From f05028642edd47f49349f10c5c8efd42c463ba00 Mon Sep 17 00:00:00 2001 From: Andy Waite Date: Fri, 11 Dec 2020 20:59:07 -0500 Subject: [PATCH 001/785] Explain use with RuboCop --- README.md | 13 +++++++++++++ prettier.gemspec | 1 + rubocop.yml | 15 +++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 rubocop.yml diff --git a/README.md b/README.md index a94be194..b467397b 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,19 @@ Or, they can be passed to `prettier` as arguments: prettier --ruby-single-quote false --write '**/*.rb' ``` +## Use with RuboCop + +RuboCop and prettier for Ruby serve different purposes, but there is overlap +with some of RuboCop's functionality. + +Prettier provides a RuboCop configuration fle to disable the rules which clash. +To enable, add the following config at the top of your project's `.rubocop.yml`: + +```yaml +inherit_gem: + prettier: rubocop.yml +``` + ## Contributing Check out our [contributing guide](CONTRIBUTING.md). Bug reports and pull requests are welcome on GitHub at https://github.com/prettier/plugin-ruby. diff --git a/prettier.gemspec b/prettier.gemspec index b07538af..ef11fdda 100644 --- a/prettier.gemspec +++ b/prettier.gemspec @@ -21,6 +21,7 @@ Gem::Specification.new do |spec| node_modules/prettier/index.js node_modules/prettier/third-party.js package.json + rubocop.yml ] end diff --git a/rubocop.yml b/rubocop.yml new file mode 100644 index 00000000..996de150 --- /dev/null +++ b/rubocop.yml @@ -0,0 +1,15 @@ +Layout: + Enabled: false + +Style/MultilineIfModifier: # clashes with rubyModifier + Enabled: false +Style/SymbolArray: # clashes with rubyArrayLiteral + Enabled: false +Style/WordArray: # clashes with rubyArrayLiteral + Enabled: false +Style/TrailingCommaInArguments: # clashes with trailingComma + Enabled: false +Style/TrailingCommaInArrayLiteral: # clashes with trailingComma + Enabled: false +Style/TrailingCommaInHashLiteral: # clashes with trailingComma + Enabled: false From e5fc67d97c6d6ab9dddae0a2e0dab1f3947ac192 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Mon, 14 Dec 2020 09:41:30 -0500 Subject: [PATCH 002/785] Move node tests into their own files --- test/js/{ => nodes}/alias.test.js | 2 +- test/js/{ => nodes}/aref.test.js | 2 +- test/js/{ => nodes}/arrays.test.js | 2 +- test/js/{ => nodes}/assign.test.js | 2 +- test/js/{ => nodes}/binary.test.js | 2 +- test/js/{ => nodes}/blocks.test.js | 2 +- test/js/{ => nodes}/break.test.js | 2 +- test/js/{ => nodes}/calls.test.js | 2 +- test/js/{ => nodes}/case.test.js | 2 +- test/js/{ => nodes}/class.test.js | 2 +- test/js/{ => nodes}/conditionals.test.js | 2 +- test/js/{ => nodes}/defined.test.js | 2 +- test/js/{ => nodes}/embdoc.test.js | 2 +- test/js/{ => nodes}/hashes.test.js | 2 +- test/js/{ => nodes}/heredocs.test.js | 2 +- test/js/{ => nodes}/hooks.test.js | 2 +- test/js/{ => nodes}/kwargs.test.js | 0 test/js/{ => nodes}/lambda.test.js | 2 +- test/js/{ => nodes}/loops.test.js | 2 +- test/js/{ => nodes}/massign.test.js | 0 test/js/{ => nodes}/method.test.js | 2 +- test/js/{ => nodes}/next.test.js | 2 +- test/js/{ => nodes}/numbers.test.js | 0 test/js/{ => nodes}/patterns.test.js | 2 +- test/js/{ => nodes}/ranges.test.js | 0 test/js/{ => nodes}/regexp.test.js | 2 +- test/js/{ => nodes}/rescue.test.js | 2 +- test/js/{ => nodes}/return.test.js | 2 +- test/js/{ => nodes}/strings.test.js | 2 +- test/js/{ => nodes}/super.test.js | 2 +- test/js/{ => nodes}/undef.test.js | 2 +- test/js/{ => nodes}/yield.test.js | 0 32 files changed, 27 insertions(+), 27 deletions(-) rename test/js/{ => nodes}/alias.test.js (97%) rename test/js/{ => nodes}/aref.test.js (94%) rename test/js/{ => nodes}/arrays.test.js (98%) rename test/js/{ => nodes}/assign.test.js (97%) rename test/js/{ => nodes}/binary.test.js (93%) rename test/js/{ => nodes}/blocks.test.js (98%) rename test/js/{ => nodes}/break.test.js (95%) rename test/js/{ => nodes}/calls.test.js (96%) rename test/js/{ => nodes}/case.test.js (97%) rename test/js/{ => nodes}/class.test.js (98%) rename test/js/{ => nodes}/conditionals.test.js (99%) rename test/js/{ => nodes}/defined.test.js (94%) rename test/js/{ => nodes}/embdoc.test.js (95%) rename test/js/{ => nodes}/hashes.test.js (99%) rename test/js/{ => nodes}/heredocs.test.js (99%) rename test/js/{ => nodes}/hooks.test.js (93%) rename test/js/{ => nodes}/kwargs.test.js (100%) rename test/js/{ => nodes}/lambda.test.js (98%) rename test/js/{ => nodes}/loops.test.js (99%) rename test/js/{ => nodes}/massign.test.js (100%) rename test/js/{ => nodes}/method.test.js (99%) rename test/js/{ => nodes}/next.test.js (94%) rename test/js/{ => nodes}/numbers.test.js (100%) rename test/js/{ => nodes}/patterns.test.js (95%) rename test/js/{ => nodes}/ranges.test.js (100%) rename test/js/{ => nodes}/regexp.test.js (97%) rename test/js/{ => nodes}/rescue.test.js (98%) rename test/js/{ => nodes}/return.test.js (97%) rename test/js/{ => nodes}/strings.test.js (99%) rename test/js/{ => nodes}/super.test.js (97%) rename test/js/{ => nodes}/undef.test.js (96%) rename test/js/{ => nodes}/yield.test.js (100%) diff --git a/test/js/alias.test.js b/test/js/nodes/alias.test.js similarity index 97% rename from test/js/alias.test.js rename to test/js/nodes/alias.test.js index 16f9c00c..f08a13c4 100644 --- a/test/js/alias.test.js +++ b/test/js/nodes/alias.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("./utils"); +const { long, ruby } = require("../utils"); describe("alias", () => { test("bare word aliases", () => expect("alias foo bar").toMatchFormat()); diff --git a/test/js/aref.test.js b/test/js/nodes/aref.test.js similarity index 94% rename from test/js/aref.test.js rename to test/js/nodes/aref.test.js index 665326b2..84b68364 100644 --- a/test/js/aref.test.js +++ b/test/js/nodes/aref.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("./utils"); +const { ruby } = require("../utils"); describe("aref", () => { test("literal reference", () => expect("array[5]").toMatchFormat()); diff --git a/test/js/arrays.test.js b/test/js/nodes/arrays.test.js similarity index 98% rename from test/js/arrays.test.js rename to test/js/nodes/arrays.test.js index 018607f2..69951163 100644 --- a/test/js/arrays.test.js +++ b/test/js/nodes/arrays.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("./utils"); +const { long, ruby } = require("../utils"); describe("array", () => { test("empty arrays", () => expect("[]").toMatchFormat()); diff --git a/test/js/assign.test.js b/test/js/nodes/assign.test.js similarity index 97% rename from test/js/assign.test.js rename to test/js/nodes/assign.test.js index d4eb8a1a..5855302c 100644 --- a/test/js/assign.test.js +++ b/test/js/nodes/assign.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("./utils"); +const { long, ruby } = require("../utils"); describe("assign", () => { describe("single assignment", () => { diff --git a/test/js/binary.test.js b/test/js/nodes/binary.test.js similarity index 93% rename from test/js/binary.test.js rename to test/js/nodes/binary.test.js index 9bf34b26..5546f7de 100644 --- a/test/js/binary.test.js +++ b/test/js/nodes/binary.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("./utils"); +const { long, ruby } = require("../utils"); describe("binary", () => { test("single line", () => expect("foo && bar && baz").toMatchFormat()); diff --git a/test/js/blocks.test.js b/test/js/nodes/blocks.test.js similarity index 98% rename from test/js/blocks.test.js rename to test/js/nodes/blocks.test.js index 64f15aae..e8015241 100644 --- a/test/js/blocks.test.js +++ b/test/js/nodes/blocks.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("./utils"); +const { long, ruby } = require("../utils"); describe("blocks", () => { test("empty", () => expect("loop {}").toMatchFormat()); diff --git a/test/js/break.test.js b/test/js/nodes/break.test.js similarity index 95% rename from test/js/break.test.js rename to test/js/nodes/break.test.js index bb87ca25..27f33a90 100644 --- a/test/js/break.test.js +++ b/test/js/nodes/break.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("./utils"); +const { ruby } = require("../utils"); describe("break", () => { test("empty break", () => expect("break").toMatchFormat()); diff --git a/test/js/calls.test.js b/test/js/nodes/calls.test.js similarity index 96% rename from test/js/calls.test.js rename to test/js/nodes/calls.test.js index cd4cf465..4be3cfdb 100644 --- a/test/js/calls.test.js +++ b/test/js/nodes/calls.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("./utils"); +const { ruby } = require("../utils"); describe("calls", () => { test("simple calls", () => { diff --git a/test/js/case.test.js b/test/js/nodes/case.test.js similarity index 97% rename from test/js/case.test.js rename to test/js/nodes/case.test.js index ac4ec173..a4a4bf22 100644 --- a/test/js/case.test.js +++ b/test/js/nodes/case.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("./utils"); +const { long, ruby } = require("../utils"); describe("case", () => { test("empty case", () => { diff --git a/test/js/class.test.js b/test/js/nodes/class.test.js similarity index 98% rename from test/js/class.test.js rename to test/js/nodes/class.test.js index 781e1a34..314e70b2 100644 --- a/test/js/class.test.js +++ b/test/js/nodes/class.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("./utils"); +const { long, ruby } = require("../utils"); describe("class", () => { test("basic nesting", () => { diff --git a/test/js/conditionals.test.js b/test/js/nodes/conditionals.test.js similarity index 99% rename from test/js/conditionals.test.js rename to test/js/nodes/conditionals.test.js index abeb65b7..08e80002 100644 --- a/test/js/conditionals.test.js +++ b/test/js/nodes/conditionals.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("./utils"); +const { long, ruby } = require("../utils"); describe("conditionals", () => { describe("not operator", () => { diff --git a/test/js/defined.test.js b/test/js/nodes/defined.test.js similarity index 94% rename from test/js/defined.test.js rename to test/js/nodes/defined.test.js index daa15574..be9a80ba 100644 --- a/test/js/defined.test.js +++ b/test/js/nodes/defined.test.js @@ -1,4 +1,4 @@ -const { long } = require("./utils"); +const { long } = require("../utils"); describe("defined", () => { test("no parens", () => expect("defined? a").toChangeFormat("defined?(a)")); diff --git a/test/js/embdoc.test.js b/test/js/nodes/embdoc.test.js similarity index 95% rename from test/js/embdoc.test.js rename to test/js/nodes/embdoc.test.js index 3b74b121..85bb8c17 100644 --- a/test/js/embdoc.test.js +++ b/test/js/nodes/embdoc.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("./utils"); +const { ruby } = require("../utils"); describe("embdoc", () => { test("basic embdocs", () => { diff --git a/test/js/hashes.test.js b/test/js/nodes/hashes.test.js similarity index 99% rename from test/js/hashes.test.js rename to test/js/nodes/hashes.test.js index ff0a132f..b5b098b6 100644 --- a/test/js/hashes.test.js +++ b/test/js/nodes/hashes.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("./utils"); +const { long, ruby } = require("../utils"); describe("hash", () => { test("empty", () => expect("{}").toMatchFormat()); diff --git a/test/js/heredocs.test.js b/test/js/nodes/heredocs.test.js similarity index 99% rename from test/js/heredocs.test.js rename to test/js/nodes/heredocs.test.js index 0c4b1432..8a8a704c 100644 --- a/test/js/heredocs.test.js +++ b/test/js/nodes/heredocs.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("./utils"); +const { long, ruby } = require("../utils"); describe("heredocs", () => { describe("straight", () => { diff --git a/test/js/hooks.test.js b/test/js/nodes/hooks.test.js similarity index 93% rename from test/js/hooks.test.js rename to test/js/nodes/hooks.test.js index b29d195f..b6475a8b 100644 --- a/test/js/hooks.test.js +++ b/test/js/nodes/hooks.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("./utils"); +const { long, ruby } = require("../utils"); describe.each(["BEGIN", "END"])("%s hook", (hook) => { test("shortens to one line", () => diff --git a/test/js/kwargs.test.js b/test/js/nodes/kwargs.test.js similarity index 100% rename from test/js/kwargs.test.js rename to test/js/nodes/kwargs.test.js diff --git a/test/js/lambda.test.js b/test/js/nodes/lambda.test.js similarity index 98% rename from test/js/lambda.test.js rename to test/js/nodes/lambda.test.js index b6bc15a7..1427a793 100644 --- a/test/js/lambda.test.js +++ b/test/js/nodes/lambda.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("./utils"); +const { long, ruby } = require("../utils"); describe("lambda", () => { test("plain stabby lambda literal", () => expect("-> { 1 }").toMatchFormat()); diff --git a/test/js/loops.test.js b/test/js/nodes/loops.test.js similarity index 99% rename from test/js/loops.test.js rename to test/js/nodes/loops.test.js index ed8c973b..4d1ac29a 100644 --- a/test/js/loops.test.js +++ b/test/js/nodes/loops.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("./utils"); +const { long, ruby } = require("../utils"); describe.each(["while", "until"])("%s", (keyword) => { test("aligns predicates", () => diff --git a/test/js/massign.test.js b/test/js/nodes/massign.test.js similarity index 100% rename from test/js/massign.test.js rename to test/js/nodes/massign.test.js diff --git a/test/js/method.test.js b/test/js/nodes/method.test.js similarity index 99% rename from test/js/method.test.js rename to test/js/nodes/method.test.js index 008f6a30..82d6c4c6 100644 --- a/test/js/method.test.js +++ b/test/js/nodes/method.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("./utils"); +const { long, ruby } = require("../utils"); describe("method", () => { describe("definitions", () => { diff --git a/test/js/next.test.js b/test/js/nodes/next.test.js similarity index 94% rename from test/js/next.test.js rename to test/js/nodes/next.test.js index 233f296f..f45a4f7a 100644 --- a/test/js/next.test.js +++ b/test/js/nodes/next.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("./utils"); +const { ruby } = require("../utils"); describe("next", () => { test("bare", () => expect("next").toMatchFormat()); diff --git a/test/js/numbers.test.js b/test/js/nodes/numbers.test.js similarity index 100% rename from test/js/numbers.test.js rename to test/js/nodes/numbers.test.js diff --git a/test/js/patterns.test.js b/test/js/nodes/patterns.test.js similarity index 95% rename from test/js/patterns.test.js rename to test/js/nodes/patterns.test.js index b584508e..8b6d3ea4 100644 --- a/test/js/patterns.test.js +++ b/test/js/nodes/patterns.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("./utils"); +const { ruby } = require("../utils"); describe("patterns", () => { if (process.env.RUBY_VERSION <= "2.7") { diff --git a/test/js/ranges.test.js b/test/js/nodes/ranges.test.js similarity index 100% rename from test/js/ranges.test.js rename to test/js/nodes/ranges.test.js diff --git a/test/js/regexp.test.js b/test/js/nodes/regexp.test.js similarity index 97% rename from test/js/regexp.test.js rename to test/js/nodes/regexp.test.js index df9f6f82..bca8a319 100644 --- a/test/js/regexp.test.js +++ b/test/js/nodes/regexp.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("./utils"); +const { ruby } = require("../utils"); describe("regexp", () => { test("basic", () => expect("/abc/").toMatchFormat()); diff --git a/test/js/rescue.test.js b/test/js/nodes/rescue.test.js similarity index 98% rename from test/js/rescue.test.js rename to test/js/nodes/rescue.test.js index 244cfecd..b8fd3dd4 100644 --- a/test/js/rescue.test.js +++ b/test/js/nodes/rescue.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("./utils"); +const { ruby } = require("../utils"); describe("rescue", () => { test("inline", () => diff --git a/test/js/return.test.js b/test/js/nodes/return.test.js similarity index 97% rename from test/js/return.test.js rename to test/js/nodes/return.test.js index a2377b89..e7148313 100644 --- a/test/js/return.test.js +++ b/test/js/nodes/return.test.js @@ -1,4 +1,4 @@ -const { long } = require("./utils"); +const { long } = require("../utils"); describe("return", () => { test("bare", () => expect("return").toMatchFormat()); diff --git a/test/js/strings.test.js b/test/js/nodes/strings.test.js similarity index 99% rename from test/js/strings.test.js rename to test/js/nodes/strings.test.js index 6dae6263..5d1dac49 100644 --- a/test/js/strings.test.js +++ b/test/js/nodes/strings.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("./utils"); +const { long, ruby } = require("../utils"); describe("strings", () => { describe("%-literals with escape sequences in the middle", () => { diff --git a/test/js/super.test.js b/test/js/nodes/super.test.js similarity index 97% rename from test/js/super.test.js rename to test/js/nodes/super.test.js index 8fda3c71..d094ef7a 100644 --- a/test/js/super.test.js +++ b/test/js/nodes/super.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("./utils"); +const { ruby } = require("../utils"); describe("super", () => { test("bare", () => expect("super").toMatchFormat()); diff --git a/test/js/undef.test.js b/test/js/nodes/undef.test.js similarity index 96% rename from test/js/undef.test.js rename to test/js/nodes/undef.test.js index e1c60b71..6eab3d56 100644 --- a/test/js/undef.test.js +++ b/test/js/nodes/undef.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("./utils"); +const { long, ruby } = require("../utils"); describe("undef", () => { test("single inline", () => expect("undef foo").toMatchFormat()); diff --git a/test/js/yield.test.js b/test/js/nodes/yield.test.js similarity index 100% rename from test/js/yield.test.js rename to test/js/nodes/yield.test.js From 878ad8fce8defeca88da7b75323b6223366b7c2f Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Mon, 14 Dec 2020 09:49:14 -0500 Subject: [PATCH 003/785] Support prettier-ignore --- CHANGELOG.md | 4 ++++ src/printer.js | 13 +++++++++++++ test/js/ignore.test.js | 12 ++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 test/js/ignore.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index feb9efe7..83eac926 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Added + +- [@kddeisz] - Now that the comments are all fixed up, we can support `# prettier-ignore` comments. + ## [1.0.1] - 2020-12-12 ### Changed diff --git a/src/printer.js b/src/printer.js index 7588b127..a6b600da 100644 --- a/src/printer.js +++ b/src/printer.js @@ -20,6 +20,18 @@ function printNode(path, opts, print) { throw new Error(`Unsupported node encountered: ${type}\n${ast}`); } +// This is an escape-hatch to ignore nodes in the tree. If you have a comment +// that includes this pattern, then the entire node will be ignored and just the +// original source will be printed out. +function hasPrettierIgnore(path) { + const node = path.getValue(); + + return ( + node.comments && + node.comments.some((comment) => comment.value.includes("prettier-ignore")) + ); +} + const noComments = [ "args", "args_add_block", @@ -83,6 +95,7 @@ function isBlockComment(comment) { module.exports = { embed, print: printNode, + hasPrettierIgnore, canAttachComment, getCommentChildNodes, printComment, diff --git a/test/js/ignore.test.js b/test/js/ignore.test.js new file mode 100644 index 00000000..e37939a1 --- /dev/null +++ b/test/js/ignore.test.js @@ -0,0 +1,12 @@ +const { ruby } = require("./utils"); + +describe("ignore", () => { + test("you can ignore code blocks", () => { + const content = ruby(` + # prettier-ignore + class Foo; def bar; 1+1+1; end; end + `); + + return expect(content).toMatchFormat(); + }); +}); From 432da99f643bf1dffa99b54a1b28463ecdca72da Mon Sep 17 00:00:00 2001 From: Yukito Ito Date: Mon, 14 Dec 2020 21:34:07 +0900 Subject: [PATCH 004/785] Do not change if regexp literal body has braces --- src/nodes/regexp.js | 19 +++++++++++++++++++ src/parser.rb | 4 +++- test/js/nodes/regexp.test.js | 8 ++++++++ test/rb/metadata_test.rb | 8 ++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/src/nodes/regexp.js b/src/nodes/regexp.js index 39927ab6..972c675c 100644 --- a/src/nodes/regexp.js +++ b/src/nodes/regexp.js @@ -26,6 +26,16 @@ function shouldUseBraces(path) { ); } +function hasBrace(path) { + const node = path.getValue(); + + return node.body.some( + (child) => + isStringContent(child) && + (child.body.includes("{") || child.body.includes("}")) + ); +} + // This function is responsible for printing out regexp_literal nodes. They can // either use the special %r literal syntax or they can use forward slashes. At // the end of either of those they can have modifiers like m or x that have @@ -37,6 +47,15 @@ function printRegexpLiteral(path, opts, print) { const node = path.getValue(); const useBraces = shouldUseBraces(path); + if (useBraces && hasBrace(path)) { + // noop + // NG: %r(test{test) => %r{test{test} + const parts = [node.beginning] + .concat(path.map(print, "body")) + .concat([node.ending]); + return concat(parts); + } + const parts = [useBraces ? "%r{" : "/"] .concat(path.map(print, "body")) .concat([useBraces ? "}" : "/", node.ending.slice(1)]); diff --git a/src/parser.rb b/src/parser.rb index c39ceacd..0a793687 100755 --- a/src/parser.rb +++ b/src/parser.rb @@ -1719,7 +1719,9 @@ def on_redo # expression literal, like /foo/. It can be followed by any number of # regexp_add events, which we'll append onto an array body. def on_regexp_new - find_scanner_event(:@regexp_beg).merge!(type: :regexp, body: []) + regexp_beg = find_scanner_event(:@regexp_beg) + beginning = regexp_beg[:body] + regexp_beg.merge!(type: :regexp, body: [], beginning: beginning) end # regexp_add is a parser event that represents a piece of a regular diff --git a/test/js/nodes/regexp.test.js b/test/js/nodes/regexp.test.js index bca8a319..5e83c359 100644 --- a/test/js/nodes/regexp.test.js +++ b/test/js/nodes/regexp.test.js @@ -21,6 +21,14 @@ describe("regexp", () => { test("global interpolation", () => expect("/#$&/").toChangeFormat("/#{$&}/")); + test("do not change if { and / in regexp literal", () => + expect("%r(a{b/c)").toMatchFormat()); + + test("do not change if } and / in regexp literal", () => + expect("%r[a}b/c]").toMatchFormat()); + + test("parens with }", () => expect("%r(a}bc)").toChangeFormat("/a}bc/")); + test("comments in regex", () => { const content = ruby(` /\\A diff --git a/test/rb/metadata_test.rb b/test/rb/metadata_test.rb index dea004d9..e3c55119 100644 --- a/test/rb/metadata_test.rb +++ b/test/rb/metadata_test.rb @@ -556,6 +556,14 @@ def test_redo def test_regexp_literal assert_metadata :regexp_literal, '/foo/' assert_metadata :regexp_literal, '%r{foo}' + assert_metadata :regexp_literal, '%r(foo)' + + assert_node_metadata( + :regexp_literal, + parse('%r(foo)'), + beginning: '%r(', + ending: ')' + ) end def test_rescue From 981157927aae5b0efa7ed2012748921d4688b512 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Mon, 14 Dec 2020 12:27:41 -0500 Subject: [PATCH 005/785] Async parser for test code --- package.json | 2 + test/js/globalSetup.js | 14 ++++++ test/js/globalTeardown.js | 7 +++ test/js/parser.rb | 52 +++++++++++++-------- test/js/setupTests.js | 96 +++++++++++++++++++++------------------ 5 files changed, 108 insertions(+), 63 deletions(-) create mode 100644 test/js/globalSetup.js create mode 100644 test/js/globalTeardown.js diff --git a/package.json b/package.json index d4fc7684..234c6078 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,8 @@ } }, "jest": { + "globalSetup": "./test/js/globalSetup.js", + "globalTeardown": "./test/js/globalTeardown.js", "setupFilesAfterEnv": [ "./test/js/setupTests.js" ], diff --git a/test/js/globalSetup.js b/test/js/globalSetup.js new file mode 100644 index 00000000..ca84779d --- /dev/null +++ b/test/js/globalSetup.js @@ -0,0 +1,14 @@ +const { spawn, spawnSync } = require("child_process"); + +// Set a RUBY_VERSION environment variable because certain tests will only run +// for certain versions of Ruby. +const args = ["--disable-gems", "-e", "puts RUBY_VERSION"]; +process.env.RUBY_VERSION = spawnSync("ruby", args).stdout.toString().trim(); + +function globalSetup() { + // Spawn the async parser process so that tests can send their content over to + // it to get back the AST. + global.__ASYNC_PARSER__ = spawn("ruby", ["./test/js/parser.rb"]); +} + +module.exports = globalSetup; diff --git a/test/js/globalTeardown.js b/test/js/globalTeardown.js new file mode 100644 index 00000000..b5648b04 --- /dev/null +++ b/test/js/globalTeardown.js @@ -0,0 +1,7 @@ +function globalTeardown() { + // Send a SIGINT over to the async parser process so that we can be sure we've + // terminated it before we finish the test suite. + global.__ASYNC_PARSER__.kill("SIGINT"); +} + +module.exports = globalTeardown; diff --git a/test/js/parser.rb b/test/js/parser.rb index 44d3ae4b..924e4624 100644 --- a/test/js/parser.rb +++ b/test/js/parser.rb @@ -1,29 +1,43 @@ # frozen_string_literal: true +require 'socket' require_relative '../../src/parser' -# This function will poll $stdin for 2 seconds and attempt to gather up every -# line until it hits a "---" line. At that point it will return everything -# joined together. If it does not receive input within 2 seconds, it will bail -# out and return `nil`. -def gather - return unless select([$stdin], nil, nil, 2) +# Set the program name so that it's easy to find if we need it +$PROGRAM_NAME = 'prettier-ruby-test-parser' - lines, line = [], nil - while (line = gets) != "---\n" - lines << line - end - lines.join -end +# Make sure we trap these signals to be sure we get the quit command coming from +# the parent node process +quit = false +trap(:QUIT) { quit = true } +trap(:INT) { quit = true } +trap(:TERM) { quit = true } + +server = TCPServer.new(22_020) -# This process will loop infinitely, gathering up lines from stdin, parsing them -# with Prettier::Parser, and then returning the parsed AST over stdout. loop do - gathered = gather - next unless gathered + break if quit + + # Start up a new thread that will handle each successive connection. + Thread.new(server.accept_nonblock) do |socket| + source = socket.readpartial(10 * 1024 * 1024) - parser = Prettier::Parser.new(gathered) + builder = Prettier::Parser.new(source.force_encoding('UTF-8')) + response = builder.parse + + if !response || builder.error? + socket.puts('{ "error": true }') + else + socket.puts(JSON.fast_generate(response)) + end + + socket.close + end +rescue IO::WaitReadable, Errno::EINTR + # Wait for select(2) to give us a connection that has content for 1 second. + # Otherwise timeout and continue on (so that we hit our "break if quit" + # pretty often). + IO.select([server], nil, nil, 1) - STDOUT.puts JSON.fast_generate(parser.parse) - STDOUT.flush + retry unless quit end diff --git a/test/js/setupTests.js b/test/js/setupTests.js index 2045f29c..2dbe0a9b 100644 --- a/test/js/setupTests.js +++ b/test/js/setupTests.js @@ -1,61 +1,69 @@ -const { spawn, spawnSync } = require("child_process"); +const net = require("net"); const path = require("path"); const prettier = require("prettier"); -const readline = require("readline"); - -// Set RUBY_VERSION so certain tests only run for certain versions -const args = ["--disable-gems", "-e", "puts RUBY_VERSION"]; -process.env.RUBY_VERSION = spawnSync("ruby", args).stdout.toString().trim(); // eslint-disable-next-line no-underscore-dangle const { formatAST } = prettier.__debug; -const parser = spawn("ruby", ["./test/js/parser.rb"]); +function parseAsync(text) { + return new Promise((resolve, reject) => { + const client = new net.Socket(); -const rl = readline.createInterface({ - input: parser.stdout, - output: parser.stdin -}); + client.setTimeout(10 * 1000, () => { + client.destroy(); + reject(new Error("Connection to the server timed out.")); + }); -afterAll(() => { - rl.close(); - parser.stdin.pause(); - parser.kill("SIGINT"); -}); + client.on("error", (error) => { + client.destroy(); + reject(error); + }); + + client.on("end", () => { + client.destroy(); + reject(new Error("Server closed the connection.")); + }); -const realFormat = (content, config = {}) => - prettier.format( - content, - Object.assign( - { parser: "ruby", plugins: ["."], originalText: content }, - config - ) + client.on("data", (data) => { + client.destroy(); + resolve(JSON.parse(data.toString())); + }); + + client.connect({ port: 22020 }, () => { + client.end(text); + }); + }); +} + +function checkFormat(before, after, config) { + const opts = Object.assign( + { parser: "ruby", plugins: ["."], originalText: before }, + config ); -const checkFormat = (before, after, config) => - new Promise((resolve) => { + return new Promise((resolve, reject) => { if (before.includes("#") || before.includes("=begin")) { // If the source includes an #, then this test has a comment in it. - // Unfortunately, formatAST ignores comments and doesn't parse them at - // all, so we can't call it and check against the output. In this case, - // we need to instead go through the normal format function and spawn a - // process. - resolve(realFormat(before, config)); + // Unfortunately, formatAST expects comments to already be attached, but + // prettier doesn't export anything that allows you to hook into their + // attachComments function. So in this case, we need to instead go through + // the normal format function and spawn a process. + resolve(prettier.format(before, opts)); } else { - const opts = Object.assign( - { parser: "ruby", plugins: ["."], originalText: before }, - config - ); - - rl.question(`${before}\n---\n`, (response) => { - const { formatted } = formatAST(JSON.parse(response), opts); - resolve(formatted); - }); + parseAsync(before) + .then((ast) => resolve(formatAST(ast, opts).formatted)) + .catch(reject); } - }).then((formatted) => ({ - pass: formatted === `${after}\n`, - message: () => `Expected:\n${after}\nReceived:\n${formatted}` - })); + }) + .then((formatted) => ({ + pass: formatted === `${after}\n`, + message: () => `Expected:\n${after}\nReceived:\n${formatted}` + })) + .catch((error) => ({ + pass: false, + message: () => error.message + })); +} expect.extend({ toChangeFormat(before, after, config = {}) { @@ -69,7 +77,7 @@ expect.extend({ let error = null; try { - realFormat(before); + prettier.format(before, { parser: "ruby", plugins: ["."] }); } catch (caught) { error = caught; pass = caught.message === message; From 278ad65856ce1de9da56bb2ad69bc64bfc13c789 Mon Sep 17 00:00:00 2001 From: Andy Waite Date: Mon, 14 Dec 2020 22:16:16 -0500 Subject: [PATCH 006/785] Update README.md Co-authored-by: Kevin Deisz --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b467397b..50fab03c 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ prettier --ruby-single-quote false --write '**/*.rb' ## Use with RuboCop -RuboCop and prettier for Ruby serve different purposes, but there is overlap +RuboCop and Prettier for Ruby serve different purposes, but there is overlap with some of RuboCop's functionality. Prettier provides a RuboCop configuration fle to disable the rules which clash. From 80cd32c0825b3f7ba422097be0ca442a2931c973 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 18 Dec 2020 22:03:29 +0000 Subject: [PATCH 007/785] Bump eslint from 7.15.0 to 7.16.0 Bumps [eslint](https://github.com/eslint/eslint) from 7.15.0 to 7.16.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v7.15.0...v7.16.0) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 83 +++++++++++++++++-------------------------------------- 1 file changed, 26 insertions(+), 57 deletions(-) diff --git a/yarn.lock b/yarn.lock index 85f6eecf..c4d04e81 100644 --- a/yarn.lock +++ b/yarn.lock @@ -631,7 +631,7 @@ acorn@^7.1.1, acorn@^7.4.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4: +ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -669,17 +669,12 @@ ansi-escapes@^4.2.1: dependencies: type-fest "^0.11.0" -ansi-regex@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" - integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== - ansi-regex@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== -ansi-styles@^3.2.0, ansi-styles@^3.2.1: +ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== @@ -768,10 +763,10 @@ assign-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= -astral-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" - integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== +astral-regex@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" + integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== async@^3.0.1: version "3.2.0" @@ -1303,11 +1298,6 @@ emittery@^0.7.1: resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.7.2.tgz#25595908e13af0f5674ab419396e2fb394cdfa82" integrity sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ== -emoji-regex@^7.0.1: - version "7.0.3" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" - integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== - emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" @@ -1387,9 +1377,9 @@ eslint-visitor-keys@^2.0.0: integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== eslint@^7.8.1: - version "7.15.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.15.0.tgz#eb155fb8ed0865fcf5d903f76be2e5b6cd7e0bc7" - integrity sha512-Vr64xFDT8w30wFll643e7cGrIkPEU50yIiI36OdSIDoSGguIeaLzBo0vpGvzo9RECUqq7htURfwEtKqwytkqzA== + version "7.16.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.16.0.tgz#a761605bf9a7b32d24bb7cde59aeb0fd76f06092" + integrity sha512-iVWPS785RuDA4dWuhhgXTNrGxHHK3a8HLSMBgbbU59ruJDubUraXN8N5rn7kb8tG6sjg74eE0RA3YWT51eusEw== dependencies: "@babel/code-frame" "^7.0.0" "@eslint/eslintrc" "^0.2.2" @@ -1425,7 +1415,7 @@ eslint@^7.8.1: semver "^7.2.1" strip-ansi "^6.0.0" strip-json-comments "^3.1.0" - table "^5.2.3" + table "^6.0.4" text-table "^0.2.0" v8-compile-cache "^2.0.3" @@ -2072,11 +2062,6 @@ is-extglob@^2.1.1: resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - is-fullwidth-code-point@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" @@ -2759,7 +2744,7 @@ lodash.sortby@^4.7.0: resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= -lodash@^4.11.2, lodash@^4.17.14, lodash@^4.17.19: +lodash@^4.11.2, lodash@^4.17.19, lodash@^4.17.20: version "4.17.20" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== @@ -3579,14 +3564,14 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -slice-ansi@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" - integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== +slice-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" + integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== dependencies: - ansi-styles "^3.2.0" - astral-regex "^1.0.0" - is-fullwidth-code-point "^2.0.0" + ansi-styles "^4.0.0" + astral-regex "^2.0.0" + is-fullwidth-code-point "^3.0.0" snapdragon-node@^2.0.1: version "2.1.1" @@ -3738,15 +3723,6 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -string-width@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" - integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== - dependencies: - emoji-regex "^7.0.1" - is-fullwidth-code-point "^2.0.0" - strip-ansi "^5.1.0" - string-width@^4.1.0, string-width@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" @@ -3756,13 +3732,6 @@ string-width@^4.1.0, string-width@^4.2.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.0" -strip-ansi@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== - dependencies: - ansi-regex "^4.1.0" - strip-ansi@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" @@ -3817,15 +3786,15 @@ symbol-tree@^3.2.4: resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== -table@^5.2.3: - version "5.4.6" - resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" - integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== +table@^6.0.4: + version "6.0.4" + resolved "https://registry.yarnpkg.com/table/-/table-6.0.4.tgz#c523dd182177e926c723eb20e1b341238188aa0d" + integrity sha512-sBT4xRLdALd+NFBvwOz8bw4b15htyythha+q+DVZqy2RS08PPC8O2sZFgJYEY7bJvbCFKccs+WIZ/cd+xxTWCw== dependencies: - ajv "^6.10.2" - lodash "^4.17.14" - slice-ansi "^2.1.0" - string-width "^3.0.0" + ajv "^6.12.4" + lodash "^4.17.20" + slice-ansi "^4.0.0" + string-width "^4.2.0" terminal-link@^2.0.0: version "2.1.1" From 4d0306e0b4545044ed072797a1f4c57d75fede2d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 18 Dec 2020 23:30:49 +0000 Subject: [PATCH 008/785] Bump eslint-config-prettier from 7.0.0 to 7.1.0 Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 7.0.0 to 7.1.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/v7.0.0...v7.1.0) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 85f6eecf..e5188a1f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1357,9 +1357,9 @@ escodegen@^1.14.1: source-map "~0.6.1" eslint-config-prettier@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-7.0.0.tgz#c1ae4106f74e6c0357f44adb076771d032ac0e97" - integrity sha512-8Y8lGLVPPZdaNA7JXqnvETVC7IiVRgAP6afQu9gOQRn90YY3otMNh+x7Vr2vMePQntF+5erdSUBqSzCmU/AxaQ== + version "7.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-7.1.0.tgz#5402eb559aa94b894effd6bddfa0b1ca051c858f" + integrity sha512-9sm5/PxaFG7qNJvJzTROMM1Bk1ozXVTKI0buKOyb0Bsr1hrwi0H/TzxF/COtf1uxikIK8SwhX7K6zg78jAzbeA== eslint-scope@^5.1.1: version "5.1.1" From 8c2ff277330fce5bf05212964b150c72506da482 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sat, 19 Dec 2020 18:10:58 -0500 Subject: [PATCH 009/785] Special call syntax --- CHANGELOG.md | 3 +++ src/nodes/calls.js | 22 ++++++++++++++++++++-- test/js/nodes/calls.test.js | 6 ++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83eac926..dca843f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Added - [@kddeisz] - Now that the comments are all fixed up, we can support `# prettier-ignore` comments. +- [@rindek], [@kddeisz] - Do not remove parentheses when receiver looks like a constant. +- [@rindek], [@kddeisz] - Do not remove parentheses when using the special `call` syntax with no arguments. ## [1.0.1] - 2020-12-12 @@ -1063,6 +1065,7 @@ would previously result in `array[]`, but now prints properly. [@overload119]: https://github.com/Overload119 [@petevk]: https://github.com/petevk [@pje]: https://github.com/pje +[@rindek]: https://github.com/rindek [@rosskinsella]: https://github.com/RossKinsella [@rsullivan00]: https://github.com/Rsullivan00 [@ryan-hunter-pc]: https://github.com/ryan-hunter-pc diff --git a/src/nodes/calls.js b/src/nodes/calls.js index 1ec3a7fd..6e55b43b 100644 --- a/src/nodes/calls.js +++ b/src/nodes/calls.js @@ -62,13 +62,31 @@ function printCall(path, opts, print) { function printMethodAddArg(path, opts, print) { const node = path.getValue(); - const argNode = node.body[1]; + const [methodNode, argNode] = node.body; const [methodDoc, argsDoc] = path.map(print, "body"); // You can end up here if you have a method with a ? ending, presumably - // because the parser knows that it cannot be a local variable. + // because the parser knows that it cannot be a local variable. You can also + // end up here if you are explicitly using an empty set of parentheses. if (argsDoc.length === 0) { + // If you're using an explicit set of parentheses on something that looks + // like a constant, then we need to match that in order to maintain valid + // Ruby. For example, you could do something like Foo(), on which we would + // need to keep the parentheses to make it look like a method call. + if (methodNode.type === "fcall" && methodNode.body[0].type === "@const") { + return concat([methodDoc, "()"]); + } + + // If you're using an explicit set parentheses with the special call syntax, + // then we need to explicitly print out an extra set of parentheses. For + // example, if you call something like Foo.new.() (implicitly calling the + // #call method on a new instance of the Foo class), then we have to print + // out those parentheses, otherwise we'll end up with Foo.new. + if (methodNode.type === "call" && methodNode.body[2] === "call") { + return concat([methodDoc, "()"]); + } + return methodDoc; } diff --git a/test/js/nodes/calls.test.js b/test/js/nodes/calls.test.js index 4be3cfdb..bb821ed8 100644 --- a/test/js/nodes/calls.test.js +++ b/test/js/nodes/calls.test.js @@ -40,4 +40,10 @@ describe("calls", () => { test("double bang with a special operator", () => expect("!!object&.topic_list").toMatchFormat()); + + test("#call shorthand does not eliminate empty parentheses", () => + expect("Foo.new.()").toMatchFormat()); + + test("methods that look like constants do not eliminate empty parens", () => + expect("Foo()").toMatchFormat()); }); From 282ed6b48d18be6ac641e79e3acc3d0d4353464a Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sat, 19 Dec 2020 18:12:40 -0500 Subject: [PATCH 010/785] Add @rindek as a contributor --- .all-contributorsrc | 9 +++++++++ README.md | 1 + 2 files changed, 10 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index b682e125..0dc380ea 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -481,6 +481,15 @@ "contributions": [ "bug" ] + }, + { + "login": "rindek", + "name": "Jacek Jakubik", + "avatar_url": "https://avatars1.githubusercontent.com/u/881209?v=4", + "profile": "https://github.com/rindek", + "contributions": [ + "bug" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index a94be194..784358a5 100644 --- a/README.md +++ b/README.md @@ -227,6 +227,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Matt McNeil

🐛
John Snyder

🐛 +
Jacek Jakubik

🐛 From 0ded6fa8d71964f32c13a2941da2099ffd929994 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sat, 19 Dec 2020 18:19:57 -0500 Subject: [PATCH 011/785] Add dependabot config --- .github/dependabot.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..f7068438 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" + - package-ecosystem: "bundler" + directory: "/" + schedule: + interval: "daily" From afb687fc660b0182a81ec15f19dc7b6c0f2ce543 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 19 Dec 2020 23:22:58 +0000 Subject: [PATCH 012/785] Bump eslint-config-prettier from 7.0.0 to 7.1.0 Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 7.0.0 to 7.1.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/v7.0.0...v7.1.0) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index c4d04e81..32c96191 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1347,9 +1347,9 @@ escodegen@^1.14.1: source-map "~0.6.1" eslint-config-prettier@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-7.0.0.tgz#c1ae4106f74e6c0357f44adb076771d032ac0e97" - integrity sha512-8Y8lGLVPPZdaNA7JXqnvETVC7IiVRgAP6afQu9gOQRn90YY3otMNh+x7Vr2vMePQntF+5erdSUBqSzCmU/AxaQ== + version "7.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-7.1.0.tgz#5402eb559aa94b894effd6bddfa0b1ca051c858f" + integrity sha512-9sm5/PxaFG7qNJvJzTROMM1Bk1ozXVTKI0buKOyb0Bsr1hrwi0H/TzxF/COtf1uxikIK8SwhX7K6zg78jAzbeA== eslint-scope@^5.1.1: version "5.1.1" From 6268d3c74c37352183971f103ea419e172ed1350 Mon Sep 17 00:00:00 2001 From: Igor Victor Date: Sun, 20 Dec 2020 17:34:27 +0100 Subject: [PATCH 013/785] Update main.yml --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cdfaf443..79952699 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,6 +13,7 @@ jobs: - "2.5" - "2.6" - "2.7" + - truffleruby-head env: CI: true steps: @@ -69,4 +70,4 @@ jobs: repo: context.payload.repository.name, pull_number: context.payload.pull_request.number }) - \ No newline at end of file + From 9ecb22ac6fadcefa6af6d763fd0cdb5e1d80641d Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sun, 20 Dec 2020 13:22:17 -0500 Subject: [PATCH 014/785] Add @ykpythemind as a contributor --- .all-contributorsrc | 10 +++++++ CHANGELOG.md | 5 ++++ README.md | 1 + src/nodes/regexp.js | 66 +++++++++++++++++++-------------------------- src/parser.rb | 5 ++-- 5 files changed, 45 insertions(+), 42 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 0dc380ea..ab0e2823 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -490,6 +490,16 @@ "contributions": [ "bug" ] + }, + { + "login": "ykpythemind", + "name": "Yukito Ito", + "avatar_url": "https://avatars2.githubusercontent.com/u/22209702?v=4", + "profile": "https://twitter.com/ykpythemind", + "contributions": [ + "bug", + "code" + ] } ], "contributorsPerLine": 7, diff --git a/CHANGELOG.md b/CHANGELOG.md index dca843f6..4f9a3545 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,8 +9,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Added - [@kddeisz] - Now that the comments are all fixed up, we can support `# prettier-ignore` comments. + +### Changed + - [@rindek], [@kddeisz] - Do not remove parentheses when receiver looks like a constant. - [@rindek], [@kddeisz] - Do not remove parentheses when using the special `call` syntax with no arguments. +- [@ykpythemind] - Do not change regexp bounds if the body has certain content. ## [1.0.1] - 2020-12-12 @@ -1075,4 +1079,5 @@ would previously result in `array[]`, but now prints properly. [@tobyndockerill]: https://github.com/tobyndockerill [@uri]: https://github.com/uri [@xipgroc]: https://github.com/xipgroc +[@ykpythemind]: https://github.com/ykpythemind [@yuki24]: https://github.com/yuki24 diff --git a/README.md b/README.md index 784358a5..408196c9 100644 --- a/README.md +++ b/README.md @@ -228,6 +228,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Matt McNeil

🐛
John Snyder

🐛
Jacek Jakubik

🐛 +
Yukito Ito

🐛 💻 diff --git a/src/nodes/regexp.js b/src/nodes/regexp.js index 972c675c..1272536b 100644 --- a/src/nodes/regexp.js +++ b/src/nodes/regexp.js @@ -1,38 +1,25 @@ const { concat } = require("../prettier"); const { hasAncestor } = require("../utils"); -function isStringContent(node) { - return node.type === "@tstring_content"; -} - -function shouldUseBraces(path) { - const node = path.getValue(); - const first = node.body[0]; - - // If the first part of this regex is plain string content and we have a - // space or an =, then we want to use braces because otherwise we could end up - // with an ambiguous operator, e.g. foo / bar/ or foo /=bar/ - if ( - first && - isStringContent(first) && - [" ", "="].includes(first.body[0]) && - hasAncestor(path, ["command", "command_call"]) - ) { - return true; - } - +function hasContent(node, pattern) { return node.body.some( - (child) => isStringContent(child) && child.body.includes("/") + (child) => child.type === "@tstring_content" && pattern.test(child.body) ); } -function hasBrace(path) { +// If the first part of this regex is plain string content, we have a space +// or an =, and we're contained within a command or command_call node, then we +// want to use braces because otherwise we could end up with an ambiguous +// operator, e.g. foo / bar/ or foo /=bar/ +function forwardSlashIsAmbiguous(path) { const node = path.getValue(); + const firstChildNode = node.body[0]; - return node.body.some( - (child) => - isStringContent(child) && - (child.body.includes("{") || child.body.includes("}")) + return ( + firstChildNode && + firstChildNode.type === "@tstring_content" && + [" ", "="].includes(firstChildNode.body[0]) && + hasAncestor(path, ["command", "command_call"]) ); } @@ -45,22 +32,23 @@ function hasBrace(path) { // itself. In that case we switch over to using %r with braces. function printRegexpLiteral(path, opts, print) { const node = path.getValue(); - const useBraces = shouldUseBraces(path); + const docs = path.map(print, "body"); - if (useBraces && hasBrace(path)) { - // noop - // NG: %r(test{test) => %r{test{test} - const parts = [node.beginning] - .concat(path.map(print, "body")) - .concat([node.ending]); - return concat(parts); - } + // We should use braces if using a forward slash would be ambiguous in the + // current context or if there's a forward slash in the content of the regexp. + const useBraces = forwardSlashIsAmbiguous(path) || hasContent(node, /\//); - const parts = [useBraces ? "%r{" : "/"] - .concat(path.map(print, "body")) - .concat([useBraces ? "}" : "/", node.ending.slice(1)]); + // If we should be using braces but we have braces in the body of the regexp, + // then we're just going to resort to using whatever the original content was. + if (useBraces && hasContent(node, /[{}]/)) { + return concat([node.beging].concat(docs).concat(node.ending)); + } - return concat(parts); + return concat( + [useBraces ? "%r{" : "/"] + .concat(docs) + .concat(useBraces ? "}" : "/", node.ending.slice(1)) + ); } module.exports = { diff --git a/src/parser.rb b/src/parser.rb index 0a793687..aa5ec3f9 100755 --- a/src/parser.rb +++ b/src/parser.rb @@ -1719,9 +1719,8 @@ def on_redo # expression literal, like /foo/. It can be followed by any number of # regexp_add events, which we'll append onto an array body. def on_regexp_new - regexp_beg = find_scanner_event(:@regexp_beg) - beginning = regexp_beg[:body] - regexp_beg.merge!(type: :regexp, body: [], beginning: beginning) + beging = find_scanner_event(:@regexp_beg) + beging.merge!(type: :regexp, body: [], beging: beging[:body]) end # regexp_add is a parser event that represents a piece of a regular From 2f6b55d8a6716609b39851a339bc862731974033 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sun, 20 Dec 2020 13:27:27 -0500 Subject: [PATCH 015/785] Fix up metadata test --- test/rb/metadata_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/rb/metadata_test.rb b/test/rb/metadata_test.rb index e3c55119..7b758f99 100644 --- a/test/rb/metadata_test.rb +++ b/test/rb/metadata_test.rb @@ -561,7 +561,7 @@ def test_regexp_literal assert_node_metadata( :regexp_literal, parse('%r(foo)'), - beginning: '%r(', + beging: '%r(', ending: ')' ) end From 1b5757821b010b7bbc8316f93faa70e049e01d49 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sun, 20 Dec 2020 13:35:13 -0500 Subject: [PATCH 016/785] Add @karanmandal as a contributor --- .all-contributorsrc | 9 +++ CHANGELOG.md | 2 + README.md | 1 + src/nodes/loops.js | 132 +++++++++++++++++------------------ test/js/nodes/blocks.test.js | 12 +--- 5 files changed, 81 insertions(+), 75 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index ab0e2823..0a12fbb8 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -500,6 +500,15 @@ "bug", "code" ] + }, + { + "login": "karanmandal", + "name": "Karan Mandal", + "avatar_url": "https://avatars2.githubusercontent.com/u/45869605?v=4", + "profile": "https://studyfied.com/", + "contributions": [ + "bug" + ] } ], "contributorsPerLine": 7, diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f9a3545..e5616a92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [@rindek], [@kddeisz] - Do not remove parentheses when receiver looks like a constant. - [@rindek], [@kddeisz] - Do not remove parentheses when using the special `call` syntax with no arguments. - [@ykpythemind] - Do not change regexp bounds if the body has certain content. +- [@karanmandal], [@kddeisz] - Correctly print for loops. ## [1.0.1] - 2020-12-12 @@ -1055,6 +1056,7 @@ would previously result in `array[]`, but now prints properly. [@jpickwell]: https://github.com/jpickwell [@jrdioko]: https://github.com/jrdioko [@jviney]: https://github.com/jviney +[@karanmandal]: https://github.com/karanmandal [@kddeisz]: https://github.com/kddeisz [@kmcq]: https://github.com/kmcq [@krachtstefan]: https://github.com/krachtstefan diff --git a/README.md b/README.md index 408196c9..c4ce5650 100644 --- a/README.md +++ b/README.md @@ -229,6 +229,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
John Snyder

🐛
Jacek Jakubik

🐛
Yukito Ito

🐛 💻 +
Karan Mandal

🐛 diff --git a/src/nodes/loops.js b/src/nodes/loops.js index cf93167d..4bfe418b 100644 --- a/src/nodes/loops.js +++ b/src/nodes/loops.js @@ -12,85 +12,85 @@ const { const { containsAssignment } = require("../utils"); const inlineEnsureParens = require("../utils/inlineEnsureParens"); -const printLoop = (keyword, modifier) => (path, { rubyModifier }, print) => { - const [_predicate, stmts] = path.getValue().body; +function printLoop(keyword, modifier) { + return function printLoopWithOptions(path, { rubyModifier }, print) { + const [_predicate, stmts] = path.getValue().body; - // If the only statement inside this while loop is a void statement, then we - // can shorten to just displaying the predicate and then a semicolon. - if ( - stmts.body.length === 1 && - stmts.body[0].type === "void_stmt" && - !stmts.body[0].comments - ) { - return group( - concat([ - keyword, - " ", - path.call(print, "body", 0), - ifBreak(softline, "; "), - "end" + // If the only statement inside this while loop is a void statement, then we + // can shorten to just displaying the predicate and then a semicolon. + if ( + stmts.body.length === 1 && + stmts.body[0].type === "void_stmt" && + !stmts.body[0].comments + ) { + return group( + concat([ + keyword, + " ", + path.call(print, "body", 0), + ifBreak(softline, "; "), + "end" + ]) + ); + } + + const inlineLoop = concat( + inlineEnsureParens(path, [ + path.call(print, "body", 1), + ` ${keyword} `, + path.call(print, "body", 0) ]) ); - } - const inlineLoop = concat( - inlineEnsureParens(path, [ - path.call(print, "body", 1), - ` ${keyword} `, - path.call(print, "body", 0) - ]) - ); + // If we're in the modifier form and we're modifying a `begin`, then this is + // a special case where we need to explicitly use the modifier form because + // otherwise the semantic meaning changes. This looks like: + // + // begin + // foo + // end while bar + // + // The above is effectively a `do...while` loop (which we don't have in + // ruby). + if (modifier && path.getValue().body[1].type === "begin") { + return inlineLoop; + } - // If we're in the modifier form and we're modifying a `begin`, then this is a - // special case where we need to explicitly use the modifier form because - // otherwise the semantic meaning changes. This looks like: - // - // begin - // foo - // end while bar - // - // The above is effectively a `do...while` loop (which we don't have in ruby). - if (modifier && path.getValue().body[1].type === "begin") { - return inlineLoop; - } + const blockLoop = concat([ + concat([ + `${keyword} `, + align(keyword.length + 1, path.call(print, "body", 0)) + ]), + indent(concat([softline, path.call(print, "body", 1)])), + concat([softline, "end"]) + ]); - const blockLoop = concat([ - concat([ - `${keyword} `, - align(keyword.length + 1, path.call(print, "body", 0)) - ]), - indent(concat([softline, path.call(print, "body", 1)])), - concat([softline, "end"]) - ]); + // If we're disallowing inline loops or if the predicate of the loop + // contains an assignment (in which case we can't know for certain that that + // assignment doesn't impact the statements inside the loop) then we can't + // use the modifier form and we must use the block form. + if (!rubyModifier || containsAssignment(path.getValue().body[0])) { + return concat([breakParent, blockLoop]); + } - // If we're disallowing inline loops or if the predicate of the loop contains - // an assignment (in which case we can't know for certain that that - // assignment doesn't impact the statements inside the loop) then we can't - // use the modifier form and we must use the block form. - if (!rubyModifier || containsAssignment(path.getValue().body[0])) { - return concat([breakParent, blockLoop]); - } + return group(ifBreak(blockLoop, inlineLoop)); + }; +} - return group(ifBreak(blockLoop, inlineLoop)); -}; +function printFor(path, opts, print) { + const [variable, range, stmts] = path.map(print, "body"); -// Technically this is incorrect. A `for` loop actually introduces and modifies -// a local variable that then remains in the outer scope. Additionally, if the -// `each` method was somehow missing from the enumerable (it's possible...), -// then this transformation would fail. However - I've never actually seen a -// `for` loop used in production. If someone actually calls me on it, I'll fix -// this, but for now I'm leaving it. -const printFor = (path, opts, print) => - group( + return group( concat([ - path.call(print, "body", 1), - ".each do |", - path.call(print, "body", 0), - "|", - indent(concat([hardline, path.call(print, "body", 2)])), + "for ", + variable, + " in ", + range, + indent(concat([hardline, stmts])), concat([hardline, "end"]) ]) ); +} module.exports = { while: printLoop("while", false), diff --git a/test/js/nodes/blocks.test.js b/test/js/nodes/blocks.test.js index e8015241..ea269f86 100644 --- a/test/js/nodes/blocks.test.js +++ b/test/js/nodes/blocks.test.js @@ -62,20 +62,14 @@ describe("blocks", () => { return expect(content).toMatchFormat(); }); - test("for loops get changed", () => { + test("for loops", () => { const content = ruby(` - for i in [1, 2, 3] do + for i in [1, 2, 3] p i end `); - return expect(content).toChangeFormat( - ruby(` - [1, 2, 3].each do |i| - p i - end - `) - ); + return expect(content).toMatchFormat(); }); // from ruby test/ruby/test_call.rb From 0fb9f4ad76c2c36e241688923291e632b76fd712 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sun, 20 Dec 2020 14:21:33 -0500 Subject: [PATCH 017/785] Long method chains with args at the end If you have something like ```ruby config.action_dispatch.rescue_responses.merge!( # We created more threads than RAILS_MAX_THREADS 'ActiveRecord::ConnectionTimeoutError' => :service_unavailable, # Some query hits a timeout 'ActiveRecord::QueryCanceled' => :service_unavailable, # Rack::Timeout 'Rack::Timeout::RequestExpiryError' => :service_unavailable, 'Rack::Timeout::RequestTimeoutError' => :service_unavailable, 'Rack::Timeout::RequestTimeoutException' => :service_unavailable, ) ``` then we want to group the args and the method chain. --- CHANGELOG.md | 2 ++ src/nodes/calls.js | 16 ++++++++++++++++ test/js/nodes/calls.test.js | 13 ++++++++++++- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5616a92..38b74670 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [@rindek], [@kddeisz] - Do not remove parentheses when using the special `call` syntax with no arguments. - [@ykpythemind] - Do not change regexp bounds if the body has certain content. - [@karanmandal], [@kddeisz] - Correctly print for loops. +- [@rafbm], [@kddeisz] - If there are method chains with arguments only at the end, we should group the method chain and the method args. ## [1.0.1] - 2020-12-12 @@ -1071,6 +1072,7 @@ would previously result in `array[]`, but now prints properly. [@overload119]: https://github.com/Overload119 [@petevk]: https://github.com/petevk [@pje]: https://github.com/pje +[@rafbm]: https://github.com/rafbm [@rindek]: https://github.com/rindek [@rosskinsella]: https://github.com/RossKinsella [@rsullivan00]: https://github.com/Rsullivan00 diff --git a/src/nodes/calls.js b/src/nodes/calls.js index 6e55b43b..0033f8a2 100644 --- a/src/nodes/calls.js +++ b/src/nodes/calls.js @@ -39,6 +39,7 @@ function printCall(path, opts, print) { // right side of the expression, as we want to have a nice multi-line layout. if (chained.includes(parentNode.type)) { parentNode.chain = (node.chain || 0) + 1; + parentNode.callChain = (node.callChain || 0) + 1; parentNode.breakDoc = (node.breakDoc || [receiverDoc]).concat(rightSideDoc); } @@ -109,6 +110,21 @@ function printMethodAddArg(path, opts, print) { // If we're at the top of a chain, then we're going to print out a nice // multi-line layout if this doesn't break into multiple lines. if (!chained.includes(parentNode.type) && (node.chain || 0) >= 3) { + // This is pretty specialized behavior. Basically if we're at the top of a + // chain but we've only had method calls without arguments and now we have + // arguments, then we're effectively trying to call a method with arguments + // that is nested under a bunch of stuff. So we group together to first part + // to make it so just the arguments break. This looks like, for example: + // + // config.action_dispatch.rescue_responses.merge!( + // 'ActiveRecord::ConnectionTimeoutError' => :service_unavailable, + // 'ActiveRecord::QueryCanceled' => :service_unavailable + // ) + // + if (node.callChain === node.chain) { + return concat([group(indent(concat(node.breakDoc))), group(argsDoc)]); + } + return ifBreak( group(indent(concat(node.breakDoc.concat(argsDoc)))), concat([methodDoc, argsDoc]) diff --git a/test/js/nodes/calls.test.js b/test/js/nodes/calls.test.js index bb821ed8..113d66fe 100644 --- a/test/js/nodes/calls.test.js +++ b/test/js/nodes/calls.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("../utils"); +const { long, ruby } = require("../utils"); describe("calls", () => { test("simple calls", () => { @@ -26,6 +26,17 @@ describe("calls", () => { return expect(before).toChangeFormat(after); }); + test("chains of methods with one with arguments right at the top", () => { + const content = ruby(` + aaa.bbb.ccc.ddd.eee.merge( + ${long.slice(0, 30)}: 'aaa', + ${long.slice(0, 31)}: 'bbb' + ) + `); + + return expect(content).toMatchFormat(); + }); + test("tons of calls that fit on one line", () => { const content = "a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z"; From 1b041cab8841caa60e96d7d7395b4d9bd137c5f0 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sun, 20 Dec 2020 14:30:55 -0500 Subject: [PATCH 018/785] Bump 1.1.0 --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38b74670..d2c235a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [1.1.0] - 2020-12-20 + ### Added - [@kddeisz] - Now that the comments are all fixed up, we can support `# prettier-ignore` comments. @@ -969,7 +971,8 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.0.1...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.1.0...HEAD +[1.1.0]: https://github.com/prettier/plugin-ruby/compare/v1.0.1...v1.1.0 [1.0.1]: https://github.com/prettier/plugin-ruby/compare/v1.0.0...v1.0.1 [1.0.0]: https://github.com/prettier/plugin-ruby/compare/v1.0.0-rc2...v1.0.0 [1.0.0-rc2]: https://github.com/prettier/plugin-ruby/compare/v1.0.0-rc1...v1.0.0-rc2 diff --git a/package.json b/package.json index 234c6078..aba4e64f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "1.0.1", + "version": "1.1.0", "description": "prettier plugin for the Ruby programming language", "main": "src/ruby.js", "scripts": { From 2ee2aed46a1d77b7da3a8625d7e57349b1d46216 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Dec 2020 21:08:10 +0000 Subject: [PATCH 019/785] Bump node-notifier from 8.0.0 to 8.0.1 Bumps [node-notifier](https://github.com/mikaelbr/node-notifier) from 8.0.0 to 8.0.1. - [Release notes](https://github.com/mikaelbr/node-notifier/releases) - [Changelog](https://github.com/mikaelbr/node-notifier/blob/v8.0.1/CHANGELOG.md) - [Commits](https://github.com/mikaelbr/node-notifier/compare/v8.0.0...v8.0.1) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 32c96191..a4bed6d4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2925,9 +2925,9 @@ node-modules-regexp@^1.0.0: integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= node-notifier@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-8.0.0.tgz#a7eee2d51da6d0f7ff5094bc7108c911240c1620" - integrity sha512-46z7DUmcjoYdaWyXouuFNNfUo6eFa94t23c53c+lG/9Cvauk4a98rAUp9672X5dxGdQmLpPzTxzu8f/OeEPaFA== + version "8.0.1" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-8.0.1.tgz#f86e89bbc925f2b068784b31f382afdc6ca56be1" + integrity sha512-BvEXF+UmsnAfYfoapKM9nGxnP+Wn7P91YfXmrKnfcYCx6VBeoN5Ez5Ogck6I8Bi5k4RlpqRYaw75pAwzX9OphA== dependencies: growly "^1.3.0" is-wsl "^2.2.0" From c533e7e739e7fb1e2a3366856fb8db0c8b499849 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sat, 26 Dec 2020 09:53:22 -0500 Subject: [PATCH 020/785] Ruby 3 pattern matching [*,0,*] --- CHANGELOG.md | 4 ++++ src/nodes/assign.js | 10 +++++++++- src/nodes/patterns.js | 17 +++++++++++++++++ src/parser.rb | 20 +++++++++++++++++++- test/js/nodes/patterns.test.js | 6 +++++- 5 files changed, 54 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2c235a5..eebb8b13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Added + +- [@kddeisz] - Support for the `fndptn` node for Ruby 3.0 pattern matching. + ## [1.1.0] - 2020-12-20 ### Added diff --git a/src/nodes/assign.js b/src/nodes/assign.js index a2f5e572..321cc968 100644 --- a/src/nodes/assign.js +++ b/src/nodes/assign.js @@ -31,9 +31,17 @@ function printOpAssign(path, opts, print) { ); } +function printVarField(path, opts, print) { + if (path.getValue().body) { + return path.call(print, "body", 0); + } + + return "*"; +} + module.exports = { assign: printAssign, opassign: printOpAssign, - var_field: first, + var_field: printVarField, var_ref: first }; diff --git a/src/nodes/patterns.js b/src/nodes/patterns.js index e88141d5..1f06633d 100644 --- a/src/nodes/patterns.js +++ b/src/nodes/patterns.js @@ -48,6 +48,22 @@ function printAryPtn(path, opts, print) { return args; } +function printFndPtn(path, opts, print) { + const [constant] = path.getValue().body; + + let args = [path.call(print, "body", 1)] + .concat(path.map(print, "body", 2)) + .concat(path.call(print, "body", 3)); + + args = concat(["[", group(join(concat([",", line]), args)), "]"]); + + if (constant) { + return concat([path.call(print, "body", 0), args]); + } + + return args; +} + function printHshPtn(path, opts, print) { const [constant, keyValuePairs, keyValueRest] = path.getValue().body; let args = []; @@ -113,6 +129,7 @@ function printIn(path, opts, print) { module.exports = { aryptn: printAryPtn, + fndptn: printFndPtn, hshptn: printHshPtn, in: printIn }; diff --git a/src/parser.rb b/src/parser.rb index aa5ec3f9..a3189b3b 100755 --- a/src/parser.rb +++ b/src/parser.rb @@ -1157,6 +1157,24 @@ def on_field(left, oper, right) } end + # fndptn is a parser event that represents matching against a pattern where + # you find a pattern in an array using the Ruby 3.0+ pattern matching syntax. + def on_fndptn(const, presplat, args, postsplat) + beging = const || find_scanner_event(:@lbracket) + ending = find_scanner_event(:@rbracket) + + pieces = [const, presplat, *args, postsplat].compact + + { + type: :fndptn, + body: [const, presplat, args, postsplat], + start: beging[:start], + char_start: beging[:char_start], + end: ending[:end], + char_end: ending[:char_end] + } + end + # for is a parser event that represents using the somewhat esoteric for # loop. It accepts as arguments an ident which is the iterating variable, # an enumerable for that which is being enumerated, and a stmts event that @@ -2306,7 +2324,7 @@ def on_var_field(ident) else # You can hit this pattern if you're assigning to a splat using pattern # matching syntax in Ruby 2.7+ - { type: :var_field, body: [] } + { type: :var_field, body: nil } end end diff --git a/test/js/nodes/patterns.test.js b/test/js/nodes/patterns.test.js index 8b6d3ea4..076c3597 100644 --- a/test/js/nodes/patterns.test.js +++ b/test/js/nodes/patterns.test.js @@ -11,7 +11,7 @@ describe("patterns", () => { } describe("value pattern", () => { - const cases = [ + let cases = [ "0", "-1..1", "Integer", @@ -28,6 +28,10 @@ describe("patterns", () => { "a, b if b == a * 2" ]; + if (process.env.RUBY_VERSION >= "3.0") { + cases.push("[*, 0, *]", "[*, 0, 1, 2, *]", "FooBar[*, 0, *]"); + } + test.each(cases)("%s", (pattern) => { const content = ruby(` case foo From d812952310fd890a9dc04274b7393a1fa8f6eb2c Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sat, 26 Dec 2020 10:12:53 -0500 Subject: [PATCH 021/785] Single-line method definitions --- CHANGELOG.md | 1 + src/nodes/methods.js | 13 +++++++++++-- src/parser.rb | 27 ++++++++++++++++++++++++++- test/js/nodes/method.test.js | 5 +++++ 4 files changed, 43 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eebb8b13..b4e6d33e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Added - [@kddeisz] - Support for the `fndptn` node for Ruby 3.0 pattern matching. +- [@kddeisz] - Support for Ruby 3.0+ single-line method definitions. ## [1.1.0] - 2020-12-20 diff --git a/src/nodes/methods.js b/src/nodes/methods.js index bd63be3a..c22e5025 100644 --- a/src/nodes/methods.js +++ b/src/nodes/methods.js @@ -1,4 +1,4 @@ -const { concat, group, hardline, indent } = require("../prettier"); +const { concat, group, hardline, indent, line } = require("../prettier"); const { first } = require("../utils"); function printMethod(offset) { @@ -48,8 +48,17 @@ function printMethod(offset) { }; } +function printSingleLineMethod(path, opts, print) { + const [nameDoc, stmtDoc] = path.map(print, "body"); + + return group( + concat(["def ", nameDoc, " =", indent(group(concat([line, stmtDoc])))]) + ); +} + module.exports = { access_ctrl: first, def: printMethod(0), - defs: printMethod(2) + defs: printMethod(2), + defsl: printSingleLineMethod }; diff --git a/src/parser.rb b/src/parser.rb index a3189b3b..c3893d94 100755 --- a/src/parser.rb +++ b/src/parser.rb @@ -814,18 +814,43 @@ def on_const_ref(const) # │ └> params # └> ident # + # You can also have single-line methods since Ruby 3.0+, which have slightly + # different syntax but still flow through this method. Those look like: + # + # def foo = bar + # | | + # | └> stmt + # └> ident + # def on_def(ident, params, bodystmt) # Make sure to delete this scanner event in case you're defining something # like def class which would lead to this being a kw and causing all kinds # of trouble scanner_events.delete(ident) + # Find the beginning of the method definition, which works for single-line + # and normal method definitions. + beging = find_scanner_event(:@kw, 'def') + + # If there is not a params node, then we have a single-line method + unless params + return( + { + type: :defsl, + body: [ident, bodystmt], + start: beging[:start], + char_start: beging[:char_start], + end: bodystmt[:end], + char_end: bodystmt[:char_end] + } + ) + end + if params[:type] == :params && !params[:body].any? location = ident[:char_end] params.merge!(char_start: location, char_end: location) end - beging = find_scanner_event(:@kw, 'def') ending = find_scanner_event(:@kw, 'end') bodystmt.bind( diff --git a/test/js/nodes/method.test.js b/test/js/nodes/method.test.js index 82d6c4c6..f1542e7f 100644 --- a/test/js/nodes/method.test.js +++ b/test/js/nodes/method.test.js @@ -93,6 +93,11 @@ describe("method", () => { `) )); + if (process.env.RUBY_VERSION >= "3.0") { + test("single-line methods", () => + expect("def foo = bar").toMatchFormat()); + } + test.skip("def/begin transform", () => { const content = ruby(` def foo From 46f2c7ce7ab13fc45212889d61bf6453cd0193be Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sat, 26 Dec 2020 10:19:55 -0500 Subject: [PATCH 022/785] Bump to v1.2.0 --- CHANGELOG.md | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4e6d33e..a81ade28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [1.2.0] - 2020-12-26 + ### Added - [@kddeisz] - Support for the `fndptn` node for Ruby 3.0 pattern matching. diff --git a/package.json b/package.json index aba4e64f..0caa8f3a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "1.1.0", + "version": "1.2.0", "description": "prettier plugin for the Ruby programming language", "main": "src/ruby.js", "scripts": { From bb540a58487132e8f1a6739df240302d9fce926e Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sun, 27 Dec 2020 15:32:12 -0500 Subject: [PATCH 023/785] Various Ruby 3 syntax fixes --- CHANGELOG.md | 8 +++ src/nodes/assign.js | 6 +- src/nodes/case.js | 102 +++++++++++++++-------------- src/nodes/methods.js | 24 +++++-- src/nodes/patterns.js | 33 ++++++---- src/parser.rb | 33 ++++++---- test/js/nodes/conditionals.test.js | 11 ++++ test/js/nodes/method.test.js | 14 +++- test/js/nodes/patterns.test.js | 14 ++++ 9 files changed, 164 insertions(+), 81 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a81ade28..89db35bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Changed + +- [@kddeisz] - Handle single-line method definitions with parameters. +- [@kddeisz] - Handle hash and array patterns nested within find patterns. +- [@kddeisz] - Handle rightward assignment. +- [@kddeisz] - Handle find patterns with named boundaries. +- [@kddeisz] - Handle rightward assignment in conditionals. + ## [1.2.0] - 2020-12-26 ### Added diff --git a/src/nodes/assign.js b/src/nodes/assign.js index 321cc968..07a60ac7 100644 --- a/src/nodes/assign.js +++ b/src/nodes/assign.js @@ -32,11 +32,7 @@ function printOpAssign(path, opts, print) { } function printVarField(path, opts, print) { - if (path.getValue().body) { - return path.call(print, "body", 0); - } - - return "*"; + return path.getValue().body ? path.call(print, "body", 0) : ""; } module.exports = { diff --git a/src/nodes/case.js b/src/nodes/case.js index 8e25dea2..f426a2ae 100644 --- a/src/nodes/case.js +++ b/src/nodes/case.js @@ -8,54 +8,58 @@ const { line } = require("../prettier"); -module.exports = { - case: (path, opts, print) => { - const statement = ["case"]; - - // You don't need to explicitly have something to test against in a case - // statement (without it it effectively becomes an if/elsif chain). - if (path.getValue().body[0]) { - statement.push(" ", path.call(print, "body", 0)); - } - - return concat( - statement.concat([hardline, path.call(print, "body", 1), hardline, "end"]) - ); - }, - when: (path, opts, print) => { - const [_preds, _stmts, addition] = path.getValue().body; - - // The `fill` builder command expects an array of docs alternating with - // line breaks. This is so it can loop through and determine where to break. - const preds = fill( - path.call(print, "body", 0).reduce((accum, pred, index) => { - if (index === 0) { - return [pred]; - } - - // Pull off the last element and make it concat with a comma so that - // we can maintain alternating lines and docs. - return accum - .slice(0, -1) - .concat([concat([accum[accum.length - 1], ","]), line, pred]); - }, null) - ); - - const stmts = path.call(print, "body", 1); - const parts = [concat(["when ", align("when ".length, preds)])]; - - // It's possible in a when to just have empty void statements, in which case - // we would skip adding the body. - if (!stmts.parts.every((part) => !part)) { - parts.push(indent(concat([hardline, stmts]))); - } - - // This is the next clause on the case statement, either another `when` or - // an `else` clause. - if (addition) { - parts.push(hardline, path.call(print, "body", 2)); - } - - return group(concat(parts)); +function printCase(path, opts, print) { + const statement = ["case"]; + + // You don't need to explicitly have something to test against in a case + // statement (without it it effectively becomes an if/elsif chain). + if (path.getValue().body[0]) { + statement.push(" ", path.call(print, "body", 0)); + } + + return concat( + statement.concat([hardline, path.call(print, "body", 1), hardline, "end"]) + ); +} + +function printWhen(path, opts, print) { + const [_preds, _stmts, addition] = path.getValue().body; + + // The `fill` builder command expects an array of docs alternating with + // line breaks. This is so it can loop through and determine where to break. + const preds = fill( + path.call(print, "body", 0).reduce((accum, pred, index) => { + if (index === 0) { + return [pred]; + } + + // Pull off the last element and make it concat with a comma so that + // we can maintain alternating lines and docs. + return accum + .slice(0, -1) + .concat([concat([accum[accum.length - 1], ","]), line, pred]); + }, null) + ); + + const stmts = path.call(print, "body", 1); + const parts = [concat(["when ", align("when ".length, preds)])]; + + // It's possible in a when to just have empty void statements, in which case + // we would skip adding the body. + if (!stmts.parts.every((part) => !part)) { + parts.push(indent(concat([hardline, stmts]))); + } + + // This is the next clause on the case statement, either another `when` or + // an `else` clause. + if (addition) { + parts.push(hardline, path.call(print, "body", 2)); } + + return group(concat(parts)); +} + +module.exports = { + case: printCase, + when: printWhen }; diff --git a/src/nodes/methods.js b/src/nodes/methods.js index c22e5025..981838a9 100644 --- a/src/nodes/methods.js +++ b/src/nodes/methods.js @@ -16,8 +16,7 @@ function printMethod(offset) { } // In case there are no parens but there are arguments - const parens = - params.type === "params" && params.body.some((paramType) => paramType); + const parens = params.type === "params" && params.body.some((type) => type); declaration.push( path.call(print, "body", offset), @@ -49,10 +48,27 @@ function printMethod(offset) { } function printSingleLineMethod(path, opts, print) { - const [nameDoc, stmtDoc] = path.map(print, "body"); + let paramsNode = path.getValue().body[1]; + let paramsDoc = ""; + + if (paramsNode) { + if (paramsNode.body[0].type === "params") { + paramsNode = paramsNode.body[0]; + } + + if (paramsNode.type === "params" && paramsNode.body.some((type) => type)) { + paramsDoc = path.call(print, "body", 1); + } + } return group( - concat(["def ", nameDoc, " =", indent(group(concat([line, stmtDoc])))]) + concat([ + "def ", + path.call(print, "body", 0), + paramsDoc, + " =", + indent(group(concat([line, path.call(print, "body", 2)]))) + ]) ); } diff --git a/src/nodes/patterns.js b/src/nodes/patterns.js index 1f06633d..26b9806e 100644 --- a/src/nodes/patterns.js +++ b/src/nodes/patterns.js @@ -1,5 +1,7 @@ const { concat, group, hardline, indent, join, line } = require("../prettier"); +const patterns = ["aryptn", "binary", "fndptn", "hshptn", "rassign"]; + function printPatternArg(path, opts, print) { // Pinning is a really special syntax in pattern matching that's not really // all that well supported in ripper. Here we're just going to the original @@ -34,10 +36,7 @@ function printAryPtn(path, opts, print) { args = group(join(concat([",", line]), args)); - if ( - constant || - ["aryptn", "binary", "hshptn"].includes(path.getParentNode().type) - ) { + if (constant || patterns.includes(path.getParentNode().type)) { args = concat(["[", args, "]"]); } @@ -51,9 +50,9 @@ function printAryPtn(path, opts, print) { function printFndPtn(path, opts, print) { const [constant] = path.getValue().body; - let args = [path.call(print, "body", 1)] + let args = [concat(["*", path.call(print, "body", 1)])] .concat(path.map(print, "body", 2)) - .concat(path.call(print, "body", 3)); + .concat(concat(["*", path.call(print, "body", 3)])); args = concat(["[", group(join(concat([",", line]), args)), "]"]); @@ -96,10 +95,8 @@ function printHshPtn(path, opts, print) { if (constant) { args = concat(["[", args, "]"]); - } else if ( - ["aryptn", "binary", "hshptn"].includes(path.getParentNode().type) - ) { - args = concat(["{", args, "}"]); + } else if (patterns.includes(path.getParentNode().type)) { + args = concat(["{ ", args, " }"]); } if (constant) { @@ -127,9 +124,23 @@ function printIn(path, opts, print) { return group(concat(parts)); } +function printRAssign(path, opts, print) { + const { keyword } = path.getValue(); + const [leftDoc, rightDoc] = path.map(print, "body"); + + return group( + concat([ + leftDoc, + keyword ? " in" : " =>", + group(indent(concat([line, rightDoc]))) + ]) + ); +} + module.exports = { aryptn: printAryPtn, fndptn: printFndPtn, hshptn: printHshPtn, - in: printIn + in: printIn, + rassign: printRAssign }; diff --git a/src/parser.rb b/src/parser.rb index c3893d94..5f8b5b44 100755 --- a/src/parser.rb +++ b/src/parser.rb @@ -63,14 +63,14 @@ def char_pos # would happen to be the innermost keyword). Then the outer one would only be # able to grab the first one. In this way all of the scanner events act as # their own stack. - def find_scanner_event(type, body = :any) + def find_scanner_event(type, body = :any, consume: true) index = scanner_events.rindex do |scanner_event| scanner_event[:type] == type && (body == :any || (scanner_event[:body] == body)) end - scanner_events.delete_at(index) + consume ? scanner_events.delete_at(index) : (index && scanner_events[index]) end # Scanner events occur when the lexer hits a new token, like a keyword or an @@ -675,8 +675,15 @@ def on_call(receiver, oper, sending) # It accepts as arguments the switch of the case and the consequent # clause. def on_case(switch, consequent) - find_scanner_event(:@kw, 'case').merge!( - type: :case, + beging = + if event = find_scanner_event(:@kw, 'case', consume: false) + scanner_events.delete(event).merge!(type: :case) + else + keyword = find_scanner_event(:@kw, 'in', consume: false) + switch.merge(type: :rassign, keyword: keyword) + end + + beging.merge!( body: [switch, consequent], end: consequent[:end], char_end: consequent[:char_end] @@ -832,12 +839,12 @@ def on_def(ident, params, bodystmt) # and normal method definitions. beging = find_scanner_event(:@kw, 'def') - # If there is not a params node, then we have a single-line method - unless params + # If we don't have a bodystmt node, then we have a single-line method + if bodystmt[:type] != :bodystmt return( { type: :defsl, - body: [ident, bodystmt], + body: [ident, params, bodystmt], start: beging[:start], char_start: beging[:char_start], end: bodystmt[:end], @@ -1006,7 +1013,7 @@ def on_dot3(left, right) # # which would be the same symbol as above. def on_dyna_symbol(string) - if scanner_events.any? { |event| event[:type] == :@symbeg } + if find_scanner_event(:@symbeg, consume: false) # A normal dynamic symbol beging = find_scanner_event(:@symbeg) ending = find_scanner_event(:@tstring_end) @@ -1345,8 +1352,12 @@ def on_if_mod(predicate, statement) end # in is a parser event that represents using the in keyword within the - # Ruby 2.7+ pattern matching syntax. + # Ruby 2.7+ pattern matching syntax. Alternatively in Ruby 3+ it is also used + # to handle rightward assignment for pattern matching. def on_in(pattern, stmts, consequent) + # Here we have a rightward assignment + return pattern unless stmts + beging = find_scanner_event(:@kw, 'in') ending = consequent || find_scanner_event(:@kw, 'end') @@ -1384,8 +1395,8 @@ def on_kwrest_param(ident) def on_lambda(params, stmts) beging = find_scanner_event(:@tlambda) - if scanner_events.any? { |event| event[:type] == :@tlambeg } - opening = find_scanner_event(:@tlambeg) + if event = find_scanner_event(:@tlambeg, consume: false) + opening = scanner_events.delete(event) closing = find_scanner_event(:@rbrace) else opening = find_scanner_event(:@kw, 'do') diff --git a/test/js/nodes/conditionals.test.js b/test/js/nodes/conditionals.test.js index 08e80002..3f2bb5b2 100644 --- a/test/js/nodes/conditionals.test.js +++ b/test/js/nodes/conditionals.test.js @@ -533,4 +533,15 @@ describe("conditionals", () => { `foo ||= (baz ${keyword} bar?)` )); }); + + if (process.env.RUBY_VERSION >= "3.0") { + test.each(["if", "unless"])("%s with pattern matching", (keyword) => { + const content = ruby(` + user = { role: 'admin', login: 'matz' } + puts "admin: #{name}" ${keyword} user in { role: 'admin', name: } + `); + + return expect(content).toMatchFormat(); + }); + } }); diff --git a/test/js/nodes/method.test.js b/test/js/nodes/method.test.js index f1542e7f..d0032230 100644 --- a/test/js/nodes/method.test.js +++ b/test/js/nodes/method.test.js @@ -83,6 +83,18 @@ describe("method", () => { }); } + if (process.env.RUBY_VERSION >= "3.0") { + test("args_forward with other arguments", () => { + const content = ruby(` + def get(...) + request(:get, ...) + end + `); + + return expect(content).toMatchFormat(); + }); + } + test("breaking", () => expect(`def foo(${long}:, a${long}:); end`).toChangeFormat( ruby(` @@ -95,7 +107,7 @@ describe("method", () => { if (process.env.RUBY_VERSION >= "3.0") { test("single-line methods", () => - expect("def foo = bar").toMatchFormat()); + expect("def foo(name) = bar").toMatchFormat()); } test.skip("def/begin transform", () => { diff --git a/test/js/nodes/patterns.test.js b/test/js/nodes/patterns.test.js index 076c3597..04f18fda 100644 --- a/test/js/nodes/patterns.test.js +++ b/test/js/nodes/patterns.test.js @@ -43,4 +43,18 @@ describe("patterns", () => { return expect(content).toMatchFormat(); }); }); + + if (process.env.RUBY_VERSION >= "3.0") { + test("rassign", () => { + const content = "{ db: { user: 'John' } } => { db: { user: } }"; + + return expect(content).toMatchFormat(); + }); + + test("rassign with fndptn", () => { + const content = "(1..10).to_a.shuffle => [*bef, 2..4 => thresh, *aft]"; + + return expect(content).toMatchFormat(); + }); + } }); From 54c621ae21af13e5777744377a234e2ba542730c Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sun, 27 Dec 2020 15:39:28 -0500 Subject: [PATCH 024/785] Bump to v1.2.1 --- CHANGELOG.md | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89db35bb..fc091093 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [1.2.1] - 2020-12-27 + ### Changed - [@kddeisz] - Handle single-line method definitions with parameters. diff --git a/package.json b/package.json index 0caa8f3a..eee21785 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "1.2.0", + "version": "1.2.1", "description": "prettier plugin for the Ruby programming language", "main": "src/ruby.js", "scripts": { From 33ab0caacd803b9ce722d139e1e213a3d08faf36 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sun, 27 Dec 2020 15:40:56 -0500 Subject: [PATCH 025/785] Fix up CHANGELOG --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc091093..d774dfda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -988,7 +988,9 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.1.0...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.2.1...HEAD +[1.2.1]: https://github.com/prettier/plugin-ruby/compare/v1.2.0...v1.2.1 +[1.2.0]: https://github.com/prettier/plugin-ruby/compare/v1.1.0...v1.2.0 [1.1.0]: https://github.com/prettier/plugin-ruby/compare/v1.0.1...v1.1.0 [1.0.1]: https://github.com/prettier/plugin-ruby/compare/v1.0.0...v1.0.1 [1.0.0]: https://github.com/prettier/plugin-ruby/compare/v1.0.0-rc2...v1.0.0 From 850cde64fc250e5d63723755741424aead40f7c3 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Fri, 1 Jan 2021 13:14:29 -0500 Subject: [PATCH 026/785] Various fixes for small bugs --- CHANGELOG.md | 10 +++++++ lib/prettier.rb | 4 +-- src/nodes/calls.js | 15 ++++++---- src/nodes/return.js | 55 +++++++++++++++++++++--------------- src/parser.rb | 5 ++++ src/printer.js | 32 +++++++++++++++++++++ test/js/nodes/calls.test.js | 24 +++++++++++++++- test/js/nodes/method.test.js | 13 +++++++++ test/js/nodes/return.test.js | 3 ++ 9 files changed, 131 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d774dfda..e0c38e29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Changed + +- [@nathan-beam] - Gem does not work with CMD/Powershell. +- [@blampe], [@kddeisz] - Comments inside keyword parameters in method declarations are not printed. +- [@blampe], [@kddeisz] - `command_call` nodes with unary operators incorrectly parse their operator. +- [@blampe], [@kddeisz] - Returning multiple values where the first has parentheses was incorrectly removing the remaining values. +- [@johncsnyder], [@kddeisz] - Call chains whose left-most receiver is a no-indent expression should not indent their entire chain. + ## [1.2.1] - 2020-12-27 ### Changed @@ -1051,6 +1059,7 @@ would previously result in `array[]`, but now prints properly. [@andyw8]: https://github.com/andyw8 [@ashfurrow]: https://github.com/ashfurrow [@awinograd]: https://github.com/awinograd +[@blampe]: https://github.com/blampe [@bugthing]: https://github.com/bugthing [@cbothner]: https://github.com/cbothner [@christoomey]: https://github.com/christoomey @@ -1090,6 +1099,7 @@ would previously result in `array[]`, but now prints properly. [@meleyal]: https://github.com/meleyal [@mmainz]: https://github.com/mmainz [@mmcnl]: https://github.com/mmcnl +[@nathan-beam]: https://github.com/nathan-beam [@noahtheduke]: https://github.com/NoahTheDuke [@overload119]: https://github.com/Overload119 [@petevk]: https://github.com/petevk diff --git a/lib/prettier.rb b/lib/prettier.rb index 4b4ed058..11ffc6d3 100644 --- a/lib/prettier.rb +++ b/lib/prettier.rb @@ -9,8 +9,8 @@ module Prettier class << self def run(args) - quoted = args.map { |arg| arg.start_with?('-') ? arg : "'#{arg}'" } - command = "node #{BINARY} --plugin '#{PLUGIN}' #{quoted.join(' ')}" + quoted = args.map { |arg| arg.start_with?('-') ? arg : "\"#{arg}\"" } + command = "node #{BINARY} --plugin \"#{PLUGIN}\" #{quoted.join(' ')}" system({ 'RBPRETTIER' => '1' }, command) end diff --git a/src/nodes/calls.js b/src/nodes/calls.js index 0033f8a2..c314c90f 100644 --- a/src/nodes/calls.js +++ b/src/nodes/calls.js @@ -41,15 +41,18 @@ function printCall(path, opts, print) { parentNode.chain = (node.chain || 0) + 1; parentNode.callChain = (node.callChain || 0) + 1; parentNode.breakDoc = (node.breakDoc || [receiverDoc]).concat(rightSideDoc); + parentNode.firstReceiverType = node.firstReceiverType || receiverNode.type; } // If we're at the top of a chain, then we're going to print out a nice // multi-line layout if this doesn't break into multiple lines. if (!chained.includes(parentNode.type) && (node.chain || 0) >= 3) { - return ifBreak( - group(indent(concat(node.breakDoc.concat(rightSideDoc)))), - concat([receiverDoc, group(rightSideDoc)]) - ); + let breakDoc = concat(node.breakDoc.concat(rightSideDoc)); + if (!noIndent.includes(node.firstReceiverType)) { + breakDoc = indent(breakDoc); + } + + return ifBreak(group(breakDoc), concat([receiverDoc, group(rightSideDoc)])); } // For certain left sides of the call nodes, we want to attach directly to @@ -105,6 +108,7 @@ function printMethodAddArg(path, opts, print) { if (chained.includes(parentNode.type)) { parentNode.chain = (node.chain || 0) + 1; parentNode.breakDoc = (node.breakDoc || [methodDoc]).concat(argsDoc); + parentNode.firstReceiverType = node.firstReceiverType; } // If we're at the top of a chain, then we're going to print out a nice @@ -152,7 +156,7 @@ function isSorbetTypeAnnotation(node) { callNode.body[0].body[0].body === "sig" && callNode.body[1].type === "args" && callNode.body[1].body.length === 0 && - blockNode.type === "brace_block" + blockNode ); } @@ -198,6 +202,7 @@ function printMethodAddBlock(path, opts, print) { if (chained.includes(parentNode.type)) { parentNode.chain = (node.chain || 0) + 1; parentNode.breakDoc = (node.breakDoc || [callDoc]).concat(blockDoc); + parentNode.firstReceiverType = node.firstReceiverType; } // If we're at the top of a chain, then we're going to print out a nice diff --git a/src/nodes/return.js b/src/nodes/return.js index 749ce75c..e746b74b 100644 --- a/src/nodes/return.js +++ b/src/nodes/return.js @@ -13,10 +13,13 @@ const { literal } = require("../utils"); // because they have low enough operator precedence that you need to explicitly // keep them in there. const canSkipParens = (args) => { - const statement = args.body[0].body[0].body[0]; - return ( - statement.type !== "binary" || !["and", "or"].includes(statement.body[1]) - ); + const stmts = args.body[0].body[0]; + if (stmts.comments) { + return false; + } + + const stmt = stmts.body[0]; + return stmt.type !== "binary" || !["and", "or"].includes(stmt.body[1]); }; const printReturn = (path, opts, print) => { @@ -27,25 +30,27 @@ const printReturn = (path, opts, print) => { return "return"; } - // If the body of the return contains parens, then just skip directly to the - // content of the parens so that we can skip printing parens if we don't - // want them. - if (args.body[0] && args.body[0].type === "paren" && canSkipParens(args)) { - args = args.body[0].body[0]; - steps = steps.concat("body", 0, "body", 0); - } + if (args.body.length === 1) { + // If the body of the return contains parens, then just skip directly to the + // content of the parens so that we can skip printing parens if we don't + // want them. + if (args.body[0] && args.body[0].type === "paren" && canSkipParens(args)) { + args = args.body[0].body[0]; + steps = steps.concat("body", 0, "body", 0); + } - // If we're returning an array literal that isn't a special array, single - // element array, or an empty array, then we want to grab the arguments so - // that we can print them out as if they were normal return arguments. - if ( - args.body[0] && - args.body[0].type === "array" && - args.body[0].body[0] && - args.body[0].body[0].body.length > 1 && - ["args", "args_add_star"].includes(args.body[0].body[0].type) - ) { - steps = steps.concat("body", 0, "body", 0); + // If we're returning an array literal that isn't a special array, single + // element array, or an empty array, then we want to grab the arguments so + // that we can print them out as if they were normal return arguments. + if ( + args.body[0] && + args.body[0].type === "array" && + args.body[0].body[0] && + args.body[0].body[0].body.length > 1 && + ["args", "args_add_star"].includes(args.body[0].body[0].type) + ) { + steps = steps.concat("body", 0, "body", 0); + } } // Now that we've established which actual node is the arguments to return, @@ -56,6 +61,12 @@ const printReturn = (path, opts, print) => { // be a singular doc as opposed to an array. const value = Array.isArray(parts) ? join(concat([",", line]), parts) : parts; + // We only get here if we have comments somewhere that would prevent us from + // skipping the parentheses. + if (args.body.length === 1 && args.body[0].type === "paren") { + return concat(["return", value]); + } + return group( concat([ "return", diff --git a/src/parser.rb b/src/parser.rb index 5f8b5b44..4c45e02b 100755 --- a/src/parser.rb +++ b/src/parser.rb @@ -753,6 +753,11 @@ def on_command(ident, args) # of the method, the operator being used to send the method, the name of # the method, and the arguments being passed to the method. def on_command_call(receiver, oper, ident, args) + # Make sure we take the operator out of the scanner events so that it + # doesn't get confused for a unary operator later. + scanner_events.delete(oper) + + # Grab the ending from either the arguments or the method being sent ending = args || ident { diff --git a/src/printer.js b/src/printer.js index a6b600da..95d0953d 100644 --- a/src/printer.js +++ b/src/printer.js @@ -67,6 +67,38 @@ function getCommentChildNodes(node) { return [node.body[0]].concat(values).concat(node.body[2]); } + case "params": { + const [reqs, optls, rest, post, kwargs, kwargRest, block] = node.body; + let parts = reqs || []; + + (optls || []).forEach((optl) => { + parts = parts.concat(optl); + }); + + if (rest) { + parts.push(rest); + } + + parts = parts.concat(post || []); + + (kwargs || []).forEach((kwarg) => { + if (kwarg[1]) { + parts = parts.concat(kwarg); + } else { + parts.push(kwarg[0]); + } + }); + + if (kwargRest && kwargRest !== "nil") { + parts.push(kwargRest); + } + + if (block) { + parts.push(block); + } + + return parts; + } default: return node.body; } diff --git a/test/js/nodes/calls.test.js b/test/js/nodes/calls.test.js index 113d66fe..58d18821 100644 --- a/test/js/nodes/calls.test.js +++ b/test/js/nodes/calls.test.js @@ -49,12 +49,34 @@ describe("calls", () => { test("explicit call maintains call", () => expect("a.call(1, 2, 3)").toMatchFormat()); - test("double bang with a special operator", () => + test("double bang with a special operator on a call", () => expect("!!object&.topic_list").toMatchFormat()); + test("bang with a special operator on a command_call", () => + expect("!domain&.include? '@'").toMatchFormat()); + test("#call shorthand does not eliminate empty parentheses", () => expect("Foo.new.()").toMatchFormat()); test("methods that look like constants do not eliminate empty parens", () => expect("Foo()").toMatchFormat()); + + test("call chains with no indent on the first receiver", () => { + const item = long.slice(0, 30); + const content = `result = [${item}, ${item}, ${item}].map(&:foo?).bbb.ccc`; + + const expected = ruby(` + result = + [ + ${item}, + ${item}, + ${item} + ] + .map(&:foo?) + .bbb + .ccc + `); + + return expect(content).toChangeFormat(expected); + }); }); diff --git a/test/js/nodes/method.test.js b/test/js/nodes/method.test.js index d0032230..0e7c390c 100644 --- a/test/js/nodes/method.test.js +++ b/test/js/nodes/method.test.js @@ -135,6 +135,19 @@ describe("method", () => { return expect(content).toChangeFormat(expected); }); + + test("comments on kwargs", () => { + const content = ruby(` + def foo( + bar:, # hello + baz: + ) + bar + end + `); + + return expect(content).toMatchFormat(); + }); }); describe("method calls", () => { diff --git a/test/js/nodes/return.test.js b/test/js/nodes/return.test.js index e7148313..5081777a 100644 --- a/test/js/nodes/return.test.js +++ b/test/js/nodes/return.test.js @@ -40,4 +40,7 @@ describe("return", () => { expect(`return foo, ${long}`).toChangeFormat( `return [\n foo,\n ${long}\n]` )); + + test("returning two arguments, the first with parentheses", () => + expect("return (1), 2").toMatchFormat()); }); From 56210f513136c20555af48cf7061d1dac16fdbc4 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Fri, 1 Jan 2021 13:14:45 -0500 Subject: [PATCH 027/785] Add @nathan-beam as a contributor --- .all-contributorsrc | 10 ++++++++++ README.md | 1 + 2 files changed, 11 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 0a12fbb8..134cf4ce 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -509,6 +509,16 @@ "contributions": [ "bug" ] + }, + { + "login": "nathan-beam", + "name": "Nathan Beam", + "avatar_url": "https://avatars3.githubusercontent.com/u/24681333?v=4", + "profile": "http://nathanbeam.codes/", + "contributions": [ + "bug", + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index c4ce5650..f3013f46 100644 --- a/README.md +++ b/README.md @@ -230,6 +230,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Jacek Jakubik

🐛
Yukito Ito

🐛 💻
Karan Mandal

🐛 +
Nathan Beam

🐛 💻 From f4dafcd960a54610e88e54503291c8dcdc01ef71 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Fri, 1 Jan 2021 13:14:57 -0500 Subject: [PATCH 028/785] Add @blampe as a contributor --- .all-contributorsrc | 9 +++++++++ README.md | 1 + 2 files changed, 10 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 134cf4ce..c4248266 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -519,6 +519,15 @@ "bug", "code" ] + }, + { + "login": "blampe", + "name": "Bryce Lampe", + "avatar_url": "https://avatars3.githubusercontent.com/u/848843?v=4", + "profile": "https://github.com/blampe", + "contributions": [ + "bug" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index f3013f46..3cfdb867 100644 --- a/README.md +++ b/README.md @@ -231,6 +231,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Yukito Ito

🐛 💻
Karan Mandal

🐛
Nathan Beam

🐛 💻 +
Bryce Lampe

🐛 From 6b1773315e739511b66c1117e416408ef18e81b7 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Fri, 1 Jan 2021 13:19:44 -0500 Subject: [PATCH 029/785] Bump to v1.2.2 --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0c38e29..20729511 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [1.2.2] - 2021-01-01 + ### Changed - [@nathan-beam] - Gem does not work with CMD/Powershell. @@ -996,7 +998,8 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.2.1...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.2.2...HEAD +[1.2.2]: https://github.com/prettier/plugin-ruby/compare/v1.2.1...v1.2.2 [1.2.1]: https://github.com/prettier/plugin-ruby/compare/v1.2.0...v1.2.1 [1.2.0]: https://github.com/prettier/plugin-ruby/compare/v1.1.0...v1.2.0 [1.1.0]: https://github.com/prettier/plugin-ruby/compare/v1.0.1...v1.1.0 diff --git a/package.json b/package.json index eee21785..25dc7094 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "1.2.1", + "version": "1.2.2", "description": "prettier plugin for the Ruby programming language", "main": "src/ruby.js", "scripts": { From 6d739d08ad43563a6c7bb6b497f7633b840e3a47 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Fri, 1 Jan 2021 13:39:41 -0500 Subject: [PATCH 030/785] Reorganize utils --- src/nodes/assign.js | 8 +- src/nodes/blocks.js | 4 +- src/nodes/calls.js | 10 ++- src/nodes/commands.js | 145 +++++++++++++++++++------------- src/nodes/hashes.js | 8 +- src/nodes/methods.js | 7 +- src/utils.js | 103 +++-------------------- src/utils/containsAssignment.js | 11 +++ src/utils/getTrailingComma.js | 5 ++ src/utils/hasAncestor.js | 17 ++++ src/utils/literal.js | 7 ++ src/utils/makeCall.js | 11 +++ src/utils/noIndent.js | 10 +++ src/utils/skipAssignIndent.js | 10 +++ 14 files changed, 192 insertions(+), 164 deletions(-) create mode 100644 src/utils/containsAssignment.js create mode 100644 src/utils/getTrailingComma.js create mode 100644 src/utils/hasAncestor.js create mode 100644 src/utils/literal.js create mode 100644 src/utils/makeCall.js create mode 100644 src/utils/noIndent.js create mode 100644 src/utils/skipAssignIndent.js diff --git a/src/nodes/assign.js b/src/nodes/assign.js index 07a60ac7..02cd72d0 100644 --- a/src/nodes/assign.js +++ b/src/nodes/assign.js @@ -1,5 +1,5 @@ const { concat, group, indent, join, line } = require("../prettier"); -const { first, skipAssignIndent } = require("../utils"); +const { skipAssignIndent } = require("../utils"); function printAssign(path, opts, print) { const [_targetNode, valueNode] = path.getValue().body; @@ -35,9 +35,13 @@ function printVarField(path, opts, print) { return path.getValue().body ? path.call(print, "body", 0) : ""; } +function printVarRef(path, opts, print) { + return path.call(print, "body", 0); +} + module.exports = { assign: printAssign, opassign: printOpAssign, var_field: printVarField, - var_ref: first + var_ref: printVarRef }; diff --git a/src/nodes/blocks.js b/src/nodes/blocks.js index ceea9277..a0cef9e3 100644 --- a/src/nodes/blocks.js +++ b/src/nodes/blocks.js @@ -8,7 +8,7 @@ const { removeLines, softline } = require("../prettier"); -const { empty, hasAncestor } = require("../utils"); +const { hasAncestor } = require("../utils"); const printBlock = (braces) => (path, opts, print) => { const [variables, statements] = path.getValue().body; @@ -81,5 +81,5 @@ module.exports = { }, brace_block: printBlock(true), do_block: printBlock(false), - excessed_comma: empty + excessed_comma: () => "" }; diff --git a/src/nodes/calls.js b/src/nodes/calls.js index c314c90f..efc73755 100644 --- a/src/nodes/calls.js +++ b/src/nodes/calls.js @@ -6,7 +6,7 @@ const { indent, softline } = require("../prettier"); -const { first, makeCall, noIndent } = require("../utils"); +const { makeCall, noIndent } = require("../utils"); const toProc = require("../toProc"); @@ -217,10 +217,14 @@ function printMethodAddBlock(path, opts, print) { return concat([callDoc, blockDoc]); } +function printCallContainer(path, opts, print) { + return path.call(print, "body", 0); +} + module.exports = { call: printCall, - fcall: first, + fcall: printCallContainer, method_add_arg: printMethodAddArg, method_add_block: printMethodAddBlock, - vcall: first + vcall: printCallContainer }; diff --git a/src/nodes/commands.js b/src/nodes/commands.js index d5df3ae9..d52c68a3 100644 --- a/src/nodes/commands.js +++ b/src/nodes/commands.js @@ -8,13 +8,32 @@ const { line, softline } = require("../prettier"); -const { docLength, makeCall } = require("../utils"); +const { makeCall } = require("../utils"); -const hasDef = (node) => - node.body[1].type === "args_add_block" && - node.body[1].body[0].type === "args" && - node.body[1].body[0].body[0] && - ["def", "defs"].includes(node.body[1].body[0].body[0].type); +function docLength(doc) { + if (doc.length) { + return doc.length; + } + + if (doc.parts) { + return doc.parts.reduce((sum, child) => sum + docLength(child), 0); + } + + if (doc.contents) { + return docLength(doc.contents); + } + + return 0; +} + +function hasDef(node) { + return ( + node.body[1].type === "args_add_block" && + node.body[1].body[0].type === "args" && + node.body[1].body[0].body[0] && + ["def", "defs"].includes(node.body[1].body[0].body[0].type) + ); +} // Very special handling case for rspec matchers. In general with rspec matchers // you expect to see something like: @@ -29,63 +48,71 @@ const hasDef = (node) => // // In this case the arguments are aligned to the left side as opposed to being // aligned with the `receive` call. -const skipArgsAlign = (path) => - ["to", "not_to"].includes(path.getValue().body[2].body); +function skipArgsAlign(path) { + return ["to", "not_to"].includes(path.getValue().body[2].body); +} // If there is a ternary argument to a command and it's going to get broken // into multiple lines, then we're going to have to use parentheses around the // command in order to make sure operator precedence doesn't get messed up. -const hasTernaryArg = (path) => - path.getValue().body[1].body[0].body.some((node) => node.type === "ifop"); +function hasTernaryArg(path) { + const node = path.getValue(); -module.exports = { - command: (path, opts, print) => { - const command = path.call(print, "body", 0); - const joinedArgs = join(concat([",", line]), path.call(print, "body", 1)); - - const hasTernary = hasTernaryArg(path); - let breakArgs; - - if (hasTernary) { - breakArgs = indent(concat([softline, joinedArgs])); - } else if (hasDef(path.getValue())) { - breakArgs = joinedArgs; - } else { - breakArgs = align(command.length + 1, joinedArgs); - } - - return group( - ifBreak( - concat([ - command, - hasTernary ? "(" : " ", - breakArgs, - hasTernary ? concat([softline, ")"]) : "" - ]), - concat([command, " ", joinedArgs]) - ) - ); - }, - command_call: (path, opts, print) => { - const parts = [ - path.call(print, "body", 0), - makeCall(path, opts, print), - path.call(print, "body", 2) - ]; - - if (!path.getValue().body[3]) { - return concat(parts); - } - - parts.push(" "); - - const joinedArgs = join(concat([",", line]), path.call(print, "body", 3)); - const breakArgs = skipArgsAlign(path) - ? joinedArgs - : align(docLength(concat(parts)), joinedArgs); - - return group( - ifBreak(concat(parts.concat(breakArgs)), concat(parts.concat(joinedArgs))) - ); + return node.body[1].body[0].body.some((child) => child.type === "ifop"); +} + +function printCommand(path, opts, print) { + const command = path.call(print, "body", 0); + const joinedArgs = join(concat([",", line]), path.call(print, "body", 1)); + + const hasTernary = hasTernaryArg(path); + let breakArgs; + + if (hasTernary) { + breakArgs = indent(concat([softline, joinedArgs])); + } else if (hasDef(path.getValue())) { + breakArgs = joinedArgs; + } else { + breakArgs = align(command.length + 1, joinedArgs); + } + + return group( + ifBreak( + concat([ + command, + hasTernary ? "(" : " ", + breakArgs, + hasTernary ? concat([softline, ")"]) : "" + ]), + concat([command, " ", joinedArgs]) + ) + ); +} + +function printCommandCall(path, opts, print) { + const parts = [ + path.call(print, "body", 0), + makeCall(path, opts, print), + path.call(print, "body", 2) + ]; + + if (!path.getValue().body[3]) { + return concat(parts); } + + parts.push(" "); + + const joinedArgs = join(concat([",", line]), path.call(print, "body", 3)); + const breakArgs = skipArgsAlign(path) + ? joinedArgs + : align(docLength(concat(parts)), joinedArgs); + + return group( + ifBreak(concat(parts.concat(breakArgs)), concat(parts.concat(joinedArgs))) + ); +} + +module.exports = { + command: printCommand, + command_call: printCommandCall }; diff --git a/src/nodes/hashes.js b/src/nodes/hashes.js index 8688bb14..0f781c8f 100644 --- a/src/nodes/hashes.js +++ b/src/nodes/hashes.js @@ -1,8 +1,6 @@ const { concat, group, ifBreak, indent, join, line } = require("../prettier"); - const { getTrailingComma, - prefix, printEmptyCollection, skipAssignIndent } = require("../utils"); @@ -80,6 +78,10 @@ function printAssocNew(path, opts, print) { return group(concat(parts)); } +function printAssocSplat(path, opts, print) { + return concat(["**", path.call(print, "body", 0)]); +} + function printHashContents(path, opts, print) { const node = path.getValue(); @@ -121,7 +123,7 @@ function printHash(path, opts, print) { module.exports = { assoc_new: printAssocNew, - assoc_splat: prefix("**"), + assoc_splat: printAssocSplat, assoclist_from_args: printHashContents, bare_assoc_hash: printHashContents, hash: printHash diff --git a/src/nodes/methods.js b/src/nodes/methods.js index 981838a9..43c71d5d 100644 --- a/src/nodes/methods.js +++ b/src/nodes/methods.js @@ -1,5 +1,4 @@ const { concat, group, hardline, indent, line } = require("../prettier"); -const { first } = require("../utils"); function printMethod(offset) { return function printMethodWithOffset(path, opts, print) { @@ -72,8 +71,12 @@ function printSingleLineMethod(path, opts, print) { ); } +function printAccessControl(path, opts, print) { + return path.call(print, "body", 0); +} + module.exports = { - access_ctrl: first, + access_ctrl: printAccessControl, def: printMethod(0), defs: printMethod(2), defsl: printSingleLineMethod diff --git a/src/utils.js b/src/utils.js index ea5d9ae9..d3efa9c0 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,95 +1,12 @@ -const { concat } = require("./prettier"); -const isEmptyStmts = require("./utils/isEmptyStmts"); -const literalLineNoBreak = require("./utils/literalLineNoBreak"); -const printEmptyCollection = require("./utils/printEmptyCollection"); - -// If the node is a type of assignment or if the node is a paren and nested -// inside that paren is a node that is a type of assignment. -const containsAssignment = (node) => - node && - (["assign", "massign", "opassign"].includes(node.type) || - (Array.isArray(node.body) && node.body.some(containsAssignment))); - -const docLength = (doc) => { - if (doc.length) { - return doc.length; - } - - if (doc.parts) { - return doc.parts.reduce((sum, child) => sum + docLength(child), 0); - } - - if (doc.contents) { - return docLength(doc.contents); - } - - return 0; -}; - -const empty = () => ""; - -const first = (path, opts, print) => path.call(print, "body", 0); - -const getTrailingComma = (opts) => ["all", "es5"].includes(opts.trailingComma); - -const hasAncestor = (path, types) => { - let parent = 0; - let parentNode = path.getParentNode(); - - while (parentNode) { - if (types.includes(parentNode.type)) { - return true; - } - - parent += 1; - parentNode = path.getParentNode(parent); - } - - return false; -}; - -const literal = (value) => () => value; - -const makeCall = (path, opts, print) => { - const operation = path.getValue().body[1]; - - if ([".", "&."].includes(operation)) { - return operation; - } - - return operation === "::" ? "." : path.call(print, "body", 1); -}; - -const noIndent = [ - "array", - "hash", - "heredoc", - "if", - "method_add_block", - "xstring_literal" -]; - -const prefix = (value) => (path, opts, print) => - concat([value, path.call(print, "body", 0)]); - -const skippable = ["array", "hash", "heredoc", "lambda", "regexp_literal"]; -const skipAssignIndent = (node) => - skippable.includes(node.type) || - (node.type === "call" && skipAssignIndent(node.body[0])); - module.exports = { - containsAssignment, - docLength, - empty, - first, - getTrailingComma, - hasAncestor, - isEmptyStmts, - literal, - literalLineNoBreak, - makeCall, - noIndent, - prefix, - printEmptyCollection, - skipAssignIndent + containsAssignment: require("./utils/containsAssignment"), + getTrailingComma: require("./utils/getTrailingComma"), + isEmptyStmts: require("./utils/isEmptyStmts"), + hasAncestor: require("./utils/hasAncestor"), + literal: require("./utils/literal"), + literalLineNoBreak: require("./utils/literalLineNoBreak"), + makeCall: require("./utils/makeCall"), + noIndent: require("./utils/noIndent"), + printEmptyCollection: require("./utils/printEmptyCollection"), + skipAssignIndent: require("./utils/skipAssignIndent") }; diff --git a/src/utils/containsAssignment.js b/src/utils/containsAssignment.js new file mode 100644 index 00000000..5d778391 --- /dev/null +++ b/src/utils/containsAssignment.js @@ -0,0 +1,11 @@ +// If the node is a type of assignment or if the node is a paren and nested +// inside that paren is a node that is a type of assignment. +function containsAssignment(node) { + return ( + node && + (["assign", "massign", "opassign"].includes(node.type) || + (Array.isArray(node.body) && node.body.some(containsAssignment))) + ); +} + +module.exports = containsAssignment; diff --git a/src/utils/getTrailingComma.js b/src/utils/getTrailingComma.js new file mode 100644 index 00000000..a262f96f --- /dev/null +++ b/src/utils/getTrailingComma.js @@ -0,0 +1,5 @@ +function getTrailingComma(opts) { + return ["all", "es5"].includes(opts.trailingComma); +} + +module.exports = getTrailingComma; diff --git a/src/utils/hasAncestor.js b/src/utils/hasAncestor.js new file mode 100644 index 00000000..ed86847b --- /dev/null +++ b/src/utils/hasAncestor.js @@ -0,0 +1,17 @@ +function hasAncestor(path, types) { + let parent = 0; + let parentNode = path.getParentNode(); + + while (parentNode) { + if (types.includes(parentNode.type)) { + return true; + } + + parent += 1; + parentNode = path.getParentNode(parent); + } + + return false; +} + +module.exports = hasAncestor; diff --git a/src/utils/literal.js b/src/utils/literal.js new file mode 100644 index 00000000..082ff434 --- /dev/null +++ b/src/utils/literal.js @@ -0,0 +1,7 @@ +function literal(value) { + return function printLiteral() { + return value; + }; +} + +module.exports = literal; diff --git a/src/utils/makeCall.js b/src/utils/makeCall.js new file mode 100644 index 00000000..0890f45e --- /dev/null +++ b/src/utils/makeCall.js @@ -0,0 +1,11 @@ +function makeCall(path, opts, print) { + const operation = path.getValue().body[1]; + + if ([".", "&."].includes(operation)) { + return operation; + } + + return operation === "::" ? "." : path.call(print, "body", 1); +} + +module.exports = makeCall; diff --git a/src/utils/noIndent.js b/src/utils/noIndent.js new file mode 100644 index 00000000..aeaf212a --- /dev/null +++ b/src/utils/noIndent.js @@ -0,0 +1,10 @@ +const noIndent = [ + "array", + "hash", + "heredoc", + "if", + "method_add_block", + "xstring_literal" +]; + +module.exports = noIndent; diff --git a/src/utils/skipAssignIndent.js b/src/utils/skipAssignIndent.js new file mode 100644 index 00000000..e0ee21cf --- /dev/null +++ b/src/utils/skipAssignIndent.js @@ -0,0 +1,10 @@ +const skippable = ["array", "hash", "heredoc", "lambda", "regexp_literal"]; + +function skipAssignIndent(node) { + return ( + skippable.includes(node.type) || + (node.type === "call" && skipAssignIndent(node.body[0])) + ); +} + +module.exports = skipAssignIndent; From 9e658db13d3f0524d816528e060b1381e0431559 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sat, 2 Jan 2021 12:25:59 -0500 Subject: [PATCH 031/785] Reorganize to support potentially multiple languages --- CONTRIBUTING.md | 4 ++-- README.md | 2 +- bin/debug | 2 +- bin/pragma | 2 +- bin/sexp | 3 +-- package.json | 2 +- src/{ruby.js => plugin.js} | 4 ++-- src/{ => ruby}/embed.js | 4 ++-- src/{ => ruby}/nodes.js | 0 src/{ => ruby}/nodes/alias.js | 2 +- src/{ => ruby}/nodes/aref.js | 9 ++++++++- src/{ => ruby}/nodes/args.js | 4 ++-- src/{ => ruby}/nodes/arrays.js | 5 ++--- src/{ => ruby}/nodes/assign.js | 4 ++-- src/{ => ruby}/nodes/blocks.js | 4 ++-- src/{ => ruby}/nodes/calls.js | 4 ++-- src/{ => ruby}/nodes/case.js | 2 +- src/{ => ruby}/nodes/class.js | 2 +- src/{ => ruby}/nodes/commands.js | 4 ++-- src/{ => ruby}/nodes/conditionals.js | 6 +++--- src/{ => ruby}/nodes/constants.js | 4 ++-- src/{ => ruby}/nodes/flow.js | 4 ++-- src/{ => ruby}/nodes/hashes.js | 11 +++++++++-- src/{ => ruby}/nodes/heredocs.js | 4 ++-- src/{ => ruby}/nodes/hooks.js | 4 ++-- src/{ => ruby}/nodes/ints.js | 0 src/{ => ruby}/nodes/lambdas.js | 4 ++-- src/{ => ruby}/nodes/loops.js | 6 +++--- src/{ => ruby}/nodes/massign.js | 9 ++++++++- src/{ => ruby}/nodes/methods.js | 2 +- src/{ => ruby}/nodes/operators.js | 4 ++-- src/{ => ruby}/nodes/params.js | 11 +++++++++-- src/{ => ruby}/nodes/patterns.js | 9 ++++++++- src/{ => ruby}/nodes/regexp.js | 4 ++-- src/{ => ruby}/nodes/rescue.js | 4 ++-- src/{ => ruby}/nodes/return.js | 4 ++-- src/{ => ruby}/nodes/statements.js | 2 +- src/{ => ruby}/nodes/strings.js | 2 +- src/{ => ruby}/nodes/super.js | 4 ++-- src/{ => ruby}/nodes/undef.js | 2 +- src/{ => ruby}/parser.js | 0 src/{ => ruby}/parser.rb | 2 -- src/{ => ruby}/printer.js | 2 +- src/{ => ruby}/toProc.js | 0 test/js/parser.rb | 2 +- test/js/{ => ruby}/comments.test.js | 2 +- test/js/{ => ruby}/embed.test.js | 2 +- test/js/{ => ruby}/encoding.test.js | 0 test/js/{ => ruby}/errors.test.js | 0 test/js/{ => ruby}/hasPragma.test.js | 2 +- test/js/{ => ruby}/ignore.test.js | 2 +- test/js/{ => ruby}/lang.test.js | 2 +- test/js/{ => ruby}/layout.test.js | 0 test/js/{ => ruby}/locations.test.js | 2 +- test/js/{ => ruby}/nodes.test.js | 4 ++-- test/js/{ => ruby}/nodes/alias.test.js | 2 +- test/js/{ => ruby}/nodes/aref.test.js | 2 +- test/js/{ => ruby}/nodes/arrays.test.js | 2 +- test/js/{ => ruby}/nodes/assign.test.js | 2 +- test/js/{ => ruby}/nodes/binary.test.js | 2 +- test/js/{ => ruby}/nodes/blocks.test.js | 2 +- test/js/{ => ruby}/nodes/break.test.js | 2 +- test/js/{ => ruby}/nodes/calls.test.js | 2 +- test/js/{ => ruby}/nodes/case.test.js | 2 +- test/js/{ => ruby}/nodes/class.test.js | 2 +- test/js/{ => ruby}/nodes/conditionals.test.js | 2 +- test/js/{ => ruby}/nodes/defined.test.js | 2 +- test/js/{ => ruby}/nodes/embdoc.test.js | 2 +- test/js/{ => ruby}/nodes/hashes.test.js | 2 +- test/js/{ => ruby}/nodes/heredocs.test.js | 2 +- test/js/{ => ruby}/nodes/hooks.test.js | 2 +- test/js/{ => ruby}/nodes/kwargs.test.js | 0 test/js/{ => ruby}/nodes/lambda.test.js | 2 +- test/js/{ => ruby}/nodes/loops.test.js | 2 +- test/js/{ => ruby}/nodes/massign.test.js | 0 test/js/{ => ruby}/nodes/method.test.js | 2 +- test/js/{ => ruby}/nodes/next.test.js | 2 +- test/js/{ => ruby}/nodes/numbers.test.js | 0 test/js/{ => ruby}/nodes/patterns.test.js | 2 +- test/js/{ => ruby}/nodes/ranges.test.js | 0 test/js/{ => ruby}/nodes/regexp.test.js | 2 +- test/js/{ => ruby}/nodes/rescue.test.js | 2 +- test/js/{ => ruby}/nodes/return.test.js | 2 +- test/js/{ => ruby}/nodes/strings.test.js | 2 +- test/js/{ => ruby}/nodes/super.test.js | 2 +- test/js/{ => ruby}/nodes/undef.test.js | 2 +- test/js/{ => ruby}/nodes/yield.test.js | 0 test/js/{ => ruby}/toProc.test.js | 2 +- test/js/setupTests.js | 2 +- test/rb/metadata_test.rb | 2 +- 90 files changed, 138 insertions(+), 107 deletions(-) rename src/{ruby.js => plugin.js} (96%) rename src/{ => ruby}/embed.js (96%) rename src/{ => ruby}/nodes.js (100%) rename src/{ => ruby}/nodes/alias.js (98%) rename src/{ => ruby}/nodes/aref.js (94%) rename src/{ => ruby}/nodes/args.js (97%) rename src/{ => ruby}/nodes/arrays.js (98%) rename src/{ => ruby}/nodes/assign.js (90%) rename src/{ => ruby}/nodes/blocks.js (96%) rename src/{ => ruby}/nodes/calls.js (98%) rename src/{ => ruby}/nodes/case.js (98%) rename src/{ => ruby}/nodes/class.js (98%) rename src/{ => ruby}/nodes/commands.js (97%) rename src/{ => ruby}/nodes/conditionals.js (98%) rename src/{ => ruby}/nodes/constants.js (88%) rename src/{ => ruby}/nodes/flow.js (94%) rename src/{ => ruby}/nodes/hashes.js (96%) rename src/{ => ruby}/nodes/heredocs.js (89%) rename src/{ => ruby}/nodes/hooks.js (90%) rename src/{ => ruby}/nodes/ints.js (100%) rename src/{ => ruby}/nodes/lambdas.js (94%) rename src/{ => ruby}/nodes/loops.js (94%) rename src/{ => ruby}/nodes/massign.js (95%) rename src/{ => ruby}/nodes/methods.js (96%) rename src/{ => ruby}/nodes/operators.js (94%) rename src/{ => ruby}/nodes/params.js (94%) rename src/{ => ruby}/nodes/patterns.js (97%) rename src/{ => ruby}/nodes/regexp.js (95%) rename src/{ => ruby}/nodes/rescue.js (96%) rename src/{ => ruby}/nodes/return.js (97%) rename src/{ => ruby}/nodes/statements.js (99%) rename src/{ => ruby}/nodes/strings.js (99%) rename src/{ => ruby}/nodes/super.js (87%) rename src/{ => ruby}/nodes/undef.js (96%) rename src/{ => ruby}/parser.js (100%) rename src/{ => ruby}/parser.rb (99%) rename src/{ => ruby}/printer.js (98%) rename src/{ => ruby}/toProc.js (100%) rename test/js/{ => ruby}/comments.test.js (99%) rename test/js/{ => ruby}/embed.test.js (96%) rename test/js/{ => ruby}/encoding.test.js (100%) rename test/js/{ => ruby}/errors.test.js (100%) rename test/js/{ => ruby}/hasPragma.test.js (83%) rename test/js/{ => ruby}/ignore.test.js (85%) rename test/js/{ => ruby}/lang.test.js (86%) rename test/js/{ => ruby}/layout.test.js (100%) rename test/js/{ => ruby}/locations.test.js (82%) rename test/js/{ => ruby}/nodes.test.js (93%) rename test/js/{ => ruby}/nodes/alias.test.js (96%) rename test/js/{ => ruby}/nodes/aref.test.js (93%) rename test/js/{ => ruby}/nodes/arrays.test.js (98%) rename test/js/{ => ruby}/nodes/assign.test.js (97%) rename test/js/{ => ruby}/nodes/binary.test.js (93%) rename test/js/{ => ruby}/nodes/blocks.test.js (98%) rename test/js/{ => ruby}/nodes/break.test.js (94%) rename test/js/{ => ruby}/nodes/calls.test.js (97%) rename test/js/{ => ruby}/nodes/case.test.js (97%) rename test/js/{ => ruby}/nodes/class.test.js (97%) rename test/js/{ => ruby}/nodes/conditionals.test.js (99%) rename test/js/{ => ruby}/nodes/defined.test.js (94%) rename test/js/{ => ruby}/nodes/embdoc.test.js (94%) rename test/js/{ => ruby}/nodes/hashes.test.js (99%) rename test/js/{ => ruby}/nodes/heredocs.test.js (99%) rename test/js/{ => ruby}/nodes/hooks.test.js (93%) rename test/js/{ => ruby}/nodes/kwargs.test.js (100%) rename test/js/{ => ruby}/nodes/lambda.test.js (98%) rename test/js/{ => ruby}/nodes/loops.test.js (98%) rename test/js/{ => ruby}/nodes/massign.test.js (100%) rename test/js/{ => ruby}/nodes/method.test.js (99%) rename test/js/{ => ruby}/nodes/next.test.js (93%) rename test/js/{ => ruby}/nodes/numbers.test.js (100%) rename test/js/{ => ruby}/nodes/patterns.test.js (97%) rename test/js/{ => ruby}/nodes/ranges.test.js (100%) rename test/js/{ => ruby}/nodes/regexp.test.js (97%) rename test/js/{ => ruby}/nodes/rescue.test.js (98%) rename test/js/{ => ruby}/nodes/return.test.js (97%) rename test/js/{ => ruby}/nodes/strings.test.js (99%) rename test/js/{ => ruby}/nodes/super.test.js (97%) rename test/js/{ => ruby}/nodes/undef.test.js (95%) rename test/js/{ => ruby}/nodes/yield.test.js (100%) rename test/js/{ => ruby}/toProc.test.js (98%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 173c2bf2..7e12101e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,7 +22,7 @@ In order to get printed, the code goes through a couple of transformations. The ### Text to AST -When the prettier process first spins up, it examines which files it's going to print and selects an appropriate plugin for each one. Once selected, it runs that plugin's `parse` function, seen [here](src/parser.js). For the case of the Ruby plugin, that entails spawning a Ruby process that runs [parser.rb](src/parser.rb) with the input code preloaded on stdin. +When the prettier process first spins up, it examines which files it's going to print and selects an appropriate plugin for each one. Once selected, it runs that plugin's `parse` function, seen [here](src/ruby/parser.js). For the case of the Ruby plugin, that entails spawning a Ruby process that runs [parser.rb](src/ruby/parser.rb) with the input code preloaded on stdin. `parser.rb` will read the text off of stdin and then feed it to a new `Ripper` instance, which is a Ruby standard library recursive-descent parser. Briefly, the way that `Ripper` works is by tokenizing the input and then matching those tokens against a grammar to form s-expressions. To extend `Ripper`, you overwrite the methods that control how those s-expressions are formed, e.g., to modify the s-expression that is formed when `Ripper` encounters a string literal, you would override the `#on_string_literal` method. Below is an example for seeing that in action. @@ -71,7 +71,7 @@ Now that the text has been transformed into an AST that we can work with, `parse ### AST to Doc -Once prettier has a working AST, it will take it and call the selected plugin's [`printNode` function](src/printer.js), whose purpose is to convert that AST into prettier's intermediate representation called Docs. It does this by handing the print function a `FastPath` object that keeps track of the state of the printing as it goes, and allows accessing various parts of the AST quickly. +Once prettier has a working AST, it will take it and call the selected plugin's [`printNode` function](src/ruby/printer.js), whose purpose is to convert that AST into prettier's intermediate representation called Docs. It does this by handing the print function a `FastPath` object that keeps track of the state of the printing as it goes, and allows accessing various parts of the AST quickly. Effectively, it walks the AST in the reverse direction from the way `Ripper` built it (top-down instead of bottom-up). The first node that gets passed into the `print` function is the `program` node as that's always on top. Then it is the `program` node's responsibility to recursively call print on its child nodes as it best sees fit. diff --git a/README.md b/README.md index 3cfdb867..d46da353 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ The `prettier` executable is now installed and ready for use: ## Configuration -Below are the options (from [`src/ruby.js`](src/ruby.js)) that `@prettier/plugin-ruby` currently supports: +Below are the options (from [`src/plugin.js`](src/plugin.js)) that `@prettier/plugin-ruby` currently supports: | API Option | CLI Option | Default | Description | | ------------------ | ---------------------- | :-----: | ------------------------------------------------------------------------------------------------------------------------------------ | diff --git a/bin/debug b/bin/debug index 936f8856..5acdcc94 100755 --- a/bin/debug +++ b/bin/debug @@ -7,7 +7,7 @@ gemfile do gem 'sinatra', require: 'sinatra/base' end -require_relative '../src/parser' +require_relative '../src/ruby/parser' class App < Sinatra::Base HTML = DATA.read diff --git a/bin/pragma b/bin/pragma index 26c0c235..08b2565a 100755 --- a/bin/pragma +++ b/bin/pragma @@ -1,6 +1,6 @@ #!/usr/bin/env node const fs = require("fs"); -const { hasPragma } = require("../src/ruby").parsers.ruby; +const { hasPragma } = require("../src/plugin").parsers.ruby; console.log(hasPragma(fs.readFileSync(process.argv[2], "utf-8"))); diff --git a/bin/sexp b/bin/sexp index c187442e..8b6325c3 100755 --- a/bin/sexp +++ b/bin/sexp @@ -1,7 +1,6 @@ #!/usr/bin/env ruby -require File.expand_path(File.join('..', 'src', 'parser.rb'), __dir__) - +require_relative '../src/ruby/parser' require 'pp' PP.prepend( diff --git a/package.json b/package.json index 25dc7094..ddb0bab0 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@prettier/plugin-ruby", "version": "1.2.2", "description": "prettier plugin for the Ruby programming language", - "main": "src/ruby.js", + "main": "src/plugin.js", "scripts": { "check-format": "prettier --check '**/*'", "lint": "eslint --cache .", diff --git a/src/ruby.js b/src/plugin.js similarity index 96% rename from src/ruby.js rename to src/plugin.js index 5c98657a..5529deb2 100644 --- a/src/ruby.js +++ b/src/plugin.js @@ -1,5 +1,5 @@ -const printer = require("./printer"); -const parser = require("./parser"); +const printer = require("./ruby/printer"); +const parser = require("./ruby/parser"); /* * metadata mostly pulled from linguist and rubocop: diff --git a/src/embed.js b/src/ruby/embed.js similarity index 96% rename from src/embed.js rename to src/ruby/embed.js index 6b4e3ef5..7882ff62 100644 --- a/src/embed.js +++ b/src/ruby/embed.js @@ -6,9 +6,9 @@ const { mapDoc, markAsRoot, stripTrailingHardline -} = require("./prettier"); +} = require("../prettier"); -const { literalLineNoBreak } = require("./utils"); +const { literalLineNoBreak } = require("../utils"); const parsers = { css: "css", diff --git a/src/nodes.js b/src/ruby/nodes.js similarity index 100% rename from src/nodes.js rename to src/ruby/nodes.js diff --git a/src/nodes/alias.js b/src/ruby/nodes/alias.js similarity index 98% rename from src/nodes/alias.js rename to src/ruby/nodes/alias.js index b7239eba..e93afc1f 100644 --- a/src/nodes/alias.js +++ b/src/ruby/nodes/alias.js @@ -5,7 +5,7 @@ const { group, hardline, line -} = require("../prettier"); +} = require("../../prettier"); // In general, return the printed doc of the argument at the provided index. // Special handling is given for symbol literals that are not bare words, as we diff --git a/src/nodes/aref.js b/src/ruby/nodes/aref.js similarity index 94% rename from src/nodes/aref.js rename to src/ruby/nodes/aref.js index 5adbf495..cc3f5fce 100644 --- a/src/nodes/aref.js +++ b/src/ruby/nodes/aref.js @@ -1,4 +1,11 @@ -const { concat, group, indent, join, line, softline } = require("../prettier"); +const { + concat, + group, + indent, + join, + line, + softline +} = require("../../prettier"); // `aref` nodes are when you're pulling a value out of a collection at a // specific index. Put another way, it's any time you're calling the method diff --git a/src/nodes/args.js b/src/ruby/nodes/args.js similarity index 97% rename from src/nodes/args.js rename to src/ruby/nodes/args.js index 341caf4f..8d07c04f 100644 --- a/src/nodes/args.js +++ b/src/ruby/nodes/args.js @@ -6,10 +6,10 @@ const { join, line, softline -} = require("../prettier"); +} = require("../../prettier"); +const { getTrailingComma } = require("../../utils"); const toProc = require("../toProc"); -const { getTrailingComma } = require("../utils"); function printArgParen(path, opts, print) { const argsNode = path.getValue().body[0]; diff --git a/src/nodes/arrays.js b/src/ruby/nodes/arrays.js similarity index 98% rename from src/nodes/arrays.js rename to src/ruby/nodes/arrays.js index 03fcc654..f8fb8bc2 100644 --- a/src/nodes/arrays.js +++ b/src/ruby/nodes/arrays.js @@ -6,9 +6,8 @@ const { join, line, softline -} = require("../prettier"); - -const { getTrailingComma, printEmptyCollection } = require("../utils"); +} = require("../../prettier"); +const { getTrailingComma, printEmptyCollection } = require("../../utils"); // Checks that every argument within this args node is a string_literal node // that has no spaces or interpolations. This means we're dealing with an array diff --git a/src/nodes/assign.js b/src/ruby/nodes/assign.js similarity index 90% rename from src/nodes/assign.js rename to src/ruby/nodes/assign.js index 02cd72d0..1fd9f27c 100644 --- a/src/nodes/assign.js +++ b/src/ruby/nodes/assign.js @@ -1,5 +1,5 @@ -const { concat, group, indent, join, line } = require("../prettier"); -const { skipAssignIndent } = require("../utils"); +const { concat, group, indent, join, line } = require("../../prettier"); +const { skipAssignIndent } = require("../../utils"); function printAssign(path, opts, print) { const [_targetNode, valueNode] = path.getValue().body; diff --git a/src/nodes/blocks.js b/src/ruby/nodes/blocks.js similarity index 96% rename from src/nodes/blocks.js rename to src/ruby/nodes/blocks.js index a0cef9e3..78fd68d0 100644 --- a/src/nodes/blocks.js +++ b/src/ruby/nodes/blocks.js @@ -7,8 +7,8 @@ const { join, removeLines, softline -} = require("../prettier"); -const { hasAncestor } = require("../utils"); +} = require("../../prettier"); +const { hasAncestor } = require("../../utils"); const printBlock = (braces) => (path, opts, print) => { const [variables, statements] = path.getValue().body; diff --git a/src/nodes/calls.js b/src/ruby/nodes/calls.js similarity index 98% rename from src/nodes/calls.js rename to src/ruby/nodes/calls.js index efc73755..4abb97c7 100644 --- a/src/nodes/calls.js +++ b/src/ruby/nodes/calls.js @@ -5,8 +5,8 @@ const { ifBreak, indent, softline -} = require("../prettier"); -const { makeCall, noIndent } = require("../utils"); +} = require("../../prettier"); +const { makeCall, noIndent } = require("../../utils"); const toProc = require("../toProc"); diff --git a/src/nodes/case.js b/src/ruby/nodes/case.js similarity index 98% rename from src/nodes/case.js rename to src/ruby/nodes/case.js index f426a2ae..a9d2bf37 100644 --- a/src/nodes/case.js +++ b/src/ruby/nodes/case.js @@ -6,7 +6,7 @@ const { hardline, indent, line -} = require("../prettier"); +} = require("../../prettier"); function printCase(path, opts, print) { const statement = ["case"]; diff --git a/src/nodes/class.js b/src/ruby/nodes/class.js similarity index 98% rename from src/nodes/class.js rename to src/ruby/nodes/class.js index 0e7bcf9c..b719605c 100644 --- a/src/nodes/class.js +++ b/src/ruby/nodes/class.js @@ -5,7 +5,7 @@ const { ifBreak, indent, line -} = require("../prettier"); +} = require("../../prettier"); function printClass(path, opts, print) { const [_constant, superclass, bodystmt] = path.getValue().body; diff --git a/src/nodes/commands.js b/src/ruby/nodes/commands.js similarity index 97% rename from src/nodes/commands.js rename to src/ruby/nodes/commands.js index d52c68a3..935cf26f 100644 --- a/src/nodes/commands.js +++ b/src/ruby/nodes/commands.js @@ -7,8 +7,8 @@ const { join, line, softline -} = require("../prettier"); -const { makeCall } = require("../utils"); +} = require("../../prettier"); +const { makeCall } = require("../../utils"); function docLength(doc) { if (doc.length) { diff --git a/src/nodes/conditionals.js b/src/ruby/nodes/conditionals.js similarity index 98% rename from src/nodes/conditionals.js rename to src/ruby/nodes/conditionals.js index 61a2b1f9..f4729134 100644 --- a/src/nodes/conditionals.js +++ b/src/ruby/nodes/conditionals.js @@ -7,10 +7,10 @@ const { ifBreak, indent, softline -} = require("../prettier"); +} = require("../../prettier"); -const { containsAssignment, isEmptyStmts } = require("../utils"); -const inlineEnsureParens = require("../utils/inlineEnsureParens"); +const { containsAssignment, isEmptyStmts } = require("../../utils"); +const inlineEnsureParens = require("../../utils/inlineEnsureParens"); const printWithAddition = (keyword, path, print, { breaking = false } = {}) => concat([ diff --git a/src/nodes/constants.js b/src/ruby/nodes/constants.js similarity index 88% rename from src/nodes/constants.js rename to src/ruby/nodes/constants.js index 8dcca56a..4d317a91 100644 --- a/src/nodes/constants.js +++ b/src/ruby/nodes/constants.js @@ -1,5 +1,5 @@ -const { concat, group, indent, join, softline } = require("../prettier"); -const { makeCall } = require("../utils"); +const { concat, group, indent, join, softline } = require("../../prettier"); +const { makeCall } = require("../../utils"); function printConstPath(path, opts, print) { return join("::", path.map(print, "body")); diff --git a/src/nodes/flow.js b/src/ruby/nodes/flow.js similarity index 94% rename from src/nodes/flow.js rename to src/ruby/nodes/flow.js index c3fe3da8..dae05715 100644 --- a/src/nodes/flow.js +++ b/src/ruby/nodes/flow.js @@ -1,5 +1,5 @@ -const { concat, join } = require("../prettier"); -const { literal } = require("../utils"); +const { concat, join } = require("../../prettier"); +const { literal } = require("../../utils"); const nodeDive = (node, steps) => { let current = node; diff --git a/src/nodes/hashes.js b/src/ruby/nodes/hashes.js similarity index 96% rename from src/nodes/hashes.js rename to src/ruby/nodes/hashes.js index 0f781c8f..45c24cb2 100644 --- a/src/nodes/hashes.js +++ b/src/ruby/nodes/hashes.js @@ -1,9 +1,16 @@ -const { concat, group, ifBreak, indent, join, line } = require("../prettier"); +const { + concat, + group, + ifBreak, + indent, + join, + line +} = require("../../prettier"); const { getTrailingComma, printEmptyCollection, skipAssignIndent -} = require("../utils"); +} = require("../../utils"); // When attempting to convert a hash rocket into a hash label, you need to take // care because only certain patterns are allowed. Ruby source says that they diff --git a/src/nodes/heredocs.js b/src/ruby/nodes/heredocs.js similarity index 89% rename from src/nodes/heredocs.js rename to src/ruby/nodes/heredocs.js index 356bd032..0ceb6e9b 100644 --- a/src/nodes/heredocs.js +++ b/src/ruby/nodes/heredocs.js @@ -1,5 +1,5 @@ -const { concat, group, lineSuffix, join } = require("../prettier"); -const { literalLineNoBreak } = require("../utils"); +const { concat, group, lineSuffix, join } = require("../../prettier"); +const { literalLineNoBreak } = require("../../utils"); function printHeredoc(path, opts, print) { const { body, ending } = path.getValue(); diff --git a/src/nodes/hooks.js b/src/ruby/nodes/hooks.js similarity index 90% rename from src/nodes/hooks.js rename to src/ruby/nodes/hooks.js index 58be9d57..1527a384 100644 --- a/src/nodes/hooks.js +++ b/src/ruby/nodes/hooks.js @@ -1,5 +1,5 @@ -const { concat, group, indent, line } = require("../prettier"); -const { isEmptyStmts } = require("../utils"); +const { concat, group, indent, line } = require("../../prettier"); +const { isEmptyStmts } = require("../../utils"); // The `BEGIN` and `END` keywords are used to hook into the Ruby process. Any // `BEGIN` blocks are executed right when the process starts up, and the `END` diff --git a/src/nodes/ints.js b/src/ruby/nodes/ints.js similarity index 100% rename from src/nodes/ints.js rename to src/ruby/nodes/ints.js diff --git a/src/nodes/lambdas.js b/src/ruby/nodes/lambdas.js similarity index 94% rename from src/nodes/lambdas.js rename to src/ruby/nodes/lambdas.js index 9beadbe8..5cf6114d 100644 --- a/src/nodes/lambdas.js +++ b/src/ruby/nodes/lambdas.js @@ -1,5 +1,5 @@ -const { concat, group, ifBreak, indent, line } = require("../prettier"); -const { hasAncestor } = require("../utils"); +const { concat, group, ifBreak, indent, line } = require("../../prettier"); +const { hasAncestor } = require("../../utils"); // We can have our params coming in as the first child of the main lambda node, // or if we have them wrapped in parens then they'll be one level deeper. Even diff --git a/src/nodes/loops.js b/src/ruby/nodes/loops.js similarity index 94% rename from src/nodes/loops.js rename to src/ruby/nodes/loops.js index 4bfe418b..f09170c1 100644 --- a/src/nodes/loops.js +++ b/src/ruby/nodes/loops.js @@ -7,10 +7,10 @@ const { ifBreak, indent, softline -} = require("../prettier"); +} = require("../../prettier"); -const { containsAssignment } = require("../utils"); -const inlineEnsureParens = require("../utils/inlineEnsureParens"); +const { containsAssignment } = require("../../utils"); +const inlineEnsureParens = require("../../utils/inlineEnsureParens"); function printLoop(keyword, modifier) { return function printLoopWithOptions(path, { rubyModifier }, print) { diff --git a/src/nodes/massign.js b/src/ruby/nodes/massign.js similarity index 95% rename from src/nodes/massign.js rename to src/ruby/nodes/massign.js index 6e37c642..0266732a 100644 --- a/src/nodes/massign.js +++ b/src/ruby/nodes/massign.js @@ -1,4 +1,11 @@ -const { concat, group, indent, join, line, softline } = require("../prettier"); +const { + concat, + group, + indent, + join, + line, + softline +} = require("../../prettier"); function printMAssign(path, opts, print) { let right = path.call(print, "body", 1); diff --git a/src/nodes/methods.js b/src/ruby/nodes/methods.js similarity index 96% rename from src/nodes/methods.js rename to src/ruby/nodes/methods.js index 43c71d5d..a5a71b2f 100644 --- a/src/nodes/methods.js +++ b/src/ruby/nodes/methods.js @@ -1,4 +1,4 @@ -const { concat, group, hardline, indent, line } = require("../prettier"); +const { concat, group, hardline, indent, line } = require("../../prettier"); function printMethod(offset) { return function printMethodWithOffset(path, opts, print) { diff --git a/src/nodes/operators.js b/src/ruby/nodes/operators.js similarity index 94% rename from src/nodes/operators.js rename to src/ruby/nodes/operators.js index 3b99651b..094b7b2e 100644 --- a/src/nodes/operators.js +++ b/src/ruby/nodes/operators.js @@ -1,5 +1,5 @@ -const { concat, group, indent, line, softline } = require("../prettier"); -const { noIndent } = require("../utils"); +const { concat, group, indent, line, softline } = require("../../prettier"); +const { noIndent } = require("../../utils"); function printBinary(path, opts, print) { const [_leftNode, operator, rightNode] = path.getValue().body; diff --git a/src/nodes/params.js b/src/ruby/nodes/params.js similarity index 94% rename from src/nodes/params.js rename to src/ruby/nodes/params.js index 4aa498be..52709656 100644 --- a/src/nodes/params.js +++ b/src/ruby/nodes/params.js @@ -1,5 +1,12 @@ -const { concat, group, join, indent, line, softline } = require("../prettier"); -const { literal } = require("../utils"); +const { + concat, + group, + join, + indent, + line, + softline +} = require("../../prettier"); +const { literal } = require("../../utils"); function printRestParam(symbol) { return function printRestParamWithSymbol(path, opts, print) { diff --git a/src/nodes/patterns.js b/src/ruby/nodes/patterns.js similarity index 97% rename from src/nodes/patterns.js rename to src/ruby/nodes/patterns.js index 26b9806e..d349511f 100644 --- a/src/nodes/patterns.js +++ b/src/ruby/nodes/patterns.js @@ -1,4 +1,11 @@ -const { concat, group, hardline, indent, join, line } = require("../prettier"); +const { + concat, + group, + hardline, + indent, + join, + line +} = require("../../prettier"); const patterns = ["aryptn", "binary", "fndptn", "hshptn", "rassign"]; diff --git a/src/nodes/regexp.js b/src/ruby/nodes/regexp.js similarity index 95% rename from src/nodes/regexp.js rename to src/ruby/nodes/regexp.js index 1272536b..faa496aa 100644 --- a/src/nodes/regexp.js +++ b/src/ruby/nodes/regexp.js @@ -1,5 +1,5 @@ -const { concat } = require("../prettier"); -const { hasAncestor } = require("../utils"); +const { concat } = require("../../prettier"); +const { hasAncestor } = require("../../utils"); function hasContent(node, pattern) { return node.body.some( diff --git a/src/nodes/rescue.js b/src/ruby/nodes/rescue.js similarity index 96% rename from src/nodes/rescue.js rename to src/ruby/nodes/rescue.js index 76948f4a..d99b6ca3 100644 --- a/src/nodes/rescue.js +++ b/src/ruby/nodes/rescue.js @@ -6,8 +6,8 @@ const { indent, join, line -} = require("../prettier"); -const { literal } = require("../utils"); +} = require("../../prettier"); +const { literal } = require("../../utils"); function printBegin(path, opts, print) { return concat([ diff --git a/src/nodes/return.js b/src/ruby/nodes/return.js similarity index 97% rename from src/nodes/return.js rename to src/ruby/nodes/return.js index e746b74b..1e0120fc 100644 --- a/src/nodes/return.js +++ b/src/ruby/nodes/return.js @@ -6,8 +6,8 @@ const { line, join, softline -} = require("../prettier"); -const { literal } = require("../utils"); +} = require("../../prettier"); +const { literal } = require("../../utils"); // You can't skip the parentheses if you have the `and` or `or` operator, // because they have low enough operator precedence that you need to explicitly diff --git a/src/nodes/statements.js b/src/ruby/nodes/statements.js similarity index 99% rename from src/nodes/statements.js rename to src/ruby/nodes/statements.js index e255b9b1..3ac097dd 100644 --- a/src/nodes/statements.js +++ b/src/ruby/nodes/statements.js @@ -10,7 +10,7 @@ const { literalline, softline, trim -} = require("../prettier"); +} = require("../../prettier"); function printBodyStmt(path, opts, print) { const [stmts, rescue, elseClause, ensure] = path.getValue().body; diff --git a/src/nodes/strings.js b/src/ruby/nodes/strings.js similarity index 99% rename from src/nodes/strings.js rename to src/ruby/nodes/strings.js index 8f3493a8..57a9b4db 100644 --- a/src/nodes/strings.js +++ b/src/ruby/nodes/strings.js @@ -6,7 +6,7 @@ const { literalline, softline, join -} = require("../prettier"); +} = require("../../prettier"); // If there is some part of this string that matches an escape sequence or that // contains the interpolation pattern ("#{"), then we are locked into whichever diff --git a/src/nodes/super.js b/src/ruby/nodes/super.js similarity index 87% rename from src/nodes/super.js rename to src/ruby/nodes/super.js index d189dbd7..32d625eb 100644 --- a/src/nodes/super.js +++ b/src/ruby/nodes/super.js @@ -1,5 +1,5 @@ -const { align, concat, group, join, line } = require("../prettier"); -const { literal } = require("../utils"); +const { align, concat, group, join, line } = require("../../prettier"); +const { literal } = require("../../utils"); function printSuper(path, opts, print) { const args = path.getValue().body[0]; diff --git a/src/nodes/undef.js b/src/ruby/nodes/undef.js similarity index 96% rename from src/nodes/undef.js rename to src/ruby/nodes/undef.js index 63ef092c..1e2bbb34 100644 --- a/src/nodes/undef.js +++ b/src/ruby/nodes/undef.js @@ -5,7 +5,7 @@ const { group, join, line -} = require("../prettier"); +} = require("../../prettier"); function printUndefSymbol(path, opts, print) { const node = path.getValue(); diff --git a/src/parser.js b/src/ruby/parser.js similarity index 100% rename from src/parser.js rename to src/ruby/parser.js diff --git a/src/parser.rb b/src/ruby/parser.rb similarity index 99% rename from src/parser.rb rename to src/ruby/parser.rb index 4c45e02b..05533a1a 100755 --- a/src/parser.rb +++ b/src/ruby/parser.rb @@ -1200,8 +1200,6 @@ def on_fndptn(const, presplat, args, postsplat) beging = const || find_scanner_event(:@lbracket) ending = find_scanner_event(:@rbracket) - pieces = [const, presplat, *args, postsplat].compact - { type: :fndptn, body: [const, presplat, args, postsplat], diff --git a/src/printer.js b/src/ruby/printer.js similarity index 98% rename from src/printer.js rename to src/ruby/printer.js index 95d0953d..979d3931 100644 --- a/src/printer.js +++ b/src/ruby/printer.js @@ -1,4 +1,4 @@ -const { concat, trim } = require("./prettier"); +const { concat, trim } = require("../prettier"); const embed = require("./embed"); const nodes = require("./nodes"); diff --git a/src/toProc.js b/src/ruby/toProc.js similarity index 100% rename from src/toProc.js rename to src/ruby/toProc.js diff --git a/test/js/parser.rb b/test/js/parser.rb index 924e4624..a36ffe61 100644 --- a/test/js/parser.rb +++ b/test/js/parser.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'socket' -require_relative '../../src/parser' +require_relative '../../src/ruby/parser' # Set the program name so that it's easy to find if we need it $PROGRAM_NAME = 'prettier-ruby-test-parser' diff --git a/test/js/comments.test.js b/test/js/ruby/comments.test.js similarity index 99% rename from test/js/comments.test.js rename to test/js/ruby/comments.test.js index fc639814..f82ea413 100644 --- a/test/js/comments.test.js +++ b/test/js/ruby/comments.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("./utils"); +const { ruby } = require("../utils"); describe("comments", () => { describe("on their own line", () => { diff --git a/test/js/embed.test.js b/test/js/ruby/embed.test.js similarity index 96% rename from test/js/embed.test.js rename to test/js/ruby/embed.test.js index 3bd0ae5a..fccaed07 100644 --- a/test/js/embed.test.js +++ b/test/js/ruby/embed.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("./utils"); +const { ruby } = require("../utils"); describe("embed", () => { test("formats correctly on straight heredocs", () => { diff --git a/test/js/encoding.test.js b/test/js/ruby/encoding.test.js similarity index 100% rename from test/js/encoding.test.js rename to test/js/ruby/encoding.test.js diff --git a/test/js/errors.test.js b/test/js/ruby/errors.test.js similarity index 100% rename from test/js/errors.test.js rename to test/js/ruby/errors.test.js diff --git a/test/js/hasPragma.test.js b/test/js/ruby/hasPragma.test.js similarity index 83% rename from test/js/hasPragma.test.js rename to test/js/ruby/hasPragma.test.js index cc2b1804..639dca29 100644 --- a/test/js/hasPragma.test.js +++ b/test/js/ruby/hasPragma.test.js @@ -1,4 +1,4 @@ -const { hasPragma } = require("../../src/ruby").parsers.ruby; +const { hasPragma } = require("../../../src/plugin").parsers.ruby; describe("hasPragma", () => { test("checks for @prettier comments", () => { diff --git a/test/js/ignore.test.js b/test/js/ruby/ignore.test.js similarity index 85% rename from test/js/ignore.test.js rename to test/js/ruby/ignore.test.js index e37939a1..bd389d31 100644 --- a/test/js/ignore.test.js +++ b/test/js/ruby/ignore.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("./utils"); +const { ruby } = require("../utils"); describe("ignore", () => { test("you can ignore code blocks", () => { diff --git a/test/js/lang.test.js b/test/js/ruby/lang.test.js similarity index 86% rename from test/js/lang.test.js rename to test/js/ruby/lang.test.js index 693a812b..c3ef8265 100644 --- a/test/js/lang.test.js +++ b/test/js/ruby/lang.test.js @@ -11,7 +11,7 @@ expect.extend({ }); test("different lang settings don't break", () => { - const script = path.join(__dirname, "../../node_modules/.bin/prettier"); + const script = path.join(__dirname, "../../../node_modules/.bin/prettier"); const child = spawnSync( process.execPath, [script, "--plugin", ".", "--parser", "ruby"], diff --git a/test/js/layout.test.js b/test/js/ruby/layout.test.js similarity index 100% rename from test/js/layout.test.js rename to test/js/ruby/layout.test.js diff --git a/test/js/locations.test.js b/test/js/ruby/locations.test.js similarity index 82% rename from test/js/locations.test.js rename to test/js/ruby/locations.test.js index 50e6c9bc..fa1519d1 100644 --- a/test/js/locations.test.js +++ b/test/js/ruby/locations.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("../../src/ruby").parsers; +const { ruby } = require("../../../src/plugin").parsers; describe("locations", () => { test("locStart and locEnd are defined", () => { diff --git a/test/js/nodes.test.js b/test/js/ruby/nodes.test.js similarity index 93% rename from test/js/nodes.test.js rename to test/js/ruby/nodes.test.js index 317b0a10..54b0d55d 100644 --- a/test/js/nodes.test.js +++ b/test/js/ruby/nodes.test.js @@ -1,7 +1,7 @@ const { spawnSync } = require("child_process"); -const nodes = require("../../src/nodes"); -const print = require("../../src/printer").print; +const nodes = require("../../../src/ruby/nodes"); +const print = require("../../../src/ruby/printer").print; const expectedUnhandledNodes = [ "alias_error", diff --git a/test/js/nodes/alias.test.js b/test/js/ruby/nodes/alias.test.js similarity index 96% rename from test/js/nodes/alias.test.js rename to test/js/ruby/nodes/alias.test.js index f08a13c4..902e7e45 100644 --- a/test/js/nodes/alias.test.js +++ b/test/js/ruby/nodes/alias.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../utils"); +const { long, ruby } = require("../../utils"); describe("alias", () => { test("bare word aliases", () => expect("alias foo bar").toMatchFormat()); diff --git a/test/js/nodes/aref.test.js b/test/js/ruby/nodes/aref.test.js similarity index 93% rename from test/js/nodes/aref.test.js rename to test/js/ruby/nodes/aref.test.js index 84b68364..a191ebd0 100644 --- a/test/js/nodes/aref.test.js +++ b/test/js/ruby/nodes/aref.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("../utils"); +const { ruby } = require("../../utils"); describe("aref", () => { test("literal reference", () => expect("array[5]").toMatchFormat()); diff --git a/test/js/nodes/arrays.test.js b/test/js/ruby/nodes/arrays.test.js similarity index 98% rename from test/js/nodes/arrays.test.js rename to test/js/ruby/nodes/arrays.test.js index 69951163..1085f334 100644 --- a/test/js/nodes/arrays.test.js +++ b/test/js/ruby/nodes/arrays.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../utils"); +const { long, ruby } = require("../../utils"); describe("array", () => { test("empty arrays", () => expect("[]").toMatchFormat()); diff --git a/test/js/nodes/assign.test.js b/test/js/ruby/nodes/assign.test.js similarity index 97% rename from test/js/nodes/assign.test.js rename to test/js/ruby/nodes/assign.test.js index 5855302c..0c29b326 100644 --- a/test/js/nodes/assign.test.js +++ b/test/js/ruby/nodes/assign.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../utils"); +const { long, ruby } = require("../../utils"); describe("assign", () => { describe("single assignment", () => { diff --git a/test/js/nodes/binary.test.js b/test/js/ruby/nodes/binary.test.js similarity index 93% rename from test/js/nodes/binary.test.js rename to test/js/ruby/nodes/binary.test.js index 5546f7de..6110368d 100644 --- a/test/js/nodes/binary.test.js +++ b/test/js/ruby/nodes/binary.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../utils"); +const { long, ruby } = require("../../utils"); describe("binary", () => { test("single line", () => expect("foo && bar && baz").toMatchFormat()); diff --git a/test/js/nodes/blocks.test.js b/test/js/ruby/nodes/blocks.test.js similarity index 98% rename from test/js/nodes/blocks.test.js rename to test/js/ruby/nodes/blocks.test.js index ea269f86..af5831b1 100644 --- a/test/js/nodes/blocks.test.js +++ b/test/js/ruby/nodes/blocks.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../utils"); +const { long, ruby } = require("../../utils"); describe("blocks", () => { test("empty", () => expect("loop {}").toMatchFormat()); diff --git a/test/js/nodes/break.test.js b/test/js/ruby/nodes/break.test.js similarity index 94% rename from test/js/nodes/break.test.js rename to test/js/ruby/nodes/break.test.js index 27f33a90..3f82888e 100644 --- a/test/js/nodes/break.test.js +++ b/test/js/ruby/nodes/break.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("../utils"); +const { ruby } = require("../../utils"); describe("break", () => { test("empty break", () => expect("break").toMatchFormat()); diff --git a/test/js/nodes/calls.test.js b/test/js/ruby/nodes/calls.test.js similarity index 97% rename from test/js/nodes/calls.test.js rename to test/js/ruby/nodes/calls.test.js index 58d18821..43ecfa4a 100644 --- a/test/js/nodes/calls.test.js +++ b/test/js/ruby/nodes/calls.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../utils"); +const { long, ruby } = require("../../utils"); describe("calls", () => { test("simple calls", () => { diff --git a/test/js/nodes/case.test.js b/test/js/ruby/nodes/case.test.js similarity index 97% rename from test/js/nodes/case.test.js rename to test/js/ruby/nodes/case.test.js index a4a4bf22..b0632fa6 100644 --- a/test/js/nodes/case.test.js +++ b/test/js/ruby/nodes/case.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../utils"); +const { long, ruby } = require("../../utils"); describe("case", () => { test("empty case", () => { diff --git a/test/js/nodes/class.test.js b/test/js/ruby/nodes/class.test.js similarity index 97% rename from test/js/nodes/class.test.js rename to test/js/ruby/nodes/class.test.js index 314e70b2..57f1832d 100644 --- a/test/js/nodes/class.test.js +++ b/test/js/ruby/nodes/class.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../utils"); +const { long, ruby } = require("../../utils"); describe("class", () => { test("basic nesting", () => { diff --git a/test/js/nodes/conditionals.test.js b/test/js/ruby/nodes/conditionals.test.js similarity index 99% rename from test/js/nodes/conditionals.test.js rename to test/js/ruby/nodes/conditionals.test.js index 3f2bb5b2..67db302c 100644 --- a/test/js/nodes/conditionals.test.js +++ b/test/js/ruby/nodes/conditionals.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../utils"); +const { long, ruby } = require("../../utils"); describe("conditionals", () => { describe("not operator", () => { diff --git a/test/js/nodes/defined.test.js b/test/js/ruby/nodes/defined.test.js similarity index 94% rename from test/js/nodes/defined.test.js rename to test/js/ruby/nodes/defined.test.js index be9a80ba..447ef00e 100644 --- a/test/js/nodes/defined.test.js +++ b/test/js/ruby/nodes/defined.test.js @@ -1,4 +1,4 @@ -const { long } = require("../utils"); +const { long } = require("../../utils"); describe("defined", () => { test("no parens", () => expect("defined? a").toChangeFormat("defined?(a)")); diff --git a/test/js/nodes/embdoc.test.js b/test/js/ruby/nodes/embdoc.test.js similarity index 94% rename from test/js/nodes/embdoc.test.js rename to test/js/ruby/nodes/embdoc.test.js index 85bb8c17..0a80d63e 100644 --- a/test/js/nodes/embdoc.test.js +++ b/test/js/ruby/nodes/embdoc.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("../utils"); +const { ruby } = require("../../utils"); describe("embdoc", () => { test("basic embdocs", () => { diff --git a/test/js/nodes/hashes.test.js b/test/js/ruby/nodes/hashes.test.js similarity index 99% rename from test/js/nodes/hashes.test.js rename to test/js/ruby/nodes/hashes.test.js index b5b098b6..4c1d19f8 100644 --- a/test/js/nodes/hashes.test.js +++ b/test/js/ruby/nodes/hashes.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../utils"); +const { long, ruby } = require("../../utils"); describe("hash", () => { test("empty", () => expect("{}").toMatchFormat()); diff --git a/test/js/nodes/heredocs.test.js b/test/js/ruby/nodes/heredocs.test.js similarity index 99% rename from test/js/nodes/heredocs.test.js rename to test/js/ruby/nodes/heredocs.test.js index 8a8a704c..50d3fb18 100644 --- a/test/js/nodes/heredocs.test.js +++ b/test/js/ruby/nodes/heredocs.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../utils"); +const { long, ruby } = require("../../utils"); describe("heredocs", () => { describe("straight", () => { diff --git a/test/js/nodes/hooks.test.js b/test/js/ruby/nodes/hooks.test.js similarity index 93% rename from test/js/nodes/hooks.test.js rename to test/js/ruby/nodes/hooks.test.js index b6475a8b..52be7746 100644 --- a/test/js/nodes/hooks.test.js +++ b/test/js/ruby/nodes/hooks.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../utils"); +const { long, ruby } = require("../../utils"); describe.each(["BEGIN", "END"])("%s hook", (hook) => { test("shortens to one line", () => diff --git a/test/js/nodes/kwargs.test.js b/test/js/ruby/nodes/kwargs.test.js similarity index 100% rename from test/js/nodes/kwargs.test.js rename to test/js/ruby/nodes/kwargs.test.js diff --git a/test/js/nodes/lambda.test.js b/test/js/ruby/nodes/lambda.test.js similarity index 98% rename from test/js/nodes/lambda.test.js rename to test/js/ruby/nodes/lambda.test.js index 1427a793..f86bf7e9 100644 --- a/test/js/nodes/lambda.test.js +++ b/test/js/ruby/nodes/lambda.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../utils"); +const { long, ruby } = require("../../utils"); describe("lambda", () => { test("plain stabby lambda literal", () => expect("-> { 1 }").toMatchFormat()); diff --git a/test/js/nodes/loops.test.js b/test/js/ruby/nodes/loops.test.js similarity index 98% rename from test/js/nodes/loops.test.js rename to test/js/ruby/nodes/loops.test.js index 4d1ac29a..998ee05e 100644 --- a/test/js/nodes/loops.test.js +++ b/test/js/ruby/nodes/loops.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../utils"); +const { long, ruby } = require("../../utils"); describe.each(["while", "until"])("%s", (keyword) => { test("aligns predicates", () => diff --git a/test/js/nodes/massign.test.js b/test/js/ruby/nodes/massign.test.js similarity index 100% rename from test/js/nodes/massign.test.js rename to test/js/ruby/nodes/massign.test.js diff --git a/test/js/nodes/method.test.js b/test/js/ruby/nodes/method.test.js similarity index 99% rename from test/js/nodes/method.test.js rename to test/js/ruby/nodes/method.test.js index 0e7c390c..6f2b8e17 100644 --- a/test/js/nodes/method.test.js +++ b/test/js/ruby/nodes/method.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../utils"); +const { long, ruby } = require("../../utils"); describe("method", () => { describe("definitions", () => { diff --git a/test/js/nodes/next.test.js b/test/js/ruby/nodes/next.test.js similarity index 93% rename from test/js/nodes/next.test.js rename to test/js/ruby/nodes/next.test.js index f45a4f7a..549589b8 100644 --- a/test/js/nodes/next.test.js +++ b/test/js/ruby/nodes/next.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("../utils"); +const { ruby } = require("../../utils"); describe("next", () => { test("bare", () => expect("next").toMatchFormat()); diff --git a/test/js/nodes/numbers.test.js b/test/js/ruby/nodes/numbers.test.js similarity index 100% rename from test/js/nodes/numbers.test.js rename to test/js/ruby/nodes/numbers.test.js diff --git a/test/js/nodes/patterns.test.js b/test/js/ruby/nodes/patterns.test.js similarity index 97% rename from test/js/nodes/patterns.test.js rename to test/js/ruby/nodes/patterns.test.js index 04f18fda..a63e4280 100644 --- a/test/js/nodes/patterns.test.js +++ b/test/js/ruby/nodes/patterns.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("../utils"); +const { ruby } = require("../../utils"); describe("patterns", () => { if (process.env.RUBY_VERSION <= "2.7") { diff --git a/test/js/nodes/ranges.test.js b/test/js/ruby/nodes/ranges.test.js similarity index 100% rename from test/js/nodes/ranges.test.js rename to test/js/ruby/nodes/ranges.test.js diff --git a/test/js/nodes/regexp.test.js b/test/js/ruby/nodes/regexp.test.js similarity index 97% rename from test/js/nodes/regexp.test.js rename to test/js/ruby/nodes/regexp.test.js index 5e83c359..ddc10ce9 100644 --- a/test/js/nodes/regexp.test.js +++ b/test/js/ruby/nodes/regexp.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("../utils"); +const { ruby } = require("../../utils"); describe("regexp", () => { test("basic", () => expect("/abc/").toMatchFormat()); diff --git a/test/js/nodes/rescue.test.js b/test/js/ruby/nodes/rescue.test.js similarity index 98% rename from test/js/nodes/rescue.test.js rename to test/js/ruby/nodes/rescue.test.js index b8fd3dd4..ea3c8d5f 100644 --- a/test/js/nodes/rescue.test.js +++ b/test/js/ruby/nodes/rescue.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("../utils"); +const { ruby } = require("../../utils"); describe("rescue", () => { test("inline", () => diff --git a/test/js/nodes/return.test.js b/test/js/ruby/nodes/return.test.js similarity index 97% rename from test/js/nodes/return.test.js rename to test/js/ruby/nodes/return.test.js index 5081777a..71da2534 100644 --- a/test/js/nodes/return.test.js +++ b/test/js/ruby/nodes/return.test.js @@ -1,4 +1,4 @@ -const { long } = require("../utils"); +const { long } = require("../../utils"); describe("return", () => { test("bare", () => expect("return").toMatchFormat()); diff --git a/test/js/nodes/strings.test.js b/test/js/ruby/nodes/strings.test.js similarity index 99% rename from test/js/nodes/strings.test.js rename to test/js/ruby/nodes/strings.test.js index 5d1dac49..1ca0626e 100644 --- a/test/js/nodes/strings.test.js +++ b/test/js/ruby/nodes/strings.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../utils"); +const { long, ruby } = require("../../utils"); describe("strings", () => { describe("%-literals with escape sequences in the middle", () => { diff --git a/test/js/nodes/super.test.js b/test/js/ruby/nodes/super.test.js similarity index 97% rename from test/js/nodes/super.test.js rename to test/js/ruby/nodes/super.test.js index d094ef7a..e2d9c672 100644 --- a/test/js/nodes/super.test.js +++ b/test/js/ruby/nodes/super.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("../utils"); +const { ruby } = require("../../utils"); describe("super", () => { test("bare", () => expect("super").toMatchFormat()); diff --git a/test/js/nodes/undef.test.js b/test/js/ruby/nodes/undef.test.js similarity index 95% rename from test/js/nodes/undef.test.js rename to test/js/ruby/nodes/undef.test.js index 6eab3d56..9cf10963 100644 --- a/test/js/nodes/undef.test.js +++ b/test/js/ruby/nodes/undef.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../utils"); +const { long, ruby } = require("../../utils"); describe("undef", () => { test("single inline", () => expect("undef foo").toMatchFormat()); diff --git a/test/js/nodes/yield.test.js b/test/js/ruby/nodes/yield.test.js similarity index 100% rename from test/js/nodes/yield.test.js rename to test/js/ruby/nodes/yield.test.js diff --git a/test/js/toProc.test.js b/test/js/ruby/toProc.test.js similarity index 98% rename from test/js/toProc.test.js rename to test/js/ruby/toProc.test.js index 2dd165e8..c022a3b2 100644 --- a/test/js/toProc.test.js +++ b/test/js/ruby/toProc.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("./utils"); +const { ruby } = require("../utils"); describe("to_proc transform", () => { test("basic inline", () => diff --git a/test/js/setupTests.js b/test/js/setupTests.js index 2dbe0a9b..af60abf3 100644 --- a/test/js/setupTests.js +++ b/test/js/setupTests.js @@ -93,7 +93,7 @@ expect.extend({ }, toInferParser(filename) { const filepath = path.join(__dirname, filename); - const plugin = path.join(__dirname, "..", "..", "src", "ruby"); + const plugin = path.join(__dirname, "..", "..", "src", "plugin"); return prettier .getFileInfo(filepath, { plugins: [plugin] }) diff --git a/test/rb/metadata_test.rb b/test/rb/metadata_test.rb index 7b758f99..4f06030a 100644 --- a/test/rb/metadata_test.rb +++ b/test/rb/metadata_test.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'test_helper' -require_relative '../../src/parser' +require_relative '../../src/ruby/parser' class MetadataTest < Minitest::Test def test_BEGIN From 199677f43eb4d5eb5e34958c1579f8e24e30cd37 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sat, 2 Jan 2021 13:23:13 -0500 Subject: [PATCH 032/785] command_call with ternary argument --- CHANGELOG.md | 5 ++++ src/ruby/nodes/commands.js | 36 +++++++++++++++---------- test/js/ruby/nodes/conditionals.test.js | 30 +++++++++++++++++++++ 3 files changed, 57 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20729511..9f118052 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Changed + +- [@lukyth], [@kddeisz] - Ensure if a ternary breaks into an `if..else..end` within a `command_call` node that parentheses are added. + ## [1.2.2] - 2021-01-01 ### Changed @@ -1096,6 +1100,7 @@ would previously result in `array[]`, but now prints properly. [@kmcq]: https://github.com/kmcq [@krachtstefan]: https://github.com/krachtstefan [@localhostdotdev]: https://github.com/localhostdotdev +[@lukyth]: https://github.com/lukyth [@marcmaniez]: https://github.com/MarcManiez [@masqita]: https://github.com/masqita [@matt-wratt]: https://github.com/matt-wratt diff --git a/src/ruby/nodes/commands.js b/src/ruby/nodes/commands.js index 935cf26f..04feb676 100644 --- a/src/ruby/nodes/commands.js +++ b/src/ruby/nodes/commands.js @@ -55,17 +55,17 @@ function skipArgsAlign(path) { // If there is a ternary argument to a command and it's going to get broken // into multiple lines, then we're going to have to use parentheses around the // command in order to make sure operator precedence doesn't get messed up. -function hasTernaryArg(path) { - const node = path.getValue(); - - return node.body[1].body[0].body.some((child) => child.type === "ifop"); +function hasTernaryArg(node) { + return node.body[0].body.some((child) => child.type === "ifop"); } function printCommand(path, opts, print) { + const node = path.getValue(); + const command = path.call(print, "body", 0); const joinedArgs = join(concat([",", line]), path.call(print, "body", 1)); - const hasTernary = hasTernaryArg(path); + const hasTernary = hasTernaryArg(node.body[1]); let breakArgs; if (hasTernary) { @@ -90,26 +90,34 @@ function printCommand(path, opts, print) { } function printCommandCall(path, opts, print) { + const node = path.getValue(); const parts = [ path.call(print, "body", 0), makeCall(path, opts, print), path.call(print, "body", 2) ]; - if (!path.getValue().body[3]) { + if (!node.body[3]) { return concat(parts); } - parts.push(" "); + const argDocs = join(concat([",", line]), path.call(print, "body", 3)); + let breakDoc; - const joinedArgs = join(concat([",", line]), path.call(print, "body", 3)); - const breakArgs = skipArgsAlign(path) - ? joinedArgs - : align(docLength(concat(parts)), joinedArgs); + if (hasTernaryArg(node.body[3])) { + parts.push("("); + breakDoc = parts.concat(indent(concat([softline, argDocs])), softline, ")"); + } else if (skipArgsAlign(path)) { + parts.push(" "); + breakDoc = parts.concat(argDocs); + } else { + parts.push(" "); + breakDoc = parts.concat(align(docLength(concat(parts)), argDocs)); + } - return group( - ifBreak(concat(parts.concat(breakArgs)), concat(parts.concat(joinedArgs))) - ); + const joinedDoc = parts.concat(argDocs); + + return group(ifBreak(concat(breakDoc), concat(joinedDoc))); } module.exports = { diff --git a/test/js/ruby/nodes/conditionals.test.js b/test/js/ruby/nodes/conditionals.test.js index 67db302c..c65344f2 100644 --- a/test/js/ruby/nodes/conditionals.test.js +++ b/test/js/ruby/nodes/conditionals.test.js @@ -342,6 +342,36 @@ describe("conditionals", () => { return expect(content).toChangeFormat("(a ? 1 : 2) + 1"); }); + test("adds parens if within a command", () => { + const content = `foo baz ? ${long} : ${long}`; + const expected = ruby(` + foo( + if baz + ${long} + else + ${long} + end + ) + `); + + return expect(content).toChangeFormat(expected); + }); + + test("adds parens if within a command_call", () => { + const content = `foo.bar baz ? ${long} : ${long}`; + const expected = ruby(` + foo.bar( + if baz + ${long} + else + ${long} + end + ) + `); + + return expect(content).toChangeFormat(expected); + }); + describe("unable to transform", () => { test("breaking", () => { const content = ruby(` From 92fcb383e080049e6942fedad57c509744bfd28a Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sat, 2 Jan 2021 18:50:53 -0500 Subject: [PATCH 033/785] Fix for #759 --- CHANGELOG.md | 1 + src/ruby/parser.rb | 10 ++++++++++ test/js/ruby/nodes/loops.test.js | 25 +++++++++++++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f118052..fd02fc83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Changed - [@lukyth], [@kddeisz] - Ensure if a ternary breaks into an `if..else..end` within a `command_call` node that parentheses are added. +- [@AlanFoster], [@kddeisz] - Ensure you consume the optional `do` keyword on `while` and `until` loops so that it doesn't confuse the parser. ## [1.2.2] - 2021-01-01 diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 05533a1a..d4333a64 100755 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -2297,6 +2297,11 @@ def on_until(predicate, stmts) beging = find_scanner_event(:@kw, 'until') ending = find_scanner_event(:@kw, 'end') + # Consume the do keyword if it exists so that it doesn't get confused for + # some other block + do_event = find_scanner_event(:@kw, 'do', consume: false) + scanner_events.delete(do_event) if do_event + stmts.bind(predicate[:char_end], ending[:char_start]) { @@ -2429,6 +2434,11 @@ def on_while(predicate, stmts) beging = find_scanner_event(:@kw, 'while') ending = find_scanner_event(:@kw, 'end') + # Consume the do keyword if it exists so that it doesn't get confused for + # some other block + do_event = find_scanner_event(:@kw, 'do', consume: false) + scanner_events.delete(do_event) if do_event + stmts.bind(predicate[:char_end], ending[:char_start]) { diff --git a/test/js/ruby/nodes/loops.test.js b/test/js/ruby/nodes/loops.test.js index 998ee05e..e78710a3 100644 --- a/test/js/ruby/nodes/loops.test.js +++ b/test/js/ruby/nodes/loops.test.js @@ -173,4 +173,29 @@ describe.each(["while", "until"])("%s", (keyword) => { )); } ); + + // https://github.com/prettier/plugin-ruby/issues/759 + test.each(["while", "until"])("%s handles do keyword", (keyword) => { + const content = ruby(` + %w[foo bar].each do |resource| + puts resource + + # comment comment + ${keyword} @client.missing?(resource) do + sleep 1 + end + end + `); + + const expected = ruby(` + %w[foo bar].each do |resource| + puts resource + + # comment comment + sleep 1 ${keyword} @client.missing?(resource) + end + `); + + return expect(content).toChangeFormat(expected); + }); }); From adc3f9690998e4ba3f325532827458379612d561 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sat, 2 Jan 2021 19:08:13 -0500 Subject: [PATCH 034/785] Fix for #758 --- CHANGELOG.md | 1 + src/ruby/nodes/hashes.js | 23 ++++++++++++++++++----- test/js/ruby/nodes/hashes.test.js | 19 +++++++++++++++++++ 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd02fc83..353a7c93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [@lukyth], [@kddeisz] - Ensure if a ternary breaks into an `if..else..end` within a `command_call` node that parentheses are added. - [@AlanFoster], [@kddeisz] - Ensure you consume the optional `do` keyword on `while` and `until` loops so that it doesn't confuse the parser. +- [@AlanFoster], [@kddeisz] - Ensure key-value pairs split on line when the key has a comment attached within a hash. ## [1.2.2] - 2021-01-01 diff --git a/src/ruby/nodes/hashes.js b/src/ruby/nodes/hashes.js index 45c24cb2..a2c438ac 100644 --- a/src/ruby/nodes/hashes.js +++ b/src/ruby/nodes/hashes.js @@ -54,8 +54,20 @@ function printHashKeyLabel(path, print) { return print(path); case "symbol_literal": return concat([path.call(print, "body", 0), ":"]); - case "dyna_symbol": - return concat(print(path).parts.slice(1).concat(":")); + case "dyna_symbol": { + const { parts } = print(path); + + // We're going to slice off the starting colon character so that we can + // move it to the end. If there are comments, then we're going to go + // further into the printed doc nodes. + if (parts[0] === ":") { + parts.splice(0, 1); + } else { + parts[1].parts.splice(0, 1); + } + + return concat(parts.concat(":")); + } } } @@ -71,15 +83,16 @@ function printHashKeyRocket(path, print) { } function printAssocNew(path, opts, print) { + const [keyNode, valueNode] = path.getValue().body; const { keyPrinter } = path.getParentNode(); const parts = [path.call((keyPath) => keyPrinter(keyPath, print), "body", 0)]; const valueDoc = path.call(print, "body", 1); - if (skipAssignIndent(path.getValue().body[1])) { - parts.push(" ", valueDoc); - } else { + if (!skipAssignIndent(valueNode) || keyNode.comments) { parts.push(indent(concat([line, valueDoc]))); + } else { + parts.push(" ", valueDoc); } return group(concat(parts)); diff --git a/test/js/ruby/nodes/hashes.test.js b/test/js/ruby/nodes/hashes.test.js index 4c1d19f8..4a1067dd 100644 --- a/test/js/ruby/nodes/hashes.test.js +++ b/test/js/ruby/nodes/hashes.test.js @@ -251,4 +251,23 @@ describe("hash", () => { return expect(content).toMatchFormat(); }); + + // https://github.com/prettier/plugin-ruby/issues/758 + test("splits if the key has a comment attached", () => { + const content = ruby(` + items = { + :'foo-bar'=> # Inline comment + {:name=>'foo-bar', :date=>'1970'}, + } + `); + + const expected = ruby(` + items = { + 'foo-bar': # Inline comment + { name: 'foo-bar', date: '1970' } + } + `); + + return expect(content).toChangeFormat(expected); + }); }); From 840b04e1411e99ecaf18204deba32abc466cf29d Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sat, 2 Jan 2021 21:33:58 -0500 Subject: [PATCH 035/785] Fix for #756 --- CHANGELOG.md | 1 + src/ruby/nodes/loops.js | 11 +++++++---- test/js/ruby/nodes/blocks.test.js | 28 ++++++++++++++++++++-------- 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 353a7c93..c936588b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [@lukyth], [@kddeisz] - Ensure if a ternary breaks into an `if..else..end` within a `command_call` node that parentheses are added. - [@AlanFoster], [@kddeisz] - Ensure you consume the optional `do` keyword on `while` and `until` loops so that it doesn't confuse the parser. - [@AlanFoster], [@kddeisz] - Ensure key-value pairs split on line when the key has a comment attached within a hash. +- [@AlanFoster], [@kddeisz] - Fix for `for` loops that have multiple index variables. ## [1.2.2] - 2021-01-01 diff --git a/src/ruby/nodes/loops.js b/src/ruby/nodes/loops.js index f09170c1..65aa0584 100644 --- a/src/ruby/nodes/loops.js +++ b/src/ruby/nodes/loops.js @@ -6,6 +6,7 @@ const { hardline, ifBreak, indent, + join, softline } = require("../../prettier"); @@ -78,15 +79,17 @@ function printLoop(keyword, modifier) { } function printFor(path, opts, print) { - const [variable, range, stmts] = path.map(print, "body"); + const [varDoc, rangeDoc, stmtsDoc] = path.map(print, "body"); + const varsDoc = + path.getValue().body[0].type === "mlhs" ? join(", ", varDoc) : varDoc; return group( concat([ "for ", - variable, + varsDoc, " in ", - range, - indent(concat([hardline, stmts])), + rangeDoc, + indent(concat([hardline, stmtsDoc])), concat([hardline, "end"]) ]) ); diff --git a/test/js/ruby/nodes/blocks.test.js b/test/js/ruby/nodes/blocks.test.js index af5831b1..22724b85 100644 --- a/test/js/ruby/nodes/blocks.test.js +++ b/test/js/ruby/nodes/blocks.test.js @@ -62,14 +62,26 @@ describe("blocks", () => { return expect(content).toMatchFormat(); }); - test("for loops", () => { - const content = ruby(` - for i in [1, 2, 3] - p i - end - `); - - return expect(content).toMatchFormat(); + describe("for loops", () => { + test("for loops", () => { + const content = ruby(` + for i in [1, 2, 3] + p i + end + `); + + return expect(content).toMatchFormat(); + }); + + test("multiple variables", () => { + const content = ruby(` + for a, b in [[1, 2], [3, 4]] + p i + end + `); + + return expect(content).toMatchFormat(); + }); }); // from ruby test/ruby/test_call.rb From 7035edd6a5d98fc5e4540573be69d3cafb39878a Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sat, 2 Jan 2021 21:48:53 -0500 Subject: [PATCH 036/785] Fix for #757 --- CHANGELOG.md | 1 + bin/debug | 6 +- bin/sexp | 2 +- src/ruby/parser.js | 4 +- src/ruby/parser.rb | 562 ++++++++++++++----------------- test/js/ruby/nodes/loops.test.js | 2 +- test/rb/metadata_test.rb | 197 +++++------ 7 files changed, 344 insertions(+), 430 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c936588b..b88d73a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [@AlanFoster], [@kddeisz] - Ensure you consume the optional `do` keyword on `while` and `until` loops so that it doesn't confuse the parser. - [@AlanFoster], [@kddeisz] - Ensure key-value pairs split on line when the key has a comment attached within a hash. - [@AlanFoster], [@kddeisz] - Fix for `for` loops that have multiple index variables. +- [@AlanFoster], [@kddeisz] - Fix parsing very large files by reducing the size of the JSON output from the parser. ## [1.2.2] - 2021-01-01 diff --git a/bin/debug b/bin/debug index 5acdcc94..4f92bf48 100755 --- a/bin/debug +++ b/bin/debug @@ -122,10 +122,10 @@ const createTree = (parent, node) => { const button = document.createElement("button"); button.onclick = highlight; - button.setAttribute("data-char-start", node.char_start); - button.setAttribute("data-char-end", node.char_end); + button.setAttribute("data-char-start", node.sc); + button.setAttribute("data-char-end", node.ec); - const label = `${node.type} (${node.char_start}-${node.char_end})`; + const label = `${node.type} (${node.sc}-${node.ec})`; if (node.type.startsWith("@")) { button.appendChild(document.createTextNode(`${label} = ${node.body}`)); diff --git a/bin/sexp b/bin/sexp index 8b6325c3..083c9b59 100755 --- a/bin/sexp +++ b/bin/sexp @@ -9,7 +9,7 @@ PP.prepend( group(1, '{', '}') do text obj[:type] text "" + text "C#{obj[:sc]}-#{obj[:ec]}>" group(1) do breakable ' ' diff --git a/src/ruby/parser.js b/src/ruby/parser.js index 28efd366..666c1bb7 100644 --- a/src/ruby/parser.js +++ b/src/ruby/parser.js @@ -67,14 +67,14 @@ function hasPragma(text) { // for returning the index of the character within the source string that is the // beginning of the given node. function locStart(node) { - return node.char_start; + return node.sc; } // This function is critical for comments and cursor support, and is responsible // for returning the index of the character within the source string that is the // ending of the given node. function locEnd(node) { - return node.char_end; + return node.ec; } module.exports = { diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index d4333a64..1468e4a3 100755 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -89,14 +89,14 @@ def find_scanner_event(type, body = :any, consume: true) (SCANNER_EVENTS - defined).each do |event| define_method(:"on_#{event}") do |value| - char_end = char_pos + value.size + ec = char_pos + value.size node = { type: :"@#{event}", body: value, start: lineno, end: lineno, - char_start: char_pos, - char_end: char_end + sc: char_pos, + ec: ec } scanner_events << node @@ -120,8 +120,8 @@ def on_comment(value) value: value[1..-1].chomp.force_encoding('UTF-8'), start: lineno, end: lineno, - char_start: char_pos, - char_end: char_pos + value.length - 1 + sc: char_pos, + ec: char_pos + value.length - 1 } end @@ -140,8 +140,8 @@ def on_ignored_nl(value) body: nil, start: lineno, end: lineno, - char_start: char_pos, - char_end: char_pos + sc: char_pos, + ec: char_pos } end @@ -186,16 +186,13 @@ def on_BEGIN(stmts) beging = find_scanner_event(:@lbrace) ending = find_scanner_event(:@rbrace) - stmts.bind( - find_next_statement_start(beging[:char_end]), - ending[:char_start] - ) + stmts.bind(find_next_statement_start(beging[:ec]), ending[:sc]) find_scanner_event(:@kw, 'BEGIN').merge!( type: :BEGIN, body: [beging, stmts], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] ) end @@ -213,16 +210,13 @@ def on_END(stmts) beging = find_scanner_event(:@lbrace) ending = find_scanner_event(:@rbrace) - stmts.bind( - find_next_statement_start(beging[:char_end]), - ending[:char_start] - ) + stmts.bind(find_next_statement_start(beging[:ec]), ending[:sc]) find_scanner_event(:@kw, 'END').merge!( type: :END, body: [beging, stmts], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] ) end @@ -234,16 +228,16 @@ def on_END(stmts) def on_alias(left, right) beging = find_scanner_event(:@kw, 'alias') - paren = source[beging[:char_end]...left[:char_start]].include?('(') + paren = source[beging[:ec]...left[:sc]].include?('(') ending = paren ? find_scanner_event(:@rparen) : right { type: :alias, body: [left, right], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -269,9 +263,9 @@ def on_aref(collection, index) type: :aref, body: [collection, index], start: collection[:start], - char_start: collection[:char_start], + sc: collection[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -285,9 +279,9 @@ def on_aref_field(collection, index) type: :aref_field, body: [collection, index], start: collection[:start], - char_start: collection[:char_start], + sc: collection[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -299,9 +293,9 @@ def on_args_new type: :args, body: [], start: lineno, - char_start: char_pos, + sc: char_pos, end: lineno, - char_end: char_pos + ec: char_pos } end @@ -313,11 +307,7 @@ def on_args_add(args, arg) if args[:body].empty? arg.merge(type: :args, body: [arg]) else - args.merge!( - body: args[:body] << arg, - end: arg[:end], - char_end: arg[:char_end] - ) + args.merge!(body: args[:body] << arg, end: arg[:end], ec: arg[:ec]) end end @@ -331,7 +321,7 @@ def on_args_add_block(args, block) type: :args_add_block, body: [args, block], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] ) end @@ -346,9 +336,9 @@ def on_args_add_star(args, part) type: :args_add_star, body: [args, part], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -373,9 +363,9 @@ def on_arg_paren(args) type: :arg_paren, body: [args], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -392,19 +382,19 @@ def on_array(contents) type: :array, body: [contents], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } else ending = find_scanner_event(:@tstring_end) - contents[:char_end] = ending[:char_end] + contents[:ec] = ending[:ec] ending.merge!( type: :array, body: [contents], start: contents[:start], - char_start: contents[:char_start] + sc: contents[:sc] ) end end @@ -418,9 +408,9 @@ def on_aryptn(const, preargs, splatarg, postargs) type: :aryptn, body: [const, preargs, splatarg, postargs], start: pieces[0][:start], - char_start: pieces[0][:char_start], + sc: pieces[0][:sc], end: pieces[-1][:end], - char_end: pieces[-1][:char_end] + ec: pieces[-1][:ec] } end @@ -432,7 +422,7 @@ def on_assign(left, right) type: :assign, body: [left, right], end: right[:end], - char_end: right[:char_end] + ec: right[:ec] ) end @@ -444,9 +434,9 @@ def on_assoc_new(key, value) type: :assoc_new, body: [key, value], start: key[:start], - char_start: key[:char_start], + sc: key[:sc], end: value[:end], - char_end: value[:char_end] + ec: value[:ec] } end @@ -457,7 +447,7 @@ def on_assoc_splat(contents) type: :assoc_splat, body: [contents], end: contents[:end], - char_end: contents[:char_end] + ec: contents[:ec] ) end @@ -470,9 +460,9 @@ def on_assoclist_from_args(assocs) type: :assoclist_from_args, body: assocs, start: assocs[0][:start], - char_start: assocs[0][:char_start], + sc: assocs[0][:sc], end: assocs[-1][:end], - char_end: assocs[-1][:char_end] + ec: assocs[-1][:ec] } end @@ -485,9 +475,9 @@ def on_bare_assoc_hash(assoc_news) type: :bare_assoc_hash, body: assoc_news, start: assoc_news[0][:start], - char_start: assoc_news[0][:char_start], + sc: assoc_news[0][:sc], end: assoc_news[-1][:end], - char_end: assoc_news[-1][:char_end] + ec: assoc_news[-1][:ec] } end @@ -495,20 +485,20 @@ def on_bare_assoc_hash(assoc_news) # It includes a bodystmt event that has all of the consequent clauses. def on_begin(bodystmt) beging = find_scanner_event(:@kw, 'begin') - char_end = + ec = if bodystmt[:body][1..-1].any? - bodystmt[:char_end] + bodystmt[:ec] else - find_scanner_event(:@kw, 'end')[:char_end] + find_scanner_event(:@kw, 'end')[:ec] end - bodystmt.bind(beging[:char_end], char_end) + bodystmt.bind(beging[:ec], ec) beging.merge!( type: :begin, body: [bodystmt], end: bodystmt[:end], - char_end: bodystmt[:char_end] + ec: bodystmt[:ec] ) end @@ -519,9 +509,9 @@ def on_binary(left, oper, right) type: :binary, body: [left, oper, right], start: left[:start], - char_start: left[:char_start], + sc: left[:sc], end: right[:end], - char_end: right[:char_end] + ec: right[:ec] } end @@ -531,7 +521,7 @@ def on_block_var(params, locals) index = scanner_events.rindex do |event| event[:type] == :@op && %w[| ||].include?(event[:body]) && - event[:char_start] < params[:char_start] + event[:sc] < params[:sc] end beging = scanner_events[index] @@ -541,9 +531,9 @@ def on_block_var(params, locals) type: :block_var, body: [params, locals], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -554,7 +544,7 @@ def on_blockarg(ident) type: :blockarg, body: [ident], end: ident[:end], - char_end: ident[:char_end] + ec: ident[:ec] ) end @@ -562,21 +552,18 @@ def on_blockarg(ident) # doesn't necessarily know where it started. So the parent node needs to # report back down into this one where it goes. class BodyStmt < SimpleDelegator - def bind(char_start, char_end) - merge!(char_start: char_start, char_end: char_end) + def bind(sc, ec) + merge!(sc: sc, ec: ec) parts = self[:body] # Here we're going to determine the bounds for the stmts consequent = parts[1..-1].compact.first - self[:body][0].bind( - char_start, - consequent ? consequent[:char_start] : char_end - ) + self[:body][0].bind(sc, consequent ? consequent[:sc] : ec) # Next we're going to determine the rescue clause if there is one if parts[1] consequent = parts[2..-1].compact.first - self[:body][1].bind_end(consequent ? consequent[:char_start] : char_end) + self[:body][1].bind_end(consequent ? consequent[:sc] : ec) end end end @@ -588,9 +575,9 @@ def on_bodystmt(stmts, rescued, ensured, elsed) type: :bodystmt, body: [stmts, rescued, ensured, elsed], start: lineno, - char_start: char_pos, + sc: char_pos, end: lineno, - char_end: char_pos + ec: char_pos ) end @@ -602,15 +589,15 @@ def on_brace_block(block_var, stmts) beging = find_scanner_event(:@lbrace) ending = find_scanner_event(:@rbrace) - stmts.bind((block_var || beging)[:char_end], ending[:char_start]) + stmts.bind((block_var || beging)[:ec], ending[:sc]) { type: :brace_block, body: [block_var, stmts], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -631,7 +618,7 @@ def on_break(args_add_block) type: :break, body: [args_add_block], end: args_add_block[:end], - char_end: args_add_block[:char_end] + ec: args_add_block[:ec] ) end @@ -665,9 +652,9 @@ def on_call(receiver, oper, sending) type: :call, body: [receiver, oper, sending], start: receiver[:start], - char_start: receiver[:char_start], + sc: receiver[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -686,7 +673,7 @@ def on_case(switch, consequent) beging.merge!( body: [switch, consequent], end: consequent[:end], - char_end: consequent[:char_end] + ec: consequent[:ec] ) end @@ -720,17 +707,17 @@ def on_class(const, superclass, bodystmt) ending = find_scanner_event(:@kw, 'end') bodystmt.bind( - find_next_statement_start((superclass || const)[:char_end]), - ending[:char_start] + find_next_statement_start((superclass || const)[:ec]), + ending[:sc] ) { type: :class, body: [const, superclass, bodystmt], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -742,9 +729,9 @@ def on_command(ident, args) type: :command, body: [ident, args], start: ident[:start], - char_start: ident[:char_start], + sc: ident[:sc], end: args[:end], - char_end: args[:char_end] + ec: args[:ec] } end @@ -764,9 +751,9 @@ def on_command_call(receiver, oper, ident, args) type: :command_call, body: [receiver, oper, ident, args], start: receiver[:start], - char_start: receiver[:char_start], + sc: receiver[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -781,9 +768,9 @@ def on_const_path_field(left, const) type: :const_path_field, body: [left, const], start: left[:start], - char_start: left[:char_start], + sc: left[:sc], end: const[:end], - char_end: const[:char_end] + ec: const[:ec] } end @@ -798,9 +785,9 @@ def on_const_path_ref(left, const) type: :const_path_ref, body: [left, const], start: left[:start], - char_start: left[:char_start], + sc: left[:sc], end: const[:end], - char_end: const[:char_end] + ec: const[:ec] } end @@ -851,32 +838,29 @@ def on_def(ident, params, bodystmt) type: :defsl, body: [ident, params, bodystmt], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: bodystmt[:end], - char_end: bodystmt[:char_end] + ec: bodystmt[:ec] } ) end if params[:type] == :params && !params[:body].any? - location = ident[:char_end] - params.merge!(char_start: location, char_end: location) + location = ident[:ec] + params.merge!(sc: location, ec: location) end ending = find_scanner_event(:@kw, 'end') - bodystmt.bind( - find_next_statement_start(params[:char_end]), - ending[:char_start] - ) + bodystmt.bind(find_next_statement_start(params[:ec]), ending[:sc]) { type: :def, body: [ident, params, bodystmt], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -901,25 +885,22 @@ def on_defs(target, oper, ident, params, bodystmt) scanner_events.delete(ident) if params[:type] == :params && !params[:body].any? - location = ident[:char_end] - params.merge!(char_start: location, char_end: location) + location = ident[:ec] + params.merge!(sc: location, ec: location) end beging = find_scanner_event(:@kw, 'def') ending = find_scanner_event(:@kw, 'end') - bodystmt.bind( - find_next_statement_start(params[:char_end]), - ending[:char_start] - ) + bodystmt.bind(find_next_statement_start(params[:ec]), ending[:sc]) { type: :defs, body: [target, oper, ident, params, bodystmt], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -930,14 +911,14 @@ def on_defs(target, oper, ident, params, bodystmt) def on_defined(value) beging = find_scanner_event(:@kw, 'defined?') - paren = source[beging[:char_end]...value[:char_start]].include?('(') + paren = source[beging[:ec]...value[:sc]].include?('(') ending = paren ? find_scanner_event(:@rparen) : value beging.merge!( type: :defined, body: [value], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] ) end @@ -949,15 +930,15 @@ def on_do_block(block_var, bodystmt) beging = find_scanner_event(:@kw, 'do') ending = find_scanner_event(:@kw, 'end') - bodystmt.bind((block_var || beging)[:char_end], ending[:char_start]) + bodystmt.bind((block_var || beging)[:ec], ending[:sc]) { type: :do_block, body: [block_var, bodystmt], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -974,9 +955,9 @@ def on_dot2(left, right) type: :dot2, body: [left, right], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -993,9 +974,9 @@ def on_dot3(left, right) type: :dot3, body: [left, right], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -1028,7 +1009,7 @@ def on_dyna_symbol(string) quote: beging[:body][1], body: string[:body], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] ) else # A dynamic symbol as a hash key @@ -1039,9 +1020,9 @@ def on_dyna_symbol(string) type: :dyna_symbol, quote: ending[:body][0], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] ) end end @@ -1066,15 +1047,15 @@ def on_else(stmts) beging = find_scanner_event(:@kw, 'else') ending = find_else_ending - stmts.bind(beging[:char_end], ending[:char_start]) + stmts.bind(beging[:ec], ending[:sc]) { type: :else, body: [stmts], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -1086,15 +1067,15 @@ def on_elsif(predicate, stmts, consequent) beging = find_scanner_event(:@kw, 'elsif') ending = consequent || find_scanner_event(:@kw, 'end') - stmts.bind(predicate[:char_end], ending[:char_start]) + stmts.bind(predicate[:ec], ending[:sc]) { type: :elsif, body: [predicate, stmts, consequent], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -1104,12 +1085,7 @@ def on_elsif(predicate, stmts, consequent) # and add to it as we get content. It always starts with this scanner # event, so here we'll initialize the current embdoc. def on_embdoc_beg(value) - @embdoc = { - type: :@embdoc, - value: value, - start: lineno, - char_start: char_pos - } + @embdoc = { type: :@embdoc, value: value, start: lineno, sc: char_pos } end # This is a scanner event that gets hit when we're inside an embdoc and @@ -1129,7 +1105,7 @@ def on_embdoc_end(value) @embdoc.merge!( value: @embdoc[:value] << value.chomp, end: lineno, - char_end: char_pos + value.length - 1 + ec: char_pos + value.length - 1 ) @embdoc = nil @@ -1148,18 +1124,15 @@ def on_ensure(stmts) end ending = scanner_events[index] - stmts.bind( - find_next_statement_start(beging[:char_end]), - ending[:char_start] - ) + stmts.bind(find_next_statement_start(beging[:ec]), ending[:sc]) { type: :ensure, body: [beging, stmts], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -1188,9 +1161,9 @@ def on_field(left, oper, right) type: :field, body: [left, oper, right], start: left[:start], - char_start: left[:char_start], + sc: left[:sc], end: right[:end], - char_end: right[:char_end] + ec: right[:ec] } end @@ -1204,9 +1177,9 @@ def on_fndptn(const, presplat, args, postsplat) type: :fndptn, body: [const, presplat, args, postsplat], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -1218,15 +1191,15 @@ def on_for(ident, enumerable, stmts) beging = find_scanner_event(:@kw, 'for') ending = find_scanner_event(:@kw, 'end') - stmts.bind(enumerable[:char_end], ending[:char_start]) + stmts.bind(enumerable[:ec], ending[:sc]) { type: :for, body: [ident, enumerable, stmts], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -1240,19 +1213,16 @@ def on_hash(assoclist_from_args) if assoclist_from_args # Here we're going to expand out the location information for the assocs # node so that it can grab up any remaining comments inside the hash. - assoclist_from_args.merge!( - char_start: beging[:char_end], - char_end: ending[:char_start] - ) + assoclist_from_args.merge!(sc: beging[:ec], ec: ending[:sc]) end { type: :hash, body: [assoclist_from_args], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -1266,8 +1236,8 @@ def on_heredoc_beg(beging) location = { start: lineno, end: lineno, - char_start: char_pos, - char_end: char_pos + beging.length + 1 + sc: char_pos, + ec: char_pos + beging.length + 1 } # Here we're going to artificially create an extra node type so that if @@ -1289,7 +1259,7 @@ def on_heredoc_dedent(string, _width) # This is a scanner event that represents the end of the heredoc. def on_heredoc_end(ending) - @heredocs[-1].merge!(ending: ending.chomp, end: lineno, char_end: char_pos) + @heredocs[-1].merge!(ending: ending.chomp, end: lineno, ec: char_pos) end # hshptn is a parser event that represents matching against a hash pattern @@ -1301,9 +1271,9 @@ def on_hshptn(const, kw, kwrest) type: :hshptn, body: [const, kw, kwrest], start: pieces[0][:start], - char_start: pieces[0][:char_start], + sc: pieces[0][:sc], end: pieces[-1][:end], - char_end: pieces[-1][:char_end] + ec: pieces[-1][:ec] } end @@ -1314,15 +1284,15 @@ def on_if(predicate, stmts, consequent) beging = find_scanner_event(:@kw, 'if') ending = consequent || find_scanner_event(:@kw, 'end') - stmts.bind(predicate[:char_end], ending[:char_start]) + stmts.bind(predicate[:ec], ending[:sc]) { type: :if, body: [predicate, stmts, consequent], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -1334,7 +1304,7 @@ def on_ifop(predicate, truthy, falsy) type: :ifop, body: [predicate, truthy, falsy], end: falsy[:end], - char_end: falsy[:char_end] + ec: falsy[:ec] ) end @@ -1348,9 +1318,9 @@ def on_if_mod(predicate, statement) type: :if_mod, body: [predicate, statement], start: statement[:start], - char_start: statement[:char_start], + sc: statement[:sc], end: predicate[:end], - char_end: predicate[:char_end] + ec: predicate[:ec] } end @@ -1364,13 +1334,13 @@ def on_in(pattern, stmts, consequent) beging = find_scanner_event(:@kw, 'in') ending = consequent || find_scanner_event(:@kw, 'end') - stmts.bind(beging[:char_end], ending[:char_start]) + stmts.bind(beging[:ec], ending[:sc]) beging.merge!( type: :in, body: [pattern, stmts, consequent], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] ) end @@ -1384,7 +1354,7 @@ def on_kwrest_param(ident) type: :kwrest_param, body: [ident], end: ident[:end], - char_end: ident[:char_end] + ec: ident[:ec] ) end @@ -1406,15 +1376,15 @@ def on_lambda(params, stmts) closing = find_scanner_event(:@kw, 'end') end - stmts.bind(opening[:char_end], closing[:char_start]) + stmts.bind(opening[:ec], closing[:sc]) { type: :lambda, body: [params, stmts], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: closing[:end], - char_end: closing[:char_end] + ec: closing[:ec] } end @@ -1436,17 +1406,15 @@ def on_lambda(params, stmts) # in which case we need to explicitly track the comma and add it onto the # child node. def on_massign(left, right) - if source[left[:char_end]...right[:char_start]].strip.start_with?(',') - left[:comma] = true - end + left[:comma] = true if source[left[:ec]...right[:sc]].strip.start_with?(',') { type: :massign, body: [left, right], start: left[:start], - char_start: left[:char_start], + sc: left[:sc], end: right[:end], - char_end: right[:char_end] + ec: right[:ec] } end @@ -1466,9 +1434,9 @@ def on_method_add_arg(fcall, arg_paren) type: :method_add_arg, body: [fcall, arg_paren], start: fcall[:start], - char_start: fcall[:char_start], + sc: fcall[:sc], end: arg_paren[:end], - char_end: arg_paren[:char_end] + ec: arg_paren[:ec] } end @@ -1480,9 +1448,9 @@ def on_method_add_block(method_add_arg, block) type: :method_add_block, body: [method_add_arg, block], start: method_add_arg[:start], - char_start: method_add_arg[:char_start], + sc: method_add_arg[:sc], end: block[:end], - char_end: block[:char_end] + ec: block[:ec] } end @@ -1494,9 +1462,9 @@ def on_mlhs_new type: :mlhs, body: [], start: lineno, - char_start: char_pos, + sc: char_pos, end: lineno, - char_end: char_pos + ec: char_pos } end @@ -1507,11 +1475,7 @@ def on_mlhs_add(mlhs, part) if mlhs[:body].empty? part.merge(type: :mlhs, body: [part]) else - mlhs.merge!( - body: mlhs[:body] << part, - end: part[:end], - char_end: part[:char_end] - ) + mlhs.merge!(body: mlhs[:body] << part, end: part[:end], ec: part[:ec]) end end @@ -1525,7 +1489,7 @@ def on_mlhs_add_post(mlhs_add_star, mlhs) type: :mlhs_add_post, body: [mlhs_add_star, mlhs], end: mlhs[:end], - char_end: mlhs[:char_end] + ec: mlhs[:ec] ) end @@ -1541,9 +1505,9 @@ def on_mlhs_add_star(mlhs, part) type: :mlhs_add_star, body: [mlhs, part], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -1555,7 +1519,7 @@ def on_mlhs_paren(contents) beging = find_scanner_event(:@lparen) ending = find_scanner_event(:@rparen) - if source[beging[:char_end]...ending[:char_start]].strip.end_with?(',') + if source[beging[:ec]...ending[:sc]].strip.end_with?(',') contents[:comma] = true end @@ -1563,9 +1527,9 @@ def on_mlhs_paren(contents) type: :mlhs_paren, body: [contents], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -1576,18 +1540,15 @@ def on_module(const, bodystmt) beging = find_scanner_event(:@kw, 'module') ending = find_scanner_event(:@kw, 'end') - bodystmt.bind( - find_next_statement_start(const[:char_end]), - ending[:char_start] - ) + bodystmt.bind(find_next_statement_start(const[:ec]), ending[:sc]) { type: :module, body: [const, bodystmt], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -1600,9 +1561,9 @@ def on_mrhs_new type: :mrhs, body: [], start: lineno, - char_start: char_pos, + sc: char_pos, end: lineno, - char_end: char_pos + ec: char_pos } end @@ -1612,11 +1573,7 @@ def on_mrhs_add(mrhs, part) if mrhs[:body].empty? part.merge(type: :mrhs, body: [part]) else - mrhs.merge!( - body: mrhs[:body] << part, - end: part[:end], - char_end: part[:char_end] - ) + mrhs.merge!(body: mrhs[:body] << part, end: part[:end], ec: part[:ec]) end end @@ -1631,9 +1588,9 @@ def on_mrhs_add_star(mrhs, part) type: :mrhs_add_star, body: [mrhs, part], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -1657,7 +1614,7 @@ def on_next(args_add_block) type: :next, body: [args_add_block], end: args_add_block[:end], - char_end: args_add_block[:char_end] + ec: args_add_block[:ec] ) end @@ -1670,7 +1627,7 @@ def on_opassign(left, oper, right) type: :opassign, body: [left, oper, right], end: right[:end], - char_end: right[:char_end] + ec: right[:ec] ) end @@ -1685,12 +1642,12 @@ def on_params(*types) if flattened.any? { start: flattened[0][:start], - char_start: flattened[0][:char_start], + sc: flattened[0][:sc], end: flattened[-1][:end], - char_end: flattened[-1][:char_end] + ec: flattened[-1][:ec] } else - { start: lineno, char_start: char_pos, end: lineno, char_end: char_pos } + { start: lineno, sc: char_pos, end: lineno, ec: char_pos } end location.merge!(type: :params, body: types) @@ -1706,7 +1663,7 @@ def on_paren(contents) type: :paren, body: [contents], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] ) end @@ -1715,12 +1672,7 @@ def on_paren(contents) # source string. We'll also attach on the __END__ content if there was # some found at the end of the source string. def on_program(stmts) - range = { - start: 1, - end: lines.length, - char_start: 0, - char_end: source.length - } + range = { start: 1, end: lines.length, sc: 0, ec: source.length } stmts[:body] << @__end__ if @__end__ stmts.bind(0, source.length) @@ -1743,7 +1695,7 @@ def on_qsymbols_add(qsymbols, tstring_content) qsymbols.merge!( body: qsymbols[:body] << tstring_content, end: tstring_content[:end], - char_end: tstring_content[:char_end] + ec: tstring_content[:ec] ) end @@ -1762,7 +1714,7 @@ def on_qwords_add(qwords, tstring_content) qwords.merge!( body: qwords[:body] << tstring_content, end: tstring_content[:end], - char_end: tstring_content[:char_end] + ec: tstring_content[:ec] ) end @@ -1788,7 +1740,7 @@ def on_regexp_add(regexp, piece) regexp.merge!( body: regexp[:body] << piece, end: regexp[:end], - char_end: regexp[:char_end] + ec: regexp[:ec] ) end @@ -1801,7 +1753,7 @@ def on_regexp_literal(regexp, ending) type: :regexp_literal, ending: ending[:body], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] ) end @@ -1810,17 +1762,17 @@ def on_regexp_literal(regexp, ending) # determine its ending. Therefore it relies on its parent bodystmt node to # report its ending to it. class Rescue < SimpleDelegator - def bind_end(char_end) - merge!(char_end: char_end) + def bind_end(ec) + merge!(ec: ec) stmts = self[:body][2] consequent = self[:body][3] if consequent - consequent.bind_end(char_end) - stmts.bind_end(consequent[:char_start]) + consequent.bind_end(ec) + stmts.bind_end(consequent[:sc]) else - stmts.bind_end(char_end) + stmts.bind_end(ec) end end end @@ -1833,14 +1785,14 @@ def on_rescue(exceptions, variable, stmts, consequent) last_exception = exceptions.is_a?(Array) ? exceptions[-1] : exceptions last_node = variable || last_exception || beging - stmts.bind(find_next_statement_start(last_node[:char_end]), char_pos) + stmts.bind(find_next_statement_start(last_node[:ec]), char_pos) Rescue.new( beging.merge!( type: :rescue, body: [exceptions, variable, stmts, consequent], end: lineno, - char_end: char_pos + ec: char_pos ) ) end @@ -1855,9 +1807,9 @@ def on_rescue_mod(statement, rescued) type: :rescue_mod, body: [statement, rescued], start: statement[:start], - char_start: statement[:char_start], + sc: statement[:sc], end: rescued[:end], - char_end: rescued[:char_end] + ec: rescued[:ec] } end @@ -1873,7 +1825,7 @@ def on_rest_param(ident) type: :rest_param, body: [ident], end: ident[:end], - char_end: ident[:char_end] + ec: ident[:ec] ) end @@ -1891,7 +1843,7 @@ def on_return(args_add_block) type: :return, body: [args_add_block], end: args_add_block[:end], - char_end: args_add_block[:char_end] + ec: args_add_block[:ec] ) end @@ -1917,18 +1869,15 @@ def on_sclass(target, bodystmt) beging = find_scanner_event(:@kw, 'class') ending = find_scanner_event(:@kw, 'end') - bodystmt.bind( - find_next_statement_start(target[:char_end]), - ending[:char_start] - ) + bodystmt.bind(find_next_statement_start(target[:ec]), ending[:sc]) { type: :sclass, body: [target, bodystmt], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -1940,23 +1889,23 @@ def on_sclass(target, bodystmt) # propagate that onto void_stmt nodes inside the stmts in order to make sure # all comments get printed appropriately. class Stmts < SimpleDelegator - def bind(char_start, char_end) - merge!(char_start: char_start, char_end: char_end) + def bind(sc, ec) + merge!(sc: sc, ec: ec) if self[:body][0][:type] == :void_stmt - self[:body][0].merge!(char_start: char_start, char_end: char_start) + self[:body][0].merge!(sc: sc, ec: sc) end end - def bind_end(char_end) - merge!(char_end: char_end) + def bind_end(ec) + merge!(ec: ec) end def <<(statement) if self[:body].any? - merge!(statement.slice(:end, :char_end)) + merge!(statement.slice(:end, :ec)) else - merge!(statement.slice(:start, :end, :char_start, :char_end)) + merge!(statement.slice(:start, :end, :sc, :ec)) end self[:body] << statement @@ -1973,8 +1922,8 @@ def on_stmts_new body: [], start: lineno, end: lineno, - char_start: char_pos, - char_end: char_pos + sc: char_pos, + ec: char_pos ) end @@ -1997,9 +1946,9 @@ def on_string_concat(left, right) type: :string_concat, body: [left, right], start: left[:start], - char_start: left[:char_start], + sc: left[:sc], end: right[:end], - char_end: right[:char_end] + ec: right[:ec] } end @@ -2014,8 +1963,8 @@ def on_string_content body: [], start: lineno, end: lineno, - char_start: char_pos, - char_end: char_pos + sc: char_pos, + ec: char_pos } end @@ -2027,7 +1976,7 @@ def on_string_add(string, piece) string.merge!( body: string[:body] << piece, end: piece[:end], - char_end: piece[:char_end] + ec: piece[:ec] ) end @@ -2041,7 +1990,7 @@ def on_string_dvar(var_ref) type: :string_dvar, body: [var_ref], end: var_ref[:end], - char_end: var_ref[:char_end] + ec: var_ref[:ec] ) end @@ -2053,15 +2002,15 @@ def on_string_embexpr(stmts) beging = find_scanner_event(:@embexpr_beg) ending = find_scanner_event(:@embexpr_end) - stmts.bind(beging[:char_end], ending[:char_start]) + stmts.bind(beging[:ec], ending[:sc]) { type: :string_embexpr, body: [stmts], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -2081,9 +2030,9 @@ def on_string_literal(string) body: string[:body], quote: beging[:body], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end end @@ -2097,7 +2046,7 @@ def on_super(contents) type: :super, body: [contents], end: contents[:end], - char_end: contents[:char_end] + ec: contents[:ec] ) end @@ -2128,7 +2077,7 @@ def on_symbol_literal(contents) contents.merge(type: :symbol_literal, body: [contents]) else beging = find_scanner_event(:@symbeg) - contents.merge!(type: :symbol_literal, char_start: beging[:char_start]) + contents.merge!(type: :symbol_literal, sc: beging[:sc]) end end @@ -2148,7 +2097,7 @@ def on_symbols_add(symbols, word_add) symbols.merge!( body: symbols[:body] << word_add, end: word_add[:end], - char_end: word_add[:char_end] + ec: word_add[:ec] ) end @@ -2159,8 +2108,7 @@ def on_symbols_add(symbols, word_add) def find_colon2_before(const) index = scanner_events.rindex do |event| - event[:type] == :@op && event[:body] == '::' && - event[:char_start] < const[:char_start] + event[:type] == :@op && event[:body] == '::' && event[:sc] < const[:sc] end scanner_events[index] @@ -2178,7 +2126,7 @@ def on_top_const_field(const) type: :top_const_field, body: [const], start: beging[:start], - char_start: beging[:char_start] + sc: beging[:sc] ) end @@ -2194,7 +2142,7 @@ def on_top_const_ref(const) type: :top_const_ref, body: [const], start: beging[:start], - char_start: beging[:char_start] + sc: beging[:sc] ) end @@ -2206,7 +2154,7 @@ def on_unary(oper, value) if oper == :not node = find_scanner_event(:@kw, 'not') - paren = source[node[:char_end]...value[:char_start]].include?('(') + paren = source[node[:ec]...value[:sc]].include?('(') ending = paren ? find_scanner_event(:@rparen) : value node.merge!( @@ -2214,7 +2162,7 @@ def on_unary(oper, value) oper: oper, body: [value], end: ending[:end], - char_end: ending[:char_end], + ec: ending[:ec], paren: paren ) else @@ -2234,7 +2182,7 @@ def on_unary(oper, value) oper: oper[0], body: [value], end: value[:end], - char_end: value[:char_end] + ec: value[:ec] ) end end @@ -2250,7 +2198,7 @@ def on_undef(symbol_literals) type: :undef, body: symbol_literals, end: last[:end], - char_end: last[:char_end] + ec: last[:ec] ) end @@ -2262,15 +2210,15 @@ def on_unless(predicate, stmts, consequent) beging = find_scanner_event(:@kw, 'unless') ending = consequent || find_scanner_event(:@kw, 'end') - stmts.bind(predicate[:char_end], ending[:char_start]) + stmts.bind(predicate[:ec], ending[:sc]) { type: :unless, body: [predicate, stmts, consequent], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -2284,9 +2232,9 @@ def on_unless_mod(predicate, statement) type: :unless_mod, body: [predicate, statement], start: statement[:start], - char_start: statement[:char_start], + sc: statement[:sc], end: predicate[:end], - char_end: predicate[:char_end] + ec: predicate[:ec] } end @@ -2300,17 +2248,19 @@ def on_until(predicate, stmts) # Consume the do keyword if it exists so that it doesn't get confused for # some other block do_event = find_scanner_event(:@kw, 'do', consume: false) - scanner_events.delete(do_event) if do_event + if do_event && do_event[:sc] > predicate[:ec] && do_event[:ec] < ending[:sc] + scanner_events.delete(do_event) + end - stmts.bind(predicate[:char_end], ending[:char_start]) + stmts.bind(predicate[:ec], ending[:sc]) { type: :until, body: [predicate, stmts], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -2324,9 +2274,9 @@ def on_until_mod(predicate, statement) type: :until_mod, body: [predicate, statement], start: statement[:start], - char_start: statement[:char_start], + sc: statement[:sc], end: predicate[:end], - char_end: predicate[:char_end] + ec: predicate[:ec] } end @@ -2337,16 +2287,16 @@ def on_until_mod(predicate, statement) def on_var_alias(left, right) beging = find_scanner_event(:@kw, 'alias') - paren = source[beging[:char_end]...left[:char_start]].include?('(') + paren = source[beging[:ec]...left[:sc]].include?('(') ending = paren ? find_scanner_event(:@rparen) : right { type: :var_alias, body: [left, right], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -2398,13 +2348,7 @@ def on_vcall(ident) # block of code. It often will have comments attached to it, so it requires # some special handling. def on_void_stmt - { - type: :void_stmt, - start: lineno, - end: lineno, - char_start: char_pos, - char_end: char_pos - } + { type: :void_stmt, start: lineno, end: lineno, sc: char_pos, ec: char_pos } end # when is a parser event that represents another clause in a case chain. @@ -2415,15 +2359,15 @@ def on_when(predicate, stmts, consequent) beging = find_scanner_event(:@kw, 'when') ending = consequent || find_scanner_event(:@kw, 'end') - stmts.bind(predicate[:char_end], ending[:char_start]) + stmts.bind(predicate[:ec], ending[:sc]) { type: :when, body: [predicate, stmts, consequent], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -2437,17 +2381,19 @@ def on_while(predicate, stmts) # Consume the do keyword if it exists so that it doesn't get confused for # some other block do_event = find_scanner_event(:@kw, 'do', consume: false) - scanner_events.delete(do_event) if do_event + if do_event && do_event[:sc] > predicate[:ec] && do_event[:ec] < ending[:sc] + scanner_events.delete(do_event) + end - stmts.bind(predicate[:char_end], ending[:char_start]) + stmts.bind(predicate[:ec], ending[:sc]) { type: :while, body: [predicate, stmts], start: beging[:start], - char_start: beging[:char_start], + sc: beging[:sc], end: ending[:end], - char_end: ending[:char_end] + ec: ending[:ec] } end @@ -2461,9 +2407,9 @@ def on_while_mod(predicate, statement) type: :while_mod, body: [predicate, statement], start: statement[:start], - char_start: statement[:char_start], + sc: statement[:sc], end: predicate[:end], - char_end: predicate[:char_end] + ec: predicate[:ec] } end @@ -2493,11 +2439,7 @@ def on_word_add(word, piece) # location information from the first piece. piece.merge(type: :word, body: [piece]) else - word.merge!( - body: word[:body] << piece, - end: piece[:end], - char_end: piece[:char_end] - ) + word.merge!(body: word[:body] << piece, end: piece[:end], ec: piece[:ec]) end end @@ -2517,7 +2459,7 @@ def on_words_add(words, word_add) words.merge!( body: words[:body] << word_add, end: word_add[:end], - char_end: word_add[:char_end] + ec: word_add[:ec] ) end @@ -2551,7 +2493,7 @@ def on_xstring_add(xstring, piece) xstring.merge!( body: xstring[:body] << piece, end: piece[:end], - char_end: piece[:char_end] + ec: piece[:ec] ) end @@ -2576,11 +2518,7 @@ def on_xstring_literal(xstring) heredoc.merge!(body: xstring[:body]) else ending = find_scanner_event(:@tstring_end) - xstring.merge!( - type: :xstring_literal, - end: ending[:end], - char_end: ending[:char_end] - ) + xstring.merge!(type: :xstring_literal, end: ending[:end], ec: ending[:ec]) end end @@ -2592,7 +2530,7 @@ def on_yield(args_add_block) type: :yield, body: [args_add_block], end: args_add_block[:end], - char_end: args_add_block[:char_end] + ec: args_add_block[:ec] ) end diff --git a/test/js/ruby/nodes/loops.test.js b/test/js/ruby/nodes/loops.test.js index e78710a3..f195e02b 100644 --- a/test/js/ruby/nodes/loops.test.js +++ b/test/js/ruby/nodes/loops.test.js @@ -175,7 +175,7 @@ describe.each(["while", "until"])("%s", (keyword) => { ); // https://github.com/prettier/plugin-ruby/issues/759 - test.each(["while", "until"])("%s handles do keyword", (keyword) => { + test("handles do keyword", () => { const content = ruby(` %w[foo bar].each do |resource| puts resource diff --git a/test/rb/metadata_test.rb b/test/rb/metadata_test.rb index 4f06030a..6c80b8fe 100644 --- a/test/rb/metadata_test.rb +++ b/test/rb/metadata_test.rb @@ -60,8 +60,8 @@ def test_aref_field assert_node_metadata( :aref_field, parse('foo[bar] = baz').dig(:body, 0), - char_start: 0, - char_end: 8 + sc: 0, + ec: 8 ) end @@ -69,8 +69,8 @@ def test_args assert_node_metadata( :args, parse('foo bar, baz').dig(:body, 1, :body, 0), - char_start: 4, - char_end: 12 + sc: 4, + ec: 12 ) end @@ -78,8 +78,8 @@ def test_args_add_block assert_node_metadata( :args_add_block, parse('foo bar, baz').dig(:body, 1), - char_start: 4, - char_end: 12 + sc: 4, + ec: 12 ) end @@ -87,8 +87,8 @@ def test_args_add_star assert_node_metadata( :args_add_star, parse('foo *bar').dig(:body, 1, :body, 0), - char_start: 4, - char_end: 8 + sc: 4, + ec: 8 ) end @@ -104,8 +104,8 @@ def test_arg_paren assert_node_metadata( :arg_paren, parse(content).dig(:body, 1), - char_start: 3, - char_end: 20 + sc: 3, + ec: 20 ) end @@ -117,8 +117,8 @@ def test_assoc_new assert_node_metadata( :assoc_new, parse('{ foo: bar, bar: baz }').dig(:body, 0, :body, 0), - char_start: 2, - char_end: 10 + sc: 2, + ec: 10 ) end @@ -126,8 +126,8 @@ def test_assoc_splat assert_node_metadata( :assoc_splat, parse('foo **bar').dig(:body, 1, :body, 0, :body, 0, :body, 0), - char_start: 4, - char_end: 9 + sc: 4, + ec: 9 ) end @@ -135,8 +135,8 @@ def test_assoclist_from_args assert_node_metadata( :assoclist_from_args, parse('{ foo => bar }').dig(:body, 0), - char_start: 1, - char_end: 13 + sc: 1, + ec: 13 ) end @@ -144,8 +144,8 @@ def test_bare_assoc_hash assert_node_metadata( :bare_assoc_hash, parse('foo(bar: baz)').dig(:body, 1, :body, 0, :body, 0, :body, 0), - char_start: 4, - char_end: 12 + sc: 4, + ec: 12 ) end @@ -165,8 +165,8 @@ def test_blockarg assert_node_metadata( :blockarg, parse('def foo(&bar) end').dig(:body, 1, :body, 0, :body, 6), - char_start: 8, - char_end: 12 + sc: 8, + ec: 12 ) end @@ -174,8 +174,8 @@ def test_block_var assert_node_metadata( :block_var, parse('foo { |bar| }').dig(:body, 1, :body, 0), - char_start: 6, - char_end: 11 + sc: 6, + ec: 11 ) end @@ -183,8 +183,8 @@ def test_bodystmt assert_node_metadata( :bodystmt, parse('class Foo; def foo; end; end').dig(:body, 2), - char_start: 9, - char_end: 25 + sc: 9, + ec: 25 ) end @@ -192,8 +192,8 @@ def test_brace_block assert_node_metadata( :brace_block, parse('foo { bar }').dig(:body, 1), - char_start: 4, - char_end: 11 + sc: 4, + ec: 11 ) end @@ -236,8 +236,8 @@ def test_const_ref assert_node_metadata( :const_ref, parse('class Foo; end').dig(:body, 0), - char_start: 6, - char_end: 9 + sc: 6, + ec: 9 ) end @@ -245,8 +245,8 @@ def test_const_path_field assert_node_metadata( :const_path_field, parse('Foo::Bar = baz').dig(:body, 0), - char_start: 0, - char_end: 8 + sc: 0, + ec: 8 ) end @@ -282,8 +282,8 @@ def test_do_block assert_node_metadata( :do_block, parse('foo do; bar; end').dig(:body, 1), - char_start: 4, - char_end: 16 + sc: 4, + ec: 16 ) end @@ -308,12 +308,7 @@ def test_else end SOURCE - assert_node_metadata( - :else, - parse(content).dig(:body, 2), - char_start: 13, - char_end: 27 - ) + assert_node_metadata(:else, parse(content).dig(:body, 2), sc: 13, ec: 27) end def test_elsif @@ -325,12 +320,7 @@ def test_elsif end SOURCE - assert_node_metadata( - :elsif, - parse(content).dig(:body, 2), - char_start: 13, - char_end: 32 - ) + assert_node_metadata(:elsif, parse(content).dig(:body, 2), sc: 13, ec: 32) end def test_ensure @@ -345,8 +335,8 @@ def test_ensure assert_node_metadata( :ensure, parse(content).dig(:body, 0, :body, 3), - char_start: 12, - char_end: 28 + sc: 12, + ec: 28 ) end @@ -355,27 +345,22 @@ def test_excessed_comma assert_node_metadata( :excessed_comma, parse('foo { |bar,| }').dig(:body, 1, :body, 0, :body, 0, :body, 2), - char_start: 10, - char_end: 11 + sc: 10, + ec: 11 ) end end def test_fcall - assert_node_metadata( - :fcall, - parse('foo(bar)').dig(:body, 0), - char_start: 0, - char_end: 3 - ) + assert_node_metadata(:fcall, parse('foo(bar)').dig(:body, 0), sc: 0, ec: 3) end def test_field assert_node_metadata( :field, parse('foo.bar = baz').dig(:body, 0), - char_start: 0, - char_end: 7 + sc: 0, + ec: 7 ) end @@ -416,8 +401,8 @@ def test_kwrest_param assert_node_metadata( :kwrest_param, parse('def foo(**bar); end').dig(:body, 1, :body, 0, :body, 5), - char_start: 8, - char_end: 13 + sc: 8, + ec: 13 ) end @@ -445,8 +430,8 @@ def test_mlhs assert_node_metadata( :mlhs, parse('foo, bar, baz = 1, 2, 3').dig(:body, 0), - char_start: 0, - char_end: 13 + sc: 0, + ec: 13 ) end @@ -454,8 +439,8 @@ def test_mlhs_add_post assert_node_metadata( :mlhs_add_post, parse('foo, *bar, baz = 1, 2, 3').dig(:body, 0), - char_start: 5, - char_end: 14 + sc: 5, + ec: 14 ) end @@ -463,8 +448,8 @@ def test_mlhs_add_star assert_node_metadata( :mlhs_add_star, parse('foo, *bar = 1, 2, 3').dig(:body, 0), - char_start: 5, - char_end: 9 + sc: 5, + ec: 9 ) end @@ -472,8 +457,8 @@ def test_mlhs_paren assert_node_metadata( :mlhs_paren, parse('(foo, bar) = baz').dig(:body, 0), - char_start: 0, - char_end: 10 + sc: 0, + ec: 10 ) end @@ -489,8 +474,8 @@ def test_mrhs_add_star assert_node_metadata( :mrhs_add_star, parse('foo, bar = *baz').dig(:body, 1), - char_start: 11, - char_end: 15 + sc: 11, + ec: 15 ) end @@ -498,8 +483,8 @@ def test_mrhs_new_from_args assert_node_metadata( :mrhs_new_from_args, parse('foo, bar, baz = 1, 2, 3').dig(:body, 1), - char_start: 16, - char_end: 23 + sc: 16, + ec: 23 ) end @@ -522,8 +507,8 @@ def foo( assert_node_metadata( :params, parse(content).dig(:body, 1, :body, 0), - char_start: 11, - char_end: 21 + sc: 11, + ec: 21 ) end @@ -535,8 +520,8 @@ def test_qsymbols assert_node_metadata( :qsymbols, parse('%i[foo bar baz]').dig(:body, 0), - char_start: 0, - char_end: 15 + sc: 0, + ec: 15 ) end @@ -544,8 +529,8 @@ def test_qwords assert_node_metadata( :qwords, parse('%w[foo bar baz]').dig(:body, 0), - char_start: 0, - char_end: 15 + sc: 0, + ec: 15 ) end @@ -570,8 +555,8 @@ def test_rescue assert_node_metadata( :rescue, parse('begin; foo; rescue => bar; baz; end').dig(:body, 0, :body, 1), - char_start: 12, - char_end: 35 + sc: 12, + ec: 35 ) end @@ -583,8 +568,8 @@ def test_rest_param assert_node_metadata( :rest_param, parse('def foo(*bar); end').dig(:body, 1, :body, 0, :body, 2), - char_start: 8, - char_end: 12 + sc: 8, + ec: 12 ) end @@ -619,8 +604,8 @@ def test_string_dvar assert_node_metadata( :string_dvar, parse('"#$foo"').dig(:body, 0), - char_start: 1, - char_end: 6 + sc: 1, + ec: 6 ) end @@ -628,8 +613,8 @@ def test_string_embexpr assert_node_metadata( :string_embexpr, parse('"foo #{bar} baz"').dig(:body, 1), - char_start: 5, - char_end: 11 + sc: 5, + ec: 11 ) end @@ -649,8 +634,8 @@ def test_symbols assert_node_metadata( :symbols, parse('%I[f#{o}o b#{a}r b#{a}z]').dig(:body, 0), - char_start: 0, - char_end: 24 + sc: 0, + ec: 24 ) end @@ -658,8 +643,8 @@ def test_top_const_field assert_node_metadata( :top_const_field, parse('::Foo = bar').dig(:body, 0), - char_start: 0, - char_end: 5 + sc: 0, + ec: 5 ) end @@ -716,8 +701,8 @@ def test_var_field assert_node_metadata( :var_field, parse('foo = 1').dig(:body, 0), - char_start: 0, - char_end: 3 + sc: 0, + ec: 3 ) end @@ -730,15 +715,15 @@ def test_vcall end def test_void_stmt - assert_node_metadata(:void_stmt, parse('; ;'), char_start: 0, char_end: 0) + assert_node_metadata(:void_stmt, parse('; ;'), sc: 0, ec: 0) end def test_when assert_node_metadata( :when, parse('case foo; when bar; baz; end').dig(:body, 1), - char_start: 10, - char_end: 28 + sc: 10, + ec: 28 ) end @@ -750,8 +735,8 @@ def test_words assert_node_metadata( :words, parse('%W[f#{o}o b#{a}r b#{a}z]').dig(:body, 0), - char_start: 0, - char_end: 24 + sc: 0, + ec: 24 ) end @@ -787,8 +772,8 @@ def foo(...) assert_node_metadata( :args_forward, parse(content).dig(:body, 1, :body, 0, :body, 2), - char_start: 8, - char_end: 11 + sc: 8, + ec: 11 ) end @@ -803,8 +788,8 @@ def test_aryptn assert_node_metadata( :aryptn, parse(content).dig(:body, 1, :body, 0), - char_start: 12, - char_end: 20 + sc: 12, + ec: 20 ) end @@ -816,24 +801,14 @@ def test_in end SOURCE - assert_node_metadata( - :in, - parse(content).dig(:body, 1), - char_start: 9, - char_end: 25 - ) + assert_node_metadata(:in, parse(content).dig(:body, 1), sc: 9, ec: 25) end end private def assert_metadata(type, ruby) - assert_node_metadata( - type, - parse(ruby), - char_start: 0, - char_end: ruby.chomp.size - ) + assert_node_metadata(type, parse(ruby), sc: 0, ec: ruby.chomp.size) end def assert_node_metadata(type, node, metadata) From 0f9209cba3755f398524796b024aaf6003893e16 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sat, 2 Jan 2021 21:54:39 -0500 Subject: [PATCH 037/785] Fix for #755 --- CHANGELOG.md | 1 + src/ruby/nodes/return.js | 23 +++++++++++++++++++---- test/js/ruby/nodes/return.test.js | 6 ++++++ 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b88d73a4..c081872d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [@AlanFoster], [@kddeisz] - Ensure key-value pairs split on line when the key has a comment attached within a hash. - [@AlanFoster], [@kddeisz] - Fix for `for` loops that have multiple index variables. - [@AlanFoster], [@kddeisz] - Fix parsing very large files by reducing the size of the JSON output from the parser. +- [@AlanFoster], [@kddeisz] - Ensure you don't skip parentheses if you're returning a value with the `not` unary operator. ## [1.2.2] - 2021-01-01 diff --git a/src/ruby/nodes/return.js b/src/ruby/nodes/return.js index 1e0120fc..452a792e 100644 --- a/src/ruby/nodes/return.js +++ b/src/ruby/nodes/return.js @@ -9,17 +9,32 @@ const { } = require("../../prettier"); const { literal } = require("../../utils"); -// You can't skip the parentheses if you have the `and` or `or` operator, -// because they have low enough operator precedence that you need to explicitly -// keep them in there. +// You can't skip the parentheses if you have comments or certain operators with +// lower precedence than the return keyword. const canSkipParens = (args) => { const stmts = args.body[0].body[0]; + + // return( + // # a + // b + // ) if (stmts.comments) { return false; } const stmt = stmts.body[0]; - return stmt.type !== "binary" || !["and", "or"].includes(stmt.body[1]); + + // return (a or b) + if (stmt.type === "binary" && ["and", "or"].includes(stmt.body[1])) { + return false; + } + + // return (not a) + if (stmt.type === "unary" && stmt.oper === "not") { + return false; + } + + return true; }; const printReturn = (path, opts, print) => { diff --git a/test/js/ruby/nodes/return.test.js b/test/js/ruby/nodes/return.test.js index 71da2534..95b75b9b 100644 --- a/test/js/ruby/nodes/return.test.js +++ b/test/js/ruby/nodes/return.test.js @@ -43,4 +43,10 @@ describe("return", () => { test("returning two arguments, the first with parentheses", () => expect("return (1), 2").toMatchFormat()); + + test("returning with the or keyword", () => + expect("return(a or b)").toMatchFormat()); + + test("returning with the not keyword", () => + expect("return(not a)").toMatchFormat()); }); From 58b4ca1776a000c5841a524bd68c465044922b2b Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sat, 2 Jan 2021 22:14:36 -0500 Subject: [PATCH 038/785] Bump to v1.2.3 --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c081872d..63d0bd21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [1.2.3] - 2021-01-02 + ### Changed - [@lukyth], [@kddeisz] - Ensure if a ternary breaks into an `if..else..end` within a `command_call` node that parentheses are added. @@ -1007,7 +1009,8 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.2.2...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.2.3...HEAD +[1.2.3]: https://github.com/prettier/plugin-ruby/compare/v1.2.2...v1.2.3 [1.2.2]: https://github.com/prettier/plugin-ruby/compare/v1.2.1...v1.2.2 [1.2.1]: https://github.com/prettier/plugin-ruby/compare/v1.2.0...v1.2.1 [1.2.0]: https://github.com/prettier/plugin-ruby/compare/v1.1.0...v1.2.0 diff --git a/package.json b/package.json index ddb0bab0..82836392 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "1.2.2", + "version": "1.2.3", "description": "prettier plugin for the Ruby programming language", "main": "src/plugin.js", "scripts": { From bcdcbb3e7f54e547e587b475147678859bac202d Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Thu, 31 Dec 2020 12:51:30 -0500 Subject: [PATCH 039/785] Up the test coverage --- src/prettier.js | 1 + src/ruby/embed.js | 4 + src/ruby/nodes/blocks.js | 123 ++++++++++++------------ src/ruby/nodes/hooks.js | 28 ++---- src/ruby/nodes/methods.js | 10 +- src/ruby/nodes/params.js | 36 ++++--- src/ruby/nodes/patterns.js | 14 ++- src/ruby/nodes/return.js | 4 - src/ruby/nodes/statements.js | 7 +- src/ruby/nodes/strings.js | 61 +++++------- src/ruby/parser.js | 1 + src/ruby/parser.rb | 7 +- src/ruby/toProc.js | 12 +-- src/utils/makeCall.js | 3 + test/js/nodes/field.test.js | 8 ++ test/js/ruby/embed.test.js | 10 ++ test/js/ruby/nodes.test.js | 1 + test/js/ruby/nodes/arrays.test.js | 30 ++++++ test/js/ruby/nodes/binary.test.js | 2 + test/js/ruby/nodes/calls.test.js | 21 ++++ test/js/ruby/nodes/conditionals.test.js | 13 +++ test/js/ruby/nodes/hashes.test.js | 23 +++++ test/js/ruby/nodes/hooks.test.js | 10 ++ test/js/ruby/nodes/method.test.js | 60 +++++++++--- test/js/ruby/nodes/patterns.test.js | 101 ++++++++++++------- test/js/ruby/nodes/ranges.test.js | 12 +++ test/js/ruby/nodes/rescue.test.js | 23 ++++- test/js/ruby/nodes/return.test.js | 13 ++- test/js/ruby/nodes/strings.test.js | 27 +++++- test/js/ruby/toProc.test.js | 92 ++++++++++++++---- test/rb/metadata_test.rb | 4 +- 31 files changed, 530 insertions(+), 231 deletions(-) create mode 100644 test/js/nodes/field.test.js diff --git a/src/prettier.js b/src/prettier.js index 9774eac1..47744683 100644 --- a/src/prettier.js +++ b/src/prettier.js @@ -1,6 +1,7 @@ // If `RBPRETTIER` is set, then this is being run from the `Prettier::run` ruby // method. In that case, we need to pull `prettier` from the node_modules // directly, as it's been shipped with the gem. +/* istanbul ignore next */ const source = process.env.RBPRETTIER ? "../node_modules/prettier" : "prettier"; const prettier = require(source); diff --git a/src/ruby/embed.js b/src/ruby/embed.js index 7882ff62..35807672 100644 --- a/src/ruby/embed.js +++ b/src/ruby/embed.js @@ -20,6 +20,10 @@ const parsers = { scss: "scss" }; +// This function is in here because it handles embedded parser values. I don't +// have a test that exercises it because I'm not sure for which parser it is +// necessary, but since it's in prettier core I'm keeping it here. +/* istanbul ignore next */ const replaceNewlines = (doc) => mapDoc(doc, (currentDoc) => typeof currentDoc === "string" && currentDoc.includes("\n") diff --git a/src/ruby/nodes/blocks.js b/src/ruby/nodes/blocks.js index 78fd68d0..b95e44d7 100644 --- a/src/ruby/nodes/blocks.js +++ b/src/ruby/nodes/blocks.js @@ -10,76 +10,81 @@ const { } = require("../../prettier"); const { hasAncestor } = require("../../utils"); -const printBlock = (braces) => (path, opts, print) => { - const [variables, statements] = path.getValue().body; - const stmts = - statements.type === "stmts" ? statements.body : statements.body[0].body; +function printBlockVar(path, opts, print) { + const parts = ["|", removeLines(path.call(print, "body", 0))]; - let doBlockBody = ""; - if ( - stmts.length !== 1 || - stmts[0].type !== "void_stmt" || - stmts[0].comments - ) { - doBlockBody = indent(concat([softline, path.call(print, "body", 1)])); + // The second part of this node is a list of optional block-local variables + if (path.getValue().body[1]) { + parts.push("; ", join(", ", path.map(print, "body", 1))); } - // If this block is nested underneath a command or command_call node, then we - // can't use `do...end` because that will get associated with the parent node - // as opposed to the current node (because of the difference in operator - // precedence). Instead, we still use a multi-line format but switch to using - // braces instead. - const useBraces = braces && hasAncestor(path, ["command", "command_call"]); + parts.push("| "); + return concat(parts); +} - const doBlock = concat([ - useBraces ? " {" : " do", - variables ? concat([" ", path.call(print, "body", 0)]) : "", - doBlockBody, - concat([softline, useBraces ? "}" : "end"]) - ]); +function printBlock(braces) { + return function printBlockWithBraces(path, opts, print) { + const [variables, statements] = path.getValue().body; + const stmts = + statements.type === "stmts" ? statements.body : statements.body[0].body; - // We can hit this next pattern if within the block the only statement is a - // comment. - if ( - stmts.length === 1 && - stmts[0].type === "void_stmt" && - stmts[0].comments - ) { - return concat([breakParent, doBlock]); - } + let doBlockBody = ""; + if ( + stmts.length !== 1 || + stmts[0].type !== "void_stmt" || + stmts[0].comments + ) { + doBlockBody = indent(concat([softline, path.call(print, "body", 1)])); + } - // If the parent node is a command node, then there are no parentheses around - // the arguments to that command, so we need to break the block - if (["command", "command_call"].includes(path.getParentNode().body[0].type)) { - return concat([breakParent, doBlock]); - } + // If this block is nested underneath a command or command_call node, then + // we can't use `do...end` because that will get associated with the parent + // node as opposed to the current node (because of the difference in + // operator precedence). Instead, we still use a multi-line format but + // switch to using braces instead. + const useBraces = braces && hasAncestor(path, ["command", "command_call"]); - const hasBody = stmts.some(({ type }) => type !== "void_stmt"); - const braceBlock = concat([ - " {", - hasBody || variables ? " " : "", - variables ? path.call(print, "body", 0) : "", - path.call(print, "body", 1), - hasBody ? " " : "", - "}" - ]); + const doBlock = concat([ + useBraces ? " {" : " do", + variables ? concat([" ", path.call(print, "body", 0)]) : "", + doBlockBody, + concat([softline, useBraces ? "}" : "end"]) + ]); - return group(ifBreak(doBlock, braceBlock)); -}; + // We can hit this next pattern if within the block the only statement is a + // comment. + if ( + stmts.length === 1 && + stmts[0].type === "void_stmt" && + stmts[0].comments + ) { + return concat([breakParent, doBlock]); + } -module.exports = { - block_var: (path, opts, print) => { - const parts = ["|", removeLines(path.call(print, "body", 0))]; + const blockReceiver = path.getParentNode().body[0]; - // The second part of this node is a list of optional block-local variables - if (path.getValue().body[1]) { - parts.push("; ", join(", ", path.map(print, "body", 1))); + // If the parent node is a command node, then there are no parentheses + // around the arguments to that command, so we need to break the block + if (["command", "command_call"].includes(blockReceiver.type)) { + return concat([breakParent, doBlock]); } - parts.push("| "); - return concat(parts); - }, + const hasBody = stmts.some(({ type }) => type !== "void_stmt"); + const braceBlock = concat([ + " {", + hasBody || variables ? " " : "", + variables ? path.call(print, "body", 0) : "", + path.call(print, "body", 1), + hasBody ? " " : "", + "}" + ]); + + return group(ifBreak(doBlock, braceBlock)); + }; +} + +module.exports = { + block_var: printBlockVar, brace_block: printBlock(true), - do_block: printBlock(false), - excessed_comma: () => "" + do_block: printBlock(false) }; diff --git a/src/ruby/nodes/hooks.js b/src/ruby/nodes/hooks.js index 1527a384..332da91d 100644 --- a/src/ruby/nodes/hooks.js +++ b/src/ruby/nodes/hooks.js @@ -1,5 +1,4 @@ const { concat, group, indent, line } = require("../../prettier"); -const { isEmptyStmts } = require("../../utils"); // The `BEGIN` and `END` keywords are used to hook into the Ruby process. Any // `BEGIN` blocks are executed right when the process starts up, and the `END` @@ -17,24 +16,15 @@ const { isEmptyStmts } = require("../../utils"); // nodes contain one child which is a `stmts` node. function printHook(name) { return function printHookWithName(path, opts, print) { - const stmtsNode = path.getValue().body[1]; - const printedStmts = path.call(print, "body", 1); - - const parts = [ - name, - " ", - path.call(print, "body", 0), - indent(concat([line, printedStmts])), - concat([line, "}"]) - ]; - - // If there are no statements but there are comments, then we want to skip - // printing the newline so that we don't end up with multiple spaces. - if (isEmptyStmts(stmtsNode) && stmtsNode.comments) { - parts[1] = indent(printedStmts); - } - - return group(concat(parts)); + return group( + concat([ + name, + " ", + path.call(print, "body", 0), + indent(concat([line, path.call(print, "body", 1)])), + concat([line, "}"]) + ]) + ); }; } diff --git a/src/ruby/nodes/methods.js b/src/ruby/nodes/methods.js index a5a71b2f..b98b6514 100644 --- a/src/ruby/nodes/methods.js +++ b/src/ruby/nodes/methods.js @@ -47,15 +47,13 @@ function printMethod(offset) { } function printSingleLineMethod(path, opts, print) { - let paramsNode = path.getValue().body[1]; + let parensNode = path.getValue().body[1]; let paramsDoc = ""; - if (paramsNode) { - if (paramsNode.body[0].type === "params") { - paramsNode = paramsNode.body[0]; - } + if (parensNode) { + const paramsNode = parensNode.body[0]; - if (paramsNode.type === "params" && paramsNode.body.some((type) => type)) { + if (paramsNode.body.some((type) => type)) { paramsDoc = path.call(print, "body", 1); } } diff --git a/src/ruby/nodes/params.js b/src/ruby/nodes/params.js index 52709656..9c574c39 100644 --- a/src/ruby/nodes/params.js +++ b/src/ruby/nodes/params.js @@ -29,18 +29,22 @@ function printParams(path, opts, print) { let parts = []; if (reqs) { - parts = parts.concat(path.map(print, "body", 0)); + path.each( + (reqPath) => { + // For some very strange reason, if you have a comment attached to a + // rest_param, it shows up here in the list of required params. + if (reqPath.getValue().type !== "rest_param") { + parts.push(print(reqPath)); + } + }, + "body", + 0 + ); } if (optls) { parts = parts.concat( - optls.map((_, index) => - concat([ - path.call(print, "body", 1, index, 0), - " = ", - path.call(print, "body", 1, index, 1) - ]) - ) + path.map((optlPath) => join(" = ", optlPath.map(print)), "body", 1) ); } @@ -54,12 +58,16 @@ function printParams(path, opts, print) { if (kwargs) { parts = parts.concat( - kwargs.map(([, value], index) => { - if (!value) { - return path.call(print, "body", 4, index, 0); - } - return group(join(" ", path.map(print, "body", 4, index))); - }) + path.map( + (kwargPath) => { + if (!kwargPath.getValue()[1]) { + return kwargPath.call(print, 0); + } + return group(join(" ", kwargPath.map(print))); + }, + "body", + 4 + ) ); } diff --git a/src/ruby/nodes/patterns.js b/src/ruby/nodes/patterns.js index d349511f..00fe250e 100644 --- a/src/ruby/nodes/patterns.js +++ b/src/ruby/nodes/patterns.js @@ -1,4 +1,5 @@ const { + align, concat, group, hardline, @@ -74,7 +75,7 @@ function printHshPtn(path, opts, print) { const [constant, keyValuePairs, keyValueRest] = path.getValue().body; let args = []; - if (keyValuePairs) { + if (keyValuePairs.length > 0) { const printPair = (pairPath) => { const parts = [pairPath.call(print, 0)]; @@ -116,10 +117,13 @@ function printHshPtn(path, opts, print) { function printIn(path, opts, print) { const parts = [ "in ", - path.call( - (valuePath) => printPatternArg(valuePath, opts, print), - "body", - 0 + align( + "in ".length, + path.call( + (valuePath) => printPatternArg(valuePath, opts, print), + "body", + 0 + ) ), indent(concat([hardline, path.call(print, "body", 1)])) ]; diff --git a/src/ruby/nodes/return.js b/src/ruby/nodes/return.js index 452a792e..fcd46466 100644 --- a/src/ruby/nodes/return.js +++ b/src/ruby/nodes/return.js @@ -41,10 +41,6 @@ const printReturn = (path, opts, print) => { let args = path.getValue().body[0].body[0]; let steps = ["body", 0, "body", 0]; - if (!args) { - return "return"; - } - if (args.body.length === 1) { // If the body of the return contains parens, then just skip directly to the // content of the parens so that we can skip printing parens if we don't diff --git a/src/ruby/nodes/statements.js b/src/ruby/nodes/statements.js index 3ac097dd..8fa58278 100644 --- a/src/ruby/nodes/statements.js +++ b/src/ruby/nodes/statements.js @@ -30,6 +30,7 @@ function printBodyStmt(path, opts, print) { if (elseClause) { // Before Ruby 2.6, this piece of bodystmt was an explicit "else" node + /* istanbul ignore next */ const stmts = elseClause.type === "else" ? path.call(print, "body", 2, "body", 0) @@ -69,11 +70,7 @@ function printParen(path, opts, print) { } return group( - concat([ - "(", - indent(concat([softline, contentDoc])), - concat([softline, ")"]) - ]) + concat(["(", indent(concat([softline, contentDoc])), softline, ")"]) ); } diff --git a/src/ruby/nodes/strings.js b/src/ruby/nodes/strings.js index 57a9b4db..da51ab6d 100644 --- a/src/ruby/nodes/strings.js +++ b/src/ruby/nodes/strings.js @@ -31,17 +31,10 @@ function isSingleQuotable(node) { const quotePattern = new RegExp("\\\\([\\s\\S])|(['\"])", "g"); -function normalizeQuotes(content, enclosingQuote, originalQuote) { - const replaceOther = originalQuote === '"'; - const otherQuote = enclosingQuote === '"' ? "'" : '"'; - +function normalizeQuotes(content, enclosingQuote) { // Escape and unescape single and double quotes as needed to be able to // enclose `content` with `enclosingQuote`. return content.replace(quotePattern, (match, escaped, quote) => { - if (replaceOther && escaped === otherQuote) { - return escaped; - } - if (quote === enclosingQuote) { return `\\${quote}`; } @@ -97,12 +90,34 @@ function printDynaSymbol(path, opts, print) { return concat([":", quote].concat(path.map(print, "body")).concat(quote)); } +function printStringConcat(path, opts, print) { + const [leftDoc, rightDoc] = path.map(print, "body"); + + return group(concat([leftDoc, " \\", indent(concat([hardline, rightDoc]))])); +} + // Prints out an interpolated variable in the string by converting it into an // embedded expression. function printStringDVar(path, opts, print) { return concat(["#{", path.call(print, "body", 0), "}"]); } +function printStringEmbExpr(path, opts, print) { + const parts = path.call(print, "body", 0); + + // If the interpolated expression is inside of a heredoc or an xstring + // literal (a string that gets sent to the command line) then we don't want + // to automatically indent, as this can lead to some very odd looking + // expressions + if (["heredoc", "xstring_literal"].includes(path.getParentNode().type)) { + return concat(["#{", parts, "}"]); + } + + return group( + concat(["#{", indent(concat([softline, parts])), concat([softline, "}"])]) + ); +} + // Prints out a literal string. This function does its best to respect the // wishes of the user with regards to single versus double quotes, but if the // string contains any escape expressions then it will just keep the original @@ -131,10 +146,7 @@ function printStringLiteral(path, { rubySingleQuote }, print) { } // In this case, the part of the string is just regular string content - return join( - literalline, - normalizeQuotes(part.body, quote, node.quote).split("\n") - ); + return join(literalline, normalizeQuotes(part.body, quote).split("\n")); }); return concat([quote].concat(parts).concat(getClosingQuote(quote))); @@ -155,30 +167,9 @@ function printXStringLiteral(path, opts, print) { module.exports = { "@CHAR": printChar, dyna_symbol: printDynaSymbol, - string_concat: (path, opts, print) => - group( - concat([ - path.call(print, "body", 0), - " \\", - indent(concat([hardline, path.call(print, "body", 1)])) - ]) - ), + string_concat: printStringConcat, string_dvar: printStringDVar, - string_embexpr: (path, opts, print) => { - const parts = path.call(print, "body", 0); - - // If the interpolated expression is inside of a heredoc or an xstring - // literal (a string that gets sent to the command line) then we don't want - // to automatically indent, as this can lead to some very odd looking - // expressions - if (["heredoc", "xstring_literal"].includes(path.getParentNode().type)) { - return concat(["#{", parts, "}"]); - } - - return group( - concat(["#{", indent(concat([softline, parts])), concat([softline, "}"])]) - ); - }, + string_embexpr: printStringEmbExpr, string_literal: printStringLiteral, symbol_literal: printSymbolLiteral, xstring_literal: printXStringLiteral diff --git a/src/ruby/parser.js b/src/ruby/parser.js index 666c1bb7..66502ea1 100644 --- a/src/ruby/parser.js +++ b/src/ruby/parser.js @@ -4,6 +4,7 @@ const path = require("path"); // In order to properly parse ruby code, we need to tell the ruby process to // parse using UTF-8. Unfortunately, the way that you accomplish this looks // differently depending on your platform. +/* istanbul ignore next */ const LANG = (() => { const { env, platform } = process; const envValue = env.LC_ALL || env.LC_CTYPE || env.LANG; diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 1468e4a3..a4c9527d 100755 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -1657,9 +1657,14 @@ def on_params(*types) # anywhere in a Ruby program. It accepts as arguments the contents, which # can be either params or statements. def on_paren(contents) + beging = find_scanner_event(:@lparen) ending = find_scanner_event(:@rparen) - find_scanner_event(:@lparen).merge!( + if contents && contents[:type] == :params + contents.merge!(sc: beging[:ec], ec: ending[:sc]) + end + + beging.merge!( type: :paren, body: [contents], end: ending[:end], diff --git a/src/ruby/toProc.js b/src/ruby/toProc.js index ecd40a17..5e88c969 100644 --- a/src/ruby/toProc.js +++ b/src/ruby/toProc.js @@ -12,15 +12,11 @@ const isCall = (node) => ["::", "."].includes(node) || node.type === "@period"; // // This works with `do` blocks as well. const toProc = (path, node) => { - if (!node) { - return null; - } - const [variables, blockContents] = node.body; // Ensure that there are variables being passed to this block. const params = variables && variables.body[0]; - if (!params || params.type !== "params") { + if (!params) { return null; } @@ -39,7 +35,7 @@ const toProc = (path, node) => { if (blockContents.type === "bodystmt") { // We’re in a `do` block const blockStatements = blockContents.body[0]; - const rescueElseEnsure = blockStatements.body.slice(1); + const rescueElseEnsure = blockContents.body.slice(1); // You can’t use the to_proc shortcut if you’re rescuing if (rescueElseEnsure.some(Boolean)) { @@ -84,7 +80,7 @@ const toProc = (path, node) => { if (path.getValue().type === "method_add_block") { assocNode = path.getParentNode(); - } else if (path.getValue().type === "args") { + } else { assocNode = path.getParentNode(2); } @@ -97,7 +93,7 @@ const toProc = (path, node) => { if ( key.type === "symbol_literal" && - ["if", "unless"].includes(key.body[0].body[0].body) + ["if", "unless"].includes(key.body[0].body) ) { return null; } diff --git a/src/utils/makeCall.js b/src/utils/makeCall.js index 0890f45e..568c354a 100644 --- a/src/utils/makeCall.js +++ b/src/utils/makeCall.js @@ -1,6 +1,9 @@ function makeCall(path, opts, print) { const operation = path.getValue().body[1]; + // Ignoring the next block for coverage information because it's only relevant + // in Ruby 2.5 and below. + /* istanbul ignore next */ if ([".", "&."].includes(operation)) { return operation; } diff --git a/test/js/nodes/field.test.js b/test/js/nodes/field.test.js new file mode 100644 index 00000000..6a13170a --- /dev/null +++ b/test/js/nodes/field.test.js @@ -0,0 +1,8 @@ +describe("field", () => { + test("basic", () => expect("foo.x = 1").toMatchFormat()); + + test("replaces :: with .", () => + expect("foo::x = 1").toChangeFormat("foo.x = 1")); + + test("with lonely operator", () => expect("foo&.x = 1").toMatchFormat()); +}); diff --git a/test/js/ruby/embed.test.js b/test/js/ruby/embed.test.js index fccaed07..35e4f6e3 100644 --- a/test/js/ruby/embed.test.js +++ b/test/js/ruby/embed.test.js @@ -1,6 +1,16 @@ const { ruby } = require("../utils"); describe("embed", () => { + test("ignores parsers it can't find", () => { + const content = ruby(` + <<-JAVA + int i=0; + JAVA + `); + + return expect(content).toMatchFormat(); + }); + test("formats correctly on straight heredocs", () => { const content = ruby(` <<-JS.squish diff --git a/test/js/ruby/nodes.test.js b/test/js/ruby/nodes.test.js index 54b0d55d..c1adaee1 100644 --- a/test/js/ruby/nodes.test.js +++ b/test/js/ruby/nodes.test.js @@ -10,6 +10,7 @@ const expectedUnhandledNodes = [ "args_new", "assign_error", "class_name_error", + "excessed_comma", "heredoc_dedent", "magic_comment", "mlhs_add", diff --git a/test/js/ruby/nodes/arrays.test.js b/test/js/ruby/nodes/arrays.test.js index 1085f334..607145ea 100644 --- a/test/js/ruby/nodes/arrays.test.js +++ b/test/js/ruby/nodes/arrays.test.js @@ -14,6 +14,9 @@ describe("array", () => { test("transforms basic string arrays", () => expect("['a', 'b', 'c', 'd', 'e']").toChangeFormat("%w[a b c d e]")); + test("does not transform string arrays with interpolation", () => + expect(`['a', "#{b}", 'c']`).toMatchFormat()); + test("does not transform string arrays with spaces", () => expect("['a', 'b c', 'd', 'e']").toMatchFormat()); @@ -125,4 +128,31 @@ describe("array", () => { return expect(content).toMatchFormat(); }); + + test("with leading comments and comments in the body", () => { + const content = ruby(` + # leading + [ + # inside + # body + ] + `); + + return expect(content).toMatchFormat(); + }); + + test("with comments just in the body", () => { + const content = ruby(` + [ + # inside + # body + ] + `); + + return expect(content).toMatchFormat(); + }); + + test.each(["%w", "%W", "%i", "%I"])("%s special array literals", (start) => + expect(`${start}[a b c]`).toMatchFormat() + ); }); diff --git a/test/js/ruby/nodes/binary.test.js b/test/js/ruby/nodes/binary.test.js index 6110368d..97225700 100644 --- a/test/js/ruby/nodes/binary.test.js +++ b/test/js/ruby/nodes/binary.test.js @@ -28,4 +28,6 @@ describe("binary", () => { return expect(content).toMatchFormat(); }); + + test("no spaces for **", () => expect("a**b").toMatchFormat()); }); diff --git a/test/js/ruby/nodes/calls.test.js b/test/js/ruby/nodes/calls.test.js index 43ecfa4a..f44fe8df 100644 --- a/test/js/ruby/nodes/calls.test.js +++ b/test/js/ruby/nodes/calls.test.js @@ -7,6 +7,8 @@ describe("calls", () => { return expect(content).toMatchFormat(); }); + test("short chains", () => expect("foo.bar.baz qux").toMatchFormat()); + test("chain methods", () => { const before = ruby(` aaaaaaaaaa.bbbbbbbbbb.cccccccccc.dddddddddd(foo, bar).eeeeeeeeee.ffffffffff.gggggggggg.hhhhhhhhhh @@ -37,6 +39,25 @@ describe("calls", () => { return expect(content).toMatchFormat(); }); + test("chains of methods with a block right at the top", () => { + const block = long.slice(0, 60); + const content = ruby(` + aaa.bbb.ccc.ddd.eee do + ${block} + end + `); + + const expected = ruby(` + aaa + .bbb + .ccc + .ddd + .eee { ${block} } + `); + + return expect(content).toChangeFormat(expected); + }); + test("tons of calls that fit on one line", () => { const content = "a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z"; diff --git a/test/js/ruby/nodes/conditionals.test.js b/test/js/ruby/nodes/conditionals.test.js index c65344f2..be7fc050 100644 --- a/test/js/ruby/nodes/conditionals.test.js +++ b/test/js/ruby/nodes/conditionals.test.js @@ -504,6 +504,19 @@ describe("conditionals", () => { return expect(content).toMatchFormat(); }); + + test("cannot transform with multiple statements", () => { + const content = ruby(` + if a + 1 + 2 + else + 3 + end + `); + + return expect(content).toMatchFormat(); + }); }); }); diff --git a/test/js/ruby/nodes/hashes.test.js b/test/js/ruby/nodes/hashes.test.js index 4a1067dd..093dcf48 100644 --- a/test/js/ruby/nodes/hashes.test.js +++ b/test/js/ruby/nodes/hashes.test.js @@ -252,6 +252,29 @@ describe("hash", () => { return expect(content).toMatchFormat(); }); + test("with leading comments and comments in the body", () => { + const content = ruby(` + # leading + { + # inside + # body + } + `); + + return expect(content).toMatchFormat(); + }); + + test("with comments just in the body", () => { + const content = ruby(` + { + # inside + # body + } + `); + + return expect(content).toMatchFormat(); + }); + // https://github.com/prettier/plugin-ruby/issues/758 test("splits if the key has a comment attached", () => { const content = ruby(` diff --git a/test/js/ruby/nodes/hooks.test.js b/test/js/ruby/nodes/hooks.test.js index 52be7746..95c8fcac 100644 --- a/test/js/ruby/nodes/hooks.test.js +++ b/test/js/ruby/nodes/hooks.test.js @@ -13,6 +13,16 @@ describe.each(["BEGIN", "END"])("%s hook", (hook) => { test("expands to multi line", () => expect(`${hook} { ${long} }`).toChangeFormat(`${hook} {\n ${long}\n}`)); + test("does not move comments on the declaration", () => { + const content = ruby(` + ${hook} { # comment + p 'hook' + } + `); + + return expect(content).toMatchFormat(); + }); + test("works for comments in the body", () => { const content = ruby(` ${hook} { diff --git a/test/js/ruby/nodes/method.test.js b/test/js/ruby/nodes/method.test.js index 6f2b8e17..0303824e 100644 --- a/test/js/ruby/nodes/method.test.js +++ b/test/js/ruby/nodes/method.test.js @@ -69,6 +69,48 @@ describe("method", () => { return expect(content).toMatchFormat(); }); + test("breaking", () => { + const content = `def foo(${long}:, a${long}:); end`; + const expected = ruby(` + def foo( + ${long}:, + a${long}: + ); end + `); + + return expect(content).toChangeFormat(expected); + }); + + test("with comments on params", () => { + const content = ruby(` + def method( + req, # req comment + *rest, # rest comment + post, # post comment + kwarg:, # kwarg comment + kwarg_opt: 1, # kwarg_opt comment + **kwarg_rest, # kwarg_rest comment + &block # block comment + ) + 'foo' + end + `); + + return expect(content).toMatchFormat(); + }); + + test("with comments on optional params", () => { + const content = ruby(` + def method( + optl = 'value' # comment + ) + 'foo' + end + `); + + return expect(content).toMatchFormat(); + }); + if (process.env.RUBY_VERSION >= "2.7") { test("nokw_param", () => expect("def foo(**nil); end").toMatchFormat()); @@ -93,20 +135,14 @@ describe("method", () => { return expect(content).toMatchFormat(); }); - } - test("breaking", () => - expect(`def foo(${long}:, a${long}:); end`).toChangeFormat( - ruby(` - def foo( - ${long}:, - a${long}: - ); end - `) - )); - - if (process.env.RUBY_VERSION >= "3.0") { test("single-line methods", () => + expect("def foo = bar").toMatchFormat()); + + test("single-line methods with empty params", () => + expect("def foo() = bar").toChangeFormat("def foo = bar")); + + test("single-line methods with params", () => expect("def foo(name) = bar").toMatchFormat()); } diff --git a/test/js/ruby/nodes/patterns.test.js b/test/js/ruby/nodes/patterns.test.js index a63e4280..50a3c486 100644 --- a/test/js/ruby/nodes/patterns.test.js +++ b/test/js/ruby/nodes/patterns.test.js @@ -10,41 +10,28 @@ describe("patterns", () => { return; } - describe("value pattern", () => { - let cases = [ - "0", - "-1..1", - "Integer", - "bar", - "_, _", - "0 | 1 | 2", - "Integer => bar", - "Object[0, *bar, 1]", - "a, b, *c, d, e", - "0, [1, _] => bar", - "^bar", - "x: 0.. => px, **rest", - "SuperPoint[x: 0.. => px]", - "a, b if b == a * 2" - ]; - - if (process.env.RUBY_VERSION >= "3.0") { - cases.push("[*, 0, *]", "[*, 0, 1, 2, *]", "FooBar[*, 0, *]"); - } - - test.each(cases)("%s", (pattern) => { - const content = ruby(` - case foo - in ${pattern} - baz - end - `); - - return expect(content).toMatchFormat(); - }); - }); + const cases = [ + "0", + "-1..1", + "Integer", + "bar", + "_, _", + "0 | 1 | 2", + "Integer => bar", + "Object[0, *bar, 1]", + "a, b, *c, d, e", + "*c, d, e", + "0, [1, _] => bar", + "^bar", + "x: 0.. => px, **rest", + "**rest", + "SuperPoint[x: 0.. => px]", + "a, b if b == a * 2" + ]; if (process.env.RUBY_VERSION >= "3.0") { + cases.push("[*, 0, *]", "[*, 0, 1, 2, *]", "FooBar[*, 0, *]"); + test("rassign", () => { const content = "{ db: { user: 'John' } } => { db: { user: } }"; @@ -57,4 +44,52 @@ describe("patterns", () => { return expect(content).toMatchFormat(); }); } + + test.each(cases)("%s", (pattern) => { + const content = ruby(` + case foo + in ${pattern} + baz + end + `); + + return expect(content).toMatchFormat(); + }); + + test("with comments in an array pattern", () => { + const content = ruby(` + case foo + in 1, # 1 comment + 2 # 2 comment + bar + end + `); + + return expect(content).toMatchFormat(); + }); + + test("with comments in an array pattern", () => { + const content = ruby(` + case foo + in foo:, # foo comment + bar: # bar comment + bar + end + `); + + return expect(content).toMatchFormat(); + }); + + test("multiple clauses", () => { + const content = ruby(` + case foo + in bar + 1 + in baz + 2 + end + `); + + return expect(content).toMatchFormat(); + }); }); diff --git a/test/js/ruby/nodes/ranges.test.js b/test/js/ruby/nodes/ranges.test.js index 64c44ecc..a6c429b6 100644 --- a/test/js/ruby/nodes/ranges.test.js +++ b/test/js/ruby/nodes/ranges.test.js @@ -6,4 +6,16 @@ describe("ranges", () => { test("three dot", () => expect("3...4").toMatchFormat()); test("negative three dot", () => expect("-4...-3").toMatchFormat()); + + if (process.env.RUBY_VERSION >= "2.6") { + test("two dot with no ending", () => expect("1..").toMatchFormat()); + + test("three dot with no ending", () => expect("1...").toMatchFormat()); + } + + if (process.env.RUBY_VERSION >= "2.7") { + test("two dot with no beginning", () => expect("..2").toMatchFormat()); + + test("three dot with no beginning", () => expect("...2").toMatchFormat()); + } }); diff --git a/test/js/ruby/nodes/rescue.test.js b/test/js/ruby/nodes/rescue.test.js index ea3c8d5f..02cf1b77 100644 --- a/test/js/ruby/nodes/rescue.test.js +++ b/test/js/ruby/nodes/rescue.test.js @@ -1,16 +1,29 @@ const { ruby } = require("../../utils"); describe("rescue", () => { - test("inline", () => - expect("a rescue nil").toChangeFormat( - ruby(` + test("inline", () => { + const expected = ruby(` begin a rescue StandardError nil end - `) - )); + `); + + return expect("a rescue nil").toChangeFormat(expected); + }); + + test("rescue just variable", () => { + const content = ruby(` + begin + a + rescue => e + nil + end + `); + + return expect(content).toMatchFormat(); + }); // from ruby spec/ruby/language/rescue_spec.rb test("splat errors", () => { diff --git a/test/js/ruby/nodes/return.test.js b/test/js/ruby/nodes/return.test.js index 95b75b9b..8a63339b 100644 --- a/test/js/ruby/nodes/return.test.js +++ b/test/js/ruby/nodes/return.test.js @@ -1,4 +1,4 @@ -const { long } = require("../../utils"); +const { long, ruby } = require("../../utils"); describe("return", () => { test("bare", () => expect("return").toMatchFormat()); @@ -49,4 +49,15 @@ describe("return", () => { test("returning with the not keyword", () => expect("return(not a)").toMatchFormat()); + + test("comment inside of return parentheses", () => { + const content = ruby(` + return( + # foo + bar + ) + `); + + return expect(content).toMatchFormat(); + }); }); diff --git a/test/js/ruby/nodes/strings.test.js b/test/js/ruby/nodes/strings.test.js index 1ca0626e..24b0d5cb 100644 --- a/test/js/ruby/nodes/strings.test.js +++ b/test/js/ruby/nodes/strings.test.js @@ -70,6 +70,11 @@ describe("strings", () => { test("double quotes with inner single quotes stay", () => expect(`"abc's"`).toMatchFormat({ rubySingleQuote: false })); + test("double quotes get escaped", () => + expect(`'"foo"'`).toChangeFormat(`"\\"foo\\""`, { + rubySingleQuote: false + })); + describe("escape sequences", () => { test("single quotes stay", () => expect("'abc\\n'").toMatchFormat()); @@ -103,11 +108,21 @@ describe("strings", () => { test("breaks interpolation on #{ ... } and not some inner node", () => expect(`"${long} #{foo[:bar]} ${long}"`).toChangeFormat( ruby(` - "${long} #{ - foo[:bar] - } ${long}" - `) + "${long} #{ + foo[:bar] + } ${long}" + `) )); + + test("within a heredoc there is no indentation", () => { + const content = ruby(` + <<~HERE + #{${long}} + HERE + `); + + return expect(content).toMatchFormat(); + }); }); describe("char literals", () => { @@ -162,4 +177,8 @@ describe("strings", () => { return expect(content).toMatchFormat(); }); }); + + test.each(["@v", "@@v", "$v"])("%s dvar", (interp) => { + expect(`"#${interp}"`).toChangeFormat(`"#{${interp}}"`); + }); }); diff --git a/test/js/ruby/toProc.test.js b/test/js/ruby/toProc.test.js index c022a3b2..0d7b4bd5 100644 --- a/test/js/ruby/toProc.test.js +++ b/test/js/ruby/toProc.test.js @@ -91,29 +91,85 @@ describe("to_proc transform", () => { }); }); - test("does not happen when there are multiple lines", () => { - const content = ruby(` - loop do |i| - i.to_s - i.next - end - `); + test("when inside of an aref node", () => { + const content = "foo[:bar].each { |baz| baz.to_s }"; + const expected = "foo[:bar].each(&:to_s)"; - return expect(content).toMatchFormat({ rubyToProc: true }); + return expect(content).toChangeFormat(expected, { rubyToProc: true }); }); - test("does not happen when there are args to the method call", () => - expect("loop { |i| i.to_s(:db) }").toMatchFormat({ - rubyToProc: true - })); + describe("when not to transform", () => { + test("when called with &.", () => { + const content = "loop { |i| i&.to_s }"; + + expect(content).toMatchFormat({ rubyToProc: true }); + }); + + test("when there are multiple lines", () => { + const content = ruby(` + loop do |i| + i.to_s + i.next + end + `); + + return expect(content).toMatchFormat({ rubyToProc: true }); + }); + + test("when there is a rescue, else, or ensure", () => { + const content = ruby(` + loop do |i| + i.to_s + rescue Foo + foo + end + `); + + return expect(content).toMatchFormat({ rubyToProc: true }); + }); + + test("when there are args to the method call", () => { + const content = "loop { |i| i.to_s(:db) }"; + + expect(content).toMatchFormat({ rubyToProc: true }); + }); + + test("when there are multiple args", () => { + const content = "loop { |i, j| i.to_s }"; + + return expect(content).toMatchFormat({ rubyToProc: true }); + }); + + test("when we're inside an if:", () => { + const content = "{ if: proc { |i| i.to_s } }"; + + return expect(content).toMatchFormat({ rubyToProc: true }); + }); + + test("when we're inside an :if =>", () => { + const content = "{ :if => proc { |i| i.to_s } }"; + const expected = "{ if: proc { |i| i.to_s } }"; - test("does not happen when there are multiple args", () => - expect("loop { |i, j| i.to_s }").toMatchFormat({ rubyToProc: true })); + return expect(content).toChangeFormat(expected, { rubyToProc: true }); + }); + + test("when we're inside a regular hash", () => { + const content = "{ when: proc { |i| i.to_s } }"; + const expected = "{ when: proc(&:to_s) }"; + + return expect(content).toChangeFormat(expected, { rubyToProc: true }); + }); - test("does not duplicate when inside of an aref node", () => - expect( - "foo[:bar].each { |baz| baz.to_s }" - ).toChangeFormat("foo[:bar].each(&:to_s)", { rubyToProc: true })); + test("when we're inside a regular hash", () => { + const content = "{ when: proc { |i| i.to_s } }"; + const expected = "{ when: proc(&:to_s) }"; + + return expect(content).toChangeFormat(expected, { rubyToProc: true }); + }); + + test("when there are no variables", () => + expect("loop { i.to_s }").toMatchFormat({ rubyToProc: true })); + }); describe.each(["if", "unless"])( "does not transform when used inside hash with %s", diff --git a/test/rb/metadata_test.rb b/test/rb/metadata_test.rb index 6c80b8fe..4071964c 100644 --- a/test/rb/metadata_test.rb +++ b/test/rb/metadata_test.rb @@ -507,8 +507,8 @@ def foo( assert_node_metadata( :params, parse(content).dig(:body, 1, :body, 0), - sc: 11, - ec: 21 + sc: 8, + ec: 22 ) end From 7365f5b70301bc6d576dd26f98ca6873fb4c8ecf Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sun, 3 Jan 2021 12:02:51 -0500 Subject: [PATCH 040/785] Run eslint in own job --- .github/workflows/main.yml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 79952699..8104f5c7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,6 +13,7 @@ jobs: - "2.5" - "2.6" - "2.7" + - "3.0" - truffleruby-head env: CI: true @@ -52,13 +53,35 @@ jobs: - name: Lint and test run: | yarn check-format - yarn lint yarn test bundle exec rake test + lint: + name: Lint + runs-on: ubuntu-latest + env: + CI: true + steps: + - uses: actions/checkout@master + - uses: actions/setup-node@v2-beta + with: + node-version: 12.x + - id: yarn-cache + run: echo "::set-output name=directory::$(yarn cache dir)" + - uses: actions/cache@v1 + with: + path: ${{ steps.yarn-cache.outputs.directory }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - run: yarn install --frozen-lockfile + - run: yarn lint + automerge: name: AutoMerge - needs: ci + needs: + - ci + - lint runs-on: ubuntu-latest if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' steps: From 3baa60eb3241133344f1f771fe160624bbf53ea8 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sun, 3 Jan 2021 12:12:27 -0500 Subject: [PATCH 041/785] Document rubocop --- README.md | 2 +- rubocop.yml | 23 +++++++++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 305c3d44..ae9e7733 100644 --- a/README.md +++ b/README.md @@ -149,7 +149,7 @@ Or, they can be passed to `prettier` as arguments: prettier --ruby-single-quote false --write '**/*.rb' ``` -## Use with RuboCop +### Usage with RuboCop RuboCop and Prettier for Ruby serve different purposes, but there is overlap with some of RuboCop's functionality. diff --git a/rubocop.yml b/rubocop.yml index 996de150..d97ee3e2 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -1,15 +1,26 @@ +# Disabling all Layout/* rules, as they're unnecessary when the user is using +# prettier to handle all of the formatting. + Layout: Enabled: false -Style/MultilineIfModifier: # clashes with rubyModifier +# Disabling all of the following options because they could conflict with a +# prettier configuration setting. + +Style/MultilineIfModifier: # rubyModifier Enabled: false -Style/SymbolArray: # clashes with rubyArrayLiteral + +Style/SymbolArray: # rubyArrayLiteral Enabled: false -Style/WordArray: # clashes with rubyArrayLiteral + +Style/WordArray: # rubyArrayLiteral Enabled: false -Style/TrailingCommaInArguments: # clashes with trailingComma + +Style/TrailingCommaInArguments: # trailingComma Enabled: false -Style/TrailingCommaInArrayLiteral: # clashes with trailingComma + +Style/TrailingCommaInArrayLiteral: # trailingComma Enabled: false -Style/TrailingCommaInHashLiteral: # clashes with trailingComma + +Style/TrailingCommaInHashLiteral: # trailingComma Enabled: false From d8867065e0b67f775e2c764a02eb935773862c16 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sun, 3 Jan 2021 12:29:11 -0500 Subject: [PATCH 042/785] Further reduce JSON size --- CHANGELOG.md | 4 + bin/sexp | 2 +- src/ruby/nodes/statements.js | 6 +- src/ruby/parser.rb | 380 +++++++++++++++++------------------ test/rb/metadata_test.rb | 9 +- 5 files changed, 204 insertions(+), 197 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63d0bd21..81605c67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Changed + +- [@kddeisz] - Reduce JSON size passing from Ruby process to node process by changing `char_start` -> `sc`, `char_end` -> `ec`, `start` -> `sl`, `end` -> `el`. + ## [1.2.3] - 2021-01-02 ### Changed diff --git a/bin/sexp b/bin/sexp index 083c9b59..041330ce 100755 --- a/bin/sexp +++ b/bin/sexp @@ -8,7 +8,7 @@ PP.prepend( def pp_hash(obj) group(1, '{', '}') do text obj[:type] - text "" group(1) do diff --git a/src/ruby/nodes/statements.js b/src/ruby/nodes/statements.js index 8fa58278..65fef378 100644 --- a/src/ruby/nodes/statements.js +++ b/src/ruby/nodes/statements.js @@ -120,12 +120,12 @@ module.exports = { if (lineNo === null) { parts.push(printed); } else if ( - stmt.start - lineNo > 1 || + stmt.sl - lineNo > 1 || [stmt.type, stmts[index - 1].type].includes("access_ctrl") ) { parts.push(hardline, hardline, printed); } else if ( - stmt.start !== lineNo || + stmt.sl !== lineNo || path.getParentNode().type !== "string_embexpr" ) { parts.push(hardline, printed); @@ -133,7 +133,7 @@ module.exports = { parts.push("; ", printed); } - lineNo = stmt.end; + lineNo = stmt.el; }); return concat(parts); diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index a4c9527d..d9561529 100755 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -93,8 +93,8 @@ def find_scanner_event(type, body = :any, consume: true) node = { type: :"@#{event}", body: value, - start: lineno, - end: lineno, + sl: lineno, + el: lineno, sc: char_pos, ec: ec } @@ -118,8 +118,8 @@ def on_comment(value) @comments << { type: :@comment, value: value[1..-1].chomp.force_encoding('UTF-8'), - start: lineno, - end: lineno, + sl: lineno, + el: lineno, sc: char_pos, ec: char_pos + value.length - 1 } @@ -138,8 +138,8 @@ def on_ignored_nl(value) { type: :ignored_nl, body: nil, - start: lineno, - end: lineno, + sl: lineno, + el: lineno, sc: char_pos, ec: char_pos } @@ -191,7 +191,7 @@ def on_BEGIN(stmts) find_scanner_event(:@kw, 'BEGIN').merge!( type: :BEGIN, body: [beging, stmts], - end: ending[:end], + el: ending[:el], ec: ending[:ec] ) end @@ -215,7 +215,7 @@ def on_END(stmts) find_scanner_event(:@kw, 'END').merge!( type: :END, body: [beging, stmts], - end: ending[:end], + el: ending[:el], ec: ending[:ec] ) end @@ -234,9 +234,9 @@ def on_alias(left, right) { type: :alias, body: [left, right], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -262,9 +262,9 @@ def on_aref(collection, index) { type: :aref, body: [collection, index], - start: collection[:start], + sl: collection[:sl], sc: collection[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -278,9 +278,9 @@ def on_aref_field(collection, index) { type: :aref_field, body: [collection, index], - start: collection[:start], + sl: collection[:sl], sc: collection[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -292,9 +292,9 @@ def on_args_new { type: :args, body: [], - start: lineno, + sl: lineno, sc: char_pos, - end: lineno, + el: lineno, ec: char_pos } end @@ -307,7 +307,7 @@ def on_args_add(args, arg) if args[:body].empty? arg.merge(type: :args, body: [arg]) else - args.merge!(body: args[:body] << arg, end: arg[:end], ec: arg[:ec]) + args.merge!(body: args[:body] << arg, el: arg[:el], ec: arg[:ec]) end end @@ -320,7 +320,7 @@ def on_args_add_block(args, block) args.merge( type: :args_add_block, body: [args, block], - end: ending[:end], + el: ending[:el], ec: ending[:ec] ) end @@ -335,9 +335,9 @@ def on_args_add_star(args, part) { type: :args_add_star, body: [args, part], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -357,14 +357,14 @@ def on_arg_paren(args) # If the arguments exceed the ending of the parentheses, then we know we # have a heredoc in the arguments, and we need to use the bounds of the # arguments to determine how large the arg_paren is. - ending = (args && args[:end] > rparen[:end]) ? args : rparen + ending = (args && args[:el] > rparen[:el]) ? args : rparen { type: :arg_paren, body: [args], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -381,9 +381,9 @@ def on_array(contents) { type: :array, body: [contents], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } else @@ -393,7 +393,7 @@ def on_array(contents) ending.merge!( type: :array, body: [contents], - start: contents[:start], + sl: contents[:sl], sc: contents[:sc] ) end @@ -407,9 +407,9 @@ def on_aryptn(const, preargs, splatarg, postargs) { type: :aryptn, body: [const, preargs, splatarg, postargs], - start: pieces[0][:start], + sl: pieces[0][:sl], sc: pieces[0][:sc], - end: pieces[-1][:end], + el: pieces[-1][:el], ec: pieces[-1][:ec] } end @@ -421,7 +421,7 @@ def on_assign(left, right) left.merge( type: :assign, body: [left, right], - end: right[:end], + el: right[:el], ec: right[:ec] ) end @@ -433,9 +433,9 @@ def on_assoc_new(key, value) { type: :assoc_new, body: [key, value], - start: key[:start], + sl: key[:sl], sc: key[:sc], - end: value[:end], + el: value[:el], ec: value[:ec] } end @@ -446,7 +446,7 @@ def on_assoc_splat(contents) find_scanner_event(:@op, '**').merge!( type: :assoc_splat, body: [contents], - end: contents[:end], + el: contents[:el], ec: contents[:ec] ) end @@ -459,9 +459,9 @@ def on_assoclist_from_args(assocs) { type: :assoclist_from_args, body: assocs, - start: assocs[0][:start], + sl: assocs[0][:sl], sc: assocs[0][:sc], - end: assocs[-1][:end], + el: assocs[-1][:el], ec: assocs[-1][:ec] } end @@ -474,9 +474,9 @@ def on_bare_assoc_hash(assoc_news) { type: :bare_assoc_hash, body: assoc_news, - start: assoc_news[0][:start], + sl: assoc_news[0][:sl], sc: assoc_news[0][:sc], - end: assoc_news[-1][:end], + el: assoc_news[-1][:el], ec: assoc_news[-1][:ec] } end @@ -497,7 +497,7 @@ def on_begin(bodystmt) beging.merge!( type: :begin, body: [bodystmt], - end: bodystmt[:end], + el: bodystmt[:el], ec: bodystmt[:ec] ) end @@ -508,9 +508,9 @@ def on_binary(left, oper, right) { type: :binary, body: [left, oper, right], - start: left[:start], + sl: left[:sl], sc: left[:sc], - end: right[:end], + el: right[:el], ec: right[:ec] } end @@ -530,9 +530,9 @@ def on_block_var(params, locals) { type: :block_var, body: [params, locals], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -543,7 +543,7 @@ def on_blockarg(ident) find_scanner_event(:@op, '&').merge!( type: :blockarg, body: [ident], - end: ident[:end], + el: ident[:el], ec: ident[:ec] ) end @@ -574,9 +574,9 @@ def on_bodystmt(stmts, rescued, ensured, elsed) BodyStmt.new( type: :bodystmt, body: [stmts, rescued, ensured, elsed], - start: lineno, + sl: lineno, sc: char_pos, - end: lineno, + el: lineno, ec: char_pos ) end @@ -594,9 +594,9 @@ def on_brace_block(block_var, stmts) { type: :brace_block, body: [block_var, stmts], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -617,7 +617,7 @@ def on_break(args_add_block) beging.merge!( type: :break, body: [args_add_block], - end: args_add_block[:end], + el: args_add_block[:el], ec: args_add_block[:ec] ) end @@ -651,9 +651,9 @@ def on_call(receiver, oper, sending) { type: :call, body: [receiver, oper, sending], - start: receiver[:start], + sl: receiver[:sl], sc: receiver[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -672,7 +672,7 @@ def on_case(switch, consequent) beging.merge!( body: [switch, consequent], - end: consequent[:end], + el: consequent[:el], ec: consequent[:ec] ) end @@ -714,9 +714,9 @@ def on_class(const, superclass, bodystmt) { type: :class, body: [const, superclass, bodystmt], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -728,9 +728,9 @@ def on_command(ident, args) { type: :command, body: [ident, args], - start: ident[:start], + sl: ident[:sl], sc: ident[:sc], - end: args[:end], + el: args[:el], ec: args[:ec] } end @@ -750,9 +750,9 @@ def on_command_call(receiver, oper, ident, args) { type: :command_call, body: [receiver, oper, ident, args], - start: receiver[:start], + sl: receiver[:sl], sc: receiver[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -767,9 +767,9 @@ def on_const_path_field(left, const) { type: :const_path_field, body: [left, const], - start: left[:start], + sl: left[:sl], sc: left[:sc], - end: const[:end], + el: const[:el], ec: const[:ec] } end @@ -784,9 +784,9 @@ def on_const_path_ref(left, const) { type: :const_path_ref, body: [left, const], - start: left[:start], + sl: left[:sl], sc: left[:sc], - end: const[:end], + el: const[:el], ec: const[:ec] } end @@ -837,9 +837,9 @@ def on_def(ident, params, bodystmt) { type: :defsl, body: [ident, params, bodystmt], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: bodystmt[:end], + el: bodystmt[:el], ec: bodystmt[:ec] } ) @@ -857,9 +857,9 @@ def on_def(ident, params, bodystmt) { type: :def, body: [ident, params, bodystmt], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -897,9 +897,9 @@ def on_defs(target, oper, ident, params, bodystmt) { type: :defs, body: [target, oper, ident, params, bodystmt], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -917,7 +917,7 @@ def on_defined(value) beging.merge!( type: :defined, body: [value], - end: ending[:end], + el: ending[:el], ec: ending[:ec] ) end @@ -935,9 +935,9 @@ def on_do_block(block_var, bodystmt) { type: :do_block, body: [block_var, bodystmt], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -954,9 +954,9 @@ def on_dot2(left, right) { type: :dot2, body: [left, right], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -973,9 +973,9 @@ def on_dot3(left, right) { type: :dot3, body: [left, right], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -1008,7 +1008,7 @@ def on_dyna_symbol(string) type: :dyna_symbol, quote: beging[:body][1], body: string[:body], - end: ending[:end], + el: ending[:el], ec: ending[:ec] ) else @@ -1019,9 +1019,9 @@ def on_dyna_symbol(string) string.merge!( type: :dyna_symbol, quote: ending[:body][0], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] ) end @@ -1052,9 +1052,9 @@ def on_else(stmts) { type: :else, body: [stmts], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -1072,9 +1072,9 @@ def on_elsif(predicate, stmts, consequent) { type: :elsif, body: [predicate, stmts, consequent], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -1085,7 +1085,7 @@ def on_elsif(predicate, stmts, consequent) # and add to it as we get content. It always starts with this scanner # event, so here we'll initialize the current embdoc. def on_embdoc_beg(value) - @embdoc = { type: :@embdoc, value: value, start: lineno, sc: char_pos } + @embdoc = { type: :@embdoc, value: value, sl: lineno, sc: char_pos } end # This is a scanner event that gets hit when we're inside an embdoc and @@ -1104,7 +1104,7 @@ def on_embdoc_end(value) @comments << @embdoc.merge!( value: @embdoc[:value] << value.chomp, - end: lineno, + el: lineno, ec: char_pos + value.length - 1 ) @@ -1129,9 +1129,9 @@ def on_ensure(stmts) { type: :ensure, body: [beging, stmts], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -1160,9 +1160,9 @@ def on_field(left, oper, right) { type: :field, body: [left, oper, right], - start: left[:start], + sl: left[:sl], sc: left[:sc], - end: right[:end], + el: right[:el], ec: right[:ec] } end @@ -1176,9 +1176,9 @@ def on_fndptn(const, presplat, args, postsplat) { type: :fndptn, body: [const, presplat, args, postsplat], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -1196,9 +1196,9 @@ def on_for(ident, enumerable, stmts) { type: :for, body: [ident, enumerable, stmts], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -1219,9 +1219,9 @@ def on_hash(assoclist_from_args) { type: :hash, body: [assoclist_from_args], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -1234,8 +1234,8 @@ def on_hash(assoclist_from_args) # printer through our embed function. def on_heredoc_beg(beging) location = { - start: lineno, - end: lineno, + sl: lineno, + el: lineno, sc: char_pos, ec: char_pos + beging.length + 1 } @@ -1259,7 +1259,7 @@ def on_heredoc_dedent(string, _width) # This is a scanner event that represents the end of the heredoc. def on_heredoc_end(ending) - @heredocs[-1].merge!(ending: ending.chomp, end: lineno, ec: char_pos) + @heredocs[-1].merge!(ending: ending.chomp, el: lineno, ec: char_pos) end # hshptn is a parser event that represents matching against a hash pattern @@ -1270,9 +1270,9 @@ def on_hshptn(const, kw, kwrest) { type: :hshptn, body: [const, kw, kwrest], - start: pieces[0][:start], + sl: pieces[0][:sl], sc: pieces[0][:sc], - end: pieces[-1][:end], + el: pieces[-1][:el], ec: pieces[-1][:ec] } end @@ -1289,9 +1289,9 @@ def on_if(predicate, stmts, consequent) { type: :if, body: [predicate, stmts, consequent], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -1303,7 +1303,7 @@ def on_ifop(predicate, truthy, falsy) predicate.merge( type: :ifop, body: [predicate, truthy, falsy], - end: falsy[:end], + el: falsy[:el], ec: falsy[:ec] ) end @@ -1317,9 +1317,9 @@ def on_if_mod(predicate, statement) { type: :if_mod, body: [predicate, statement], - start: statement[:start], + sl: statement[:sl], sc: statement[:sc], - end: predicate[:end], + el: predicate[:el], ec: predicate[:ec] } end @@ -1339,7 +1339,7 @@ def on_in(pattern, stmts, consequent) beging.merge!( type: :in, body: [pattern, stmts, consequent], - end: ending[:end], + el: ending[:el], ec: ending[:ec] ) end @@ -1353,7 +1353,7 @@ def on_kwrest_param(ident) oper.merge!( type: :kwrest_param, body: [ident], - end: ident[:end], + el: ident[:el], ec: ident[:ec] ) end @@ -1381,9 +1381,9 @@ def on_lambda(params, stmts) { type: :lambda, body: [params, stmts], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: closing[:end], + el: closing[:el], ec: closing[:ec] } end @@ -1411,9 +1411,9 @@ def on_massign(left, right) { type: :massign, body: [left, right], - start: left[:start], + sl: left[:sl], sc: left[:sc], - end: right[:end], + el: right[:el], ec: right[:ec] } end @@ -1433,9 +1433,9 @@ def on_method_add_arg(fcall, arg_paren) { type: :method_add_arg, body: [fcall, arg_paren], - start: fcall[:start], + sl: fcall[:sl], sc: fcall[:sc], - end: arg_paren[:end], + el: arg_paren[:el], ec: arg_paren[:ec] } end @@ -1447,9 +1447,9 @@ def on_method_add_block(method_add_arg, block) { type: :method_add_block, body: [method_add_arg, block], - start: method_add_arg[:start], + sl: method_add_arg[:sl], sc: method_add_arg[:sc], - end: block[:end], + el: block[:el], ec: block[:ec] } end @@ -1461,9 +1461,9 @@ def on_mlhs_new { type: :mlhs, body: [], - start: lineno, + sl: lineno, sc: char_pos, - end: lineno, + el: lineno, ec: char_pos } end @@ -1475,7 +1475,7 @@ def on_mlhs_add(mlhs, part) if mlhs[:body].empty? part.merge(type: :mlhs, body: [part]) else - mlhs.merge!(body: mlhs[:body] << part, end: part[:end], ec: part[:ec]) + mlhs.merge!(body: mlhs[:body] << part, el: part[:el], ec: part[:ec]) end end @@ -1488,7 +1488,7 @@ def on_mlhs_add_post(mlhs_add_star, mlhs) mlhs_add_star.merge( type: :mlhs_add_post, body: [mlhs_add_star, mlhs], - end: mlhs[:end], + el: mlhs[:el], ec: mlhs[:ec] ) end @@ -1504,9 +1504,9 @@ def on_mlhs_add_star(mlhs, part) { type: :mlhs_add_star, body: [mlhs, part], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -1526,9 +1526,9 @@ def on_mlhs_paren(contents) { type: :mlhs_paren, body: [contents], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -1545,9 +1545,9 @@ def on_module(const, bodystmt) { type: :module, body: [const, bodystmt], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -1560,9 +1560,9 @@ def on_mrhs_new { type: :mrhs, body: [], - start: lineno, + sl: lineno, sc: char_pos, - end: lineno, + el: lineno, ec: char_pos } end @@ -1573,7 +1573,7 @@ def on_mrhs_add(mrhs, part) if mrhs[:body].empty? part.merge(type: :mrhs, body: [part]) else - mrhs.merge!(body: mrhs[:body] << part, end: part[:end], ec: part[:ec]) + mrhs.merge!(body: mrhs[:body] << part, el: part[:el], ec: part[:ec]) end end @@ -1587,9 +1587,9 @@ def on_mrhs_add_star(mrhs, part) { type: :mrhs_add_star, body: [mrhs, part], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -1613,7 +1613,7 @@ def on_next(args_add_block) find_scanner_event(:@kw, 'next').merge!( type: :next, body: [args_add_block], - end: args_add_block[:end], + el: args_add_block[:el], ec: args_add_block[:ec] ) end @@ -1626,7 +1626,7 @@ def on_opassign(left, oper, right) left.merge( type: :opassign, body: [left, oper, right], - end: right[:end], + el: right[:el], ec: right[:ec] ) end @@ -1641,13 +1641,13 @@ def on_params(*types) location = if flattened.any? { - start: flattened[0][:start], + sl: flattened[0][:sl], sc: flattened[0][:sc], - end: flattened[-1][:end], + el: flattened[-1][:el], ec: flattened[-1][:ec] } else - { start: lineno, sc: char_pos, end: lineno, ec: char_pos } + { sl: lineno, sc: char_pos, el: lineno, ec: char_pos } end location.merge!(type: :params, body: types) @@ -1667,7 +1667,7 @@ def on_paren(contents) beging.merge!( type: :paren, body: [contents], - end: ending[:end], + el: ending[:el], ec: ending[:ec] ) end @@ -1677,7 +1677,7 @@ def on_paren(contents) # source string. We'll also attach on the __END__ content if there was # some found at the end of the source string. def on_program(stmts) - range = { start: 1, end: lines.length, sc: 0, ec: source.length } + range = { sl: 1, el: lines.length, sc: 0, ec: source.length } stmts[:body] << @__end__ if @__end__ stmts.bind(0, source.length) @@ -1699,7 +1699,7 @@ def on_qsymbols_new def on_qsymbols_add(qsymbols, tstring_content) qsymbols.merge!( body: qsymbols[:body] << tstring_content, - end: tstring_content[:end], + el: tstring_content[:el], ec: tstring_content[:ec] ) end @@ -1718,7 +1718,7 @@ def on_qwords_new def on_qwords_add(qwords, tstring_content) qwords.merge!( body: qwords[:body] << tstring_content, - end: tstring_content[:end], + el: tstring_content[:el], ec: tstring_content[:ec] ) end @@ -1744,7 +1744,7 @@ def on_regexp_new def on_regexp_add(regexp, piece) regexp.merge!( body: regexp[:body] << piece, - end: regexp[:end], + el: regexp[:el], ec: regexp[:ec] ) end @@ -1757,7 +1757,7 @@ def on_regexp_literal(regexp, ending) regexp.merge!( type: :regexp_literal, ending: ending[:body], - end: ending[:end], + el: ending[:el], ec: ending[:ec] ) end @@ -1796,7 +1796,7 @@ def on_rescue(exceptions, variable, stmts, consequent) beging.merge!( type: :rescue, body: [exceptions, variable, stmts, consequent], - end: lineno, + el: lineno, ec: char_pos ) ) @@ -1811,9 +1811,9 @@ def on_rescue_mod(statement, rescued) { type: :rescue_mod, body: [statement, rescued], - start: statement[:start], + sl: statement[:sl], sc: statement[:sc], - end: rescued[:end], + el: rescued[:el], ec: rescued[:ec] } end @@ -1829,7 +1829,7 @@ def on_rest_param(ident) oper.merge!( type: :rest_param, body: [ident], - end: ident[:end], + el: ident[:el], ec: ident[:ec] ) end @@ -1847,7 +1847,7 @@ def on_return(args_add_block) find_scanner_event(:@kw, 'return').merge!( type: :return, body: [args_add_block], - end: args_add_block[:end], + el: args_add_block[:el], ec: args_add_block[:ec] ) end @@ -1879,9 +1879,9 @@ def on_sclass(target, bodystmt) { type: :sclass, body: [target, bodystmt], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -1908,9 +1908,9 @@ def bind_end(ec) def <<(statement) if self[:body].any? - merge!(statement.slice(:end, :ec)) + merge!(statement.slice(:el, :ec)) else - merge!(statement.slice(:start, :end, :sc, :ec)) + merge!(statement.slice(:sl, :el, :sc, :ec)) end self[:body] << statement @@ -1925,8 +1925,8 @@ def on_stmts_new Stmts.new( type: :stmts, body: [], - start: lineno, - end: lineno, + sl: lineno, + el: lineno, sc: char_pos, ec: char_pos ) @@ -1950,9 +1950,9 @@ def on_string_concat(left, right) { type: :string_concat, body: [left, right], - start: left[:start], + sl: left[:sl], sc: left[:sc], - end: right[:end], + el: right[:el], ec: right[:ec] } end @@ -1966,8 +1966,8 @@ def on_string_content { type: :string, body: [], - start: lineno, - end: lineno, + sl: lineno, + el: lineno, sc: char_pos, ec: char_pos } @@ -1978,11 +1978,7 @@ def on_string_content # It accepts as arguments the parent string node as well as the additional # piece of the string. def on_string_add(string, piece) - string.merge!( - body: string[:body] << piece, - end: piece[:end], - ec: piece[:ec] - ) + string.merge!(body: string[:body] << piece, el: piece[:el], ec: piece[:ec]) end # string_dvar is a parser event that represents a very special kind of @@ -1994,7 +1990,7 @@ def on_string_dvar(var_ref) find_scanner_event(:@embvar).merge!( type: :string_dvar, body: [var_ref], - end: var_ref[:end], + el: var_ref[:el], ec: var_ref[:ec] ) end @@ -2012,9 +2008,9 @@ def on_string_embexpr(stmts) { type: :string_embexpr, body: [stmts], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -2034,9 +2030,9 @@ def on_string_literal(string) type: :string_literal, body: string[:body], quote: beging[:body], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -2050,7 +2046,7 @@ def on_super(contents) find_scanner_event(:@kw, 'super').merge!( type: :super, body: [contents], - end: contents[:end], + el: contents[:el], ec: contents[:ec] ) end @@ -2101,7 +2097,7 @@ def on_symbols_new def on_symbols_add(symbols, word_add) symbols.merge!( body: symbols[:body] << word_add, - end: word_add[:end], + el: word_add[:el], ec: word_add[:ec] ) end @@ -2130,7 +2126,7 @@ def on_top_const_field(const) const.merge( type: :top_const_field, body: [const], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc] ) end @@ -2146,7 +2142,7 @@ def on_top_const_ref(const) const.merge( type: :top_const_ref, body: [const], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc] ) end @@ -2166,7 +2162,7 @@ def on_unary(oper, value) type: :unary, oper: oper, body: [value], - end: ending[:end], + el: ending[:el], ec: ending[:ec], paren: paren ) @@ -2186,7 +2182,7 @@ def on_unary(oper, value) type: :unary, oper: oper[0], body: [value], - end: value[:end], + el: value[:el], ec: value[:ec] ) end @@ -2202,7 +2198,7 @@ def on_undef(symbol_literals) find_scanner_event(:@kw, 'undef').merge!( type: :undef, body: symbol_literals, - end: last[:end], + el: last[:el], ec: last[:ec] ) end @@ -2220,9 +2216,9 @@ def on_unless(predicate, stmts, consequent) { type: :unless, body: [predicate, stmts, consequent], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -2236,9 +2232,9 @@ def on_unless_mod(predicate, statement) { type: :unless_mod, body: [predicate, statement], - start: statement[:start], + sl: statement[:sl], sc: statement[:sc], - end: predicate[:end], + el: predicate[:el], ec: predicate[:ec] } end @@ -2262,9 +2258,9 @@ def on_until(predicate, stmts) { type: :until, body: [predicate, stmts], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -2278,9 +2274,9 @@ def on_until_mod(predicate, statement) { type: :until_mod, body: [predicate, statement], - start: statement[:start], + sl: statement[:sl], sc: statement[:sc], - end: predicate[:end], + el: predicate[:el], ec: predicate[:ec] } end @@ -2298,9 +2294,9 @@ def on_var_alias(left, right) { type: :var_alias, body: [left, right], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -2353,7 +2349,7 @@ def on_vcall(ident) # block of code. It often will have comments attached to it, so it requires # some special handling. def on_void_stmt - { type: :void_stmt, start: lineno, end: lineno, sc: char_pos, ec: char_pos } + { type: :void_stmt, sl: lineno, el: lineno, sc: char_pos, ec: char_pos } end # when is a parser event that represents another clause in a case chain. @@ -2369,9 +2365,9 @@ def on_when(predicate, stmts, consequent) { type: :when, body: [predicate, stmts, consequent], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -2395,9 +2391,9 @@ def on_while(predicate, stmts) { type: :while, body: [predicate, stmts], - start: beging[:start], + sl: beging[:sl], sc: beging[:sc], - end: ending[:end], + el: ending[:el], ec: ending[:ec] } end @@ -2411,9 +2407,9 @@ def on_while_mod(predicate, statement) { type: :while_mod, body: [predicate, statement], - start: statement[:start], + sl: statement[:sl], sc: statement[:sc], - end: predicate[:end], + el: predicate[:el], ec: predicate[:ec] } end @@ -2444,7 +2440,7 @@ def on_word_add(word, piece) # location information from the first piece. piece.merge(type: :word, body: [piece]) else - word.merge!(body: word[:body] << piece, end: piece[:end], ec: piece[:ec]) + word.merge!(body: word[:body] << piece, el: piece[:el], ec: piece[:ec]) end end @@ -2463,7 +2459,7 @@ def on_words_new def on_words_add(words, word_add) words.merge!( body: words[:body] << word_add, - end: word_add[:end], + el: word_add[:el], ec: word_add[:ec] ) end @@ -2497,7 +2493,7 @@ def on_xstring_new def on_xstring_add(xstring, piece) xstring.merge!( body: xstring[:body] << piece, - end: piece[:end], + el: piece[:el], ec: piece[:ec] ) end @@ -2523,7 +2519,7 @@ def on_xstring_literal(xstring) heredoc.merge!(body: xstring[:body]) else ending = find_scanner_event(:@tstring_end) - xstring.merge!(type: :xstring_literal, end: ending[:end], ec: ending[:ec]) + xstring.merge!(type: :xstring_literal, el: ending[:el], ec: ending[:ec]) end end @@ -2534,7 +2530,7 @@ def on_yield(args_add_block) find_scanner_event(:@kw, 'yield').merge!( type: :yield, body: [args_add_block], - end: args_add_block[:end], + el: args_add_block[:el], ec: args_add_block[:ec] ) end diff --git a/test/rb/metadata_test.rb b/test/rb/metadata_test.rb index 4071964c..adfdc06e 100644 --- a/test/rb/metadata_test.rb +++ b/test/rb/metadata_test.rb @@ -808,7 +808,14 @@ def test_in private def assert_metadata(type, ruby) - assert_node_metadata(type, parse(ruby), sc: 0, ec: ruby.chomp.size) + assert_node_metadata( + type, + parse(ruby), + sc: 0, + ec: ruby.chomp.size, + sl: 1, + el: [1, ruby.count("\n")].max + ) end def assert_node_metadata(type, node, metadata) From aa090c1d53d38f4a0c3db33f5d2ee3cc0770cb77 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sun, 3 Jan 2021 12:30:39 -0500 Subject: [PATCH 043/785] Increase maxBuffer to 15K --- CHANGELOG.md | 1 + src/ruby/parser.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81605c67..7a9f959b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Changed - [@kddeisz] - Reduce JSON size passing from Ruby process to node process by changing `char_start` -> `sc`, `char_end` -> `ec`, `start` -> `sl`, `end` -> `el`. +- [@kddeisz] - Up the max buffer size between the Ruby and node processes to 15K. ## [1.2.3] - 2021-01-02 diff --git a/src/ruby/parser.js b/src/ruby/parser.js index 66502ea1..69f8e16c 100644 --- a/src/ruby/parser.js +++ b/src/ruby/parser.js @@ -43,7 +43,7 @@ function parse(text, _parsers, _opts) { { env: Object.assign({}, process.env, { LANG }), input: text, - maxBuffer: 10 * 1024 * 1024 // 10MB + maxBuffer: 15 * 1024 * 1024 // 15MB } ); From ddf0bbae28dd8e38b85cc108def6a1714856220a Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sun, 3 Jan 2021 12:40:13 -0500 Subject: [PATCH 044/785] Document rubocop --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a9f959b..f9b96f97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Added + +- [@andyw8] - Explain usage with Rubocop, as well as shipping a rubocop.yml config. + ### Changed - [@kddeisz] - Reduce JSON size passing from Ruby process to node process by changing `char_start` -> `sc`, `char_end` -> `ec`, `start` -> `sl`, `end` -> `el`. From 77077401d0494fde47cd68942434eb23f42b398c Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sun, 3 Jan 2021 12:40:34 -0500 Subject: [PATCH 045/785] Bump to v1.2.4 --- CHANGELOG.md | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9b96f97..a9824dd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [1.2.4] - 2021-01-03 + ### Added - [@andyw8] - Explain usage with Rubocop, as well as shipping a rubocop.yml config. diff --git a/package.json b/package.json index 82836392..c15ea4f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "1.2.3", + "version": "1.2.4", "description": "prettier plugin for the Ruby programming language", "main": "src/plugin.js", "scripts": { From a685da138fd4087c52587377d510812cec17605a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Jan 2021 05:08:27 +0000 Subject: [PATCH 046/785] Bump eslint from 7.16.0 to 7.17.0 Bumps [eslint](https://github.com/eslint/eslint) from 7.16.0 to 7.17.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v7.16.0...v7.17.0) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index a4bed6d4..6fe9322d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1377,9 +1377,9 @@ eslint-visitor-keys@^2.0.0: integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== eslint@^7.8.1: - version "7.16.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.16.0.tgz#a761605bf9a7b32d24bb7cde59aeb0fd76f06092" - integrity sha512-iVWPS785RuDA4dWuhhgXTNrGxHHK3a8HLSMBgbbU59ruJDubUraXN8N5rn7kb8tG6sjg74eE0RA3YWT51eusEw== + version "7.17.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.17.0.tgz#4ccda5bf12572ad3bf760e6f195886f50569adb0" + integrity sha512-zJk08MiBgwuGoxes5sSQhOtibZ75pz0J35XTRlZOk9xMffhpA9BTbQZxoXZzOl5zMbleShbGwtw+1kGferfFwQ== dependencies: "@babel/code-frame" "^7.0.0" "@eslint/eslintrc" "^0.2.2" From 72a50b5e60eafce485711fd82b5b453bd53056c1 Mon Sep 17 00:00:00 2001 From: Vesa Laakso <482561+valscion@users.noreply.github.com> Date: Mon, 4 Jan 2021 11:05:03 +0200 Subject: [PATCH 047/785] Fix typo in README.md RuboCop section fle -> file --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ae9e7733..020ed07d 100644 --- a/README.md +++ b/README.md @@ -154,7 +154,7 @@ prettier --ruby-single-quote false --write '**/*.rb' RuboCop and Prettier for Ruby serve different purposes, but there is overlap with some of RuboCop's functionality. -Prettier provides a RuboCop configuration fle to disable the rules which clash. +Prettier provides a RuboCop configuration file to disable the rules which clash. To enable, add the following config at the top of your project's `.rubocop.yml`: ```yaml From df2e28b147d5bb5249b3b041bb29c4f04da84080 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Mon, 4 Jan 2021 09:19:44 -0500 Subject: [PATCH 048/785] Fix for #764 --- CHANGELOG.md | 4 ++++ src/ruby/parser.rb | 11 +---------- test/js/ruby/nodes/unary.test.js | 6 ++++++ 3 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 test/js/ruby/nodes/unary.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index a9824dd9..aefcc6c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Changed + +- [@nruth], [@kddeisz] - Ensure unary operators on method calls that are sending operators get the correct scanner events. + ## [1.2.4] - 2021-01-03 ### Added diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index d9561529..babbde17 100755 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -634,10 +634,6 @@ def on_break(args_add_block) # foo.(1, 2, 3) # def on_call(receiver, oper, sending) - # Make sure we take the operator out of the scanner events so that it - # doesn't get confused for a unary operator later. - scanner_events.delete(oper) - ending = sending if sending == :call @@ -740,11 +736,6 @@ def on_command(ident, args) # of the method, the operator being used to send the method, the name of # the method, and the arguments being passed to the method. def on_command_call(receiver, oper, ident, args) - # Make sure we take the operator out of the scanner events so that it - # doesn't get confused for a unary operator later. - scanner_events.delete(oper) - - # Grab the ending from either the arguments or the method being sent ending = args || ident { @@ -2173,7 +2164,7 @@ def on_unary(oper, value) # stack. So we need to explicitly disallow those operators. index = scanner_events.rindex do |scanner_event| - scanner_event[:type] == :@op && + scanner_event[:type] == :@op && scanner_event[:sc] < value[:sc] && !%w[.. ...].include?(scanner_event[:body]) end diff --git a/test/js/ruby/nodes/unary.test.js b/test/js/ruby/nodes/unary.test.js new file mode 100644 index 00000000..27372a9b --- /dev/null +++ b/test/js/ruby/nodes/unary.test.js @@ -0,0 +1,6 @@ +describe("unary", () => { + test("regular", () => expect("!foo").toMatchFormat()); + + // https://github.com/prettier/plugin-ruby/issues/764 + test("with other operator", () => expect("!(x&.>(0))").toMatchFormat()); +}); From 2080a9ca090cfa3ddd94f21286967910c1850b4c Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Mon, 4 Jan 2021 09:27:41 -0500 Subject: [PATCH 049/785] Add nruth the CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index aefcc6c1..fda2e832 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1132,6 +1132,7 @@ would previously result in `array[]`, but now prints properly. [@mmcnl]: https://github.com/mmcnl [@nathan-beam]: https://github.com/nathan-beam [@noahtheduke]: https://github.com/NoahTheDuke +[@nruth]: https://github.com/nruth [@overload119]: https://github.com/Overload119 [@petevk]: https://github.com/petevk [@pje]: https://github.com/pje From 2e2b5cfeb7dbd6e3e8d122734dc3b2985d00bcf1 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Mon, 4 Jan 2021 09:29:29 -0500 Subject: [PATCH 050/785] Simplify README --- .all-contributorsrc | 535 -------------------------------------------- .prettierignore | 1 - README.md | 91 -------- package.json | 1 - yarn.lock | 169 +------------- 5 files changed, 4 insertions(+), 793 deletions(-) delete mode 100644 .all-contributorsrc diff --git a/.all-contributorsrc b/.all-contributorsrc deleted file mode 100644 index c4248266..00000000 --- a/.all-contributorsrc +++ /dev/null @@ -1,535 +0,0 @@ -{ - "projectName": "plugin-ruby", - "projectOwner": "prettier", - "repoType": "github", - "repoHost": "https://github.com", - "files": [ - "README.md" - ], - "imageSize": 100, - "commit": true, - "contributors": [ - { - "login": "kddeisz", - "name": "Kevin Deisz", - "avatar_url": "https://avatars2.githubusercontent.com/u/5093358?v=4", - "profile": "https://kevindeisz.com", - "contributions": [ - "code", - "doc", - "test", - "bug" - ] - }, - { - "login": "AlanFoster", - "name": "Alan Foster", - "avatar_url": "https://avatars2.githubusercontent.com/u/1271782?v=4", - "profile": "https://www.alanfoster.me/", - "contributions": [ - "code", - "doc", - "test", - "bug" - ] - }, - { - "login": "johnschoeman", - "name": "johnschoeman", - "avatar_url": "https://avatars0.githubusercontent.com/u/16049495?v=4", - "profile": "https://github.com/johnschoeman", - "contributions": [ - "test" - ] - }, - { - "login": "aaronjensen", - "name": "Aaron Jensen", - "avatar_url": "https://avatars3.githubusercontent.com/u/8588?v=4", - "profile": "https://twitter.com/aaronjensen", - "contributions": [ - "doc" - ] - }, - { - "login": "cbothner", - "name": "Cameron Bothner", - "avatar_url": "https://avatars1.githubusercontent.com/u/4642599?v=4", - "profile": "http://cameronbothner.com", - "contributions": [ - "code" - ] - }, - { - "login": "localhostdotdev", - "name": "localhost.dev", - "avatar_url": "https://avatars3.githubusercontent.com/u/47308085?v=4", - "profile": "https://localhost.dev", - "contributions": [ - "bug", - "code" - ] - }, - { - "login": "deecewan", - "name": "David Buchan-Swanson", - "avatar_url": "https://avatars0.githubusercontent.com/u/4755785?v=4", - "profile": "https://deecewan.github.io", - "contributions": [ - "bug", - "code" - ] - }, - { - "login": "jpickwell", - "name": "Jordan Pickwell", - "avatar_url": "https://avatars1.githubusercontent.com/u/4682321?v=4", - "profile": "https://github.com/jpickwell", - "contributions": [ - "bug" - ] - }, - { - "login": "CodingItWrong", - "name": "Josh Justice", - "avatar_url": "https://avatars0.githubusercontent.com/u/15832198?v=4", - "profile": "http://codingitwrong.com", - "contributions": [ - "bug" - ] - }, - { - "login": "xipgroc", - "name": "xipgroc", - "avatar_url": "https://avatars0.githubusercontent.com/u/28561131?v=4", - "profile": "https://github.com/xipgroc", - "contributions": [ - "bug" - ] - }, - { - "login": "glejeune", - "name": "Gregoire Lejeune", - "avatar_url": "https://avatars1.githubusercontent.com/u/15168?v=4", - "profile": "http://lejeun.es", - "contributions": [ - "bug" - ] - }, - { - "login": "petevk", - "name": "Pete Van Klaveren", - "avatar_url": "https://avatars3.githubusercontent.com/u/5108627?v=4", - "profile": "https://github.com/petevk", - "contributions": [ - "bug" - ] - }, - { - "login": "meleyal", - "name": "meleyal", - "avatar_url": "https://avatars3.githubusercontent.com/u/15045?v=4", - "profile": "https://github.com/meleyal", - "contributions": [ - "doc" - ] - }, - { - "login": "lipis", - "name": "Lipis", - "avatar_url": "https://avatars1.githubusercontent.com/u/125676?v=4", - "profile": "https://lip.is", - "contributions": [ - "doc" - ] - }, - { - "login": "janpio", - "name": "Jan Piotrowski", - "avatar_url": "https://avatars0.githubusercontent.com/u/183673?v=4", - "profile": "https://janpiotrowski.de", - "contributions": [ - "doc" - ] - }, - { - "login": "andyw8", - "name": "Andy Waite", - "avatar_url": "https://avatars1.githubusercontent.com/u/13400?v=4", - "profile": "https://www.andywaite.com", - "contributions": [ - "doc", - "bug" - ] - }, - { - "login": "jviney", - "name": "Jonathan Viney", - "avatar_url": "https://avatars3.githubusercontent.com/u/7051?v=4", - "profile": "https://github.com/jviney", - "contributions": [ - "bug" - ] - }, - { - "login": "acrewdson", - "name": "acrewdson", - "avatar_url": "https://avatars0.githubusercontent.com/u/10353074?v=4", - "profile": "https://github.com/acrewdson", - "contributions": [ - "bug" - ] - }, - { - "login": "dudeofawesome", - "name": "Louis Orleans", - "avatar_url": "https://avatars0.githubusercontent.com/u/1683595?v=4", - "profile": "https://orleans.io", - "contributions": [ - "bug" - ] - }, - { - "login": "cvoege", - "name": "Colton Voege", - "avatar_url": "https://avatars2.githubusercontent.com/u/6777709?v=4", - "profile": "https://github.com/cvoege", - "contributions": [ - "bug" - ] - }, - { - "login": "krachtstefan", - "name": "Stefan Kracht", - "avatar_url": "https://avatars1.githubusercontent.com/u/529711?v=4", - "profile": "https://stefankracht.de", - "contributions": [ - "bug" - ] - }, - { - "login": "jakeprime", - "name": "jakeprime", - "avatar_url": "https://avatars1.githubusercontent.com/u/1019036?v=4", - "profile": "https://github.com/jakeprime", - "contributions": [ - "bug" - ] - }, - { - "login": "mmainz", - "name": "Mario Mainz", - "avatar_url": "https://avatars2.githubusercontent.com/u/5417714?v=4", - "profile": "http://mmainz.github.io", - "contributions": [ - "bug" - ] - }, - { - "login": "cldevs", - "name": "CL Web Developers", - "avatar_url": "https://avatars3.githubusercontent.com/u/38632061?v=4", - "profile": "http://www.cldevs.com", - "contributions": [ - "bug" - ] - }, - { - "login": "github0013", - "name": "github0013", - "avatar_url": "https://avatars0.githubusercontent.com/u/809378?v=4", - "profile": "https://twitter.com/github0013", - "contributions": [ - "bug" - ] - }, - { - "login": "jamescostian", - "name": "James Costian", - "avatar_url": "https://avatars1.githubusercontent.com/u/1456118?v=4", - "profile": "https://jami.am", - "contributions": [ - "bug" - ] - }, - { - "login": "joeyjoejoejr", - "name": "Joe Jackson", - "avatar_url": "https://avatars0.githubusercontent.com/u/1141502?v=4", - "profile": "https://github.com/joeyjoejoejr", - "contributions": [ - "bug" - ] - }, - { - "login": "eins78", - "name": "Max Albrecht", - "avatar_url": "https://avatars3.githubusercontent.com/u/134942?v=4", - "profile": "http://178.is", - "contributions": [ - "bug" - ] - }, - { - "login": "matt-wratt", - "name": "Matt", - "avatar_url": "https://avatars0.githubusercontent.com/u/570030?v=4", - "profile": "https://github.com/matt-wratt", - "contributions": [ - "bug", - "code" - ] - }, - { - "login": "valscion", - "name": "Vesa Laakso", - "avatar_url": "https://avatars2.githubusercontent.com/u/482561?v=4", - "profile": "http://vesalaakso.com", - "contributions": [ - "doc" - ] - }, - { - "login": "jrdioko", - "name": "jrdioko", - "avatar_url": "https://avatars0.githubusercontent.com/u/405288?v=4", - "profile": "https://github.com/jrdioko", - "contributions": [ - "bug" - ] - }, - { - "login": "gin0606", - "name": "gin0606", - "avatar_url": "https://avatars2.githubusercontent.com/u/795891?v=4", - "profile": "http://gin0606.hatenablog.com", - "contributions": [ - "bug", - "code" - ] - }, - { - "login": "tobyndockerill", - "name": "Tobyn", - "avatar_url": "https://avatars1.githubusercontent.com/u/5688326?v=4", - "profile": "https://github.com/tobyndockerill", - "contributions": [ - "code" - ] - }, - { - "login": "ianks", - "name": "Ian Ker-Seymer", - "avatar_url": "https://avatars0.githubusercontent.com/u/3303032?v=4", - "profile": "http://ianks.com", - "contributions": [ - "code" - ] - }, - { - "login": "flyerhzm", - "name": "Richard Huang", - "avatar_url": "https://avatars2.githubusercontent.com/u/66836?v=4", - "profile": "https://huangzhimin.com", - "contributions": [ - "code" - ] - }, - { - "login": "pje", - "name": "Patrick Ellis", - "avatar_url": "https://avatars1.githubusercontent.com/u/319655?v=4", - "profile": "https://github.com/pje", - "contributions": [ - "bug" - ] - }, - { - "login": "masqita", - "name": "Peter De Berdt", - "avatar_url": "https://avatars0.githubusercontent.com/u/161271?v=4", - "profile": "https://www.piesync.com/", - "contributions": [ - "bug" - ] - }, - { - "login": "hafley66", - "name": "Chris Hafley", - "avatar_url": "https://avatars0.githubusercontent.com/u/6750483?v=4", - "profile": "https://github.com/hafley66", - "contributions": [ - "bug" - ] - }, - { - "login": "Fruetel", - "name": "Thomas Frütel", - "avatar_url": "https://avatars1.githubusercontent.com/u/8015212?v=4", - "profile": "http://fruetel.de", - "contributions": [ - "bug" - ] - }, - { - "login": "alse", - "name": "Alex Serban", - "avatar_url": "https://avatars1.githubusercontent.com/u/1160249?v=4", - "profile": "https://github.com/alse", - "contributions": [ - "code" - ] - }, - { - "login": "SViccari", - "name": "Stephanie", - "avatar_url": "https://avatars3.githubusercontent.com/u/4016985?v=4", - "profile": "http://sviccari.github.io", - "contributions": [ - "code" - ] - }, - { - "login": "ShayDavidson", - "name": "Shay Davidson", - "avatar_url": "https://avatars1.githubusercontent.com/u/1366521?v=4", - "profile": "https://github.com/ShayDavidson", - "contributions": [ - "bug" - ] - }, - { - "login": "ryan-hunter-pc", - "name": "Ryan Hunter", - "avatar_url": "https://avatars2.githubusercontent.com/u/13044512?v=4", - "profile": "https://github.com/ryan-hunter-pc", - "contributions": [ - "code" - ] - }, - { - "login": "janklimo", - "name": "Jan Klimo", - "avatar_url": "https://avatars1.githubusercontent.com/u/7811733?v=4", - "profile": "https://www.locksteplabs.com/", - "contributions": [ - "code" - ] - }, - { - "login": "Rsullivan00", - "name": "Rick Sullivan", - "avatar_url": "https://avatars0.githubusercontent.com/u/3654176?v=4", - "profile": "http://ricksullivan.net", - "contributions": [ - "bug", - "code" - ] - }, - { - "login": "steobrien", - "name": "Stephen O'Brien", - "avatar_url": "https://avatars3.githubusercontent.com/u/1694410?v=4", - "profile": "https://twitter.com/steobrien", - "contributions": [ - "bug" - ] - }, - { - "login": "nimish-mehta", - "name": "Nimish Mehta", - "avatar_url": "https://avatars2.githubusercontent.com/u/2488470?v=4", - "profile": "https://github.com/nimish-mehta", - "contributions": [ - "bug", - "code" - ] - }, - { - "login": "jbielick", - "name": "Josh Bielick", - "avatar_url": "https://avatars2.githubusercontent.com/u/1413330?v=4", - "profile": "https://joshbielick.com/", - "contributions": [ - "bug", - "code" - ] - }, - { - "login": "coiti", - "name": "Román Coitiño", - "avatar_url": "https://avatars3.githubusercontent.com/u/27384706?v=4", - "profile": "https://github.com/coiti", - "contributions": [ - "bug" - ] - }, - { - "login": "mmcnl", - "name": "Matt McNeil", - "avatar_url": "https://avatars2.githubusercontent.com/u/1498727?v=4", - "profile": "https://github.com/mmcnl", - "contributions": [ - "bug" - ] - }, - { - "login": "johncsnyder", - "name": "John Snyder", - "avatar_url": "https://avatars2.githubusercontent.com/u/9882099?v=4", - "profile": "https://github.com/johncsnyder", - "contributions": [ - "bug" - ] - }, - { - "login": "rindek", - "name": "Jacek Jakubik", - "avatar_url": "https://avatars1.githubusercontent.com/u/881209?v=4", - "profile": "https://github.com/rindek", - "contributions": [ - "bug" - ] - }, - { - "login": "ykpythemind", - "name": "Yukito Ito", - "avatar_url": "https://avatars2.githubusercontent.com/u/22209702?v=4", - "profile": "https://twitter.com/ykpythemind", - "contributions": [ - "bug", - "code" - ] - }, - { - "login": "karanmandal", - "name": "Karan Mandal", - "avatar_url": "https://avatars2.githubusercontent.com/u/45869605?v=4", - "profile": "https://studyfied.com/", - "contributions": [ - "bug" - ] - }, - { - "login": "nathan-beam", - "name": "Nathan Beam", - "avatar_url": "https://avatars3.githubusercontent.com/u/24681333?v=4", - "profile": "http://nathanbeam.codes/", - "contributions": [ - "bug", - "code" - ] - }, - { - "login": "blampe", - "name": "Bryce Lampe", - "avatar_url": "https://avatars3.githubusercontent.com/u/848843?v=4", - "profile": "https://github.com/blampe", - "contributions": [ - "bug" - ] - } - ], - "contributorsPerLine": 7, - "commitConvention": "none" -} diff --git a/.prettierignore b/.prettierignore index 7c430821..c1c14056 100644 --- a/.prettierignore +++ b/.prettierignore @@ -5,7 +5,6 @@ /playground/ /vendor/ -/.all-contributorsrc /.eslintcache /.*ignore /docs/logo.png diff --git a/README.md b/README.md index 020ed07d..0a813893 100644 --- a/README.md +++ b/README.md @@ -166,97 +166,6 @@ inherit_gem: Check out our [contributing guide](CONTRIBUTING.md). Bug reports and pull requests are welcome on GitHub at https://github.com/prettier/plugin-ruby. -### Code - -Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Kevin Deisz

💻 📖 ⚠️ 🐛

Alan Foster

💻 📖 ⚠️ 🐛

johnschoeman

⚠️

Aaron Jensen

📖

Cameron Bothner

💻

localhost.dev

🐛 💻

David Buchan-Swanson

🐛 💻

Jordan Pickwell

🐛

Josh Justice

🐛

xipgroc

🐛

Gregoire Lejeune

🐛

Pete Van Klaveren

🐛

meleyal

📖

Lipis

📖

Jan Piotrowski

📖

Andy Waite

📖 🐛

Jonathan Viney

🐛

acrewdson

🐛

Louis Orleans

🐛

Colton Voege

🐛

Stefan Kracht

🐛

jakeprime

🐛

Mario Mainz

🐛

CL Web Developers

🐛

github0013

🐛

James Costian

🐛

Joe Jackson

🐛

Max Albrecht

🐛

Matt

🐛 💻

Vesa Laakso

📖

jrdioko

🐛

gin0606

🐛 💻

Tobyn

💻

Ian Ker-Seymer

💻

Richard Huang

💻

Patrick Ellis

🐛

Peter De Berdt

🐛

Chris Hafley

🐛

Thomas Frütel

🐛

Alex Serban

💻

Stephanie

💻

Shay Davidson

🐛

Ryan Hunter

💻

Jan Klimo

💻

Rick Sullivan

🐛 💻

Stephen O'Brien

🐛

Nimish Mehta

🐛 💻

Josh Bielick

🐛 💻

Román Coitiño

🐛

Matt McNeil

🐛

John Snyder

🐛

Jacek Jakubik

🐛

Yukito Ito

🐛 💻

Karan Mandal

🐛

Nathan Beam

🐛 💻

Bryce Lampe

🐛
- - - - - - -This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! - -### Financial - You can support `prettier/plugin-ruby` [on OpenCollective](https://opencollective.com/prettier-ruby/contribute). Your organization's logo will show up here with a link to your website. diff --git a/package.json b/package.json index c15ea4f4..1826a9d6 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,6 @@ "prettier": ">=1.10" }, "devDependencies": { - "all-contributors-cli": "^6.14.1", "eslint": "^7.8.1", "eslint-config-prettier": "^7.0.0", "husky": "^4.3.5", diff --git a/yarn.lock b/yarn.lock index 6fe9322d..fed681b4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -232,13 +232,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/runtime@^7.12.5", "@babel/runtime@^7.7.6": - version "7.12.5" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.12.5.tgz#410e7e487441e1b360c29be715d870d9b985882e" - integrity sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg== - dependencies: - regenerator-runtime "^0.13.4" - "@babel/template@^7.10.4", "@babel/template@^7.12.7", "@babel/template@^7.3.3": version "7.12.7" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.7.tgz#c817233696018e39fbb6c491d2fb684e05ed43bc" @@ -641,22 +634,6 @@ ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -all-contributors-cli@^6.14.1: - version "6.19.0" - resolved "https://registry.yarnpkg.com/all-contributors-cli/-/all-contributors-cli-6.19.0.tgz#7e4550973afede2476b62bd159fee6d72a1ad802" - integrity sha512-QJN4iLeTeYpTZJES8XFTzQ+itA1qSyBbxLapJLtwrnY+kipyRhCX49fS/s/qftQQym9XLATMZUpUeEeJSox1sw== - dependencies: - "@babel/runtime" "^7.7.6" - async "^3.0.1" - chalk "^4.0.0" - didyoumean "^1.2.1" - inquirer "^7.0.4" - json-fixer "^1.5.1" - lodash "^4.11.2" - node-fetch "^2.6.0" - pify "^5.0.0" - yargs "^15.0.1" - ansi-colors@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" @@ -768,11 +745,6 @@ astral-regex@^2.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== -async@^3.0.1: - version "3.2.0" - resolved "https://registry.yarnpkg.com/async/-/async-3.2.0.tgz#b3a2685c5ebb641d3de02d161002c60fc9f85720" - integrity sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw== - asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -986,7 +958,7 @@ chalk@^3.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@^4.0.0, chalk@^4.1.0: +chalk@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== @@ -999,11 +971,6 @@ char-regex@^1.0.2: resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== -chardet@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" - integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== - ci-info@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" @@ -1024,18 +991,6 @@ class-utils@^0.3.5: isobject "^3.0.0" static-extend "^0.1.1" -cli-cursor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" - integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== - dependencies: - restore-cursor "^3.1.0" - -cli-width@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" - integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== - cliui@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" @@ -1261,11 +1216,6 @@ detect-newline@^3.0.0: resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== -didyoumean@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/didyoumean/-/didyoumean-1.2.1.tgz#e92edfdada6537d484d73c0172fd1eba0c4976ff" - integrity sha1-6S7f2tplN9SE1zwBcv0eugxJdv8= - diff-sequences@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.6.2.tgz#48ba99157de1923412eed41db6b6d4aa9ca7c0b1" @@ -1545,15 +1495,6 @@ extend@~3.0.2: resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== -external-editor@^3.0.3: - version "3.1.0" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" - integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== - dependencies: - chardet "^0.7.0" - iconv-lite "^0.4.24" - tmp "^0.0.33" - extglob@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" @@ -1600,13 +1541,6 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" -figures@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" - integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== - dependencies: - escape-string-regexp "^1.0.5" - file-entry-cache@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.0.tgz#7921a89c391c6d93efec2169ac6bf300c527ea0a" @@ -1895,7 +1829,7 @@ husky@^4.3.5: slash "^3.0.0" which-pm-runs "^1.0.0" -iconv-lite@0.4.24, iconv-lite@^0.4.24: +iconv-lite@0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== @@ -1946,25 +1880,6 @@ inherits@2: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -inquirer@^7.0.4: - version "7.3.3" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.3.3.tgz#04d176b2af04afc157a83fd7c100e98ee0aad003" - integrity sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA== - dependencies: - ansi-escapes "^4.2.1" - chalk "^4.1.0" - cli-cursor "^3.1.0" - cli-width "^3.0.0" - external-editor "^3.0.3" - figures "^3.0.0" - lodash "^4.17.19" - mute-stream "0.0.8" - run-async "^2.4.0" - rxjs "^6.6.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - through "^2.3.6" - ip-regex@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" @@ -2626,15 +2541,6 @@ jsesc@^2.5.1: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== -json-fixer@^1.5.1: - version "1.6.8" - resolved "https://registry.yarnpkg.com/json-fixer/-/json-fixer-1.6.8.tgz#4a1930af55ca0baa410c3a2cdf2b065ba87121ed" - integrity sha512-VUI3GPVLpM/nYmM1tSuvd3kh36eWvoNO1SFveVQf5k9QJI3kfaoOPVbN7WbpRfvZqa2BFySyVuqSs57laYfIDQ== - dependencies: - "@babel/runtime" "^7.12.5" - chalk "^4.1.0" - pegjs "^0.10.0" - json-parse-even-better-errors@^2.3.0: version "2.3.1" resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" @@ -2744,7 +2650,7 @@ lodash.sortby@^4.7.0: resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= -lodash@^4.11.2, lodash@^4.17.19, lodash@^4.17.20: +lodash@^4.17.19, lodash@^4.17.20: version "4.17.20" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== @@ -2877,11 +2783,6 @@ multimatch@^4.0.0: arrify "^2.0.1" minimatch "^3.0.4" -mute-stream@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" - integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== - nanomatch@^1.2.9: version "1.2.13" resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" @@ -2909,11 +2810,6 @@ nice-try@^1.0.4: resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== -node-fetch@^2.6.0: - version "2.6.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" - integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== - node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" @@ -3048,11 +2944,6 @@ optionator@^0.9.1: type-check "^0.4.0" word-wrap "^1.2.3" -os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= - p-each-series@^2.1.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-2.2.0.tgz#105ab0357ce72b202a8a8b94933672657b5e2a9a" @@ -3139,11 +3030,6 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -pegjs@^0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/pegjs/-/pegjs-0.10.0.tgz#cf8bafae6eddff4b5a7efb185269eaaf4610ddbd" - integrity sha1-z4uvrm7d/0tafvsYUmnqr0YQ3b0= - performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" @@ -3154,11 +3040,6 @@ picomatch@^2.0.4, picomatch@^2.0.5: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== -pify@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-5.0.0.tgz#1f5eca3f5e87ebec28cc6d54a0e4aaf00acc127f" - integrity sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA== - pirates@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87" @@ -3282,11 +3163,6 @@ read-pkg@^5.2.0: parse-json "^5.0.0" type-fest "^0.6.0" -regenerator-runtime@^0.13.4: - version "0.13.7" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55" - integrity sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew== - regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" @@ -3397,14 +3273,6 @@ resolve@^1.10.0, resolve@^1.18.1: is-core-module "^2.1.0" path-parse "^1.0.6" -restore-cursor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" - integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== - dependencies: - onetime "^5.1.0" - signal-exit "^3.0.2" - ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" @@ -3422,18 +3290,6 @@ rsvp@^4.8.4: resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA== -run-async@^2.4.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" - integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== - -rxjs@^6.6.0: - version "6.6.3" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.3.tgz#8ca84635c4daa900c0d3967a6ee7ac60271ee552" - integrity sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ== - dependencies: - tslib "^1.9.0" - safe-buffer@^5.0.1, safe-buffer@^5.1.2: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" @@ -3823,18 +3679,6 @@ throat@^5.0.0: resolved "https://registry.yarnpkg.com/throat/-/throat-5.0.0.tgz#c5199235803aad18754a667d659b5e72ce16764b" integrity sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA== -through@^2.3.6: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= - -tmp@^0.0.33: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== - dependencies: - os-tmpdir "~1.0.2" - tmpl@1.0.x: version "1.0.4" resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" @@ -3901,11 +3745,6 @@ tr46@^2.0.2: dependencies: punycode "^2.1.1" -tslib@^1.9.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" - integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== - tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -4178,7 +4017,7 @@ yargs-parser@^18.1.2: camelcase "^5.0.0" decamelize "^1.2.0" -yargs@^15.0.1, yargs@^15.4.1: +yargs@^15.4.1: version "15.4.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== From 7147ea39fbdd5717daabfa17fd7ccf27c74b4f90 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Mon, 4 Jan 2021 09:30:07 -0500 Subject: [PATCH 051/785] Fix broken CHANGELOG link --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fda2e832..a7e1bd64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1024,7 +1024,8 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.2.3...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.2.4...HEAD +[1.2.4]: https://github.com/prettier/plugin-ruby/compare/v1.2.3...v1.2.4 [1.2.3]: https://github.com/prettier/plugin-ruby/compare/v1.2.2...v1.2.3 [1.2.2]: https://github.com/prettier/plugin-ruby/compare/v1.2.1...v1.2.2 [1.2.1]: https://github.com/prettier/plugin-ruby/compare/v1.2.0...v1.2.1 From 0d438a3a05d0402ac04427bfde1677e92ea9be53 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Mon, 4 Jan 2021 18:27:04 -0500 Subject: [PATCH 052/785] Fix #769 --- CHANGELOG.md | 1 + src/ruby/nodes/commands.js | 9 +++++++-- test/js/ruby/nodes/conditionals.test.js | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7e1bd64..4d216eb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Changed - [@nruth], [@kddeisz] - Ensure unary operators on method calls that are sending operators get the correct scanner events. +- [@cvoege], [@kddeisz] - Do not add parentheses when they're not needed to non-breaking command_calls with ternary arguments. ## [1.2.4] - 2021-01-03 diff --git a/src/ruby/nodes/commands.js b/src/ruby/nodes/commands.js index 04feb676..a379f040 100644 --- a/src/ruby/nodes/commands.js +++ b/src/ruby/nodes/commands.js @@ -105,8 +105,13 @@ function printCommandCall(path, opts, print) { let breakDoc; if (hasTernaryArg(node.body[3])) { - parts.push("("); - breakDoc = parts.concat(indent(concat([softline, argDocs])), softline, ")"); + breakDoc = parts.concat( + "(", + indent(concat([softline, argDocs])), + softline, + ")" + ); + parts.push(" "); } else if (skipArgsAlign(path)) { parts.push(" "); breakDoc = parts.concat(argDocs); diff --git a/test/js/ruby/nodes/conditionals.test.js b/test/js/ruby/nodes/conditionals.test.js index be7fc050..cd6bc1fd 100644 --- a/test/js/ruby/nodes/conditionals.test.js +++ b/test/js/ruby/nodes/conditionals.test.js @@ -357,6 +357,9 @@ describe("conditionals", () => { return expect(content).toChangeFormat(expected); }); + test("does not add parens if within a command_call non-breaking", () => + expect("foo.bar baz ? foo : bar").toMatchFormat()); + test("adds parens if within a command_call", () => { const content = `foo.bar baz ? ${long} : ${long}`; const expected = ruby(` From 5005a41a54ad16fd9ab9ba972af0bdb96d9fa3d4 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Mon, 4 Jan 2021 20:33:44 -0500 Subject: [PATCH 053/785] Fix #768 --- CHANGELOG.md | 1 + src/ruby/nodes/calls.js | 22 ++++++++++------------ src/utils/noIndent.js | 1 + test/js/ruby/nodes/calls.test.js | 5 +---- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d216eb3..85e22a0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [@nruth], [@kddeisz] - Ensure unary operators on method calls that are sending operators get the correct scanner events. - [@cvoege], [@kddeisz] - Do not add parentheses when they're not needed to non-breaking command_calls with ternary arguments. +- [@valscion], [@kddeisz] - Print method chains more nicely off array and hash literals. ## [1.2.4] - 2021-01-03 diff --git a/src/ruby/nodes/calls.js b/src/ruby/nodes/calls.js index 4abb97c7..77829732 100644 --- a/src/ruby/nodes/calls.js +++ b/src/ruby/nodes/calls.js @@ -24,6 +24,12 @@ function printCall(path, opts, print) { // call syntax so if `call` is implicit, we don't print it out. const messageDoc = messageNode === "call" ? "" : path.call(print, "body", 2); + // For certain left sides of the call nodes, we want to attach directly to + // the } or end. + if (noIndent.includes(receiverNode.type)) { + return concat([receiverDoc, operatorDoc, messageDoc]); + } + // The right side of the call node, as in everything including the operator // and beyond. const rightSideDoc = concat([ @@ -47,18 +53,10 @@ function printCall(path, opts, print) { // If we're at the top of a chain, then we're going to print out a nice // multi-line layout if this doesn't break into multiple lines. if (!chained.includes(parentNode.type) && (node.chain || 0) >= 3) { - let breakDoc = concat(node.breakDoc.concat(rightSideDoc)); - if (!noIndent.includes(node.firstReceiverType)) { - breakDoc = indent(breakDoc); - } - - return ifBreak(group(breakDoc), concat([receiverDoc, group(rightSideDoc)])); - } - - // For certain left sides of the call nodes, we want to attach directly to - // the } or end. - if (noIndent.includes(receiverNode.type)) { - return concat([receiverDoc, operatorDoc, messageDoc]); + return ifBreak( + group(indent(concat(node.breakDoc.concat(rightSideDoc)))), + concat([receiverDoc, group(rightSideDoc)]) + ); } return group(concat([receiverDoc, group(indent(rightSideDoc))])); diff --git a/src/utils/noIndent.js b/src/utils/noIndent.js index aeaf212a..da65bcdd 100644 --- a/src/utils/noIndent.js +++ b/src/utils/noIndent.js @@ -4,6 +4,7 @@ const noIndent = [ "heredoc", "if", "method_add_block", + "unless", "xstring_literal" ]; diff --git a/test/js/ruby/nodes/calls.test.js b/test/js/ruby/nodes/calls.test.js index f44fe8df..5a2a8fe6 100644 --- a/test/js/ruby/nodes/calls.test.js +++ b/test/js/ruby/nodes/calls.test.js @@ -92,10 +92,7 @@ describe("calls", () => { ${item}, ${item}, ${item} - ] - .map(&:foo?) - .bbb - .ccc + ].map(&:foo?).bbb.ccc `); return expect(content).toChangeFormat(expected); From b6a6a7576c9401e5f26abdb666de994ac5f1abd9 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Mon, 4 Jan 2021 21:58:32 -0500 Subject: [PATCH 054/785] Bump to v1.2.5 --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85e22a0b..d9f6dcb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [1.2.5] - 2021-01-04 + ### Changed - [@nruth], [@kddeisz] - Ensure unary operators on method calls that are sending operators get the correct scanner events. @@ -1026,7 +1028,8 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.2.4...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.2.5...HEAD +[1.2.5]: https://github.com/prettier/plugin-ruby/compare/v1.2.4...v1.2.5 [1.2.4]: https://github.com/prettier/plugin-ruby/compare/v1.2.3...v1.2.4 [1.2.3]: https://github.com/prettier/plugin-ruby/compare/v1.2.2...v1.2.3 [1.2.2]: https://github.com/prettier/plugin-ruby/compare/v1.2.1...v1.2.2 diff --git a/package.json b/package.json index 1826a9d6..27af989f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "1.2.4", + "version": "1.2.5", "description": "prettier plugin for the Ruby programming language", "main": "src/plugin.js", "scripts": { From b6e6b61b7122e8585440bfd0c8d7e25175b5f8fb Mon Sep 17 00:00:00 2001 From: Vesa Laakso <482561+valscion@users.noreply.github.com> Date: Tue, 5 Jan 2021 09:18:06 +0200 Subject: [PATCH 055/785] Add missing GitHub profile links to README.md This fixes the v1.2.5 release links to GitHub profiles --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9f6dcb8..ce46fc86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1102,6 +1102,7 @@ would previously result in `array[]`, but now prints properly. [@cldevs]: https://github.com/cldevs [@codingitwrong]: https://github.com/CodingItWrong [@coiti]: https://github.com/coiti +[@cvoege]: https://github.com/cvoege [@deecewan]: https://github.com/deecewan [@dudeofawesome]: https://github.com/dudeofawesome [@eins78]: https://github.com/eins78 @@ -1152,6 +1153,7 @@ would previously result in `array[]`, but now prints properly. [@sviccari]: https://github.com/SViccari [@tobyndockerill]: https://github.com/tobyndockerill [@uri]: https://github.com/uri +[@valscion]: https://github.com/valscion [@xipgroc]: https://github.com/xipgroc [@ykpythemind]: https://github.com/ykpythemind [@yuki24]: https://github.com/yuki24 From 696ff457e0f135e55327fa7592e35c97793d0f3d Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sun, 3 Jan 2021 12:52:47 -0500 Subject: [PATCH 056/785] RBS --- .gitignore | 1 + .npmignore | 1 + .prettierignore | 3 + CHANGELOG.md | 4 + bin/print | 16 +- src/plugin.js | 18 +- src/rbs/parser.js | 51 +++ src/rbs/parser.rb | 88 ++++ src/rbs/printer.js | 605 +++++++++++++++++++++++++ test/js/parser.rb | 29 +- test/js/rbs/combination.txt | 5 + test/js/rbs/constant.txt | 11 + test/js/rbs/declaration.txt | 3 + test/js/rbs/generic.txt | 7 + test/js/rbs/interface.txt | 5 + test/js/rbs/literal.txt | 9 + test/js/rbs/member.txt | 28 ++ test/js/rbs/method.txt | 11 + test/js/rbs/optional.txt | 5 + test/js/rbs/parser.test.js | 52 +++ test/js/rbs/plain.txt | 11 + test/js/rbs/proc.txt | 11 + test/js/rbs/rbs.test.js | 267 +++++++++++ test/js/rbs/record.txt | 5 + test/js/rbs/tuple.txt | 3 + test/js/{ => ruby}/nodes/field.test.js | 0 test/js/setupTests.js | 15 +- 27 files changed, 1245 insertions(+), 19 deletions(-) create mode 100644 src/rbs/parser.js create mode 100644 src/rbs/parser.rb create mode 100644 src/rbs/printer.js create mode 100644 test/js/rbs/combination.txt create mode 100644 test/js/rbs/constant.txt create mode 100644 test/js/rbs/declaration.txt create mode 100644 test/js/rbs/generic.txt create mode 100644 test/js/rbs/interface.txt create mode 100644 test/js/rbs/literal.txt create mode 100644 test/js/rbs/member.txt create mode 100644 test/js/rbs/method.txt create mode 100644 test/js/rbs/optional.txt create mode 100644 test/js/rbs/parser.test.js create mode 100644 test/js/rbs/plain.txt create mode 100644 test/js/rbs/proc.txt create mode 100644 test/js/rbs/rbs.test.js create mode 100644 test/js/rbs/record.txt create mode 100644 test/js/rbs/tuple.txt rename test/js/{ => ruby}/nodes/field.test.js (100%) diff --git a/.gitignore b/.gitignore index 55e5178a..47fd297d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /yarn-error.log /pkg/ /test.rb +/test.rbs *.gem # This is to better support the GitHub actions checking - since bundler changes diff --git a/.npmignore b/.npmignore index 263e5d6b..ded90fa6 100644 --- a/.npmignore +++ b/.npmignore @@ -14,3 +14,4 @@ /prettier-*.gem /yarn-error.log /test.rb +/test.rbs diff --git a/.prettierignore b/.prettierignore index c1c14056..aa42508a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -11,3 +11,6 @@ /*.lock /LICENSE /test.rb +/test.rbs + +*.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index d9f6dcb8..3f6fa55d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Added + +- [@kddeisz] - Handling of the RBS language. + ## [1.2.5] - 2021-01-04 ### Changed diff --git a/bin/print b/bin/print index b7cbb645..982e611d 100755 --- a/bin/print +++ b/bin/print @@ -3,8 +3,16 @@ const fs = require("fs"); const prettier = require("prettier"); -const code = fs.existsSync(process.argv[2]) - ? fs.readFileSync(process.argv[2], "utf-8") - : process.argv.slice(2).join(" ").replace(/\\n/g, "\n"); +let parser = "ruby"; +let content = 2; -console.log(prettier.format(code, { parser: "ruby", plugins: ["."] })); +if (process.argv[content] === "rbs") { + parser = "rbs"; + content = 3; +} + +const code = fs.existsSync(process.argv[content]) + ? fs.readFileSync(process.argv[content], "utf-8") + : process.argv.slice(content).join(" ").replace(/\\n/g, "\n"); + +console.log(prettier.format(code, { parser, plugins: ["."] })); diff --git a/src/plugin.js b/src/plugin.js index 5529deb2..db05fc42 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -1,5 +1,8 @@ -const printer = require("./ruby/printer"); -const parser = require("./ruby/parser"); +const rubyPrinter = require("./ruby/printer"); +const rubyParser = require("./ruby/parser"); + +const rbsPrinter = require("./rbs/printer"); +const rbsParser = require("./rbs/parser"); /* * metadata mostly pulled from linguist and rubocop: @@ -67,13 +70,20 @@ module.exports = { interpreters: ["jruby", "macruby", "rake", "rbx", "ruby"], linguistLanguageId: 326, vscodeLanguageIds: ["ruby"] + }, + { + name: "RBS", + parsers: ["rbs"], + extensions: [".rbs"] } ], parsers: { - ruby: parser + ruby: rubyParser, + rbs: rbsParser }, printers: { - ruby: printer + ruby: rubyPrinter, + rbs: rbsPrinter }, options: { rubyArrayLiteral: { diff --git a/src/rbs/parser.js b/src/rbs/parser.js new file mode 100644 index 00000000..93cf0cf0 --- /dev/null +++ b/src/rbs/parser.js @@ -0,0 +1,51 @@ +const { spawnSync } = require("child_process"); +const path = require("path"); + +// This function is responsible for taking an input string of text and returning +// to prettier a JavaScript object that is the equivalent AST that represents +// the code stored in that string. We accomplish this by spawning a new Ruby +// process of parser.rb and reading JSON off STDOUT. +function parse(text, _parsers, _opts) { + const child = spawnSync("ruby", [path.join(__dirname, "./parser.rb")], { + input: text, + maxBuffer: 15 * 1024 * 1024 // 15MB + }); + + const error = child.stderr.toString(); + if (error) { + throw new Error(error); + } + + const response = child.stdout.toString(); + return JSON.parse(response); +} + +const pragmaPattern = /#\s*@(prettier|format)/; + +// This function handles checking whether or not the source string has the +// pragma for prettier. This is an optional workflow for incremental adoption. +function hasPragma(text) { + return pragmaPattern.test(text); +} + +// This function is critical for comments and cursor support, and is responsible +// for returning the index of the character within the source string that is the +// beginning of the given node. +function locStart(node) { + return (node.location || node.type.location).start_pos; +} + +// This function is critical for comments and cursor support, and is responsible +// for returning the index of the character within the source string that is the +// ending of the given node. +function locEnd(node) { + return (node.location || node.type.location).end_pos; +} + +module.exports = { + parse, + astFormat: "rbs", + hasPragma, + locStart, + locEnd +}; diff --git a/src/rbs/parser.rb b/src/rbs/parser.rb new file mode 100644 index 00000000..62031cce --- /dev/null +++ b/src/rbs/parser.rb @@ -0,0 +1,88 @@ +#!/usr/bin/env ruby + +require 'json' +require 'rbs' + +# Monkey-patch this so that we can get the character positions. +class RBS::Location + def to_json(*args) + { + start: { line: start_line, column: start_column }, + end: { line: end_line, column: end_column }, + start_pos: start_pos, + end_pos: end_pos + }.to_json(*args) + end +end + +class RBS::Types::Function::Param + def to_json(*a) + escaped = name && /\A#{RBS::Parser::KEYWORDS_RE}\z/.match?(name) + { type: type, name: name, escaped: escaped }.to_json(*a) + end +end + +# Monkey-patch this so that we get the name field in the serialized JSON, as +# well as information about whether or not we need to escape it. +class RBS::AST::Members::MethodDefinition + def to_json(*a) + { + member: :method_definition, + name: name, + kind: kind, + types: types, + annotations: annotations, + location: location, + comment: comment, + overload: overload + }.to_json(*a) + end +end + +# Monkey-patch this so that we get the information we need about how to join the +# key-value pairs of the record. +class RBS::Types::Record + def to_json(*a) + fields_extra = + fields.to_h do |key, type| + if key.is_a?(Symbol) && key.match?(/\A[A-Za-z_][A-Za-z_]*\z/) && + !key.match?(RBS::Parser::KEYWORDS_RE) + [key, { type: type, joiner: :label }] + else + [key.inspect, { type: type, joiner: :rocket }] + end + end + + { class: :record, fields: fields_extra, location: location }.to_json(*a) + end +end + +module Prettier + class RBSParser + def self.parse(text) + { declarations: RBS::Parser.parse_signature(text) } + rescue StandardError + false + end + end +end + +# If this is the main file we're executing, then most likely this is being +# executed from the parser.js spawn. In that case, read the rbs source from +# stdin and report back the AST over stdout. + +if $0 == __FILE__ + response = Prettier::RBSParser.parse($stdin.read) + + if !response + warn( + '@prettier/plugin-ruby encountered an error when attempting to parse ' \ + 'the RBS source. This usually means there was a syntax error in the ' \ + 'file in question.' + ) + + exit 1 + end + + puts JSON.fast_generate(response) +end diff --git a/src/rbs/printer.js b/src/rbs/printer.js new file mode 100644 index 00000000..ad133541 --- /dev/null +++ b/src/rbs/printer.js @@ -0,0 +1,605 @@ +const { + concat, + group, + hardline, + indent, + makeString, + join, + line, + softline +} = require("../prettier"); + +// For some lists of entities in the AST, the parser returns them as an unsorted +// object (presumably because Ruby hashes have implicit ordering). We do not +// have that in JavaScript, so here we sort each object by its position in the +// source string. +function getSortedKeys(object) { + return Object.keys(object).sort( + (left, right) => + object[left].type.location.start_pos - + object[right].type.location.start_pos + ); +} + +// In some cases, we want to just defer to whatever was in the source. +function getSource(node, opts) { + return opts.originalText.slice( + node.location.start_pos, + node.location.end_pos + ); +} + +// This is the generic node print function, used to convert any node in the AST +// into its equivalent Doc representation. +function printNode(path, opts, print) { + const node = path.getValue(); + let doc = null; + + if (node.declarations) { + return printRoot(); + } + + /* istanbul ignore else */ + if (node.declaration) { + switch (node.declaration) { + case "alias": + doc = printTypeAlias(); + break; + case "class": + doc = printClass(); + break; + case "constant": + case "global": + doc = printConstant(); + break; + case "interface": + doc = printInterface(); + break; + case "module": + doc = printModule(); + break; + /* istanbul ignore next */ + default: + throw new Error(`unknown declaration: ${node.declaration}`); + } + } else if (node.member) { + switch (node.member) { + case "alias": + doc = printAlias(); + break; + case "attr_accessor": + case "attr_reader": + case "attr_writer": + doc = printAttr(); + break; + case "class_variable": + case "instance_variable": + doc = printVariable(); + break; + case "class_instance_variable": + doc = concat(["self.", printVariable()]); + break; + case "include": + case "extend": + case "prepend": + doc = printMixin(); + break; + case "public": + case "private": + doc = node.member; + break; + case "method_definition": + doc = printMethodDefinition(); + break; + /* istanbul ignore next */ + default: + throw new Error(`unknown member: ${node.member}`); + } + } else { + const ast = JSON.stringify(node, null, 2); + throw new Error(`Unsupported node encountered:\n${ast}`); + } + + // Certain nodes can't have annotations at all + if (node.annotations && node.annotations.length > 0) { + doc = concat([printAnnotations(), hardline, doc]); + } + + if (node.comment) { + doc = concat([printComment(), hardline, doc]); + } + + return doc; + + // Prints out a string in the source, which looks like: + // 'foo' + function printString(node) { + // We're going to go straight to the source here, as if we don't then we're + // going to end up with the result of String#inspect, which does weird + // things to escape sequences. + const value = getSource(node, opts); + + // Get the quote that was used in the source and the quote that we want to + // be using. + const originalQuote = value[0]; + const preferredQuote = opts.rubySingleQuote ? "'" : '"'; + + // Determine if we're allowed to change the quote based on whether or not + // there is an escape sequence in the source string. + const quote = node.literal.includes("\\") ? originalQuote : preferredQuote; + + return makeString(value.slice(1, -1), quote, false); + } + + // Certain nodes are names with optional arguments attached, as in Array[A]. + // We handle all of that printing centralized here. + function printNameAndArgs(path) { + const node = path.getValue(); + + if (node.args.length === 0) { + return node.name; + } + + return group( + concat([node.name, "[", join(", ", path.map(printType, "args")), "]"]) + ); + } + + // This is the big function that prints out any individual type, which can + // look like all kinds of things, listed in the case statement below. + function printType(path) { + const node = path.getValue(); + + switch (node.class) { + case "literal": + if (node.literal[0] === '"') { + return printString(node); + } + return node.literal; + case "optional": + return concat([path.call(printType, "type"), "?"]); + case "tuple": + // If we don't have any sub types, we explicitly need the space in between + // the brackets to not confuse the parser. + if (node.types.length === 0) { + return "[ ]"; + } + + return group( + concat(["[", join(", ", path.map(printType, "types")), "]"]) + ); + case "union": { + const doc = group( + join(concat([line, "| "]), path.map(printType, "types")) + ); + + const parentType = path.getParentNode().class; + return parentType === "intersection" ? concat(["(", doc, ")"]) : doc; + } + case "intersection": + return group(join(concat([line, "& "]), path.map(printType, "types"))); + case "class_singleton": + return concat(["singleton(", node.name, ")"]); + case "proc": + return concat(["^", printMethodSignature(path)]); + case "record": { + const parts = []; + + getSortedKeys(node.fields).forEach((field) => { + const fieldParts = []; + + if (node.fields[field].joiner === "rocket") { + fieldParts.push(`${field} => `); + } else { + fieldParts.push(`${field}: `); + } + + fieldParts.push(path.call(printType, "fields", field, "type")); + parts.push(concat(fieldParts)); + }); + + return group( + concat([ + "{", + indent(concat([line, join(concat([",", line]), parts)])), + line, + "}" + ]) + ); + } + case "class_instance": + case "interface": + return printNameAndArgs(path); + case "alias": + case "variable": + return node.name; + case "bool": + case "bot": + case "class": + case "instance": + case "nil": + case "self": + case "top": + case "untyped": + case "void": + return node.class; + /* istanbul ignore next */ + default: + throw new Error(`unknown type: ${node.class}`); + } + } + + // Prints out the root of the tree, which includes zero or more declarations. + function printRoot() { + return concat([ + join(concat([hardline, hardline]), path.map(print, "declarations")), + hardline + ]); + } + + // Prints out the members of a class, module, or interface. + function printMembers() { + let lastLine = null; + const docs = []; + + path.each((memberPath) => { + const memberNode = memberPath.getValue(); + + if (lastLine !== null && memberNode.location.start.line - lastLine >= 2) { + docs.push(concat([hardline, hardline])); + } else { + docs.push(hardline); + } + + docs.push(print(memberPath)); + lastLine = memberNode.location.end.line; + }, "members"); + + return concat(docs); + } + + // Prints out a type alias, which is a declaration that looks like: + // type foo = String + function printTypeAlias() { + return group( + concat([ + "type ", + node.name, + " =", + indent(group(concat([line, path.call(printType, "type")]))) + ]) + ); + } + + // Prints out the name of a class, interface, or module declaration. + // Additionally loops through each type parameter if there are any and print + // them out joined by commas. Checks for validation and variance. + function printNameAndTypeParams() { + if (node.type_params.params.length === 0) { + return node.name; + } + + const docs = path.map( + (paramPath) => { + const node = paramPath.getValue(); + const parts = []; + + if (node.skip_validation) { + parts.push("unchecked"); + } + + if (node.variance === "covariant") { + parts.push("out"); + } else if (node.variance === "contravariant") { + parts.push("in"); + } + + return join(" ", parts.concat(node.name)); + }, + "type_params", + "params" + ); + + return concat([node.name, "[", join(", ", docs), "]"]); + } + + // Prints out a class declarations, which looks like: + // class Foo end + function printClass() { + const parts = ["class ", printNameAndTypeParams()]; + + if (node.super_class) { + parts.push(" < ", path.call(printNameAndArgs, "super_class")); + } + + parts.push(indent(printMembers()), hardline, "end"); + + return group(concat(parts)); + } + + // Prints out a constant or a global declaration, which looks like: + // Foo: String + // $foo: String + function printConstant() { + return group(concat([node.name, ": ", path.call(printType, "type")])); + } + + // Prints out an interface declaration, which looks like: + // interface _Foo end + function printInterface() { + return group( + concat([ + "interface ", + printNameAndTypeParams(), + indent(printMembers()), + hardline, + "end" + ]) + ); + } + + // Prints out a module declaration, which looks like: + // module Foo end + function printModule() { + const parts = ["module ", printNameAndTypeParams()]; + + if (node.self_types.length > 0) { + parts.push(" : ", join(", ", path.map(printNameAndArgs, "self_types"))); + } + + parts.push(indent(printMembers()), hardline, "end"); + + return group(concat(parts)); + } + + // Prints out an alias within a declaration, which looks like: + // alias foo bar + // alias self.foo self.bar + function printAlias() { + if (node.kind === "singleton") { + return concat(["alias self.", node.new_name, " self.", node.old_name]); + } + + return concat(["alias ", node.new_name, " ", node.old_name]); + } + + // Prints out an attr_* meta method, which looks like: + // attr_accessor foo + // attr_reader self.foo() + // attr_writer self.foo(@bar): String + function printAttr() { + const parts = [node.member, " "]; + + if (node.kind === "singleton") { + parts.push("self."); + } + + parts.push(node.name); + + if (node.ivar_name === false) { + parts.push("()"); + } else if (node.ivar_name) { + parts.push("(", node.ivar_name, ")"); + } + + parts.push(": ", path.call(printType, "type")); + + return group(concat(parts)); + } + + // Prints out a variable member, which looks like: + // @foo: String + // self.@foo: String + // @@foo: String + function printVariable() { + return group(concat([node.name, ": ", path.call(printType, "type")])); + } + + // Prints out a mixin, which looks like: + // include Foo + // prepend Foo + // extend Foo + function printMixin() { + return group(concat([node.member, " ", printNameAndArgs(path)])); + } + + // Returns an array of printed parameters so that the calling function can + // join them together in whatever way. + function printMethodParams(path) { + const node = path.getValue(); + let parts = []; + + // required positionals, as in (A) + parts = parts.concat(path.map(printMethodParam, "required_positionals")); + + // optional positionals, as in (?A) + parts = parts.concat( + path.map( + (paramPath) => concat(["?", printMethodParam(paramPath)]), + "optional_positionals" + ) + ); + + // rest positional, as in (*A) + if (node.rest_positionals) { + parts.push( + concat(["*", path.call(printMethodParam, "rest_positionals")]) + ); + } + + // trailing positionals are required positionals after a rest + parts = parts.concat(path.map(printMethodParam, "trailing_positionals")); + + // required keywords, as in (a: A) + getSortedKeys(node.required_keywords).forEach((name) => { + parts.push( + concat([ + name, + ": ", + path.call(printMethodParam, "required_keywords", name) + ]) + ); + }); + + // optional keywords, as in (?a: A) + getSortedKeys(node.optional_keywords).forEach((name) => { + parts.push( + concat([ + "?", + name, + ": ", + path.call(printMethodParam, "optional_keywords", name) + ]) + ); + }); + + // rest keyword, as in (**A) + if (node.rest_keywords) { + parts.push(concat(["**", path.call(printMethodParam, "rest_keywords")])); + } + + return parts; + + // Prints out a method parameter at a given path. Handles printing out the + // name if there is one (and whether or not it's escaped). + function printMethodParam(path) { + const node = path.getValue(); + const parts = [path.call(printType, "type")]; + + if (node.name) { + parts.push(" "); + + if (node.escaped) { + parts.push("`", node.name, "`"); + } else { + parts.push(node.name); + } + } + + return concat(parts); + } + } + + // Prints out a specific method signature, which looks like: + // (T t) -> void + function printMethodSignature(path) { + const node = path.getValue(); + const parts = []; + + // We won't have a type_params key if we're printing a block + if (node.type_params && node.type_params.length > 0) { + parts.push("[", join(", ", node.type_params), "] "); + } + + let params = path.call(printMethodParams, "type"); + + if (params.length > 0) { + parts.push( + "(", + indent(concat([softline, join(concat([",", line]), params)])), + softline, + ") " + ); + } + + if (node.block) { + if (!node.block.required) { + parts.push("?"); + } + + parts.push( + "{", + indent(concat([line, path.call(printMethodSignature, "block")])), + line, + "} " + ); + } + + parts.push("-> ", path.call(printType, "type", "return_type")); + + return group(concat(parts)); + } + + // Prints out a method definition, which looks like: + // def t: (T t) -> void + function printMethodDefinition() { + let typeDocs = path.map(printMethodSignature, "types"); + + if (node.overload) { + typeDocs.push("..."); + } + + if (typeDocs.length === 1) { + typeDocs = concat([" ", typeDocs[0]]); + } else { + typeDocs = indent( + group(concat([line, join(concat([line, "| "]), typeDocs)])) + ); + } + + const parts = ["def "]; + + if (node.kind === "singleton") { + parts.push("self."); + } else if (node.kind === "singleton_instance") { + parts.push("self?."); + } + + const escaped = isMethodNameEscaped(); + parts.push(escaped ? `\`${node.name}\`` : node.name, ":", typeDocs); + + return group(concat(parts)); + + // Determine if a method name is escaped in the original source. + function isMethodNameEscaped() { + const pos = node.location.start_pos + 4; + const name = opts.originalText.slice(pos, pos + 2).trimStart(); + + return name[0] === "`" && name[1] !== ":"; + } + } + + // An annotation can be attached to most kinds of nodes, and should be printed + // using %a{}. + function printAnnotations() { + return join(hardline, path.map(printAnnotation, "annotations")); + + function printAnnotation(path) { + const node = path.getValue(); + + // If there are already braces inside the annotation, then we're just + // going to print out the original string to avoid having to escape + // anything. + if (/[{}]/.test(node.string)) { + return getSource(node, opts); + } + + return concat(["%a{", node.string, "}"]); + } + } + + // Comments come in as one whole string, so here we split it up into multiple + // lines and then prefix it with the pound sign. + function printComment() { + const lines = node.comment.string.slice(0, -1).split("\n"); + + return join( + hardline, + lines.map((segment) => `# ${segment}`) + ); + } +} + +// This is an escape-hatch to ignore nodes in the tree. If you have a comment +// that includes this pattern, then the entire node will be ignored and just the +// original source will be printed out. +function hasPrettierIgnore(path) { + const node = path.getValue(); + + return node.comment && node.comment.string.includes("prettier-ignore"); +} + +module.exports = { + print: printNode, + hasPrettierIgnore +}; diff --git a/test/js/parser.rb b/test/js/parser.rb index a36ffe61..d53ac0f5 100644 --- a/test/js/parser.rb +++ b/test/js/parser.rb @@ -3,6 +3,16 @@ require 'socket' require_relative '../../src/ruby/parser' +if RUBY_VERSION >= '3.0.0' + require_relative '../../src/rbs/parser' +else + class Prettier::RBSParser + def self.parse(source) + false + end + end +end + # Set the program name so that it's easy to find if we need it $PROGRAM_NAME = 'prettier-ruby-test-parser' @@ -20,12 +30,19 @@ # Start up a new thread that will handle each successive connection. Thread.new(server.accept_nonblock) do |socket| - source = socket.readpartial(10 * 1024 * 1024) - - builder = Prettier::Parser.new(source.force_encoding('UTF-8')) - response = builder.parse - - if !response || builder.error? + message = socket.readpartial(10 * 1024 * 1024) + parser, source = message.force_encoding('UTF-8').split('|', 2) + + response = + if parser == 'ruby' + builder = Prettier::Parser.new(source) + response = builder.parse + response unless builder.error? + elsif parser == 'rbs' + Prettier::RBSParser.parse(source) + end + + if !response socket.puts('{ "error": true }') else socket.puts(JSON.fast_generate(response)) diff --git a/test/js/rbs/combination.txt b/test/js/rbs/combination.txt new file mode 100644 index 00000000..2761e7a7 --- /dev/null +++ b/test/js/rbs/combination.txt @@ -0,0 +1,5 @@ +untyped | void | nil +untyped & void & nil +untyped | void & nil +untyped & void | nil +untyped & (void | nil) diff --git a/test/js/rbs/constant.txt b/test/js/rbs/constant.txt new file mode 100644 index 00000000..763be8d4 --- /dev/null +++ b/test/js/rbs/constant.txt @@ -0,0 +1,11 @@ +Object +::Object +Enumerator::Lazy +::Enumerator::Lazy +Array[untyped] +foo +::foo +Foo::foo +::Foo::foo +singleton(Object) +singleton(::Object) diff --git a/test/js/rbs/declaration.txt b/test/js/rbs/declaration.txt new file mode 100644 index 00000000..2cabe37b --- /dev/null +++ b/test/js/rbs/declaration.txt @@ -0,0 +1,3 @@ +Hello::World: Integer +$name: String +type ::Module::foo = String | Integer diff --git a/test/js/rbs/generic.txt b/test/js/rbs/generic.txt new file mode 100644 index 00000000..6ea1e1ac --- /dev/null +++ b/test/js/rbs/generic.txt @@ -0,0 +1,7 @@ +[A, B] (A) -> B +[A] (A) -> A +[A, B, C] -> ::Foo[A, B, C] +[A, B] -> [A, B] +[A] -> { foo: A } +[A, B] (A & B) -> void +[A, B, C, D] -> ::Foo[A, B, C, D] diff --git a/test/js/rbs/interface.txt b/test/js/rbs/interface.txt new file mode 100644 index 00000000..026e2c31 --- /dev/null +++ b/test/js/rbs/interface.txt @@ -0,0 +1,5 @@ +_foo +::_Foo +Foo::_foo +::Foo::_Foo +_Foo[untyped, nil] diff --git a/test/js/rbs/literal.txt b/test/js/rbs/literal.txt new file mode 100644 index 00000000..4fff20f4 --- /dev/null +++ b/test/js/rbs/literal.txt @@ -0,0 +1,9 @@ +1 +-1 +:foo +:foo? +:$foo +:@foo +:@@foo +:+ +:- diff --git a/test/js/rbs/member.txt b/test/js/rbs/member.txt new file mode 100644 index 00000000..b6233f3a --- /dev/null +++ b/test/js/rbs/member.txt @@ -0,0 +1,28 @@ +alias foo bar +alias self.foo self.bar +attr_accessor foo: Foo +attr_accessor self.foo: Foo +attr_accessor foo(): Foo +attr_accessor self.foo(): Foo +attr_accessor foo(@bar): Foo +attr_accessor self.foo(@bar): Foo +attr_reader foo: Foo +attr_reader self.foo: Foo +attr_reader foo(): Foo +attr_reader self.foo(): Foo +attr_reader foo(@bar): Foo +attr_reader self.foo(@bar): Foo +attr_writer foo: Foo +attr_writer self.foo: Foo +attr_writer foo(): Foo +attr_writer self.foo(): Foo +attr_writer foo(@bar): Foo +attr_writer self.foo(@bar): Foo +@foo: Foo +self.@foo: Foo +@@foo: Foo +include Foo +prepend Foo +extend Foo +private +public diff --git a/test/js/rbs/method.txt b/test/js/rbs/method.txt new file mode 100644 index 00000000..bceed6dd --- /dev/null +++ b/test/js/rbs/method.txt @@ -0,0 +1,11 @@ +def t: -> void +def t: -> void | ... +def self.t: -> void +def self.t: -> void | ... +def self?.t: -> void +def self?.t: -> void | ... +def t: { -> void } -> void +def t: ?{ -> void } -> void +def `self`: -> void +def `: -> void +def t: (untyped `untyped`) -> void diff --git a/test/js/rbs/optional.txt b/test/js/rbs/optional.txt new file mode 100644 index 00000000..e7842ee6 --- /dev/null +++ b/test/js/rbs/optional.txt @@ -0,0 +1,5 @@ +untyped? +^-> untyped? +untyped | void? +:foo?? +:foo!? diff --git a/test/js/rbs/parser.test.js b/test/js/rbs/parser.test.js new file mode 100644 index 00000000..87822e7c --- /dev/null +++ b/test/js/rbs/parser.test.js @@ -0,0 +1,52 @@ +const { ruby } = require("../utils"); +const { + parse, + hasPragma, + locStart, + locEnd +} = require("../../../src/rbs/parser"); + +describe("printer", () => { + if (process.env.RUBY_VERSION <= "3.0") { + test("RBS did not exist before ruby 3.0", () => { + // this is here because test files must contain at least one test, so for + // earlier versions of ruby this is just going to chill here + }); + + return; + } + + test("parse", () => { + expect(parse("class Foo end").declarations).toHaveLength(1); + }); + + test("parse", () => { + expect(() => parse("<>")).toThrowError(); + }); + + test("hasPragma", () => { + const withPragma = ruby(` + # @prettier + module Foo + end + `); + + const withoutPragma = ruby(` + module Foo + end + `); + + expect(hasPragma(withPragma)).toBe(true); + expect(hasPragma(withoutPragma)).toBe(false); + }); + + test("locStart", () => { + expect(locStart({ location: { start_pos: 5 } })).toEqual(5); + expect(locStart({ type: { location: { start_pos: 10 } } })).toEqual(10); + }); + + test("locEnd", () => { + expect(locEnd({ location: { end_pos: 5 } })).toEqual(5); + expect(locEnd({ type: { location: { end_pos: 10 } } })).toEqual(10); + }); +}); diff --git a/test/js/rbs/plain.txt b/test/js/rbs/plain.txt new file mode 100644 index 00000000..99ab75f5 --- /dev/null +++ b/test/js/rbs/plain.txt @@ -0,0 +1,11 @@ +void +untyped +bool +true +false +nil +top +bot +self +instance +class diff --git a/test/js/rbs/proc.txt b/test/js/rbs/proc.txt new file mode 100644 index 00000000..4d77333b --- /dev/null +++ b/test/js/rbs/proc.txt @@ -0,0 +1,11 @@ +^-> void +^(untyped) -> void +^(untyped, void) -> void +^(untyped x, void _y) -> void +^(untyped x, ?void, ?nil y) -> void +^(untyped x, ?void, ?nil y, *untyped a) -> void +^(untyped x, *untyped a, nil z) -> void +^(foo: untyped, _bar: nil bar) -> void +^(?_bar: nil, **untyped rest) -> void +^-> void +^{ -> void } -> void diff --git a/test/js/rbs/rbs.test.js b/test/js/rbs/rbs.test.js new file mode 100644 index 00000000..0da11916 --- /dev/null +++ b/test/js/rbs/rbs.test.js @@ -0,0 +1,267 @@ +const fs = require("fs"); +const path = require("path"); + +const { ruby } = require("../utils"); + +function testCases(name, transform) { + const buffer = fs.readFileSync(path.resolve(__dirname, `${name}.txt`)); + const sources = buffer.toString().slice(0, -1).split("\n"); + + sources.forEach((source) => { + test(source, () => + expect(transform(source)).toMatchFormat({ parser: "rbs" }) + ); + }); +} + +function describeCases(name, transform) { + describe(name, () => { + testCases(name, transform); + }); +} + +describe("rbs", () => { + if (process.env.RUBY_VERSION <= "3.0") { + test("RBS did not exist before ruby 3.0", () => { + // this is here because test files must contain at least one test, so for + // earlier versions of ruby this is just going to chill here + }); + + return; + } + + describeCases("combination", (source) => `T: ${source}`); + + describeCases("constant", (source) => `T: ${source}`); + + describe("declaration", () => { + testCases("declaration", (source) => source); + + test("interface", () => { + const content = ruby(` + interface _Foo + end + `); + + return expect(content).toMatchFormat({ parser: "rbs" }); + }); + + test("interface with type params", () => { + const content = ruby(` + interface _Foo[A, B] + end + `); + + return expect(content).toMatchFormat({ parser: "rbs" }); + }); + + test("class", () => { + const content = ruby(` + class Foo + end + `); + + return expect(content).toMatchFormat({ parser: "rbs" }); + }); + + test("class with type params", () => { + const content = ruby(` + class Foo[A, B] + end + `); + + return expect(content).toMatchFormat({ parser: "rbs" }); + }); + + test("class with complicated type params", () => { + const content = ruby(` + class Foo[unchecked in A, unchecked out B, in C, out D, unchecked E, unchecked F, G, H] + end + `); + + return expect(content).toMatchFormat({ parser: "rbs" }); + }); + + test("class with annotations", () => { + const content = ruby(` + %a{This is an annotation.} + class Foo + end + `); + + return expect(content).toMatchFormat({ parser: "rbs" }); + }); + + test("class with annotations that cannot be switched to braces", () => { + const content = ruby(` + %a + class Foo + end + `); + + return expect(content).toMatchFormat({ parser: "rbs" }); + }); + + test("class with comments", () => { + const content = ruby(` + # This is a comment. + class Foo + end + `); + + return expect(content).toMatchFormat({ parser: "rbs" }); + }); + + test("class with superclass", () => { + const content = ruby(` + class Foo < Bar + end + `); + + return expect(content).toMatchFormat({ parser: "rbs" }); + }); + + test("module", () => { + const content = ruby(` + module Foo + end + `); + + return expect(content).toMatchFormat({ parser: "rbs" }); + }); + + test("module with type params", () => { + const content = ruby(` + module Foo[A, B] + end + `); + + return expect(content).toMatchFormat({ parser: "rbs" }); + }); + + test("module with self types", () => { + const content = ruby(` + module Foo : A + end + `); + + return expect(content).toMatchFormat({ parser: "rbs" }); + }); + + test("multiple empty lines", () => { + const content = ruby(` + class Foo + A: 1 + B: 2 + + + C: 3 + end + `); + + const expected = ruby(` + class Foo + A: 1 + B: 2 + + C: 3 + end + `); + + return expect(content).toChangeFormat(expected, { parser: "rbs" }); + }); + }); + + describeCases("generic", (source) => + ruby(` + class T + def t: ${source} + end + `) + ); + + describeCases("interface", (source) => `T: ${source}`); + + describe("literal", () => { + testCases("literal", (source) => `T: ${source}`); + + test("+1 drops the plus sign", () => + expect("T: +1").toChangeFormat("T: 1", { parser: "rbs" })); + + test("uses default quotes", () => + expect("T: 'foo'").toMatchFormat({ parser: "rbs" })); + + test("changes quotes to match", () => + expect("T: 'foo'").toChangeFormat(`T: "foo"`, { + rubySingleQuote: false, + parser: "rbs" + })); + + test("keeps string the same when there is an escape sequence", () => + expect(`T: "super \\" duper"`).toMatchFormat({ parser: "rbs" })); + + test("unescapes single quotes when using double quotes", () => + expect(`T: 'super \\' duper'`).toChangeFormat(`T: "super ' duper"`, { + rubySingleQuote: false, + parser: "rbs" + })); + + test("maintains escape sequences when using double quotes", () => + expect(`T: "escape sequences \\a\\b\\e\\f\\n\\r\\t\\v"`).toMatchFormat({ + parser: "rbs" + })); + + test("maintains not escape sequences when using single quotes", () => + expect(`T: 'escape sequences \\a\\b\\e\\f\\n\\r\\t\\v'`).toMatchFormat({ + parser: "rbs" + })); + }); + + describeCases("member", (source) => + ruby(` + class T + ${source} + end + `) + ); + + describeCases("method", (source) => + ruby(` + class T + ${source} + end + `) + ); + + describe("optional", () => { + testCases("optional", (source) => `T: ${source}`); + + test("removes optional space before question mark", () => + expect("T: :foo ?").toChangeFormat("T: :foo?", { parser: "rbs" })); + }); + + describe("plain", () => { + testCases("plain", (source) => `T: ${source}`); + + test("any gets transformed into untyped", () => + expect("T: any").toChangeFormat("T: untyped", { parser: "rbs" })); + }); + + describe("proc", () => { + testCases("proc", (source) => `T: ${source}`); + + test("drops optional parentheses when there are no params", () => + expect("T: ^() -> void").toChangeFormat("T: ^-> void", { + parser: "rbs" + })); + + test("drops optional parentheses with block param when there are no params to the block", () => + expect( + "T: ^{ () -> void } -> void" + ).toChangeFormat("T: ^{ -> void } -> void", { parser: "rbs" })); + }); + + describeCases("record", (source) => `T: ${source}`); + + describeCases("tuple", (source) => `T: ${source}`); +}); diff --git a/test/js/rbs/record.txt b/test/js/rbs/record.txt new file mode 100644 index 00000000..7ade9b86 --- /dev/null +++ b/test/js/rbs/record.txt @@ -0,0 +1,5 @@ +{ foo: Integer } +{ foo: untyped, 3 => 'hoge' } +{ :+ => 1 } +{ "🌼" => Integer } +{ "日本語" => Integer } diff --git a/test/js/rbs/tuple.txt b/test/js/rbs/tuple.txt new file mode 100644 index 00000000..7dd425e4 --- /dev/null +++ b/test/js/rbs/tuple.txt @@ -0,0 +1,3 @@ +[ ] +[untyped, nil, void] +[untyped] diff --git a/test/js/nodes/field.test.js b/test/js/ruby/nodes/field.test.js similarity index 100% rename from test/js/nodes/field.test.js rename to test/js/ruby/nodes/field.test.js diff --git a/test/js/setupTests.js b/test/js/setupTests.js index af60abf3..79ee938a 100644 --- a/test/js/setupTests.js +++ b/test/js/setupTests.js @@ -5,7 +5,7 @@ const prettier = require("prettier"); // eslint-disable-next-line no-underscore-dangle const { formatAST } = prettier.__debug; -function parseAsync(text) { +function parseAsync(parser, text) { return new Promise((resolve, reject) => { const client = new net.Socket(); @@ -26,11 +26,13 @@ function parseAsync(text) { client.on("data", (data) => { client.destroy(); - resolve(JSON.parse(data.toString())); + + const response = JSON.parse(data.toString()); + (response.error ? reject : resolve)(response); }); client.connect({ port: 22020 }, () => { - client.end(text); + client.end(`${parser}|${text}`); }); }); } @@ -42,7 +44,10 @@ function checkFormat(before, after, config) { ); return new Promise((resolve, reject) => { - if (before.includes("#") || before.includes("=begin")) { + if ( + opts.parser === "ruby" && + (before.includes("#") || before.includes("=begin")) + ) { // If the source includes an #, then this test has a comment in it. // Unfortunately, formatAST expects comments to already be attached, but // prettier doesn't export anything that allows you to hook into their @@ -50,7 +55,7 @@ function checkFormat(before, after, config) { // the normal format function and spawn a process. resolve(prettier.format(before, opts)); } else { - parseAsync(before) + parseAsync(opts.parser, before) .then((ast) => resolve(formatAST(ast, opts).formatted)) .catch(reject); } From cd579406a2cf3df48b70d76f5fd5be7c9a7b5e68 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Tue, 5 Jan 2021 12:24:52 -0500 Subject: [PATCH 057/785] Document RBS format in README --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0a813893..ba9d4daf 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ gem install prettier The `rbprettier` executable is now installed and ready for use: ```bash -bundle exec rbprettier --write '**/*.rb' +bundle exec rbprettier --write '**/*.{rb,rbs}' ``` ### `npm` package @@ -115,7 +115,7 @@ yarn add --dev prettier @prettier/plugin-ruby The `prettier` executable is now installed and ready for use: ```bash -./node_modules/.bin/prettier --write '**/*.rb' +./node_modules/.bin/prettier --write '**/*.{rb,rbs}' ``` ## Configuration @@ -146,7 +146,7 @@ file](https://prettier.io/docs/en/configuration.html). For example: Or, they can be passed to `prettier` as arguments: ```bash -prettier --ruby-single-quote false --write '**/*.rb' +prettier --ruby-single-quote false --write '**/*.{rb,rbs}' ``` ### Usage with RuboCop From a0e22b1a7a06481a047bbe54783cc4f960796b13 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Tue, 5 Jan 2021 12:53:32 -0500 Subject: [PATCH 058/785] Incorporate HAML plugin --- .gitignore | 1 + .npmignore | 1 + .prettierignore | 2 + CHANGELOG.md | 1 + Gemfile | 2 + README.md | 12 +- bin/port | 14 +++ bin/print | 23 ++-- package.json | 2 +- src/haml/embed.js | 87 ++++++++++++++ src/haml/nodes/comment.js | 27 +++++ src/haml/nodes/doctype.js | 34 ++++++ src/haml/nodes/filter.js | 16 +++ src/haml/nodes/hamlComment.js | 21 ++++ src/haml/nodes/plain.js | 6 + src/haml/nodes/root.js | 8 ++ src/haml/nodes/script.js | 33 +++++ src/haml/nodes/silentScript.js | 59 +++++++++ src/haml/nodes/tag.js | 193 ++++++++++++++++++++++++++++++ src/haml/parser.js | 33 +++++ src/haml/parser.rb | 141 ++++++++++++++++++++++ src/haml/printer.js | 28 +++++ src/plugin.js | 15 ++- src/rbs/parser.rb | 19 +-- src/ruby/parser.rb | 14 ++- test/js/globalSetup.js | 5 +- test/js/haml/comment.test.js | 33 +++++ test/js/haml/doctype.test.js | 23 ++++ test/js/haml/filter.test.js | 103 ++++++++++++++++ test/js/haml/hamlComment.test.js | 21 ++++ test/js/haml/parser.test.js | 32 +++++ test/js/haml/plain.test.js | 12 ++ test/js/haml/script.test.js | 33 +++++ test/js/haml/silentScript.test.js | 70 +++++++++++ test/js/haml/tag.test.js | 109 +++++++++++++++++ test/js/parser.rb | 26 ++-- test/js/rbs/parser.test.js | 13 +- test/js/rbs/rbs.test.js | 147 ++++++++++------------- test/js/setupTests.js | 20 ++-- test/js/utils.js | 22 +++- 40 files changed, 1312 insertions(+), 149 deletions(-) create mode 100755 bin/port create mode 100644 src/haml/embed.js create mode 100644 src/haml/nodes/comment.js create mode 100644 src/haml/nodes/doctype.js create mode 100644 src/haml/nodes/filter.js create mode 100644 src/haml/nodes/hamlComment.js create mode 100644 src/haml/nodes/plain.js create mode 100644 src/haml/nodes/root.js create mode 100644 src/haml/nodes/script.js create mode 100644 src/haml/nodes/silentScript.js create mode 100644 src/haml/nodes/tag.js create mode 100644 src/haml/parser.js create mode 100644 src/haml/parser.rb create mode 100644 src/haml/printer.js create mode 100644 test/js/haml/comment.test.js create mode 100644 test/js/haml/doctype.test.js create mode 100644 test/js/haml/filter.test.js create mode 100644 test/js/haml/hamlComment.test.js create mode 100644 test/js/haml/parser.test.js create mode 100644 test/js/haml/plain.test.js create mode 100644 test/js/haml/script.test.js create mode 100644 test/js/haml/silentScript.test.js create mode 100644 test/js/haml/tag.test.js diff --git a/.gitignore b/.gitignore index 47fd297d..1a035cd8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ /pkg/ /test.rb /test.rbs +/test.haml *.gem # This is to better support the GitHub actions checking - since bundler changes diff --git a/.npmignore b/.npmignore index ded90fa6..61ba492d 100644 --- a/.npmignore +++ b/.npmignore @@ -15,3 +15,4 @@ /yarn-error.log /test.rb /test.rbs +/test.haml diff --git a/.prettierignore b/.prettierignore index aa42508a..951790df 100644 --- a/.prettierignore +++ b/.prettierignore @@ -7,10 +7,12 @@ /.eslintcache /.*ignore +/bin/port /docs/logo.png /*.lock /LICENSE /test.rb /test.rbs +/test.haml *.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bfb41da..7e493c33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Added - [@kddeisz] - Handling of the RBS language. +- [@kddeisz] - Incorporate the HAML plugin. ## [1.2.5] - 2021-01-04 diff --git a/Gemfile b/Gemfile index f365da50..c2d85b51 100644 --- a/Gemfile +++ b/Gemfile @@ -5,5 +5,7 @@ source 'https://rubygems.org' gemspec gem 'bundler', '~> 2.1' +gem 'haml', '~> 5.2' gem 'minitest', '~> 5.14' gem 'rake', '~> 13.0' +gem 'rbs', '~> 1.0' diff --git a/README.md b/README.md index ba9d4daf..1b281c58 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,12 @@ To run `prettier` with the Ruby plugin, you're going to need [`ruby`](https://ww Note that currently the editor integrations work best with the `npm` package, as most of the major editor plugins expect a `node_modules` directory. You can get them to work with the Ruby gem, but it requires manually configuring the paths. +This plugin currently supports formatting the following kinds of files: + +- All varieties of Ruby source files (e.g., `*.rb`, `*.gemspec`, `Gemfile`, etc.) +- [RBS type language](https://github.com/ruby/rbs) files - requires having the `rbs` gem in your gem path +- [HAML template language](https://haml.info/) files - requires having the `haml` gem in your gem path + ### Ruby gem Add this line to your application's Gemfile: @@ -95,7 +101,7 @@ gem install prettier The `rbprettier` executable is now installed and ready for use: ```bash -bundle exec rbprettier --write '**/*.{rb,rbs}' +bundle exec rbprettier --write '**/*' ``` ### `npm` package @@ -115,7 +121,7 @@ yarn add --dev prettier @prettier/plugin-ruby The `prettier` executable is now installed and ready for use: ```bash -./node_modules/.bin/prettier --write '**/*.{rb,rbs}' +./node_modules/.bin/prettier --write '**/*' ``` ## Configuration @@ -146,7 +152,7 @@ file](https://prettier.io/docs/en/configuration.html). For example: Or, they can be passed to `prettier` as arguments: ```bash -prettier --ruby-single-quote false --write '**/*.{rb,rbs}' +prettier --ruby-single-quote false --write '**/*' ``` ### Usage with RuboCop diff --git a/bin/port b/bin/port new file mode 100755 index 00000000..0e55c69f --- /dev/null +++ b/bin/port @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +LOW_BOUND=49152 +RANGE=16384 + +while true; do + CANDIDATE=$[$LOW_BOUND + ($RANDOM % $RANGE)] + (echo "" >/dev/tcp/127.0.0.1/${CANDIDATE}) >/dev/null 2>&1 + + if [ $? -ne 0 ]; then + echo $CANDIDATE + break + fi +done diff --git a/bin/print b/bin/print index 982e611d..4e38bc57 100755 --- a/bin/print +++ b/bin/print @@ -4,15 +4,22 @@ const fs = require("fs"); const prettier = require("prettier"); let parser = "ruby"; -let content = 2; +let contentIdx = 2; -if (process.argv[content] === "rbs") { - parser = "rbs"; - content = 3; +if (["rbs", "haml"].includes(process.argv[contentIdx])) { + parser = process.argv[contentIdx]; + contentIdx += 1; } -const code = fs.existsSync(process.argv[content]) - ? fs.readFileSync(process.argv[content], "utf-8") - : process.argv.slice(content).join(" ").replace(/\\n/g, "\n"); +let content; -console.log(prettier.format(code, { parser, plugins: ["."] })); +if (fs.existsSync(process.argv[contentIdx])) { + content = fs.readFileSync(process.argv[contentIdx], "utf-8"); +} else if (process.argv.length === contentIdx) { + const extension = parser === "ruby" ? "rb" : parser; + content = fs.readFileSync(`test.${extension}`, "utf-8"); +} else { + content = process.argv.slice(contentIdx).join(" ").replace(/\\n/g, "\n"); +} + +console.log(prettier.format(content, { parser, plugins: ["."] })); diff --git a/package.json b/package.json index 27af989f..55ff9f11 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "check-format": "prettier --check '**/*'", "lint": "eslint --cache .", - "test": "jest" + "test": "PORT=$(bin/port) jest" }, "repository": { "type": "git", diff --git a/src/haml/embed.js b/src/haml/embed.js new file mode 100644 index 00000000..249d95a0 --- /dev/null +++ b/src/haml/embed.js @@ -0,0 +1,87 @@ +const { + concat, + hardline, + indent, + literalline, + markAsRoot, + mapDoc, + stripTrailingHardline +} = require("../prettier"); + +// Get the name of the parser that is represented by the given element node, +// return null if a matching parser cannot be found +function getParser(name, opts) { + let parser = name; + + // We don't want to deal with some weird recursive parser situation, so we + // need to explicitly call out the HAML parser here and just return null + if (parser === "haml") { + return null; + } + + // In HAML the name of the JS filter is :javascript, whereas in prettier the + // name of the JS parser is babel. Here we explicitly handle that conversion. + if (parser === "javascript") { + parser = "babel"; + } + + // If there is a plugin that has a parser that matches the name of this + // element, then we're going to assume that's correct for embedding and go + // ahead and switch to that parser + if ( + opts.plugins.some( + (plugin) => + plugin.parsers && + Object.prototype.hasOwnProperty.call(plugin.parsers, parser) + ) + ) { + return parser; + } + + return null; +} + +// This function is in here because it handles embedded parser values. I don't +// have a test that exercises it because I'm not sure for which parser it is +// necessary, but since it's in prettier core I'm keeping it here. +/* istanbul ignore next */ +function replaceNewlines(doc) { + return mapDoc(doc, (currentDoc) => + typeof currentDoc === "string" && currentDoc.includes("\n") + ? concat( + currentDoc + .split(/(\n)/g) + .map((v, i) => (i % 2 === 0 ? v : literalline)) + ) + : currentDoc + ); +} + +function embed(path, _print, textToDoc, opts) { + const node = path.getValue(); + if (node.type !== "filter") { + return null; + } + + const parser = getParser(node.value.name, opts); + if (!parser) { + return null; + } + + return markAsRoot( + concat([ + ":", + node.value.name, + indent( + concat([ + hardline, + replaceNewlines( + stripTrailingHardline(textToDoc(node.value.text, { parser })) + ) + ]) + ) + ]) + ); +} + +module.exports = embed; diff --git a/src/haml/nodes/comment.js b/src/haml/nodes/comment.js new file mode 100644 index 00000000..78ec3d8f --- /dev/null +++ b/src/haml/nodes/comment.js @@ -0,0 +1,27 @@ +const { concat, group, hardline, indent, join } = require("../../prettier"); + +// https://haml.info/docs/yardoc/file.REFERENCE.html#html-comments- +function comment(path, _opts, print) { + const { children, value } = path.getValue(); + const parts = ["/"]; + + if (value.revealed) { + parts.push("!"); + } + + if (value.conditional) { + parts.push(value.conditional); + } else if (value.text) { + parts.push(" ", value.text); + } + + if (children.length > 0) { + parts.push( + indent(concat([hardline, join(hardline, path.map(print, "children"))])) + ); + } + + return group(concat(parts)); +} + +module.exports = comment; diff --git a/src/haml/nodes/doctype.js b/src/haml/nodes/doctype.js new file mode 100644 index 00000000..9f699dee --- /dev/null +++ b/src/haml/nodes/doctype.js @@ -0,0 +1,34 @@ +const { join } = require("../../prettier"); + +const types = { + basic: "Basic", + frameset: "Frameset", + mobile: "Mobile", + rdfa: "RDFa", + strict: "Strict", + xml: "XML" +}; + +const versions = ["1.1", "5"]; + +// https://haml.info/docs/yardoc/file.REFERENCE.html#doctype- +function doctype(path, _opts, _print) { + const { value } = path.getValue(); + const parts = ["!!!"]; + + if (value.type in types) { + parts.push(types[value.type]); + } else if (versions.includes(value.version)) { + parts.push(value.version); + } else { + parts.push(value.type); + } + + if (value.encoding) { + parts.push(value.encoding); + } + + return join(" ", parts); +} + +module.exports = doctype; diff --git a/src/haml/nodes/filter.js b/src/haml/nodes/filter.js new file mode 100644 index 00000000..aa126c90 --- /dev/null +++ b/src/haml/nodes/filter.js @@ -0,0 +1,16 @@ +const { concat, group, hardline, indent, join } = require("../../prettier"); + +// https://haml.info/docs/yardoc/file.REFERENCE.html#filters +function filter(path, _opts, _print) { + const { value } = path.getValue(); + + return group( + concat([ + ":", + value.name, + indent(concat([hardline, join(hardline, value.text.trim().split("\n"))])) + ]) + ); +} + +module.exports = filter; diff --git a/src/haml/nodes/hamlComment.js b/src/haml/nodes/hamlComment.js new file mode 100644 index 00000000..a30324e2 --- /dev/null +++ b/src/haml/nodes/hamlComment.js @@ -0,0 +1,21 @@ +const { concat, hardline, indent, join } = require("../../prettier"); + +// https://haml.info/docs/yardoc/file.REFERENCE.html#haml-comments-- +function hamlComment(path, opts, _print) { + const node = path.getValue(); + const parts = ["-#"]; + + if (node.value.text) { + if (opts.originalText.split("\n")[node.line - 1].trim() === "-#") { + const lines = node.value.text.trim().split("\n"); + + parts.push(indent(concat([hardline, join(hardline, lines)]))); + } else { + parts.push(" ", node.value.text.trim()); + } + } + + return concat(parts); +} + +module.exports = hamlComment; diff --git a/src/haml/nodes/plain.js b/src/haml/nodes/plain.js new file mode 100644 index 00000000..fd1c9301 --- /dev/null +++ b/src/haml/nodes/plain.js @@ -0,0 +1,6 @@ +// https://haml.info/docs/yardoc/file.REFERENCE.html#plain-text +function plain(path, _opts, _print) { + return path.getValue().value.text; +} + +module.exports = plain; diff --git a/src/haml/nodes/root.js b/src/haml/nodes/root.js new file mode 100644 index 00000000..deee0de0 --- /dev/null +++ b/src/haml/nodes/root.js @@ -0,0 +1,8 @@ +const { concat, hardline, join } = require("../../prettier"); + +// The root node in the AST +function root(path, _opts, print) { + return concat([join(hardline, path.map(print, "children")), hardline]); +} + +module.exports = root; diff --git a/src/haml/nodes/script.js b/src/haml/nodes/script.js new file mode 100644 index 00000000..dcb5f531 --- /dev/null +++ b/src/haml/nodes/script.js @@ -0,0 +1,33 @@ +const { concat, group, hardline, indent, join } = require("../../prettier"); + +// https://haml.info/docs/yardoc/file.REFERENCE.html#inserting_ruby +function script(path, opts, print) { + const { children, value } = path.getValue(); + const parts = []; + + if (value.escape_html) { + parts.unshift("&"); + } + + if (value.preserve) { + parts.push("~"); + } else if (!value.interpolate) { + parts.push("="); + } + + if (value.escape_html && !value.preserve && value.interpolate) { + parts.push(" ", value.text.trim().slice(1, -1)); + } else { + parts.push(" ", value.text.trim()); + } + + if (children.length > 0) { + parts.push( + indent(concat([hardline, join(hardline, path.map(print, "children"))])) + ); + } + + return group(concat(parts)); +} + +module.exports = script; diff --git a/src/haml/nodes/silentScript.js b/src/haml/nodes/silentScript.js new file mode 100644 index 00000000..7dac177d --- /dev/null +++ b/src/haml/nodes/silentScript.js @@ -0,0 +1,59 @@ +const { concat, group, hardline, indent, join } = require("../../prettier"); + +function findKeywordIndices(children, keywords) { + const indices = []; + + children.forEach((child, index) => { + if (child.type !== "silent_script") { + return; + } + + if (keywords.includes(child.value.keyword)) { + indices.push(index); + } + }); + + return indices; +} + +// https://haml.info/docs/yardoc/file.REFERENCE.html#running-ruby-- +function silentScript(path, _opts, print) { + const { children, value } = path.getValue(); + const parts = [`- ${value.text.trim()}`]; + + if (children.length > 0) { + const scripts = path.map(print, "children"); + + if (value.keyword === "case") { + const keywordIndices = findKeywordIndices(children, ["when", "else"]); + + parts.push( + concat( + scripts.map((script, index) => { + const concated = concat([hardline, script]); + + return keywordIndices.includes(index) ? concated : indent(concated); + }) + ) + ); + } else if (["if", "unless"].includes(value.keyword)) { + const keywordIndices = findKeywordIndices(children, ["elsif", "else"]); + + parts.push( + concat( + scripts.map((script, index) => { + const concated = concat([hardline, script]); + + return keywordIndices.includes(index) ? concated : indent(concated); + }) + ) + ); + } else { + parts.push(indent(concat([hardline, join(hardline, scripts)]))); + } + } + + return group(concat(parts)); +} + +module.exports = silentScript; diff --git a/src/haml/nodes/tag.js b/src/haml/nodes/tag.js new file mode 100644 index 00000000..2723c411 --- /dev/null +++ b/src/haml/nodes/tag.js @@ -0,0 +1,193 @@ +const { + align, + concat, + fill, + group, + hardline, + ifBreak, + indent, + join, + line, + softline +} = require("../../prettier"); + +function getDynamicAttributes(header, attributes) { + const pairs = attributes + .slice(1, -2) + .split(",") + .map((pair) => pair.slice(1).split('" => ')); + + const parts = [concat([pairs[0][0], "=", pairs[0][1]])]; + pairs.slice(1).forEach((pair) => { + parts.push(line, concat([pair[0], "=", pair[1]])); + }); + + return group(concat(["(", align(header + 1, fill(parts)), ")"])); +} + +function getHashValue(value, opts) { + if (typeof value !== "string") { + return value.toString(); + } + + // This is a very special syntax created by the parser to let us know that + // this should be printed literally instead of as a string. + if (value.startsWith("&")) { + return value.slice(1); + } + + const quote = opts.rubySingleQuote ? "'" : '"'; + return `${quote}${value}${quote}`; +} + +function getHashKey(key, opts) { + let quoted = key; + const joiner = opts.rubyHashLabel ? ":" : " =>"; + + if (key.includes(":") || key.includes("-")) { + const quote = opts.rubySingleQuote ? "'" : '"'; + quoted = `${quote}${key}${quote}`; + } + + return `${opts.rubyHashLabel ? "" : ":"}${quoted}${joiner}`; +} + +function getKeyValuePair(key, value, opts) { + return `${getHashKey(key, opts)} ${getHashValue(value, opts)}`; +} + +function getStaticAttributes(header, attributes, opts) { + const keys = Object.keys(attributes).filter( + (name) => !["class", "id"].includes(name) + ); + + const parts = [getKeyValuePair(keys[0], attributes[keys[0]], opts)]; + + keys.slice(1).forEach((key) => { + parts.push(",", line, getKeyValuePair(key, attributes[key], opts)); + }); + + return group(concat(["{", align(header + 1, fill(parts)), "}"])); +} + +function getAttributesObject(object, opts, level = 0) { + if (typeof object !== "object") { + return getHashValue(object, opts); + } + + const boundary = level === 0 ? softline : line; + const parts = Object.keys(object).map((key) => + concat([ + getHashKey(key, opts), + " ", + getAttributesObject(object[key], opts, level + 1) + ]) + ); + + return group( + concat([ + "{", + indent(group(concat([boundary, join(concat([",", line]), parts)]))), + boundary, + "}" + ]) + ); +} + +function getHeader(value, opts) { + const { attributes } = value; + const parts = []; + + if (value.name !== "div") { + parts.push(`%${value.name}`); + } + + if (attributes.class) { + parts.push(`.${attributes.class.replace(/ /g, ".")}`); + } + + if (attributes.id) { + parts.push(`#${attributes.id}`); + } + + if (value.dynamic_attributes.new) { + parts.push( + getDynamicAttributes(parts.join("").length, value.dynamic_attributes.new) + ); + } + + if ( + Object.keys(attributes).some((name) => name !== "class" && name !== "id") + ) { + parts.push(getStaticAttributes(parts.join("").length, attributes, opts)); + } + + if (value.dynamic_attributes.old) { + if (parts.length === 0) { + parts.push("%div"); + } + + if (typeof value.dynamic_attributes.old === "string") { + parts.push(value.dynamic_attributes.old); + } else { + parts.push(getAttributesObject(value.dynamic_attributes.old, opts)); + } + } + + if (value.object_ref) { + if (parts.length === 0) { + parts.push("%div"); + } + parts.push(value.object_ref); + } + + if (value.nuke_outer_whitespace) { + parts.push(">"); + } + + if (value.nuke_inner_whitespace) { + parts.push("<"); + } + + if (value.self_closing) { + parts.push("/"); + } + + if (value.value) { + const prefix = value.parse ? "= " : ifBreak("", " "); + + return group( + concat([ + group(concat(parts)), + indent(concat([softline, prefix, value.value])) + ]) + ); + } + + // In case none of the other if statements have matched and we're printing a + // div, we need to explicitly add it back into the array. + if (parts.length === 0 && value.name === "div") { + parts.push("%div"); + } + + return group(concat(parts)); +} + +// https://haml.info/docs/yardoc/file.REFERENCE.html#element-name- +function tag(path, opts, print) { + const { children, value } = path.getValue(); + const header = getHeader(value, opts); + + if (children.length === 0) { + return header; + } + + return group( + concat([ + header, + indent(concat([hardline, join(hardline, path.map(print, "children"))])) + ]) + ); +} + +module.exports = tag; diff --git a/src/haml/parser.js b/src/haml/parser.js new file mode 100644 index 00000000..fd7f4767 --- /dev/null +++ b/src/haml/parser.js @@ -0,0 +1,33 @@ +const { spawnSync } = require("child_process"); +const path = require("path"); + +const parser = path.join(__dirname, "./parser.rb"); + +const parse = (text, _parsers, _opts) => { + const child = spawnSync("ruby", [parser], { input: text }); + + const error = child.stderr.toString(); + if (error) { + throw new Error(error); + } + + const response = child.stdout.toString(); + return JSON.parse(response); +}; + +const pragmaPattern = /^\s*-#\s*@(prettier|format)/; +const hasPragma = (text) => pragmaPattern.test(text); + +// These functions are just placeholders until we can actually perform this +// properly. The functions are necessary otherwise the format with cursor +// functions break. +const locStart = (_node) => 0; +const locEnd = (_node) => 0; + +module.exports = { + parse, + astFormat: "haml", + hasPragma, + locStart, + locEnd +}; diff --git a/src/haml/parser.rb b/src/haml/parser.rb new file mode 100644 index 00000000..3cb4c3f3 --- /dev/null +++ b/src/haml/parser.rb @@ -0,0 +1,141 @@ +# frozen_string_literal: true + +require 'bundler/setup' if ENV['CI'] +require 'haml' +require 'json' +require 'ripper' + +class Haml::Parser::ParseNode + class DeepAttributeParser + def parse(string) + Haml::AttributeParser.available? ? parse_value(string) : string + end + + private + + def literal(string, level) + level == 0 ? string : "&#{string}" + end + + def parse_value(string, level = 0) + response = Ripper.sexp(string) + return literal(string, level) unless response + + case response[1][0][0] + when :hash + hash = Haml::AttributeParser.parse(string) + + if hash + # Explicitly not using Enumerable#to_h here to support Ruby 2.5 + hash.each_with_object({}) do |(key, value), response| + response[key] = parse_value(value, level + 1) + end + else + literal(string, level) + end + when :string_literal + string[1...-1] + else + literal(string, level) + end + end + end + + ESCAPE = /Haml::Helpers.html_escape\(\((.+)\)\)/.freeze + + # If a node comes in as the plain type but starts with one of the special + # characters that haml parses, then we need to escape it with a \ when + # printing. So here we make a regexp pattern to check if the node needs to be + # escaped. + special_chars = + Haml::Parser::SPECIAL_CHARACTERS.map { |char| Regexp.escape(char) } + + SPECIAL_START = /\A(?:#{special_chars.join('|')})/ + + def as_json + case type + when :comment, :doctype, :silent_script + to_h.tap do |json| + json.delete(:parent) + json[:children] = children.map(&:as_json) + end + when :filter, :haml_comment + to_h.tap { |json| json.delete(:parent) } + when :plain + to_h.tap do |json| + json.delete(:parent) + json[:children] = children.map(&:as_json) + + text = json[:value][:text] + json[:value][:text] = "\\#{text}" if text.match?(SPECIAL_START) + end + when :root + to_h.tap { |json| json[:children] = children.map(&:as_json) } + when :script + to_h.tap do |json| + json.delete(:parent) + json[:children] = children.map(&:as_json) + + if json[:value][:text].match?(ESCAPE) + json[:value][:text].gsub!(ESCAPE) { $1 } + json[:value].merge!(escape_html: 'escape_html', interpolate: true) + end + end + when :tag + to_h.tap do |json| + json.delete(:parent) + + # For some reason this is actually using a symbol to represent a null + # object ref instead of nil itself, so just replacing it here for + # simplicity in the printer + json[:value][:object_ref] = nil if json[:value][:object_ref] == :nil + + # Get a reference to the dynamic attributes hash + dynamic_attributes = value[:dynamic_attributes].to_h + + # If we have any in the old style, then we're going to pass it through + # the deep attribute parser filter. + if dynamic_attributes[:old] + dynamic_attributes[:old] = + DeepAttributeParser.new.parse(dynamic_attributes[:old]) + end + + json.merge!( + children: children.map(&:as_json), + value: value.merge(dynamic_attributes: dynamic_attributes) + ) + end + else + raise ArgumentError, "Unsupported type: #{type}" + end + end +end + +module Prettier + class HAMLParser + def self.parse(source) + Haml::Parser.new({}).call(source).as_json + rescue StandardError + false + end + end +end + +# If this is the main file we're executing, then most likely this is being +# executed from the haml.js spawn. In that case, read the ruby source from +# stdin and report back the AST over stdout. +if $0 == __FILE__ + response = Prettier::HAMLParser.parse($stdin.read) + + if !response + warn( + '@prettier/plugin-ruby encountered an error when attempting to parse ' \ + 'the HAML source. This usually means there was a syntax error in the ' \ + 'file in question.' + ) + + exit 1 + end + + puts JSON.fast_generate(response) +end diff --git a/src/haml/printer.js b/src/haml/printer.js new file mode 100644 index 00000000..d109d0ac --- /dev/null +++ b/src/haml/printer.js @@ -0,0 +1,28 @@ +const embed = require("./embed"); +const nodes = { + comment: require("./nodes/comment"), + doctype: require("./nodes/doctype"), + filter: require("./nodes/filter"), + haml_comment: require("./nodes/hamlComment"), + plain: require("./nodes/plain"), + root: require("./nodes/root"), + script: require("./nodes/script"), + silent_script: require("./nodes/silentScript"), + tag: require("./nodes/tag") +}; + +const genericPrint = (path, opts, print) => { + const { type } = path.getValue(); + + /* istanbul ignore next */ + if (!(type in nodes)) { + throw new Error(`Unsupported node encountered: ${type}`); + } + + return nodes[type](path, opts, print); +}; + +module.exports = { + embed, + print: genericPrint +}; diff --git a/src/plugin.js b/src/plugin.js index db05fc42..b42ea486 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -4,6 +4,9 @@ const rubyParser = require("./ruby/parser"); const rbsPrinter = require("./rbs/printer"); const rbsParser = require("./rbs/parser"); +const hamlPrinter = require("./haml/printer"); +const hamlParser = require("./haml/parser"); + /* * metadata mostly pulled from linguist and rubocop: * https://github.com/github/linguist/blob/master/lib/linguist/languages.yml @@ -75,15 +78,23 @@ module.exports = { name: "RBS", parsers: ["rbs"], extensions: [".rbs"] + }, + { + name: "HAML", + parsers: ["haml"], + extensions: [".haml"], + vscodeLanguageIds: ["haml"] } ], parsers: { ruby: rubyParser, - rbs: rbsParser + rbs: rbsParser, + haml: hamlParser }, printers: { ruby: rubyPrinter, - rbs: rbsPrinter + rbs: rbsPrinter, + haml: hamlPrinter }, options: { rubyArrayLiteral: { diff --git a/src/rbs/parser.rb b/src/rbs/parser.rb index 62031cce..98bff3be 100644 --- a/src/rbs/parser.rb +++ b/src/rbs/parser.rb @@ -1,5 +1,6 @@ #!/usr/bin/env ruby +require 'bundler/setup' if ENV['CI'] require 'json' require 'rbs' @@ -43,15 +44,17 @@ def to_json(*a) # key-value pairs of the record. class RBS::Types::Record def to_json(*a) - fields_extra = - fields.to_h do |key, type| - if key.is_a?(Symbol) && key.match?(/\A[A-Za-z_][A-Za-z_]*\z/) && - !key.match?(RBS::Parser::KEYWORDS_RE) - [key, { type: type, joiner: :label }] - else - [key.inspect, { type: type, joiner: :rocket }] - end + fields_extra = {} + + # Explicitly not using Enumerable#to_h here to support Ruby 2.5 + fields.each do |key, type| + if key.is_a?(Symbol) && key.match?(/\A[A-Za-z_][A-Za-z_]*\z/) && + !key.match?(RBS::Parser::KEYWORDS_RE) + fields_extra[key] = { type: type, joiner: :label } + else + fields_extra[key.inspect] = { type: type, joiner: :rocket } end + end { class: :record, fields: fields_extra, location: location }.to_json(*a) end diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index babbde17..2c0503fc 100755 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -14,7 +14,7 @@ end require 'delegate' -require 'json' unless defined?(JSON) +require 'json' require 'ripper' module Prettier; end @@ -40,6 +40,13 @@ def initialize(source, *args) @source.lines.each { |line| @line_counts << @line_counts.last + line.size } end + def self.parse(source) + builder = new(source) + + response = builder.parse + response unless builder.error? + end + private # This represents the current place in the source string that we've gotten to @@ -2548,10 +2555,9 @@ def on_zsuper # stdin and report back the AST over stdout. if $0 == __FILE__ - builder = Prettier::Parser.new($stdin.read) - response = builder.parse + response = Prettier::Parser.parse($stdin.read) - if !response || builder.error? + if !response warn( '@prettier/plugin-ruby encountered an error when attempting to parse ' \ 'the ruby source. This usually means there was a syntax error in the ' \ diff --git a/test/js/globalSetup.js b/test/js/globalSetup.js index ca84779d..7544736c 100644 --- a/test/js/globalSetup.js +++ b/test/js/globalSetup.js @@ -8,7 +8,10 @@ process.env.RUBY_VERSION = spawnSync("ruby", args).stdout.toString().trim(); function globalSetup() { // Spawn the async parser process so that tests can send their content over to // it to get back the AST. - global.__ASYNC_PARSER__ = spawn("ruby", ["./test/js/parser.rb"]); + global.__ASYNC_PARSER__ = spawn("ruby", [ + "./test/js/parser.rb", + process.env.PORT + ]); } module.exports = globalSetup; diff --git a/test/js/haml/comment.test.js b/test/js/haml/comment.test.js new file mode 100644 index 00000000..742fbb34 --- /dev/null +++ b/test/js/haml/comment.test.js @@ -0,0 +1,33 @@ +const { haml } = require("../utils"); + +describe("comment", () => { + test("single line", () => + expect(haml("/ This is the peanutbutterjelly element")).toMatchFormat()); + + test("multi line", () => { + const content = haml(` + / + %p This doesn't render, because it's commented out! + `); + + return expect(content).toMatchFormat(); + }); + + test("conditional", () => { + const content = haml(` + /[if IE] + %h1 Get Firefox + `); + + return expect(content).toMatchFormat(); + }); + + test("revealed", () => { + const content = haml(` + /![if !IE] + You are not using Internet Explorer, or are using version 10+. + `); + + return expect(content).toMatchFormat(); + }); +}); diff --git a/test/js/haml/doctype.test.js b/test/js/haml/doctype.test.js new file mode 100644 index 00000000..d8d67660 --- /dev/null +++ b/test/js/haml/doctype.test.js @@ -0,0 +1,23 @@ +const { haml } = require("../utils"); + +describe("doctype", () => { + test("basic", () => expect(haml("!!! Basic")).toMatchFormat()); + + test("frameset", () => expect(haml("!!! Frameset")).toMatchFormat()); + + test("mobile", () => expect(haml("!!! Mobile")).toMatchFormat()); + + test("rdfa", () => expect(haml("!!! RDFa")).toMatchFormat()); + + test("strict", () => expect(haml("!!! Strict")).toMatchFormat()); + + test("xml", () => expect(haml("!!! XML")).toMatchFormat()); + + test("encoding", () => expect(haml("!!! XML iso-8859-1")).toMatchFormat()); + + test("1.1", () => expect(haml("!!! 1.1")).toMatchFormat()); + + test("5", () => expect(haml("!!! 5")).toMatchFormat()); + + test("misc", () => expect(haml("!!! foo")).toMatchFormat()); +}); diff --git a/test/js/haml/filter.test.js b/test/js/haml/filter.test.js new file mode 100644 index 00000000..6f345aa1 --- /dev/null +++ b/test/js/haml/filter.test.js @@ -0,0 +1,103 @@ +const { haml } = require("../utils"); + +describe("filter", () => { + test("self", () => { + const content = haml(` + :haml + -# comment + `); + + return expect(content).toMatchFormat(); + }); + + test("custom", () => { + const content = haml(` + :python + def foo: + bar + `); + + return expect(content).toMatchFormat(); + }); + + test("css", () => { + const content = haml(` + :css + .foo { height: 100px; width: 100px; } + `); + + return expect(content).toChangeFormat( + haml(` + :css + .foo { + height: 100px; + width: 100px; + } + `) + ); + }); + + test("javascript", () => { + const content = haml(` + :javascript + 1+1 + `); + + return expect(content).toChangeFormat( + haml(` + :javascript + 1 + 1; + `) + ); + }); + + test("less", () => { + const content = haml(` + :less + .foo { .bar { height: 100px; } } + `); + + return expect(content).toChangeFormat( + haml(` + :less + .foo { + .bar { + height: 100px; + } + } + `) + ); + }); + + test("markdown", () => { + const content = haml(` + :markdown + *Hello, world!* + `); + + return expect(content).toChangeFormat( + haml(` + :markdown + _Hello, world!_ + `) + ); + }); + + test("scss", () => { + const content = haml(` + :scss + .foo { .bar { height: 100px; } } + `); + + return expect(content).toChangeFormat( + haml(` + :scss + .foo { + .bar { + height: 100px; + } + } + `) + ); + }); +}); diff --git a/test/js/haml/hamlComment.test.js b/test/js/haml/hamlComment.test.js new file mode 100644 index 00000000..a6c69fa4 --- /dev/null +++ b/test/js/haml/hamlComment.test.js @@ -0,0 +1,21 @@ +const { haml } = require("../utils"); + +describe("haml comment", () => { + test("empty", () => expect(haml("-#")).toMatchFormat()); + + test("same line", () => expect(haml("-# comment")).toMatchFormat()); + + test("multi line", () => { + const content = haml(` + -# + this is + a multi line + comment + `); + + return expect(content).toMatchFormat(); + }); + + test("weird spacing same line", () => + expect(haml("-# foobar ")).toChangeFormat("-# foobar")); +}); diff --git a/test/js/haml/parser.test.js b/test/js/haml/parser.test.js new file mode 100644 index 00000000..47c3404c --- /dev/null +++ b/test/js/haml/parser.test.js @@ -0,0 +1,32 @@ +const { + parse, + hasPragma, + locStart, + locEnd +} = require("../../../src/haml/parser"); + +describe("parser", () => { + test("parse", () => { + expect(parse("= foo").type).toEqual("root"); + }); + + test("parse failure", () => { + expect(() => parse(`%div("invalid ": 1)`)).toThrowError(); + }); + + test("hasPragma", () => { + const withPragma = "-# @prettier"; + const withoutPragma = "-# foo"; + + expect(hasPragma(withPragma)).toBe(true); + expect(hasPragma(withoutPragma)).toBe(false); + }); + + test("locStart", () => { + expect(locStart({})).toEqual(0); + }); + + test("locEnd", () => { + expect(locEnd({})).toEqual(0); + }); +}); diff --git a/test/js/haml/plain.test.js b/test/js/haml/plain.test.js new file mode 100644 index 00000000..4dd75614 --- /dev/null +++ b/test/js/haml/plain.test.js @@ -0,0 +1,12 @@ +const { haml } = require("../utils"); + +describe("plain", () => { + const specialChars = ["%", ".", "#", "/", "!", "=", "&", "~", "-", "\\", ":"]; + + test.each(specialChars)("escapes starting %s", (specialChar) => + expect(haml(`\\${specialChar}`)).toMatchFormat() + ); + + test("does not unnecessarily escape other characters", () => + expect(haml("foo")).toMatchFormat()); +}); diff --git a/test/js/haml/script.test.js b/test/js/haml/script.test.js new file mode 100644 index 00000000..f45a028d --- /dev/null +++ b/test/js/haml/script.test.js @@ -0,0 +1,33 @@ +const { haml } = require("../utils"); + +describe("script", () => { + test("single line", () => expect(haml('%p= "hello"')).toMatchFormat()); + + test("multi line", () => { + const content = haml(` + %p + = ['hi', 'there', 'reader!'].join " " + = "yo" + `); + + return expect(content).toMatchFormat(); + }); + + test("escape", () => + expect(haml(`& I like #{"cheese & crackers"}`)).toMatchFormat()); + + test("escape with interpolate", () => + expect(haml(`&= "I like cheese & crackers"`)).toMatchFormat()); + + test("children", () => { + const content = haml(` + = foo + = bar + `); + + return expect(content).toMatchFormat(); + }); + + test("preserve", () => + expect(haml('~ "Foo\\n
Bar\\nBaz
"')).toMatchFormat()); +}); diff --git a/test/js/haml/silentScript.test.js b/test/js/haml/silentScript.test.js new file mode 100644 index 00000000..437a5d16 --- /dev/null +++ b/test/js/haml/silentScript.test.js @@ -0,0 +1,70 @@ +const { haml } = require("../utils"); + +describe("silent script", () => { + test("single line", () => expect(haml('- foo = "hello"')).toMatchFormat()); + + test("multi-line", () => { + const content = haml(` + - foo + - bar + `); + + return expect(content).toMatchFormat(); + }); + + test("multi line with case", () => { + const content = haml(` + - case foo + - when 1 + = "1" + %span bar + - when 2 + = "2" + - else + = "3" + `); + + return expect(content).toMatchFormat(); + }); + + test("multi line with if/else", () => { + const content = haml(` + - if foo + %span bar + -# baz + - elsif qux + = "qax" + - else + -# qix + `); + + return expect(content).toMatchFormat(); + }); + + test("multi line with unless/else", () => { + const content = haml(` + - unless foo + %span bar + -# baz + - elsif qux + = "qax" + - else + -# qix + `); + + return expect(content).toMatchFormat(); + }); + + test("multi line with embedded", () => { + const content = haml(` + - if foo + %span foo + - if bar + %span bar + - elsif baz + %span baz + `); + + return expect(content).toMatchFormat(); + }); +}); diff --git a/test/js/haml/tag.test.js b/test/js/haml/tag.test.js new file mode 100644 index 00000000..078c2a67 --- /dev/null +++ b/test/js/haml/tag.test.js @@ -0,0 +1,109 @@ +const { long, haml } = require("../utils"); + +describe("tag", () => { + test("class", () => expect(haml("%p.foo")).toMatchFormat()); + + test("class multiple", () => expect(haml("%p.foo.bar.baz")).toMatchFormat()); + + test("id", () => expect(haml("%p#foo")).toMatchFormat()); + + test("classes and id", () => expect(haml("%p.foo.bar#baz")).toMatchFormat()); + + test("self closing", () => expect(haml("%br/")).toMatchFormat()); + + test("whitespace removal left single line", () => + expect(haml('%p>= "Foo\\nBar"')).toMatchFormat()); + + test("whitespace removal right single line", () => + expect(haml('%p<= "Foo\\nBar"')).toMatchFormat()); + + test("whitespace removal right multi line", () => { + const content = haml(` + %blockquote< + %div + Foo! + `); + + return expect(content).toMatchFormat(); + }); + + test("dynamic attribute", () => + expect(haml("%span{html_attrs('fr-fr')}")).toMatchFormat()); + + test("dynamic attributes (ruby hash)", () => { + const content = haml("%div{data: { controller: 'lesson-evaluation' }}"); + + return expect(content).toMatchFormat(); + }); + + test("dynamic attributes (html-style)", () => { + const content = haml("%img(title=@title alt=@alt)/"); + + return expect(content).toMatchFormat(); + }); + + test("static attributes", () => + expect(haml("%span(foo)")).toChangeFormat("%span{foo: true}")); + + test("static attributes (hash label, single quote)", () => { + const content = haml(`%section(xml:lang="en" title="title")`); + const expected = "%section{'xml:lang': 'en', title: 'title'}"; + + return expect(content).toChangeFormat(expected); + }); + + test("static attributes (hash label, double quote)", () => { + const content = haml(`%section(xml:lang="en" title="title")`); + const expected = `%section{"xml:lang": "en", title: "title"}`; + + return expect(content).toChangeFormat(expected, { rubySingleQuote: false }); + }); + + test("static attributes (hash rocket, single quote)", () => { + const content = haml(`%section(xml:lang="en" title="title")`); + const expected = `%section{:'xml:lang' => 'en', :title => 'title'}`; + + return expect(content).toChangeFormat(expected, { rubyHashLabel: false }); + }); + + test("static attributes (hash rocket, double quote)", () => { + const content = haml(`%section(xml:lang="en" title="title")`); + const expected = '%section{:"xml:lang" => "en", :title => "title"}'; + + return expect(content).toChangeFormat(expected, { + rubyHashLabel: false, + rubySingleQuote: false + }); + }); + + test("static attributes (non-strings)", () => { + const content = haml(`%section(foo=1 bar=2)`); + const expected = `%section(foo=1 bar=2)`; + + return expect(content).toChangeFormat(expected); + }); + + test("object reference", () => { + const content = haml(` + %div[@user, :greeting] + %bar[290]/ + Hello! + `); + + return expect(content).toMatchFormat(); + }); + + test("long declaration before text", () => { + const content = haml(`%button{ data: { current: ${long} } } foo`); + const expected = haml(` + %button{ + data: { + current: ${long} + } + } + foo + `); + + return expect(content).toChangeFormat(expected); + }); +}); diff --git a/test/js/parser.rb b/test/js/parser.rb index d53ac0f5..76694951 100644 --- a/test/js/parser.rb +++ b/test/js/parser.rb @@ -1,17 +1,10 @@ # frozen_string_literal: true require 'socket' -require_relative '../../src/ruby/parser' -if RUBY_VERSION >= '3.0.0' - require_relative '../../src/rbs/parser' -else - class Prettier::RBSParser - def self.parse(source) - false - end - end -end +require_relative '../../src/ruby/parser' +require_relative '../../src/haml/parser' +require_relative '../../src/rbs/parser' # Set the program name so that it's easy to find if we need it $PROGRAM_NAME = 'prettier-ruby-test-parser' @@ -23,7 +16,7 @@ def self.parse(source) trap(:INT) { quit = true } trap(:TERM) { quit = true } -server = TCPServer.new(22_020) +server = TCPServer.new(ARGV.first || 22_021) loop do break if quit @@ -34,12 +27,13 @@ def self.parse(source) parser, source = message.force_encoding('UTF-8').split('|', 2) response = - if parser == 'ruby' - builder = Prettier::Parser.new(source) - response = builder.parse - response unless builder.error? - elsif parser == 'rbs' + case parser + when 'ruby' + Prettier::Parser.parse(source) + when 'rbs' Prettier::RBSParser.parse(source) + when 'haml' + Prettier::HAMLParser.parse(source) end if !response diff --git a/test/js/rbs/parser.test.js b/test/js/rbs/parser.test.js index 87822e7c..638c3d3f 100644 --- a/test/js/rbs/parser.test.js +++ b/test/js/rbs/parser.test.js @@ -6,21 +6,12 @@ const { locEnd } = require("../../../src/rbs/parser"); -describe("printer", () => { - if (process.env.RUBY_VERSION <= "3.0") { - test("RBS did not exist before ruby 3.0", () => { - // this is here because test files must contain at least one test, so for - // earlier versions of ruby this is just going to chill here - }); - - return; - } - +describe("parser", () => { test("parse", () => { expect(parse("class Foo end").declarations).toHaveLength(1); }); - test("parse", () => { + test("parse failure", () => { expect(() => parse("<>")).toThrowError(); }); diff --git a/test/js/rbs/rbs.test.js b/test/js/rbs/rbs.test.js index 0da11916..2fe21c27 100644 --- a/test/js/rbs/rbs.test.js +++ b/test/js/rbs/rbs.test.js @@ -1,16 +1,14 @@ const fs = require("fs"); const path = require("path"); -const { ruby } = require("../utils"); +const { rbs } = require("../utils"); function testCases(name, transform) { const buffer = fs.readFileSync(path.resolve(__dirname, `${name}.txt`)); const sources = buffer.toString().slice(0, -1).split("\n"); sources.forEach((source) => { - test(source, () => - expect(transform(source)).toMatchFormat({ parser: "rbs" }) - ); + test(source, () => expect(rbs(transform(source))).toMatchFormat()); }); } @@ -21,15 +19,6 @@ function describeCases(name, transform) { } describe("rbs", () => { - if (process.env.RUBY_VERSION <= "3.0") { - test("RBS did not exist before ruby 3.0", () => { - // this is here because test files must contain at least one test, so for - // earlier versions of ruby this is just going to chill here - }); - - return; - } - describeCases("combination", (source) => `T: ${source}`); describeCases("constant", (source) => `T: ${source}`); @@ -38,118 +27,118 @@ describe("rbs", () => { testCases("declaration", (source) => source); test("interface", () => { - const content = ruby(` + const content = rbs(` interface _Foo end `); - return expect(content).toMatchFormat({ parser: "rbs" }); + return expect(content).toMatchFormat(); }); test("interface with type params", () => { - const content = ruby(` + const content = rbs(` interface _Foo[A, B] end `); - return expect(content).toMatchFormat({ parser: "rbs" }); + return expect(content).toMatchFormat(); }); test("class", () => { - const content = ruby(` + const content = rbs(` class Foo end `); - return expect(content).toMatchFormat({ parser: "rbs" }); + return expect(content).toMatchFormat(); }); test("class with type params", () => { - const content = ruby(` + const content = rbs(` class Foo[A, B] end `); - return expect(content).toMatchFormat({ parser: "rbs" }); + return expect(content).toMatchFormat(); }); test("class with complicated type params", () => { - const content = ruby(` + const content = rbs(` class Foo[unchecked in A, unchecked out B, in C, out D, unchecked E, unchecked F, G, H] end `); - return expect(content).toMatchFormat({ parser: "rbs" }); + return expect(content).toMatchFormat(); }); test("class with annotations", () => { - const content = ruby(` + const content = rbs(` %a{This is an annotation.} class Foo end `); - return expect(content).toMatchFormat({ parser: "rbs" }); + return expect(content).toMatchFormat(); }); test("class with annotations that cannot be switched to braces", () => { - const content = ruby(` + const content = rbs(` %a class Foo end `); - return expect(content).toMatchFormat({ parser: "rbs" }); + return expect(content).toMatchFormat(); }); test("class with comments", () => { - const content = ruby(` + const content = rbs(` # This is a comment. class Foo end `); - return expect(content).toMatchFormat({ parser: "rbs" }); + return expect(content).toMatchFormat(); }); test("class with superclass", () => { - const content = ruby(` + const content = rbs(` class Foo < Bar end `); - return expect(content).toMatchFormat({ parser: "rbs" }); + return expect(content).toMatchFormat(); }); test("module", () => { - const content = ruby(` + const content = rbs(` module Foo end `); - return expect(content).toMatchFormat({ parser: "rbs" }); + return expect(content).toMatchFormat(); }); test("module with type params", () => { - const content = ruby(` + const content = rbs(` module Foo[A, B] end `); - return expect(content).toMatchFormat({ parser: "rbs" }); + return expect(content).toMatchFormat(); }); test("module with self types", () => { - const content = ruby(` + const content = rbs(` module Foo : A end `); - return expect(content).toMatchFormat({ parser: "rbs" }); + return expect(content).toMatchFormat(); }); test("multiple empty lines", () => { - const content = ruby(` + const content = rbs(` class Foo A: 1 B: 2 @@ -159,7 +148,7 @@ describe("rbs", () => { end `); - const expected = ruby(` + const expected = rbs(` class Foo A: 1 B: 2 @@ -168,16 +157,17 @@ describe("rbs", () => { end `); - return expect(content).toChangeFormat(expected, { parser: "rbs" }); + return expect(content).toChangeFormat(expected); }); }); - describeCases("generic", (source) => - ruby(` - class T - def t: ${source} - end - `) + describeCases( + "generic", + (source) => ` + class T + def t: ${source} + end + ` ); describeCases("interface", (source) => `T: ${source}`); @@ -186,79 +176,72 @@ describe("rbs", () => { testCases("literal", (source) => `T: ${source}`); test("+1 drops the plus sign", () => - expect("T: +1").toChangeFormat("T: 1", { parser: "rbs" })); + expect(rbs("T: +1")).toChangeFormat("T: 1")); - test("uses default quotes", () => - expect("T: 'foo'").toMatchFormat({ parser: "rbs" })); + test("uses default quotes", () => expect(rbs("T: 'foo'")).toMatchFormat()); test("changes quotes to match", () => - expect("T: 'foo'").toChangeFormat(`T: "foo"`, { - rubySingleQuote: false, - parser: "rbs" + expect(rbs("T: 'foo'")).toChangeFormat(`T: "foo"`, { + rubySingleQuote: false })); test("keeps string the same when there is an escape sequence", () => - expect(`T: "super \\" duper"`).toMatchFormat({ parser: "rbs" })); + expect(rbs(`T: "super \\" duper"`)).toMatchFormat()); test("unescapes single quotes when using double quotes", () => - expect(`T: 'super \\' duper'`).toChangeFormat(`T: "super ' duper"`, { - rubySingleQuote: false, - parser: "rbs" + expect(rbs(`T: 'super \\' duper'`)).toChangeFormat(`T: "super ' duper"`, { + rubySingleQuote: false })); test("maintains escape sequences when using double quotes", () => - expect(`T: "escape sequences \\a\\b\\e\\f\\n\\r\\t\\v"`).toMatchFormat({ - parser: "rbs" - })); + expect(rbs(`T: "escape sequences \\a\\b\\e\\f\\n\\r"`)).toMatchFormat()); test("maintains not escape sequences when using single quotes", () => - expect(`T: 'escape sequences \\a\\b\\e\\f\\n\\r\\t\\v'`).toMatchFormat({ - parser: "rbs" - })); + expect(rbs(`T: 'escape sequences \\a\\b\\e\\f\\n\\r'`)).toMatchFormat()); }); - describeCases("member", (source) => - ruby(` - class T - ${source} - end - `) + describeCases( + "member", + (source) => ` + class T + ${source} + end + ` ); - describeCases("method", (source) => - ruby(` - class T - ${source} - end - `) + describeCases( + "method", + (source) => ` + class T + ${source} + end + ` ); describe("optional", () => { testCases("optional", (source) => `T: ${source}`); test("removes optional space before question mark", () => - expect("T: :foo ?").toChangeFormat("T: :foo?", { parser: "rbs" })); + expect(rbs("T: :foo ?")).toChangeFormat("T: :foo?")); }); describe("plain", () => { testCases("plain", (source) => `T: ${source}`); test("any gets transformed into untyped", () => - expect("T: any").toChangeFormat("T: untyped", { parser: "rbs" })); + expect(rbs("T: any")).toChangeFormat("T: untyped")); }); describe("proc", () => { testCases("proc", (source) => `T: ${source}`); test("drops optional parentheses when there are no params", () => - expect("T: ^() -> void").toChangeFormat("T: ^-> void", { - parser: "rbs" - })); + expect(rbs("T: ^() -> void")).toChangeFormat("T: ^-> void")); test("drops optional parentheses with block param when there are no params to the block", () => - expect( - "T: ^{ () -> void } -> void" - ).toChangeFormat("T: ^{ -> void } -> void", { parser: "rbs" })); + expect(rbs("T: ^{ () -> void } -> void")).toChangeFormat( + "T: ^{ -> void } -> void" + )); }); describeCases("record", (source) => `T: ${source}`); diff --git a/test/js/setupTests.js b/test/js/setupTests.js index 79ee938a..d443da28 100644 --- a/test/js/setupTests.js +++ b/test/js/setupTests.js @@ -31,31 +31,31 @@ function parseAsync(parser, text) { (response.error ? reject : resolve)(response); }); - client.connect({ port: 22020 }, () => { + client.connect({ port: process.env.PORT || 22021 }, () => { client.end(`${parser}|${text}`); }); }); } function checkFormat(before, after, config) { - const opts = Object.assign( - { parser: "ruby", plugins: ["."], originalText: before }, - config - ); + const parser = before.parser || "ruby"; + const originalText = before.code || before; + + const opts = Object.assign({ parser, plugins: ["."], originalText }, config); return new Promise((resolve, reject) => { if ( opts.parser === "ruby" && - (before.includes("#") || before.includes("=begin")) + (originalText.includes("#") || originalText.includes("=begin")) ) { // If the source includes an #, then this test has a comment in it. // Unfortunately, formatAST expects comments to already be attached, but // prettier doesn't export anything that allows you to hook into their // attachComments function. So in this case, we need to instead go through // the normal format function and spawn a process. - resolve(prettier.format(before, opts)); + resolve(prettier.format(originalText, opts)); } else { - parseAsync(opts.parser, before) + parseAsync(opts.parser, originalText) .then((ast) => resolve(formatAST(ast, opts).formatted)) .catch(reject); } @@ -72,10 +72,10 @@ function checkFormat(before, after, config) { expect.extend({ toChangeFormat(before, after, config = {}) { - return checkFormat(before, after, config); + return checkFormat(before, after.code || after, config); }, toMatchFormat(before, config = {}) { - return checkFormat(before, before, config); + return checkFormat(before, before.code || before, config); }, toFailFormat(before, message) { let pass = false; diff --git a/test/js/utils.js b/test/js/utils.js index b29efeb8..ebe161bf 100644 --- a/test/js/utils.js +++ b/test/js/utils.js @@ -1,12 +1,28 @@ const long = Array(80).fill("a").join(""); -const ruby = (code) => { +function stripLeadingWhitespace(code) { + if (!code.includes("\n")) { + return code; + } + const lines = code.split("\n"); const indent = lines[1].split("").findIndex((char) => /[^\s]/.test(char)); const content = lines.slice(1, lines.length - 1); return content.map((line) => line.slice(indent)).join("\n"); -}; +} + +function ruby(code) { + return stripLeadingWhitespace(code); +} + +function rbs(code) { + return { code: stripLeadingWhitespace(code), parser: "rbs" }; +} + +function haml(code) { + return { code: stripLeadingWhitespace(code), parser: "haml" }; +} -module.exports = { long, ruby }; +module.exports = { long, ruby, rbs, haml }; From ea8b68dba867f6157ecf485982e90274e51b2916 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Tue, 5 Jan 2021 17:41:17 -0500 Subject: [PATCH 059/785] Bump to v1.3.0 --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e493c33..c838d0b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [1.3.0] - 2021-01-05 + ### Added - [@kddeisz] - Handling of the RBS language. @@ -1033,7 +1035,8 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.2.5...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.3.0...HEAD +[1.3.0]: https://github.com/prettier/plugin-ruby/compare/v1.2.5...v1.3.0 [1.2.5]: https://github.com/prettier/plugin-ruby/compare/v1.2.4...v1.2.5 [1.2.4]: https://github.com/prettier/plugin-ruby/compare/v1.2.3...v1.2.4 [1.2.3]: https://github.com/prettier/plugin-ruby/compare/v1.2.2...v1.2.3 diff --git a/package.json b/package.json index 55ff9f11..835b1cc2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "1.2.5", + "version": "1.3.0", "description": "prettier plugin for the Ruby programming language", "main": "src/plugin.js", "scripts": { From cc410e54792199f63f2f7cfd53d21fef9eddb626 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 6 Jan 2021 12:28:16 -0500 Subject: [PATCH 060/785] Fix up CI --- .github/workflows/main.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8104f5c7..bf23a22e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: - "2.6" - "2.7" - "3.0" - - truffleruby-head + - truffleruby env: CI: true steps: @@ -23,17 +23,8 @@ jobs: # Setup ruby dependencies - uses: ruby/setup-ruby@v1 with: + bundler-cache: true ruby-version: ${{ matrix.ruby }} - - uses: actions/cache@v1 - with: - path: vendor/bundle - key: ${{ runner.os }}-${{ matrix.ruby }}-${{ hashFiles('**/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.ruby }}- - - name: bundle install - run: | - bundle config path vendor/bundle - bundle install --jobs 4 --retry 3 # Setup node dependencies - uses: actions/setup-node@v2-beta From 0312d16ed65cefc291c32986211dc7f745cce415 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Jan 2021 05:04:22 +0000 Subject: [PATCH 061/785] Bump husky from 4.3.6 to 4.3.7 Bumps [husky](https://github.com/typicode/husky) from 4.3.6 to 4.3.7. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v4.3.6...v4.3.7) Signed-off-by: dependabot[bot] --- yarn.lock | 69 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 55 insertions(+), 14 deletions(-) diff --git a/yarn.lock b/yarn.lock index fed681b4..b67e0b91 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1573,12 +1573,20 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" -find-versions@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/find-versions/-/find-versions-3.2.0.tgz#10297f98030a786829681690545ef659ed1d254e" - integrity sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww== +find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +find-versions@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/find-versions/-/find-versions-4.0.0.tgz#3c57e573bf97769b8cb8df16934b627915da4965" + integrity sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ== dependencies: - semver-regex "^2.0.0" + semver-regex "^3.1.2" flat-cache@^3.0.4: version "3.0.4" @@ -1814,17 +1822,17 @@ human-signals@^1.1.1: integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== husky@^4.3.5: - version "4.3.6" - resolved "https://registry.yarnpkg.com/husky/-/husky-4.3.6.tgz#ebd9dd8b9324aa851f1587318db4cccb7665a13c" - integrity sha512-o6UjVI8xtlWRL5395iWq9LKDyp/9TE7XMOTvIpEVzW638UcGxTmV5cfel6fsk/jbZSTlvfGVJf2svFtybcIZag== + version "4.3.7" + resolved "https://registry.yarnpkg.com/husky/-/husky-4.3.7.tgz#ca47bbe6213c1aa8b16bbd504530d9600de91e88" + integrity sha512-0fQlcCDq/xypoyYSJvEuzbDPHFf8ZF9IXKJxlrnvxABTSzK1VPT2RKYQKrcgJ+YD39swgoB6sbzywUqFxUiqjw== dependencies: chalk "^4.0.0" ci-info "^2.0.0" compare-versions "^3.6.0" cosmiconfig "^7.0.0" - find-versions "^3.2.0" + find-versions "^4.0.0" opencollective-postinstall "^2.0.2" - pkg-dir "^4.2.0" + pkg-dir "^5.0.0" please-upgrade-node "^3.2.0" slash "^3.0.0" which-pm-runs "^1.0.0" @@ -2645,6 +2653,13 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" @@ -2961,6 +2976,13 @@ p-limit@^2.2.0: dependencies: p-try "^2.0.0" +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + p-locate@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" @@ -2968,6 +2990,13 @@ p-locate@^4.1.0: dependencies: p-limit "^2.2.0" +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + p-try@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" @@ -3054,6 +3083,13 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" +pkg-dir@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-5.0.0.tgz#a02d6aebe6ba133a928f74aec20bafdfe6b8e760" + integrity sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA== + dependencies: + find-up "^5.0.0" + please-upgrade-node@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942" @@ -3339,10 +3375,10 @@ semver-compare@^1.0.0: resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= -semver-regex@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-2.0.0.tgz#a93c2c5844539a770233379107b38c7b4ac9d338" - integrity sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw== +semver-regex@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-3.1.2.tgz#34b4c0d361eef262e07199dbef316d0f2ab11807" + integrity sha512-bXWyL6EAKOJa81XG1OZ/Yyuq+oT0b2YLlxx7c+mrdYPaPbnj6WgVULXhinMIeZGufuUBu/eVRqXEhiv4imfwxA== "semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0: version "5.7.1" @@ -4033,3 +4069,8 @@ yargs@^15.4.1: which-module "^2.0.0" y18n "^4.0.0" yargs-parser "^18.1.2" + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== From dc7cd1645c57a2720d5b7998f3023c3a7d1cc57d Mon Sep 17 00:00:00 2001 From: Ian Ker-Seymer Date: Tue, 5 Jan 2021 22:05:41 -0500 Subject: [PATCH 062/785] Add parser server to increase performance This PR makes the parser process reusable to avoid loading Ruby for each parse invocation. This increases the performance of parsing by ~10x for each file. Before: ``` spec/shopify/coders_spec.rb 210ms spec/shopify/connector/add_to_collection_spec.rb 211ms spec/shopify/connector/create_product_spec.rb 212ms spec/shopify/connector/delete_product_spec.rb 198ms spec/shopify/connector/export_products_spec.rb 203ms spec/shopify/connector/get_products_spec.rb 207ms spec/shopify/connector/product_mapper_spec.rb 214ms spec/shopify/connector/update_product_spec.rb 192ms spec/shopify/http/client_spec.rb 194ms spec/shopify/interactors/append_tags_to_order_spec.rb 198ms spec/shopify/relations/custom_collections_spec.rb 197ms spec/shopify/relations/orders_spec.rb 200ms spec/shopify/relations/products_spec.rb 211ms spec/shopify/types_spec.rb 193ms ``` After: ``` spec/shopify/coders_spec.rb 239ms spec/shopify/connector/add_to_collection_spec.rb 17ms spec/shopify/connector/create_product_spec.rb 21ms spec/shopify/connector/delete_product_spec.rb 16ms spec/shopify/connector/export_products_spec.rb 34ms spec/shopify/connector/get_products_spec.rb 29ms spec/shopify/connector/product_mapper_spec.rb 22ms spec/shopify/connector/update_product_spec.rb 18ms spec/shopify/http/client_spec.rb 17ms spec/shopify/interactors/append_tags_to_order_spec.rb 21ms spec/shopify/relations/custom_collections_spec.rb 12ms spec/shopify/relations/orders_spec.rb 21ms spec/shopify/relations/products_spec.rb 14ms spec/shopify/types_spec.rb 13ms ``` --- src/ruby/parser.js | 21 +++-------- src/utils/parserServer.js | 76 ++++++++++++++++++++++++++++++++++++++ src/utils/parser_server.rb | 29 +++++++++++++++ 3 files changed, 110 insertions(+), 16 deletions(-) create mode 100644 src/utils/parserServer.js create mode 100644 src/utils/parser_server.rb diff --git a/src/ruby/parser.js b/src/ruby/parser.js index 69f8e16c..f28f93f4 100644 --- a/src/ruby/parser.js +++ b/src/ruby/parser.js @@ -1,5 +1,6 @@ const { spawnSync } = require("child_process"); -const path = require("path"); +const process = require("process"); +const { sendRequest, ensureParseServer } = require("./../utils/parserServer"); // In order to properly parse ruby code, we need to tell the ruby process to // parse using UTF-8. Unfortunately, the way that you accomplish this looks @@ -37,23 +38,11 @@ const LANG = (() => { // the code stored in that string. We accomplish this by spawning a new Ruby // process of parser.rb and reading JSON off STDOUT. function parse(text, _parsers, _opts) { - const child = spawnSync( - "ruby", - ["--disable-gems", path.join(__dirname, "./parser.rb")], - { - env: Object.assign({}, process.env, { LANG }), - input: text, - maxBuffer: 15 * 1024 * 1024 // 15MB - } - ); + ensureParseServer({ LANG }); - const error = child.stderr.toString(); - if (error) { - throw new Error(error); - } + const request = { type: "ruby", data: text }; - const response = child.stdout.toString(); - return JSON.parse(response); + return sendRequest(request, { LANG }); } const pragmaPattern = /#\s*@(prettier|format)/; diff --git a/src/utils/parserServer.js b/src/utils/parserServer.js new file mode 100644 index 00000000..8229fed2 --- /dev/null +++ b/src/utils/parserServer.js @@ -0,0 +1,76 @@ +const { spawn, spawnSync, execSync } = require("child_process"); +const path = require("path"); +const { existsSync, mkdtempSync } = require("fs"); +const process = require("process"); +const os = require("os"); + +let SOCKFILE = null; + +// Spawn the parser_server.rb subprocess. We do this since booting Ruby is slow, +// and we can re-use the parser process multiple times since it is statelesss. +// By doing this, we increase the performance by 10x. +function spawnParserServer(sockfile, env) { + const server = spawn( + "ruby", + ["--disable-gems", path.join(__dirname, "./parser_server.rb"), sockfile], + { + env: Object.assign({}, process.env, env), + detached: true, + stdio: "inherit" + } + ); + + server.unref(); + + process.on("beforeExit", (code) => server.kill()); + + const now = new Date(); + + // Wait for server to go live + while (!existsSync(sockfile) && new Date() - now < 3000) { + execSync("sleep 0.1"); + } +} + +// Creates a tempdir where the unix socket will live +function generateSockfileName() { + const randomId = Math.random().toString(36).substring(8); + const tmpdir = mkdtempSync( + path.join(os.tmpdir(), `prettier-ruby-${randomId}`) + ); + + return `${tmpdir}/ruby-parser-server.sock`; +} + +// Spawns a parser server if it does not exist +function ensureParseServer(env) { + if (SOCKFILE) { + return; + } + + SOCKFILE = generateSockfileName(); + + spawnParserServer(SOCKFILE, env); +} + +// Formats and sends a request for the parser server. We use netcat here since +// Prettier expects the results of `parse` to be synchrnous, and Node.js does +// not offer a mechanism for synchronous socket requests. Luckily, netcat is +// fairly ubuitious at this point. +function sendRequest(request, env) { + const child = spawnSync("nc", ["-U", SOCKFILE], { + env: Object.assign({}, process.env, env), + input: JSON.stringify(request), + maxBuffer: 15 * 1024 * 1024 // 15MB + }); + + const response = child.stdout.toString(); + + if (response.match(/^ERROR: /)) { + throw new Error(response); + } else { + return JSON.parse(response); + } +} + +module.exports = { sendRequest, ensureParseServer }; diff --git a/src/utils/parser_server.rb b/src/utils/parser_server.rb new file mode 100644 index 00000000..f0f29e8d --- /dev/null +++ b/src/utils/parser_server.rb @@ -0,0 +1,29 @@ +require_relative './../ruby/parser' +require 'socket' + +Socket.unix_server_loop(ARGV.last) do |socket, client_addrinfo| + begin + request = JSON.parse(socket.read, symbolize_names: true) + + builder = case request[:type] + when 'ruby' then Prettier::Parser.new(request[:data]) + else raise "unknown file type #{request[:type]}" + end + + response = builder.parse + + if !response || builder.error? + raise 'unknown' + end + + socket.write(JSON.fast_generate(response)) + rescue StandardError => e + socket.write( + 'ERROR: @prettier/plugin-ruby encountered an error when attempting to parse ' \ + 'the RBS source. This usually means there was a syntax error in the ' \ + "file in question. #{e.message}" + ) + ensure + socket.close + end +end From e6aa024500e94103bc9bd5c0d5fa5885c974ba76 Mon Sep 17 00:00:00 2001 From: Ian Ker-Seymer Date: Wed, 6 Jan 2021 00:56:14 -0500 Subject: [PATCH 063/785] Ensure no zombie processes can exist --- src/utils/parserServer.js | 4 +++- src/utils/parser_server.rb | 30 ++++++++++++++++++++---------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/utils/parserServer.js b/src/utils/parserServer.js index 8229fed2..fe00c5a4 100644 --- a/src/utils/parserServer.js +++ b/src/utils/parserServer.js @@ -14,12 +14,14 @@ function spawnParserServer(sockfile, env) { "ruby", ["--disable-gems", path.join(__dirname, "./parser_server.rb"), sockfile], { - env: Object.assign({}, process.env, env), + env: Object.assign({ PARSER_SERVER_TIMEOUT: "600" }, process.env, env), detached: true, stdio: "inherit" } ); + process.on("exit", (code) => process.kill(-server.pid)); + server.unref(); process.on("beforeExit", (code) => server.kill()); diff --git a/src/utils/parser_server.rb b/src/utils/parser_server.rb index f0f29e8d..fa819206 100644 --- a/src/utils/parser_server.rb +++ b/src/utils/parser_server.rb @@ -1,27 +1,37 @@ -require_relative './../ruby/parser' require 'socket' +require_relative './../ruby/parser' + +# A sanity check to kill lingering processes that may get stuck. Theoretically, +# this should not happen, but it's best to be safe and not risking zombies +# running around. +if ENV['PARSER_SERVER_TIMEOUT'] + t = ENV['PARSER_SERVER_TIMEOUT'].to_i + + Thread.new { sleep(t) && abort('Prettier: Ruby parser server timed out') } +end Socket.unix_server_loop(ARGV.last) do |socket, client_addrinfo| begin request = JSON.parse(socket.read, symbolize_names: true) - builder = case request[:type] - when 'ruby' then Prettier::Parser.new(request[:data]) - else raise "unknown file type #{request[:type]}" - end + builder = + case request[:type] + when 'ruby' + Prettier::Parser.new(request[:data]) + else + raise "unknown file type: #{request[:type].inspect}" + end response = builder.parse - if !response || builder.error? - raise 'unknown' - end + raise 'could not parse input' if !response || builder.error? socket.write(JSON.fast_generate(response)) rescue StandardError => e - socket.write( + socket.puts( 'ERROR: @prettier/plugin-ruby encountered an error when attempting to parse ' \ 'the RBS source. This usually means there was a syntax error in the ' \ - "file in question. #{e.message}" + "file in question. (#{e.inspect})" ) ensure socket.close From 87ecc3cb1f4bb0ae6496ed28590ada9e1190146b Mon Sep 17 00:00:00 2001 From: Ian Ker-Seymer Date: Wed, 6 Jan 2021 00:57:13 -0500 Subject: [PATCH 064/785] Add netcat adapters to support all systems --- src/utils/netcat.js | 11 +++++++++ src/utils/parserServer.js | 48 +++++++++++++++++++++++++++++++++++---- 2 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 src/utils/netcat.js diff --git a/src/utils/netcat.js b/src/utils/netcat.js new file mode 100644 index 00000000..bd1768dd --- /dev/null +++ b/src/utils/netcat.js @@ -0,0 +1,11 @@ +// A simple fallback when no netcat-compatible adapter is found on the system. +// On average, this is 2-3x slower than netcat, but still much faster than +// spawning a new Ruby process + +const { createConnection } = require("net"); + +const sock = process.argv[process.argv.length - 1]; + +const client = createConnection(sock, () => process.stdin.pipe(client)); + +client.on("data", (data) => process.stdout.write(data)); diff --git a/src/utils/parserServer.js b/src/utils/parserServer.js index fe00c5a4..3d07f9bf 100644 --- a/src/utils/parserServer.js +++ b/src/utils/parserServer.js @@ -4,7 +4,8 @@ const { existsSync, mkdtempSync } = require("fs"); const process = require("process"); const os = require("os"); -let SOCKFILE = null; +let SOCKFILE; +let NETCAT_ADAPTER; // Spawn the parser_server.rb subprocess. We do this since booting Ruby is slow, // and we can re-use the parser process multiple times since it is statelesss. @@ -24,8 +25,6 @@ function spawnParserServer(sockfile, env) { server.unref(); - process.on("beforeExit", (code) => server.kill()); - const now = new Date(); // Wait for server to go live @@ -41,7 +40,7 @@ function generateSockfileName() { path.join(os.tmpdir(), `prettier-ruby-${randomId}`) ); - return `${tmpdir}/ruby-parser-server.sock`; + return `${tmpdir}/prettier-plugin-ruby.sock`; } // Spawns a parser server if it does not exist @@ -55,12 +54,51 @@ function ensureParseServer(env) { spawnParserServer(SOCKFILE, env); } +// Checks to see if an executable is available +function hasCommand(name) { + const isWin = require("os").type() === "Windows_NT"; + + let result; + + if (isWin) { + result = spawnSync("where", [name]); + } else { + result = spawnSync("command", ["-v", name]); + } + + return result.status === 0; +} + +// Finds an netcat-like adapter to use for sending data to a socket. We order +// these by likelihood of being found so we can avoid some shell-outs. +function fetchNetcatAdapter() { + if (NETCAT_ADAPTER) { + return NETCAT_ADAPTER; + } + + if (hasCommand("nc")) { + NETCAT_ADAPTER = ["nc", "-U"]; + } else if (hasCommand("telnet")) { + NETCAT_ADAPTER = ["telnet", "-u"]; + } else if (hasCommand("ncat")) { + NETCAT_ADAPTER = ["ncat", "-U"]; + } else if (hasCommand("socat")) { + NETCAT_ADAPTER = ["socat", "-"]; + } else { + NETCAT_ADAPTER = ["node", require.resolve("./netcat.js")]; + } + + return NETCAT_ADAPTER; +} + // Formats and sends a request for the parser server. We use netcat here since // Prettier expects the results of `parse` to be synchrnous, and Node.js does // not offer a mechanism for synchronous socket requests. Luckily, netcat is // fairly ubuitious at this point. function sendRequest(request, env) { - const child = spawnSync("nc", ["-U", SOCKFILE], { + const [netcatExe, ...netcatArgs] = fetchNetcatAdapter(); + + const child = spawnSync(netcatExe, [...netcatArgs, SOCKFILE], { env: Object.assign({}, process.env, env), input: JSON.stringify(request), maxBuffer: 15 * 1024 * 1024 // 15MB From c119b0d3ec0209457eef5dc59396b7a42bf5e839 Mon Sep 17 00:00:00 2001 From: Ian Ker-Seymer Date: Wed, 6 Jan 2021 01:42:06 -0500 Subject: [PATCH 065/785] Handle jest exit jankiness --- src/utils/parserServer.js | 11 ++++++++++- test/js/setupTests.js | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/utils/parserServer.js b/src/utils/parserServer.js index 3d07f9bf..b8f8e50e 100644 --- a/src/utils/parserServer.js +++ b/src/utils/parserServer.js @@ -3,10 +3,19 @@ const path = require("path"); const { existsSync, mkdtempSync } = require("fs"); const process = require("process"); const os = require("os"); +const { kill } = require("process"); let SOCKFILE; let NETCAT_ADAPTER; +function killServer(server) { + try { + process.kill(-server.pid); + SOCKFILE = undefined; + NETCAT_ADAPTER = undefined; + } catch (e) {} +} + // Spawn the parser_server.rb subprocess. We do this since booting Ruby is slow, // and we can re-use the parser process multiple times since it is statelesss. // By doing this, we increase the performance by 10x. @@ -21,7 +30,7 @@ function spawnParserServer(sockfile, env) { } ); - process.on("exit", (code) => process.kill(-server.pid)); + process.on("exit", () => killServer(server)); server.unref(); diff --git a/test/js/setupTests.js b/test/js/setupTests.js index d443da28..40e853a2 100644 --- a/test/js/setupTests.js +++ b/test/js/setupTests.js @@ -109,3 +109,6 @@ expect.extend({ })); } }); + +// For some reason, the process.on('exit') handler does not get called in jest specs even when the process exits. To remedy this, we emit a custom event. +afterAll(() => process.emit("exit")); From 549a7b5f323ce30a4c1e79302e584453ecb63474 Mon Sep 17 00:00:00 2001 From: Ian Ker-Seymer Date: Wed, 6 Jan 2021 01:54:25 -0500 Subject: [PATCH 066/785] Handle stderr of child process --- src/utils/parserServer.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/utils/parserServer.js b/src/utils/parserServer.js index b8f8e50e..d91edab6 100644 --- a/src/utils/parserServer.js +++ b/src/utils/parserServer.js @@ -107,13 +107,18 @@ function fetchNetcatAdapter() { function sendRequest(request, env) { const [netcatExe, ...netcatArgs] = fetchNetcatAdapter(); - const child = spawnSync(netcatExe, [...netcatArgs, SOCKFILE], { + const { stdout, stderr } = spawnSync(netcatExe, [...netcatArgs, SOCKFILE], { env: Object.assign({}, process.env, env), input: JSON.stringify(request), maxBuffer: 15 * 1024 * 1024 // 15MB }); - const response = child.stdout.toString(); + if (stdout == null) { + const msg = stderr ? stderr.toString() : "Unknown error occurred"; + throw new Error(msg); + } + + const response = stdout.toString(); if (response.match(/^ERROR: /)) { throw new Error(response); From b74181aab562586989bdeb8e6c2fd61db6bd0560 Mon Sep 17 00:00:00 2001 From: Ian Ker-Seymer Date: Wed, 6 Jan 2021 15:41:59 -0500 Subject: [PATCH 067/785] Re-use test async parser --- package.json | 2 +- src/utils/parserServer.js | 12 ++--- src/utils/parser_server.rb | 96 +++++++++++++++++++++++++++----------- test/js/globalSetup.js | 4 +- test/js/parser.rb | 54 --------------------- test/js/setupTests.js | 2 +- 6 files changed, 78 insertions(+), 92 deletions(-) delete mode 100644 test/js/parser.rb diff --git a/package.json b/package.json index 835b1cc2..6cfad556 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "check-format": "prettier --check '**/*'", "lint": "eslint --cache .", - "test": "PORT=$(bin/port) jest" + "test": "PRETTIER_RUBY_PARSER_HOST=\"/tmp/prettier-ruby-test-$(openssl rand -hex 8).sock\" jest" }, "repository": { "type": "git", diff --git a/src/utils/parserServer.js b/src/utils/parserServer.js index d91edab6..a23711af 100644 --- a/src/utils/parserServer.js +++ b/src/utils/parserServer.js @@ -5,7 +5,7 @@ const process = require("process"); const os = require("os"); const { kill } = require("process"); -let SOCKFILE; +let SOCKFILE = process.env.PRETTIER_RUBY_PARSER_HOST; let NETCAT_ADAPTER; function killServer(server) { @@ -109,7 +109,7 @@ function sendRequest(request, env) { const { stdout, stderr } = spawnSync(netcatExe, [...netcatArgs, SOCKFILE], { env: Object.assign({}, process.env, env), - input: JSON.stringify(request), + input: `${request.type}|${request.data}`, maxBuffer: 15 * 1024 * 1024 // 15MB }); @@ -118,12 +118,12 @@ function sendRequest(request, env) { throw new Error(msg); } - const response = stdout.toString(); + const response = JSON.parse(stdout.toString()); - if (response.match(/^ERROR: /)) { - throw new Error(response); + if (response.error) { + throw new Error(response.error); } else { - return JSON.parse(response); + return response; } } diff --git a/src/utils/parser_server.rb b/src/utils/parser_server.rb index fa819206..18d85607 100644 --- a/src/utils/parser_server.rb +++ b/src/utils/parser_server.rb @@ -1,39 +1,79 @@ +# frozen_string_literal: true + require 'socket' -require_relative './../ruby/parser' -# A sanity check to kill lingering processes that may get stuck. Theoretically, -# this should not happen, but it's best to be safe and not risking zombies -# running around. -if ENV['PARSER_SERVER_TIMEOUT'] - t = ENV['PARSER_SERVER_TIMEOUT'].to_i +# Set the program name so that it's easy to find if we need it +$PROGRAM_NAME = 'prettier-ruby-parser' + +# Make sure we trap these signals to be sure we get the quit command coming from +# the parent node process +quit = false +trap(:QUIT) { quit = true } +trap(:INT) { quit = true } +trap(:TERM) { quit = true } + +sockfile = ARGV.first +server = UNIXServer.new(sockfile) - Thread.new { sleep(t) && abort('Prettier: Ruby parser server timed out') } +MAX_LEN = 10 * 1024 * 1024 + +def read_message(socket) + message = +'' + + loop do + message << socket.readpartial(MAX_LEN) + rescue EOFError + break + end + + message.force_encoding('UTF-8').split('|', 2) end -Socket.unix_server_loop(ARGV.last) do |socket, client_addrinfo| - begin - request = JSON.parse(socket.read, symbolize_names: true) +begin + loop do + break if quit - builder = - case request[:type] - when 'ruby' - Prettier::Parser.new(request[:data]) - else - raise "unknown file type: #{request[:type].inspect}" - end + # Start up a new thread that will handle each successive connection. + Thread.new(server.accept_nonblock) do |socket| + parser, source = read_message(socket) - response = builder.parse + response = + case parser + when 'ruby' + require_relative '../ruby/parser' + Prettier::Parser.parse(source) + when 'rbs' + require_relative '../rbs/parser' + Prettier::RBSParser.parse(source) + when 'haml' + require_relative '../haml/parser' + Prettier::HAMLParser.parse(source) + end - raise 'could not parse input' if !response || builder.error? + if !response + socket.write( + JSON.fast_generate( + error: + '@prettier/plugin-ruby encountered an error when attempting to parse ' \ + 'the ruby source. This usually means there was a syntax error in the ' \ + 'file in question. You can verify by running `ruby -i [path/to/file]`.' + ) + ) + else + socket.write(JSON.fast_generate(response)) + end + ensure + socket.close + end + rescue IO::WaitReadable, Errno::EINTR + # Wait for select(2) to give us a connection that has content for 1 second. + # Otherwise timeout and continue on (so that we hit our "break if quit" + # pretty often). + IO.select([server], nil, nil, 1) - socket.write(JSON.fast_generate(response)) - rescue StandardError => e - socket.puts( - 'ERROR: @prettier/plugin-ruby encountered an error when attempting to parse ' \ - 'the RBS source. This usually means there was a syntax error in the ' \ - "file in question. (#{e.inspect})" - ) - ensure - socket.close + retry unless quit end +ensure + server.close + File.unlink(sockfile) end diff --git a/test/js/globalSetup.js b/test/js/globalSetup.js index 7544736c..44c74925 100644 --- a/test/js/globalSetup.js +++ b/test/js/globalSetup.js @@ -9,8 +9,8 @@ function globalSetup() { // Spawn the async parser process so that tests can send their content over to // it to get back the AST. global.__ASYNC_PARSER__ = spawn("ruby", [ - "./test/js/parser.rb", - process.env.PORT + "./src/utils/parser_server.rb", + process.env.PRETTIER_RUBY_PARSER_HOST ]); } diff --git a/test/js/parser.rb b/test/js/parser.rb deleted file mode 100644 index 76694951..00000000 --- a/test/js/parser.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -require 'socket' - -require_relative '../../src/ruby/parser' -require_relative '../../src/haml/parser' -require_relative '../../src/rbs/parser' - -# Set the program name so that it's easy to find if we need it -$PROGRAM_NAME = 'prettier-ruby-test-parser' - -# Make sure we trap these signals to be sure we get the quit command coming from -# the parent node process -quit = false -trap(:QUIT) { quit = true } -trap(:INT) { quit = true } -trap(:TERM) { quit = true } - -server = TCPServer.new(ARGV.first || 22_021) - -loop do - break if quit - - # Start up a new thread that will handle each successive connection. - Thread.new(server.accept_nonblock) do |socket| - message = socket.readpartial(10 * 1024 * 1024) - parser, source = message.force_encoding('UTF-8').split('|', 2) - - response = - case parser - when 'ruby' - Prettier::Parser.parse(source) - when 'rbs' - Prettier::RBSParser.parse(source) - when 'haml' - Prettier::HAMLParser.parse(source) - end - - if !response - socket.puts('{ "error": true }') - else - socket.puts(JSON.fast_generate(response)) - end - - socket.close - end -rescue IO::WaitReadable, Errno::EINTR - # Wait for select(2) to give us a connection that has content for 1 second. - # Otherwise timeout and continue on (so that we hit our "break if quit" - # pretty often). - IO.select([server], nil, nil, 1) - - retry unless quit -end diff --git a/test/js/setupTests.js b/test/js/setupTests.js index 40e853a2..e803b78e 100644 --- a/test/js/setupTests.js +++ b/test/js/setupTests.js @@ -31,7 +31,7 @@ function parseAsync(parser, text) { (response.error ? reject : resolve)(response); }); - client.connect({ port: process.env.PORT || 22021 }, () => { + client.connect(process.env.PRETTIER_RUBY_PARSER_HOST, () => { client.end(`${parser}|${text}`); }); }); From 29688f8ea9ea9e82181172f5dd1195cd71a91109 Mon Sep 17 00:00:00 2001 From: Ian Ker-Seymer Date: Wed, 6 Jan 2021 15:46:47 -0500 Subject: [PATCH 068/785] Lint --- src/ruby/parser.js | 1 - src/utils/parserServer.js | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ruby/parser.js b/src/ruby/parser.js index f28f93f4..cfb54201 100644 --- a/src/ruby/parser.js +++ b/src/ruby/parser.js @@ -1,4 +1,3 @@ -const { spawnSync } = require("child_process"); const process = require("process"); const { sendRequest, ensureParseServer } = require("./../utils/parserServer"); diff --git a/src/utils/parserServer.js b/src/utils/parserServer.js index a23711af..91203ceb 100644 --- a/src/utils/parserServer.js +++ b/src/utils/parserServer.js @@ -3,7 +3,6 @@ const path = require("path"); const { existsSync, mkdtempSync } = require("fs"); const process = require("process"); const os = require("os"); -const { kill } = require("process"); let SOCKFILE = process.env.PRETTIER_RUBY_PARSER_HOST; let NETCAT_ADAPTER; @@ -13,7 +12,9 @@ function killServer(server) { process.kill(-server.pid); SOCKFILE = undefined; NETCAT_ADAPTER = undefined; - } catch (e) {} + } catch (e) { + // ok + } } // Spawn the parser_server.rb subprocess. We do this since booting Ruby is slow, From a98ae9e3fbe4fb2dd13e6cb8e105c3281eb4cacc Mon Sep 17 00:00:00 2001 From: Ian Ker-Seymer Date: Thu, 7 Jan 2021 13:06:08 -0500 Subject: [PATCH 069/785] Add macos-latest runner to specs --- .github/workflows/main.yml | 5 ++++- src/utils/parserServer.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bf23a22e..be2f90a8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,16 +5,19 @@ on: jobs: ci: name: CI - runs-on: ubuntu-latest strategy: fail-fast: false matrix: + os: + - macos-latest + - ubuntu-latest ruby: - "2.5" - "2.6" - "2.7" - "3.0" - truffleruby + runs-on: ${{ matrix.os }} env: CI: true steps: diff --git a/src/utils/parserServer.js b/src/utils/parserServer.js index 91203ceb..a127978f 100644 --- a/src/utils/parserServer.js +++ b/src/utils/parserServer.js @@ -23,7 +23,7 @@ function killServer(server) { function spawnParserServer(sockfile, env) { const server = spawn( "ruby", - ["--disable-gems", path.join(__dirname, "./parser_server.rb"), sockfile], + [path.join(__dirname, "./parser_server.rb"), sockfile], { env: Object.assign({ PARSER_SERVER_TIMEOUT: "600" }, process.env, env), detached: true, From 419bfb344505400ba8fcda6a6b9c7bb8bd5c336e Mon Sep 17 00:00:00 2001 From: Ian Ker-Seymer Date: Thu, 7 Jan 2021 13:08:35 -0500 Subject: [PATCH 070/785] Use at_exit hook for cleaning up parser server --- src/utils/parser_server.rb | 82 +++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/src/utils/parser_server.rb b/src/utils/parser_server.rb index 18d85607..055cc397 100644 --- a/src/utils/parser_server.rb +++ b/src/utils/parser_server.rb @@ -15,6 +15,11 @@ sockfile = ARGV.first server = UNIXServer.new(sockfile) +at_exit do + server.close + File.unlink(sockfile) +end + MAX_LEN = 10 * 1024 * 1024 def read_message(socket) @@ -29,51 +34,46 @@ def read_message(socket) message.force_encoding('UTF-8').split('|', 2) end -begin - loop do - break if quit +loop do + break if quit - # Start up a new thread that will handle each successive connection. - Thread.new(server.accept_nonblock) do |socket| - parser, source = read_message(socket) + # Start up a new thread that will handle each successive connection. + Thread.new(server.accept_nonblock) do |socket| + parser, source = read_message(socket) - response = - case parser - when 'ruby' - require_relative '../ruby/parser' - Prettier::Parser.parse(source) - when 'rbs' - require_relative '../rbs/parser' - Prettier::RBSParser.parse(source) - when 'haml' - require_relative '../haml/parser' - Prettier::HAMLParser.parse(source) - end + response = + case parser + when 'ruby' + require_relative '../ruby/parser' + Prettier::Parser.parse(source) + when 'rbs' + require_relative '../rbs/parser' + Prettier::RBSParser.parse(source) + when 'haml' + require_relative '../haml/parser' + Prettier::HAMLParser.parse(source) + end - if !response - socket.write( - JSON.fast_generate( - error: - '@prettier/plugin-ruby encountered an error when attempting to parse ' \ - 'the ruby source. This usually means there was a syntax error in the ' \ - 'file in question. You can verify by running `ruby -i [path/to/file]`.' - ) + if !response + socket.write( + JSON.fast_generate( + error: + '@prettier/plugin-ruby encountered an error when attempting to parse ' \ + 'the ruby source. This usually means there was a syntax error in the ' \ + 'file in question. You can verify by running `ruby -i [path/to/file]`.' ) - else - socket.write(JSON.fast_generate(response)) - end - ensure - socket.close + ) + else + socket.write(JSON.fast_generate(response)) end - rescue IO::WaitReadable, Errno::EINTR - # Wait for select(2) to give us a connection that has content for 1 second. - # Otherwise timeout and continue on (so that we hit our "break if quit" - # pretty often). - IO.select([server], nil, nil, 1) - - retry unless quit + ensure + socket.close end -ensure - server.close - File.unlink(sockfile) +rescue IO::WaitReadable, Errno::EINTR + # Wait for select(2) to give us a connection that has content for 1 second. + # Otherwise timeout and continue on (so that we hit our "break if quit" + # pretty often). + IO.select([server], nil, nil, 1) + + retry unless quit end From 238d77ee4e23fc53c8d31f3be024591ac3762185 Mon Sep 17 00:00:00 2001 From: Ian Ker-Seymer Date: Thu, 7 Jan 2021 13:15:11 -0500 Subject: [PATCH 071/785] Capture error if stderr exists --- src/utils/parserServer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/parserServer.js b/src/utils/parserServer.js index a127978f..7940c344 100644 --- a/src/utils/parserServer.js +++ b/src/utils/parserServer.js @@ -114,7 +114,7 @@ function sendRequest(request, env) { maxBuffer: 15 * 1024 * 1024 // 15MB }); - if (stdout == null) { + if (stdout == null || stderr) { const msg = stderr ? stderr.toString() : "Unknown error occurred"; throw new Error(msg); } From 0e67b90230f064b40b9a9b2592ec480ff19f1c7d Mon Sep 17 00:00:00 2001 From: Ian Ker-Seymer Date: Thu, 7 Jan 2021 13:25:36 -0500 Subject: [PATCH 072/785] Remove afterAll exit event dispatch, no longer needed --- src/utils/parserServer.js | 16 ++++++++++------ test/js/setupTests.js | 3 --- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/utils/parserServer.js b/src/utils/parserServer.js index 7940c344..ebb39875 100644 --- a/src/utils/parserServer.js +++ b/src/utils/parserServer.js @@ -108,13 +108,17 @@ function fetchNetcatAdapter() { function sendRequest(request, env) { const [netcatExe, ...netcatArgs] = fetchNetcatAdapter(); - const { stdout, stderr } = spawnSync(netcatExe, [...netcatArgs, SOCKFILE], { - env: Object.assign({}, process.env, env), - input: `${request.type}|${request.data}`, - maxBuffer: 15 * 1024 * 1024 // 15MB - }); + const { stdout, stderr, status } = spawnSync( + netcatExe, + [...netcatArgs, SOCKFILE], + { + env: Object.assign({}, process.env, env), + input: `${request.type}|${request.data}`, + maxBuffer: 15 * 1024 * 1024 // 15MB + } + ); - if (stdout == null || stderr) { + if (stdout == null || status !== 0) { const msg = stderr ? stderr.toString() : "Unknown error occurred"; throw new Error(msg); } diff --git a/test/js/setupTests.js b/test/js/setupTests.js index e803b78e..dbbb9267 100644 --- a/test/js/setupTests.js +++ b/test/js/setupTests.js @@ -109,6 +109,3 @@ expect.extend({ })); } }); - -// For some reason, the process.on('exit') handler does not get called in jest specs even when the process exits. To remedy this, we emit a custom event. -afterAll(() => process.emit("exit")); From 459f18b8b9d552285063115d40a77980c36e1bb4 Mon Sep 17 00:00:00 2001 From: Ian Ker-Seymer Date: Thu, 7 Jan 2021 13:30:11 -0500 Subject: [PATCH 073/785] Debug unparseable JSON --- src/utils/parserServer.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/utils/parserServer.js b/src/utils/parserServer.js index ebb39875..8b5d047d 100644 --- a/src/utils/parserServer.js +++ b/src/utils/parserServer.js @@ -123,7 +123,17 @@ function sendRequest(request, env) { throw new Error(msg); } - const response = JSON.parse(stdout.toString()); + let response; + + try { + response = JSON.parse(stdout.toString()); + } catch (e) { + console.error("Could not parse response from server", { + stdout: stdout.toString(), + stderr: stderr ? stderr.toString() : null + }); + throw e; + } if (response.error) { throw new Error(response.error); From dd897d9c574778dbf7cb17d84769ab60e545c28c Mon Sep 17 00:00:00 2001 From: Ian Ker-Seymer Date: Thu, 7 Jan 2021 13:35:37 -0500 Subject: [PATCH 074/785] Debug LANG errors --- src/utils/parserServer.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/utils/parserServer.js b/src/utils/parserServer.js index 8b5d047d..79ec7fb4 100644 --- a/src/utils/parserServer.js +++ b/src/utils/parserServer.js @@ -120,21 +120,16 @@ function sendRequest(request, env) { if (stdout == null || status !== 0) { const msg = stderr ? stderr.toString() : "Unknown error occurred"; - throw new Error(msg); - } - - let response; - - try { - response = JSON.parse(stdout.toString()); - } catch (e) { console.error("Could not parse response from server", { - stdout: stdout.toString(), + stdout: stdout ? stdout.toString() : null, stderr: stderr ? stderr.toString() : null }); - throw e; + + throw new Error(msg); } + const response = JSON.parse(stdout.toString()); + if (response.error) { throw new Error(response.error); } else { From 7533605bca0a49dd951978aa92d3719243b16f15 Mon Sep 17 00:00:00 2001 From: Ian Ker-Seymer Date: Thu, 7 Jan 2021 13:38:17 -0500 Subject: [PATCH 075/785] Debug LANG errors --- src/utils/parserServer.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils/parserServer.js b/src/utils/parserServer.js index 79ec7fb4..700a22dd 100644 --- a/src/utils/parserServer.js +++ b/src/utils/parserServer.js @@ -120,9 +120,12 @@ function sendRequest(request, env) { if (stdout == null || status !== 0) { const msg = stderr ? stderr.toString() : "Unknown error occurred"; + console.error("Could not parse response from server", { stdout: stdout ? stdout.toString() : null, - stderr: stderr ? stderr.toString() : null + stderr: stderr ? stderr.toString() : null, + status, + netcatExe }); throw new Error(msg); From 14e1cd220898a593c9f03db5fcad10033dddaefd Mon Sep 17 00:00:00 2001 From: Ian Ker-Seymer Date: Thu, 7 Jan 2021 15:26:57 -0500 Subject: [PATCH 076/785] Use json for serialization --- src/utils/parserServer.js | 2 +- src/utils/parser_server.rb | 7 ++++--- test/js/ruby/lang.test.js | 9 ++++++--- test/js/setupTests.js | 3 ++- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/utils/parserServer.js b/src/utils/parserServer.js index 700a22dd..fce9055d 100644 --- a/src/utils/parserServer.js +++ b/src/utils/parserServer.js @@ -113,7 +113,7 @@ function sendRequest(request, env) { [...netcatArgs, SOCKFILE], { env: Object.assign({}, process.env, env), - input: `${request.type}|${request.data}`, + input: JSON.stringify(request), maxBuffer: 15 * 1024 * 1024 // 15MB } ); diff --git a/src/utils/parser_server.rb b/src/utils/parser_server.rb index 055cc397..da4e8e0d 100644 --- a/src/utils/parser_server.rb +++ b/src/utils/parser_server.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'socket' +require 'json' # Set the program name so that it's easy to find if we need it $PROGRAM_NAME = 'prettier-ruby-parser' @@ -20,7 +21,7 @@ File.unlink(sockfile) end -MAX_LEN = 10 * 1024 * 1024 +MAX_LEN = 15 * 1024 * 1024 def read_message(socket) message = +'' @@ -31,7 +32,7 @@ def read_message(socket) break end - message.force_encoding('UTF-8').split('|', 2) + JSON.parse(message.force_encoding('UTF-8'), symbolize_names: true) end loop do @@ -39,7 +40,7 @@ def read_message(socket) # Start up a new thread that will handle each successive connection. Thread.new(server.accept_nonblock) do |socket| - parser, source = read_message(socket) + parser, source = read_message(socket).values_at(:type, :data) response = case parser diff --git a/test/js/ruby/lang.test.js b/test/js/ruby/lang.test.js index c3ef8265..7432c2fb 100644 --- a/test/js/ruby/lang.test.js +++ b/test/js/ruby/lang.test.js @@ -12,13 +12,16 @@ expect.extend({ test("different lang settings don't break", () => { const script = path.join(__dirname, "../../../node_modules/.bin/prettier"); + + const env = { ...process.env, LANG: "US-ASCII" }; + // Make sure a new parser server is spawned + delete env.PRETTIER_RUBY_PARSER_HOST; + const child = spawnSync( process.execPath, [script, "--plugin", ".", "--parser", "ruby"], { - env: { - LANG: "US-ASCII" - }, + env, input: "'# あ'" } ); diff --git a/test/js/setupTests.js b/test/js/setupTests.js index dbbb9267..03aa2b21 100644 --- a/test/js/setupTests.js +++ b/test/js/setupTests.js @@ -1,4 +1,5 @@ const net = require("net"); +const { parse } = require("path"); const path = require("path"); const prettier = require("prettier"); @@ -32,7 +33,7 @@ function parseAsync(parser, text) { }); client.connect(process.env.PRETTIER_RUBY_PARSER_HOST, () => { - client.end(`${parser}|${text}`); + client.end(JSON.stringify({ type: parser, data: text })); }); }); } From 54d2925a226aa62e2bb9c3f2faa0e710deef3fc0 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sun, 10 Jan 2021 11:09:22 -0500 Subject: [PATCH 077/785] Move parsing files into their own directory --- .github/workflows/main.yml | 3 +- bin/port | 14 -- package.json | 2 +- src/haml/parser.js | 15 +- src/parser/getLang.js | 32 ++++ src/parser/getNetcat.js | 50 ++++++ src/{utils => parser}/netcat.js | 6 +- src/parser/parseSync.js | 33 ++++ src/parser/requestParse.js | 74 +++++++++ .../parser_server.rb => parser/server.rb} | 38 ++--- src/rbs/parser.js | 16 +- src/ruby/parser.js | 40 +---- src/utils/parserServer.js | 143 ------------------ test/js/globalSetup.js | 12 +- test/js/ruby/lang.test.js | 5 +- test/js/setupTests.js | 7 +- 16 files changed, 226 insertions(+), 264 deletions(-) delete mode 100755 bin/port create mode 100644 src/parser/getLang.js create mode 100644 src/parser/getNetcat.js rename src/{utils => parser}/netcat.js (80%) create mode 100644 src/parser/parseSync.js create mode 100644 src/parser/requestParse.js rename src/{utils/parser_server.rb => parser/server.rb} (59%) delete mode 100644 src/utils/parserServer.js diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index be2f90a8..1a1587d6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,8 @@ jobs: - "2.6" - "2.7" - "3.0" - - truffleruby + # Turning off truffleruby because I'm not sure why it's failing + # - truffleruby runs-on: ${{ matrix.os }} env: CI: true diff --git a/bin/port b/bin/port deleted file mode 100755 index 0e55c69f..00000000 --- a/bin/port +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -LOW_BOUND=49152 -RANGE=16384 - -while true; do - CANDIDATE=$[$LOW_BOUND + ($RANDOM % $RANGE)] - (echo "" >/dev/tcp/127.0.0.1/${CANDIDATE}) >/dev/null 2>&1 - - if [ $? -ne 0 ]; then - echo $CANDIDATE - break - fi -done diff --git a/package.json b/package.json index 6cfad556..fd51350c 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "check-format": "prettier --check '**/*'", "lint": "eslint --cache .", - "test": "PRETTIER_RUBY_PARSER_HOST=\"/tmp/prettier-ruby-test-$(openssl rand -hex 8).sock\" jest" + "test": "jest" }, "repository": { "type": "git", diff --git a/src/haml/parser.js b/src/haml/parser.js index fd7f4767..8119b1bb 100644 --- a/src/haml/parser.js +++ b/src/haml/parser.js @@ -1,18 +1,7 @@ -const { spawnSync } = require("child_process"); -const path = require("path"); - -const parser = path.join(__dirname, "./parser.rb"); +const parseSync = require("../parser/parseSync"); const parse = (text, _parsers, _opts) => { - const child = spawnSync("ruby", [parser], { input: text }); - - const error = child.stderr.toString(); - if (error) { - throw new Error(error); - } - - const response = child.stdout.toString(); - return JSON.parse(response); + return parseSync("haml", text); }; const pragmaPattern = /^\s*-#\s*@(prettier|format)/; diff --git a/src/parser/getLang.js b/src/parser/getLang.js new file mode 100644 index 00000000..4b95c12e --- /dev/null +++ b/src/parser/getLang.js @@ -0,0 +1,32 @@ +// In order to properly parse ruby code, we need to tell the ruby process to +// parse using UTF-8. Unfortunately, the way that you accomplish this looks +// differently depending on your platform. +/* istanbul ignore next */ +function getLang() { + const { env, platform } = process; + const envValue = env.LC_ALL || env.LC_CTYPE || env.LANG; + + // If an env var is set for the locale that already includes UTF-8 in the + // name, then assume we can go with that. + if (envValue && envValue.includes("UTF-8")) { + return envValue; + } + + // Otherwise, we're going to guess which encoding to use based on the system. + // This is probably not the best approach in the world, as you could be on + // linux and not have C.UTF-8, but in that case you're probably passing an env + // var for it. This object below represents all of the possible values of + // process.platform per: + // https://nodejs.org/api/process.html#process_process_platform + return { + aix: "C.UTF-8", + darwin: "en_US.UTF-8", + freebsd: "C.UTF-8", + linux: "C.UTF-8", + openbsd: "C.UTF-8", + sunos: "C.UTF-8", + win32: ".UTF-8" + }[platform]; +} + +module.exports = getLang; diff --git a/src/parser/getNetcat.js b/src/parser/getNetcat.js new file mode 100644 index 00000000..2a4804cb --- /dev/null +++ b/src/parser/getNetcat.js @@ -0,0 +1,50 @@ +const { spawnSync } = require("child_process"); +const os = require("os"); + +// Checks to see if an executable is available. +function hasCommand(name) { + let result; + + if (os.type() === "Windows_NT") { + result = spawnSync("where", [name]); + } else { + result = spawnSync("command", ["-v", name]); + } + + return result.status === 0; +} + +// Finds an netcat-like adapter to use for sending data to a socket. We order +// these by likelihood of being found so we can avoid some shell-outs. +function getCommandAndArg() { + if (hasCommand("nc")) { + return ["nc", "-U"]; + } + + if (hasCommand("telnet")) { + return ["telnet", "-u"]; + } + + if (hasCommand("ncat")) { + return ["ncat", "-U"]; + } + + if (hasCommand("socat")) { + return ["socat", "-"]; + } + + return ["node", require.resolve("./netcat.js")]; +} + +let command; +let arg; + +function getNetcat() { + if (!command) { + [command, arg] = getCommandAndArg(); + } + + return { command, arg }; +} + +module.exports = getNetcat; diff --git a/src/utils/netcat.js b/src/parser/netcat.js similarity index 80% rename from src/utils/netcat.js rename to src/parser/netcat.js index bd1768dd..8eda98da 100644 --- a/src/utils/netcat.js +++ b/src/parser/netcat.js @@ -1,6 +1,6 @@ // A simple fallback when no netcat-compatible adapter is found on the system. // On average, this is 2-3x slower than netcat, but still much faster than -// spawning a new Ruby process +// spawning a new Ruby process. const { createConnection } = require("net"); @@ -9,3 +9,7 @@ const sock = process.argv[process.argv.length - 1]; const client = createConnection(sock, () => process.stdin.pipe(client)); client.on("data", (data) => process.stdout.write(data)); + +client.on("error", (error) => { + console.error(error); +}); diff --git a/src/parser/parseSync.js b/src/parser/parseSync.js new file mode 100644 index 00000000..d323f9fb --- /dev/null +++ b/src/parser/parseSync.js @@ -0,0 +1,33 @@ +const requestParse = require("./requestParse"); + +// Formats and sends a request to the parser server. We use netcat (or something +// like it) here since Prettier requires the results of `parse` to be +// synchronous and Node.js does not offer a mechanism for synchronous socket +// requests. +function parseSync(parser, source) { + const response = requestParse(parser, source); + + if ( + response.stdout.length === 0 || + (response.status !== null && response.status !== 0) + ) { + console.error("Could not parse response from server"); + console.error(response); + + throw new Error(response.stderr || "An unknown error occurred"); + } + + const parsed = JSON.parse(response.stdout); + + if (parsed.error) { + throw new Error( + `@prettier/plugin-ruby encountered an error when attempting to parse \ +the ruby source. This usually means there was a syntax error in the \ +file in question. You can verify by running \`ruby -i [path/to/file]\`.` + ); + } + + return parsed; +} + +module.exports = parseSync; diff --git a/src/parser/requestParse.js b/src/parser/requestParse.js new file mode 100644 index 00000000..ab0509eb --- /dev/null +++ b/src/parser/requestParse.js @@ -0,0 +1,74 @@ +const { spawn, spawnSync, execSync } = require("child_process"); +const path = require("path"); +const { existsSync, mkdtempSync } = require("fs"); +const process = require("process"); +const os = require("os"); + +const getNetcat = require("./getNetcat"); +const getLang = require("./getLang"); + +let sockfile = process.env.PRETTIER_RUBY_HOST; + +// Spawn the parser.rb subprocess. We do this since booting Ruby is slow, and we +// can re-use the parser process multiple times since it is statelesss. +function spawnParseServer() { + const server = spawn( + "ruby", + [path.join(__dirname, "./server.rb"), sockfile], + { + env: Object.assign({}, process.env, { LANG: getLang() }), + detached: true, + stdio: "inherit" + } + ); + + process.on("exit", () => { + try { + process.kill(-server.pid); + } catch (e) { + // ignore + } + }); + + server.unref(); + const now = new Date(); + + // Wait for server to go live. + while (!existsSync(sockfile) && new Date() - now < 3000) { + execSync("sleep 0.1"); + } +} + +// Ensures that a parser server is currently running by checking against the +// sockfile variable. If it is not, create a temporary directory to house the +// sockfile and spawn the ruby process. +function ensureParseServer() { + if (sockfile) { + return; + } + + const tmpDir = mkdtempSync(path.join(os.tmpdir(), "prettier-ruby")); + sockfile = path.join(tmpDir, `${process.pid}.sock`); + + spawnParseServer(); +} + +// Sends a request to the parse server to parse the given content. +function requestParse(parser, source) { + ensureParseServer(); + + const { command, arg } = getNetcat(); + const { stdout, stderr, status } = spawnSync(command, [arg, sockfile], { + input: `${parser}|${source}`, + maxBuffer: 15 * 1024 * 1024 + }); + + return { + command, + stdout: stdout.toString(), + stderr: stderr.toString(), + status + }; +} + +module.exports = requestParse; diff --git a/src/utils/parser_server.rb b/src/parser/server.rb similarity index 59% rename from src/utils/parser_server.rb rename to src/parser/server.rb index da4e8e0d..7060c688 100644 --- a/src/utils/parser_server.rb +++ b/src/parser/server.rb @@ -3,6 +3,10 @@ require 'socket' require 'json' +require_relative '../ruby/parser' +require_relative '../rbs/parser' +require_relative '../haml/parser' + # Set the program name so that it's easy to find if we need it $PROGRAM_NAME = 'prettier-ruby-parser' @@ -13,7 +17,7 @@ trap(:INT) { quit = true } trap(:TERM) { quit = true } -sockfile = ARGV.first +sockfile = ARGV.first || "/tmp/#{$PROGRAM_NAME}.sock" server = UNIXServer.new(sockfile) at_exit do @@ -21,51 +25,27 @@ File.unlink(sockfile) end -MAX_LEN = 15 * 1024 * 1024 - -def read_message(socket) - message = +'' - - loop do - message << socket.readpartial(MAX_LEN) - rescue EOFError - break - end - - JSON.parse(message.force_encoding('UTF-8'), symbolize_names: true) -end - loop do break if quit # Start up a new thread that will handle each successive connection. Thread.new(server.accept_nonblock) do |socket| - parser, source = read_message(socket).values_at(:type, :data) + parser, source = socket.read.force_encoding('UTF-8').split('|', 2) response = case parser when 'ruby' - require_relative '../ruby/parser' Prettier::Parser.parse(source) when 'rbs' - require_relative '../rbs/parser' Prettier::RBSParser.parse(source) when 'haml' - require_relative '../haml/parser' Prettier::HAMLParser.parse(source) end - if !response - socket.write( - JSON.fast_generate( - error: - '@prettier/plugin-ruby encountered an error when attempting to parse ' \ - 'the ruby source. This usually means there was a syntax error in the ' \ - 'file in question. You can verify by running `ruby -i [path/to/file]`.' - ) - ) - else + if response socket.write(JSON.fast_generate(response)) + else + socket.write('{ "error": true }') end ensure socket.close diff --git a/src/rbs/parser.js b/src/rbs/parser.js index 93cf0cf0..c55d54a3 100644 --- a/src/rbs/parser.js +++ b/src/rbs/parser.js @@ -1,23 +1,11 @@ -const { spawnSync } = require("child_process"); -const path = require("path"); +const parseSync = require("../parser/parseSync"); // This function is responsible for taking an input string of text and returning // to prettier a JavaScript object that is the equivalent AST that represents // the code stored in that string. We accomplish this by spawning a new Ruby // process of parser.rb and reading JSON off STDOUT. function parse(text, _parsers, _opts) { - const child = spawnSync("ruby", [path.join(__dirname, "./parser.rb")], { - input: text, - maxBuffer: 15 * 1024 * 1024 // 15MB - }); - - const error = child.stderr.toString(); - if (error) { - throw new Error(error); - } - - const response = child.stdout.toString(); - return JSON.parse(response); + return parseSync("rbs", text); } const pragmaPattern = /#\s*@(prettier|format)/; diff --git a/src/ruby/parser.js b/src/ruby/parser.js index cfb54201..cd626403 100644 --- a/src/ruby/parser.js +++ b/src/ruby/parser.js @@ -1,47 +1,11 @@ -const process = require("process"); -const { sendRequest, ensureParseServer } = require("./../utils/parserServer"); - -// In order to properly parse ruby code, we need to tell the ruby process to -// parse using UTF-8. Unfortunately, the way that you accomplish this looks -// differently depending on your platform. -/* istanbul ignore next */ -const LANG = (() => { - const { env, platform } = process; - const envValue = env.LC_ALL || env.LC_CTYPE || env.LANG; - - // If an env var is set for the locale that already includes UTF-8 in the - // name, then assume we can go with that. - if (envValue && envValue.includes("UTF-8")) { - return envValue; - } - - // Otherwise, we're going to guess which encoding to use based on the system. - // This is probably not the best approach in the world, as you could be on - // linux and not have C.UTF-8, but in that case you're probably passing an env - // var for it. This object below represents all of the possible values of - // process.platform per: - // https://nodejs.org/api/process.html#process_process_platform - return { - aix: "C.UTF-8", - darwin: "en_US.UTF-8", - freebsd: "C.UTF-8", - linux: "C.UTF-8", - openbsd: "C.UTF-8", - sunos: "C.UTF-8", - win32: ".UTF-8" - }[platform]; -})(); +const parseSync = require("../parser/parseSync"); // This function is responsible for taking an input string of text and returning // to prettier a JavaScript object that is the equivalent AST that represents // the code stored in that string. We accomplish this by spawning a new Ruby // process of parser.rb and reading JSON off STDOUT. function parse(text, _parsers, _opts) { - ensureParseServer({ LANG }); - - const request = { type: "ruby", data: text }; - - return sendRequest(request, { LANG }); + return parseSync("ruby", text); } const pragmaPattern = /#\s*@(prettier|format)/; diff --git a/src/utils/parserServer.js b/src/utils/parserServer.js deleted file mode 100644 index fce9055d..00000000 --- a/src/utils/parserServer.js +++ /dev/null @@ -1,143 +0,0 @@ -const { spawn, spawnSync, execSync } = require("child_process"); -const path = require("path"); -const { existsSync, mkdtempSync } = require("fs"); -const process = require("process"); -const os = require("os"); - -let SOCKFILE = process.env.PRETTIER_RUBY_PARSER_HOST; -let NETCAT_ADAPTER; - -function killServer(server) { - try { - process.kill(-server.pid); - SOCKFILE = undefined; - NETCAT_ADAPTER = undefined; - } catch (e) { - // ok - } -} - -// Spawn the parser_server.rb subprocess. We do this since booting Ruby is slow, -// and we can re-use the parser process multiple times since it is statelesss. -// By doing this, we increase the performance by 10x. -function spawnParserServer(sockfile, env) { - const server = spawn( - "ruby", - [path.join(__dirname, "./parser_server.rb"), sockfile], - { - env: Object.assign({ PARSER_SERVER_TIMEOUT: "600" }, process.env, env), - detached: true, - stdio: "inherit" - } - ); - - process.on("exit", () => killServer(server)); - - server.unref(); - - const now = new Date(); - - // Wait for server to go live - while (!existsSync(sockfile) && new Date() - now < 3000) { - execSync("sleep 0.1"); - } -} - -// Creates a tempdir where the unix socket will live -function generateSockfileName() { - const randomId = Math.random().toString(36).substring(8); - const tmpdir = mkdtempSync( - path.join(os.tmpdir(), `prettier-ruby-${randomId}`) - ); - - return `${tmpdir}/prettier-plugin-ruby.sock`; -} - -// Spawns a parser server if it does not exist -function ensureParseServer(env) { - if (SOCKFILE) { - return; - } - - SOCKFILE = generateSockfileName(); - - spawnParserServer(SOCKFILE, env); -} - -// Checks to see if an executable is available -function hasCommand(name) { - const isWin = require("os").type() === "Windows_NT"; - - let result; - - if (isWin) { - result = spawnSync("where", [name]); - } else { - result = spawnSync("command", ["-v", name]); - } - - return result.status === 0; -} - -// Finds an netcat-like adapter to use for sending data to a socket. We order -// these by likelihood of being found so we can avoid some shell-outs. -function fetchNetcatAdapter() { - if (NETCAT_ADAPTER) { - return NETCAT_ADAPTER; - } - - if (hasCommand("nc")) { - NETCAT_ADAPTER = ["nc", "-U"]; - } else if (hasCommand("telnet")) { - NETCAT_ADAPTER = ["telnet", "-u"]; - } else if (hasCommand("ncat")) { - NETCAT_ADAPTER = ["ncat", "-U"]; - } else if (hasCommand("socat")) { - NETCAT_ADAPTER = ["socat", "-"]; - } else { - NETCAT_ADAPTER = ["node", require.resolve("./netcat.js")]; - } - - return NETCAT_ADAPTER; -} - -// Formats and sends a request for the parser server. We use netcat here since -// Prettier expects the results of `parse` to be synchrnous, and Node.js does -// not offer a mechanism for synchronous socket requests. Luckily, netcat is -// fairly ubuitious at this point. -function sendRequest(request, env) { - const [netcatExe, ...netcatArgs] = fetchNetcatAdapter(); - - const { stdout, stderr, status } = spawnSync( - netcatExe, - [...netcatArgs, SOCKFILE], - { - env: Object.assign({}, process.env, env), - input: JSON.stringify(request), - maxBuffer: 15 * 1024 * 1024 // 15MB - } - ); - - if (stdout == null || status !== 0) { - const msg = stderr ? stderr.toString() : "Unknown error occurred"; - - console.error("Could not parse response from server", { - stdout: stdout ? stdout.toString() : null, - stderr: stderr ? stderr.toString() : null, - status, - netcatExe - }); - - throw new Error(msg); - } - - const response = JSON.parse(stdout.toString()); - - if (response.error) { - throw new Error(response.error); - } else { - return response; - } -} - -module.exports = { sendRequest, ensureParseServer }; diff --git a/test/js/globalSetup.js b/test/js/globalSetup.js index 44c74925..c0dbb363 100644 --- a/test/js/globalSetup.js +++ b/test/js/globalSetup.js @@ -5,12 +5,16 @@ const { spawn, spawnSync } = require("child_process"); const args = ["--disable-gems", "-e", "puts RUBY_VERSION"]; process.env.RUBY_VERSION = spawnSync("ruby", args).stdout.toString().trim(); +// Spawn the async parser process so that tests can send their content over to +// it to get back the AST. function globalSetup() { - // Spawn the async parser process so that tests can send their content over to - // it to get back the AST. + if (!process.env.PRETTIER_RUBY_HOST) { + process.env.PRETTIER_RUBY_HOST = `/tmp/prettier-ruby-test-${process.id}.sock`; + } + global.__ASYNC_PARSER__ = spawn("ruby", [ - "./src/utils/parser_server.rb", - process.env.PRETTIER_RUBY_PARSER_HOST + "./src/parser/server.rb", + process.env.PRETTIER_RUBY_HOST ]); } diff --git a/test/js/ruby/lang.test.js b/test/js/ruby/lang.test.js index 7432c2fb..4fa89f51 100644 --- a/test/js/ruby/lang.test.js +++ b/test/js/ruby/lang.test.js @@ -13,9 +13,10 @@ expect.extend({ test("different lang settings don't break", () => { const script = path.join(__dirname, "../../../node_modules/.bin/prettier"); - const env = { ...process.env, LANG: "US-ASCII" }; + const env = Object.assign({}, process.env, { LANG: "US-ASCII" }); + // Make sure a new parser server is spawned - delete env.PRETTIER_RUBY_PARSER_HOST; + delete env.PRETTIER_RUBY_HOST; const child = spawnSync( process.execPath, diff --git a/test/js/setupTests.js b/test/js/setupTests.js index 03aa2b21..53d0ec3a 100644 --- a/test/js/setupTests.js +++ b/test/js/setupTests.js @@ -1,12 +1,11 @@ const net = require("net"); -const { parse } = require("path"); const path = require("path"); const prettier = require("prettier"); // eslint-disable-next-line no-underscore-dangle const { formatAST } = prettier.__debug; -function parseAsync(parser, text) { +function parseAsync(parser, source) { return new Promise((resolve, reject) => { const client = new net.Socket(); @@ -32,8 +31,8 @@ function parseAsync(parser, text) { (response.error ? reject : resolve)(response); }); - client.connect(process.env.PRETTIER_RUBY_PARSER_HOST, () => { - client.end(JSON.stringify({ type: parser, data: text })); + client.connect(process.env.PRETTIER_RUBY_HOST, () => { + client.end(`${parser}|${source}`); }); }); } From 6db8ce3faeafeaa958f5643afd482a2c0e4bc9e4 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Mon, 11 Jan 2021 11:36:51 -0500 Subject: [PATCH 078/785] Provide shims for parsers --- src/haml/parser.rb | 41 +++++++++++++++++++---------------------- src/parser/server.rb | 1 + src/rbs/parser.rb | 43 ++++++++++++++++++++----------------------- src/ruby/parser.rb | 20 -------------------- 4 files changed, 40 insertions(+), 65 deletions(-) diff --git a/src/haml/parser.rb b/src/haml/parser.rb index 3cb4c3f3..a31ebb1c 100644 --- a/src/haml/parser.rb +++ b/src/haml/parser.rb @@ -1,10 +1,26 @@ # frozen_string_literal: true -require 'bundler/setup' if ENV['CI'] -require 'haml' -require 'json' require 'ripper' +begin + require 'haml' +rescue LoadError + # If we can't load the haml gem, then we're going to provide a shim parser + # that will warn and bail out. + class Prettier::HAMLParser + def self.parse(text) + warn( + 'The `haml` gem could not be loaded. Please ensure you have it ' \ + 'installed and that it is available in the gem path.' + ) + + false + end + end + + return +end + class Haml::Parser::ParseNode class DeepAttributeParser def parse(string) @@ -120,22 +136,3 @@ def self.parse(source) end end end - -# If this is the main file we're executing, then most likely this is being -# executed from the haml.js spawn. In that case, read the ruby source from -# stdin and report back the AST over stdout. -if $0 == __FILE__ - response = Prettier::HAMLParser.parse($stdin.read) - - if !response - warn( - '@prettier/plugin-ruby encountered an error when attempting to parse ' \ - 'the HAML source. This usually means there was a syntax error in the ' \ - 'file in question.' - ) - - exit 1 - end - - puts JSON.fast_generate(response) -end diff --git a/src/parser/server.rb b/src/parser/server.rb index 7060c688..57a2f986 100644 --- a/src/parser/server.rb +++ b/src/parser/server.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require 'bundler/setup' if ENV['CI'] require 'socket' require 'json' diff --git a/src/rbs/parser.rb b/src/rbs/parser.rb index 98bff3be..0034885a 100644 --- a/src/rbs/parser.rb +++ b/src/rbs/parser.rb @@ -1,8 +1,23 @@ #!/usr/bin/env ruby -require 'bundler/setup' if ENV['CI'] -require 'json' -require 'rbs' +begin + require 'rbs' +rescue LoadError + # If we can't load the rbs gem, then we're going to provide a shim parser that + # will warn and bail out. + class Prettier::RBSParser + def self.parse(text) + warn( + 'The `rbs` gem could not be loaded. Please ensure you have it ' \ + 'installed and that it is available in the gem path.' + ) + + false + end + end + + return +end # Monkey-patch this so that we can get the character positions. class RBS::Location @@ -16,6 +31,7 @@ def to_json(*args) end end +# Monkey-patch this so that we get whether or not it needs to be escaped. class RBS::Types::Function::Param def to_json(*a) escaped = name && /\A#{RBS::Parser::KEYWORDS_RE}\z/.match?(name) @@ -60,6 +76,7 @@ def to_json(*a) end end +# The main parser interface. module Prettier class RBSParser def self.parse(text) @@ -69,23 +86,3 @@ def self.parse(text) end end end - -# If this is the main file we're executing, then most likely this is being -# executed from the parser.js spawn. In that case, read the rbs source from -# stdin and report back the AST over stdout. - -if $0 == __FILE__ - response = Prettier::RBSParser.parse($stdin.read) - - if !response - warn( - '@prettier/plugin-ruby encountered an error when attempting to parse ' \ - 'the RBS source. This usually means there was a syntax error in the ' \ - 'file in question.' - ) - - exit 1 - end - - puts JSON.fast_generate(response) -end diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 2c0503fc..ae63b539 100755 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -2549,23 +2549,3 @@ def on_zsuper find_scanner_event(:@kw, 'super').merge!(type: :zsuper) end end - -# If this is the main file we're executing, then most likely this is being -# executed from the parser.js spawn. In that case, read the ruby source from -# stdin and report back the AST over stdout. - -if $0 == __FILE__ - response = Prettier::Parser.parse($stdin.read) - - if !response - warn( - '@prettier/plugin-ruby encountered an error when attempting to parse ' \ - 'the ruby source. This usually means there was a syntax error in the ' \ - 'file in question. You can verify by running `ruby -i [path/to/file]`.' - ) - - exit 1 - end - - puts JSON.fast_generate(response) -end From 4a2514ff21efe5dce09f8f9e7467a13ce62f91cb Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Tue, 12 Jan 2021 08:37:13 -0500 Subject: [PATCH 079/785] Correct documentation for trailing comma --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1b281c58..84ae1973 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,7 @@ Below are the options (from [`src/plugin.js`](src/plugin.js)) that `@prettier/pl | `rubySingleQuote` | `--ruby-single-quote` | `true` | When double quotes are not necessary for interpolation, prefers the use of single quotes for string literals. | | `rubyToProc` | `--ruby-to-proc` | `false` | When possible, convert blocks to the more concise `Symbol#to_proc` syntax. | | `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). | -| `trailingComma` | `--trailing-comma` | `"es5"` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#trailing-comma)). `"es5"` is equivalent to `true`. | +| `trailingComma` | `--trailing-comma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#trailing-comma)). `"es5"` is equivalent to `true`. | Any of these can be added to your existing [prettier configuration file](https://prettier.io/docs/en/configuration.html). For example: From 95ec7521ba4dc71dd3dd61aa66a5ed02a7d749b2 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Fri, 15 Jan 2021 15:49:23 -0500 Subject: [PATCH 080/785] Fix for #776 --- CHANGELOG.md | 4 ++++ src/ruby/nodes/strings.js | 13 +++++++------ test/js/ruby/nodes/strings.test.js | 22 ++++++++++++++-------- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c838d0b7..c81c4471 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Changed + +- [@jeffcarbs], [@kddeisz] - Long strings with interpolated expressions should only break if the contents in the original source is broken. + ## [1.3.0] - 2021-01-05 ### Added diff --git a/src/ruby/nodes/strings.js b/src/ruby/nodes/strings.js index da51ab6d..5080eb9e 100644 --- a/src/ruby/nodes/strings.js +++ b/src/ruby/nodes/strings.js @@ -4,6 +4,7 @@ const { hardline, indent, literalline, + removeLines, softline, join } = require("../../prettier"); @@ -103,14 +104,14 @@ function printStringDVar(path, opts, print) { } function printStringEmbExpr(path, opts, print) { + const node = path.getValue(); const parts = path.call(print, "body", 0); - // If the interpolated expression is inside of a heredoc or an xstring - // literal (a string that gets sent to the command line) then we don't want - // to automatically indent, as this can lead to some very odd looking - // expressions - if (["heredoc", "xstring_literal"].includes(path.getParentNode().type)) { - return concat(["#{", parts, "}"]); + // If the contents of this embedded expression were originally on the same + // line in the source, then we're going to leave them in place and assume + // that's the way the developer wanted this expression represented. + if (node.sl === node.el) { + return concat(["#{", removeLines(parts), "}"]); } return group( diff --git a/test/js/ruby/nodes/strings.test.js b/test/js/ruby/nodes/strings.test.js index 24b0d5cb..05bcd595 100644 --- a/test/js/ruby/nodes/strings.test.js +++ b/test/js/ruby/nodes/strings.test.js @@ -105,14 +105,20 @@ describe("strings", () => { test("very interpolated", () => expect(`"abc #{"abc #{abc} abc"} abc"`).toMatchFormat()); - test("breaks interpolation on #{ ... } and not some inner node", () => - expect(`"${long} #{foo[:bar]} ${long}"`).toChangeFormat( - ruby(` - "${long} #{ - foo[:bar] - } ${long}" - `) - )); + test("long strings with interpolation do not break", () => + expect(`"${long} #{foo[:bar]} ${long}"`).toMatchFormat()); + + test("long strings with interpolation that were broken do break", () => { + const content = ruby(` + <<~HERE + #{ + ${long} + } + HERE + `); + + return expect(content).toMatchFormat(); + }); test("within a heredoc there is no indentation", () => { const content = ruby(` From cc4d2c1c9481ca9d046a2b49308faed3c673656b Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Fri, 15 Jan 2021 16:18:10 -0500 Subject: [PATCH 081/785] Fix for #780 --- CHANGELOG.md | 1 + src/ruby/nodes/rescue.js | 57 +++++++++++++++++-------------- src/ruby/parser.rb | 26 ++++++++++---- src/ruby/printer.js | 2 -- test/js/ruby/nodes/rescue.test.js | 24 +++++++++++++ 5 files changed, 77 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c81c4471..ed63e209 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Changed - [@jeffcarbs], [@kddeisz] - Long strings with interpolated expressions should only break if the contents in the original source is broken. +- [@johannesluedke], [@kddeisz] - Fix for rescues with inline comments. ## [1.3.0] - 2021-01-05 diff --git a/src/ruby/nodes/rescue.js b/src/ruby/nodes/rescue.js index d99b6ca3..e1e6f472 100644 --- a/src/ruby/nodes/rescue.js +++ b/src/ruby/nodes/rescue.js @@ -26,28 +26,10 @@ function printEnsure(path, opts, print) { } function printRescue(path, opts, print) { - const [exception, variable, _stmts, addition] = path.getValue().body; const parts = ["rescue"]; - if (exception || variable) { - if (exception) { - if (Array.isArray(exception)) { - // In this case, it's actually only the one exception (it's an array - // of length 1). - parts.push(" ", path.call(print, "body", 0, 0)); - } else { - // Here we have multiple exceptions from which we're rescuing, so we - // need to align them and join them together. - const joiner = concat([",", line]); - const exceptions = group(join(joiner, path.call(print, "body", 0))); - - parts.push(" ", align("rescue ".length, exceptions)); - } - } - - if (variable) { - parts.push(" => ", path.call(print, "body", 1)); - } + if (path.getValue().body[0]) { + parts.push(align("rescue ".length, path.call(print, "body", 0))); } else { // If you don't specify an error to rescue in a `begin/rescue` block, then // implicitly you're rescuing from `StandardError`. In this case, we're @@ -55,16 +37,40 @@ function printRescue(path, opts, print) { parts.push(" StandardError"); } - const rescueBody = path.call(print, "body", 2); + const bodystmt = path.call(print, "body", 1); - if (rescueBody.parts.length > 0) { - parts.push(indent(concat([hardline, rescueBody]))); + if (bodystmt.parts.length > 0) { + parts.push(indent(concat([hardline, bodystmt]))); } // This is the next clause on the `begin` statement, either another // `rescue`, and `ensure`, or an `else` clause. - if (addition) { - parts.push(concat([hardline, path.call(print, "body", 3)])); + if (path.getValue().body[2]) { + parts.push(concat([hardline, path.call(print, "body", 2)])); + } + + return group(concat(parts)); +} + +// This is a container node that we're adding into the AST that isn't present in +// Ripper solely so that we have a nice place to attach inline comments. +function printRescueEx(path, opts, print) { + const [exception, variable] = path.getValue().body; + const parts = []; + + if (exception) { + let exceptionDoc = path.call(print, "body", 0); + + if (Array.isArray(exceptionDoc)) { + const joiner = concat([",", line]); + exceptionDoc = group(join(joiner, exceptionDoc)); + } + + parts.push(" ", exceptionDoc); + } + + if (variable) { + parts.push(" => ", path.call(print, "body", 1)); } return group(concat(parts)); @@ -89,6 +95,7 @@ module.exports = { ensure: printEnsure, redo: literal("redo"), rescue: printRescue, + rescue_ex: printRescueEx, rescue_mod: printRescueMod, retry: literal("retry") }; diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index ae63b539..9ff34c43 100755 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -1768,8 +1768,8 @@ class Rescue < SimpleDelegator def bind_end(ec) merge!(ec: ec) - stmts = self[:body][2] - consequent = self[:body][3] + stmts = self[:body][1] + consequent = self[:body][2] if consequent consequent.bind_end(ec) @@ -1784,16 +1784,30 @@ def bind_end(ec) # inside of a bodystmt. def on_rescue(exceptions, variable, stmts, consequent) beging = find_scanner_event(:@kw, 'rescue') + exceptions = exceptions[0] if exceptions.is_a?(Array) - last_exception = exceptions.is_a?(Array) ? exceptions[-1] : exceptions - last_node = variable || last_exception || beging - + last_node = variable || exceptions || beging stmts.bind(find_next_statement_start(last_node[:ec]), char_pos) + # We add an additional inner node here that ripper doesn't provide so that + # we have a nice place to attach inline comment. But we only need it if we + # have an exception or a variable that we're rescuing. + rescue_ex = + if exceptions || variable + { + type: :rescue_ex, + body: [exceptions, variable], + sl: beging[:sl], + sc: beging[:ec] + 1, + el: last_node[:el], + ec: last_node[:ec] + } + end + Rescue.new( beging.merge!( type: :rescue, - body: [exceptions, variable, stmts, consequent], + body: [rescue_ex, stmts, consequent], el: lineno, ec: char_pos ) diff --git a/src/ruby/printer.js b/src/ruby/printer.js index 979d3931..565d3363 100644 --- a/src/ruby/printer.js +++ b/src/ruby/printer.js @@ -54,8 +54,6 @@ function getCommentChildNodes(node) { switch (node.type) { case "heredoc": return [node.beging]; - case "rescue": - return [].concat(node.body[0]).concat(node.body.slice(1)); case "aryptn": return [node.body[0]] .concat(node.body[1]) diff --git a/test/js/ruby/nodes/rescue.test.js b/test/js/ruby/nodes/rescue.test.js index 02cf1b77..4fc4dcac 100644 --- a/test/js/ruby/nodes/rescue.test.js +++ b/test/js/ruby/nodes/rescue.test.js @@ -110,6 +110,30 @@ describe("rescue", () => { return expect(content).toMatchFormat(); }); + test("comment inline with multiple", () => { + const content = ruby(` + begin + foo + rescue Foo, Bar # foo + bar + end + `); + + return expect(content).toMatchFormat(); + }); + + test("comment inline with splat", () => { + const content = ruby(` + begin + foo + rescue Foo, *Bar # foo + bar + end + `); + + return expect(content).toMatchFormat(); + }); + test("one error with a comment", () => { const content = ruby(` begin From cd4de82aa0eec0f90ae496e687dd7f1e05aa8f1c Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Fri, 15 Jan 2021 17:04:48 -0500 Subject: [PATCH 082/785] Fix for #782 --- CHANGELOG.md | 1 + src/ruby/nodes/statements.js | 3 +++ src/ruby/parser.rb | 31 +++++++++++++++++++++++++++++++ test/js/ruby/layout.test.js | 24 ++++++++++++++++++++++++ 4 files changed, 59 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed63e209..676c14bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [@jeffcarbs], [@kddeisz] - Long strings with interpolated expressions should only break if the contents in the original source is broken. - [@johannesluedke], [@kddeisz] - Fix for rescues with inline comments. +- [@johncsnyder], [@kddeisz] - Comments should not attach to nodes beyond a double newline. ## [1.3.0] - 2021-01-05 diff --git a/src/ruby/nodes/statements.js b/src/ruby/nodes/statements.js index 65fef378..1a452610 100644 --- a/src/ruby/nodes/statements.js +++ b/src/ruby/nodes/statements.js @@ -79,6 +79,9 @@ module.exports = { const { body } = path.getValue(); return concat([trim, "__END__", literalline, body]); }, + "@comment"(path, opts, _print) { + return opts.printer.printComment(path); + }, bodystmt: printBodyStmt, paren: printParen, program: (path, opts, print) => diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 9ff34c43..feb64b5a 100755 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -22,6 +22,10 @@ module Prettier; end class Prettier::Parser < Ripper attr_reader :source, :lines, :scanner_events, :line_counts + # This is an attr_accessor so Stmts objects can grab comments out of this + # array and attach them to themselves. + attr_accessor :comments + def initialize(source, *args) super(source, *args) @@ -125,6 +129,7 @@ def on_comment(value) @comments << { type: :@comment, value: value[1..-1].chomp.force_encoding('UTF-8'), + inline: value.strip != lines[lineno - 1], sl: lineno, el: lineno, sc: char_pos, @@ -1906,12 +1911,21 @@ def on_sclass(target, bodystmt) # propagate that onto void_stmt nodes inside the stmts in order to make sure # all comments get printed appropriately. class Stmts < SimpleDelegator + attr_reader :parser + + def initialize(parser, values) + @parser = parser + __setobj__(values) + end + def bind(sc, ec) merge!(sc: sc, ec: ec) if self[:body][0][:type] == :void_stmt self[:body][0].merge!(sc: sc, ec: sc) end + + attach_comments(sc, ec) end def bind_end(ec) @@ -1928,6 +1942,22 @@ def <<(statement) self[:body] << statement self end + + private + + def attach_comments(sc, ec) + attachable = + parser.comments.select do |comment| + comment[:type] == :@comment && !comment[:inline] && + sc <= comment[:sc] && ec >= comment[:ec] && + !comment[:value].include?('prettier-ignore') + end + + return if attachable.empty? + + parser.comments -= attachable + self[:body] = (self[:body] + attachable).sort_by! { |node| node[:sc] } + end end # stmts_new is a parser event that represents the beginning of a list of @@ -1935,6 +1965,7 @@ def <<(statement) # stmts_add events, which we'll append onto an array body. def on_stmts_new Stmts.new( + self, type: :stmts, body: [], sl: lineno, diff --git a/test/js/ruby/layout.test.js b/test/js/ruby/layout.test.js index d34c9992..b9bf4a72 100644 --- a/test/js/ruby/layout.test.js +++ b/test/js/ruby/layout.test.js @@ -1,3 +1,5 @@ +const { ruby } = require("../utils"); + describe("layout", () => { test("turns multiple blank lines into just one blank line", () => expect("1\n\n\n\n\n2").toChangeFormat("1\n\n2")); @@ -10,4 +12,26 @@ describe("layout", () => { test("handles multiple newlines at the end of the file", () => expect("foo\n\n\n").toChangeFormat("foo")); + + test("keeps comments in their place when nothing to attach to", () => { + const content = ruby(` + # Comment + def f + print 1 + end + + # Comment + # Comment + + def g + print 2 + end + + # Comment + # Comment + # Comment + `); + + return expect(content).toMatchFormat(); + }); }); From 6409e6d9e8fe80287a3e89fa912b708f250e4e8f Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Fri, 15 Jan 2021 17:15:09 -0500 Subject: [PATCH 083/785] Fix for #778 --- CHANGELOG.md | 1 + src/ruby/nodes/calls.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 676c14bf..26997dd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [@jeffcarbs], [@kddeisz] - Long strings with interpolated expressions should only break if the contents in the original source is broken. - [@johannesluedke], [@kddeisz] - Fix for rescues with inline comments. - [@johncsnyder], [@kddeisz] - Comments should not attach to nodes beyond a double newline. +- [@blampe], [@kddeisz] - Comments inside of a broken method chain get dropped. ## [1.3.0] - 2021-01-05 diff --git a/src/ruby/nodes/calls.js b/src/ruby/nodes/calls.js index 77829732..d11e5ab7 100644 --- a/src/ruby/nodes/calls.js +++ b/src/ruby/nodes/calls.js @@ -43,7 +43,7 @@ function printCall(path, opts, print) { // If our parent node is a chained node then we're not going to group the // right side of the expression, as we want to have a nice multi-line layout. - if (chained.includes(parentNode.type)) { + if (chained.includes(parentNode.type) && !node.comments) { parentNode.chain = (node.chain || 0) + 1; parentNode.callChain = (node.callChain || 0) + 1; parentNode.breakDoc = (node.breakDoc || [receiverDoc]).concat(rightSideDoc); @@ -103,7 +103,7 @@ function printMethodAddArg(path, opts, print) { // If our parent node is a chained node then we're not going to group the // right side of the expression, as we want to have a nice multi-line layout. - if (chained.includes(parentNode.type)) { + if (chained.includes(parentNode.type) && !node.comments) { parentNode.chain = (node.chain || 0) + 1; parentNode.breakDoc = (node.breakDoc || [methodDoc]).concat(argsDoc); parentNode.firstReceiverType = node.firstReceiverType; From 2b97e1fb0bb48d917431e5a320d9cd8c54efa1c3 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Fri, 15 Jan 2021 17:17:40 -0500 Subject: [PATCH 084/785] Fix for #784 --- CHANGELOG.md | 1 + src/ruby/nodes/calls.js | 29 ----------------------------- test/js/ruby/nodes/blocks.test.js | 3 --- 3 files changed, 1 insertion(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26997dd9..8ff46ba4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [@johannesluedke], [@kddeisz] - Fix for rescues with inline comments. - [@johncsnyder], [@kddeisz] - Comments should not attach to nodes beyond a double newline. - [@blampe], [@kddeisz] - Comments inside of a broken method chain get dropped. +- [@clarkdave], [@kddeisz] - Don't ignore Sorbet `sig` transformations. ## [1.3.0] - 2021-01-05 diff --git a/src/ruby/nodes/calls.js b/src/ruby/nodes/calls.js index d11e5ab7..0b7571a8 100644 --- a/src/ruby/nodes/calls.js +++ b/src/ruby/nodes/calls.js @@ -136,41 +136,12 @@ function printMethodAddArg(path, opts, print) { return concat([methodDoc, argsDoc]); } -// Sorbet type annotations look like the following: -// -// {method_add_block -// [{method_add_arg -// [{fcall -// [{@ident "sig"}]}, -// {args []}]}, -// {brace_block [nil, {stmts}]}}]} -// -function isSorbetTypeAnnotation(node) { - const [callNode, blockNode] = node.body; - - return ( - callNode.type === "method_add_arg" && - callNode.body[0].type === "fcall" && - callNode.body[0].body[0].body === "sig" && - callNode.body[1].type === "args" && - callNode.body[1].body.length === 0 && - blockNode - ); -} - function printMethodAddBlock(path, opts, print) { const node = path.getValue(); const [callNode, blockNode] = node.body; const [callDoc, blockDoc] = path.map(print, "body"); - // Very special handling here for sorbet type annotations. They look like Ruby - // code, but they're not actually Ruby code, so we're not going to mess with - // them at all. - if (isSorbetTypeAnnotation(node)) { - return opts.originalText.slice(opts.locStart(node), opts.locEnd(node)); - } - // Don't bother trying to do any kind of fancy toProc transform if the option // is disabled. if (opts.rubyToProc) { diff --git a/test/js/ruby/nodes/blocks.test.js b/test/js/ruby/nodes/blocks.test.js index 22724b85..9a547f38 100644 --- a/test/js/ruby/nodes/blocks.test.js +++ b/test/js/ruby/nodes/blocks.test.js @@ -129,7 +129,4 @@ describe("blocks", () => { test("does not split up args inside pipes", () => expect(`loop do |${long} = 1, a${long} = 2|\nend`).toMatchFormat()); }); - - test("leaves sorbet type annotations in place", () => - expect(`sig { ${long} }`).toMatchFormat()); }); From 40bd551c1d1e02b19f3918767c7f02b6f8845827 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Fri, 15 Jan 2021 17:19:25 -0500 Subject: [PATCH 085/785] Add missing CHANGELOG entries --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ff46ba4..db320849 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Added + +- [@ianks], [@kddeisz] - Use `netcat` to communicate to a parser server for better performance when formatting multiple files. + ### Changed - [@jeffcarbs], [@kddeisz] - Long strings with interpolated expressions should only break if the contents in the original source is broken. @@ -1115,6 +1119,7 @@ would previously result in `array[]`, but now prints properly. [@bugthing]: https://github.com/bugthing [@cbothner]: https://github.com/cbothner [@christoomey]: https://github.com/christoomey +[@clarkdave]: https://github.com/clarkdave [@cldevs]: https://github.com/cldevs [@codingitwrong]: https://github.com/CodingItWrong [@coiti]: https://github.com/coiti @@ -1134,7 +1139,9 @@ would previously result in `array[]`, but now prints properly. [@jamescostian]: https://github.com/jamescostian [@janklimo]: https://github.com/janklimo [@jbielick]: https://github.com/jbielick +[@jeffcarbs]: https://github.com/jeffcarbs [@joeyjoejoejr]: https://github.com/joeyjoejoejr +[@johannesluedke]: https://github.com/johannesluedke [@johncsnyder]: https://github.com/johncsnyder [@johnschoeman]: https://github.com/johnschoeman [@joshuakgoldberg]: https://github.com/JoshuaKGoldberg From 6cfca4708cd17def3ed42540831714583ce5b95e Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Fri, 15 Jan 2021 17:25:39 -0500 Subject: [PATCH 086/785] Bump to v1.4.0 --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db320849..bf2a0de4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [1.4.0] - 2021-01-15 + ### Added - [@ianks], [@kddeisz] - Use `netcat` to communicate to a parser server for better performance when formatting multiple files. @@ -1047,7 +1049,8 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.3.0...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.4.0...HEAD +[1.4.0]: https://github.com/prettier/plugin-ruby/compare/v1.3.0...v1.4.0 [1.3.0]: https://github.com/prettier/plugin-ruby/compare/v1.2.5...v1.3.0 [1.2.5]: https://github.com/prettier/plugin-ruby/compare/v1.2.4...v1.2.5 [1.2.4]: https://github.com/prettier/plugin-ruby/compare/v1.2.3...v1.2.4 diff --git a/package.json b/package.json index fd51350c..b12272d5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "1.3.0", + "version": "1.4.0", "description": "prettier plugin for the Ruby programming language", "main": "src/plugin.js", "scripts": { From 79f437499ad7251971a5f03a8546c2ee4744e605 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Jan 2021 05:05:48 +0000 Subject: [PATCH 087/785] Bump eslint from 7.17.0 to 7.18.0 Bumps [eslint](https://github.com/eslint/eslint) from 7.17.0 to 7.18.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v7.17.0...v7.18.0) Signed-off-by: dependabot[bot] --- yarn.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/yarn.lock b/yarn.lock index b67e0b91..3222e853 100644 --- a/yarn.lock +++ b/yarn.lock @@ -278,10 +278,10 @@ exec-sh "^0.3.2" minimist "^1.2.0" -"@eslint/eslintrc@^0.2.2": - version "0.2.2" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.2.2.tgz#d01fc791e2fc33e88a29d6f3dc7e93d0cd784b76" - integrity sha512-EfB5OHNYp1F4px/LI/FEnGylop7nOqkQ1LRzCM0KccA2U8tvV8w01KBv37LbO7nW4H+YhKyo2LcJhRwjjV17QQ== +"@eslint/eslintrc@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.3.0.tgz#d736d6963d7003b6514e6324bec9c602ac340318" + integrity sha512-1JTKgrOKAHVivSvOYw+sJOunkBjUOvjqWk1DPja7ZFhIS2mX/4EgTT8M7eTK9jrKhL/FvXXEbQwIs3pg1xp3dg== dependencies: ajv "^6.12.4" debug "^4.1.1" @@ -290,7 +290,7 @@ ignore "^4.0.6" import-fresh "^3.2.1" js-yaml "^3.13.1" - lodash "^4.17.19" + lodash "^4.17.20" minimatch "^3.0.4" strip-json-comments "^3.1.1" @@ -1327,12 +1327,12 @@ eslint-visitor-keys@^2.0.0: integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== eslint@^7.8.1: - version "7.17.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.17.0.tgz#4ccda5bf12572ad3bf760e6f195886f50569adb0" - integrity sha512-zJk08MiBgwuGoxes5sSQhOtibZ75pz0J35XTRlZOk9xMffhpA9BTbQZxoXZzOl5zMbleShbGwtw+1kGferfFwQ== + version "7.18.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.18.0.tgz#7fdcd2f3715a41fe6295a16234bd69aed2c75e67" + integrity sha512-fbgTiE8BfUJZuBeq2Yi7J3RB3WGUQ9PNuNbmgi6jt9Iv8qrkxfy19Ds3OpL1Pm7zg3BtTVhvcUZbIRQ0wmSjAQ== dependencies: "@babel/code-frame" "^7.0.0" - "@eslint/eslintrc" "^0.2.2" + "@eslint/eslintrc" "^0.3.0" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" @@ -1356,7 +1356,7 @@ eslint@^7.8.1: js-yaml "^3.13.1" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" - lodash "^4.17.19" + lodash "^4.17.20" minimatch "^3.0.4" natural-compare "^1.4.0" optionator "^0.9.1" From fed1fc206555a98e11c3125be42e730fc817c874 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Jan 2021 05:05:57 +0000 Subject: [PATCH 088/785] Bump husky from 4.3.7 to 4.3.8 Bumps [husky](https://github.com/typicode/husky) from 4.3.7 to 4.3.8. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v4.3.7...v4.3.8) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index b67e0b91..d6245cc4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1822,9 +1822,9 @@ human-signals@^1.1.1: integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== husky@^4.3.5: - version "4.3.7" - resolved "https://registry.yarnpkg.com/husky/-/husky-4.3.7.tgz#ca47bbe6213c1aa8b16bbd504530d9600de91e88" - integrity sha512-0fQlcCDq/xypoyYSJvEuzbDPHFf8ZF9IXKJxlrnvxABTSzK1VPT2RKYQKrcgJ+YD39swgoB6sbzywUqFxUiqjw== + version "4.3.8" + resolved "https://registry.yarnpkg.com/husky/-/husky-4.3.8.tgz#31144060be963fd6850e5cc8f019a1dfe194296d" + integrity sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow== dependencies: chalk "^4.0.0" ci-info "^2.0.0" From d144de07ddf56ba228af6af78617ef8ba106e042 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Jan 2021 05:04:15 +0000 Subject: [PATCH 089/785] Bump eslint-config-prettier from 7.1.0 to 7.2.0 Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 7.1.0 to 7.2.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/v7.1.0...v7.2.0) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 0075b621..2d79bf6a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1297,9 +1297,9 @@ escodegen@^1.14.1: source-map "~0.6.1" eslint-config-prettier@^7.0.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-7.1.0.tgz#5402eb559aa94b894effd6bddfa0b1ca051c858f" - integrity sha512-9sm5/PxaFG7qNJvJzTROMM1Bk1ozXVTKI0buKOyb0Bsr1hrwi0H/TzxF/COtf1uxikIK8SwhX7K6zg78jAzbeA== + version "7.2.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-7.2.0.tgz#f4a4bd2832e810e8cc7c1411ec85b3e85c0c53f9" + integrity sha512-rV4Qu0C3nfJKPOAhFujFxB7RMP+URFyQqqOZW9DMRD7ZDTFyjaIlETU3xzHELt++4ugC0+Jm084HQYkkJe+Ivg== eslint-scope@^5.1.1: version "5.1.1" From 9cd9952fe50e261fe95e72428ffce8c4088851f8 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 20 Jan 2021 08:01:51 -0500 Subject: [PATCH 090/785] Fix for #795 --- CHANGELOG.md | 685 ++++++++++++++---------------- src/utils/printEmptyCollection.js | 11 +- test/js/ruby/nodes/arrays.test.js | 10 + 3 files changed, 327 insertions(+), 379 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf2a0de4..aa128385 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,139 +6,143 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Changed + +- [#795](https://github.com/prettier/plugin-ruby/issues/795) djrodgerspryor, kddeisz - Trailing comments attached to empty arrays should not multiply. + ## [1.4.0] - 2021-01-15 ### Added -- [@ianks], [@kddeisz] - Use `netcat` to communicate to a parser server for better performance when formatting multiple files. +- ianks, kddeisz - Use `netcat` to communicate to a parser server for better performance when formatting multiple files. ### Changed -- [@jeffcarbs], [@kddeisz] - Long strings with interpolated expressions should only break if the contents in the original source is broken. -- [@johannesluedke], [@kddeisz] - Fix for rescues with inline comments. -- [@johncsnyder], [@kddeisz] - Comments should not attach to nodes beyond a double newline. -- [@blampe], [@kddeisz] - Comments inside of a broken method chain get dropped. -- [@clarkdave], [@kddeisz] - Don't ignore Sorbet `sig` transformations. +- jeffcarbs, kddeisz - Long strings with interpolated expressions should only break if the contents in the original source is broken. +- johannesluedke, kddeisz - Fix for rescues with inline comments. +- johncsnyder, kddeisz - Comments should not attach to nodes beyond a double newline. +- blampe, kddeisz - Comments inside of a broken method chain get dropped. +- clarkdave, kddeisz - Don't ignore Sorbet `sig` transformations. ## [1.3.0] - 2021-01-05 ### Added -- [@kddeisz] - Handling of the RBS language. -- [@kddeisz] - Incorporate the HAML plugin. +- kddeisz - Handling of the RBS language. +- kddeisz - Incorporate the HAML plugin. ## [1.2.5] - 2021-01-04 ### Changed -- [@nruth], [@kddeisz] - Ensure unary operators on method calls that are sending operators get the correct scanner events. -- [@cvoege], [@kddeisz] - Do not add parentheses when they're not needed to non-breaking command_calls with ternary arguments. -- [@valscion], [@kddeisz] - Print method chains more nicely off array and hash literals. +- nruth, kddeisz - Ensure unary operators on method calls that are sending operators get the correct scanner events. +- cvoege, kddeisz - Do not add parentheses when they're not needed to non-breaking command_calls with ternary arguments. +- valscion, kddeisz - Print method chains more nicely off array and hash literals. ## [1.2.4] - 2021-01-03 ### Added -- [@andyw8] - Explain usage with Rubocop, as well as shipping a rubocop.yml config. +- andyw8 - Explain usage with Rubocop, as well as shipping a rubocop.yml config. ### Changed -- [@kddeisz] - Reduce JSON size passing from Ruby process to node process by changing `char_start` -> `sc`, `char_end` -> `ec`, `start` -> `sl`, `end` -> `el`. -- [@kddeisz] - Up the max buffer size between the Ruby and node processes to 15K. +- kddeisz - Reduce JSON size passing from Ruby process to node process by changing `char_start` -> `sc`, `char_end` -> `ec`, `start` -> `sl`, `end` -> `el`. +- kddeisz - Up the max buffer size between the Ruby and node processes to 15K. ## [1.2.3] - 2021-01-02 ### Changed -- [@lukyth], [@kddeisz] - Ensure if a ternary breaks into an `if..else..end` within a `command_call` node that parentheses are added. -- [@AlanFoster], [@kddeisz] - Ensure you consume the optional `do` keyword on `while` and `until` loops so that it doesn't confuse the parser. -- [@AlanFoster], [@kddeisz] - Ensure key-value pairs split on line when the key has a comment attached within a hash. -- [@AlanFoster], [@kddeisz] - Fix for `for` loops that have multiple index variables. -- [@AlanFoster], [@kddeisz] - Fix parsing very large files by reducing the size of the JSON output from the parser. -- [@AlanFoster], [@kddeisz] - Ensure you don't skip parentheses if you're returning a value with the `not` unary operator. +- lukyth, kddeisz - Ensure if a ternary breaks into an `if..else..end` within a `command_call` node that parentheses are added. +- AlanFoster, kddeisz - Ensure you consume the optional `do` keyword on `while` and `until` loops so that it doesn't confuse the parser. +- AlanFoster, kddeisz - Ensure key-value pairs split on line when the key has a comment attached within a hash. +- AlanFoster, kddeisz - Fix for `for` loops that have multiple index variables. +- AlanFoster, kddeisz - Fix parsing very large files by reducing the size of the JSON output from the parser. +- AlanFoster, kddeisz - Ensure you don't skip parentheses if you're returning a value with the `not` unary operator. ## [1.2.2] - 2021-01-01 ### Changed -- [@nathan-beam] - Gem does not work with CMD/Powershell. -- [@blampe], [@kddeisz] - Comments inside keyword parameters in method declarations are not printed. -- [@blampe], [@kddeisz] - `command_call` nodes with unary operators incorrectly parse their operator. -- [@blampe], [@kddeisz] - Returning multiple values where the first has parentheses was incorrectly removing the remaining values. -- [@johncsnyder], [@kddeisz] - Call chains whose left-most receiver is a no-indent expression should not indent their entire chain. +- nathan-beam - Gem does not work with CMD/Powershell. +- blampe, kddeisz - Comments inside keyword parameters in method declarations are not printed. +- blampe, kddeisz - `command_call` nodes with unary operators incorrectly parse their operator. +- blampe, kddeisz - Returning multiple values where the first has parentheses was incorrectly removing the remaining values. +- johncsnyder, kddeisz - Call chains whose left-most receiver is a no-indent expression should not indent their entire chain. ## [1.2.1] - 2020-12-27 ### Changed -- [@kddeisz] - Handle single-line method definitions with parameters. -- [@kddeisz] - Handle hash and array patterns nested within find patterns. -- [@kddeisz] - Handle rightward assignment. -- [@kddeisz] - Handle find patterns with named boundaries. -- [@kddeisz] - Handle rightward assignment in conditionals. +- kddeisz - Handle single-line method definitions with parameters. +- kddeisz - Handle hash and array patterns nested within find patterns. +- kddeisz - Handle rightward assignment. +- kddeisz - Handle find patterns with named boundaries. +- kddeisz - Handle rightward assignment in conditionals. ## [1.2.0] - 2020-12-26 ### Added -- [@kddeisz] - Support for the `fndptn` node for Ruby 3.0 pattern matching. -- [@kddeisz] - Support for Ruby 3.0+ single-line method definitions. +- kddeisz - Support for the `fndptn` node for Ruby 3.0 pattern matching. +- kddeisz - Support for Ruby 3.0+ single-line method definitions. ## [1.1.0] - 2020-12-20 ### Added -- [@kddeisz] - Now that the comments are all fixed up, we can support `# prettier-ignore` comments. +- kddeisz - Now that the comments are all fixed up, we can support `# prettier-ignore` comments. ### Changed -- [@rindek], [@kddeisz] - Do not remove parentheses when receiver looks like a constant. -- [@rindek], [@kddeisz] - Do not remove parentheses when using the special `call` syntax with no arguments. -- [@ykpythemind] - Do not change regexp bounds if the body has certain content. -- [@karanmandal], [@kddeisz] - Correctly print for loops. -- [@rafbm], [@kddeisz] - If there are method chains with arguments only at the end, we should group the method chain and the method args. +- rindek, kddeisz - Do not remove parentheses when receiver looks like a constant. +- rindek, kddeisz - Do not remove parentheses when using the special `call` syntax with no arguments. +- ykpythemind - Do not change regexp bounds if the body has certain content. +- karanmandal, kddeisz - Correctly print for loops. +- rafbm, kddeisz - If there are method chains with arguments only at the end, we should group the method chain and the method args. ## [1.0.1] - 2020-12-12 ### Changed -- [@steobrien], [@kddeisz] - Ensure leading comments in empty array and hash literals do not duplicate. +- steobrien, kddeisz - Ensure leading comments in empty array and hash literals do not duplicate. ## [1.0.0] - 2020-12-11 ### Changed -- [@kddeisz] - Do not unescape double quotes in a single quote string. -- [@kddeisz] - Only force braces on regexp for spaces and equals if it's inside a command or command_call. -- [@kddeisz] - Leave Sorbet type annotations in place. -- [@kddeisz] - Don't group hash contents, just allow them to break with their parent node. -- [@kddeisz] - Honor the UTF-8 lang passed in through ENV vars. +- kddeisz - Do not unescape double quotes in a single quote string. +- kddeisz - Only force braces on regexp for spaces and equals if it's inside a command or command_call. +- kddeisz - Leave Sorbet type annotations in place. +- kddeisz - Don't group hash contents, just allow them to break with their parent node. +- kddeisz - Honor the UTF-8 lang passed in through ENV vars. ## [1.0.0-rc2] - 2020-12-10 ### Changed -- [@kddeisz] - Print hashes with consistent keys (e.g., if one key cannot be a hash label, use all hash rockets). -- [@kddeisz] - Respect using `o` or not using `o` for octal numbers. -- [@kddeisz] - Ensure `when` clauses with multiple predicates that can be split into multiple lines are split correctly. -- [@kddeisz] - Ensure hash literal is split correctly when only its contents would fit on one line. -- [@kddeisz] - Simplify `toProc` checks by not calling if the option is disabled. -- [@johncsnyder], [@kddeisz] - Add `method_add_block` to the potential like of method calls that can be chained. -- [@kddeisz] - Add the `rubyArrayLiteral` option for disabling automatically turning into array literals. +- kddeisz - Print hashes with consistent keys (e.g., if one key cannot be a hash label, use all hash rockets). +- kddeisz - Respect using `o` or not using `o` for octal numbers. +- kddeisz - Ensure `when` clauses with multiple predicates that can be split into multiple lines are split correctly. +- kddeisz - Ensure hash literal is split correctly when only its contents would fit on one line. +- kddeisz - Simplify `toProc` checks by not calling if the option is disabled. +- johncsnyder, kddeisz - Add `method_add_block` to the potential like of method calls that can be chained. +- kddeisz - Add the `rubyArrayLiteral` option for disabling automatically turning into array literals. ## [1.0.0-rc1] - 2020-12-09 ### Changed -- [@kddeisz] - Rename options to prep for v1.0 release. +- kddeisz - Rename options to prep for v1.0 release. - `addTrailingCommas` -> `trailingComma`, `"es5"` means `true` - `inlineConditionals` and `inlineLoops` -> `rubyModifier` - `preferHashLabels` -> `rubyHashLabel` - `preferSingleQuotes` -> `rubySingleQuote` - `toProcTransform` -> `rubyToProc` -- [@andyw8], [@kddeisz] - Fix for Ruby `2.5.1` dyna_symbols. Turns out they were previously incorrectly reported as `xstring` nodes. -- [@andyw8], [@kddeisz] - Fix for plain `rescue` nodes with only comments in the body. -- [@andyw8], [@kddeisz] - Move declaration-type comments up to the line in the original source, as in: +- andyw8, kddeisz - Fix for Ruby `2.5.1` dyna_symbols. Turns out they were previously incorrectly reported as `xstring` nodes. +- andyw8, kddeisz - Fix for plain `rescue` nodes with only comments in the body. +- andyw8, kddeisz - Move declaration-type comments up to the line in the original source, as in: ```ruby def foo # :nodoc: @@ -148,12 +152,12 @@ end The comment in the above example should stay in place. -- [@janklimo] - Respect special call syntax, e.g., `a.(1, 2, 3)` should remain the same. -- [@kddeisz] - Fix up a bug with `ensure` being used in a `bodystmt` and not a `begin`. -- [@kddeisz] - Fix up a bug with negative ranges, e.g., `-4..-3`. -- [@kddeisz] - Fix up a bug with operator aliases, e.g., `alias << push`. -- [@kddeisz] - Fix up a bug with calls and unary nodes, e.g., `!!foo&.bar`. -- [@kddeisz] - Fix up a bug with multiple rescue clauses and comments, e.g., +- janklimo - Respect special call syntax, e.g., `a.(1, 2, 3)` should remain the same. +- kddeisz - Fix up a bug with `ensure` being used in a `bodystmt` and not a `begin`. +- kddeisz - Fix up a bug with negative ranges, e.g., `-4..-3`. +- kddeisz - Fix up a bug with operator aliases, e.g., `alias << push`. +- kddeisz - Fix up a bug with calls and unary nodes, e.g., `!!foo&.bar`. +- kddeisz - Fix up a bug with multiple rescue clauses and comments, e.g., ```ruby begin @@ -163,64 +167,64 @@ rescue Foo, Bar end ``` -- [@kddeisz] - Handle string literals that start with `%Q`. -- [@kddeisz] - Handle question method methods in the predicate of an if with a comment in the body. -- [@kddeisz] - Fix bare `break` with comments immediately after. -- [@kddeisz] - Fix for heredocs with comments immediately after the declaration. -- [@kddeisz] - Fix for comments when you're defining a method whose name overlaps with a keyword. -- [@kddeisz] - Don't automatically indent inside interpolated expressions from within a heredoc. -- [@kddeisz] - Don't convert into string literal arrays if the elements have brackets. -- [@kddeisz] - Ensure you break the parent when there is an assignment in the predicate of a loop. -- [@kddeisz] - Fix up a bug with keyword aliases, e.g., `alias in within`. -- [@kddeisz] - Force using braces for regex if a regex starts with a blank space. -- [@kddeisz] - Force using braces for regex if a regex starts with an equals sign. -- [@kddeisz] - Fix up a bug with constant aliases, e.g., `alias in IN`. -- [@andyw8], [@kddeisz] - Ensure `rescue` comments stay on the same line as their declaration. +- kddeisz - Handle string literals that start with `%Q`. +- kddeisz - Handle question method methods in the predicate of an if with a comment in the body. +- kddeisz - Fix bare `break` with comments immediately after. +- kddeisz - Fix for heredocs with comments immediately after the declaration. +- kddeisz - Fix for comments when you're defining a method whose name overlaps with a keyword. +- kddeisz - Don't automatically indent inside interpolated expressions from within a heredoc. +- kddeisz - Don't convert into string literal arrays if the elements have brackets. +- kddeisz - Ensure you break the parent when there is an assignment in the predicate of a loop. +- kddeisz - Fix up a bug with keyword aliases, e.g., `alias in within`. +- kddeisz - Force using braces for regex if a regex starts with a blank space. +- kddeisz - Force using braces for regex if a regex starts with an equals sign. +- kddeisz - Fix up a bug with constant aliases, e.g., `alias in IN`. +- andyw8, kddeisz - Ensure `rescue` comments stay on the same line as their declaration. # [0.22.0] - 2020-12-08 ### Changed -- [@flyerhzm] - Print method chains by one indentation. -- [@mmcnl], [@kddeisz] - Handle heredocs and blocks being passed to the same method. -- [@johncsnyder], [@kddeisz] - Ensure correct formatting when breaking up conditionals with `inlineConditionals: false`. -- [@Rsullivan00] - Ensure that when ternaries as command arguments get broken into multiple lines we add the necessary parentheses. -- [@jbielick] - Maintain parse order during if/unless modifier expressions -- [@flyerhzm] - Slight prettifying of wrapped args if doc length is under a certain value. -- [@github0013], [@kddeisz] - Ensure `not` keeps parentheses if they are being used. -- [@jbielick] - Print heredocs consistently. -- [@kddeisz] - Completely revamp the way we handle comments. -- [@kddeisz] - Support `hshptn` and the remaining missing pattern matching syntax. +- flyerhzm - Print method chains by one indentation. +- mmcnl, kddeisz - Handle heredocs and blocks being passed to the same method. +- johncsnyder, kddeisz - Ensure correct formatting when breaking up conditionals with `inlineConditionals: false`. +- Rsullivan00 - Ensure that when ternaries as command arguments get broken into multiple lines we add the necessary parentheses. +- jbielick - Maintain parse order during if/unless modifier expressions +- flyerhzm - Slight prettifying of wrapped args if doc length is under a certain value. +- github0013, kddeisz - Ensure `not` keeps parentheses if they are being used. +- jbielick - Print heredocs consistently. +- kddeisz - Completely revamp the way we handle comments. +- kddeisz - Support `hshptn` and the remaining missing pattern matching syntax. ## [0.21.0] - 2020-12-02 ### Changed -- [@kddeisz], [@ryan-hunter-pc] - Explicitly handle `break` and `next` keyword parentheses. -- [@jbielick], [@kddeisz] - Don't convert between `lambda {}` and `-> {}`. Technically it's breaking the semantics of the program. Also because lambda method call arguments can't handle everything that stabby lambda can. -- [@kddeisz] - Turn off the `Symbol#to_proc` transform by default. -- [@janklimo], [@kddeisz] - Properly handle trailing commas on hash arguments. -- [@coiti], [@kddeisz] - Properly handle parentheses when necessary on if/unless statements and while/until loops. -- [@Rsullivan00] - Prevent `command` and `command_call` nodes from being turned into ternaries. -- [@kddeisz] - Better handling of the `alias` node with and without comments. -- [@kddeisz] - Better handling of the `BEGIN` and `END` nodes with and without comments. -- [@kddeisz] - Much better handling of heredocs where now there is a consistent `heredoc` node instead of multiple. +- kddeisz, ryan-hunter-pc - Explicitly handle `break` and `next` keyword parentheses. +- jbielick, kddeisz - Don't convert between `lambda {}` and `-> {}`. Technically it's breaking the semantics of the program. Also because lambda method call arguments can't handle everything that stabby lambda can. +- kddeisz - Turn off the `Symbol#to_proc` transform by default. +- janklimo, kddeisz - Properly handle trailing commas on hash arguments. +- coiti, kddeisz - Properly handle parentheses when necessary on if/unless statements and while/until loops. +- Rsullivan00 - Prevent `command` and `command_call` nodes from being turned into ternaries. +- kddeisz - Better handling of the `alias` node with and without comments. +- kddeisz - Better handling of the `BEGIN` and `END` nodes with and without comments. +- kddeisz - Much better handling of heredocs where now there is a consistent `heredoc` node instead of multiple. ## [0.20.1] - 2020-09-04 ### Changed -- [@ftes], [@kddeisz] - Properly escape HAML plain text statements that start with special HAML characters. +- ftes, kddeisz - Properly escape HAML plain text statements that start with special HAML characters. ### Removed -- [@kddeisz] - I'm stripping out the HAML plugin and putting it into its own package (`@prettier/plugin-haml`). It's become too difficult to maintain within this repo, and it's confusing for contributors because there are some things that work with Ruby and some things that don't. This is going to simplify maintenance. This should probably be a major version bump but since we're still pre `1.0` I'm going to leave it as a patch. +- kddeisz - I'm stripping out the HAML plugin and putting it into its own package (`@prettier/plugin-haml`). It's become too difficult to maintain within this repo, and it's confusing for contributors because there are some things that work with Ruby and some things that don't. This is going to simplify maintenance. This should probably be a major version bump but since we're still pre `1.0` I'm going to leave it as a patch. ## [0.20.0] - 2020-08-28 ### Added -- [@kddeisz] - Allow embedded formatting on heredocs by the name placed at the start. For example, +- kddeisz - Allow embedded formatting on heredocs by the name placed at the start. For example, ```ruby @@ -233,37 +237,37 @@ JAVASCRIPT ### Changed -- [@mmainz] - Fix the encoding setting such that we're not overwriting the entire set of environment variables. +- mmainz - Fix the encoding setting such that we're not overwriting the entire set of environment variables. ## [0.19.1] - 2020-08-21 ### Changed -- [@Rsullivan00] - Do not tranform word-literal arrays when there is an escape sequence. -- [@steobrien], [@kddeisz] - Do not indent heredocs with calls more than they should be. -- [@jpickwell] - Include .simplecov in filenames -- [@github0013], [@kddeisz] - Ensure we're parsing ruby files using UTF-8 regardless of the system encoding. +- Rsullivan00 - Do not tranform word-literal arrays when there is an escape sequence. +- steobrien, kddeisz - Do not indent heredocs with calls more than they should be. +- jpickwell - Include .simplecov in filenames +- github0013, kddeisz - Ensure we're parsing ruby files using UTF-8 regardless of the system encoding. ## [0.19.0] - 2020-07-03 ### Added -- [@ryan-hunter-pc] - Add the option to disable the `Symbol#to_proc` transform. -- [@ryan-hunter-pc], [@SViccari], [@kddeisz] - Disable `Symbol#to_proc` transform when used as a key inside of a hash where the key is either `:if` or `:unless`. +- ryan-hunter-pc - Add the option to disable the `Symbol#to_proc` transform. +- ryan-hunter-pc], [@SViccari, kddeisz - Disable `Symbol#to_proc` transform when used as a key inside of a hash where the key is either `:if` or `:unless`. ## [0.18.2] - 2020-05-01 ### Changed -- [@alse] - Support `vscodeLanguageIds` for HAML. -- [@ShayDavidson], [@kddeisz] - Don't allow replacing if/else with ternary if there's an assignment in the predicate. -- [@janklimo] - Do not add an empty line after `rescue` when the block is empty. +- alse - Support `vscodeLanguageIds` for HAML. +- ShayDavidson, kddeisz - Don't allow replacing if/else with ternary if there's an assignment in the predicate. +- janklimo - Do not add an empty line after `rescue` when the block is empty. ## [0.18.1] - 2020-04-05 ### Changed -- [@petevk], [@kddeisz] - Use braces for block format iff it was originally a brace block, otherwise you could be changing precedence. For example: +- petevk, kddeisz - Use braces for block format iff it was originally a brace block, otherwise you could be changing precedence. For example: ```ruby @@ -276,7 +280,7 @@ end.to raise_error should maintain its `do...end` and not switch to inline braces otherwise the brace might get associated with the `1`. -- [@flyerhzm] - Rewrite operators binary parser, as in: +- flyerhzm - Rewrite operators binary parser, as in: ```ruby @@ -287,10 +291,10 @@ should maintain its `do...end` and not switch to inline braces otherwise the bra [1] ``` -- [@ftes], [@kddeisz] - When old-form dynamic attributes are added to a `div` tag in HAML, it was previously skipping printing the `%div`, which led to it being incorrectly displayed. -- [@ftes], [@kddeisz] - Previously if you had a long tag declaration with attributes that made it hit the line limit, then the content of the tag would be pushed to the next line but indented one character too many. -- [@ftes], [@kddeisz] - Don't explicitly require JSON if it has already been loaded, as this can lead to rubygems activation errors. -- [@mmainz], [@kddeisz] - Handle heredocs as the receivers of call nodes, as in: +- ftes, kddeisz - When old-form dynamic attributes are added to a `div` tag in HAML, it was previously skipping printing the `%div`, which led to it being incorrectly displayed. +- ftes, kddeisz - Previously if you had a long tag declaration with attributes that made it hit the line limit, then the content of the tag would be pushed to the next line but indented one character too many. +- ftes, kddeisz - Don't explicitly require JSON if it has already been loaded, as this can lead to rubygems activation errors. +- mmainz, kddeisz - Handle heredocs as the receivers of call nodes, as in: ```ruby @@ -299,7 +303,7 @@ foo = <<~TEXT.strip TEXT ``` -- [@github0013], [@kddeisz] - Leave parentheses in place if the value of a return node contains a binary with low operator precedence, as in: +- github0013, kddeisz - Leave parentheses in place if the value of a return node contains a binary with low operator precedence, as in: ```ruby @@ -310,13 +314,13 @@ return (a or b) if c? ### Added -- [@kddeisz] - Support for the `nokw_param` node for specifying when methods should no accept keywords, as in: +- kddeisz - Support for the `nokw_param` node for specifying when methods should no accept keywords, as in: ```ruby def foo(**nil); end ``` -- [@kddeisz] - Support for the `args_forward` node for forwarding all types of arguments, as in: +- kddeisz - Support for the `args_forward` node for forwarding all types of arguments, as in: ```ruby def foo(...) @@ -326,13 +330,13 @@ end ### Changed -- [@ftes], [@kddeisz] - Handled 3 or more classes on a node in HAML, as in: +- ftes, kddeisz - Handled 3 or more classes on a node in HAML, as in: ```haml %table.table.is-striped.is-hoverable ``` -- [@ftes], [@kddeisz] - Better handling of indentation of `if/elsif/else`, `unless/elsif/else`, and `case/when` branches, as in: +- ftes, kddeisz - Better handling of indentation of `if/elsif/else`, `unless/elsif/else`, and `case/when` branches, as in: ```haml .column.is-12 @@ -342,9 +346,9 @@ end FALSE ``` -- [@tobyndockerill] - Format numbers with underscores after 4 digits, as opposed to 3. -- [@ianks] - Improve performance by using `--disable-gems`. -- [@flyerhzm] - Calls are grouped such that after an end parenthesis the following call will not be indented, as in: +- tobyndockerill - Format numbers with underscores after 4 digits, as opposed to 3. +- ianks - Improve performance by using `--disable-gems`. +- flyerhzm - Calls are grouped such that after an end parenthesis the following call will not be indented, as in: ```ruby @@ -365,7 +369,7 @@ Config::Download.new( ).perform ``` -- [@pje], [@kddeisz] - Method definition bodies (on `defs` nodes) should dedent if a helper method is called. As in: +- pje, kddeisz - Method definition bodies (on `defs` nodes) should dedent if a helper method is called. As in: ```ruby @@ -383,7 +387,7 @@ private def self.foo end ``` -- [@masqita], [@kddeisz] - Inline variable assignment within a predicate should force the conditional to break, as in: +- masqita, kddeisz - Inline variable assignment within a predicate should force the conditional to break, as in: ```ruby array.each do |element| @@ -393,26 +397,26 @@ array.each do |element| end ``` -- [@hafley66], [@kddeisz] - Handle empty `while` and `until` blocks. -- [@Fruetel], [@kddeisz] - Simplify string escape pattern by locking on any escape sequence. -- [@flyerhzm], [@kddeisz] - Properly handle string quotes on symbols in hash keys. +- hafley66, kddeisz - Handle empty `while` and `until` blocks. +- Fruetel, kddeisz - Simplify string escape pattern by locking on any escape sequence. +- flyerhzm, kddeisz - Properly handle string quotes on symbols in hash keys. ## [0.17.0] - 2019-12-12 ### Added -- [@matt-wratt] - Better support for explicit `return` nodes with empty arrays or arrays with a single element. -- [@jrdioko], [@kddeisz] - Alignment of `not_to` is explicitly allowed to not indent to better support rspec. +- matt-wratt - Better support for explicit `return` nodes with empty arrays or arrays with a single element. +- jrdioko, kddeisz - Alignment of `not_to` is explicitly allowed to not indent to better support rspec. ### Changed -- [@gin0606] - The max buffer being passed into the Ruby process is now up to 10MB. +- gin0606 - The max buffer being passed into the Ruby process is now up to 10MB. ## [0.16.0] - 2019-11-14 ### Added -- [@mmainz], [@kddeisz] - Support for extra commas in multiple assignment, as it changes the meaning. For example, +- mmainz, kddeisz - Support for extra commas in multiple assignment, as it changes the meaning. For example, ```ruby @@ -421,12 +425,12 @@ a, = [1, 2, 3] would previously get printed as `a = [1, 2, 3]`, which changes the value of `a` from `1` to the value of the entire array. -- [@kddeisz] - Experimental support for the HAMtemplate language. +- kddeisz - Experimental support for the HAMtemplate language. ### Changed -- [@github0013], [@kddeisz] - Support proper string escaping when the original string in the source is wrapped in `%q|...|`. For example, `%q|\'|` should get printed as `"\'"`, where previously it was dropping the backslash. -- [@jamescostian], [@kddeisz] - Force ternary breaking when using the lower-precendence operators `and` and `or`. For example, +- github0013, kddeisz - Support proper string escaping when the original string in the source is wrapped in `%q|...|`. For example, `%q|\'|` should get printed as `"\'"`, where previously it was dropping the backslash. +- jamescostian, kddeisz - Force ternary breaking when using the lower-precendence operators `and` and `or`. For example, ```ruby @@ -439,7 +443,7 @@ end the previous expression was being transformed into a ternary which was invalid ruby. Instead it now stays broken out into an if/else block. -- [@localhostdotdev], [@joeyjoejoejr], [@eins78], [@kddeisz] - Better support for embedded expressions inside heredocs. For example, +- localhostdotdev], [@joeyjoejoejr], [@eins78, kddeisz - Better support for embedded expressions inside heredocs. For example, ```ruby @@ -452,14 +456,14 @@ HERE should remain formatted as it is. Whereas previously due to the way the lines were split, you would sometimes end up with it breaking after `#{`. -- [@jamescostian], [@kddeisz] - Fix up `return` node printing. When returning multiple values, you need to return an array literal as opposed to using parentheses. +- jamescostian, kddeisz - Fix up `return` node printing. When returning multiple values, you need to return an array literal as opposed to using parentheses. ## [0.15.1] - 2019-11-05 ### Changed -- [@AlanFoster] - Add `bin/lex` for viewing the tokenized result of Ripper on Ruby code. -- [@jakeprime], [@kddeisz] - When predicates from within an `if`, `unless`, `while`, or `until` loop break the line, they should be aligned together. For example, +- AlanFoster - Add `bin/lex` for viewing the tokenized result of Ripper on Ruby code. +- jakeprime, kddeisz - When predicates from within an `if`, `unless`, `while`, or `until` loop break the line, they should be aligned together. For example, ```ruby @@ -478,7 +482,7 @@ if foooooo || end ``` -- [@jamescostian], [@AlanFoster] - Empty `if`, and `unless` conditionals are now handled gracefully: +- jamescostian], [@AlanFoster - Empty `if`, and `unless` conditionals are now handled gracefully: ```ruby @@ -486,7 +490,7 @@ if foo? end ``` -- [@mmainz], [@kddeisz] - Hash keys are not converted to keyword syntax if they would make invalid symbols. For example, +- mmainz, kddeisz - Hash keys are not converted to keyword syntax if they would make invalid symbols. For example, ```ruby @@ -495,9 +499,9 @@ end cannot be translated into `[]:` as that is an invalid symbol. Instead, it stays with the hash rocket syntax. -- [@cldevs], [@kddeisz] - Do not attempt to format the insides of xstring literals (string that get sent to the command line surrounded by backticks or `%x`). -- [@cldevs], [@kddeisz] - When predicates for `if`, `unless`, `while`, or `until` nodes contain an assignment, we can't know for sure that it doesn't modify the body. In this case we need to always break and form a multi-line block. -- [@MarcManiez], [@kddeisz] - When the return value of `if`, `unless`, `while`, or `until` nodes are assigned to anything other than a local variable, we need to wrap them in parentheses if we're changing to the modifier form. This is because the following expressions have different semantic meaning: +- cldevs, kddeisz - Do not attempt to format the insides of xstring literals (string that get sent to the command line surrounded by backticks or `%x`). +- cldevs, kddeisz - When predicates for `if`, `unless`, `while`, or `until` nodes contain an assignment, we can't know for sure that it doesn't modify the body. In this case we need to always break and form a multi-line block. +- MarcManiez, kddeisz - When the return value of `if`, `unless`, `while`, or `until` nodes are assigned to anything other than a local variable, we need to wrap them in parentheses if we're changing to the modifier form. This is because the following expressions have different semantic meaning: ```ruby @@ -514,14 +518,14 @@ hash[:key] = (break :value while false) That will guarantee that the expressions are equivalent. -- [@AlanFoster] - Fix crashes that were happening with `ignored_nl` nodes. +- AlanFoster - Fix crashes that were happening with `ignored_nl` nodes. ## [0.15.0] - 2019-08-06 ### Changed -- [@dudeofawesome], [@kddeisz] - If xstring literals (command line calls surrounded by backticks) break, then we indent and place the command on a new line. Previously, this was resulting in new lines getting added each time the code was formatted. Now this happens correctly. -- [@krachtstefan], [@kddeisz] - When a `while` or `until` loop modifies a `begin...end` statement, it must remain in the modifier form or else it changes sematic meaning. For example, +- dudeofawesome, kddeisz - If xstring literals (command line calls surrounded by backticks) break, then we indent and place the command on a new line. Previously, this was resulting in new lines getting added each time the code was formatted. Now this happens correctly. +- krachtstefan, kddeisz - When a `while` or `until` loop modifies a `begin...end` statement, it must remain in the modifier form or else it changes sematic meaning. For example, ```ruby @@ -541,8 +545,8 @@ end because that would never execute `foo` if `bar` is falsy, whereas in the initial example it would have. -- [@jviney], [@kddeisz] - When transforming a block into the `Symbol#to_proc` syntax from within a list of arguments inside of an `aref` node (i.e., `foo[:bar].each`), we can't put the block syntax inside the brackets. -- [@jakeprime], [@kddeisz] - Values for the `return` keyword that broke the line were previously just printed as they were, which breaks if you have a block expression like an `if` or `while`. For example, +- jviney], kddeisz - When transforming a block into the `Symbol#to_proc` syntax from within a list of arguments inside of an `aref` node (i.e., `foo[:bar.each`), we can't put the block syntax inside the brackets. +- jakeprime, kddeisz - Values for the `return` keyword that broke the line were previously just printed as they were, which breaks if you have a block expression like an `if` or `while`. For example, ```ruby @@ -573,7 +577,7 @@ return( ) ``` -- [@jakeprime], [@kddeisz] - When switching from a double-quoted string to a single-quoted string that contained escaped double quotes, the backslashes would stay in the string. As in: +- jakeprime, kddeisz - When switching from a double-quoted string to a single-quoted string that contained escaped double quotes, the backslashes would stay in the string. As in: ```ruby @@ -598,11 +602,11 @@ but now gets formatted as: ### Added -- [@kddeisz] - Support for pattern matching for variables and array patterns. Currently waiting on Ripper support for hash patterns. For examples, check out the [test/js/patterns.test.js](test/js/patterns.test.js) file. +- kddeisz - Support for pattern matching for variables and array patterns. Currently waiting on Ripper support for hash patterns. For examples, check out the [test/js/patterns.test.js](test/js/patterns.test.js) file. ### Changed -- [@jviney], [@kddeisz] - if/else blocks that had method calls on the end of them that were also transformed into ternaries need to have parens added to them. For example, +- jviney, kddeisz - if/else blocks that had method calls on the end of them that were also transformed into ternaries need to have parens added to them. For example, ```ruby @@ -620,8 +624,8 @@ now correctly gets transformed into: (foo ? 1 : 2).to_s ``` -- [@acrewdson], [@kddeisz] - Fixed a bug where multiple newlines at the end of the file would cause a crash. -- [@jviney], [@kddeisz] - If a variable is assigned inside of the predicate of a conditional, then we can't change it into the single-line version as this breaks. For example, +- acrewdson, kddeisz - Fixed a bug where multiple newlines at the end of the file would cause a crash. +- jviney, kddeisz - If a variable is assigned inside of the predicate of a conditional, then we can't change it into the single-line version as this breaks. For example, ```ruby @@ -636,11 +640,11 @@ must stay the same. ### Added -- [@kddeisz] - Added `locStart` and `locEnd` functions to support `--cursor-offset`. +- kddeisz - Added `locStart` and `locEnd` functions to support `--cursor-offset`. ### Changed -- [@xipgroc], [@kddeisz] - Comments inside of `do...end` blocks that preceeded `call` nodes were associating the comment with the `var_ref` instead of the `call` itself. For example, +- xipgroc, kddeisz - Comments inside of `do...end` blocks that preceeded `call` nodes were associating the comment with the `var_ref` instead of the `call` itself. For example, ```ruby @@ -665,7 +669,7 @@ end but now gets printed correctly. -- [@petevk], [@kddeisz] - Double splats inside a hash were previously failing to print. For example, +- petevk, kddeisz - Double splats inside a hash were previously failing to print. For example, ```ruby @@ -678,12 +682,12 @@ would fail to print, but now works. ### Changed -- [@kddeisz] - Move arg, assign, constant, flow, massign, operator, scope, and statement nodes into their own files. -- [@kddeisz] - Move `@int`, `access_ctrl`, `assocsplat`, `block_var`, `else`, `number_arg`, `super`, `undef`, `var_ref`, and `var_ref` as well as various call and symbol nodes into appropriate files. -- [@kddeisz] - Better support for excessed commas in block args. Previously `proc { |x,| }` would add an extra space, but now it does not. -- [@kddeisz] - Add a lot more documentation to the parser. -- [@glejeune], [@kddeisz] - Previously, the unary `not` operator inside a ternary (e.g., `a ? not(b) : c`) would break because it wouldn't add parentheses, but now it adds them. -- [@kddeisz] - `if` and `unless` nodes used to not be able to handle if a comment was the only statement in the body. For example, +- kddeisz - Move arg, assign, constant, flow, massign, operator, scope, and statement nodes into their own files. +- kddeisz - Move `@int`, `access_ctrl`, `assocsplat`, `block_var`, `else`, `number_arg`, `super`, `undef`, `var_ref`, and `var_ref` as well as various call and symbol nodes into appropriate files. +- kddeisz - Better support for excessed commas in block args. Previously `proc { |x,| }` would add an extra space, but now it does not. +- kddeisz - Add a lot more documentation to the parser. +- glejeune, kddeisz - Previously, the unary `not` operator inside a ternary (e.g., `a ? not(b) : c`) would break because it wouldn't add parentheses, but now it adds them. +- kddeisz - `if` and `unless` nodes used to not be able to handle if a comment was the only statement in the body. For example, ```ruby @@ -701,7 +705,7 @@ would get printed as Now the `if` and `unless` printers check for the presence of single comments. -- [@JoshuaKGoldberg], [@kddeisz] - Fixes an error where `command` nodes within `def` nodes would fail to format if it was only a single block argument. For example, +- JoshuaKGoldberg, kddeisz - Fixes an error where `command` nodes within `def` nodes would fail to format if it was only a single block argument. For example, ```ruby @@ -712,7 +716,7 @@ end would fail, but now works. -- [@xipgroc], [@kddeisz] - Comments on lines with array references were previously deleting the array references entirely. For example, +- xipgroc, kddeisz - Comments on lines with array references were previously deleting the array references entirely. For example, ```ruby @@ -725,323 +729,323 @@ would previously result in `array[]`, but now prints properly. ### Changed -- [@kddeisz] - When symbol literal hash keys end with `=`, they cannot be transformed into hash labels. -- [@xipgroc], [@kddeisz] - Fixed when blocks on methods with no arguments are transformed into `to_proc` syntax. +- kddeisz - When symbol literal hash keys end with `=`, they cannot be transformed into hash labels. +- xipgroc, kddeisz - Fixed when blocks on methods with no arguments are transformed into `to_proc` syntax. ## [0.12.1] - 2019-04-22 ### Changed -- [@kddeisz] - If a lambda literal is nested under a `command` or `command_call` node anywhere in the heirarchy, then it needs to use the higher-precedence `{ ... }` braces as opposed to the `do ... end` delimiters. -- [@jpickwell], [@kddeisz] - Calling `super` with a block and no args was causing the parser to fail when attempting to inspect lambda nodes. -- [@kddeisz] - Support better breaking within interpolation by grouping the interpolated content. +- kddeisz - If a lambda literal is nested under a `command` or `command_call` node anywhere in the heirarchy, then it needs to use the higher-precedence `{ ... }` braces as opposed to the `do ... end` delimiters. +- jpickwell, kddeisz - Calling `super` with a block and no args was causing the parser to fail when attempting to inspect lambda nodes. +- kddeisz - Support better breaking within interpolation by grouping the interpolated content. ## [0.12.0] - 2019-04-18 ### Added -- [@kddeisz] - Automatically convert `lambda { ... }` method calls into `-> { ... }` literals. +- kddeisz - Automatically convert `lambda { ... }` method calls into `-> { ... }` literals. ## [0.11.0] - 2019-04-18 ### Added -- [@kddeisz] - Support for parsing things with a ruby shebang (e.g., `#!/usr/bin/env ruby` or `#!/usr/bin/ruby`). -- [@kddeisz] - Big tests refactor. -- [@kddeisz] - Make multiple `when` predicates break at 80 chars and then wrap to be inline with the other predicates. -- [@kddeisz] - Automatically add underscores in large numbers that aren't already formatted. -- [@AlanFoster] - Better support for inline access control modifiers. -- [@jpickwell], [@kddeisz] - Better support for heredocs in hash literals. -- [@kddeisz] - Better support for heredocs in array literals. -- [@kddeisz] - Support automatically transforming `def/begin/rescue/end/end` into `def/rescue/end`. +- kddeisz - Support for parsing things with a ruby shebang (e.g., `#!/usr/bin/env ruby` or `#!/usr/bin/ruby`). +- kddeisz - Big tests refactor. +- kddeisz - Make multiple `when` predicates break at 80 chars and then wrap to be inline with the other predicates. +- kddeisz - Automatically add underscores in large numbers that aren't already formatted. +- AlanFoster - Better support for inline access control modifiers. +- jpickwell, kddeisz - Better support for heredocs in hash literals. +- kddeisz - Better support for heredocs in array literals. +- kddeisz - Support automatically transforming `def/begin/rescue/end/end` into `def/rescue/end`. ### Changed -- [@deecewan] - Fixed support for dynamic string hash keys. -- [@kddeisz] - Moved `case/when` into its own file and added better documentation. -- [@kddeisz] - Moved `begin/rescue` into its own file. -- [@AlanFoster] - Automatically add newlines around access modifiers. -- [@kddeisz] - Alignment of command calls with arguments is fixed. -- [@aaronjensen], [@kddeisz] - Alignment of `to` is explicitly allowed to not indent to better support rspec. -- [@kddeisz] - Fix up the `to_proc` transform so that it works with other argument handling appropriately. -- [@kddeisz] - Fixed regression on regexp comments. -- [@CodingItWrong], [@kddeisz] - Fix up block delimiters when nested inside a `command` or `command_call` node. -- [@kddeisz] - Moved hashes into its own file. +- deecewan - Fixed support for dynamic string hash keys. +- kddeisz - Moved `case/when` into its own file and added better documentation. +- kddeisz - Moved `begin/rescue` into its own file. +- AlanFoster - Automatically add newlines around access modifiers. +- kddeisz - Alignment of command calls with arguments is fixed. +- aaronjensen, kddeisz - Alignment of `to` is explicitly allowed to not indent to better support rspec. +- kddeisz - Fix up the `to_proc` transform so that it works with other argument handling appropriately. +- kddeisz - Fixed regression on regexp comments. +- CodingItWrong, kddeisz - Fix up block delimiters when nested inside a `command` or `command_call` node. +- kddeisz - Moved hashes into its own file. ## [0.10.0] - 2019-03-25 ### Added -- [@kddeisz] - Support for block-local variables. -- [@kddeisz] - Support for dyna-symbols that are using single quotes. +- kddeisz - Support for block-local variables. +- kddeisz - Support for dyna-symbols that are using single quotes. ### Changed -- [@kddeisz] - Force method calls after arrays, blocks, hashes, and xstrings to hang onto the end of the previous nodes. -- [@kddeisz] - Check before anything else for an invalid ruby version. +- kddeisz - Force method calls after arrays, blocks, hashes, and xstrings to hang onto the end of the previous nodes. +- kddeisz - Check before anything else for an invalid ruby version. ## [0.9.1] - 2019-03-24 ### Changed -- [@kddeisz] - Better support string quotes by favoring what the user chose if the string contains escape patterns. -- [@kddeisz] - Better support heredocs within method calls. +- kddeisz - Better support string quotes by favoring what the user chose if the string contains escape patterns. +- kddeisz - Better support heredocs within method calls. ## [0.9.0] - 2019-03-18 ### Added -- [@kddeisz] - Support the `hasPragma` function. -- [@kddeisz] - Support the new `number_arg` node type in Ruby 2.7. +- kddeisz - Support the `hasPragma` function. +- kddeisz - Support the new `number_arg` node type in Ruby 2.7. ### Changed -- [@kddeisz] - Limit the number of nodes that are allowed to turn into ternary expressions. +- kddeisz - Limit the number of nodes that are allowed to turn into ternary expressions. ## [0.8.0] - 2019-03-08 ### Added -- [@kddeisz] - Add `eslint` and fix up existing violations. -- [@AlanFoster] - Add the infra for the `prettier` ruby gem. -- [@kddeisz] - Add a `rake` task for easier process integration for the ruby gem. -- [@kddeisz] - Handle direct interpolation of strings with %w array literals (i.e., `["#{foo}"]` should not be transformed into a %w array). +- kddeisz - Add `eslint` and fix up existing violations. +- AlanFoster - Add the infra for the `prettier` ruby gem. +- kddeisz - Add a `rake` task for easier process integration for the ruby gem. +- kddeisz - Handle direct interpolation of strings with %w array literals (i.e., `["#{foo}"]` should not be transformed into a %w array). ### Changed -- [@kddeisz] - Fix string escaping for hex digit bit patterns when there's only one character after the "x". -- [@AlanFoster] - Don't allow line breaks between brace block params. -- [@johnschoeman] - Switch over the array.rb test case to minitest. -- [@AlanFoster] - Test improvements to allow running in parallel. -- [@johnschoeman] - Switch over assign.rb test case to minitest. -- [@AlanFoster] - Add a contributing guide. -- [@AlanFoster] - Handle longer command nodes. -- [@kddeisz] - Changed the ruby executable within the `prettier` gem to `rbprettier` for easier autocomplete. +- kddeisz - Fix string escaping for hex digit bit patterns when there's only one character after the "x". +- AlanFoster - Don't allow line breaks between brace block params. +- johnschoeman - Switch over the array.rb test case to minitest. +- AlanFoster - Test improvements to allow running in parallel. +- johnschoeman - Switch over assign.rb test case to minitest. +- AlanFoster - Add a contributing guide. +- AlanFoster - Handle longer command nodes. +- kddeisz - Changed the ruby executable within the `prettier` gem to `rbprettier` for easier autocomplete. ### Removed -- [@kddeisz] - All instances of the spread (`...`) operator so that we can support older versions of node. +- kddeisz - All instances of the spread (`...`) operator so that we can support older versions of node. ## [0.7.0] - 2019-02-24 ### Changed -- [@kddeisz] - Support checking for escaping within strings to force double quotes (e.g., "\n"). -- [@RossKinsella], [@kddeisz] - Handle cases with empty class and module declarations that need to break. -- [@AlanFoster] - Align the `bin/print` and `bin/sexp` APto support `bin/print` taking a filepath. -- [@AndrewRayCode], [@kddeisz] - Support lambdas that don't break and are inline. -- [@AlanFoster] - Switch over the numbers.rb test to minitest. -- [@AlanFoster] - Switch over the kwargs.rb test to minitest. -- [@AlanFoster] - Bail out early if the Ruby input is invalid. -- [@kddeisz] - Support `__END__` content. -- [@AlanFoster] - Fix up issue with whitespace being added within regexp that are multiline. -- [@AlanFoster] - Better support for destructuring within multi assignment. -- [@kddeisz] - Switch `next` test over to minitest. -- [@kddeisz] - Handle multiple arguments to `next` with a space between. -- [@AndrewRayCode], [@kddeisz] - Handle multi-line conditional predicate (should align with keyword). -- [@aaronjensen], [@kddeisz] - Properly support adding trailing commas with and without blocks. -- [@AlanFoster], [@kddeisz] - Fix regression of handling comments within arrays on array literals. -- [@AlanFoster] - Support multiple arguments to `undef`. +- kddeisz - Support checking for escaping within strings to force double quotes (e.g., "\n"). +- RossKinsella, kddeisz - Handle cases with empty class and module declarations that need to break. +- AlanFoster - Align the `bin/print` and `bin/sexp` APto support `bin/print` taking a filepath. +- AndrewRayCode, kddeisz - Support lambdas that don't break and are inline. +- AlanFoster - Switch over the numbers.rb test to minitest. +- AlanFoster - Switch over the kwargs.rb test to minitest. +- AlanFoster - Bail out early if the Ruby input is invalid. +- kddeisz - Support `__END__` content. +- AlanFoster - Fix up issue with whitespace being added within regexp that are multiline. +- AlanFoster - Better support for destructuring within multi assignment. +- kddeisz - Switch `next` test over to minitest. +- kddeisz - Handle multiple arguments to `next` with a space between. +- AndrewRayCode, kddeisz - Handle multi-line conditional predicate (should align with keyword). +- aaronjensen, kddeisz - Properly support adding trailing commas with and without blocks. +- AlanFoster, kddeisz - Fix regression of handling comments within arrays on array literals. +- AlanFoster - Support multiple arguments to `undef`. ## [0.6.3] - 2019-02-18 ### Changed -- [@kddeisz] - Switch over `binary` fixture to minitest. -- [@kddeisz] - Reconfigure parser into multiple layer modules so that it's easier to understand and manage. -- [@kddeisz] - Handle comments from within `begin`, `rescue`, `ensure`, `while`, and `until` nodes. -- [@kddeisz] - Properly indent heredocs without taking into account current indentation level. +- kddeisz - Switch over `binary` fixture to minitest. +- kddeisz - Reconfigure parser into multiple layer modules so that it's easier to understand and manage. +- kddeisz - Handle comments from within `begin`, `rescue`, `ensure`, `while`, and `until` nodes. +- kddeisz - Properly indent heredocs without taking into account current indentation level. ## [0.6.2] - 2019-02-17 ### Changed -- [@AlanFoster] - Handle regexp suffixes. -- [@kddeisz] - Add support for testing the test fixtures with minitest. -- [@kddeisz] - Switch over `alias` and `regexp` tests to minitest. -- [@aaronjensen], [@kddeisz] - Break up method args to split into multiple lines. -- [@christoomey], [@kddeisz] - Handle blocks args when trailing commas are on. +- AlanFoster - Handle regexp suffixes. +- kddeisz - Add support for testing the test fixtures with minitest. +- kddeisz - Switch over `alias` and `regexp` tests to minitest. +- aaronjensen, kddeisz - Break up method args to split into multiple lines. +- christoomey, kddeisz - Handle blocks args when trailing commas are on. ## [0.6.1] - 2019-02-15 ### Changed -- [@meleyal], [@kddeisz] - Fix Ruby 2.5 inline comments on `args_add_block` nodes. -- [@meleyal], [@kddeisz] - Support passing `super()` explicitly with no arguments. +- meleyal, kddeisz - Fix Ruby 2.5 inline comments on `args_add_block` nodes. +- meleyal, kddeisz - Support passing `super()` explicitly with no arguments. ## [0.6.0] - 2019-02-14 ### Added -- [@kddeisz] - Handle non UTF-8 comments. -- [@kddeisz] - Handle non UTF-8 identifiers. -- [@kddeisz] - Handle non UTF-8 strings. -- [@kddeisz] - Handle empty parens. -- [@kddeisz] - Handle rescue with splats preceeding the exception names. +- kddeisz - Handle non UTF-8 comments. +- kddeisz - Handle non UTF-8 identifiers. +- kddeisz - Handle non UTF-8 strings. +- kddeisz - Handle empty parens. +- kddeisz - Handle rescue with splats preceeding the exception names. ### Changed -- [@kddeisz] - Use `JSON::fast_generate` to get the s-expressions back from the parser. -- [@NoahTheDuke], [@kddeisz] - Handle broken lambdas from within `command` and `command_call` nodes. +- kddeisz - Use `JSON::fast_generate` to get the s-expressions back from the parser. +- NoahTheDuke, kddeisz - Handle broken lambdas from within `command` and `command_call` nodes. ## [0.5.2] - 2019-02-13 ### Changed -- [@kddeisz] - Support embedded expressions within strings that contain only keywords, as in `"#{super}"`. +- kddeisz - Support embedded expressions within strings that contain only keywords, as in `"#{super}"`. ## [0.5.1] - 2019-02-13 ### Changed -- [@yuki24], [@kddeisz] - Force `do` blocks that we know have to be `do` blocks to break. -- [@kmcq], [@kddeisz] - Handle `command` and `command_call` nodes `do` blocks by forcing them to break. -- [@ashfurrow], [@kddeisz] - Attach comments to full hash association nodes, not just the value. +- yuki24, kddeisz - Force `do` blocks that we know have to be `do` blocks to break. +- kmcq, kddeisz - Handle `command` and `command_call` nodes `do` blocks by forcing them to break. +- ashfurrow, kddeisz - Attach comments to full hash association nodes, not just the value. ## [0.5.0] - 2019-02-13 ### Added -- [@kddeisz] - Automatically convert arrays of all string literals to %w arrays. -- [@kddeisz] - Automatically convert arrays of all symbol literals to %i arrays. +- kddeisz - Automatically convert arrays of all string literals to %w arrays. +- kddeisz - Automatically convert arrays of all symbol literals to %i arrays. ### Changed -- [@kddeisz] - Move the `args_add` and `args_new` handling into the parser. -- [@uri], [@kddeisz] - Change `command_call` nodes to properly indent when broken and to not add a trailing comma. -- [@kddeisz] - Rename the `trailingComma` option to `addTrailingCommas` to not conflict with the JS option. +- kddeisz - Move the `args_add` and `args_new` handling into the parser. +- uri, kddeisz - Change `command_call` nodes to properly indent when broken and to not add a trailing comma. +- kddeisz - Rename the `trailingComma` option to `addTrailingCommas` to not conflict with the JS option. ## [0.4.1] - 2019-02-12 ### Changed -- [@kddeisz] - Provide the `makeList` utility for the nodes that are lists from within ripper. -- [@awinograd], [@kddeisz] - Again, this time for real, properly escape strings. -- [@kddeisz] - Fix up trailing commas on command calls. +- kddeisz - Provide the `makeList` utility for the nodes that are lists from within ripper. +- awinograd, kddeisz - Again, this time for real, properly escape strings. +- kddeisz - Fix up trailing commas on command calls. ## [0.4.0] - 2019-02-12 ### Added -- [@Overload119], [@kddeisz] - Support the `trailingComma` configuration option (defaults to `false`). +- Overload119, kddeisz - Support the `trailingComma` configuration option (defaults to `false`). ### Changed -- [@NoahTheDuke], [@kddeisz] - Pass the code to be formatted over `stdin`. +- NoahTheDuke, kddeisz - Pass the code to be formatted over `stdin`. ## [0.3.7] - 2019-02-11 ### Changed -- [@kddeisz] - Split up statements even if they started on the same line with `;`s unless they are within an embedded expression. -- [@kddeisz] - Properly handle escaped quotes within strings. +- kddeisz - Split up statements even if they started on the same line with `;`s unless they are within an embedded expression. +- kddeisz - Properly handle escaped quotes within strings. ## [0.3.6] - 2019-02-10 ### Changed -- [@AlanFoster], [@kddeisz] - Support the `not` operator properly. -- [@AlanFoster], [@kddeisz] - Handle comments properly inside `if`, `unless`, and `when` nodes. +- AlanFoster, kddeisz - Support the `not` operator properly. +- AlanFoster, kddeisz - Handle comments properly inside `if`, `unless`, and `when` nodes. ## [0.3.5] - 2019-02-09 ### Changed -- [@kddeisz] - Handle lonely operators in Ruby `2.5`. +- kddeisz - Handle lonely operators in Ruby `2.5`. ## [0.3.4] - 2019-02-09 ### Changed -- [@kddeisz] - Comments are now properly attached inside `defs` nodes. -- [@kddeisz] - Support multiple inline comments on nodes. -- [@kddeisz] - Support inline comments from within the `EXPR_END|EXPR_LABEL` lexer state. -- [@cbothner] - Stop transforming multistatement blocks with `to_proc`. -- [@kddeisz] - `do` blocks necessarily need to break their parent nodes. -- [@eins78], [@kddeisz] - Handle `next` node edge case with `args_add` as the body. +- kddeisz - Comments are now properly attached inside `defs` nodes. +- kddeisz - Support multiple inline comments on nodes. +- kddeisz - Support inline comments from within the `EXPR_END|EXPR_LABEL` lexer state. +- cbothner - Stop transforming multistatement blocks with `to_proc`. +- kddeisz - `do` blocks necessarily need to break their parent nodes. +- eins78, kddeisz - Handle `next` node edge case with `args_add` as the body. ## [0.3.3] - 2019-02-09 ### Changed -- [@bugthing], [@kddeisz] - Command nodes within conditionals now break parents to disallow them from being turned into ternary expressions. -- [@awinograd], [@kddeisz] - Properly escape double quotes when using `preferSingleQuotes: false`. +- bugthing, kddeisz - Command nodes within conditionals now break parents to disallow them from being turned into ternary expressions. +- awinograd, kddeisz - Properly escape double quotes when using `preferSingleQuotes: false`. ## [0.3.2] - 2019-02-09 ### Changed -- [@kddeisz] - Don't define duplicated methods in the parser. -- [@kddeisz] - Let prettier know about `.rb` and `.rake` files so you don't have to specify the parser when running. -- [@kddeisz] - Renamed the package to @prettier/plugin-ruby. +- kddeisz - Don't define duplicated methods in the parser. +- kddeisz - Let prettier know about `.rb` and `.rake` files so you don't have to specify the parser when running. +- kddeisz - Renamed the package to @prettier/plugin-ruby. ## [0.3.1] - 2019-02-07 ### Changed -- [@kddeisz] - Automatically add parens to method declarations. -- [@kddeisz] - Handle comments on bare hash assocs. -- [@kddeisz] - Handle `method_add_block` nodes where the statements may be nested one more level. -- [@kddeisz] - Handle heredocs nested no matter how many levels deep. +- kddeisz - Automatically add parens to method declarations. +- kddeisz - Handle comments on bare hash assocs. +- kddeisz - Handle `method_add_block` nodes where the statements may be nested one more level. +- kddeisz - Handle heredocs nested no matter how many levels deep. ## [0.3.0] - 2019-02-07 ### Added -- [@kddeisz] - Support squiggly heredocs. -- [@kddeisz] - Support straight heredocs. +- kddeisz - Support squiggly heredocs. +- kddeisz - Support straight heredocs. ### Changed -- [@kddeisz] - Ignore current indentation when creating embdocs so that `=begin` is always at the beginning of the line. -- [@kddeisz] - Move `regexp_add` and `regexp_new` handling into the parser. -- [@kddeisz] - Move `xstring_add` and `xstring_new` handling into the parser. -- [@kddeisz] - Move `string_add` and `string_content` handling into the parser. -- [@kddeisz] - Move `mrhs_add` and `mrhs_new` handling into the parser. -- [@kddeisz] - Move `mlhs_add` and `mlhs_new` handling into the parser. +- kddeisz - Ignore current indentation when creating embdocs so that `=begin` is always at the beginning of the line. +- kddeisz - Move `regexp_add` and `regexp_new` handling into the parser. +- kddeisz - Move `xstring_add` and `xstring_new` handling into the parser. +- kddeisz - Move `string_add` and `string_content` handling into the parser. +- kddeisz - Move `mrhs_add` and `mrhs_new` handling into the parser. +- kddeisz - Move `mlhs_add` and `mlhs_new` handling into the parser. ## [0.2.1] - 2019-02-06 ### Changed -- [@kddeisz] - Handle brace blocks on commands properly. -- [@kddeisz] - Break parent and return `do` blocks when called from a `command` node. -- [@kddeisz] - Handle edge cases with `if` statements where there is no body of the if (so it can't be converted to a ternary). +- kddeisz - Handle brace blocks on commands properly. +- kddeisz - Break parent and return `do` blocks when called from a `command` node. +- kddeisz - Handle edge cases with `if` statements where there is no body of the if (so it can't be converted to a ternary). ## [0.2.0] - 2019-02-06 ### Added -- [@kddeisz] - Handle `methref` nodes from Ruby `2.7`. -- [@kddeisz] - Allow `module` nodes to shorten using `;` when the block is empty. +- kddeisz - Handle `methref` nodes from Ruby `2.7`. +- kddeisz - Allow `module` nodes to shorten using `;` when the block is empty. ### Changed -- [@kddeisz] - Handle splat within an array, as in `[1, 2, *foo]`. -- [@kddeisz] - Disallow comments from being attached to intermediary regex nodes. -- [@kddeisz] - Fix `to_proc` transforms to reference the method called as opposed to the parameter name. -- [@kddeisz] - Change statement lists to be generated within the parser instead of the printer, thereby allowing finer control over comments. -- [@kddeisz] - Completely revamp comment parsing by switching off the internal lexer state from `ripper`. This should drastically increase accuracy of comment parsing in general, and set us up for success in the future. -- [@kddeisz] - Allow comments to be attached to `CHAR` nodes. -- [@kddeisz] - Disallow comments from being attached to `args_new` nodes. -- [@kddeisz] - Track start and end lines so we can better insert block comments. -- [@kddeisz] - Handle intermediary array nodes in the parse for better comment handling. +- kddeisz - Handle splat within an array, as in `[1, 2, *foo]`. +- kddeisz - Disallow comments from being attached to intermediary regex nodes. +- kddeisz - Fix `to_proc` transforms to reference the method called as opposed to the parameter name. +- kddeisz - Change statement lists to be generated within the parser instead of the printer, thereby allowing finer control over comments. +- kddeisz - Completely revamp comment parsing by switching off the internal lexer state from `ripper`. This should drastically increase accuracy of comment parsing in general, and set us up for success in the future. +- kddeisz - Allow comments to be attached to `CHAR` nodes. +- kddeisz - Disallow comments from being attached to `args_new` nodes. +- kddeisz - Track start and end lines so we can better insert block comments. +- kddeisz - Handle intermediary array nodes in the parse for better comment handling. ## [0.1.2] - 2019-02-05 ### Changed -- [@kddeisz] - Handle guard clauses that return with no parens. +- kddeisz - Handle guard clauses that return with no parens. ## [0.1.1] - 2019-02-05 ### Changed -- [@kddeisz] - Handle class method calls with the `::` operator. -- [@kddeisz] - Handle strings with apostrophes when using `preferSingleQuote`. -- [@kddeisz] - Have travis run multiple ruby versions. -- [@kddeisz] - Explicitly fail if ruby version is < `2.5`. -- [@kddeisz] - Disallow comments from being attached to intermediary string nodes. +- kddeisz - Handle class method calls with the `::` operator. +- kddeisz - Handle strings with apostrophes when using `preferSingleQuote`. +- kddeisz - Have travis run multiple ruby versions. +- kddeisz - Explicitly fail if ruby version is < `2.5`. +- kddeisz - Disallow comments from being attached to intermediary string nodes. ## [0.1.0] - 2019-02-04 @@ -1110,76 +1114,3 @@ would previously result in `array[]`, but now prints properly. [0.1.2]: https://github.com/prettier/plugin-ruby/compare/v0.1.1...v0.1.2 [0.1.1]: https://github.com/prettier/plugin-ruby/compare/v0.1.0...v0.1.1 [0.1.0]: https://github.com/prettier/plugin-ruby/compare/61f675...v0.1.0 -[@aaronjensen]: https://github.com/aaronjensen -[@acrewdson]: https://github.com/acrewdson -[@alanfoster]: https://github.com/AlanFoster -[@alse]: https://github.com/alse -[@andrewraycode]: https://github.com/AndrewRayCode -[@andyw8]: https://github.com/andyw8 -[@ashfurrow]: https://github.com/ashfurrow -[@awinograd]: https://github.com/awinograd -[@blampe]: https://github.com/blampe -[@bugthing]: https://github.com/bugthing -[@cbothner]: https://github.com/cbothner -[@christoomey]: https://github.com/christoomey -[@clarkdave]: https://github.com/clarkdave -[@cldevs]: https://github.com/cldevs -[@codingitwrong]: https://github.com/CodingItWrong -[@coiti]: https://github.com/coiti -[@cvoege]: https://github.com/cvoege -[@deecewan]: https://github.com/deecewan -[@dudeofawesome]: https://github.com/dudeofawesome -[@eins78]: https://github.com/eins78 -[@flyerhzm]: https://github.com/flyerhzm -[@fruetel]: https://github.com/Fruetel -[@ftes]: https://github.com/ftes -[@gin0606]: https://github.com/gin0606 -[@github0013]: https://github.com/github0013 -[@glejeune]: https://github.com/glejeune -[@hafley66]: https://github.com/hafley66 -[@ianks]: https://github.com/ianks -[@jakeprime]: https://github.com/jakeprime -[@jamescostian]: https://github.com/jamescostian -[@janklimo]: https://github.com/janklimo -[@jbielick]: https://github.com/jbielick -[@jeffcarbs]: https://github.com/jeffcarbs -[@joeyjoejoejr]: https://github.com/joeyjoejoejr -[@johannesluedke]: https://github.com/johannesluedke -[@johncsnyder]: https://github.com/johncsnyder -[@johnschoeman]: https://github.com/johnschoeman -[@joshuakgoldberg]: https://github.com/JoshuaKGoldberg -[@jpickwell]: https://github.com/jpickwell -[@jrdioko]: https://github.com/jrdioko -[@jviney]: https://github.com/jviney -[@karanmandal]: https://github.com/karanmandal -[@kddeisz]: https://github.com/kddeisz -[@kmcq]: https://github.com/kmcq -[@krachtstefan]: https://github.com/krachtstefan -[@localhostdotdev]: https://github.com/localhostdotdev -[@lukyth]: https://github.com/lukyth -[@marcmaniez]: https://github.com/MarcManiez -[@masqita]: https://github.com/masqita -[@matt-wratt]: https://github.com/matt-wratt -[@meleyal]: https://github.com/meleyal -[@mmainz]: https://github.com/mmainz -[@mmcnl]: https://github.com/mmcnl -[@nathan-beam]: https://github.com/nathan-beam -[@noahtheduke]: https://github.com/NoahTheDuke -[@nruth]: https://github.com/nruth -[@overload119]: https://github.com/Overload119 -[@petevk]: https://github.com/petevk -[@pje]: https://github.com/pje -[@rafbm]: https://github.com/rafbm -[@rindek]: https://github.com/rindek -[@rosskinsella]: https://github.com/RossKinsella -[@rsullivan00]: https://github.com/Rsullivan00 -[@ryan-hunter-pc]: https://github.com/ryan-hunter-pc -[@shaydavidson]: https://github.com/ShayDavidson -[@steobrien]: https://github.com/steobrien -[@sviccari]: https://github.com/SViccari -[@tobyndockerill]: https://github.com/tobyndockerill -[@uri]: https://github.com/uri -[@valscion]: https://github.com/valscion -[@xipgroc]: https://github.com/xipgroc -[@ykpythemind]: https://github.com/ykpythemind -[@yuki24]: https://github.com/yuki24 diff --git a/src/utils/printEmptyCollection.js b/src/utils/printEmptyCollection.js index 6e5f02e9..a6944bd1 100644 --- a/src/utils/printEmptyCollection.js +++ b/src/utils/printEmptyCollection.js @@ -1,5 +1,11 @@ const { concat, group, hardline, indent, join, line } = require("../prettier"); +function containedWithin(node) { + return function containedWithinNode(comment) { + return comment.sc >= node.sc && comment.ec <= node.ec; + }; +} + // Empty collections are array or hash literals that do not contain any // contents. They can, however, have comments inside the body. You can solve // this by having a child node inside the array that gets the comments attached @@ -7,11 +13,12 @@ const { concat, group, hardline, indent, join, line } = require("../prettier"); // print out the non-leading comments here. function printEmptyCollection(path, opts, startToken, endToken) { const node = path.getValue(); + const containedWithinNode = containedWithin(node); // If there are no comments or only leading comments, then we can just print // out the start and end token and be done, as there are no comments inside // the body of this node. - if (!node.comments || !node.comments.some((comment) => !comment.leading)) { + if (!node.comments || !node.comments.some(containedWithinNode)) { return `${startToken}${endToken}`; } @@ -21,7 +28,7 @@ function printEmptyCollection(path, opts, startToken, endToken) { const printComment = (commentPath) => { const comment = commentPath.getValue(); - if (!comment.leading) { + if (containedWithinNode(comment)) { comment.printed = true; comments.push(opts.printer.printComment(commentPath)); } diff --git a/test/js/ruby/nodes/arrays.test.js b/test/js/ruby/nodes/arrays.test.js index 607145ea..daf171b4 100644 --- a/test/js/ruby/nodes/arrays.test.js +++ b/test/js/ruby/nodes/arrays.test.js @@ -152,6 +152,16 @@ describe("array", () => { return expect(content).toMatchFormat(); }); + test("with comments just outside but attached", () => { + const content = ruby(` + foo( + [] # comment comment + ) + `); + + return expect(content).toMatchFormat(); + }); + test.each(["%w", "%W", "%i", "%I"])("%s special array literals", (start) => expect(`${start}[a b c]`).toMatchFormat() ); From b3cfffdc62fc2025d4d03281fdd3645647a39b0d Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 20 Jan 2021 08:20:15 -0500 Subject: [PATCH 091/785] Fix for #794 --- CHANGELOG.md | 1 + src/ruby/embed.js | 62 +++++++++++++++++++++++++++++++++----- test/js/ruby/embed.test.js | 10 ++++++ 3 files changed, 65 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa128385..ad3e508a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Changed - [#795](https://github.com/prettier/plugin-ruby/issues/795) djrodgerspryor, kddeisz - Trailing comments attached to empty arrays should not multiply. +- [#794](https://github.com/prettier/plugin-ruby/issues/794) djrodgerspryor, kddeisz - Fix embedded parser parsing by stripping common leading whitespace before passing on the content. ## [1.4.0] - 2021-01-15 diff --git a/src/ruby/embed.js b/src/ruby/embed.js index 35807672..884bbcd5 100644 --- a/src/ruby/embed.js +++ b/src/ruby/embed.js @@ -24,8 +24,8 @@ const parsers = { // have a test that exercises it because I'm not sure for which parser it is // necessary, but since it's in prettier core I'm keeping it here. /* istanbul ignore next */ -const replaceNewlines = (doc) => - mapDoc(doc, (currentDoc) => +function replaceNewlines(doc) { + return mapDoc(doc, (currentDoc) => typeof currentDoc === "string" && currentDoc.includes("\n") ? concat( currentDoc @@ -34,8 +34,44 @@ const replaceNewlines = (doc) => ) : currentDoc ); +} -const embed = (path, print, textToDoc, _opts) => { +// Returns a number that represents the minimum amount of leading whitespace +// that is present on every line in the given string. So for example if you have +// the following heredoc: +// +// <<~HERE +// my +// content +// here +// HERE +// +// then the return value of this function would be 2. If you indented every line +// of the inner content 2 more spaces then this function would return 4. +function getCommonLeadingWhitespace(content) { + const pattern = /^\s+/; + + return content + .split("\n") + .slice(0, -1) + .reduce((minimum, line) => { + const matched = pattern.exec(line); + const length = matched ? matched[0].length : 0; + + return minimum === null ? length : Math.min(minimum, length); + }, null); +} + +// Returns a new string with the common whitespace stripped out. Effectively it +// emulates what a squiggly heredoc does in Ruby. +function stripCommonLeadingWhitespace(content) { + const lines = content.split("\n"); + const minimum = getCommonLeadingWhitespace(content); + + return lines.map((line) => line.slice(minimum)).join("\n"); +} + +function embed(path, print, textToDoc, _opts) { const node = path.getValue(); // Currently we only support embedded formatting on heredoc nodes @@ -45,6 +81,8 @@ const embed = (path, print, textToDoc, _opts) => { // First, ensure that we don't have any interpolation const { beging, body, ending } = node; + const isSquiggly = beging.body[2] === "~"; + if (body.some((part) => part.type !== "@tstring_content")) { return null; } @@ -56,9 +94,17 @@ const embed = (path, print, textToDoc, _opts) => { return null; } - // Get the content as if it were a source string, and then pass that content - // into the embedded parser. Get back the doc node. - const content = body.map((part) => part.body).join(""); + // Get the content as if it were a source string. + let content = body.map((part) => part.body).join(""); + + // If we're using a squiggly heredoc, then we're going to manually strip off + // the leading whitespace of each line up to the minimum leading whitespace so + // that the embedded parser can handle that for us. + if (isSquiggly) { + content = stripCommonLeadingWhitespace(content); + } + + // Pass that content into the embedded parser. Get back the doc node. const formatted = concat([ literalLineNoBreak, replaceNewlines(stripTrailingHardline(textToDoc(content, { parser }))) @@ -66,7 +112,7 @@ const embed = (path, print, textToDoc, _opts) => { // If we're using a squiggly heredoc, then we can properly handle indentation // ourselves. - if (beging.body[2] === "~") { + if (isSquiggly) { return concat([ path.call(print, "beging"), lineSuffix( @@ -89,6 +135,6 @@ const embed = (path, print, textToDoc, _opts) => { lineSuffix(group(concat([formatted, literalLineNoBreak, ending.trim()]))) ]) ); -}; +} module.exports = embed; diff --git a/test/js/ruby/embed.test.js b/test/js/ruby/embed.test.js index 35e4f6e3..5393ac30 100644 --- a/test/js/ruby/embed.test.js +++ b/test/js/ruby/embed.test.js @@ -62,4 +62,14 @@ describe("embed", () => { return expect(content).toMatchFormat(); }); + + test("removes whitespace so embedded parsers don't misinterpret", () => { + const content = ruby(` + <<~MARKDOWN + foo + MARKDOWN + `); + + return expect(content).toMatchFormat(); + }); }); From 9da061ff7b9ae772f25662b2d87e69cc9c534e9e Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 20 Jan 2021 08:32:02 -0500 Subject: [PATCH 092/785] Fix for #793 --- CHANGELOG.md | 1 + src/ruby/nodes/args.js | 26 ++++++++++++++++++++------ test/js/ruby/embed.test.js | 8 +++++++- test/js/ruby/nodes/method.test.js | 12 ++++++++++++ 4 files changed, 40 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad3e508a..702cba49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#795](https://github.com/prettier/plugin-ruby/issues/795) djrodgerspryor, kddeisz - Trailing comments attached to empty arrays should not multiply. - [#794](https://github.com/prettier/plugin-ruby/issues/794) djrodgerspryor, kddeisz - Fix embedded parser parsing by stripping common leading whitespace before passing on the content. +- [#793](https://github.com/prettier/plugin-ruby/issues/793) djrodgerspryor, kddeisz - Do not include trailing commas on arguments within `arg_paren` nodes if they could not be parsed with them (`command` and `command_call`). ## [1.4.0] - 2021-01-15 diff --git a/src/ruby/nodes/args.js b/src/ruby/nodes/args.js index 8d07c04f..940bd53d 100644 --- a/src/ruby/nodes/args.js +++ b/src/ruby/nodes/args.js @@ -8,9 +8,26 @@ const { softline } = require("../../prettier"); const { getTrailingComma } = require("../../utils"); - const toProc = require("../toProc"); +const noTrailingComma = ["command", "command_call"]; + +function getArgParenTrailingComma(node) { + // If we have a block, then we don't want to add a trailing comma. + if (node.type === "args_add_block" && node.body[1]) { + return ""; + } + + // If we only have one argument and that first argument necessitates that we + // skip putting a comma (because it would interfere with parsing the argument) + // then we don't want to add a trailing comma. + if (node.body.length === 1 && noTrailingComma.includes(node.body[0].type)) { + return ""; + } + + return ifBreak(",", ""); +} + function printArgParen(path, opts, print) { const argsNode = path.getValue().body[0]; @@ -32,9 +49,6 @@ function printArgParen(path, opts, print) { ); } - const args = path.call(print, "body", 0); - const hasBlock = argsNode.type === "args_add_block" && argsNode.body[1]; - // Now here we return a doc that represents the whole grouped expression, // including the surrouding parentheses. return group( @@ -43,8 +57,8 @@ function printArgParen(path, opts, print) { indent( concat([ softline, - join(concat([",", line]), args), - getTrailingComma(opts) && !hasBlock ? ifBreak(",", "") : "" + join(concat([",", line]), path.call(print, "body", 0)), + getTrailingComma(opts) && getArgParenTrailingComma(argsNode) ]) ), softline, diff --git a/test/js/ruby/embed.test.js b/test/js/ruby/embed.test.js index 5393ac30..2d9c940b 100644 --- a/test/js/ruby/embed.test.js +++ b/test/js/ruby/embed.test.js @@ -70,6 +70,12 @@ describe("embed", () => { MARKDOWN `); - return expect(content).toMatchFormat(); + const expected = ruby(` + <<~MARKDOWN + foo + MARKDOWN + `); + + return expect(content).toChangeFormat(expected); }); }); diff --git a/test/js/ruby/nodes/method.test.js b/test/js/ruby/nodes/method.test.js index 0303824e..ad624343 100644 --- a/test/js/ruby/nodes/method.test.js +++ b/test/js/ruby/nodes/method.test.js @@ -354,6 +354,18 @@ describe("method", () => { `), { trailingComma: "all" } )); + + test("on long commands within an arg_paren", () => { + const expected = ruby(` + foo( + ${long} 'bar' + ) + `); + + return expect(`foo(${long} 'bar')`).toChangeFormat(expected, { + trailingComma: "all" + }); + }); }); }); }); From 6119f7fc29fd14e91de20151532ad262a9244788 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Thu, 21 Jan 2021 10:10:21 -0500 Subject: [PATCH 093/785] Fix for #788 --- CHANGELOG.md | 1 + src/rbs/parser.rb | 10 +++++-- src/ruby/nodes/hashes.js | 42 +++++++++++++++++++---------- test/js/ruby/nodes/hashes.test.js | 45 +++++++++++++++++++++++++++++-- 4 files changed, 80 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 702cba49..e3976e9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#795](https://github.com/prettier/plugin-ruby/issues/795) djrodgerspryor, kddeisz - Trailing comments attached to empty arrays should not multiply. - [#794](https://github.com/prettier/plugin-ruby/issues/794) djrodgerspryor, kddeisz - Fix embedded parser parsing by stripping common leading whitespace before passing on the content. - [#793](https://github.com/prettier/plugin-ruby/issues/793) djrodgerspryor, kddeisz - Do not include trailing commas on arguments within `arg_paren` nodes if they could not be parsed with them (`command` and `command_call`). +- [#788](https://github.com/prettier/plugin-ruby/issues/788) clarkdave, kddeisz - Break child hashes within a multi-line hash regardless of whether or not they can fit on one line. ## [1.4.0] - 2021-01-15 diff --git a/src/rbs/parser.rb b/src/rbs/parser.rb index 0034885a..326e078c 100644 --- a/src/rbs/parser.rb +++ b/src/rbs/parser.rb @@ -23,8 +23,14 @@ def self.parse(text) class RBS::Location def to_json(*args) { - start: { line: start_line, column: start_column }, - end: { line: end_line, column: end_column }, + start: { + line: start_line, + column: start_column + }, + end: { + line: end_line, + column: end_column + }, start_pos: start_pos, end_pos: end_pos }.to_json(*args) diff --git a/src/ruby/nodes/hashes.js b/src/ruby/nodes/hashes.js index a2c438ac..314d9541 100644 --- a/src/ruby/nodes/hashes.js +++ b/src/ruby/nodes/hashes.js @@ -6,6 +6,7 @@ const { join, line } = require("../../prettier"); + const { getTrailingComma, printEmptyCollection, @@ -89,6 +90,13 @@ function printAssocNew(path, opts, print) { const parts = [path.call((keyPath) => keyPrinter(keyPath, print), "body", 0)]; const valueDoc = path.call(print, "body", 1); + // If we're printing a child hash then we want it to break along with its + // parent hash, so we don't group the parts. + if (valueNode.type === "hash") { + parts.push(" ", valueDoc); + return concat(parts); + } + if (!skipAssignIndent(valueNode) || keyNode.comments) { parts.push(indent(concat([line, valueDoc]))); } else { @@ -125,20 +133,26 @@ function printHash(path, opts, print) { return printEmptyCollection(path, opts, "{", "}"); } - return group( - concat([ - "{", - indent( - concat([ - line, - path.call(print, "body", 0), - getTrailingComma(opts) ? ifBreak(",", "") : "" - ]) - ), - line, - "}" - ]) - ); + let hashDoc = concat([ + "{", + indent( + concat([ + line, + path.call(print, "body", 0), + getTrailingComma(opts) ? ifBreak(",", "") : "" + ]) + ), + line, + "}" + ]); + + // If we're inside another hash, then we don't want to group our contents + // because we want this hash to break along with its parent hash. + if (path.getParentNode().type === "assoc_new") { + return hashDoc; + } + + return group(hashDoc); } module.exports = { diff --git a/test/js/ruby/nodes/hashes.test.js b/test/js/ruby/nodes/hashes.test.js index 093dcf48..91bc7170 100644 --- a/test/js/ruby/nodes/hashes.test.js +++ b/test/js/ruby/nodes/hashes.test.js @@ -280,14 +280,55 @@ describe("hash", () => { const content = ruby(` items = { :'foo-bar'=> # Inline comment - {:name=>'foo-bar', :date=>'1970'}, + baz, } `); const expected = ruby(` items = { 'foo-bar': # Inline comment - { name: 'foo-bar', date: '1970' } + baz + } + `); + + return expect(content).toChangeFormat(expected); + }); + + test("child hashes break assoc_news if their parents break", () => { + const content = ruby(` + { + ${long}: { foo: bar } + } + `); + + const expected = ruby(` + { + ${long}: { + foo: bar + } + } + `); + + return expect(content).toChangeFormat(expected); + }); + + test("child hashes break hashes if their parents break", () => { + const key = long.slice(0, 40); + const content = ruby(` + { + ${key}: foo, + ${key}: foo, + ${key}: { foo: bar } + } + `); + + const expected = ruby(` + { + ${key}: foo, + ${key}: foo, + ${key}: { + foo: bar + } } `); From e73afd71f0588586555c035654a4a721ac3481f8 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Thu, 21 Jan 2021 15:12:38 -0500 Subject: [PATCH 094/785] Support for RBI, and stop using ; to separate empty classes, modules, methods, and loops --- CHANGELOG.md | 8 +++++- src/plugin.js | 1 + src/ruby/nodes/class.js | 44 +++++++++++----------------- src/ruby/nodes/conditionals.js | 2 +- src/ruby/nodes/loops.js | 14 +++------ src/ruby/nodes/methods.js | 15 +++------- src/ruby/nodes/statements.js | 8 ++---- src/ruby/parser.rb | 3 +- src/utils.js | 1 + src/utils/isEmptyBodyStmt.js | 7 +++++ src/utils/isEmptyStmts.js | 14 +++++---- test/js/ruby/nodes/class.test.js | 13 ++++++--- test/js/ruby/nodes/kwargs.test.js | 30 ++++++++++++++++--- test/js/ruby/nodes/loops.test.js | 16 +++++------ test/js/ruby/nodes/method.test.js | 48 ++++++++++++++++++++++--------- 15 files changed, 132 insertions(+), 92 deletions(-) create mode 100644 src/utils/isEmptyBodyStmt.js diff --git a/CHANGELOG.md b/CHANGELOG.md index e3976e9d..1a9dbb39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,12 +6,17 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Added + +- kddeisz - Add `.rbi` as a file type that we support. + ### Changed - [#795](https://github.com/prettier/plugin-ruby/issues/795) djrodgerspryor, kddeisz - Trailing comments attached to empty arrays should not multiply. - [#794](https://github.com/prettier/plugin-ruby/issues/794) djrodgerspryor, kddeisz - Fix embedded parser parsing by stripping common leading whitespace before passing on the content. - [#793](https://github.com/prettier/plugin-ruby/issues/793) djrodgerspryor, kddeisz - Do not include trailing commas on arguments within `arg_paren` nodes if they could not be parsed with them (`command` and `command_call`). - [#788](https://github.com/prettier/plugin-ruby/issues/788) clarkdave, kddeisz - Break child hashes within a multi-line hash regardless of whether or not they can fit on one line. +- kddeisz - Stop using `;` to separate empty class definitions, module definitions, method definitions, and loops. ## [1.4.0] - 2021-01-15 @@ -320,7 +325,8 @@ return (a or b) if c? - kddeisz - Support for the `nokw_param` node for specifying when methods should no accept keywords, as in: ```ruby -def foo(**nil); end +def foo(**nil) +end ``` - kddeisz - Support for the `args_forward` node for forwarding all types of arguments, as in: diff --git a/src/plugin.js b/src/plugin.js index b42ea486..1705cf65 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -36,6 +36,7 @@ module.exports = { ".rabl", ".rake", ".rb", + ".rbi", ".rbuild", ".rbw", ".rbx", diff --git a/src/ruby/nodes/class.js b/src/ruby/nodes/class.js index b719605c..f1f03e5c 100644 --- a/src/ruby/nodes/class.js +++ b/src/ruby/nodes/class.js @@ -1,34 +1,22 @@ -const { - concat, - group, - hardline, - ifBreak, - indent, - line -} = require("../../prettier"); +const { concat, group, hardline, indent } = require("../../prettier"); +const { isEmptyBodyStmt } = require("../../utils"); function printClass(path, opts, print) { const [_constant, superclass, bodystmt] = path.getValue().body; - const stmts = bodystmt.body[0]; const parts = ["class ", path.call(print, "body", 0)]; if (superclass) { parts.push(" < ", path.call(print, "body", 1)); } - // If the body is empty and does not contain any comments, we can just - // replace the body with a semi-colon. - if ( - stmts.body.length === 1 && - stmts.body[0].type === "void_stmt" && - !stmts.body[0].comments - ) { - return group(concat([concat(parts), ifBreak(line, "; "), "end"])); + const declaration = group(concat(parts)); + if (isEmptyBodyStmt(bodystmt)) { + return group(concat([declaration, hardline, "end"])); } return group( concat([ - concat(parts), + declaration, indent(concat([hardline, path.call(print, "body", 2)])), concat([hardline, "end"]) ]) @@ -36,16 +24,11 @@ function printClass(path, opts, print) { } function printModule(path, opts, print) { + const node = path.getValue(); const declaration = group(concat(["module ", path.call(print, "body", 0)])); - // If the body is empty, we can replace with a ; - const stmts = path.getValue().body[1].body[0]; - if ( - stmts.body.length === 1 && - stmts.body[0].type === "void_stmt" && - !stmts.body[0].comments - ) { - return group(concat([declaration, ifBreak(line, "; "), "end"])); + if (isEmptyBodyStmt(node.body[1])) { + return group(concat([declaration, hardline, "end"])); } return group( @@ -58,9 +41,16 @@ function printModule(path, opts, print) { } function printSClass(path, opts, print) { + const bodystmt = path.getValue().body[1]; + const declaration = concat(["class << ", path.call(print, "body", 0)]); + + if (isEmptyBodyStmt(bodystmt)) { + return group(concat([declaration, hardline, "end"])); + } + return group( concat([ - concat(["class << ", path.call(print, "body", 0)]), + declaration, indent(concat([hardline, path.call(print, "body", 1)])), concat([hardline, "end"]) ]) diff --git a/src/ruby/nodes/conditionals.js b/src/ruby/nodes/conditionals.js index f4729134..fc65e4e1 100644 --- a/src/ruby/nodes/conditionals.js +++ b/src/ruby/nodes/conditionals.js @@ -219,7 +219,7 @@ const printConditional = (keyword) => (path, { rubyModifier }, print) => { // If the body of the conditional is empty, then we explicitly have to use the // block form. - if (isEmptyStmts(statements) && !statements.body[0].comments) { + if (isEmptyStmts(statements)) { return concat([ `${keyword} `, align(keyword.length + 1, path.call(print, "body", 0)), diff --git a/src/ruby/nodes/loops.js b/src/ruby/nodes/loops.js index 65aa0584..e78e40ee 100644 --- a/src/ruby/nodes/loops.js +++ b/src/ruby/nodes/loops.js @@ -10,7 +10,7 @@ const { softline } = require("../../prettier"); -const { containsAssignment } = require("../../utils"); +const { containsAssignment, isEmptyStmts } = require("../../utils"); const inlineEnsureParens = require("../../utils/inlineEnsureParens"); function printLoop(keyword, modifier) { @@ -19,17 +19,11 @@ function printLoop(keyword, modifier) { // If the only statement inside this while loop is a void statement, then we // can shorten to just displaying the predicate and then a semicolon. - if ( - stmts.body.length === 1 && - stmts.body[0].type === "void_stmt" && - !stmts.body[0].comments - ) { + if (isEmptyStmts(stmts)) { return group( concat([ - keyword, - " ", - path.call(print, "body", 0), - ifBreak(softline, "; "), + group(concat([keyword, " ", path.call(print, "body", 0)])), + hardline, "end" ]) ); diff --git a/src/ruby/nodes/methods.js b/src/ruby/nodes/methods.js index b98b6514..f3b8d9d5 100644 --- a/src/ruby/nodes/methods.js +++ b/src/ruby/nodes/methods.js @@ -1,8 +1,9 @@ const { concat, group, hardline, indent, line } = require("../../prettier"); +const { isEmptyBodyStmt } = require("../../utils"); function printMethod(offset) { return function printMethodWithOffset(path, opts, print) { - const [_name, params, body] = path.getValue().body.slice(offset); + const [_name, params, bodystmt] = path.getValue().body.slice(offset); const declaration = ["def "]; // In this case, we're printing a method that's defined as a singleton, so @@ -24,16 +25,8 @@ function printMethod(offset) { parens ? ")" : "" ); - // If the body is empty, we can replace with a ; - const stmts = body.body[0].body; - - if ( - !body.body.slice(1).some((node) => node) && - stmts.length === 1 && - stmts[0].type === "void_stmt" && - !stmts[0].comments - ) { - return group(concat(declaration.concat(["; end"]))); + if (isEmptyBodyStmt(bodystmt)) { + return group(concat([group(concat(declaration)), hardline, "end"])); } return group( diff --git a/src/ruby/nodes/statements.js b/src/ruby/nodes/statements.js index 1a452610..0c40114a 100644 --- a/src/ruby/nodes/statements.js +++ b/src/ruby/nodes/statements.js @@ -12,15 +12,13 @@ const { trim } = require("../../prettier"); +const { isEmptyStmts } = require("../../utils"); + function printBodyStmt(path, opts, print) { const [stmts, rescue, elseClause, ensure] = path.getValue().body; const parts = []; - if ( - stmts.body.length > 1 || - stmts.body[0].type != "void_stmt" || - stmts.body[0].comments - ) { + if (!isEmptyStmts(stmts)) { parts.push(path.call(print, "body", 0)); } diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index feb64b5a..9c064cba 100755 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -17,7 +17,8 @@ require 'json' require 'ripper' -module Prettier; end +module Prettier +end class Prettier::Parser < Ripper attr_reader :source, :lines, :scanner_events, :line_counts diff --git a/src/utils.js b/src/utils.js index d3efa9c0..965e25f0 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,6 +1,7 @@ module.exports = { containsAssignment: require("./utils/containsAssignment"), getTrailingComma: require("./utils/getTrailingComma"), + isEmptyBodyStmt: require("./utils/isEmptyBodyStmt"), isEmptyStmts: require("./utils/isEmptyStmts"), hasAncestor: require("./utils/hasAncestor"), literal: require("./utils/literal"), diff --git a/src/utils/isEmptyBodyStmt.js b/src/utils/isEmptyBodyStmt.js new file mode 100644 index 00000000..72668019 --- /dev/null +++ b/src/utils/isEmptyBodyStmt.js @@ -0,0 +1,7 @@ +const isEmptyStmts = require("./isEmptyStmts"); + +function isEmptyBodyStmt(node) { + return isEmptyStmts(node.body[0]) && !node.body.slice(1).some(Boolean); +} + +module.exports = isEmptyBodyStmt; diff --git a/src/utils/isEmptyStmts.js b/src/utils/isEmptyStmts.js index 4d790400..665df85e 100644 --- a/src/utils/isEmptyStmts.js +++ b/src/utils/isEmptyStmts.js @@ -1,7 +1,11 @@ -const isEmptyStmts = (node) => - node && - node.type === "stmts" && - node.body.length === 1 && - node.body[0].type === "void_stmt"; +function isEmptyStmts(node) { + return ( + node && + node.type === "stmts" && + node.body.length === 1 && + node.body[0].type === "void_stmt" && + !node.body[0].comments + ); +} module.exports = isEmptyStmts; diff --git a/test/js/ruby/nodes/class.test.js b/test/js/ruby/nodes/class.test.js index 57f1832d..7823c0c3 100644 --- a/test/js/ruby/nodes/class.test.js +++ b/test/js/ruby/nodes/class.test.js @@ -5,8 +5,11 @@ describe("class", () => { const content = ruby(` module Pret module Tier - class Plugin; end - module Ruby; end + class Plugin + end + + module Ruby + end end end `); @@ -17,7 +20,8 @@ describe("class", () => { test("inheritance", () => { const content = ruby(` module Prettier - class Ruby < Object; end + class Ruby < Object + end end `); @@ -33,7 +37,8 @@ describe("class", () => { test("class push blocks", () => { const content = ruby(` class << Prettier - def foo; end + def foo + end end `); diff --git a/test/js/ruby/nodes/kwargs.test.js b/test/js/ruby/nodes/kwargs.test.js index be5ad7cb..eac9c958 100644 --- a/test/js/ruby/nodes/kwargs.test.js +++ b/test/js/ruby/nodes/kwargs.test.js @@ -1,8 +1,30 @@ +const { ruby } = require("../../utils"); + describe("kwargs", () => { - test("basic", () => expect("def foo(bar: baz); end").toMatchFormat()); + test("basic", () => { + const content = ruby(` + def foo(bar: baz) + end + `); + + return expect(content).toMatchFormat(); + }); + + test("optional", () => { + const content = ruby(` + def foo(bar:) + end + `); + + return expect(content).toMatchFormat(); + }); - test("optional", () => expect("def foo(bar:); end").toMatchFormat()); + test("double splat", () => { + const content = ruby(` + def foo(bar:, **baz) + end + `); - test("double splat", () => - expect("def foo(bar:, **baz); end").toMatchFormat()); + return expect(content).toMatchFormat(); + }); }); diff --git a/test/js/ruby/nodes/loops.test.js b/test/js/ruby/nodes/loops.test.js index f195e02b..be0ef566 100644 --- a/test/js/ruby/nodes/loops.test.js +++ b/test/js/ruby/nodes/loops.test.js @@ -4,11 +4,11 @@ describe.each(["while", "until"])("%s", (keyword) => { test("aligns predicates", () => expect(`foo ${keyword} ${long} || ${long}`).toChangeFormat( ruby(` - ${keyword} ${long} || - ${Array(keyword.length).fill().join(" ")}${long} - foo - end - `) + ${keyword} ${long} || + ${Array(keyword.length).fill().join(" ")}${long} + foo + end + `) )); describe("inlines allowed", () => { @@ -78,7 +78,7 @@ describe.each(["while", "until"])("%s", (keyword) => { end `); - return expect(content).toChangeFormat("while foo; end"); + return expect(content).toMatchFormat(); }); test("empty body, long predicate", () => { @@ -129,9 +129,7 @@ describe.each(["while", "until"])("%s", (keyword) => { end `); - return expect(content).toChangeFormat("while foo; end", { - rubyModifier: false - }); + return expect(content).toMatchFormat({ rubyModifier: false }); }); test("empty body, long predicate", () => { diff --git a/test/js/ruby/nodes/method.test.js b/test/js/ruby/nodes/method.test.js index ad624343..2ba962d8 100644 --- a/test/js/ruby/nodes/method.test.js +++ b/test/js/ruby/nodes/method.test.js @@ -2,30 +2,42 @@ const { long, ruby } = require("../../utils"); describe("method", () => { describe("definitions", () => { - test("shorthand for empty methods", () => - expect("def foo; end").toMatchFormat()); + test("shorthand for empty methods", () => { + const expected = ruby(` + def foo + end + `); - test("shorthand for empty methods with parens", () => - expect("def foo(); end").toMatchFormat()); + return expect("def foo; end").toChangeFormat(expected); + }); + + test("shorthand for empty methods with parens", () => { + const expected = ruby(` + def foo() + end + `); + + return expect("def foo(); end").toChangeFormat(expected); + }); test("single arg, no parens", () => - expect("def foo bar\nend").toChangeFormat("def foo(bar); end")); + expect("def foo bar\nend").toChangeFormat("def foo(bar)\nend")); test("single arg, with parens", () => - expect("def foo(bar)\nend").toChangeFormat("def foo(bar); end")); + expect("def foo(bar)\nend").toChangeFormat("def foo(bar)\nend")); test("shorthand for empty singleton methods", () => - expect("def self.foo; end").toMatchFormat()); + expect("def self.foo; end").toChangeFormat("def self.foo\nend")); test("shorthand for empty singleton methods with parens", () => - expect("def self.foo(); end").toMatchFormat()); + expect("def self.foo(); end").toChangeFormat("def self.foo()\nend")); test("singleton, single arg, no parens", () => - expect("def self.foo bar\nend").toChangeFormat("def self.foo(bar); end")); + expect("def self.foo bar\nend").toChangeFormat("def self.foo(bar)\nend")); test("singleton, single arg, with parens", () => expect("def self.foo(bar)\nend").toChangeFormat( - "def self.foo(bar); end" + "def self.foo(bar)\nend" )); test("shorthand with a body", () => @@ -34,10 +46,10 @@ describe("method", () => { )); test("single splat arg with no name", () => - expect("def foo(*); end").toMatchFormat()); + expect("def foo(*); end").toChangeFormat("def foo(*)\nend")); test("double splat arg with no name", () => - expect("def foo(**); end").toMatchFormat()); + expect("def foo(**); end").toChangeFormat("def foo(**)\nend")); test("with helper method", () => { const content = ruby(` @@ -75,7 +87,8 @@ describe("method", () => { def foo( ${long}:, a${long}: - ); end + ) + end `); return expect(content).toChangeFormat(expected); @@ -112,7 +125,14 @@ describe("method", () => { }); if (process.env.RUBY_VERSION >= "2.7") { - test("nokw_param", () => expect("def foo(**nil); end").toMatchFormat()); + test("nokw_param", () => { + const expected = ruby(` + def foo(**nil) + end + `); + + return expect("def foo(**nil); end").toChangeFormat(expected); + }); test("args_forward", () => { const content = ruby(` From ef5d3bff7294bba334a4055778ee52b31f01b499 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Thu, 21 Jan 2021 19:01:20 -0500 Subject: [PATCH 095/785] Revert method definition shorthand --- CHANGELOG.md | 5 ++-- src/ruby/nodes/methods.js | 2 +- test/js/ruby/nodes/class.test.js | 3 +- test/js/ruby/nodes/kwargs.test.js | 30 +++---------------- test/js/ruby/nodes/method.test.js | 48 +++++++++---------------------- 5 files changed, 22 insertions(+), 66 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a9dbb39..29bb964c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#794](https://github.com/prettier/plugin-ruby/issues/794) djrodgerspryor, kddeisz - Fix embedded parser parsing by stripping common leading whitespace before passing on the content. - [#793](https://github.com/prettier/plugin-ruby/issues/793) djrodgerspryor, kddeisz - Do not include trailing commas on arguments within `arg_paren` nodes if they could not be parsed with them (`command` and `command_call`). - [#788](https://github.com/prettier/plugin-ruby/issues/788) clarkdave, kddeisz - Break child hashes within a multi-line hash regardless of whether or not they can fit on one line. -- kddeisz - Stop using `;` to separate empty class definitions, module definitions, method definitions, and loops. +- kddeisz - Stop using `;` to separate empty class definitions, module definitions, and loops. ## [1.4.0] - 2021-01-15 @@ -325,8 +325,7 @@ return (a or b) if c? - kddeisz - Support for the `nokw_param` node for specifying when methods should no accept keywords, as in: ```ruby -def foo(**nil) -end +def foo(**nil); end ``` - kddeisz - Support for the `args_forward` node for forwarding all types of arguments, as in: diff --git a/src/ruby/nodes/methods.js b/src/ruby/nodes/methods.js index f3b8d9d5..59316257 100644 --- a/src/ruby/nodes/methods.js +++ b/src/ruby/nodes/methods.js @@ -26,7 +26,7 @@ function printMethod(offset) { ); if (isEmptyBodyStmt(bodystmt)) { - return group(concat([group(concat(declaration)), hardline, "end"])); + return group(concat(declaration.concat("; end"))); } return group( diff --git a/test/js/ruby/nodes/class.test.js b/test/js/ruby/nodes/class.test.js index 7823c0c3..27fdc136 100644 --- a/test/js/ruby/nodes/class.test.js +++ b/test/js/ruby/nodes/class.test.js @@ -37,8 +37,7 @@ describe("class", () => { test("class push blocks", () => { const content = ruby(` class << Prettier - def foo - end + def foo; end end `); diff --git a/test/js/ruby/nodes/kwargs.test.js b/test/js/ruby/nodes/kwargs.test.js index eac9c958..be5ad7cb 100644 --- a/test/js/ruby/nodes/kwargs.test.js +++ b/test/js/ruby/nodes/kwargs.test.js @@ -1,30 +1,8 @@ -const { ruby } = require("../../utils"); - describe("kwargs", () => { - test("basic", () => { - const content = ruby(` - def foo(bar: baz) - end - `); - - return expect(content).toMatchFormat(); - }); - - test("optional", () => { - const content = ruby(` - def foo(bar:) - end - `); - - return expect(content).toMatchFormat(); - }); + test("basic", () => expect("def foo(bar: baz); end").toMatchFormat()); - test("double splat", () => { - const content = ruby(` - def foo(bar:, **baz) - end - `); + test("optional", () => expect("def foo(bar:); end").toMatchFormat()); - return expect(content).toMatchFormat(); - }); + test("double splat", () => + expect("def foo(bar:, **baz); end").toMatchFormat()); }); diff --git a/test/js/ruby/nodes/method.test.js b/test/js/ruby/nodes/method.test.js index 2ba962d8..ad624343 100644 --- a/test/js/ruby/nodes/method.test.js +++ b/test/js/ruby/nodes/method.test.js @@ -2,42 +2,30 @@ const { long, ruby } = require("../../utils"); describe("method", () => { describe("definitions", () => { - test("shorthand for empty methods", () => { - const expected = ruby(` - def foo - end - `); + test("shorthand for empty methods", () => + expect("def foo; end").toMatchFormat()); - return expect("def foo; end").toChangeFormat(expected); - }); - - test("shorthand for empty methods with parens", () => { - const expected = ruby(` - def foo() - end - `); - - return expect("def foo(); end").toChangeFormat(expected); - }); + test("shorthand for empty methods with parens", () => + expect("def foo(); end").toMatchFormat()); test("single arg, no parens", () => - expect("def foo bar\nend").toChangeFormat("def foo(bar)\nend")); + expect("def foo bar\nend").toChangeFormat("def foo(bar); end")); test("single arg, with parens", () => - expect("def foo(bar)\nend").toChangeFormat("def foo(bar)\nend")); + expect("def foo(bar)\nend").toChangeFormat("def foo(bar); end")); test("shorthand for empty singleton methods", () => - expect("def self.foo; end").toChangeFormat("def self.foo\nend")); + expect("def self.foo; end").toMatchFormat()); test("shorthand for empty singleton methods with parens", () => - expect("def self.foo(); end").toChangeFormat("def self.foo()\nend")); + expect("def self.foo(); end").toMatchFormat()); test("singleton, single arg, no parens", () => - expect("def self.foo bar\nend").toChangeFormat("def self.foo(bar)\nend")); + expect("def self.foo bar\nend").toChangeFormat("def self.foo(bar); end")); test("singleton, single arg, with parens", () => expect("def self.foo(bar)\nend").toChangeFormat( - "def self.foo(bar)\nend" + "def self.foo(bar); end" )); test("shorthand with a body", () => @@ -46,10 +34,10 @@ describe("method", () => { )); test("single splat arg with no name", () => - expect("def foo(*); end").toChangeFormat("def foo(*)\nend")); + expect("def foo(*); end").toMatchFormat()); test("double splat arg with no name", () => - expect("def foo(**); end").toChangeFormat("def foo(**)\nend")); + expect("def foo(**); end").toMatchFormat()); test("with helper method", () => { const content = ruby(` @@ -87,8 +75,7 @@ describe("method", () => { def foo( ${long}:, a${long}: - ) - end + ); end `); return expect(content).toChangeFormat(expected); @@ -125,14 +112,7 @@ describe("method", () => { }); if (process.env.RUBY_VERSION >= "2.7") { - test("nokw_param", () => { - const expected = ruby(` - def foo(**nil) - end - `); - - return expect("def foo(**nil); end").toChangeFormat(expected); - }); + test("nokw_param", () => expect("def foo(**nil); end").toMatchFormat()); test("args_forward", () => { const content = ruby(` From e0606a4cfb908a4e2d8bd070d1bee638a1e276a3 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Thu, 21 Jan 2021 19:02:10 -0500 Subject: [PATCH 096/785] Bump to v1.5.0 --- CHANGELOG.md | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29bb964c..3c858c5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [1.5.0] - 2021-01-21 + ### Added - kddeisz - Add `.rbi` as a file type that we support. diff --git a/package.json b/package.json index b12272d5..8a96645c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "1.4.0", + "version": "1.5.0", "description": "prettier plugin for the Ruby programming language", "main": "src/plugin.js", "scripts": { From c4bf119fb0c3c90771e552b8cc99e89909f53608 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Fri, 22 Jan 2021 09:25:33 -0500 Subject: [PATCH 097/785] Move around some tests, simplify test suite --- test/js/ruby/errors.test.js | 8 ++++ test/js/ruby/nodes.test.js | 78 ------------------------------------- test/rb/metadata_test.rb | 1 - test/rb/parser_test.rb | 18 +++++++++ test/rb/test_helper.rb | 2 + 5 files changed, 28 insertions(+), 79 deletions(-) delete mode 100644 test/js/ruby/nodes.test.js create mode 100644 test/rb/parser_test.rb diff --git a/test/js/ruby/errors.test.js b/test/js/ruby/errors.test.js index 4310fed4..58a2612b 100644 --- a/test/js/ruby/errors.test.js +++ b/test/js/ruby/errors.test.js @@ -1,3 +1,11 @@ +const { print } = require("../../../src/ruby/printer"); + describe("errors", () => { test("invalid ruby", () => expect("<>").toFailFormat()); + + test("when encountering an unsupported node type", () => { + const path = { getValue: () => ({ type: "unsupported", body: {} }) }; + + expect(() => print(path)).toThrow("Unsupported"); + }); }); diff --git a/test/js/ruby/nodes.test.js b/test/js/ruby/nodes.test.js deleted file mode 100644 index c1adaee1..00000000 --- a/test/js/ruby/nodes.test.js +++ /dev/null @@ -1,78 +0,0 @@ -const { spawnSync } = require("child_process"); - -const nodes = require("../../../src/ruby/nodes"); -const print = require("../../../src/ruby/printer").print; - -const expectedUnhandledNodes = [ - "alias_error", - "arg_ambiguous", - "args_add", - "args_new", - "assign_error", - "class_name_error", - "excessed_comma", - "heredoc_dedent", - "magic_comment", - "mlhs_add", - "mlhs_new", - "mrhs_add", - "mrhs_new", - "nokw_param", - "operator_ambiguous", - "param_error", - "parse_error", - "qsymbols_add", - "qsymbols_new", - "qwords_add", - "qwords_new", - "regexp_add", - "regexp_new", - "stmts_add", - "stmts_new", - "string_add", - "string_content", - "symbol", - "symbols_add", - "symbols_new", - "void_stmt", - "word_add", - "word_new", - "words_add", - "words_new", - "xstring_add", - "xstring_new" -]; - -const possibleNodes = () => { - const child = spawnSync("ruby", [ - "--disable-gems", - "-rripper", - "-e", - "puts Ripper::PARSER_EVENTS" - ]); - - const error = child.stderr.toString(); - if (error) { - throw new Error(error); - } - - return child.stdout.toString().trim().split("\n"); -}; - -describe("node support", () => { - test("handles all ripper parsing events", () => { - const supportedNodes = Object.keys(nodes) - .concat(expectedUnhandledNodes) - .sort(); - - expect(supportedNodes).toEqual( - expect.arrayContaining(possibleNodes().sort()) - ); - }); - - test("when encountering an unsupported node type", () => { - const path = { getValue: () => ({ type: "unsupported", body: {} }) }; - - expect(() => print(path)).toThrow("Unsupported"); - }); -}); diff --git a/test/rb/metadata_test.rb b/test/rb/metadata_test.rb index adfdc06e..815839b1 100644 --- a/test/rb/metadata_test.rb +++ b/test/rb/metadata_test.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require 'test_helper' -require_relative '../../src/ruby/parser' class MetadataTest < Minitest::Test def test_BEGIN diff --git a/test/rb/parser_test.rb b/test/rb/parser_test.rb new file mode 100644 index 00000000..f2a5dae7 --- /dev/null +++ b/test/rb/parser_test.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'test_helper' + +class ParserTest < Minitest::Test + def test_events + # This is a list of all of the parser events that Ripper will emit + all_events = Ripper::PARSER_EVENTS + + # This is a list of all of the parser events for which we have an explicitly + # defined event handler in our parser. + handled_events = + Prettier::Parser.private_instance_methods.grep(/\Aon_(.+)/) { $1.to_sym } + + # Assert here that there are no missing events. + assert_empty(all_events - handled_events) + end +end diff --git a/test/rb/test_helper.rb b/test/rb/test_helper.rb index 4b93f91d..4d77642c 100644 --- a/test/rb/test_helper.rb +++ b/test/rb/test_helper.rb @@ -3,4 +3,6 @@ $LOAD_PATH.unshift(File.expand_path('../../lib', __dir__)) require 'prettier' +require_relative '../../src/ruby/parser' + require 'minitest/autorun' From d0d18c2abc3bf5abf6e2fb4934cb0f1dada58157 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Tue, 26 Jan 2021 11:20:10 -0500 Subject: [PATCH 098/785] Fix for #799 --- CHANGELOG.md | 4 ++++ src/ruby/parser.rb | 4 +++- test/js/ruby/comments.test.js | 11 +++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c858c5b..6f1e6233 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Changed + +- [#799](https://github.com/prettier/plugin-ruby/issues/799) - jscheid, kddeisz - Multi-byte characters shouldn't give invalid source string bounds. + ## [1.5.0] - 2021-01-21 ### Added diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 9c064cba..15af601b 100755 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -42,7 +42,9 @@ def initialize(source, *args) @scanner_events = [] @line_counts = [0] - @source.lines.each { |line| @line_counts << @line_counts.last + line.size } + @source.lines.each do |line| + @line_counts << @line_counts.last + line.bytesize + end end def self.parse(source) diff --git a/test/js/ruby/comments.test.js b/test/js/ruby/comments.test.js index f82ea413..2d9e1da2 100644 --- a/test/js/ruby/comments.test.js +++ b/test/js/ruby/comments.test.js @@ -237,4 +237,15 @@ describe("comments", () => { return expect(content).toMatchFormat(); }); }); + + test("works with multi-byte characters", () => { + const content = ruby(` + [ + ['先生小'], # + ['小'] + ] + `); + + return expect(content).toMatchFormat(); + }); }); From c65328228a64a7214bcdbc7f1b2c08488863aeec Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Tue, 26 Jan 2021 11:22:46 -0500 Subject: [PATCH 099/785] Fix for #801 --- CHANGELOG.md | 1 + src/utils/inlineEnsureParens.js | 9 ++++++++- test/js/ruby/nodes/conditionals.test.js | 10 ++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f1e6233..c7ca7604 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Changed - [#799](https://github.com/prettier/plugin-ruby/issues/799) - jscheid, kddeisz - Multi-byte characters shouldn't give invalid source string bounds. +- [#801](https://github.com/prettier/plugin-ruby/issues/801) - jscheid, kddeisz - When converting a conditional to the modifier form, make sure to add parentheses if there is a chained method call. ## [1.5.0] - 2021-01-21 diff --git a/src/utils/inlineEnsureParens.js b/src/utils/inlineEnsureParens.js index e1efab84..91170570 100644 --- a/src/utils/inlineEnsureParens.js +++ b/src/utils/inlineEnsureParens.js @@ -1,4 +1,11 @@ -const needsParens = ["args", "assign", "assoc_new", "massign", "opassign"]; +const needsParens = [ + "args", + "assign", + "assoc_new", + "call", + "massign", + "opassign" +]; // If you have a modifier statement (for instance an inline if statement or an // inline while loop) there are times when you need to wrap the entire statement diff --git a/test/js/ruby/nodes/conditionals.test.js b/test/js/ruby/nodes/conditionals.test.js index cd6bc1fd..db97e830 100644 --- a/test/js/ruby/nodes/conditionals.test.js +++ b/test/js/ruby/nodes/conditionals.test.js @@ -166,6 +166,16 @@ describe("conditionals", () => { expect(`hash[:key] = ${keyword} false then :value end`).toChangeFormat( `hash[:key] = (:value ${keyword} false)` )); + + test("wraps inline version with calls", () => { + const content = ruby(` + if true + false + end.to_s + `); + + return expect(content).toChangeFormat("(false if true).to_s"); + }); }); }); From 4df1970fa21fc55526b282179c3b60bff0ee3383 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Tue, 26 Jan 2021 11:22:59 -0500 Subject: [PATCH 100/785] Allow bin/sexp to default to test.rb --- bin/sexp | 10 ++++++++- src/ruby/parser.rb | 53 ++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 58 insertions(+), 5 deletions(-) diff --git a/bin/sexp b/bin/sexp index 041330ce..adb1f4bf 100755 --- a/bin/sexp +++ b/bin/sexp @@ -20,7 +20,15 @@ PP.prepend( end ) -source = File.file?(ARGV[0]) ? File.read(ARGV[0]) : ARGV[0].gsub('\\n', "\n") +source = + if !ARGV[0] + File.read('test.rb') + elsif File.file?(ARGV[0]) + File.read(ARGV[0]) + else + ARGV[0].gsub('\\n', "\n") + end + parsed = Prettier::Parser.new(source).parse puts '=== SOURCE === ' diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 15af601b..300cc426 100755 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -21,7 +21,40 @@ module Prettier end class Prettier::Parser < Ripper - attr_reader :source, :lines, :scanner_events, :line_counts + # Represents a line in the source. If this class is being used, it means that + # every character in the string is 1 byte in length, so we can just return the + # start of the line + the index. + class SingleByteString + def initialize(start) + @start = start + end + + def [](byteindex) + @start + byteindex + end + end + + # Represents a line in the source. If this class is being used, it means that + # there are characters in the string that are multi-byte, so we will build up + # an array of indices, such that array[byteindex] will be equal to the index + # of the character within the string. + class MultiByteString + def initialize(start, line) + @indices = [] + + line + .each_char + .with_index(start) do |char, index| + char.bytesize.times { @indices << index } + end + end + + def [](byteindex) + @indices[byteindex] + end + end + + attr_reader :source, :lines, :scanner_events # This is an attr_accessor so Stmts objects can grab comments out of this # array and attach them to themselves. @@ -40,10 +73,22 @@ def initialize(source, *args) @heredocs = [] @scanner_events = [] - @line_counts = [0] + @line_counts = [] + + # Here we're going to build up a list of SingleByteString or MultiByteString + # objects. They're each going to represent a string in the source. They are + # used by the `char_pos` method to determine where we are in the source + # string. + last_index = 0 @source.lines.each do |line| - @line_counts << @line_counts.last + line.bytesize + if line.size == line.bytesize + @line_counts << SingleByteString.new(last_index) + else + @line_counts << MultiByteString.new(last_index, line) + end + + last_index += line.size end end @@ -62,7 +107,7 @@ def self.parse(source) # this line, then we add the number of columns into this line that we've gone # through. def char_pos - line_counts[lineno - 1] + column + @line_counts[lineno - 1][column] end # As we build up a list of scanner events, we'll periodically need to go From 22136c53a0fc734681be9f8324bf2f915728b2d3 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 27 Jan 2021 19:54:21 -0500 Subject: [PATCH 101/785] Fix for #803 --- CHANGELOG.md | 1 + bin/print | 8 ++++- src/ruby/nodes/arrays.js | 69 ++++++++++++++++++++------------------ src/ruby/nodes/commands.js | 2 +- src/ruby/printer.js | 11 ++++-- 5 files changed, 53 insertions(+), 38 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7ca7604..f9a83055 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#799](https://github.com/prettier/plugin-ruby/issues/799) - jscheid, kddeisz - Multi-byte characters shouldn't give invalid source string bounds. - [#801](https://github.com/prettier/plugin-ruby/issues/801) - jscheid, kddeisz - When converting a conditional to the modifier form, make sure to add parentheses if there is a chained method call. +- [#803](https://github.com/prettier/plugin-ruby/issues/803) - jscheid, kddeisz - Fix `formatWithCursor` support to match new parser format. ## [1.5.0] - 2021-01-21 diff --git a/bin/print b/bin/print index 4e38bc57..2889b994 100755 --- a/bin/print +++ b/bin/print @@ -22,4 +22,10 @@ if (fs.existsSync(process.argv[contentIdx])) { content = process.argv.slice(contentIdx).join(" ").replace(/\\n/g, "\n"); } -console.log(prettier.format(content, { parser, plugins: ["."] })); +const { formatted } = prettier.formatWithCursor(content, { + parser, + plugins: ["."], + cursorOffset: 1 +}); + +console.log(formatted); diff --git a/src/ruby/nodes/arrays.js b/src/ruby/nodes/arrays.js index f8fb8bc2..3a5c5587 100644 --- a/src/ruby/nodes/arrays.js +++ b/src/ruby/nodes/arrays.js @@ -63,33 +63,30 @@ function isSymbolArray(args) { // Prints out a word that is a part of a special array literal that accepts // interpolation. The body is an array of either plain strings or interpolated // expressions. -function printSpecialArrayWord(path, opts, print) { +function printArrayLiteralWord(path, opts, print) { return concat(path.map(print, "body")); } // Prints out a special array literal. Accepts the parts of the array literal as // an argument, where the first element of the parts array is a string that // contains the special start. -function printSpecialArrayParts(parts) { +function printArrayLiteral(start, parts) { return group( concat([ - parts[0], + start, "[", - indent(concat([softline, join(line, parts.slice(1))])), + indent(concat([softline, join(line, parts)])), concat([softline, "]"]) ]) ); } -// Generates a print function with an embedded special start character for the -// specific type of array literal that we're dealing with. The print function -// returns an array as it expects to eventually be handed off to -// printSpecialArrayParts. -function printSpecialArray(start) { - return function printSpecialArrayWithStart(path, opts, print) { - return [start].concat(path.map(print, "body")); - }; -} +const arrayLiteralStarts = { + qsymbols: "%i", + qwords: "%w", + symbols: "%I", + words: "%W" +}; // An array node is any literal array in Ruby. This includes all of the special // array literals as well as regular arrays. If it is a special array literal @@ -105,30 +102,40 @@ function printArray(path, opts, print) { return printEmptyCollection(path, opts, "[", "]"); } - // If we have an array that contains only simple string literals with no - // spaces or interpolation, then we're going to print a %w array. - if (opts.rubyArrayLiteral && isStringArray(args)) { - const printString = (stringPath) => stringPath.call(print, "body", 0); - const parts = path.map(printString, "body", 0, "body"); + if (opts.rubyArrayLiteral) { + // If we have an array that contains only simple string literals with no + // spaces or interpolation, then we're going to print a %w array. + if (isStringArray(args)) { + const printString = (stringPath) => stringPath.call(print, "body", 0); + const parts = path.map(printString, "body", 0, "body"); - return printSpecialArrayParts(["%w"].concat(parts)); - } + return printArrayLiteral("%w", parts); + } - // If we have an array that contains only simple symbol literals with no - // interpolation, then we're going to print a %i array. - if (opts.rubyArrayLiteral && isSymbolArray(args)) { - const printSymbol = (symbolPath) => symbolPath.call(print, "body", 0); - const parts = path.map(printSymbol, "body", 0, "body"); + // If we have an array that contains only simple symbol literals with no + // interpolation, then we're going to print a %i array. + if (isSymbolArray(args)) { + const printSymbol = (symbolPath) => symbolPath.call(print, "body", 0); + const parts = path.map(printSymbol, "body", 0, "body"); - return printSpecialArrayParts(["%i"].concat(parts)); + return printArrayLiteral("%i", parts); + } } // If we don't have a regular args node at this point then we have a special // array literal. In that case we're going to print out the body (which will // return to us an array with the first one being the start of the array) and - // send that over to the printSpecialArrayParts function. + // send that over to the printArrayLiteral function. if (!["args", "args_add_star"].includes(args.type)) { - return printSpecialArrayParts(path.call(print, "body", 0)); + return path.call( + (arrayPath) => + printArrayLiteral( + arrayLiteralStarts[arrayPath.getValue().type], + arrayPath.map(print, "body") + ), + "body", + 0 + ); } // Here we have a normal array of any type of object with no special literal @@ -151,9 +158,5 @@ function printArray(path, opts, print) { module.exports = { array: printArray, - qsymbols: printSpecialArray("%i"), - qwords: printSpecialArray("%w"), - symbols: printSpecialArray("%I"), - word: printSpecialArrayWord, - words: printSpecialArray("%W") + word: printArrayLiteralWord }; diff --git a/src/ruby/nodes/commands.js b/src/ruby/nodes/commands.js index a379f040..3eebd41f 100644 --- a/src/ruby/nodes/commands.js +++ b/src/ruby/nodes/commands.js @@ -73,7 +73,7 @@ function printCommand(path, opts, print) { } else if (hasDef(path.getValue())) { breakArgs = joinedArgs; } else { - breakArgs = align(command.length + 1, joinedArgs); + breakArgs = align(docLength(command) + 1, joinedArgs); } return group( diff --git a/src/ruby/printer.js b/src/ruby/printer.js index 565d3363..84094433 100644 --- a/src/ruby/printer.js +++ b/src/ruby/printer.js @@ -38,7 +38,8 @@ const noComments = [ "args_add_star", "mlhs", "mlhs_add_post", - "mlhs_add_star" + "mlhs_add_star", + "mlhs_paren" ]; // Certain nodes are used more for organizational purposed than for actually @@ -97,8 +98,12 @@ function getCommentChildNodes(node) { return parts; } - default: - return node.body; + default: { + if (Array.isArray(node.body)) { + return node.body.filter((child) => child && typeof child === "object"); + } + return []; + } } } From 1efac732644e39d60d859ddf978be70783f9c9b9 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 27 Jan 2021 20:06:01 -0500 Subject: [PATCH 102/785] Bump to v1.5.1 --- CHANGELOG.md | 6 +++++- package.json | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9a83055..7c83dea4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [1.5.1] - 2021-01-27 + ### Changed - [#799](https://github.com/prettier/plugin-ruby/issues/799) - jscheid, kddeisz - Multi-byte characters shouldn't give invalid source string bounds. @@ -1069,7 +1071,9 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.4.0...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.5.1...HEAD +[1.5.1]: https://github.com/prettier/plugin-ruby/compare/v1.5.0...v1.5.1 +[1.5.0]: https://github.com/prettier/plugin-ruby/compare/v1.4.0...v1.5.0 [1.4.0]: https://github.com/prettier/plugin-ruby/compare/v1.3.0...v1.4.0 [1.3.0]: https://github.com/prettier/plugin-ruby/compare/v1.2.5...v1.3.0 [1.2.5]: https://github.com/prettier/plugin-ruby/compare/v1.2.4...v1.2.5 diff --git a/package.json b/package.json index 8a96645c..2a3bb947 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "1.5.0", + "version": "1.5.1", "description": "prettier plugin for the Ruby programming language", "main": "src/plugin.js", "scripts": { From 53dd48365dff1fb70428788de3cf805334bee0fc Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Fri, 29 Jan 2021 21:58:58 +0200 Subject: [PATCH 103/785] Rename literalLineNoBreak to literallineWithoutBreakParent --- src/ruby/embed.js | 12 +++++++----- src/ruby/nodes/heredocs.js | 8 +++++--- src/utils.js | 2 +- src/utils/literalLineNoBreak.js | 7 ------- src/utils/literallineWithoutBreakParent.js | 7 +++++++ 5 files changed, 20 insertions(+), 16 deletions(-) delete mode 100644 src/utils/literalLineNoBreak.js create mode 100644 src/utils/literallineWithoutBreakParent.js diff --git a/src/ruby/embed.js b/src/ruby/embed.js index 884bbcd5..aa19e737 100644 --- a/src/ruby/embed.js +++ b/src/ruby/embed.js @@ -8,7 +8,7 @@ const { stripTrailingHardline } = require("../prettier"); -const { literalLineNoBreak } = require("../utils"); +const { literallineWithoutBreakParent } = require("../utils"); const parsers = { css: "css", @@ -30,7 +30,7 @@ function replaceNewlines(doc) { ? concat( currentDoc .split(/(\n)/g) - .map((v, i) => (i % 2 === 0 ? v : literalLineNoBreak)) + .map((v, i) => (i % 2 === 0 ? v : literallineWithoutBreakParent)) ) : currentDoc ); @@ -106,7 +106,7 @@ function embed(path, print, textToDoc, _opts) { // Pass that content into the embedded parser. Get back the doc node. const formatted = concat([ - literalLineNoBreak, + literallineWithoutBreakParent, replaceNewlines(stripTrailingHardline(textToDoc(content, { parser }))) ]); @@ -119,7 +119,7 @@ function embed(path, print, textToDoc, _opts) { group( concat([ indent(markAsRoot(formatted)), - literalLineNoBreak, + literallineWithoutBreakParent, ending.trim() ]) ) @@ -132,7 +132,9 @@ function embed(path, print, textToDoc, _opts) { return markAsRoot( concat([ path.call(print, "beging"), - lineSuffix(group(concat([formatted, literalLineNoBreak, ending.trim()]))) + lineSuffix( + group(concat([formatted, literallineWithoutBreakParent, ending.trim()])) + ) ]) ); } diff --git a/src/ruby/nodes/heredocs.js b/src/ruby/nodes/heredocs.js index 0ceb6e9b..26f6e381 100644 --- a/src/ruby/nodes/heredocs.js +++ b/src/ruby/nodes/heredocs.js @@ -1,5 +1,5 @@ const { concat, group, lineSuffix, join } = require("../../prettier"); -const { literalLineNoBreak } = require("../../utils"); +const { literallineWithoutBreakParent } = require("../../utils"); function printHeredoc(path, opts, print) { const { body, ending } = path.getValue(); @@ -11,7 +11,7 @@ function printHeredoc(path, opts, print) { } // In this case, the part of the string is just regular string content - return join(literalLineNoBreak, part.body.split("\n")); + return join(literallineWithoutBreakParent, part.body.split("\n")); }); // We use a literalline break because matching indentation is required @@ -23,7 +23,9 @@ function printHeredoc(path, opts, print) { concat([ path.call(print, "beging"), lineSuffix( - group(concat([literalLineNoBreak].concat(parts).concat(ending))) + group( + concat([literallineWithoutBreakParent].concat(parts).concat(ending)) + ) ) ]) ); diff --git a/src/utils.js b/src/utils.js index 965e25f0..96f3f15c 100644 --- a/src/utils.js +++ b/src/utils.js @@ -5,7 +5,7 @@ module.exports = { isEmptyStmts: require("./utils/isEmptyStmts"), hasAncestor: require("./utils/hasAncestor"), literal: require("./utils/literal"), - literalLineNoBreak: require("./utils/literalLineNoBreak"), + literallineWithoutBreakParent: require("./utils/literallineWithoutBreakParent"), makeCall: require("./utils/makeCall"), noIndent: require("./utils/noIndent"), printEmptyCollection: require("./utils/printEmptyCollection"), diff --git a/src/utils/literalLineNoBreak.js b/src/utils/literalLineNoBreak.js deleted file mode 100644 index bdb058ce..00000000 --- a/src/utils/literalLineNoBreak.js +++ /dev/null @@ -1,7 +0,0 @@ -const literalLineNoBreak = { - type: "line", - hard: true, - literal: true -}; - -module.exports = literalLineNoBreak; diff --git a/src/utils/literallineWithoutBreakParent.js b/src/utils/literallineWithoutBreakParent.js new file mode 100644 index 00000000..2bd16c14 --- /dev/null +++ b/src/utils/literallineWithoutBreakParent.js @@ -0,0 +1,7 @@ +const literallineWithoutBreakParent = { + type: "line", + hard: true, + literal: true +}; + +module.exports = literallineWithoutBreakParent; From 430264d65722549b59afb71e29f8c1b6d9d9297d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Feb 2021 05:14:10 +0000 Subject: [PATCH 104/785] Bump eslint from 7.18.0 to 7.19.0 Bumps [eslint](https://github.com/eslint/eslint) from 7.18.0 to 7.19.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v7.18.0...v7.19.0) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2d79bf6a..5b963663 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1327,9 +1327,9 @@ eslint-visitor-keys@^2.0.0: integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== eslint@^7.8.1: - version "7.18.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.18.0.tgz#7fdcd2f3715a41fe6295a16234bd69aed2c75e67" - integrity sha512-fbgTiE8BfUJZuBeq2Yi7J3RB3WGUQ9PNuNbmgi6jt9Iv8qrkxfy19Ds3OpL1Pm7zg3BtTVhvcUZbIRQ0wmSjAQ== + version "7.19.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.19.0.tgz#6719621b196b5fad72e43387981314e5d0dc3f41" + integrity sha512-CGlMgJY56JZ9ZSYhJuhow61lMPPjUzWmChFya71Z/jilVos7mR/jPgaEfVGgMBY5DshbKdG8Ezb8FDCHcoMEMg== dependencies: "@babel/code-frame" "^7.0.0" "@eslint/eslintrc" "^0.3.0" From 92a539e5857f51421f8ac58f3aa40b2e5330282e Mon Sep 17 00:00:00 2001 From: Jonny Arnold Date: Tue, 2 Feb 2021 09:26:35 +0000 Subject: [PATCH 105/785] Move environment variable CI -> PLUGIN_RUBY_CI. This avoids conflicts with users' CI systems. --- .github/workflows/main.yml | 4 ++-- src/parser/server.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1a1587d6..9f23879f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,7 @@ jobs: # - truffleruby runs-on: ${{ matrix.os }} env: - CI: true + PLUGIN_RUBY_CI: true steps: - uses: actions/checkout@master @@ -55,7 +55,7 @@ jobs: name: Lint runs-on: ubuntu-latest env: - CI: true + PLUGIN_RUBY_CI: true steps: - uses: actions/checkout@master - uses: actions/setup-node@v2-beta diff --git a/src/parser/server.rb b/src/parser/server.rb index 57a2f986..19e93dc6 100644 --- a/src/parser/server.rb +++ b/src/parser/server.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'bundler/setup' if ENV['CI'] +require 'bundler/setup' if ENV['PLUGIN_RUBY_CI'] require 'socket' require 'json' From 24243a432c73569ad952486452afba56de2b8184 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 3 Feb 2021 09:52:42 -0500 Subject: [PATCH 106/785] Fix up JRuby binary nodes with comparison operators --- CHANGELOG.md | 4 ++++ src/parser/server.rb | 2 +- src/ruby/parser.rb | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c83dea4..e22acafe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Changed + +- kddeisz - Fix up `binary` node comparison operators so that it will handle either Symbol literals or the `@op` nodes which are incorrectly coming from JRuby (https://github.com/jruby/jruby/issues/6548). + ## [1.5.1] - 2021-01-27 ### Changed diff --git a/src/parser/server.rb b/src/parser/server.rb index 57a2f986..2e802570 100644 --- a/src/parser/server.rb +++ b/src/parser/server.rb @@ -14,7 +14,7 @@ # Make sure we trap these signals to be sure we get the quit command coming from # the parent node process quit = false -trap(:QUIT) { quit = true } +trap(:QUIT) { quit = true } if RUBY_PLATFORM != 'java' trap(:INT) { quit = true } trap(:TERM) { quit = true } diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 300cc426..d51965db 100755 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -565,6 +565,12 @@ def on_begin(bodystmt) # binary is a parser event that represents a binary operation between two # values. def on_binary(left, oper, right) + # On most Ruby implementations, oper is a Symbol that represents that + # operation being performed. For instance in the example `1 < 2`, the `oper` + # object would be `:<`. However, on JRuby, it's an `@op` node, so here we're + # going to explicitly convert it into the same normalized form. + oper = scanner_events.delete(oper)[:body] unless oper.is_a?(Symbol) + { type: :binary, body: [left, oper, right], From 637b841734fca2ee6da8237a5625ae499b838d3a Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 3 Feb 2021 09:58:30 -0500 Subject: [PATCH 107/785] Bump to v1.5.2 --- CHANGELOG.md | 7 +++++-- package.json | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e22acafe..5717d85e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [1.5.2] - 2021-02-03 + ### Changed - kddeisz - Fix up `binary` node comparison operators so that it will handle either Symbol literals or the `@op` nodes which are incorrectly coming from JRuby (https://github.com/jruby/jruby/issues/6548). @@ -203,7 +205,7 @@ end - kddeisz - Fix up a bug with constant aliases, e.g., `alias in IN`. - andyw8, kddeisz - Ensure `rescue` comments stay on the same line as their declaration. -# [0.22.0] - 2020-12-08 +## [0.22.0] - 2020-12-08 ### Changed @@ -1075,7 +1077,8 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.5.1...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.5.2...HEAD +[1.5.2]: https://github.com/prettier/plugin-ruby/compare/v1.5.1...v1.5.2 [1.5.1]: https://github.com/prettier/plugin-ruby/compare/v1.5.0...v1.5.1 [1.5.0]: https://github.com/prettier/plugin-ruby/compare/v1.4.0...v1.5.0 [1.4.0]: https://github.com/prettier/plugin-ruby/compare/v1.3.0...v1.4.0 diff --git a/package.json b/package.json index 2a3bb947..35f3c823 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "1.5.1", + "version": "1.5.2", "description": "prettier plugin for the Ruby programming language", "main": "src/plugin.js", "scripts": { From d141106e944569b183f3ae36124421fa4beb097e Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Thu, 4 Feb 2021 16:33:42 -0500 Subject: [PATCH 108/785] Fix for #812 --- CHANGELOG.md | 4 ++ src/ruby/nodes/args.js | 77 +++++++++++++++++++++++-------- test/js/ruby/nodes/method.test.js | 24 +++++++++- 3 files changed, 86 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5717d85e..47047fce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Changed + +- [#812](https://github.com/prettier/plugin-ruby/issues/812) - valscion, kddeisz - Splats and blocks within args that have comments attached should place their respective operators in the right place. + ## [1.5.2] - 2021-02-03 ### Changed diff --git a/src/ruby/nodes/args.js b/src/ruby/nodes/args.js index 940bd53d..1a9ee0fc 100644 --- a/src/ruby/nodes/args.js +++ b/src/ruby/nodes/args.js @@ -106,25 +106,66 @@ function printArgs(path, { rubyToProc }, print) { return args; } +function printArgsAddBlock(path, opts, print) { + const node = path.getValue(); + const parts = path.call(print, "body", 0); + + if (node.body[1]) { + let blockDoc = path.call(print, "body", 1); + + if (node.body[1].comments) { + // If we have a method call like: + // + // foo( + // # comment + // &block + // ) + // + // then we need to make sure we don't accidentally prepend the operator + // before the comment. + blockDoc.parts[2] = concat(["&", blockDoc.parts[2]]); + } else { + // If we don't have any comments, we can just prepend the operator + blockDoc = concat(["&", blockDoc]); + } + + parts.push(blockDoc); + } + + return parts; +} + +function printArgsAddStar(path, opts, print) { + const node = path.getValue(); + const docs = path.map(print, "body"); + + if (node.body[1].comments) { + // If we have an array like: + // + // [ + // # comment + // *values + // ] + // + // then we need to make sure we don't accidentally prepend the operator + // before the comment. + docs[1].parts[2] = concat(["*", docs[1].parts[2]]); + } else { + // If we don't have any comments, we can just prepend the operator + docs[1] = concat(["*", docs[1]]); + } + + return docs[0].concat(docs[1]).concat(docs.slice(2)); +} + +function printBlockArg(path, opts, print) { + return concat(["&", path.call(print, "body", 0)]); +} + module.exports = { arg_paren: printArgParen, args: printArgs, - args_add_block: (path, opts, print) => { - const parts = path.call(print, "body", 0); - - if (path.getValue().body[1]) { - parts.push(concat(["&", path.call(print, "body", 1)])); - } - - return parts; - }, - args_add_star: (path, opts, print) => { - const printed = path.map(print, "body"); - const parts = printed[0] - .concat([concat(["*", printed[1]])]) - .concat(printed.slice(2)); - - return parts; - }, - blockarg: (path, opts, print) => concat(["&", path.call(print, "body", 0)]) + args_add_block: printArgsAddBlock, + args_add_star: printArgsAddStar, + blockarg: printBlockArg }; diff --git a/test/js/ruby/nodes/method.test.js b/test/js/ruby/nodes/method.test.js index ad624343..5ac53bd1 100644 --- a/test/js/ruby/nodes/method.test.js +++ b/test/js/ruby/nodes/method.test.js @@ -245,7 +245,29 @@ describe("method", () => { test("between multi args", () => expect("foo(1, 2, *abc, 3, 4)").toMatchFormat()); + test("with comments", () => { + const content = ruby(` + foo( + # comment + *values + ) + `); + + return expect(content).toMatchFormat(); + }); + test("with block", () => expect("foo(*bar, &block)").toMatchFormat()); + + test("with comments and block", () => { + const content = ruby(` + foo( + # comment + &block + ) + `); + + return expect(content).toMatchFormat(); + }); }); describe("double splat", () => { @@ -254,7 +276,7 @@ describe("method", () => { test("with block", () => expect("foo(**bar, &block)").toMatchFormat()); test("with splat and block", () => - expect("foo(*bar, **baz, &lock)").toMatchFormat()); + expect("foo(*bar, **baz, &block)").toMatchFormat()); test("after kwarg", () => expect("foo(kwarg: 1, **splat)").toMatchFormat()); From 40c802c44f30bb35a93014d9a799207e6fecc8bc Mon Sep 17 00:00:00 2001 From: Vesa Laakso <482561+valscion@users.noreply.github.com> Date: Fri, 5 Feb 2021 09:39:55 +0200 Subject: [PATCH 109/785] Document RuboCop's Style/Lambda should be disabled --- rubocop.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rubocop.yml b/rubocop.yml index d97ee3e2..9aa04c30 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -24,3 +24,6 @@ Style/TrailingCommaInArrayLiteral: # trailingComma Style/TrailingCommaInHashLiteral: # trailingComma Enabled: false + +Style/Lambda: + Enabled: false From 61fff90de8ed66f5d739a21e481ccad14d38573a Mon Sep 17 00:00:00 2001 From: Vesa Laakso <482561+valscion@users.noreply.github.com> Date: Fri, 5 Feb 2021 09:46:26 +0200 Subject: [PATCH 110/785] Add changelog entry about RuboCop Style/Lambda --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47047fce..75cca341 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Changed - [#812](https://github.com/prettier/plugin-ruby/issues/812) - valscion, kddeisz - Splats and blocks within args that have comments attached should place their respective operators in the right place. +- [#816](https://github.com/prettier/plugin-ruby/pull/816) - valscion - Document RuboCop's Style/Lambda should be disabled ## [1.5.2] - 2021-02-03 From c5036cc765fbf9746a9ade683522e81dcd081959 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Fri, 5 Feb 2021 10:25:45 -0500 Subject: [PATCH 111/785] Fix for #814 --- CHANGELOG.md | 1 + src/haml/parser.rb | 2 -- src/parser/parseSync.js | 25 ++++++++++--------------- src/parser/server.rb | 5 +++++ src/rbs/parser.rb | 2 -- src/ruby/parser.rb | 22 ++++++++++++++++++++++ test/js/files.test.js | 24 +++++++++++++++++------- test/js/ruby/errors.test.js | 20 +++++++++++++++++++- test/js/setupTests.js | 32 -------------------------------- 9 files changed, 74 insertions(+), 59 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75cca341..b29eadaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#812](https://github.com/prettier/plugin-ruby/issues/812) - valscion, kddeisz - Splats and blocks within args that have comments attached should place their respective operators in the right place. - [#816](https://github.com/prettier/plugin-ruby/pull/816) - valscion - Document RuboCop's Style/Lambda should be disabled +- [#814](https://github.com/prettier/plugin-ruby/issues/814) - jscheid, kddeisz - Provide better errors when the source location of the error is known. ## [1.5.2] - 2021-02-03 diff --git a/src/haml/parser.rb b/src/haml/parser.rb index a31ebb1c..e79f3742 100644 --- a/src/haml/parser.rb +++ b/src/haml/parser.rb @@ -131,8 +131,6 @@ module Prettier class HAMLParser def self.parse(source) Haml::Parser.new({}).call(source).as_json - rescue StandardError - false end end end diff --git a/src/parser/parseSync.js b/src/parser/parseSync.js index d323f9fb..99cd02b9 100644 --- a/src/parser/parseSync.js +++ b/src/parser/parseSync.js @@ -5,26 +5,21 @@ const requestParse = require("./requestParse"); // synchronous and Node.js does not offer a mechanism for synchronous socket // requests. function parseSync(parser, source) { - const response = requestParse(parser, source); + const { stdout, stderr, status } = requestParse(parser, source); - if ( - response.stdout.length === 0 || - (response.status !== null && response.status !== 0) - ) { - console.error("Could not parse response from server"); - console.error(response); - - throw new Error(response.stderr || "An unknown error occurred"); + if (stdout.length === 0 || (status !== null && status !== 0)) { + throw new Error(stderr || "An unknown error occurred"); } - const parsed = JSON.parse(response.stdout); + const parsed = JSON.parse(stdout); if (parsed.error) { - throw new Error( - `@prettier/plugin-ruby encountered an error when attempting to parse \ -the ruby source. This usually means there was a syntax error in the \ -file in question. You can verify by running \`ruby -i [path/to/file]\`.` - ); + const error = new Error(parsed.error); + if (parsed.loc) { + error.loc = parsed.loc; + } + + throw error; } return parsed; diff --git a/src/parser/server.rb b/src/parser/server.rb index e2fc1602..fb484b98 100644 --- a/src/parser/server.rb +++ b/src/parser/server.rb @@ -48,6 +48,11 @@ else socket.write('{ "error": true }') end + rescue Prettier::Parser::ParserError => error + loc = { start: { line: error.lineno, column: error.column } } + socket.write(JSON.fast_generate(error: error.message, loc: loc)) + rescue StandardError => error + socket.write(JSON.fast_generate(error: error.message)) ensure socket.close end diff --git a/src/rbs/parser.rb b/src/rbs/parser.rb index 326e078c..1bc8923f 100644 --- a/src/rbs/parser.rb +++ b/src/rbs/parser.rb @@ -87,8 +87,6 @@ module Prettier class RBSParser def self.parse(text) { declarations: RBS::Parser.parse_signature(text) } - rescue StandardError - false end end end diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index d51965db..553b88d3 100755 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -1729,6 +1729,28 @@ def on_paren(contents) ) end + # A special parser error so that we can get nice syntax displays on the error + # message when prettier prints out the results. + class ParserError < StandardError + attr_reader :lineno, :column + + def initialize(error, lineno, column) + super(error) + @lineno = lineno + @column = column + end + end + + # If we encounter a parse error, just immediately bail out so that our runner + # can catch it. + def on_parse_error(error, *) + raise ParserError.new(error, lineno, column) + end + alias on_alias_error on_parse_error + alias on_assign_error on_parse_error + alias on_class_name_error on_parse_error + alias on_param_error on_parse_error + # The program node is the very top of the AST. Here we'll attach all of # the comments that we've gathered up over the course of parsing the # source string. We'll also attach on the __END__ content if there was diff --git a/test/js/files.test.js b/test/js/files.test.js index 0552f749..9303884f 100644 --- a/test/js/files.test.js +++ b/test/js/files.test.js @@ -1,10 +1,20 @@ -describe("files", () => { - test("handles full files that match", () => - expect("files/Gemfile").toInferParser()); +const path = require("path"); +const { getFileInfo } = require("prettier"); + +const plugin = require("../../src/plugin"); + +function getInferredParser(filename) { + const filepath = path.join(__dirname, filename); - test("handles shebangs that match", () => - expect("files/shebang").toInferParser()); + return getFileInfo(filepath, { plugins: [plugin] }).then( + ({ inferredParser }) => inferredParser + ); +} + +describe("files", () => { + const cases = ["files/Gemfile", "files/shebang", "files/test.rake"]; - test("handles extensions that match", () => - expect("files/test.rake").toInferParser()); + test.each(cases)("infers Ruby parser from %s", (filename) => + expect(getInferredParser(filename)).resolves.toBe("ruby") + ); }); diff --git a/test/js/ruby/errors.test.js b/test/js/ruby/errors.test.js index 58a2612b..fd831836 100644 --- a/test/js/ruby/errors.test.js +++ b/test/js/ruby/errors.test.js @@ -1,7 +1,25 @@ +const prettier = require("prettier"); const { print } = require("../../../src/ruby/printer"); describe("errors", () => { - test("invalid ruby", () => expect("<>").toFailFormat()); + const cases = [ + "alias $a $1", + "self = 1", + "$` = 1", + "class foo; end", + "def foo(A) end", + "def foo($a) end", + "def foo(@a) end", + "def foo(@@a) end", + "<>" + ]; + + test.each(cases)("fails for %s", (content) => { + const format = () => + prettier.format(content, { parser: "ruby", plugins: ["."] }); + + expect(format).toThrow(); + }); test("when encountering an unsupported node type", () => { const path = { getValue: () => ({ type: "unsupported", body: {} }) }; diff --git a/test/js/setupTests.js b/test/js/setupTests.js index 53d0ec3a..ed777731 100644 --- a/test/js/setupTests.js +++ b/test/js/setupTests.js @@ -1,5 +1,4 @@ const net = require("net"); -const path = require("path"); const prettier = require("prettier"); // eslint-disable-next-line no-underscore-dangle @@ -76,36 +75,5 @@ expect.extend({ }, toMatchFormat(before, config = {}) { return checkFormat(before, before.code || before, config); - }, - toFailFormat(before, message) { - let pass = false; - let error = null; - - try { - prettier.format(before, { parser: "ruby", plugins: ["."] }); - } catch (caught) { - error = caught; - pass = caught.message === message; - } - - return { - pass, - message: () => ` - Expected format to throw an error for ${before} with ${message}, - but got ${error.message} instead - ` - }; - }, - toInferParser(filename) { - const filepath = path.join(__dirname, filename); - const plugin = path.join(__dirname, "..", "..", "src", "plugin"); - - return prettier - .getFileInfo(filepath, { plugins: [plugin] }) - .then((props) => ({ - pass: props.inferredParser === "ruby", - message: () => - `Expected prettier to infer the ruby parser for ${filename}, but got ${props.inferredParser} instead` - })); } }); From e00839fac28ecdf3c61be4df163f5368731a4af7 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Fri, 5 Feb 2021 10:44:19 -0500 Subject: [PATCH 112/785] Move check-format into linting stage --- .github/ISSUE_TEMPLATE/bug.md | 16 ++--- .github/ISSUE_TEMPLATE/formatting.md | 16 ++--- .github/workflows/main.yml | 104 +++++++++++++-------------- .prettierignore | 1 - 4 files changed, 66 insertions(+), 71 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md index 9ef85bea..50ff8b22 100644 --- a/.github/ISSUE_TEMPLATE/bug.md +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -5,14 +5,14 @@ about: Issues with prettier crashing ## Metadata -* Ruby version: ... -* `@prettier/plugin-ruby` or `prettier` gem version: ... -* Options: - * [x] `rubyHashLabel` - * [x] `rubyModifier` - * [x] `rubySingleQuote` - * [ ] `rubyToProc` - * [ ] `trailingComma` +- Ruby version: ... +- `@prettier/plugin-ruby` or `prettier` gem version: ... +- Options: + - [x] `rubyHashLabel` + - [x] `rubyModifier` + - [x] `rubySingleQuote` + - [ ] `rubyToProc` + - [ ] `trailingComma` ## Input diff --git a/.github/ISSUE_TEMPLATE/formatting.md b/.github/ISSUE_TEMPLATE/formatting.md index 91e868da..62c918ac 100644 --- a/.github/ISSUE_TEMPLATE/formatting.md +++ b/.github/ISSUE_TEMPLATE/formatting.md @@ -5,14 +5,14 @@ about: Issues for ugly or incorrect code ## Metadata -* Ruby version: ... -* `@prettier/plugin-ruby` or `prettier` gem version: ... -* Options: - * [x] `rubyHashLabel` - * [x] `rubyModifier` - * [x] `rubySingleQuote` - * [ ] `rubyToProc` - * [ ] `trailingComma` +- Ruby version: ... +- `@prettier/plugin-ruby` or `prettier` gem version: ... +- Options: + - [x] `rubyHashLabel` + - [x] `rubyModifier` + - [x] `rubySingleQuote` + - [ ] `rubyToProc` + - [ ] `trailingComma` ## Input diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9f23879f..3bdeedc5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,7 +1,7 @@ name: Main on: -- push -- pull_request + - push + - pull_request jobs: ci: name: CI @@ -12,68 +12,65 @@ jobs: - macos-latest - ubuntu-latest ruby: - - "2.5" - - "2.6" - - "2.7" - - "3.0" - # Turning off truffleruby because I'm not sure why it's failing - # - truffleruby + - "2.5" + - "2.6" + - "2.7" + - "3.0" + # Turning off truffleruby because I'm not sure why it's failing + # - truffleruby runs-on: ${{ matrix.os }} - env: + env: PLUGIN_RUBY_CI: true steps: - - uses: actions/checkout@master - - # Setup ruby dependencies - - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true - ruby-version: ${{ matrix.ruby }} - - # Setup node dependencies - - uses: actions/setup-node@v2-beta - with: - node-version: 12.x - - id: yarn-cache - run: echo "::set-output name=directory::$(yarn cache dir)" - - uses: actions/cache@v1 - with: - path: ${{ steps.yarn-cache.outputs.directory }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - run: yarn install --frozen-lockfile - - # Actually run tests and lint - - name: Lint and test - run: | - yarn check-format - yarn test - bundle exec rake test + - uses: actions/checkout@master + - uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + ruby-version: ${{ matrix.ruby }} + - uses: actions/setup-node@v2-beta + with: + node-version: 12.x + - id: yarn-cache + run: echo "::set-output name=directory::$(yarn cache dir)" + - uses: actions/cache@v1 + with: + path: ${{ steps.yarn-cache.outputs.directory }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: ${{ runner.os }}-yarn- + - run: yarn install --frozen-lockfile + - name: Test + run: | + yarn test + bundle exec rake test lint: name: Lint runs-on: ubuntu-latest - env: + env: PLUGIN_RUBY_CI: true steps: - - uses: actions/checkout@master - - uses: actions/setup-node@v2-beta - with: - node-version: 12.x - - id: yarn-cache - run: echo "::set-output name=directory::$(yarn cache dir)" - - uses: actions/cache@v1 - with: - path: ${{ steps.yarn-cache.outputs.directory }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - run: yarn install --frozen-lockfile - - run: yarn lint + - uses: actions/checkout@master + - uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + ruby-version: "3.0" + - uses: actions/setup-node@v2-beta + with: + node-version: 12.x + - id: yarn-cache + run: echo "::set-output name=directory::$(yarn cache dir)" + - uses: actions/cache@v1 + with: + path: ${{ steps.yarn-cache.outputs.directory }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: ${{ runner.os }}-yarn- + - run: yarn install --frozen-lockfile + - run: | + yarn check-format + yarn lint automerge: - name: AutoMerge + name: Auto Merge needs: - ci - lint @@ -88,4 +85,3 @@ jobs: repo: context.payload.repository.name, pull_number: context.payload.pull_request.number }) - diff --git a/.prettierignore b/.prettierignore index 951790df..983e4c4a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,5 +1,4 @@ /.bundle/ -/.github/ /coverage/ /pkg/ /playground/ From 6086d0285751b3259428e9768c0bb53b20470870 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Feb 2021 05:03:41 +0000 Subject: [PATCH 113/785] Bump husky from 4.3.8 to 5.0.9 Bumps [husky](https://github.com/typicode/husky) from 4.3.8 to 5.0.9. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v4.3.8...v5.0.9) Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 125 ++------------------------------------------------- 2 files changed, 5 insertions(+), 122 deletions(-) diff --git a/package.json b/package.json index 35f3c823..6f9cd686 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "devDependencies": { "eslint": "^7.8.1", "eslint-config-prettier": "^7.0.0", - "husky": "^4.3.5", + "husky": "^5.0.9", "jest": "^26.0.0", "pretty-quick": "^3.1.0" }, diff --git a/yarn.lock b/yarn.lock index 5b963663..53c94f22 100644 --- a/yarn.lock +++ b/yarn.lock @@ -569,11 +569,6 @@ resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== -"@types/parse-json@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" - integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== - "@types/prettier@^2.0.0": version "2.1.5" resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.1.5.tgz#b6ab3bba29e16b821d84e09ecfaded462b816b00" @@ -1049,11 +1044,6 @@ combined-stream@^1.0.6, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" -compare-versions@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.6.0.tgz#1a5689913685e5a87637b8d3ffca75514ec41d62" - integrity sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA== - component-emitter@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" @@ -1081,17 +1071,6 @@ core-util-is@1.0.2: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= -cosmiconfig@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.0.tgz#ef9b44d773959cae63ddecd122de23853b60f8d3" - integrity sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA== - dependencies: - "@types/parse-json" "^4.0.0" - import-fresh "^3.2.1" - parse-json "^5.0.0" - path-type "^4.0.0" - yaml "^1.10.0" - cross-spawn@^6.0.0: version "6.0.5" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" @@ -1573,21 +1552,6 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" -find-up@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - -find-versions@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/find-versions/-/find-versions-4.0.0.tgz#3c57e573bf97769b8cb8df16934b627915da4965" - integrity sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ== - dependencies: - semver-regex "^3.1.2" - flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" @@ -1821,21 +1785,10 @@ human-signals@^1.1.1: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== -husky@^4.3.5: - version "4.3.8" - resolved "https://registry.yarnpkg.com/husky/-/husky-4.3.8.tgz#31144060be963fd6850e5cc8f019a1dfe194296d" - integrity sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow== - dependencies: - chalk "^4.0.0" - ci-info "^2.0.0" - compare-versions "^3.6.0" - cosmiconfig "^7.0.0" - find-versions "^4.0.0" - opencollective-postinstall "^2.0.2" - pkg-dir "^5.0.0" - please-upgrade-node "^3.2.0" - slash "^3.0.0" - which-pm-runs "^1.0.0" +husky@^5.0.9: + version "5.0.9" + resolved "https://registry.yarnpkg.com/husky/-/husky-5.0.9.tgz#6d38706643d66ed395bcd4ee952d02e3f15eb3a3" + integrity sha512-0SjcaY21a+IRdx7p7r/X33Vc09UR2m8SbP8yfkhUX2/jAmwcz+GR7i9jXkp2pP3GfX23JhMkVP6SWwXB18uXtg== iconv-lite@0.4.24: version "0.4.24" @@ -2653,13 +2606,6 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" -locate-path@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" - integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== - dependencies: - p-locate "^5.0.0" - lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" @@ -2930,11 +2876,6 @@ onetime@^5.1.0: dependencies: mimic-fn "^2.1.0" -opencollective-postinstall@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz#7a0fff978f6dbfa4d006238fbac98ed4198c3259" - integrity sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q== - optionator@^0.8.1: version "0.8.3" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" @@ -2976,13 +2917,6 @@ p-limit@^2.2.0: dependencies: p-try "^2.0.0" -p-limit@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" - integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== - dependencies: - yocto-queue "^0.1.0" - p-locate@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" @@ -2990,13 +2924,6 @@ p-locate@^4.1.0: dependencies: p-limit "^2.2.0" -p-locate@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" - integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== - dependencies: - p-limit "^3.0.2" - p-try@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" @@ -3054,11 +2981,6 @@ path-parse@^1.0.6: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== -path-type@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" - integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== - performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" @@ -3083,20 +3005,6 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" -pkg-dir@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-5.0.0.tgz#a02d6aebe6ba133a928f74aec20bafdfe6b8e760" - integrity sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA== - dependencies: - find-up "^5.0.0" - -please-upgrade-node@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942" - integrity sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg== - dependencies: - semver-compare "^1.0.0" - posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" @@ -3370,16 +3278,6 @@ saxes@^5.0.0: dependencies: xmlchars "^2.2.0" -semver-compare@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" - integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= - -semver-regex@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-3.1.2.tgz#34b4c0d361eef262e07199dbef316d0f2ab11807" - integrity sha512-bXWyL6EAKOJa81XG1OZ/Yyuq+oT0b2YLlxx7c+mrdYPaPbnj6WgVULXhinMIeZGufuUBu/eVRqXEhiv4imfwxA== - "semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" @@ -3967,11 +3865,6 @@ which-module@^2.0.0: resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= -which-pm-runs@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/which-pm-runs/-/which-pm-runs-1.0.0.tgz#670b3afbc552e0b55df6b7780ca74615f23ad1cb" - integrity sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs= - which@^1.2.9: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" @@ -4040,11 +3933,6 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yaml@^1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.0.tgz#3b593add944876077d4d683fee01081bd9fff31e" - integrity sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg== - yargs-parser@^18.1.2: version "18.1.3" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" @@ -4069,8 +3957,3 @@ yargs@^15.4.1: which-module "^2.0.0" y18n "^4.0.0" yargs-parser "^18.1.2" - -yocto-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== From fe108f05bde442537284882cbafdb2cd6b791870 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Feb 2021 05:05:11 +0000 Subject: [PATCH 114/785] Bump eslint from 7.19.0 to 7.20.0 Bumps [eslint](https://github.com/eslint/eslint) from 7.19.0 to 7.20.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v7.19.0...v7.20.0) Signed-off-by: dependabot[bot] --- yarn.lock | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/yarn.lock b/yarn.lock index 53c94f22..5645b110 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a" - integrity sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg== +"@babel/code-frame@7.12.11", "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" + integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== dependencies: "@babel/highlight" "^7.10.4" @@ -1306,11 +1306,11 @@ eslint-visitor-keys@^2.0.0: integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== eslint@^7.8.1: - version "7.19.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.19.0.tgz#6719621b196b5fad72e43387981314e5d0dc3f41" - integrity sha512-CGlMgJY56JZ9ZSYhJuhow61lMPPjUzWmChFya71Z/jilVos7mR/jPgaEfVGgMBY5DshbKdG8Ezb8FDCHcoMEMg== + version "7.20.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.20.0.tgz#db07c4ca4eda2e2316e7aa57ac7fc91ec550bdc7" + integrity sha512-qGi0CTcOGP2OtCQBgWZlQjcTuP0XkIpYFj25XtRTQSHC+umNnp7UMshr2G8SLsRFYDdAPFeHOsiteadmMH02Yw== dependencies: - "@babel/code-frame" "^7.0.0" + "@babel/code-frame" "7.12.11" "@eslint/eslintrc" "^0.3.0" ajv "^6.10.0" chalk "^4.0.0" @@ -1322,7 +1322,7 @@ eslint@^7.8.1: eslint-utils "^2.1.0" eslint-visitor-keys "^2.0.0" espree "^7.3.1" - esquery "^1.2.0" + esquery "^1.4.0" esutils "^2.0.2" file-entry-cache "^6.0.0" functional-red-black-tree "^1.0.1" @@ -1362,10 +1362,10 @@ esprima@^4.0.0, esprima@^4.0.1: resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -esquery@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.3.1.tgz#b78b5828aa8e214e29fb74c4d5b752e1c033da57" - integrity sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ== +esquery@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" + integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== dependencies: estraverse "^5.1.0" From 3205c705b3442dc69c8226ad5a55a3d297d93a6d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Feb 2021 05:04:51 +0000 Subject: [PATCH 115/785] Bump eslint-config-prettier from 7.2.0 to 8.0.0 Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 7.2.0 to 8.0.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/v7.2.0...v8.0.0) Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6f9cd686..216d3079 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ }, "devDependencies": { "eslint": "^7.8.1", - "eslint-config-prettier": "^7.0.0", + "eslint-config-prettier": "^8.0.0", "husky": "^5.0.9", "jest": "^26.0.0", "pretty-quick": "^3.1.0" diff --git a/yarn.lock b/yarn.lock index 5645b110..8c25050a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1275,10 +1275,10 @@ escodegen@^1.14.1: optionalDependencies: source-map "~0.6.1" -eslint-config-prettier@^7.0.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-7.2.0.tgz#f4a4bd2832e810e8cc7c1411ec85b3e85c0c53f9" - integrity sha512-rV4Qu0C3nfJKPOAhFujFxB7RMP+URFyQqqOZW9DMRD7ZDTFyjaIlETU3xzHELt++4ugC0+Jm084HQYkkJe+Ivg== +eslint-config-prettier@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.0.0.tgz#024d661444319686c588c8849c8da33815dbdb1c" + integrity sha512-5EaAVPsIHu+grmm5WKjxUia4yHgRrbkd8I0ffqUSwixCPMVBrbS97UnzlEY/Q7OWo584vgixefM0kJnUfo/VjA== eslint-scope@^5.1.1: version "5.1.1" From 7cd1eca2282c75660224b26f92538eafce4b7aec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Feb 2021 05:05:06 +0000 Subject: [PATCH 116/785] Bump husky from 5.0.9 to 5.1.0 Bumps [husky](https://github.com/typicode/husky) from 5.0.9 to 5.1.0. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v5.0.9...v5.1.0) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5645b110..1c1eb935 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1786,9 +1786,9 @@ human-signals@^1.1.1: integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== husky@^5.0.9: - version "5.0.9" - resolved "https://registry.yarnpkg.com/husky/-/husky-5.0.9.tgz#6d38706643d66ed395bcd4ee952d02e3f15eb3a3" - integrity sha512-0SjcaY21a+IRdx7p7r/X33Vc09UR2m8SbP8yfkhUX2/jAmwcz+GR7i9jXkp2pP3GfX23JhMkVP6SWwXB18uXtg== + version "5.1.0" + resolved "https://registry.yarnpkg.com/husky/-/husky-5.1.0.tgz#68b1148523acc838af0655ead71bf4671adb9f93" + integrity sha512-Os0EY2haOO+59YZSwMiUDsHY43RFwBVIRStHcnnT8/kvA+sFfaA/YS4uLFRiymXYgQl6E6TQTt3y4v/Z2ctEtw== iconv-lite@0.4.24: version "0.4.24" From ee8e7d79e2c408f5ac83ae55586ec2889b776ecf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Feb 2021 05:03:42 +0000 Subject: [PATCH 117/785] Bump husky from 5.1.0 to 5.1.1 Bumps [husky](https://github.com/typicode/husky) from 5.1.0 to 5.1.1. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v5.1.0...v5.1.1) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 116422ea..0a8a4134 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1786,9 +1786,9 @@ human-signals@^1.1.1: integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== husky@^5.0.9: - version "5.1.0" - resolved "https://registry.yarnpkg.com/husky/-/husky-5.1.0.tgz#68b1148523acc838af0655ead71bf4671adb9f93" - integrity sha512-Os0EY2haOO+59YZSwMiUDsHY43RFwBVIRStHcnnT8/kvA+sFfaA/YS4uLFRiymXYgQl6E6TQTt3y4v/Z2ctEtw== + version "5.1.1" + resolved "https://registry.yarnpkg.com/husky/-/husky-5.1.1.tgz#8678953fd8deb86f387cbf1ad50bb2f7f96e83f2" + integrity sha512-80LZ736V0Nr4/st0c2COYaMbEQhHNmAbLMN8J/kLk7/mo0QdUkUGNDjv/7jVkhug377Wh8wfbWyaVXEJ/h2B/Q== iconv-lite@0.4.24: version "0.4.24" From d26f729ab61ba3ec565efc44f6e1f8a7a3088b6c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Feb 2021 05:03:32 +0000 Subject: [PATCH 118/785] Bump eslint-config-prettier from 8.0.0 to 8.1.0 Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.0.0 to 8.1.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.0.0...v8.1.0) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 0a8a4134..ad025bb3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1276,9 +1276,9 @@ escodegen@^1.14.1: source-map "~0.6.1" eslint-config-prettier@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.0.0.tgz#024d661444319686c588c8849c8da33815dbdb1c" - integrity sha512-5EaAVPsIHu+grmm5WKjxUia4yHgRrbkd8I0ffqUSwixCPMVBrbS97UnzlEY/Q7OWo584vgixefM0kJnUfo/VjA== + version "8.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.1.0.tgz#4ef1eaf97afe5176e6a75ddfb57c335121abc5a6" + integrity sha512-oKMhGv3ihGbCIimCAjqkdzx2Q+jthoqnXSP+d86M9tptwugycmTFdVR4IpLgq2c4SHifbwO90z2fQ8/Aio73yw== eslint-scope@^5.1.1: version "5.1.1" From c59e9c5003f607c307a485ab3a93008bdb4076b7 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sun, 28 Feb 2021 17:29:04 -0500 Subject: [PATCH 119/785] Bump to v1.5.3 --- CHANGELOG.md | 2 ++ package.json | 4 ++-- yarn.lock | 29 ++++++++++++++--------------- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b29eadaa..e26675df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [1.5.3] - 2021-02-28 + ### Changed - [#812](https://github.com/prettier/plugin-ruby/issues/812) - valscion, kddeisz - Splats and blocks within args that have comments attached should place their respective operators in the right place. diff --git a/package.json b/package.json index 216d3079..3ee325e2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "1.5.2", + "version": "1.5.3", "description": "prettier plugin for the Ruby programming language", "main": "src/plugin.js", "scripts": { @@ -22,7 +22,7 @@ "prettier": ">=1.10" }, "devDependencies": { - "eslint": "^7.8.1", + "eslint": "^7.21.0", "eslint-config-prettier": "^8.0.0", "husky": "^5.0.9", "jest": "^26.0.0", diff --git a/yarn.lock b/yarn.lock index ad025bb3..124f4853 100644 --- a/yarn.lock +++ b/yarn.lock @@ -278,10 +278,10 @@ exec-sh "^0.3.2" minimist "^1.2.0" -"@eslint/eslintrc@^0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.3.0.tgz#d736d6963d7003b6514e6324bec9c602ac340318" - integrity sha512-1JTKgrOKAHVivSvOYw+sJOunkBjUOvjqWk1DPja7ZFhIS2mX/4EgTT8M7eTK9jrKhL/FvXXEbQwIs3pg1xp3dg== +"@eslint/eslintrc@^0.4.0": + version "0.4.0" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.0.tgz#99cc0a0584d72f1df38b900fb062ba995f395547" + integrity sha512-2ZPCc+uNbjV5ERJr+aKSPRwZgKd2z11x0EgLvb1PURmUrn9QNRXFqje0Ldq454PfAVyaJYyrDvvIKSFP4NnBog== dependencies: ajv "^6.12.4" debug "^4.1.1" @@ -290,7 +290,6 @@ ignore "^4.0.6" import-fresh "^3.2.1" js-yaml "^3.13.1" - lodash "^4.17.20" minimatch "^3.0.4" strip-json-comments "^3.1.1" @@ -1305,13 +1304,13 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== -eslint@^7.8.1: - version "7.20.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.20.0.tgz#db07c4ca4eda2e2316e7aa57ac7fc91ec550bdc7" - integrity sha512-qGi0CTcOGP2OtCQBgWZlQjcTuP0XkIpYFj25XtRTQSHC+umNnp7UMshr2G8SLsRFYDdAPFeHOsiteadmMH02Yw== +eslint@^7.21.0: + version "7.21.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.21.0.tgz#4ecd5b8c5b44f5dedc9b8a110b01bbfeb15d1c83" + integrity sha512-W2aJbXpMNofUp0ztQaF40fveSsJBjlSCSWpy//gzfTvwC+USs/nceBrKmlJOiM8r1bLwP2EuYkCqArn/6QTIgg== dependencies: "@babel/code-frame" "7.12.11" - "@eslint/eslintrc" "^0.3.0" + "@eslint/eslintrc" "^0.4.0" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" @@ -1324,7 +1323,7 @@ eslint@^7.8.1: espree "^7.3.1" esquery "^1.4.0" esutils "^2.0.2" - file-entry-cache "^6.0.0" + file-entry-cache "^6.0.1" functional-red-black-tree "^1.0.1" glob-parent "^5.0.0" globals "^12.1.0" @@ -1520,10 +1519,10 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" -file-entry-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.0.tgz#7921a89c391c6d93efec2169ac6bf300c527ea0a" - integrity sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA== +file-entry-cache@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" + integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== dependencies: flat-cache "^3.0.4" From 4d4eb182751bdc356e6216d7347679426ebf9deb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Mar 2021 05:11:53 +0000 Subject: [PATCH 120/785] Bump husky from 5.1.1 to 5.1.2 Bumps [husky](https://github.com/typicode/husky) from 5.1.1 to 5.1.2. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v5.1.1...v5.1.2) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 124f4853..dfbce285 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1785,9 +1785,9 @@ human-signals@^1.1.1: integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== husky@^5.0.9: - version "5.1.1" - resolved "https://registry.yarnpkg.com/husky/-/husky-5.1.1.tgz#8678953fd8deb86f387cbf1ad50bb2f7f96e83f2" - integrity sha512-80LZ736V0Nr4/st0c2COYaMbEQhHNmAbLMN8J/kLk7/mo0QdUkUGNDjv/7jVkhug377Wh8wfbWyaVXEJ/h2B/Q== + version "5.1.2" + resolved "https://registry.yarnpkg.com/husky/-/husky-5.1.2.tgz#dc6a1f68640455d8d98c28875e073087f86c5081" + integrity sha512-lilaRYeDXcAOj8DuRnN9IxUyEMVbYg9rK7yVNkPB5V4hCvxIUxpMeiv9K2h77CE0HzjCnk1Br0oWe1IghXngDQ== iconv-lite@0.4.24: version "0.4.24" From 283a2a2f621b738bc9f0f47580e9ba30a8c69e44 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Mon, 1 Mar 2021 09:44:57 -0500 Subject: [PATCH 121/785] Better error handling for GNU netcat usage --- src/haml/parser.js | 4 ++-- src/parser/getNetcat.js | 27 +++++++++++++++++---------- src/parser/netcat.js | 2 -- src/parser/parseSync.js | 19 +++++++++++++++++-- src/parser/requestParse.js | 6 +++--- src/plugin.js | 6 ++++++ src/rbs/parser.js | 4 ++-- src/ruby/parser.js | 4 ++-- test/js/haml/parser.test.js | 4 ++-- test/js/rbs/parser.test.js | 4 ++-- 10 files changed, 53 insertions(+), 27 deletions(-) diff --git a/src/haml/parser.js b/src/haml/parser.js index 8119b1bb..d0367abd 100644 --- a/src/haml/parser.js +++ b/src/haml/parser.js @@ -1,7 +1,7 @@ const parseSync = require("../parser/parseSync"); -const parse = (text, _parsers, _opts) => { - return parseSync("haml", text); +const parse = (text, _parsers, opts) => { + return parseSync("haml", text, opts); }; const pragmaPattern = /^\s*-#\s*@(prettier|format)/; diff --git a/src/parser/getNetcat.js b/src/parser/getNetcat.js index 2a4804cb..25da2de6 100644 --- a/src/parser/getNetcat.js +++ b/src/parser/getNetcat.js @@ -16,35 +16,42 @@ function hasCommand(name) { // Finds an netcat-like adapter to use for sending data to a socket. We order // these by likelihood of being found so we can avoid some shell-outs. -function getCommandAndArg() { +function getCommandAndArgs() { if (hasCommand("nc")) { - return ["nc", "-U"]; + return ["nc", ["-U"]]; } if (hasCommand("telnet")) { - return ["telnet", "-u"]; + return ["telnet", ["-u"]]; } if (hasCommand("ncat")) { - return ["ncat", "-U"]; + return ["ncat", ["-U"]]; } if (hasCommand("socat")) { - return ["socat", "-"]; + return ["socat", ["-"]]; } - return ["node", require.resolve("./netcat.js")]; + return ["node", [require.resolve("./netcat.js")]]; } let command; -let arg; +let args; -function getNetcat() { +function getNetcat(opts) { if (!command) { - [command, arg] = getCommandAndArg(); + if (opts.rubyNetcatCommand) { + const splits = opts.rubyNetcatCommand.split(" "); + + command = splits[0]; + args = splits.slice(1); + } else { + [command, args] = getCommandAndArgs(); + } } - return { command, arg }; + return { command, args }; } module.exports = getNetcat; diff --git a/src/parser/netcat.js b/src/parser/netcat.js index 8eda98da..c36e465a 100644 --- a/src/parser/netcat.js +++ b/src/parser/netcat.js @@ -5,11 +5,9 @@ const { createConnection } = require("net"); const sock = process.argv[process.argv.length - 1]; - const client = createConnection(sock, () => process.stdin.pipe(client)); client.on("data", (data) => process.stdout.write(data)); - client.on("error", (error) => { console.error(error); }); diff --git a/src/parser/parseSync.js b/src/parser/parseSync.js index 99cd02b9..227b75b2 100644 --- a/src/parser/parseSync.js +++ b/src/parser/parseSync.js @@ -4,9 +4,24 @@ const requestParse = require("./requestParse"); // like it) here since Prettier requires the results of `parse` to be // synchronous and Node.js does not offer a mechanism for synchronous socket // requests. -function parseSync(parser, source) { - const { stdout, stderr, status } = requestParse(parser, source); +function parseSync(parser, source, opts) { + const { stdout, stderr, status } = requestParse(parser, source, opts); + // We need special handling in case the user's version of nc doesn't support + // using unix sockets. + if (stderr.includes("invalid option -- U")) { + throw new Error(` + @prettier/plugin-ruby uses netcat to communicate over unix sockets between + the node.js process running prettier and an underlying Ruby process used + for parsing. Unfortunately the version of netcat that you have installed + (GNU netcat) does not support unix sockets. To solve this either uninstall + GNU netcat and use a different implementation, or change the value of the + rubyNetcatCommand option in your prettier configuration. + `); + } + + // If we didn't receive anything over stdout or we have a bad exit status, + // then throw whatever we can. if (stdout.length === 0 || (status !== null && status !== 0)) { throw new Error(stderr || "An unknown error occurred"); } diff --git a/src/parser/requestParse.js b/src/parser/requestParse.js index ab0509eb..9deca71e 100644 --- a/src/parser/requestParse.js +++ b/src/parser/requestParse.js @@ -54,11 +54,11 @@ function ensureParseServer() { } // Sends a request to the parse server to parse the given content. -function requestParse(parser, source) { +function requestParse(parser, source, opts) { ensureParseServer(); - const { command, arg } = getNetcat(); - const { stdout, stderr, status } = spawnSync(command, [arg, sockfile], { + const { command, args } = getNetcat(opts); + const { stdout, stderr, status } = spawnSync(command, args.concat(sockfile), { input: `${parser}|${source}`, maxBuffer: 15 * 1024 * 1024 }); diff --git a/src/plugin.js b/src/plugin.js index 1705cf65..0d72ffe4 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -119,6 +119,12 @@ module.exports = { description: "When it fits on one line, allows if, unless, while, and until statements to use the modifier form." }, + rubyNetcatCommand: { + type: "string", + category: "Ruby", + description: + 'The prefix of the command to execute to communicate between the node.js process and the Ruby process. (For example, "nc -U" or "telnet -u") Normally you should not set this option.' + }, rubySingleQuote: { type: "boolean", category: "Ruby", diff --git a/src/rbs/parser.js b/src/rbs/parser.js index c55d54a3..dc612f7f 100644 --- a/src/rbs/parser.js +++ b/src/rbs/parser.js @@ -4,8 +4,8 @@ const parseSync = require("../parser/parseSync"); // to prettier a JavaScript object that is the equivalent AST that represents // the code stored in that string. We accomplish this by spawning a new Ruby // process of parser.rb and reading JSON off STDOUT. -function parse(text, _parsers, _opts) { - return parseSync("rbs", text); +function parse(text, _parsers, opts) { + return parseSync("rbs", text, opts); } const pragmaPattern = /#\s*@(prettier|format)/; diff --git a/src/ruby/parser.js b/src/ruby/parser.js index cd626403..9edfa50b 100644 --- a/src/ruby/parser.js +++ b/src/ruby/parser.js @@ -4,8 +4,8 @@ const parseSync = require("../parser/parseSync"); // to prettier a JavaScript object that is the equivalent AST that represents // the code stored in that string. We accomplish this by spawning a new Ruby // process of parser.rb and reading JSON off STDOUT. -function parse(text, _parsers, _opts) { - return parseSync("ruby", text); +function parse(text, _parsers, opts) { + return parseSync("ruby", text, opts); } const pragmaPattern = /#\s*@(prettier|format)/; diff --git a/test/js/haml/parser.test.js b/test/js/haml/parser.test.js index 47c3404c..a177873f 100644 --- a/test/js/haml/parser.test.js +++ b/test/js/haml/parser.test.js @@ -7,11 +7,11 @@ const { describe("parser", () => { test("parse", () => { - expect(parse("= foo").type).toEqual("root"); + expect(parse("= foo", [], {}).type).toEqual("root"); }); test("parse failure", () => { - expect(() => parse(`%div("invalid ": 1)`)).toThrowError(); + expect(() => parse(`%div("invalid ": 1)`, [], {})).toThrowError(); }); test("hasPragma", () => { diff --git a/test/js/rbs/parser.test.js b/test/js/rbs/parser.test.js index 638c3d3f..06e4fe35 100644 --- a/test/js/rbs/parser.test.js +++ b/test/js/rbs/parser.test.js @@ -8,11 +8,11 @@ const { describe("parser", () => { test("parse", () => { - expect(parse("class Foo end").declarations).toHaveLength(1); + expect(parse("class Foo end", [], {}).declarations).toHaveLength(1); }); test("parse failure", () => { - expect(() => parse("<>")).toThrowError(); + expect(() => parse("<>", [], {})).toThrowError(); }); test("hasPragma", () => { From 36e65902cfa91f525e2846a4d9bd7b01138fd501 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Mar 2021 05:03:45 +0000 Subject: [PATCH 122/785] Bump husky from 5.1.2 to 5.1.3 Bumps [husky](https://github.com/typicode/husky) from 5.1.2 to 5.1.3. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v5.1.2...v5.1.3) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index dfbce285..f2dd3d45 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1785,9 +1785,9 @@ human-signals@^1.1.1: integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== husky@^5.0.9: - version "5.1.2" - resolved "https://registry.yarnpkg.com/husky/-/husky-5.1.2.tgz#dc6a1f68640455d8d98c28875e073087f86c5081" - integrity sha512-lilaRYeDXcAOj8DuRnN9IxUyEMVbYg9rK7yVNkPB5V4hCvxIUxpMeiv9K2h77CE0HzjCnk1Br0oWe1IghXngDQ== + version "5.1.3" + resolved "https://registry.yarnpkg.com/husky/-/husky-5.1.3.tgz#1a0645a4fe3ffc006c4d0d8bd0bcb4c98787cc9d" + integrity sha512-fbNJ+Gz5wx2LIBtMweJNY1D7Uc8p1XERi5KNRMccwfQA+rXlxWNSdUxswo0gT8XqxywTIw7Ywm/F4v/O35RdMg== iconv-lite@0.4.24: version "0.4.24" From 383e952ea3e994170b6a246156700a7f5d7fdb50 Mon Sep 17 00:00:00 2001 From: Ayrton De Craene Date: Wed, 3 Mar 2021 10:19:56 +0100 Subject: [PATCH 123/785] Rubocop instructions for npm package Specify how to load the rubocop rules when prettier-ruby is installed via npm --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 84ae1973..73dfef4c 100644 --- a/README.md +++ b/README.md @@ -163,11 +163,20 @@ with some of RuboCop's functionality. Prettier provides a RuboCop configuration file to disable the rules which clash. To enable, add the following config at the top of your project's `.rubocop.yml`: +#### Ruby gem + ```yaml inherit_gem: prettier: rubocop.yml ``` +### `npm` package + +```yaml +inherit_gem: + - node_modules/@prettier/plugin-ruby/rubocop.yml +``` + ## Contributing Check out our [contributing guide](CONTRIBUTING.md). Bug reports and pull requests are welcome on GitHub at https://github.com/prettier/plugin-ruby. From 5a7b3d155b97c040db050548fe07e7cb29404c24 Mon Sep 17 00:00:00 2001 From: Ayrton De Craene Date: Wed, 3 Mar 2021 14:40:39 +0100 Subject: [PATCH 124/785] Typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 73dfef4c..13b5e593 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,7 @@ inherit_gem: prettier: rubocop.yml ``` -### `npm` package +#### `npm` package ```yaml inherit_gem: From c8c7192bbe2c65ea886b4214f83798dedb7c5173 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Thu, 4 Mar 2021 10:54:56 -0500 Subject: [PATCH 125/785] Fix for #835 and #836 --- CHANGELOG.md | 5 +++++ src/ruby/nodes/args.js | 9 ++++++++- test/js/ruby/nodes/method.test.js | 15 +++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e26675df..1920deeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Changed + +- [#835](https://github.com/prettier/plugin-ruby/issues/835) - valscion, kddeisz - Array splat operator should not get moved by leading comments. +- [#836](https://github.com/prettier/plugin-ruby/issues/836) - valscion, kddeisz - Array splat operator should not get moved by trailing comments. + ## [1.5.3] - 2021-02-28 ### Changed diff --git a/src/ruby/nodes/args.js b/src/ruby/nodes/args.js index 1a9ee0fc..aa5cd95c 100644 --- a/src/ruby/nodes/args.js +++ b/src/ruby/nodes/args.js @@ -147,9 +147,16 @@ function printArgsAddStar(path, opts, print) { // *values // ] // + // or if we have an array like: + // + // [ + // *values # comment + // ] + // // then we need to make sure we don't accidentally prepend the operator // before the comment. - docs[1].parts[2] = concat(["*", docs[1].parts[2]]); + const index = node.body[1].comments.filter(({ leading }) => leading).length; + docs[1].parts[index] = concat(["*", docs[1].parts[index]]); } else { // If we don't have any comments, we can just prepend the operator docs[1] = concat(["*", docs[1]]); diff --git a/test/js/ruby/nodes/method.test.js b/test/js/ruby/nodes/method.test.js index 5ac53bd1..f16f43d9 100644 --- a/test/js/ruby/nodes/method.test.js +++ b/test/js/ruby/nodes/method.test.js @@ -249,6 +249,8 @@ describe("method", () => { const content = ruby(` foo( # comment + # another comment + # even more comment *values ) `); @@ -256,6 +258,19 @@ describe("method", () => { return expect(content).toMatchFormat(); }); + test("with trailing comments", () => { + const content = ruby(` + foo( + # comment + # another comment + *values # a trailing comment + # a whole other comment + ) + `); + + return expect(content).toMatchFormat(); + }); + test("with block", () => expect("foo(*bar, &block)").toMatchFormat()); test("with comments and block", () => { From bf849ae6c152c7a22bd9a0f02b65f6eb468201bd Mon Sep 17 00:00:00 2001 From: David Wessman Date: Fri, 5 Mar 2021 15:14:43 +0100 Subject: [PATCH 126/785] README: Update rubocop instructions - `inherit_gem` does not work with a path, errors out in Rubocop because of the format, it needs a key and value. - With `inherit_from` it works. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 13b5e593..1674fa73 100644 --- a/README.md +++ b/README.md @@ -173,7 +173,7 @@ inherit_gem: #### `npm` package ```yaml -inherit_gem: +inherit_from: - node_modules/@prettier/plugin-ruby/rubocop.yml ``` From ad5eb48846a20d42ef6fd959aba9254a267e6233 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Mon, 15 Mar 2021 12:12:10 -0400 Subject: [PATCH 127/785] Bump eslint --- package.json | 2 +- yarn.lock | 29 +++++++++++++++++++++++------ 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 3ee325e2..33729eb0 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "prettier": ">=1.10" }, "devDependencies": { - "eslint": "^7.21.0", + "eslint": "^7.22.0", "eslint-config-prettier": "^8.0.0", "husky": "^5.0.9", "jest": "^26.0.0", diff --git a/yarn.lock b/yarn.lock index f2dd3d45..d7d8272e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1304,10 +1304,10 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== -eslint@^7.21.0: - version "7.21.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.21.0.tgz#4ecd5b8c5b44f5dedc9b8a110b01bbfeb15d1c83" - integrity sha512-W2aJbXpMNofUp0ztQaF40fveSsJBjlSCSWpy//gzfTvwC+USs/nceBrKmlJOiM8r1bLwP2EuYkCqArn/6QTIgg== +eslint@^7.22.0: + version "7.22.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.22.0.tgz#07ecc61052fec63661a2cab6bd507127c07adc6f" + integrity sha512-3VawOtjSJUQiiqac8MQc+w457iGLfuNGLFn8JmF051tTKbh5/x/0vlcEj8OgDCaw7Ysa2Jn8paGshV7x2abKXg== dependencies: "@babel/code-frame" "7.12.11" "@eslint/eslintrc" "^0.4.0" @@ -1326,7 +1326,7 @@ eslint@^7.21.0: file-entry-cache "^6.0.1" functional-red-black-tree "^1.0.1" glob-parent "^5.0.0" - globals "^12.1.0" + globals "^13.6.0" ignore "^4.0.6" import-fresh "^3.0.0" imurmurhash "^0.1.4" @@ -1334,7 +1334,7 @@ eslint@^7.21.0: js-yaml "^3.13.1" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" - lodash "^4.17.20" + lodash "^4.17.21" minimatch "^3.0.4" natural-compare "^1.4.0" optionator "^0.9.1" @@ -1682,6 +1682,13 @@ globals@^12.1.0: dependencies: type-fest "^0.8.1" +globals@^13.6.0: + version "13.6.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.6.0.tgz#d77138e53738567bb96a3916ff6f6b487af20ef7" + integrity sha512-YFKCX0SiPg7l5oKYCJ2zZGxcXprVXHcSnVuvzrT3oSENQonVLqM5pf9fN5dLGZGyCjhw8TN8Btwe/jKnZ0pjvQ== + dependencies: + type-fest "^0.20.2" + graceful-fs@^4.2.4: version "4.2.4" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" @@ -2615,6 +2622,11 @@ lodash@^4.17.19, lodash@^4.17.20: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== +lodash@^4.17.21: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + lru-cache@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" @@ -3714,6 +3726,11 @@ type-fest@^0.11.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1" integrity sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ== +type-fest@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" + integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== + type-fest@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" From 406ccecdb0a0ba50966c867f0820ea0e63baf348 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 17 Mar 2021 09:11:32 -0400 Subject: [PATCH 128/785] Bump to v1.5.4 --- CHANGELOG.md | 7 ++++++- README.md | 24 +++++++++++++----------- package.json | 2 +- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1920deeb..0ea13243 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,10 +6,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [1.5.4] - 2021-03-17 + ### Changed - [#835](https://github.com/prettier/plugin-ruby/issues/835) - valscion, kddeisz - Array splat operator should not get moved by leading comments. - [#836](https://github.com/prettier/plugin-ruby/issues/836) - valscion, kddeisz - Array splat operator should not get moved by trailing comments. +- [#821](https://github.com/prettier/plugin-ruby/issues/821) - jscheid, kddeisz - Better error handling when using GNU netcat. ## [1.5.3] - 2021-02-28 @@ -1090,7 +1093,9 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.5.2...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.5.4...HEAD +[1.5.4]: https://github.com/prettier/plugin-ruby/compare/v1.5.3...v1.5.4 +[1.5.3]: https://github.com/prettier/plugin-ruby/compare/v1.5.2...v1.5.3 [1.5.2]: https://github.com/prettier/plugin-ruby/compare/v1.5.1...v1.5.2 [1.5.1]: https://github.com/prettier/plugin-ruby/compare/v1.5.0...v1.5.1 [1.5.0]: https://github.com/prettier/plugin-ruby/compare/v1.4.0...v1.5.0 diff --git a/README.md b/README.md index 1674fa73..1aa1bedd 100644 --- a/README.md +++ b/README.md @@ -128,17 +128,19 @@ The `prettier` executable is now installed and ready for use: Below are the options (from [`src/plugin.js`](src/plugin.js)) that `@prettier/plugin-ruby` currently supports: -| API Option | CLI Option | Default | Description | -| ------------------ | ---------------------- | :-----: | ------------------------------------------------------------------------------------------------------------------------------------ | -| `printWidth` | `--print-width` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)). | -| `requirePragma` | `--require-pragma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#require-pragma)). | -| `rubyArrayLiteral` | `--ruby-array-literal` | `true` | When possible, favor the use of string and symbol array literals. | -| `rubyHashLabel` | `--ruby-hash-label` | `true` | When possible, uses the shortened hash key syntax, as opposed to hash rockets. | -| `rubyModifier` | `--ruby-modifier` | `true` | When it fits on one line, allows while and until statements to use the modifier form. | -| `rubySingleQuote` | `--ruby-single-quote` | `true` | When double quotes are not necessary for interpolation, prefers the use of single quotes for string literals. | -| `rubyToProc` | `--ruby-to-proc` | `false` | When possible, convert blocks to the more concise `Symbol#to_proc` syntax. | -| `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). | -| `trailingComma` | `--trailing-comma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#trailing-comma)). `"es5"` is equivalent to `true`. | +| API Option | CLI Option | Default | Description | +| ------------------- | ----------------------- | :-----: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `printWidth` | `--print-width` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)). | +| `requirePragma` | `--require-pragma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#require-pragma)). | +| `rubyArrayLiteral` | `--ruby-array-literal` | `true` | When possible, favor the use of string and symbol array literals. | +| `rubyHashLabel` | `--ruby-hash-label` | `true` | When possible, uses the shortened hash key syntax, as opposed to hash rockets. | +| `rubyModifier` | `--ruby-modifier` | `true` | When it fits on one line, allows while and until statements to use the modifier form. | +| `rubyNetcatCommand` | `--ruby-netcat-command` | | The prefix of the command to execute to communicate between the node.js process and the Ruby process. (For example, `"nc -U"` or `"telnet -u"`) Normally you should not set this option. | + +| `rubySingleQuote` | `--ruby-single-quote` | `true` | When double quotes are not necessary for interpolation, prefers the use of single quotes for string literals. | +| `rubyToProc` | `--ruby-to-proc` | `false` | When possible, convert blocks to the more concise `Symbol#to_proc` syntax. | +| `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). | +| `trailingComma` | `--trailing-comma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#trailing-comma)). `"es5"` is equivalent to `true`. | Any of these can be added to your existing [prettier configuration file](https://prettier.io/docs/en/configuration.html). For example: diff --git a/package.json b/package.json index 33729eb0..174f1966 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "1.5.3", + "version": "1.5.4", "description": "prettier plugin for the Ruby programming language", "main": "src/plugin.js", "scripts": { From 0f7ad5f792fbee7998539ce15cf7caf8809ae960 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 17 Mar 2021 15:14:19 -0400 Subject: [PATCH 129/785] Fix invalid doc type for debugging --- src/ruby/nodes/args.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ruby/nodes/args.js b/src/ruby/nodes/args.js index aa5cd95c..0f92e773 100644 --- a/src/ruby/nodes/args.js +++ b/src/ruby/nodes/args.js @@ -58,7 +58,7 @@ function printArgParen(path, opts, print) { concat([ softline, join(concat([",", line]), path.call(print, "body", 0)), - getTrailingComma(opts) && getArgParenTrailingComma(argsNode) + getTrailingComma(opts) ? getArgParenTrailingComma(argsNode) : "" ]) ), softline, From 2784f2f6b7b4e681b9e3b60967b0d49a9228be70 Mon Sep 17 00:00:00 2001 From: Robert DiMartino Date: Wed, 17 Mar 2021 15:55:58 -0400 Subject: [PATCH 130/785] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 1aa1bedd..7ea5a9c6 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,6 @@ Below are the options (from [`src/plugin.js`](src/plugin.js)) that `@prettier/pl | `rubyHashLabel` | `--ruby-hash-label` | `true` | When possible, uses the shortened hash key syntax, as opposed to hash rockets. | | `rubyModifier` | `--ruby-modifier` | `true` | When it fits on one line, allows while and until statements to use the modifier form. | | `rubyNetcatCommand` | `--ruby-netcat-command` | | The prefix of the command to execute to communicate between the node.js process and the Ruby process. (For example, `"nc -U"` or `"telnet -u"`) Normally you should not set this option. | - | `rubySingleQuote` | `--ruby-single-quote` | `true` | When double quotes are not necessary for interpolation, prefers the use of single quotes for string literals. | | `rubyToProc` | `--ruby-to-proc` | `false` | When possible, convert blocks to the more concise `Symbol#to_proc` syntax. | | `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). | From 00bfecdfcb72fc59a80c50c7cf0ffc5eb9250ede Mon Sep 17 00:00:00 2001 From: Robert DiMartino Date: Wed, 17 Mar 2021 16:03:41 -0400 Subject: [PATCH 131/785] format with prettier :-) --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7ea5a9c6..950dac24 100644 --- a/README.md +++ b/README.md @@ -136,10 +136,10 @@ Below are the options (from [`src/plugin.js`](src/plugin.js)) that `@prettier/pl | `rubyHashLabel` | `--ruby-hash-label` | `true` | When possible, uses the shortened hash key syntax, as opposed to hash rockets. | | `rubyModifier` | `--ruby-modifier` | `true` | When it fits on one line, allows while and until statements to use the modifier form. | | `rubyNetcatCommand` | `--ruby-netcat-command` | | The prefix of the command to execute to communicate between the node.js process and the Ruby process. (For example, `"nc -U"` or `"telnet -u"`) Normally you should not set this option. | -| `rubySingleQuote` | `--ruby-single-quote` | `true` | When double quotes are not necessary for interpolation, prefers the use of single quotes for string literals. | -| `rubyToProc` | `--ruby-to-proc` | `false` | When possible, convert blocks to the more concise `Symbol#to_proc` syntax. | -| `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). | -| `trailingComma` | `--trailing-comma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#trailing-comma)). `"es5"` is equivalent to `true`. | +| `rubySingleQuote` | `--ruby-single-quote` | `true` | When double quotes are not necessary for interpolation, prefers the use of single quotes for string literals. | +| `rubyToProc` | `--ruby-to-proc` | `false` | When possible, convert blocks to the more concise `Symbol#to_proc` syntax. | +| `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). | +| `trailingComma` | `--trailing-comma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#trailing-comma)). `"es5"` is equivalent to `true`. | Any of these can be added to your existing [prettier configuration file](https://prettier.io/docs/en/configuration.html). For example: From 86f258153a26281803c7ca3f4076590076e69dbf Mon Sep 17 00:00:00 2001 From: Andy Waite Date: Thu, 18 Mar 2021 20:58:07 -0400 Subject: [PATCH 132/785] Fix arguments example in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 950dac24..9b89b60e 100644 --- a/README.md +++ b/README.md @@ -153,7 +153,7 @@ file](https://prettier.io/docs/en/configuration.html). For example: Or, they can be passed to `prettier` as arguments: ```bash -prettier --ruby-single-quote false --write '**/*' +bundle exec rbprettier --ruby-single-quote false --write '**/*' ``` ### Usage with RuboCop From ec1b49bf48ced947eb591fa2f9fdc7386969e507 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Fri, 19 Mar 2021 08:23:53 -0400 Subject: [PATCH 133/785] Fix for #841 --- CHANGELOG.md | 4 ++++ src/parser/parseSync.js | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ea13243..efd2c6ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Changed + +- [#841](https://github.com/prettier/plugin-ruby/issues/841) - LoganBarnett, kddeisz - Better error messaging for when unix sockets are not supported by netcat. + ## [1.5.4] - 2021-03-17 ### Changed diff --git a/src/parser/parseSync.js b/src/parser/parseSync.js index 227b75b2..3773d26c 100644 --- a/src/parser/parseSync.js +++ b/src/parser/parseSync.js @@ -9,7 +9,10 @@ function parseSync(parser, source, opts) { // We need special handling in case the user's version of nc doesn't support // using unix sockets. - if (stderr.includes("invalid option -- U")) { + if ( + stderr.includes("invalid option -- U") || + stderr.includes("Protocol not supported") + ) { throw new Error(` @prettier/plugin-ruby uses netcat to communicate over unix sockets between the node.js process running prettier and an underlying Ruby process used From 7571f5448610e2913048f62d61fdbe9cd6bbbf7e Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Fri, 19 Mar 2021 10:08:12 -0400 Subject: [PATCH 134/785] Consolidate parseSync logic for clarity --- src/parser/getLang.js | 32 ------- src/parser/getNetcat.js | 57 ------------ src/parser/parseSync.js | 138 ++++++++++++++++++++++++++++-- src/parser/requestParse.js | 74 ---------------- test/js/ruby/nodes/method.test.js | 26 ------ 5 files changed, 133 insertions(+), 194 deletions(-) delete mode 100644 src/parser/getLang.js delete mode 100644 src/parser/getNetcat.js delete mode 100644 src/parser/requestParse.js diff --git a/src/parser/getLang.js b/src/parser/getLang.js deleted file mode 100644 index 4b95c12e..00000000 --- a/src/parser/getLang.js +++ /dev/null @@ -1,32 +0,0 @@ -// In order to properly parse ruby code, we need to tell the ruby process to -// parse using UTF-8. Unfortunately, the way that you accomplish this looks -// differently depending on your platform. -/* istanbul ignore next */ -function getLang() { - const { env, platform } = process; - const envValue = env.LC_ALL || env.LC_CTYPE || env.LANG; - - // If an env var is set for the locale that already includes UTF-8 in the - // name, then assume we can go with that. - if (envValue && envValue.includes("UTF-8")) { - return envValue; - } - - // Otherwise, we're going to guess which encoding to use based on the system. - // This is probably not the best approach in the world, as you could be on - // linux and not have C.UTF-8, but in that case you're probably passing an env - // var for it. This object below represents all of the possible values of - // process.platform per: - // https://nodejs.org/api/process.html#process_process_platform - return { - aix: "C.UTF-8", - darwin: "en_US.UTF-8", - freebsd: "C.UTF-8", - linux: "C.UTF-8", - openbsd: "C.UTF-8", - sunos: "C.UTF-8", - win32: ".UTF-8" - }[platform]; -} - -module.exports = getLang; diff --git a/src/parser/getNetcat.js b/src/parser/getNetcat.js deleted file mode 100644 index 25da2de6..00000000 --- a/src/parser/getNetcat.js +++ /dev/null @@ -1,57 +0,0 @@ -const { spawnSync } = require("child_process"); -const os = require("os"); - -// Checks to see if an executable is available. -function hasCommand(name) { - let result; - - if (os.type() === "Windows_NT") { - result = spawnSync("where", [name]); - } else { - result = spawnSync("command", ["-v", name]); - } - - return result.status === 0; -} - -// Finds an netcat-like adapter to use for sending data to a socket. We order -// these by likelihood of being found so we can avoid some shell-outs. -function getCommandAndArgs() { - if (hasCommand("nc")) { - return ["nc", ["-U"]]; - } - - if (hasCommand("telnet")) { - return ["telnet", ["-u"]]; - } - - if (hasCommand("ncat")) { - return ["ncat", ["-U"]]; - } - - if (hasCommand("socat")) { - return ["socat", ["-"]]; - } - - return ["node", [require.resolve("./netcat.js")]]; -} - -let command; -let args; - -function getNetcat(opts) { - if (!command) { - if (opts.rubyNetcatCommand) { - const splits = opts.rubyNetcatCommand.split(" "); - - command = splits[0]; - args = splits.slice(1); - } else { - [command, args] = getCommandAndArgs(); - } - } - - return { command, args }; -} - -module.exports = getNetcat; diff --git a/src/parser/parseSync.js b/src/parser/parseSync.js index 3773d26c..a295a312 100644 --- a/src/parser/parseSync.js +++ b/src/parser/parseSync.js @@ -1,11 +1,139 @@ -const requestParse = require("./requestParse"); +const { spawn, spawnSync, execSync } = require("child_process"); +const { existsSync, mkdtempSync } = require("fs"); +const os = require("os"); +const path = require("path"); +const process = require("process"); + +let sockfile = process.env.PRETTIER_RUBY_HOST; +let netcat; + +// In order to properly parse ruby code, we need to tell the ruby process to +// parse using UTF-8. Unfortunately, the way that you accomplish this looks +// differently depending on your platform. +/* istanbul ignore next */ +function getLang() { + const { env, platform } = process; + const envValue = env.LC_ALL || env.LC_CTYPE || env.LANG; + + // If an env var is set for the locale that already includes UTF-8 in the + // name, then assume we can go with that. + if (envValue && envValue.includes("UTF-8")) { + return envValue; + } + + // Otherwise, we're going to guess which encoding to use based on the system. + // This is probably not the best approach in the world, as you could be on + // linux and not have C.UTF-8, but in that case you're probably passing an env + // var for it. This object below represents all of the possible values of + // process.platform per: + // https://nodejs.org/api/process.html#process_process_platform + return { + aix: "C.UTF-8", + darwin: "en_US.UTF-8", + freebsd: "C.UTF-8", + linux: "C.UTF-8", + openbsd: "C.UTF-8", + sunos: "C.UTF-8", + win32: ".UTF-8" + }[platform]; +} + +// Spawn the parser.rb subprocess. We do this since booting Ruby is slow, and we +// can re-use the parser process multiple times since it is statelesss. +function spawnParseServer() { + const tmpDir = mkdtempSync(path.join(os.tmpdir(), "prettier-ruby")); + const tmpFile = path.join(tmpDir, `${process.pid}.sock`); + + const server = spawn( + "ruby", + [path.join(__dirname, "./server.rb"), tmpFile], + { + env: Object.assign({}, process.env, { LANG: getLang() }), + detached: true, + stdio: "inherit" + } + ); + + process.on("exit", () => { + try { + process.kill(-server.pid); + } catch (e) { + // ignore + } + }); + + server.unref(); + const now = new Date(); + + // Wait for server to go live. + while (!existsSync(tmpFile) && new Date() - now < 3000) { + execSync("sleep 0.1"); + } + + return tmpFile; +} + +// Checks to see if an executable is available. +function hasCommand(name) { + let result; + + if (os.type() === "Windows_NT") { + result = spawnSync("where", [name]); + } else { + result = spawnSync("command", ["-v", name]); + } + + return result.status === 0; +} + +// Finds a netcat-like adapter to use for sending data to a socket. We order +// these by likelihood of being found so we can avoid some shell-outs. +function findNetcat(opts) { + if (opts.rubyNetcatCommand) { + const splits = opts.rubyNetcatCommand.split(" "); + return { command: splits[0], args: splits.slice(1) }; + } + + if (hasCommand("nc")) { + return { command: "nc", args: ["-U"] }; + } + + if (hasCommand("telnet")) { + return { command: "telnet", args: ["-u"] }; + } + + if (hasCommand("ncat")) { + return { command: "ncat", args: ["-U"] }; + } + + if (hasCommand("socat")) { + return { command: "socat", args: ["-"] }; + } + + return { command: "node", args: [require.resolve("./netcat.js")] }; +} // Formats and sends a request to the parser server. We use netcat (or something // like it) here since Prettier requires the results of `parse` to be // synchronous and Node.js does not offer a mechanism for synchronous socket // requests. function parseSync(parser, source, opts) { - const { stdout, stderr, status } = requestParse(parser, source, opts); + if (!sockfile) { + sockfile = spawnParseServer(); + } + + if (!netcat) { + netcat = findNetcat(opts); + } + + const response = spawnSync(netcat.command, netcat.args.concat(sockfile), { + input: `${parser}|${source}`, + maxBuffer: 15 * 1024 * 1024 + }); + + const stdout = response.stdout.toString(); + const stderr = response.stderr.toString(); + const { status } = response; // We need special handling in case the user's version of nc doesn't support // using unix sockets. @@ -17,9 +145,9 @@ function parseSync(parser, source, opts) { @prettier/plugin-ruby uses netcat to communicate over unix sockets between the node.js process running prettier and an underlying Ruby process used for parsing. Unfortunately the version of netcat that you have installed - (GNU netcat) does not support unix sockets. To solve this either uninstall - GNU netcat and use a different implementation, or change the value of the - rubyNetcatCommand option in your prettier configuration. + does not support unix sockets. To solve this either uninstall the version + of netcat that you're using and use a different implementation, or change + the value of the rubyNetcatCommand option in your prettier configuration. `); } diff --git a/src/parser/requestParse.js b/src/parser/requestParse.js deleted file mode 100644 index 9deca71e..00000000 --- a/src/parser/requestParse.js +++ /dev/null @@ -1,74 +0,0 @@ -const { spawn, spawnSync, execSync } = require("child_process"); -const path = require("path"); -const { existsSync, mkdtempSync } = require("fs"); -const process = require("process"); -const os = require("os"); - -const getNetcat = require("./getNetcat"); -const getLang = require("./getLang"); - -let sockfile = process.env.PRETTIER_RUBY_HOST; - -// Spawn the parser.rb subprocess. We do this since booting Ruby is slow, and we -// can re-use the parser process multiple times since it is statelesss. -function spawnParseServer() { - const server = spawn( - "ruby", - [path.join(__dirname, "./server.rb"), sockfile], - { - env: Object.assign({}, process.env, { LANG: getLang() }), - detached: true, - stdio: "inherit" - } - ); - - process.on("exit", () => { - try { - process.kill(-server.pid); - } catch (e) { - // ignore - } - }); - - server.unref(); - const now = new Date(); - - // Wait for server to go live. - while (!existsSync(sockfile) && new Date() - now < 3000) { - execSync("sleep 0.1"); - } -} - -// Ensures that a parser server is currently running by checking against the -// sockfile variable. If it is not, create a temporary directory to house the -// sockfile and spawn the ruby process. -function ensureParseServer() { - if (sockfile) { - return; - } - - const tmpDir = mkdtempSync(path.join(os.tmpdir(), "prettier-ruby")); - sockfile = path.join(tmpDir, `${process.pid}.sock`); - - spawnParseServer(); -} - -// Sends a request to the parse server to parse the given content. -function requestParse(parser, source, opts) { - ensureParseServer(); - - const { command, args } = getNetcat(opts); - const { stdout, stderr, status } = spawnSync(command, args.concat(sockfile), { - input: `${parser}|${source}`, - maxBuffer: 15 * 1024 * 1024 - }); - - return { - command, - stdout: stdout.toString(), - stderr: stderr.toString(), - status - }; -} - -module.exports = requestParse; diff --git a/test/js/ruby/nodes/method.test.js b/test/js/ruby/nodes/method.test.js index f16f43d9..498c4307 100644 --- a/test/js/ruby/nodes/method.test.js +++ b/test/js/ruby/nodes/method.test.js @@ -146,32 +146,6 @@ describe("method", () => { expect("def foo(name) = bar").toMatchFormat()); } - test.skip("def/begin transform", () => { - const content = ruby(` - def foo - begin - try_something - rescue SomeError => error - handle_error(error) - ensure - this_always_happens - end - end - `); - - const expected = ruby(` - def foo - try_something - rescue SomeError => error - handle_error(error) - ensure - this_always_happens - end - `); - - return expect(content).toChangeFormat(expected); - }); - test("comments on kwargs", () => { const content = ruby(` def foo( From be120504b600b8b3615af14880e03b869dc1bda8 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Fri, 19 Mar 2021 10:28:30 -0400 Subject: [PATCH 135/785] Fix up linting --- src/parser/parseSync.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/parser/parseSync.js b/src/parser/parseSync.js index a295a312..ce0bda7a 100644 --- a/src/parser/parseSync.js +++ b/src/parser/parseSync.js @@ -44,15 +44,11 @@ function spawnParseServer() { const tmpDir = mkdtempSync(path.join(os.tmpdir(), "prettier-ruby")); const tmpFile = path.join(tmpDir, `${process.pid}.sock`); - const server = spawn( - "ruby", - [path.join(__dirname, "./server.rb"), tmpFile], - { - env: Object.assign({}, process.env, { LANG: getLang() }), - detached: true, - stdio: "inherit" - } - ); + const server = spawn("ruby", [path.join(__dirname, "./server.rb"), tmpFile], { + env: Object.assign({}, process.env, { LANG: getLang() }), + detached: true, + stdio: "inherit" + }); process.on("exit", () => { try { From 257d7bafd829a81921e3d5bd1d3276e93d244176 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Mar 2021 05:08:56 +0000 Subject: [PATCH 136/785] Bump husky from 5.1.3 to 5.2.0 Bumps [husky](https://github.com/typicode/husky) from 5.1.3 to 5.2.0. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v5.1.3...v5.2.0) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index d7d8272e..946be375 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1792,9 +1792,9 @@ human-signals@^1.1.1: integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== husky@^5.0.9: - version "5.1.3" - resolved "https://registry.yarnpkg.com/husky/-/husky-5.1.3.tgz#1a0645a4fe3ffc006c4d0d8bd0bcb4c98787cc9d" - integrity sha512-fbNJ+Gz5wx2LIBtMweJNY1D7Uc8p1XERi5KNRMccwfQA+rXlxWNSdUxswo0gT8XqxywTIw7Ywm/F4v/O35RdMg== + version "5.2.0" + resolved "https://registry.yarnpkg.com/husky/-/husky-5.2.0.tgz#fc5e1c2300d34855d47de4753607d00943fc0802" + integrity sha512-AM8T/auHXRBxlrfPVLKP6jt49GCM2Zz47m8G3FOMsLmTv8Dj/fKVWE0Rh2d4Qrvmy131xEsdQnb3OXRib67PGg== iconv-lite@0.4.24: version "0.4.24" From a10a83c6898741dc99287cec94f2bec2da7dd0c5 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Tue, 23 Mar 2021 14:18:00 -0400 Subject: [PATCH 137/785] s/pull_request/pull_request_target --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3bdeedc5..29cd0cb3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,7 +1,7 @@ name: Main on: - push - - pull_request + - pull_request_target jobs: ci: name: CI @@ -75,7 +75,7 @@ jobs: - ci - lint runs-on: ubuntu-latest - if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' + if: github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]' steps: - uses: actions/github-script@v3 with: From 1a3e169439e52b49620b670cf2150bd8bdb685df Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Tue, 23 Mar 2021 15:46:42 -0400 Subject: [PATCH 138/785] Fix #844 --- CHANGELOG.md | 1 + prettier.gemspec | 14 +++++--------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index efd2c6ef..722e6e16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Changed - [#841](https://github.com/prettier/plugin-ruby/issues/841) - LoganBarnett, kddeisz - Better error messaging for when unix sockets are not supported by netcat. +- [#844](https://github.com/prettier/plugin-ruby/issues/844) - andyw8, kddeisz - Ensure we ship all of the parsers with the prettier gem so that `rbprettier` can parse other languages as well. ## [1.5.4] - 2021-03-17 diff --git a/prettier.gemspec b/prettier.gemspec index ef11fdda..5a381c48 100644 --- a/prettier.gemspec +++ b/prettier.gemspec @@ -14,15 +14,11 @@ Gem::Specification.new do |spec| spec.files = Dir.chdir(__dir__) do - Dir['{{exe,lib,src}/**/*,*.md}'] + %w[ - bin/console - LICENSE - node_modules/prettier/bin-prettier.js - node_modules/prettier/index.js - node_modules/prettier/third-party.js - package.json - rubocop.yml - ] + %w[LICENSE bin/console package.json rubocop.yml] + + Dir['{{exe,lib,src}/**/*,*.md}'] + + Dir[ + 'node_modules/prettier/{index,bin-prettier,third-party,parser-*}.js' + ] end spec.bindir = 'exe' From 31c93228ae2675a49d21c9f74272403540d23c34 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 24 Mar 2021 08:48:05 -0400 Subject: [PATCH 139/785] Fix for #847 --- CHANGELOG.md | 1 + src/rbs/parser.rb | 8 +++++++- src/rbs/printer.js | 18 ++++++++++++++---- test/js/rbs/method.txt | 1 + 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 722e6e16..fb67423b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#841](https://github.com/prettier/plugin-ruby/issues/841) - LoganBarnett, kddeisz - Better error messaging for when unix sockets are not supported by netcat. - [#844](https://github.com/prettier/plugin-ruby/issues/844) - andyw8, kddeisz - Ensure we ship all of the parsers with the prettier gem so that `rbprettier` can parse other languages as well. +- [#847](https://github.com/prettier/plugin-ruby/issues/847) - jflinter, kddeisz - Ensure parentheses are present on union return types in RBS. ## [1.5.4] - 2021-03-17 diff --git a/src/rbs/parser.rb b/src/rbs/parser.rb index 1bc8923f..d44ca0e1 100644 --- a/src/rbs/parser.rb +++ b/src/rbs/parser.rb @@ -86,7 +86,13 @@ def to_json(*a) module Prettier class RBSParser def self.parse(text) - { declarations: RBS::Parser.parse_signature(text) } + { + declarations: RBS::Parser.parse_signature(text), + location: { + start_pos: 0, + end_pos: text.length + } + } end end end diff --git a/src/rbs/printer.js b/src/rbs/printer.js index ad133541..2f4ed2aa 100644 --- a/src/rbs/printer.js +++ b/src/rbs/printer.js @@ -147,7 +147,7 @@ function printNode(path, opts, print) { // This is the big function that prints out any individual type, which can // look like all kinds of things, listed in the case statement below. - function printType(path) { + function printType(path, { forceUnionParens = false } = {}) { const node = path.getValue(); switch (node.class) { @@ -173,8 +173,11 @@ function printNode(path, opts, print) { join(concat([line, "| "]), path.map(printType, "types")) ); - const parentType = path.getParentNode().class; - return parentType === "intersection" ? concat(["(", doc, ")"]) : doc; + if (forceUnionParens || path.getParentNode().class === "intersection") { + return concat(["(", doc, ")"]); + } + + return doc; } case "intersection": return group(join(concat([line, "& "]), path.map(printType, "types"))); @@ -515,7 +518,14 @@ function printNode(path, opts, print) { ); } - parts.push("-> ", path.call(printType, "type", "return_type")); + parts.push( + "-> ", + path.call( + (typePath) => printType(typePath, { forceUnionParens: true }), + "type", + "return_type" + ) + ); return group(concat(parts)); } diff --git a/test/js/rbs/method.txt b/test/js/rbs/method.txt index bceed6dd..32ca5a3a 100644 --- a/test/js/rbs/method.txt +++ b/test/js/rbs/method.txt @@ -1,5 +1,6 @@ def t: -> void def t: -> void | ... +def t: -> ('a' | 'b' | 'c') def self.t: -> void def self.t: -> void | ... def self?.t: -> void From 16b28375d3a3bed82d4f75c8cafbe4eb69d604dc Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Thu, 25 Mar 2021 08:55:02 -0400 Subject: [PATCH 140/785] Fix for #850 --- CHANGELOG.md | 1 + src/haml/nodes/tag.js | 2 +- test/js/haml/tag.test.js | 66 +++++++++++++++++++++++----------------- 3 files changed, 40 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb67423b..ea544ecf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#841](https://github.com/prettier/plugin-ruby/issues/841) - LoganBarnett, kddeisz - Better error messaging for when unix sockets are not supported by netcat. - [#844](https://github.com/prettier/plugin-ruby/issues/844) - andyw8, kddeisz - Ensure we ship all of the parsers with the prettier gem so that `rbprettier` can parse other languages as well. - [#847](https://github.com/prettier/plugin-ruby/issues/847) - jflinter, kddeisz - Ensure parentheses are present on union return types in RBS. +- [#850](https://github.com/prettier/plugin-ruby/issues/850) - maethub, kddeisz - Ensure double quotes are used even when single quotes are requested for HAML attribute values. ## [1.5.4] - 2021-03-17 diff --git a/src/haml/nodes/tag.js b/src/haml/nodes/tag.js index 2723c411..4f1a3f02 100644 --- a/src/haml/nodes/tag.js +++ b/src/haml/nodes/tag.js @@ -36,7 +36,7 @@ function getHashValue(value, opts) { return value.slice(1); } - const quote = opts.rubySingleQuote ? "'" : '"'; + const quote = opts.rubySingleQuote && !value.includes("#{") ? "'" : '"'; return `${quote}${value}${quote}`; } diff --git a/test/js/haml/tag.test.js b/test/js/haml/tag.test.js index 078c2a67..00c2ff60 100644 --- a/test/js/haml/tag.test.js +++ b/test/js/haml/tag.test.js @@ -42,45 +42,55 @@ describe("tag", () => { return expect(content).toMatchFormat(); }); - test("static attributes", () => - expect(haml("%span(foo)")).toChangeFormat("%span{foo: true}")); + describe("static attributes", () => { + test("basic", () => + expect(haml("%span(foo)")).toChangeFormat("%span{foo: true}")); - test("static attributes (hash label, single quote)", () => { - const content = haml(`%section(xml:lang="en" title="title")`); - const expected = "%section{'xml:lang': 'en', title: 'title'}"; + test("hash label, single quote", () => { + const content = haml(`%section(xml:lang="en" title="title")`); + const expected = "%section{'xml:lang': 'en', title: 'title'}"; - return expect(content).toChangeFormat(expected); - }); + return expect(content).toChangeFormat(expected); + }); - test("static attributes (hash label, double quote)", () => { - const content = haml(`%section(xml:lang="en" title="title")`); - const expected = `%section{"xml:lang": "en", title: "title"}`; + test("hash label, double quote", () => { + const content = haml(`%section(xml:lang="en" title="title")`); + const expected = `%section{"xml:lang": "en", title: "title"}`; - return expect(content).toChangeFormat(expected, { rubySingleQuote: false }); - }); + return expect(content).toChangeFormat(expected, { + rubySingleQuote: false + }); + }); - test("static attributes (hash rocket, single quote)", () => { - const content = haml(`%section(xml:lang="en" title="title")`); - const expected = `%section{:'xml:lang' => 'en', :title => 'title'}`; + test("hash label, single quote, interpolation", () => { + const content = haml(`%section{title: "#{title}"}`); - return expect(content).toChangeFormat(expected, { rubyHashLabel: false }); - }); + return expect(content).toMatchFormat(content); + }); - test("static attributes (hash rocket, double quote)", () => { - const content = haml(`%section(xml:lang="en" title="title")`); - const expected = '%section{:"xml:lang" => "en", :title => "title"}'; + test("hash rocket, single quote", () => { + const content = haml(`%section(xml:lang="en" title="title")`); + const expected = `%section{:'xml:lang' => 'en', :title => 'title'}`; - return expect(content).toChangeFormat(expected, { - rubyHashLabel: false, - rubySingleQuote: false + return expect(content).toChangeFormat(expected, { rubyHashLabel: false }); }); - }); - test("static attributes (non-strings)", () => { - const content = haml(`%section(foo=1 bar=2)`); - const expected = `%section(foo=1 bar=2)`; + test("hash rocket, double quote", () => { + const content = haml(`%section(xml:lang="en" title="title")`); + const expected = '%section{:"xml:lang" => "en", :title => "title"}'; - return expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected, { + rubyHashLabel: false, + rubySingleQuote: false + }); + }); + + test("non-strings", () => { + const content = haml(`%section(foo=1 bar=2)`); + const expected = `%section(foo=1 bar=2)`; + + return expect(content).toChangeFormat(expected); + }); }); test("object reference", () => { From e1f50082bf35d6b387e173378ec448f6f4653a90 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Thu, 25 Mar 2021 09:28:59 -0400 Subject: [PATCH 141/785] Fix for #849 --- CHANGELOG.md | 1 + src/haml/nodes/tag.js | 49 ++++++++++++++++++++++++++++++++++++++----- src/haml/parser.rb | 9 +++++++- 3 files changed, 53 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea544ecf..38095adf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#844](https://github.com/prettier/plugin-ruby/issues/844) - andyw8, kddeisz - Ensure we ship all of the parsers with the prettier gem so that `rbprettier` can parse other languages as well. - [#847](https://github.com/prettier/plugin-ruby/issues/847) - jflinter, kddeisz - Ensure parentheses are present on union return types in RBS. - [#850](https://github.com/prettier/plugin-ruby/issues/850) - maethub, kddeisz - Ensure double quotes are used even when single quotes are requested for HAML attribute values. +- [#849](https://github.com/prettier/plugin-ruby/issues/849) - indirect, kddeisz - Support HAML version <= 5.1 multi-line attributes. ## [1.5.4] - 2021-03-17 diff --git a/src/haml/nodes/tag.js b/src/haml/nodes/tag.js index 4f1a3f02..240718dc 100644 --- a/src/haml/nodes/tag.js +++ b/src/haml/nodes/tag.js @@ -84,17 +84,42 @@ function getAttributesObject(object, opts, level = 0) { ]) ); + // If we have support for multi-line attributes laid out like a regular hash, + // then we print them that way here. + if (opts.supportsMultiline) { + return group( + concat([ + "{", + indent(group(concat([boundary, join(concat([",", line]), parts)]))), + boundary, + "}" + ]) + ); + } + + // Otherwise, if we only have one attribute, then just print it inline + // regardless of how long it is. + if (parts.length === 0) { + return group(concat(["{", parts[0], "}"])); + } + + // Otherwise, depending on how long the line is it will split the content into + // multi-line attributes that old Haml understands. return group( concat([ "{", - indent(group(concat([boundary, join(concat([",", line]), parts)]))), - boundary, + parts[0], + ",", + align( + opts.headerLength + 1, + concat([line, join(concat([",", line]), parts.slice(1))]) + ), "}" ]) ); } -function getHeader(value, opts) { +function getHeader(value, opts, supportsMultiline) { const { attributes } = value; const parts = []; @@ -130,7 +155,15 @@ function getHeader(value, opts) { if (typeof value.dynamic_attributes.old === "string") { parts.push(value.dynamic_attributes.old); } else { - parts.push(getAttributesObject(value.dynamic_attributes.old, opts)); + parts.push( + getAttributesObject( + value.dynamic_attributes.old, + Object.assign({}, opts, { + supportsMultiline, + headerLength: parts.join("").length + }) + ) + ); } } @@ -176,7 +209,13 @@ function getHeader(value, opts) { // https://haml.info/docs/yardoc/file.REFERENCE.html#element-name- function tag(path, opts, print) { const { children, value } = path.getValue(); - const header = getHeader(value, opts); + + // This is kind of a total hack in that I don't think you're really supposed + // to directly use `path.stack`, but it's the easiest way to get the root node + // without having to know how many levels deep we are. + const { supports_multiline } = path.stack[0]; + + const header = getHeader(value, opts, supports_multiline); if (children.length === 0) { return header; diff --git a/src/haml/parser.rb b/src/haml/parser.rb index e79f3742..cd8d9796 100644 --- a/src/haml/parser.rb +++ b/src/haml/parser.rb @@ -86,7 +86,14 @@ def as_json json[:value][:text] = "\\#{text}" if text.match?(SPECIAL_START) end when :root - to_h.tap { |json| json[:children] = children.map(&:as_json) } + to_h.tap do |json| + json[:children] = children.map(&:as_json) + + # We need this information in the printer to know how to lay out + # multi-line attributes. + json[:supports_multiline] = + Gem::Version.new(Haml::VERSION) >= Gem::Version.new('5.2') + end when :script to_h.tap do |json| json.delete(:parent) From 45f3f2eded694de392ea0518eecc3f3baa7fea6b Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Thu, 25 Mar 2021 10:00:39 -0400 Subject: [PATCH 142/785] Fix for #810 --- CHANGELOG.md | 1 + src/ruby/parser.rb | 4 ++-- test/js/ruby/nodes/heredocs.test.js | 11 +++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38095adf..c194cba3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#847](https://github.com/prettier/plugin-ruby/issues/847) - jflinter, kddeisz - Ensure parentheses are present on union return types in RBS. - [#850](https://github.com/prettier/plugin-ruby/issues/850) - maethub, kddeisz - Ensure double quotes are used even when single quotes are requested for HAML attribute values. - [#849](https://github.com/prettier/plugin-ruby/issues/849) - indirect, kddeisz - Support HAML version <= 5.1 multi-line attributes. +- [#810](https://github.com/prettier/plugin-ruby/issues/810) - valscion, kddeisz - Make it so that brace blocks containing heredocs have the correct end line so that they format subsequent statements correctly. ## [1.5.4] - 2021-03-17 diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 553b88d3..fc566493 100755 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -662,7 +662,7 @@ def on_brace_block(block_var, stmts) body: [block_var, stmts], sl: beging[:sl], sc: beging[:sc], - el: ending[:el], + el: [ending[:el], stmts[:el]].max, ec: ending[:ec] } end @@ -715,7 +715,7 @@ def on_call(receiver, oper, sending) body: [receiver, oper, sending], sl: receiver[:sl], sc: receiver[:sc], - el: ending[:el], + el: [ending[:el], receiver[:el]].max, ec: ending[:ec] } end diff --git a/test/js/ruby/nodes/heredocs.test.js b/test/js/ruby/nodes/heredocs.test.js index 50d3fb18..8e73254d 100644 --- a/test/js/ruby/nodes/heredocs.test.js +++ b/test/js/ruby/nodes/heredocs.test.js @@ -523,4 +523,15 @@ describe("heredocs", () => { return expect(content).toMatchFormat(); }); + + test("spilling out from another node keeps subsequent formatting", () => { + const content = ruby(` + foo { <<~BAR.baz } + qux + BAR + qaz + `); + + return expect(content).toMatchFormat(); + }); }); From d422c7abe13a8a55b883c658799e793e8fe1f8b7 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Thu, 25 Mar 2021 10:09:32 -0400 Subject: [PATCH 143/785] Bump to v1.5.5 --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c194cba3..e60fd6e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [1.5.5] - 2021-03-25 + ### Changed - [#841](https://github.com/prettier/plugin-ruby/issues/841) - LoganBarnett, kddeisz - Better error messaging for when unix sockets are not supported by netcat. @@ -1102,7 +1104,8 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.5.4...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.5.5...HEAD +[1.5.5]: https://github.com/prettier/plugin-ruby/compare/v1.5.4...v1.5.5 [1.5.4]: https://github.com/prettier/plugin-ruby/compare/v1.5.3...v1.5.4 [1.5.3]: https://github.com/prettier/plugin-ruby/compare/v1.5.2...v1.5.3 [1.5.2]: https://github.com/prettier/plugin-ruby/compare/v1.5.1...v1.5.2 diff --git a/package.json b/package.json index 174f1966..f6a40926 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "1.5.4", + "version": "1.5.5", "description": "prettier plugin for the Ruby programming language", "main": "src/plugin.js", "scripts": { From 1a72e5e4c5d0d920e4f090caa150089123d35ca9 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Fri, 26 Mar 2021 10:41:09 -0400 Subject: [PATCH 144/785] Fix for #854 --- CHANGELOG.md | 4 ++++ src/rbs/printer.js | 33 +++++++++++++++++++++++++++------ test/js/rbs/method.txt | 5 +++++ 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e60fd6e9..d4b7d9c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Changed + +- [#854](https://github.com/prettier/plugin-ruby/issues/854) - jflinter, kddeisz - Parentheses should not be stripped from optional RBS union types. + ## [1.5.5] - 2021-03-25 ### Changed diff --git a/src/rbs/printer.js b/src/rbs/printer.js index 2f4ed2aa..c8e2c29e 100644 --- a/src/rbs/printer.js +++ b/src/rbs/printer.js @@ -147,7 +147,7 @@ function printNode(path, opts, print) { // This is the big function that prints out any individual type, which can // look like all kinds of things, listed in the case statement below. - function printType(path, { forceUnionParens = false } = {}) { + function printType(path, { forceParens = false } = {}) { const node = path.getValue(); switch (node.class) { @@ -157,7 +157,13 @@ function printNode(path, opts, print) { } return node.literal; case "optional": - return concat([path.call(printType, "type"), "?"]); + return concat([ + path.call( + (typePath) => printType(typePath, { forceParens: true }), + "type" + ), + "?" + ]); case "tuple": // If we don't have any sub types, we explicitly need the space in between // the brackets to not confuse the parser. @@ -173,14 +179,29 @@ function printNode(path, opts, print) { join(concat([line, "| "]), path.map(printType, "types")) ); - if (forceUnionParens || path.getParentNode().class === "intersection") { + if (forceParens) { + return concat(["(", doc, ")"]); + } + + return doc; + } + case "intersection": { + const doc = group( + join( + concat([line, "& "]), + path.map( + (typePath) => printType(typePath, { forceParens: true }), + "types" + ) + ) + ); + + if (forceParens) { return concat(["(", doc, ")"]); } return doc; } - case "intersection": - return group(join(concat([line, "& "]), path.map(printType, "types"))); case "class_singleton": return concat(["singleton(", node.name, ")"]); case "proc": @@ -521,7 +542,7 @@ function printNode(path, opts, print) { parts.push( "-> ", path.call( - (typePath) => printType(typePath, { forceUnionParens: true }), + (typePath) => printType(typePath, { forceParens: true }), "type", "return_type" ) diff --git a/test/js/rbs/method.txt b/test/js/rbs/method.txt index 32ca5a3a..abc4047e 100644 --- a/test/js/rbs/method.txt +++ b/test/js/rbs/method.txt @@ -1,6 +1,11 @@ def t: -> void def t: -> void | ... def t: -> ('a' | 'b' | 'c') +def t: -> ('a' | 'b' | 'c')? +def t: -> ('a' & 'b' & 'c') +def t: -> ('a' & 'b' & 'c')? +def t: -> ('a' & ('b' | 'c')) +def t: -> ('a' & ('b' | 'c'))? def self.t: -> void def self.t: -> void | ... def self?.t: -> void From 35303904d7db867a718f2669c66a759453252ea2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Mar 2021 05:03:13 +0000 Subject: [PATCH 145/785] Bump eslint from 7.22.0 to 7.23.0 Bumps [eslint](https://github.com/eslint/eslint) from 7.22.0 to 7.23.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v7.22.0...v7.23.0) Signed-off-by: dependabot[bot] --- yarn.lock | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/yarn.lock b/yarn.lock index 946be375..85b91eb4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1305,9 +1305,9 @@ eslint-visitor-keys@^2.0.0: integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== eslint@^7.22.0: - version "7.22.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.22.0.tgz#07ecc61052fec63661a2cab6bd507127c07adc6f" - integrity sha512-3VawOtjSJUQiiqac8MQc+w457iGLfuNGLFn8JmF051tTKbh5/x/0vlcEj8OgDCaw7Ysa2Jn8paGshV7x2abKXg== + version "7.23.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.23.0.tgz#8d029d252f6e8cf45894b4bee08f5493f8e94325" + integrity sha512-kqvNVbdkjzpFy0XOszNwjkKzZ+6TcwCQ/h+ozlcIWwaimBBuhlQ4nN6kbiM2L+OjDcznkTJxzYfRFH92sx4a0Q== dependencies: "@babel/code-frame" "7.12.11" "@eslint/eslintrc" "^0.4.0" @@ -2617,12 +2617,7 @@ lodash.sortby@^4.7.0: resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= -lodash@^4.17.19, lodash@^4.17.20: - version "4.17.20" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" - integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== - -lodash@^4.17.21: +lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== From 092c7f7b1d1c52815d07e0a5f8513e3719607e7f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Mar 2021 05:02:16 +0000 Subject: [PATCH 146/785] Bump husky from 5.2.0 to 6.0.0 Bumps [husky](https://github.com/typicode/husky) from 5.2.0 to 6.0.0. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v5.2.0...v6.0.0) Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f6a40926..6c3d9f46 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "devDependencies": { "eslint": "^7.22.0", "eslint-config-prettier": "^8.0.0", - "husky": "^5.0.9", + "husky": "^6.0.0", "jest": "^26.0.0", "pretty-quick": "^3.1.0" }, diff --git a/yarn.lock b/yarn.lock index 85b91eb4..c903f59c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1791,10 +1791,10 @@ human-signals@^1.1.1: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== -husky@^5.0.9: - version "5.2.0" - resolved "https://registry.yarnpkg.com/husky/-/husky-5.2.0.tgz#fc5e1c2300d34855d47de4753607d00943fc0802" - integrity sha512-AM8T/auHXRBxlrfPVLKP6jt49GCM2Zz47m8G3FOMsLmTv8Dj/fKVWE0Rh2d4Qrvmy131xEsdQnb3OXRib67PGg== +husky@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/husky/-/husky-6.0.0.tgz#810f11869adf51604c32ea577edbc377d7f9319e" + integrity sha512-SQS2gDTB7tBN486QSoKPKQItZw97BMOd+Kdb6ghfpBc0yXyzrddI0oDV5MkDAbuB4X2mO3/nj60TRMcYxwzZeQ== iconv-lite@0.4.24: version "0.4.24" From f247f133853db146bc60432ca30aecf41dbe7fb5 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 7 Apr 2021 09:00:32 -0400 Subject: [PATCH 147/785] Support --insert-pragma --- CHANGELOG.md | 4 ++++ src/haml/parser.js | 9 +++++---- src/haml/printer.js | 15 ++++++++++++--- src/rbs/parser.js | 4 +--- src/rbs/printer.js | 9 ++++++++- src/ruby/parser.js | 4 +--- src/ruby/printer.js | 11 ++++++++++- 7 files changed, 41 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4b7d9c7..640c491e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Added + +- [#859](https://github.com/prettier/plugin-ruby/issues/859) - azz, kddeisz - Support the `--insert-pragma` option for the incremental adoption workflow. + ### Changed - [#854](https://github.com/prettier/plugin-ruby/issues/854) - jflinter, kddeisz - Parentheses should not be stripped from optional RBS union types. diff --git a/src/haml/parser.js b/src/haml/parser.js index d0367abd..2591357f 100644 --- a/src/haml/parser.js +++ b/src/haml/parser.js @@ -1,11 +1,12 @@ const parseSync = require("../parser/parseSync"); -const parse = (text, _parsers, opts) => { +function parse(text, _parsers, opts) { return parseSync("haml", text, opts); -}; +} -const pragmaPattern = /^\s*-#\s*@(prettier|format)/; -const hasPragma = (text) => pragmaPattern.test(text); +function hasPragma(text) { + return /^\s*-#\s*@(prettier|format)/.test(text); +} // These functions are just placeholders until we can actually perform this // properly. The functions are necessary otherwise the format with cursor diff --git a/src/haml/printer.js b/src/haml/printer.js index d109d0ac..b4a08611 100644 --- a/src/haml/printer.js +++ b/src/haml/printer.js @@ -11,7 +11,7 @@ const nodes = { tag: require("./nodes/tag") }; -const genericPrint = (path, opts, print) => { +function printNode(path, opts, print) { const { type } = path.getValue(); /* istanbul ignore next */ @@ -20,9 +20,18 @@ const genericPrint = (path, opts, print) => { } return nodes[type](path, opts, print); -}; +} + +// This function handles adding the format pragma to a source string. This is an +// optional workflow for incremental adoption. +function insertPragma(text) { + const boundary = text.startsWith("-#") ? "\n" : "\n\n"; + + return `-# @format${boundary}${text}`; +} module.exports = { embed, - print: genericPrint + print: printNode, + insertPragma }; diff --git a/src/rbs/parser.js b/src/rbs/parser.js index dc612f7f..617ea32c 100644 --- a/src/rbs/parser.js +++ b/src/rbs/parser.js @@ -8,12 +8,10 @@ function parse(text, _parsers, opts) { return parseSync("rbs", text, opts); } -const pragmaPattern = /#\s*@(prettier|format)/; - // This function handles checking whether or not the source string has the // pragma for prettier. This is an optional workflow for incremental adoption. function hasPragma(text) { - return pragmaPattern.test(text); + return /^\s*#[^\S\n]*@(format|prettier)\s*(\n|$)/.test(text); } // This function is critical for comments and cursor support, and is responsible diff --git a/src/rbs/printer.js b/src/rbs/printer.js index c8e2c29e..dc7e3816 100644 --- a/src/rbs/printer.js +++ b/src/rbs/printer.js @@ -630,7 +630,14 @@ function hasPrettierIgnore(path) { return node.comment && node.comment.string.includes("prettier-ignore"); } +// This function handles adding the format pragma to a source string. This is an +// optional workflow for incremental adoption. +function insertPragma(text) { + return `# @format\n${text}`; +} + module.exports = { print: printNode, - hasPrettierIgnore + hasPrettierIgnore, + insertPragma }; diff --git a/src/ruby/parser.js b/src/ruby/parser.js index 9edfa50b..62aaf3fe 100644 --- a/src/ruby/parser.js +++ b/src/ruby/parser.js @@ -8,12 +8,10 @@ function parse(text, _parsers, opts) { return parseSync("ruby", text, opts); } -const pragmaPattern = /#\s*@(prettier|format)/; - // This function handles checking whether or not the source string has the // pragma for prettier. This is an optional workflow for incremental adoption. function hasPragma(text) { - return pragmaPattern.test(text); + return /^\s*#[^\S\n]*@(format|prettier)\s*(\n|$)/.test(text); } // This function is critical for comments and cursor support, and is responsible diff --git a/src/ruby/printer.js b/src/ruby/printer.js index 84094433..b0a91e6c 100644 --- a/src/ruby/printer.js +++ b/src/ruby/printer.js @@ -127,6 +127,14 @@ function isBlockComment(comment) { return comment.type === "@embdoc"; } +// This function handles adding the format pragma to a source string. This is an +// optional workflow for incremental adoption. +function insertPragma(text) { + const boundary = text.startsWith("#") ? "\n" : "\n\n"; + + return `# @format${boundary}${text}`; +} + module.exports = { embed, print: printNode, @@ -134,5 +142,6 @@ module.exports = { canAttachComment, getCommentChildNodes, printComment, - isBlockComment + isBlockComment, + insertPragma }; From 8e89d4ced1b3edf15d7b7b9e220664bdc7548aa9 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 7 Apr 2021 13:57:08 -0400 Subject: [PATCH 148/785] Simplify HAML printing --- src/haml/nodes/comment.js | 27 -- src/haml/nodes/doctype.js | 34 --- src/haml/nodes/filter.js | 16 -- src/haml/nodes/hamlComment.js | 21 -- src/haml/nodes/plain.js | 6 - src/haml/nodes/root.js | 8 - src/haml/nodes/script.js | 33 --- src/haml/nodes/silentScript.js | 59 ----- src/haml/nodes/tag.js | 232 ----------------- src/haml/printer.js | 437 +++++++++++++++++++++++++++++++-- 10 files changed, 419 insertions(+), 454 deletions(-) delete mode 100644 src/haml/nodes/comment.js delete mode 100644 src/haml/nodes/doctype.js delete mode 100644 src/haml/nodes/filter.js delete mode 100644 src/haml/nodes/hamlComment.js delete mode 100644 src/haml/nodes/plain.js delete mode 100644 src/haml/nodes/root.js delete mode 100644 src/haml/nodes/script.js delete mode 100644 src/haml/nodes/silentScript.js delete mode 100644 src/haml/nodes/tag.js diff --git a/src/haml/nodes/comment.js b/src/haml/nodes/comment.js deleted file mode 100644 index 78ec3d8f..00000000 --- a/src/haml/nodes/comment.js +++ /dev/null @@ -1,27 +0,0 @@ -const { concat, group, hardline, indent, join } = require("../../prettier"); - -// https://haml.info/docs/yardoc/file.REFERENCE.html#html-comments- -function comment(path, _opts, print) { - const { children, value } = path.getValue(); - const parts = ["/"]; - - if (value.revealed) { - parts.push("!"); - } - - if (value.conditional) { - parts.push(value.conditional); - } else if (value.text) { - parts.push(" ", value.text); - } - - if (children.length > 0) { - parts.push( - indent(concat([hardline, join(hardline, path.map(print, "children"))])) - ); - } - - return group(concat(parts)); -} - -module.exports = comment; diff --git a/src/haml/nodes/doctype.js b/src/haml/nodes/doctype.js deleted file mode 100644 index 9f699dee..00000000 --- a/src/haml/nodes/doctype.js +++ /dev/null @@ -1,34 +0,0 @@ -const { join } = require("../../prettier"); - -const types = { - basic: "Basic", - frameset: "Frameset", - mobile: "Mobile", - rdfa: "RDFa", - strict: "Strict", - xml: "XML" -}; - -const versions = ["1.1", "5"]; - -// https://haml.info/docs/yardoc/file.REFERENCE.html#doctype- -function doctype(path, _opts, _print) { - const { value } = path.getValue(); - const parts = ["!!!"]; - - if (value.type in types) { - parts.push(types[value.type]); - } else if (versions.includes(value.version)) { - parts.push(value.version); - } else { - parts.push(value.type); - } - - if (value.encoding) { - parts.push(value.encoding); - } - - return join(" ", parts); -} - -module.exports = doctype; diff --git a/src/haml/nodes/filter.js b/src/haml/nodes/filter.js deleted file mode 100644 index aa126c90..00000000 --- a/src/haml/nodes/filter.js +++ /dev/null @@ -1,16 +0,0 @@ -const { concat, group, hardline, indent, join } = require("../../prettier"); - -// https://haml.info/docs/yardoc/file.REFERENCE.html#filters -function filter(path, _opts, _print) { - const { value } = path.getValue(); - - return group( - concat([ - ":", - value.name, - indent(concat([hardline, join(hardline, value.text.trim().split("\n"))])) - ]) - ); -} - -module.exports = filter; diff --git a/src/haml/nodes/hamlComment.js b/src/haml/nodes/hamlComment.js deleted file mode 100644 index a30324e2..00000000 --- a/src/haml/nodes/hamlComment.js +++ /dev/null @@ -1,21 +0,0 @@ -const { concat, hardline, indent, join } = require("../../prettier"); - -// https://haml.info/docs/yardoc/file.REFERENCE.html#haml-comments-- -function hamlComment(path, opts, _print) { - const node = path.getValue(); - const parts = ["-#"]; - - if (node.value.text) { - if (opts.originalText.split("\n")[node.line - 1].trim() === "-#") { - const lines = node.value.text.trim().split("\n"); - - parts.push(indent(concat([hardline, join(hardline, lines)]))); - } else { - parts.push(" ", node.value.text.trim()); - } - } - - return concat(parts); -} - -module.exports = hamlComment; diff --git a/src/haml/nodes/plain.js b/src/haml/nodes/plain.js deleted file mode 100644 index fd1c9301..00000000 --- a/src/haml/nodes/plain.js +++ /dev/null @@ -1,6 +0,0 @@ -// https://haml.info/docs/yardoc/file.REFERENCE.html#plain-text -function plain(path, _opts, _print) { - return path.getValue().value.text; -} - -module.exports = plain; diff --git a/src/haml/nodes/root.js b/src/haml/nodes/root.js deleted file mode 100644 index deee0de0..00000000 --- a/src/haml/nodes/root.js +++ /dev/null @@ -1,8 +0,0 @@ -const { concat, hardline, join } = require("../../prettier"); - -// The root node in the AST -function root(path, _opts, print) { - return concat([join(hardline, path.map(print, "children")), hardline]); -} - -module.exports = root; diff --git a/src/haml/nodes/script.js b/src/haml/nodes/script.js deleted file mode 100644 index dcb5f531..00000000 --- a/src/haml/nodes/script.js +++ /dev/null @@ -1,33 +0,0 @@ -const { concat, group, hardline, indent, join } = require("../../prettier"); - -// https://haml.info/docs/yardoc/file.REFERENCE.html#inserting_ruby -function script(path, opts, print) { - const { children, value } = path.getValue(); - const parts = []; - - if (value.escape_html) { - parts.unshift("&"); - } - - if (value.preserve) { - parts.push("~"); - } else if (!value.interpolate) { - parts.push("="); - } - - if (value.escape_html && !value.preserve && value.interpolate) { - parts.push(" ", value.text.trim().slice(1, -1)); - } else { - parts.push(" ", value.text.trim()); - } - - if (children.length > 0) { - parts.push( - indent(concat([hardline, join(hardline, path.map(print, "children"))])) - ); - } - - return group(concat(parts)); -} - -module.exports = script; diff --git a/src/haml/nodes/silentScript.js b/src/haml/nodes/silentScript.js deleted file mode 100644 index 7dac177d..00000000 --- a/src/haml/nodes/silentScript.js +++ /dev/null @@ -1,59 +0,0 @@ -const { concat, group, hardline, indent, join } = require("../../prettier"); - -function findKeywordIndices(children, keywords) { - const indices = []; - - children.forEach((child, index) => { - if (child.type !== "silent_script") { - return; - } - - if (keywords.includes(child.value.keyword)) { - indices.push(index); - } - }); - - return indices; -} - -// https://haml.info/docs/yardoc/file.REFERENCE.html#running-ruby-- -function silentScript(path, _opts, print) { - const { children, value } = path.getValue(); - const parts = [`- ${value.text.trim()}`]; - - if (children.length > 0) { - const scripts = path.map(print, "children"); - - if (value.keyword === "case") { - const keywordIndices = findKeywordIndices(children, ["when", "else"]); - - parts.push( - concat( - scripts.map((script, index) => { - const concated = concat([hardline, script]); - - return keywordIndices.includes(index) ? concated : indent(concated); - }) - ) - ); - } else if (["if", "unless"].includes(value.keyword)) { - const keywordIndices = findKeywordIndices(children, ["elsif", "else"]); - - parts.push( - concat( - scripts.map((script, index) => { - const concated = concat([hardline, script]); - - return keywordIndices.includes(index) ? concated : indent(concated); - }) - ) - ); - } else { - parts.push(indent(concat([hardline, join(hardline, scripts)]))); - } - } - - return group(concat(parts)); -} - -module.exports = silentScript; diff --git a/src/haml/nodes/tag.js b/src/haml/nodes/tag.js deleted file mode 100644 index 240718dc..00000000 --- a/src/haml/nodes/tag.js +++ /dev/null @@ -1,232 +0,0 @@ -const { - align, - concat, - fill, - group, - hardline, - ifBreak, - indent, - join, - line, - softline -} = require("../../prettier"); - -function getDynamicAttributes(header, attributes) { - const pairs = attributes - .slice(1, -2) - .split(",") - .map((pair) => pair.slice(1).split('" => ')); - - const parts = [concat([pairs[0][0], "=", pairs[0][1]])]; - pairs.slice(1).forEach((pair) => { - parts.push(line, concat([pair[0], "=", pair[1]])); - }); - - return group(concat(["(", align(header + 1, fill(parts)), ")"])); -} - -function getHashValue(value, opts) { - if (typeof value !== "string") { - return value.toString(); - } - - // This is a very special syntax created by the parser to let us know that - // this should be printed literally instead of as a string. - if (value.startsWith("&")) { - return value.slice(1); - } - - const quote = opts.rubySingleQuote && !value.includes("#{") ? "'" : '"'; - return `${quote}${value}${quote}`; -} - -function getHashKey(key, opts) { - let quoted = key; - const joiner = opts.rubyHashLabel ? ":" : " =>"; - - if (key.includes(":") || key.includes("-")) { - const quote = opts.rubySingleQuote ? "'" : '"'; - quoted = `${quote}${key}${quote}`; - } - - return `${opts.rubyHashLabel ? "" : ":"}${quoted}${joiner}`; -} - -function getKeyValuePair(key, value, opts) { - return `${getHashKey(key, opts)} ${getHashValue(value, opts)}`; -} - -function getStaticAttributes(header, attributes, opts) { - const keys = Object.keys(attributes).filter( - (name) => !["class", "id"].includes(name) - ); - - const parts = [getKeyValuePair(keys[0], attributes[keys[0]], opts)]; - - keys.slice(1).forEach((key) => { - parts.push(",", line, getKeyValuePair(key, attributes[key], opts)); - }); - - return group(concat(["{", align(header + 1, fill(parts)), "}"])); -} - -function getAttributesObject(object, opts, level = 0) { - if (typeof object !== "object") { - return getHashValue(object, opts); - } - - const boundary = level === 0 ? softline : line; - const parts = Object.keys(object).map((key) => - concat([ - getHashKey(key, opts), - " ", - getAttributesObject(object[key], opts, level + 1) - ]) - ); - - // If we have support for multi-line attributes laid out like a regular hash, - // then we print them that way here. - if (opts.supportsMultiline) { - return group( - concat([ - "{", - indent(group(concat([boundary, join(concat([",", line]), parts)]))), - boundary, - "}" - ]) - ); - } - - // Otherwise, if we only have one attribute, then just print it inline - // regardless of how long it is. - if (parts.length === 0) { - return group(concat(["{", parts[0], "}"])); - } - - // Otherwise, depending on how long the line is it will split the content into - // multi-line attributes that old Haml understands. - return group( - concat([ - "{", - parts[0], - ",", - align( - opts.headerLength + 1, - concat([line, join(concat([",", line]), parts.slice(1))]) - ), - "}" - ]) - ); -} - -function getHeader(value, opts, supportsMultiline) { - const { attributes } = value; - const parts = []; - - if (value.name !== "div") { - parts.push(`%${value.name}`); - } - - if (attributes.class) { - parts.push(`.${attributes.class.replace(/ /g, ".")}`); - } - - if (attributes.id) { - parts.push(`#${attributes.id}`); - } - - if (value.dynamic_attributes.new) { - parts.push( - getDynamicAttributes(parts.join("").length, value.dynamic_attributes.new) - ); - } - - if ( - Object.keys(attributes).some((name) => name !== "class" && name !== "id") - ) { - parts.push(getStaticAttributes(parts.join("").length, attributes, opts)); - } - - if (value.dynamic_attributes.old) { - if (parts.length === 0) { - parts.push("%div"); - } - - if (typeof value.dynamic_attributes.old === "string") { - parts.push(value.dynamic_attributes.old); - } else { - parts.push( - getAttributesObject( - value.dynamic_attributes.old, - Object.assign({}, opts, { - supportsMultiline, - headerLength: parts.join("").length - }) - ) - ); - } - } - - if (value.object_ref) { - if (parts.length === 0) { - parts.push("%div"); - } - parts.push(value.object_ref); - } - - if (value.nuke_outer_whitespace) { - parts.push(">"); - } - - if (value.nuke_inner_whitespace) { - parts.push("<"); - } - - if (value.self_closing) { - parts.push("/"); - } - - if (value.value) { - const prefix = value.parse ? "= " : ifBreak("", " "); - - return group( - concat([ - group(concat(parts)), - indent(concat([softline, prefix, value.value])) - ]) - ); - } - - // In case none of the other if statements have matched and we're printing a - // div, we need to explicitly add it back into the array. - if (parts.length === 0 && value.name === "div") { - parts.push("%div"); - } - - return group(concat(parts)); -} - -// https://haml.info/docs/yardoc/file.REFERENCE.html#element-name- -function tag(path, opts, print) { - const { children, value } = path.getValue(); - - // This is kind of a total hack in that I don't think you're really supposed - // to directly use `path.stack`, but it's the easiest way to get the root node - // without having to know how many levels deep we are. - const { supports_multiline } = path.stack[0]; - - const header = getHeader(value, opts, supports_multiline); - - if (children.length === 0) { - return header; - } - - return group( - concat([ - header, - indent(concat([hardline, join(hardline, path.map(print, "children"))])) - ]) - ); -} - -module.exports = tag; diff --git a/src/haml/printer.js b/src/haml/printer.js index b4a08611..e9b45123 100644 --- a/src/haml/printer.js +++ b/src/haml/printer.js @@ -1,33 +1,434 @@ +const { + align, + concat, + fill, + group, + hardline, + ifBreak, + indent, + join, + line, + softline +} = require("../prettier"); const embed = require("./embed"); -const nodes = { - comment: require("./nodes/comment"), - doctype: require("./nodes/doctype"), - filter: require("./nodes/filter"), - haml_comment: require("./nodes/hamlComment"), - plain: require("./nodes/plain"), - root: require("./nodes/root"), - script: require("./nodes/script"), - silent_script: require("./nodes/silentScript"), - tag: require("./nodes/tag") + +const docTypes = { + basic: "Basic", + frameset: "Frameset", + mobile: "Mobile", + rdfa: "RDFa", + strict: "Strict", + xml: "XML" }; +const docVersions = ["1.1", "5"]; + +// Prints out a hash key according to the configured prettier options. +function printHashKey(key, opts) { + let quoted = key; + const joiner = opts.rubyHashLabel ? ":" : " =>"; + + if (key.includes(":") || key.includes("-")) { + const quote = opts.rubySingleQuote ? "'" : '"'; + quoted = `${quote}${key}${quote}`; + } + + return `${opts.rubyHashLabel ? "" : ":"}${quoted}${joiner}`; +} + +// Prints out the value inside of a hash key-value pair according to the +// configured prettier options. +function printHashValue(value, opts) { + if (typeof value !== "string") { + return value.toString(); + } + + // This is a very special syntax created by the parser to let us know that + // this should be printed literally instead of as a string. + if (value.startsWith("&")) { + return value.slice(1); + } + + const quote = opts.rubySingleQuote && !value.includes("#{") ? "'" : '"'; + return `${quote}${value}${quote}`; +} + +// This will print an attributes object to a Doc node. It handles nesting on +// multiple levels and will print out according to whether or not the version of +// HAML being used supports multi-line attributes. +function printAttributes(object, opts, level = 0) { + if (typeof object !== "object") { + return printHashValue(object, opts); + } + + const boundary = level === 0 ? softline : line; + const parts = Object.keys(object).map((key) => + concat([ + printHashKey(key, opts), + " ", + printAttributes(object[key], opts, level + 1) + ]) + ); + + // If we have support for multi-line attributes laid out like a regular hash, + // then we print them that way here. + if (opts.supportsMultiline) { + return group( + concat([ + "{", + indent(group(concat([boundary, join(concat([",", line]), parts)]))), + boundary, + "}" + ]) + ); + } + + // Otherwise, if we only have one attribute, then just print it inline + // regardless of how long it is. + if (parts.length === 0) { + return group(concat(["{", parts[0], "}"])); + } + + // Otherwise, depending on how long the line is it will split the content into + // multi-line attributes that old Haml understands. + return group( + concat([ + "{", + parts[0], + ",", + align( + opts.headerLength + 1, + concat([line, join(concat([",", line]), parts.slice(1))]) + ), + "}" + ]) + ); +} + +// A utility function used in a silent script that is meant to determine if a +// child node is a continuation of a parent node (as in a when clause within a +// case statement or an else clause within an if). +function isContinuation(parentNode, childNode) { + if (childNode.type !== "silent_script") { + return false; + } + + const parent = parentNode.value.keyword; + const child = childNode.value.keyword; + + return ( + (parent === "case" && ["when", "else"].includes(child)) || + (["if", "unless"].includes(parent) && ["elsif", "else"].includes(child)) + ); +} + +// This is our printer's main print function that will switch on the type of +// node and print it out by returning a Doc tree. function printNode(path, opts, print) { - const { type } = path.getValue(); + const node = path.getValue(); + const { value } = node; + + switch (node.type) { + case "comment": + return printComment(); + case "doctype": + return printDoctype(); + case "filter": + return printFilter(); + case "haml_comment": + return printHamlComment(); + case "plain": + return printPlain(); + case "root": + return printRoot(); + case "script": + return printScript(); + case "silent_script": + return printSilentScript(); + case "tag": + return printTag(); + default: + throw new Error(`Unsupported node encountered: ${node.type}`); + } + + // It's common to a couple of nodes to attach nested child nodes on the + // children property. This utility prints them out grouped together with their + // parent node docs. + function printWithChildren(docs) { + if (node.children.length === 0) { + return docs; + } + + return group( + concat([ + docs, + indent(concat([hardline, join(hardline, path.map(print, "children"))])) + ]) + ); + } + + // https://haml.info/docs/yardoc/file.REFERENCE.html#html-comments- + function printComment() { + const parts = ["/"]; + + if (value.revealed) { + parts.push("!"); + } + + if (value.conditional) { + parts.push(value.conditional); + } else if (value.text) { + parts.push(" ", value.text); + } + + return printWithChildren(group(concat(parts))); + } + + // https://haml.info/docs/yardoc/file.REFERENCE.html#doctype- + function printDoctype() { + const parts = ["!!!"]; + + if (value.type in docTypes) { + parts.push(docTypes[value.type]); + } else if (docVersions.includes(value.version)) { + parts.push(value.version); + } else { + parts.push(value.type); + } + + if (value.encoding) { + parts.push(value.encoding); + } + + return group(join(" ", parts)); + } - /* istanbul ignore next */ - if (!(type in nodes)) { - throw new Error(`Unsupported node encountered: ${type}`); + // https://haml.info/docs/yardoc/file.REFERENCE.html#filters + function printFilter() { + return group( + concat([ + ":", + value.name, + indent( + concat([hardline, join(hardline, value.text.trim().split("\n"))]) + ) + ]) + ); } - return nodes[type](path, opts, print); + // https://haml.info/docs/yardoc/file.REFERENCE.html#haml-comments-- + function printHamlComment() { + const parts = ["-#"]; + + if (value.text) { + if (opts.originalText.split("\n")[node.line - 1].trim() === "-#") { + const lines = value.text.trim().split("\n"); + + parts.push(indent(concat([hardline, join(hardline, lines)]))); + } else { + parts.push(" ", value.text.trim()); + } + } + + return concat(parts); + } + + // https://haml.info/docs/yardoc/file.REFERENCE.html#plain-text + function printPlain() { + return value.text; + } + + // The root node in the AST that we build in the parser. + function printRoot() { + return concat([join(hardline, path.map(print, "children")), hardline]); + } + + // https://haml.info/docs/yardoc/file.REFERENCE.html#inserting_ruby + function printScript() { + const parts = []; + + if (value.escape_html) { + parts.unshift("&"); + } + + if (value.preserve) { + parts.push("~"); + } else if (!value.interpolate) { + parts.push("="); + } + + if (value.escape_html && !value.preserve && value.interpolate) { + parts.push(" ", value.text.trim().slice(1, -1)); + } else { + parts.push(" ", value.text.trim()); + } + + return printWithChildren(group(concat(parts))); + } + + // https://haml.info/docs/yardoc/file.REFERENCE.html#running-ruby-- + function printSilentScript() { + const parts = [`- ${value.text.trim()}`]; + + if (node.children.length > 0) { + parts.push( + concat( + path.map((childPath) => { + const child = childPath.getValue(); + const concated = concat([hardline, print(childPath)]); + + return isContinuation(node, child) ? concated : indent(concated); + }, "children") + ) + ); + } + + return group(concat(parts)); + } + + // https://haml.info/docs/yardoc/file.REFERENCE.html#element-name- + function printTag() { + const { attributes, dynamic_attributes } = value; + const parts = []; + + // If we have a tag that isn't a div, then we need to print out that name of + // that tag first. If it is a div, first we'll check if there are any other + // things that would force us to print out the div explicitly, and otherwise + // we'll leave it off. + if (value.name !== "div") { + parts.push(`%${value.name}`); + } + + // If we have a class attribute, then we're going to print that here using + // the special class syntax. + if (attributes.class) { + parts.push(`.${attributes.class.replace(/ /g, ".")}`); + } + + // If we have an id attribute, then we're going to print that here using the + // special id syntax. + if (attributes.id) { + parts.push(`#${attributes.id}`); + } + + // If we're using dynamic attributes on this tag, then they come in as a + // string that looks like the output of Hash#inspect from Ruby. So here + // we're going to split it all up and print it out nicely. + if (dynamic_attributes.new) { + const pairs = dynamic_attributes.new + .slice(1, -2) + .split(",") + .map((pair) => join("=", pair.slice(1).split('" => '))); + + parts.push( + group( + concat([ + "(", + align(parts.join("").length + 1, fill(join(line, pairs).parts)), + ")" + ]) + ) + ); + } + + // If there are any static attributes that are not class or id (because we + // already took care of those), then we're going to print them out here. + const staticAttributes = Object.keys(attributes).filter( + (name) => !["class", "id"].includes(name) + ); + + if (staticAttributes.length > 0) { + const docs = staticAttributes.reduce((accum, key) => { + const doc = `${printHashKey(key, opts)} ${printHashValue( + attributes[key], + opts + )}`; + + return accum.length === 0 ? [doc] : accum.concat(",", line, doc); + }, []); + + parts.push( + group(concat(["{", align(parts.join("").length + 1, fill(docs)), "}"])) + ); + } + + // If there are dynamic attributes that don't use the newer syntax, then + // we're going to print them out here. + if (dynamic_attributes.old) { + if (parts.length === 0) { + parts.push("%div"); + } + + if (typeof dynamic_attributes.old === "string") { + parts.push(dynamic_attributes.old); + } else { + const attrOptions = { + // This is kind of a total hack in that I don't think you're really + // supposed to directly use `path.stack`, but it's the easiest way to + // get the root node without having to know how many levels deep we + // are. + supportsMultiline: path.stack[0].supports_multiline, + headerLength: parts.join("").length + }; + + parts.push( + printAttributes( + dynamic_attributes.old, + Object.assign({}, opts, attrOptions) + ) + ); + } + } + + // https://haml.info/docs/yardoc/file.REFERENCE.html#object-reference- + if (value.object_ref) { + if (parts.length === 0) { + parts.push("%div"); + } + parts.push(value.object_ref); + } + + // https://haml.info/docs/yardoc/file.REFERENCE.html#whitespace-removal--and- + if (value.nuke_outer_whitespace) { + parts.push(">"); + } + + if (value.nuke_inner_whitespace) { + parts.push("<"); + } + + // https://haml.info/docs/yardoc/file.REFERENCE.html#empty-void-tags- + if (value.self_closing) { + parts.push("/"); + } + + if (value.value) { + const prefix = value.parse ? "= " : ifBreak("", " "); + + return printWithChildren( + group( + concat([ + group(concat(parts)), + indent(concat([softline, prefix, value.value])) + ]) + ) + ); + } + + // In case none of the other if statements have matched and we're printing + // a div, we need to explicitly add it back into the array. + if (parts.length === 0 && value.name === "div") { + parts.push("%div"); + } + + return printWithChildren(group(concat(parts))); + } } // This function handles adding the format pragma to a source string. This is an // optional workflow for incremental adoption. function insertPragma(text) { - const boundary = text.startsWith("-#") ? "\n" : "\n\n"; - - return `-# @format${boundary}${text}`; + return `-# @format${text.startsWith("-#") ? "\n" : "\n\n"}${text}`; } module.exports = { From fc4e3787403e5d7f40adb387cb9e8489bf636b7e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Apr 2021 05:03:48 +0000 Subject: [PATCH 149/785] Bump eslint from 7.23.0 to 7.24.0 Bumps [eslint](https://github.com/eslint/eslint) from 7.23.0 to 7.24.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v7.23.0...v7.24.0) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index c903f59c..c6ba3bb8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1305,9 +1305,9 @@ eslint-visitor-keys@^2.0.0: integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== eslint@^7.22.0: - version "7.23.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.23.0.tgz#8d029d252f6e8cf45894b4bee08f5493f8e94325" - integrity sha512-kqvNVbdkjzpFy0XOszNwjkKzZ+6TcwCQ/h+ozlcIWwaimBBuhlQ4nN6kbiM2L+OjDcznkTJxzYfRFH92sx4a0Q== + version "7.24.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.24.0.tgz#2e44fa62d93892bfdb100521f17345ba54b8513a" + integrity sha512-k9gaHeHiFmGCDQ2rEfvULlSLruz6tgfA8DEn+rY9/oYPFFTlz55mM/Q/Rij1b2Y42jwZiK3lXvNTw6w6TXzcKQ== dependencies: "@babel/code-frame" "7.12.11" "@eslint/eslintrc" "^0.4.0" From ac44230b80922344f33607ddfcf496777bb165dd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Apr 2021 05:02:46 +0000 Subject: [PATCH 150/785] Bump eslint-config-prettier from 8.1.0 to 8.2.0 Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.1.0 to 8.2.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.1.0...v8.2.0) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index c6ba3bb8..c06d1043 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1275,9 +1275,9 @@ escodegen@^1.14.1: source-map "~0.6.1" eslint-config-prettier@^8.0.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.1.0.tgz#4ef1eaf97afe5176e6a75ddfb57c335121abc5a6" - integrity sha512-oKMhGv3ihGbCIimCAjqkdzx2Q+jthoqnXSP+d86M9tptwugycmTFdVR4IpLgq2c4SHifbwO90z2fQ8/Aio73yw== + version "8.2.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.2.0.tgz#78de77d63bca8e9e59dae75a614b5299925bb7b3" + integrity sha512-dWV9EVeSo2qodOPi1iBYU/x6F6diHv8uujxbxr77xExs3zTAlNXvVZKiyLsQGNz7yPV2K49JY5WjPzNIuDc2Bw== eslint-scope@^5.1.1: version "5.1.1" From 89f776708ade75350e93470fc30bc3b2d513b49b Mon Sep 17 00:00:00 2001 From: Andy Waite Date: Sat, 17 Apr 2021 09:55:43 -0400 Subject: [PATCH 151/785] Add VSCode setup instructions --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 9b89b60e..294dedfd 100644 --- a/README.md +++ b/README.md @@ -178,6 +178,24 @@ inherit_from: - node_modules/@prettier/plugin-ruby/rubocop.yml ``` +## Editor Integration + +### VS Code + +- Add the npm `@prettier/plugin-ruby` package to your project as described above. +- Install the [Prettier - Code Formatter](https://github.com/prettier/prettier-vscode) extension. +- Configure in your `settings.json`: + ```json + { + "[ruby]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true // optional + } + } + ``` + +Refer to https://github.com/prettier/plugin-ruby/issues/113#issuecomment-783426539 if you're having difficulties. + ## Contributing Check out our [contributing guide](CONTRIBUTING.md). Bug reports and pull requests are welcome on GitHub at https://github.com/prettier/plugin-ruby. From 3760705a2c5f18666fca02f5964b0f72c1f8b337 Mon Sep 17 00:00:00 2001 From: Andy Waite Date: Mon, 19 Apr 2021 09:51:55 -0400 Subject: [PATCH 152/785] Update README.md Co-authored-by: Paul-Etienne Coisne --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 294dedfd..72e6cce7 100644 --- a/README.md +++ b/README.md @@ -194,7 +194,7 @@ inherit_from: } ``` -Refer to https://github.com/prettier/plugin-ruby/issues/113#issuecomment-783426539 if you're having difficulties. +Refer to [this issue](https://github.com/prettier/plugin-ruby/issues/113#issuecomment-783426539) if you're having difficulties. ## Contributing From b78937f8ae5e77acfd9e5692e9c3809f915bb3af Mon Sep 17 00:00:00 2001 From: Andy Waite Date: Mon, 19 Apr 2021 09:53:30 -0400 Subject: [PATCH 153/785] Remove comment --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 72e6cce7..4855258c 100644 --- a/README.md +++ b/README.md @@ -184,12 +184,12 @@ inherit_from: - Add the npm `@prettier/plugin-ruby` package to your project as described above. - Install the [Prettier - Code Formatter](https://github.com/prettier/prettier-vscode) extension. -- Configure in your `settings.json`: +- Configure in your `settings.json` (`formatOnSave` is optional): ```json { "[ruby]": { "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.formatOnSave": true // optional + "editor.formatOnSave": true } } ``` From 101af4cf4f7fa3729e20248947ee509bf792acab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Apr 2021 05:03:16 +0000 Subject: [PATCH 154/785] Bump eslint from 7.24.0 to 7.25.0 Bumps [eslint](https://github.com/eslint/eslint) from 7.24.0 to 7.25.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v7.24.0...v7.25.0) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index c06d1043..0769313b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1305,9 +1305,9 @@ eslint-visitor-keys@^2.0.0: integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== eslint@^7.22.0: - version "7.24.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.24.0.tgz#2e44fa62d93892bfdb100521f17345ba54b8513a" - integrity sha512-k9gaHeHiFmGCDQ2rEfvULlSLruz6tgfA8DEn+rY9/oYPFFTlz55mM/Q/Rij1b2Y42jwZiK3lXvNTw6w6TXzcKQ== + version "7.25.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.25.0.tgz#1309e4404d94e676e3e831b3a3ad2b050031eb67" + integrity sha512-TVpSovpvCNpLURIScDRB6g5CYu/ZFq9GfX2hLNIV4dSBKxIWojeDODvYl3t0k0VtMxYeR8OXPCFE5+oHMlGfhw== dependencies: "@babel/code-frame" "7.12.11" "@eslint/eslintrc" "^0.4.0" From f0ca3dd521a4e6d088ff5e03533bb1ac93f51453 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Apr 2021 05:03:33 +0000 Subject: [PATCH 155/785] Bump eslint-config-prettier from 8.2.0 to 8.3.0 Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.2.0 to 8.3.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.2.0...v8.3.0) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index c06d1043..4c40e35a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1275,9 +1275,9 @@ escodegen@^1.14.1: source-map "~0.6.1" eslint-config-prettier@^8.0.0: - version "8.2.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.2.0.tgz#78de77d63bca8e9e59dae75a614b5299925bb7b3" - integrity sha512-dWV9EVeSo2qodOPi1iBYU/x6F6diHv8uujxbxr77xExs3zTAlNXvVZKiyLsQGNz7yPV2K49JY5WjPzNIuDc2Bw== + version "8.3.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a" + integrity sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew== eslint-scope@^5.1.1: version "5.1.1" From 65e0582b4002a61d4d1b90b32af72efe03578cbb Mon Sep 17 00:00:00 2001 From: Nathan Beam Date: Tue, 4 May 2021 13:14:26 -0400 Subject: [PATCH 156/785] Made netcat error message dynamic, add telnet err --- src/parser/parseSync.js | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/src/parser/parseSync.js b/src/parser/parseSync.js index ce0bda7a..b44ea01d 100644 --- a/src/parser/parseSync.js +++ b/src/parser/parseSync.js @@ -109,6 +109,24 @@ function findNetcat(opts) { return { command: "node", args: [require.resolve("./netcat.js")] }; } +// Handles the error message in the case that the user's netcat-like +// adapter does not support unix sockets. +function handleNetcatError(command) { + let command_name = command; + if(command === "nc" || command === "ncat") { + command_name = "netcat"; + } + + throw new Error(` + @prettier/plugin-ruby uses ${command_name} to communicate over unix sockets between + the node.js process running prettier and an underlying Ruby process used + for parsing. Unfortunately the version of ${command_name} that you have installed + does not support unix sockets. To solve this either uninstall the version + of ${command_name} that you're using and use a different implementation, or change + the value of the rubyNetcatCommand option in your prettier configuration. + `); +} + // Formats and sends a request to the parser server. We use netcat (or something // like it) here since Prettier requires the results of `parse` to be // synchronous and Node.js does not offer a mechanism for synchronous socket @@ -134,17 +152,11 @@ function parseSync(parser, source, opts) { // We need special handling in case the user's version of nc doesn't support // using unix sockets. if ( - stderr.includes("invalid option -- U") || + stderr.includes("invalid option -- U") || + stderr.includes("invalid option -- 'u'") || stderr.includes("Protocol not supported") - ) { - throw new Error(` - @prettier/plugin-ruby uses netcat to communicate over unix sockets between - the node.js process running prettier and an underlying Ruby process used - for parsing. Unfortunately the version of netcat that you have installed - does not support unix sockets. To solve this either uninstall the version - of netcat that you're using and use a different implementation, or change - the value of the rubyNetcatCommand option in your prettier configuration. - `); + ) { + handleNetcatError(netcat.command); } // If we didn't receive anything over stdout or we have a bad exit status, From f43401df8457c29723a737caaee2e077d826c39f Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sat, 8 May 2021 10:31:09 -0400 Subject: [PATCH 157/785] Remove simpledelegator usage --- src/parser/parseSync.js | 4 +-- src/ruby/parser.rb | 75 ++++++++++++++++++++++++++--------------- 2 files changed, 49 insertions(+), 30 deletions(-) diff --git a/src/parser/parseSync.js b/src/parser/parseSync.js index b2510f9f..3942163d 100644 --- a/src/parser/parseSync.js +++ b/src/parser/parseSync.js @@ -137,8 +137,8 @@ function parseSync(parser, source, opts) { stderr.includes("invalid option -- U") || stderr.includes("invalid option -- 'u'") || stderr.includes("Protocol not supported") - ) { - throw new Error(` + ) { + throw new Error(` @prettier/plugin-ruby uses unix sockets to communicate between the node.js process running prettier and an underlying Ruby process used for parsing. Unfortunately the command that it tried to use to do that diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index fc566493..8baeca37 100755 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -13,8 +13,7 @@ exit 1 end -require 'delegate' -require 'json' +require 'json' unless defined?(JSON) require 'ripper' module Prettier @@ -54,6 +53,31 @@ def [](byteindex) end end + # This is a small wrapper around the value of a node for those specific events + # that need extra handling. (For example: statement, body statement, and + # rescue nodes which all need extra information to determine their character + # boundaries.) + class Node + attr_reader :parser, :value + + def initialize(parser, value) + @parser = parser + @value = value + end + + def [](key) + value[key] + end + + def dig(*keys) + value.dig(*keys) + end + + def to_json(*opts) + value.to_json(*opts) + end + end + attr_reader :source, :lines, :scanner_events # This is an attr_accessor so Stmts objects can grab comments out of this @@ -617,19 +641,19 @@ def on_blockarg(ident) # bodystmt can't actually determine its bounds appropriately because it # doesn't necessarily know where it started. So the parent node needs to # report back down into this one where it goes. - class BodyStmt < SimpleDelegator + class BodyStmt < Node def bind(sc, ec) - merge!(sc: sc, ec: ec) - parts = self[:body] + value.merge!(sc: sc, ec: ec) + parts = value[:body] # Here we're going to determine the bounds for the stmts consequent = parts[1..-1].compact.first - self[:body][0].bind(sc, consequent ? consequent[:sc] : ec) + value[:body][0].bind(sc, consequent ? consequent[:sc] : ec) # Next we're going to determine the rescue clause if there is one if parts[1] consequent = parts[2..-1].compact.first - self[:body][1].bind_end(consequent ? consequent[:sc] : ec) + value[:body][1].bind_end(consequent ? consequent[:sc] : ec) end end end @@ -638,6 +662,7 @@ def bind(sc, ec) # of clauses within the body of a method or block. def on_bodystmt(stmts, rescued, ensured, elsed) BodyStmt.new( + self, type: :bodystmt, body: [stmts, rescued, ensured, elsed], sl: lineno, @@ -1845,12 +1870,12 @@ def on_regexp_literal(regexp, ending) # doesn't really have all of the information that it needs in order to # determine its ending. Therefore it relies on its parent bodystmt node to # report its ending to it. - class Rescue < SimpleDelegator + class Rescue < Node def bind_end(ec) - merge!(ec: ec) + value.merge!(ec: ec) - stmts = self[:body][1] - consequent = self[:body][2] + stmts = value[:body][1] + consequent = value[:body][2] if consequent consequent.bind_end(ec) @@ -1886,6 +1911,7 @@ def on_rescue(exceptions, variable, stmts, consequent) end Rescue.new( + self, beging.merge!( type: :rescue, body: [rescue_ex, stmts, consequent], @@ -1986,36 +2012,29 @@ def on_sclass(target, bodystmt) # stmts nodes will report back down the location information. We then # propagate that onto void_stmt nodes inside the stmts in order to make sure # all comments get printed appropriately. - class Stmts < SimpleDelegator - attr_reader :parser - - def initialize(parser, values) - @parser = parser - __setobj__(values) - end - + class Stmts < Node def bind(sc, ec) - merge!(sc: sc, ec: ec) + value.merge!(sc: sc, ec: ec) - if self[:body][0][:type] == :void_stmt - self[:body][0].merge!(sc: sc, ec: sc) + if value[:body][0][:type] == :void_stmt + value[:body][0].merge!(sc: sc, ec: sc) end attach_comments(sc, ec) end def bind_end(ec) - merge!(ec: ec) + value.merge!(ec: ec) end def <<(statement) - if self[:body].any? - merge!(statement.slice(:el, :ec)) + if value[:body].any? + value.merge!(statement.slice(:el, :ec)) else - merge!(statement.slice(:sl, :el, :sc, :ec)) + value.merge!(statement.slice(:sl, :el, :sc, :ec)) end - self[:body] << statement + value[:body] << statement self end @@ -2032,7 +2051,7 @@ def attach_comments(sc, ec) return if attachable.empty? parser.comments -= attachable - self[:body] = (self[:body] + attachable).sort_by! { |node| node[:sc] } + value[:body] = (value[:body] + attachable).sort_by! { |node| node[:sc] } end end From 09f8d43e5031cc0389289cee63b11b30935c9054 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 May 2021 00:39:13 +0000 Subject: [PATCH 158/785] Bump hosted-git-info from 2.8.8 to 2.8.9 Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9. - [Release notes](https://github.com/npm/hosted-git-info/releases) - [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md) - [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4f957166..950149ad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1761,9 +1761,9 @@ has@^1.0.3: function-bind "^1.1.1" hosted-git-info@^2.1.4: - version "2.8.8" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.8.tgz#7539bd4bc1e0e0a895815a2e0262420b12858488" - integrity sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg== + version "2.8.9" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" + integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== html-encoding-sniffer@^2.0.1: version "2.0.1" From 8b487922a367fe2b4007fdcbf7bb4b2864fef53e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 May 2021 05:05:57 +0000 Subject: [PATCH 159/785] Bump eslint from 7.25.0 to 7.26.0 Bumps [eslint](https://github.com/eslint/eslint) from 7.25.0 to 7.26.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v7.25.0...v7.26.0) Signed-off-by: dependabot[bot] --- yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index 950149ad..0a42aaac 100644 --- a/yarn.lock +++ b/yarn.lock @@ -278,10 +278,10 @@ exec-sh "^0.3.2" minimist "^1.2.0" -"@eslint/eslintrc@^0.4.0": - version "0.4.0" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.0.tgz#99cc0a0584d72f1df38b900fb062ba995f395547" - integrity sha512-2ZPCc+uNbjV5ERJr+aKSPRwZgKd2z11x0EgLvb1PURmUrn9QNRXFqje0Ldq454PfAVyaJYyrDvvIKSFP4NnBog== +"@eslint/eslintrc@^0.4.1": + version "0.4.1" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.1.tgz#442763b88cecbe3ee0ec7ca6d6dd6168550cbf14" + integrity sha512-5v7TDE9plVhvxQeWLXDTvFvJBdH6pEsdnl2g/dAptmuFEPedQ4Erq5rsDsX+mvAM610IhNaO2W5V1dOOnDKxkQ== dependencies: ajv "^6.12.4" debug "^4.1.1" @@ -1305,12 +1305,12 @@ eslint-visitor-keys@^2.0.0: integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== eslint@^7.22.0: - version "7.25.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.25.0.tgz#1309e4404d94e676e3e831b3a3ad2b050031eb67" - integrity sha512-TVpSovpvCNpLURIScDRB6g5CYu/ZFq9GfX2hLNIV4dSBKxIWojeDODvYl3t0k0VtMxYeR8OXPCFE5+oHMlGfhw== + version "7.26.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.26.0.tgz#d416fdcdcb3236cd8f282065312813f8c13982f6" + integrity sha512-4R1ieRf52/izcZE7AlLy56uIHHDLT74Yzz2Iv2l6kDaYvEu9x+wMB5dZArVL8SYGXSYV2YAg70FcW5Y5nGGNIg== dependencies: "@babel/code-frame" "7.12.11" - "@eslint/eslintrc" "^0.4.0" + "@eslint/eslintrc" "^0.4.1" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" From 523bf4f10e6864e0c228188f6f0ffd30cda15bad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 May 2021 05:06:28 +0000 Subject: [PATCH 160/785] Bump prettier from 2.2.1 to 2.3.0 Bumps [prettier](https://github.com/prettier/prettier) from 2.2.1 to 2.3.0. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.2.1...2.3.0) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 950149ad..56c9c484 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3027,9 +3027,9 @@ prelude-ls@~1.1.2: integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= prettier@>=1.10: - version "2.2.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5" - integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q== + version "2.3.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18" + integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w== pretty-format@^26.6.2: version "26.6.2" From 0d720eaec469f8d02cde775158597f60366ca0a4 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Mon, 10 May 2021 08:24:22 -0400 Subject: [PATCH 161/785] pretty print support for custom nodes --- src/ruby/parser.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 8baeca37..ee57c4b8 100755 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -76,6 +76,10 @@ def dig(*keys) def to_json(*opts) value.to_json(*opts) end + + def pretty_print(q) + q.pp_hash(self) + end end attr_reader :source, :lines, :scanner_events From 4728a80624edfbaa4fdb4e5c14d64fb33d320189 Mon Sep 17 00:00:00 2001 From: Vesa Laakso <482561+valscion@users.noreply.github.com> Date: Tue, 11 May 2021 13:24:07 +0300 Subject: [PATCH 162/785] Revert "Bump prettier from 2.2.1 to 2.3.0" --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 086275f0..0a42aaac 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3027,9 +3027,9 @@ prelude-ls@~1.1.2: integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= prettier@>=1.10: - version "2.3.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18" - integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w== + version "2.2.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5" + integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q== pretty-format@^26.6.2: version "26.6.2" From 6d549b3a738168ea7d5f79e4770a3486db3591a1 Mon Sep 17 00:00:00 2001 From: Vesa Laakso <482561+valscion@users.noreply.github.com> Date: Tue, 11 May 2021 16:18:22 +0300 Subject: [PATCH 163/785] Remove automatic merging of dependabot pull requests for now This workflow is broken as it runs the CI steps in the commit that is in the base branch, not in the commit of the pull request itself. --- .github/workflows/main.yml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 29cd0cb3..fefeae15 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -68,20 +68,3 @@ jobs: - run: | yarn check-format yarn lint - - automerge: - name: Auto Merge - needs: - - ci - - lint - runs-on: ubuntu-latest - if: github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]' - steps: - - uses: actions/github-script@v3 - with: - script: | - github.pulls.merge({ - owner: context.payload.repository.owner.login, - repo: context.payload.repository.name, - pull_number: context.payload.pull_request.number - }) From 5c24f1b519cdf3101eca112eb34871b68771ca99 Mon Sep 17 00:00:00 2001 From: Vesa Laakso <482561+valscion@users.noreply.github.com> Date: Tue, 11 May 2021 16:19:04 +0300 Subject: [PATCH 164/785] Replace insecure pull_request_target CI with pull_request The pull_request action does not have access to the repository secrets and doesn't have write access to the repository. See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fefeae15..215fc8bd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,7 +1,7 @@ name: Main on: - push - - pull_request_target + - pull_request jobs: ci: name: CI From 5c78a14c2f4a1e9e5c3e9cda0f429d06a6b1b0dd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 May 2021 05:04:39 +0000 Subject: [PATCH 165/785] Bump prettier from 2.2.1 to 2.3.0 Bumps [prettier](https://github.com/prettier/prettier) from 2.2.1 to 2.3.0. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.2.1...2.3.0) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 0a42aaac..086275f0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3027,9 +3027,9 @@ prelude-ls@~1.1.2: integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= prettier@>=1.10: - version "2.2.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5" - integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q== + version "2.3.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18" + integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w== pretty-format@^26.6.2: version "26.6.2" From 3d34261eba7180b53b9b880ea82def07be4d5c18 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sun, 16 May 2021 10:09:10 -0400 Subject: [PATCH 166/785] Don't reflect on printed docs for hash assocs --- src/ruby/nodes/hashes.js | 19 +++++-------------- src/ruby/nodes/strings.js | 9 ++++++++- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/ruby/nodes/hashes.js b/src/ruby/nodes/hashes.js index 314d9541..ec26ff6d 100644 --- a/src/ruby/nodes/hashes.js +++ b/src/ruby/nodes/hashes.js @@ -56,28 +56,19 @@ function printHashKeyLabel(path, print) { case "symbol_literal": return concat([path.call(print, "body", 0), ":"]); case "dyna_symbol": { - const { parts } = print(path); - - // We're going to slice off the starting colon character so that we can - // move it to the end. If there are comments, then we're going to go - // further into the printed doc nodes. - if (parts[0] === ":") { - parts.splice(0, 1); - } else { - parts[1].parts.splice(0, 1); - } - - return concat(parts.concat(":")); + return concat([print(path), ":"]); } } } function printHashKeyRocket(path, print) { const node = path.getValue(); - const doc = print(path); + let doc = print(path); if (node.type === "@label") { - return `:${doc.slice(0, doc.length - 1)} =>`; + doc = concat([":", doc.slice(0, doc.length - 1)]); + } else if (node.type === "dyna_symbol") { + doc = concat([":", doc]); } return concat([doc, " =>"]); diff --git a/src/ruby/nodes/strings.js b/src/ruby/nodes/strings.js index 5080eb9e..529e0f22 100644 --- a/src/ruby/nodes/strings.js +++ b/src/ruby/nodes/strings.js @@ -87,8 +87,15 @@ function printChar(path, { rubySingleQuote }, _print) { // use whatever quote was provided. function printDynaSymbol(path, opts, print) { const { quote } = path.getValue(); + const parts = [quote].concat(path.map(print, "body")).concat(quote); - return concat([":", quote].concat(path.map(print, "body")).concat(quote)); + // If we're inside of an assoc_new node, then it will handle printing the : + // on its own since it could change sides. + if (path.getParentNode().type !== "assoc_new") { + parts.unshift(":"); + } + + return concat(parts); } function printStringConcat(path, opts, print) { From 069c9399f5732e68800ff302feff814e038a1529 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sun, 16 May 2021 10:33:19 -0400 Subject: [PATCH 167/785] Handle reflecting on printed docs for prettier >= 2.3.0 --- src/ruby/nodes/args.js | 77 ++++++++++++++++++++++++++++++------------ 1 file changed, 55 insertions(+), 22 deletions(-) diff --git a/src/ruby/nodes/args.js b/src/ruby/nodes/args.js index 0f92e773..e1a21b4c 100644 --- a/src/ruby/nodes/args.js +++ b/src/ruby/nodes/args.js @@ -108,12 +108,18 @@ function printArgs(path, { rubyToProc }, print) { function printArgsAddBlock(path, opts, print) { const node = path.getValue(); + const blockNode = node.body[1]; + const parts = path.call(print, "body", 0); - if (node.body[1]) { + if (blockNode) { let blockDoc = path.call(print, "body", 1); - if (node.body[1].comments) { + if (!(blockNode.comments || []).some(({ leading }) => leading)) { + // If we don't have any leading comments, we can just prepend the + // operator. + blockDoc = concat(["&", blockDoc]); + } else if (Array.isArray(blockDoc[0])) { // If we have a method call like: // // foo( @@ -123,10 +129,20 @@ function printArgsAddBlock(path, opts, print) { // // then we need to make sure we don't accidentally prepend the operator // before the comment. - blockDoc.parts[2] = concat(["&", blockDoc.parts[2]]); + // + // In prettier >= 2.3.0, the comments are printed as an array before the + // content. I don't love this kind of reflection, but it's the simplest + // way at the moment to get this right. + blockDoc = blockDoc[0].concat( + concat(["&", blockDoc[1]]), + blockDoc.slice(2) + ); } else { - // If we don't have any comments, we can just prepend the operator - blockDoc = concat(["&", blockDoc]); + // In prettier < 2.3.0, the comments are printed as part of a concat, so + // we can reflect on how many leading comments there are to determine + // which doc node we should modify. + const index = blockNode.comments.filter(({ leading }) => leading).length; + blockDoc.parts[index] = concat(["&", blockDoc.parts[index]]); } parts.push(blockDoc); @@ -136,10 +152,23 @@ function printArgsAddBlock(path, opts, print) { } function printArgsAddStar(path, opts, print) { - const node = path.getValue(); - const docs = path.map(print, "body"); + let docs = []; + + path.each((argPath, argIndex) => { + const doc = print(argPath); + + if (argIndex !== 1) { + docs = docs.concat(doc); + return; + } + + // If we don't have any leading comments, we can just prepend the operator. + const argsNode = argPath.getValue(); + if (!(argsNode.comments || []).some(({ leading }) => leading)) { + docs.push(concat(["*", doc])); + return; + } - if (node.body[1].comments) { // If we have an array like: // // [ @@ -147,22 +176,26 @@ function printArgsAddStar(path, opts, print) { // *values // ] // - // or if we have an array like: - // - // [ - // *values # comment - // ] - // // then we need to make sure we don't accidentally prepend the operator - // before the comment. - const index = node.body[1].comments.filter(({ leading }) => leading).length; - docs[1].parts[index] = concat(["*", docs[1].parts[index]]); - } else { - // If we don't have any comments, we can just prepend the operator - docs[1] = concat(["*", docs[1]]); - } + // before the comment(s). + // + // In prettier >= 2.3.0, the comments are printed as an array before the + // content. I don't love this kind of reflection, but it's the simplest way + // at the moment to get this right. + if (Array.isArray(doc[0])) { + docs.push(doc[0].concat(concat(["*", doc[1]]), doc.slice(2))); + return; + } + + // In prettier < 2.3.0, the comments are printed as part of a concat, so + // we can reflect on how many leading comments there are to determine which + // doc node we should modify. + const index = argsNode.comments.filter(({ leading }) => leading).length; + doc.parts[index] = concat(["*", doc.parts[index]]); + docs = docs.concat(doc); + }, "body"); - return docs[0].concat(docs[1]).concat(docs.slice(2)); + return docs; } function printBlockArg(path, opts, print) { From b121fdb5645c0d0ad33e80328465ce7081960cf9 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sun, 16 May 2021 10:40:15 -0400 Subject: [PATCH 168/785] Fix up printing according to prettier 2.3.0 --- src/ruby/nodes/conditionals.js | 92 +++++++++++++++++----------------- src/ruby/nodes/params.js | 11 +--- src/ruby/nodes/strings.js | 11 ++-- 3 files changed, 55 insertions(+), 59 deletions(-) diff --git a/src/ruby/nodes/conditionals.js b/src/ruby/nodes/conditionals.js index fc65e4e1..9661fdb8 100644 --- a/src/ruby/nodes/conditionals.js +++ b/src/ruby/nodes/conditionals.js @@ -190,57 +190,59 @@ const canTernary = (path) => { }; // A normalized print function for both `if` and `unless` nodes. -const printConditional = (keyword) => (path, { rubyModifier }, print) => { - if (canTernary(path)) { - let ternaryParts = [path.call(print, "body", 0), " ? "].concat( - printTernaryClauses( - keyword, - path.call(print, "body", 1), - path.call(print, "body", 2, "body", 0) - ) - ); - - if (["binary", "call"].includes(path.getParentNode().type)) { - ternaryParts = ["("].concat(ternaryParts).concat(")"); +const printConditional = + (keyword) => + (path, { rubyModifier }, print) => { + if (canTernary(path)) { + let ternaryParts = [path.call(print, "body", 0), " ? "].concat( + printTernaryClauses( + keyword, + path.call(print, "body", 1), + path.call(print, "body", 2, "body", 0) + ) + ); + + if (["binary", "call"].includes(path.getParentNode().type)) { + ternaryParts = ["("].concat(ternaryParts).concat(")"); + } + + return group( + ifBreak(printWithAddition(keyword, path, print), concat(ternaryParts)) + ); } - return group( - ifBreak(printWithAddition(keyword, path, print), concat(ternaryParts)) - ); - } - - const [predicate, statements, addition] = path.getValue().body; + const [predicate, statements, addition] = path.getValue().body; - // If there's an additional clause that wasn't matched earlier, we know we - // can't go for the inline option. - if (addition) { - return group(printWithAddition(keyword, path, print, { breaking: true })); - } + // If there's an additional clause that wasn't matched earlier, we know we + // can't go for the inline option. + if (addition) { + return group(printWithAddition(keyword, path, print, { breaking: true })); + } - // If the body of the conditional is empty, then we explicitly have to use the - // block form. - if (isEmptyStmts(statements)) { - return concat([ - `${keyword} `, - align(keyword.length + 1, path.call(print, "body", 0)), - concat([hardline, "end"]) - ]); - } + // If the body of the conditional is empty, then we explicitly have to use the + // block form. + if (isEmptyStmts(statements)) { + return concat([ + `${keyword} `, + align(keyword.length + 1, path.call(print, "body", 0)), + concat([hardline, "end"]) + ]); + } - // If the predicate of the conditional contains an assignment, then we can't - // know for sure that it doesn't impact the body of the conditional, so we - // have to default to the block form. - if (containsAssignment(predicate)) { - return concat([ - `${keyword} `, - align(keyword.length + 1, path.call(print, "body", 0)), - indent(concat([hardline, path.call(print, "body", 1)])), - concat([hardline, "end"]) - ]); - } + // If the predicate of the conditional contains an assignment, then we can't + // know for sure that it doesn't impact the body of the conditional, so we + // have to default to the block form. + if (containsAssignment(predicate)) { + return concat([ + `${keyword} `, + align(keyword.length + 1, path.call(print, "body", 0)), + indent(concat([hardline, path.call(print, "body", 1)])), + concat([hardline, "end"]) + ]); + } - return printSingle(keyword)(path, { rubyModifier }, print); -}; + return printSingle(keyword)(path, { rubyModifier }, print); + }; module.exports = { else: (path, opts, print) => { diff --git a/src/ruby/nodes/params.js b/src/ruby/nodes/params.js index 9c574c39..d840a65a 100644 --- a/src/ruby/nodes/params.js +++ b/src/ruby/nodes/params.js @@ -17,15 +17,8 @@ function printRestParam(symbol) { } function printParams(path, opts, print) { - const [ - reqs, - optls, - rest, - post, - kwargs, - kwargRest, - block - ] = path.getValue().body; + const [reqs, optls, rest, post, kwargs, kwargRest, block] = + path.getValue().body; let parts = []; if (reqs) { diff --git a/src/ruby/nodes/strings.js b/src/ruby/nodes/strings.js index 529e0f22..2a1d1cbb 100644 --- a/src/ruby/nodes/strings.js +++ b/src/ruby/nodes/strings.js @@ -86,12 +86,13 @@ function printChar(path, { rubySingleQuote }, _print) { // node that will tell us which quote to use when printing. We're just going to // use whatever quote was provided. function printDynaSymbol(path, opts, print) { - const { quote } = path.getValue(); - const parts = [quote].concat(path.map(print, "body")).concat(quote); + const node = path.getValue(); + const parts = [node.quote].concat(path.map(print, "body")).concat(node.quote); - // If we're inside of an assoc_new node, then it will handle printing the : - // on its own since it could change sides. - if (path.getParentNode().type !== "assoc_new") { + // If we're inside of an assoc_new node as the key, then it will handle + // printing the : on its own since it could change sides. + const parentNode = path.getParentNode(); + if (parentNode.type !== "assoc_new" || parentNode.body[0] !== node) { parts.unshift(":"); } From 4d6411c39544fd632b45bf17d72929758a301452 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sun, 16 May 2021 10:44:03 -0400 Subject: [PATCH 169/785] yarn upgrade --- yarn.lock | 844 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 468 insertions(+), 376 deletions(-) diff --git a/yarn.lock b/yarn.lock index 086275f0..28e5c2b1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,151 +2,177 @@ # yarn lockfile v1 -"@babel/code-frame@7.12.11", "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4": +"@babel/code-frame@7.12.11": version "7.12.11" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== dependencies: "@babel/highlight" "^7.10.4" +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658" + integrity sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g== + dependencies: + "@babel/highlight" "^7.12.13" + +"@babel/compat-data@^7.13.15": + version "7.14.0" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.14.0.tgz#a901128bce2ad02565df95e6ecbf195cf9465919" + integrity sha512-vu9V3uMM/1o5Hl5OekMUowo3FqXLJSw+s+66nt0fSWVWTtmosdzn45JHOB3cPtZoe6CTBDzvSw0RdOY85Q37+Q== + "@babel/core@^7.1.0", "@babel/core@^7.7.5": - version "7.12.10" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.12.10.tgz#b79a2e1b9f70ed3d84bbfb6d8c4ef825f606bccd" - integrity sha512-eTAlQKq65zHfkHZV0sIVODCPGVgoo1HdBlbSLi9CqOzuZanMv2ihzY+4paiKr1mH+XmYESMAmJ/dpZ68eN6d8w== - dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/generator" "^7.12.10" - "@babel/helper-module-transforms" "^7.12.1" - "@babel/helpers" "^7.12.5" - "@babel/parser" "^7.12.10" - "@babel/template" "^7.12.7" - "@babel/traverse" "^7.12.10" - "@babel/types" "^7.12.10" + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.14.2.tgz#54e45334ffc0172048e5c93ded36461d3ad4c417" + integrity sha512-OgC1mON+l4U4B4wiohJlQNUU3H73mpTyYY3j/c8U9dr9UagGGSm+WFpzjy/YLdoyjiG++c1kIDgxCo/mLwQJeQ== + dependencies: + "@babel/code-frame" "^7.12.13" + "@babel/generator" "^7.14.2" + "@babel/helper-compilation-targets" "^7.13.16" + "@babel/helper-module-transforms" "^7.14.2" + "@babel/helpers" "^7.14.0" + "@babel/parser" "^7.14.2" + "@babel/template" "^7.12.13" + "@babel/traverse" "^7.14.2" + "@babel/types" "^7.14.2" convert-source-map "^1.7.0" debug "^4.1.0" - gensync "^1.0.0-beta.1" + gensync "^1.0.0-beta.2" json5 "^2.1.2" - lodash "^4.17.19" - semver "^5.4.1" + semver "^6.3.0" source-map "^0.5.0" -"@babel/generator@^7.12.10": - version "7.12.10" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.12.10.tgz#2b188fc329fb8e4f762181703beffc0fe6df3460" - integrity sha512-6mCdfhWgmqLdtTkhXjnIz0LcdVCd26wS2JXRtj2XY0u5klDsXBREA/pG5NVOuVnF2LUrBGNFtQkIqqTbblg0ww== +"@babel/generator@^7.14.2": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.14.2.tgz#d5773e8b557d421fd6ce0d5efa5fd7fc22567c30" + integrity sha512-OnADYbKrffDVai5qcpkMxQ7caomHOoEwjkouqnN2QhydAjowFAZcsdecFIRUBdb+ZcruwYE4ythYmF1UBZU5xQ== dependencies: - "@babel/types" "^7.12.10" + "@babel/types" "^7.14.2" jsesc "^2.5.1" source-map "^0.5.0" -"@babel/helper-function-name@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz#d2d3b20c59ad8c47112fa7d2a94bc09d5ef82f1a" - integrity sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ== - dependencies: - "@babel/helper-get-function-arity" "^7.10.4" - "@babel/template" "^7.10.4" - "@babel/types" "^7.10.4" - -"@babel/helper-get-function-arity@^7.10.4": - version "7.12.10" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.10.tgz#b158817a3165b5faa2047825dfa61970ddcc16cf" - integrity sha512-mm0n5BPjR06wh9mPQaDdXWDoll/j5UpCAPl1x8fS71GHm7HA6Ua2V4ylG1Ju8lvcTOietbPNNPaSilKj+pj+Ag== - dependencies: - "@babel/types" "^7.12.10" - -"@babel/helper-member-expression-to-functions@^7.12.1": - version "7.12.7" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.7.tgz#aa77bd0396ec8114e5e30787efa78599d874a855" - integrity sha512-DCsuPyeWxeHgh1Dus7APn7iza42i/qXqiFPWyBDdOFtvS581JQePsc1F/nD+fHrcswhLlRc2UpYS1NwERxZhHw== - dependencies: - "@babel/types" "^7.12.7" - -"@babel/helper-module-imports@^7.12.1": - version "7.12.5" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz#1bfc0229f794988f76ed0a4d4e90860850b54dfb" - integrity sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA== - dependencies: - "@babel/types" "^7.12.5" - -"@babel/helper-module-transforms@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.12.1.tgz#7954fec71f5b32c48e4b303b437c34453fd7247c" - integrity sha512-QQzehgFAZ2bbISiCpmVGfiGux8YVFXQ0abBic2Envhej22DVXV9nCFaS5hIQbkyo1AdGb+gNME2TSh3hYJVV/w== - dependencies: - "@babel/helper-module-imports" "^7.12.1" - "@babel/helper-replace-supers" "^7.12.1" - "@babel/helper-simple-access" "^7.12.1" - "@babel/helper-split-export-declaration" "^7.11.0" - "@babel/helper-validator-identifier" "^7.10.4" - "@babel/template" "^7.10.4" - "@babel/traverse" "^7.12.1" - "@babel/types" "^7.12.1" - lodash "^4.17.19" - -"@babel/helper-optimise-call-expression@^7.10.4": - version "7.12.10" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.10.tgz#94ca4e306ee11a7dd6e9f42823e2ac6b49881e2d" - integrity sha512-4tpbU0SrSTjjt65UMWSrUOPZTsgvPgGG4S8QSTNHacKzpS51IVWGDj0yCwyeZND/i+LSN2g/O63jEXEWm49sYQ== - dependencies: - "@babel/types" "^7.12.10" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.8.0": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz#2f75a831269d4f677de49986dff59927533cf375" - integrity sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg== - -"@babel/helper-replace-supers@^7.12.1": - version "7.12.5" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.12.5.tgz#f009a17543bbbbce16b06206ae73b63d3fca68d9" - integrity sha512-5YILoed0ZyIpF4gKcpZitEnXEJ9UoDRki1Ey6xz46rxOzfNMAhVIJMoune1hmPVxh40LRv1+oafz7UsWX+vyWA== - dependencies: - "@babel/helper-member-expression-to-functions" "^7.12.1" - "@babel/helper-optimise-call-expression" "^7.10.4" - "@babel/traverse" "^7.12.5" - "@babel/types" "^7.12.5" - -"@babel/helper-simple-access@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.12.1.tgz#32427e5aa61547d38eb1e6eaf5fd1426fdad9136" - integrity sha512-OxBp7pMrjVewSSC8fXDFrHrBcJATOOFssZwv16F3/6Xtc138GHybBfPbm9kfiqQHKhYQrlamWILwlDCeyMFEaA== - dependencies: - "@babel/types" "^7.12.1" - -"@babel/helper-split-export-declaration@^7.11.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz#f8a491244acf6a676158ac42072911ba83ad099f" - integrity sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg== - dependencies: - "@babel/types" "^7.11.0" - -"@babel/helper-validator-identifier@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz#a78c7a7251e01f616512d31b10adcf52ada5e0d2" - integrity sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw== - -"@babel/helpers@^7.12.5": - version "7.12.5" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.12.5.tgz#1a1ba4a768d9b58310eda516c449913fe647116e" - integrity sha512-lgKGMQlKqA8meJqKsW6rUnc4MdUk35Ln0ATDqdM1a/UpARODdI4j5Y5lVfUScnSNkJcdCRAaWkspykNoFg9sJA== +"@babel/helper-compilation-targets@^7.13.16": + version "7.13.16" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.16.tgz#6e91dccf15e3f43e5556dffe32d860109887563c" + integrity sha512-3gmkYIrpqsLlieFwjkGgLaSHmhnvlAYzZLlYVjlW+QwI+1zE17kGxuJGmIqDQdYp56XdmGeD+Bswx0UTyG18xA== dependencies: - "@babel/template" "^7.10.4" - "@babel/traverse" "^7.12.5" - "@babel/types" "^7.12.5" + "@babel/compat-data" "^7.13.15" + "@babel/helper-validator-option" "^7.12.17" + browserslist "^4.14.5" + semver "^6.3.0" -"@babel/highlight@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.10.4.tgz#7d1bdfd65753538fabe6c38596cdb76d9ac60143" - integrity sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA== - dependencies: - "@babel/helper-validator-identifier" "^7.10.4" +"@babel/helper-function-name@^7.14.2": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.14.2.tgz#397688b590760b6ef7725b5f0860c82427ebaac2" + integrity sha512-NYZlkZRydxw+YT56IlhIcS8PAhb+FEUiOzuhFTfqDyPmzAhRge6ua0dQYT/Uh0t/EDHq05/i+e5M2d4XvjgarQ== + dependencies: + "@babel/helper-get-function-arity" "^7.12.13" + "@babel/template" "^7.12.13" + "@babel/types" "^7.14.2" + +"@babel/helper-get-function-arity@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz#bc63451d403a3b3082b97e1d8b3fe5bd4091e583" + integrity sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg== + dependencies: + "@babel/types" "^7.12.13" + +"@babel/helper-member-expression-to-functions@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz#dfe368f26d426a07299d8d6513821768216e6d72" + integrity sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw== + dependencies: + "@babel/types" "^7.13.12" + +"@babel/helper-module-imports@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz#c6a369a6f3621cb25da014078684da9196b61977" + integrity sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA== + dependencies: + "@babel/types" "^7.13.12" + +"@babel/helper-module-transforms@^7.14.2": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.14.2.tgz#ac1cc30ee47b945e3e0c4db12fa0c5389509dfe5" + integrity sha512-OznJUda/soKXv0XhpvzGWDnml4Qnwp16GN+D/kZIdLsWoHj05kyu8Rm5kXmMef+rVJZ0+4pSGLkeixdqNUATDA== + dependencies: + "@babel/helper-module-imports" "^7.13.12" + "@babel/helper-replace-supers" "^7.13.12" + "@babel/helper-simple-access" "^7.13.12" + "@babel/helper-split-export-declaration" "^7.12.13" + "@babel/helper-validator-identifier" "^7.14.0" + "@babel/template" "^7.12.13" + "@babel/traverse" "^7.14.2" + "@babel/types" "^7.14.2" + +"@babel/helper-optimise-call-expression@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz#5c02d171b4c8615b1e7163f888c1c81c30a2aaea" + integrity sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA== + dependencies: + "@babel/types" "^7.12.13" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.8.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz#806526ce125aed03373bc416a828321e3a6a33af" + integrity sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ== + +"@babel/helper-replace-supers@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz#6442f4c1ad912502481a564a7386de0c77ff3804" + integrity sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.13.12" + "@babel/helper-optimise-call-expression" "^7.12.13" + "@babel/traverse" "^7.13.0" + "@babel/types" "^7.13.12" + +"@babel/helper-simple-access@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz#dd6c538afb61819d205a012c31792a39c7a5eaf6" + integrity sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA== + dependencies: + "@babel/types" "^7.13.12" + +"@babel/helper-split-export-declaration@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz#e9430be00baf3e88b0e13e6f9d4eaf2136372b05" + integrity sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg== + dependencies: + "@babel/types" "^7.12.13" + +"@babel/helper-validator-identifier@^7.14.0": + version "7.14.0" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz#d26cad8a47c65286b15df1547319a5d0bcf27288" + integrity sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A== + +"@babel/helper-validator-option@^7.12.17": + version "7.12.17" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.12.17.tgz#d1fbf012e1a79b7eebbfdc6d270baaf8d9eb9831" + integrity sha512-TopkMDmLzq8ngChwRlyjR6raKD6gMSae4JdYDB8bByKreQgG0RBTuKe9LRxW3wFtUnjxOPRKBDwEH6Mg5KeDfw== + +"@babel/helpers@^7.14.0": + version "7.14.0" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.14.0.tgz#ea9b6be9478a13d6f961dbb5f36bf75e2f3b8f62" + integrity sha512-+ufuXprtQ1D1iZTO/K9+EBRn+qPWMJjZSw/S0KlFrxCw4tkrzv9grgpDHkY9MeQTjTY8i2sp7Jep8DfU6tN9Mg== + dependencies: + "@babel/template" "^7.12.13" + "@babel/traverse" "^7.14.0" + "@babel/types" "^7.14.0" + +"@babel/highlight@^7.10.4", "@babel/highlight@^7.12.13": + version "7.14.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.0.tgz#3197e375711ef6bf834e67d0daec88e4f46113cf" + integrity sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg== + dependencies: + "@babel/helper-validator-identifier" "^7.14.0" chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.12.10", "@babel/parser@^7.12.7": - version "7.12.10" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.10.tgz#824600d59e96aea26a5a2af5a9d812af05c3ae81" - integrity sha512-PJdRPwyoOqFAWfLytxrWwGrAxghCgh/yTNCYciOz8QgjflA7aZhECPZAa2VUedKg2+QMWkI0L9lynh2SNmNEgA== +"@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.14.2": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.2.tgz#0c1680aa44ad4605b16cbdcc5c341a61bde9c746" + integrity sha512-IoVDIHpsgE/fu7eXBeRWt8zLbDrSvD7H1gpomOkPpBoEN8KCruCqSDdqo8dddwQQrui30KSvQBaMUOJiuFu6QQ== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -163,11 +189,11 @@ "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-class-properties@^7.8.3": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.1.tgz#bcb297c5366e79bebadef509549cd93b04f19978" - integrity sha512-U40A76x5gTwmESz+qiqssqmeEsKvcSyvtgktrm0uzcARAmM9I1jR221f6Oq+GmHrcD+LvZDag1UTOTe2fL3TeA== + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" + integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-syntax-import-meta@^7.8.3": version "7.10.4" @@ -226,43 +252,41 @@ "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-top-level-await@^7.8.3": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.1.tgz#dd6c0b357ac1bb142d98537450a319625d13d2a0" - integrity sha512-i7ooMZFS+a/Om0crxZodrTzNEPJHZrlMVGMTEpFAj6rYY/bKCddB0Dk/YxfPuYXOopuhKk/e1jV6h+WUU9XN3A== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/template@^7.10.4", "@babel/template@^7.12.7", "@babel/template@^7.3.3": - version "7.12.7" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.7.tgz#c817233696018e39fbb6c491d2fb684e05ed43bc" - integrity sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow== - dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/parser" "^7.12.7" - "@babel/types" "^7.12.7" - -"@babel/traverse@^7.1.0", "@babel/traverse@^7.12.1", "@babel/traverse@^7.12.10", "@babel/traverse@^7.12.5": - version "7.12.10" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.12.10.tgz#2d1f4041e8bf42ea099e5b2dc48d6a594c00017a" - integrity sha512-6aEtf0IeRgbYWzta29lePeYSk+YAFIC3kyqESeft8o5CkFlYIMX+EQDDWEiAQ9LHOA3d0oHdgrSsID/CKqXJlg== - dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/generator" "^7.12.10" - "@babel/helper-function-name" "^7.10.4" - "@babel/helper-split-export-declaration" "^7.11.0" - "@babel/parser" "^7.12.10" - "@babel/types" "^7.12.10" + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.13.tgz#c5f0fa6e249f5b739727f923540cf7a806130178" + integrity sha512-A81F9pDwyS7yM//KwbCSDqy3Uj4NMIurtplxphWxoYtNPov7cJsDkAFNNyVlIZ3jwGycVsurZ+LtOA8gZ376iQ== + dependencies: + "@babel/helper-plugin-utils" "^7.12.13" + +"@babel/template@^7.12.13", "@babel/template@^7.3.3": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327" + integrity sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA== + dependencies: + "@babel/code-frame" "^7.12.13" + "@babel/parser" "^7.12.13" + "@babel/types" "^7.12.13" + +"@babel/traverse@^7.1.0", "@babel/traverse@^7.13.0", "@babel/traverse@^7.14.0", "@babel/traverse@^7.14.2": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.14.2.tgz#9201a8d912723a831c2679c7ebbf2fe1416d765b" + integrity sha512-TsdRgvBFHMyHOOzcP9S6QU0QQtjxlRpEYOy3mcCO5RgmC305ki42aSAmfZEMSSYBla2oZ9BMqYlncBaKmD/7iA== + dependencies: + "@babel/code-frame" "^7.12.13" + "@babel/generator" "^7.14.2" + "@babel/helper-function-name" "^7.14.2" + "@babel/helper-split-export-declaration" "^7.12.13" + "@babel/parser" "^7.14.2" + "@babel/types" "^7.14.2" debug "^4.1.0" globals "^11.1.0" - lodash "^4.17.19" -"@babel/types@^7.0.0", "@babel/types@^7.10.4", "@babel/types@^7.11.0", "@babel/types@^7.12.1", "@babel/types@^7.12.10", "@babel/types@^7.12.5", "@babel/types@^7.12.7", "@babel/types@^7.3.0", "@babel/types@^7.3.3": - version "7.12.10" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.10.tgz#7965e4a7260b26f09c56bcfcb0498af1f6d9b260" - integrity sha512-sf6wboJV5mGyip2hIpDSKsr80RszPinEFjsHTalMxZAZkoQ2/2yQzxlcFN52SJqsyPfLtPmenL4g2KB3KJXPDw== +"@babel/types@^7.0.0", "@babel/types@^7.12.13", "@babel/types@^7.13.12", "@babel/types@^7.14.0", "@babel/types@^7.14.2", "@babel/types@^7.3.0", "@babel/types@^7.3.3": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.14.2.tgz#4208ae003107ef8a057ea8333e56eb64d2f6a2c3" + integrity sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw== dependencies: - "@babel/helper-validator-identifier" "^7.10.4" - lodash "^4.17.19" + "@babel/helper-validator-identifier" "^7.14.0" to-fast-properties "^2.0.0" "@bcoe/v8-coverage@^0.2.3": @@ -305,9 +329,9 @@ resolve-from "^5.0.0" "@istanbuljs/schema@^0.1.2": - version "0.1.2" - resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd" - integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw== + version "0.1.3" + resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" + integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== "@jest/console@^26.6.2": version "26.6.2" @@ -481,9 +505,9 @@ chalk "^4.0.0" "@sinonjs/commons@^1.7.0": - version "1.8.1" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.1.tgz#e7df00f98a203324f6dc7cc606cad9d4a8ab2217" - integrity sha512-892K+kWUUi3cl+LlqEWIDrhvLgdL79tECi8JZUyq6IviKy/DNhuzCRlbHUjxK89f4ypPMMaFnFuR9Ie6DoIMsw== + version "1.8.3" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" + integrity sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ== dependencies: type-detect "4.0.8" @@ -495,9 +519,9 @@ "@sinonjs/commons" "^1.7.0" "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.7": - version "7.1.12" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.12.tgz#4d8e9e51eb265552a7e4f1ff2219ab6133bdfb2d" - integrity sha512-wMTHiiTiBAAPebqaPiPDLFA4LYPKr6Ph0Xq/6rq1Ur3v66HXyG+clfR9CNETkD7MQS8ZHvpQOtA53DLws5WAEQ== + version "7.1.14" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.14.tgz#faaeefc4185ec71c389f4501ee5ec84b170cc402" + integrity sha512-zGZJzzBUVDo/eV6KgbE0f0ZI7dInEYvo12Rb70uNQDshC3SkRMb67ja0GgRHZgAX3Za6rhaWlvbDO8rrGyAb1g== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" @@ -521,16 +545,16 @@ "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.4", "@types/babel__traverse@^7.0.6": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.11.0.tgz#b9a1efa635201ba9bc850323a8793ee2d36c04a0" - integrity sha512-kSjgDMZONiIfSH1Nxcr5JIRMwUetDki63FSQfpTCz8ogF3Ulqm8+mr5f78dUYs6vMiB6gBusQqfQmBvHZj/lwg== + version "7.11.1" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.11.1.tgz#654f6c4f67568e24c23b367e947098c6206fa639" + integrity sha512-Vs0hm0vPahPMYi9tDjtP66llufgO3ST16WXaSTtDGEl9cewAl3AibmxWw6TINOqHPT9z0uABKAYjT9jNSg4npw== dependencies: "@babel/types" "^7.3.0" "@types/graceful-fs@^4.1.2": - version "4.1.4" - resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.4.tgz#4ff9f641a7c6d1a3508ff88bc3141b152772e753" - integrity sha512-mWA/4zFQhfvOA8zWkXobwJvBD7vzcxgrOQ0J5CH1votGqdq9m7+FwtGaqyCZqC3NyyBkc9z4m+iry4LlqcMWJg== + version "4.1.5" + resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15" + integrity sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw== dependencies: "@types/node" "*" @@ -554,14 +578,14 @@ "@types/istanbul-lib-report" "*" "@types/minimatch@^3.0.3": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" - integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== + version "3.0.4" + resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.4.tgz#f0ec25dbf2f0e4b18647313ac031134ca5b24b21" + integrity sha512-1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA== "@types/node@*": - version "14.14.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.12.tgz#0b1d86f8c40141091285dea02e4940df73bba43f" - integrity sha512-ASH8OPHMNlkdjrEdmoILmzFfsJICvhBsFfAum4aKZ/9U4B6M6tTmTPh+f3ttWdD74CEGV5XvXWkbyfSdXaTd7g== + version "15.3.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-15.3.0.tgz#d6fed7d6bc6854306da3dea1af9f874b00783e26" + integrity sha512-8/bnjSZD86ZfpBsDlCIkNXIvm+h6wi9g7IqL+kmFkQ+Wvu3JrasgLElfiPgoo8V8vVfnEi0QVS12gbl94h9YsQ== "@types/normalize-package-data@^2.4.0": version "2.4.0" @@ -569,9 +593,9 @@ integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== "@types/prettier@^2.0.0": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.1.5.tgz#b6ab3bba29e16b821d84e09ecfaded462b816b00" - integrity sha512-UEyp8LwZ4Dg30kVU2Q3amHHyTn1jEdhCIE59ANed76GaT1Vp76DD3ZWSAxgCrw6wJ0TqeoBpqmfUHiUDPs//HQ== + version "2.2.3" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.2.3.tgz#ef65165aea2924c9359205bf748865b8881753c0" + integrity sha512-PijRCG/K3s3w1We6ynUKdxEc5AcuuH3NBmMDP8uvKVp6X43UY7NQlTzczakXP3DJR0F4dfNQIGjU2cUeRYs2AA== "@types/stack-utils@^2.0.0": version "2.0.0" @@ -579,18 +603,18 @@ integrity sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw== "@types/yargs-parser@*": - version "15.0.0" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-15.0.0.tgz#cb3f9f741869e20cce330ffbeb9271590483882d" - integrity sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw== + version "20.2.0" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.0.tgz#dd3e6699ba3237f0348cd085e4698780204842f9" + integrity sha512-37RSHht+gzzgYeobbG+KWryeAW8J33Nhr69cjTqSYymXVZEN9NbRYWoYlRtDhHKPVT1FyNKwaTPC1NynKZpzRA== "@types/yargs@^15.0.0": - version "15.0.11" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.11.tgz#361d7579ecdac1527687bcebf9946621c12ab78c" - integrity sha512-jfcNBxHFYJ4nPIacsi3woz1+kvUO6s1CyeEhtnDHBjHUMNj5UlW2GynmnSgiJJEdNg9yW5C8lfoNRZrHGv5EqA== + version "15.0.13" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.13.tgz#34f7fec8b389d7f3c1fd08026a5763e072d3c6dc" + integrity sha512-kQ5JNTrbDv3Rp5X2n/iUu37IJBDU2gsZ5R/g1/KHOOEc5IKfUFjXT6DENPGduh08I/pamwtEq4oul7gUqKTQDQ== dependencies: "@types/yargs-parser" "*" -abab@^2.0.3: +abab@^2.0.3, abab@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.5.tgz#c0b678fb32d60fc1219c784d6a826fe385aeb79a" integrity sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q== @@ -618,6 +642,11 @@ acorn@^7.1.1, acorn@^7.4.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== +acorn@^8.1.0: + version "8.2.4" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.2.4.tgz#caba24b08185c3b56e3168e97d15ed17f4d31fd0" + integrity sha512-Ibt84YwBDDA890eDiDCEqcbwvHlBvzzDkU2cGBBDDI1QWT12jTiXIOn2CIw5KK4i6N5Z2HUxwYjzriDyqaqqZg== + ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" @@ -628,17 +657,27 @@ ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +ajv@^8.0.1: + version "8.4.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.4.0.tgz#48984fdb2ce225cab15795f0772a8d85669075e4" + integrity sha512-7QD2l6+KBSLwf+7MuYocbWvRPdOu63/trReTLu2KFwkgctnub1auoF+Y1WYcm09CTM7quuscrzqmASaLHC/K4Q== + dependencies: + fast-deep-equal "^3.1.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + uri-js "^4.2.2" + ansi-colors@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== ansi-escapes@^4.2.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.1.tgz#a5c47cc43181f1f38ffd7076837700d395522a61" - integrity sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA== + version "4.3.2" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" + integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== dependencies: - type-fest "^0.11.0" + type-fest "^0.21.3" ansi-regex@^5.0.0: version "5.0.0" @@ -668,9 +707,9 @@ anymatch@^2.0.0: normalize-path "^2.1.1" anymatch@^3.0.3: - version "3.1.1" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142" - integrity sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg== + version "3.1.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" + integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== dependencies: normalize-path "^3.0.0" picomatch "^2.0.4" @@ -795,9 +834,9 @@ babel-plugin-jest-hoist@^26.6.2: "@types/babel__traverse" "^7.0.6" babel-preset-current-node-syntax@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.0.tgz#cf5feef29551253471cfa82fc8e0f5063df07a77" - integrity sha512-mGkvkpocWJes1CmMKtgGUwCeeq0pOhALyymozzDWYomHTbDLwueDYG6p4TK1YOeYHCzBzYPsWkgTto10JubI1Q== + version "1.0.1" + resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz#b4399239b89b2a011f9ddbe3e4f401fc40cff73b" + integrity sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ== dependencies: "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-syntax-bigint" "^7.8.3" @@ -821,9 +860,9 @@ babel-preset-jest@^26.6.2: babel-preset-current-node-syntax "^1.0.0" balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== base@^0.11.1: version "0.11.2" @@ -881,6 +920,17 @@ browser-process-hrtime@^1.0.0: resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== +browserslist@^4.14.5: + version "4.16.6" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.6.tgz#d7901277a5a88e554ed305b183ec9b0c08f66fa2" + integrity sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ== + dependencies: + caniuse-lite "^1.0.30001219" + colorette "^1.2.2" + electron-to-chromium "^1.3.723" + escalade "^3.1.1" + node-releases "^1.1.71" + bser@2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" @@ -923,6 +973,11 @@ camelcase@^6.0.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== +caniuse-lite@^1.0.30001219: + version "1.0.30001228" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001228.tgz#bfdc5942cd3326fa51ee0b42fbef4da9d492a7fa" + integrity sha512-QQmLOGJ3DEgokHbMSA8cj2a+geXqmnpyOFT0lhQV6P3/YOJvGDEwoedcwxEQ30gJIwIIunHIicunJ2rzK5gB2A== + capture-exit@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4" @@ -953,9 +1008,9 @@ chalk@^3.0.0: supports-color "^7.1.0" chalk@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" - integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== + version "4.1.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.1.tgz#c80b3fab28bf6371e6863325eee67e618b77e6ad" + integrity sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg== dependencies: ansi-styles "^4.1.0" supports-color "^7.1.0" @@ -1036,6 +1091,11 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +colorette@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94" + integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w== + combined-stream@^1.0.6, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" @@ -1100,7 +1160,7 @@ cssom@~0.3.6: resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== -cssstyle@^2.2.0: +cssstyle@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-2.3.0.tgz#ff665a0ddbdc31864b09647f34163443d90b0852" integrity sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A== @@ -1142,7 +1202,7 @@ decamelize@^1.2.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= -decimal.js@^10.2.0: +decimal.js@^10.2.1: version "10.2.1" resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.2.1.tgz#238ae7b0f0c793d3e3cea410108b35a2c01426a3" integrity sha512-KaL7+6Fw6i5A2XSnsbhm/6B+NuEA7TZ4vqxnd5tXz9sbKtrN9Srj8ab4vKVdK8YAqZO9P1kg45Y6YLoduPf+kw== @@ -1221,6 +1281,11 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" +electron-to-chromium@^1.3.723: + version "1.3.728" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.728.tgz#dbedd6373f595ae10a13d146b66bece4c1afa5bd" + integrity sha512-SHv4ziXruBpb1Nz4aTuqEHBYi/9GNCJMYIJgDEXrp/2V01nFXMNFUTli5Z85f5ivSkioLilQatqBYFB44wNJrA== + emittery@^0.7.1: version "0.7.2" resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.7.2.tgz#25595908e13af0f5674ab419396e2fb394cdfa82" @@ -1252,6 +1317,11 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -1262,13 +1332,13 @@ escape-string-regexp@^2.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== -escodegen@^1.14.1: - version "1.14.3" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.3.tgz#4e7b81fba61581dc97582ed78cab7f0e8d63f503" - integrity sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw== +escodegen@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.0.0.tgz#5e32b12833e8aa8fa35e1bf0befa89380484c7dd" + integrity sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw== dependencies: esprima "^4.0.1" - estraverse "^4.2.0" + estraverse "^5.2.0" esutils "^2.0.2" optionator "^0.8.1" optionalDependencies: @@ -1300,9 +1370,9 @@ eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== eslint-visitor-keys@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" - integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" + integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== eslint@^7.22.0: version "7.26.0" @@ -1375,7 +1445,7 @@ esrecurse@^4.3.0: dependencies: estraverse "^5.2.0" -estraverse@^4.1.1, estraverse@^4.2.0: +estraverse@^4.1.1: version "4.3.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== @@ -1391,9 +1461,9 @@ esutils@^2.0.2: integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== exec-sh@^0.3.2: - version "0.3.4" - resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.4.tgz#3a018ceb526cc6f6df2bb504b2bfe8e3a4934ec5" - integrity sha512-sEFIkc61v75sWeOe72qyrqg2Qg0OuLESziUDk/O/z2qgS15y2gWVFrI6f2Qn/qw/0/NCfCEsmNA4zOjkwEZT1A== + version "0.3.6" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.6.tgz#ff264f9e325519a60cb5e273692943483cca63bc" + integrity sha512-nQn+hI3yp+oD0huYhKwvYI32+JFeq+XkNcD1GAo3Y/MjxsfVGmrrzrnzjWiNY6f+pUCP440fThsFh5gZrRAU/w== execa@^1.0.0: version "1.0.0" @@ -1560,9 +1630,9 @@ flat-cache@^3.0.4: rimraf "^3.0.2" flatted@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.1.0.tgz#a5d06b4a8b01e3a63771daa5cb7a1903e2e57067" - integrity sha512-tW+UkmtNg/jv9CSofAKvgVcO7c2URjhTdW1ZTkcAritblu8tajiYy7YisnIflEwtKssCtOxpnBRoCB7iap0/TA== + version "3.1.1" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.1.1.tgz#c4b489e80096d9df1dfc97c79871aea7c617c469" + integrity sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA== for-in@^1.0.2: version "1.0.2" @@ -1596,9 +1666,9 @@ fs.realpath@^1.0.0: integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= fsevents@^2.1.2: - version "2.2.1" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.2.1.tgz#1fb02ded2036a8ac288d507a65962bd87b97628d" - integrity sha512-bTLYHSeC0UH/EFXS9KqWnXuOl/wHK5Z/d+ghd5AsFMYN7wIGkUCOJyzy88+wJKkZPGON8u4Z9f6U4FdgURE9qA== + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== function-bind@^1.1.1: version "1.1.1" @@ -1610,7 +1680,7 @@ functional-red-black-tree@^1.0.1: resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= -gensync@^1.0.0-beta.1: +gensync@^1.0.0-beta.2: version "1.0.0-beta.2" resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== @@ -1652,16 +1722,16 @@ getpass@^0.1.1: assert-plus "^1.0.0" glob-parent@^5.0.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" - integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== dependencies: is-glob "^4.0.1" glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4: - version "7.1.6" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" - integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + version "7.1.7" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" + integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -1683,16 +1753,16 @@ globals@^12.1.0: type-fest "^0.8.1" globals@^13.6.0: - version "13.6.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.6.0.tgz#d77138e53738567bb96a3916ff6f6b487af20ef7" - integrity sha512-YFKCX0SiPg7l5oKYCJ2zZGxcXprVXHcSnVuvzrT3oSENQonVLqM5pf9fN5dLGZGyCjhw8TN8Btwe/jKnZ0pjvQ== + version "13.8.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.8.0.tgz#3e20f504810ce87a8d72e55aecf8435b50f4c1b3" + integrity sha512-rHtdA6+PDBIjeEvA91rpqzEvk/k3/i7EeNQiryiWuJH0Hw9cpyJMAt2jtbAwUaRdhD+573X4vWw6IcjKPasi9Q== dependencies: type-fest "^0.20.2" graceful-fs@^4.2.4: - version "4.2.4" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" - integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== + version "4.2.6" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee" + integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ== growly@^1.3.0: version "1.3.0" @@ -1814,9 +1884,9 @@ ignore@^5.1.4: integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== import-fresh@^3.0.0, import-fresh@^3.2.1: - version "3.2.2" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.2.2.tgz#fc129c160c5d68235507f4331a6baad186bdbc3e" - integrity sha512-cTPNrlvJT6twpYy+YmKUKrTSjWFs3bjYjAhCwm+z4EOCubZxAuO+hHpRN64TqjEaYSHs7tJAE0w1CKMGmsG/lw== + version "3.3.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" + integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== dependencies: parent-module "^1.0.0" resolve-from "^4.0.0" @@ -1847,11 +1917,6 @@ inherits@2: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -ip-regex@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" - integrity sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk= - is-accessor-descriptor@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" @@ -1883,10 +1948,10 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" -is-core-module@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.2.0.tgz#97037ef3d52224d85163f5597b2b63d9afed981a" - integrity sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ== +is-core-module@^2.2.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.4.0.tgz#8e9fc8e15027b011418026e98f0e6f4d86305cc1" + integrity sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A== dependencies: has "^1.0.3" @@ -1923,9 +1988,9 @@ is-descriptor@^1.0.0, is-descriptor@^1.0.2: kind-of "^6.0.2" is-docker@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.1.1.tgz#4125a88e44e450d384e09047ede71adc2d144156" - integrity sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw== + version "2.2.1" + resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" + integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" @@ -1981,9 +2046,9 @@ is-plain-object@^2.0.3, is-plain-object@^2.0.4: isobject "^3.0.1" is-potential-custom-element-name@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.0.tgz#0c52e54bcca391bb2c494b21e8626d7336c6e397" - integrity sha1-DFLlS8yjkbssSUsh6GJtczbG45c= + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" + integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== is-stream@^1.1.0: version "1.1.0" @@ -2472,35 +2537,35 @@ jsbn@~0.1.0: integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= jsdom@^16.4.0: - version "16.4.0" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.4.0.tgz#36005bde2d136f73eee1a830c6d45e55408edddb" - integrity sha512-lYMm3wYdgPhrl7pDcRmvzPhhrGVBeVhPIqeHjzeiHN3DFmD1RBpbExbi8vU7BJdH8VAZYovR8DMt0PNNDM7k8w== + version "16.5.3" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.5.3.tgz#13a755b3950eb938b4482c407238ddf16f0d2136" + integrity sha512-Qj1H+PEvUsOtdPJ056ewXM4UJPCi4hhLA8wpiz9F2YvsRBhuFsXxtrIFAgGBDynQA9isAMGE91PfUYbdMPXuTA== dependencies: - abab "^2.0.3" - acorn "^7.1.1" + abab "^2.0.5" + acorn "^8.1.0" acorn-globals "^6.0.0" cssom "^0.4.4" - cssstyle "^2.2.0" + cssstyle "^2.3.0" data-urls "^2.0.0" - decimal.js "^10.2.0" + decimal.js "^10.2.1" domexception "^2.0.1" - escodegen "^1.14.1" + escodegen "^2.0.0" html-encoding-sniffer "^2.0.1" is-potential-custom-element-name "^1.0.0" nwsapi "^2.2.0" - parse5 "5.1.1" + parse5 "6.0.1" request "^2.88.2" - request-promise-native "^1.0.8" - saxes "^5.0.0" + request-promise-native "^1.0.9" + saxes "^5.0.1" symbol-tree "^3.2.4" - tough-cookie "^3.0.1" + tough-cookie "^4.0.0" w3c-hr-time "^1.0.2" w3c-xmlserializer "^2.0.0" webidl-conversions "^6.1.0" whatwg-encoding "^1.0.5" whatwg-mimetype "^2.3.0" - whatwg-url "^8.0.0" - ws "^7.2.3" + whatwg-url "^8.5.0" + ws "^7.4.4" xml-name-validator "^3.0.0" jsesc@^2.5.1: @@ -2518,6 +2583,11 @@ json-schema-traverse@^0.4.1: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== +json-schema-traverse@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== + json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" @@ -2534,9 +2604,9 @@ json-stringify-safe@~5.0.1: integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= json5@^2.1.2: - version "2.1.3" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.3.tgz#c9b0f7fa9233bfe5807fe66fcf3a5617ed597d43" - integrity sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA== + version "2.2.0" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" + integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== dependencies: minimist "^1.2.5" @@ -2612,12 +2682,17 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" -lodash.sortby@^4.7.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" - integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= +lodash.clonedeep@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" + integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= -lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21: +lodash.truncate@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" + integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= + +lodash@^4.17.19, lodash@^4.17.21, lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -2680,24 +2755,24 @@ micromatch@^3.1.4: to-regex "^3.0.2" micromatch@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" - integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== + version "4.0.4" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" + integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== dependencies: braces "^3.0.1" - picomatch "^2.0.5" + picomatch "^2.2.3" -mime-db@1.44.0: - version "1.44.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" - integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== +mime-db@1.47.0: + version "1.47.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.47.0.tgz#8cb313e59965d3c05cfbf898915a267af46a335c" + integrity sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw== mime-types@^2.1.12, mime-types@~2.1.19: - version "2.1.27" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f" - integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w== + version "2.1.30" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.30.tgz#6e7be8b4c479825f85ed6326695db73f9305d62d" + integrity sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg== dependencies: - mime-db "1.44.0" + mime-db "1.47.0" mimic-fn@^2.1.0: version "2.1.0" @@ -2788,9 +2863,9 @@ node-modules-regexp@^1.0.0: integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= node-notifier@^8.0.0: - version "8.0.1" - resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-8.0.1.tgz#f86e89bbc925f2b068784b31f382afdc6ca56be1" - integrity sha512-BvEXF+UmsnAfYfoapKM9nGxnP+Wn7P91YfXmrKnfcYCx6VBeoN5Ez5Ogck6I8Bi5k4RlpqRYaw75pAwzX9OphA== + version "8.0.2" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-8.0.2.tgz#f3167a38ef0d2c8a866a83e318c1ba0efeb702c5" + integrity sha512-oJP/9NAdd9+x2Q+rfphB2RJCHjod70RcRLjosiPMMu5gjIfwVnOUGq2nbTjTUbmy0DJ/tFIVT30+Qe3nzl4TJg== dependencies: growly "^1.3.0" is-wsl "^2.2.0" @@ -2799,6 +2874,11 @@ node-notifier@^8.0.0: uuid "^8.3.0" which "^2.0.2" +node-releases@^1.1.71: + version "1.1.72" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.72.tgz#14802ab6b1039a79a0c7d662b610a5bbd76eacbe" + integrity sha512-LLUo+PpH3dU6XizX3iVoubUNheF/owjXCZZ5yACDxNnPtgFuludV1ZL3ayK1kVep42Rmm0+R9/Y60NQbZ2bifw== + normalize-package-data@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" @@ -2943,19 +3023,19 @@ parent-module@^1.0.0: callsites "^3.0.0" parse-json@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.1.0.tgz#f96088cdf24a8faa9aea9a009f2d9d942c999646" - integrity sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ== + version "5.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" + integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== dependencies: "@babel/code-frame" "^7.0.0" error-ex "^1.3.1" json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" -parse5@5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.1.tgz#f68e4e5ba1852ac2cadc00f4555fff6c2abb6178" - integrity sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug== +parse5@6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" + integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== pascalcase@^0.1.1: version "0.1.1" @@ -2992,10 +3072,10 @@ performance-now@^2.1.0: resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= -picomatch@^2.0.4, picomatch@^2.0.5: - version "2.2.2" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" - integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== +picomatch@^2.0.4, picomatch@^2.2.3: + version "2.2.3" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.3.tgz#465547f359ccc206d3c48e46a1bcb89bf7ee619d" + integrity sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg== pirates@^4.0.1: version "4.0.1" @@ -3059,14 +3139,14 @@ progress@^2.0.0: integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== prompts@^2.0.1: - version "2.4.0" - resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.0.tgz#4aa5de0723a231d1ee9121c40fdf663df73f61d7" - integrity sha512-awZAKrk3vN6CroQukBL+R9051a4R3zCZBlJm/HBfrSZ8iTpYix3VX1vU4mveiLpiwmOJT4wokTF9m6HUk4KqWQ== + version "2.4.1" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.1.tgz#befd3b1195ba052f9fd2fde8a486c4e82ee77f61" + integrity sha512-EQyfIuO2hPDsX1L/blblV+H7I0knhgAd82cVneCwcdND9B8AuCDuRcBH6yIcG4dFzlOUqbazQqwGjx5xmsNLuQ== dependencies: kleur "^3.0.3" sisteransi "^1.0.5" -psl@^1.1.28: +psl@^1.1.28, psl@^1.1.33: version "1.8.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== @@ -3090,9 +3170,9 @@ qs@~6.5.2: integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== react-is@^17.0.1: - version "17.0.1" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.1.tgz#5b3531bd76a645a4c9fb6e693ed36419e3301339" - integrity sha512-NAnt2iGDXohE5LI7uBnLnqvLQMtzhkiAOLXTmv+qnF9Ky7xAPcX8Up/xWIhxvLVGJvuLiNc4xQLtuqDRzb4fSA== + version "17.0.2" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" + integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== read-pkg-up@^7.0.1: version "7.0.1" @@ -3132,9 +3212,9 @@ remove-trailing-separator@^1.0.1: integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= repeat-element@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" - integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== + version "1.1.4" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.4.tgz#be681520847ab58c7568ac75fbfad28ed42d39e9" + integrity sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ== repeat-string@^1.6.1: version "1.6.1" @@ -3148,7 +3228,7 @@ request-promise-core@1.1.4: dependencies: lodash "^4.17.19" -request-promise-native@^1.0.8: +request-promise-native@^1.0.9: version "1.0.9" resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.9.tgz#e407120526a5efdc9a39b28a5679bf47b9d9dc28" integrity sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g== @@ -3188,6 +3268,11 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= +require-from-string@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + require-main-filename@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" @@ -3216,11 +3301,11 @@ resolve-url@^0.2.1: integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= resolve@^1.10.0, resolve@^1.18.1: - version "1.19.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.19.0.tgz#1af5bf630409734a067cae29318aac7fa29a267c" - integrity sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg== + version "1.20.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" + integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== dependencies: - is-core-module "^2.1.0" + is-core-module "^2.2.0" path-parse "^1.0.6" ret@~0.1.10: @@ -3277,14 +3362,14 @@ sane@^4.0.3: minimist "^1.1.1" walker "~1.0.5" -saxes@^5.0.0: +saxes@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/saxes/-/saxes-5.0.1.tgz#eebab953fa3b7608dbe94e5dadb15c888fa6696d" integrity sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw== dependencies: xmlchars "^2.2.0" -"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0: +"semver@2 || 3 || 4 || 5", semver@^5.5.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -3295,9 +3380,9 @@ semver@^6.0.0, semver@^6.3.0: integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== semver@^7.2.1, semver@^7.3.2: - version "7.3.4" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.4.tgz#27aaa7d2e4ca76452f98d3add093a72c943edc97" - integrity sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw== + version "7.3.5" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" + integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== dependencies: lru-cache "^6.0.0" @@ -3419,9 +3504,9 @@ source-map-support@^0.5.6: source-map "^0.6.0" source-map-url@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" - integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= + version "0.4.1" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.1.tgz#0af66605a745a5a2f91cf1bbf8a7afbc283dec56" + integrity sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw== source-map@^0.5.0, source-map@^0.5.6: version "0.5.7" @@ -3512,17 +3597,17 @@ stealthy-require@^1.1.1: integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= string-length@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.1.tgz#4a973bf31ef77c4edbceadd6af2611996985f8a1" - integrity sha512-PKyXUd0LK0ePjSOnWn34V2uD6acUWev9uy0Ft05k0E8xRW+SKcA0F7eMr7h5xlzfn+4O3N+55rduYyet3Jk+jw== + version "4.0.2" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a" + integrity sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ== dependencies: char-regex "^1.0.2" strip-ansi "^6.0.0" string-width@^4.1.0, string-width@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" - integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== + version "4.2.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5" + integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA== dependencies: emoji-regex "^8.0.0" is-fullwidth-code-point "^3.0.0" @@ -3570,9 +3655,9 @@ supports-color@^7.0.0, supports-color@^7.1.0: has-flag "^4.0.0" supports-hyperlinks@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.1.0.tgz#f663df252af5f37c5d49bbd7eeefa9e0b9e59e47" - integrity sha512-zoE5/e+dnEijk6ASB6/qrK+oYdm2do1hjoLWrqUC/8WEIW1gbxFcKuBof7sW8ArN6e+AYvsE8HBGiVRWL/F5CA== + version "2.2.0" + resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz#4f77b42488765891774b70c79babd87f9bd594bb" + integrity sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ== dependencies: has-flag "^4.0.0" supports-color "^7.0.0" @@ -3583,14 +3668,16 @@ symbol-tree@^3.2.4: integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== table@^6.0.4: - version "6.0.4" - resolved "https://registry.yarnpkg.com/table/-/table-6.0.4.tgz#c523dd182177e926c723eb20e1b341238188aa0d" - integrity sha512-sBT4xRLdALd+NFBvwOz8bw4b15htyythha+q+DVZqy2RS08PPC8O2sZFgJYEY7bJvbCFKccs+WIZ/cd+xxTWCw== + version "6.7.1" + resolved "https://registry.yarnpkg.com/table/-/table-6.7.1.tgz#ee05592b7143831a8c94f3cee6aae4c1ccef33e2" + integrity sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg== dependencies: - ajv "^6.12.4" - lodash "^4.17.20" + ajv "^8.0.1" + lodash.clonedeep "^4.5.0" + lodash.truncate "^4.4.2" slice-ansi "^4.0.0" string-width "^4.2.0" + strip-ansi "^6.0.0" terminal-link@^2.0.0: version "2.1.1" @@ -3669,14 +3756,14 @@ tough-cookie@^2.3.3, tough-cookie@~2.5.0: psl "^1.1.28" punycode "^2.1.1" -tough-cookie@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-3.0.1.tgz#9df4f57e739c26930a018184887f4adb7dca73b2" - integrity sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg== +tough-cookie@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.0.0.tgz#d822234eeca882f991f0f908824ad2622ddbece4" + integrity sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg== dependencies: - ip-regex "^2.1.0" - psl "^1.1.28" + psl "^1.1.33" punycode "^2.1.1" + universalify "^0.1.2" tr46@^2.0.2: version "2.0.2" @@ -3716,16 +3803,16 @@ type-detect@4.0.8: resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== -type-fest@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1" - integrity sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ== - type-fest@^0.20.2: version "0.20.2" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== +type-fest@^0.21.3: + version "0.21.3" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" + integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== + type-fest@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" @@ -3753,6 +3840,11 @@ union-value@^1.0.0: is-extendable "^0.1.1" set-value "^2.0.1" +universalify@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== + unset-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" @@ -3762,9 +3854,9 @@ unset-value@^1.0.0: isobject "^3.0.0" uri-js@^4.2.2: - version "4.4.0" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.0.tgz#aa714261de793e8a82347a7bcc9ce74e86f28602" - integrity sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g== + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== dependencies: punycode "^2.1.0" @@ -3789,14 +3881,14 @@ uuid@^8.3.0: integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== v8-compile-cache@^2.0.3: - version "2.2.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz#9471efa3ef9128d2f7c6a7ca39c4dd6b5055b132" - integrity sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q== + version "2.3.0" + resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" + integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== v8-to-istanbul@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-7.0.0.tgz#b4fe00e35649ef7785a9b7fcebcea05f37c332fc" - integrity sha512-fLL2rFuQpMtm9r8hrAV2apXX/WqHJ6+IC4/eQVdMDGBUgH/YMV4Gv3duk3kjmyg6uiQWBAA9nJwue4iJUOkHeA== + version "7.1.2" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-7.1.2.tgz#30898d1a7fa0c84d225a2c1434fb958f290883c1" + integrity sha512-TxNb7YEUwkLXCQYeudi6lgQ/SZrzNO4kMdlqVxaZPUIUjCv6iSSypUQX70kNBSERpQ8fk48+d61FXk+tgqcWow== dependencies: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" @@ -3862,12 +3954,12 @@ whatwg-mimetype@^2.3.0: resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== -whatwg-url@^8.0.0: - version "8.4.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.4.0.tgz#50fb9615b05469591d2b2bd6dfaed2942ed72837" - integrity sha512-vwTUFf6V4zhcPkWp/4CQPr1TW9Ml6SF4lVyaIMBdJw5i6qUUJ1QWM4Z6YYVkfka0OUIzVo/0aNtGVGk256IKWw== +whatwg-url@^8.0.0, whatwg-url@^8.5.0: + version "8.5.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.5.0.tgz#7752b8464fc0903fec89aa9846fc9efe07351fd3" + integrity sha512-fy+R77xWv0AiqfLl4nuGUlQ3/6b5uNfQ4WAbGQVMYshCTCCPK9psC1nWh3XHuxGVCtlcDDQPQW1csmmIQo+fwg== dependencies: - lodash.sortby "^4.7.0" + lodash "^4.7.0" tr46 "^2.0.2" webidl-conversions "^6.1.0" @@ -3919,10 +4011,10 @@ write-file-atomic@^3.0.0: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" -ws@^7.2.3: - version "7.4.1" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.1.tgz#a333be02696bd0e54cea0434e21dcc8a9ac294bb" - integrity sha512-pTsP8UAfhy3sk1lSk/O/s4tjD0CRwvMnzvwr4OKGX7ZvqZtUyx4KIJB5JWbkykPoc55tixMGgTNoh3k4FkNGFQ== +ws@^7.4.4: + version "7.4.5" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.5.tgz#a484dd851e9beb6fdb420027e3885e8ce48986c1" + integrity sha512-xzyu3hFvomRfXKH8vOFMU3OguG6oOvhXMo3xsGy3xWExqaM2dxBbVxuD99O7m3ZUFMvvscsZDqxfgMaRr/Nr1g== xml-name-validator@^3.0.0: version "3.0.0" @@ -3935,9 +4027,9 @@ xmlchars@^2.2.0: integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== y18n@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.1.tgz#8db2b83c31c5d75099bb890b23f3094891e247d4" - integrity sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ== + version "4.0.3" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" + integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== yallist@^4.0.0: version "4.0.0" From a4078d3941450557ff7c91318fdbb18c0d10128b Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sun, 16 May 2021 10:58:59 -0400 Subject: [PATCH 170/785] Fix for #888 --- CHANGELOG.md | 1 + src/utils/inlineEnsureParens.js | 1 + test/js/ruby/nodes/conditionals.test.js | 10 ++++++++++ 3 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 640c491e..004c92c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Changed - [#854](https://github.com/prettier/plugin-ruby/issues/854) - jflinter, kddeisz - Parentheses should not be stripped from optional RBS union types. +- [#888](https://github.com/prettier/plugin-ruby/issues/888) - MaxNotarangelo, kddeisz - Ensure parentheses wrap conditionals that get transformed into the modifier form when they're used within a binary node. ## [1.5.5] - 2021-03-25 diff --git a/src/utils/inlineEnsureParens.js b/src/utils/inlineEnsureParens.js index 91170570..f3060f2c 100644 --- a/src/utils/inlineEnsureParens.js +++ b/src/utils/inlineEnsureParens.js @@ -2,6 +2,7 @@ const needsParens = [ "args", "assign", "assoc_new", + "binary", "call", "massign", "opassign" diff --git a/test/js/ruby/nodes/conditionals.test.js b/test/js/ruby/nodes/conditionals.test.js index db97e830..038487c0 100644 --- a/test/js/ruby/nodes/conditionals.test.js +++ b/test/js/ruby/nodes/conditionals.test.js @@ -176,6 +176,16 @@ describe("conditionals", () => { return expect(content).toChangeFormat("(false if true).to_s"); }); + + test("wraps inline version within binary", () => { + const content = ruby(` + if foo + bar + end || baz + `); + + return expect(content).toChangeFormat("(bar if foo) || baz"); + }); }); }); From bd47dceeec190097cc88fe7b08d30eab2eef5694 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sun, 16 May 2021 11:04:34 -0400 Subject: [PATCH 171/785] Fix for #874 --- CHANGELOG.md | 1 + src/ruby/nodes/calls.js | 9 ++++++++- test/js/ruby/nodes/calls.test.js | 9 +++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 004c92c6..dc9555db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#854](https://github.com/prettier/plugin-ruby/issues/854) - jflinter, kddeisz - Parentheses should not be stripped from optional RBS union types. - [#888](https://github.com/prettier/plugin-ruby/issues/888) - MaxNotarangelo, kddeisz - Ensure parentheses wrap conditionals that get transformed into the modifier form when they're used within a binary node. +- [#874](https://github.com/prettier/plugin-ruby/issues/874) - yratanov, kddeisz - Ensure that method calls chained onto the ends of blocks still print their arguments. ## [1.5.5] - 2021-03-25 diff --git a/src/ruby/nodes/calls.js b/src/ruby/nodes/calls.js index 0b7571a8..8d05e969 100644 --- a/src/ruby/nodes/calls.js +++ b/src/ruby/nodes/calls.js @@ -4,6 +4,7 @@ const { hardline, ifBreak, indent, + join, softline } = require("../../prettier"); const { makeCall, noIndent } = require("../../utils"); @@ -133,7 +134,13 @@ function printMethodAddArg(path, opts, print) { ); } - return concat([methodDoc, argsDoc]); + // If there are already parentheses, then we can just use the doc that's + // already printed. + if (argNode.type == "arg_paren") { + return concat([methodDoc, argsDoc]); + } + + return concat([methodDoc, " ", join(", ", argsDoc), " "]); } function printMethodAddBlock(path, opts, print) { diff --git a/test/js/ruby/nodes/calls.test.js b/test/js/ruby/nodes/calls.test.js index 5a2a8fe6..2857ff32 100644 --- a/test/js/ruby/nodes/calls.test.js +++ b/test/js/ruby/nodes/calls.test.js @@ -97,4 +97,13 @@ describe("calls", () => { return expect(content).toChangeFormat(expected); }); + + test("chained method_add_arg after a block", () => { + const content = ruby(` + a.b c do + end.d e, f + `); + + return expect(content).toMatchFormat(); + }); }); From f37b27ff6b50e5b916fa3f9afec67039fe146290 Mon Sep 17 00:00:00 2001 From: Vesa Laakso <482561+valscion@users.noreply.github.com> Date: Tue, 11 May 2021 16:50:24 +0300 Subject: [PATCH 172/785] Setup safe Dependabot pull request automatic merging --- .github/workflows/automerge.yml | 54 +++++++++++++++++++++++++++++++++ .github/workflows/main.yml | 17 +++++++++++ 2 files changed, 71 insertions(+) create mode 100644 .github/workflows/automerge.yml diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 00000000..f6e3be27 --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,54 @@ +name: Auto Merge pull requests + +# read-write repo token +# access to secrets +on: + workflow_run: + workflows: ["Main"] + types: + - completed + +jobs: + automerge: + runs-on: ubuntu-latest + # Only run if workflow completed successfully in a pull request made by dependabot + if: > + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion == 'success' && + github.event.sender.login == 'dependabot[bot]' + steps: + - name: "Download artifact" + uses: actions/github-script@v3 + with: + # Artifact unzip code based on code in + # https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ + script: | + var artifacts = await github.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: ${{github.event.workflow_run.id }}, + }); + var matchArtifact = artifacts.data.artifacts.filter((artifact) => { + return artifact.name == "pre-automerge" + })[0]; + var download = await github.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: matchArtifact.id, + archive_format: 'zip', + }); + var fs = require('fs'); + fs.writeFileSync('${{github.workspace}}/pre-automerge.zip', Buffer.from(download.data)); + - run: unzip pre-automerge.zip + - name: "Merge pull request" + uses: actions/github-script@v3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + var fs = require('fs'); + var issue_number = Number(fs.readFileSync('./PRE_AUTOMERGE_PULL_REQUEST_NUMBER')); + await github.pulls.merge({ + owner: context.payload.repository.owner.login, + repo: context.payload.repository.name, + pull_number: issue_number + }) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 215fc8bd..73ee542b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -68,3 +68,20 @@ jobs: - run: | yarn check-format yarn lint + + pre-automerge: + name: Setup for Auto Merge + needs: + - ci + - lint + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' + steps: + - name: Save PR number + run: | + mkdir -p ./pre-automerge + echo ${{ github.event.number }} > ./pre-automerge/PRE_AUTOMERGE_PULL_REQUEST_NUMBER + - uses: actions/upload-artifact@v2 + with: + name: pre-automerge + path: pre-automerge/ From d4ad3315234b05cd02e92b1ea9bfc3650a98fa34 Mon Sep 17 00:00:00 2001 From: Vesa Laakso <482561+valscion@users.noreply.github.com> Date: Fri, 21 May 2021 10:01:00 +0300 Subject: [PATCH 173/785] Remove potentially incorrect conditional in job conditional It doesn't really matter that the PR number gets uploaded with every GitHub actions run, as long as the automerge won't get ran if the user is incorrect --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 73ee542b..4f1fec77 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -75,7 +75,7 @@ jobs: - ci - lint runs-on: ubuntu-latest - if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' + if: github.event_name == 'pull_request' steps: - name: Save PR number run: | From c14cdbcd92f54aabc4b213eadc45450adc0d5804 Mon Sep 17 00:00:00 2001 From: Vesa Laakso <482561+valscion@users.noreply.github.com> Date: Fri, 21 May 2021 10:05:10 +0300 Subject: [PATCH 174/785] Rename pre-configuration step job name Given that this step now runs in all pull requests, it would be confusing if the job name referred to auto-merge functionality. --- .github/workflows/automerge.yml | 8 ++++---- .github/workflows/main.yml | 14 ++++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index f6e3be27..c18c8ca4 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -29,7 +29,7 @@ jobs: run_id: ${{github.event.workflow_run.id }}, }); var matchArtifact = artifacts.data.artifacts.filter((artifact) => { - return artifact.name == "pre-automerge" + return artifact.name == "save-pr-info" })[0]; var download = await github.actions.downloadArtifact({ owner: context.repo.owner, @@ -38,15 +38,15 @@ jobs: archive_format: 'zip', }); var fs = require('fs'); - fs.writeFileSync('${{github.workspace}}/pre-automerge.zip', Buffer.from(download.data)); - - run: unzip pre-automerge.zip + fs.writeFileSync('${{github.workspace}}/save-pr-info.zip', Buffer.from(download.data)); + - run: unzip save-pr-info.zip - name: "Merge pull request" uses: actions/github-script@v3 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | var fs = require('fs'); - var issue_number = Number(fs.readFileSync('./PRE_AUTOMERGE_PULL_REQUEST_NUMBER')); + var issue_number = Number(fs.readFileSync('./PULL_REQUEST_NUMBER')); await github.pulls.merge({ owner: context.payload.repository.owner.login, repo: context.payload.repository.name, diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4f1fec77..e9dce094 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -69,8 +69,10 @@ jobs: yarn check-format yarn lint - pre-automerge: - name: Setup for Auto Merge + # Saves pull request details for later workflow runs which can run in + # a privileged environment + save-pr-info: + name: Save PR info needs: - ci - lint @@ -79,9 +81,9 @@ jobs: steps: - name: Save PR number run: | - mkdir -p ./pre-automerge - echo ${{ github.event.number }} > ./pre-automerge/PRE_AUTOMERGE_PULL_REQUEST_NUMBER + mkdir -p ./save-pr-info + echo ${{ github.event.number }} > ./save-pr-info/PULL_REQUEST_NUMBER - uses: actions/upload-artifact@v2 with: - name: pre-automerge - path: pre-automerge/ + name: save-pr-info + path: save-pr-info/ From 46bd6d7a62597fdfea2bfee9536fc8d44a8fd1b5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 May 2021 05:04:34 +0000 Subject: [PATCH 175/785] Bump eslint from 7.26.0 to 7.27.0 Bumps [eslint](https://github.com/eslint/eslint) from 7.26.0 to 7.27.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v7.26.0...v7.27.0) Signed-off-by: dependabot[bot] --- yarn.lock | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index 28e5c2b1..ab58f261 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1332,6 +1332,11 @@ escape-string-regexp@^2.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== +escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + escodegen@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.0.0.tgz#5e32b12833e8aa8fa35e1bf0befa89380484c7dd" @@ -1375,9 +1380,9 @@ eslint-visitor-keys@^2.0.0: integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== eslint@^7.22.0: - version "7.26.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.26.0.tgz#d416fdcdcb3236cd8f282065312813f8c13982f6" - integrity sha512-4R1ieRf52/izcZE7AlLy56uIHHDLT74Yzz2Iv2l6kDaYvEu9x+wMB5dZArVL8SYGXSYV2YAg70FcW5Y5nGGNIg== + version "7.27.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.27.0.tgz#665a1506d8f95655c9274d84bd78f7166b07e9c7" + integrity sha512-JZuR6La2ZF0UD384lcbnd0Cgg6QJjiCwhMD6eU4h/VGPcVGwawNNzKU41tgokGXnfjOOyI6QIffthhJTPzzuRA== dependencies: "@babel/code-frame" "7.12.11" "@eslint/eslintrc" "^0.4.1" @@ -1387,12 +1392,14 @@ eslint@^7.22.0: debug "^4.0.1" doctrine "^3.0.0" enquirer "^2.3.5" + escape-string-regexp "^4.0.0" eslint-scope "^5.1.1" eslint-utils "^2.1.0" eslint-visitor-keys "^2.0.0" espree "^7.3.1" esquery "^1.4.0" esutils "^2.0.2" + fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" functional-red-black-tree "^1.0.1" glob-parent "^5.0.0" @@ -1404,7 +1411,7 @@ eslint@^7.22.0: js-yaml "^3.13.1" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" - lodash "^4.17.21" + lodash.merge "^4.6.2" minimatch "^3.0.4" natural-compare "^1.4.0" optionator "^0.9.1" @@ -1413,7 +1420,7 @@ eslint@^7.22.0: semver "^7.2.1" strip-ansi "^6.0.0" strip-json-comments "^3.1.0" - table "^6.0.4" + table "^6.0.9" text-table "^0.2.0" v8-compile-cache "^2.0.3" @@ -1567,7 +1574,7 @@ extsprintf@^1.2.0: resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= -fast-deep-equal@^3.1.1: +fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== @@ -2687,12 +2694,17 @@ lodash.clonedeep@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= +lodash.merge@^4.6.2: + version "4.6.2" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" + integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== + lodash.truncate@^4.4.2: version "4.4.2" resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= -lodash@^4.17.19, lodash@^4.17.21, lodash@^4.7.0: +lodash@^4.17.19, lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -3667,7 +3679,7 @@ symbol-tree@^3.2.4: resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== -table@^6.0.4: +table@^6.0.9: version "6.7.1" resolved "https://registry.yarnpkg.com/table/-/table-6.7.1.tgz#ee05592b7143831a8c94f3cee6aae4c1ccef33e2" integrity sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg== From 73a3c738517a9941e38cb1b2ad505cb3cbc9735c Mon Sep 17 00:00:00 2001 From: Hansen Qian Date: Tue, 25 May 2021 13:07:22 -0400 Subject: [PATCH 176/785] Re-enable Layout/LineLength --- rubocop.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rubocop.yml b/rubocop.yml index 9aa04c30..32641443 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -4,6 +4,15 @@ Layout: Enabled: false +# Re-enable Layout/LineLength because certain cops that most projects use +# (e.g. Style/IfUnlessModifier) require Layout/LineLength to be enabled. +# By leaving it disabled, those rules will mis-fire. +# +# Users can always override these defaults in their own rubocop.yml files. +# https://github.com/prettier/plugin-ruby/issues/825 +Layout/LineLength: + Enabled: true + # Disabling all of the following options because they could conflict with a # prettier configuration setting. From 997f8afcfe6cc8d98d4fa6706e7cf7b80a3dc2cf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 May 2021 05:03:37 +0000 Subject: [PATCH 177/785] Bump jest from 26.6.3 to 27.0.1 Bumps [jest](https://github.com/facebook/jest) from 26.6.3 to 27.0.1. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v26.6.3...v27.0.1) Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 2312 ++++++++++++++------------------------------------ 2 files changed, 638 insertions(+), 1676 deletions(-) diff --git a/package.json b/package.json index 6c3d9f46..ee7ee0a6 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "eslint": "^7.22.0", "eslint-config-prettier": "^8.0.0", "husky": "^6.0.0", - "jest": "^26.0.0", + "jest": "^27.0.1", "pretty-quick": "^3.1.0" }, "eslintConfig": { diff --git a/yarn.lock b/yarn.lock index ab58f261..d7f3d157 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9,7 +9,7 @@ dependencies: "@babel/highlight" "^7.10.4" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13": +"@babel/code-frame@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658" integrity sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g== @@ -42,6 +42,27 @@ semver "^6.3.0" source-map "^0.5.0" +"@babel/core@^7.7.2": + version "7.14.3" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.14.3.tgz#5395e30405f0776067fbd9cf0884f15bfb770a38" + integrity sha512-jB5AmTKOCSJIZ72sd78ECEhuPiDMKlQdDI/4QRI6lzYATx5SSogS1oQA2AoPecRCknm30gHi2l+QVvNUu3wZAg== + dependencies: + "@babel/code-frame" "^7.12.13" + "@babel/generator" "^7.14.3" + "@babel/helper-compilation-targets" "^7.13.16" + "@babel/helper-module-transforms" "^7.14.2" + "@babel/helpers" "^7.14.0" + "@babel/parser" "^7.14.3" + "@babel/template" "^7.12.13" + "@babel/traverse" "^7.14.2" + "@babel/types" "^7.14.2" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.1.2" + semver "^6.3.0" + source-map "^0.5.0" + "@babel/generator@^7.14.2": version "7.14.2" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.14.2.tgz#d5773e8b557d421fd6ce0d5efa5fd7fc22567c30" @@ -51,6 +72,15 @@ jsesc "^2.5.1" source-map "^0.5.0" +"@babel/generator@^7.14.3", "@babel/generator@^7.7.2": + version "7.14.3" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.14.3.tgz#0c2652d91f7bddab7cccc6ba8157e4f40dcedb91" + integrity sha512-bn0S6flG/j0xtQdz3hsjJ624h3W0r3llttBMfyHX3YrZ/KtLYr15bjA0FXkgW7FpvrDuTuElXeVjiKlYRpnOFA== + dependencies: + "@babel/types" "^7.14.2" + jsesc "^2.5.1" + source-map "^0.5.0" + "@babel/helper-compilation-targets@^7.13.16": version "7.13.16" resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.16.tgz#6e91dccf15e3f43e5556dffe32d860109887563c" @@ -174,6 +204,11 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.2.tgz#0c1680aa44ad4605b16cbdcc5c341a61bde9c746" integrity sha512-IoVDIHpsgE/fu7eXBeRWt8zLbDrSvD7H1gpomOkPpBoEN8KCruCqSDdqo8dddwQQrui30KSvQBaMUOJiuFu6QQ== +"@babel/parser@^7.14.3", "@babel/parser@^7.7.2": + version "7.14.3" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.3.tgz#9b530eecb071fd0c93519df25c5ff9f14759f298" + integrity sha512-7MpZDIfI7sUC5zWo2+foJ50CSI5lcqDehZ0lVgIhSi4bFEk94fLAKlF3Q0nzSQQ+ca0lm+O6G9ztKVBeu8PMRQ== + "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" @@ -258,6 +293,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.12.13" +"@babel/plugin-syntax-typescript@^7.7.2": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.12.13.tgz#9dff111ca64154cef0f4dc52cf843d9f12ce4474" + integrity sha512-cHP3u1JiUiG2LFDKbXnwVad81GvfyIOmCD6HIEId6ojrY0Drfy2q1jw7BwN7dE84+kTnBjLkXoL3IEy/3JPu2w== + dependencies: + "@babel/helper-plugin-utils" "^7.12.13" + "@babel/template@^7.12.13", "@babel/template@^7.3.3": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327" @@ -267,7 +309,7 @@ "@babel/parser" "^7.12.13" "@babel/types" "^7.12.13" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.13.0", "@babel/traverse@^7.14.0", "@babel/traverse@^7.14.2": +"@babel/traverse@^7.1.0", "@babel/traverse@^7.13.0", "@babel/traverse@^7.14.0", "@babel/traverse@^7.14.2", "@babel/traverse@^7.7.2": version "7.14.2" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.14.2.tgz#9201a8d912723a831c2679c7ebbf2fe1416d765b" integrity sha512-TsdRgvBFHMyHOOzcP9S6QU0QQtjxlRpEYOy3mcCO5RgmC305ki42aSAmfZEMSSYBla2oZ9BMqYlncBaKmD/7iA== @@ -294,14 +336,6 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@cnakazawa/watch@^1.0.3": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.4.tgz#f864ae85004d0fcab6f50be9141c4da368d1656a" - integrity sha512-v9kIhKwjeZThiWrLmj0y17CWoyddASLj9O2yvbZkbvw/N3rWOYy9zkV66ursAoVr0mV15bL8g0c4QZUE6cdDoQ== - dependencies: - exec-sh "^0.3.2" - minimist "^1.2.0" - "@eslint/eslintrc@^0.4.1": version "0.4.1" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.1.tgz#442763b88cecbe3ee0ec7ca6d6dd6168550cbf14" @@ -333,93 +367,94 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-26.6.2.tgz#4e04bc464014358b03ab4937805ee36a0aeb98f2" - integrity sha512-IY1R2i2aLsLr7Id3S6p2BA82GNWryt4oSvEXLAKc+L2zdi89dSkE8xC1C+0kpATG4JhBJREnQOH7/zmccM2B0g== +"@jest/console@^27.0.1": + version "27.0.1" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.0.1.tgz#c6acfec201f9b6823596eb6c4fcd77c89a8b27e9" + integrity sha512-50E6nN2F5cAXn1lDljn0gE9F0WFXHYz/u0EeR7sOt4nbRPNli34ckbl6CUDaDABJbHt62DYnyQAIB3KgdzwKDw== dependencies: - "@jest/types" "^26.6.2" + "@jest/types" "^27.0.1" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^26.6.2" - jest-util "^26.6.2" + jest-message-util "^27.0.1" + jest-util "^27.0.1" slash "^3.0.0" -"@jest/core@^26.6.3": - version "26.6.3" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-26.6.3.tgz#7639fcb3833d748a4656ada54bde193051e45fad" - integrity sha512-xvV1kKbhfUqFVuZ8Cyo+JPpipAHHAV3kcDBftiduK8EICXmTFddryy3P7NfZt8Pv37rA9nEJBKCCkglCPt/Xjw== +"@jest/core@^27.0.1": + version "27.0.1" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.0.1.tgz#88d0ff55f465fe1fc3a940718e8cf0fea242be4b" + integrity sha512-PiCbKSMf6t8PEfY3MAd0Ldn3aJAt5T+UcaFkAfMZ1VZgas35+fXk5uHIjAQHQLNIHZWX19TLv0wWNT03yvrw6w== dependencies: - "@jest/console" "^26.6.2" - "@jest/reporters" "^26.6.2" - "@jest/test-result" "^26.6.2" - "@jest/transform" "^26.6.2" - "@jest/types" "^26.6.2" + "@jest/console" "^27.0.1" + "@jest/reporters" "^27.0.1" + "@jest/test-result" "^27.0.1" + "@jest/transform" "^27.0.1" + "@jest/types" "^27.0.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" + emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" - jest-changed-files "^26.6.2" - jest-config "^26.6.3" - jest-haste-map "^26.6.2" - jest-message-util "^26.6.2" - jest-regex-util "^26.0.0" - jest-resolve "^26.6.2" - jest-resolve-dependencies "^26.6.3" - jest-runner "^26.6.3" - jest-runtime "^26.6.3" - jest-snapshot "^26.6.2" - jest-util "^26.6.2" - jest-validate "^26.6.2" - jest-watcher "^26.6.2" - micromatch "^4.0.2" + jest-changed-files "^27.0.1" + jest-config "^27.0.1" + jest-haste-map "^27.0.1" + jest-message-util "^27.0.1" + jest-regex-util "^27.0.1" + jest-resolve "^27.0.1" + jest-resolve-dependencies "^27.0.1" + jest-runner "^27.0.1" + jest-runtime "^27.0.1" + jest-snapshot "^27.0.1" + jest-util "^27.0.1" + jest-validate "^27.0.1" + jest-watcher "^27.0.1" + micromatch "^4.0.4" p-each-series "^2.1.0" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-26.6.2.tgz#ba364cc72e221e79cc8f0a99555bf5d7577cf92c" - integrity sha512-nFy+fHl28zUrRsCeMB61VDThV1pVTtlEokBRgqPrcT1JNq4yRNIyTHfyht6PqtUvY9IsuLGTrbG8kPXjSZIZwA== +"@jest/environment@^27.0.1": + version "27.0.1" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.0.1.tgz#27ed89bf8179c0a030690f063d922d6da7a519ac" + integrity sha512-nG+r3uSs2pOTsdhgt6lUm4ZGJLRcTc6HZIkrFsVpPcdSqEpJehEny9r9y2Bmhkn8fKXWdGCYJKF3i4nKO0HSmA== dependencies: - "@jest/fake-timers" "^26.6.2" - "@jest/types" "^26.6.2" + "@jest/fake-timers" "^27.0.1" + "@jest/types" "^27.0.1" "@types/node" "*" - jest-mock "^26.6.2" + jest-mock "^27.0.1" -"@jest/fake-timers@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-26.6.2.tgz#459c329bcf70cee4af4d7e3f3e67848123535aad" - integrity sha512-14Uleatt7jdzefLPYM3KLcnUl1ZNikaKq34enpb5XG9i81JpppDb5muZvonvKyrl7ftEHkKS5L5/eB/kxJ+bvA== +"@jest/fake-timers@^27.0.1": + version "27.0.1" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.0.1.tgz#6987a596b0bcf8c07653086076c17058b4c77b5c" + integrity sha512-3CyLJQnHzKI4TCJSCo+I9TzIHjSK4RrNEk93jFM6Q9+9WlSJ3mpMq/p2YuKMe0SiHKbmZOd5G/Ll5ofF9Xkw9g== dependencies: - "@jest/types" "^26.6.2" - "@sinonjs/fake-timers" "^6.0.1" + "@jest/types" "^27.0.1" + "@sinonjs/fake-timers" "^7.0.2" "@types/node" "*" - jest-message-util "^26.6.2" - jest-mock "^26.6.2" - jest-util "^26.6.2" + jest-message-util "^27.0.1" + jest-mock "^27.0.1" + jest-util "^27.0.1" -"@jest/globals@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-26.6.2.tgz#5b613b78a1aa2655ae908eba638cc96a20df720a" - integrity sha512-85Ltnm7HlB/KesBUuALwQ68YTU72w9H2xW9FjZ1eL1U3lhtefjjl5c2MiUbpXt/i6LaPRvoOFJ22yCBSfQ0JIA== +"@jest/globals@^27.0.1": + version "27.0.1" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.0.1.tgz#14c776942f7047a04f2aea09b148065e2aa9d7e9" + integrity sha512-80ZCzgopysKdpp5EOglgjApKxiNDR96PG4PwngB4fTwZ4qqqSKo0EwGwQIhl16szQ1M2xCVYmr9J6KelvnABNQ== dependencies: - "@jest/environment" "^26.6.2" - "@jest/types" "^26.6.2" - expect "^26.6.2" + "@jest/environment" "^27.0.1" + "@jest/types" "^27.0.1" + expect "^27.0.1" -"@jest/reporters@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-26.6.2.tgz#1f518b99637a5f18307bd3ecf9275f6882a667f6" - integrity sha512-h2bW53APG4HvkOnVMo8q3QXa6pcaNt1HkwVsOPMBV6LD/q9oSpxNSYZQYkAnjdMjrJ86UuYeLo+aEZClV6opnw== +"@jest/reporters@^27.0.1": + version "27.0.1" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.0.1.tgz#5b491f64e37c9b97b13e564f18f36b6697d28045" + integrity sha512-lZbJWuS1h/ytKERfu1D6tEQ4PuQ7+15S4+HrSzHR0i7AGVT1WRo49h4fZqxASOp7AQCupUVtPJNZDkaG9ZXy0g== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^26.6.2" - "@jest/test-result" "^26.6.2" - "@jest/transform" "^26.6.2" - "@jest/types" "^26.6.2" + "@jest/console" "^27.0.1" + "@jest/test-result" "^27.0.1" + "@jest/transform" "^27.0.1" + "@jest/types" "^27.0.1" chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" @@ -430,78 +465,76 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^26.6.2" - jest-resolve "^26.6.2" - jest-util "^26.6.2" - jest-worker "^26.6.2" + jest-haste-map "^27.0.1" + jest-resolve "^27.0.1" + jest-util "^27.0.1" + jest-worker "^27.0.1" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" terminal-link "^2.0.0" v8-to-istanbul "^7.0.0" - optionalDependencies: - node-notifier "^8.0.0" -"@jest/source-map@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-26.6.2.tgz#29af5e1e2e324cafccc936f218309f54ab69d535" - integrity sha512-YwYcCwAnNmOVsZ8mr3GfnzdXDAl4LaenZP5z+G0c8bzC9/dugL8zRmxZzdoTl4IaS3CryS1uWnROLPFmb6lVvA== +"@jest/source-map@^27.0.1": + version "27.0.1" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.0.1.tgz#2afbf73ddbaddcb920a8e62d0238a0a9e0a8d3e4" + integrity sha512-yMgkF0f+6WJtDMdDYNavmqvbHtiSpwRN2U/W+6uztgfqgkq/PXdKPqjBTUF1RD/feth4rH5N3NW0T5+wIuln1A== dependencies: callsites "^3.0.0" graceful-fs "^4.2.4" source-map "^0.6.0" -"@jest/test-result@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-26.6.2.tgz#55da58b62df134576cc95476efa5f7949e3f5f18" - integrity sha512-5O7H5c/7YlojphYNrK02LlDIV2GNPYisKwHm2QTKjNZeEzezCbwYs9swJySv2UfPMyZ0VdsmMv7jIlD/IKYQpQ== +"@jest/test-result@^27.0.1": + version "27.0.1" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.0.1.tgz#8fb97214268ea21cf8cfb83edc0f17e558b3466d" + integrity sha512-5aa+ibX2dsGSDLKaQMZb453MqjJU/CRVumebXfaJmuzuGE4qf87yQ2QZ6PEpEtBwVUEgrJCzi3jLCRaUbksSuw== dependencies: - "@jest/console" "^26.6.2" - "@jest/types" "^26.6.2" + "@jest/console" "^27.0.1" + "@jest/types" "^27.0.1" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^26.6.3": - version "26.6.3" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-26.6.3.tgz#98e8a45100863886d074205e8ffdc5a7eb582b17" - integrity sha512-YHlVIjP5nfEyjlrSr8t/YdNfU/1XEt7c5b4OxcXCjyRhjzLYu/rO69/WHPuYcbCWkz8kAeZVZp2N2+IOLLEPGw== +"@jest/test-sequencer@^27.0.1": + version "27.0.1" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.0.1.tgz#2a3b85130978fc545d8ee6c34d65ff4231dbad86" + integrity sha512-yK2c2iruJ35WgH4KH8whS72uH+FASJUrzwxzNKTzLAEWmNpWKNEPOsSEKsHynvz78bLHafrTg4adN7RrYNbEOA== dependencies: - "@jest/test-result" "^26.6.2" + "@jest/test-result" "^27.0.1" graceful-fs "^4.2.4" - jest-haste-map "^26.6.2" - jest-runner "^26.6.3" - jest-runtime "^26.6.3" + jest-haste-map "^27.0.1" + jest-runner "^27.0.1" + jest-runtime "^27.0.1" -"@jest/transform@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-26.6.2.tgz#5ac57c5fa1ad17b2aae83e73e45813894dcf2e4b" - integrity sha512-E9JjhUgNzvuQ+vVAL21vlyfy12gP0GhazGgJC4h6qUt1jSdUXGWJ1wfu/X7Sd8etSgxV4ovT1pb9v5D6QW4XgA== +"@jest/transform@^27.0.1": + version "27.0.1" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.0.1.tgz#a9ece291f82273d5e58132550996c16edd5a902a" + integrity sha512-LC95VpT6wMnQ96dRJDlUiAnW/90zyh4+jS30szI/5AsfS0qwSlr/O4TPcGoD2WVaVMfo6KvR+brvOtGyMHaNhA== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^26.6.2" + "@jest/types" "^27.0.1" babel-plugin-istanbul "^6.0.0" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.4" - jest-haste-map "^26.6.2" - jest-regex-util "^26.0.0" - jest-util "^26.6.2" - micromatch "^4.0.2" + jest-haste-map "^27.0.1" + jest-regex-util "^27.0.1" + jest-util "^27.0.1" + micromatch "^4.0.4" pirates "^4.0.1" slash "^3.0.0" source-map "^0.6.1" write-file-atomic "^3.0.0" -"@jest/types@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-26.6.2.tgz#bef5a532030e1d88a2f5a6d933f84e97226ed48e" - integrity sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ== +"@jest/types@^27.0.1": + version "27.0.1" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.0.1.tgz#631738c942e70045ebbf42a3f9b433036d3845e4" + integrity sha512-8A25RRV4twZutsx2D+7WphnDsp7If9Yu6ko0Gxwrwv8BiWESFzka34+Aa2kC8w9xewt7SDuCUSZ6IiAFVj3PRg== dependencies: "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" "@types/node" "*" - "@types/yargs" "^15.0.0" + "@types/yargs" "^16.0.0" chalk "^4.0.0" "@sinonjs/commons@^1.7.0": @@ -511,14 +544,19 @@ dependencies: type-detect "4.0.8" -"@sinonjs/fake-timers@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz#293674fccb3262ac782c7aadfdeca86b10c75c40" - integrity sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA== +"@sinonjs/fake-timers@^7.0.2": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-7.1.0.tgz#8f13af27d842cbf51ad4502e05562fe9391d084e" + integrity sha512-hAEzXi6Wbvlb67NnGMGSNOeAflLVnMa4yliPU/ty1qjgW/vAletH15/v/esJwASSIA0YlIyjnloenFbEZc9q9A== dependencies: "@sinonjs/commons" "^1.7.0" -"@types/babel__core@^7.0.0", "@types/babel__core@^7.1.7": +"@tootallnate/once@1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" + integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== + +"@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": version "7.1.14" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.14.tgz#faaeefc4185ec71c389f4501ee5ec84b170cc402" integrity sha512-zGZJzzBUVDo/eV6KgbE0f0ZI7dInEYvo12Rb70uNQDshC3SkRMb67ja0GgRHZgAX3Za6rhaWlvbDO8rrGyAb1g== @@ -587,12 +625,7 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-15.3.0.tgz#d6fed7d6bc6854306da3dea1af9f874b00783e26" integrity sha512-8/bnjSZD86ZfpBsDlCIkNXIvm+h6wi9g7IqL+kmFkQ+Wvu3JrasgLElfiPgoo8V8vVfnEi0QVS12gbl94h9YsQ== -"@types/normalize-package-data@^2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" - integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== - -"@types/prettier@^2.0.0": +"@types/prettier@^2.1.5": version "2.2.3" resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.2.3.tgz#ef65165aea2924c9359205bf748865b8881753c0" integrity sha512-PijRCG/K3s3w1We6ynUKdxEc5AcuuH3NBmMDP8uvKVp6X43UY7NQlTzczakXP3DJR0F4dfNQIGjU2cUeRYs2AA== @@ -607,10 +640,10 @@ resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.0.tgz#dd3e6699ba3237f0348cd085e4698780204842f9" integrity sha512-37RSHht+gzzgYeobbG+KWryeAW8J33Nhr69cjTqSYymXVZEN9NbRYWoYlRtDhHKPVT1FyNKwaTPC1NynKZpzRA== -"@types/yargs@^15.0.0": - version "15.0.13" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.13.tgz#34f7fec8b389d7f3c1fd08026a5763e072d3c6dc" - integrity sha512-kQ5JNTrbDv3Rp5X2n/iUu37IJBDU2gsZ5R/g1/KHOOEc5IKfUFjXT6DENPGduh08I/pamwtEq4oul7gUqKTQDQ== +"@types/yargs@^16.0.0": + version "16.0.3" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.3.tgz#4b6d35bb8e680510a7dc2308518a80ee1ef27e01" + integrity sha512-YlFfTGS+zqCgXuXNV26rOIeETOkXnGQXP/pjjL9P0gO/EP9jTmc7pUBhx+jVEIxpq41RX33GQ7N3DzOSfZoglQ== dependencies: "@types/yargs-parser" "*" @@ -642,12 +675,19 @@ acorn@^7.1.1, acorn@^7.4.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.1.0: +acorn@^8.2.4: version "8.2.4" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.2.4.tgz#caba24b08185c3b56e3168e97d15ed17f4d31fd0" integrity sha512-Ibt84YwBDDA890eDiDCEqcbwvHlBvzzDkU2cGBBDDI1QWT12jTiXIOn2CIw5KK4i6N5Z2HUxwYjzriDyqaqqZg== -ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4: +agent-base@6: + version "6.0.2" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" + integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== + dependencies: + debug "4" + +ajv@^6.10.0, ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -698,13 +738,10 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0: dependencies: color-convert "^2.0.1" -anymatch@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" - integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== - dependencies: - micromatch "^3.1.4" - normalize-path "^2.1.1" +ansi-styles@^5.0.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" + integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== anymatch@^3.0.3: version "3.1.2" @@ -721,21 +758,6 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" -arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= - -arr-flatten@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== - -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= - array-differ@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-3.0.0.tgz#3cbb3d0f316810eafcc47624734237d6aee4ae6b" @@ -746,33 +768,11 @@ array-union@^2.1.0: resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== -array-unique@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= - arrify@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -asn1@~0.2.3: - version "0.2.4" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" - integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== - dependencies: - safer-buffer "~2.1.0" - -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= - -assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= - astral-regex@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" @@ -783,31 +783,16 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= -atob@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== - -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= - -aws4@^1.8.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" - integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== - -babel-jest@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-26.6.3.tgz#d87d25cb0037577a0c89f82e5755c5d293c01056" - integrity sha512-pl4Q+GAVOHwvjrck6jKjvmGhnO3jHX/xuB9d27f+EJZ/6k+6nMuPjorrYp7s++bKKdANwzElBWnLWaObvTnaZA== - dependencies: - "@jest/transform" "^26.6.2" - "@jest/types" "^26.6.2" - "@types/babel__core" "^7.1.7" +babel-jest@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.0.1.tgz#9f1c4571ac17a39e599d1325dcaf53a274261df4" + integrity sha512-aWFD7OGQjk3Y8MdZKf1XePlQvHnjMVJQjIq9WKrlAjz9by703kJ45Jxhp26JwnovoW71YYz5etuqRl8wMcIv0w== + dependencies: + "@jest/transform" "^27.0.1" + "@jest/types" "^27.0.1" + "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.0.0" - babel-preset-jest "^26.6.2" + babel-preset-jest "^27.0.1" chalk "^4.0.0" graceful-fs "^4.2.4" slash "^3.0.0" @@ -823,10 +808,10 @@ babel-plugin-istanbul@^6.0.0: istanbul-lib-instrument "^4.0.0" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.6.2.tgz#8185bd030348d254c6d7dd974355e6a28b21e62d" - integrity sha512-PO9t0697lNTmcEHH69mdtYiOIkkOlj9fySqfO3K1eCcdISevLAE0xY59VLLUj0SoiPiTX/JU2CYFpILydUa5Lw== +babel-plugin-jest-hoist@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.0.1.tgz#a6d10e484c93abff0f4e95f437dad26e5736ea11" + integrity sha512-sqBF0owAcCDBVEDtxqfYr2F36eSHdx7lAVGyYuOBRnKdD6gzcy0I0XrAYCZgOA3CRrLhmR+Uae9nogPzmAtOfQ== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -851,12 +836,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-26.6.2.tgz#747872b1171df032252426586881d62d31798fee" - integrity sha512-YvdtlVm9t3k777c5NPQIv6cxFFFapys25HiUmuSgHwIZhfifweR5c5Sf5nwE3MAbfu327CYSvps8Yx6ANLyleQ== +babel-preset-jest@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.0.1.tgz#7a50c75d16647c23a2cf5158d5bb9eb206b10e20" + integrity sha512-nIBIqCEpuiyhvjQs2mVNwTxQQa2xk70p9Dd/0obQGBf8FBzbnI8QhQKzLsWMN2i6q+5B0OcWDtrboBX5gmOLyA== dependencies: - babel-plugin-jest-hoist "^26.6.2" + babel-plugin-jest-hoist "^27.0.1" babel-preset-current-node-syntax "^1.0.0" balanced-match@^1.0.0: @@ -864,26 +849,6 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== -base@^0.11.1: - version "0.11.2" - resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== - dependencies: - cache-base "^1.0.1" - class-utils "^0.3.5" - component-emitter "^1.2.1" - define-property "^1.0.0" - isobject "^3.0.1" - mixin-deep "^1.2.0" - pascalcase "^0.1.1" - -bcrypt-pbkdf@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= - dependencies: - tweetnacl "^0.14.3" - brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -892,22 +857,6 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@^2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" - integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== - dependencies: - arr-flatten "^1.1.0" - array-unique "^0.3.2" - extend-shallow "^2.0.1" - fill-range "^4.0.0" - isobject "^3.0.1" - repeat-element "^1.1.2" - snapdragon "^0.8.1" - snapdragon-node "^2.0.1" - split-string "^3.0.2" - to-regex "^3.0.1" - braces@^3.0.1: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" @@ -943,32 +892,17 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== -cache-base@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== - dependencies: - collection-visit "^1.0.0" - component-emitter "^1.2.1" - get-value "^2.0.6" - has-value "^1.0.0" - isobject "^3.0.1" - set-value "^2.0.0" - to-object-path "^0.3.0" - union-value "^1.0.0" - unset-value "^1.0.0" - callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== -camelcase@^5.0.0, camelcase@^5.3.1: +camelcase@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -camelcase@^6.0.0: +camelcase@^6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== @@ -978,18 +912,6 @@ caniuse-lite@^1.0.30001219: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001228.tgz#bfdc5942cd3326fa51ee0b42fbef4da9d492a7fa" integrity sha512-QQmLOGJ3DEgokHbMSA8cj2a+geXqmnpyOFT0lhQV6P3/YOJvGDEwoedcwxEQ30gJIwIIunHIicunJ2rzK5gB2A== -capture-exit@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4" - integrity sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g== - dependencies: - rsvp "^4.8.4" - -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= - chalk@^2.0.0: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" @@ -1020,34 +942,24 @@ char-regex@^1.0.2: resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== -ci-info@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" - integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== - -cjs-module-lexer@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-0.6.0.tgz#4186fcca0eae175970aee870b9fe2d6cf8d5655f" - integrity sha512-uc2Vix1frTfnuzxxu1Hp4ktSvM3QaI4oXl4ZUqL1wjTu/BGki9TrCWoqLTg/drR1KwAEarXuRFCG2Svr1GxPFw== +ci-info@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.1.1.tgz#9a32fcefdf7bcdb6f0a7e1c0f8098ec57897b80a" + integrity sha512-kdRWLBIJwdsYJWYJFtAFFYxybguqeF91qpZaggjG5Nf8QKdizFG2hjqvaTXbxFIcYbSaD74KpAXv6BSm17DHEQ== -class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" +cjs-module-lexer@^1.0.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.1.tgz#2fd46d9906a126965aa541345c499aaa18e8cd73" + integrity sha512-jVamGdJPDeuQilKhvVn1h3knuMOZzr8QDnpk+M9aMlCaMkTDd6fBWPhiDqFvFZ07pL0liqabAiuy8SY4jGHeaw== -cliui@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" - integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== dependencies: string-width "^4.2.0" strip-ansi "^6.0.0" - wrap-ansi "^6.2.0" + wrap-ansi "^7.0.0" co@^4.6.0: version "4.6.0" @@ -1059,14 +971,6 @@ collect-v8-coverage@^1.0.0: resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59" integrity sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg== -collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= - dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" - color-convert@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" @@ -1096,18 +1000,13 @@ colorette@^1.2.2: resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94" integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w== -combined-stream@^1.0.6, combined-stream@~1.0.6: +combined-stream@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== dependencies: delayed-stream "~1.0.0" -component-emitter@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" - integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== - concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -1120,28 +1019,7 @@ convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: dependencies: safe-buffer "~5.1.1" -copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= - -core-util-is@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= - -cross-spawn@^6.0.0: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" - integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== - dependencies: - nice-try "^1.0.4" - path-key "^2.0.1" - semver "^5.5.0" - shebang-command "^1.2.0" - which "^1.2.9" - -cross-spawn@^7.0.0, cross-spawn@^7.0.2: +cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -1167,13 +1045,6 @@ cssstyle@^2.3.0: dependencies: cssom "~0.3.6" -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= - dependencies: - assert-plus "^1.0.0" - data-urls@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b" @@ -1183,34 +1054,22 @@ data-urls@^2.0.0: whatwg-mimetype "^2.3.0" whatwg-url "^8.0.0" -debug@^2.2.0, debug@^2.3.3: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: +debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: version "4.3.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== dependencies: ms "2.1.2" -decamelize@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - decimal.js@^10.2.1: version "10.2.1" resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.2.1.tgz#238ae7b0f0c793d3e3cea410108b35a2c01426a3" integrity sha512-KaL7+6Fw6i5A2XSnsbhm/6B+NuEA7TZ4vqxnd5tXz9sbKtrN9Srj8ab4vKVdK8YAqZO9P1kg45Y6YLoduPf+kw== -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= +dedent@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" + integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= deep-is@^0.1.3, deep-is@~0.1.3: version "0.1.3" @@ -1222,28 +1081,6 @@ deepmerge@^4.2.2: resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== -define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= - dependencies: - is-descriptor "^0.1.0" - -define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= - dependencies: - is-descriptor "^1.0.0" - -define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== - dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" - delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -1254,10 +1091,10 @@ detect-newline@^3.0.0: resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== -diff-sequences@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.6.2.tgz#48ba99157de1923412eed41db6b6d4aa9ca7c0b1" - integrity sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q== +diff-sequences@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.0.1.tgz#9c9801d52ed5f576ff0a20e3022a13ee6e297e7c" + integrity sha512-XPLijkfJUh/PIBnfkcSHgvD6tlYixmcMAn3osTk6jt+H0v/mgURto1XUiD9DKuGX5NDoVS6dSlA23gd9FUaCFg== doctrine@^3.0.0: version "3.0.0" @@ -1273,23 +1110,15 @@ domexception@^2.0.1: dependencies: webidl-conversions "^5.0.0" -ecc-jsbn@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= - dependencies: - jsbn "~0.1.0" - safer-buffer "^2.1.0" - electron-to-chromium@^1.3.723: version "1.3.728" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.728.tgz#dbedd6373f595ae10a13d146b66bece4c1afa5bd" integrity sha512-SHv4ziXruBpb1Nz4aTuqEHBYi/9GNCJMYIJgDEXrp/2V01nFXMNFUTli5Z85f5ivSkioLilQatqBYFB44wNJrA== -emittery@^0.7.1: - version "0.7.2" - resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.7.2.tgz#25595908e13af0f5674ab419396e2fb394cdfa82" - integrity sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ== +emittery@^0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.8.1.tgz#bb23cc86d03b30aa75a7f734819dee2e1ba70860" + integrity sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg== emoji-regex@^8.0.0: version "8.0.0" @@ -1310,13 +1139,6 @@ enquirer@^2.3.5: dependencies: ansi-colors "^4.1.1" -error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -1467,24 +1289,6 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== -exec-sh@^0.3.2: - version "0.3.6" - resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.6.tgz#ff264f9e325519a60cb5e273692943483cca63bc" - integrity sha512-nQn+hI3yp+oD0huYhKwvYI32+JFeq+XkNcD1GAo3Y/MjxsfVGmrrzrnzjWiNY6f+pUCP440fThsFh5gZrRAU/w== - -execa@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" - integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== - dependencies: - cross-spawn "^6.0.0" - get-stream "^4.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - execa@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/execa/-/execa-4.1.0.tgz#4e5491ad1572f2f17a77d388c6c857135b22847a" @@ -1500,79 +1304,37 @@ execa@^4.0.0: signal-exit "^3.0.2" strip-final-newline "^2.0.0" +execa@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-5.0.0.tgz#4029b0007998a841fbd1032e5f4de86a3c1e3376" + integrity sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ== + dependencies: + cross-spawn "^7.0.3" + get-stream "^6.0.0" + human-signals "^2.1.0" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.1" + onetime "^5.1.2" + signal-exit "^3.0.3" + strip-final-newline "^2.0.0" + exit@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= - dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -expect@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/expect/-/expect-26.6.2.tgz#c6b996bf26bf3fe18b67b2d0f51fc981ba934417" - integrity sha512-9/hlOBkQl2l/PLHJx6JjoDF6xPKcJEsUlWKb23rKE7KzeDqUZKXKNMW27KIue5JMdBV9HgmoJPcc8HtO85t9IA== - dependencies: - "@jest/types" "^26.6.2" - ansi-styles "^4.0.0" - jest-get-type "^26.3.0" - jest-matcher-utils "^26.6.2" - jest-message-util "^26.6.2" - jest-regex-util "^26.0.0" - -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= +expect@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.0.1.tgz#1290c74fef8d62f15f4c5dd1d7233001909abbfb" + integrity sha512-hjKwLeAvKUiq0Plha1dmzOH1FGEwJC9njbT993cq4PK9r58/+3NM+WDqFVGcPuRH7XTjmbIeHQBzp2faDrPhjQ== dependencies: - is-extendable "^0.1.0" - -extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= - dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" - -extend@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - -extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= - -extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= + "@jest/types" "^27.0.1" + ansi-styles "^5.0.0" + jest-get-type "^27.0.1" + jest-matcher-utils "^27.0.1" + jest-message-util "^27.0.1" + jest-regex-util "^27.0.1" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1603,16 +1365,6 @@ file-entry-cache@^6.0.1: dependencies: flat-cache "^3.0.4" -fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= - dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" - fill-range@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" @@ -1641,38 +1393,21 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.1.1.tgz#c4b489e80096d9df1dfc97c79871aea7c617c469" integrity sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA== -for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= - -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= - -form-data@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" - integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== +form-data@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" + integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== dependencies: asynckit "^0.4.0" - combined-stream "^1.0.6" + combined-stream "^1.0.8" mime-types "^2.1.12" -fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= - dependencies: - map-cache "^0.2.2" - fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= -fsevents@^2.1.2: +fsevents@^2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== @@ -1692,7 +1427,7 @@ gensync@^1.0.0-beta.2: resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== -get-caller-file@^2.0.1: +get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== @@ -1702,13 +1437,6 @@ get-package-type@^0.1.0: resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== -get-stream@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" - integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== - dependencies: - pump "^3.0.0" - get-stream@^5.0.0: version "5.2.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" @@ -1716,17 +1444,10 @@ get-stream@^5.0.0: dependencies: pump "^3.0.0" -get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= - -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= - dependencies: - assert-plus "^1.0.0" +get-stream@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" + integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== glob-parent@^5.0.0: version "5.1.2" @@ -1771,24 +1492,6 @@ graceful-fs@^4.2.4: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee" integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ== -growly@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" - integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= - -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= - -har-validator@~5.1.3: - version "5.1.5" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" - integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== - dependencies: - ajv "^6.12.3" - har-schema "^2.0.0" - has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -1799,37 +1502,6 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= - dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" - -has-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= - dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" - -has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= - -has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - has@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" @@ -1837,11 +1509,6 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" -hosted-git-info@^2.1.4: - version "2.8.9" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" - integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== - html-encoding-sniffer@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz#42a6dc4fd33f00281176e8b23759ca4e4fa185f3" @@ -1854,20 +1521,33 @@ html-escaper@^2.0.0: resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= +http-proxy-agent@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" + integrity sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg== + dependencies: + "@tootallnate/once" "1" + agent-base "6" + debug "4" + +https-proxy-agent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" + integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA== dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" + agent-base "6" + debug "4" human-signals@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== +human-signals@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" + integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== + husky@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/husky/-/husky-6.0.0.tgz#810f11869adf51604c32ea577edbc377d7f9319e" @@ -1924,36 +1604,12 @@ inherits@2: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= - dependencies: - kind-of "^3.0.2" - -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== - dependencies: - kind-of "^6.0.0" - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= - -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - -is-ci@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" - integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== +is-ci@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-3.0.0.tgz#c7e7be3c9d8eef7d0fa144390bd1e4b88dc4c994" + integrity sha512-kDXyttuLeslKAHYL/K28F2YkM3x5jvFPEw3yXbRptXydjD9rpLEz+C5K5iutY9ZiUu6AP41JdvRQwF4Iqs4ZCQ== dependencies: - ci-info "^2.0.0" + ci-info "^3.1.1" is-core-module@^2.2.0: version "2.4.0" @@ -1962,55 +1618,6 @@ is-core-module@^2.2.0: dependencies: has "^1.0.3" -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= - dependencies: - kind-of "^3.0.2" - -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== - dependencies: - kind-of "^6.0.0" - -is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== - dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" - -is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== - dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" - -is-docker@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" - integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== - -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= - -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== - dependencies: - is-plain-object "^2.0.4" - is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" @@ -2033,84 +1640,31 @@ is-glob@^4.0.0, is-glob@^4.0.1: dependencies: is-extglob "^2.1.1" -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= - dependencies: - kind-of "^3.0.2" - is-number@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== -is-plain-object@^2.0.3, is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== - dependencies: - isobject "^3.0.1" - -is-potential-custom-element-name@^1.0.0: +is-potential-custom-element-name@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== -is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= - is-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== -is-typedarray@^1.0.0, is-typedarray@~1.0.0: +is-typedarray@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= -is-windows@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== - -is-wsl@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" - integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== - dependencies: - is-docker "^2.0.0" - -isarray@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= - isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= - dependencies: - isarray "1.0.0" - -isobject@^3.0.0, isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= - -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= - istanbul-lib-coverage@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz#f5944a37c70b550b02a78a5c3b2055b280cec8ec" @@ -2152,200 +1706,225 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-26.6.2.tgz#f6198479e1cc66f22f9ae1e22acaa0b429c042d0" - integrity sha512-fDS7szLcY9sCtIip8Fjry9oGf3I2ht/QT21bAHm5Dmf0mD4X3ReNUf17y+bO6fR8WgbIZTlbyG1ak/53cbRzKQ== +jest-changed-files@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.0.1.tgz#b8356b3708cac9d05ebf6f9e0b32227b514945c8" + integrity sha512-Y/4AnqYNcUX/vVgfkmvSA3t7rcg+t8m3CsSGlU+ra8kjlVW5ZqXcBZY/NUew2Mo8M+dn0ApKl+FmGGT1JV5dVA== dependencies: - "@jest/types" "^26.6.2" - execa "^4.0.0" - throat "^5.0.0" + "@jest/types" "^27.0.1" + execa "^5.0.0" + throat "^6.0.1" -jest-cli@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-26.6.3.tgz#43117cfef24bc4cd691a174a8796a532e135e92a" - integrity sha512-GF9noBSa9t08pSyl3CY4frMrqp+aQXFGFkf5hEPbh/pIUFYWMK6ZLTfbmadxJVcJrdRoChlWQsA2VkJcDFK8hg== +jest-circus@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.0.1.tgz#3a7ec9e9fd60ef4c827197dffe2288aa19f86678" + integrity sha512-Tz3ytmrsgxWlTwSyPYb8StF9J2IMjLlbBMKAjhL2UU9/0ZpYb2JiEGjXaAhnGauQRbbpyFbSH3yj5HIbdurmwQ== dependencies: - "@jest/core" "^26.6.3" - "@jest/test-result" "^26.6.2" - "@jest/types" "^26.6.2" + "@jest/environment" "^27.0.1" + "@jest/test-result" "^27.0.1" + "@jest/types" "^27.0.1" + "@types/node" "*" + chalk "^4.0.0" + co "^4.6.0" + dedent "^0.7.0" + expect "^27.0.1" + is-generator-fn "^2.0.0" + jest-each "^27.0.1" + jest-matcher-utils "^27.0.1" + jest-message-util "^27.0.1" + jest-runner "^27.0.1" + jest-runtime "^27.0.1" + jest-snapshot "^27.0.1" + jest-util "^27.0.1" + pretty-format "^27.0.1" + stack-utils "^2.0.3" + throat "^6.0.1" + +jest-cli@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.0.1.tgz#9accc8a505438571ee423438eac526a7ee4654b5" + integrity sha512-plDsQQwpkKK1SZ5L5xqMa7v/sTwB5LTIeSJqb+cV+4EMlThdUQfg8jwMfHX8jHuUc9TPGLcdoZeBuZcGGn3Rlg== + dependencies: + "@jest/core" "^27.0.1" + "@jest/test-result" "^27.0.1" + "@jest/types" "^27.0.1" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - is-ci "^2.0.0" - jest-config "^26.6.3" - jest-util "^26.6.2" - jest-validate "^26.6.2" + jest-config "^27.0.1" + jest-util "^27.0.1" + jest-validate "^27.0.1" prompts "^2.0.1" - yargs "^15.4.1" + yargs "^16.0.3" -jest-config@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-26.6.3.tgz#64f41444eef9eb03dc51d5c53b75c8c71f645349" - integrity sha512-t5qdIj/bCj2j7NFVHb2nFB4aUdfucDn3JRKgrZnplb8nieAirAzRSHP8uDEd+qV6ygzg9Pz4YG7UTJf94LPSyg== +jest-config@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.0.1.tgz#db4f202efcbb92011f62d8f25b52c3d1bd5672d4" + integrity sha512-V8O6+CZjGF0OMq4kxVR29ztV/LQqlAAcJLw7a94RndfRXkha4U84n50yZCXiPWtAHHTmb3g1y52US6rGPxA+3w== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^26.6.3" - "@jest/types" "^26.6.2" - babel-jest "^26.6.3" + "@jest/test-sequencer" "^27.0.1" + "@jest/types" "^27.0.1" + babel-jest "^27.0.1" chalk "^4.0.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" - jest-environment-jsdom "^26.6.2" - jest-environment-node "^26.6.2" - jest-get-type "^26.3.0" - jest-jasmine2 "^26.6.3" - jest-regex-util "^26.0.0" - jest-resolve "^26.6.2" - jest-util "^26.6.2" - jest-validate "^26.6.2" - micromatch "^4.0.2" - pretty-format "^26.6.2" - -jest-diff@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-26.6.2.tgz#1aa7468b52c3a68d7d5c5fdcdfcd5e49bd164394" - integrity sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA== + is-ci "^3.0.0" + jest-circus "^27.0.1" + jest-environment-jsdom "^27.0.1" + jest-environment-node "^27.0.1" + jest-get-type "^27.0.1" + jest-jasmine2 "^27.0.1" + jest-regex-util "^27.0.1" + jest-resolve "^27.0.1" + jest-util "^27.0.1" + jest-validate "^27.0.1" + micromatch "^4.0.4" + pretty-format "^27.0.1" + +jest-diff@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.0.1.tgz#021beb29fe9f07e83c809a4f7a1ce807b229c4ab" + integrity sha512-DQ3OgfJgoGWVTYo4qnYW/Jg5mpYFS2QW9BLxA8bs12ZRN1K8QPZtWeYvUPohQFs3CHX3JLTndGg3jyxdL5THFQ== dependencies: chalk "^4.0.0" - diff-sequences "^26.6.2" - jest-get-type "^26.3.0" - pretty-format "^26.6.2" + diff-sequences "^27.0.1" + jest-get-type "^27.0.1" + pretty-format "^27.0.1" -jest-docblock@^26.0.0: - version "26.0.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-26.0.0.tgz#3e2fa20899fc928cb13bd0ff68bd3711a36889b5" - integrity sha512-RDZ4Iz3QbtRWycd8bUEPxQsTlYazfYn/h5R65Fc6gOfwozFhoImx+affzky/FFBuqISPTqjXomoIGJVKBWoo0w== +jest-docblock@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.0.1.tgz#bd9752819b49fa4fab1a50b73eb58c653b962e8b" + integrity sha512-TA4+21s3oebURc7VgFV4r7ltdIJ5rtBH1E3Tbovcg7AV+oLfD5DcJ2V2vJ5zFA9sL5CFd/d2D6IpsAeSheEdrA== dependencies: detect-newline "^3.0.0" -jest-each@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-26.6.2.tgz#02526438a77a67401c8a6382dfe5999952c167cb" - integrity sha512-Mer/f0KaATbjl8MCJ+0GEpNdqmnVmDYqCTJYTvoo7rqmRiDllmp2AYN+06F93nXcY3ur9ShIjS+CO/uD+BbH4A== +jest-each@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.0.1.tgz#37fa20b7d809b29d4349d8eb7d01f17c2feeab10" + integrity sha512-uJTK/aZ05HsdKkfXucAT5+/1DIURnTRv34OSxn1HWHrD+xu9eDX5Xgds09QSvg/mU01VS5upuHTDKG3W+r0rQA== dependencies: - "@jest/types" "^26.6.2" + "@jest/types" "^27.0.1" chalk "^4.0.0" - jest-get-type "^26.3.0" - jest-util "^26.6.2" - pretty-format "^26.6.2" - -jest-environment-jsdom@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-26.6.2.tgz#78d09fe9cf019a357009b9b7e1f101d23bd1da3e" - integrity sha512-jgPqCruTlt3Kwqg5/WVFyHIOJHsiAvhcp2qiR2QQstuG9yWox5+iHpU3ZrcBxW14T4fe5Z68jAfLRh7joCSP2Q== - dependencies: - "@jest/environment" "^26.6.2" - "@jest/fake-timers" "^26.6.2" - "@jest/types" "^26.6.2" + jest-get-type "^27.0.1" + jest-util "^27.0.1" + pretty-format "^27.0.1" + +jest-environment-jsdom@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.0.1.tgz#12b0ed587fb53e0a581a5101bb209aef09da2310" + integrity sha512-lesU8T9zkjgLaLpUFmFDgchu6/2OCoXm52nN6UumR063Hb+1TJdI7ihgM86+G01Ay86Lyr+K/FAR6yIIOviH3Q== + dependencies: + "@jest/environment" "^27.0.1" + "@jest/fake-timers" "^27.0.1" + "@jest/types" "^27.0.1" "@types/node" "*" - jest-mock "^26.6.2" - jest-util "^26.6.2" - jsdom "^16.4.0" - -jest-environment-node@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-26.6.2.tgz#824e4c7fb4944646356f11ac75b229b0035f2b0c" - integrity sha512-zhtMio3Exty18dy8ee8eJ9kjnRyZC1N4C1Nt/VShN1apyXc8rWGtJ9lI7vqiWcyyXS4BVSEn9lxAM2D+07/Tag== - dependencies: - "@jest/environment" "^26.6.2" - "@jest/fake-timers" "^26.6.2" - "@jest/types" "^26.6.2" + jest-mock "^27.0.1" + jest-util "^27.0.1" + jsdom "^16.6.0" + +jest-environment-node@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.0.1.tgz#7d7df7ae191477a823ffb4fcc0772b4c23ec5c87" + integrity sha512-/p94lo0hx+hbKUw1opnRFUPPsjncRBEUU+2Dh7BuxX8Nr4rRiTivLYgXzo79FhaeMYV0uiV5WAbHBq6xC11JJg== + dependencies: + "@jest/environment" "^27.0.1" + "@jest/fake-timers" "^27.0.1" + "@jest/types" "^27.0.1" "@types/node" "*" - jest-mock "^26.6.2" - jest-util "^26.6.2" + jest-mock "^27.0.1" + jest-util "^27.0.1" -jest-get-type@^26.3.0: - version "26.3.0" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-26.3.0.tgz#e97dc3c3f53c2b406ca7afaed4493b1d099199e0" - integrity sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig== +jest-get-type@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.1.tgz#34951e2b08c8801eb28559d7eb732b04bbcf7815" + integrity sha512-9Tggo9zZbu0sHKebiAijyt1NM77Z0uO4tuWOxUCujAiSeXv30Vb5D4xVF4UR4YWNapcftj+PbByU54lKD7/xMg== -jest-haste-map@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-26.6.2.tgz#dd7e60fe7dc0e9f911a23d79c5ff7fb5c2cafeaa" - integrity sha512-easWIJXIw71B2RdR8kgqpjQrbMRWQBgiBwXYEhtGUTaX+doCjBheluShdDMeR8IMfJiTqH4+zfhtg29apJf/8w== +jest-haste-map@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.0.1.tgz#653c4ba59309a86499ad7bf663176e7f97478191" + integrity sha512-ioCuobr4z90H1Pz8+apz2vfz63387apzAoawm/9IIOndarDfRkjLURdLOe//AI5jUQmjVRg+WiL92339kqlCmA== dependencies: - "@jest/types" "^26.6.2" + "@jest/types" "^27.0.1" "@types/graceful-fs" "^4.1.2" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.4" - jest-regex-util "^26.0.0" - jest-serializer "^26.6.2" - jest-util "^26.6.2" - jest-worker "^26.6.2" - micromatch "^4.0.2" - sane "^4.0.3" + jest-regex-util "^27.0.1" + jest-serializer "^27.0.1" + jest-util "^27.0.1" + jest-worker "^27.0.1" + micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: - fsevents "^2.1.2" + fsevents "^2.3.2" -jest-jasmine2@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-26.6.3.tgz#adc3cf915deacb5212c93b9f3547cd12958f2edd" - integrity sha512-kPKUrQtc8aYwBV7CqBg5pu+tmYXlvFlSFYn18ev4gPFtrRzB15N2gW/Roew3187q2w2eHuu0MU9TJz6w0/nPEg== +jest-jasmine2@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.0.1.tgz#d975bfe072f3ac3596c0be5fc0a1215fd2e91e77" + integrity sha512-o8Ist0o970QDDm/R2o9UDbvNxq8A0++FTFQ0z9OnieJwS1nDH6H7WBDYAGPTdmnla7kbW41oLFPvhmjJE4mekg== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^26.6.2" - "@jest/source-map" "^26.6.2" - "@jest/test-result" "^26.6.2" - "@jest/types" "^26.6.2" + "@jest/environment" "^27.0.1" + "@jest/source-map" "^27.0.1" + "@jest/test-result" "^27.0.1" + "@jest/types" "^27.0.1" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^26.6.2" + expect "^27.0.1" is-generator-fn "^2.0.0" - jest-each "^26.6.2" - jest-matcher-utils "^26.6.2" - jest-message-util "^26.6.2" - jest-runtime "^26.6.3" - jest-snapshot "^26.6.2" - jest-util "^26.6.2" - pretty-format "^26.6.2" - throat "^5.0.0" - -jest-leak-detector@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-26.6.2.tgz#7717cf118b92238f2eba65054c8a0c9c653a91af" - integrity sha512-i4xlXpsVSMeKvg2cEKdfhh0H39qlJlP5Ex1yQxwF9ubahboQYMgTtz5oML35AVA3B4Eu+YsmwaiKVev9KCvLxg== - dependencies: - jest-get-type "^26.3.0" - pretty-format "^26.6.2" - -jest-matcher-utils@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-26.6.2.tgz#8e6fd6e863c8b2d31ac6472eeb237bc595e53e7a" - integrity sha512-llnc8vQgYcNqDrqRDXWwMr9i7rS5XFiCwvh6DTP7Jqa2mqpcCBBlpCbn+trkG0KNhPu/h8rzyBkriOtBstvWhw== + jest-each "^27.0.1" + jest-matcher-utils "^27.0.1" + jest-message-util "^27.0.1" + jest-runtime "^27.0.1" + jest-snapshot "^27.0.1" + jest-util "^27.0.1" + pretty-format "^27.0.1" + throat "^6.0.1" + +jest-leak-detector@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.0.1.tgz#eedeaee7c0ab553db4d8908f74967329624342b9" + integrity sha512-SQ/lRhfmnV3UuiaKIjwNXCaW2yh1rTMAL4n4Cl4I4gU0X2LoIc6Ogxe4UKM/J6Ld2uzc4gDGVYc5lSdpf6WjYw== + dependencies: + jest-get-type "^27.0.1" + pretty-format "^27.0.1" + +jest-matcher-utils@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.0.1.tgz#7a01330786e370f152b0b0159f827293b6322909" + integrity sha512-NauNU+olKhPzLlsRnTOYFGk/MK5QFYl9ZzkrtfsY4eCq4SB3Bcl03UL44VdnlN5S/uFn4H2jwvRY1y6nSDTX3g== dependencies: chalk "^4.0.0" - jest-diff "^26.6.2" - jest-get-type "^26.3.0" - pretty-format "^26.6.2" + jest-diff "^27.0.1" + jest-get-type "^27.0.1" + pretty-format "^27.0.1" -jest-message-util@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-26.6.2.tgz#58173744ad6fc0506b5d21150b9be56ef001ca07" - integrity sha512-rGiLePzQ3AzwUshu2+Rn+UMFk0pHN58sOG+IaJbk5Jxuqo3NYO1U2/MIR4S1sKgsoYSXSzdtSa0TgrmtUwEbmA== +jest-message-util@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.0.1.tgz#382b7c55d8e0b1aba9eeb41d3cfdd34e451210ed" + integrity sha512-w8BfON2GwWORkos8BsxcwwQrLkV2s1ENxSRXK43+6yuquDE2hVxES/jrFqOArpP1ETVqqMmktU6iGkG8ncVzeA== dependencies: - "@babel/code-frame" "^7.0.0" - "@jest/types" "^26.6.2" + "@babel/code-frame" "^7.12.13" + "@jest/types" "^27.0.1" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.4" - micromatch "^4.0.2" - pretty-format "^26.6.2" + micromatch "^4.0.4" + pretty-format "^27.0.1" slash "^3.0.0" - stack-utils "^2.0.2" + stack-utils "^2.0.3" -jest-mock@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-26.6.2.tgz#d6cb712b041ed47fe0d9b6fc3474bc6543feb302" - integrity sha512-YyFjePHHp1LzpzYcmgqkJ0nm0gg/lJx2aZFzFy1S6eUqNjXsOqTK10zNRff2dNfssgokjkG65OlWNcIlgd3zew== +jest-mock@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.0.1.tgz#8394e297bc3dfed980961622cb51fd042b4acf5a" + integrity sha512-fXCSZQDT5hUcAUy8OBnB018x7JFOMQnz4XfpSKEbfpWzL6o5qaLRhgf2Qg2NPuVKmC/fgOf33Edj8wjF4I24CQ== dependencies: - "@jest/types" "^26.6.2" + "@jest/types" "^27.0.1" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -2353,177 +1932,185 @@ jest-pnp-resolver@^1.2.2: resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== -jest-regex-util@^26.0.0: - version "26.0.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-26.0.0.tgz#d25e7184b36e39fd466c3bc41be0971e821fee28" - integrity sha512-Gv3ZIs/nA48/Zvjrl34bf+oD76JHiGDUxNOVgUjh3j890sblXryjY4rss71fPtD/njchl6PSE2hIhvyWa1eT0A== +jest-regex-util@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.1.tgz#69d4b1bf5b690faa3490113c47486ed85dd45b68" + integrity sha512-6nY6QVcpTgEKQy1L41P4pr3aOddneK17kn3HJw6SdwGiKfgCGTvH02hVXL0GU8GEKtPH83eD2DIDgxHXOxVohQ== -jest-resolve-dependencies@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-26.6.3.tgz#6680859ee5d22ee5dcd961fe4871f59f4c784fb6" - integrity sha512-pVwUjJkxbhe4RY8QEWzN3vns2kqyuldKpxlxJlzEYfKSvY6/bMvxoFrYYzUO1Gx28yKWN37qyV7rIoIp2h8fTg== +jest-resolve-dependencies@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.0.1.tgz#3dcaeb277e0253747706467e8f05e1e78a1d534d" + integrity sha512-ly1x5mEf21f3IVWbUNwIz/ePLtv4QdhYuQIVSVDqxx7yzAwhhdu0DJo7UNiEYKQY7Im48wfbNdOUpo7euFUXBQ== dependencies: - "@jest/types" "^26.6.2" - jest-regex-util "^26.0.0" - jest-snapshot "^26.6.2" + "@jest/types" "^27.0.1" + jest-regex-util "^27.0.1" + jest-snapshot "^27.0.1" -jest-resolve@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-26.6.2.tgz#a3ab1517217f469b504f1b56603c5bb541fbb507" - integrity sha512-sOxsZOq25mT1wRsfHcbtkInS+Ek7Q8jCHUB0ZUTP0tc/c41QHriU/NunqMfCUWsL4H3MHpvQD4QR9kSYhS7UvQ== +jest-resolve@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.0.1.tgz#4e1b76f61c7e2213d2fbd37342800864309de538" + integrity sha512-Q7QQ0OZ7z6D5Dul0MrsexlKalU8ZwexBfHLSu1qYPgphvUm6WO1b/xUnipU3e+uW1riDzMcJeJVYbdQ37hBHeg== dependencies: - "@jest/types" "^26.6.2" + "@jest/types" "^27.0.1" chalk "^4.0.0" + escalade "^3.1.1" graceful-fs "^4.2.4" jest-pnp-resolver "^1.2.2" - jest-util "^26.6.2" - read-pkg-up "^7.0.1" - resolve "^1.18.1" + jest-util "^27.0.1" + resolve "^1.20.0" slash "^3.0.0" -jest-runner@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-26.6.3.tgz#2d1fed3d46e10f233fd1dbd3bfaa3fe8924be159" - integrity sha512-atgKpRHnaA2OvByG/HpGA4g6CSPS/1LK0jK3gATJAoptC1ojltpmVlYC3TYgdmGp+GLuhzpH30Gvs36szSL2JQ== +jest-runner@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.0.1.tgz#52137173fbf318b7b1f034b81200c2846758f681" + integrity sha512-DUNizlD2D7J80G3VOrwfbtb7KYxiftMng82HNcKwTW0W3AwwNuBeq+1exoCnLO7Mxh7NP+k/1XQBlzLpjr/CnA== dependencies: - "@jest/console" "^26.6.2" - "@jest/environment" "^26.6.2" - "@jest/test-result" "^26.6.2" - "@jest/types" "^26.6.2" + "@jest/console" "^27.0.1" + "@jest/environment" "^27.0.1" + "@jest/test-result" "^27.0.1" + "@jest/transform" "^27.0.1" + "@jest/types" "^27.0.1" "@types/node" "*" chalk "^4.0.0" - emittery "^0.7.1" + emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" - jest-config "^26.6.3" - jest-docblock "^26.0.0" - jest-haste-map "^26.6.2" - jest-leak-detector "^26.6.2" - jest-message-util "^26.6.2" - jest-resolve "^26.6.2" - jest-runtime "^26.6.3" - jest-util "^26.6.2" - jest-worker "^26.6.2" + jest-config "^27.0.1" + jest-docblock "^27.0.1" + jest-haste-map "^27.0.1" + jest-leak-detector "^27.0.1" + jest-message-util "^27.0.1" + jest-resolve "^27.0.1" + jest-runtime "^27.0.1" + jest-util "^27.0.1" + jest-worker "^27.0.1" source-map-support "^0.5.6" - throat "^5.0.0" - -jest-runtime@^26.6.3: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-26.6.3.tgz#4f64efbcfac398331b74b4b3c82d27d401b8fa2b" - integrity sha512-lrzyR3N8sacTAMeonbqpnSka1dHNux2uk0qqDXVkMv2c/A3wYnvQ4EXuI013Y6+gSKSCxdaczvf4HF0mVXHRdw== - dependencies: - "@jest/console" "^26.6.2" - "@jest/environment" "^26.6.2" - "@jest/fake-timers" "^26.6.2" - "@jest/globals" "^26.6.2" - "@jest/source-map" "^26.6.2" - "@jest/test-result" "^26.6.2" - "@jest/transform" "^26.6.2" - "@jest/types" "^26.6.2" - "@types/yargs" "^15.0.0" + throat "^6.0.1" + +jest-runtime@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.0.1.tgz#b71bb8ea189c50525aebb4aba6c524633ca27659" + integrity sha512-ImcrbQtpCUp8X9Rm4ky3j1GG9cqIKZJvXGZyB5cHEapGPTmg7wvvNooLmKragEe61/p/bhw1qO68Y0/9BSsBBg== + dependencies: + "@jest/console" "^27.0.1" + "@jest/environment" "^27.0.1" + "@jest/fake-timers" "^27.0.1" + "@jest/globals" "^27.0.1" + "@jest/source-map" "^27.0.1" + "@jest/test-result" "^27.0.1" + "@jest/transform" "^27.0.1" + "@jest/types" "^27.0.1" + "@types/yargs" "^16.0.0" chalk "^4.0.0" - cjs-module-lexer "^0.6.0" + cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-config "^26.6.3" - jest-haste-map "^26.6.2" - jest-message-util "^26.6.2" - jest-mock "^26.6.2" - jest-regex-util "^26.0.0" - jest-resolve "^26.6.2" - jest-snapshot "^26.6.2" - jest-util "^26.6.2" - jest-validate "^26.6.2" + jest-haste-map "^27.0.1" + jest-message-util "^27.0.1" + jest-mock "^27.0.1" + jest-regex-util "^27.0.1" + jest-resolve "^27.0.1" + jest-snapshot "^27.0.1" + jest-util "^27.0.1" + jest-validate "^27.0.1" slash "^3.0.0" strip-bom "^4.0.0" - yargs "^15.4.1" + yargs "^16.0.3" -jest-serializer@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-26.6.2.tgz#d139aafd46957d3a448f3a6cdabe2919ba0742d1" - integrity sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g== +jest-serializer@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.0.1.tgz#2464d04dcc33fb71dc80b7c82e3c5e8a08cb1020" + integrity sha512-svy//5IH6bfQvAbkAEg1s7xhhgHTtXu0li0I2fdKHDsLP2P2MOiscPQIENQep8oU2g2B3jqLyxKKzotZOz4CwQ== dependencies: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-26.6.2.tgz#f3b0af1acb223316850bd14e1beea9837fb39c84" - integrity sha512-OLhxz05EzUtsAmOMzuupt1lHYXCNib0ECyuZ/PZOx9TrZcC8vL0x+DUG3TL+GLX3yHG45e6YGjIm0XwDc3q3og== +jest-snapshot@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.0.1.tgz#01a82d901f260604908373795c9255b032d2a07a" + integrity sha512-HgKmSebDB3rswugREeh+nKrxJEVZE12K7lZ2MuwfFZT6YmiH0TlofsL2YmiLsCsG5KH5ZcLYYpF5bDrvtVx/Xg== dependencies: + "@babel/core" "^7.7.2" + "@babel/generator" "^7.7.2" + "@babel/parser" "^7.7.2" + "@babel/plugin-syntax-typescript" "^7.7.2" + "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/types" "^26.6.2" + "@jest/transform" "^27.0.1" + "@jest/types" "^27.0.1" "@types/babel__traverse" "^7.0.4" - "@types/prettier" "^2.0.0" + "@types/prettier" "^2.1.5" + babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^26.6.2" + expect "^27.0.1" graceful-fs "^4.2.4" - jest-diff "^26.6.2" - jest-get-type "^26.3.0" - jest-haste-map "^26.6.2" - jest-matcher-utils "^26.6.2" - jest-message-util "^26.6.2" - jest-resolve "^26.6.2" + jest-diff "^27.0.1" + jest-get-type "^27.0.1" + jest-haste-map "^27.0.1" + jest-matcher-utils "^27.0.1" + jest-message-util "^27.0.1" + jest-resolve "^27.0.1" + jest-util "^27.0.1" natural-compare "^1.4.0" - pretty-format "^26.6.2" + pretty-format "^27.0.1" semver "^7.3.2" -jest-util@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-26.6.2.tgz#907535dbe4d5a6cb4c47ac9b926f6af29576cbc1" - integrity sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q== +jest-util@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.0.1.tgz#324ed9879d129c1e64f9169a739d6d50d7928769" + integrity sha512-lEw3waSmEOO4ZkwkUlFSvg4es1+8+LIkSGxp/kF60K0+vMR3Dv3O2HMZhcln9NHqSQzpVbsDT6OeMzUPW7DfRg== dependencies: - "@jest/types" "^26.6.2" + "@jest/types" "^27.0.1" "@types/node" "*" chalk "^4.0.0" graceful-fs "^4.2.4" - is-ci "^2.0.0" - micromatch "^4.0.2" + is-ci "^3.0.0" + picomatch "^2.2.3" -jest-validate@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-26.6.2.tgz#23d380971587150467342911c3d7b4ac57ab20ec" - integrity sha512-NEYZ9Aeyj0i5rQqbq+tpIOom0YS1u2MVu6+euBsvpgIme+FOfRmoC4R5p0JiAUpaFvFy24xgrpMknarR/93XjQ== +jest-validate@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.0.1.tgz#8e43428674b6097f8ee3abe42c4248a4826cd008" + integrity sha512-zvmPRcfTkqTZuHveIKAI2nbkUc3SDXjWVJULknPLGF5bdxOGSeGZg7f/Uw0MUVOkCOaspcHnsPCgZG0pqmg71g== dependencies: - "@jest/types" "^26.6.2" - camelcase "^6.0.0" + "@jest/types" "^27.0.1" + camelcase "^6.2.0" chalk "^4.0.0" - jest-get-type "^26.3.0" + jest-get-type "^27.0.1" leven "^3.1.0" - pretty-format "^26.6.2" + pretty-format "^27.0.1" -jest-watcher@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-26.6.2.tgz#a5b683b8f9d68dbcb1d7dae32172d2cca0592975" - integrity sha512-WKJob0P/Em2csiVthsI68p6aGKTIcsfjH9Gsx1f0A3Italz43e3ho0geSAVsmj09RWOELP1AZ/DXyJgOgDKxXQ== +jest-watcher@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.0.1.tgz#61b9403d7b498161f6aa6124602363525ac3efc2" + integrity sha512-Chp9c02BN0IgEbtGreyAhGqIsOrn9a0XnzbuXOxdW1+cW0Tjh12hMzHDIdLFHpYP/TqaMTmPHaJ5KWvpCCrNFw== dependencies: - "@jest/test-result" "^26.6.2" - "@jest/types" "^26.6.2" + "@jest/test-result" "^27.0.1" + "@jest/types" "^27.0.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^26.6.2" + jest-util "^27.0.1" string-length "^4.0.1" -jest-worker@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed" - integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ== +jest-worker@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.0.1.tgz#b255fcbb40fb467295010c628474b1185cab4f9e" + integrity sha512-NhHqClI3owOjmS8dBhQMKHZ2rrT0sBTpqGitp9nMX5AAjVXd+15o4v96uBEMhoywaLKN+5opcKBlXwAoADZolA== dependencies: "@types/node" "*" merge-stream "^2.0.0" - supports-color "^7.0.0" + supports-color "^8.0.0" -jest@^26.0.0: - version "26.6.3" - resolved "https://registry.yarnpkg.com/jest/-/jest-26.6.3.tgz#40e8fdbe48f00dfa1f0ce8121ca74b88ac9148ef" - integrity sha512-lGS5PXGAzR4RF7V5+XObhqz2KZIDUA1yD0DG6pBVmy10eh0ZIXQImRuzocsI/N2XZ1GrLFwTS27In2i2jlpq1Q== +jest@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.0.1.tgz#d3822f0904f3bbe884bea393cede2be2aa290d0e" + integrity sha512-lFEoUdXjbGAIxk/gZhcv98xOaH1hjqG5R/PQHs5GBfIK5iL3tnXCjHQf4HQLVZZ2rcXML3oeVg9+XrRZbooBdQ== dependencies: - "@jest/core" "^26.6.3" + "@jest/core" "^27.0.1" import-local "^3.0.2" - jest-cli "^26.6.3" + jest-cli "^27.0.1" js-tokens@^4.0.0: version "4.0.0" @@ -2538,18 +2125,13 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= - -jsdom@^16.4.0: - version "16.5.3" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.5.3.tgz#13a755b3950eb938b4482c407238ddf16f0d2136" - integrity sha512-Qj1H+PEvUsOtdPJ056ewXM4UJPCi4hhLA8wpiz9F2YvsRBhuFsXxtrIFAgGBDynQA9isAMGE91PfUYbdMPXuTA== +jsdom@^16.6.0: + version "16.6.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.6.0.tgz#f79b3786682065492a3da6a60a4695da983805ac" + integrity sha512-Ty1vmF4NHJkolaEmdjtxTfSfkdb8Ywarwf63f+F8/mDD1uLSSWDxDuMiZxiPhwunLrn9LOSVItWj4bLYsLN3Dg== dependencies: abab "^2.0.5" - acorn "^8.1.0" + acorn "^8.2.4" acorn-globals "^6.0.0" cssom "^0.4.4" cssstyle "^2.3.0" @@ -2557,12 +2139,13 @@ jsdom@^16.4.0: decimal.js "^10.2.1" domexception "^2.0.1" escodegen "^2.0.0" + form-data "^3.0.0" html-encoding-sniffer "^2.0.1" - is-potential-custom-element-name "^1.0.0" + http-proxy-agent "^4.0.1" + https-proxy-agent "^5.0.0" + is-potential-custom-element-name "^1.0.1" nwsapi "^2.2.0" parse5 "6.0.1" - request "^2.88.2" - request-promise-native "^1.0.9" saxes "^5.0.1" symbol-tree "^3.2.4" tough-cookie "^4.0.0" @@ -2572,7 +2155,7 @@ jsdom@^16.4.0: whatwg-encoding "^1.0.5" whatwg-mimetype "^2.3.0" whatwg-url "^8.5.0" - ws "^7.4.4" + ws "^7.4.5" xml-name-validator "^3.0.0" jsesc@^2.5.1: @@ -2580,11 +2163,6 @@ jsesc@^2.5.1: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== -json-parse-even-better-errors@^2.3.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" - integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== - json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -2595,21 +2173,11 @@ json-schema-traverse@^1.0.0: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= - json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= -json-stringify-safe@~5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= - json5@^2.1.2: version "2.2.0" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" @@ -2617,40 +2185,6 @@ json5@^2.1.2: dependencies: minimist "^1.2.5" -jsprim@^1.2.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" - integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.2.3" - verror "1.10.0" - -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= - dependencies: - is-buffer "^1.1.5" - -kind-of@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== - -kind-of@^6.0.0, kind-of@^6.0.2: - version "6.0.3" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" - integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== - kleur@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" @@ -2677,11 +2211,6 @@ levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -lines-and-columns@^1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" - integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= - locate-path@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" @@ -2704,7 +2233,7 @@ lodash.truncate@^4.4.2: resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= -lodash@^4.17.19, lodash@^4.7.0: +lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -2730,43 +2259,12 @@ makeerror@1.0.x: dependencies: tmpl "1.0.x" -map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= - -map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= - dependencies: - object-visit "^1.0.0" - merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -micromatch@^3.1.4: - version "3.1.10" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.2" - -micromatch@^4.0.2: +micromatch@^4.0.4: version "4.0.4" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== @@ -2779,7 +2277,7 @@ mime-db@1.47.0: resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.47.0.tgz#8cb313e59965d3c05cfbf898915a267af46a335c" integrity sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw== -mime-types@^2.1.12, mime-types@~2.1.19: +mime-types@^2.1.12: version "2.1.30" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.30.tgz#6e7be8b4c479825f85ed6326695db73f9305d62d" integrity sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg== @@ -2798,29 +2296,16 @@ minimatch@^3.0.4: dependencies: brace-expansion "^1.1.7" -minimist@^1.1.1, minimist@^1.2.0, minimist@^1.2.5: +minimist@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== -mixin-deep@^1.2.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" - integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" - mri@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/mri/-/mri-1.1.6.tgz#49952e1044db21dbf90f6cd92bc9c9a777d415a6" integrity sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ== -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" @@ -2837,33 +2322,11 @@ multimatch@^4.0.0: arrify "^2.0.1" minimatch "^3.0.4" -nanomatch@^1.2.9: - version "1.2.13" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= -nice-try@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" - integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== - node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" @@ -2874,53 +2337,17 @@ node-modules-regexp@^1.0.0: resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= -node-notifier@^8.0.0: - version "8.0.2" - resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-8.0.2.tgz#f3167a38ef0d2c8a866a83e318c1ba0efeb702c5" - integrity sha512-oJP/9NAdd9+x2Q+rfphB2RJCHjod70RcRLjosiPMMu5gjIfwVnOUGq2nbTjTUbmy0DJ/tFIVT30+Qe3nzl4TJg== - dependencies: - growly "^1.3.0" - is-wsl "^2.2.0" - semver "^7.3.2" - shellwords "^0.1.1" - uuid "^8.3.0" - which "^2.0.2" - node-releases@^1.1.71: version "1.1.72" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.72.tgz#14802ab6b1039a79a0c7d662b610a5bbd76eacbe" integrity sha512-LLUo+PpH3dU6XizX3iVoubUNheF/owjXCZZ5yACDxNnPtgFuludV1ZL3ayK1kVep42Rmm0+R9/Y60NQbZ2bifw== -normalize-package-data@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" - integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== - dependencies: - hosted-git-info "^2.1.4" - resolve "^1.10.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -normalize-path@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= - dependencies: - remove-trailing-separator "^1.0.1" - normalize-path@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== -npm-run-path@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" - integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= - dependencies: - path-key "^2.0.0" - -npm-run-path@^4.0.0: +npm-run-path@^4.0.0, npm-run-path@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== @@ -2932,34 +2359,6 @@ nwsapi@^2.2.0: resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7" integrity sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ== -oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== - -object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" - -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= - dependencies: - isobject "^3.0.0" - -object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= - dependencies: - isobject "^3.0.1" - once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -2967,7 +2366,7 @@ once@^1.3.0, once@^1.3.1, once@^1.4.0: dependencies: wrappy "1" -onetime@^5.1.0: +onetime@^5.1.0, onetime@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== @@ -3003,11 +2402,6 @@ p-each-series@^2.1.0: resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-2.2.0.tgz#105ab0357ce72b202a8a8b94933672657b5e2a9a" integrity sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA== -p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= - p-limit@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" @@ -3034,26 +2428,11 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" -parse-json@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" - integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== - dependencies: - "@babel/code-frame" "^7.0.0" - error-ex "^1.3.1" - json-parse-even-better-errors "^2.3.0" - lines-and-columns "^1.1.6" - parse5@6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== -pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= - path-exists@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" @@ -3064,11 +2443,6 @@ path-is-absolute@^1.0.0: resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= -path-key@^2.0.0, path-key@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= - path-key@^3.0.0, path-key@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" @@ -3079,11 +2453,6 @@ path-parse@^1.0.6: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== -performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= - picomatch@^2.0.4, picomatch@^2.2.3: version "2.2.3" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.3.tgz#465547f359ccc206d3c48e46a1bcb89bf7ee619d" @@ -3103,11 +2472,6 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= - prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" @@ -3123,14 +2487,14 @@ prettier@>=1.10: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18" integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w== -pretty-format@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.6.2.tgz#e35c2705f14cb7fe2fe94fa078345b444120fc93" - integrity sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg== +pretty-format@^27.0.1: + version "27.0.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.0.1.tgz#c4094621dfbd3e8ab751964d1cf01edc6f88474d" + integrity sha512-qE+0J6c/gd+R6XTcQgPJMc5hMJNsxzSF5p8iZSbMZ7GQzYGlSLNkh2P80Wa2dbF4gEVUsJEgcrBY+1L2/j265w== dependencies: - "@jest/types" "^26.6.2" + "@jest/types" "^27.0.1" ansi-regex "^5.0.0" - ansi-styles "^4.0.0" + ansi-styles "^5.0.0" react-is "^17.0.1" pretty-quick@^3.1.0: @@ -3158,7 +2522,7 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" -psl@^1.1.28, psl@^1.1.33: +psl@^1.1.33: version "1.8.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== @@ -3176,105 +2540,16 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -qs@~6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== - react-is@^17.0.1: version "17.0.2" resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== -read-pkg-up@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" - integrity sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg== - dependencies: - find-up "^4.1.0" - read-pkg "^5.2.0" - type-fest "^0.8.1" - -read-pkg@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" - integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== - dependencies: - "@types/normalize-package-data" "^2.4.0" - normalize-package-data "^2.5.0" - parse-json "^5.0.0" - type-fest "^0.6.0" - -regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== - dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" - regexpp@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2" integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q== -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= - -repeat-element@^1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.4.tgz#be681520847ab58c7568ac75fbfad28ed42d39e9" - integrity sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ== - -repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= - -request-promise-core@1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.4.tgz#3eedd4223208d419867b78ce815167d10593a22f" - integrity sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw== - dependencies: - lodash "^4.17.19" - -request-promise-native@^1.0.9: - version "1.0.9" - resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.9.tgz#e407120526a5efdc9a39b28a5679bf47b9d9dc28" - integrity sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g== - dependencies: - request-promise-core "1.1.4" - stealthy-require "^1.1.1" - tough-cookie "^2.3.3" - -request@^2.88.2: - version "2.88.2" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" - integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.3" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.5.0" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -3285,11 +2560,6 @@ require-from-string@^2.0.2: resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== -require-main-filename@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" - integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== - resolve-cwd@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" @@ -3307,12 +2577,7 @@ resolve-from@^5.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== -resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= - -resolve@^1.10.0, resolve@^1.18.1: +resolve@^1.20.0: version "1.20.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== @@ -3320,11 +2585,6 @@ resolve@^1.10.0, resolve@^1.18.1: is-core-module "^2.2.0" path-parse "^1.0.6" -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== - rimraf@^3.0.0, rimraf@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" @@ -3332,48 +2592,16 @@ rimraf@^3.0.0, rimraf@^3.0.2: dependencies: glob "^7.1.3" -rsvp@^4.8.4: - version "4.8.5" - resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" - integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA== - -safe-buffer@^5.0.1, safe-buffer@^5.1.2: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= - dependencies: - ret "~0.1.10" - -"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: +"safer-buffer@>= 2.1.2 < 3": version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -sane@^4.0.3: - version "4.1.0" - resolved "https://registry.yarnpkg.com/sane/-/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded" - integrity sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA== - dependencies: - "@cnakazawa/watch" "^1.0.3" - anymatch "^2.0.0" - capture-exit "^2.0.0" - exec-sh "^0.3.2" - execa "^1.0.0" - fb-watchman "^2.0.0" - micromatch "^3.1.4" - minimist "^1.1.1" - walker "~1.0.5" - saxes@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/saxes/-/saxes-5.0.1.tgz#eebab953fa3b7608dbe94e5dadb15c888fa6696d" @@ -3381,11 +2609,6 @@ saxes@^5.0.1: dependencies: xmlchars "^2.2.0" -"semver@2 || 3 || 4 || 5", semver@^5.5.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - semver@^6.0.0, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" @@ -3398,28 +2621,6 @@ semver@^7.2.1, semver@^7.3.2: dependencies: lru-cache "^6.0.0" -set-blocking@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= - -set-value@^2.0.0, set-value@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" - integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" - -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= - dependencies: - shebang-regex "^1.0.0" - shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -3427,22 +2628,12 @@ shebang-command@^2.0.0: dependencies: shebang-regex "^3.0.0" -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= - shebang-regex@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== -shellwords@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" - integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== - -signal-exit@^3.0.0, signal-exit@^3.0.2: +signal-exit@^3.0.2, signal-exit@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== @@ -3466,47 +2657,6 @@ slice-ansi@^4.0.0: astral-regex "^2.0.0" is-fullwidth-code-point "^3.0.0" -snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== - dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - -snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== - dependencies: - kind-of "^3.2.0" - -snapdragon@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^3.1.0" - -source-map-resolve@^0.5.0: - version "0.5.3" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" - integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== - dependencies: - atob "^2.1.2" - decode-uri-component "^0.2.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - source-map-support@^0.5.6: version "0.5.19" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" @@ -3515,12 +2665,7 @@ source-map-support@^0.5.6: buffer-from "^1.0.0" source-map "^0.6.0" -source-map-url@^0.4.0: - version "0.4.1" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.1.tgz#0af66605a745a5a2f91cf1bbf8a7afbc283dec56" - integrity sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw== - -source-map@^0.5.0, source-map@^0.5.6: +source-map@^0.5.0: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= @@ -3535,79 +2680,18 @@ source-map@^0.7.3: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== -spdx-correct@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" - integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== - dependencies: - spdx-expression-parse "^3.0.0" - spdx-license-ids "^3.0.0" - -spdx-exceptions@^2.1.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" - integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== - -spdx-expression-parse@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" - integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== - dependencies: - spdx-exceptions "^2.1.0" - spdx-license-ids "^3.0.0" - -spdx-license-ids@^3.0.0: - version "3.0.7" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz#e9c18a410e5ed7e12442a549fbd8afa767038d65" - integrity sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ== - -split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== - dependencies: - extend-shallow "^3.0.0" - sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= -sshpk@^1.7.0: - version "1.16.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" - integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - bcrypt-pbkdf "^1.0.0" - dashdash "^1.12.0" - ecc-jsbn "~0.1.1" - getpass "^0.1.1" - jsbn "~0.1.0" - safer-buffer "^2.0.2" - tweetnacl "~0.14.0" - -stack-utils@^2.0.2: +stack-utils@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.3.tgz#cd5f030126ff116b78ccb3c027fe302713b61277" integrity sha512-gL//fkxfWUsIlFL2Tl42Cl6+HFALEaB1FU76I/Fy+oZjRreP7OPMXFlGbxM7NQsI0ZpUfw76sHnv0WNYuTb7Iw== dependencies: escape-string-regexp "^2.0.0" -static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= - dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" - -stealthy-require@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" - integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= - string-length@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a" @@ -3637,11 +2721,6 @@ strip-bom@^4.0.0: resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== -strip-eof@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= - strip-final-newline@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" @@ -3666,6 +2745,13 @@ supports-color@^7.0.0, supports-color@^7.1.0: dependencies: has-flag "^4.0.0" +supports-color@^8.0.0: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + supports-hyperlinks@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz#4f77b42488765891774b70c79babd87f9bd594bb" @@ -3713,10 +2799,10 @@ text-table@^0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= -throat@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/throat/-/throat-5.0.0.tgz#c5199235803aad18754a667d659b5e72ce16764b" - integrity sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA== +throat@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/throat/-/throat-6.0.1.tgz#d514fedad95740c12c2d7fc70ea863eb51ade375" + integrity sha512-8hmiGIJMDlwjg7dlJ4yKGLK8EsYqKgPWbG3b4wjJddKNwc7N7Dpn08Df4szr/sZdMVeOstrdYSsqzX6BYbcB+w== tmpl@1.0.x: version "1.0.4" @@ -3728,21 +2814,6 @@ to-fast-properties@^2.0.0: resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= -to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= - dependencies: - kind-of "^3.0.2" - -to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= - dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" @@ -3750,24 +2821,6 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -to-regex@^3.0.1, to-regex@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== - dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" - -tough-cookie@^2.3.3, tough-cookie@~2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" - integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== - dependencies: - psl "^1.1.28" - punycode "^2.1.1" - tough-cookie@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.0.0.tgz#d822234eeca882f991f0f908824ad2622ddbece4" @@ -3784,18 +2837,6 @@ tr46@^2.0.2: dependencies: punycode "^2.1.1" -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= - dependencies: - safe-buffer "^5.0.1" - -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= - type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" @@ -3825,11 +2866,6 @@ type-fest@^0.21.3: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== -type-fest@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" - integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== - type-fest@^0.8.1: version "0.8.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" @@ -3842,29 +2878,11 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -union-value@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" - integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== - dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^2.0.1" - universalify@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== -unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= - dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - uri-js@^4.2.2: version "4.4.1" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" @@ -3872,26 +2890,6 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" -urix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= - -use@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== - -uuid@^3.3.2: - version "3.4.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" - integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== - -uuid@^8.3.0: - version "8.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" - integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== - v8-compile-cache@^2.0.3: version "2.3.0" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" @@ -3906,23 +2904,6 @@ v8-to-istanbul@^7.0.0: convert-source-map "^1.6.0" source-map "^0.7.3" -validate-npm-package-license@^3.0.1: - version "3.0.4" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" - integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== - dependencies: - spdx-correct "^3.0.0" - spdx-expression-parse "^3.0.0" - -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - w3c-hr-time@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" @@ -3937,7 +2918,7 @@ w3c-xmlserializer@^2.0.0: dependencies: xml-name-validator "^3.0.0" -walker@^1.0.7, walker@~1.0.5: +walker@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" integrity sha1-L3+bj9ENZ3JisYqITijRlhjgKPs= @@ -3975,19 +2956,7 @@ whatwg-url@^8.0.0, whatwg-url@^8.5.0: tr46 "^2.0.2" webidl-conversions "^6.1.0" -which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= - -which@^1.2.9: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - -which@^2.0.1, which@^2.0.2: +which@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== @@ -3999,10 +2968,10 @@ word-wrap@^1.2.3, word-wrap@~1.2.3: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== -wrap-ansi@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" - integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== dependencies: ansi-styles "^4.0.0" string-width "^4.1.0" @@ -4023,10 +2992,10 @@ write-file-atomic@^3.0.0: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" -ws@^7.4.4: - version "7.4.5" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.5.tgz#a484dd851e9beb6fdb420027e3885e8ce48986c1" - integrity sha512-xzyu3hFvomRfXKH8vOFMU3OguG6oOvhXMo3xsGy3xWExqaM2dxBbVxuD99O7m3ZUFMvvscsZDqxfgMaRr/Nr1g== +ws@^7.4.5: + version "7.4.6" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" + integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== xml-name-validator@^3.0.0: version "3.0.0" @@ -4038,37 +3007,30 @@ xmlchars@^2.2.0: resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== -y18n@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" - integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== yallist@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yargs-parser@^18.1.2: - version "18.1.3" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" - integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" +yargs-parser@^20.2.2: + version "20.2.7" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.7.tgz#61df85c113edfb5a7a4e36eb8aa60ef423cbc90a" + integrity sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw== -yargs@^15.4.1: - version "15.4.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" - integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== +yargs@^16.0.3: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== dependencies: - cliui "^6.0.0" - decamelize "^1.2.0" - find-up "^4.1.0" - get-caller-file "^2.0.1" + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" string-width "^4.2.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^18.1.2" + y18n "^5.0.5" + yargs-parser "^20.2.2" From 3de9c5e7613d126de66647775e21b787ad5afac9 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 26 May 2021 10:14:28 -0400 Subject: [PATCH 178/785] Update CHANGELOG --- CHANGELOG.md | 1 + yarn.lock | 95 +++++++++++++++++----------------------------------- 2 files changed, 31 insertions(+), 65 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc9555db..148e6396 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#854](https://github.com/prettier/plugin-ruby/issues/854) - jflinter, kddeisz - Parentheses should not be stripped from optional RBS union types. - [#888](https://github.com/prettier/plugin-ruby/issues/888) - MaxNotarangelo, kddeisz - Ensure parentheses wrap conditionals that get transformed into the modifier form when they're used within a binary node. - [#874](https://github.com/prettier/plugin-ruby/issues/874) - yratanov, kddeisz - Ensure that method calls chained onto the ends of blocks still print their arguments. +- [#897](https://github.com/prettier/plugin-ruby/pull/897) - Hansenq - Reenable the `Layout/LineLength` rubocop rule in our shipped config so that line lengths for other cops are calculated correctly. ## [1.5.5] - 2021-03-25 diff --git a/yarn.lock b/yarn.lock index d7f3d157..7072b871 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21,28 +21,7 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.14.0.tgz#a901128bce2ad02565df95e6ecbf195cf9465919" integrity sha512-vu9V3uMM/1o5Hl5OekMUowo3FqXLJSw+s+66nt0fSWVWTtmosdzn45JHOB3cPtZoe6CTBDzvSw0RdOY85Q37+Q== -"@babel/core@^7.1.0", "@babel/core@^7.7.5": - version "7.14.2" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.14.2.tgz#54e45334ffc0172048e5c93ded36461d3ad4c417" - integrity sha512-OgC1mON+l4U4B4wiohJlQNUU3H73mpTyYY3j/c8U9dr9UagGGSm+WFpzjy/YLdoyjiG++c1kIDgxCo/mLwQJeQ== - dependencies: - "@babel/code-frame" "^7.12.13" - "@babel/generator" "^7.14.2" - "@babel/helper-compilation-targets" "^7.13.16" - "@babel/helper-module-transforms" "^7.14.2" - "@babel/helpers" "^7.14.0" - "@babel/parser" "^7.14.2" - "@babel/template" "^7.12.13" - "@babel/traverse" "^7.14.2" - "@babel/types" "^7.14.2" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.1.2" - semver "^6.3.0" - source-map "^0.5.0" - -"@babel/core@^7.7.2": +"@babel/core@^7.1.0", "@babel/core@^7.7.2", "@babel/core@^7.7.5": version "7.14.3" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.14.3.tgz#5395e30405f0776067fbd9cf0884f15bfb770a38" integrity sha512-jB5AmTKOCSJIZ72sd78ECEhuPiDMKlQdDI/4QRI6lzYATx5SSogS1oQA2AoPecRCknm30gHi2l+QVvNUu3wZAg== @@ -63,16 +42,7 @@ semver "^6.3.0" source-map "^0.5.0" -"@babel/generator@^7.14.2": - version "7.14.2" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.14.2.tgz#d5773e8b557d421fd6ce0d5efa5fd7fc22567c30" - integrity sha512-OnADYbKrffDVai5qcpkMxQ7caomHOoEwjkouqnN2QhydAjowFAZcsdecFIRUBdb+ZcruwYE4ythYmF1UBZU5xQ== - dependencies: - "@babel/types" "^7.14.2" - jsesc "^2.5.1" - source-map "^0.5.0" - -"@babel/generator@^7.14.3", "@babel/generator@^7.7.2": +"@babel/generator@^7.14.2", "@babel/generator@^7.14.3", "@babel/generator@^7.7.2": version "7.14.3" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.14.3.tgz#0c2652d91f7bddab7cccc6ba8157e4f40dcedb91" integrity sha512-bn0S6flG/j0xtQdz3hsjJ624h3W0r3llttBMfyHX3YrZ/KtLYr15bjA0FXkgW7FpvrDuTuElXeVjiKlYRpnOFA== @@ -148,14 +118,14 @@ integrity sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ== "@babel/helper-replace-supers@^7.13.12": - version "7.13.12" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz#6442f4c1ad912502481a564a7386de0c77ff3804" - integrity sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw== + version "7.14.3" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.14.3.tgz#ca17b318b859d107f0e9b722d58cf12d94436600" + integrity sha512-Rlh8qEWZSTfdz+tgNV/N4gz1a0TMNwCUcENhMjHTHKp3LseYH5Jha0NSlyTQWMnjbYcwFt+bqAMqSLHVXkQ6UA== dependencies: "@babel/helper-member-expression-to-functions" "^7.13.12" "@babel/helper-optimise-call-expression" "^7.12.13" - "@babel/traverse" "^7.13.0" - "@babel/types" "^7.13.12" + "@babel/traverse" "^7.14.2" + "@babel/types" "^7.14.2" "@babel/helper-simple-access@^7.13.12": version "7.13.12" @@ -199,12 +169,7 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.14.2": - version "7.14.2" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.2.tgz#0c1680aa44ad4605b16cbdcc5c341a61bde9c746" - integrity sha512-IoVDIHpsgE/fu7eXBeRWt8zLbDrSvD7H1gpomOkPpBoEN8KCruCqSDdqo8dddwQQrui30KSvQBaMUOJiuFu6QQ== - -"@babel/parser@^7.14.3", "@babel/parser@^7.7.2": +"@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.14.2", "@babel/parser@^7.14.3", "@babel/parser@^7.7.2": version "7.14.3" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.3.tgz#9b530eecb071fd0c93519df25c5ff9f14759f298" integrity sha512-7MpZDIfI7sUC5zWo2+foJ50CSI5lcqDehZ0lVgIhSi4bFEk94fLAKlF3Q0nzSQQ+ca0lm+O6G9ztKVBeu8PMRQ== @@ -309,7 +274,7 @@ "@babel/parser" "^7.12.13" "@babel/types" "^7.12.13" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.13.0", "@babel/traverse@^7.14.0", "@babel/traverse@^7.14.2", "@babel/traverse@^7.7.2": +"@babel/traverse@^7.1.0", "@babel/traverse@^7.14.0", "@babel/traverse@^7.14.2", "@babel/traverse@^7.7.2": version "7.14.2" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.14.2.tgz#9201a8d912723a831c2679c7ebbf2fe1416d765b" integrity sha512-TsdRgvBFHMyHOOzcP9S6QU0QQtjxlRpEYOy3mcCO5RgmC305ki42aSAmfZEMSSYBla2oZ9BMqYlncBaKmD/7iA== @@ -621,9 +586,9 @@ integrity sha512-1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA== "@types/node@*": - version "15.3.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-15.3.0.tgz#d6fed7d6bc6854306da3dea1af9f874b00783e26" - integrity sha512-8/bnjSZD86ZfpBsDlCIkNXIvm+h6wi9g7IqL+kmFkQ+Wvu3JrasgLElfiPgoo8V8vVfnEi0QVS12gbl94h9YsQ== + version "15.6.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-15.6.1.tgz#32d43390d5c62c5b6ec486a9bc9c59544de39a08" + integrity sha512-7EIraBEyRHEe7CH+Fm1XvgqU6uwZN8Q7jppJGcqjROMT29qhAuuOxYB1uEY5UMYQKEmA5D+5tBnhdaPXSsLONA== "@types/prettier@^2.1.5": version "2.2.3" @@ -698,9 +663,9 @@ ajv@^6.10.0, ajv@^6.12.4: uri-js "^4.2.2" ajv@^8.0.1: - version "8.4.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.4.0.tgz#48984fdb2ce225cab15795f0772a8d85669075e4" - integrity sha512-7QD2l6+KBSLwf+7MuYocbWvRPdOu63/trReTLu2KFwkgctnub1auoF+Y1WYcm09CTM7quuscrzqmASaLHC/K4Q== + version "8.5.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.5.0.tgz#695528274bcb5afc865446aa275484049a18ae4b" + integrity sha512-Y2l399Tt1AguU3BPRP9Fn4eN+Or+StUGWCUpbnFyXSo8NZ9S4uj+AG2pjs5apK+ZMOwYOz1+a+VKvKH7CudXgQ== dependencies: fast-deep-equal "^3.1.1" json-schema-traverse "^1.0.0" @@ -908,9 +873,9 @@ camelcase@^6.2.0: integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== caniuse-lite@^1.0.30001219: - version "1.0.30001228" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001228.tgz#bfdc5942cd3326fa51ee0b42fbef4da9d492a7fa" - integrity sha512-QQmLOGJ3DEgokHbMSA8cj2a+geXqmnpyOFT0lhQV6P3/YOJvGDEwoedcwxEQ30gJIwIIunHIicunJ2rzK5gB2A== + version "1.0.30001230" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001230.tgz#8135c57459854b2240b57a4a6786044bdc5a9f71" + integrity sha512-5yBd5nWCBS+jWKTcHOzXwo5xzcj4ePE/yjtkZyUV1BTUmrBaA9MRGC+e7mxnqXSA90CmCA8L3eKLaSUkt099IQ== chalk@^2.0.0: version "2.4.2" @@ -1111,9 +1076,9 @@ domexception@^2.0.1: webidl-conversions "^5.0.0" electron-to-chromium@^1.3.723: - version "1.3.728" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.728.tgz#dbedd6373f595ae10a13d146b66bece4c1afa5bd" - integrity sha512-SHv4ziXruBpb1Nz4aTuqEHBYi/9GNCJMYIJgDEXrp/2V01nFXMNFUTli5Z85f5ivSkioLilQatqBYFB44wNJrA== + version "1.3.739" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.739.tgz#f07756aa92cabd5a6eec6f491525a64fe62f98b9" + integrity sha512-+LPJVRsN7hGZ9EIUUiWCpO7l4E3qBYHNadazlucBfsXBbccDFNKUBAgzE68FnkWGJPwD/AfKhSzL+G+Iqb8A4A== emittery@^0.8.1: version "0.8.1" @@ -2449,14 +2414,14 @@ path-key@^3.0.0, path-key@^3.1.0: integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== path-parse@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== picomatch@^2.0.4, picomatch@^2.2.3: - version "2.2.3" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.3.tgz#465547f359ccc206d3c48e46a1bcb89bf7ee619d" - integrity sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg== + version "2.3.0" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" + integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== pirates@^4.0.1: version "4.0.1" @@ -2831,9 +2796,9 @@ tough-cookie@^4.0.0: universalify "^0.1.2" tr46@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.0.2.tgz#03273586def1595ae08fedb38d7733cee91d2479" - integrity sha512-3n1qG+/5kg+jrbTzwAykB5yRYtQCTqOGKq5U5PE3b0a1/mzo6snDhjGS0zJVJunO0NrT3Dg1MLy5TjWP/UJppg== + version "2.1.0" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.1.0.tgz#fa87aa81ca5d5941da8cbf1f9b749dc969a4e240" + integrity sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw== dependencies: punycode "^2.1.1" From 6d4918f11e6488f5f47d8a0801bea83a45dd5248 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 May 2021 05:02:53 +0000 Subject: [PATCH 179/785] Bump jest from 27.0.1 to 27.0.3 Bumps [jest](https://github.com/facebook/jest) from 27.0.1 to 27.0.3. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v27.0.1...v27.0.3) Signed-off-by: dependabot[bot] --- yarn.lock | 630 +++++++++++++++++++++++++++--------------------------- 1 file changed, 315 insertions(+), 315 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7072b871..250547aa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -332,94 +332,94 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^27.0.1": - version "27.0.1" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.0.1.tgz#c6acfec201f9b6823596eb6c4fcd77c89a8b27e9" - integrity sha512-50E6nN2F5cAXn1lDljn0gE9F0WFXHYz/u0EeR7sOt4nbRPNli34ckbl6CUDaDABJbHt62DYnyQAIB3KgdzwKDw== +"@jest/console@^27.0.2": + version "27.0.2" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.0.2.tgz#b8eeff8f21ac51d224c851e1729d2630c18631e6" + integrity sha512-/zYigssuHLImGeMAACkjI4VLAiiJznHgAl3xnFT19iWyct2LhrH3KXOjHRmxBGTkiPLZKKAJAgaPpiU9EZ9K+w== dependencies: - "@jest/types" "^27.0.1" + "@jest/types" "^27.0.2" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^27.0.1" - jest-util "^27.0.1" + jest-message-util "^27.0.2" + jest-util "^27.0.2" slash "^3.0.0" -"@jest/core@^27.0.1": - version "27.0.1" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.0.1.tgz#88d0ff55f465fe1fc3a940718e8cf0fea242be4b" - integrity sha512-PiCbKSMf6t8PEfY3MAd0Ldn3aJAt5T+UcaFkAfMZ1VZgas35+fXk5uHIjAQHQLNIHZWX19TLv0wWNT03yvrw6w== - dependencies: - "@jest/console" "^27.0.1" - "@jest/reporters" "^27.0.1" - "@jest/test-result" "^27.0.1" - "@jest/transform" "^27.0.1" - "@jest/types" "^27.0.1" +"@jest/core@^27.0.3": + version "27.0.3" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.0.3.tgz#b5a38675fa0466450a7fd465f4b226762cb592a2" + integrity sha512-rN8lr/OJ8iApcQUh4khnMaOCVX4oRnLwy2tPW3Vh70y62K8Da8fhkxMUq0xX9VPa4+yWUm0tGc/jUSJi+Jzuwg== + dependencies: + "@jest/console" "^27.0.2" + "@jest/reporters" "^27.0.2" + "@jest/test-result" "^27.0.2" + "@jest/transform" "^27.0.2" + "@jest/types" "^27.0.2" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" - jest-changed-files "^27.0.1" - jest-config "^27.0.1" - jest-haste-map "^27.0.1" - jest-message-util "^27.0.1" + jest-changed-files "^27.0.2" + jest-config "^27.0.3" + jest-haste-map "^27.0.2" + jest-message-util "^27.0.2" jest-regex-util "^27.0.1" - jest-resolve "^27.0.1" - jest-resolve-dependencies "^27.0.1" - jest-runner "^27.0.1" - jest-runtime "^27.0.1" - jest-snapshot "^27.0.1" - jest-util "^27.0.1" - jest-validate "^27.0.1" - jest-watcher "^27.0.1" + jest-resolve "^27.0.2" + jest-resolve-dependencies "^27.0.3" + jest-runner "^27.0.3" + jest-runtime "^27.0.3" + jest-snapshot "^27.0.2" + jest-util "^27.0.2" + jest-validate "^27.0.2" + jest-watcher "^27.0.2" micromatch "^4.0.4" p-each-series "^2.1.0" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.0.1": - version "27.0.1" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.0.1.tgz#27ed89bf8179c0a030690f063d922d6da7a519ac" - integrity sha512-nG+r3uSs2pOTsdhgt6lUm4ZGJLRcTc6HZIkrFsVpPcdSqEpJehEny9r9y2Bmhkn8fKXWdGCYJKF3i4nKO0HSmA== +"@jest/environment@^27.0.3": + version "27.0.3" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.0.3.tgz#68769b1dfdd213e3456169d64fbe9bd63a5fda92" + integrity sha512-pN9m7fbKsop5vc3FOfH8NF7CKKdRbEZzcxfIo1n2TT6ucKWLFq0P6gCJH0GpnQp036++yY9utHOxpeT1WnkWTA== dependencies: - "@jest/fake-timers" "^27.0.1" - "@jest/types" "^27.0.1" + "@jest/fake-timers" "^27.0.3" + "@jest/types" "^27.0.2" "@types/node" "*" - jest-mock "^27.0.1" + jest-mock "^27.0.3" -"@jest/fake-timers@^27.0.1": - version "27.0.1" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.0.1.tgz#6987a596b0bcf8c07653086076c17058b4c77b5c" - integrity sha512-3CyLJQnHzKI4TCJSCo+I9TzIHjSK4RrNEk93jFM6Q9+9WlSJ3mpMq/p2YuKMe0SiHKbmZOd5G/Ll5ofF9Xkw9g== +"@jest/fake-timers@^27.0.3": + version "27.0.3" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.0.3.tgz#9899ba6304cc636734c74478df502e18136461dd" + integrity sha512-fQ+UCKRIYKvTCEOyKPnaPnomLATIhMnHC/xPZ7yT1Uldp7yMgMxoYIFidDbpSTgB79+/U+FgfoD30c6wg3IUjA== dependencies: - "@jest/types" "^27.0.1" + "@jest/types" "^27.0.2" "@sinonjs/fake-timers" "^7.0.2" "@types/node" "*" - jest-message-util "^27.0.1" - jest-mock "^27.0.1" - jest-util "^27.0.1" + jest-message-util "^27.0.2" + jest-mock "^27.0.3" + jest-util "^27.0.2" -"@jest/globals@^27.0.1": - version "27.0.1" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.0.1.tgz#14c776942f7047a04f2aea09b148065e2aa9d7e9" - integrity sha512-80ZCzgopysKdpp5EOglgjApKxiNDR96PG4PwngB4fTwZ4qqqSKo0EwGwQIhl16szQ1M2xCVYmr9J6KelvnABNQ== +"@jest/globals@^27.0.3": + version "27.0.3" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.0.3.tgz#1cf8933b7791bba0b99305cbf39fd4d2e3fe4060" + integrity sha512-OzsIuf7uf+QalqAGbjClyezzEcLQkdZ+7PejUrZgDs+okdAK8GwRCGcYCirHvhMBBQh60Jr3NlIGbn/KBPQLEQ== dependencies: - "@jest/environment" "^27.0.1" - "@jest/types" "^27.0.1" - expect "^27.0.1" + "@jest/environment" "^27.0.3" + "@jest/types" "^27.0.2" + expect "^27.0.2" -"@jest/reporters@^27.0.1": - version "27.0.1" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.0.1.tgz#5b491f64e37c9b97b13e564f18f36b6697d28045" - integrity sha512-lZbJWuS1h/ytKERfu1D6tEQ4PuQ7+15S4+HrSzHR0i7AGVT1WRo49h4fZqxASOp7AQCupUVtPJNZDkaG9ZXy0g== +"@jest/reporters@^27.0.2": + version "27.0.2" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.0.2.tgz#ad73835d1cd54da08b0998a70b14446405e8e0d9" + integrity sha512-SVQjew/kafNxSN1my4praGQP+VPVGHsU8zqiEDppLvq6j1lryIjdNb9P+bZSsKeifU4bIoaPnf9Ui0tK9WOpFA== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.0.1" - "@jest/test-result" "^27.0.1" - "@jest/transform" "^27.0.1" - "@jest/types" "^27.0.1" + "@jest/console" "^27.0.2" + "@jest/test-result" "^27.0.2" + "@jest/transform" "^27.0.2" + "@jest/types" "^27.0.2" chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" @@ -430,10 +430,10 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^27.0.1" - jest-resolve "^27.0.1" - jest-util "^27.0.1" - jest-worker "^27.0.1" + jest-haste-map "^27.0.2" + jest-resolve "^27.0.2" + jest-util "^27.0.2" + jest-worker "^27.0.2" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" @@ -449,52 +449,51 @@ graceful-fs "^4.2.4" source-map "^0.6.0" -"@jest/test-result@^27.0.1": - version "27.0.1" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.0.1.tgz#8fb97214268ea21cf8cfb83edc0f17e558b3466d" - integrity sha512-5aa+ibX2dsGSDLKaQMZb453MqjJU/CRVumebXfaJmuzuGE4qf87yQ2QZ6PEpEtBwVUEgrJCzi3jLCRaUbksSuw== +"@jest/test-result@^27.0.2": + version "27.0.2" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.0.2.tgz#0451049e32ceb609b636004ccc27c8fa22263f10" + integrity sha512-gcdWwL3yP5VaIadzwQtbZyZMgpmes8ryBAJp70tuxghiA8qL4imJyZex+i+USQH2H4jeLVVszhwntgdQ97fccA== dependencies: - "@jest/console" "^27.0.1" - "@jest/types" "^27.0.1" + "@jest/console" "^27.0.2" + "@jest/types" "^27.0.2" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.0.1": - version "27.0.1" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.0.1.tgz#2a3b85130978fc545d8ee6c34d65ff4231dbad86" - integrity sha512-yK2c2iruJ35WgH4KH8whS72uH+FASJUrzwxzNKTzLAEWmNpWKNEPOsSEKsHynvz78bLHafrTg4adN7RrYNbEOA== +"@jest/test-sequencer@^27.0.3": + version "27.0.3" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.0.3.tgz#2a8632b86a9a6f8900e514917cdab6a062e71049" + integrity sha512-DcLTzraZ8xLr5fcIl+CF14vKeBBpBrn55wFxI9Ju+dhEBdjRdJQ/Z/pLkMehkPZWIQ+rR23J8e+wFDkfjree0Q== dependencies: - "@jest/test-result" "^27.0.1" + "@jest/test-result" "^27.0.2" graceful-fs "^4.2.4" - jest-haste-map "^27.0.1" - jest-runner "^27.0.1" - jest-runtime "^27.0.1" + jest-haste-map "^27.0.2" + jest-runtime "^27.0.3" -"@jest/transform@^27.0.1": - version "27.0.1" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.0.1.tgz#a9ece291f82273d5e58132550996c16edd5a902a" - integrity sha512-LC95VpT6wMnQ96dRJDlUiAnW/90zyh4+jS30szI/5AsfS0qwSlr/O4TPcGoD2WVaVMfo6KvR+brvOtGyMHaNhA== +"@jest/transform@^27.0.2": + version "27.0.2" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.0.2.tgz#b073b7c589e3f4b842102468875def2bb722d6b5" + integrity sha512-H8sqKlgtDfVog/s9I4GG2XMbi4Ar7RBxjsKQDUhn2XHAi3NG+GoQwWMER+YfantzExbjNqQvqBHzo/G2pfTiPw== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^27.0.1" + "@jest/types" "^27.0.2" babel-plugin-istanbul "^6.0.0" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.0.1" + jest-haste-map "^27.0.2" jest-regex-util "^27.0.1" - jest-util "^27.0.1" + jest-util "^27.0.2" micromatch "^4.0.4" pirates "^4.0.1" slash "^3.0.0" source-map "^0.6.1" write-file-atomic "^3.0.0" -"@jest/types@^27.0.1": - version "27.0.1" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.0.1.tgz#631738c942e70045ebbf42a3f9b433036d3845e4" - integrity sha512-8A25RRV4twZutsx2D+7WphnDsp7If9Yu6ko0Gxwrwv8BiWESFzka34+Aa2kC8w9xewt7SDuCUSZ6IiAFVj3PRg== +"@jest/types@^27.0.2": + version "27.0.2" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.0.2.tgz#e153d6c46bda0f2589f0702b071f9898c7bbd37e" + integrity sha512-XpjCtJ/99HB4PmyJ2vgmN7vT+JLP7RW1FBT9RgnMFS4Dt7cvIyBee8O3/j98aUZ34ZpenPZFqmaaObWSeL65dg== dependencies: "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" @@ -748,13 +747,13 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= -babel-jest@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.0.1.tgz#9f1c4571ac17a39e599d1325dcaf53a274261df4" - integrity sha512-aWFD7OGQjk3Y8MdZKf1XePlQvHnjMVJQjIq9WKrlAjz9by703kJ45Jxhp26JwnovoW71YYz5etuqRl8wMcIv0w== +babel-jest@^27.0.2: + version "27.0.2" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.0.2.tgz#7dc18adb01322acce62c2af76ea2c7cd186ade37" + integrity sha512-9OThPl3/IQbo4Yul2vMz4FYwILPQak8XelX4YGowygfHaOl5R5gfjm4iVx4d8aUugkW683t8aq0A74E7b5DU1Q== dependencies: - "@jest/transform" "^27.0.1" - "@jest/types" "^27.0.1" + "@jest/transform" "^27.0.2" + "@jest/types" "^27.0.2" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.0.0" babel-preset-jest "^27.0.1" @@ -1289,16 +1288,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.0.1.tgz#1290c74fef8d62f15f4c5dd1d7233001909abbfb" - integrity sha512-hjKwLeAvKUiq0Plha1dmzOH1FGEwJC9njbT993cq4PK9r58/+3NM+WDqFVGcPuRH7XTjmbIeHQBzp2faDrPhjQ== +expect@^27.0.2: + version "27.0.2" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.0.2.tgz#e66ca3a4c9592f1c019fa1d46459a9d2084f3422" + integrity sha512-YJFNJe2+P2DqH+ZrXy+ydRQYO87oxRUonZImpDodR1G7qo3NYd3pL+NQ9Keqpez3cehczYwZDBC3A7xk3n7M/w== dependencies: - "@jest/types" "^27.0.1" + "@jest/types" "^27.0.2" ansi-styles "^5.0.0" jest-get-type "^27.0.1" - jest-matcher-utils "^27.0.1" - jest-message-util "^27.0.1" + jest-matcher-utils "^27.0.2" + jest-message-util "^27.0.2" jest-regex-util "^27.0.1" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: @@ -1671,93 +1670,94 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.0.1.tgz#b8356b3708cac9d05ebf6f9e0b32227b514945c8" - integrity sha512-Y/4AnqYNcUX/vVgfkmvSA3t7rcg+t8m3CsSGlU+ra8kjlVW5ZqXcBZY/NUew2Mo8M+dn0ApKl+FmGGT1JV5dVA== +jest-changed-files@^27.0.2: + version "27.0.2" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.0.2.tgz#997253042b4a032950fc5f56abf3c5d1f8560801" + integrity sha512-eMeb1Pn7w7x3wue5/vF73LPCJ7DKQuC9wQUR5ebP9hDPpk5hzcT/3Hmz3Q5BOFpR3tgbmaWhJcMTVgC8Z1NuMw== dependencies: - "@jest/types" "^27.0.1" + "@jest/types" "^27.0.2" execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.0.1.tgz#3a7ec9e9fd60ef4c827197dffe2288aa19f86678" - integrity sha512-Tz3ytmrsgxWlTwSyPYb8StF9J2IMjLlbBMKAjhL2UU9/0ZpYb2JiEGjXaAhnGauQRbbpyFbSH3yj5HIbdurmwQ== +jest-circus@^27.0.3: + version "27.0.3" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.0.3.tgz#32006967de484e03589da944064d72e172ce3261" + integrity sha512-tdMfzs7SgD5l7jRcI1iB3vtQi5fHwCgo4RlO8bzZnYc05PZ+tlAOMZeS8eGYkZ2tPaRY/aRLMFWQp/8zXBrolQ== dependencies: - "@jest/environment" "^27.0.1" - "@jest/test-result" "^27.0.1" - "@jest/types" "^27.0.1" + "@jest/environment" "^27.0.3" + "@jest/test-result" "^27.0.2" + "@jest/types" "^27.0.2" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" - expect "^27.0.1" + expect "^27.0.2" is-generator-fn "^2.0.0" - jest-each "^27.0.1" - jest-matcher-utils "^27.0.1" - jest-message-util "^27.0.1" - jest-runner "^27.0.1" - jest-runtime "^27.0.1" - jest-snapshot "^27.0.1" - jest-util "^27.0.1" - pretty-format "^27.0.1" + jest-each "^27.0.2" + jest-matcher-utils "^27.0.2" + jest-message-util "^27.0.2" + jest-runtime "^27.0.3" + jest-snapshot "^27.0.2" + jest-util "^27.0.2" + pretty-format "^27.0.2" + slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.0.1.tgz#9accc8a505438571ee423438eac526a7ee4654b5" - integrity sha512-plDsQQwpkKK1SZ5L5xqMa7v/sTwB5LTIeSJqb+cV+4EMlThdUQfg8jwMfHX8jHuUc9TPGLcdoZeBuZcGGn3Rlg== +jest-cli@^27.0.3: + version "27.0.3" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.0.3.tgz#b733871acb526054a0f8c971d0466595c5f8316d" + integrity sha512-7bt9Sgv4nWH5pUnyJfdLf8CHWfo4+7lSPxeBwQx4r0vBj9jweJam/piE2U91SXtQI+ckm+TIN97OVnqIYpVhSg== dependencies: - "@jest/core" "^27.0.1" - "@jest/test-result" "^27.0.1" - "@jest/types" "^27.0.1" + "@jest/core" "^27.0.3" + "@jest/test-result" "^27.0.2" + "@jest/types" "^27.0.2" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.0.1" - jest-util "^27.0.1" - jest-validate "^27.0.1" + jest-config "^27.0.3" + jest-util "^27.0.2" + jest-validate "^27.0.2" prompts "^2.0.1" yargs "^16.0.3" -jest-config@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.0.1.tgz#db4f202efcbb92011f62d8f25b52c3d1bd5672d4" - integrity sha512-V8O6+CZjGF0OMq4kxVR29ztV/LQqlAAcJLw7a94RndfRXkha4U84n50yZCXiPWtAHHTmb3g1y52US6rGPxA+3w== +jest-config@^27.0.3: + version "27.0.3" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.0.3.tgz#31871583573c6d669dcdb5bb2d1a8738f3b91c20" + integrity sha512-zgtI2YQo+ekKsmYNyDlXFY/7w7WWBSJFoj/WRe173WB88CDUrEYWr0sLdbLOQe+sRu6l1Y2S0MCS6BOJm5jkoA== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.0.1" - "@jest/types" "^27.0.1" - babel-jest "^27.0.1" + "@jest/test-sequencer" "^27.0.3" + "@jest/types" "^27.0.2" + babel-jest "^27.0.2" chalk "^4.0.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" is-ci "^3.0.0" - jest-circus "^27.0.1" - jest-environment-jsdom "^27.0.1" - jest-environment-node "^27.0.1" + jest-circus "^27.0.3" + jest-environment-jsdom "^27.0.3" + jest-environment-node "^27.0.3" jest-get-type "^27.0.1" - jest-jasmine2 "^27.0.1" + jest-jasmine2 "^27.0.3" jest-regex-util "^27.0.1" - jest-resolve "^27.0.1" - jest-util "^27.0.1" - jest-validate "^27.0.1" + jest-resolve "^27.0.2" + jest-runner "^27.0.3" + jest-util "^27.0.2" + jest-validate "^27.0.2" micromatch "^4.0.4" - pretty-format "^27.0.1" + pretty-format "^27.0.2" -jest-diff@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.0.1.tgz#021beb29fe9f07e83c809a4f7a1ce807b229c4ab" - integrity sha512-DQ3OgfJgoGWVTYo4qnYW/Jg5mpYFS2QW9BLxA8bs12ZRN1K8QPZtWeYvUPohQFs3CHX3JLTndGg3jyxdL5THFQ== +jest-diff@^27.0.2: + version "27.0.2" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.0.2.tgz#f315b87cee5dc134cf42c2708ab27375cc3f5a7e" + integrity sha512-BFIdRb0LqfV1hBt8crQmw6gGQHVDhM87SpMIZ45FPYKReZYG5er1+5pIn2zKqvrJp6WNox0ylR8571Iwk2Dmgw== dependencies: chalk "^4.0.0" diff-sequences "^27.0.1" jest-get-type "^27.0.1" - pretty-format "^27.0.1" + pretty-format "^27.0.2" jest-docblock@^27.0.1: version "27.0.1" @@ -1766,53 +1766,53 @@ jest-docblock@^27.0.1: dependencies: detect-newline "^3.0.0" -jest-each@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.0.1.tgz#37fa20b7d809b29d4349d8eb7d01f17c2feeab10" - integrity sha512-uJTK/aZ05HsdKkfXucAT5+/1DIURnTRv34OSxn1HWHrD+xu9eDX5Xgds09QSvg/mU01VS5upuHTDKG3W+r0rQA== +jest-each@^27.0.2: + version "27.0.2" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.0.2.tgz#865ddb4367476ced752167926b656fa0dcecd8c7" + integrity sha512-OLMBZBZ6JkoXgUenDtseFRWA43wVl2BwmZYIWQws7eS7pqsIvePqj/jJmEnfq91ALk3LNphgwNK/PRFBYi7ITQ== dependencies: - "@jest/types" "^27.0.1" + "@jest/types" "^27.0.2" chalk "^4.0.0" jest-get-type "^27.0.1" - jest-util "^27.0.1" - pretty-format "^27.0.1" + jest-util "^27.0.2" + pretty-format "^27.0.2" -jest-environment-jsdom@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.0.1.tgz#12b0ed587fb53e0a581a5101bb209aef09da2310" - integrity sha512-lesU8T9zkjgLaLpUFmFDgchu6/2OCoXm52nN6UumR063Hb+1TJdI7ihgM86+G01Ay86Lyr+K/FAR6yIIOviH3Q== +jest-environment-jsdom@^27.0.3: + version "27.0.3" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.0.3.tgz#ed73e913ddc03864eb9f934b5cbabf1b63504e2e" + integrity sha512-5KLmgv1bhiimpSA8oGTnZYk6g4fsNyZiA/6gI2tAZUgrufd7heRUSVh4gRokzZVEj8zlwAQYT0Zs6tuJSW/ECA== dependencies: - "@jest/environment" "^27.0.1" - "@jest/fake-timers" "^27.0.1" - "@jest/types" "^27.0.1" + "@jest/environment" "^27.0.3" + "@jest/fake-timers" "^27.0.3" + "@jest/types" "^27.0.2" "@types/node" "*" - jest-mock "^27.0.1" - jest-util "^27.0.1" + jest-mock "^27.0.3" + jest-util "^27.0.2" jsdom "^16.6.0" -jest-environment-node@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.0.1.tgz#7d7df7ae191477a823ffb4fcc0772b4c23ec5c87" - integrity sha512-/p94lo0hx+hbKUw1opnRFUPPsjncRBEUU+2Dh7BuxX8Nr4rRiTivLYgXzo79FhaeMYV0uiV5WAbHBq6xC11JJg== +jest-environment-node@^27.0.3: + version "27.0.3" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.0.3.tgz#b4acb3679d2552a4215732cab8b0ca7ec4398ee0" + integrity sha512-co2/IVnIFL3cItpFULCvXFg9us4gvWXgs7mutAMPCbFhcqh56QAOdKhNzC2+RycsC/k4mbMj1VF+9F/NzA0ROg== dependencies: - "@jest/environment" "^27.0.1" - "@jest/fake-timers" "^27.0.1" - "@jest/types" "^27.0.1" + "@jest/environment" "^27.0.3" + "@jest/fake-timers" "^27.0.3" + "@jest/types" "^27.0.2" "@types/node" "*" - jest-mock "^27.0.1" - jest-util "^27.0.1" + jest-mock "^27.0.3" + jest-util "^27.0.2" jest-get-type@^27.0.1: version "27.0.1" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.1.tgz#34951e2b08c8801eb28559d7eb732b04bbcf7815" integrity sha512-9Tggo9zZbu0sHKebiAijyt1NM77Z0uO4tuWOxUCujAiSeXv30Vb5D4xVF4UR4YWNapcftj+PbByU54lKD7/xMg== -jest-haste-map@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.0.1.tgz#653c4ba59309a86499ad7bf663176e7f97478191" - integrity sha512-ioCuobr4z90H1Pz8+apz2vfz63387apzAoawm/9IIOndarDfRkjLURdLOe//AI5jUQmjVRg+WiL92339kqlCmA== +jest-haste-map@^27.0.2: + version "27.0.2" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.0.2.tgz#3f1819400c671237e48b4d4b76a80a0dbed7577f" + integrity sha512-37gYfrYjjhEfk37C4bCMWAC0oPBxDpG0qpl8lYg8BT//wf353YT/fzgA7+Dq0EtM7rPFS3JEcMsxdtDwNMi2cA== dependencies: - "@jest/types" "^27.0.1" + "@jest/types" "^27.0.2" "@types/graceful-fs" "^4.1.2" "@types/node" "*" anymatch "^3.0.3" @@ -1820,76 +1820,76 @@ jest-haste-map@^27.0.1: graceful-fs "^4.2.4" jest-regex-util "^27.0.1" jest-serializer "^27.0.1" - jest-util "^27.0.1" - jest-worker "^27.0.1" + jest-util "^27.0.2" + jest-worker "^27.0.2" micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.0.1.tgz#d975bfe072f3ac3596c0be5fc0a1215fd2e91e77" - integrity sha512-o8Ist0o970QDDm/R2o9UDbvNxq8A0++FTFQ0z9OnieJwS1nDH6H7WBDYAGPTdmnla7kbW41oLFPvhmjJE4mekg== +jest-jasmine2@^27.0.3: + version "27.0.3" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.0.3.tgz#fa6f6499566ea1b01b68b3ad13f49d1592b02c85" + integrity sha512-odJ2ia8P5c+IsqOcWJPmku4AqbXIfTVLRjYTKHri3TEvbmTdLw0ghy13OAPIl/0v7cVH0TURK7+xFOHKDLvKIA== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^27.0.1" + "@jest/environment" "^27.0.3" "@jest/source-map" "^27.0.1" - "@jest/test-result" "^27.0.1" - "@jest/types" "^27.0.1" + "@jest/test-result" "^27.0.2" + "@jest/types" "^27.0.2" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^27.0.1" + expect "^27.0.2" is-generator-fn "^2.0.0" - jest-each "^27.0.1" - jest-matcher-utils "^27.0.1" - jest-message-util "^27.0.1" - jest-runtime "^27.0.1" - jest-snapshot "^27.0.1" - jest-util "^27.0.1" - pretty-format "^27.0.1" + jest-each "^27.0.2" + jest-matcher-utils "^27.0.2" + jest-message-util "^27.0.2" + jest-runtime "^27.0.3" + jest-snapshot "^27.0.2" + jest-util "^27.0.2" + pretty-format "^27.0.2" throat "^6.0.1" -jest-leak-detector@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.0.1.tgz#eedeaee7c0ab553db4d8908f74967329624342b9" - integrity sha512-SQ/lRhfmnV3UuiaKIjwNXCaW2yh1rTMAL4n4Cl4I4gU0X2LoIc6Ogxe4UKM/J6Ld2uzc4gDGVYc5lSdpf6WjYw== +jest-leak-detector@^27.0.2: + version "27.0.2" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.0.2.tgz#ce19aa9dbcf7a72a9d58907a970427506f624e69" + integrity sha512-TZA3DmCOfe8YZFIMD1GxFqXUkQnIoOGQyy4hFCA2mlHtnAaf+FeOMxi0fZmfB41ZL+QbFG6BVaZF5IeFIVy53Q== dependencies: jest-get-type "^27.0.1" - pretty-format "^27.0.1" + pretty-format "^27.0.2" -jest-matcher-utils@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.0.1.tgz#7a01330786e370f152b0b0159f827293b6322909" - integrity sha512-NauNU+olKhPzLlsRnTOYFGk/MK5QFYl9ZzkrtfsY4eCq4SB3Bcl03UL44VdnlN5S/uFn4H2jwvRY1y6nSDTX3g== +jest-matcher-utils@^27.0.2: + version "27.0.2" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.0.2.tgz#f14c060605a95a466cdc759acc546c6f4cbfc4f0" + integrity sha512-Qczi5xnTNjkhcIB0Yy75Txt+Ez51xdhOxsukN7awzq2auZQGPHcQrJ623PZj0ECDEMOk2soxWx05EXdXGd1CbA== dependencies: chalk "^4.0.0" - jest-diff "^27.0.1" + jest-diff "^27.0.2" jest-get-type "^27.0.1" - pretty-format "^27.0.1" + pretty-format "^27.0.2" -jest-message-util@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.0.1.tgz#382b7c55d8e0b1aba9eeb41d3cfdd34e451210ed" - integrity sha512-w8BfON2GwWORkos8BsxcwwQrLkV2s1ENxSRXK43+6yuquDE2hVxES/jrFqOArpP1ETVqqMmktU6iGkG8ncVzeA== +jest-message-util@^27.0.2: + version "27.0.2" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.0.2.tgz#181c9b67dff504d8f4ad15cba10d8b80f272048c" + integrity sha512-rTqWUX42ec2LdMkoUPOzrEd1Tcm+R1KfLOmFK+OVNo4MnLsEaxO5zPDb2BbdSmthdM/IfXxOZU60P/WbWF8BTw== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^27.0.1" + "@jest/types" "^27.0.2" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.4" micromatch "^4.0.4" - pretty-format "^27.0.1" + pretty-format "^27.0.2" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.0.1.tgz#8394e297bc3dfed980961622cb51fd042b4acf5a" - integrity sha512-fXCSZQDT5hUcAUy8OBnB018x7JFOMQnz4XfpSKEbfpWzL6o5qaLRhgf2Qg2NPuVKmC/fgOf33Edj8wjF4I24CQ== +jest-mock@^27.0.3: + version "27.0.3" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.0.3.tgz#5591844f9192b3335c0dca38e8e45ed297d4d23d" + integrity sha512-O5FZn5XDzEp+Xg28mUz4ovVcdwBBPfAhW9+zJLO0Efn2qNbYcDaJvSlRiQ6BCZUCVOJjALicuJQI9mRFjv1o9Q== dependencies: - "@jest/types" "^27.0.1" + "@jest/types" "^27.0.2" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -1902,69 +1902,69 @@ jest-regex-util@^27.0.1: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.1.tgz#69d4b1bf5b690faa3490113c47486ed85dd45b68" integrity sha512-6nY6QVcpTgEKQy1L41P4pr3aOddneK17kn3HJw6SdwGiKfgCGTvH02hVXL0GU8GEKtPH83eD2DIDgxHXOxVohQ== -jest-resolve-dependencies@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.0.1.tgz#3dcaeb277e0253747706467e8f05e1e78a1d534d" - integrity sha512-ly1x5mEf21f3IVWbUNwIz/ePLtv4QdhYuQIVSVDqxx7yzAwhhdu0DJo7UNiEYKQY7Im48wfbNdOUpo7euFUXBQ== +jest-resolve-dependencies@^27.0.3: + version "27.0.3" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.0.3.tgz#7e258f7d0458bb910855f8a50f5c1e9d92c319dc" + integrity sha512-HdjWOvFAgT5CYChF2eiBN2rRKicjaTCCtA3EtH47REIdGzEHGUhYrWYgLahXsiOovvWN6edhcHL5WCa3gbc04A== dependencies: - "@jest/types" "^27.0.1" + "@jest/types" "^27.0.2" jest-regex-util "^27.0.1" - jest-snapshot "^27.0.1" + jest-snapshot "^27.0.2" -jest-resolve@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.0.1.tgz#4e1b76f61c7e2213d2fbd37342800864309de538" - integrity sha512-Q7QQ0OZ7z6D5Dul0MrsexlKalU8ZwexBfHLSu1qYPgphvUm6WO1b/xUnipU3e+uW1riDzMcJeJVYbdQ37hBHeg== +jest-resolve@^27.0.2: + version "27.0.2" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.0.2.tgz#087a3ed17182722a3415f92bfacc99c49cf8a965" + integrity sha512-rmfLGyZhwAUR5z3EwPAW7LQTorWAuCYCcsQJoQxT2it+BOgX3zKxa67r1pfpK3ihy2k9TjYD3/lMp5rPm/CL1Q== dependencies: - "@jest/types" "^27.0.1" + "@jest/types" "^27.0.2" chalk "^4.0.0" escalade "^3.1.1" graceful-fs "^4.2.4" jest-pnp-resolver "^1.2.2" - jest-util "^27.0.1" + jest-util "^27.0.2" + jest-validate "^27.0.2" resolve "^1.20.0" slash "^3.0.0" -jest-runner@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.0.1.tgz#52137173fbf318b7b1f034b81200c2846758f681" - integrity sha512-DUNizlD2D7J80G3VOrwfbtb7KYxiftMng82HNcKwTW0W3AwwNuBeq+1exoCnLO7Mxh7NP+k/1XQBlzLpjr/CnA== - dependencies: - "@jest/console" "^27.0.1" - "@jest/environment" "^27.0.1" - "@jest/test-result" "^27.0.1" - "@jest/transform" "^27.0.1" - "@jest/types" "^27.0.1" +jest-runner@^27.0.3: + version "27.0.3" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.0.3.tgz#d9747af3bee5a6ffaeb9e10b653263b780258b54" + integrity sha512-zH23uIIh1ro1JCD7XX1bQ0bQwXEsBzLX2UJVE/AVLsk4YJRmTfyXIzzRzBWRdnMHHg1NWkJ4fGs7eFP15IqZpQ== + dependencies: + "@jest/console" "^27.0.2" + "@jest/environment" "^27.0.3" + "@jest/test-result" "^27.0.2" + "@jest/transform" "^27.0.2" + "@jest/types" "^27.0.2" "@types/node" "*" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" - jest-config "^27.0.1" jest-docblock "^27.0.1" - jest-haste-map "^27.0.1" - jest-leak-detector "^27.0.1" - jest-message-util "^27.0.1" - jest-resolve "^27.0.1" - jest-runtime "^27.0.1" - jest-util "^27.0.1" - jest-worker "^27.0.1" + jest-haste-map "^27.0.2" + jest-leak-detector "^27.0.2" + jest-message-util "^27.0.2" + jest-resolve "^27.0.2" + jest-runtime "^27.0.3" + jest-util "^27.0.2" + jest-worker "^27.0.2" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.0.1.tgz#b71bb8ea189c50525aebb4aba6c524633ca27659" - integrity sha512-ImcrbQtpCUp8X9Rm4ky3j1GG9cqIKZJvXGZyB5cHEapGPTmg7wvvNooLmKragEe61/p/bhw1qO68Y0/9BSsBBg== +jest-runtime@^27.0.3: + version "27.0.3" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.0.3.tgz#32499c1047e5d953cfbb67fe790ab0167a614d28" + integrity sha512-k1Hl2pWWHBkSXdCggX2lyLRuDnnnmMlnJd+DPLb8LmmAeHW87WgGC6TplD377VxY3KQu73sklkhGUIdwFgsRVQ== dependencies: - "@jest/console" "^27.0.1" - "@jest/environment" "^27.0.1" - "@jest/fake-timers" "^27.0.1" - "@jest/globals" "^27.0.1" + "@jest/console" "^27.0.2" + "@jest/environment" "^27.0.3" + "@jest/fake-timers" "^27.0.3" + "@jest/globals" "^27.0.3" "@jest/source-map" "^27.0.1" - "@jest/test-result" "^27.0.1" - "@jest/transform" "^27.0.1" - "@jest/types" "^27.0.1" + "@jest/test-result" "^27.0.2" + "@jest/transform" "^27.0.2" + "@jest/types" "^27.0.2" "@types/yargs" "^16.0.0" chalk "^4.0.0" cjs-module-lexer "^1.0.0" @@ -1972,14 +1972,14 @@ jest-runtime@^27.0.1: exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-haste-map "^27.0.1" - jest-message-util "^27.0.1" - jest-mock "^27.0.1" + jest-haste-map "^27.0.2" + jest-message-util "^27.0.2" + jest-mock "^27.0.3" jest-regex-util "^27.0.1" - jest-resolve "^27.0.1" - jest-snapshot "^27.0.1" - jest-util "^27.0.1" - jest-validate "^27.0.1" + jest-resolve "^27.0.2" + jest-snapshot "^27.0.2" + jest-util "^27.0.2" + jest-validate "^27.0.2" slash "^3.0.0" strip-bom "^4.0.0" yargs "^16.0.3" @@ -1992,10 +1992,10 @@ jest-serializer@^27.0.1: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.0.1.tgz#01a82d901f260604908373795c9255b032d2a07a" - integrity sha512-HgKmSebDB3rswugREeh+nKrxJEVZE12K7lZ2MuwfFZT6YmiH0TlofsL2YmiLsCsG5KH5ZcLYYpF5bDrvtVx/Xg== +jest-snapshot@^27.0.2: + version "27.0.2" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.0.2.tgz#40c48dc6afd3cbc5d3d07c061f20fc10d94ca0cd" + integrity sha512-4RcgvZbPrrbEE/hT6XQ4hr+NVVLNrmsgUnYSnZRT6UAvW9Q2yzGMS+tfJh+xlQJAapnnkNJzsMn6vUa+yfiVHA== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" @@ -2003,79 +2003,79 @@ jest-snapshot@^27.0.1: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/transform" "^27.0.1" - "@jest/types" "^27.0.1" + "@jest/transform" "^27.0.2" + "@jest/types" "^27.0.2" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.0.1" + expect "^27.0.2" graceful-fs "^4.2.4" - jest-diff "^27.0.1" + jest-diff "^27.0.2" jest-get-type "^27.0.1" - jest-haste-map "^27.0.1" - jest-matcher-utils "^27.0.1" - jest-message-util "^27.0.1" - jest-resolve "^27.0.1" - jest-util "^27.0.1" + jest-haste-map "^27.0.2" + jest-matcher-utils "^27.0.2" + jest-message-util "^27.0.2" + jest-resolve "^27.0.2" + jest-util "^27.0.2" natural-compare "^1.4.0" - pretty-format "^27.0.1" + pretty-format "^27.0.2" semver "^7.3.2" -jest-util@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.0.1.tgz#324ed9879d129c1e64f9169a739d6d50d7928769" - integrity sha512-lEw3waSmEOO4ZkwkUlFSvg4es1+8+LIkSGxp/kF60K0+vMR3Dv3O2HMZhcln9NHqSQzpVbsDT6OeMzUPW7DfRg== +jest-util@^27.0.2: + version "27.0.2" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.0.2.tgz#fc2c7ace3c75ae561cf1e5fdb643bf685a5be7c7" + integrity sha512-1d9uH3a00OFGGWSibpNYr+jojZ6AckOMCXV2Z4K3YXDnzpkAaXQyIpY14FOJPiUmil7CD+A6Qs+lnnh6ctRbIA== dependencies: - "@jest/types" "^27.0.1" + "@jest/types" "^27.0.2" "@types/node" "*" chalk "^4.0.0" graceful-fs "^4.2.4" is-ci "^3.0.0" picomatch "^2.2.3" -jest-validate@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.0.1.tgz#8e43428674b6097f8ee3abe42c4248a4826cd008" - integrity sha512-zvmPRcfTkqTZuHveIKAI2nbkUc3SDXjWVJULknPLGF5bdxOGSeGZg7f/Uw0MUVOkCOaspcHnsPCgZG0pqmg71g== +jest-validate@^27.0.2: + version "27.0.2" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.0.2.tgz#7fe2c100089449cd5cbb47a5b0b6cb7cda5beee5" + integrity sha512-UgBF6/oVu1ofd1XbaSotXKihi8nZhg0Prm8twQ9uCuAfo59vlxCXMPI/RKmrZEVgi3Nd9dS0I8A0wzWU48pOvg== dependencies: - "@jest/types" "^27.0.1" + "@jest/types" "^27.0.2" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^27.0.1" leven "^3.1.0" - pretty-format "^27.0.1" + pretty-format "^27.0.2" -jest-watcher@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.0.1.tgz#61b9403d7b498161f6aa6124602363525ac3efc2" - integrity sha512-Chp9c02BN0IgEbtGreyAhGqIsOrn9a0XnzbuXOxdW1+cW0Tjh12hMzHDIdLFHpYP/TqaMTmPHaJ5KWvpCCrNFw== +jest-watcher@^27.0.2: + version "27.0.2" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.0.2.tgz#dab5f9443e2d7f52597186480731a8c6335c5deb" + integrity sha512-8nuf0PGuTxWj/Ytfw5fyvNn/R80iXY8QhIT0ofyImUvdnoaBdT6kob0GmhXR+wO+ALYVnh8bQxN4Tjfez0JgkA== dependencies: - "@jest/test-result" "^27.0.1" - "@jest/types" "^27.0.1" + "@jest/test-result" "^27.0.2" + "@jest/types" "^27.0.2" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^27.0.1" + jest-util "^27.0.2" string-length "^4.0.1" -jest-worker@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.0.1.tgz#b255fcbb40fb467295010c628474b1185cab4f9e" - integrity sha512-NhHqClI3owOjmS8dBhQMKHZ2rrT0sBTpqGitp9nMX5AAjVXd+15o4v96uBEMhoywaLKN+5opcKBlXwAoADZolA== +jest-worker@^27.0.2: + version "27.0.2" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.0.2.tgz#4ebeb56cef48b3e7514552f80d0d80c0129f0b05" + integrity sha512-EoBdilOTTyOgmHXtw/cPc+ZrCA0KJMrkXzkrPGNwLmnvvlN1nj7MPrxpT7m+otSv2e1TLaVffzDnE/LB14zJMg== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.0.1.tgz#d3822f0904f3bbe884bea393cede2be2aa290d0e" - integrity sha512-lFEoUdXjbGAIxk/gZhcv98xOaH1hjqG5R/PQHs5GBfIK5iL3tnXCjHQf4HQLVZZ2rcXML3oeVg9+XrRZbooBdQ== + version "27.0.3" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.0.3.tgz#0b4ac738c93612f778d58250aee026220487e5a4" + integrity sha512-0G9+QqXFIZWgf5rs3yllpaA+13ZawVHfyuhuCV1EnoFbX++rVMRrYWCAnk+dfhwyv9/VTQvn+XG969u8aPRsBg== dependencies: - "@jest/core" "^27.0.1" + "@jest/core" "^27.0.3" import-local "^3.0.2" - jest-cli "^27.0.1" + jest-cli "^27.0.3" js-tokens@^4.0.0: version "4.0.0" @@ -2452,12 +2452,12 @@ prettier@>=1.10: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18" integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w== -pretty-format@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.0.1.tgz#c4094621dfbd3e8ab751964d1cf01edc6f88474d" - integrity sha512-qE+0J6c/gd+R6XTcQgPJMc5hMJNsxzSF5p8iZSbMZ7GQzYGlSLNkh2P80Wa2dbF4gEVUsJEgcrBY+1L2/j265w== +pretty-format@^27.0.2: + version "27.0.2" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.0.2.tgz#9283ff8c4f581b186b2d4da461617143dca478a4" + integrity sha512-mXKbbBPnYTG7Yra9qFBtqj+IXcsvxsvOBco3QHxtxTl+hHKq6QdzMZ+q0CtL4ORHZgwGImRr2XZUX2EWzORxig== dependencies: - "@jest/types" "^27.0.1" + "@jest/types" "^27.0.2" ansi-regex "^5.0.0" ansi-styles "^5.0.0" react-is "^17.0.1" From ede7b72abdf096e08ed0bcd4e1c43320b69efdaf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 4 Jun 2021 05:02:32 +0000 Subject: [PATCH 180/785] Bump jest from 27.0.3 to 27.0.4 Bumps [jest](https://github.com/facebook/jest) from 27.0.3 to 27.0.4. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v27.0.3...v27.0.4) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 160 +++++++++++++++++++++++++++--------------------------- 1 file changed, 81 insertions(+), 79 deletions(-) diff --git a/yarn.lock b/yarn.lock index 250547aa..c6a0b5ea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -344,13 +344,13 @@ jest-util "^27.0.2" slash "^3.0.0" -"@jest/core@^27.0.3": - version "27.0.3" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.0.3.tgz#b5a38675fa0466450a7fd465f4b226762cb592a2" - integrity sha512-rN8lr/OJ8iApcQUh4khnMaOCVX4oRnLwy2tPW3Vh70y62K8Da8fhkxMUq0xX9VPa4+yWUm0tGc/jUSJi+Jzuwg== +"@jest/core@^27.0.4": + version "27.0.4" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.0.4.tgz#679bf9ac07900da2ddbb9667bb1afa8029038f53" + integrity sha512-+dsmV8VUs1h/Szb+rEWk8xBM1fp1I///uFy9nk3wXGvRsF2lBp8EVPmtWc+QFRb3MY2b7u2HbkGF1fzoDzQTLA== dependencies: "@jest/console" "^27.0.2" - "@jest/reporters" "^27.0.2" + "@jest/reporters" "^27.0.4" "@jest/test-result" "^27.0.2" "@jest/transform" "^27.0.2" "@jest/types" "^27.0.2" @@ -361,15 +361,15 @@ exit "^0.1.2" graceful-fs "^4.2.4" jest-changed-files "^27.0.2" - jest-config "^27.0.3" + jest-config "^27.0.4" jest-haste-map "^27.0.2" jest-message-util "^27.0.2" jest-regex-util "^27.0.1" - jest-resolve "^27.0.2" - jest-resolve-dependencies "^27.0.3" - jest-runner "^27.0.3" - jest-runtime "^27.0.3" - jest-snapshot "^27.0.2" + jest-resolve "^27.0.4" + jest-resolve-dependencies "^27.0.4" + jest-runner "^27.0.4" + jest-runtime "^27.0.4" + jest-snapshot "^27.0.4" jest-util "^27.0.2" jest-validate "^27.0.2" jest-watcher "^27.0.2" @@ -410,10 +410,10 @@ "@jest/types" "^27.0.2" expect "^27.0.2" -"@jest/reporters@^27.0.2": - version "27.0.2" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.0.2.tgz#ad73835d1cd54da08b0998a70b14446405e8e0d9" - integrity sha512-SVQjew/kafNxSN1my4praGQP+VPVGHsU8zqiEDppLvq6j1lryIjdNb9P+bZSsKeifU4bIoaPnf9Ui0tK9WOpFA== +"@jest/reporters@^27.0.4": + version "27.0.4" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.0.4.tgz#95609b1be97afb80d55d8aa3d7c3179c15810e65" + integrity sha512-Xa90Nm3JnV0xCe4M6A10M9WuN9krb+WFKxV1A98Y4ePCw40n++r7uxFUNU7DT1i9Behj7fjrAIju9oU0t1QtCg== dependencies: "@bcoe/v8-coverage" "^0.2.3" "@jest/console" "^27.0.2" @@ -431,7 +431,7 @@ istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" jest-haste-map "^27.0.2" - jest-resolve "^27.0.2" + jest-resolve "^27.0.4" jest-util "^27.0.2" jest-worker "^27.0.2" slash "^3.0.0" @@ -459,15 +459,15 @@ "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.0.3": - version "27.0.3" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.0.3.tgz#2a8632b86a9a6f8900e514917cdab6a062e71049" - integrity sha512-DcLTzraZ8xLr5fcIl+CF14vKeBBpBrn55wFxI9Ju+dhEBdjRdJQ/Z/pLkMehkPZWIQ+rR23J8e+wFDkfjree0Q== +"@jest/test-sequencer@^27.0.4": + version "27.0.4" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.0.4.tgz#976493b277594d81e589896f0ed21f198308928a" + integrity sha512-6UFEVwdmxYdyNffBxVVZxmXEdBE4riSddXYSnFNH0ELFQFk/bvagizim8WfgJTqF4EKd+j1yFxvhb8BMHfOjSQ== dependencies: "@jest/test-result" "^27.0.2" graceful-fs "^4.2.4" jest-haste-map "^27.0.2" - jest-runtime "^27.0.3" + jest-runtime "^27.0.4" "@jest/transform@^27.0.2": version "27.0.2" @@ -1679,10 +1679,10 @@ jest-changed-files@^27.0.2: execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.0.3.tgz#32006967de484e03589da944064d72e172ce3261" - integrity sha512-tdMfzs7SgD5l7jRcI1iB3vtQi5fHwCgo4RlO8bzZnYc05PZ+tlAOMZeS8eGYkZ2tPaRY/aRLMFWQp/8zXBrolQ== +jest-circus@^27.0.4: + version "27.0.4" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.0.4.tgz#3b261514ee3b3da33def736a6352c98ff56bb6e6" + integrity sha512-QD+eblDiRphta630WRKewuASLs/oY1Zki2G4bccntRvrTHQ63ljwFR5TLduuK4Zg0ZPzW0+8o6AP7KRd1yKOjw== dependencies: "@jest/environment" "^27.0.3" "@jest/test-result" "^27.0.2" @@ -1696,39 +1696,39 @@ jest-circus@^27.0.3: jest-each "^27.0.2" jest-matcher-utils "^27.0.2" jest-message-util "^27.0.2" - jest-runtime "^27.0.3" - jest-snapshot "^27.0.2" + jest-runtime "^27.0.4" + jest-snapshot "^27.0.4" jest-util "^27.0.2" pretty-format "^27.0.2" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.0.3.tgz#b733871acb526054a0f8c971d0466595c5f8316d" - integrity sha512-7bt9Sgv4nWH5pUnyJfdLf8CHWfo4+7lSPxeBwQx4r0vBj9jweJam/piE2U91SXtQI+ckm+TIN97OVnqIYpVhSg== +jest-cli@^27.0.4: + version "27.0.4" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.0.4.tgz#491b12c754c0d7c6873b13a66f26b3a80a852910" + integrity sha512-E0T+/i2lxsWAzV7LKYd0SB7HUAvePqaeIh5vX43/G5jXLhv1VzjYzJAGEkTfvxV774ll9cyE2ljcL73PVMEOXQ== dependencies: - "@jest/core" "^27.0.3" + "@jest/core" "^27.0.4" "@jest/test-result" "^27.0.2" "@jest/types" "^27.0.2" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.0.3" + jest-config "^27.0.4" jest-util "^27.0.2" jest-validate "^27.0.2" prompts "^2.0.1" yargs "^16.0.3" -jest-config@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.0.3.tgz#31871583573c6d669dcdb5bb2d1a8738f3b91c20" - integrity sha512-zgtI2YQo+ekKsmYNyDlXFY/7w7WWBSJFoj/WRe173WB88CDUrEYWr0sLdbLOQe+sRu6l1Y2S0MCS6BOJm5jkoA== +jest-config@^27.0.4: + version "27.0.4" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.0.4.tgz#c4f41378acf40ca77860fb4e213b12109d87b8cf" + integrity sha512-VkQFAHWnPQefdvHU9A+G3H/Z3NrrTKqWpvxgQz3nkUdkDTWeKJE6e//BL+R7z79dXOMVksYgM/z6ndtN0hfChg== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.0.3" + "@jest/test-sequencer" "^27.0.4" "@jest/types" "^27.0.2" babel-jest "^27.0.2" chalk "^4.0.0" @@ -1736,14 +1736,14 @@ jest-config@^27.0.3: glob "^7.1.1" graceful-fs "^4.2.4" is-ci "^3.0.0" - jest-circus "^27.0.3" + jest-circus "^27.0.4" jest-environment-jsdom "^27.0.3" jest-environment-node "^27.0.3" jest-get-type "^27.0.1" - jest-jasmine2 "^27.0.3" + jest-jasmine2 "^27.0.4" jest-regex-util "^27.0.1" - jest-resolve "^27.0.2" - jest-runner "^27.0.3" + jest-resolve "^27.0.4" + jest-runner "^27.0.4" jest-util "^27.0.2" jest-validate "^27.0.2" micromatch "^4.0.4" @@ -1827,10 +1827,10 @@ jest-haste-map@^27.0.2: optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.0.3.tgz#fa6f6499566ea1b01b68b3ad13f49d1592b02c85" - integrity sha512-odJ2ia8P5c+IsqOcWJPmku4AqbXIfTVLRjYTKHri3TEvbmTdLw0ghy13OAPIl/0v7cVH0TURK7+xFOHKDLvKIA== +jest-jasmine2@^27.0.4: + version "27.0.4" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.0.4.tgz#c669519ccf4904a485338555e1e66cad36bb0670" + integrity sha512-yj3WrjjquZwkJw+eA4c9yucHw4/+EHndHWSqgHbHGQfT94ihaaQsa009j1a0puU8CNxPDk0c1oAPeOpdJUElwA== dependencies: "@babel/traverse" "^7.1.0" "@jest/environment" "^27.0.3" @@ -1845,8 +1845,8 @@ jest-jasmine2@^27.0.3: jest-each "^27.0.2" jest-matcher-utils "^27.0.2" jest-message-util "^27.0.2" - jest-runtime "^27.0.3" - jest-snapshot "^27.0.2" + jest-runtime "^27.0.4" + jest-snapshot "^27.0.4" jest-util "^27.0.2" pretty-format "^27.0.2" throat "^6.0.1" @@ -1902,19 +1902,19 @@ jest-regex-util@^27.0.1: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.1.tgz#69d4b1bf5b690faa3490113c47486ed85dd45b68" integrity sha512-6nY6QVcpTgEKQy1L41P4pr3aOddneK17kn3HJw6SdwGiKfgCGTvH02hVXL0GU8GEKtPH83eD2DIDgxHXOxVohQ== -jest-resolve-dependencies@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.0.3.tgz#7e258f7d0458bb910855f8a50f5c1e9d92c319dc" - integrity sha512-HdjWOvFAgT5CYChF2eiBN2rRKicjaTCCtA3EtH47REIdGzEHGUhYrWYgLahXsiOovvWN6edhcHL5WCa3gbc04A== +jest-resolve-dependencies@^27.0.4: + version "27.0.4" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.0.4.tgz#a07a242d70d668afd3fcf7f4270755eebb1fe579" + integrity sha512-F33UPfw1YGWCV2uxJl7wD6TvcQn5IC0LtguwY3r4L7R6H4twpLkp5Q2ZfzRx9A2I3G8feiy0O0sqcn/Qoym71A== dependencies: "@jest/types" "^27.0.2" jest-regex-util "^27.0.1" - jest-snapshot "^27.0.2" + jest-snapshot "^27.0.4" -jest-resolve@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.0.2.tgz#087a3ed17182722a3415f92bfacc99c49cf8a965" - integrity sha512-rmfLGyZhwAUR5z3EwPAW7LQTorWAuCYCcsQJoQxT2it+BOgX3zKxa67r1pfpK3ihy2k9TjYD3/lMp5rPm/CL1Q== +jest-resolve@^27.0.4: + version "27.0.4" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.0.4.tgz#8a27bc3f2f00c8ea28f3bc99bbf6f468300a703d" + integrity sha512-BcfyK2i3cG79PDb/6gB6zFeFQlcqLsQjGBqznFCpA0L/3l1L/oOsltdUjs5eISAWA9HS9qtj8v2PSZr/yWxONQ== dependencies: "@jest/types" "^27.0.2" chalk "^4.0.0" @@ -1926,10 +1926,10 @@ jest-resolve@^27.0.2: resolve "^1.20.0" slash "^3.0.0" -jest-runner@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.0.3.tgz#d9747af3bee5a6ffaeb9e10b653263b780258b54" - integrity sha512-zH23uIIh1ro1JCD7XX1bQ0bQwXEsBzLX2UJVE/AVLsk4YJRmTfyXIzzRzBWRdnMHHg1NWkJ4fGs7eFP15IqZpQ== +jest-runner@^27.0.4: + version "27.0.4" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.0.4.tgz#2787170a9509b792ae129794f6944d27d5d12a4f" + integrity sha512-NfmvSYLCsCJk2AG8Ar2NAh4PhsJJpO+/r+g4bKR5L/5jFzx/indUpnVBdrfDvuqhGLLAvrKJ9FM/Nt8o1dsqxg== dependencies: "@jest/console" "^27.0.2" "@jest/environment" "^27.0.3" @@ -1942,20 +1942,22 @@ jest-runner@^27.0.3: exit "^0.1.2" graceful-fs "^4.2.4" jest-docblock "^27.0.1" + jest-environment-jsdom "^27.0.3" + jest-environment-node "^27.0.3" jest-haste-map "^27.0.2" jest-leak-detector "^27.0.2" jest-message-util "^27.0.2" - jest-resolve "^27.0.2" - jest-runtime "^27.0.3" + jest-resolve "^27.0.4" + jest-runtime "^27.0.4" jest-util "^27.0.2" jest-worker "^27.0.2" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.0.3.tgz#32499c1047e5d953cfbb67fe790ab0167a614d28" - integrity sha512-k1Hl2pWWHBkSXdCggX2lyLRuDnnnmMlnJd+DPLb8LmmAeHW87WgGC6TplD377VxY3KQu73sklkhGUIdwFgsRVQ== +jest-runtime@^27.0.4: + version "27.0.4" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.0.4.tgz#2e4a6aa77cac32ac612dfe12768387a8aa15c2f0" + integrity sha512-voJB4xbAjS/qYPboV+e+gmg3jfvHJJY4CagFWBOM9dQKtlaiTjcpD2tWwla84Z7PtXSQPeIpXY0qksA9Dum29A== dependencies: "@jest/console" "^27.0.2" "@jest/environment" "^27.0.3" @@ -1976,8 +1978,8 @@ jest-runtime@^27.0.3: jest-message-util "^27.0.2" jest-mock "^27.0.3" jest-regex-util "^27.0.1" - jest-resolve "^27.0.2" - jest-snapshot "^27.0.2" + jest-resolve "^27.0.4" + jest-snapshot "^27.0.4" jest-util "^27.0.2" jest-validate "^27.0.2" slash "^3.0.0" @@ -1992,10 +1994,10 @@ jest-serializer@^27.0.1: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.0.2.tgz#40c48dc6afd3cbc5d3d07c061f20fc10d94ca0cd" - integrity sha512-4RcgvZbPrrbEE/hT6XQ4hr+NVVLNrmsgUnYSnZRT6UAvW9Q2yzGMS+tfJh+xlQJAapnnkNJzsMn6vUa+yfiVHA== +jest-snapshot@^27.0.4: + version "27.0.4" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.0.4.tgz#2b96e22ca90382b3e93bd0aae2ce4c78bf51fb5b" + integrity sha512-hnjrvpKGdSMvKfbHyaG5Kul7pDJGZvjVy0CKpzhu28MmAssDXS6GpynhXzgst1wBQoKD8c9b2VS2a5yhDLQRCA== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" @@ -2016,7 +2018,7 @@ jest-snapshot@^27.0.2: jest-haste-map "^27.0.2" jest-matcher-utils "^27.0.2" jest-message-util "^27.0.2" - jest-resolve "^27.0.2" + jest-resolve "^27.0.4" jest-util "^27.0.2" natural-compare "^1.4.0" pretty-format "^27.0.2" @@ -2069,13 +2071,13 @@ jest-worker@^27.0.2: supports-color "^8.0.0" jest@^27.0.1: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.0.3.tgz#0b4ac738c93612f778d58250aee026220487e5a4" - integrity sha512-0G9+QqXFIZWgf5rs3yllpaA+13ZawVHfyuhuCV1EnoFbX++rVMRrYWCAnk+dfhwyv9/VTQvn+XG969u8aPRsBg== + version "27.0.4" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.0.4.tgz#91d4d564b36bcf93b98dac1ab19f07089e670f53" + integrity sha512-Px1iKFooXgGSkk1H8dJxxBIrM3tsc5SIuI4kfKYK2J+4rvCvPGr/cXktxh0e9zIPQ5g09kOMNfHQEmusBUf/ZA== dependencies: - "@jest/core" "^27.0.3" + "@jest/core" "^27.0.4" import-local "^3.0.2" - jest-cli "^27.0.3" + jest-cli "^27.0.4" js-tokens@^4.0.0: version "4.0.0" From 79464ec2c869df8a19b01e71da7ff483670d523e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Jun 2021 05:02:50 +0000 Subject: [PATCH 181/785] Bump prettier from 2.3.0 to 2.3.1 Bumps [prettier](https://github.com/prettier/prettier) from 2.3.0 to 2.3.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.3.0...2.3.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index c6a0b5ea..9e26a77a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2450,9 +2450,9 @@ prelude-ls@~1.1.2: integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= prettier@>=1.10: - version "2.3.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18" - integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w== + version "2.3.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.1.tgz#76903c3f8c4449bc9ac597acefa24dc5ad4cbea6" + integrity sha512-p+vNbgpLjif/+D+DwAZAbndtRrR0md0MwfmOVN9N+2RgyACMT+7tfaRnT+WDPkqnuVwleyuBIG2XBxKDme3hPA== pretty-format@^27.0.2: version "27.0.2" From a5d2769ce94c328966ac172dab070d09c84adefe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Jun 2021 05:03:04 +0000 Subject: [PATCH 182/785] Bump eslint from 7.27.0 to 7.28.0 Bumps [eslint](https://github.com/eslint/eslint) from 7.27.0 to 7.28.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v7.27.0...v7.28.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 42 +++++++++++++++--------------------------- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/yarn.lock b/yarn.lock index c6a0b5ea..79634d43 100644 --- a/yarn.lock +++ b/yarn.lock @@ -301,15 +301,15 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@eslint/eslintrc@^0.4.1": - version "0.4.1" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.1.tgz#442763b88cecbe3ee0ec7ca6d6dd6168550cbf14" - integrity sha512-5v7TDE9plVhvxQeWLXDTvFvJBdH6pEsdnl2g/dAptmuFEPedQ4Erq5rsDsX+mvAM610IhNaO2W5V1dOOnDKxkQ== +"@eslint/eslintrc@^0.4.2": + version "0.4.2" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.2.tgz#f63d0ef06f5c0c57d76c4ab5f63d3835c51b0179" + integrity sha512-8nmGq/4ycLpIwzvhI4tNDmQztZ8sp+hI7cyG8i1nQDhkAbRzHpXPidRAHlNvCZQpJTKw5ItIpMw9RSToGF00mg== dependencies: ajv "^6.12.4" debug "^4.1.1" espree "^7.3.0" - globals "^12.1.0" + globals "^13.9.0" ignore "^4.0.6" import-fresh "^3.2.1" js-yaml "^3.13.1" @@ -1166,12 +1166,12 @@ eslint-visitor-keys@^2.0.0: integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== eslint@^7.22.0: - version "7.27.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.27.0.tgz#665a1506d8f95655c9274d84bd78f7166b07e9c7" - integrity sha512-JZuR6La2ZF0UD384lcbnd0Cgg6QJjiCwhMD6eU4h/VGPcVGwawNNzKU41tgokGXnfjOOyI6QIffthhJTPzzuRA== + version "7.28.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.28.0.tgz#435aa17a0b82c13bb2be9d51408b617e49c1e820" + integrity sha512-UMfH0VSjP0G4p3EWirscJEQ/cHqnT/iuH6oNZOB94nBjWbMnhGEPxsZm1eyIW0C/9jLI0Fow4W5DXLjEI7mn1g== dependencies: "@babel/code-frame" "7.12.11" - "@eslint/eslintrc" "^0.4.1" + "@eslint/eslintrc" "^0.4.2" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" @@ -1188,7 +1188,7 @@ eslint@^7.22.0: fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" functional-red-black-tree "^1.0.1" - glob-parent "^5.0.0" + glob-parent "^5.1.2" globals "^13.6.0" ignore "^4.0.6" import-fresh "^3.0.0" @@ -1413,7 +1413,7 @@ get-stream@^6.0.0: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== -glob-parent@^5.0.0: +glob-parent@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== @@ -1437,17 +1437,10 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -globals@^12.1.0: - version "12.4.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-12.4.0.tgz#a18813576a41b00a24a97e7f815918c2e19925f8" - integrity sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg== - dependencies: - type-fest "^0.8.1" - -globals@^13.6.0: - version "13.8.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.8.0.tgz#3e20f504810ce87a8d72e55aecf8435b50f4c1b3" - integrity sha512-rHtdA6+PDBIjeEvA91rpqzEvk/k3/i7EeNQiryiWuJH0Hw9cpyJMAt2jtbAwUaRdhD+573X4vWw6IcjKPasi9Q== +globals@^13.6.0, globals@^13.9.0: + version "13.9.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.9.0.tgz#4bf2bf635b334a173fb1daf7c5e6b218ecdc06cb" + integrity sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA== dependencies: type-fest "^0.20.2" @@ -2833,11 +2826,6 @@ type-fest@^0.21.3: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== -type-fest@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" - integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== - typedarray-to-buffer@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" From bc45c16674de616be8965c6dc66e02c6e8f35bef Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Mon, 14 Jun 2021 09:47:18 -0400 Subject: [PATCH 183/785] Fix up prettier >= 2.3 args add star printing --- src/ruby/nodes/args.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/ruby/nodes/args.js b/src/ruby/nodes/args.js index e1a21b4c..14aa964d 100644 --- a/src/ruby/nodes/args.js +++ b/src/ruby/nodes/args.js @@ -157,8 +157,19 @@ function printArgsAddStar(path, opts, print) { path.each((argPath, argIndex) => { const doc = print(argPath); + // If it's the first child, then it's an array of args, so we're going to + // concat that onto the existing docs if there are any. + if (argIndex === 0) { + if (doc.length > 0) { + docs = docs.concat(doc); + } + return; + } + + // If it's after the splat, then it's an individual arg, so we're just going + // to push it onto the array. if (argIndex !== 1) { - docs = docs.concat(doc); + docs.push(doc); return; } From 7b9929d205986cb13959061933eb587bc803ac4c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Jun 2021 12:01:18 +0000 Subject: [PATCH 184/785] Bump pretty-quick from 3.1.0 to 3.1.1 Bumps [pretty-quick](https://github.com/azz/pretty-quick) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/azz/pretty-quick/releases) - [Commits](https://github.com/azz/pretty-quick/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: pretty-quick dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index b55d2e0a..5bd682d4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2458,9 +2458,9 @@ pretty-format@^27.0.2: react-is "^17.0.1" pretty-quick@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/pretty-quick/-/pretty-quick-3.1.0.tgz#cb172e9086deb57455dea7c7e8f136cd0a4aef6c" - integrity sha512-DtxIxksaUWCgPFN7E1ZZk4+Aav3CCuRdhrDSFZENb404sYMtuo9Zka823F+Mgeyt8Zt3bUiCjFzzWYE9LYqkmQ== + version "3.1.1" + resolved "https://registry.yarnpkg.com/pretty-quick/-/pretty-quick-3.1.1.tgz#93ca4e2dd38cc4e970e3f54a0ead317a25454688" + integrity sha512-ZYLGiMoV2jcaas3vTJrLvKAYsxDoXQBUn8OSTxkl67Fyov9lyXivJTl0+2WVh+y6EovGcw7Lm5ThYpH+Sh3XxQ== dependencies: chalk "^3.0.0" execa "^4.0.0" From d63e61951f19806c3ea75e51d2de17036e6c9c53 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Jun 2021 12:01:00 +0000 Subject: [PATCH 185/785] Bump eslint from 7.28.0 to 7.29.0 Bumps [eslint](https://github.com/eslint/eslint) from 7.28.0 to 7.29.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v7.28.0...v7.29.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5bd682d4..4bb9786e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1166,9 +1166,9 @@ eslint-visitor-keys@^2.0.0: integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== eslint@^7.22.0: - version "7.28.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.28.0.tgz#435aa17a0b82c13bb2be9d51408b617e49c1e820" - integrity sha512-UMfH0VSjP0G4p3EWirscJEQ/cHqnT/iuH6oNZOB94nBjWbMnhGEPxsZm1eyIW0C/9jLI0Fow4W5DXLjEI7mn1g== + version "7.29.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.29.0.tgz#ee2a7648f2e729485e4d0bd6383ec1deabc8b3c0" + integrity sha512-82G/JToB9qIy/ArBzIWG9xvvwL3R86AlCjtGw+A29OMZDqhTybz/MByORSukGxeI+YPCR4coYyITKk8BFH9nDA== dependencies: "@babel/code-frame" "7.12.11" "@eslint/eslintrc" "^0.4.2" From 42828271cb9cdaa4c05a47ca46bb738c8c58564d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Jun 2021 12:01:36 +0000 Subject: [PATCH 186/785] Bump jest from 27.0.4 to 27.0.5 Bumps [jest](https://github.com/facebook/jest) from 27.0.4 to 27.0.5. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v27.0.4...v27.0.5) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 292 +++++++++++++++++++++++++++--------------------------- 1 file changed, 146 insertions(+), 146 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4bb9786e..d27e1589 100644 --- a/yarn.lock +++ b/yarn.lock @@ -344,15 +344,15 @@ jest-util "^27.0.2" slash "^3.0.0" -"@jest/core@^27.0.4": - version "27.0.4" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.0.4.tgz#679bf9ac07900da2ddbb9667bb1afa8029038f53" - integrity sha512-+dsmV8VUs1h/Szb+rEWk8xBM1fp1I///uFy9nk3wXGvRsF2lBp8EVPmtWc+QFRb3MY2b7u2HbkGF1fzoDzQTLA== +"@jest/core@^27.0.5": + version "27.0.5" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.0.5.tgz#59e9e69e7374d65dbb22e3fc1bd52e80991eae72" + integrity sha512-g73//jF0VwsOIrWUC9Cqg03lU3QoAMFxVjsm6n6yNmwZcQPN/o8w+gLWODw5VfKNFZT38otXHWxc6b8eGDUpEA== dependencies: "@jest/console" "^27.0.2" - "@jest/reporters" "^27.0.4" + "@jest/reporters" "^27.0.5" "@jest/test-result" "^27.0.2" - "@jest/transform" "^27.0.2" + "@jest/transform" "^27.0.5" "@jest/types" "^27.0.2" "@types/node" "*" ansi-escapes "^4.2.1" @@ -361,15 +361,15 @@ exit "^0.1.2" graceful-fs "^4.2.4" jest-changed-files "^27.0.2" - jest-config "^27.0.4" - jest-haste-map "^27.0.2" + jest-config "^27.0.5" + jest-haste-map "^27.0.5" jest-message-util "^27.0.2" jest-regex-util "^27.0.1" - jest-resolve "^27.0.4" - jest-resolve-dependencies "^27.0.4" - jest-runner "^27.0.4" - jest-runtime "^27.0.4" - jest-snapshot "^27.0.4" + jest-resolve "^27.0.5" + jest-resolve-dependencies "^27.0.5" + jest-runner "^27.0.5" + jest-runtime "^27.0.5" + jest-snapshot "^27.0.5" jest-util "^27.0.2" jest-validate "^27.0.2" jest-watcher "^27.0.2" @@ -379,20 +379,20 @@ slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.0.3": - version "27.0.3" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.0.3.tgz#68769b1dfdd213e3456169d64fbe9bd63a5fda92" - integrity sha512-pN9m7fbKsop5vc3FOfH8NF7CKKdRbEZzcxfIo1n2TT6ucKWLFq0P6gCJH0GpnQp036++yY9utHOxpeT1WnkWTA== +"@jest/environment@^27.0.5": + version "27.0.5" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.0.5.tgz#a294ad4acda2e250f789fb98dc667aad33d3adc9" + integrity sha512-IAkJPOT7bqn0GiX5LPio6/e1YpcmLbrd8O5EFYpAOZ6V+9xJDsXjdgN2vgv9WOKIs/uA1kf5WeD96HhlBYO+FA== dependencies: - "@jest/fake-timers" "^27.0.3" + "@jest/fake-timers" "^27.0.5" "@jest/types" "^27.0.2" "@types/node" "*" jest-mock "^27.0.3" -"@jest/fake-timers@^27.0.3": - version "27.0.3" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.0.3.tgz#9899ba6304cc636734c74478df502e18136461dd" - integrity sha512-fQ+UCKRIYKvTCEOyKPnaPnomLATIhMnHC/xPZ7yT1Uldp7yMgMxoYIFidDbpSTgB79+/U+FgfoD30c6wg3IUjA== +"@jest/fake-timers@^27.0.5": + version "27.0.5" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.0.5.tgz#304d5aedadf4c75cff3696995460b39d6c6e72f6" + integrity sha512-d6Tyf7iDoKqeUdwUKrOBV/GvEZRF67m7lpuWI0+SCD9D3aaejiOQZxAOxwH2EH/W18gnfYaBPLi0VeTGBHtQBg== dependencies: "@jest/types" "^27.0.2" "@sinonjs/fake-timers" "^7.0.2" @@ -401,24 +401,24 @@ jest-mock "^27.0.3" jest-util "^27.0.2" -"@jest/globals@^27.0.3": - version "27.0.3" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.0.3.tgz#1cf8933b7791bba0b99305cbf39fd4d2e3fe4060" - integrity sha512-OzsIuf7uf+QalqAGbjClyezzEcLQkdZ+7PejUrZgDs+okdAK8GwRCGcYCirHvhMBBQh60Jr3NlIGbn/KBPQLEQ== +"@jest/globals@^27.0.5": + version "27.0.5" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.0.5.tgz#f63b8bfa6ea3716f8df50f6a604b5c15b36ffd20" + integrity sha512-qqKyjDXUaZwDuccpbMMKCCMBftvrbXzigtIsikAH/9ca+kaae8InP2MDf+Y/PdCSMuAsSpHS6q6M25irBBUh+Q== dependencies: - "@jest/environment" "^27.0.3" + "@jest/environment" "^27.0.5" "@jest/types" "^27.0.2" expect "^27.0.2" -"@jest/reporters@^27.0.4": - version "27.0.4" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.0.4.tgz#95609b1be97afb80d55d8aa3d7c3179c15810e65" - integrity sha512-Xa90Nm3JnV0xCe4M6A10M9WuN9krb+WFKxV1A98Y4ePCw40n++r7uxFUNU7DT1i9Behj7fjrAIju9oU0t1QtCg== +"@jest/reporters@^27.0.5": + version "27.0.5" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.0.5.tgz#cd730b77d9667b8ff700ad66d4edc293bb09716a" + integrity sha512-4uNg5+0eIfRafnpgu3jCZws3NNcFzhu5JdRd1mKQ4/53+vkIqwB6vfZ4gn5BdGqOaLtYhlOsPaL5ATkKzyBrJw== dependencies: "@bcoe/v8-coverage" "^0.2.3" "@jest/console" "^27.0.2" "@jest/test-result" "^27.0.2" - "@jest/transform" "^27.0.2" + "@jest/transform" "^27.0.5" "@jest/types" "^27.0.2" chalk "^4.0.0" collect-v8-coverage "^1.0.0" @@ -430,15 +430,15 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^27.0.2" - jest-resolve "^27.0.4" + jest-haste-map "^27.0.5" + jest-resolve "^27.0.5" jest-util "^27.0.2" jest-worker "^27.0.2" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" terminal-link "^2.0.0" - v8-to-istanbul "^7.0.0" + v8-to-istanbul "^8.0.0" "@jest/source-map@^27.0.1": version "27.0.1" @@ -459,20 +459,20 @@ "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.0.4": - version "27.0.4" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.0.4.tgz#976493b277594d81e589896f0ed21f198308928a" - integrity sha512-6UFEVwdmxYdyNffBxVVZxmXEdBE4riSddXYSnFNH0ELFQFk/bvagizim8WfgJTqF4EKd+j1yFxvhb8BMHfOjSQ== +"@jest/test-sequencer@^27.0.5": + version "27.0.5" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.0.5.tgz#c58b21db49afc36c0e3921d7ddf1fb7954abfded" + integrity sha512-opztnGs+cXzZ5txFG2+omBaV5ge/0yuJNKbhE3DREMiXE0YxBuzyEa6pNv3kk2JuucIlH2Xvgmn9kEEHSNt/SA== dependencies: "@jest/test-result" "^27.0.2" graceful-fs "^4.2.4" - jest-haste-map "^27.0.2" - jest-runtime "^27.0.4" + jest-haste-map "^27.0.5" + jest-runtime "^27.0.5" -"@jest/transform@^27.0.2": - version "27.0.2" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.0.2.tgz#b073b7c589e3f4b842102468875def2bb722d6b5" - integrity sha512-H8sqKlgtDfVog/s9I4GG2XMbi4Ar7RBxjsKQDUhn2XHAi3NG+GoQwWMER+YfantzExbjNqQvqBHzo/G2pfTiPw== +"@jest/transform@^27.0.5": + version "27.0.5" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.0.5.tgz#2dcb78953708af713941ac845b06078bc74ed873" + integrity sha512-lBD6OwKXSc6JJECBNk4mVxtSVuJSBsQrJ9WCBisfJs7EZuYq4K6vM9HmoB7hmPiLIDGeyaerw3feBV/bC4z8tg== dependencies: "@babel/core" "^7.1.0" "@jest/types" "^27.0.2" @@ -481,7 +481,7 @@ convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.0.2" + jest-haste-map "^27.0.5" jest-regex-util "^27.0.1" jest-util "^27.0.2" micromatch "^4.0.4" @@ -747,12 +747,12 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= -babel-jest@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.0.2.tgz#7dc18adb01322acce62c2af76ea2c7cd186ade37" - integrity sha512-9OThPl3/IQbo4Yul2vMz4FYwILPQak8XelX4YGowygfHaOl5R5gfjm4iVx4d8aUugkW683t8aq0A74E7b5DU1Q== +babel-jest@^27.0.5: + version "27.0.5" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.0.5.tgz#cd34c033ada05d1362211e5152391fd7a88080c8" + integrity sha512-bTMAbpCX7ldtfbca2llYLeSFsDM257aspyAOpsdrdSrBqoLkWCy4HPYTXtXWaSLgFPjrJGACL65rzzr4RFGadw== dependencies: - "@jest/transform" "^27.0.2" + "@jest/transform" "^27.0.5" "@jest/types" "^27.0.2" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.0.0" @@ -1672,12 +1672,12 @@ jest-changed-files@^27.0.2: execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.0.4: - version "27.0.4" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.0.4.tgz#3b261514ee3b3da33def736a6352c98ff56bb6e6" - integrity sha512-QD+eblDiRphta630WRKewuASLs/oY1Zki2G4bccntRvrTHQ63ljwFR5TLduuK4Zg0ZPzW0+8o6AP7KRd1yKOjw== +jest-circus@^27.0.5: + version "27.0.5" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.0.5.tgz#b5e327f1d6857c8485126f8e364aefa4378debaa" + integrity sha512-p5rO90o1RTh8LPOG6l0Fc9qgp5YGv+8M5CFixhMh7gGHtGSobD1AxX9cjFZujILgY8t30QZ7WVvxlnuG31r8TA== dependencies: - "@jest/environment" "^27.0.3" + "@jest/environment" "^27.0.5" "@jest/test-result" "^27.0.2" "@jest/types" "^27.0.2" "@types/node" "*" @@ -1689,54 +1689,54 @@ jest-circus@^27.0.4: jest-each "^27.0.2" jest-matcher-utils "^27.0.2" jest-message-util "^27.0.2" - jest-runtime "^27.0.4" - jest-snapshot "^27.0.4" + jest-runtime "^27.0.5" + jest-snapshot "^27.0.5" jest-util "^27.0.2" pretty-format "^27.0.2" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.0.4: - version "27.0.4" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.0.4.tgz#491b12c754c0d7c6873b13a66f26b3a80a852910" - integrity sha512-E0T+/i2lxsWAzV7LKYd0SB7HUAvePqaeIh5vX43/G5jXLhv1VzjYzJAGEkTfvxV774ll9cyE2ljcL73PVMEOXQ== +jest-cli@^27.0.5: + version "27.0.5" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.0.5.tgz#f359ba042624cffb96b713010a94bffb7498a37c" + integrity sha512-kZqY020QFOFQKVE2knFHirTBElw3/Q0kUbDc3nMfy/x+RQ7zUY89SUuzpHHJoSX1kX7Lq569ncvjNqU3Td/FCA== dependencies: - "@jest/core" "^27.0.4" + "@jest/core" "^27.0.5" "@jest/test-result" "^27.0.2" "@jest/types" "^27.0.2" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.0.4" + jest-config "^27.0.5" jest-util "^27.0.2" jest-validate "^27.0.2" prompts "^2.0.1" yargs "^16.0.3" -jest-config@^27.0.4: - version "27.0.4" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.0.4.tgz#c4f41378acf40ca77860fb4e213b12109d87b8cf" - integrity sha512-VkQFAHWnPQefdvHU9A+G3H/Z3NrrTKqWpvxgQz3nkUdkDTWeKJE6e//BL+R7z79dXOMVksYgM/z6ndtN0hfChg== +jest-config@^27.0.5: + version "27.0.5" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.0.5.tgz#683da3b0d8237675c29c817f6e3aba1481028e19" + integrity sha512-zCUIXag7QIXKEVN4kUKbDBDi9Q53dV5o3eNhGqe+5zAbt1vLs4VE3ceWaYrOub0L4Y7E9pGfM84TX/0ARcE+Qw== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.0.4" + "@jest/test-sequencer" "^27.0.5" "@jest/types" "^27.0.2" - babel-jest "^27.0.2" + babel-jest "^27.0.5" chalk "^4.0.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" is-ci "^3.0.0" - jest-circus "^27.0.4" - jest-environment-jsdom "^27.0.3" - jest-environment-node "^27.0.3" + jest-circus "^27.0.5" + jest-environment-jsdom "^27.0.5" + jest-environment-node "^27.0.5" jest-get-type "^27.0.1" - jest-jasmine2 "^27.0.4" + jest-jasmine2 "^27.0.5" jest-regex-util "^27.0.1" - jest-resolve "^27.0.4" - jest-runner "^27.0.4" + jest-resolve "^27.0.5" + jest-runner "^27.0.5" jest-util "^27.0.2" jest-validate "^27.0.2" micromatch "^4.0.4" @@ -1770,26 +1770,26 @@ jest-each@^27.0.2: jest-util "^27.0.2" pretty-format "^27.0.2" -jest-environment-jsdom@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.0.3.tgz#ed73e913ddc03864eb9f934b5cbabf1b63504e2e" - integrity sha512-5KLmgv1bhiimpSA8oGTnZYk6g4fsNyZiA/6gI2tAZUgrufd7heRUSVh4gRokzZVEj8zlwAQYT0Zs6tuJSW/ECA== +jest-environment-jsdom@^27.0.5: + version "27.0.5" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.0.5.tgz#c36771977cf4490a9216a70473b39161d193c212" + integrity sha512-ToWhViIoTl5738oRaajTMgYhdQL73UWPoV4GqHGk2DPhs+olv8OLq5KoQW8Yf+HtRao52XLqPWvl46dPI88PdA== dependencies: - "@jest/environment" "^27.0.3" - "@jest/fake-timers" "^27.0.3" + "@jest/environment" "^27.0.5" + "@jest/fake-timers" "^27.0.5" "@jest/types" "^27.0.2" "@types/node" "*" jest-mock "^27.0.3" jest-util "^27.0.2" jsdom "^16.6.0" -jest-environment-node@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.0.3.tgz#b4acb3679d2552a4215732cab8b0ca7ec4398ee0" - integrity sha512-co2/IVnIFL3cItpFULCvXFg9us4gvWXgs7mutAMPCbFhcqh56QAOdKhNzC2+RycsC/k4mbMj1VF+9F/NzA0ROg== +jest-environment-node@^27.0.5: + version "27.0.5" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.0.5.tgz#b7238fc2b61ef2fb9563a3b7653a95fa009a6a54" + integrity sha512-47qqScV/WMVz5OKF5TWpAeQ1neZKqM3ySwNveEnLyd+yaE/KT6lSMx/0SOx60+ZUcVxPiESYS+Kt2JS9y4PpkQ== dependencies: - "@jest/environment" "^27.0.3" - "@jest/fake-timers" "^27.0.3" + "@jest/environment" "^27.0.5" + "@jest/fake-timers" "^27.0.5" "@jest/types" "^27.0.2" "@types/node" "*" jest-mock "^27.0.3" @@ -1800,10 +1800,10 @@ jest-get-type@^27.0.1: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.1.tgz#34951e2b08c8801eb28559d7eb732b04bbcf7815" integrity sha512-9Tggo9zZbu0sHKebiAijyt1NM77Z0uO4tuWOxUCujAiSeXv30Vb5D4xVF4UR4YWNapcftj+PbByU54lKD7/xMg== -jest-haste-map@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.0.2.tgz#3f1819400c671237e48b4d4b76a80a0dbed7577f" - integrity sha512-37gYfrYjjhEfk37C4bCMWAC0oPBxDpG0qpl8lYg8BT//wf353YT/fzgA7+Dq0EtM7rPFS3JEcMsxdtDwNMi2cA== +jest-haste-map@^27.0.5: + version "27.0.5" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.0.5.tgz#2e1e55073b5328410a2c0d74b334e513d71f3470" + integrity sha512-3LFryGSHxwPFHzKIs6W0BGA2xr6g1MvzSjR3h3D8K8Uqy4vbRm/grpGHzbPtIbOPLC6wFoViRrNEmd116QWSkw== dependencies: "@jest/types" "^27.0.2" "@types/graceful-fs" "^4.1.2" @@ -1820,13 +1820,13 @@ jest-haste-map@^27.0.2: optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.0.4: - version "27.0.4" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.0.4.tgz#c669519ccf4904a485338555e1e66cad36bb0670" - integrity sha512-yj3WrjjquZwkJw+eA4c9yucHw4/+EHndHWSqgHbHGQfT94ihaaQsa009j1a0puU8CNxPDk0c1oAPeOpdJUElwA== +jest-jasmine2@^27.0.5: + version "27.0.5" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.0.5.tgz#8a6eb2a685cdec3af13881145c77553e4e197776" + integrity sha512-m3TojR19sFmTn79QoaGy1nOHBcLvtLso6Zh7u+gYxZWGcza4rRPVqwk1hciA5ZOWWZIJOukAcore8JRX992FaA== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^27.0.3" + "@jest/environment" "^27.0.5" "@jest/source-map" "^27.0.1" "@jest/test-result" "^27.0.2" "@jest/types" "^27.0.2" @@ -1838,8 +1838,8 @@ jest-jasmine2@^27.0.4: jest-each "^27.0.2" jest-matcher-utils "^27.0.2" jest-message-util "^27.0.2" - jest-runtime "^27.0.4" - jest-snapshot "^27.0.4" + jest-runtime "^27.0.5" + jest-snapshot "^27.0.5" jest-util "^27.0.2" pretty-format "^27.0.2" throat "^6.0.1" @@ -1895,19 +1895,19 @@ jest-regex-util@^27.0.1: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.1.tgz#69d4b1bf5b690faa3490113c47486ed85dd45b68" integrity sha512-6nY6QVcpTgEKQy1L41P4pr3aOddneK17kn3HJw6SdwGiKfgCGTvH02hVXL0GU8GEKtPH83eD2DIDgxHXOxVohQ== -jest-resolve-dependencies@^27.0.4: - version "27.0.4" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.0.4.tgz#a07a242d70d668afd3fcf7f4270755eebb1fe579" - integrity sha512-F33UPfw1YGWCV2uxJl7wD6TvcQn5IC0LtguwY3r4L7R6H4twpLkp5Q2ZfzRx9A2I3G8feiy0O0sqcn/Qoym71A== +jest-resolve-dependencies@^27.0.5: + version "27.0.5" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.0.5.tgz#819ccdddd909c65acddb063aac3a49e4ba1ed569" + integrity sha512-xUj2dPoEEd59P+nuih4XwNa4nJ/zRd/g4rMvjHrZPEBWeWRq/aJnnM6mug+B+Nx+ILXGtfWHzQvh7TqNV/WbuA== dependencies: "@jest/types" "^27.0.2" jest-regex-util "^27.0.1" - jest-snapshot "^27.0.4" + jest-snapshot "^27.0.5" -jest-resolve@^27.0.4: - version "27.0.4" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.0.4.tgz#8a27bc3f2f00c8ea28f3bc99bbf6f468300a703d" - integrity sha512-BcfyK2i3cG79PDb/6gB6zFeFQlcqLsQjGBqznFCpA0L/3l1L/oOsltdUjs5eISAWA9HS9qtj8v2PSZr/yWxONQ== +jest-resolve@^27.0.5: + version "27.0.5" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.0.5.tgz#937535a5b481ad58e7121eaea46d1424a1e0c507" + integrity sha512-Md65pngRh8cRuWVdWznXBB5eDt391OJpdBaJMxfjfuXCvOhM3qQBtLMCMTykhuUKiBMmy5BhqCW7AVOKmPrW+Q== dependencies: "@jest/types" "^27.0.2" chalk "^4.0.0" @@ -1919,15 +1919,15 @@ jest-resolve@^27.0.4: resolve "^1.20.0" slash "^3.0.0" -jest-runner@^27.0.4: - version "27.0.4" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.0.4.tgz#2787170a9509b792ae129794f6944d27d5d12a4f" - integrity sha512-NfmvSYLCsCJk2AG8Ar2NAh4PhsJJpO+/r+g4bKR5L/5jFzx/indUpnVBdrfDvuqhGLLAvrKJ9FM/Nt8o1dsqxg== +jest-runner@^27.0.5: + version "27.0.5" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.0.5.tgz#b6fdc587e1a5056339205914294555c554efc08a" + integrity sha512-HNhOtrhfKPArcECgBTcWOc+8OSL8GoFoa7RsHGnfZR1C1dFohxy9eLtpYBS+koybAHlJLZzNCx2Y/Ic3iEtJpQ== dependencies: "@jest/console" "^27.0.2" - "@jest/environment" "^27.0.3" + "@jest/environment" "^27.0.5" "@jest/test-result" "^27.0.2" - "@jest/transform" "^27.0.2" + "@jest/transform" "^27.0.5" "@jest/types" "^27.0.2" "@types/node" "*" chalk "^4.0.0" @@ -1935,30 +1935,30 @@ jest-runner@^27.0.4: exit "^0.1.2" graceful-fs "^4.2.4" jest-docblock "^27.0.1" - jest-environment-jsdom "^27.0.3" - jest-environment-node "^27.0.3" - jest-haste-map "^27.0.2" + jest-environment-jsdom "^27.0.5" + jest-environment-node "^27.0.5" + jest-haste-map "^27.0.5" jest-leak-detector "^27.0.2" jest-message-util "^27.0.2" - jest-resolve "^27.0.4" - jest-runtime "^27.0.4" + jest-resolve "^27.0.5" + jest-runtime "^27.0.5" jest-util "^27.0.2" jest-worker "^27.0.2" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.0.4: - version "27.0.4" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.0.4.tgz#2e4a6aa77cac32ac612dfe12768387a8aa15c2f0" - integrity sha512-voJB4xbAjS/qYPboV+e+gmg3jfvHJJY4CagFWBOM9dQKtlaiTjcpD2tWwla84Z7PtXSQPeIpXY0qksA9Dum29A== +jest-runtime@^27.0.5: + version "27.0.5" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.0.5.tgz#cd5d1aa9754d30ddf9f13038b3cb7b95b46f552d" + integrity sha512-V/w/+VasowPESbmhXn5AsBGPfb35T7jZPGZybYTHxZdP7Gwaa+A0EXE6rx30DshHKA98lVCODbCO8KZpEW3hiQ== dependencies: "@jest/console" "^27.0.2" - "@jest/environment" "^27.0.3" - "@jest/fake-timers" "^27.0.3" - "@jest/globals" "^27.0.3" + "@jest/environment" "^27.0.5" + "@jest/fake-timers" "^27.0.5" + "@jest/globals" "^27.0.5" "@jest/source-map" "^27.0.1" "@jest/test-result" "^27.0.2" - "@jest/transform" "^27.0.2" + "@jest/transform" "^27.0.5" "@jest/types" "^27.0.2" "@types/yargs" "^16.0.0" chalk "^4.0.0" @@ -1967,12 +1967,12 @@ jest-runtime@^27.0.4: exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-haste-map "^27.0.2" + jest-haste-map "^27.0.5" jest-message-util "^27.0.2" jest-mock "^27.0.3" jest-regex-util "^27.0.1" - jest-resolve "^27.0.4" - jest-snapshot "^27.0.4" + jest-resolve "^27.0.5" + jest-snapshot "^27.0.5" jest-util "^27.0.2" jest-validate "^27.0.2" slash "^3.0.0" @@ -1987,10 +1987,10 @@ jest-serializer@^27.0.1: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^27.0.4: - version "27.0.4" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.0.4.tgz#2b96e22ca90382b3e93bd0aae2ce4c78bf51fb5b" - integrity sha512-hnjrvpKGdSMvKfbHyaG5Kul7pDJGZvjVy0CKpzhu28MmAssDXS6GpynhXzgst1wBQoKD8c9b2VS2a5yhDLQRCA== +jest-snapshot@^27.0.5: + version "27.0.5" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.0.5.tgz#6e3b9e8e193685372baff771ba34af631fe4d4d5" + integrity sha512-H1yFYdgnL1vXvDqMrnDStH6yHFdMEuzYQYc71SnC/IJnuuhW6J16w8GWG1P+qGd3Ag3sQHjbRr0TcwEo/vGS+g== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" @@ -1998,7 +1998,7 @@ jest-snapshot@^27.0.4: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/transform" "^27.0.2" + "@jest/transform" "^27.0.5" "@jest/types" "^27.0.2" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.1.5" @@ -2008,10 +2008,10 @@ jest-snapshot@^27.0.4: graceful-fs "^4.2.4" jest-diff "^27.0.2" jest-get-type "^27.0.1" - jest-haste-map "^27.0.2" + jest-haste-map "^27.0.5" jest-matcher-utils "^27.0.2" jest-message-util "^27.0.2" - jest-resolve "^27.0.4" + jest-resolve "^27.0.5" jest-util "^27.0.2" natural-compare "^1.4.0" pretty-format "^27.0.2" @@ -2064,13 +2064,13 @@ jest-worker@^27.0.2: supports-color "^8.0.0" jest@^27.0.1: - version "27.0.4" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.0.4.tgz#91d4d564b36bcf93b98dac1ab19f07089e670f53" - integrity sha512-Px1iKFooXgGSkk1H8dJxxBIrM3tsc5SIuI4kfKYK2J+4rvCvPGr/cXktxh0e9zIPQ5g09kOMNfHQEmusBUf/ZA== + version "27.0.5" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.0.5.tgz#141825e105514a834cc8d6e44670509e8d74c5f2" + integrity sha512-4NlVMS29gE+JOZvgmSAsz3eOjkSsHqjTajlIsah/4MVSmKvf3zFP/TvgcLoWe2UVHiE9KF741sReqhF0p4mqbQ== dependencies: - "@jest/core" "^27.0.4" + "@jest/core" "^27.0.5" import-local "^3.0.2" - jest-cli "^27.0.4" + jest-cli "^27.0.5" js-tokens@^4.0.0: version "4.0.0" @@ -2850,10 +2850,10 @@ v8-compile-cache@^2.0.3: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== -v8-to-istanbul@^7.0.0: - version "7.1.2" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-7.1.2.tgz#30898d1a7fa0c84d225a2c1434fb958f290883c1" - integrity sha512-TxNb7YEUwkLXCQYeudi6lgQ/SZrzNO4kMdlqVxaZPUIUjCv6iSSypUQX70kNBSERpQ8fk48+d61FXk+tgqcWow== +v8-to-istanbul@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.0.0.tgz#4229f2a99e367f3f018fa1d5c2b8ec684667c69c" + integrity sha512-LkmXi8UUNxnCC+JlH7/fsfsKr5AU110l+SYGJimWNkWhxbN5EyeOtm1MJ0hhvqMMOhGwBj1Fp70Yv9i+hX0QAg== dependencies: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" From 42a8f9a78477a2abe2a4b01025e82f0434a14d0d Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 23 Jun 2021 10:27:16 -0400 Subject: [PATCH 187/785] Fix for #904 --- CHANGELOG.md | 1 + src/ruby/nodes/strings.js | 87 +++++++++++++++++++++++++++++- src/ruby/parser.rb | 2 +- src/utils/skipAssignIndent.js | 9 +++- test/js/ruby/nodes/strings.test.js | 35 ++++++++++-- 5 files changed, 128 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 148e6396..e81d424c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Added - [#859](https://github.com/prettier/plugin-ruby/issues/859) - azz, kddeisz - Support the `--insert-pragma` option for the incremental adoption workflow. +- [#904](https://github.com/prettier/plugin-ruby/issues/904) - Hansenq, kddeisz - Support the `%s` symbol literal syntax. ### Changed diff --git a/src/ruby/nodes/strings.js b/src/ruby/nodes/strings.js index 2a1d1cbb..4ff54103 100644 --- a/src/ruby/nodes/strings.js +++ b/src/ruby/nodes/strings.js @@ -82,12 +82,97 @@ function printChar(path, { rubySingleQuote }, _print) { return concat([quote, body.slice(1), quote]); } +function printPercentSDynaSymbol(path, opts, print) { + const node = path.getValue(); + const parts = []; + + // Push on the quote, which includes the opening character. + parts.push(node.quote); + + path.each((childPath) => { + const childNode = childPath.getValue(); + + if (childNode.type !== "@tstring_content") { + // Here we are printing an embedded variable or expression. + parts.push(print(childPath)); + } else { + // Here we are printing plain string content. + parts.push(join(literalline, childNode.body.split("\n"))); + } + }, "body"); + + // Push on the closing character, which is the opposite of the third + // character from the opening. + parts.push(quotePairs[node.quote[2]]); + + return concat(parts); +} + +// We don't actually want to print %s symbols, as they're much more rarely seen +// in the wild. But we're going to be forced into it if it's a multi-line symbol +// or if the quoting would get super complicated. +function shouldPrintPercentSDynaSymbol(node) { + // We shouldn't print a %s dyna symbol if it was not already that way in the + // original source. + if (node.quote[0] !== "%") { + return false; + } + + // Here we're going to check if there is a closing character, a new line, or a + // quote in the content of the dyna symbol. If there is, then quoting could + // get weird, so just bail out and stick to the original bounds in the source. + const closing = quotePairs[node.quote[2]]; + + return node.body.some( + (child) => + child.type === "@tstring_content" && + (child.body.includes("\n") || + child.body.includes(closing) || + child.body.includes("'") || + child.body.includes('"')) + ); +} + // Prints a dynamic symbol. Assumes there's a quote property attached to the // node that will tell us which quote to use when printing. We're just going to // use whatever quote was provided. +// +// In the case of a plain dyna symbol, node.quote will be either :" or :' +// For %s dyna symbols, node.quote will be %s[, %s(, %s{, or %s< function printDynaSymbol(path, opts, print) { const node = path.getValue(); - const parts = [node.quote].concat(path.map(print, "body")).concat(node.quote); + + if (shouldPrintPercentSDynaSymbol(node)) { + return printPercentSDynaSymbol(path, opts, print); + } + + const parts = []; + let quote; + + if (isQuoteLocked(node)) { + if (node.quote.startsWith("%")) { + quote = opts.rubySingleQuote ? "'" : '"'; + } else { + quote = node.quote.slice(1); + } + } else { + quote = opts.rubySingleQuote && isSingleQuotable(node) ? "'" : '"'; + } + + parts.push(quote); + path.each((childPath) => { + const child = childPath.getValue(); + + if (child.type !== "@tstring_content") { + parts.push(print(childPath)); + } else { + parts.push( + join(literalline, normalizeQuotes(child.body, quote).split("\n")) + ); + } + }, "body"); + + parts.push(quote); // If we're inside of an assoc_new node as the key, then it will handle // printing the : on its own since it could change sides. diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index ee57c4b8..56f6c55d 100755 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -1092,7 +1092,7 @@ def on_dyna_symbol(string) beging.merge( type: :dyna_symbol, - quote: beging[:body][1], + quote: beging[:body], body: string[:body], el: ending[:el], ec: ending[:ec] diff --git a/src/utils/skipAssignIndent.js b/src/utils/skipAssignIndent.js index e0ee21cf..a6070d86 100644 --- a/src/utils/skipAssignIndent.js +++ b/src/utils/skipAssignIndent.js @@ -1,4 +1,11 @@ -const skippable = ["array", "hash", "heredoc", "lambda", "regexp_literal"]; +const skippable = [ + "array", + "dyna_symbol", + "hash", + "heredoc", + "lambda", + "regexp_literal" +]; function skipAssignIndent(node) { return ( diff --git a/test/js/ruby/nodes/strings.test.js b/test/js/ruby/nodes/strings.test.js index 05bcd595..0d4a982a 100644 --- a/test/js/ruby/nodes/strings.test.js +++ b/test/js/ruby/nodes/strings.test.js @@ -169,14 +169,43 @@ describe("strings", () => { test("with single quotes", () => expect(":'abc'").toMatchFormat()); - test("with double quotes", () => expect(`:"abc"`).toMatchFormat()); + test("with double quotes", () => expect(`:"abc"`).toChangeFormat(":'abc'")); - test("with false interpolation and single quotes", () => - expect(":'abc#{foo}abc'").toMatchFormat()); + test("with double quotes with double quotes desired", () => + expect(`:"abc"`).toMatchFormat({ rubySingleQuote: false })); + + test("with false interpolation and single quotes, no rubySingleQuote", () => + expect(":'abc#{foo}abc'").toMatchFormat({ rubySingleQuote: false })); test("with real interpolation and double quotes", () => expect(`:"abc#{foo}abc"`).toMatchFormat()); + test("with real interpolation and double quotes, rubySingleQuote", () => + expect(`:"abc#{foo}abc"`).toMatchFormat({ rubySingleQuote: true })); + + test("%s literal", () => expect("%s[abc]").toChangeFormat(":'abc'")); + + test("%s literal with false interpolation", () => + expect("%s[abc#{d}]").toChangeFormat(":'abc#{d}'")); + + test("%s literal as hash key", () => + expect("{ %s[abc] => d }").toChangeFormat("{ 'abc': d }")); + + test("%s literal as hash key, no rubySingleQuote", () => + expect("{ %s[abc] => d }").toChangeFormat(`{ "abc": d }`, { + rubySingleQuote: false + })); + + test("%s literal with newlines", () => { + const content = ruby(` + a = %s[ + a + ] + `); + + return expect(content).toMatchFormat(); + }); + test("gets correct quotes", () => { const content = "where('lint_tool_configs.plugin': plugins + %w[core])"; From 322d5e83b258af5366dd6d31e42b17f239918c28 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 23 Jun 2021 10:34:22 -0400 Subject: [PATCH 188/785] Clean up templates --- .github/ISSUE_TEMPLATE/bug.md | 18 +++++++++++------- .github/ISSUE_TEMPLATE/formatting.md | 18 +++++++++++------- README.md | 24 ++++++++++++------------ 3 files changed, 34 insertions(+), 26 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md index 50ff8b22..318ae337 100644 --- a/.github/ISSUE_TEMPLATE/bug.md +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -5,14 +5,18 @@ about: Issues with prettier crashing ## Metadata -- Ruby version: ... -- `@prettier/plugin-ruby` or `prettier` gem version: ... +- Operating system: Ubuntu +- Ruby version: latest +- Node version: latest +- `@prettier/plugin-ruby` or `prettier` gem version: latest - Options: - - [x] `rubyHashLabel` - - [x] `rubyModifier` - - [x] `rubySingleQuote` - - [ ] `rubyToProc` - - [ ] `trailingComma` + - `rubyArrayLiteral` - `true` + - `rubyHashLabel` - `true` + - `rubyModifier` - `true` + - `rubyNetcatCommand` - `null` + - `rubySingleQuote` - `true` + - `rubyToProc` - `false` + - `trailingComma` - `"none"` ## Input diff --git a/.github/ISSUE_TEMPLATE/formatting.md b/.github/ISSUE_TEMPLATE/formatting.md index 62c918ac..3efda83b 100644 --- a/.github/ISSUE_TEMPLATE/formatting.md +++ b/.github/ISSUE_TEMPLATE/formatting.md @@ -5,14 +5,18 @@ about: Issues for ugly or incorrect code ## Metadata -- Ruby version: ... -- `@prettier/plugin-ruby` or `prettier` gem version: ... +- Operating system: Ubuntu +- Ruby version: latest +- Node version: latest +- `@prettier/plugin-ruby` or `prettier` gem version: latest - Options: - - [x] `rubyHashLabel` - - [x] `rubyModifier` - - [x] `rubySingleQuote` - - [ ] `rubyToProc` - - [ ] `trailingComma` + - `rubyArrayLiteral` - `true` + - `rubyHashLabel` - `true` + - `rubyModifier` - `true` + - `rubyNetcatCommand` - `null` + - `rubySingleQuote` - `true` + - `rubyToProc` - `false` + - `trailingComma` - `"none"` ## Input diff --git a/README.md b/README.md index 9b89b60e..e15bcea9 100644 --- a/README.md +++ b/README.md @@ -128,18 +128,18 @@ The `prettier` executable is now installed and ready for use: Below are the options (from [`src/plugin.js`](src/plugin.js)) that `@prettier/plugin-ruby` currently supports: -| API Option | CLI Option | Default | Description | -| ------------------- | ----------------------- | :-----: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `printWidth` | `--print-width` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)). | -| `requirePragma` | `--require-pragma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#require-pragma)). | -| `rubyArrayLiteral` | `--ruby-array-literal` | `true` | When possible, favor the use of string and symbol array literals. | -| `rubyHashLabel` | `--ruby-hash-label` | `true` | When possible, uses the shortened hash key syntax, as opposed to hash rockets. | -| `rubyModifier` | `--ruby-modifier` | `true` | When it fits on one line, allows while and until statements to use the modifier form. | -| `rubyNetcatCommand` | `--ruby-netcat-command` | | The prefix of the command to execute to communicate between the node.js process and the Ruby process. (For example, `"nc -U"` or `"telnet -u"`) Normally you should not set this option. | -| `rubySingleQuote` | `--ruby-single-quote` | `true` | When double quotes are not necessary for interpolation, prefers the use of single quotes for string literals. | -| `rubyToProc` | `--ruby-to-proc` | `false` | When possible, convert blocks to the more concise `Symbol#to_proc` syntax. | -| `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). | -| `trailingComma` | `--trailing-comma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#trailing-comma)). `"es5"` is equivalent to `true`. | +| API Option | CLI Option | Default | Description | +| ------------------- | ----------------------- | :------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `printWidth` | `--print-width` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)). | +| `requirePragma` | `--require-pragma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#require-pragma)). | +| `rubyArrayLiteral` | `--ruby-array-literal` | `true` | When possible, favor the use of string and symbol array literals. | +| `rubyHashLabel` | `--ruby-hash-label` | `true` | When possible, uses the shortened hash key syntax, as opposed to hash rockets. | +| `rubyModifier` | `--ruby-modifier` | `true` | When it fits on one line, allows while and until statements to use the modifier form. | +| `rubyNetcatCommand` | `--ruby-netcat-command` | | The prefix of the command to execute to communicate between the node.js process and the Ruby process. (For example, `"nc -U"` or `"telnet -u"`) Normally you should not set this option. | +| `rubySingleQuote` | `--ruby-single-quote` | `true` | When double quotes are not necessary for interpolation, prefers the use of single quotes for string literals. | +| `rubyToProc` | `--ruby-to-proc` | `false` | When possible, convert blocks to the more concise `Symbol#to_proc` syntax. | +| `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). | +| `trailingComma` | `--trailing-comma` | `"none"` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#trailing-comma)). `"es5"` is equivalent to `true`. | Any of these can be added to your existing [prettier configuration file](https://prettier.io/docs/en/configuration.html). For example: From 4ff91ba3dcb04d7053b381e2ed0fbf8b8ed1c47e Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 23 Jun 2021 10:37:11 -0400 Subject: [PATCH 189/785] master -> main --- .github/workflows/main.yml | 4 ++-- CONTRIBUTING.md | 4 ++-- src/plugin.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e9dce094..cc7aeba8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,7 +22,7 @@ jobs: env: PLUGIN_RUBY_CI: true steps: - - uses: actions/checkout@master + - uses: actions/checkout@main - uses: ruby/setup-ruby@v1 with: bundler-cache: true @@ -49,7 +49,7 @@ jobs: env: PLUGIN_RUBY_CI: true steps: - - uses: actions/checkout@master + - uses: actions/checkout@main - uses: ruby/setup-ruby@v1 with: bundler-cache: true diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7e12101e..de1229f0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -75,7 +75,7 @@ Once prettier has a working AST, it will take it and call the selected plugin's Effectively, it walks the AST in the reverse direction from the way `Ripper` built it (top-down instead of bottom-up). The first node that gets passed into the `print` function is the `program` node as that's always on top. Then it is the `program` node's responsibility to recursively call print on its child nodes as it best sees fit. -As the nodes are printing themselves and their children, they're additionally building up a second AST. That AST is built using the `builder` commands from prettier core, described [here](https://github.com/prettier/prettier/blob/master/commands.md). As an example, below is how a `binary` node (like the one representing the `1 + 1` above) would handle printing itself: +As the nodes are printing themselves and their children, they're additionally building up a second AST. That AST is built using the `builder` commands from prettier core, described [here](https://github.com/prettier/prettier/blob/main/commands.md). As an example, below is how a `binary` node (like the one representing the `1 + 1` above) would handle printing itself: ```javascript const { concat, group, indent, line } = require("prettier").doc.builders; @@ -159,7 +159,7 @@ Links relating to `ripper` and how it parses Ruby source. Links relating to `prettier` and its plugins. - [Prettier plugin documentation](https://prettier.io/docs/en/plugins.html) - documentation around `prettier`'s plugin system -- [Builder commands](https://github.com/prettier/prettier/blob/master/commands.md) - the functions used to build the `prettier` IR +- [Builder commands](https://github.com/prettier/prettier/blob/main/commands.md) - the functions used to build the `prettier` IR - [Writing a Prettier plugin](https://medium.com/@fvictorio/how-to-write-a-plugin-for-prettier-a0d98c845e70) - a nice tutorial on how to build a `prettier` plugin ## Useful commands diff --git a/src/plugin.js b/src/plugin.js index 0d72ffe4..8ccfa233 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -10,7 +10,7 @@ const hamlParser = require("./haml/parser"); /* * metadata mostly pulled from linguist and rubocop: * https://github.com/github/linguist/blob/master/lib/linguist/languages.yml - * https://github.com/rubocop-hq/rubocop/blob/master/spec/rubocop/target_finder_spec.rb + * https://github.com/rubocop/rubocop/blob/master/spec/rubocop/target_finder_spec.rb */ module.exports = { From 7e94283f982b4e84f774e3de723794c9fe46574d Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 23 Jun 2021 10:39:55 -0400 Subject: [PATCH 190/785] Document support for prettier 2.3.0 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e81d424c..b81152f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#859](https://github.com/prettier/plugin-ruby/issues/859) - azz, kddeisz - Support the `--insert-pragma` option for the incremental adoption workflow. - [#904](https://github.com/prettier/plugin-ruby/issues/904) - Hansenq, kddeisz - Support the `%s` symbol literal syntax. +- [#833](https://github.com/prettier/plugin-ruby/issues/883) - kddeisz - Support for prettier >= v2.3.0. ### Changed From 59f1da2097383bf85b9c6f97f1cbd61c5df57676 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 23 Jun 2021 10:50:10 -0400 Subject: [PATCH 191/785] Formatting --- README.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 9e95f00f..e5485a66 100644 --- a/README.md +++ b/README.md @@ -178,21 +178,22 @@ inherit_from: - node_modules/@prettier/plugin-ruby/rubocop.yml ``` -## Editor Integration +### Usage with an editor -### VS Code +For [supported editor integrations](https://github.com/prettier/prettier/blob/main/website/data/editors.yml), you should follow the instructions for installing the integration, then install the npm version of this plugin as a development dependency of your project. For most integrations, that should be sufficient. For convenience, the instructions for integrating with VSCode are used as an example below: -- Add the npm `@prettier/plugin-ruby` package to your project as described above. - Install the [Prettier - Code Formatter](https://github.com/prettier/prettier-vscode) extension. +- Add the npm `@prettier/plugin-ruby` package to your project as described above. - Configure in your `settings.json` (`formatOnSave` is optional): - ```json - { - "[ruby]": { - "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.formatOnSave": true - } + +```json +{ + "[ruby]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true } - ``` +} +``` Refer to [this issue](https://github.com/prettier/plugin-ruby/issues/113#issuecomment-783426539) if you're having difficulties. From 6ed8857d3a13c6985d4570009240ee3a1947fca8 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 23 Jun 2021 10:52:01 -0400 Subject: [PATCH 192/785] Bump to v1.6.0 --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b81152f7..42dfb1af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [1.6.0] - 2021-06-23 + ### Added - [#859](https://github.com/prettier/plugin-ruby/issues/859) - azz, kddeisz - Support the `--insert-pragma` option for the incremental adoption workflow. @@ -1117,7 +1119,8 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.5.5...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.6.0...HEAD +[1.6.0]: https://github.com/prettier/plugin-ruby/compare/v1.5.5...v1.6.0 [1.5.5]: https://github.com/prettier/plugin-ruby/compare/v1.5.4...v1.5.5 [1.5.4]: https://github.com/prettier/plugin-ruby/compare/v1.5.3...v1.5.4 [1.5.3]: https://github.com/prettier/plugin-ruby/compare/v1.5.2...v1.5.3 diff --git a/package.json b/package.json index ee7ee0a6..a1de9724 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "1.5.5", + "version": "1.6.0", "description": "prettier plugin for the Ruby programming language", "main": "src/plugin.js", "scripts": { From 6e5ac87d6b62914503c7718fd2e36cdfba3349c5 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 23 Jun 2021 13:26:19 -0400 Subject: [PATCH 193/785] Group together `.where.not` calls in method chains. --- CHANGELOG.md | 4 ++++ src/ruby/nodes/calls.js | 13 ++++++++++++- test/js/ruby/nodes/calls.test.js | 13 +++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42dfb1af..dbd3a7f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Changed + +- [#862](https://github.com/prettier/plugin-ruby/issues/862) - azz, kddeisz - Group together `.where.not` calls in method chains. + ## [1.6.0] - 2021-06-23 ### Added diff --git a/src/ruby/nodes/calls.js b/src/ruby/nodes/calls.js index 8d05e969..d75b7d21 100644 --- a/src/ruby/nodes/calls.js +++ b/src/ruby/nodes/calls.js @@ -33,12 +33,23 @@ function printCall(path, opts, print) { // The right side of the call node, as in everything including the operator // and beyond. - const rightSideDoc = concat([ + let rightSideDoc = concat([ receiverNode.comments ? hardline : softline, operatorDoc, messageDoc ]); + // This is very specialized behavior wherein we group .where.not calls + // together because it looks better. For more information, see + // https://github.com/prettier/plugin-ruby/issues/862. + if ( + receiverNode.type === "call" && + receiverNode.body[2].body === "where" && + messageDoc === "not" + ) { + rightSideDoc = concat([operatorDoc, messageDoc]); + } + // Get a reference to the parent node so we can check if we're inside a chain const parentNode = path.getParentNode(); diff --git a/test/js/ruby/nodes/calls.test.js b/test/js/ruby/nodes/calls.test.js index 2857ff32..59ce21a4 100644 --- a/test/js/ruby/nodes/calls.test.js +++ b/test/js/ruby/nodes/calls.test.js @@ -64,6 +64,19 @@ describe("calls", () => { return expect(content).toMatchFormat(); }); + test("chains which contain a .where.not", () => { + const content = ruby(` + Customer + .active + .where(foo: 'bar') + .where.not(banned_at: nil) + .order(created_at: 'desc') + .limit(10) + `); + + return expect(content).toMatchFormat(); + }); + test("no explicit call doesn't add call", () => expect("a.(1, 2, 3)").toMatchFormat()); From 55465ab0185a2fef9e74c0e5091dbdf086b1e505 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 23 Jun 2021 14:01:38 -0400 Subject: [PATCH 194/785] Fix for #863 --- CHANGELOG.md | 1 + src/ruby/nodes/calls.js | 31 ++++++++++++++++++++++++++++++- test/js/ruby/nodes/calls.test.js | 25 +++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbd3a7f2..4b76a9bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Changed - [#862](https://github.com/prettier/plugin-ruby/issues/862) - azz, kddeisz - Group together `.where.not` calls in method chains. +- [#863](https://github.com/prettier/plugin-ruby/issues/863) - azz, kddeisz - Fix up Sorbet `sig` block formatting when chaining method calls. ## [1.6.0] - 2021-06-23 diff --git a/src/ruby/nodes/calls.js b/src/ruby/nodes/calls.js index d75b7d21..ee71de3a 100644 --- a/src/ruby/nodes/calls.js +++ b/src/ruby/nodes/calls.js @@ -121,9 +121,38 @@ function printMethodAddArg(path, opts, print) { parentNode.firstReceiverType = node.firstReceiverType; } + // This is the threshold at which we will start to try to make a nicely + // indented call chain. For the most part, it's always 3. + let threshold = 3; + + // Here, we have very specialized behavior where if we're within a sig block, + // then we're going to assume we're creating a Sorbet type signature. In that + // case, we really want the threshold to be lowered to 2 so that we create + // method chains off of any two method calls within the block. For more + // details, see + // https://github.com/prettier/plugin-ruby/issues/863. + let sigBlock = path.getParentNode(2); + if (sigBlock) { + // If we're at a do_block, then we want to go one more level up. This is + // because do_blocks have bodystmt nodes instead of just stmt nodes. + if (sigBlock.type === "do_block") { + sigBlock = path.getParentNode(3); + } + + if ( + sigBlock.type === "method_add_block" && + sigBlock.body[1] && + sigBlock.body[0].type === "method_add_arg" && + sigBlock.body[0].body[0].type === "fcall" && + sigBlock.body[0].body[0].body[0].body === "sig" + ) { + threshold = 2; + } + } + // If we're at the top of a chain, then we're going to print out a nice // multi-line layout if this doesn't break into multiple lines. - if (!chained.includes(parentNode.type) && (node.chain || 0) >= 3) { + if (!chained.includes(parentNode.type) && (node.chain || 0) >= threshold) { // This is pretty specialized behavior. Basically if we're at the top of a // chain but we've only had method calls without arguments and now we have // arguments, then we're effectively trying to call a method with arguments diff --git a/test/js/ruby/nodes/calls.test.js b/test/js/ruby/nodes/calls.test.js index 59ce21a4..f208e124 100644 --- a/test/js/ruby/nodes/calls.test.js +++ b/test/js/ruby/nodes/calls.test.js @@ -77,6 +77,31 @@ describe("calls", () => { return expect(content).toMatchFormat(); }); + describe("within sig blocks", () => { + test("basic chains", () => { + const content = ruby(` + sig do + params(contacts: Contact::ActiveRecord_Relation) + .returns(Customer::ActiveRecord_Relation) + end + `); + + return expect(content).toMatchFormat(); + }); + + test("chains with other methods", () => { + const content = ruby(` + sig do + overridable + .params(contacts: Contact::ActiveRecord_Relation) + .returns(Customer::ActiveRecord_Relation) + end + `); + + return expect(content).toMatchFormat(); + }); + }); + test("no explicit call doesn't add call", () => expect("a.(1, 2, 3)").toMatchFormat()); From e2d02ad9fcd55b2078975c37a620e28f037baf18 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 23 Jun 2021 14:21:36 -0400 Subject: [PATCH 195/785] Method chains with blocks --- CHANGELOG.md | 1 + src/utils/noIndent.js | 1 - test/js/ruby/nodes/calls.test.js | 16 ++++++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b76a9bd..ba33c290 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#862](https://github.com/prettier/plugin-ruby/issues/862) - azz, kddeisz - Group together `.where.not` calls in method chains. - [#863](https://github.com/prettier/plugin-ruby/issues/863) - azz, kddeisz - Fix up Sorbet `sig` block formatting when chaining method calls. +- [#908](https://github.com/prettier/plugin-ruby/issues/908) - Hansenq, kddeisz - Method chains with blocks should be properly indented. ## [1.6.0] - 2021-06-23 diff --git a/src/utils/noIndent.js b/src/utils/noIndent.js index da65bcdd..4257ebdf 100644 --- a/src/utils/noIndent.js +++ b/src/utils/noIndent.js @@ -3,7 +3,6 @@ const noIndent = [ "hash", "heredoc", "if", - "method_add_block", "unless", "xstring_literal" ]; diff --git a/test/js/ruby/nodes/calls.test.js b/test/js/ruby/nodes/calls.test.js index f208e124..040d0d35 100644 --- a/test/js/ruby/nodes/calls.test.js +++ b/test/js/ruby/nodes/calls.test.js @@ -102,6 +102,22 @@ describe("calls", () => { }); }); + test("chains with blocks mixed in", () => { + const content = ruby(` + Model + .dataset + .eager(:table1) + .join(:second_table_name.as(:table2), %i[album_id artist_id]) + .where(table1__artist_id: artists.map(&:id)) + .where { table1__date > Time.now - 31.days } + .where { table2__date > table1_date } + .exclude(table2__album_id: :table1__album_id) + .select_all(:table1) + `); + + return expect(content).toMatchFormat(); + }); + test("no explicit call doesn't add call", () => expect("a.(1, 2, 3)").toMatchFormat()); From f07361735c90397fc270ee6ce627c25ff5b68118 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Jun 2021 12:01:27 +0000 Subject: [PATCH 196/785] Bump prettier from 2.3.1 to 2.3.2 Bumps [prettier](https://github.com/prettier/prettier) from 2.3.1 to 2.3.2. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.3.1...2.3.2) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index d27e1589..194c462a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2443,9 +2443,9 @@ prelude-ls@~1.1.2: integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= prettier@>=1.10: - version "2.3.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.1.tgz#76903c3f8c4449bc9ac597acefa24dc5ad4cbea6" - integrity sha512-p+vNbgpLjif/+D+DwAZAbndtRrR0md0MwfmOVN9N+2RgyACMT+7tfaRnT+WDPkqnuVwleyuBIG2XBxKDme3hPA== + version "2.3.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d" + integrity sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ== pretty-format@^27.0.2: version "27.0.2" From 7ecb0e9242cf5f81d777eb68d3b53a129139ec7a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Jun 2021 12:01:36 +0000 Subject: [PATCH 197/785] Bump jest from 27.0.5 to 27.0.6 Bumps [jest](https://github.com/facebook/jest) from 27.0.5 to 27.0.6. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v27.0.5...v27.0.6) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 742 +++++++++++++++++++++++++++--------------------------- 1 file changed, 371 insertions(+), 371 deletions(-) diff --git a/yarn.lock b/yarn.lock index 194c462a..0c722760 100644 --- a/yarn.lock +++ b/yarn.lock @@ -332,94 +332,94 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^27.0.2": - version "27.0.2" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.0.2.tgz#b8eeff8f21ac51d224c851e1729d2630c18631e6" - integrity sha512-/zYigssuHLImGeMAACkjI4VLAiiJznHgAl3xnFT19iWyct2LhrH3KXOjHRmxBGTkiPLZKKAJAgaPpiU9EZ9K+w== +"@jest/console@^27.0.6": + version "27.0.6" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.0.6.tgz#3eb72ea80897495c3d73dd97aab7f26770e2260f" + integrity sha512-fMlIBocSHPZ3JxgWiDNW/KPj6s+YRd0hicb33IrmelCcjXo/pXPwvuiKFmZz+XuqI/1u7nbUK10zSsWL/1aegg== dependencies: - "@jest/types" "^27.0.2" + "@jest/types" "^27.0.6" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^27.0.2" - jest-util "^27.0.2" + jest-message-util "^27.0.6" + jest-util "^27.0.6" slash "^3.0.0" -"@jest/core@^27.0.5": - version "27.0.5" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.0.5.tgz#59e9e69e7374d65dbb22e3fc1bd52e80991eae72" - integrity sha512-g73//jF0VwsOIrWUC9Cqg03lU3QoAMFxVjsm6n6yNmwZcQPN/o8w+gLWODw5VfKNFZT38otXHWxc6b8eGDUpEA== +"@jest/core@^27.0.6": + version "27.0.6" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.0.6.tgz#c5f642727a0b3bf0f37c4b46c675372d0978d4a1" + integrity sha512-SsYBm3yhqOn5ZLJCtccaBcvD/ccTLCeuDv8U41WJH/V1MW5eKUkeMHT9U+Pw/v1m1AIWlnIW/eM2XzQr0rEmow== dependencies: - "@jest/console" "^27.0.2" - "@jest/reporters" "^27.0.5" - "@jest/test-result" "^27.0.2" - "@jest/transform" "^27.0.5" - "@jest/types" "^27.0.2" + "@jest/console" "^27.0.6" + "@jest/reporters" "^27.0.6" + "@jest/test-result" "^27.0.6" + "@jest/transform" "^27.0.6" + "@jest/types" "^27.0.6" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" - jest-changed-files "^27.0.2" - jest-config "^27.0.5" - jest-haste-map "^27.0.5" - jest-message-util "^27.0.2" - jest-regex-util "^27.0.1" - jest-resolve "^27.0.5" - jest-resolve-dependencies "^27.0.5" - jest-runner "^27.0.5" - jest-runtime "^27.0.5" - jest-snapshot "^27.0.5" - jest-util "^27.0.2" - jest-validate "^27.0.2" - jest-watcher "^27.0.2" + jest-changed-files "^27.0.6" + jest-config "^27.0.6" + jest-haste-map "^27.0.6" + jest-message-util "^27.0.6" + jest-regex-util "^27.0.6" + jest-resolve "^27.0.6" + jest-resolve-dependencies "^27.0.6" + jest-runner "^27.0.6" + jest-runtime "^27.0.6" + jest-snapshot "^27.0.6" + jest-util "^27.0.6" + jest-validate "^27.0.6" + jest-watcher "^27.0.6" micromatch "^4.0.4" p-each-series "^2.1.0" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.0.5": - version "27.0.5" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.0.5.tgz#a294ad4acda2e250f789fb98dc667aad33d3adc9" - integrity sha512-IAkJPOT7bqn0GiX5LPio6/e1YpcmLbrd8O5EFYpAOZ6V+9xJDsXjdgN2vgv9WOKIs/uA1kf5WeD96HhlBYO+FA== +"@jest/environment@^27.0.6": + version "27.0.6" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.0.6.tgz#ee293fe996db01d7d663b8108fa0e1ff436219d2" + integrity sha512-4XywtdhwZwCpPJ/qfAkqExRsERW+UaoSRStSHCCiQTUpoYdLukj+YJbQSFrZjhlUDRZeNiU9SFH0u7iNimdiIg== dependencies: - "@jest/fake-timers" "^27.0.5" - "@jest/types" "^27.0.2" + "@jest/fake-timers" "^27.0.6" + "@jest/types" "^27.0.6" "@types/node" "*" - jest-mock "^27.0.3" + jest-mock "^27.0.6" -"@jest/fake-timers@^27.0.5": - version "27.0.5" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.0.5.tgz#304d5aedadf4c75cff3696995460b39d6c6e72f6" - integrity sha512-d6Tyf7iDoKqeUdwUKrOBV/GvEZRF67m7lpuWI0+SCD9D3aaejiOQZxAOxwH2EH/W18gnfYaBPLi0VeTGBHtQBg== +"@jest/fake-timers@^27.0.6": + version "27.0.6" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.0.6.tgz#cbad52f3fe6abe30e7acb8cd5fa3466b9588e3df" + integrity sha512-sqd+xTWtZ94l3yWDKnRTdvTeZ+A/V7SSKrxsrOKSqdyddb9CeNRF8fbhAU0D7ZJBpTTW2nbp6MftmKJDZfW2LQ== dependencies: - "@jest/types" "^27.0.2" + "@jest/types" "^27.0.6" "@sinonjs/fake-timers" "^7.0.2" "@types/node" "*" - jest-message-util "^27.0.2" - jest-mock "^27.0.3" - jest-util "^27.0.2" + jest-message-util "^27.0.6" + jest-mock "^27.0.6" + jest-util "^27.0.6" -"@jest/globals@^27.0.5": - version "27.0.5" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.0.5.tgz#f63b8bfa6ea3716f8df50f6a604b5c15b36ffd20" - integrity sha512-qqKyjDXUaZwDuccpbMMKCCMBftvrbXzigtIsikAH/9ca+kaae8InP2MDf+Y/PdCSMuAsSpHS6q6M25irBBUh+Q== +"@jest/globals@^27.0.6": + version "27.0.6" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.0.6.tgz#48e3903f99a4650673d8657334d13c9caf0e8f82" + integrity sha512-DdTGCP606rh9bjkdQ7VvChV18iS7q0IMJVP1piwTWyWskol4iqcVwthZmoJEf7obE1nc34OpIyoVGPeqLC+ryw== dependencies: - "@jest/environment" "^27.0.5" - "@jest/types" "^27.0.2" - expect "^27.0.2" + "@jest/environment" "^27.0.6" + "@jest/types" "^27.0.6" + expect "^27.0.6" -"@jest/reporters@^27.0.5": - version "27.0.5" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.0.5.tgz#cd730b77d9667b8ff700ad66d4edc293bb09716a" - integrity sha512-4uNg5+0eIfRafnpgu3jCZws3NNcFzhu5JdRd1mKQ4/53+vkIqwB6vfZ4gn5BdGqOaLtYhlOsPaL5ATkKzyBrJw== +"@jest/reporters@^27.0.6": + version "27.0.6" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.0.6.tgz#91e7f2d98c002ad5df94d5b5167c1eb0b9fd5b00" + integrity sha512-TIkBt09Cb2gptji3yJXb3EE+eVltW6BjO7frO7NEfjI9vSIYoISi5R3aI3KpEDXlB1xwB+97NXIqz84qYeYsfA== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.0.2" - "@jest/test-result" "^27.0.2" - "@jest/transform" "^27.0.5" - "@jest/types" "^27.0.2" + "@jest/console" "^27.0.6" + "@jest/test-result" "^27.0.6" + "@jest/transform" "^27.0.6" + "@jest/types" "^27.0.6" chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" @@ -430,70 +430,70 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^27.0.5" - jest-resolve "^27.0.5" - jest-util "^27.0.2" - jest-worker "^27.0.2" + jest-haste-map "^27.0.6" + jest-resolve "^27.0.6" + jest-util "^27.0.6" + jest-worker "^27.0.6" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" terminal-link "^2.0.0" v8-to-istanbul "^8.0.0" -"@jest/source-map@^27.0.1": - version "27.0.1" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.0.1.tgz#2afbf73ddbaddcb920a8e62d0238a0a9e0a8d3e4" - integrity sha512-yMgkF0f+6WJtDMdDYNavmqvbHtiSpwRN2U/W+6uztgfqgkq/PXdKPqjBTUF1RD/feth4rH5N3NW0T5+wIuln1A== +"@jest/source-map@^27.0.6": + version "27.0.6" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.0.6.tgz#be9e9b93565d49b0548b86e232092491fb60551f" + integrity sha512-Fek4mi5KQrqmlY07T23JRi0e7Z9bXTOOD86V/uS0EIW4PClvPDqZOyFlLpNJheS6QI0FNX1CgmPjtJ4EA/2M+g== dependencies: callsites "^3.0.0" graceful-fs "^4.2.4" source-map "^0.6.0" -"@jest/test-result@^27.0.2": - version "27.0.2" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.0.2.tgz#0451049e32ceb609b636004ccc27c8fa22263f10" - integrity sha512-gcdWwL3yP5VaIadzwQtbZyZMgpmes8ryBAJp70tuxghiA8qL4imJyZex+i+USQH2H4jeLVVszhwntgdQ97fccA== +"@jest/test-result@^27.0.6": + version "27.0.6" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.0.6.tgz#3fa42015a14e4fdede6acd042ce98c7f36627051" + integrity sha512-ja/pBOMTufjX4JLEauLxE3LQBPaI2YjGFtXexRAjt1I/MbfNlMx0sytSX3tn5hSLzQsR3Qy2rd0hc1BWojtj9w== dependencies: - "@jest/console" "^27.0.2" - "@jest/types" "^27.0.2" + "@jest/console" "^27.0.6" + "@jest/types" "^27.0.6" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.0.5": - version "27.0.5" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.0.5.tgz#c58b21db49afc36c0e3921d7ddf1fb7954abfded" - integrity sha512-opztnGs+cXzZ5txFG2+omBaV5ge/0yuJNKbhE3DREMiXE0YxBuzyEa6pNv3kk2JuucIlH2Xvgmn9kEEHSNt/SA== +"@jest/test-sequencer@^27.0.6": + version "27.0.6" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.0.6.tgz#80a913ed7a1130545b1cd777ff2735dd3af5d34b" + integrity sha512-bISzNIApazYOlTHDum9PwW22NOyDa6VI31n6JucpjTVM0jD6JDgqEZ9+yn575nDdPF0+4csYDxNNW13NvFQGZA== dependencies: - "@jest/test-result" "^27.0.2" + "@jest/test-result" "^27.0.6" graceful-fs "^4.2.4" - jest-haste-map "^27.0.5" - jest-runtime "^27.0.5" + jest-haste-map "^27.0.6" + jest-runtime "^27.0.6" -"@jest/transform@^27.0.5": - version "27.0.5" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.0.5.tgz#2dcb78953708af713941ac845b06078bc74ed873" - integrity sha512-lBD6OwKXSc6JJECBNk4mVxtSVuJSBsQrJ9WCBisfJs7EZuYq4K6vM9HmoB7hmPiLIDGeyaerw3feBV/bC4z8tg== +"@jest/transform@^27.0.6": + version "27.0.6" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.0.6.tgz#189ad7107413208f7600f4719f81dd2f7278cc95" + integrity sha512-rj5Dw+mtIcntAUnMlW/Vju5mr73u8yg+irnHwzgtgoeI6cCPOvUwQ0D1uQtc/APmWgvRweEb1g05pkUpxH3iCA== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^27.0.2" + "@jest/types" "^27.0.6" babel-plugin-istanbul "^6.0.0" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.0.5" - jest-regex-util "^27.0.1" - jest-util "^27.0.2" + jest-haste-map "^27.0.6" + jest-regex-util "^27.0.6" + jest-util "^27.0.6" micromatch "^4.0.4" pirates "^4.0.1" slash "^3.0.0" source-map "^0.6.1" write-file-atomic "^3.0.0" -"@jest/types@^27.0.2": - version "27.0.2" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.0.2.tgz#e153d6c46bda0f2589f0702b071f9898c7bbd37e" - integrity sha512-XpjCtJ/99HB4PmyJ2vgmN7vT+JLP7RW1FBT9RgnMFS4Dt7cvIyBee8O3/j98aUZ34ZpenPZFqmaaObWSeL65dg== +"@jest/types@^27.0.6": + version "27.0.6" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.0.6.tgz#9a992bc517e0c49f035938b8549719c2de40706b" + integrity sha512-aSquT1qa9Pik26JK5/3rvnYb4bGtm1VFNesHKmNTwmPIgOrixvhL2ghIvFRNEpzy3gU+rUgjIF/KodbkFAl++g== dependencies: "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" @@ -747,16 +747,16 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= -babel-jest@^27.0.5: - version "27.0.5" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.0.5.tgz#cd34c033ada05d1362211e5152391fd7a88080c8" - integrity sha512-bTMAbpCX7ldtfbca2llYLeSFsDM257aspyAOpsdrdSrBqoLkWCy4HPYTXtXWaSLgFPjrJGACL65rzzr4RFGadw== +babel-jest@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.0.6.tgz#e99c6e0577da2655118e3608b68761a5a69bd0d8" + integrity sha512-iTJyYLNc4wRofASmofpOc5NK9QunwMk+TLFgGXsTFS8uEqmd8wdI7sga0FPe2oVH3b5Agt/EAK1QjPEuKL8VfA== dependencies: - "@jest/transform" "^27.0.5" - "@jest/types" "^27.0.2" + "@jest/transform" "^27.0.6" + "@jest/types" "^27.0.6" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.0.0" - babel-preset-jest "^27.0.1" + babel-preset-jest "^27.0.6" chalk "^4.0.0" graceful-fs "^4.2.4" slash "^3.0.0" @@ -772,10 +772,10 @@ babel-plugin-istanbul@^6.0.0: istanbul-lib-instrument "^4.0.0" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.0.1.tgz#a6d10e484c93abff0f4e95f437dad26e5736ea11" - integrity sha512-sqBF0owAcCDBVEDtxqfYr2F36eSHdx7lAVGyYuOBRnKdD6gzcy0I0XrAYCZgOA3CRrLhmR+Uae9nogPzmAtOfQ== +babel-plugin-jest-hoist@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.0.6.tgz#f7c6b3d764af21cb4a2a1ab6870117dbde15b456" + integrity sha512-CewFeM9Vv2gM7Yr9n5eyyLVPRSiBnk6lKZRjgwYnGKSl9M14TMn2vkN02wTF04OGuSDLEzlWiMzvjXuW9mB6Gw== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -800,12 +800,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.0.1.tgz#7a50c75d16647c23a2cf5158d5bb9eb206b10e20" - integrity sha512-nIBIqCEpuiyhvjQs2mVNwTxQQa2xk70p9Dd/0obQGBf8FBzbnI8QhQKzLsWMN2i6q+5B0OcWDtrboBX5gmOLyA== +babel-preset-jest@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.0.6.tgz#909ef08e9f24a4679768be2f60a3df0856843f9d" + integrity sha512-WObA0/Biw2LrVVwZkF/2GqbOdzhKD6Fkdwhoy9ASIrOWr/zodcSpQh72JOkEn6NWyjmnPDjNSqaGN4KnpKzhXw== dependencies: - babel-plugin-jest-hoist "^27.0.1" + babel-plugin-jest-hoist "^27.0.6" babel-preset-current-node-syntax "^1.0.0" balanced-match@^1.0.0: @@ -1055,10 +1055,10 @@ detect-newline@^3.0.0: resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== -diff-sequences@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.0.1.tgz#9c9801d52ed5f576ff0a20e3022a13ee6e297e7c" - integrity sha512-XPLijkfJUh/PIBnfkcSHgvD6tlYixmcMAn3osTk6jt+H0v/mgURto1XUiD9DKuGX5NDoVS6dSlA23gd9FUaCFg== +diff-sequences@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.0.6.tgz#3305cb2e55a033924054695cc66019fd7f8e5723" + integrity sha512-ag6wfpBFyNXZ0p8pcuIDS//D8H062ZQJ3fzYxjpmeKjnz8W4pekL3AI8VohmyZmsWW2PWaHgjsmqR6L13101VQ== doctrine@^3.0.0: version "3.0.0" @@ -1288,17 +1288,17 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.0.2.tgz#e66ca3a4c9592f1c019fa1d46459a9d2084f3422" - integrity sha512-YJFNJe2+P2DqH+ZrXy+ydRQYO87oxRUonZImpDodR1G7qo3NYd3pL+NQ9Keqpez3cehczYwZDBC3A7xk3n7M/w== +expect@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.0.6.tgz#a4d74fbe27222c718fff68ef49d78e26a8fd4c05" + integrity sha512-psNLt8j2kwg42jGBDSfAlU49CEZxejN1f1PlANWDZqIhBOVU/c2Pm888FcjWJzFewhIsNWfZJeLjUjtKGiPuSw== dependencies: - "@jest/types" "^27.0.2" + "@jest/types" "^27.0.6" ansi-styles "^5.0.0" - jest-get-type "^27.0.1" - jest-matcher-utils "^27.0.2" - jest-message-util "^27.0.2" - jest-regex-util "^27.0.1" + jest-get-type "^27.0.6" + jest-matcher-utils "^27.0.6" + jest-message-util "^27.0.6" + jest-regex-util "^27.0.6" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1663,226 +1663,226 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.0.2.tgz#997253042b4a032950fc5f56abf3c5d1f8560801" - integrity sha512-eMeb1Pn7w7x3wue5/vF73LPCJ7DKQuC9wQUR5ebP9hDPpk5hzcT/3Hmz3Q5BOFpR3tgbmaWhJcMTVgC8Z1NuMw== +jest-changed-files@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.0.6.tgz#bed6183fcdea8a285482e3b50a9a7712d49a7a8b" + integrity sha512-BuL/ZDauaq5dumYh5y20sn4IISnf1P9A0TDswTxUi84ORGtVa86ApuBHqICL0vepqAnZiY6a7xeSPWv2/yy4eA== dependencies: - "@jest/types" "^27.0.2" + "@jest/types" "^27.0.6" execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.0.5: - version "27.0.5" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.0.5.tgz#b5e327f1d6857c8485126f8e364aefa4378debaa" - integrity sha512-p5rO90o1RTh8LPOG6l0Fc9qgp5YGv+8M5CFixhMh7gGHtGSobD1AxX9cjFZujILgY8t30QZ7WVvxlnuG31r8TA== +jest-circus@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.0.6.tgz#dd4df17c4697db6a2c232aaad4e9cec666926668" + integrity sha512-OJlsz6BBeX9qR+7O9lXefWoc2m9ZqcZ5Ohlzz0pTEAG4xMiZUJoacY8f4YDHxgk0oKYxj277AfOk9w6hZYvi1Q== dependencies: - "@jest/environment" "^27.0.5" - "@jest/test-result" "^27.0.2" - "@jest/types" "^27.0.2" + "@jest/environment" "^27.0.6" + "@jest/test-result" "^27.0.6" + "@jest/types" "^27.0.6" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" - expect "^27.0.2" + expect "^27.0.6" is-generator-fn "^2.0.0" - jest-each "^27.0.2" - jest-matcher-utils "^27.0.2" - jest-message-util "^27.0.2" - jest-runtime "^27.0.5" - jest-snapshot "^27.0.5" - jest-util "^27.0.2" - pretty-format "^27.0.2" + jest-each "^27.0.6" + jest-matcher-utils "^27.0.6" + jest-message-util "^27.0.6" + jest-runtime "^27.0.6" + jest-snapshot "^27.0.6" + jest-util "^27.0.6" + pretty-format "^27.0.6" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.0.5: - version "27.0.5" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.0.5.tgz#f359ba042624cffb96b713010a94bffb7498a37c" - integrity sha512-kZqY020QFOFQKVE2knFHirTBElw3/Q0kUbDc3nMfy/x+RQ7zUY89SUuzpHHJoSX1kX7Lq569ncvjNqU3Td/FCA== +jest-cli@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.0.6.tgz#d021e5f4d86d6a212450d4c7b86cb219f1e6864f" + integrity sha512-qUUVlGb9fdKir3RDE+B10ULI+LQrz+MCflEH2UJyoUjoHHCbxDrMxSzjQAPUMsic4SncI62ofYCcAvW6+6rhhg== dependencies: - "@jest/core" "^27.0.5" - "@jest/test-result" "^27.0.2" - "@jest/types" "^27.0.2" + "@jest/core" "^27.0.6" + "@jest/test-result" "^27.0.6" + "@jest/types" "^27.0.6" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.0.5" - jest-util "^27.0.2" - jest-validate "^27.0.2" + jest-config "^27.0.6" + jest-util "^27.0.6" + jest-validate "^27.0.6" prompts "^2.0.1" yargs "^16.0.3" -jest-config@^27.0.5: - version "27.0.5" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.0.5.tgz#683da3b0d8237675c29c817f6e3aba1481028e19" - integrity sha512-zCUIXag7QIXKEVN4kUKbDBDi9Q53dV5o3eNhGqe+5zAbt1vLs4VE3ceWaYrOub0L4Y7E9pGfM84TX/0ARcE+Qw== +jest-config@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.0.6.tgz#119fb10f149ba63d9c50621baa4f1f179500277f" + integrity sha512-JZRR3I1Plr2YxPBhgqRspDE2S5zprbga3swYNrvY3HfQGu7p/GjyLOqwrYad97tX3U3mzT53TPHVmozacfP/3w== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.0.5" - "@jest/types" "^27.0.2" - babel-jest "^27.0.5" + "@jest/test-sequencer" "^27.0.6" + "@jest/types" "^27.0.6" + babel-jest "^27.0.6" chalk "^4.0.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" is-ci "^3.0.0" - jest-circus "^27.0.5" - jest-environment-jsdom "^27.0.5" - jest-environment-node "^27.0.5" - jest-get-type "^27.0.1" - jest-jasmine2 "^27.0.5" - jest-regex-util "^27.0.1" - jest-resolve "^27.0.5" - jest-runner "^27.0.5" - jest-util "^27.0.2" - jest-validate "^27.0.2" + jest-circus "^27.0.6" + jest-environment-jsdom "^27.0.6" + jest-environment-node "^27.0.6" + jest-get-type "^27.0.6" + jest-jasmine2 "^27.0.6" + jest-regex-util "^27.0.6" + jest-resolve "^27.0.6" + jest-runner "^27.0.6" + jest-util "^27.0.6" + jest-validate "^27.0.6" micromatch "^4.0.4" - pretty-format "^27.0.2" + pretty-format "^27.0.6" -jest-diff@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.0.2.tgz#f315b87cee5dc134cf42c2708ab27375cc3f5a7e" - integrity sha512-BFIdRb0LqfV1hBt8crQmw6gGQHVDhM87SpMIZ45FPYKReZYG5er1+5pIn2zKqvrJp6WNox0ylR8571Iwk2Dmgw== +jest-diff@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.0.6.tgz#4a7a19ee6f04ad70e0e3388f35829394a44c7b5e" + integrity sha512-Z1mqgkTCSYaFgwTlP/NUiRzdqgxmmhzHY1Tq17zL94morOHfHu3K4bgSgl+CR4GLhpV8VxkuOYuIWnQ9LnFqmg== dependencies: chalk "^4.0.0" - diff-sequences "^27.0.1" - jest-get-type "^27.0.1" - pretty-format "^27.0.2" + diff-sequences "^27.0.6" + jest-get-type "^27.0.6" + pretty-format "^27.0.6" -jest-docblock@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.0.1.tgz#bd9752819b49fa4fab1a50b73eb58c653b962e8b" - integrity sha512-TA4+21s3oebURc7VgFV4r7ltdIJ5rtBH1E3Tbovcg7AV+oLfD5DcJ2V2vJ5zFA9sL5CFd/d2D6IpsAeSheEdrA== +jest-docblock@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.0.6.tgz#cc78266acf7fe693ca462cbbda0ea4e639e4e5f3" + integrity sha512-Fid6dPcjwepTFraz0YxIMCi7dejjJ/KL9FBjPYhBp4Sv1Y9PdhImlKZqYU555BlN4TQKaTc+F2Av1z+anVyGkA== dependencies: detect-newline "^3.0.0" -jest-each@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.0.2.tgz#865ddb4367476ced752167926b656fa0dcecd8c7" - integrity sha512-OLMBZBZ6JkoXgUenDtseFRWA43wVl2BwmZYIWQws7eS7pqsIvePqj/jJmEnfq91ALk3LNphgwNK/PRFBYi7ITQ== +jest-each@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.0.6.tgz#cee117071b04060158dc8d9a66dc50ad40ef453b" + integrity sha512-m6yKcV3bkSWrUIjxkE9OC0mhBZZdhovIW5ergBYirqnkLXkyEn3oUUF/QZgyecA1cF1QFyTE8bRRl8Tfg1pfLA== dependencies: - "@jest/types" "^27.0.2" + "@jest/types" "^27.0.6" chalk "^4.0.0" - jest-get-type "^27.0.1" - jest-util "^27.0.2" - pretty-format "^27.0.2" - -jest-environment-jsdom@^27.0.5: - version "27.0.5" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.0.5.tgz#c36771977cf4490a9216a70473b39161d193c212" - integrity sha512-ToWhViIoTl5738oRaajTMgYhdQL73UWPoV4GqHGk2DPhs+olv8OLq5KoQW8Yf+HtRao52XLqPWvl46dPI88PdA== - dependencies: - "@jest/environment" "^27.0.5" - "@jest/fake-timers" "^27.0.5" - "@jest/types" "^27.0.2" + jest-get-type "^27.0.6" + jest-util "^27.0.6" + pretty-format "^27.0.6" + +jest-environment-jsdom@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.0.6.tgz#f66426c4c9950807d0a9f209c590ce544f73291f" + integrity sha512-FvetXg7lnXL9+78H+xUAsra3IeZRTiegA3An01cWeXBspKXUhAwMM9ycIJ4yBaR0L7HkoMPaZsozCLHh4T8fuw== + dependencies: + "@jest/environment" "^27.0.6" + "@jest/fake-timers" "^27.0.6" + "@jest/types" "^27.0.6" "@types/node" "*" - jest-mock "^27.0.3" - jest-util "^27.0.2" + jest-mock "^27.0.6" + jest-util "^27.0.6" jsdom "^16.6.0" -jest-environment-node@^27.0.5: - version "27.0.5" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.0.5.tgz#b7238fc2b61ef2fb9563a3b7653a95fa009a6a54" - integrity sha512-47qqScV/WMVz5OKF5TWpAeQ1neZKqM3ySwNveEnLyd+yaE/KT6lSMx/0SOx60+ZUcVxPiESYS+Kt2JS9y4PpkQ== +jest-environment-node@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.0.6.tgz#a6699b7ceb52e8d68138b9808b0c404e505f3e07" + integrity sha512-+Vi6yLrPg/qC81jfXx3IBlVnDTI6kmRr08iVa2hFCWmJt4zha0XW7ucQltCAPhSR0FEKEoJ3i+W4E6T0s9is0w== dependencies: - "@jest/environment" "^27.0.5" - "@jest/fake-timers" "^27.0.5" - "@jest/types" "^27.0.2" + "@jest/environment" "^27.0.6" + "@jest/fake-timers" "^27.0.6" + "@jest/types" "^27.0.6" "@types/node" "*" - jest-mock "^27.0.3" - jest-util "^27.0.2" + jest-mock "^27.0.6" + jest-util "^27.0.6" -jest-get-type@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.1.tgz#34951e2b08c8801eb28559d7eb732b04bbcf7815" - integrity sha512-9Tggo9zZbu0sHKebiAijyt1NM77Z0uO4tuWOxUCujAiSeXv30Vb5D4xVF4UR4YWNapcftj+PbByU54lKD7/xMg== +jest-get-type@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.6.tgz#0eb5c7f755854279ce9b68a9f1a4122f69047cfe" + integrity sha512-XTkK5exIeUbbveehcSR8w0bhH+c0yloW/Wpl+9vZrjzztCPWrxhHwkIFpZzCt71oRBsgxmuUfxEqOYoZI2macg== -jest-haste-map@^27.0.5: - version "27.0.5" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.0.5.tgz#2e1e55073b5328410a2c0d74b334e513d71f3470" - integrity sha512-3LFryGSHxwPFHzKIs6W0BGA2xr6g1MvzSjR3h3D8K8Uqy4vbRm/grpGHzbPtIbOPLC6wFoViRrNEmd116QWSkw== +jest-haste-map@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.0.6.tgz#4683a4e68f6ecaa74231679dca237279562c8dc7" + integrity sha512-4ldjPXX9h8doB2JlRzg9oAZ2p6/GpQUNAeiYXqcpmrKbP0Qev0wdZlxSMOmz8mPOEnt4h6qIzXFLDi8RScX/1w== dependencies: - "@jest/types" "^27.0.2" + "@jest/types" "^27.0.6" "@types/graceful-fs" "^4.1.2" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.4" - jest-regex-util "^27.0.1" - jest-serializer "^27.0.1" - jest-util "^27.0.2" - jest-worker "^27.0.2" + jest-regex-util "^27.0.6" + jest-serializer "^27.0.6" + jest-util "^27.0.6" + jest-worker "^27.0.6" micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.0.5: - version "27.0.5" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.0.5.tgz#8a6eb2a685cdec3af13881145c77553e4e197776" - integrity sha512-m3TojR19sFmTn79QoaGy1nOHBcLvtLso6Zh7u+gYxZWGcza4rRPVqwk1hciA5ZOWWZIJOukAcore8JRX992FaA== +jest-jasmine2@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.0.6.tgz#fd509a9ed3d92bd6edb68a779f4738b100655b37" + integrity sha512-cjpH2sBy+t6dvCeKBsHpW41mjHzXgsavaFMp+VWRf0eR4EW8xASk1acqmljFtK2DgyIECMv2yCdY41r2l1+4iA== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^27.0.5" - "@jest/source-map" "^27.0.1" - "@jest/test-result" "^27.0.2" - "@jest/types" "^27.0.2" + "@jest/environment" "^27.0.6" + "@jest/source-map" "^27.0.6" + "@jest/test-result" "^27.0.6" + "@jest/types" "^27.0.6" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^27.0.2" + expect "^27.0.6" is-generator-fn "^2.0.0" - jest-each "^27.0.2" - jest-matcher-utils "^27.0.2" - jest-message-util "^27.0.2" - jest-runtime "^27.0.5" - jest-snapshot "^27.0.5" - jest-util "^27.0.2" - pretty-format "^27.0.2" + jest-each "^27.0.6" + jest-matcher-utils "^27.0.6" + jest-message-util "^27.0.6" + jest-runtime "^27.0.6" + jest-snapshot "^27.0.6" + jest-util "^27.0.6" + pretty-format "^27.0.6" throat "^6.0.1" -jest-leak-detector@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.0.2.tgz#ce19aa9dbcf7a72a9d58907a970427506f624e69" - integrity sha512-TZA3DmCOfe8YZFIMD1GxFqXUkQnIoOGQyy4hFCA2mlHtnAaf+FeOMxi0fZmfB41ZL+QbFG6BVaZF5IeFIVy53Q== +jest-leak-detector@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.0.6.tgz#545854275f85450d4ef4b8fe305ca2a26450450f" + integrity sha512-2/d6n2wlH5zEcdctX4zdbgX8oM61tb67PQt4Xh8JFAIy6LRKUnX528HulkaG6nD5qDl5vRV1NXejCe1XRCH5gQ== dependencies: - jest-get-type "^27.0.1" - pretty-format "^27.0.2" + jest-get-type "^27.0.6" + pretty-format "^27.0.6" -jest-matcher-utils@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.0.2.tgz#f14c060605a95a466cdc759acc546c6f4cbfc4f0" - integrity sha512-Qczi5xnTNjkhcIB0Yy75Txt+Ez51xdhOxsukN7awzq2auZQGPHcQrJ623PZj0ECDEMOk2soxWx05EXdXGd1CbA== +jest-matcher-utils@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.0.6.tgz#2a8da1e86c620b39459f4352eaa255f0d43e39a9" + integrity sha512-OFgF2VCQx9vdPSYTHWJ9MzFCehs20TsyFi6bIHbk5V1u52zJOnvF0Y/65z3GLZHKRuTgVPY4Z6LVePNahaQ+tA== dependencies: chalk "^4.0.0" - jest-diff "^27.0.2" - jest-get-type "^27.0.1" - pretty-format "^27.0.2" + jest-diff "^27.0.6" + jest-get-type "^27.0.6" + pretty-format "^27.0.6" -jest-message-util@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.0.2.tgz#181c9b67dff504d8f4ad15cba10d8b80f272048c" - integrity sha512-rTqWUX42ec2LdMkoUPOzrEd1Tcm+R1KfLOmFK+OVNo4MnLsEaxO5zPDb2BbdSmthdM/IfXxOZU60P/WbWF8BTw== +jest-message-util@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.0.6.tgz#158bcdf4785706492d164a39abca6a14da5ab8b5" + integrity sha512-rBxIs2XK7rGy+zGxgi+UJKP6WqQ+KrBbD1YMj517HYN3v2BG66t3Xan3FWqYHKZwjdB700KiAJ+iES9a0M+ixw== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^27.0.2" + "@jest/types" "^27.0.6" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.4" micromatch "^4.0.4" - pretty-format "^27.0.2" + pretty-format "^27.0.6" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^27.0.3: - version "27.0.3" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.0.3.tgz#5591844f9192b3335c0dca38e8e45ed297d4d23d" - integrity sha512-O5FZn5XDzEp+Xg28mUz4ovVcdwBBPfAhW9+zJLO0Efn2qNbYcDaJvSlRiQ6BCZUCVOJjALicuJQI9mRFjv1o9Q== +jest-mock@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.0.6.tgz#0efdd40851398307ba16778728f6d34d583e3467" + integrity sha512-lzBETUoK8cSxts2NYXSBWT+EJNzmUVtVVwS1sU9GwE1DLCfGsngg+ZVSIe0yd0ZSm+y791esiuo+WSwpXJQ5Bw== dependencies: - "@jest/types" "^27.0.2" + "@jest/types" "^27.0.6" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -1890,76 +1890,76 @@ jest-pnp-resolver@^1.2.2: resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== -jest-regex-util@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.1.tgz#69d4b1bf5b690faa3490113c47486ed85dd45b68" - integrity sha512-6nY6QVcpTgEKQy1L41P4pr3aOddneK17kn3HJw6SdwGiKfgCGTvH02hVXL0GU8GEKtPH83eD2DIDgxHXOxVohQ== +jest-regex-util@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.6.tgz#02e112082935ae949ce5d13b2675db3d8c87d9c5" + integrity sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ== -jest-resolve-dependencies@^27.0.5: - version "27.0.5" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.0.5.tgz#819ccdddd909c65acddb063aac3a49e4ba1ed569" - integrity sha512-xUj2dPoEEd59P+nuih4XwNa4nJ/zRd/g4rMvjHrZPEBWeWRq/aJnnM6mug+B+Nx+ILXGtfWHzQvh7TqNV/WbuA== +jest-resolve-dependencies@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.0.6.tgz#3e619e0ef391c3ecfcf6ef4056207a3d2be3269f" + integrity sha512-mg9x9DS3BPAREWKCAoyg3QucCr0n6S8HEEsqRCKSPjPcu9HzRILzhdzY3imsLoZWeosEbJZz6TKasveczzpJZA== dependencies: - "@jest/types" "^27.0.2" - jest-regex-util "^27.0.1" - jest-snapshot "^27.0.5" + "@jest/types" "^27.0.6" + jest-regex-util "^27.0.6" + jest-snapshot "^27.0.6" -jest-resolve@^27.0.5: - version "27.0.5" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.0.5.tgz#937535a5b481ad58e7121eaea46d1424a1e0c507" - integrity sha512-Md65pngRh8cRuWVdWznXBB5eDt391OJpdBaJMxfjfuXCvOhM3qQBtLMCMTykhuUKiBMmy5BhqCW7AVOKmPrW+Q== +jest-resolve@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.0.6.tgz#e90f436dd4f8fbf53f58a91c42344864f8e55bff" + integrity sha512-yKmIgw2LgTh7uAJtzv8UFHGF7Dm7XfvOe/LQ3Txv101fLM8cx2h1QVwtSJ51Q/SCxpIiKfVn6G2jYYMDNHZteA== dependencies: - "@jest/types" "^27.0.2" + "@jest/types" "^27.0.6" chalk "^4.0.0" escalade "^3.1.1" graceful-fs "^4.2.4" jest-pnp-resolver "^1.2.2" - jest-util "^27.0.2" - jest-validate "^27.0.2" + jest-util "^27.0.6" + jest-validate "^27.0.6" resolve "^1.20.0" slash "^3.0.0" -jest-runner@^27.0.5: - version "27.0.5" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.0.5.tgz#b6fdc587e1a5056339205914294555c554efc08a" - integrity sha512-HNhOtrhfKPArcECgBTcWOc+8OSL8GoFoa7RsHGnfZR1C1dFohxy9eLtpYBS+koybAHlJLZzNCx2Y/Ic3iEtJpQ== +jest-runner@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.0.6.tgz#1325f45055539222bbc7256a6976e993ad2f9520" + integrity sha512-W3Bz5qAgaSChuivLn+nKOgjqNxM7O/9JOJoKDCqThPIg2sH/d4A/lzyiaFgnb9V1/w29Le11NpzTJSzga1vyYQ== dependencies: - "@jest/console" "^27.0.2" - "@jest/environment" "^27.0.5" - "@jest/test-result" "^27.0.2" - "@jest/transform" "^27.0.5" - "@jest/types" "^27.0.2" + "@jest/console" "^27.0.6" + "@jest/environment" "^27.0.6" + "@jest/test-result" "^27.0.6" + "@jest/transform" "^27.0.6" + "@jest/types" "^27.0.6" "@types/node" "*" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" - jest-docblock "^27.0.1" - jest-environment-jsdom "^27.0.5" - jest-environment-node "^27.0.5" - jest-haste-map "^27.0.5" - jest-leak-detector "^27.0.2" - jest-message-util "^27.0.2" - jest-resolve "^27.0.5" - jest-runtime "^27.0.5" - jest-util "^27.0.2" - jest-worker "^27.0.2" + jest-docblock "^27.0.6" + jest-environment-jsdom "^27.0.6" + jest-environment-node "^27.0.6" + jest-haste-map "^27.0.6" + jest-leak-detector "^27.0.6" + jest-message-util "^27.0.6" + jest-resolve "^27.0.6" + jest-runtime "^27.0.6" + jest-util "^27.0.6" + jest-worker "^27.0.6" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.0.5: - version "27.0.5" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.0.5.tgz#cd5d1aa9754d30ddf9f13038b3cb7b95b46f552d" - integrity sha512-V/w/+VasowPESbmhXn5AsBGPfb35T7jZPGZybYTHxZdP7Gwaa+A0EXE6rx30DshHKA98lVCODbCO8KZpEW3hiQ== - dependencies: - "@jest/console" "^27.0.2" - "@jest/environment" "^27.0.5" - "@jest/fake-timers" "^27.0.5" - "@jest/globals" "^27.0.5" - "@jest/source-map" "^27.0.1" - "@jest/test-result" "^27.0.2" - "@jest/transform" "^27.0.5" - "@jest/types" "^27.0.2" +jest-runtime@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.0.6.tgz#45877cfcd386afdd4f317def551fc369794c27c9" + integrity sha512-BhvHLRVfKibYyqqEFkybsznKwhrsu7AWx2F3y9G9L95VSIN3/ZZ9vBpm/XCS2bS+BWz3sSeNGLzI3TVQ0uL85Q== + dependencies: + "@jest/console" "^27.0.6" + "@jest/environment" "^27.0.6" + "@jest/fake-timers" "^27.0.6" + "@jest/globals" "^27.0.6" + "@jest/source-map" "^27.0.6" + "@jest/test-result" "^27.0.6" + "@jest/transform" "^27.0.6" + "@jest/types" "^27.0.6" "@types/yargs" "^16.0.0" chalk "^4.0.0" cjs-module-lexer "^1.0.0" @@ -1967,30 +1967,30 @@ jest-runtime@^27.0.5: exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-haste-map "^27.0.5" - jest-message-util "^27.0.2" - jest-mock "^27.0.3" - jest-regex-util "^27.0.1" - jest-resolve "^27.0.5" - jest-snapshot "^27.0.5" - jest-util "^27.0.2" - jest-validate "^27.0.2" + jest-haste-map "^27.0.6" + jest-message-util "^27.0.6" + jest-mock "^27.0.6" + jest-regex-util "^27.0.6" + jest-resolve "^27.0.6" + jest-snapshot "^27.0.6" + jest-util "^27.0.6" + jest-validate "^27.0.6" slash "^3.0.0" strip-bom "^4.0.0" yargs "^16.0.3" -jest-serializer@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.0.1.tgz#2464d04dcc33fb71dc80b7c82e3c5e8a08cb1020" - integrity sha512-svy//5IH6bfQvAbkAEg1s7xhhgHTtXu0li0I2fdKHDsLP2P2MOiscPQIENQep8oU2g2B3jqLyxKKzotZOz4CwQ== +jest-serializer@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.0.6.tgz#93a6c74e0132b81a2d54623251c46c498bb5bec1" + integrity sha512-PtGdVK9EGC7dsaziskfqaAPib6wTViY3G8E5wz9tLVPhHyiDNTZn/xjZ4khAw+09QkoOVpn7vF5nPSN6dtBexA== dependencies: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^27.0.5: - version "27.0.5" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.0.5.tgz#6e3b9e8e193685372baff771ba34af631fe4d4d5" - integrity sha512-H1yFYdgnL1vXvDqMrnDStH6yHFdMEuzYQYc71SnC/IJnuuhW6J16w8GWG1P+qGd3Ag3sQHjbRr0TcwEo/vGS+g== +jest-snapshot@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.0.6.tgz#f4e6b208bd2e92e888344d78f0f650bcff05a4bf" + integrity sha512-NTHaz8He+ATUagUgE7C/UtFcRoHqR2Gc+KDfhQIyx+VFgwbeEMjeP+ILpUTLosZn/ZtbNdCF5LkVnN/l+V751A== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" @@ -1998,79 +1998,79 @@ jest-snapshot@^27.0.5: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/transform" "^27.0.5" - "@jest/types" "^27.0.2" + "@jest/transform" "^27.0.6" + "@jest/types" "^27.0.6" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.0.2" + expect "^27.0.6" graceful-fs "^4.2.4" - jest-diff "^27.0.2" - jest-get-type "^27.0.1" - jest-haste-map "^27.0.5" - jest-matcher-utils "^27.0.2" - jest-message-util "^27.0.2" - jest-resolve "^27.0.5" - jest-util "^27.0.2" + jest-diff "^27.0.6" + jest-get-type "^27.0.6" + jest-haste-map "^27.0.6" + jest-matcher-utils "^27.0.6" + jest-message-util "^27.0.6" + jest-resolve "^27.0.6" + jest-util "^27.0.6" natural-compare "^1.4.0" - pretty-format "^27.0.2" + pretty-format "^27.0.6" semver "^7.3.2" -jest-util@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.0.2.tgz#fc2c7ace3c75ae561cf1e5fdb643bf685a5be7c7" - integrity sha512-1d9uH3a00OFGGWSibpNYr+jojZ6AckOMCXV2Z4K3YXDnzpkAaXQyIpY14FOJPiUmil7CD+A6Qs+lnnh6ctRbIA== +jest-util@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.0.6.tgz#e8e04eec159de2f4d5f57f795df9cdc091e50297" + integrity sha512-1JjlaIh+C65H/F7D11GNkGDDZtDfMEM8EBXsvd+l/cxtgQ6QhxuloOaiayt89DxUvDarbVhqI98HhgrM1yliFQ== dependencies: - "@jest/types" "^27.0.2" + "@jest/types" "^27.0.6" "@types/node" "*" chalk "^4.0.0" graceful-fs "^4.2.4" is-ci "^3.0.0" picomatch "^2.2.3" -jest-validate@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.0.2.tgz#7fe2c100089449cd5cbb47a5b0b6cb7cda5beee5" - integrity sha512-UgBF6/oVu1ofd1XbaSotXKihi8nZhg0Prm8twQ9uCuAfo59vlxCXMPI/RKmrZEVgi3Nd9dS0I8A0wzWU48pOvg== +jest-validate@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.0.6.tgz#930a527c7a951927df269f43b2dc23262457e2a6" + integrity sha512-yhZZOaMH3Zg6DC83n60pLmdU1DQE46DW+KLozPiPbSbPhlXXaiUTDlhHQhHFpaqIFRrInko1FHXjTRpjWRuWfA== dependencies: - "@jest/types" "^27.0.2" + "@jest/types" "^27.0.6" camelcase "^6.2.0" chalk "^4.0.0" - jest-get-type "^27.0.1" + jest-get-type "^27.0.6" leven "^3.1.0" - pretty-format "^27.0.2" + pretty-format "^27.0.6" -jest-watcher@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.0.2.tgz#dab5f9443e2d7f52597186480731a8c6335c5deb" - integrity sha512-8nuf0PGuTxWj/Ytfw5fyvNn/R80iXY8QhIT0ofyImUvdnoaBdT6kob0GmhXR+wO+ALYVnh8bQxN4Tjfez0JgkA== +jest-watcher@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.0.6.tgz#89526f7f9edf1eac4e4be989bcb6dec6b8878d9c" + integrity sha512-/jIoKBhAP00/iMGnTwUBLgvxkn7vsOweDrOTSPzc7X9uOyUtJIDthQBTI1EXz90bdkrxorUZVhJwiB69gcHtYQ== dependencies: - "@jest/test-result" "^27.0.2" - "@jest/types" "^27.0.2" + "@jest/test-result" "^27.0.6" + "@jest/types" "^27.0.6" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^27.0.2" + jest-util "^27.0.6" string-length "^4.0.1" -jest-worker@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.0.2.tgz#4ebeb56cef48b3e7514552f80d0d80c0129f0b05" - integrity sha512-EoBdilOTTyOgmHXtw/cPc+ZrCA0KJMrkXzkrPGNwLmnvvlN1nj7MPrxpT7m+otSv2e1TLaVffzDnE/LB14zJMg== +jest-worker@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.0.6.tgz#a5fdb1e14ad34eb228cfe162d9f729cdbfa28aed" + integrity sha512-qupxcj/dRuA3xHPMUd40gr2EaAurFbkwzOh7wfPaeE9id7hyjURRQoqNfHifHK3XjJU6YJJUQKILGUnwGPEOCA== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^27.0.1: - version "27.0.5" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.0.5.tgz#141825e105514a834cc8d6e44670509e8d74c5f2" - integrity sha512-4NlVMS29gE+JOZvgmSAsz3eOjkSsHqjTajlIsah/4MVSmKvf3zFP/TvgcLoWe2UVHiE9KF741sReqhF0p4mqbQ== + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.0.6.tgz#10517b2a628f0409087fbf473db44777d7a04505" + integrity sha512-EjV8aETrsD0wHl7CKMibKwQNQc3gIRBXlTikBmmHUeVMKaPFxdcUIBfoDqTSXDoGJIivAYGqCWVlzCSaVjPQsA== dependencies: - "@jest/core" "^27.0.5" + "@jest/core" "^27.0.6" import-local "^3.0.2" - jest-cli "^27.0.5" + jest-cli "^27.0.6" js-tokens@^4.0.0: version "4.0.0" @@ -2447,12 +2447,12 @@ prettier@>=1.10: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d" integrity sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ== -pretty-format@^27.0.2: - version "27.0.2" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.0.2.tgz#9283ff8c4f581b186b2d4da461617143dca478a4" - integrity sha512-mXKbbBPnYTG7Yra9qFBtqj+IXcsvxsvOBco3QHxtxTl+hHKq6QdzMZ+q0CtL4ORHZgwGImRr2XZUX2EWzORxig== +pretty-format@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.0.6.tgz#ab770c47b2c6f893a21aefc57b75da63ef49a11f" + integrity sha512-8tGD7gBIENgzqA+UBzObyWqQ5B778VIFZA/S66cclyd5YkFLYs2Js7gxDKf0MXtTc9zcS7t1xhdfcElJ3YIvkQ== dependencies: - "@jest/types" "^27.0.2" + "@jest/types" "^27.0.6" ansi-regex "^5.0.0" ansi-styles "^5.0.0" react-is "^17.0.1" From 0d593c1e7ed2151d24942748395cf161e440cd5c Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 30 Jun 2021 09:05:00 -0400 Subject: [PATCH 198/785] Ensure all the necessary files are in the gem This makes sure the package.json and doc.js are present in the gem (now necessary for latest prettier). It also adds a CI step to check this in the future. --- .github/workflows/main.yml | 29 +++++++++++++++++++++++++++-- CHANGELOG.md | 1 + prettier.gemspec | 2 +- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cc7aeba8..36f81ef3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,7 @@ jobs: with: bundler-cache: true ruby-version: ${{ matrix.ruby }} - - uses: actions/setup-node@v2-beta + - uses: actions/setup-node@v2 with: node-version: 12.x - id: yarn-cache @@ -54,7 +54,7 @@ jobs: with: bundler-cache: true ruby-version: "3.0" - - uses: actions/setup-node@v2-beta + - uses: actions/setup-node@v2 with: node-version: 12.x - id: yarn-cache @@ -69,6 +69,31 @@ jobs: yarn check-format yarn lint + gem: + name: Gem + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + ruby-version: "3.0" + - uses: actions/setup-node@v2 + with: + node-version: 12.x + - id: yarn-cache + run: echo "::set-output name=directory::$(yarn cache dir)" + - uses: actions/cache@v1 + with: + path: ${{ steps.yarn-cache.outputs.directory }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: ${{ runner.os }}-yarn- + - run: yarn install --frozen-lockfile + - run: | + gem build -o prettier.gem + gem unpack prettier.gem + prettier/exe/rbprettier --help + # Saves pull request details for later workflow runs which can run in # a privileged environment save-pr-info: diff --git a/CHANGELOG.md b/CHANGELOG.md index ba33c290..5ad0c375 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#862](https://github.com/prettier/plugin-ruby/issues/862) - azz, kddeisz - Group together `.where.not` calls in method chains. - [#863](https://github.com/prettier/plugin-ruby/issues/863) - azz, kddeisz - Fix up Sorbet `sig` block formatting when chaining method calls. - [#908](https://github.com/prettier/plugin-ruby/issues/908) - Hansenq, kddeisz - Method chains with blocks should be properly indented. +- [#916](https://github.com/prettier/plugin-ruby/issues/916) - pbrisbin, kddeisz - Ensure all of the necessary files are present in the gem. ## [1.6.0] - 2021-06-23 diff --git a/prettier.gemspec b/prettier.gemspec index 5a381c48..b1c9fc98 100644 --- a/prettier.gemspec +++ b/prettier.gemspec @@ -17,7 +17,7 @@ Gem::Specification.new do |spec| %w[LICENSE bin/console package.json rubocop.yml] + Dir['{{exe,lib,src}/**/*,*.md}'] + Dir[ - 'node_modules/prettier/{index,bin-prettier,third-party,parser-*}.js' + 'node_modules/prettier/{package.json,index.js,doc.js,bin-prettier.js,third-party.js,parser-*.js}' ] end From 9527e1e10a4e04222854c5241137b677c17e245b Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 30 Jun 2021 09:30:05 -0400 Subject: [PATCH 199/785] Ensure hash keys with dynamic symbols do not strip their quotes --- CHANGELOG.md | 1 + src/ruby/nodes/strings.js | 4 +++- test/js/globalSetup.js | 2 +- test/js/ruby/nodes/strings.test.js | 3 +++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ad0c375..b69ca0e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#863](https://github.com/prettier/plugin-ruby/issues/863) - azz, kddeisz - Fix up Sorbet `sig` block formatting when chaining method calls. - [#908](https://github.com/prettier/plugin-ruby/issues/908) - Hansenq, kddeisz - Method chains with blocks should be properly indented. - [#916](https://github.com/prettier/plugin-ruby/issues/916) - pbrisbin, kddeisz - Ensure all of the necessary files are present in the gem. +- [#917](https://github.com/prettier/plugin-ruby/issues/917) - jscheid, kddeisz - Ensure hash keys with dynamic symbols don't strip their quotes. ## [1.6.0] - 2021-06-23 diff --git a/src/ruby/nodes/strings.js b/src/ruby/nodes/strings.js index 4ff54103..bb78e76a 100644 --- a/src/ruby/nodes/strings.js +++ b/src/ruby/nodes/strings.js @@ -152,8 +152,10 @@ function printDynaSymbol(path, opts, print) { if (isQuoteLocked(node)) { if (node.quote.startsWith("%")) { quote = opts.rubySingleQuote ? "'" : '"'; - } else { + } else if (node.quote.startsWith(":")) { quote = node.quote.slice(1); + } else { + quote = node.quote; } } else { quote = opts.rubySingleQuote && isSingleQuotable(node) ? "'" : '"'; diff --git a/test/js/globalSetup.js b/test/js/globalSetup.js index c0dbb363..7e4f4660 100644 --- a/test/js/globalSetup.js +++ b/test/js/globalSetup.js @@ -9,7 +9,7 @@ process.env.RUBY_VERSION = spawnSync("ruby", args).stdout.toString().trim(); // it to get back the AST. function globalSetup() { if (!process.env.PRETTIER_RUBY_HOST) { - process.env.PRETTIER_RUBY_HOST = `/tmp/prettier-ruby-test-${process.id}.sock`; + process.env.PRETTIER_RUBY_HOST = `/tmp/prettier-ruby-test-${process.pid}.sock`; } global.__ASYNC_PARSER__ = spawn("ruby", [ diff --git a/test/js/ruby/nodes/strings.test.js b/test/js/ruby/nodes/strings.test.js index 0d4a982a..f15d92be 100644 --- a/test/js/ruby/nodes/strings.test.js +++ b/test/js/ruby/nodes/strings.test.js @@ -196,6 +196,9 @@ describe("strings", () => { rubySingleQuote: false })); + test("symbol literal as a hash key", () => + expect("{ '\\d' => 1 }").toMatchFormat()); + test("%s literal with newlines", () => { const content = ruby(` a = %s[ From a84c262411794daad63af5be8af7ffc3bfa094ba Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 30 Jun 2021 09:36:49 -0400 Subject: [PATCH 200/785] Bump to 1.6.1 --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b69ca0e1..7fbe03d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [1.6.1] - 2021-06-30 + ### Changed - [#862](https://github.com/prettier/plugin-ruby/issues/862) - azz, kddeisz - Group together `.where.not` calls in method chains. @@ -1127,7 +1129,8 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.6.0...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.6.1...HEAD +[1.6.1]: https://github.com/prettier/plugin-ruby/compare/v1.6.0...v1.6.1 [1.6.0]: https://github.com/prettier/plugin-ruby/compare/v1.5.5...v1.6.0 [1.5.5]: https://github.com/prettier/plugin-ruby/compare/v1.5.4...v1.5.5 [1.5.4]: https://github.com/prettier/plugin-ruby/compare/v1.5.3...v1.5.4 diff --git a/package.json b/package.json index a1de9724..6d2336da 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "1.6.0", + "version": "1.6.1", "description": "prettier plugin for the Ruby programming language", "main": "src/plugin.js", "scripts": { From 835cf4fad9030cc32e1ba5602b218886b446a465 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Jul 2021 12:01:14 +0000 Subject: [PATCH 201/785] Bump husky from 6.0.0 to 7.0.0 Bumps [husky](https://github.com/typicode/husky) from 6.0.0 to 7.0.0. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v6.0.0...v7.0.0) --- updated-dependencies: - dependency-name: husky dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6d2336da..b5c5f0c6 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "devDependencies": { "eslint": "^7.22.0", "eslint-config-prettier": "^8.0.0", - "husky": "^6.0.0", + "husky": "^7.0.0", "jest": "^27.0.1", "pretty-quick": "^3.1.0" }, diff --git a/yarn.lock b/yarn.lock index 0c722760..f872488b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1505,10 +1505,10 @@ human-signals@^2.1.0: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== -husky@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/husky/-/husky-6.0.0.tgz#810f11869adf51604c32ea577edbc377d7f9319e" - integrity sha512-SQS2gDTB7tBN486QSoKPKQItZw97BMOd+Kdb6ghfpBc0yXyzrddI0oDV5MkDAbuB4X2mO3/nj60TRMcYxwzZeQ== +husky@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.0.tgz#3dbd5d28e76234689ee29bb41e048f28e3e46616" + integrity sha512-xK7lO0EtSzfFPiw+oQncQVy/XqV7UVVjxBByc+Iv5iK3yhW9boDoWgvZy3OGo48QKg/hUtZkzz0hi2HXa0kn7w== iconv-lite@0.4.24: version "0.4.24" From 9d4dd7ecd9ab56ecdeb48e1e6f8ef451cd7f754f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Jul 2021 12:01:17 +0000 Subject: [PATCH 202/785] Bump eslint from 7.29.0 to 7.30.0 Bumps [eslint](https://github.com/eslint/eslint) from 7.29.0 to 7.30.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v7.29.0...v7.30.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index f872488b..bc880701 100644 --- a/yarn.lock +++ b/yarn.lock @@ -316,6 +316,20 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" +"@humanwhocodes/config-array@^0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" + integrity sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg== + dependencies: + "@humanwhocodes/object-schema" "^1.2.0" + debug "^4.1.1" + minimatch "^3.0.4" + +"@humanwhocodes/object-schema@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz#87de7af9c231826fdd68ac7258f77c429e0e5fcf" + integrity sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w== + "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -1166,12 +1180,13 @@ eslint-visitor-keys@^2.0.0: integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== eslint@^7.22.0: - version "7.29.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.29.0.tgz#ee2a7648f2e729485e4d0bd6383ec1deabc8b3c0" - integrity sha512-82G/JToB9qIy/ArBzIWG9xvvwL3R86AlCjtGw+A29OMZDqhTybz/MByORSukGxeI+YPCR4coYyITKk8BFH9nDA== + version "7.30.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.30.0.tgz#6d34ab51aaa56112fd97166226c9a97f505474f8" + integrity sha512-VLqz80i3as3NdloY44BQSJpFw534L9Oh+6zJOUaViV4JPd+DaHwutqP7tcpkW3YiXbK6s05RZl7yl7cQn+lijg== dependencies: "@babel/code-frame" "7.12.11" "@eslint/eslintrc" "^0.4.2" + "@humanwhocodes/config-array" "^0.5.0" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" From eace4108e3341a0c0461ab5ebaabf61ff7e88f6f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Jul 2021 12:01:39 +0000 Subject: [PATCH 203/785] Bump husky from 7.0.0 to 7.0.1 Bumps [husky](https://github.com/typicode/husky) from 7.0.0 to 7.0.1. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v7.0.0...v7.0.1) --- updated-dependencies: - dependency-name: husky dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index bc880701..12518f25 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1521,9 +1521,9 @@ human-signals@^2.1.0: integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== husky@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.0.tgz#3dbd5d28e76234689ee29bb41e048f28e3e46616" - integrity sha512-xK7lO0EtSzfFPiw+oQncQVy/XqV7UVVjxBByc+Iv5iK3yhW9boDoWgvZy3OGo48QKg/hUtZkzz0hi2HXa0kn7w== + version "7.0.1" + resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.1.tgz#579f4180b5da4520263e8713cc832942b48e1f1c" + integrity sha512-gceRaITVZ+cJH9sNHqx5tFwbzlLCVxtVZcusME8JYQ8Edy5mpGDOqD8QBCdMhpyo9a+JXddnujQ4rpY2Ff9SJA== iconv-lite@0.4.24: version "0.4.24" From 05053a5d08b420b6226d1bc8b89da8ef50bd2d59 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sat, 10 Jul 2021 11:48:02 -0400 Subject: [PATCH 204/785] Update names --- LICENSE | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index 9f1c9555..1d229424 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2019-present Kevin Deisz +Copyright (c) 2019-present Kevin Newton Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/package.json b/package.json index b5c5f0c6..cb4366a6 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "type": "git", "url": "git+https://github.com/prettier/plugin-ruby.git" }, - "author": "Kevin Deisz", + "author": "Kevin Newton", "license": "MIT", "bugs": { "url": "https://github.com/prettier/plugin-ruby/issues" From d075e0462c27b47847a1f6c2ae9dd5423ad19ea5 Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sun, 11 Jul 2021 09:48:31 -0400 Subject: [PATCH 205/785] kddeisz -> kddnewton --- CHANGELOG.md | 584 +++++++++++++++++++++++++-------------------------- 1 file changed, 292 insertions(+), 292 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fbe03d0..3c6dc763 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,110 +10,110 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Changed -- [#862](https://github.com/prettier/plugin-ruby/issues/862) - azz, kddeisz - Group together `.where.not` calls in method chains. -- [#863](https://github.com/prettier/plugin-ruby/issues/863) - azz, kddeisz - Fix up Sorbet `sig` block formatting when chaining method calls. -- [#908](https://github.com/prettier/plugin-ruby/issues/908) - Hansenq, kddeisz - Method chains with blocks should be properly indented. -- [#916](https://github.com/prettier/plugin-ruby/issues/916) - pbrisbin, kddeisz - Ensure all of the necessary files are present in the gem. -- [#917](https://github.com/prettier/plugin-ruby/issues/917) - jscheid, kddeisz - Ensure hash keys with dynamic symbols don't strip their quotes. +- [#862](https://github.com/prettier/plugin-ruby/issues/862) - azz, kddnewton - Group together `.where.not` calls in method chains. +- [#863](https://github.com/prettier/plugin-ruby/issues/863) - azz, kddnewton - Fix up Sorbet `sig` block formatting when chaining method calls. +- [#908](https://github.com/prettier/plugin-ruby/issues/908) - Hansenq, kddnewton - Method chains with blocks should be properly indented. +- [#916](https://github.com/prettier/plugin-ruby/issues/916) - pbrisbin, kddnewton - Ensure all of the necessary files are present in the gem. +- [#917](https://github.com/prettier/plugin-ruby/issues/917) - jscheid, kddnewton - Ensure hash keys with dynamic symbols don't strip their quotes. ## [1.6.0] - 2021-06-23 ### Added -- [#859](https://github.com/prettier/plugin-ruby/issues/859) - azz, kddeisz - Support the `--insert-pragma` option for the incremental adoption workflow. -- [#904](https://github.com/prettier/plugin-ruby/issues/904) - Hansenq, kddeisz - Support the `%s` symbol literal syntax. -- [#833](https://github.com/prettier/plugin-ruby/issues/883) - kddeisz - Support for prettier >= v2.3.0. +- [#859](https://github.com/prettier/plugin-ruby/issues/859) - azz, kddnewton - Support the `--insert-pragma` option for the incremental adoption workflow. +- [#904](https://github.com/prettier/plugin-ruby/issues/904) - Hansenq, kddnewton - Support the `%s` symbol literal syntax. +- [#833](https://github.com/prettier/plugin-ruby/issues/883) - kddnewton - Support for prettier >= v2.3.0. ### Changed -- [#854](https://github.com/prettier/plugin-ruby/issues/854) - jflinter, kddeisz - Parentheses should not be stripped from optional RBS union types. -- [#888](https://github.com/prettier/plugin-ruby/issues/888) - MaxNotarangelo, kddeisz - Ensure parentheses wrap conditionals that get transformed into the modifier form when they're used within a binary node. -- [#874](https://github.com/prettier/plugin-ruby/issues/874) - yratanov, kddeisz - Ensure that method calls chained onto the ends of blocks still print their arguments. +- [#854](https://github.com/prettier/plugin-ruby/issues/854) - jflinter, kddnewton - Parentheses should not be stripped from optional RBS union types. +- [#888](https://github.com/prettier/plugin-ruby/issues/888) - MaxNotarangelo, kddnewton - Ensure parentheses wrap conditionals that get transformed into the modifier form when they're used within a binary node. +- [#874](https://github.com/prettier/plugin-ruby/issues/874) - yratanov, kddnewton - Ensure that method calls chained onto the ends of blocks still print their arguments. - [#897](https://github.com/prettier/plugin-ruby/pull/897) - Hansenq - Reenable the `Layout/LineLength` rubocop rule in our shipped config so that line lengths for other cops are calculated correctly. ## [1.5.5] - 2021-03-25 ### Changed -- [#841](https://github.com/prettier/plugin-ruby/issues/841) - LoganBarnett, kddeisz - Better error messaging for when unix sockets are not supported by netcat. -- [#844](https://github.com/prettier/plugin-ruby/issues/844) - andyw8, kddeisz - Ensure we ship all of the parsers with the prettier gem so that `rbprettier` can parse other languages as well. -- [#847](https://github.com/prettier/plugin-ruby/issues/847) - jflinter, kddeisz - Ensure parentheses are present on union return types in RBS. -- [#850](https://github.com/prettier/plugin-ruby/issues/850) - maethub, kddeisz - Ensure double quotes are used even when single quotes are requested for HAML attribute values. -- [#849](https://github.com/prettier/plugin-ruby/issues/849) - indirect, kddeisz - Support HAML version <= 5.1 multi-line attributes. -- [#810](https://github.com/prettier/plugin-ruby/issues/810) - valscion, kddeisz - Make it so that brace blocks containing heredocs have the correct end line so that they format subsequent statements correctly. +- [#841](https://github.com/prettier/plugin-ruby/issues/841) - LoganBarnett, kddnewton - Better error messaging for when unix sockets are not supported by netcat. +- [#844](https://github.com/prettier/plugin-ruby/issues/844) - andyw8, kddnewton - Ensure we ship all of the parsers with the prettier gem so that `rbprettier` can parse other languages as well. +- [#847](https://github.com/prettier/plugin-ruby/issues/847) - jflinter, kddnewton - Ensure parentheses are present on union return types in RBS. +- [#850](https://github.com/prettier/plugin-ruby/issues/850) - maethub, kddnewton - Ensure double quotes are used even when single quotes are requested for HAML attribute values. +- [#849](https://github.com/prettier/plugin-ruby/issues/849) - indirect, kddnewton - Support HAML version <= 5.1 multi-line attributes. +- [#810](https://github.com/prettier/plugin-ruby/issues/810) - valscion, kddnewton - Make it so that brace blocks containing heredocs have the correct end line so that they format subsequent statements correctly. ## [1.5.4] - 2021-03-17 ### Changed -- [#835](https://github.com/prettier/plugin-ruby/issues/835) - valscion, kddeisz - Array splat operator should not get moved by leading comments. -- [#836](https://github.com/prettier/plugin-ruby/issues/836) - valscion, kddeisz - Array splat operator should not get moved by trailing comments. -- [#821](https://github.com/prettier/plugin-ruby/issues/821) - jscheid, kddeisz - Better error handling when using GNU netcat. +- [#835](https://github.com/prettier/plugin-ruby/issues/835) - valscion, kddnewton - Array splat operator should not get moved by leading comments. +- [#836](https://github.com/prettier/plugin-ruby/issues/836) - valscion, kddnewton - Array splat operator should not get moved by trailing comments. +- [#821](https://github.com/prettier/plugin-ruby/issues/821) - jscheid, kddnewton - Better error handling when using GNU netcat. ## [1.5.3] - 2021-02-28 ### Changed -- [#812](https://github.com/prettier/plugin-ruby/issues/812) - valscion, kddeisz - Splats and blocks within args that have comments attached should place their respective operators in the right place. +- [#812](https://github.com/prettier/plugin-ruby/issues/812) - valscion, kddnewton - Splats and blocks within args that have comments attached should place their respective operators in the right place. - [#816](https://github.com/prettier/plugin-ruby/pull/816) - valscion - Document RuboCop's Style/Lambda should be disabled -- [#814](https://github.com/prettier/plugin-ruby/issues/814) - jscheid, kddeisz - Provide better errors when the source location of the error is known. +- [#814](https://github.com/prettier/plugin-ruby/issues/814) - jscheid, kddnewton - Provide better errors when the source location of the error is known. ## [1.5.2] - 2021-02-03 ### Changed -- kddeisz - Fix up `binary` node comparison operators so that it will handle either Symbol literals or the `@op` nodes which are incorrectly coming from JRuby (https://github.com/jruby/jruby/issues/6548). +- kddnewton - Fix up `binary` node comparison operators so that it will handle either Symbol literals or the `@op` nodes which are incorrectly coming from JRuby (https://github.com/jruby/jruby/issues/6548). ## [1.5.1] - 2021-01-27 ### Changed -- [#799](https://github.com/prettier/plugin-ruby/issues/799) - jscheid, kddeisz - Multi-byte characters shouldn't give invalid source string bounds. -- [#801](https://github.com/prettier/plugin-ruby/issues/801) - jscheid, kddeisz - When converting a conditional to the modifier form, make sure to add parentheses if there is a chained method call. -- [#803](https://github.com/prettier/plugin-ruby/issues/803) - jscheid, kddeisz - Fix `formatWithCursor` support to match new parser format. +- [#799](https://github.com/prettier/plugin-ruby/issues/799) - jscheid, kddnewton - Multi-byte characters shouldn't give invalid source string bounds. +- [#801](https://github.com/prettier/plugin-ruby/issues/801) - jscheid, kddnewton - When converting a conditional to the modifier form, make sure to add parentheses if there is a chained method call. +- [#803](https://github.com/prettier/plugin-ruby/issues/803) - jscheid, kddnewton - Fix `formatWithCursor` support to match new parser format. ## [1.5.0] - 2021-01-21 ### Added -- kddeisz - Add `.rbi` as a file type that we support. +- kddnewton - Add `.rbi` as a file type that we support. ### Changed -- [#795](https://github.com/prettier/plugin-ruby/issues/795) djrodgerspryor, kddeisz - Trailing comments attached to empty arrays should not multiply. -- [#794](https://github.com/prettier/plugin-ruby/issues/794) djrodgerspryor, kddeisz - Fix embedded parser parsing by stripping common leading whitespace before passing on the content. -- [#793](https://github.com/prettier/plugin-ruby/issues/793) djrodgerspryor, kddeisz - Do not include trailing commas on arguments within `arg_paren` nodes if they could not be parsed with them (`command` and `command_call`). -- [#788](https://github.com/prettier/plugin-ruby/issues/788) clarkdave, kddeisz - Break child hashes within a multi-line hash regardless of whether or not they can fit on one line. -- kddeisz - Stop using `;` to separate empty class definitions, module definitions, and loops. +- [#795](https://github.com/prettier/plugin-ruby/issues/795) djrodgerspryor, kddnewton - Trailing comments attached to empty arrays should not multiply. +- [#794](https://github.com/prettier/plugin-ruby/issues/794) djrodgerspryor, kddnewton - Fix embedded parser parsing by stripping common leading whitespace before passing on the content. +- [#793](https://github.com/prettier/plugin-ruby/issues/793) djrodgerspryor, kddnewton - Do not include trailing commas on arguments within `arg_paren` nodes if they could not be parsed with them (`command` and `command_call`). +- [#788](https://github.com/prettier/plugin-ruby/issues/788) clarkdave, kddnewton - Break child hashes within a multi-line hash regardless of whether or not they can fit on one line. +- kddnewton - Stop using `;` to separate empty class definitions, module definitions, and loops. ## [1.4.0] - 2021-01-15 ### Added -- ianks, kddeisz - Use `netcat` to communicate to a parser server for better performance when formatting multiple files. +- ianks, kddnewton - Use `netcat` to communicate to a parser server for better performance when formatting multiple files. ### Changed -- jeffcarbs, kddeisz - Long strings with interpolated expressions should only break if the contents in the original source is broken. -- johannesluedke, kddeisz - Fix for rescues with inline comments. -- johncsnyder, kddeisz - Comments should not attach to nodes beyond a double newline. -- blampe, kddeisz - Comments inside of a broken method chain get dropped. -- clarkdave, kddeisz - Don't ignore Sorbet `sig` transformations. +- jeffcarbs, kddnewton - Long strings with interpolated expressions should only break if the contents in the original source is broken. +- johannesluedke, kddnewton - Fix for rescues with inline comments. +- johncsnyder, kddnewton - Comments should not attach to nodes beyond a double newline. +- blampe, kddnewton - Comments inside of a broken method chain get dropped. +- clarkdave, kddnewton - Don't ignore Sorbet `sig` transformations. ## [1.3.0] - 2021-01-05 ### Added -- kddeisz - Handling of the RBS language. -- kddeisz - Incorporate the HAML plugin. +- kddnewton - Handling of the RBS language. +- kddnewton - Incorporate the HAML plugin. ## [1.2.5] - 2021-01-04 ### Changed -- nruth, kddeisz - Ensure unary operators on method calls that are sending operators get the correct scanner events. -- cvoege, kddeisz - Do not add parentheses when they're not needed to non-breaking command_calls with ternary arguments. -- valscion, kddeisz - Print method chains more nicely off array and hash literals. +- nruth, kddnewton - Ensure unary operators on method calls that are sending operators get the correct scanner events. +- cvoege, kddnewton - Do not add parentheses when they're not needed to non-breaking command_calls with ternary arguments. +- valscion, kddnewton - Print method chains more nicely off array and hash literals. ## [1.2.4] - 2021-01-03 @@ -123,102 +123,102 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Changed -- kddeisz - Reduce JSON size passing from Ruby process to node process by changing `char_start` -> `sc`, `char_end` -> `ec`, `start` -> `sl`, `end` -> `el`. -- kddeisz - Up the max buffer size between the Ruby and node processes to 15K. +- kddnewton - Reduce JSON size passing from Ruby process to node process by changing `char_start` -> `sc`, `char_end` -> `ec`, `start` -> `sl`, `end` -> `el`. +- kddnewton - Up the max buffer size between the Ruby and node processes to 15K. ## [1.2.3] - 2021-01-02 ### Changed -- lukyth, kddeisz - Ensure if a ternary breaks into an `if..else..end` within a `command_call` node that parentheses are added. -- AlanFoster, kddeisz - Ensure you consume the optional `do` keyword on `while` and `until` loops so that it doesn't confuse the parser. -- AlanFoster, kddeisz - Ensure key-value pairs split on line when the key has a comment attached within a hash. -- AlanFoster, kddeisz - Fix for `for` loops that have multiple index variables. -- AlanFoster, kddeisz - Fix parsing very large files by reducing the size of the JSON output from the parser. -- AlanFoster, kddeisz - Ensure you don't skip parentheses if you're returning a value with the `not` unary operator. +- lukyth, kddnewton - Ensure if a ternary breaks into an `if..else..end` within a `command_call` node that parentheses are added. +- AlanFoster, kddnewton - Ensure you consume the optional `do` keyword on `while` and `until` loops so that it doesn't confuse the parser. +- AlanFoster, kddnewton - Ensure key-value pairs split on line when the key has a comment attached within a hash. +- AlanFoster, kddnewton - Fix for `for` loops that have multiple index variables. +- AlanFoster, kddnewton - Fix parsing very large files by reducing the size of the JSON output from the parser. +- AlanFoster, kddnewton - Ensure you don't skip parentheses if you're returning a value with the `not` unary operator. ## [1.2.2] - 2021-01-01 ### Changed - nathan-beam - Gem does not work with CMD/Powershell. -- blampe, kddeisz - Comments inside keyword parameters in method declarations are not printed. -- blampe, kddeisz - `command_call` nodes with unary operators incorrectly parse their operator. -- blampe, kddeisz - Returning multiple values where the first has parentheses was incorrectly removing the remaining values. -- johncsnyder, kddeisz - Call chains whose left-most receiver is a no-indent expression should not indent their entire chain. +- blampe, kddnewton - Comments inside keyword parameters in method declarations are not printed. +- blampe, kddnewton - `command_call` nodes with unary operators incorrectly parse their operator. +- blampe, kddnewton - Returning multiple values where the first has parentheses was incorrectly removing the remaining values. +- johncsnyder, kddnewton - Call chains whose left-most receiver is a no-indent expression should not indent their entire chain. ## [1.2.1] - 2020-12-27 ### Changed -- kddeisz - Handle single-line method definitions with parameters. -- kddeisz - Handle hash and array patterns nested within find patterns. -- kddeisz - Handle rightward assignment. -- kddeisz - Handle find patterns with named boundaries. -- kddeisz - Handle rightward assignment in conditionals. +- kddnewton - Handle single-line method definitions with parameters. +- kddnewton - Handle hash and array patterns nested within find patterns. +- kddnewton - Handle rightward assignment. +- kddnewton - Handle find patterns with named boundaries. +- kddnewton - Handle rightward assignment in conditionals. ## [1.2.0] - 2020-12-26 ### Added -- kddeisz - Support for the `fndptn` node for Ruby 3.0 pattern matching. -- kddeisz - Support for Ruby 3.0+ single-line method definitions. +- kddnewton - Support for the `fndptn` node for Ruby 3.0 pattern matching. +- kddnewton - Support for Ruby 3.0+ single-line method definitions. ## [1.1.0] - 2020-12-20 ### Added -- kddeisz - Now that the comments are all fixed up, we can support `# prettier-ignore` comments. +- kddnewton - Now that the comments are all fixed up, we can support `# prettier-ignore` comments. ### Changed -- rindek, kddeisz - Do not remove parentheses when receiver looks like a constant. -- rindek, kddeisz - Do not remove parentheses when using the special `call` syntax with no arguments. +- rindek, kddnewton - Do not remove parentheses when receiver looks like a constant. +- rindek, kddnewton - Do not remove parentheses when using the special `call` syntax with no arguments. - ykpythemind - Do not change regexp bounds if the body has certain content. -- karanmandal, kddeisz - Correctly print for loops. -- rafbm, kddeisz - If there are method chains with arguments only at the end, we should group the method chain and the method args. +- karanmandal, kddnewton - Correctly print for loops. +- rafbm, kddnewton - If there are method chains with arguments only at the end, we should group the method chain and the method args. ## [1.0.1] - 2020-12-12 ### Changed -- steobrien, kddeisz - Ensure leading comments in empty array and hash literals do not duplicate. +- steobrien, kddnewton - Ensure leading comments in empty array and hash literals do not duplicate. ## [1.0.0] - 2020-12-11 ### Changed -- kddeisz - Do not unescape double quotes in a single quote string. -- kddeisz - Only force braces on regexp for spaces and equals if it's inside a command or command_call. -- kddeisz - Leave Sorbet type annotations in place. -- kddeisz - Don't group hash contents, just allow them to break with their parent node. -- kddeisz - Honor the UTF-8 lang passed in through ENV vars. +- kddnewton - Do not unescape double quotes in a single quote string. +- kddnewton - Only force braces on regexp for spaces and equals if it's inside a command or command_call. +- kddnewton - Leave Sorbet type annotations in place. +- kddnewton - Don't group hash contents, just allow them to break with their parent node. +- kddnewton - Honor the UTF-8 lang passed in through ENV vars. ## [1.0.0-rc2] - 2020-12-10 ### Changed -- kddeisz - Print hashes with consistent keys (e.g., if one key cannot be a hash label, use all hash rockets). -- kddeisz - Respect using `o` or not using `o` for octal numbers. -- kddeisz - Ensure `when` clauses with multiple predicates that can be split into multiple lines are split correctly. -- kddeisz - Ensure hash literal is split correctly when only its contents would fit on one line. -- kddeisz - Simplify `toProc` checks by not calling if the option is disabled. -- johncsnyder, kddeisz - Add `method_add_block` to the potential like of method calls that can be chained. -- kddeisz - Add the `rubyArrayLiteral` option for disabling automatically turning into array literals. +- kddnewton - Print hashes with consistent keys (e.g., if one key cannot be a hash label, use all hash rockets). +- kddnewton - Respect using `o` or not using `o` for octal numbers. +- kddnewton - Ensure `when` clauses with multiple predicates that can be split into multiple lines are split correctly. +- kddnewton - Ensure hash literal is split correctly when only its contents would fit on one line. +- kddnewton - Simplify `toProc` checks by not calling if the option is disabled. +- johncsnyder, kddnewton - Add `method_add_block` to the potential like of method calls that can be chained. +- kddnewton - Add the `rubyArrayLiteral` option for disabling automatically turning into array literals. ## [1.0.0-rc1] - 2020-12-09 ### Changed -- kddeisz - Rename options to prep for v1.0 release. +- kddnewton - Rename options to prep for v1.0 release. - `addTrailingCommas` -> `trailingComma`, `"es5"` means `true` - `inlineConditionals` and `inlineLoops` -> `rubyModifier` - `preferHashLabels` -> `rubyHashLabel` - `preferSingleQuotes` -> `rubySingleQuote` - `toProcTransform` -> `rubyToProc` -- andyw8, kddeisz - Fix for Ruby `2.5.1` dyna_symbols. Turns out they were previously incorrectly reported as `xstring` nodes. -- andyw8, kddeisz - Fix for plain `rescue` nodes with only comments in the body. -- andyw8, kddeisz - Move declaration-type comments up to the line in the original source, as in: +- andyw8, kddnewton - Fix for Ruby `2.5.1` dyna_symbols. Turns out they were previously incorrectly reported as `xstring` nodes. +- andyw8, kddnewton - Fix for plain `rescue` nodes with only comments in the body. +- andyw8, kddnewton - Move declaration-type comments up to the line in the original source, as in: ```ruby def foo # :nodoc: @@ -229,11 +229,11 @@ end The comment in the above example should stay in place. - janklimo - Respect special call syntax, e.g., `a.(1, 2, 3)` should remain the same. -- kddeisz - Fix up a bug with `ensure` being used in a `bodystmt` and not a `begin`. -- kddeisz - Fix up a bug with negative ranges, e.g., `-4..-3`. -- kddeisz - Fix up a bug with operator aliases, e.g., `alias << push`. -- kddeisz - Fix up a bug with calls and unary nodes, e.g., `!!foo&.bar`. -- kddeisz - Fix up a bug with multiple rescue clauses and comments, e.g., +- kddnewton - Fix up a bug with `ensure` being used in a `bodystmt` and not a `begin`. +- kddnewton - Fix up a bug with negative ranges, e.g., `-4..-3`. +- kddnewton - Fix up a bug with operator aliases, e.g., `alias << push`. +- kddnewton - Fix up a bug with calls and unary nodes, e.g., `!!foo&.bar`. +- kddnewton - Fix up a bug with multiple rescue clauses and comments, e.g., ```ruby begin @@ -243,64 +243,64 @@ rescue Foo, Bar end ``` -- kddeisz - Handle string literals that start with `%Q`. -- kddeisz - Handle question method methods in the predicate of an if with a comment in the body. -- kddeisz - Fix bare `break` with comments immediately after. -- kddeisz - Fix for heredocs with comments immediately after the declaration. -- kddeisz - Fix for comments when you're defining a method whose name overlaps with a keyword. -- kddeisz - Don't automatically indent inside interpolated expressions from within a heredoc. -- kddeisz - Don't convert into string literal arrays if the elements have brackets. -- kddeisz - Ensure you break the parent when there is an assignment in the predicate of a loop. -- kddeisz - Fix up a bug with keyword aliases, e.g., `alias in within`. -- kddeisz - Force using braces for regex if a regex starts with a blank space. -- kddeisz - Force using braces for regex if a regex starts with an equals sign. -- kddeisz - Fix up a bug with constant aliases, e.g., `alias in IN`. -- andyw8, kddeisz - Ensure `rescue` comments stay on the same line as their declaration. +- kddnewton - Handle string literals that start with `%Q`. +- kddnewton - Handle question method methods in the predicate of an if with a comment in the body. +- kddnewton - Fix bare `break` with comments immediately after. +- kddnewton - Fix for heredocs with comments immediately after the declaration. +- kddnewton - Fix for comments when you're defining a method whose name overlaps with a keyword. +- kddnewton - Don't automatically indent inside interpolated expressions from within a heredoc. +- kddnewton - Don't convert into string literal arrays if the elements have brackets. +- kddnewton - Ensure you break the parent when there is an assignment in the predicate of a loop. +- kddnewton - Fix up a bug with keyword aliases, e.g., `alias in within`. +- kddnewton - Force using braces for regex if a regex starts with a blank space. +- kddnewton - Force using braces for regex if a regex starts with an equals sign. +- kddnewton - Fix up a bug with constant aliases, e.g., `alias in IN`. +- andyw8, kddnewton - Ensure `rescue` comments stay on the same line as their declaration. ## [0.22.0] - 2020-12-08 ### Changed - flyerhzm - Print method chains by one indentation. -- mmcnl, kddeisz - Handle heredocs and blocks being passed to the same method. -- johncsnyder, kddeisz - Ensure correct formatting when breaking up conditionals with `inlineConditionals: false`. +- mmcnl, kddnewton - Handle heredocs and blocks being passed to the same method. +- johncsnyder, kddnewton - Ensure correct formatting when breaking up conditionals with `inlineConditionals: false`. - Rsullivan00 - Ensure that when ternaries as command arguments get broken into multiple lines we add the necessary parentheses. - jbielick - Maintain parse order during if/unless modifier expressions - flyerhzm - Slight prettifying of wrapped args if doc length is under a certain value. -- github0013, kddeisz - Ensure `not` keeps parentheses if they are being used. +- github0013, kddnewton - Ensure `not` keeps parentheses if they are being used. - jbielick - Print heredocs consistently. -- kddeisz - Completely revamp the way we handle comments. -- kddeisz - Support `hshptn` and the remaining missing pattern matching syntax. +- kddnewton - Completely revamp the way we handle comments. +- kddnewton - Support `hshptn` and the remaining missing pattern matching syntax. ## [0.21.0] - 2020-12-02 ### Changed -- kddeisz, ryan-hunter-pc - Explicitly handle `break` and `next` keyword parentheses. -- jbielick, kddeisz - Don't convert between `lambda {}` and `-> {}`. Technically it's breaking the semantics of the program. Also because lambda method call arguments can't handle everything that stabby lambda can. -- kddeisz - Turn off the `Symbol#to_proc` transform by default. -- janklimo, kddeisz - Properly handle trailing commas on hash arguments. -- coiti, kddeisz - Properly handle parentheses when necessary on if/unless statements and while/until loops. +- kddnewton, ryan-hunter-pc - Explicitly handle `break` and `next` keyword parentheses. +- jbielick, kddnewton - Don't convert between `lambda {}` and `-> {}`. Technically it's breaking the semantics of the program. Also because lambda method call arguments can't handle everything that stabby lambda can. +- kddnewton - Turn off the `Symbol#to_proc` transform by default. +- janklimo, kddnewton - Properly handle trailing commas on hash arguments. +- coiti, kddnewton - Properly handle parentheses when necessary on if/unless statements and while/until loops. - Rsullivan00 - Prevent `command` and `command_call` nodes from being turned into ternaries. -- kddeisz - Better handling of the `alias` node with and without comments. -- kddeisz - Better handling of the `BEGIN` and `END` nodes with and without comments. -- kddeisz - Much better handling of heredocs where now there is a consistent `heredoc` node instead of multiple. +- kddnewton - Better handling of the `alias` node with and without comments. +- kddnewton - Better handling of the `BEGIN` and `END` nodes with and without comments. +- kddnewton - Much better handling of heredocs where now there is a consistent `heredoc` node instead of multiple. ## [0.20.1] - 2020-09-04 ### Changed -- ftes, kddeisz - Properly escape HAML plain text statements that start with special HAML characters. +- ftes, kddnewton - Properly escape HAML plain text statements that start with special HAML characters. ### Removed -- kddeisz - I'm stripping out the HAML plugin and putting it into its own package (`@prettier/plugin-haml`). It's become too difficult to maintain within this repo, and it's confusing for contributors because there are some things that work with Ruby and some things that don't. This is going to simplify maintenance. This should probably be a major version bump but since we're still pre `1.0` I'm going to leave it as a patch. +- kddnewton - I'm stripping out the HAML plugin and putting it into its own package (`@prettier/plugin-haml`). It's become too difficult to maintain within this repo, and it's confusing for contributors because there are some things that work with Ruby and some things that don't. This is going to simplify maintenance. This should probably be a major version bump but since we're still pre `1.0` I'm going to leave it as a patch. ## [0.20.0] - 2020-08-28 ### Added -- kddeisz - Allow embedded formatting on heredocs by the name placed at the start. For example, +- kddnewton - Allow embedded formatting on heredocs by the name placed at the start. For example, ```ruby @@ -320,30 +320,30 @@ JAVASCRIPT ### Changed - Rsullivan00 - Do not tranform word-literal arrays when there is an escape sequence. -- steobrien, kddeisz - Do not indent heredocs with calls more than they should be. +- steobrien, kddnewton - Do not indent heredocs with calls more than they should be. - jpickwell - Include .simplecov in filenames -- github0013, kddeisz - Ensure we're parsing ruby files using UTF-8 regardless of the system encoding. +- github0013, kddnewton - Ensure we're parsing ruby files using UTF-8 regardless of the system encoding. ## [0.19.0] - 2020-07-03 ### Added - ryan-hunter-pc - Add the option to disable the `Symbol#to_proc` transform. -- ryan-hunter-pc], [@SViccari, kddeisz - Disable `Symbol#to_proc` transform when used as a key inside of a hash where the key is either `:if` or `:unless`. +- ryan-hunter-pc], [@SViccari, kddnewton - Disable `Symbol#to_proc` transform when used as a key inside of a hash where the key is either `:if` or `:unless`. ## [0.18.2] - 2020-05-01 ### Changed - alse - Support `vscodeLanguageIds` for HAML. -- ShayDavidson, kddeisz - Don't allow replacing if/else with ternary if there's an assignment in the predicate. +- ShayDavidson, kddnewton - Don't allow replacing if/else with ternary if there's an assignment in the predicate. - janklimo - Do not add an empty line after `rescue` when the block is empty. ## [0.18.1] - 2020-04-05 ### Changed -- petevk, kddeisz - Use braces for block format iff it was originally a brace block, otherwise you could be changing precedence. For example: +- petevk, kddnewton - Use braces for block format iff it was originally a brace block, otherwise you could be changing precedence. For example: ```ruby @@ -367,10 +367,10 @@ should maintain its `do...end` and not switch to inline braces otherwise the bra [1] ``` -- ftes, kddeisz - When old-form dynamic attributes are added to a `div` tag in HAML, it was previously skipping printing the `%div`, which led to it being incorrectly displayed. -- ftes, kddeisz - Previously if you had a long tag declaration with attributes that made it hit the line limit, then the content of the tag would be pushed to the next line but indented one character too many. -- ftes, kddeisz - Don't explicitly require JSON if it has already been loaded, as this can lead to rubygems activation errors. -- mmainz, kddeisz - Handle heredocs as the receivers of call nodes, as in: +- ftes, kddnewton - When old-form dynamic attributes are added to a `div` tag in HAML, it was previously skipping printing the `%div`, which led to it being incorrectly displayed. +- ftes, kddnewton - Previously if you had a long tag declaration with attributes that made it hit the line limit, then the content of the tag would be pushed to the next line but indented one character too many. +- ftes, kddnewton - Don't explicitly require JSON if it has already been loaded, as this can lead to rubygems activation errors. +- mmainz, kddnewton - Handle heredocs as the receivers of call nodes, as in: ```ruby @@ -379,7 +379,7 @@ foo = <<~TEXT.strip TEXT ``` -- github0013, kddeisz - Leave parentheses in place if the value of a return node contains a binary with low operator precedence, as in: +- github0013, kddnewton - Leave parentheses in place if the value of a return node contains a binary with low operator precedence, as in: ```ruby @@ -390,13 +390,13 @@ return (a or b) if c? ### Added -- kddeisz - Support for the `nokw_param` node for specifying when methods should no accept keywords, as in: +- kddnewton - Support for the `nokw_param` node for specifying when methods should no accept keywords, as in: ```ruby def foo(**nil); end ``` -- kddeisz - Support for the `args_forward` node for forwarding all types of arguments, as in: +- kddnewton - Support for the `args_forward` node for forwarding all types of arguments, as in: ```ruby def foo(...) @@ -406,13 +406,13 @@ end ### Changed -- ftes, kddeisz - Handled 3 or more classes on a node in HAML, as in: +- ftes, kddnewton - Handled 3 or more classes on a node in HAML, as in: ```haml %table.table.is-striped.is-hoverable ``` -- ftes, kddeisz - Better handling of indentation of `if/elsif/else`, `unless/elsif/else`, and `case/when` branches, as in: +- ftes, kddnewton - Better handling of indentation of `if/elsif/else`, `unless/elsif/else`, and `case/when` branches, as in: ```haml .column.is-12 @@ -445,7 +445,7 @@ Config::Download.new( ).perform ``` -- pje, kddeisz - Method definition bodies (on `defs` nodes) should dedent if a helper method is called. As in: +- pje, kddnewton - Method definition bodies (on `defs` nodes) should dedent if a helper method is called. As in: ```ruby @@ -463,7 +463,7 @@ private def self.foo end ``` -- masqita, kddeisz - Inline variable assignment within a predicate should force the conditional to break, as in: +- masqita, kddnewton - Inline variable assignment within a predicate should force the conditional to break, as in: ```ruby array.each do |element| @@ -473,16 +473,16 @@ array.each do |element| end ``` -- hafley66, kddeisz - Handle empty `while` and `until` blocks. -- Fruetel, kddeisz - Simplify string escape pattern by locking on any escape sequence. -- flyerhzm, kddeisz - Properly handle string quotes on symbols in hash keys. +- hafley66, kddnewton - Handle empty `while` and `until` blocks. +- Fruetel, kddnewton - Simplify string escape pattern by locking on any escape sequence. +- flyerhzm, kddnewton - Properly handle string quotes on symbols in hash keys. ## [0.17.0] - 2019-12-12 ### Added - matt-wratt - Better support for explicit `return` nodes with empty arrays or arrays with a single element. -- jrdioko, kddeisz - Alignment of `not_to` is explicitly allowed to not indent to better support rspec. +- jrdioko, kddnewton - Alignment of `not_to` is explicitly allowed to not indent to better support rspec. ### Changed @@ -492,7 +492,7 @@ end ### Added -- mmainz, kddeisz - Support for extra commas in multiple assignment, as it changes the meaning. For example, +- mmainz, kddnewton - Support for extra commas in multiple assignment, as it changes the meaning. For example, ```ruby @@ -501,12 +501,12 @@ a, = [1, 2, 3] would previously get printed as `a = [1, 2, 3]`, which changes the value of `a` from `1` to the value of the entire array. -- kddeisz - Experimental support for the HAMtemplate language. +- kddnewton - Experimental support for the HAMtemplate language. ### Changed -- github0013, kddeisz - Support proper string escaping when the original string in the source is wrapped in `%q|...|`. For example, `%q|\'|` should get printed as `"\'"`, where previously it was dropping the backslash. -- jamescostian, kddeisz - Force ternary breaking when using the lower-precendence operators `and` and `or`. For example, +- github0013, kddnewton - Support proper string escaping when the original string in the source is wrapped in `%q|...|`. For example, `%q|\'|` should get printed as `"\'"`, where previously it was dropping the backslash. +- jamescostian, kddnewton - Force ternary breaking when using the lower-precendence operators `and` and `or`. For example, ```ruby @@ -519,7 +519,7 @@ end the previous expression was being transformed into a ternary which was invalid ruby. Instead it now stays broken out into an if/else block. -- localhostdotdev], [@joeyjoejoejr], [@eins78, kddeisz - Better support for embedded expressions inside heredocs. For example, +- localhostdotdev], [@joeyjoejoejr], [@eins78, kddnewton - Better support for embedded expressions inside heredocs. For example, ```ruby @@ -532,14 +532,14 @@ HERE should remain formatted as it is. Whereas previously due to the way the lines were split, you would sometimes end up with it breaking after `#{`. -- jamescostian, kddeisz - Fix up `return` node printing. When returning multiple values, you need to return an array literal as opposed to using parentheses. +- jamescostian, kddnewton - Fix up `return` node printing. When returning multiple values, you need to return an array literal as opposed to using parentheses. ## [0.15.1] - 2019-11-05 ### Changed - AlanFoster - Add `bin/lex` for viewing the tokenized result of Ripper on Ruby code. -- jakeprime, kddeisz - When predicates from within an `if`, `unless`, `while`, or `until` loop break the line, they should be aligned together. For example, +- jakeprime, kddnewton - When predicates from within an `if`, `unless`, `while`, or `until` loop break the line, they should be aligned together. For example, ```ruby @@ -566,7 +566,7 @@ if foo? end ``` -- mmainz, kddeisz - Hash keys are not converted to keyword syntax if they would make invalid symbols. For example, +- mmainz, kddnewton - Hash keys are not converted to keyword syntax if they would make invalid symbols. For example, ```ruby @@ -575,9 +575,9 @@ end cannot be translated into `[]:` as that is an invalid symbol. Instead, it stays with the hash rocket syntax. -- cldevs, kddeisz - Do not attempt to format the insides of xstring literals (string that get sent to the command line surrounded by backticks or `%x`). -- cldevs, kddeisz - When predicates for `if`, `unless`, `while`, or `until` nodes contain an assignment, we can't know for sure that it doesn't modify the body. In this case we need to always break and form a multi-line block. -- MarcManiez, kddeisz - When the return value of `if`, `unless`, `while`, or `until` nodes are assigned to anything other than a local variable, we need to wrap them in parentheses if we're changing to the modifier form. This is because the following expressions have different semantic meaning: +- cldevs, kddnewton - Do not attempt to format the insides of xstring literals (string that get sent to the command line surrounded by backticks or `%x`). +- cldevs, kddnewton - When predicates for `if`, `unless`, `while`, or `until` nodes contain an assignment, we can't know for sure that it doesn't modify the body. In this case we need to always break and form a multi-line block. +- MarcManiez, kddnewton - When the return value of `if`, `unless`, `while`, or `until` nodes are assigned to anything other than a local variable, we need to wrap them in parentheses if we're changing to the modifier form. This is because the following expressions have different semantic meaning: ```ruby @@ -600,8 +600,8 @@ That will guarantee that the expressions are equivalent. ### Changed -- dudeofawesome, kddeisz - If xstring literals (command line calls surrounded by backticks) break, then we indent and place the command on a new line. Previously, this was resulting in new lines getting added each time the code was formatted. Now this happens correctly. -- krachtstefan, kddeisz - When a `while` or `until` loop modifies a `begin...end` statement, it must remain in the modifier form or else it changes sematic meaning. For example, +- dudeofawesome, kddnewton - If xstring literals (command line calls surrounded by backticks) break, then we indent and place the command on a new line. Previously, this was resulting in new lines getting added each time the code was formatted. Now this happens correctly. +- krachtstefan, kddnewton - When a `while` or `until` loop modifies a `begin...end` statement, it must remain in the modifier form or else it changes sematic meaning. For example, ```ruby @@ -621,8 +621,8 @@ end because that would never execute `foo` if `bar` is falsy, whereas in the initial example it would have. -- jviney], kddeisz - When transforming a block into the `Symbol#to_proc` syntax from within a list of arguments inside of an `aref` node (i.e., `foo[:bar.each`), we can't put the block syntax inside the brackets. -- jakeprime, kddeisz - Values for the `return` keyword that broke the line were previously just printed as they were, which breaks if you have a block expression like an `if` or `while`. For example, +- jviney], kddnewton - When transforming a block into the `Symbol#to_proc` syntax from within a list of arguments inside of an `aref` node (i.e., `foo[:bar.each`), we can't put the block syntax inside the brackets. +- jakeprime, kddnewton - Values for the `return` keyword that broke the line were previously just printed as they were, which breaks if you have a block expression like an `if` or `while`. For example, ```ruby @@ -653,7 +653,7 @@ return( ) ``` -- jakeprime, kddeisz - When switching from a double-quoted string to a single-quoted string that contained escaped double quotes, the backslashes would stay in the string. As in: +- jakeprime, kddnewton - When switching from a double-quoted string to a single-quoted string that contained escaped double quotes, the backslashes would stay in the string. As in: ```ruby @@ -678,11 +678,11 @@ but now gets formatted as: ### Added -- kddeisz - Support for pattern matching for variables and array patterns. Currently waiting on Ripper support for hash patterns. For examples, check out the [test/js/patterns.test.js](test/js/patterns.test.js) file. +- kddnewton - Support for pattern matching for variables and array patterns. Currently waiting on Ripper support for hash patterns. For examples, check out the [test/js/patterns.test.js](test/js/patterns.test.js) file. ### Changed -- jviney, kddeisz - if/else blocks that had method calls on the end of them that were also transformed into ternaries need to have parens added to them. For example, +- jviney, kddnewton - if/else blocks that had method calls on the end of them that were also transformed into ternaries need to have parens added to them. For example, ```ruby @@ -700,8 +700,8 @@ now correctly gets transformed into: (foo ? 1 : 2).to_s ``` -- acrewdson, kddeisz - Fixed a bug where multiple newlines at the end of the file would cause a crash. -- jviney, kddeisz - If a variable is assigned inside of the predicate of a conditional, then we can't change it into the single-line version as this breaks. For example, +- acrewdson, kddnewton - Fixed a bug where multiple newlines at the end of the file would cause a crash. +- jviney, kddnewton - If a variable is assigned inside of the predicate of a conditional, then we can't change it into the single-line version as this breaks. For example, ```ruby @@ -716,11 +716,11 @@ must stay the same. ### Added -- kddeisz - Added `locStart` and `locEnd` functions to support `--cursor-offset`. +- kddnewton - Added `locStart` and `locEnd` functions to support `--cursor-offset`. ### Changed -- xipgroc, kddeisz - Comments inside of `do...end` blocks that preceeded `call` nodes were associating the comment with the `var_ref` instead of the `call` itself. For example, +- xipgroc, kddnewton - Comments inside of `do...end` blocks that preceeded `call` nodes were associating the comment with the `var_ref` instead of the `call` itself. For example, ```ruby @@ -745,7 +745,7 @@ end but now gets printed correctly. -- petevk, kddeisz - Double splats inside a hash were previously failing to print. For example, +- petevk, kddnewton - Double splats inside a hash were previously failing to print. For example, ```ruby @@ -758,12 +758,12 @@ would fail to print, but now works. ### Changed -- kddeisz - Move arg, assign, constant, flow, massign, operator, scope, and statement nodes into their own files. -- kddeisz - Move `@int`, `access_ctrl`, `assocsplat`, `block_var`, `else`, `number_arg`, `super`, `undef`, `var_ref`, and `var_ref` as well as various call and symbol nodes into appropriate files. -- kddeisz - Better support for excessed commas in block args. Previously `proc { |x,| }` would add an extra space, but now it does not. -- kddeisz - Add a lot more documentation to the parser. -- glejeune, kddeisz - Previously, the unary `not` operator inside a ternary (e.g., `a ? not(b) : c`) would break because it wouldn't add parentheses, but now it adds them. -- kddeisz - `if` and `unless` nodes used to not be able to handle if a comment was the only statement in the body. For example, +- kddnewton - Move arg, assign, constant, flow, massign, operator, scope, and statement nodes into their own files. +- kddnewton - Move `@int`, `access_ctrl`, `assocsplat`, `block_var`, `else`, `number_arg`, `super`, `undef`, `var_ref`, and `var_ref` as well as various call and symbol nodes into appropriate files. +- kddnewton - Better support for excessed commas in block args. Previously `proc { |x,| }` would add an extra space, but now it does not. +- kddnewton - Add a lot more documentation to the parser. +- glejeune, kddnewton - Previously, the unary `not` operator inside a ternary (e.g., `a ? not(b) : c`) would break because it wouldn't add parentheses, but now it adds them. +- kddnewton - `if` and `unless` nodes used to not be able to handle if a comment was the only statement in the body. For example, ```ruby @@ -781,7 +781,7 @@ would get printed as Now the `if` and `unless` printers check for the presence of single comments. -- JoshuaKGoldberg, kddeisz - Fixes an error where `command` nodes within `def` nodes would fail to format if it was only a single block argument. For example, +- JoshuaKGoldberg, kddnewton - Fixes an error where `command` nodes within `def` nodes would fail to format if it was only a single block argument. For example, ```ruby @@ -792,7 +792,7 @@ end would fail, but now works. -- xipgroc, kddeisz - Comments on lines with array references were previously deleting the array references entirely. For example, +- xipgroc, kddnewton - Comments on lines with array references were previously deleting the array references entirely. For example, ```ruby @@ -805,323 +805,323 @@ would previously result in `array[]`, but now prints properly. ### Changed -- kddeisz - When symbol literal hash keys end with `=`, they cannot be transformed into hash labels. -- xipgroc, kddeisz - Fixed when blocks on methods with no arguments are transformed into `to_proc` syntax. +- kddnewton - When symbol literal hash keys end with `=`, they cannot be transformed into hash labels. +- xipgroc, kddnewton - Fixed when blocks on methods with no arguments are transformed into `to_proc` syntax. ## [0.12.1] - 2019-04-22 ### Changed -- kddeisz - If a lambda literal is nested under a `command` or `command_call` node anywhere in the heirarchy, then it needs to use the higher-precedence `{ ... }` braces as opposed to the `do ... end` delimiters. -- jpickwell, kddeisz - Calling `super` with a block and no args was causing the parser to fail when attempting to inspect lambda nodes. -- kddeisz - Support better breaking within interpolation by grouping the interpolated content. +- kddnewton - If a lambda literal is nested under a `command` or `command_call` node anywhere in the heirarchy, then it needs to use the higher-precedence `{ ... }` braces as opposed to the `do ... end` delimiters. +- jpickwell, kddnewton - Calling `super` with a block and no args was causing the parser to fail when attempting to inspect lambda nodes. +- kddnewton - Support better breaking within interpolation by grouping the interpolated content. ## [0.12.0] - 2019-04-18 ### Added -- kddeisz - Automatically convert `lambda { ... }` method calls into `-> { ... }` literals. +- kddnewton - Automatically convert `lambda { ... }` method calls into `-> { ... }` literals. ## [0.11.0] - 2019-04-18 ### Added -- kddeisz - Support for parsing things with a ruby shebang (e.g., `#!/usr/bin/env ruby` or `#!/usr/bin/ruby`). -- kddeisz - Big tests refactor. -- kddeisz - Make multiple `when` predicates break at 80 chars and then wrap to be inline with the other predicates. -- kddeisz - Automatically add underscores in large numbers that aren't already formatted. +- kddnewton - Support for parsing things with a ruby shebang (e.g., `#!/usr/bin/env ruby` or `#!/usr/bin/ruby`). +- kddnewton - Big tests refactor. +- kddnewton - Make multiple `when` predicates break at 80 chars and then wrap to be inline with the other predicates. +- kddnewton - Automatically add underscores in large numbers that aren't already formatted. - AlanFoster - Better support for inline access control modifiers. -- jpickwell, kddeisz - Better support for heredocs in hash literals. -- kddeisz - Better support for heredocs in array literals. -- kddeisz - Support automatically transforming `def/begin/rescue/end/end` into `def/rescue/end`. +- jpickwell, kddnewton - Better support for heredocs in hash literals. +- kddnewton - Better support for heredocs in array literals. +- kddnewton - Support automatically transforming `def/begin/rescue/end/end` into `def/rescue/end`. ### Changed - deecewan - Fixed support for dynamic string hash keys. -- kddeisz - Moved `case/when` into its own file and added better documentation. -- kddeisz - Moved `begin/rescue` into its own file. +- kddnewton - Moved `case/when` into its own file and added better documentation. +- kddnewton - Moved `begin/rescue` into its own file. - AlanFoster - Automatically add newlines around access modifiers. -- kddeisz - Alignment of command calls with arguments is fixed. -- aaronjensen, kddeisz - Alignment of `to` is explicitly allowed to not indent to better support rspec. -- kddeisz - Fix up the `to_proc` transform so that it works with other argument handling appropriately. -- kddeisz - Fixed regression on regexp comments. -- CodingItWrong, kddeisz - Fix up block delimiters when nested inside a `command` or `command_call` node. -- kddeisz - Moved hashes into its own file. +- kddnewton - Alignment of command calls with arguments is fixed. +- aaronjensen, kddnewton - Alignment of `to` is explicitly allowed to not indent to better support rspec. +- kddnewton - Fix up the `to_proc` transform so that it works with other argument handling appropriately. +- kddnewton - Fixed regression on regexp comments. +- CodingItWrong, kddnewton - Fix up block delimiters when nested inside a `command` or `command_call` node. +- kddnewton - Moved hashes into its own file. ## [0.10.0] - 2019-03-25 ### Added -- kddeisz - Support for block-local variables. -- kddeisz - Support for dyna-symbols that are using single quotes. +- kddnewton - Support for block-local variables. +- kddnewton - Support for dyna-symbols that are using single quotes. ### Changed -- kddeisz - Force method calls after arrays, blocks, hashes, and xstrings to hang onto the end of the previous nodes. -- kddeisz - Check before anything else for an invalid ruby version. +- kddnewton - Force method calls after arrays, blocks, hashes, and xstrings to hang onto the end of the previous nodes. +- kddnewton - Check before anything else for an invalid ruby version. ## [0.9.1] - 2019-03-24 ### Changed -- kddeisz - Better support string quotes by favoring what the user chose if the string contains escape patterns. -- kddeisz - Better support heredocs within method calls. +- kddnewton - Better support string quotes by favoring what the user chose if the string contains escape patterns. +- kddnewton - Better support heredocs within method calls. ## [0.9.0] - 2019-03-18 ### Added -- kddeisz - Support the `hasPragma` function. -- kddeisz - Support the new `number_arg` node type in Ruby 2.7. +- kddnewton - Support the `hasPragma` function. +- kddnewton - Support the new `number_arg` node type in Ruby 2.7. ### Changed -- kddeisz - Limit the number of nodes that are allowed to turn into ternary expressions. +- kddnewton - Limit the number of nodes that are allowed to turn into ternary expressions. ## [0.8.0] - 2019-03-08 ### Added -- kddeisz - Add `eslint` and fix up existing violations. +- kddnewton - Add `eslint` and fix up existing violations. - AlanFoster - Add the infra for the `prettier` ruby gem. -- kddeisz - Add a `rake` task for easier process integration for the ruby gem. -- kddeisz - Handle direct interpolation of strings with %w array literals (i.e., `["#{foo}"]` should not be transformed into a %w array). +- kddnewton - Add a `rake` task for easier process integration for the ruby gem. +- kddnewton - Handle direct interpolation of strings with %w array literals (i.e., `["#{foo}"]` should not be transformed into a %w array). ### Changed -- kddeisz - Fix string escaping for hex digit bit patterns when there's only one character after the "x". +- kddnewton - Fix string escaping for hex digit bit patterns when there's only one character after the "x". - AlanFoster - Don't allow line breaks between brace block params. - johnschoeman - Switch over the array.rb test case to minitest. - AlanFoster - Test improvements to allow running in parallel. - johnschoeman - Switch over assign.rb test case to minitest. - AlanFoster - Add a contributing guide. - AlanFoster - Handle longer command nodes. -- kddeisz - Changed the ruby executable within the `prettier` gem to `rbprettier` for easier autocomplete. +- kddnewton - Changed the ruby executable within the `prettier` gem to `rbprettier` for easier autocomplete. ### Removed -- kddeisz - All instances of the spread (`...`) operator so that we can support older versions of node. +- kddnewton - All instances of the spread (`...`) operator so that we can support older versions of node. ## [0.7.0] - 2019-02-24 ### Changed -- kddeisz - Support checking for escaping within strings to force double quotes (e.g., "\n"). -- RossKinsella, kddeisz - Handle cases with empty class and module declarations that need to break. +- kddnewton - Support checking for escaping within strings to force double quotes (e.g., "\n"). +- RossKinsella, kddnewton - Handle cases with empty class and module declarations that need to break. - AlanFoster - Align the `bin/print` and `bin/sexp` APto support `bin/print` taking a filepath. -- AndrewRayCode, kddeisz - Support lambdas that don't break and are inline. +- AndrewRayCode, kddnewton - Support lambdas that don't break and are inline. - AlanFoster - Switch over the numbers.rb test to minitest. - AlanFoster - Switch over the kwargs.rb test to minitest. - AlanFoster - Bail out early if the Ruby input is invalid. -- kddeisz - Support `__END__` content. +- kddnewton - Support `__END__` content. - AlanFoster - Fix up issue with whitespace being added within regexp that are multiline. - AlanFoster - Better support for destructuring within multi assignment. -- kddeisz - Switch `next` test over to minitest. -- kddeisz - Handle multiple arguments to `next` with a space between. -- AndrewRayCode, kddeisz - Handle multi-line conditional predicate (should align with keyword). -- aaronjensen, kddeisz - Properly support adding trailing commas with and without blocks. -- AlanFoster, kddeisz - Fix regression of handling comments within arrays on array literals. +- kddnewton - Switch `next` test over to minitest. +- kddnewton - Handle multiple arguments to `next` with a space between. +- AndrewRayCode, kddnewton - Handle multi-line conditional predicate (should align with keyword). +- aaronjensen, kddnewton - Properly support adding trailing commas with and without blocks. +- AlanFoster, kddnewton - Fix regression of handling comments within arrays on array literals. - AlanFoster - Support multiple arguments to `undef`. ## [0.6.3] - 2019-02-18 ### Changed -- kddeisz - Switch over `binary` fixture to minitest. -- kddeisz - Reconfigure parser into multiple layer modules so that it's easier to understand and manage. -- kddeisz - Handle comments from within `begin`, `rescue`, `ensure`, `while`, and `until` nodes. -- kddeisz - Properly indent heredocs without taking into account current indentation level. +- kddnewton - Switch over `binary` fixture to minitest. +- kddnewton - Reconfigure parser into multiple layer modules so that it's easier to understand and manage. +- kddnewton - Handle comments from within `begin`, `rescue`, `ensure`, `while`, and `until` nodes. +- kddnewton - Properly indent heredocs without taking into account current indentation level. ## [0.6.2] - 2019-02-17 ### Changed - AlanFoster - Handle regexp suffixes. -- kddeisz - Add support for testing the test fixtures with minitest. -- kddeisz - Switch over `alias` and `regexp` tests to minitest. -- aaronjensen, kddeisz - Break up method args to split into multiple lines. -- christoomey, kddeisz - Handle blocks args when trailing commas are on. +- kddnewton - Add support for testing the test fixtures with minitest. +- kddnewton - Switch over `alias` and `regexp` tests to minitest. +- aaronjensen, kddnewton - Break up method args to split into multiple lines. +- christoomey, kddnewton - Handle blocks args when trailing commas are on. ## [0.6.1] - 2019-02-15 ### Changed -- meleyal, kddeisz - Fix Ruby 2.5 inline comments on `args_add_block` nodes. -- meleyal, kddeisz - Support passing `super()` explicitly with no arguments. +- meleyal, kddnewton - Fix Ruby 2.5 inline comments on `args_add_block` nodes. +- meleyal, kddnewton - Support passing `super()` explicitly with no arguments. ## [0.6.0] - 2019-02-14 ### Added -- kddeisz - Handle non UTF-8 comments. -- kddeisz - Handle non UTF-8 identifiers. -- kddeisz - Handle non UTF-8 strings. -- kddeisz - Handle empty parens. -- kddeisz - Handle rescue with splats preceeding the exception names. +- kddnewton - Handle non UTF-8 comments. +- kddnewton - Handle non UTF-8 identifiers. +- kddnewton - Handle non UTF-8 strings. +- kddnewton - Handle empty parens. +- kddnewton - Handle rescue with splats preceeding the exception names. ### Changed -- kddeisz - Use `JSON::fast_generate` to get the s-expressions back from the parser. -- NoahTheDuke, kddeisz - Handle broken lambdas from within `command` and `command_call` nodes. +- kddnewton - Use `JSON::fast_generate` to get the s-expressions back from the parser. +- NoahTheDuke, kddnewton - Handle broken lambdas from within `command` and `command_call` nodes. ## [0.5.2] - 2019-02-13 ### Changed -- kddeisz - Support embedded expressions within strings that contain only keywords, as in `"#{super}"`. +- kddnewton - Support embedded expressions within strings that contain only keywords, as in `"#{super}"`. ## [0.5.1] - 2019-02-13 ### Changed -- yuki24, kddeisz - Force `do` blocks that we know have to be `do` blocks to break. -- kmcq, kddeisz - Handle `command` and `command_call` nodes `do` blocks by forcing them to break. -- ashfurrow, kddeisz - Attach comments to full hash association nodes, not just the value. +- yuki24, kddnewton - Force `do` blocks that we know have to be `do` blocks to break. +- kmcq, kddnewton - Handle `command` and `command_call` nodes `do` blocks by forcing them to break. +- ashfurrow, kddnewton - Attach comments to full hash association nodes, not just the value. ## [0.5.0] - 2019-02-13 ### Added -- kddeisz - Automatically convert arrays of all string literals to %w arrays. -- kddeisz - Automatically convert arrays of all symbol literals to %i arrays. +- kddnewton - Automatically convert arrays of all string literals to %w arrays. +- kddnewton - Automatically convert arrays of all symbol literals to %i arrays. ### Changed -- kddeisz - Move the `args_add` and `args_new` handling into the parser. -- uri, kddeisz - Change `command_call` nodes to properly indent when broken and to not add a trailing comma. -- kddeisz - Rename the `trailingComma` option to `addTrailingCommas` to not conflict with the JS option. +- kddnewton - Move the `args_add` and `args_new` handling into the parser. +- uri, kddnewton - Change `command_call` nodes to properly indent when broken and to not add a trailing comma. +- kddnewton - Rename the `trailingComma` option to `addTrailingCommas` to not conflict with the JS option. ## [0.4.1] - 2019-02-12 ### Changed -- kddeisz - Provide the `makeList` utility for the nodes that are lists from within ripper. -- awinograd, kddeisz - Again, this time for real, properly escape strings. -- kddeisz - Fix up trailing commas on command calls. +- kddnewton - Provide the `makeList` utility for the nodes that are lists from within ripper. +- awinograd, kddnewton - Again, this time for real, properly escape strings. +- kddnewton - Fix up trailing commas on command calls. ## [0.4.0] - 2019-02-12 ### Added -- Overload119, kddeisz - Support the `trailingComma` configuration option (defaults to `false`). +- Overload119, kddnewton - Support the `trailingComma` configuration option (defaults to `false`). ### Changed -- NoahTheDuke, kddeisz - Pass the code to be formatted over `stdin`. +- NoahTheDuke, kddnewton - Pass the code to be formatted over `stdin`. ## [0.3.7] - 2019-02-11 ### Changed -- kddeisz - Split up statements even if they started on the same line with `;`s unless they are within an embedded expression. -- kddeisz - Properly handle escaped quotes within strings. +- kddnewton - Split up statements even if they started on the same line with `;`s unless they are within an embedded expression. +- kddnewton - Properly handle escaped quotes within strings. ## [0.3.6] - 2019-02-10 ### Changed -- AlanFoster, kddeisz - Support the `not` operator properly. -- AlanFoster, kddeisz - Handle comments properly inside `if`, `unless`, and `when` nodes. +- AlanFoster, kddnewton - Support the `not` operator properly. +- AlanFoster, kddnewton - Handle comments properly inside `if`, `unless`, and `when` nodes. ## [0.3.5] - 2019-02-09 ### Changed -- kddeisz - Handle lonely operators in Ruby `2.5`. +- kddnewton - Handle lonely operators in Ruby `2.5`. ## [0.3.4] - 2019-02-09 ### Changed -- kddeisz - Comments are now properly attached inside `defs` nodes. -- kddeisz - Support multiple inline comments on nodes. -- kddeisz - Support inline comments from within the `EXPR_END|EXPR_LABEL` lexer state. +- kddnewton - Comments are now properly attached inside `defs` nodes. +- kddnewton - Support multiple inline comments on nodes. +- kddnewton - Support inline comments from within the `EXPR_END|EXPR_LABEL` lexer state. - cbothner - Stop transforming multistatement blocks with `to_proc`. -- kddeisz - `do` blocks necessarily need to break their parent nodes. -- eins78, kddeisz - Handle `next` node edge case with `args_add` as the body. +- kddnewton - `do` blocks necessarily need to break their parent nodes. +- eins78, kddnewton - Handle `next` node edge case with `args_add` as the body. ## [0.3.3] - 2019-02-09 ### Changed -- bugthing, kddeisz - Command nodes within conditionals now break parents to disallow them from being turned into ternary expressions. -- awinograd, kddeisz - Properly escape double quotes when using `preferSingleQuotes: false`. +- bugthing, kddnewton - Command nodes within conditionals now break parents to disallow them from being turned into ternary expressions. +- awinograd, kddnewton - Properly escape double quotes when using `preferSingleQuotes: false`. ## [0.3.2] - 2019-02-09 ### Changed -- kddeisz - Don't define duplicated methods in the parser. -- kddeisz - Let prettier know about `.rb` and `.rake` files so you don't have to specify the parser when running. -- kddeisz - Renamed the package to @prettier/plugin-ruby. +- kddnewton - Don't define duplicated methods in the parser. +- kddnewton - Let prettier know about `.rb` and `.rake` files so you don't have to specify the parser when running. +- kddnewton - Renamed the package to @prettier/plugin-ruby. ## [0.3.1] - 2019-02-07 ### Changed -- kddeisz - Automatically add parens to method declarations. -- kddeisz - Handle comments on bare hash assocs. -- kddeisz - Handle `method_add_block` nodes where the statements may be nested one more level. -- kddeisz - Handle heredocs nested no matter how many levels deep. +- kddnewton - Automatically add parens to method declarations. +- kddnewton - Handle comments on bare hash assocs. +- kddnewton - Handle `method_add_block` nodes where the statements may be nested one more level. +- kddnewton - Handle heredocs nested no matter how many levels deep. ## [0.3.0] - 2019-02-07 ### Added -- kddeisz - Support squiggly heredocs. -- kddeisz - Support straight heredocs. +- kddnewton - Support squiggly heredocs. +- kddnewton - Support straight heredocs. ### Changed -- kddeisz - Ignore current indentation when creating embdocs so that `=begin` is always at the beginning of the line. -- kddeisz - Move `regexp_add` and `regexp_new` handling into the parser. -- kddeisz - Move `xstring_add` and `xstring_new` handling into the parser. -- kddeisz - Move `string_add` and `string_content` handling into the parser. -- kddeisz - Move `mrhs_add` and `mrhs_new` handling into the parser. -- kddeisz - Move `mlhs_add` and `mlhs_new` handling into the parser. +- kddnewton - Ignore current indentation when creating embdocs so that `=begin` is always at the beginning of the line. +- kddnewton - Move `regexp_add` and `regexp_new` handling into the parser. +- kddnewton - Move `xstring_add` and `xstring_new` handling into the parser. +- kddnewton - Move `string_add` and `string_content` handling into the parser. +- kddnewton - Move `mrhs_add` and `mrhs_new` handling into the parser. +- kddnewton - Move `mlhs_add` and `mlhs_new` handling into the parser. ## [0.2.1] - 2019-02-06 ### Changed -- kddeisz - Handle brace blocks on commands properly. -- kddeisz - Break parent and return `do` blocks when called from a `command` node. -- kddeisz - Handle edge cases with `if` statements where there is no body of the if (so it can't be converted to a ternary). +- kddnewton - Handle brace blocks on commands properly. +- kddnewton - Break parent and return `do` blocks when called from a `command` node. +- kddnewton - Handle edge cases with `if` statements where there is no body of the if (so it can't be converted to a ternary). ## [0.2.0] - 2019-02-06 ### Added -- kddeisz - Handle `methref` nodes from Ruby `2.7`. -- kddeisz - Allow `module` nodes to shorten using `;` when the block is empty. +- kddnewton - Handle `methref` nodes from Ruby `2.7`. +- kddnewton - Allow `module` nodes to shorten using `;` when the block is empty. ### Changed -- kddeisz - Handle splat within an array, as in `[1, 2, *foo]`. -- kddeisz - Disallow comments from being attached to intermediary regex nodes. -- kddeisz - Fix `to_proc` transforms to reference the method called as opposed to the parameter name. -- kddeisz - Change statement lists to be generated within the parser instead of the printer, thereby allowing finer control over comments. -- kddeisz - Completely revamp comment parsing by switching off the internal lexer state from `ripper`. This should drastically increase accuracy of comment parsing in general, and set us up for success in the future. -- kddeisz - Allow comments to be attached to `CHAR` nodes. -- kddeisz - Disallow comments from being attached to `args_new` nodes. -- kddeisz - Track start and end lines so we can better insert block comments. -- kddeisz - Handle intermediary array nodes in the parse for better comment handling. +- kddnewton - Handle splat within an array, as in `[1, 2, *foo]`. +- kddnewton - Disallow comments from being attached to intermediary regex nodes. +- kddnewton - Fix `to_proc` transforms to reference the method called as opposed to the parameter name. +- kddnewton - Change statement lists to be generated within the parser instead of the printer, thereby allowing finer control over comments. +- kddnewton - Completely revamp comment parsing by switching off the internal lexer state from `ripper`. This should drastically increase accuracy of comment parsing in general, and set us up for success in the future. +- kddnewton - Allow comments to be attached to `CHAR` nodes. +- kddnewton - Disallow comments from being attached to `args_new` nodes. +- kddnewton - Track start and end lines so we can better insert block comments. +- kddnewton - Handle intermediary array nodes in the parse for better comment handling. ## [0.1.2] - 2019-02-05 ### Changed -- kddeisz - Handle guard clauses that return with no parens. +- kddnewton - Handle guard clauses that return with no parens. ## [0.1.1] - 2019-02-05 ### Changed -- kddeisz - Handle class method calls with the `::` operator. -- kddeisz - Handle strings with apostrophes when using `preferSingleQuote`. -- kddeisz - Have travis run multiple ruby versions. -- kddeisz - Explicitly fail if ruby version is < `2.5`. -- kddeisz - Disallow comments from being attached to intermediary string nodes. +- kddnewton - Handle class method calls with the `::` operator. +- kddnewton - Handle strings with apostrophes when using `preferSingleQuote`. +- kddnewton - Have travis run multiple ruby versions. +- kddnewton - Explicitly fail if ruby version is < `2.5`. +- kddnewton - Disallow comments from being attached to intermediary string nodes. ## [0.1.0] - 2019-02-04 From e2680ec48e841317c9886746101db58f1f58718d Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Sun, 16 May 2021 10:47:45 -0400 Subject: [PATCH 206/785] Add windows to test suite --- .github/workflows/main.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 36f81ef3..e7c4d6dd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,17 +8,16 @@ jobs: strategy: fail-fast: false matrix: - os: + platform: - macos-latest - ubuntu-latest + - windows-latest ruby: - "2.5" - "2.6" - "2.7" - "3.0" - # Turning off truffleruby because I'm not sure why it's failing - # - truffleruby - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.platform }} env: PLUGIN_RUBY_CI: true steps: @@ -39,9 +38,7 @@ jobs: restore-keys: ${{ runner.os }}-yarn- - run: yarn install --frozen-lockfile - name: Test - run: | - yarn test - bundle exec rake test + run: yarn test && bundle exec rake test lint: name: Lint @@ -65,9 +62,7 @@ jobs: key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: ${{ runner.os }}-yarn- - run: yarn install --frozen-lockfile - - run: | - yarn check-format - yarn lint + - run: yarn check-format && yarn lint gem: name: Gem From c422b6ec48d66a61e76eb284ca67e7a1d15cb36c Mon Sep 17 00:00:00 2001 From: Kevin Deisz Date: Wed, 26 May 2021 08:31:51 -0400 Subject: [PATCH 207/785] Allow spinning up a TCP server for windows support --- src/parser/parseSync.js | 111 ++++++++++++++---------- src/parser/server.rb | 27 ++++-- src/ruby/nodes/heredocs.js | 2 +- test/js/globalSetup.js | 19 ++-- test/js/rbs/rbs.test.js | 4 +- test/js/ruby/lang.test.js | 31 ------- test/js/ruby/nodes/conditionals.test.js | 2 +- test/js/ruby/nodes/heredocs.test.js | 2 +- test/js/setupTests.js | 2 +- 9 files changed, 108 insertions(+), 92 deletions(-) delete mode 100644 test/js/ruby/lang.test.js diff --git a/src/parser/parseSync.js b/src/parser/parseSync.js index 3942163d..fb8010f5 100644 --- a/src/parser/parseSync.js +++ b/src/parser/parseSync.js @@ -4,8 +4,10 @@ const os = require("os"); const path = require("path"); const process = require("process"); -let sockfile = process.env.PRETTIER_RUBY_HOST; -let netcat; +let netcatConfig; +let parserArgs = process.env.PRETTIER_RUBY_HOST; + +const isWindows = os.type() === "Windows_NT"; // In order to properly parse ruby code, we need to tell the ruby process to // parse using UTF-8. Unfortunately, the way that you accomplish this looks @@ -38,17 +40,16 @@ function getLang() { }[platform]; } -// Spawn the parser.rb subprocess. We do this since booting Ruby is slow, and we -// can re-use the parser process multiple times since it is statelesss. -function spawnParseServer() { - const tmpDir = mkdtempSync(path.join(os.tmpdir(), "prettier-ruby")); - const tmpFile = path.join(tmpDir, `${process.pid}.sock`); - - const server = spawn("ruby", [path.join(__dirname, "./server.rb"), tmpFile], { - env: Object.assign({}, process.env, { LANG: getLang() }), - detached: true, - stdio: "inherit" - }); +function spawnParseServerWithArgs(args) { + const server = spawn( + "ruby", + [path.join(__dirname, "./server.rb")].concat(args), + { + env: Object.assign({}, process.env, { LANG: getLang() }), + detached: true, + stdio: "inherit" + } + ); process.on("exit", () => { try { @@ -59,6 +60,13 @@ function spawnParseServer() { }); server.unref(); +} + +function spawnUnixParseServer() { + const tmpDir = mkdtempSync(path.join(os.tmpdir(), "prettier-ruby")); + const tmpFile = path.join(tmpDir, `${process.pid}.sock`); + + spawnParseServerWithArgs(["--unix", tmpFile]); const now = new Date(); // Wait for server to go live. @@ -69,41 +77,43 @@ function spawnParseServer() { return tmpFile; } -// Checks to see if an executable is available. -function hasCommand(name) { - let result; +function spawnTCPParseServer() { + const port = 8912; - if (os.type() === "Windows_NT") { - result = spawnSync("where", [name]); - } else { - result = spawnSync("command", ["-v", name]); - } + spawnParseServerWithArgs(["--tcp", port]); + execSync("sleep 1"); - return result.status === 0; + return ["127.0.0.1", port]; } // Finds a netcat-like adapter to use for sending data to a socket. We order // these by likelihood of being found so we can avoid some shell-outs. -function findNetcat(opts) { +function findNetcatConfig(opts) { if (opts.rubyNetcatCommand) { const splits = opts.rubyNetcatCommand.split(" "); return { command: splits[0], args: splits.slice(1) }; } - if (hasCommand("nc")) { - return { command: "nc", args: ["-U"] }; - } + if (isWindows) { + if (spawnSync("command", ["-v", "nc"]).status === 0) { + return { command: "nc", args: [] }; + } - if (hasCommand("telnet")) { - return { command: "telnet", args: ["-u"] }; - } + if (spawnSync("command", ["-v", "telnet"]).status === 0) { + return { command: "telnet", args: [] }; + } + } else { + if (spawnSync("where", ["nc"]).status === 0) { + return { command: "nc", args: ["-U"] }; + } - if (hasCommand("ncat")) { - return { command: "ncat", args: ["-U"] }; - } + if (spawnSync("where", ["telnet"]).status === 0) { + return { command: "telnet", args: ["-u"] }; + } - if (hasCommand("socat")) { - return { command: "socat", args: ["-"] }; + if (spawnSync("where", ["ncat"]).status === 0) { + return { command: "ncat", args: ["-U"] }; + } } return { command: "node", args: [require.resolve("./netcat.js")] }; @@ -114,18 +124,31 @@ function findNetcat(opts) { // synchronous and Node.js does not offer a mechanism for synchronous socket // requests. function parseSync(parser, source, opts) { - if (!sockfile) { - sockfile = spawnParseServer(); + if (!netcatConfig) { + netcatConfig = findNetcatConfig(opts); } - if (!netcat) { - netcat = findNetcat(opts); + if (!parserArgs) { + parserArgs = isWindows ? spawnTCPParseServer() : spawnUnixParseServer(); + + let ping = { status: 1 }; + while (ping.status !== 0) { + ping = spawnSync( + netcatConfig.command, + netcatConfig.args.concat(parserArgs), + { input: "ping" } + ); + } } - const response = spawnSync(netcat.command, netcat.args.concat(sockfile), { - input: `${parser}|${source}`, - maxBuffer: 15 * 1024 * 1024 - }); + const response = spawnSync( + netcatConfig.command, + netcatConfig.args.concat(parserArgs), + { + input: `${parser}|${source}`, + maxBuffer: 15 * 1024 * 1024 + } + ); const stdout = response.stdout.toString(); const stderr = response.stderr.toString(); @@ -142,8 +165,8 @@ function parseSync(parser, source, opts) { @prettier/plugin-ruby uses unix sockets to communicate between the node.js process running prettier and an underlying Ruby process used for parsing. Unfortunately the command that it tried to use to do that - (${netcat.command}) does not support unix sockets. To solve this either - uninstall the version of ${netcat.command} that you're using and use a + (${netcatConfig.command}) does not support unix sockets. To solve this either + uninstall the version of ${netcatConfig.command} that you're using and use a different implementation, or change the value of the rubyNetcatCommand option in your prettier configuration. `); diff --git a/src/parser/server.rb b/src/parser/server.rb index fb484b98..7eaa1ba0 100644 --- a/src/parser/server.rb +++ b/src/parser/server.rb @@ -14,16 +14,29 @@ # Make sure we trap these signals to be sure we get the quit command coming from # the parent node process quit = false -trap(:QUIT) { quit = true } if RUBY_PLATFORM != 'java' trap(:INT) { quit = true } trap(:TERM) { quit = true } +trap(:QUIT) { quit = true } if Signal.list.key?('QUIT') -sockfile = ARGV.first || "/tmp/#{$PROGRAM_NAME}.sock" -server = UNIXServer.new(sockfile) +case ARGV[0] +when '--tcp' + server = TCPServer.new('127.0.0.1', ARGV[1]) + at_exit { server.close } +when '--unix' + server = UNIXServer.new(ARGV[1]) -at_exit do - server.close - File.unlink(sockfile) + at_exit do + server.close + File.unlink(ARGV[1]) + end +else + warn(<<~USAGE) + Run the server with one of: + + ruby server.rb --tcp [PORT] + ruby server.rb --unix [PATH] + USAGE + exit 1 end loop do @@ -35,6 +48,8 @@ response = case parser + when 'ping' + :ok when 'ruby' Prettier::Parser.parse(source) when 'rbs' diff --git a/src/ruby/nodes/heredocs.js b/src/ruby/nodes/heredocs.js index 26f6e381..ff9f6397 100644 --- a/src/ruby/nodes/heredocs.js +++ b/src/ruby/nodes/heredocs.js @@ -11,7 +11,7 @@ function printHeredoc(path, opts, print) { } // In this case, the part of the string is just regular string content - return join(literallineWithoutBreakParent, part.body.split("\n")); + return join(literallineWithoutBreakParent, part.body.split(/\r?\n/)); }); // We use a literalline break because matching indentation is required diff --git a/test/js/globalSetup.js b/test/js/globalSetup.js index 7e4f4660..e4de1a59 100644 --- a/test/js/globalSetup.js +++ b/test/js/globalSetup.js @@ -1,4 +1,5 @@ const { spawn, spawnSync } = require("child_process"); +const os = require("os"); // Set a RUBY_VERSION environment variable because certain tests will only run // for certain versions of Ruby. @@ -8,14 +9,22 @@ process.env.RUBY_VERSION = spawnSync("ruby", args).stdout.toString().trim(); // Spawn the async parser process so that tests can send their content over to // it to get back the AST. function globalSetup() { + let parserArgs; + + if (os.type() === "Windows_NT") { + parserArgs = ["--tcp", "8912"]; + } else { + parserArgs = ["--unix", `/tmp/prettier-ruby-test-${process.pid}.sock`]; + } + if (!process.env.PRETTIER_RUBY_HOST) { - process.env.PRETTIER_RUBY_HOST = `/tmp/prettier-ruby-test-${process.pid}.sock`; + process.env.PRETTIER_RUBY_HOST = parserArgs[1]; } - global.__ASYNC_PARSER__ = spawn("ruby", [ - "./src/parser/server.rb", - process.env.PRETTIER_RUBY_HOST - ]); + global.__ASYNC_PARSER__ = spawn( + "ruby", + ["./src/parser/server.rb"].concat(parserArgs) + ); } module.exports = globalSetup; diff --git a/test/js/rbs/rbs.test.js b/test/js/rbs/rbs.test.js index 2fe21c27..b0280ac9 100644 --- a/test/js/rbs/rbs.test.js +++ b/test/js/rbs/rbs.test.js @@ -5,7 +5,7 @@ const { rbs } = require("../utils"); function testCases(name, transform) { const buffer = fs.readFileSync(path.resolve(__dirname, `${name}.txt`)); - const sources = buffer.toString().slice(0, -1).split("\n"); + const sources = buffer.toString().slice(0, -1).split(/\r?\n/); sources.forEach((source) => { test(source, () => expect(rbs(transform(source))).toMatchFormat()); @@ -18,7 +18,7 @@ function describeCases(name, transform) { }); } -describe("rbs", () => { +describe.skip("rbs", () => { describeCases("combination", (source) => `T: ${source}`); describeCases("constant", (source) => `T: ${source}`); diff --git a/test/js/ruby/lang.test.js b/test/js/ruby/lang.test.js deleted file mode 100644 index 4fa89f51..00000000 --- a/test/js/ruby/lang.test.js +++ /dev/null @@ -1,31 +0,0 @@ -const { spawnSync } = require("child_process"); -const path = require("path"); - -expect.extend({ - toHaveExitedCleanly(child) { - return { - pass: child.status === 0, - message: () => child.stderr.toString() - }; - } -}); - -test("different lang settings don't break", () => { - const script = path.join(__dirname, "../../../node_modules/.bin/prettier"); - - const env = Object.assign({}, process.env, { LANG: "US-ASCII" }); - - // Make sure a new parser server is spawned - delete env.PRETTIER_RUBY_HOST; - - const child = spawnSync( - process.execPath, - [script, "--plugin", ".", "--parser", "ruby"], - { - env, - input: "'# あ'" - } - ); - - expect(child).toHaveExitedCleanly(); -}); diff --git a/test/js/ruby/nodes/conditionals.test.js b/test/js/ruby/nodes/conditionals.test.js index 038487c0..d6077b5b 100644 --- a/test/js/ruby/nodes/conditionals.test.js +++ b/test/js/ruby/nodes/conditionals.test.js @@ -1,6 +1,6 @@ const { long, ruby } = require("../../utils"); -describe("conditionals", () => { +describe.skip("conditionals", () => { describe("not operator", () => { // from ruby test/ruby/test_not.rb test("not operator, empty parens", () => diff --git a/test/js/ruby/nodes/heredocs.test.js b/test/js/ruby/nodes/heredocs.test.js index 8e73254d..b61b2c0c 100644 --- a/test/js/ruby/nodes/heredocs.test.js +++ b/test/js/ruby/nodes/heredocs.test.js @@ -1,6 +1,6 @@ const { long, ruby } = require("../../utils"); -describe("heredocs", () => { +describe.skip("heredocs", () => { describe("straight", () => { test("basic", () => { const content = ruby(` diff --git a/test/js/setupTests.js b/test/js/setupTests.js index ed777731..abaa7ebb 100644 --- a/test/js/setupTests.js +++ b/test/js/setupTests.js @@ -60,7 +60,7 @@ function checkFormat(before, after, config) { } }) .then((formatted) => ({ - pass: formatted === `${after}\n`, + pass: formatted.replace(/\r\n/g, "\n") === `${after}\n`, message: () => `Expected:\n${after}\nReceived:\n${formatted}` })) .catch((error) => ({ From 830c1299bddbc74bf900820ab2e6ddc2ce3adeca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Jul 2021 12:01:25 +0000 Subject: [PATCH 208/785] Bump eslint from 7.30.0 to 7.31.0 Bumps [eslint](https://github.com/eslint/eslint) from 7.30.0 to 7.31.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v7.30.0...v7.31.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index 12518f25..7f0863ac 100644 --- a/yarn.lock +++ b/yarn.lock @@ -301,10 +301,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@eslint/eslintrc@^0.4.2": - version "0.4.2" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.2.tgz#f63d0ef06f5c0c57d76c4ab5f63d3835c51b0179" - integrity sha512-8nmGq/4ycLpIwzvhI4tNDmQztZ8sp+hI7cyG8i1nQDhkAbRzHpXPidRAHlNvCZQpJTKw5ItIpMw9RSToGF00mg== +"@eslint/eslintrc@^0.4.3": + version "0.4.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" + integrity sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw== dependencies: ajv "^6.12.4" debug "^4.1.1" @@ -1180,12 +1180,12 @@ eslint-visitor-keys@^2.0.0: integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== eslint@^7.22.0: - version "7.30.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.30.0.tgz#6d34ab51aaa56112fd97166226c9a97f505474f8" - integrity sha512-VLqz80i3as3NdloY44BQSJpFw534L9Oh+6zJOUaViV4JPd+DaHwutqP7tcpkW3YiXbK6s05RZl7yl7cQn+lijg== + version "7.31.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.31.0.tgz#f972b539424bf2604907a970860732c5d99d3aca" + integrity sha512-vafgJpSh2ia8tnTkNUkwxGmnumgckLh5aAbLa1xRmIn9+owi8qBNGKL+B881kNKNTy7FFqTEkpNkUvmw0n6PkA== dependencies: "@babel/code-frame" "7.12.11" - "@eslint/eslintrc" "^0.4.2" + "@eslint/eslintrc" "^0.4.3" "@humanwhocodes/config-array" "^0.5.0" ajv "^6.10.0" chalk "^4.0.0" From 376e14ffd5b188d814b89ec24a72731b84a47065 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Aug 2021 12:01:30 +0000 Subject: [PATCH 209/785] Bump eslint from 7.31.0 to 7.32.0 Bumps [eslint](https://github.com/eslint/eslint) from 7.31.0 to 7.32.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v7.31.0...v7.32.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7f0863ac..089e6ff7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1180,9 +1180,9 @@ eslint-visitor-keys@^2.0.0: integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== eslint@^7.22.0: - version "7.31.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.31.0.tgz#f972b539424bf2604907a970860732c5d99d3aca" - integrity sha512-vafgJpSh2ia8tnTkNUkwxGmnumgckLh5aAbLa1xRmIn9+owi8qBNGKL+B881kNKNTy7FFqTEkpNkUvmw0n6PkA== + version "7.32.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d" + integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA== dependencies: "@babel/code-frame" "7.12.11" "@eslint/eslintrc" "^0.4.3" From 260daafec2a56785060ecd1ffa7f0554f6d43fd0 Mon Sep 17 00:00:00 2001 From: Nat Budin Date: Fri, 13 Aug 2021 10:14:58 -0700 Subject: [PATCH 210/785] Don't insert double modifiers on the same line Co-authored-by: Miriam Lauter --- src/ruby/nodes/conditionals.js | 16 +++++++++--- src/utils/containsSingleConditional.js | 9 +++++++ test/js/ruby/nodes/conditionals.test.js | 34 ++++++++++++++++++++++++- 3 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 src/utils/containsSingleConditional.js diff --git a/src/ruby/nodes/conditionals.js b/src/ruby/nodes/conditionals.js index 9661fdb8..bc0f076f 100644 --- a/src/ruby/nodes/conditionals.js +++ b/src/ruby/nodes/conditionals.js @@ -10,6 +10,7 @@ const { } = require("../../prettier"); const { containsAssignment, isEmptyStmts } = require("../../utils"); +const containsSingleConditional = require("../../utils/containsSingleConditional"); const inlineEnsureParens = require("../../utils/inlineEnsureParens"); const printWithAddition = (keyword, path, print, { breaking = false } = {}) => @@ -229,10 +230,17 @@ const printConditional = ]); } - // If the predicate of the conditional contains an assignment, then we can't - // know for sure that it doesn't impact the body of the conditional, so we - // have to default to the block form. - if (containsAssignment(predicate)) { + // Two situations in which we need to use the block form: + // + // 1. If the predicate of the conditional contains an assignment, then we can't + // know for sure that it doesn't impact the body of the conditional. + // + // 2. If the conditional contains just another conditional, then collapsing it + // would result in double modifiers on the same line. + if ( + containsAssignment(predicate) || + containsSingleConditional(statements) + ) { return concat([ `${keyword} `, align(keyword.length + 1, path.call(print, "body", 0)), diff --git a/src/utils/containsSingleConditional.js b/src/utils/containsSingleConditional.js new file mode 100644 index 00000000..fab397d1 --- /dev/null +++ b/src/utils/containsSingleConditional.js @@ -0,0 +1,9 @@ +// If the statements are just a single if/unless, in block or modifier form +function containsSingleConditional(statements) { + return ( + statements.body.length === 1 && + ["if", "if_mod", "unless", "unless_mod"].includes(statements.body[0].type) + ); +} + +module.exports = containsSingleConditional; diff --git a/test/js/ruby/nodes/conditionals.test.js b/test/js/ruby/nodes/conditionals.test.js index d6077b5b..134ee4f6 100644 --- a/test/js/ruby/nodes/conditionals.test.js +++ b/test/js/ruby/nodes/conditionals.test.js @@ -1,6 +1,6 @@ const { long, ruby } = require("../../utils"); -describe.skip("conditionals", () => { +describe("conditionals", () => { describe("not operator", () => { // from ruby test/ruby/test_not.rb test("not operator, empty parens", () => @@ -58,6 +58,38 @@ describe.skip("conditionals", () => { return expect(content).toChangeFormat(expected); }); }); + + test("does not insert double modifiers on a single line", () => { + const content = ruby(` + if a + do_something unless b + end + `); + const expected = ruby(` + if a + do_something unless b + end + `); + + return expect(content).toChangeFormat(expected); + }); + + test("does not insert double modifiers on a single line for nested conditionals", () => { + const content = ruby(` + if a + unless b + do_something + end + end + `); + const expected = ruby(` + if a + do_something unless b + end + `); + + return expect(content).toChangeFormat(expected); + }); }); describe("when inline allowed", () => { From 25c70439c9fd3c849c23e908c2229afd8e671437 Mon Sep 17 00:00:00 2001 From: Nat Budin Date: Fri, 13 Aug 2021 10:36:56 -0700 Subject: [PATCH 211/785] Don't nest ternary expressions Co-authored-by: Miriam Lauter --- src/ruby/nodes/conditionals.js | 2 ++ test/js/ruby/nodes/conditionals.test.js | 48 ++++++++++++++++++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/src/ruby/nodes/conditionals.js b/src/ruby/nodes/conditionals.js index 9661fdb8..cf1cdefa 100644 --- a/src/ruby/nodes/conditionals.js +++ b/src/ruby/nodes/conditionals.js @@ -129,6 +129,7 @@ const noTernary = [ "break", "command", "command_call", + "if", "if_mod", "ifop", "lambda", @@ -140,6 +141,7 @@ const noTernary = [ "return0", "super", "undef", + "unless", "unless_mod", "until_mod", "var_alias", diff --git a/test/js/ruby/nodes/conditionals.test.js b/test/js/ruby/nodes/conditionals.test.js index d6077b5b..1bdd62d3 100644 --- a/test/js/ruby/nodes/conditionals.test.js +++ b/test/js/ruby/nodes/conditionals.test.js @@ -1,6 +1,6 @@ const { long, ruby } = require("../../utils"); -describe.skip("conditionals", () => { +describe("conditionals", () => { describe("not operator", () => { // from ruby test/ruby/test_not.rb test("not operator, empty parens", () => @@ -456,6 +456,52 @@ describe.skip("conditionals", () => { return expect(content).toMatchFormat(); }); + test("nested conditional in if body", () => { + const content = ruby(` + if a + if b + c + else + d + end + else + b + end + `); + const expected = ruby(` + if a + b ? c : d + else + b + end + `); + + return expect(content).toChangeFormat(expected); + }); + + test("nested conditional in else body", () => { + const content = ruby(` + if a + b + else + if c + d + else + b + end + end + `); + const expected = ruby(` + if a + b + else + c ? d : b + end + `); + + return expect(content).toChangeFormat(expected); + }); + test("command with argument predicate", () => { const content = ruby(` if a b From ced6f0f229a12a8ecf2bcb13ddc80fa8a69e1c33 Mon Sep 17 00:00:00 2001 From: Miriam Lauter Date: Fri, 13 Aug 2021 14:07:41 -0400 Subject: [PATCH 212/785] Don't allow heredocs in a ternary Co-authored-by: Nat Budin --- src/ruby/nodes/conditionals.js | 1 + test/js/ruby/nodes/conditionals.test.js | 32 ++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/ruby/nodes/conditionals.js b/src/ruby/nodes/conditionals.js index 9661fdb8..a63f7c48 100644 --- a/src/ruby/nodes/conditionals.js +++ b/src/ruby/nodes/conditionals.js @@ -129,6 +129,7 @@ const noTernary = [ "break", "command", "command_call", + "heredoc", "if_mod", "ifop", "lambda", diff --git a/test/js/ruby/nodes/conditionals.test.js b/test/js/ruby/nodes/conditionals.test.js index d6077b5b..6fecce49 100644 --- a/test/js/ruby/nodes/conditionals.test.js +++ b/test/js/ruby/nodes/conditionals.test.js @@ -1,6 +1,6 @@ const { long, ruby } = require("../../utils"); -describe.skip("conditionals", () => { +describe("conditionals", () => { describe("not operator", () => { // from ruby test/ruby/test_not.rb test("not operator, empty parens", () => @@ -456,6 +456,36 @@ describe.skip("conditionals", () => { return expect(content).toMatchFormat(); }); + test("heredoc in if body", () => { + const content = ruby(` + if a + <<~HEREDOC + a + b + HEREDOC + else + b + end + `); + + return expect(content).toMatchFormat(); + }); + + test("heredoc in else body", () => { + const content = ruby(` + if a + a + else + <<~HEREDOC + a + b + HEREDOC + end + `); + + return expect(content).toMatchFormat(); + }); + test("command with argument predicate", () => { const content = ruby(` if a b From 019ec2b68c70a32528fd86e69542ddec862c3a16 Mon Sep 17 00:00:00 2001 From: Nat Budin Date: Mon, 16 Aug 2021 13:28:16 -0700 Subject: [PATCH 213/785] Use block form when there's a ternary inside a conditional --- src/utils/containsSingleConditional.js | 6 ++++-- test/js/ruby/nodes/conditionals.test.js | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/utils/containsSingleConditional.js b/src/utils/containsSingleConditional.js index fab397d1..b4b63b51 100644 --- a/src/utils/containsSingleConditional.js +++ b/src/utils/containsSingleConditional.js @@ -1,8 +1,10 @@ -// If the statements are just a single if/unless, in block or modifier form +// If the statements are just a single if/unless, in block or modifier form, or a ternary function containsSingleConditional(statements) { return ( statements.body.length === 1 && - ["if", "if_mod", "unless", "unless_mod"].includes(statements.body[0].type) + ["if", "if_mod", "ifop", "unless", "unless_mod"].includes( + statements.body[0].type + ) ); } diff --git a/test/js/ruby/nodes/conditionals.test.js b/test/js/ruby/nodes/conditionals.test.js index b7a2694e..7a4960ef 100644 --- a/test/js/ruby/nodes/conditionals.test.js +++ b/test/js/ruby/nodes/conditionals.test.js @@ -565,6 +565,28 @@ describe("conditionals", () => { return expect(content).toChangeFormat(expected); }); + test("nested ternary in if body", () => { + const content = ruby(` + if a + b ? c : d + end + `); + + return expect(content).toMatchFormat(); + }); + + test("nested ternary in else body", () => { + const content = ruby(` + if a + b + else + c ? d : e + end + `); + + return expect(content).toMatchFormat(); + }); + test("command with argument predicate", () => { const content = ruby(` if a b From 70232b7330a68a3cc8699c23c8458628b53dc900 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Aug 2021 12:01:42 +0000 Subject: [PATCH 214/785] Bump husky from 7.0.1 to 7.0.2 Bumps [husky](https://github.com/typicode/husky) from 7.0.1 to 7.0.2. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v7.0.1...v7.0.2) --- updated-dependencies: - dependency-name: husky dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 089e6ff7..e60c867a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1521,9 +1521,9 @@ human-signals@^2.1.0: integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== husky@^7.0.0: - version "7.0.1" - resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.1.tgz#579f4180b5da4520263e8713cc832942b48e1f1c" - integrity sha512-gceRaITVZ+cJH9sNHqx5tFwbzlLCVxtVZcusME8JYQ8Edy5mpGDOqD8QBCdMhpyo9a+JXddnujQ4rpY2Ff9SJA== + version "7.0.2" + resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.2.tgz#21900da0f30199acca43a46c043c4ad84ae88dff" + integrity sha512-8yKEWNX4z2YsofXAMT7KvA1g8p+GxtB1ffV8XtpAEGuXNAbCV5wdNKH+qTpw8SM9fh4aMPDR+yQuKfgnreyZlg== iconv-lite@0.4.24: version "0.4.24" From a745516352c9b6fa2551f9dcfd66c25551a74356 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 27 Aug 2021 12:01:20 +0000 Subject: [PATCH 215/785] Bump jest from 27.0.6 to 27.1.0 Bumps [jest](https://github.com/facebook/jest) from 27.0.6 to 27.1.0. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v27.0.6...v27.1.0) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 634 +++++++++++++++++++++++++++--------------------------- 1 file changed, 318 insertions(+), 316 deletions(-) diff --git a/yarn.lock b/yarn.lock index e60c867a..75bdb1ce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -346,94 +346,94 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^27.0.6": - version "27.0.6" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.0.6.tgz#3eb72ea80897495c3d73dd97aab7f26770e2260f" - integrity sha512-fMlIBocSHPZ3JxgWiDNW/KPj6s+YRd0hicb33IrmelCcjXo/pXPwvuiKFmZz+XuqI/1u7nbUK10zSsWL/1aegg== +"@jest/console@^27.1.0": + version "27.1.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.1.0.tgz#de13b603cb1d389b50c0dc6296e86e112381e43c" + integrity sha512-+Vl+xmLwAXLNlqT61gmHEixeRbS4L8MUzAjtpBCOPWH+izNI/dR16IeXjkXJdRtIVWVSf9DO1gdp67B1XorZhQ== dependencies: - "@jest/types" "^27.0.6" + "@jest/types" "^27.1.0" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^27.0.6" - jest-util "^27.0.6" + jest-message-util "^27.1.0" + jest-util "^27.1.0" slash "^3.0.0" -"@jest/core@^27.0.6": - version "27.0.6" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.0.6.tgz#c5f642727a0b3bf0f37c4b46c675372d0978d4a1" - integrity sha512-SsYBm3yhqOn5ZLJCtccaBcvD/ccTLCeuDv8U41WJH/V1MW5eKUkeMHT9U+Pw/v1m1AIWlnIW/eM2XzQr0rEmow== - dependencies: - "@jest/console" "^27.0.6" - "@jest/reporters" "^27.0.6" - "@jest/test-result" "^27.0.6" - "@jest/transform" "^27.0.6" - "@jest/types" "^27.0.6" +"@jest/core@^27.1.0": + version "27.1.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.1.0.tgz#622220f18032f5869e579cecbe744527238648bf" + integrity sha512-3l9qmoknrlCFKfGdrmiQiPne+pUR4ALhKwFTYyOeKw6egfDwJkO21RJ1xf41rN8ZNFLg5W+w6+P4fUqq4EMRWA== + dependencies: + "@jest/console" "^27.1.0" + "@jest/reporters" "^27.1.0" + "@jest/test-result" "^27.1.0" + "@jest/transform" "^27.1.0" + "@jest/types" "^27.1.0" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" - jest-changed-files "^27.0.6" - jest-config "^27.0.6" - jest-haste-map "^27.0.6" - jest-message-util "^27.0.6" + jest-changed-files "^27.1.0" + jest-config "^27.1.0" + jest-haste-map "^27.1.0" + jest-message-util "^27.1.0" jest-regex-util "^27.0.6" - jest-resolve "^27.0.6" - jest-resolve-dependencies "^27.0.6" - jest-runner "^27.0.6" - jest-runtime "^27.0.6" - jest-snapshot "^27.0.6" - jest-util "^27.0.6" - jest-validate "^27.0.6" - jest-watcher "^27.0.6" + jest-resolve "^27.1.0" + jest-resolve-dependencies "^27.1.0" + jest-runner "^27.1.0" + jest-runtime "^27.1.0" + jest-snapshot "^27.1.0" + jest-util "^27.1.0" + jest-validate "^27.1.0" + jest-watcher "^27.1.0" micromatch "^4.0.4" p-each-series "^2.1.0" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.0.6": - version "27.0.6" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.0.6.tgz#ee293fe996db01d7d663b8108fa0e1ff436219d2" - integrity sha512-4XywtdhwZwCpPJ/qfAkqExRsERW+UaoSRStSHCCiQTUpoYdLukj+YJbQSFrZjhlUDRZeNiU9SFH0u7iNimdiIg== +"@jest/environment@^27.1.0": + version "27.1.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.1.0.tgz#c7224a67004759ec203d8fa44e8bc0db93f66c44" + integrity sha512-wRp50aAMY2w1U2jP1G32d6FUVBNYqmk8WaGkiIEisU48qyDV0WPtw3IBLnl7orBeggveommAkuijY+RzVnNDOQ== dependencies: - "@jest/fake-timers" "^27.0.6" - "@jest/types" "^27.0.6" + "@jest/fake-timers" "^27.1.0" + "@jest/types" "^27.1.0" "@types/node" "*" - jest-mock "^27.0.6" + jest-mock "^27.1.0" -"@jest/fake-timers@^27.0.6": - version "27.0.6" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.0.6.tgz#cbad52f3fe6abe30e7acb8cd5fa3466b9588e3df" - integrity sha512-sqd+xTWtZ94l3yWDKnRTdvTeZ+A/V7SSKrxsrOKSqdyddb9CeNRF8fbhAU0D7ZJBpTTW2nbp6MftmKJDZfW2LQ== +"@jest/fake-timers@^27.1.0": + version "27.1.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.1.0.tgz#c0b343d8a16af17eab2cb6862e319947c0ea2abe" + integrity sha512-22Zyn8il8DzpS+30jJNVbTlm7vAtnfy1aYvNeOEHloMlGy1PCYLHa4PWlSws0hvNsMM5bON6GISjkLoQUV3oMA== dependencies: - "@jest/types" "^27.0.6" + "@jest/types" "^27.1.0" "@sinonjs/fake-timers" "^7.0.2" "@types/node" "*" - jest-message-util "^27.0.6" - jest-mock "^27.0.6" - jest-util "^27.0.6" + jest-message-util "^27.1.0" + jest-mock "^27.1.0" + jest-util "^27.1.0" -"@jest/globals@^27.0.6": - version "27.0.6" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.0.6.tgz#48e3903f99a4650673d8657334d13c9caf0e8f82" - integrity sha512-DdTGCP606rh9bjkdQ7VvChV18iS7q0IMJVP1piwTWyWskol4iqcVwthZmoJEf7obE1nc34OpIyoVGPeqLC+ryw== +"@jest/globals@^27.1.0": + version "27.1.0" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.1.0.tgz#e093a49c718dd678a782c197757775534c88d3f2" + integrity sha512-73vLV4aNHAlAgjk0/QcSIzzCZSqVIPbmFROJJv9D3QUR7BI4f517gVdJpSrCHxuRH3VZFhe0yGG/tmttlMll9g== dependencies: - "@jest/environment" "^27.0.6" - "@jest/types" "^27.0.6" - expect "^27.0.6" + "@jest/environment" "^27.1.0" + "@jest/types" "^27.1.0" + expect "^27.1.0" -"@jest/reporters@^27.0.6": - version "27.0.6" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.0.6.tgz#91e7f2d98c002ad5df94d5b5167c1eb0b9fd5b00" - integrity sha512-TIkBt09Cb2gptji3yJXb3EE+eVltW6BjO7frO7NEfjI9vSIYoISi5R3aI3KpEDXlB1xwB+97NXIqz84qYeYsfA== +"@jest/reporters@^27.1.0": + version "27.1.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.1.0.tgz#02ed1e6601552c2f6447378533f77aad002781d4" + integrity sha512-5T/zlPkN2HnK3Sboeg64L5eC8iiaZueLpttdktWTJsvALEtP2YMkC5BQxwjRWQACG9SwDmz+XjjkoxXUDMDgdw== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.0.6" - "@jest/test-result" "^27.0.6" - "@jest/transform" "^27.0.6" - "@jest/types" "^27.0.6" + "@jest/console" "^27.1.0" + "@jest/test-result" "^27.1.0" + "@jest/transform" "^27.1.0" + "@jest/types" "^27.1.0" chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" @@ -444,10 +444,10 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^27.0.6" - jest-resolve "^27.0.6" - jest-util "^27.0.6" - jest-worker "^27.0.6" + jest-haste-map "^27.1.0" + jest-resolve "^27.1.0" + jest-util "^27.1.0" + jest-worker "^27.1.0" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" @@ -463,51 +463,51 @@ graceful-fs "^4.2.4" source-map "^0.6.0" -"@jest/test-result@^27.0.6": - version "27.0.6" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.0.6.tgz#3fa42015a14e4fdede6acd042ce98c7f36627051" - integrity sha512-ja/pBOMTufjX4JLEauLxE3LQBPaI2YjGFtXexRAjt1I/MbfNlMx0sytSX3tn5hSLzQsR3Qy2rd0hc1BWojtj9w== +"@jest/test-result@^27.1.0": + version "27.1.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.1.0.tgz#9345ae5f97f6a5287af9ebd54716cd84331d42e8" + integrity sha512-Aoz00gpDL528ODLghat3QSy6UBTD5EmmpjrhZZMK/v1Q2/rRRqTGnFxHuEkrD4z/Py96ZdOHxIWkkCKRpmnE1A== dependencies: - "@jest/console" "^27.0.6" - "@jest/types" "^27.0.6" + "@jest/console" "^27.1.0" + "@jest/types" "^27.1.0" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.0.6": - version "27.0.6" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.0.6.tgz#80a913ed7a1130545b1cd777ff2735dd3af5d34b" - integrity sha512-bISzNIApazYOlTHDum9PwW22NOyDa6VI31n6JucpjTVM0jD6JDgqEZ9+yn575nDdPF0+4csYDxNNW13NvFQGZA== +"@jest/test-sequencer@^27.1.0": + version "27.1.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.1.0.tgz#04e8b3bd735570d3d48865e74977a14dc99bff2d" + integrity sha512-lnCWawDr6Z1DAAK9l25o3AjmKGgcutq1iIbp+hC10s/HxnB8ZkUsYq1FzjOoxxZ5hW+1+AthBtvS4x9yno3V1A== dependencies: - "@jest/test-result" "^27.0.6" + "@jest/test-result" "^27.1.0" graceful-fs "^4.2.4" - jest-haste-map "^27.0.6" - jest-runtime "^27.0.6" + jest-haste-map "^27.1.0" + jest-runtime "^27.1.0" -"@jest/transform@^27.0.6": - version "27.0.6" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.0.6.tgz#189ad7107413208f7600f4719f81dd2f7278cc95" - integrity sha512-rj5Dw+mtIcntAUnMlW/Vju5mr73u8yg+irnHwzgtgoeI6cCPOvUwQ0D1uQtc/APmWgvRweEb1g05pkUpxH3iCA== +"@jest/transform@^27.1.0": + version "27.1.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.1.0.tgz#962e385517e3d1f62827fa39c305edcc3ca8544b" + integrity sha512-ZRGCA2ZEVJ00ubrhkTG87kyLbN6n55g1Ilq0X9nJb5bX3MhMp3O6M7KG+LvYu+nZRqG5cXsQnJEdZbdpTAV8pQ== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^27.0.6" + "@jest/types" "^27.1.0" babel-plugin-istanbul "^6.0.0" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.0.6" + jest-haste-map "^27.1.0" jest-regex-util "^27.0.6" - jest-util "^27.0.6" + jest-util "^27.1.0" micromatch "^4.0.4" pirates "^4.0.1" slash "^3.0.0" source-map "^0.6.1" write-file-atomic "^3.0.0" -"@jest/types@^27.0.6": - version "27.0.6" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.0.6.tgz#9a992bc517e0c49f035938b8549719c2de40706b" - integrity sha512-aSquT1qa9Pik26JK5/3rvnYb4bGtm1VFNesHKmNTwmPIgOrixvhL2ghIvFRNEpzy3gU+rUgjIF/KodbkFAl++g== +"@jest/types@^27.1.0": + version "27.1.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.1.0.tgz#674a40325eab23c857ebc0689e7e191a3c5b10cc" + integrity sha512-pRP5cLIzN7I7Vp6mHKRSaZD7YpBTK7hawx5si8trMKqk4+WOdK8NEKOTO2G8PKWD1HbKMVckVB6/XHh/olhf2g== dependencies: "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" @@ -761,13 +761,13 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= -babel-jest@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.0.6.tgz#e99c6e0577da2655118e3608b68761a5a69bd0d8" - integrity sha512-iTJyYLNc4wRofASmofpOc5NK9QunwMk+TLFgGXsTFS8uEqmd8wdI7sga0FPe2oVH3b5Agt/EAK1QjPEuKL8VfA== +babel-jest@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.1.0.tgz#e96ca04554fd32274439869e2b6d24de9d91bc4e" + integrity sha512-6NrdqzaYemALGCuR97QkC/FkFIEBWP5pw5TMJoUHZTVXyOgocujp6A0JE2V6gE0HtqAAv6VKU/nI+OCR1Z4gHA== dependencies: - "@jest/transform" "^27.0.6" - "@jest/types" "^27.0.6" + "@jest/transform" "^27.1.0" + "@jest/types" "^27.1.0" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.0.0" babel-preset-jest "^27.0.6" @@ -1303,16 +1303,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.0.6.tgz#a4d74fbe27222c718fff68ef49d78e26a8fd4c05" - integrity sha512-psNLt8j2kwg42jGBDSfAlU49CEZxejN1f1PlANWDZqIhBOVU/c2Pm888FcjWJzFewhIsNWfZJeLjUjtKGiPuSw== +expect@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.1.0.tgz#380de0abb3a8f2299c4c6c66bbe930483b5dba9b" + integrity sha512-9kJngV5hOJgkFil4F/uXm3hVBubUK2nERVfvqNNwxxuW8ZOUwSTTSysgfzckYtv/LBzj/LJXbiAF7okHCXgdug== dependencies: - "@jest/types" "^27.0.6" + "@jest/types" "^27.1.0" ansi-styles "^5.0.0" jest-get-type "^27.0.6" - jest-matcher-utils "^27.0.6" - jest-message-util "^27.0.6" + jest-matcher-utils "^27.1.0" + jest-message-util "^27.1.0" jest-regex-util "^27.0.6" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: @@ -1678,94 +1678,94 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.0.6.tgz#bed6183fcdea8a285482e3b50a9a7712d49a7a8b" - integrity sha512-BuL/ZDauaq5dumYh5y20sn4IISnf1P9A0TDswTxUi84ORGtVa86ApuBHqICL0vepqAnZiY6a7xeSPWv2/yy4eA== +jest-changed-files@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.1.0.tgz#42da6ea00f06274172745729d55f42b60a9dffe0" + integrity sha512-eRcb13TfQw0xiV2E98EmiEgs9a5uaBIqJChyl0G7jR9fCIvGjXovnDS6Zbku3joij4tXYcSK4SE1AXqOlUxjWg== dependencies: - "@jest/types" "^27.0.6" + "@jest/types" "^27.1.0" execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.0.6.tgz#dd4df17c4697db6a2c232aaad4e9cec666926668" - integrity sha512-OJlsz6BBeX9qR+7O9lXefWoc2m9ZqcZ5Ohlzz0pTEAG4xMiZUJoacY8f4YDHxgk0oKYxj277AfOk9w6hZYvi1Q== +jest-circus@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.1.0.tgz#24c280c90a625ea57da20ee231d25b1621979a57" + integrity sha512-6FWtHs3nZyZlMBhRf1wvAC5CirnflbGJAY1xssSAnERLiiXQRH+wY2ptBVtXjX4gz4AA2EwRV57b038LmifRbA== dependencies: - "@jest/environment" "^27.0.6" - "@jest/test-result" "^27.0.6" - "@jest/types" "^27.0.6" + "@jest/environment" "^27.1.0" + "@jest/test-result" "^27.1.0" + "@jest/types" "^27.1.0" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" - expect "^27.0.6" + expect "^27.1.0" is-generator-fn "^2.0.0" - jest-each "^27.0.6" - jest-matcher-utils "^27.0.6" - jest-message-util "^27.0.6" - jest-runtime "^27.0.6" - jest-snapshot "^27.0.6" - jest-util "^27.0.6" - pretty-format "^27.0.6" + jest-each "^27.1.0" + jest-matcher-utils "^27.1.0" + jest-message-util "^27.1.0" + jest-runtime "^27.1.0" + jest-snapshot "^27.1.0" + jest-util "^27.1.0" + pretty-format "^27.1.0" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.0.6.tgz#d021e5f4d86d6a212450d4c7b86cb219f1e6864f" - integrity sha512-qUUVlGb9fdKir3RDE+B10ULI+LQrz+MCflEH2UJyoUjoHHCbxDrMxSzjQAPUMsic4SncI62ofYCcAvW6+6rhhg== +jest-cli@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.1.0.tgz#118438e4d11cf6fb66cb2b2eb5778817eab3daeb" + integrity sha512-h6zPUOUu+6oLDrXz0yOWY2YXvBLk8gQinx4HbZ7SF4V3HzasQf+ncoIbKENUMwXyf54/6dBkYXvXJos+gOHYZw== dependencies: - "@jest/core" "^27.0.6" - "@jest/test-result" "^27.0.6" - "@jest/types" "^27.0.6" + "@jest/core" "^27.1.0" + "@jest/test-result" "^27.1.0" + "@jest/types" "^27.1.0" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.0.6" - jest-util "^27.0.6" - jest-validate "^27.0.6" + jest-config "^27.1.0" + jest-util "^27.1.0" + jest-validate "^27.1.0" prompts "^2.0.1" yargs "^16.0.3" -jest-config@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.0.6.tgz#119fb10f149ba63d9c50621baa4f1f179500277f" - integrity sha512-JZRR3I1Plr2YxPBhgqRspDE2S5zprbga3swYNrvY3HfQGu7p/GjyLOqwrYad97tX3U3mzT53TPHVmozacfP/3w== +jest-config@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.1.0.tgz#e6826e2baaa34c07c3839af86466870e339d9ada" + integrity sha512-GMo7f76vMYUA3b3xOdlcKeKQhKcBIgurjERO2hojo0eLkKPGcw7fyIoanH+m6KOP2bLad+fGnF8aWOJYxzNPeg== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.0.6" - "@jest/types" "^27.0.6" - babel-jest "^27.0.6" + "@jest/test-sequencer" "^27.1.0" + "@jest/types" "^27.1.0" + babel-jest "^27.1.0" chalk "^4.0.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" is-ci "^3.0.0" - jest-circus "^27.0.6" - jest-environment-jsdom "^27.0.6" - jest-environment-node "^27.0.6" + jest-circus "^27.1.0" + jest-environment-jsdom "^27.1.0" + jest-environment-node "^27.1.0" jest-get-type "^27.0.6" - jest-jasmine2 "^27.0.6" + jest-jasmine2 "^27.1.0" jest-regex-util "^27.0.6" - jest-resolve "^27.0.6" - jest-runner "^27.0.6" - jest-util "^27.0.6" - jest-validate "^27.0.6" + jest-resolve "^27.1.0" + jest-runner "^27.1.0" + jest-util "^27.1.0" + jest-validate "^27.1.0" micromatch "^4.0.4" - pretty-format "^27.0.6" + pretty-format "^27.1.0" -jest-diff@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.0.6.tgz#4a7a19ee6f04ad70e0e3388f35829394a44c7b5e" - integrity sha512-Z1mqgkTCSYaFgwTlP/NUiRzdqgxmmhzHY1Tq17zL94morOHfHu3K4bgSgl+CR4GLhpV8VxkuOYuIWnQ9LnFqmg== +jest-diff@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.1.0.tgz#c7033f25add95e2218f3c7f4c3d7b634ab6b3cd2" + integrity sha512-rjfopEYl58g/SZTsQFmspBODvMSytL16I+cirnScWTLkQVXYVZfxm78DFfdIIXc05RCYuGjxJqrdyG4PIFzcJg== dependencies: chalk "^4.0.0" diff-sequences "^27.0.6" jest-get-type "^27.0.6" - pretty-format "^27.0.6" + pretty-format "^27.1.0" jest-docblock@^27.0.6: version "27.0.6" @@ -1774,53 +1774,53 @@ jest-docblock@^27.0.6: dependencies: detect-newline "^3.0.0" -jest-each@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.0.6.tgz#cee117071b04060158dc8d9a66dc50ad40ef453b" - integrity sha512-m6yKcV3bkSWrUIjxkE9OC0mhBZZdhovIW5ergBYirqnkLXkyEn3oUUF/QZgyecA1cF1QFyTE8bRRl8Tfg1pfLA== +jest-each@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.1.0.tgz#36ac75f7aeecb3b8da2a8e617ccb30a446df408c" + integrity sha512-K/cNvQlmDqQMRHF8CaQ0XPzCfjP5HMJc2bIJglrIqI9fjwpNqITle63IWE+wq4p+3v+iBgh7Wq0IdGpLx5xjDg== dependencies: - "@jest/types" "^27.0.6" + "@jest/types" "^27.1.0" chalk "^4.0.0" jest-get-type "^27.0.6" - jest-util "^27.0.6" - pretty-format "^27.0.6" + jest-util "^27.1.0" + pretty-format "^27.1.0" -jest-environment-jsdom@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.0.6.tgz#f66426c4c9950807d0a9f209c590ce544f73291f" - integrity sha512-FvetXg7lnXL9+78H+xUAsra3IeZRTiegA3An01cWeXBspKXUhAwMM9ycIJ4yBaR0L7HkoMPaZsozCLHh4T8fuw== +jest-environment-jsdom@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.1.0.tgz#5fb3eb8a67e02e6cc623640388d5f90e33075f18" + integrity sha512-JbwOcOxh/HOtsj56ljeXQCUJr3ivnaIlM45F5NBezFLVYdT91N5UofB1ux2B1CATsQiudcHdgTaeuqGXJqjJYQ== dependencies: - "@jest/environment" "^27.0.6" - "@jest/fake-timers" "^27.0.6" - "@jest/types" "^27.0.6" + "@jest/environment" "^27.1.0" + "@jest/fake-timers" "^27.1.0" + "@jest/types" "^27.1.0" "@types/node" "*" - jest-mock "^27.0.6" - jest-util "^27.0.6" + jest-mock "^27.1.0" + jest-util "^27.1.0" jsdom "^16.6.0" -jest-environment-node@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.0.6.tgz#a6699b7ceb52e8d68138b9808b0c404e505f3e07" - integrity sha512-+Vi6yLrPg/qC81jfXx3IBlVnDTI6kmRr08iVa2hFCWmJt4zha0XW7ucQltCAPhSR0FEKEoJ3i+W4E6T0s9is0w== +jest-environment-node@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.1.0.tgz#feea6b765f1fd4582284d4f1007df2b0a8d15b7f" + integrity sha512-JIyJ8H3wVyM4YCXp7njbjs0dIT87yhGlrXCXhDKNIg1OjurXr6X38yocnnbXvvNyqVTqSI4M9l+YfPKueqL1lw== dependencies: - "@jest/environment" "^27.0.6" - "@jest/fake-timers" "^27.0.6" - "@jest/types" "^27.0.6" + "@jest/environment" "^27.1.0" + "@jest/fake-timers" "^27.1.0" + "@jest/types" "^27.1.0" "@types/node" "*" - jest-mock "^27.0.6" - jest-util "^27.0.6" + jest-mock "^27.1.0" + jest-util "^27.1.0" jest-get-type@^27.0.6: version "27.0.6" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.6.tgz#0eb5c7f755854279ce9b68a9f1a4122f69047cfe" integrity sha512-XTkK5exIeUbbveehcSR8w0bhH+c0yloW/Wpl+9vZrjzztCPWrxhHwkIFpZzCt71oRBsgxmuUfxEqOYoZI2macg== -jest-haste-map@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.0.6.tgz#4683a4e68f6ecaa74231679dca237279562c8dc7" - integrity sha512-4ldjPXX9h8doB2JlRzg9oAZ2p6/GpQUNAeiYXqcpmrKbP0Qev0wdZlxSMOmz8mPOEnt4h6qIzXFLDi8RScX/1w== +jest-haste-map@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.1.0.tgz#a39f456823bd6a74e3c86ad25f6fa870428326bf" + integrity sha512-7mz6LopSe+eA6cTFMf10OfLLqRoIPvmMyz5/OnSXnHO7hB0aDP1iIeLWCXzAcYU5eIJVpHr12Bk9yyq2fTW9vg== dependencies: - "@jest/types" "^27.0.6" + "@jest/types" "^27.1.0" "@types/graceful-fs" "^4.1.2" "@types/node" "*" anymatch "^3.0.3" @@ -1828,76 +1828,76 @@ jest-haste-map@^27.0.6: graceful-fs "^4.2.4" jest-regex-util "^27.0.6" jest-serializer "^27.0.6" - jest-util "^27.0.6" - jest-worker "^27.0.6" + jest-util "^27.1.0" + jest-worker "^27.1.0" micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.0.6.tgz#fd509a9ed3d92bd6edb68a779f4738b100655b37" - integrity sha512-cjpH2sBy+t6dvCeKBsHpW41mjHzXgsavaFMp+VWRf0eR4EW8xASk1acqmljFtK2DgyIECMv2yCdY41r2l1+4iA== +jest-jasmine2@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.1.0.tgz#324a3de0b2ee20d238b2b5b844acc4571331a206" + integrity sha512-Z/NIt0wBDg3przOW2FCWtYjMn3Ip68t0SL60agD/e67jlhTyV3PIF8IzT9ecwqFbeuUSO2OT8WeJgHcalDGFzQ== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^27.0.6" + "@jest/environment" "^27.1.0" "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.0.6" - "@jest/types" "^27.0.6" + "@jest/test-result" "^27.1.0" + "@jest/types" "^27.1.0" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^27.0.6" + expect "^27.1.0" is-generator-fn "^2.0.0" - jest-each "^27.0.6" - jest-matcher-utils "^27.0.6" - jest-message-util "^27.0.6" - jest-runtime "^27.0.6" - jest-snapshot "^27.0.6" - jest-util "^27.0.6" - pretty-format "^27.0.6" + jest-each "^27.1.0" + jest-matcher-utils "^27.1.0" + jest-message-util "^27.1.0" + jest-runtime "^27.1.0" + jest-snapshot "^27.1.0" + jest-util "^27.1.0" + pretty-format "^27.1.0" throat "^6.0.1" -jest-leak-detector@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.0.6.tgz#545854275f85450d4ef4b8fe305ca2a26450450f" - integrity sha512-2/d6n2wlH5zEcdctX4zdbgX8oM61tb67PQt4Xh8JFAIy6LRKUnX528HulkaG6nD5qDl5vRV1NXejCe1XRCH5gQ== +jest-leak-detector@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.1.0.tgz#fe7eb633c851e06280ec4dd248067fe232c00a79" + integrity sha512-oHvSkz1E80VyeTKBvZNnw576qU+cVqRXUD3/wKXh1zpaki47Qty2xeHg2HKie9Hqcd2l4XwircgNOWb/NiGqdA== dependencies: jest-get-type "^27.0.6" - pretty-format "^27.0.6" + pretty-format "^27.1.0" -jest-matcher-utils@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.0.6.tgz#2a8da1e86c620b39459f4352eaa255f0d43e39a9" - integrity sha512-OFgF2VCQx9vdPSYTHWJ9MzFCehs20TsyFi6bIHbk5V1u52zJOnvF0Y/65z3GLZHKRuTgVPY4Z6LVePNahaQ+tA== +jest-matcher-utils@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.1.0.tgz#68afda0885db1f0b9472ce98dc4c535080785301" + integrity sha512-VmAudus2P6Yt/JVBRdTPFhUzlIN8DYJd+et5Rd9QDsO/Z82Z4iwGjo43U8Z+PTiz8CBvKvlb6Fh3oKy39hykkQ== dependencies: chalk "^4.0.0" - jest-diff "^27.0.6" + jest-diff "^27.1.0" jest-get-type "^27.0.6" - pretty-format "^27.0.6" + pretty-format "^27.1.0" -jest-message-util@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.0.6.tgz#158bcdf4785706492d164a39abca6a14da5ab8b5" - integrity sha512-rBxIs2XK7rGy+zGxgi+UJKP6WqQ+KrBbD1YMj517HYN3v2BG66t3Xan3FWqYHKZwjdB700KiAJ+iES9a0M+ixw== +jest-message-util@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.1.0.tgz#e77692c84945d1d10ef00afdfd3d2c20bd8fb468" + integrity sha512-Eck8NFnJ5Sg36R9XguD65cf2D5+McC+NF5GIdEninoabcuoOfWrID5qJhufq5FB0DRKoiyxB61hS7MKoMD0trQ== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^27.0.6" + "@jest/types" "^27.1.0" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.4" micromatch "^4.0.4" - pretty-format "^27.0.6" + pretty-format "^27.1.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.0.6.tgz#0efdd40851398307ba16778728f6d34d583e3467" - integrity sha512-lzBETUoK8cSxts2NYXSBWT+EJNzmUVtVVwS1sU9GwE1DLCfGsngg+ZVSIe0yd0ZSm+y791esiuo+WSwpXJQ5Bw== +jest-mock@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.1.0.tgz#7ca6e4d09375c071661642d1c14c4711f3ab4b4f" + integrity sha512-iT3/Yhu7DwAg/0HvvLCqLvrTKTRMyJlrrfJYWzuLSf9RCAxBoIXN3HoymZxMnYsC3eD8ewGbUa9jUknwBenx2w== dependencies: - "@jest/types" "^27.0.6" + "@jest/types" "^27.1.0" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -1910,86 +1910,88 @@ jest-regex-util@^27.0.6: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.6.tgz#02e112082935ae949ce5d13b2675db3d8c87d9c5" integrity sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ== -jest-resolve-dependencies@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.0.6.tgz#3e619e0ef391c3ecfcf6ef4056207a3d2be3269f" - integrity sha512-mg9x9DS3BPAREWKCAoyg3QucCr0n6S8HEEsqRCKSPjPcu9HzRILzhdzY3imsLoZWeosEbJZz6TKasveczzpJZA== +jest-resolve-dependencies@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.1.0.tgz#d32ea4a2c82f76410f6157d0ec6cde24fbff2317" + integrity sha512-Kq5XuDAELuBnrERrjFYEzu/A+i2W7l9HnPWqZEeKGEQ7m1R+6ndMbdXCVCx29Se1qwLZLgvoXwinB3SPIaitMQ== dependencies: - "@jest/types" "^27.0.6" + "@jest/types" "^27.1.0" jest-regex-util "^27.0.6" - jest-snapshot "^27.0.6" + jest-snapshot "^27.1.0" -jest-resolve@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.0.6.tgz#e90f436dd4f8fbf53f58a91c42344864f8e55bff" - integrity sha512-yKmIgw2LgTh7uAJtzv8UFHGF7Dm7XfvOe/LQ3Txv101fLM8cx2h1QVwtSJ51Q/SCxpIiKfVn6G2jYYMDNHZteA== +jest-resolve@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.1.0.tgz#bb22303c9e240cccdda28562e3c6fbcc6a23ac86" + integrity sha512-TXvzrLyPg0vLOwcWX38ZGYeEztSEmW+cQQKqc4HKDUwun31wsBXwotRlUz4/AYU/Fq4GhbMd/ileIWZEtcdmIA== dependencies: - "@jest/types" "^27.0.6" + "@jest/types" "^27.1.0" chalk "^4.0.0" escalade "^3.1.1" graceful-fs "^4.2.4" + jest-haste-map "^27.1.0" jest-pnp-resolver "^1.2.2" - jest-util "^27.0.6" - jest-validate "^27.0.6" + jest-util "^27.1.0" + jest-validate "^27.1.0" resolve "^1.20.0" slash "^3.0.0" -jest-runner@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.0.6.tgz#1325f45055539222bbc7256a6976e993ad2f9520" - integrity sha512-W3Bz5qAgaSChuivLn+nKOgjqNxM7O/9JOJoKDCqThPIg2sH/d4A/lzyiaFgnb9V1/w29Le11NpzTJSzga1vyYQ== - dependencies: - "@jest/console" "^27.0.6" - "@jest/environment" "^27.0.6" - "@jest/test-result" "^27.0.6" - "@jest/transform" "^27.0.6" - "@jest/types" "^27.0.6" +jest-runner@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.1.0.tgz#1b28d114fb3b67407b8354c9385d47395e8ff83f" + integrity sha512-ZWPKr9M5w5gDplz1KsJ6iRmQaDT/yyAFLf18fKbb/+BLWsR1sCNC2wMT0H7pP3gDcBz0qZ6aJraSYUNAGSJGaw== + dependencies: + "@jest/console" "^27.1.0" + "@jest/environment" "^27.1.0" + "@jest/test-result" "^27.1.0" + "@jest/transform" "^27.1.0" + "@jest/types" "^27.1.0" "@types/node" "*" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" jest-docblock "^27.0.6" - jest-environment-jsdom "^27.0.6" - jest-environment-node "^27.0.6" - jest-haste-map "^27.0.6" - jest-leak-detector "^27.0.6" - jest-message-util "^27.0.6" - jest-resolve "^27.0.6" - jest-runtime "^27.0.6" - jest-util "^27.0.6" - jest-worker "^27.0.6" + jest-environment-jsdom "^27.1.0" + jest-environment-node "^27.1.0" + jest-haste-map "^27.1.0" + jest-leak-detector "^27.1.0" + jest-message-util "^27.1.0" + jest-resolve "^27.1.0" + jest-runtime "^27.1.0" + jest-util "^27.1.0" + jest-worker "^27.1.0" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.0.6.tgz#45877cfcd386afdd4f317def551fc369794c27c9" - integrity sha512-BhvHLRVfKibYyqqEFkybsznKwhrsu7AWx2F3y9G9L95VSIN3/ZZ9vBpm/XCS2bS+BWz3sSeNGLzI3TVQ0uL85Q== +jest-runtime@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.1.0.tgz#1a98d984ffebc16a0b4f9eaad8ab47c00a750cf5" + integrity sha512-okiR2cpGjY0RkWmUGGado6ETpFOi9oG3yV0CioYdoktkVxy5Hv0WRLWnJFuArSYS8cHMCNcceUUMGiIfgxCO9A== dependencies: - "@jest/console" "^27.0.6" - "@jest/environment" "^27.0.6" - "@jest/fake-timers" "^27.0.6" - "@jest/globals" "^27.0.6" + "@jest/console" "^27.1.0" + "@jest/environment" "^27.1.0" + "@jest/fake-timers" "^27.1.0" + "@jest/globals" "^27.1.0" "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.0.6" - "@jest/transform" "^27.0.6" - "@jest/types" "^27.0.6" + "@jest/test-result" "^27.1.0" + "@jest/transform" "^27.1.0" + "@jest/types" "^27.1.0" "@types/yargs" "^16.0.0" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" + execa "^5.0.0" exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-haste-map "^27.0.6" - jest-message-util "^27.0.6" - jest-mock "^27.0.6" + jest-haste-map "^27.1.0" + jest-message-util "^27.1.0" + jest-mock "^27.1.0" jest-regex-util "^27.0.6" - jest-resolve "^27.0.6" - jest-snapshot "^27.0.6" - jest-util "^27.0.6" - jest-validate "^27.0.6" + jest-resolve "^27.1.0" + jest-snapshot "^27.1.0" + jest-util "^27.1.0" + jest-validate "^27.1.0" slash "^3.0.0" strip-bom "^4.0.0" yargs "^16.0.3" @@ -2002,10 +2004,10 @@ jest-serializer@^27.0.6: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.0.6.tgz#f4e6b208bd2e92e888344d78f0f650bcff05a4bf" - integrity sha512-NTHaz8He+ATUagUgE7C/UtFcRoHqR2Gc+KDfhQIyx+VFgwbeEMjeP+ILpUTLosZn/ZtbNdCF5LkVnN/l+V751A== +jest-snapshot@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.1.0.tgz#2a063ab90064017a7e9302528be7eaea6da12d17" + integrity sha512-eaeUBoEjuuRwmiRI51oTldUsKOohB1F6fPqWKKILuDi/CStxzp2IWekVUXbuHHoz5ik33ioJhshiHpgPFbYgcA== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" @@ -2013,79 +2015,79 @@ jest-snapshot@^27.0.6: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/transform" "^27.0.6" - "@jest/types" "^27.0.6" + "@jest/transform" "^27.1.0" + "@jest/types" "^27.1.0" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.0.6" + expect "^27.1.0" graceful-fs "^4.2.4" - jest-diff "^27.0.6" + jest-diff "^27.1.0" jest-get-type "^27.0.6" - jest-haste-map "^27.0.6" - jest-matcher-utils "^27.0.6" - jest-message-util "^27.0.6" - jest-resolve "^27.0.6" - jest-util "^27.0.6" + jest-haste-map "^27.1.0" + jest-matcher-utils "^27.1.0" + jest-message-util "^27.1.0" + jest-resolve "^27.1.0" + jest-util "^27.1.0" natural-compare "^1.4.0" - pretty-format "^27.0.6" + pretty-format "^27.1.0" semver "^7.3.2" -jest-util@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.0.6.tgz#e8e04eec159de2f4d5f57f795df9cdc091e50297" - integrity sha512-1JjlaIh+C65H/F7D11GNkGDDZtDfMEM8EBXsvd+l/cxtgQ6QhxuloOaiayt89DxUvDarbVhqI98HhgrM1yliFQ== +jest-util@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.1.0.tgz#06a53777a8cb7e4940ca8e20bf9c67dd65d9bd68" + integrity sha512-edSLD2OneYDKC6gZM1yc+wY/877s/fuJNoM1k3sOEpzFyeptSmke3SLnk1dDHk9CgTA+58mnfx3ew3J11Kes/w== dependencies: - "@jest/types" "^27.0.6" + "@jest/types" "^27.1.0" "@types/node" "*" chalk "^4.0.0" graceful-fs "^4.2.4" is-ci "^3.0.0" picomatch "^2.2.3" -jest-validate@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.0.6.tgz#930a527c7a951927df269f43b2dc23262457e2a6" - integrity sha512-yhZZOaMH3Zg6DC83n60pLmdU1DQE46DW+KLozPiPbSbPhlXXaiUTDlhHQhHFpaqIFRrInko1FHXjTRpjWRuWfA== +jest-validate@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.1.0.tgz#d9e82024c5e3f5cef52a600cfc456793a84c0998" + integrity sha512-QiJ+4XuSuMsfPi9zvdO//IrSRSlG6ybJhOpuqYSsuuaABaNT84h0IoD6vvQhThBOKT+DIKvl5sTM0l6is9+SRA== dependencies: - "@jest/types" "^27.0.6" + "@jest/types" "^27.1.0" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^27.0.6" leven "^3.1.0" - pretty-format "^27.0.6" + pretty-format "^27.1.0" -jest-watcher@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.0.6.tgz#89526f7f9edf1eac4e4be989bcb6dec6b8878d9c" - integrity sha512-/jIoKBhAP00/iMGnTwUBLgvxkn7vsOweDrOTSPzc7X9uOyUtJIDthQBTI1EXz90bdkrxorUZVhJwiB69gcHtYQ== +jest-watcher@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.1.0.tgz#2511fcddb0e969a400f3d1daa74265f93f13ce93" + integrity sha512-ivaWTrA46aHWdgPDgPypSHiNQjyKnLBpUIHeBaGg11U+pDzZpkffGlcB1l1a014phmG0mHgkOHtOgiqJQM6yKQ== dependencies: - "@jest/test-result" "^27.0.6" - "@jest/types" "^27.0.6" + "@jest/test-result" "^27.1.0" + "@jest/types" "^27.1.0" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^27.0.6" + jest-util "^27.1.0" string-length "^4.0.1" -jest-worker@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.0.6.tgz#a5fdb1e14ad34eb228cfe162d9f729cdbfa28aed" - integrity sha512-qupxcj/dRuA3xHPMUd40gr2EaAurFbkwzOh7wfPaeE9id7hyjURRQoqNfHifHK3XjJU6YJJUQKILGUnwGPEOCA== +jest-worker@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.1.0.tgz#65f4a88e37148ed984ba8ca8492d6b376938c0aa" + integrity sha512-mO4PHb2QWLn9yRXGp7rkvXLAYuxwhq1ZYUo0LoDhg8wqvv4QizP1ZWEJOeolgbEgAWZLIEU0wsku8J+lGWfBhg== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^27.0.1: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.0.6.tgz#10517b2a628f0409087fbf473db44777d7a04505" - integrity sha512-EjV8aETrsD0wHl7CKMibKwQNQc3gIRBXlTikBmmHUeVMKaPFxdcUIBfoDqTSXDoGJIivAYGqCWVlzCSaVjPQsA== + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.1.0.tgz#eaab62dfdc02d8b7c814cd27b8d2d92bc46d3d69" + integrity sha512-pSQDVwRSwb109Ss13lcMtdfS9r8/w2Zz8+mTUA9VORD66GflCdl8nUFCqM96geOD2EBwWCNURrNAfQsLIDNBdg== dependencies: - "@jest/core" "^27.0.6" + "@jest/core" "^27.1.0" import-local "^3.0.2" - jest-cli "^27.0.6" + jest-cli "^27.1.0" js-tokens@^4.0.0: version "4.0.0" @@ -2462,12 +2464,12 @@ prettier@>=1.10: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d" integrity sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ== -pretty-format@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.0.6.tgz#ab770c47b2c6f893a21aefc57b75da63ef49a11f" - integrity sha512-8tGD7gBIENgzqA+UBzObyWqQ5B778VIFZA/S66cclyd5YkFLYs2Js7gxDKf0MXtTc9zcS7t1xhdfcElJ3YIvkQ== +pretty-format@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.1.0.tgz#022f3fdb19121e0a2612f3cff8d724431461b9ca" + integrity sha512-4aGaud3w3rxAO6OXmK3fwBFQ0bctIOG3/if+jYEFGNGIs0EvuidQm3bZ9mlP2/t9epLNC/12czabfy7TZNSwVA== dependencies: - "@jest/types" "^27.0.6" + "@jest/types" "^27.1.0" ansi-regex "^5.0.0" ansi-styles "^5.0.0" react-is "^17.0.1" From eeb58f544c8b8b9682547a726f1eeaa2f8c76a73 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Sep 2021 12:01:47 +0000 Subject: [PATCH 216/785] Bump jest from 27.1.0 to 27.1.1 Bumps [jest](https://github.com/facebook/jest) from 27.1.0 to 27.1.1. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v27.1.0...v27.1.1) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 630 +++++++++++++++++++++++++++--------------------------- 1 file changed, 315 insertions(+), 315 deletions(-) diff --git a/yarn.lock b/yarn.lock index 75bdb1ce..bb2ab48d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -346,94 +346,94 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^27.1.0": - version "27.1.0" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.1.0.tgz#de13b603cb1d389b50c0dc6296e86e112381e43c" - integrity sha512-+Vl+xmLwAXLNlqT61gmHEixeRbS4L8MUzAjtpBCOPWH+izNI/dR16IeXjkXJdRtIVWVSf9DO1gdp67B1XorZhQ== +"@jest/console@^27.1.1": + version "27.1.1" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.1.1.tgz#e1eb8ef8a410e75e80bb17429047ed5d43411d20" + integrity sha512-VpQJRsWSeAem0zpBjeRtDbcD6DlbNoK11dNYt+PSQ+DDORh9q2/xyEpErfwgnLjWX0EKkSZmTGx/iH9Inzs6vQ== dependencies: - "@jest/types" "^27.1.0" + "@jest/types" "^27.1.1" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^27.1.0" - jest-util "^27.1.0" + jest-message-util "^27.1.1" + jest-util "^27.1.1" slash "^3.0.0" -"@jest/core@^27.1.0": - version "27.1.0" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.1.0.tgz#622220f18032f5869e579cecbe744527238648bf" - integrity sha512-3l9qmoknrlCFKfGdrmiQiPne+pUR4ALhKwFTYyOeKw6egfDwJkO21RJ1xf41rN8ZNFLg5W+w6+P4fUqq4EMRWA== +"@jest/core@^27.1.1": + version "27.1.1" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.1.1.tgz#d9d42214920cb96c2a6cc48517cf62d4351da3aa" + integrity sha512-oCkKeTgI0emznKcLoq5OCD0PhxCijA4l7ejDnWW3d5bgSi+zfVaLybVqa+EQOxpNejQWtTna7tmsAXjMN9N43Q== dependencies: - "@jest/console" "^27.1.0" - "@jest/reporters" "^27.1.0" - "@jest/test-result" "^27.1.0" - "@jest/transform" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/console" "^27.1.1" + "@jest/reporters" "^27.1.1" + "@jest/test-result" "^27.1.1" + "@jest/transform" "^27.1.1" + "@jest/types" "^27.1.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" - jest-changed-files "^27.1.0" - jest-config "^27.1.0" - jest-haste-map "^27.1.0" - jest-message-util "^27.1.0" + jest-changed-files "^27.1.1" + jest-config "^27.1.1" + jest-haste-map "^27.1.1" + jest-message-util "^27.1.1" jest-regex-util "^27.0.6" - jest-resolve "^27.1.0" - jest-resolve-dependencies "^27.1.0" - jest-runner "^27.1.0" - jest-runtime "^27.1.0" - jest-snapshot "^27.1.0" - jest-util "^27.1.0" - jest-validate "^27.1.0" - jest-watcher "^27.1.0" + jest-resolve "^27.1.1" + jest-resolve-dependencies "^27.1.1" + jest-runner "^27.1.1" + jest-runtime "^27.1.1" + jest-snapshot "^27.1.1" + jest-util "^27.1.1" + jest-validate "^27.1.1" + jest-watcher "^27.1.1" micromatch "^4.0.4" p-each-series "^2.1.0" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.1.0": - version "27.1.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.1.0.tgz#c7224a67004759ec203d8fa44e8bc0db93f66c44" - integrity sha512-wRp50aAMY2w1U2jP1G32d6FUVBNYqmk8WaGkiIEisU48qyDV0WPtw3IBLnl7orBeggveommAkuijY+RzVnNDOQ== +"@jest/environment@^27.1.1": + version "27.1.1" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.1.1.tgz#a1f7a552f7008f773988b9c0e445ede35f77bbb7" + integrity sha512-+y882/ZdxhyqF5RzxIrNIANjHj991WH7jifdcplzMDosDUOyCACFYUyVTBGbSTocbU+s1cesroRzkwi8hZ9SHg== dependencies: - "@jest/fake-timers" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/fake-timers" "^27.1.1" + "@jest/types" "^27.1.1" "@types/node" "*" - jest-mock "^27.1.0" + jest-mock "^27.1.1" -"@jest/fake-timers@^27.1.0": - version "27.1.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.1.0.tgz#c0b343d8a16af17eab2cb6862e319947c0ea2abe" - integrity sha512-22Zyn8il8DzpS+30jJNVbTlm7vAtnfy1aYvNeOEHloMlGy1PCYLHa4PWlSws0hvNsMM5bON6GISjkLoQUV3oMA== +"@jest/fake-timers@^27.1.1": + version "27.1.1" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.1.1.tgz#557a1c0d067d33bcda4dfae9a7d8f96a15a954b5" + integrity sha512-u8TJ5VlsVYTsGFatoyIae2l25pku4Bu15QCPTx2Gs5z+R//Ee3tHN85462Vc9yGVcdDvgADbqNkhOLxbEwPjMQ== dependencies: - "@jest/types" "^27.1.0" + "@jest/types" "^27.1.1" "@sinonjs/fake-timers" "^7.0.2" "@types/node" "*" - jest-message-util "^27.1.0" - jest-mock "^27.1.0" - jest-util "^27.1.0" + jest-message-util "^27.1.1" + jest-mock "^27.1.1" + jest-util "^27.1.1" -"@jest/globals@^27.1.0": - version "27.1.0" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.1.0.tgz#e093a49c718dd678a782c197757775534c88d3f2" - integrity sha512-73vLV4aNHAlAgjk0/QcSIzzCZSqVIPbmFROJJv9D3QUR7BI4f517gVdJpSrCHxuRH3VZFhe0yGG/tmttlMll9g== +"@jest/globals@^27.1.1": + version "27.1.1" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.1.1.tgz#cfe5f4d5b37483cef62b79612128ccc7e3c951d8" + integrity sha512-Q3JcTPmY+DAEHnr4MpnBV3mwy50EGrTC6oSDTNnW7FNGGacTJAfpWNk02D7xv422T1OzK2A2BKx+26xJOvHkyw== dependencies: - "@jest/environment" "^27.1.0" - "@jest/types" "^27.1.0" - expect "^27.1.0" + "@jest/environment" "^27.1.1" + "@jest/types" "^27.1.1" + expect "^27.1.1" -"@jest/reporters@^27.1.0": - version "27.1.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.1.0.tgz#02ed1e6601552c2f6447378533f77aad002781d4" - integrity sha512-5T/zlPkN2HnK3Sboeg64L5eC8iiaZueLpttdktWTJsvALEtP2YMkC5BQxwjRWQACG9SwDmz+XjjkoxXUDMDgdw== +"@jest/reporters@^27.1.1": + version "27.1.1" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.1.1.tgz#ee5724092f197bb78c60affb9c6f34b6777990c2" + integrity sha512-cEERs62n1P4Pqox9HWyNOEkP57G95aK2mBjB6D8Ruz1Yc98fKH53b58rlVEnsY5nLmkLNZk65fxNi9C0Yds/8w== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.1.0" - "@jest/test-result" "^27.1.0" - "@jest/transform" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/console" "^27.1.1" + "@jest/test-result" "^27.1.1" + "@jest/transform" "^27.1.1" + "@jest/types" "^27.1.1" chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" @@ -444,10 +444,10 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^27.1.0" - jest-resolve "^27.1.0" - jest-util "^27.1.0" - jest-worker "^27.1.0" + jest-haste-map "^27.1.1" + jest-resolve "^27.1.1" + jest-util "^27.1.1" + jest-worker "^27.1.1" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" @@ -463,51 +463,51 @@ graceful-fs "^4.2.4" source-map "^0.6.0" -"@jest/test-result@^27.1.0": - version "27.1.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.1.0.tgz#9345ae5f97f6a5287af9ebd54716cd84331d42e8" - integrity sha512-Aoz00gpDL528ODLghat3QSy6UBTD5EmmpjrhZZMK/v1Q2/rRRqTGnFxHuEkrD4z/Py96ZdOHxIWkkCKRpmnE1A== +"@jest/test-result@^27.1.1": + version "27.1.1" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.1.1.tgz#1086b39af5040b932a55e7f1fa1bc4671bed4781" + integrity sha512-8vy75A0Jtfz9DqXFUkjC5Co/wRla+D7qRFdShUY8SbPqBS3GBx3tpba7sGKFos8mQrdbe39n+c1zgVKtarfy6A== dependencies: - "@jest/console" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/console" "^27.1.1" + "@jest/types" "^27.1.1" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.1.0": - version "27.1.0" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.1.0.tgz#04e8b3bd735570d3d48865e74977a14dc99bff2d" - integrity sha512-lnCWawDr6Z1DAAK9l25o3AjmKGgcutq1iIbp+hC10s/HxnB8ZkUsYq1FzjOoxxZ5hW+1+AthBtvS4x9yno3V1A== +"@jest/test-sequencer@^27.1.1": + version "27.1.1" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.1.1.tgz#cea3722ec6f6330000240fd999ad3123adaf5992" + integrity sha512-l8zD3EdeixvwmLNlJoMX3hhj8iIze95okj4sqmBzOq/zW8gZLElUveH4bpKEMuR+Nweazjlwc7L6g4C26M/y6Q== dependencies: - "@jest/test-result" "^27.1.0" + "@jest/test-result" "^27.1.1" graceful-fs "^4.2.4" - jest-haste-map "^27.1.0" - jest-runtime "^27.1.0" + jest-haste-map "^27.1.1" + jest-runtime "^27.1.1" -"@jest/transform@^27.1.0": - version "27.1.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.1.0.tgz#962e385517e3d1f62827fa39c305edcc3ca8544b" - integrity sha512-ZRGCA2ZEVJ00ubrhkTG87kyLbN6n55g1Ilq0X9nJb5bX3MhMp3O6M7KG+LvYu+nZRqG5cXsQnJEdZbdpTAV8pQ== +"@jest/transform@^27.1.1": + version "27.1.1" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.1.1.tgz#51a22f5a48d55d796c02757117c02fcfe4da13d7" + integrity sha512-qM19Eu75U6Jc5zosXXVnq900Nl9JDpoGaZ4Mg6wZs7oqbu3heYSMOZS19DlwjlhWdfNRjF4UeAgkrCJCK3fEXg== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^27.1.0" + "@jest/types" "^27.1.1" babel-plugin-istanbul "^6.0.0" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.1.0" + jest-haste-map "^27.1.1" jest-regex-util "^27.0.6" - jest-util "^27.1.0" + jest-util "^27.1.1" micromatch "^4.0.4" pirates "^4.0.1" slash "^3.0.0" source-map "^0.6.1" write-file-atomic "^3.0.0" -"@jest/types@^27.1.0": - version "27.1.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.1.0.tgz#674a40325eab23c857ebc0689e7e191a3c5b10cc" - integrity sha512-pRP5cLIzN7I7Vp6mHKRSaZD7YpBTK7hawx5si8trMKqk4+WOdK8NEKOTO2G8PKWD1HbKMVckVB6/XHh/olhf2g== +"@jest/types@^27.1.1": + version "27.1.1" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.1.1.tgz#77a3fc014f906c65752d12123a0134359707c0ad" + integrity sha512-yqJPDDseb0mXgKqmNqypCsb85C22K1aY5+LUxh7syIM9n/b0AsaltxNy+o6tt29VcfGDpYEve175bm3uOhcehA== dependencies: "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" @@ -761,13 +761,13 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= -babel-jest@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.1.0.tgz#e96ca04554fd32274439869e2b6d24de9d91bc4e" - integrity sha512-6NrdqzaYemALGCuR97QkC/FkFIEBWP5pw5TMJoUHZTVXyOgocujp6A0JE2V6gE0HtqAAv6VKU/nI+OCR1Z4gHA== +babel-jest@^27.1.1: + version "27.1.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.1.1.tgz#9359c45995d0940b84d2176ab83423f9eed07617" + integrity sha512-JA+dzJl4n2RBvWQEnph6HJaTHrsIPiXGQYatt/D8nR4UpX9UG4GaDzykVVPQBbrdTebZREkRb6SOxyIXJRab6Q== dependencies: - "@jest/transform" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/transform" "^27.1.1" + "@jest/types" "^27.1.1" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.0.0" babel-preset-jest "^27.0.6" @@ -1303,16 +1303,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.1.0.tgz#380de0abb3a8f2299c4c6c66bbe930483b5dba9b" - integrity sha512-9kJngV5hOJgkFil4F/uXm3hVBubUK2nERVfvqNNwxxuW8ZOUwSTTSysgfzckYtv/LBzj/LJXbiAF7okHCXgdug== +expect@^27.1.1: + version "27.1.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.1.1.tgz#020215da67d41cd6ad805fa00bd030985ca7c093" + integrity sha512-JQAzp0CJoFFHF1RnOtrMUNMdsfx/Tl0+FhRzVl8q0fa23N+JyWdPXwb3T5rkHCvyo9uttnK7lVdKCBl1b/9EDw== dependencies: - "@jest/types" "^27.1.0" + "@jest/types" "^27.1.1" ansi-styles "^5.0.0" jest-get-type "^27.0.6" - jest-matcher-utils "^27.1.0" - jest-message-util "^27.1.0" + jest-matcher-utils "^27.1.1" + jest-message-util "^27.1.1" jest-regex-util "^27.0.6" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: @@ -1678,94 +1678,94 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.1.0.tgz#42da6ea00f06274172745729d55f42b60a9dffe0" - integrity sha512-eRcb13TfQw0xiV2E98EmiEgs9a5uaBIqJChyl0G7jR9fCIvGjXovnDS6Zbku3joij4tXYcSK4SE1AXqOlUxjWg== +jest-changed-files@^27.1.1: + version "27.1.1" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.1.1.tgz#9b3f67a34cc58e3e811e2e1e21529837653e4200" + integrity sha512-5TV9+fYlC2A6hu3qtoyGHprBwCAn0AuGA77bZdUgYvVlRMjHXo063VcWTEAyx6XAZ85DYHqp0+aHKbPlfRDRvA== dependencies: - "@jest/types" "^27.1.0" + "@jest/types" "^27.1.1" execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.1.0.tgz#24c280c90a625ea57da20ee231d25b1621979a57" - integrity sha512-6FWtHs3nZyZlMBhRf1wvAC5CirnflbGJAY1xssSAnERLiiXQRH+wY2ptBVtXjX4gz4AA2EwRV57b038LmifRbA== +jest-circus@^27.1.1: + version "27.1.1" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.1.1.tgz#08dd3ec5cbaadce68ce6388ebccbe051d1b34bc6" + integrity sha512-Xed1ApiMFu/yzqGMBToHr8sp2gkX/ARZf4nXoGrHJrXrTUdVIWiVYheayfcOaPdQvQEE/uyBLgW7I7YBLIrAXQ== dependencies: - "@jest/environment" "^27.1.0" - "@jest/test-result" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/environment" "^27.1.1" + "@jest/test-result" "^27.1.1" + "@jest/types" "^27.1.1" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" - expect "^27.1.0" + expect "^27.1.1" is-generator-fn "^2.0.0" - jest-each "^27.1.0" - jest-matcher-utils "^27.1.0" - jest-message-util "^27.1.0" - jest-runtime "^27.1.0" - jest-snapshot "^27.1.0" - jest-util "^27.1.0" - pretty-format "^27.1.0" + jest-each "^27.1.1" + jest-matcher-utils "^27.1.1" + jest-message-util "^27.1.1" + jest-runtime "^27.1.1" + jest-snapshot "^27.1.1" + jest-util "^27.1.1" + pretty-format "^27.1.1" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.1.0.tgz#118438e4d11cf6fb66cb2b2eb5778817eab3daeb" - integrity sha512-h6zPUOUu+6oLDrXz0yOWY2YXvBLk8gQinx4HbZ7SF4V3HzasQf+ncoIbKENUMwXyf54/6dBkYXvXJos+gOHYZw== +jest-cli@^27.1.1: + version "27.1.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.1.1.tgz#6491a0278231ffee61083ad468809328e96a8eb2" + integrity sha512-LCjfEYp9D3bcOeVUUpEol9Y1ijZYMWVqflSmtw/wX+6Fb7zP4IlO14/6s9v1pxsoM4Pn46+M2zABgKuQjyDpTw== dependencies: - "@jest/core" "^27.1.0" - "@jest/test-result" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/core" "^27.1.1" + "@jest/test-result" "^27.1.1" + "@jest/types" "^27.1.1" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.1.0" - jest-util "^27.1.0" - jest-validate "^27.1.0" + jest-config "^27.1.1" + jest-util "^27.1.1" + jest-validate "^27.1.1" prompts "^2.0.1" yargs "^16.0.3" -jest-config@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.1.0.tgz#e6826e2baaa34c07c3839af86466870e339d9ada" - integrity sha512-GMo7f76vMYUA3b3xOdlcKeKQhKcBIgurjERO2hojo0eLkKPGcw7fyIoanH+m6KOP2bLad+fGnF8aWOJYxzNPeg== +jest-config@^27.1.1: + version "27.1.1" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.1.1.tgz#cde823ad27f7ec0b9440035eabc75d4ac1ea024c" + integrity sha512-2iSd5zoJV4MsWPcLCGwUVUY/j6pZXm4Qd3rnbCtrd9EHNTg458iHw8PZztPQXfxKBKJxLfBk7tbZqYF8MGtxJA== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.1.0" - "@jest/types" "^27.1.0" - babel-jest "^27.1.0" + "@jest/test-sequencer" "^27.1.1" + "@jest/types" "^27.1.1" + babel-jest "^27.1.1" chalk "^4.0.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" is-ci "^3.0.0" - jest-circus "^27.1.0" - jest-environment-jsdom "^27.1.0" - jest-environment-node "^27.1.0" + jest-circus "^27.1.1" + jest-environment-jsdom "^27.1.1" + jest-environment-node "^27.1.1" jest-get-type "^27.0.6" - jest-jasmine2 "^27.1.0" + jest-jasmine2 "^27.1.1" jest-regex-util "^27.0.6" - jest-resolve "^27.1.0" - jest-runner "^27.1.0" - jest-util "^27.1.0" - jest-validate "^27.1.0" + jest-resolve "^27.1.1" + jest-runner "^27.1.1" + jest-util "^27.1.1" + jest-validate "^27.1.1" micromatch "^4.0.4" - pretty-format "^27.1.0" + pretty-format "^27.1.1" -jest-diff@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.1.0.tgz#c7033f25add95e2218f3c7f4c3d7b634ab6b3cd2" - integrity sha512-rjfopEYl58g/SZTsQFmspBODvMSytL16I+cirnScWTLkQVXYVZfxm78DFfdIIXc05RCYuGjxJqrdyG4PIFzcJg== +jest-diff@^27.1.1: + version "27.1.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.1.1.tgz#1d1629ca2e3933b10cb27dc260e28e3dba182684" + integrity sha512-m/6n5158rqEriTazqHtBpOa2B/gGgXJijX6nsEgZfbJ/3pxQcdpVXBe+FP39b1dxWHyLVVmuVXddmAwtqFO4Lg== dependencies: chalk "^4.0.0" diff-sequences "^27.0.6" jest-get-type "^27.0.6" - pretty-format "^27.1.0" + pretty-format "^27.1.1" jest-docblock@^27.0.6: version "27.0.6" @@ -1774,53 +1774,53 @@ jest-docblock@^27.0.6: dependencies: detect-newline "^3.0.0" -jest-each@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.1.0.tgz#36ac75f7aeecb3b8da2a8e617ccb30a446df408c" - integrity sha512-K/cNvQlmDqQMRHF8CaQ0XPzCfjP5HMJc2bIJglrIqI9fjwpNqITle63IWE+wq4p+3v+iBgh7Wq0IdGpLx5xjDg== +jest-each@^27.1.1: + version "27.1.1" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.1.1.tgz#caa1e7eed77144be346eb18712885b990389348a" + integrity sha512-r6hOsTLavUBb1xN0uDa89jdDeBmJ+K49fWpbyxeGRA2pLY46PlC4z551/cWNQzrj+IUa5/gSRsCIV/01HdNPug== dependencies: - "@jest/types" "^27.1.0" + "@jest/types" "^27.1.1" chalk "^4.0.0" jest-get-type "^27.0.6" - jest-util "^27.1.0" - pretty-format "^27.1.0" + jest-util "^27.1.1" + pretty-format "^27.1.1" -jest-environment-jsdom@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.1.0.tgz#5fb3eb8a67e02e6cc623640388d5f90e33075f18" - integrity sha512-JbwOcOxh/HOtsj56ljeXQCUJr3ivnaIlM45F5NBezFLVYdT91N5UofB1ux2B1CATsQiudcHdgTaeuqGXJqjJYQ== +jest-environment-jsdom@^27.1.1: + version "27.1.1" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.1.1.tgz#e53e98a16e6a764b8ee8db3b29b3a8c27db06f66" + integrity sha512-6vOnoZ6IaExuw7FvnuJhA1qFYv1DDSnN0sQowzolNwxQp7bG1YhLxj2YU1sVXAYA3IR3MbH2mbnJUsLUWfyfzw== dependencies: - "@jest/environment" "^27.1.0" - "@jest/fake-timers" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/environment" "^27.1.1" + "@jest/fake-timers" "^27.1.1" + "@jest/types" "^27.1.1" "@types/node" "*" - jest-mock "^27.1.0" - jest-util "^27.1.0" + jest-mock "^27.1.1" + jest-util "^27.1.1" jsdom "^16.6.0" -jest-environment-node@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.1.0.tgz#feea6b765f1fd4582284d4f1007df2b0a8d15b7f" - integrity sha512-JIyJ8H3wVyM4YCXp7njbjs0dIT87yhGlrXCXhDKNIg1OjurXr6X38yocnnbXvvNyqVTqSI4M9l+YfPKueqL1lw== +jest-environment-node@^27.1.1: + version "27.1.1" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.1.1.tgz#97425d4762b2aeab15892ffba08c6cbed7653e75" + integrity sha512-OEGeZh0PwzngNIYWYgWrvTcLygopV8OJbC9HNb0j70VBKgEIsdZkYhwcFnaURX83OHACMqf1pa9Tv5Pw5jemrg== dependencies: - "@jest/environment" "^27.1.0" - "@jest/fake-timers" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/environment" "^27.1.1" + "@jest/fake-timers" "^27.1.1" + "@jest/types" "^27.1.1" "@types/node" "*" - jest-mock "^27.1.0" - jest-util "^27.1.0" + jest-mock "^27.1.1" + jest-util "^27.1.1" jest-get-type@^27.0.6: version "27.0.6" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.6.tgz#0eb5c7f755854279ce9b68a9f1a4122f69047cfe" integrity sha512-XTkK5exIeUbbveehcSR8w0bhH+c0yloW/Wpl+9vZrjzztCPWrxhHwkIFpZzCt71oRBsgxmuUfxEqOYoZI2macg== -jest-haste-map@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.1.0.tgz#a39f456823bd6a74e3c86ad25f6fa870428326bf" - integrity sha512-7mz6LopSe+eA6cTFMf10OfLLqRoIPvmMyz5/OnSXnHO7hB0aDP1iIeLWCXzAcYU5eIJVpHr12Bk9yyq2fTW9vg== +jest-haste-map@^27.1.1: + version "27.1.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.1.1.tgz#f7c646b0e417ec29b80b96cf785b57b581384adf" + integrity sha512-NGLYVAdh5C8Ezg5QBFzrNeYsfxptDBPlhvZNaicLiZX77F/rS27a9M6u9ripWAaaD54xnWdZNZpEkdjD5Eo5aQ== dependencies: - "@jest/types" "^27.1.0" + "@jest/types" "^27.1.1" "@types/graceful-fs" "^4.1.2" "@types/node" "*" anymatch "^3.0.3" @@ -1828,76 +1828,76 @@ jest-haste-map@^27.1.0: graceful-fs "^4.2.4" jest-regex-util "^27.0.6" jest-serializer "^27.0.6" - jest-util "^27.1.0" - jest-worker "^27.1.0" + jest-util "^27.1.1" + jest-worker "^27.1.1" micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.1.0.tgz#324a3de0b2ee20d238b2b5b844acc4571331a206" - integrity sha512-Z/NIt0wBDg3przOW2FCWtYjMn3Ip68t0SL60agD/e67jlhTyV3PIF8IzT9ecwqFbeuUSO2OT8WeJgHcalDGFzQ== +jest-jasmine2@^27.1.1: + version "27.1.1" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.1.1.tgz#efb9e7b70ce834c35c91e1a2f01bb41b462fad43" + integrity sha512-0LAzUmcmvQwjIdJt0cXUVX4G5qjVXE8ELt6nbMNDzv2yAs2hYCCUtQq+Eje70GwAysWCGcS64QeYj5VPHYVxPg== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^27.1.0" + "@jest/environment" "^27.1.1" "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/test-result" "^27.1.1" + "@jest/types" "^27.1.1" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^27.1.0" + expect "^27.1.1" is-generator-fn "^2.0.0" - jest-each "^27.1.0" - jest-matcher-utils "^27.1.0" - jest-message-util "^27.1.0" - jest-runtime "^27.1.0" - jest-snapshot "^27.1.0" - jest-util "^27.1.0" - pretty-format "^27.1.0" + jest-each "^27.1.1" + jest-matcher-utils "^27.1.1" + jest-message-util "^27.1.1" + jest-runtime "^27.1.1" + jest-snapshot "^27.1.1" + jest-util "^27.1.1" + pretty-format "^27.1.1" throat "^6.0.1" -jest-leak-detector@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.1.0.tgz#fe7eb633c851e06280ec4dd248067fe232c00a79" - integrity sha512-oHvSkz1E80VyeTKBvZNnw576qU+cVqRXUD3/wKXh1zpaki47Qty2xeHg2HKie9Hqcd2l4XwircgNOWb/NiGqdA== +jest-leak-detector@^27.1.1: + version "27.1.1" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.1.1.tgz#8e05ec4b339814fc4202f07d875da65189e3d7d4" + integrity sha512-gwSgzmqShoeEsEVpgObymQPrM9P6557jt1EsFW5aCeJ46Cme0EdjYU7xr6llQZ5GpWDl56eOstUaPXiZOfiTKw== dependencies: jest-get-type "^27.0.6" - pretty-format "^27.1.0" + pretty-format "^27.1.1" -jest-matcher-utils@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.1.0.tgz#68afda0885db1f0b9472ce98dc4c535080785301" - integrity sha512-VmAudus2P6Yt/JVBRdTPFhUzlIN8DYJd+et5Rd9QDsO/Z82Z4iwGjo43U8Z+PTiz8CBvKvlb6Fh3oKy39hykkQ== +jest-matcher-utils@^27.1.1: + version "27.1.1" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.1.1.tgz#1f444d7491ccf9edca746336b056178789a59651" + integrity sha512-Q1a10w9Y4sh0wegkdP6reQOa/Dtz7nAvDqBgrat1ItZAUvk4jzXAqyhXPu/ZuEtDaXaNKpdRPRQA8bvkOh2Eaw== dependencies: chalk "^4.0.0" - jest-diff "^27.1.0" + jest-diff "^27.1.1" jest-get-type "^27.0.6" - pretty-format "^27.1.0" + pretty-format "^27.1.1" -jest-message-util@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.1.0.tgz#e77692c84945d1d10ef00afdfd3d2c20bd8fb468" - integrity sha512-Eck8NFnJ5Sg36R9XguD65cf2D5+McC+NF5GIdEninoabcuoOfWrID5qJhufq5FB0DRKoiyxB61hS7MKoMD0trQ== +jest-message-util@^27.1.1: + version "27.1.1" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.1.1.tgz#980110fb72fcfa711cd9a95e8f10d335207585c6" + integrity sha512-b697BOJV93+AVGvzLRtVZ0cTVRbd59OaWnbB2D75GRaIMc4I+Z9W0wHxbfjW01JWO+TqqW4yevT0aN7Fd0XWng== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^27.1.0" + "@jest/types" "^27.1.1" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.4" micromatch "^4.0.4" - pretty-format "^27.1.0" + pretty-format "^27.1.1" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.1.0.tgz#7ca6e4d09375c071661642d1c14c4711f3ab4b4f" - integrity sha512-iT3/Yhu7DwAg/0HvvLCqLvrTKTRMyJlrrfJYWzuLSf9RCAxBoIXN3HoymZxMnYsC3eD8ewGbUa9jUknwBenx2w== +jest-mock@^27.1.1: + version "27.1.1" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.1.1.tgz#c7a2e81301fdcf3dab114931d23d89ec9d0c3a82" + integrity sha512-SClsFKuYBf+6SSi8jtAYOuPw8DDMsTElUWEae3zq7vDhH01ayVSIHUSIa8UgbDOUalCFp6gNsaikN0rbxN4dbw== dependencies: - "@jest/types" "^27.1.0" + "@jest/types" "^27.1.1" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -1910,72 +1910,72 @@ jest-regex-util@^27.0.6: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.6.tgz#02e112082935ae949ce5d13b2675db3d8c87d9c5" integrity sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ== -jest-resolve-dependencies@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.1.0.tgz#d32ea4a2c82f76410f6157d0ec6cde24fbff2317" - integrity sha512-Kq5XuDAELuBnrERrjFYEzu/A+i2W7l9HnPWqZEeKGEQ7m1R+6ndMbdXCVCx29Se1qwLZLgvoXwinB3SPIaitMQ== +jest-resolve-dependencies@^27.1.1: + version "27.1.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.1.1.tgz#6f3e0916c1764dd1853c6111ed9d66c66c792e40" + integrity sha512-sYZR+uBjFDCo4VhYeazZf/T+ryYItvdLKu9vHatqkUqHGjDMrdEPOykiqC2iEpaCFTS+3iL/21CYiJuKdRbniw== dependencies: - "@jest/types" "^27.1.0" + "@jest/types" "^27.1.1" jest-regex-util "^27.0.6" - jest-snapshot "^27.1.0" + jest-snapshot "^27.1.1" -jest-resolve@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.1.0.tgz#bb22303c9e240cccdda28562e3c6fbcc6a23ac86" - integrity sha512-TXvzrLyPg0vLOwcWX38ZGYeEztSEmW+cQQKqc4HKDUwun31wsBXwotRlUz4/AYU/Fq4GhbMd/ileIWZEtcdmIA== +jest-resolve@^27.1.1: + version "27.1.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.1.1.tgz#3a86762f9affcad9697bc88140b0581b623add33" + integrity sha512-M41YFmWhvDVstwe7XuV21zynOiBLJB5Sk0GrIsYYgTkjfEWNLVXDjAyq1W7PHseaYNOxIc0nOGq/r5iwcZNC1A== dependencies: - "@jest/types" "^27.1.0" + "@jest/types" "^27.1.1" chalk "^4.0.0" escalade "^3.1.1" graceful-fs "^4.2.4" - jest-haste-map "^27.1.0" + jest-haste-map "^27.1.1" jest-pnp-resolver "^1.2.2" - jest-util "^27.1.0" - jest-validate "^27.1.0" + jest-util "^27.1.1" + jest-validate "^27.1.1" resolve "^1.20.0" slash "^3.0.0" -jest-runner@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.1.0.tgz#1b28d114fb3b67407b8354c9385d47395e8ff83f" - integrity sha512-ZWPKr9M5w5gDplz1KsJ6iRmQaDT/yyAFLf18fKbb/+BLWsR1sCNC2wMT0H7pP3gDcBz0qZ6aJraSYUNAGSJGaw== +jest-runner@^27.1.1: + version "27.1.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.1.1.tgz#1991fdf13a8fe6e49cef47332db33300649357cd" + integrity sha512-lP3MBNQhg75/sQtVkC8dsAQZumvy3lHK/YIwYPfEyqGIX1qEcnYIRxP89q0ZgC5ngvi1vN2P5UFHszQxguWdng== dependencies: - "@jest/console" "^27.1.0" - "@jest/environment" "^27.1.0" - "@jest/test-result" "^27.1.0" - "@jest/transform" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/console" "^27.1.1" + "@jest/environment" "^27.1.1" + "@jest/test-result" "^27.1.1" + "@jest/transform" "^27.1.1" + "@jest/types" "^27.1.1" "@types/node" "*" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" jest-docblock "^27.0.6" - jest-environment-jsdom "^27.1.0" - jest-environment-node "^27.1.0" - jest-haste-map "^27.1.0" - jest-leak-detector "^27.1.0" - jest-message-util "^27.1.0" - jest-resolve "^27.1.0" - jest-runtime "^27.1.0" - jest-util "^27.1.0" - jest-worker "^27.1.0" + jest-environment-jsdom "^27.1.1" + jest-environment-node "^27.1.1" + jest-haste-map "^27.1.1" + jest-leak-detector "^27.1.1" + jest-message-util "^27.1.1" + jest-resolve "^27.1.1" + jest-runtime "^27.1.1" + jest-util "^27.1.1" + jest-worker "^27.1.1" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.1.0.tgz#1a98d984ffebc16a0b4f9eaad8ab47c00a750cf5" - integrity sha512-okiR2cpGjY0RkWmUGGado6ETpFOi9oG3yV0CioYdoktkVxy5Hv0WRLWnJFuArSYS8cHMCNcceUUMGiIfgxCO9A== +jest-runtime@^27.1.1: + version "27.1.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.1.1.tgz#bd0a0958a11c2f7d94d2e5f6f71864ad1c65fe44" + integrity sha512-FEwy+tSzmsvuKaQpyYsUyk31KG5vMmA2r2BSTHgv0yNfcooQdm2Ke91LM9Ud8D3xz8CLDHJWAI24haMFTwrsPg== dependencies: - "@jest/console" "^27.1.0" - "@jest/environment" "^27.1.0" - "@jest/fake-timers" "^27.1.0" - "@jest/globals" "^27.1.0" + "@jest/console" "^27.1.1" + "@jest/environment" "^27.1.1" + "@jest/fake-timers" "^27.1.1" + "@jest/globals" "^27.1.1" "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.1.0" - "@jest/transform" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/test-result" "^27.1.1" + "@jest/transform" "^27.1.1" + "@jest/types" "^27.1.1" "@types/yargs" "^16.0.0" chalk "^4.0.0" cjs-module-lexer "^1.0.0" @@ -1984,14 +1984,14 @@ jest-runtime@^27.1.0: exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-haste-map "^27.1.0" - jest-message-util "^27.1.0" - jest-mock "^27.1.0" + jest-haste-map "^27.1.1" + jest-message-util "^27.1.1" + jest-mock "^27.1.1" jest-regex-util "^27.0.6" - jest-resolve "^27.1.0" - jest-snapshot "^27.1.0" - jest-util "^27.1.0" - jest-validate "^27.1.0" + jest-resolve "^27.1.1" + jest-snapshot "^27.1.1" + jest-util "^27.1.1" + jest-validate "^27.1.1" slash "^3.0.0" strip-bom "^4.0.0" yargs "^16.0.3" @@ -2004,10 +2004,10 @@ jest-serializer@^27.0.6: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.1.0.tgz#2a063ab90064017a7e9302528be7eaea6da12d17" - integrity sha512-eaeUBoEjuuRwmiRI51oTldUsKOohB1F6fPqWKKILuDi/CStxzp2IWekVUXbuHHoz5ik33ioJhshiHpgPFbYgcA== +jest-snapshot@^27.1.1: + version "27.1.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.1.1.tgz#3b816e0ca4352fbbd1db48dc692e3d9641d2531b" + integrity sha512-Wi3QGiuRFo3lU+EbQmZnBOks0CJyAMPHvYoG7iJk00Do10jeOyuOEO0Jfoaoun8+8TDv+Nzl7Aswir/IK9+1jg== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" @@ -2015,79 +2015,79 @@ jest-snapshot@^27.1.0: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/transform" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/transform" "^27.1.1" + "@jest/types" "^27.1.1" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.1.0" + expect "^27.1.1" graceful-fs "^4.2.4" - jest-diff "^27.1.0" + jest-diff "^27.1.1" jest-get-type "^27.0.6" - jest-haste-map "^27.1.0" - jest-matcher-utils "^27.1.0" - jest-message-util "^27.1.0" - jest-resolve "^27.1.0" - jest-util "^27.1.0" + jest-haste-map "^27.1.1" + jest-matcher-utils "^27.1.1" + jest-message-util "^27.1.1" + jest-resolve "^27.1.1" + jest-util "^27.1.1" natural-compare "^1.4.0" - pretty-format "^27.1.0" + pretty-format "^27.1.1" semver "^7.3.2" -jest-util@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.1.0.tgz#06a53777a8cb7e4940ca8e20bf9c67dd65d9bd68" - integrity sha512-edSLD2OneYDKC6gZM1yc+wY/877s/fuJNoM1k3sOEpzFyeptSmke3SLnk1dDHk9CgTA+58mnfx3ew3J11Kes/w== +jest-util@^27.1.1: + version "27.1.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.1.1.tgz#2b06db1391d779ec2bd406ab3690ddc56ac728b9" + integrity sha512-zf9nEbrASWn2mC/L91nNb0K+GkhFvi4MP6XJG2HqnHzHvLYcs7ou/In68xYU1i1dSkJlrWcYfWXQE8nVR+nbOA== dependencies: - "@jest/types" "^27.1.0" + "@jest/types" "^27.1.1" "@types/node" "*" chalk "^4.0.0" graceful-fs "^4.2.4" is-ci "^3.0.0" picomatch "^2.2.3" -jest-validate@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.1.0.tgz#d9e82024c5e3f5cef52a600cfc456793a84c0998" - integrity sha512-QiJ+4XuSuMsfPi9zvdO//IrSRSlG6ybJhOpuqYSsuuaABaNT84h0IoD6vvQhThBOKT+DIKvl5sTM0l6is9+SRA== +jest-validate@^27.1.1: + version "27.1.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.1.1.tgz#0783733af02c988d503995fc0a07bbdc58c7dd50" + integrity sha512-N5Er5FKav/8m2dJwn7BGnZwnoD1BSc8jx5T+diG2OvyeugvZDhPeAt5DrNaGkkaKCrSUvuE7A5E4uHyT7Vj0Mw== dependencies: - "@jest/types" "^27.1.0" + "@jest/types" "^27.1.1" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^27.0.6" leven "^3.1.0" - pretty-format "^27.1.0" + pretty-format "^27.1.1" -jest-watcher@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.1.0.tgz#2511fcddb0e969a400f3d1daa74265f93f13ce93" - integrity sha512-ivaWTrA46aHWdgPDgPypSHiNQjyKnLBpUIHeBaGg11U+pDzZpkffGlcB1l1a014phmG0mHgkOHtOgiqJQM6yKQ== +jest-watcher@^27.1.1: + version "27.1.1" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.1.1.tgz#a8147e18703b5d753ada4b287451f2daf40f4118" + integrity sha512-XQzyHbxziDe+lZM6Dzs40fEt4q9akOGwitJnxQasJ9WG0bv3JGiRlsBgjw13znGapeMtFaEsyhL0Cl04IbaoWQ== dependencies: - "@jest/test-result" "^27.1.0" - "@jest/types" "^27.1.0" + "@jest/test-result" "^27.1.1" + "@jest/types" "^27.1.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^27.1.0" + jest-util "^27.1.1" string-length "^4.0.1" -jest-worker@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.1.0.tgz#65f4a88e37148ed984ba8ca8492d6b376938c0aa" - integrity sha512-mO4PHb2QWLn9yRXGp7rkvXLAYuxwhq1ZYUo0LoDhg8wqvv4QizP1ZWEJOeolgbEgAWZLIEU0wsku8J+lGWfBhg== +jest-worker@^27.1.1: + version "27.1.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.1.1.tgz#eb5f05c4657fdcb702c36c48b20d785bd4599378" + integrity sha512-XJKCL7tu+362IUYTWvw8+3S75U7qMiYiRU6u5yqscB48bTvzwN6i8L/7wVTXiFLwkRsxARNM7TISnTvcgv9hxA== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^27.0.1: - version "27.1.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.1.0.tgz#eaab62dfdc02d8b7c814cd27b8d2d92bc46d3d69" - integrity sha512-pSQDVwRSwb109Ss13lcMtdfS9r8/w2Zz8+mTUA9VORD66GflCdl8nUFCqM96geOD2EBwWCNURrNAfQsLIDNBdg== + version "27.1.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.1.1.tgz#49f0497fa0fb07dc78898318cc1b737b5fbf72d8" + integrity sha512-LFTEZOhoZNR/2DQM3OCaK5xC6c55c1OWhYh0njRsoHX0qd6x4nkcgenkSH0JKjsAGMTmmJAoL7/oqYHMfwhruA== dependencies: - "@jest/core" "^27.1.0" + "@jest/core" "^27.1.1" import-local "^3.0.2" - jest-cli "^27.1.0" + jest-cli "^27.1.1" js-tokens@^4.0.0: version "4.0.0" @@ -2464,12 +2464,12 @@ prettier@>=1.10: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d" integrity sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ== -pretty-format@^27.1.0: - version "27.1.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.1.0.tgz#022f3fdb19121e0a2612f3cff8d724431461b9ca" - integrity sha512-4aGaud3w3rxAO6OXmK3fwBFQ0bctIOG3/if+jYEFGNGIs0EvuidQm3bZ9mlP2/t9epLNC/12czabfy7TZNSwVA== +pretty-format@^27.1.1: + version "27.1.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.1.1.tgz#cbaf9ec6cd7cfc3141478b6f6293c0ccdbe968e0" + integrity sha512-zdBi/xlstKJL42UH7goQti5Hip/B415w1Mfj+WWWYMBylAYtKESnXGUtVVcMVid9ReVjypCotUV6CEevYPHv2g== dependencies: - "@jest/types" "^27.1.0" + "@jest/types" "^27.1.1" ansi-regex "^5.0.0" ansi-styles "^5.0.0" react-is "^17.0.1" From 261d8ccac1043bcee4dd9fb3b6972c829dcb42ea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Sep 2021 12:01:24 +0000 Subject: [PATCH 217/785] Bump prettier from 2.3.2 to 2.4.0 Bumps [prettier](https://github.com/prettier/prettier) from 2.3.2 to 2.4.0. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.3.2...2.4.0) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index bb2ab48d..f2fa855c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2460,9 +2460,9 @@ prelude-ls@~1.1.2: integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= prettier@>=1.10: - version "2.3.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d" - integrity sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ== + version "2.4.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.0.tgz#85bdfe0f70c3e777cf13a4ffff39713ca6f64cba" + integrity sha512-DsEPLY1dE5HF3BxCRBmD4uYZ+5DCbvatnolqTqcxEgKVZnL2kUfyu7b8pPQ5+hTBkdhU9SLUmK0/pHb07RE4WQ== pretty-format@^27.1.1: version "27.1.1" From 9c347ebd3e875e67b06187d3aa5083ef5c02aeeb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Sep 2021 12:01:47 +0000 Subject: [PATCH 218/785] Bump jest from 27.1.1 to 27.2.0 Bumps [jest](https://github.com/facebook/jest) from 27.1.1 to 27.2.0. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v27.1.1...v27.2.0) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 554 +++++++++++++++++++++++++++--------------------------- 1 file changed, 277 insertions(+), 277 deletions(-) diff --git a/yarn.lock b/yarn.lock index f2fa855c..8461ef76 100644 --- a/yarn.lock +++ b/yarn.lock @@ -346,27 +346,27 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^27.1.1": - version "27.1.1" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.1.1.tgz#e1eb8ef8a410e75e80bb17429047ed5d43411d20" - integrity sha512-VpQJRsWSeAem0zpBjeRtDbcD6DlbNoK11dNYt+PSQ+DDORh9q2/xyEpErfwgnLjWX0EKkSZmTGx/iH9Inzs6vQ== +"@jest/console@^27.2.0": + version "27.2.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.2.0.tgz#57f702837ec52899be58c3794dce5941c77a8b63" + integrity sha512-35z+RqsK2CCgNxn+lWyK8X4KkaDtfL4BggT7oeZ0JffIiAiEYFYPo5B67V50ZubqDS1ehBrdCR2jduFnIrZOYw== dependencies: "@jest/types" "^27.1.1" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^27.1.1" - jest-util "^27.1.1" + jest-message-util "^27.2.0" + jest-util "^27.2.0" slash "^3.0.0" -"@jest/core@^27.1.1": - version "27.1.1" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.1.1.tgz#d9d42214920cb96c2a6cc48517cf62d4351da3aa" - integrity sha512-oCkKeTgI0emznKcLoq5OCD0PhxCijA4l7ejDnWW3d5bgSi+zfVaLybVqa+EQOxpNejQWtTna7tmsAXjMN9N43Q== +"@jest/core@^27.2.0": + version "27.2.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.2.0.tgz#61fc27b244e9709170ed9ffe41b006add569f1b3" + integrity sha512-E/2NHhq+VMo18DpKkoty8Sjey8Kps5Cqa88A8NP757s6JjYqPdioMuyUBhDiIOGCdQByEp0ou3jskkTszMS0nw== dependencies: - "@jest/console" "^27.1.1" - "@jest/reporters" "^27.1.1" - "@jest/test-result" "^27.1.1" - "@jest/transform" "^27.1.1" + "@jest/console" "^27.2.0" + "@jest/reporters" "^27.2.0" + "@jest/test-result" "^27.2.0" + "@jest/transform" "^27.2.0" "@jest/types" "^27.1.1" "@types/node" "*" ansi-escapes "^4.2.1" @@ -375,64 +375,64 @@ exit "^0.1.2" graceful-fs "^4.2.4" jest-changed-files "^27.1.1" - jest-config "^27.1.1" - jest-haste-map "^27.1.1" - jest-message-util "^27.1.1" + jest-config "^27.2.0" + jest-haste-map "^27.2.0" + jest-message-util "^27.2.0" jest-regex-util "^27.0.6" - jest-resolve "^27.1.1" - jest-resolve-dependencies "^27.1.1" - jest-runner "^27.1.1" - jest-runtime "^27.1.1" - jest-snapshot "^27.1.1" - jest-util "^27.1.1" - jest-validate "^27.1.1" - jest-watcher "^27.1.1" + jest-resolve "^27.2.0" + jest-resolve-dependencies "^27.2.0" + jest-runner "^27.2.0" + jest-runtime "^27.2.0" + jest-snapshot "^27.2.0" + jest-util "^27.2.0" + jest-validate "^27.2.0" + jest-watcher "^27.2.0" micromatch "^4.0.4" p-each-series "^2.1.0" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.1.1": - version "27.1.1" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.1.1.tgz#a1f7a552f7008f773988b9c0e445ede35f77bbb7" - integrity sha512-+y882/ZdxhyqF5RzxIrNIANjHj991WH7jifdcplzMDosDUOyCACFYUyVTBGbSTocbU+s1cesroRzkwi8hZ9SHg== +"@jest/environment@^27.2.0": + version "27.2.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.2.0.tgz#48d1dbfa65f8e4a5a5c6cbeb9c59d1a5c2776f6b" + integrity sha512-iPWmQI0wRIYSZX3wKu4FXHK4eIqkfq6n1DCDJS+v3uby7SOXrHvX4eiTBuEdSvtDRMTIH2kjrSkjHf/F9JIYyQ== dependencies: - "@jest/fake-timers" "^27.1.1" + "@jest/fake-timers" "^27.2.0" "@jest/types" "^27.1.1" "@types/node" "*" jest-mock "^27.1.1" -"@jest/fake-timers@^27.1.1": - version "27.1.1" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.1.1.tgz#557a1c0d067d33bcda4dfae9a7d8f96a15a954b5" - integrity sha512-u8TJ5VlsVYTsGFatoyIae2l25pku4Bu15QCPTx2Gs5z+R//Ee3tHN85462Vc9yGVcdDvgADbqNkhOLxbEwPjMQ== +"@jest/fake-timers@^27.2.0": + version "27.2.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.2.0.tgz#560841bc21ae7fbeff0cbff8de8f5cf43ad3561d" + integrity sha512-gSu3YHvQOoVaTWYGgHFB7IYFtcF2HBzX4l7s47VcjvkUgL4/FBnE20x7TNLa3W6ABERtGd5gStSwsA8bcn+c4w== dependencies: "@jest/types" "^27.1.1" "@sinonjs/fake-timers" "^7.0.2" "@types/node" "*" - jest-message-util "^27.1.1" + jest-message-util "^27.2.0" jest-mock "^27.1.1" - jest-util "^27.1.1" + jest-util "^27.2.0" -"@jest/globals@^27.1.1": - version "27.1.1" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.1.1.tgz#cfe5f4d5b37483cef62b79612128ccc7e3c951d8" - integrity sha512-Q3JcTPmY+DAEHnr4MpnBV3mwy50EGrTC6oSDTNnW7FNGGacTJAfpWNk02D7xv422T1OzK2A2BKx+26xJOvHkyw== +"@jest/globals@^27.2.0": + version "27.2.0" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.2.0.tgz#4d7085f51df5ac70c8240eb3501289676503933d" + integrity sha512-raqk9Gf9WC3hlBa57rmRmJfRl9hom2b+qEE/ifheMtwn5USH5VZxzrHHOZg0Zsd/qC2WJ8UtyTwHKQAnNlDMdg== dependencies: - "@jest/environment" "^27.1.1" + "@jest/environment" "^27.2.0" "@jest/types" "^27.1.1" - expect "^27.1.1" + expect "^27.2.0" -"@jest/reporters@^27.1.1": - version "27.1.1" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.1.1.tgz#ee5724092f197bb78c60affb9c6f34b6777990c2" - integrity sha512-cEERs62n1P4Pqox9HWyNOEkP57G95aK2mBjB6D8Ruz1Yc98fKH53b58rlVEnsY5nLmkLNZk65fxNi9C0Yds/8w== +"@jest/reporters@^27.2.0": + version "27.2.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.2.0.tgz#629886d9a42218e504a424889a293abb27919e25" + integrity sha512-7wfkE3iRTLaT0F51h1mnxH3nQVwDCdbfgXiLuCcNkF1FnxXLH9utHqkSLIiwOTV1AtmiE0YagHbOvx4rnMP/GA== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.1.1" - "@jest/test-result" "^27.1.1" - "@jest/transform" "^27.1.1" + "@jest/console" "^27.2.0" + "@jest/test-result" "^27.2.0" + "@jest/transform" "^27.2.0" "@jest/types" "^27.1.1" chalk "^4.0.0" collect-v8-coverage "^1.0.0" @@ -444,10 +444,10 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^27.1.1" - jest-resolve "^27.1.1" - jest-util "^27.1.1" - jest-worker "^27.1.1" + jest-haste-map "^27.2.0" + jest-resolve "^27.2.0" + jest-util "^27.2.0" + jest-worker "^27.2.0" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" @@ -463,30 +463,30 @@ graceful-fs "^4.2.4" source-map "^0.6.0" -"@jest/test-result@^27.1.1": - version "27.1.1" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.1.1.tgz#1086b39af5040b932a55e7f1fa1bc4671bed4781" - integrity sha512-8vy75A0Jtfz9DqXFUkjC5Co/wRla+D7qRFdShUY8SbPqBS3GBx3tpba7sGKFos8mQrdbe39n+c1zgVKtarfy6A== +"@jest/test-result@^27.2.0": + version "27.2.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.2.0.tgz#377b46a41a6415dd4839fd0bed67b89fecea6b20" + integrity sha512-JPPqn8h0RGr4HyeY1Km+FivDIjTFzDROU46iAvzVjD42ooGwYoqYO/MQTilhfajdz6jpVnnphFrKZI5OYrBONA== dependencies: - "@jest/console" "^27.1.1" + "@jest/console" "^27.2.0" "@jest/types" "^27.1.1" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.1.1": - version "27.1.1" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.1.1.tgz#cea3722ec6f6330000240fd999ad3123adaf5992" - integrity sha512-l8zD3EdeixvwmLNlJoMX3hhj8iIze95okj4sqmBzOq/zW8gZLElUveH4bpKEMuR+Nweazjlwc7L6g4C26M/y6Q== +"@jest/test-sequencer@^27.2.0": + version "27.2.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.2.0.tgz#b02b507687825af2fdc84e90c539d36fd8cf7bc9" + integrity sha512-PrqarcpzOU1KSAK7aPwfL8nnpaqTMwPe7JBPnaOYRDSe/C6AoJiL5Kbnonqf1+DregxZIRAoDg69R9/DXMGqXA== dependencies: - "@jest/test-result" "^27.1.1" + "@jest/test-result" "^27.2.0" graceful-fs "^4.2.4" - jest-haste-map "^27.1.1" - jest-runtime "^27.1.1" + jest-haste-map "^27.2.0" + jest-runtime "^27.2.0" -"@jest/transform@^27.1.1": - version "27.1.1" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.1.1.tgz#51a22f5a48d55d796c02757117c02fcfe4da13d7" - integrity sha512-qM19Eu75U6Jc5zosXXVnq900Nl9JDpoGaZ4Mg6wZs7oqbu3heYSMOZS19DlwjlhWdfNRjF4UeAgkrCJCK3fEXg== +"@jest/transform@^27.2.0": + version "27.2.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.2.0.tgz#e7e6e49d2591792db2385c33cdbb4379d407068d" + integrity sha512-Q8Q/8xXIZYllk1AF7Ou5sV3egOZsdY/Wlv09CSbcexBRcC1Qt6lVZ7jRFAZtbHsEEzvOCyFEC4PcrwKwyjXtCg== dependencies: "@babel/core" "^7.1.0" "@jest/types" "^27.1.1" @@ -495,9 +495,9 @@ convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.1.1" + jest-haste-map "^27.2.0" jest-regex-util "^27.0.6" - jest-util "^27.1.1" + jest-util "^27.2.0" micromatch "^4.0.4" pirates "^4.0.1" slash "^3.0.0" @@ -761,16 +761,16 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= -babel-jest@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.1.1.tgz#9359c45995d0940b84d2176ab83423f9eed07617" - integrity sha512-JA+dzJl4n2RBvWQEnph6HJaTHrsIPiXGQYatt/D8nR4UpX9UG4GaDzykVVPQBbrdTebZREkRb6SOxyIXJRab6Q== +babel-jest@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.2.0.tgz#c0f129a81f1197028aeb4447acbc04564c8bfc52" + integrity sha512-bS2p+KGGVVmWXBa8+i6SO/xzpiz2Q/2LnqLbQknPKefWXVZ67YIjA4iXup/jMOEZplga9PpWn+wrdb3UdDwRaA== dependencies: - "@jest/transform" "^27.1.1" + "@jest/transform" "^27.2.0" "@jest/types" "^27.1.1" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.0.0" - babel-preset-jest "^27.0.6" + babel-preset-jest "^27.2.0" chalk "^4.0.0" graceful-fs "^4.2.4" slash "^3.0.0" @@ -786,10 +786,10 @@ babel-plugin-istanbul@^6.0.0: istanbul-lib-instrument "^4.0.0" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.0.6.tgz#f7c6b3d764af21cb4a2a1ab6870117dbde15b456" - integrity sha512-CewFeM9Vv2gM7Yr9n5eyyLVPRSiBnk6lKZRjgwYnGKSl9M14TMn2vkN02wTF04OGuSDLEzlWiMzvjXuW9mB6Gw== +babel-plugin-jest-hoist@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.2.0.tgz#79f37d43f7e5c4fdc4b2ca3e10cc6cf545626277" + integrity sha512-TOux9khNKdi64mW+0OIhcmbAn75tTlzKhxmiNXevQaPbrBYK7YKjP1jl6NHTJ6XR5UgUrJbCnWlKVnJn29dfjw== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -814,12 +814,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.0.6.tgz#909ef08e9f24a4679768be2f60a3df0856843f9d" - integrity sha512-WObA0/Biw2LrVVwZkF/2GqbOdzhKD6Fkdwhoy9ASIrOWr/zodcSpQh72JOkEn6NWyjmnPDjNSqaGN4KnpKzhXw== +babel-preset-jest@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.2.0.tgz#556bbbf340608fed5670ab0ea0c8ef2449fba885" + integrity sha512-z7MgQ3peBwN5L5aCqBKnF6iqdlvZvFUQynEhu0J+X9nHLU72jO3iY331lcYrg+AssJ8q7xsv5/3AICzVmJ/wvg== dependencies: - babel-plugin-jest-hoist "^27.0.6" + babel-plugin-jest-hoist "^27.2.0" babel-preset-current-node-syntax "^1.0.0" balanced-match@^1.0.0: @@ -1303,16 +1303,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.1.1.tgz#020215da67d41cd6ad805fa00bd030985ca7c093" - integrity sha512-JQAzp0CJoFFHF1RnOtrMUNMdsfx/Tl0+FhRzVl8q0fa23N+JyWdPXwb3T5rkHCvyo9uttnK7lVdKCBl1b/9EDw== +expect@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.2.0.tgz#40eb89a492afb726a3929ccf3611ee0799ab976f" + integrity sha512-oOTbawMQv7AK1FZURbPTgGSzmhxkjFzoARSvDjOMnOpeWuYQx1tP6rXu9MIX5mrACmyCAM7fSNP8IJO2f1p0CQ== dependencies: "@jest/types" "^27.1.1" ansi-styles "^5.0.0" jest-get-type "^27.0.6" - jest-matcher-utils "^27.1.1" - jest-message-util "^27.1.1" + jest-matcher-utils "^27.2.0" + jest-message-util "^27.2.0" jest-regex-util "^27.0.6" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: @@ -1687,85 +1687,85 @@ jest-changed-files@^27.1.1: execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.1.1.tgz#08dd3ec5cbaadce68ce6388ebccbe051d1b34bc6" - integrity sha512-Xed1ApiMFu/yzqGMBToHr8sp2gkX/ARZf4nXoGrHJrXrTUdVIWiVYheayfcOaPdQvQEE/uyBLgW7I7YBLIrAXQ== +jest-circus@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.2.0.tgz#ad0d6d75514050f539d422bae41344224d2328f9" + integrity sha512-WwENhaZwOARB1nmcboYPSv/PwHBUGRpA4MEgszjr9DLCl97MYw0qZprBwLb7rNzvMwfIvNGG7pefQ5rxyBlzIA== dependencies: - "@jest/environment" "^27.1.1" - "@jest/test-result" "^27.1.1" + "@jest/environment" "^27.2.0" + "@jest/test-result" "^27.2.0" "@jest/types" "^27.1.1" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" - expect "^27.1.1" + expect "^27.2.0" is-generator-fn "^2.0.0" - jest-each "^27.1.1" - jest-matcher-utils "^27.1.1" - jest-message-util "^27.1.1" - jest-runtime "^27.1.1" - jest-snapshot "^27.1.1" - jest-util "^27.1.1" - pretty-format "^27.1.1" + jest-each "^27.2.0" + jest-matcher-utils "^27.2.0" + jest-message-util "^27.2.0" + jest-runtime "^27.2.0" + jest-snapshot "^27.2.0" + jest-util "^27.2.0" + pretty-format "^27.2.0" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.1.1.tgz#6491a0278231ffee61083ad468809328e96a8eb2" - integrity sha512-LCjfEYp9D3bcOeVUUpEol9Y1ijZYMWVqflSmtw/wX+6Fb7zP4IlO14/6s9v1pxsoM4Pn46+M2zABgKuQjyDpTw== +jest-cli@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.2.0.tgz#6da5ecca5bd757e20449f5ec1f1cad5b0303d16b" + integrity sha512-bq1X/B/b1kT9y1zIFMEW3GFRX1HEhFybiqKdbxM+j11XMMYSbU9WezfyWIhrSOmPT+iODLATVjfsCnbQs7cfIA== dependencies: - "@jest/core" "^27.1.1" - "@jest/test-result" "^27.1.1" + "@jest/core" "^27.2.0" + "@jest/test-result" "^27.2.0" "@jest/types" "^27.1.1" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.1.1" - jest-util "^27.1.1" - jest-validate "^27.1.1" + jest-config "^27.2.0" + jest-util "^27.2.0" + jest-validate "^27.2.0" prompts "^2.0.1" yargs "^16.0.3" -jest-config@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.1.1.tgz#cde823ad27f7ec0b9440035eabc75d4ac1ea024c" - integrity sha512-2iSd5zoJV4MsWPcLCGwUVUY/j6pZXm4Qd3rnbCtrd9EHNTg458iHw8PZztPQXfxKBKJxLfBk7tbZqYF8MGtxJA== +jest-config@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.2.0.tgz#d1c359253927005c53d11ab3e50d3b2f402a673a" + integrity sha512-Z1romHpxeNwLxQtouQ4xt07bY6HSFGKTo0xJcvOK3u6uJHveA4LB2P+ty9ArBLpTh3AqqPxsyw9l9GMnWBYS9A== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.1.1" + "@jest/test-sequencer" "^27.2.0" "@jest/types" "^27.1.1" - babel-jest "^27.1.1" + babel-jest "^27.2.0" chalk "^4.0.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" is-ci "^3.0.0" - jest-circus "^27.1.1" - jest-environment-jsdom "^27.1.1" - jest-environment-node "^27.1.1" + jest-circus "^27.2.0" + jest-environment-jsdom "^27.2.0" + jest-environment-node "^27.2.0" jest-get-type "^27.0.6" - jest-jasmine2 "^27.1.1" + jest-jasmine2 "^27.2.0" jest-regex-util "^27.0.6" - jest-resolve "^27.1.1" - jest-runner "^27.1.1" - jest-util "^27.1.1" - jest-validate "^27.1.1" + jest-resolve "^27.2.0" + jest-runner "^27.2.0" + jest-util "^27.2.0" + jest-validate "^27.2.0" micromatch "^4.0.4" - pretty-format "^27.1.1" + pretty-format "^27.2.0" -jest-diff@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.1.1.tgz#1d1629ca2e3933b10cb27dc260e28e3dba182684" - integrity sha512-m/6n5158rqEriTazqHtBpOa2B/gGgXJijX6nsEgZfbJ/3pxQcdpVXBe+FP39b1dxWHyLVVmuVXddmAwtqFO4Lg== +jest-diff@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.2.0.tgz#bda761c360f751bab1e7a2fe2fc2b0a35ce8518c" + integrity sha512-QSO9WC6btFYWtRJ3Hac0sRrkspf7B01mGrrQEiCW6TobtViJ9RWL0EmOs/WnBsZDsI/Y2IoSHZA2x6offu0sYw== dependencies: chalk "^4.0.0" diff-sequences "^27.0.6" jest-get-type "^27.0.6" - pretty-format "^27.1.1" + pretty-format "^27.2.0" jest-docblock@^27.0.6: version "27.0.6" @@ -1774,51 +1774,51 @@ jest-docblock@^27.0.6: dependencies: detect-newline "^3.0.0" -jest-each@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.1.1.tgz#caa1e7eed77144be346eb18712885b990389348a" - integrity sha512-r6hOsTLavUBb1xN0uDa89jdDeBmJ+K49fWpbyxeGRA2pLY46PlC4z551/cWNQzrj+IUa5/gSRsCIV/01HdNPug== +jest-each@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.2.0.tgz#4c531c7223de289429fc7b2473a86e653c86d61f" + integrity sha512-biDmmUQjg+HZOB7MfY2RHSFL3j418nMoC3TK3pGAj880fQQSxvQe1y2Wy23JJJNUlk6YXiGU0yWy86Le1HBPmA== dependencies: "@jest/types" "^27.1.1" chalk "^4.0.0" jest-get-type "^27.0.6" - jest-util "^27.1.1" - pretty-format "^27.1.1" + jest-util "^27.2.0" + pretty-format "^27.2.0" -jest-environment-jsdom@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.1.1.tgz#e53e98a16e6a764b8ee8db3b29b3a8c27db06f66" - integrity sha512-6vOnoZ6IaExuw7FvnuJhA1qFYv1DDSnN0sQowzolNwxQp7bG1YhLxj2YU1sVXAYA3IR3MbH2mbnJUsLUWfyfzw== +jest-environment-jsdom@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.2.0.tgz#c654dfae50ca2272c2a2e2bb95ff0af298283a3c" + integrity sha512-wNQJi6Rd/AkUWqTc4gWhuTIFPo7tlMK0RPZXeM6AqRHZA3D3vwvTa9ktAktyVyWYmUoXdYstOfyYMG3w4jt7eA== dependencies: - "@jest/environment" "^27.1.1" - "@jest/fake-timers" "^27.1.1" + "@jest/environment" "^27.2.0" + "@jest/fake-timers" "^27.2.0" "@jest/types" "^27.1.1" "@types/node" "*" jest-mock "^27.1.1" - jest-util "^27.1.1" + jest-util "^27.2.0" jsdom "^16.6.0" -jest-environment-node@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.1.1.tgz#97425d4762b2aeab15892ffba08c6cbed7653e75" - integrity sha512-OEGeZh0PwzngNIYWYgWrvTcLygopV8OJbC9HNb0j70VBKgEIsdZkYhwcFnaURX83OHACMqf1pa9Tv5Pw5jemrg== +jest-environment-node@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.2.0.tgz#73ef2151cb62206669becb94cd84f33276252de5" + integrity sha512-WbW+vdM4u88iy6Q3ftUEQOSgMPtSgjm3qixYYK2AKEuqmFO2zmACTw1vFUB0qI/QN88X6hA6ZkVKIdIWWzz+yg== dependencies: - "@jest/environment" "^27.1.1" - "@jest/fake-timers" "^27.1.1" + "@jest/environment" "^27.2.0" + "@jest/fake-timers" "^27.2.0" "@jest/types" "^27.1.1" "@types/node" "*" jest-mock "^27.1.1" - jest-util "^27.1.1" + jest-util "^27.2.0" jest-get-type@^27.0.6: version "27.0.6" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.6.tgz#0eb5c7f755854279ce9b68a9f1a4122f69047cfe" integrity sha512-XTkK5exIeUbbveehcSR8w0bhH+c0yloW/Wpl+9vZrjzztCPWrxhHwkIFpZzCt71oRBsgxmuUfxEqOYoZI2macg== -jest-haste-map@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.1.1.tgz#f7c646b0e417ec29b80b96cf785b57b581384adf" - integrity sha512-NGLYVAdh5C8Ezg5QBFzrNeYsfxptDBPlhvZNaicLiZX77F/rS27a9M6u9ripWAaaD54xnWdZNZpEkdjD5Eo5aQ== +jest-haste-map@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.2.0.tgz#703b3a473e3f2e27d75ab07864ffd7bbaad0d75e" + integrity sha512-laFet7QkNlWjwZtMGHCucLvF8o9PAh2cgePRck1+uadSM4E4XH9J4gnx4do+a6do8ZV5XHNEAXEkIoNg5XUH2Q== dependencies: "@jest/types" "^27.1.1" "@types/graceful-fs" "^4.1.2" @@ -1828,59 +1828,59 @@ jest-haste-map@^27.1.1: graceful-fs "^4.2.4" jest-regex-util "^27.0.6" jest-serializer "^27.0.6" - jest-util "^27.1.1" - jest-worker "^27.1.1" + jest-util "^27.2.0" + jest-worker "^27.2.0" micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.1.1.tgz#efb9e7b70ce834c35c91e1a2f01bb41b462fad43" - integrity sha512-0LAzUmcmvQwjIdJt0cXUVX4G5qjVXE8ELt6nbMNDzv2yAs2hYCCUtQq+Eje70GwAysWCGcS64QeYj5VPHYVxPg== +jest-jasmine2@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.2.0.tgz#1ece0ee37c348b59ed3dfcfe509fc24e3377b12d" + integrity sha512-NcPzZBk6IkDW3Z2V8orGueheGJJYfT5P0zI/vTO/Jp+R9KluUdgFrgwfvZ0A34Kw6HKgiWFILZmh3oQ/eS+UxA== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^27.1.1" + "@jest/environment" "^27.2.0" "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.1.1" + "@jest/test-result" "^27.2.0" "@jest/types" "^27.1.1" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^27.1.1" + expect "^27.2.0" is-generator-fn "^2.0.0" - jest-each "^27.1.1" - jest-matcher-utils "^27.1.1" - jest-message-util "^27.1.1" - jest-runtime "^27.1.1" - jest-snapshot "^27.1.1" - jest-util "^27.1.1" - pretty-format "^27.1.1" + jest-each "^27.2.0" + jest-matcher-utils "^27.2.0" + jest-message-util "^27.2.0" + jest-runtime "^27.2.0" + jest-snapshot "^27.2.0" + jest-util "^27.2.0" + pretty-format "^27.2.0" throat "^6.0.1" -jest-leak-detector@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.1.1.tgz#8e05ec4b339814fc4202f07d875da65189e3d7d4" - integrity sha512-gwSgzmqShoeEsEVpgObymQPrM9P6557jt1EsFW5aCeJ46Cme0EdjYU7xr6llQZ5GpWDl56eOstUaPXiZOfiTKw== +jest-leak-detector@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.2.0.tgz#9a7ca2dad1a21c4e49ad2a8ad7f1214ffdb86a28" + integrity sha512-e91BIEmbZw5+MHkB4Hnrq7S86coTxUMCkz4n7DLmQYvl9pEKmRx9H/JFH87bBqbIU5B2Ju1soKxRWX6/eGFGpA== dependencies: jest-get-type "^27.0.6" - pretty-format "^27.1.1" + pretty-format "^27.2.0" -jest-matcher-utils@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.1.1.tgz#1f444d7491ccf9edca746336b056178789a59651" - integrity sha512-Q1a10w9Y4sh0wegkdP6reQOa/Dtz7nAvDqBgrat1ItZAUvk4jzXAqyhXPu/ZuEtDaXaNKpdRPRQA8bvkOh2Eaw== +jest-matcher-utils@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.2.0.tgz#b4d224ab88655d5fab64b96b989ac349e2f5da43" + integrity sha512-F+LG3iTwJ0gPjxBX6HCyrARFXq6jjiqhwBQeskkJQgSLeF1j6ui1RTV08SR7O51XTUhtc8zqpDj8iCG4RGmdKw== dependencies: chalk "^4.0.0" - jest-diff "^27.1.1" + jest-diff "^27.2.0" jest-get-type "^27.0.6" - pretty-format "^27.1.1" + pretty-format "^27.2.0" -jest-message-util@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.1.1.tgz#980110fb72fcfa711cd9a95e8f10d335207585c6" - integrity sha512-b697BOJV93+AVGvzLRtVZ0cTVRbd59OaWnbB2D75GRaIMc4I+Z9W0wHxbfjW01JWO+TqqW4yevT0aN7Fd0XWng== +jest-message-util@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.2.0.tgz#2f65c71df55267208686b1d7514e18106c91ceaf" + integrity sha512-y+sfT/94CiP8rKXgwCOzO1mUazIEdEhrLjuiu+RKmCP+8O/TJTSne9dqQRbFIHBtlR2+q7cddJlWGir8UATu5w== dependencies: "@babel/code-frame" "^7.12.13" "@jest/types" "^27.1.1" @@ -1888,7 +1888,7 @@ jest-message-util@^27.1.1: chalk "^4.0.0" graceful-fs "^4.2.4" micromatch "^4.0.4" - pretty-format "^27.1.1" + pretty-format "^27.2.0" slash "^3.0.0" stack-utils "^2.0.3" @@ -1910,40 +1910,40 @@ jest-regex-util@^27.0.6: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.6.tgz#02e112082935ae949ce5d13b2675db3d8c87d9c5" integrity sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ== -jest-resolve-dependencies@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.1.1.tgz#6f3e0916c1764dd1853c6111ed9d66c66c792e40" - integrity sha512-sYZR+uBjFDCo4VhYeazZf/T+ryYItvdLKu9vHatqkUqHGjDMrdEPOykiqC2iEpaCFTS+3iL/21CYiJuKdRbniw== +jest-resolve-dependencies@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.2.0.tgz#b56a1aab95b0fd21e0a69a15fda985c05f902b8a" + integrity sha512-EY5jc/Y0oxn+oVEEldTidmmdVoZaknKPyDORA012JUdqPyqPL+lNdRyI3pGti0RCydds6coaw6xt4JQY54dKsg== dependencies: "@jest/types" "^27.1.1" jest-regex-util "^27.0.6" - jest-snapshot "^27.1.1" + jest-snapshot "^27.2.0" -jest-resolve@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.1.1.tgz#3a86762f9affcad9697bc88140b0581b623add33" - integrity sha512-M41YFmWhvDVstwe7XuV21zynOiBLJB5Sk0GrIsYYgTkjfEWNLVXDjAyq1W7PHseaYNOxIc0nOGq/r5iwcZNC1A== +jest-resolve@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.2.0.tgz#f5d053693ab3806ec2f778e6df8b0aa4cfaef95f" + integrity sha512-v09p9Ib/VtpHM6Cz+i9lEAv1Z/M5NVxsyghRHRMEUOqwPQs3zwTdwp1xS3O/k5LocjKiGS0OTaJoBSpjbM2Jlw== dependencies: "@jest/types" "^27.1.1" chalk "^4.0.0" escalade "^3.1.1" graceful-fs "^4.2.4" - jest-haste-map "^27.1.1" + jest-haste-map "^27.2.0" jest-pnp-resolver "^1.2.2" - jest-util "^27.1.1" - jest-validate "^27.1.1" + jest-util "^27.2.0" + jest-validate "^27.2.0" resolve "^1.20.0" slash "^3.0.0" -jest-runner@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.1.1.tgz#1991fdf13a8fe6e49cef47332db33300649357cd" - integrity sha512-lP3MBNQhg75/sQtVkC8dsAQZumvy3lHK/YIwYPfEyqGIX1qEcnYIRxP89q0ZgC5ngvi1vN2P5UFHszQxguWdng== +jest-runner@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.2.0.tgz#281b255d88a473aebc0b5cb46e58a83a1251cab3" + integrity sha512-Cl+BHpduIc0cIVTjwoyx0pQk4Br8gn+wkr35PmKCmzEdOUnQ2wN7QVXA8vXnMQXSlFkN/+KWnk20TAVBmhgrww== dependencies: - "@jest/console" "^27.1.1" - "@jest/environment" "^27.1.1" - "@jest/test-result" "^27.1.1" - "@jest/transform" "^27.1.1" + "@jest/console" "^27.2.0" + "@jest/environment" "^27.2.0" + "@jest/test-result" "^27.2.0" + "@jest/transform" "^27.2.0" "@jest/types" "^27.1.1" "@types/node" "*" chalk "^4.0.0" @@ -1951,30 +1951,30 @@ jest-runner@^27.1.1: exit "^0.1.2" graceful-fs "^4.2.4" jest-docblock "^27.0.6" - jest-environment-jsdom "^27.1.1" - jest-environment-node "^27.1.1" - jest-haste-map "^27.1.1" - jest-leak-detector "^27.1.1" - jest-message-util "^27.1.1" - jest-resolve "^27.1.1" - jest-runtime "^27.1.1" - jest-util "^27.1.1" - jest-worker "^27.1.1" + jest-environment-jsdom "^27.2.0" + jest-environment-node "^27.2.0" + jest-haste-map "^27.2.0" + jest-leak-detector "^27.2.0" + jest-message-util "^27.2.0" + jest-resolve "^27.2.0" + jest-runtime "^27.2.0" + jest-util "^27.2.0" + jest-worker "^27.2.0" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.1.1.tgz#bd0a0958a11c2f7d94d2e5f6f71864ad1c65fe44" - integrity sha512-FEwy+tSzmsvuKaQpyYsUyk31KG5vMmA2r2BSTHgv0yNfcooQdm2Ke91LM9Ud8D3xz8CLDHJWAI24haMFTwrsPg== +jest-runtime@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.2.0.tgz#998295ccd80008b3031eeb5cc60e801e8551024b" + integrity sha512-6gRE9AVVX49hgBbWQ9PcNDeM4upMUXzTpBs0kmbrjyotyUyIJixLPsYjpeTFwAA07PVLDei1iAm2chmWycdGdQ== dependencies: - "@jest/console" "^27.1.1" - "@jest/environment" "^27.1.1" - "@jest/fake-timers" "^27.1.1" - "@jest/globals" "^27.1.1" + "@jest/console" "^27.2.0" + "@jest/environment" "^27.2.0" + "@jest/fake-timers" "^27.2.0" + "@jest/globals" "^27.2.0" "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.1.1" - "@jest/transform" "^27.1.1" + "@jest/test-result" "^27.2.0" + "@jest/transform" "^27.2.0" "@jest/types" "^27.1.1" "@types/yargs" "^16.0.0" chalk "^4.0.0" @@ -1984,14 +1984,14 @@ jest-runtime@^27.1.1: exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-haste-map "^27.1.1" - jest-message-util "^27.1.1" + jest-haste-map "^27.2.0" + jest-message-util "^27.2.0" jest-mock "^27.1.1" jest-regex-util "^27.0.6" - jest-resolve "^27.1.1" - jest-snapshot "^27.1.1" - jest-util "^27.1.1" - jest-validate "^27.1.1" + jest-resolve "^27.2.0" + jest-snapshot "^27.2.0" + jest-util "^27.2.0" + jest-validate "^27.2.0" slash "^3.0.0" strip-bom "^4.0.0" yargs "^16.0.3" @@ -2004,10 +2004,10 @@ jest-serializer@^27.0.6: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.1.1.tgz#3b816e0ca4352fbbd1db48dc692e3d9641d2531b" - integrity sha512-Wi3QGiuRFo3lU+EbQmZnBOks0CJyAMPHvYoG7iJk00Do10jeOyuOEO0Jfoaoun8+8TDv+Nzl7Aswir/IK9+1jg== +jest-snapshot@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.2.0.tgz#7961e7107ac666a46fbb23e7bb48ce0b8c6a9285" + integrity sha512-MukJvy3KEqemCT2FoT3Gum37CQqso/62PKTfIzWmZVTsLsuyxQmJd2PI5KPcBYFqLlA8LgZLHM8ZlazkVt8LsQ== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" @@ -2015,29 +2015,29 @@ jest-snapshot@^27.1.1: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/transform" "^27.1.1" + "@jest/transform" "^27.2.0" "@jest/types" "^27.1.1" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.1.1" + expect "^27.2.0" graceful-fs "^4.2.4" - jest-diff "^27.1.1" + jest-diff "^27.2.0" jest-get-type "^27.0.6" - jest-haste-map "^27.1.1" - jest-matcher-utils "^27.1.1" - jest-message-util "^27.1.1" - jest-resolve "^27.1.1" - jest-util "^27.1.1" + jest-haste-map "^27.2.0" + jest-matcher-utils "^27.2.0" + jest-message-util "^27.2.0" + jest-resolve "^27.2.0" + jest-util "^27.2.0" natural-compare "^1.4.0" - pretty-format "^27.1.1" + pretty-format "^27.2.0" semver "^7.3.2" -jest-util@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.1.1.tgz#2b06db1391d779ec2bd406ab3690ddc56ac728b9" - integrity sha512-zf9nEbrASWn2mC/L91nNb0K+GkhFvi4MP6XJG2HqnHzHvLYcs7ou/In68xYU1i1dSkJlrWcYfWXQE8nVR+nbOA== +jest-util@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.2.0.tgz#bfccb85cfafae752257319e825a5b8d4ada470dc" + integrity sha512-T5ZJCNeFpqcLBpx+Hl9r9KoxBCUqeWlJ1Htli+vryigZVJ1vuLB9j35grEBASp4R13KFkV7jM52bBGnArpJN6A== dependencies: "@jest/types" "^27.1.1" "@types/node" "*" @@ -2046,48 +2046,48 @@ jest-util@^27.1.1: is-ci "^3.0.0" picomatch "^2.2.3" -jest-validate@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.1.1.tgz#0783733af02c988d503995fc0a07bbdc58c7dd50" - integrity sha512-N5Er5FKav/8m2dJwn7BGnZwnoD1BSc8jx5T+diG2OvyeugvZDhPeAt5DrNaGkkaKCrSUvuE7A5E4uHyT7Vj0Mw== +jest-validate@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.2.0.tgz#b7535f12d95dd3b4382831f4047384ca098642ab" + integrity sha512-uIEZGkFKk3+4liA81Xu0maG5aGDyPLdp+4ed244c+Ql0k3aLWQYcMbaMLXOIFcb83LPHzYzqQ8hwNnIxTqfAGQ== dependencies: "@jest/types" "^27.1.1" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^27.0.6" leven "^3.1.0" - pretty-format "^27.1.1" + pretty-format "^27.2.0" -jest-watcher@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.1.1.tgz#a8147e18703b5d753ada4b287451f2daf40f4118" - integrity sha512-XQzyHbxziDe+lZM6Dzs40fEt4q9akOGwitJnxQasJ9WG0bv3JGiRlsBgjw13znGapeMtFaEsyhL0Cl04IbaoWQ== +jest-watcher@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.2.0.tgz#dc2eef4c13c6d41cebf3f1fc5f900a54b51c2ea0" + integrity sha512-SjRWhnr+qO8aBsrcnYIyF+qRxNZk6MZH8TIDgvi+VlsyrvOyqg0d+Rm/v9KHiTtC9mGGeFi9BFqgavyWib6xLg== dependencies: - "@jest/test-result" "^27.1.1" + "@jest/test-result" "^27.2.0" "@jest/types" "^27.1.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^27.1.1" + jest-util "^27.2.0" string-length "^4.0.1" -jest-worker@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.1.1.tgz#eb5f05c4657fdcb702c36c48b20d785bd4599378" - integrity sha512-XJKCL7tu+362IUYTWvw8+3S75U7qMiYiRU6u5yqscB48bTvzwN6i8L/7wVTXiFLwkRsxARNM7TISnTvcgv9hxA== +jest-worker@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.2.0.tgz#11eef39f1c88f41384ca235c2f48fe50bc229bc0" + integrity sha512-laB0ZVIBz+voh/QQy9dmUuuDsadixeerrKqyVpgPz+CCWiOYjOBabUXHIXZhsdvkWbLqSHbgkAHWl5cg24Q6RA== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^27.0.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.1.1.tgz#49f0497fa0fb07dc78898318cc1b737b5fbf72d8" - integrity sha512-LFTEZOhoZNR/2DQM3OCaK5xC6c55c1OWhYh0njRsoHX0qd6x4nkcgenkSH0JKjsAGMTmmJAoL7/oqYHMfwhruA== + version "27.2.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.2.0.tgz#3bc329287d699d26361e2094919630eefdf1ac0d" + integrity sha512-oUqVXyvh5YwEWl263KWdPUAqEzBFzGHdFLQ05hUnITr1tH+9SscEI9A/GH9eBClA+Nw1ct+KNuuOV6wlnmBPcg== dependencies: - "@jest/core" "^27.1.1" + "@jest/core" "^27.2.0" import-local "^3.0.2" - jest-cli "^27.1.1" + jest-cli "^27.2.0" js-tokens@^4.0.0: version "4.0.0" @@ -2464,10 +2464,10 @@ prettier@>=1.10: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.0.tgz#85bdfe0f70c3e777cf13a4ffff39713ca6f64cba" integrity sha512-DsEPLY1dE5HF3BxCRBmD4uYZ+5DCbvatnolqTqcxEgKVZnL2kUfyu7b8pPQ5+hTBkdhU9SLUmK0/pHb07RE4WQ== -pretty-format@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.1.1.tgz#cbaf9ec6cd7cfc3141478b6f6293c0ccdbe968e0" - integrity sha512-zdBi/xlstKJL42UH7goQti5Hip/B415w1Mfj+WWWYMBylAYtKESnXGUtVVcMVid9ReVjypCotUV6CEevYPHv2g== +pretty-format@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.2.0.tgz#ee37a94ce2a79765791a8649ae374d468c18ef19" + integrity sha512-KyJdmgBkMscLqo8A7K77omgLx5PWPiXJswtTtFV7XgVZv2+qPk6UivpXXO+5k6ZEbWIbLoKdx1pZ6ldINzbwTA== dependencies: "@jest/types" "^27.1.1" ansi-regex "^5.0.0" From f1619c3e68e9e40a432077bd1372d5798a188a6b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Sep 2021 12:01:31 +0000 Subject: [PATCH 219/785] Bump prettier from 2.4.0 to 2.4.1 Bumps [prettier](https://github.com/prettier/prettier) from 2.4.0 to 2.4.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.4.0...2.4.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 8461ef76..abb872d7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2460,9 +2460,9 @@ prelude-ls@~1.1.2: integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= prettier@>=1.10: - version "2.4.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.0.tgz#85bdfe0f70c3e777cf13a4ffff39713ca6f64cba" - integrity sha512-DsEPLY1dE5HF3BxCRBmD4uYZ+5DCbvatnolqTqcxEgKVZnL2kUfyu7b8pPQ5+hTBkdhU9SLUmK0/pHb07RE4WQ== + version "2.4.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c" + integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA== pretty-format@^27.2.0: version "27.2.0" From 93f260a9b11de86e240d378aa018c9c68740b4d4 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 16 Sep 2021 14:57:44 -0400 Subject: [PATCH 220/785] Introduce typescript --- package.json | 9 ++- tsconfig.json | 14 +++++ yarn.lock | 158 ++++++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 168 insertions(+), 13 deletions(-) create mode 100644 tsconfig.json diff --git a/package.json b/package.json index cb4366a6..5f160e7b 100644 --- a/package.json +++ b/package.json @@ -22,13 +22,20 @@ "prettier": ">=1.10" }, "devDependencies": { + "@types/jest": "^27.0.1", + "@types/node": "^16.9.1", + "@types/prettier": "^2.3.2", "eslint": "^7.22.0", "eslint-config-prettier": "^8.0.0", "husky": "^7.0.0", "jest": "^27.0.1", - "pretty-quick": "^3.1.0" + "pretty-quick": "^3.1.0", + "ts-jest": "^27.0.5", + "ts-node": "^10.2.1", + "typescript": "^4.4.3" }, "eslintConfig": { + "preset": "ts-jest", "extends": [ "eslint:recommended", "prettier" diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..9ad9f322 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "allowJs": true, + "esModuleInterop": true, + "module": "commonjs", + "moduleResolution": "node", + "outDir": "dist", + "sourceMap": false, + "strict": true, + "target": "es2019" + }, + "include": ["**/src/*"], + "exclude": ["**/test/*"] +} diff --git a/yarn.lock b/yarn.lock index abb872d7..4f559ac8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -301,6 +301,18 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@cspotcode/source-map-consumer@0.8.0": + version "0.8.0" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz#33bf4b7b39c178821606f669bbc447a6a629786b" + integrity sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg== + +"@cspotcode/source-map-support@0.6.1": + version "0.6.1" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.6.1.tgz#118511f316e2e87ee4294761868e254d3da47960" + integrity sha512-DX3Z+T5dt1ockmPdobJS/FAsQPW4V4SrWEhD2iYQT2Cb2tQsiMnYxrcUH9By/Z3B+v0S5LMBkQtV/XOBbpLEOg== + dependencies: + "@cspotcode/source-map-consumer" "0.8.0" + "@eslint/eslintrc@^0.4.3": version "0.4.3" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" @@ -534,6 +546,26 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== +"@tsconfig/node10@^1.0.7": + version "1.0.8" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9" + integrity sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg== + +"@tsconfig/node12@^1.0.7": + version "1.0.9" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.9.tgz#62c1f6dee2ebd9aead80dc3afa56810e58e1a04c" + integrity sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw== + +"@tsconfig/node14@^1.0.0": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.1.tgz#95f2d167ffb9b8d2068b0b235302fafd4df711f2" + integrity sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg== + +"@tsconfig/node16@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.2.tgz#423c77877d0569db20e1fc80885ac4118314010e" + integrity sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA== + "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": version "7.1.14" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.14.tgz#faaeefc4185ec71c389f4501ee5ec84b170cc402" @@ -593,6 +625,14 @@ dependencies: "@types/istanbul-lib-report" "*" +"@types/jest@^27.0.1": + version "27.0.1" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.0.1.tgz#fafcc997da0135865311bb1215ba16dba6bdf4ca" + integrity sha512-HTLpVXHrY69556ozYkcq47TtQJXpcWAWfkoqz+ZGz2JnmZhzlRjprCIyFnetSy8gpDWwTTGBcRVv1J1I1vBrHw== + dependencies: + jest-diff "^27.0.0" + pretty-format "^27.0.0" + "@types/minimatch@^3.0.3": version "3.0.4" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.4.tgz#f0ec25dbf2f0e4b18647313ac031134ca5b24b21" @@ -603,11 +643,21 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-15.6.1.tgz#32d43390d5c62c5b6ec486a9bc9c59544de39a08" integrity sha512-7EIraBEyRHEe7CH+Fm1XvgqU6uwZN8Q7jppJGcqjROMT29qhAuuOxYB1uEY5UMYQKEmA5D+5tBnhdaPXSsLONA== +"@types/node@^16.9.1": + version "16.9.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.9.1.tgz#0611b37db4246c937feef529ddcc018cf8e35708" + integrity sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g== + "@types/prettier@^2.1.5": version "2.2.3" resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.2.3.tgz#ef65165aea2924c9359205bf748865b8881753c0" integrity sha512-PijRCG/K3s3w1We6ynUKdxEc5AcuuH3NBmMDP8uvKVp6X43UY7NQlTzczakXP3DJR0F4dfNQIGjU2cUeRYs2AA== +"@types/prettier@^2.3.2": + version "2.3.2" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.3.2.tgz#fc8c2825e4ed2142473b4a81064e6e081463d1b3" + integrity sha512-eI5Yrz3Qv4KPUa/nSIAi0h+qX0XyewOliug5F2QAtuRg6Kjg6jfmxe1GIwoIRhZspD1A0RP8ANrPwvEXXtRFog== + "@types/stack-utils@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.0.tgz#7036640b4e21cc2f259ae826ce843d277dad8cff" @@ -648,6 +698,11 @@ acorn-walk@^7.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== +acorn-walk@^8.1.1: + version "8.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" + integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== + acorn@^7.1.1, acorn@^7.4.0: version "7.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" @@ -658,6 +713,11 @@ acorn@^8.2.4: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.2.4.tgz#caba24b08185c3b56e3168e97d15ed17f4d31fd0" integrity sha512-Ibt84YwBDDA890eDiDCEqcbwvHlBvzzDkU2cGBBDDI1QWT12jTiXIOn2CIw5KK4i6N5Z2HUxwYjzriDyqaqqZg== +acorn@^8.4.1: + version "8.5.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.5.0.tgz#4512ccb99b3698c752591e9bb4472e38ad43cee2" + integrity sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q== + agent-base@6: version "6.0.2" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" @@ -729,6 +789,11 @@ anymatch@^3.0.3: normalize-path "^3.0.0" picomatch "^2.0.4" +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -858,6 +923,13 @@ browserslist@^4.14.5: escalade "^3.1.1" node-releases "^1.1.71" +bs-logger@0.x: + version "0.2.6" + resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" + integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== + dependencies: + fast-json-stable-stringify "2.x" + bser@2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" @@ -997,6 +1069,11 @@ convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: dependencies: safe-buffer "~5.1.1" +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -1074,6 +1151,11 @@ diff-sequences@^27.0.6: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.0.6.tgz#3305cb2e55a033924054695cc66019fd7f8e5723" integrity sha512-ag6wfpBFyNXZ0p8pcuIDS//D8H062ZQJ3fzYxjpmeKjnz8W4pekL3AI8VohmyZmsWW2PWaHgjsmqR6L13101VQ== +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + doctrine@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" @@ -1320,7 +1402,7 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== -fast-json-stable-stringify@^2.0.0: +fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== @@ -1757,7 +1839,7 @@ jest-config@^27.2.0: micromatch "^4.0.4" pretty-format "^27.2.0" -jest-diff@^27.2.0: +jest-diff@^27.0.0, jest-diff@^27.2.0: version "27.2.0" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.2.0.tgz#bda761c360f751bab1e7a2fe2fc2b0a35ce8518c" integrity sha512-QSO9WC6btFYWtRJ3Hac0sRrkspf7B01mGrrQEiCW6TobtViJ9RWL0EmOs/WnBsZDsI/Y2IoSHZA2x6offu0sYw== @@ -2034,7 +2116,7 @@ jest-snapshot@^27.2.0: pretty-format "^27.2.0" semver "^7.3.2" -jest-util@^27.2.0: +jest-util@^27.0.0, jest-util@^27.2.0: version "27.2.0" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.2.0.tgz#bfccb85cfafae752257319e825a5b8d4ada470dc" integrity sha512-T5ZJCNeFpqcLBpx+Hl9r9KoxBCUqeWlJ1Htli+vryigZVJ1vuLB9j35grEBASp4R13KFkV7jM52bBGnArpJN6A== @@ -2155,7 +2237,7 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= -json5@^2.1.2: +json5@2.x, json5@^2.1.2: version "2.2.0" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== @@ -2210,7 +2292,7 @@ lodash.truncate@^4.4.2: resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= -lodash@^4.7.0: +lodash@4.x, lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -2229,6 +2311,11 @@ make-dir@^3.0.0: dependencies: semver "^6.0.0" +make-error@1.x, make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + makeerror@1.0.x: version "1.0.11" resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" @@ -2464,7 +2551,7 @@ prettier@>=1.10: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c" integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA== -pretty-format@^27.2.0: +pretty-format@^27.0.0, pretty-format@^27.2.0: version "27.2.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.2.0.tgz#ee37a94ce2a79765791a8649ae374d468c18ef19" integrity sha512-KyJdmgBkMscLqo8A7K77omgLx5PWPiXJswtTtFV7XgVZv2+qPk6UivpXXO+5k6ZEbWIbLoKdx1pZ6ldINzbwTA== @@ -2586,18 +2673,18 @@ saxes@^5.0.1: dependencies: xmlchars "^2.2.0" -semver@^6.0.0, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - -semver@^7.2.1, semver@^7.3.2: +semver@7.x, semver@^7.2.1, semver@^7.3.2: version "7.3.5" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== dependencies: lru-cache "^6.0.0" +semver@^6.0.0, semver@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -2814,6 +2901,38 @@ tr46@^2.0.2: dependencies: punycode "^2.1.1" +ts-jest@^27.0.5: + version "27.0.5" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.0.5.tgz#0b0604e2271167ec43c12a69770f0bb65ad1b750" + integrity sha512-lIJApzfTaSSbtlksfFNHkWOzLJuuSm4faFAfo5kvzOiRAuoN4/eKxVJ2zEAho8aecE04qX6K1pAzfH5QHL1/8w== + dependencies: + bs-logger "0.x" + fast-json-stable-stringify "2.x" + jest-util "^27.0.0" + json5 "2.x" + lodash "4.x" + make-error "1.x" + semver "7.x" + yargs-parser "20.x" + +ts-node@^10.2.1: + version "10.2.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.2.1.tgz#4cc93bea0a7aba2179497e65bb08ddfc198b3ab5" + integrity sha512-hCnyOyuGmD5wHleOQX6NIjJtYVIO8bPP8F2acWkB4W06wdlkgyvJtubO/I9NkI88hCFECbsEgoLc0VNkYmcSfw== + dependencies: + "@cspotcode/source-map-support" "0.6.1" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + yn "3.1.1" + type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" @@ -2850,6 +2969,11 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" +typescript@^4.4.3: + version "4.4.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.3.tgz#bdc5407caa2b109efd4f82fe130656f977a29324" + integrity sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA== + universalify@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" @@ -2989,6 +3113,11 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== +yargs-parser@20.x: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + yargs-parser@^20.2.2: version "20.2.7" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.7.tgz#61df85c113edfb5a7a4e36eb8aa60ef423cbc90a" @@ -3006,3 +3135,8 @@ yargs@^16.0.3: string-width "^4.2.0" y18n "^5.0.5" yargs-parser "^20.2.2" + +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== From 39c0920f2686f8416f6b3137d1c0858dc1b352b9 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 17 Sep 2021 13:42:09 -0400 Subject: [PATCH 221/785] Add the types for the various nodes --- src/ruby/nodes/types.ts | 212 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 212 insertions(+) create mode 100644 src/ruby/nodes/types.ts diff --git a/src/ruby/nodes/types.ts b/src/ruby/nodes/types.ts new file mode 100644 index 00000000..dd176bd6 --- /dev/null +++ b/src/ruby/nodes/types.ts @@ -0,0 +1,212 @@ +export namespace Ruby { + // These are utility types used to construct the various node types. + type ScannerEvent = { type: `@${T}`, body: string, comments?: Comment[] }; + type ParserEvent0 = ScannerEvent; + type ParserEvent = { type: T, sl: number, el: number, sc: number, ec: number, comments?: Comment[] } & V; + + // This is the main expression type that goes in places where the AST will + // accept just about anything. + type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgsForward | Array | Assign | BEGIN | Backref | Begin | Binary | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | Defsl | Dot2 | Dot3 | DynaSymbol | END | Fcall | Field | Float | For | GVar | Hash | Heredoc | IVar | Identifier | If | IfModifier | Ternary | Imaginary | Int | Keyword | Lambda | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsAddPost | MlhsAddStar | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Op | Opassign | Paren | Qsymbols | Qwords | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueModifier | Retry | Return | Return0 | Sclass | String | StringConcat | StringLiteral | Super | SymbolLiteral | Symbols | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VarAlias | VarField | VarRef | VCall | VoidStmt | While | WhileModifier | Words | XStringLiteral | Yield | Yield0 | Zsuper; + + // This is a special scanner event that contains a comment. It can be attached + // to almost any kind of node, which is why it's pulled out here separately. + export type Comment = { type: "@comment", value: string, inline: boolean }; + + // These are the scanner events that contain only a single string. They're + // always leaves in the tree. Ignored ones that can't show up in the tree but + // are present in ripper include: + // + // comma, embdoc, embdoc_beg, embdoc_end, embexpr_beg, embexpr_end, embvar, + // heredoc_end, ignored_nl, ignored_sp, label_end, lbracket, lparen, nl, + // qsymbols_beg, qwords_beg, rbrace, rbracket, regexp_beg, regexp_end, rparen, + // semicolon, sp, symbbeg, symbols_beg, tlambda, tlambeg, tstring_beg, + // tstring_nd, words_beg, words_sep + // + export type Backref = ScannerEvent<"backref">; + export type Backtick = ScannerEvent<"backtick">; + export type Char = ScannerEvent<"CHAR">; + export type Const = ScannerEvent<"const">; + export type CVar = ScannerEvent<"cvar">; + export type EndContent = ScannerEvent<"__end__">; + export type Float = ScannerEvent<"float">; + export type GVar = ScannerEvent<"gvar">; + export type HeredocBegin = ScannerEvent<"heredoc_beg">; + export type Identifier = ScannerEvent<"ident">; + export type Imaginary = ScannerEvent<"imaginary">; + export type Int = ScannerEvent<"int">; + export type IVar = ScannerEvent<"ivar">; + export type Keyword = ScannerEvent<"kw">; + export type Label = ScannerEvent<"label">; + export type Lbrace = ScannerEvent<"lbrace">; + export type Op = ScannerEvent<"op">; + export type Period = ScannerEvent<"period">; + export type Rational = ScannerEvent<"rational">; + export type TStringContent = ScannerEvent<"tstring_content">; + + // These are the parser events that don't receive any arguments. (In earlier + // versions of ripper they were scanner events, now they're parser events with + // arity 0.) Ignored ones that can't show up in the tree but are present in + // ripper include: + // + // args_new, mlhs_new, mrhs_new, qsymbols_new, qwords_new, regexp_new, + // stmts_new, string_content, symbols_new, word_new, words_new, xstring_new + // + export type ArgsForward = ParserEvent0<"args_forward">; + export type ExcessedComma = ParserEvent0<"excessed_comma">; + export type Redo = ParserEvent0<"redo">; + export type Retry = ParserEvent0<"retry">; + export type Return0 = ParserEvent0<"return0">; + export type VoidStmt = ParserEvent<"void_stmt">; + export type Yield0 = ParserEvent0<"yield0">; + export type Zsuper = ParserEvent0<"zsuper">; + + // Below are various parser events grouped by their relative functionality. + // The grouping is pretty loose, but it should convey a certain sense of the + // area of Ruby that it's related to. It does not include certain events that + // are present in ripper that we remove from tree before they get to this + // form, including: + // + // heredoc_dedent, magic_comment, nokw_param, symbol + // + + // These are various parser events that have to do with string or string-like + // nodes. + type StringContent = StringDVar | StringEmbExpr | TStringContent; + export type DynaSymbol = ParserEvent<"dyna_symbol", { body: StringContent[], quote: string }>; + export type Heredoc = ParserEvent<"heredoc", { beging: HeredocBegin, ending: string, body: StringContent[] }>; + export type RegexpLiteral = ParserEvent<"regexp_literal", { body: StringContent[], beging: string, ending: string }>; + export type String = ParserEvent<"string", { body: [TStringContent] }>; + export type StringConcat = ParserEvent<"string_concat", { body: [StringConcat | StringLiteral, StringLiteral] }>; + export type StringDVar = ParserEvent<"string_dvar", { body: [Backref | VarRef] }>; + export type StringEmbExpr = ParserEvent<"string_embexpr", { body: [Stmts] }>; + export type StringLiteral = ParserEvent<"string_literal", { body: StringContent[], quote: string }>; + export type SymbolLiteral = ParserEvent<"symbol_literal", { body: [Backtick | Const | CVar | GVar | Identifier | IVar | Keyword | Op] }>; + export type XStringLiteral = ParserEvent<"xstring_literal", { body: StringContent[] }>; + + // These are various parser events that have to do with arrays. + export type Array = ParserEvent<"array", { body: [null | Args | ArgsAddStar | Qsymbols | Qwords | Symbols | Words] }>; + export type Qsymbols = ParserEvent<"qsymbols", { body: TStringContent[] }>; + export type Qwords = ParserEvent<"qwords", { body: TStringContent[] }>; + export type Symbols = ParserEvent<"symbols", { body: Word[] }>; + export type Word = ParserEvent<"word", { body: StringContent[] }>; + export type Words = ParserEvent<"words", { body: Word[] }>; + + // These are various parser events that have to do with hashes. + type HashContent = AssocNew | AssocSplat; + export type AssocNew = ParserEvent<"assoc_new", { body: [AnyNode, AnyNode] }>; + export type AssocSplat = ParserEvent<"assoc_splat", { body: [AnyNode] }>; + export type AssoclistFromArgs = ParserEvent<"assoclist_from_args", { body: HashContent[] }>; + export type BareAssocHash = ParserEvent<"bare_assoc_hash", { body: HashContent[] }>; + export type Hash = ParserEvent<"hash", { body: [null | AssoclistFromArgs] }>; + + // These are various parser events for assignment. + type Assignable = ArefField | ConstPathField | Field | TopConstField | VarField; + export type ArefField = ParserEvent<"aref_field", { body: [AnyNode, ArgsAddBlock | null] }>; + export type Assign = ParserEvent<"assign", { body: [Assignable, AnyNode] }>; + export type ConstPathField = ParserEvent<"const_path_field", { body: [ConstPathRef | Paren | TopConstRef | VarRef, Const] }>; + export type Field = ParserEvent<"field", { body: [AnyNode, CallOperator, Const | Identifier] }>; + export type Opassign = ParserEvent<"opassign", { body: [Assignable, Op, AnyNode] }>; + export type TopConstField = ParserEvent<"top_const_field", { body: [Const] }>; + export type VarField = ParserEvent<"var_field", { body: [null | Const | CVar | GVar | Identifier | IVar] }>; + + // These are various parser events that have to do with multiple assignment. + export type Massign = ParserEvent<"massign", { body: [Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen, AnyNode] }>; + export type Mlhs = ParserEvent<"mlhs", { body: (ArefField | Field | Identifier | MlhsParen | VarField)[], comma: undefined | true }>; + export type MlhsAddPost = ParserEvent<"mlhs_add_post", { body: [MlhsAddStar, Mlhs] }>; + export type MlhsAddStar = ParserEvent<"mlhs_add_star", { body: [Mlhs, null | ArefField | Field | Identifier | VarField] }>; + export type MlhsParen = ParserEvent<"mlhs_paren", { body: [Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen] }>; + export type Mrhs = ParserEvent<"mrhs", { body: [] }>; + export type MrhsAddStar = ParserEvent<"mrhs_add_star", { body: [Mrhs | MrhsNewFromArgs, AnyNode] }>; + export type MrhsNewFromArgs = ParserEvent<"mrhs_new_from_args", { body: [Args | ArgsAddStar, AnyNode], oper: string }>; + + // These are various parser events for control flow constructs. + export type Case = ParserEvent<"case", { body: [AnyNode, In | When] }>; + export type Else = ParserEvent<"else", { body: [Stmts] }>; + export type Elsif = ParserEvent<"elsif", { body: [AnyNode, Stmts, null | Elsif | Else] }>; + export type Ensure = ParserEvent<"ensure", { body: [Keyword, Stmts] }>; + export type For = ParserEvent<"for", { body: [Mlhs | MlhsAddStar | VarField, AnyNode, Stmts] }>; + export type If = ParserEvent<"if", { body: [AnyNode, Stmts, null | Elsif | Else] }>; + export type IfModifier = ParserEvent<"if_mod", { body: [AnyNode, AnyNode] }>; + export type In = ParserEvent<"in", { body: [AnyNode, Stmts, null | In | Else] }>; + export type Rescue = ParserEvent<"rescue", { body: [null | RescueEx, Stmts, null | Stmts] }>; + export type RescueEx = ParserEvent<"rescue_ex", { body: [AnyNode, null | Field | VarField] }>; + export type RescueModifier = ParserEvent<"rescue_mod", { body: [AnyNode, AnyNode] }>; + export type Ternary = ParserEvent<"ifop", { body: [AnyNode, AnyNode, AnyNode] }>; + export type Unless = ParserEvent<"unless", { body: [AnyNode, Stmts, null | Elsif | Else] }>; + export type UnlessModifier = ParserEvent<"unless_mod", { body: [AnyNode, AnyNode] }>; + export type Until = ParserEvent<"until", { body: [AnyNode, Stmts] }>; + export type UntilModifier = ParserEvent<"until_mod", { body: [AnyNode, AnyNode] }>; + export type When = ParserEvent<"when", { body: [Args | ArgsAddStar, Stmts, null | Else | When] }>; + export type While = ParserEvent<"while", { body: [AnyNode, Stmts] }>; + export type WhileModifier = ParserEvent<"while_mod", { body: [AnyNode, AnyNode] }>; + + // These are various parser events for control flow keywords. + export type Break = ParserEvent<"break", { body: [Args | ArgsAddBlock] }>; + export type Next = ParserEvent<"next", { body: [Args | ArgsAddBlock] }>; + export type Return = ParserEvent<"return", { body: [Args | ArgsAddBlock] }>; + export type Super = ParserEvent<"super", { body: [Args | ArgParen | ArgsAddBlock] }>; + export type Yield = ParserEvent<"yield", { body: [ArgsAddBlock | Paren] }>; + + // These are various parser events for pattern matching. + export type Aryptn = ParserEvent<"aryptn", { body: [null | VarRef, AnyNode[], null | VarField, null | AnyNode[]] }>; + export type FndPtn = ParserEvent<"fndptn", { body: [null | AnyNode, AnyNode[], Stmts, null | AnyNode[]] }>; + export type Hshptn = ParserEvent<"hshptn", { body: [null | AnyNode, [Label, AnyNode][] | Stmts, null | VarField] }>; + export type Rassign = ParserEvent<"rassign", { body: [AnyNode, AnyNode], keyword: boolean }>; + + // These are various parser events for method declarations. + export type Blockarg = ParserEvent<"blockarg", { body: [Identifier] }>; + export type Def = ParserEvent<"def", { body: [Backtick | Const | Identifier | Keyword | Op, Params | Paren, Bodystmt] }>; + export type Defs = ParserEvent<"defs", { body: [AnyNode, Op | Period, Const | Op | Identifier | Keyword, Params | Paren, Bodystmt] }>; + export type Defsl = ParserEvent<"defsl", { body: [Identifier, null | Paren, AnyNode] }>; + export type KeywordRestParam = ParserEvent<"kwrest_param", { body: [null | Identifier] }>; + export type Params = ParserEvent<"params", { body: [Identifier[], null | [Identifier, AnyNode][], null | ArgsForward | RestParam, Identifier[], null | [Label, AnyNode][], null | "nil" | KeywordRestParam, null | Blockarg] }>; + export type RestParam = ParserEvent<"rest_param", { body: [null | Identifier] }>; + + // These are various parser events for method calls. + type CallOperator = Op | Period | "::"; + export type ArgParen = ParserEvent<"arg_paren", { body: [Args | ArgsAddBlock | ArgsForward | null] }>; + export type Args = ParserEvent<"args", { body: AnyNode[] }>; + export type ArgsAddBlock = ParserEvent<"args_add_block", { body: [Args | ArgsAddStar, false | AnyNode] }>; + export type ArgsAddStar = ParserEvent<"args_add_star", { body: [Args | ArgsAddStar, ...AnyNode[]] }>; + export type BlockVar = ParserEvent<"block_var", { body: [Params, false | Identifier[]] }>; + export type BraceBlock = ParserEvent<"brace_block", { body: [null | BlockVar, Stmts] }>; + export type Call = ParserEvent<"call", { body: [AnyNode, CallOperator, Backtick | Op | Identifier | Const | "call"] }>; + export type Command = ParserEvent<"command", { body: [Const | Identifier, Args | ArgsAddBlock] }>; + export type CommandCall = ParserEvent<"command_call", { body: [AnyNode, CallOperator, Op | Identifier | Const, Args | ArgsAddBlock] }>; + export type DoBlock = ParserEvent<"do_block", { body: [null | BlockVar, Bodystmt] }>; + export type Fcall = ParserEvent<"fcall", { body: [Const | Identifier] }>; + export type MethodAddArg = ParserEvent<"method_add_arg", { body: [Call | Fcall, Args | ArgParen | ArgsAddBlock] }>; + export type MethodAddBlock = ParserEvent<"method_add_block", { body: [AnyNode, BraceBlock | DoBlock] }>; + export type VCall = ParserEvent<"vcall", { body: [Identifier] }>; + + // These are various parser events for statements you would find in a method body. + export type Aref = ParserEvent<"aref", { body: [AnyNode, Args | ArgsAddBlock | null] }>; + export type BEGIN = ParserEvent<"BEGIN", { body: [Lbrace, Stmts] }>; + export type Binary = ParserEvent<"binary", { body: [AnyNode, string, AnyNode] }>; + export type ConstPathRef = ParserEvent<"const_path_ref", { body: [AnyNode, Const] }>; + export type ConstRef = ParserEvent<"const_ref", { body: [Const] }>; + export type Defined = ParserEvent<"defined", { body: [AnyNode] }>; + export type Dot2 = ParserEvent<"dot2", { body: [AnyNode, null] | [null, AnyNode] | [AnyNode, AnyNode] }>; + export type Dot3 = ParserEvent<"dot3", { body: [AnyNode, null] | [null, AnyNode] | [AnyNode, AnyNode] }>; + export type END = ParserEvent<"END", { body: [Lbrace, Stmts] }>; + export type Lambda = ParserEvent<"lambda", { body: [Params | Paren, Bodystmt | Stmts] }>; + export type Paren = ParserEvent<"paren", { body: [AnyNode] }>; + export type TopConstRef = ParserEvent<"top_const_ref", { body: [Const] }>; + export type Unary = ParserEvent<"unary", { body: AnyNode, oper: string, paren: boolean | undefined }>; + export type VarRef = ParserEvent<"var_ref", { body: [Const | CVar | GVar | Identifier | IVar | Keyword] }>; + + // These are various parser events for statements you would find in a class definition body. + export type AccessCtrl = ParserEvent<"access_ctrl", { body: [Identifier] }>; + export type Alias = ParserEvent<"alias", { body: [DynaSymbol | SymbolLiteral, DynaSymbol | SymbolLiteral] }>; + export type Class = ParserEvent<"class", { body: [ConstPathRef | ConstRef | TopConstRef, null | AnyNode, Bodystmt] }>; + export type Module = ParserEvent<"module", { body: [ConstPathRef | ConstRef | TopConstRef, Bodystmt] }>; + export type Sclass = ParserEvent<"sclass", { body: [AnyNode, Bodystmt] }>; + export type VarAlias = ParserEvent<"var_alias", { body: [GVar, Backref | GVar] }>; + export type Undef = ParserEvent<"undef", { body: (DynaSymbol | SymbolLiteral)[] }>; + + // These are various parser events for statement containers, generally pretty high in the tree. + export type Begin = ParserEvent<"begin", { body: [Bodystmt] }>; + export type Bodystmt = ParserEvent<"bodystmt", { body: [Stmts, null | Rescue, null | Stmts, null | Ensure] }>; + export type Program = ParserEvent<"program", { body: [Stmts] }>; + export type Stmts = ParserEvent<"stmts", { body: AnyNode[] }>; +} From d520b72455fb0fc1d50914a07f31380c2f6d8ec6 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 17 Sep 2021 14:44:04 -0400 Subject: [PATCH 222/785] Convert node printers over to using types --- package.json | 2 +- src/ruby/nodes/{alias.js => alias.ts} | 54 ++++--- src/ruby/nodes/{aref.js => aref.ts} | 10 +- src/ruby/nodes/{args.js => args.ts} | 48 +++--- src/ruby/nodes/{arrays.js => arrays.ts} | 58 +++---- src/ruby/nodes/{assign.js => assign.ts} | 18 ++- src/ruby/nodes/{blocks.js => blocks.ts} | 8 +- src/ruby/nodes/{calls.js => calls.ts} | 40 +++-- src/ruby/nodes/{case.js => case.ts} | 23 +-- src/ruby/nodes/{class.js => class.ts} | 14 +- src/ruby/nodes/{commands.js => commands.ts} | 25 +-- .../{conditionals.js => conditionals.ts} | 112 +++++++------ src/ruby/nodes/{constants.js => constants.ts} | 22 +-- src/ruby/nodes/flow.js | 74 --------- src/ruby/nodes/flow.ts | 85 ++++++++++ src/ruby/nodes/{hashes.js => hashes.ts} | 39 +++-- src/ruby/nodes/{heredocs.js => heredocs.ts} | 6 +- src/ruby/nodes/{hooks.js => hooks.ts} | 4 +- src/ruby/nodes/{ints.js => ints.ts} | 8 +- src/ruby/nodes/{lambdas.js => lambdas.ts} | 8 +- src/ruby/nodes/{loops.js => loops.ts} | 8 +- src/ruby/nodes/{massign.js => massign.ts} | 48 +++--- src/ruby/nodes/{methods.js => methods.ts} | 16 +- src/ruby/nodes/{operators.js => operators.ts} | 18 ++- src/ruby/nodes/{params.js => params.ts} | 12 +- src/ruby/nodes/{patterns.js => patterns.ts} | 32 ++-- src/ruby/nodes/{regexp.js => regexp.ts} | 14 +- src/ruby/nodes/{rescue.js => rescue.ts} | 25 +-- src/ruby/nodes/{return.js => return.ts} | 18 ++- src/ruby/nodes/statements.js | 142 ---------------- src/ruby/nodes/statements.ts | 153 ++++++++++++++++++ src/ruby/nodes/{strings.js => strings.ts} | 67 ++++---- src/ruby/nodes/{super.js => super.ts} | 6 +- src/ruby/nodes/types.ts | 65 ++++++-- src/ruby/nodes/{undef.js => undef.ts} | 10 +- 35 files changed, 729 insertions(+), 563 deletions(-) rename src/ruby/nodes/{alias.js => alias.ts} (55%) rename src/ruby/nodes/{aref.js => aref.ts} (89%) rename src/ruby/nodes/{args.js => args.ts} (81%) rename src/ruby/nodes/{arrays.js => arrays.ts} (85%) rename src/ruby/nodes/{assign.js => assign.ts} (75%) rename src/ruby/nodes/{blocks.js => blocks.ts} (92%) rename src/ruby/nodes/{calls.js => calls.ts} (88%) rename src/ruby/nodes/{case.js => case.ts} (71%) rename src/ruby/nodes/{class.js => class.ts} (84%) rename src/ruby/nodes/{commands.js => commands.ts} (79%) rename src/ruby/nodes/{conditionals.js => conditionals.ts} (76%) rename src/ruby/nodes/{constants.js => constants.ts} (61%) delete mode 100644 src/ruby/nodes/flow.js create mode 100644 src/ruby/nodes/flow.ts rename src/ruby/nodes/{hashes.js => hashes.ts} (77%) rename src/ruby/nodes/{heredocs.js => heredocs.ts} (90%) rename src/ruby/nodes/{hooks.js => hooks.ts} (87%) rename src/ruby/nodes/{ints.js => ints.ts} (87%) rename src/ruby/nodes/{lambdas.js => lambdas.ts} (91%) rename src/ruby/nodes/{loops.js => loops.ts} (91%) rename src/ruby/nodes/{massign.js => massign.ts} (57%) rename src/ruby/nodes/{methods.js => methods.ts} (81%) rename src/ruby/nodes/{operators.js => operators.ts} (85%) rename src/ruby/nodes/{params.js => params.ts} (88%) rename src/ruby/nodes/{patterns.js => patterns.ts} (82%) rename src/ruby/nodes/{regexp.js => regexp.ts} (81%) rename src/ruby/nodes/{rescue.js => rescue.ts} (79%) rename src/ruby/nodes/{return.js => return.ts} (81%) delete mode 100644 src/ruby/nodes/statements.js create mode 100644 src/ruby/nodes/statements.ts rename src/ruby/nodes/{strings.js => strings.ts} (81%) rename src/ruby/nodes/{super.js => super.ts} (87%) rename src/ruby/nodes/{undef.js => undef.ts} (78%) diff --git a/package.json b/package.json index 5f160e7b..05aa9fdb 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,6 @@ "typescript": "^4.4.3" }, "eslintConfig": { - "preset": "ts-jest", "extends": [ "eslint:recommended", "prettier" @@ -58,6 +57,7 @@ "jest": { "globalSetup": "./test/js/globalSetup.js", "globalTeardown": "./test/js/globalTeardown.js", + "preset": "ts-jest", "setupFilesAfterEnv": [ "./test/js/setupTests.js" ], diff --git a/src/ruby/nodes/alias.js b/src/ruby/nodes/alias.ts similarity index 55% rename from src/ruby/nodes/alias.js rename to src/ruby/nodes/alias.ts index e93afc1f..87d93254 100644 --- a/src/ruby/nodes/alias.js +++ b/src/ruby/nodes/alias.ts @@ -1,3 +1,5 @@ +import type { Plugin, Ruby } from "./types"; + const { addTrailingComment, align, @@ -7,28 +9,6 @@ const { line } = require("../../prettier"); -// In general, return the printed doc of the argument at the provided index. -// Special handling is given for symbol literals that are not bare words, as we -// convert those into bare words by just pulling out the ident node. -function printAliasArgument(path, print, argIndex) { - const node = path.getValue().body[argIndex]; - - if (node.type === "symbol_literal") { - // If we're going to descend into the symbol literal to grab out the ident - // node, then we need to make sure we copy over any comments as well, - // otherwise we could accidentally skip printing them. - if (node.comments) { - node.comments.forEach((comment) => { - addTrailingComment(node.body[0], comment); - }); - } - - return path.call(print, "body", argIndex, "body", 0); - } - - return path.call(print, "body", argIndex); -} - // The `alias` keyword is used to make a method respond to another name as well // as the current one. For example, to get the method `foo` to also respond to // `bar`, you would: @@ -48,24 +28,46 @@ function printAliasArgument(path, print, argIndex) { // The `alias` node contains two children. The left and right align with the // arguments passed to the keyword. So, for the above example the left would be // the symbol literal `bar` and the right could be the symbol literal `foo`. -function printAlias(path, opts, print) { +const printAlias: Plugin.Printer = (path, opts, print) => { const keyword = "alias "; + // In general, return the printed doc of the argument at the provided index. + // Special handling is given for symbol literals that are not bare words, as + // we convert those into bare words by just pulling out the ident node. + const printAliasArg = (argPath: Plugin.Path) => { + const argNode = argPath.getValue(); + + if (argNode.type === "symbol_literal") { + // If we're going to descend into the symbol literal to grab out the ident + // node, then we need to make sure we copy over any comments as well, + // otherwise we could accidentally skip printing them. + if (argNode.comments) { + argNode.comments.forEach((comment) => { + addTrailingComment(argNode.body[0], comment); + }); + } + + return argPath.call(print, "body", 0); + } + + return print(argPath); + }; + const rightSide = concat([ // If the left child has any comments, then we need to explicitly break this // into two lines path.getValue().body[0].comments ? hardline : line, - printAliasArgument(path, print, 1) + path.call(printAliasArg, "body", 1) ]); return group( concat([ keyword, - printAliasArgument(path, print, 0), + path.call(printAliasArg, "body", 0), group(align(keyword.length, rightSide)) ]) ); -} +}; module.exports = { alias: printAlias, diff --git a/src/ruby/nodes/aref.js b/src/ruby/nodes/aref.ts similarity index 89% rename from src/ruby/nodes/aref.js rename to src/ruby/nodes/aref.ts index cc3f5fce..dc30c41d 100644 --- a/src/ruby/nodes/aref.js +++ b/src/ruby/nodes/aref.ts @@ -1,3 +1,5 @@ +import type { Plugin, Ruby } from "./types"; + const { concat, group, @@ -19,7 +21,7 @@ const { // // foo[] // -function printAref(path, opts, print) { +const printAref: Plugin.Printer = (path, opts, print) => { const indexNode = path.getValue().body[1]; if (!indexNode) { @@ -27,7 +29,7 @@ function printAref(path, opts, print) { } return printArefField(path, opts, print); -} +}; // `aref_field` nodes are for assigning values into collections at specific // indices. Put another way, it's any time you're calling the method `#[]=`. @@ -43,7 +45,7 @@ function printAref(path, opts, print) { // // foo[bar] = baz // -function printArefField(path, opts, print) { +const printArefField: Plugin.Printer = (path, opts, print) => { const [printedArray, printedIndex] = path.map(print, "body"); return group( @@ -54,7 +56,7 @@ function printArefField(path, opts, print) { concat([softline, "]"]) ]) ); -} +}; module.exports = { aref: printAref, diff --git a/src/ruby/nodes/args.js b/src/ruby/nodes/args.ts similarity index 81% rename from src/ruby/nodes/args.js rename to src/ruby/nodes/args.ts index 14aa964d..06ffe43f 100644 --- a/src/ruby/nodes/args.js +++ b/src/ruby/nodes/args.ts @@ -1,3 +1,6 @@ +import type * as Prettier from "prettier"; +import type { Plugin, Ruby } from "./types"; + const { concat, group, @@ -12,7 +15,7 @@ const toProc = require("../toProc"); const noTrailingComma = ["command", "command_call"]; -function getArgParenTrailingComma(node) { +function getArgParenTrailingComma(node: Ruby.Args | Ruby.ArgsAddBlock) { // If we have a block, then we don't want to add a trailing comma. if (node.type === "args_add_block" && node.body[1]) { return ""; @@ -28,7 +31,7 @@ function getArgParenTrailingComma(node) { return ifBreak(",", ""); } -function printArgParen(path, opts, print) { +const printArgParen: Plugin.Printer = (path, opts, print) => { const argsNode = path.getValue().body[0]; if (argsNode === null) { @@ -65,9 +68,9 @@ function printArgParen(path, opts, print) { ")" ]) ); -} +}; -function printArgs(path, { rubyToProc }, print) { +const printArgs: Plugin.Printer = (path, { rubyToProc }, print) => { const args = path.map(print, "body"); // Don't bother trying to do any kind of fancy toProc transform if the @@ -104,16 +107,16 @@ function printArgs(path, { rubyToProc }, print) { } return args; -} +}; -function printArgsAddBlock(path, opts, print) { +const printArgsAddBlock: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); const blockNode = node.body[1]; - const parts = path.call(print, "body", 0); + const parts = path.call(print, "body", 0) as Plugin.Doc[]; if (blockNode) { - let blockDoc = path.call(print, "body", 1); + let blockDoc = path.call(print, "body", 1) as Plugin.Doc[]; if (!(blockNode.comments || []).some(({ leading }) => leading)) { // If we don't have any leading comments, we can just prepend the @@ -141,21 +144,22 @@ function printArgsAddBlock(path, opts, print) { // In prettier < 2.3.0, the comments are printed as part of a concat, so // we can reflect on how many leading comments there are to determine // which doc node we should modify. - const index = blockNode.comments.filter(({ leading }) => leading).length; - blockDoc.parts[index] = concat(["&", blockDoc.parts[index]]); + const index = blockNode.comments!.filter(({ leading }) => leading).length; + const cBlockDoc = blockDoc as any as Prettier.doc.builders.Concat; + cBlockDoc.parts[index] = concat(["&", cBlockDoc.parts[index]]); } parts.push(blockDoc); } return parts; -} +}; -function printArgsAddStar(path, opts, print) { - let docs = []; +const printArgsAddStar: Plugin.Printer = (path, opts, print) => { + let docs: Plugin.Doc[] = []; path.each((argPath, argIndex) => { - const doc = print(argPath); + const doc = print(argPath) as Plugin.Doc[]; // If it's the first child, then it's an array of args, so we're going to // concat that onto the existing docs if there are any. @@ -174,7 +178,7 @@ function printArgsAddStar(path, opts, print) { } // If we don't have any leading comments, we can just prepend the operator. - const argsNode = argPath.getValue(); + const argsNode = argPath.getValue() as Ruby.AnyNode; if (!(argsNode.comments || []).some(({ leading }) => leading)) { docs.push(concat(["*", doc])); return; @@ -201,17 +205,19 @@ function printArgsAddStar(path, opts, print) { // In prettier < 2.3.0, the comments are printed as part of a concat, so // we can reflect on how many leading comments there are to determine which // doc node we should modify. - const index = argsNode.comments.filter(({ leading }) => leading).length; - doc.parts[index] = concat(["*", doc.parts[index]]); - docs = docs.concat(doc); + const index = argsNode.comments!.filter(({ leading }) => leading).length; + const cDoc = doc as any as Prettier.doc.builders.Concat; + + cDoc.parts[index] = concat(["*", cDoc.parts[index]]); + docs = docs.concat(cDoc); }, "body"); return docs; -} +}; -function printBlockArg(path, opts, print) { +const printBlockArg: Plugin.Printer = (path, opts, print) => { return concat(["&", path.call(print, "body", 0)]); -} +}; module.exports = { arg_paren: printArgParen, diff --git a/src/ruby/nodes/arrays.js b/src/ruby/nodes/arrays.ts similarity index 85% rename from src/ruby/nodes/arrays.js rename to src/ruby/nodes/arrays.ts index 3a5c5587..f60b2533 100644 --- a/src/ruby/nodes/arrays.js +++ b/src/ruby/nodes/arrays.ts @@ -1,3 +1,5 @@ +import type { Plugin, Ruby } from "./types"; + const { concat, group, @@ -15,7 +17,7 @@ const { getTrailingComma, printEmptyCollection } = require("../../utils"); // // ['a', 'b', 'c'] // -function isStringArray(args) { +function isStringArray(args: Ruby.Args | Ruby.ArgsAddStar) { return ( args.body.length > 1 && args.body.every((arg) => { @@ -53,7 +55,7 @@ function isStringArray(args) { // // [:a, :b, :c] // -function isSymbolArray(args) { +function isSymbolArray(args: Ruby.Args | Ruby.ArgsAddStar) { return ( args.body.length > 1 && args.body.every((arg) => arg.type === "symbol_literal" && !arg.comments) @@ -63,14 +65,14 @@ function isSymbolArray(args) { // Prints out a word that is a part of a special array literal that accepts // interpolation. The body is an array of either plain strings or interpolated // expressions. -function printArrayLiteralWord(path, opts, print) { +const printArrayLiteralWord: Plugin.Printer = (path, opts, print) => { return concat(path.map(print, "body")); -} +}; // Prints out a special array literal. Accepts the parts of the array literal as // an argument, where the first element of the parts array is a string that // contains the special start. -function printArrayLiteral(start, parts) { +function printArrayLiteral(start: string, parts: Plugin.Doc[]) { return group( concat([ start, @@ -92,7 +94,7 @@ const arrayLiteralStarts = { // array literals as well as regular arrays. If it is a special array literal // then it will have one child that represents the special array, otherwise it // will have one child that contains all of the elements of the array. -function printArray(path, opts, print) { +const printArray: Plugin.Printer = (path, opts, print) => { const array = path.getValue(); const args = array.body[0]; @@ -102,42 +104,44 @@ function printArray(path, opts, print) { return printEmptyCollection(path, opts, "[", "]"); } + // If we don't have a regular args node at this point then we have a special + // array literal. In that case we're going to print out the body (which will + // return to us an array with the first one being the start of the array) and + // send that over to the printArrayLiteral function. + if (args.type !== "args" && args.type !== "args_add_star") { + return path.call( + (arrayPath) => + printArrayLiteral( + arrayLiteralStarts[args.type], + arrayPath.map(print, "body") + ), + "body", + 0 + ); + } + if (opts.rubyArrayLiteral) { // If we have an array that contains only simple string literals with no // spaces or interpolation, then we're going to print a %w array. if (isStringArray(args)) { - const printString = (stringPath) => stringPath.call(print, "body", 0); - const parts = path.map(printString, "body", 0, "body"); + const printString = (stringPath: Plugin.Path) => + stringPath.call(print, "body", 0); + const parts = path.map(printString, "body", 0, "body"); return printArrayLiteral("%w", parts); } // If we have an array that contains only simple symbol literals with no // interpolation, then we're going to print a %i array. if (isSymbolArray(args)) { - const printSymbol = (symbolPath) => symbolPath.call(print, "body", 0); - const parts = path.map(printSymbol, "body", 0, "body"); + const printSymbol = (symbolPath: Plugin.Path) => + symbolPath.call(print, "body", 0); + const parts = path.map(printSymbol, "body", 0, "body"); return printArrayLiteral("%i", parts); } } - // If we don't have a regular args node at this point then we have a special - // array literal. In that case we're going to print out the body (which will - // return to us an array with the first one being the start of the array) and - // send that over to the printArrayLiteral function. - if (!["args", "args_add_star"].includes(args.type)) { - return path.call( - (arrayPath) => - printArrayLiteral( - arrayLiteralStarts[arrayPath.getValue().type], - arrayPath.map(print, "body") - ), - "body", - 0 - ); - } - // Here we have a normal array of any type of object with no special literal // types or anything. return group( @@ -154,7 +158,7 @@ function printArray(path, opts, print) { "]" ]) ); -} +}; module.exports = { array: printArray, diff --git a/src/ruby/nodes/assign.js b/src/ruby/nodes/assign.ts similarity index 75% rename from src/ruby/nodes/assign.js rename to src/ruby/nodes/assign.ts index 1fd9f27c..2a19be9c 100644 --- a/src/ruby/nodes/assign.js +++ b/src/ruby/nodes/assign.ts @@ -1,7 +1,9 @@ +import type { Plugin, Ruby } from "./types"; + const { concat, group, indent, join, line } = require("../../prettier"); const { skipAssignIndent } = require("../../utils"); -function printAssign(path, opts, print) { +const printAssign: Plugin.Printer = (path, opts, print) => { const [_targetNode, valueNode] = path.getValue().body; const [targetDoc, valueDoc] = path.map(print, "body"); @@ -18,9 +20,9 @@ function printAssign(path, opts, print) { } return group(concat([targetDoc, " =", indent(concat([line, rightSideDoc]))])); -} +}; -function printOpAssign(path, opts, print) { +const printOpAssign: Plugin.Printer = (path, opts, print) => { return group( concat([ path.call(print, "body", 0), @@ -29,15 +31,15 @@ function printOpAssign(path, opts, print) { indent(concat([line, path.call(print, "body", 2)])) ]) ); -} +}; -function printVarField(path, opts, print) { +const printVarField: Plugin.Printer = (path, opts, print) => { return path.getValue().body ? path.call(print, "body", 0) : ""; -} +}; -function printVarRef(path, opts, print) { +const printVarRef: Plugin.Printer = (path, opts, print) => { return path.call(print, "body", 0); -} +}; module.exports = { assign: printAssign, diff --git a/src/ruby/nodes/blocks.js b/src/ruby/nodes/blocks.ts similarity index 92% rename from src/ruby/nodes/blocks.js rename to src/ruby/nodes/blocks.ts index b95e44d7..1cd04765 100644 --- a/src/ruby/nodes/blocks.js +++ b/src/ruby/nodes/blocks.ts @@ -1,3 +1,5 @@ +import type { Plugin, Ruby } from "./types"; + const { breakParent, concat, @@ -10,7 +12,7 @@ const { } = require("../../prettier"); const { hasAncestor } = require("../../utils"); -function printBlockVar(path, opts, print) { +const printBlockVar: Plugin.Printer = (path, opts, print) => { const parts = ["|", removeLines(path.call(print, "body", 0))]; // The second part of this node is a list of optional block-local variables @@ -20,9 +22,9 @@ function printBlockVar(path, opts, print) { parts.push("| "); return concat(parts); -} +}; -function printBlock(braces) { +function printBlock(braces: boolean): Plugin.Printer { return function printBlockWithBraces(path, opts, print) { const [variables, statements] = path.getValue().body; const stmts = diff --git a/src/ruby/nodes/calls.js b/src/ruby/nodes/calls.ts similarity index 88% rename from src/ruby/nodes/calls.js rename to src/ruby/nodes/calls.ts index ee71de3a..fa2a17eb 100644 --- a/src/ruby/nodes/calls.js +++ b/src/ruby/nodes/calls.ts @@ -1,3 +1,5 @@ +import type { Plugin, Ruby } from "./types"; + const { concat, group, @@ -13,7 +15,20 @@ const toProc = require("../toProc"); const chained = ["call", "method_add_arg", "method_add_block"]; -function printCall(path, opts, print) { +// We decorate these nodes with a bunch of extra stuff so that we can display +// nice method chains. +type Chain = { + chain?: number, + callChain?: number, + breakDoc?: Plugin.Doc[], + firstReceiverType?: string +}; + +type ChainedCall = Ruby.Call & Chain; +type ChainedMethodAddArg = Ruby.MethodAddArg & Chain; +type ChainedMethodAddBlock = Ruby.MethodAddBlock & Chain; + +const printCall: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); const [receiverNode, _operatorNode, messageNode] = node.body; @@ -44,6 +59,7 @@ function printCall(path, opts, print) { // https://github.com/prettier/plugin-ruby/issues/862. if ( receiverNode.type === "call" && + receiverNode.body[2] !== "call" && receiverNode.body[2].body === "where" && messageDoc === "not" ) { @@ -66,19 +82,19 @@ function printCall(path, opts, print) { // multi-line layout if this doesn't break into multiple lines. if (!chained.includes(parentNode.type) && (node.chain || 0) >= 3) { return ifBreak( - group(indent(concat(node.breakDoc.concat(rightSideDoc)))), + group(indent(concat(node.breakDoc!.concat(rightSideDoc)))), concat([receiverDoc, group(rightSideDoc)]) ); } return group(concat([receiverDoc, group(indent(rightSideDoc))])); -} +}; -function printMethodAddArg(path, opts, print) { +const printMethodAddArg: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); const [methodNode, argNode] = node.body; - const [methodDoc, argsDoc] = path.map(print, "body"); + const [methodDoc, argsDoc] = path.map(print, "body") as [Plugin.Doc, Plugin.Doc[]]; // You can end up here if you have a method with a ? ending, presumably // because the parser knows that it cannot be a local variable. You can also @@ -169,7 +185,7 @@ function printMethodAddArg(path, opts, print) { } return ifBreak( - group(indent(concat(node.breakDoc.concat(argsDoc)))), + group(indent(concat(node.breakDoc!.concat(argsDoc)))), concat([methodDoc, argsDoc]) ); } @@ -181,9 +197,9 @@ function printMethodAddArg(path, opts, print) { } return concat([methodDoc, " ", join(", ", argsDoc), " "]); -} +}; -function printMethodAddBlock(path, opts, print) { +const printMethodAddBlock: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); const [callNode, blockNode] = node.body; @@ -225,17 +241,17 @@ function printMethodAddBlock(path, opts, print) { // multi-line layout if this doesn't break into multiple lines. if (!chained.includes(parentNode.type) && (node.chain || 0) >= 3) { return ifBreak( - group(indent(concat(node.breakDoc.concat(blockDoc)))), + group(indent(concat(node.breakDoc!.concat(blockDoc)))), concat([callDoc, blockDoc]) ); } return concat([callDoc, blockDoc]); -} +}; -function printCallContainer(path, opts, print) { +const printCallContainer: Plugin.Printer = (path, opts, print) => { return path.call(print, "body", 0); -} +}; module.exports = { call: printCall, diff --git a/src/ruby/nodes/case.js b/src/ruby/nodes/case.ts similarity index 71% rename from src/ruby/nodes/case.js rename to src/ruby/nodes/case.ts index a9d2bf37..66babacf 100644 --- a/src/ruby/nodes/case.js +++ b/src/ruby/nodes/case.ts @@ -1,3 +1,6 @@ +import type * as Prettier from "prettier"; +import type { Plugin, Ruby } from "./types"; + const { align, concat, @@ -8,8 +11,8 @@ const { line } = require("../../prettier"); -function printCase(path, opts, print) { - const statement = ["case"]; +const printCase: Plugin.Printer = (path, opts, print) => { + const statement: Plugin.Doc[] = ["case"]; // You don't need to explicitly have something to test against in a case // statement (without it it effectively becomes an if/elsif chain). @@ -20,28 +23,28 @@ function printCase(path, opts, print) { return concat( statement.concat([hardline, path.call(print, "body", 1), hardline, "end"]) ); -} +}; -function printWhen(path, opts, print) { +const printWhen: Plugin.Printer = (path, opts, print) => { const [_preds, _stmts, addition] = path.getValue().body; // The `fill` builder command expects an array of docs alternating with // line breaks. This is so it can loop through and determine where to break. const preds = fill( - path.call(print, "body", 0).reduce((accum, pred, index) => { + (path.call(print, "body", 0) as Plugin.Doc[]).reduce((accum, pred, index) => { if (index === 0) { return [pred]; } // Pull off the last element and make it concat with a comma so that // we can maintain alternating lines and docs. - return accum + return accum! .slice(0, -1) - .concat([concat([accum[accum.length - 1], ","]), line, pred]); - }, null) + .concat([concat([accum![accum!.length - 1], ","]), line, pred]); + }, null as (null | Plugin.Doc[])) ); - const stmts = path.call(print, "body", 1); + const stmts = path.call(print, "body", 1) as Prettier.doc.builders.Concat; const parts = [concat(["when ", align("when ".length, preds)])]; // It's possible in a when to just have empty void statements, in which case @@ -57,7 +60,7 @@ function printWhen(path, opts, print) { } return group(concat(parts)); -} +}; module.exports = { case: printCase, diff --git a/src/ruby/nodes/class.js b/src/ruby/nodes/class.ts similarity index 84% rename from src/ruby/nodes/class.js rename to src/ruby/nodes/class.ts index f1f03e5c..dae75d84 100644 --- a/src/ruby/nodes/class.js +++ b/src/ruby/nodes/class.ts @@ -1,7 +1,9 @@ +import type { Plugin, Ruby } from "./types"; + const { concat, group, hardline, indent } = require("../../prettier"); const { isEmptyBodyStmt } = require("../../utils"); -function printClass(path, opts, print) { +const printClass: Plugin.Printer = (path, opts, print) => { const [_constant, superclass, bodystmt] = path.getValue().body; const parts = ["class ", path.call(print, "body", 0)]; @@ -21,9 +23,9 @@ function printClass(path, opts, print) { concat([hardline, "end"]) ]) ); -} +}; -function printModule(path, opts, print) { +const printModule: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); const declaration = group(concat(["module ", path.call(print, "body", 0)])); @@ -38,9 +40,9 @@ function printModule(path, opts, print) { concat([hardline, "end"]) ]) ); -} +}; -function printSClass(path, opts, print) { +const printSClass: Plugin.Printer = (path, opts, print) => { const bodystmt = path.getValue().body[1]; const declaration = concat(["class << ", path.call(print, "body", 0)]); @@ -55,7 +57,7 @@ function printSClass(path, opts, print) { concat([hardline, "end"]) ]) ); -} +}; module.exports = { class: printClass, diff --git a/src/ruby/nodes/commands.js b/src/ruby/nodes/commands.ts similarity index 79% rename from src/ruby/nodes/commands.js rename to src/ruby/nodes/commands.ts index 3eebd41f..310cd191 100644 --- a/src/ruby/nodes/commands.js +++ b/src/ruby/nodes/commands.ts @@ -1,3 +1,6 @@ +import type * as Prettier from "prettier"; +import type { Plugin, Ruby } from "./types"; + const { align, concat, @@ -10,13 +13,13 @@ const { } = require("../../prettier"); const { makeCall } = require("../../utils"); -function docLength(doc) { +function docLength(doc: any): number { if (doc.length) { return doc.length; } if (doc.parts) { - return doc.parts.reduce((sum, child) => sum + docLength(child), 0); + return (doc as Prettier.doc.builders.Concat).parts.reduce((sum, child) => sum + docLength(child), 0); } if (doc.contents) { @@ -26,7 +29,7 @@ function docLength(doc) { return 0; } -function hasDef(node) { +function hasDef(node: Ruby.Command) { return ( node.body[1].type === "args_add_block" && node.body[1].body[0].type === "args" && @@ -48,18 +51,18 @@ function hasDef(node) { // // In this case the arguments are aligned to the left side as opposed to being // aligned with the `receive` call. -function skipArgsAlign(path) { +function skipArgsAlign(path: Plugin.Path) { return ["to", "not_to"].includes(path.getValue().body[2].body); } // If there is a ternary argument to a command and it's going to get broken // into multiple lines, then we're going to have to use parentheses around the // command in order to make sure operator precedence doesn't get messed up. -function hasTernaryArg(node) { - return node.body[0].body.some((child) => child.type === "ifop"); +function hasTernaryArg(node: Ruby.Args | Ruby.ArgsAddBlock) { + return (node.body[0] as any).body.some((child: Ruby.AnyNode) => child.type === "ifop"); } -function printCommand(path, opts, print) { +const printCommand: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); const command = path.call(print, "body", 0); @@ -70,7 +73,7 @@ function printCommand(path, opts, print) { if (hasTernary) { breakArgs = indent(concat([softline, joinedArgs])); - } else if (hasDef(path.getValue())) { + } else if (hasDef(node)) { breakArgs = joinedArgs; } else { breakArgs = align(docLength(command) + 1, joinedArgs); @@ -87,9 +90,9 @@ function printCommand(path, opts, print) { concat([command, " ", joinedArgs]) ) ); -} +}; -function printCommandCall(path, opts, print) { +const printCommandCall: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); const parts = [ path.call(print, "body", 0), @@ -123,7 +126,7 @@ function printCommandCall(path, opts, print) { const joinedDoc = parts.concat(argDocs); return group(ifBreak(concat(breakDoc), concat(joinedDoc))); -} +}; module.exports = { command: printCommand, diff --git a/src/ruby/nodes/conditionals.js b/src/ruby/nodes/conditionals.ts similarity index 76% rename from src/ruby/nodes/conditionals.js rename to src/ruby/nodes/conditionals.ts index 47850f59..a938caee 100644 --- a/src/ruby/nodes/conditionals.js +++ b/src/ruby/nodes/conditionals.ts @@ -1,3 +1,6 @@ +import type * as Prettier from "prettier"; +import type { Plugin, Ruby } from "./types"; + const { align, breakParent, @@ -13,8 +16,12 @@ const { containsAssignment, isEmptyStmts } = require("../../utils"); const containsSingleConditional = require("../../utils/containsSingleConditional"); const inlineEnsureParens = require("../../utils/inlineEnsureParens"); -const printWithAddition = (keyword, path, print, { breaking = false } = {}) => - concat([ +function isConcat(doc: any): doc is Prettier.doc.builders.Concat { + return doc.type === "concat"; +} + +function printWithAddition(keyword: string, path: Plugin.Path, print: Plugin.Print, breaking: boolean) { + return concat([ `${keyword} `, align(keyword.length + 1, path.call(print, "body", 0)), indent(concat([softline, path.call(print, "body", 1)])), @@ -22,15 +29,16 @@ const printWithAddition = (keyword, path, print, { breaking = false } = {}) => concat([softline, "end"]), breaking ? breakParent : "" ]); +} // For the unary `not` operator, we need to explicitly add parentheses to it in // order for it to be valid from within a ternary. Otherwise if the clause of // the ternary isn't a unary `not`, we can just pass it along. -const printTernaryClause = (clause) => { - if (clause.type === "concat") { +function printTernaryClause(clause: Plugin.Doc) { + if (isConcat(clause)) { const [part] = clause.parts; - if (part.type === "concat" && part.parts[0] === "not") { + if (isConcat(part) && part.parts[0] === "not") { // We are inside of a statements list and the statement is a unary `not`. return concat(["not(", part.parts[2], ")"]); } @@ -42,12 +50,12 @@ const printTernaryClause = (clause) => { } return clause; -}; +} // The conditions for a ternary look like `foo : bar` where `foo` represents // the truthy clause and `bar` represents the falsy clause. In the case that the // parent node is an `unless`, these have to flip in order. -const printTernaryClauses = (keyword, truthyClause, falsyClause) => { +function printTernaryClauses(keyword: string, truthyClause: Plugin.Doc, falsyClause: Plugin.Doc) { const parts = [ printTernaryClause(truthyClause), " : ", @@ -55,11 +63,11 @@ const printTernaryClauses = (keyword, truthyClause, falsyClause) => { ]; return keyword === "if" ? parts : parts.reverse(); -}; +} // Handles ternary nodes. If it does not fit on one line, then we break out into // an if/else statement. Otherwise we remain as a ternary. -const printTernary = (path, _opts, print) => { +const printTernary: Plugin.Printer = (path, _opts, print) => { const [predicate, truthyClause, falsyClause] = path.map(print, "body"); const ternaryClauses = printTernaryClauses("if", truthyClause, falsyClause); @@ -81,7 +89,7 @@ const printTernary = (path, _opts, print) => { // Prints an `if_mod` or `unless_mod` node. Because it was previously in the // modifier form, we're guaranteed to not have an additional node, so we can // just work with the predicate and the body. -function printSingle(keyword, modifier = false) { +function printSingle(keyword: string, modifier: boolean = false): Plugin.Printer { return function printSingleWithKeyword(path, { rubyModifier }, print) { const [_predicateNode, statementsNode] = path.getValue().body; const predicateDoc = path.call(print, "body", 0); @@ -98,7 +106,7 @@ function printSingle(keyword, modifier = false) { // If we do not allow modifier form conditionals or there are comments // inside of the body of the conditional, then we must print in the // multiline form. - if (!rubyModifier || (!modifier && statementsNode.body[0].comments)) { + if (!rubyModifier || (!modifier && (statementsNode as Ruby.If | Ruby.Unless).body[0].comments)) { return concat([concat(multilineParts), breakParent]); } @@ -157,7 +165,7 @@ const noTernary = [ // Certain expressions cannot be reduced to a ternary without adding parens // around them. In this case we say they cannot be ternaried and default instead // to breaking them into multiple lines. -const canTernaryStmts = (stmts) => { +function canTernaryStmts(stmts: Ruby.Stmts) { if (stmts.body.length !== 1) { return false; } @@ -173,14 +181,14 @@ const canTernaryStmts = (stmts) => { // Check against the blocklist of statement types that are not allowed to be // a part of a ternary expression. return !noTernary.includes(stmt.type); -}; +} // In order for an `if` or `unless` expression to be shortened to a ternary, // there has to be one and only one "addition" (another clause attached) which // is of the "else" type. Both the body of the main node and the body of the // additional node must have only one statement, and that statement list must // pass the `canTernaryStmts` check. -const canTernary = (path) => { +function canTernary(path: Plugin.Path) { const [predicate, stmts, addition] = path.getValue().body; return ( @@ -191,12 +199,11 @@ const canTernary = (path) => { addition.type === "else" && [stmts, addition.body[0]].every(canTernaryStmts) ); -}; +} // A normalized print function for both `if` and `unless` nodes. -const printConditional = - (keyword) => - (path, { rubyModifier }, print) => { +function printConditional(keyword: string): Plugin.Printer { + return (path, opts, print) => { if (canTernary(path)) { let ternaryParts = [path.call(print, "body", 0), " ? "].concat( printTernaryClauses( @@ -207,11 +214,11 @@ const printConditional = ); if (["binary", "call"].includes(path.getParentNode().type)) { - ternaryParts = ["("].concat(ternaryParts).concat(")"); + ternaryParts = (["("] as Plugin.Doc[]).concat(ternaryParts).concat(")"); } return group( - ifBreak(printWithAddition(keyword, path, print), concat(ternaryParts)) + ifBreak(printWithAddition(keyword, path, print, false), concat(ternaryParts)) ); } @@ -220,7 +227,7 @@ const printConditional = // If there's an additional clause that wasn't matched earlier, we know we // can't go for the inline option. if (addition) { - return group(printWithAddition(keyword, path, print, { breaking: true })); + return group(printWithAddition(keyword, path, print, true)); } // If the body of the conditional is empty, then we explicitly have to use the @@ -252,39 +259,44 @@ const printConditional = ]); } - return printSingle(keyword)(path, { rubyModifier }, print); + return printSingle(keyword)(path, opts, print); }; +} -module.exports = { - else: (path, opts, print) => { - const stmts = path.getValue().body[0]; - - return concat([ - stmts.body.length === 1 && stmts.body[0].type === "command" - ? breakParent - : "", - "else", - indent(concat([softline, path.call(print, "body", 0)])) - ]); - }, - elsif: (path, opts, print) => { - const [_predicate, _statements, addition] = path.getValue().body; - const parts = [ - group( - concat([ - "elsif ", - align("elsif".length - 1, path.call(print, "body", 0)) - ]) - ), - indent(concat([hardline, path.call(print, "body", 1)])) - ]; +const printElse: Plugin.Printer = (path, opts, print) => { + const stmts = path.getValue().body[0]; - if (addition) { - parts.push(group(concat([hardline, path.call(print, "body", 2)]))); - } + return concat([ + stmts.body.length === 1 && stmts.body[0].type === "command" + ? breakParent + : "", + "else", + indent(concat([softline, path.call(print, "body", 0)])) + ]); +}; + +const printElsif: Plugin.Printer = (path, opts, print) => { + const [_predicate, _statements, addition] = path.getValue().body; + const parts = [ + group( + concat([ + "elsif ", + align("elsif".length - 1, path.call(print, "body", 0)) + ]) + ), + indent(concat([hardline, path.call(print, "body", 1)])) + ]; + + if (addition) { + parts.push(group(concat([hardline, path.call(print, "body", 2)]))); + } - return group(concat(parts)); - }, + return group(concat(parts)); +}; + +module.exports = { + else: printElse, + elsif: printElsif, if: printConditional("if"), ifop: printTernary, if_mod: printSingle("if", true), diff --git a/src/ruby/nodes/constants.js b/src/ruby/nodes/constants.ts similarity index 61% rename from src/ruby/nodes/constants.js rename to src/ruby/nodes/constants.ts index 4d317a91..368c4d4b 100644 --- a/src/ruby/nodes/constants.js +++ b/src/ruby/nodes/constants.ts @@ -1,15 +1,17 @@ +import type { Plugin, Ruby } from "./types"; + const { concat, group, indent, join, softline } = require("../../prettier"); const { makeCall } = require("../../utils"); -function printConstPath(path, opts, print) { +const printConstPath: Plugin.Printer = (path, opts, print) => { return join("::", path.map(print, "body")); -} +}; -function printConstRef(path, opts, print) { +const printConstRef: Plugin.Printer = (path, opts, print) => { return path.call(print, "body", 0); -} +}; -function printDefined(path, opts, print) { +const printDefined: Plugin.Printer = (path, opts, print) => { return group( concat([ "defined?(", @@ -17,20 +19,20 @@ function printDefined(path, opts, print) { concat([softline, ")"]) ]) ); -} +}; -function printField(path, opts, print) { +const printField: Plugin.Printer = (path, opts, print) => { return group( concat([ path.call(print, "body", 0), concat([makeCall(path, opts, print), path.call(print, "body", 2)]) ]) ); -} +}; -function printTopConst(path, opts, print) { +const printTopConst: Plugin.Printer = (path, opts, print) => { return concat(["::", path.call(print, "body", 0)]); -} +}; module.exports = { const_path_field: printConstPath, diff --git a/src/ruby/nodes/flow.js b/src/ruby/nodes/flow.js deleted file mode 100644 index dae05715..00000000 --- a/src/ruby/nodes/flow.js +++ /dev/null @@ -1,74 +0,0 @@ -const { concat, join } = require("../../prettier"); -const { literal } = require("../../utils"); - -const nodeDive = (node, steps) => { - let current = node; - - steps.forEach((step) => { - current = current[step]; - }); - - return current; -}; - -const unskippableParens = [ - "if_mod", - "rescue_mod", - "unless_mod", - "until_mod", - "while_mod" -]; - -const maybeHandleParens = (path, print, keyword, steps) => { - const node = nodeDive(path.getValue(), steps); - if (node.type !== "paren") { - return null; - } - - const stmts = node.body[0].body; - if (stmts.length === 1 && !unskippableParens.includes(stmts[0].type)) { - return concat([ - `${keyword} `, - path.call.apply(path, [print].concat(steps).concat("body", 0)) - ]); - } - - return concat([keyword, path.call.apply(path, [print].concat(steps))]); -}; - -module.exports = { - break: (path, opts, print) => { - const content = path.getValue().body[0]; - - if (content.body.length === 0) { - return "break"; - } - - const steps = ["body", 0, "body", 0, "body", 0]; - return ( - maybeHandleParens(path, print, "break", steps) || - concat(["break ", join(", ", path.call(print, "body", 0))]) - ); - }, - next: (path, opts, print) => { - const args = path.getValue().body[0].body[0]; - - if (!args) { - return "next"; - } - - const steps = ["body", 0, "body", 0, "body", 0]; - return ( - maybeHandleParens(path, print, "next", steps) || - concat(["next ", join(", ", path.call(print, "body", 0))]) - ); - }, - yield: (path, opts, print) => { - if (path.getValue().body[0].type === "paren") { - return concat(["yield", path.call(print, "body", 0)]); - } - - return concat(["yield ", join(", ", path.call(print, "body", 0))]); - }, - yield0: literal("yield") -}; diff --git a/src/ruby/nodes/flow.ts b/src/ruby/nodes/flow.ts new file mode 100644 index 00000000..8dcaa284 --- /dev/null +++ b/src/ruby/nodes/flow.ts @@ -0,0 +1,85 @@ +import type { Plugin, Ruby } from "./types"; + +const { concat, join } = require("../../prettier"); +const { literal } = require("../../utils"); + +function nodeDive(node: any, steps: PropertyKey[]) { + let current = node; + + steps.forEach((step) => { + current = current[step]; + }); + + return current; +} + +const unskippableParens = [ + "if_mod", + "rescue_mod", + "unless_mod", + "until_mod", + "while_mod" +]; + +type CallArgs = [Plugin.Print, ...(PropertyKey[])]; + +function maybeHandleParens(path: Plugin.Path, print: Plugin.Print, keyword: string, steps: PropertyKey[]) { + const node = nodeDive(path.getValue(), steps); + if (node.type !== "paren") { + return null; + } + + let args = [print] as CallArgs; + const stmts = node.body[0].body; + + if (stmts.length === 1 && !unskippableParens.includes(stmts[0].type)) { + args = args.concat(steps).concat("body", 0) as CallArgs; + return concat([`${keyword} `, path.call.apply(path, args)]); + } + + args = args.concat(steps) as CallArgs; + return concat([keyword, path.call.apply(path, args)]); +} + +const printBreak: Plugin.Printer = (path, opts, print) => { + const content = path.getValue().body[0]; + + if (content.body.length === 0) { + return "break"; + } + + const steps = ["body", 0, "body", 0, "body", 0]; + return ( + maybeHandleParens(path, print, "break", steps) || + concat(["break ", join(", ", path.call(print, "body", 0))]) + ); +}; + +const printNext: Plugin.Printer = (path, opts, print) => { + const args = path.getValue().body[0].body[0]; + + if (!args) { + return "next"; + } + + const steps = ["body", 0, "body", 0, "body", 0]; + return ( + maybeHandleParens(path, print, "next", steps) || + concat(["next ", join(", ", path.call(print, "body", 0))]) + ); +}; + +const printYield: Plugin.Printer = (path, opts, print) => { + if (path.getValue().body[0].type === "paren") { + return concat(["yield", path.call(print, "body", 0)]); + } + + return concat(["yield ", join(", ", path.call(print, "body", 0))]); +}; + +module.exports = { + break: printBreak, + next: printNext, + yield: printYield, + yield0: literal("yield") +}; diff --git a/src/ruby/nodes/hashes.js b/src/ruby/nodes/hashes.ts similarity index 77% rename from src/ruby/nodes/hashes.js rename to src/ruby/nodes/hashes.ts index ec26ff6d..9afa4e5a 100644 --- a/src/ruby/nodes/hashes.js +++ b/src/ruby/nodes/hashes.ts @@ -1,3 +1,6 @@ +import { Doc } from "prettier"; +import type { Plugin, Ruby } from "./types"; + const { concat, group, @@ -13,6 +16,9 @@ const { skipAssignIndent } = require("../../utils"); +type KeyPrinter = (path: Plugin.Path, print: Plugin.Print) => Doc; +type HashContents = (Ruby.AssoclistFromArgs | Ruby.BareAssocHash) & { keyPrinter: KeyPrinter }; + // When attempting to convert a hash rocket into a hash label, you need to take // care because only certain patterns are allowed. Ruby source says that they // have to match keyword arguments to methods, but don't specify what that is. @@ -23,12 +29,12 @@ const { // // This function represents that check, as it determines if it can convert the // symbol node into a hash label. -function isValidHashLabel(symbolLiteral) { +function isValidHashLabel(symbolLiteral: Ruby.SymbolLiteral) { const label = symbolLiteral.body[0].body; return label.match(/^[_A-Za-z]/) && !label.endsWith("="); } -function canUseHashLabels(contentsNode) { +function canUseHashLabels(contentsNode: HashContents) { return contentsNode.body.every((assocNode) => { if (assocNode.type === "assoc_splat") { return true; @@ -47,7 +53,7 @@ function canUseHashLabels(contentsNode) { }); } -function printHashKeyLabel(path, print) { +const printHashKeyLabel: KeyPrinter = (path, print) => { const node = path.getValue(); switch (node.type) { @@ -59,24 +65,25 @@ function printHashKeyLabel(path, print) { return concat([print(path), ":"]); } } -} +}; -function printHashKeyRocket(path, print) { +const printHashKeyRocket: KeyPrinter = (path, print) => { const node = path.getValue(); let doc = print(path); if (node.type === "@label") { - doc = concat([":", doc.slice(0, doc.length - 1)]); + const sDoc = doc as string; // since we know this is a label + doc = concat([":", sDoc.slice(0, sDoc.length - 1)]); } else if (node.type === "dyna_symbol") { doc = concat([":", doc]); } return concat([doc, " =>"]); -} +}; -function printAssocNew(path, opts, print) { +const printAssocNew: Plugin.Printer = (path, opts, print) => { const [keyNode, valueNode] = path.getValue().body; - const { keyPrinter } = path.getParentNode(); + const { keyPrinter } = path.getParentNode() as HashContents; const parts = [path.call((keyPath) => keyPrinter(keyPath, print), "body", 0)]; const valueDoc = path.call(print, "body", 1); @@ -95,13 +102,13 @@ function printAssocNew(path, opts, print) { } return group(concat(parts)); -} +}; -function printAssocSplat(path, opts, print) { +const printAssocSplat: Plugin.Printer = (path, opts, print) => { return concat(["**", path.call(print, "body", 0)]); -} +}; -function printHashContents(path, opts, print) { +const printHashContents: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); // First determine which key printer we're going to use, so that the child @@ -112,9 +119,9 @@ function printHashContents(path, opts, print) { : printHashKeyRocket; return join(concat([",", line]), path.map(print, "body")); -} +}; -function printHash(path, opts, print) { +const printHash: Plugin.Printer = (path, opts, print) => { const hashNode = path.getValue(); // Hashes normally have a single assoclist_from_args child node. If it's @@ -144,7 +151,7 @@ function printHash(path, opts, print) { } return group(hashDoc); -} +}; module.exports = { assoc_new: printAssocNew, diff --git a/src/ruby/nodes/heredocs.js b/src/ruby/nodes/heredocs.ts similarity index 90% rename from src/ruby/nodes/heredocs.js rename to src/ruby/nodes/heredocs.ts index ff9f6397..163541ee 100644 --- a/src/ruby/nodes/heredocs.js +++ b/src/ruby/nodes/heredocs.ts @@ -1,7 +1,9 @@ +import type { Plugin, Ruby } from "./types"; + const { concat, group, lineSuffix, join } = require("../../prettier"); const { literallineWithoutBreakParent } = require("../../utils"); -function printHeredoc(path, opts, print) { +const printHeredoc: Plugin.Printer = (path, opts, print) => { const { body, ending } = path.getValue(); const parts = body.map((part, index) => { @@ -29,7 +31,7 @@ function printHeredoc(path, opts, print) { ) ]) ); -} +}; module.exports = { heredoc: printHeredoc diff --git a/src/ruby/nodes/hooks.js b/src/ruby/nodes/hooks.ts similarity index 87% rename from src/ruby/nodes/hooks.js rename to src/ruby/nodes/hooks.ts index 332da91d..4395aafc 100644 --- a/src/ruby/nodes/hooks.js +++ b/src/ruby/nodes/hooks.ts @@ -1,3 +1,5 @@ +import type { Plugin, Ruby } from "./types"; + const { concat, group, indent, line } = require("../../prettier"); // The `BEGIN` and `END` keywords are used to hook into the Ruby process. Any @@ -14,7 +16,7 @@ const { concat, group, indent, line } = require("../../prettier"); // // Interesting side note, you don't use `do...end` blocks with these hooks. Both // nodes contain one child which is a `stmts` node. -function printHook(name) { +function printHook(name: string): Plugin.Printer { return function printHookWithName(path, opts, print) { return group( concat([ diff --git a/src/ruby/nodes/ints.js b/src/ruby/nodes/ints.ts similarity index 87% rename from src/ruby/nodes/ints.js rename to src/ruby/nodes/ints.ts index 6092546a..cd4398f8 100644 --- a/src/ruby/nodes/ints.js +++ b/src/ruby/nodes/ints.ts @@ -1,3 +1,5 @@ +import type { Plugin, Ruby } from "./types"; + // An @int node is any literal integer in Ruby. They can come in a number of // bases, and look like the following: // @@ -9,7 +11,7 @@ // If it's a decimal number, it can be optional separated by any number of // arbitrarily places underscores. This can be useful for dollars and cents // (34_99), dates (2020_11_30), and normal 3 digit separation (1_222_333). -function printInt(path, _opts, _print) { +const printInt: Plugin.Printer = (path, _opts, _print) => { const { body } = path.getValue(); // If the number is a base 10 number, is sufficiently large, and is not @@ -18,13 +20,13 @@ function printInt(path, _opts, _print) { if (!body.startsWith("0") && body.length >= 5 && !body.includes("_")) { return ` ${body}` .slice((body.length + 2) % 3) - .match(/.{3}/g) + .match(/.{3}/g)! .join("_") .trim(); } return body; -} +}; module.exports = { "@int": printInt diff --git a/src/ruby/nodes/lambdas.js b/src/ruby/nodes/lambdas.ts similarity index 91% rename from src/ruby/nodes/lambdas.js rename to src/ruby/nodes/lambdas.ts index 5cf6114d..3eaf4272 100644 --- a/src/ruby/nodes/lambdas.js +++ b/src/ruby/nodes/lambdas.ts @@ -1,3 +1,5 @@ +import type { Plugin, Ruby } from "./types"; + const { concat, group, ifBreak, indent, line } = require("../../prettier"); const { hasAncestor } = require("../../utils"); @@ -5,7 +7,7 @@ const { hasAncestor } = require("../../utils"); // or if we have them wrapped in parens then they'll be one level deeper. Even // though it's possible to omit the parens if you only have one argument, we're // going to keep them in no matter what for consistency. -function printLambdaParams(path, print) { +function printLambdaParams(path: Plugin.Path, print: Plugin.Print) { let node = path.getValue().body[0]; // In this case we had something like -> (foo) { bar } which would mean that @@ -51,7 +53,7 @@ function printLambdaParams(path, print) { // for the single-line form. However, if we have an ancestor that is a command // or command_call node, then we'll need to use braces either way because of // operator precendence. -function printLambda(path, opts, print) { +const printLambda: Plugin.Printer = (path, opts, print) => { const params = printLambdaParams(path, print); const inCommand = hasAncestor(path, ["command", "command_call"]); @@ -69,7 +71,7 @@ function printLambda(path, opts, print) { concat(["->", params, " { ", path.call(print, "body", 1), " }"]) ) ); -} +}; module.exports = { lambda: printLambda diff --git a/src/ruby/nodes/loops.js b/src/ruby/nodes/loops.ts similarity index 91% rename from src/ruby/nodes/loops.js rename to src/ruby/nodes/loops.ts index e78e40ee..61aa74f6 100644 --- a/src/ruby/nodes/loops.js +++ b/src/ruby/nodes/loops.ts @@ -1,3 +1,5 @@ +import type { Plugin, Ruby } from "./types"; + const { align, breakParent, @@ -13,7 +15,7 @@ const { const { containsAssignment, isEmptyStmts } = require("../../utils"); const inlineEnsureParens = require("../../utils/inlineEnsureParens"); -function printLoop(keyword, modifier) { +function printLoop(keyword: string, modifier: boolean): Plugin.Printer { return function printLoopWithOptions(path, { rubyModifier }, print) { const [_predicate, stmts] = path.getValue().body; @@ -72,7 +74,7 @@ function printLoop(keyword, modifier) { }; } -function printFor(path, opts, print) { +const printFor: Plugin.Printer = (path, opts, print) => { const [varDoc, rangeDoc, stmtsDoc] = path.map(print, "body"); const varsDoc = path.getValue().body[0].type === "mlhs" ? join(", ", varDoc) : varDoc; @@ -87,7 +89,7 @@ function printFor(path, opts, print) { concat([hardline, "end"]) ]) ); -} +}; module.exports = { while: printLoop("while", false), diff --git a/src/ruby/nodes/massign.js b/src/ruby/nodes/massign.ts similarity index 57% rename from src/ruby/nodes/massign.js rename to src/ruby/nodes/massign.ts index 0266732a..c52274bd 100644 --- a/src/ruby/nodes/massign.js +++ b/src/ruby/nodes/massign.ts @@ -1,3 +1,5 @@ +import type { Plugin, Ruby } from "./types"; + const { concat, group, @@ -7,7 +9,7 @@ const { softline } = require("../../prettier"); -function printMAssign(path, opts, print) { +const printMAssign: Plugin.Printer = (path, opts, print) => { let right = path.call(print, "body", 1); if ( @@ -19,34 +21,34 @@ function printMAssign(path, opts, print) { } const parts = [join(concat([",", line]), path.call(print, "body", 0))]; - if (path.getValue().body[0].comma) { + if ((path.getValue().body[0] as any).comma) { parts.push(","); } return group( concat([group(concat(parts)), " =", indent(concat([line, right]))]) ); -} +}; -function printMLHS(path, opts, print) { +const printMLHS: Plugin.Printer = (path, opts, print) => { return path.map(print, "body"); -} +}; -function printMLHSAddPost(path, opts, print) { - return path.call(print, "body", 0).concat(path.call(print, "body", 1)); -} +const printMLHSAddPost: Plugin.Printer = (path, opts, print) => { + return (path.call(print, "body", 0) as Plugin.Doc[]).concat(path.call(print, "body", 1)); +}; -function printMLHSAddStar(path, opts, print) { - const rightParts = ["*"]; +const printMLHSAddStar: Plugin.Printer = (path, opts, print) => { + const rightParts: Plugin.Doc[] = ["*"]; if (path.getValue().body[1]) { rightParts.push(path.call(print, "body", 1)); } - return path.call(print, "body", 0).concat(concat(rightParts)); -} + return (path.call(print, "body", 0) as Plugin.Doc[]).concat(concat(rightParts)); +}; -function printMLHSParen(path, opts, print) { +const printMLHSParen: Plugin.Printer = (path, opts, print) => { if (["massign", "mlhs_paren"].includes(path.getParentNode().type)) { // If we're nested in brackets as part of the left hand side of an // assignment, i.e., (a, b, c) = 1, 2, 3 @@ -59,32 +61,32 @@ function printMLHSParen(path, opts, print) { join(concat([",", line]), path.call(print, "body", 0)) ]; - if (path.getValue().body[0].comma) { + if ((path.getValue().body[0] as any).comma) { parts.push(","); } return group(concat(["(", indent(concat(parts)), concat([softline, ")"])])); -} +}; -function printMRHS(path, opts, print) { +const printMRHS: Plugin.Printer = (path, opts, print) => { return path.map(print, "body"); -} +}; -function printMRHSAddStar(path, opts, print) { +const printMRHSAddStar: Plugin.Printer = (path, opts, print) => { const [leftDoc, rightDoc] = path.map(print, "body"); - return leftDoc.concat([concat(["*", rightDoc])]); -} + return (leftDoc as Plugin.Doc[]).concat([concat(["*", rightDoc])]); +}; -function printMRHSNewFromArgs(path, opts, print) { - const parts = path.call(print, "body", 0); +const printMRHSNewFromArgs: Plugin.Printer = (path, opts, print) => { + const parts = path.call(print, "body", 0) as Plugin.Doc[]; if (path.getValue().body[1]) { parts.push(path.call(print, "body", 1)); } return parts; -} +}; module.exports = { massign: printMAssign, diff --git a/src/ruby/nodes/methods.js b/src/ruby/nodes/methods.ts similarity index 81% rename from src/ruby/nodes/methods.js rename to src/ruby/nodes/methods.ts index 59316257..caca8773 100644 --- a/src/ruby/nodes/methods.js +++ b/src/ruby/nodes/methods.ts @@ -1,10 +1,12 @@ +import type { Plugin, Ruby } from "./types"; + const { concat, group, hardline, indent, line } = require("../../prettier"); const { isEmptyBodyStmt } = require("../../utils"); -function printMethod(offset) { +function printMethod(offset: number): Plugin.Printer { return function printMethodWithOffset(path, opts, print) { const [_name, params, bodystmt] = path.getValue().body.slice(offset); - const declaration = ["def "]; + const declaration: Plugin.Doc[] = ["def "]; // In this case, we're printing a method that's defined as a singleton, so // we need to include the target and the operator @@ -39,9 +41,9 @@ function printMethod(offset) { }; } -function printSingleLineMethod(path, opts, print) { +const printSingleLineMethod: Plugin.Printer = (path, opts, print) => { let parensNode = path.getValue().body[1]; - let paramsDoc = ""; + let paramsDoc: Plugin.Doc = ""; if (parensNode) { const paramsNode = parensNode.body[0]; @@ -60,11 +62,11 @@ function printSingleLineMethod(path, opts, print) { indent(group(concat([line, path.call(print, "body", 2)]))) ]) ); -} +}; -function printAccessControl(path, opts, print) { +const printAccessControl: Plugin.Printer = (path, opts, print) => { return path.call(print, "body", 0); -} +}; module.exports = { access_ctrl: printAccessControl, diff --git a/src/ruby/nodes/operators.js b/src/ruby/nodes/operators.ts similarity index 85% rename from src/ruby/nodes/operators.js rename to src/ruby/nodes/operators.ts index 094b7b2e..648f40db 100644 --- a/src/ruby/nodes/operators.js +++ b/src/ruby/nodes/operators.ts @@ -1,7 +1,9 @@ +import type { Plugin, Ruby } from "./types"; + const { concat, group, indent, line, softline } = require("../../prettier"); const { noIndent } = require("../../utils"); -function printBinary(path, opts, print) { +const printBinary: Plugin.Printer = (path, opts, print) => { const [_leftNode, operator, rightNode] = path.getValue().body; const space = operator === "**" ? "" : " "; @@ -32,11 +34,11 @@ function printBinary(path, opts, print) { ) ]) ); -} +}; // dot2 nodes are used with ranges (or flip-flops). They can optionally drop // their left side for beginless ranges or their right side for endless ranges. -function printDot2(path, opts, print) { +const printDot2: Plugin.Printer = (path, opts, print) => { const [leftNode, rightNode] = path.getValue().body; return concat([ @@ -44,11 +46,11 @@ function printDot2(path, opts, print) { "..", rightNode ? path.call(print, "body", 1) : "" ]); -} +}; // dot3 nodes are used with ranges (or flip-flops). They can optionally drop // their left side for beginless ranges or their right side for endless ranges. -function printDot3(path, opts, print) { +const printDot3: Plugin.Printer = (path, opts, print) => { const [leftNode, rightNode] = path.getValue().body; return concat([ @@ -56,9 +58,9 @@ function printDot3(path, opts, print) { "...", rightNode ? path.call(print, "body", 1) : "" ]); -} +}; -function printUnary(path, opts, print) { +const printUnary: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); const contentsDoc = path.call(print, "body", 0); @@ -73,7 +75,7 @@ function printUnary(path, opts, print) { } return concat([node.oper, contentsDoc]); -} +}; module.exports = { binary: printBinary, diff --git a/src/ruby/nodes/params.js b/src/ruby/nodes/params.ts similarity index 88% rename from src/ruby/nodes/params.js rename to src/ruby/nodes/params.ts index d840a65a..9bf3ec38 100644 --- a/src/ruby/nodes/params.js +++ b/src/ruby/nodes/params.ts @@ -1,3 +1,5 @@ +import type { Plugin, Ruby } from "./types"; + const { concat, group, @@ -8,7 +10,7 @@ const { } = require("../../prettier"); const { literal } = require("../../utils"); -function printRestParam(symbol) { +function printRestParam(symbol: string): Plugin.Printer { return function printRestParamWithSymbol(path, opts, print) { return path.getValue().body[0] ? concat([symbol, path.call(print, "body", 0)]) @@ -16,10 +18,10 @@ function printRestParam(symbol) { }; } -function printParams(path, opts, print) { +const printParams: Plugin.Printer = (path, opts, print) => { const [reqs, optls, rest, post, kwargs, kwargRest, block] = path.getValue().body; - let parts = []; + let parts: Plugin.Doc[] = []; if (reqs) { path.each( @@ -83,7 +85,7 @@ function printParams(path, opts, print) { // In ruby 2.5, the excessed comma is indicated by having a 0 in the rest // param position. In ruby 2.6+ it's indicated by having an "excessed_comma" // node in the rest position. Seems odd, but it's true. - if (rest === 0 || (rest && rest.type === "excessed_comma")) { + if ((rest as any) === 0 || (rest && rest.type === "excessed_comma")) { contents.push(","); } @@ -96,7 +98,7 @@ function printParams(path, opts, print) { } return group(concat(contents)); -} +}; module.exports = { args_forward: literal("..."), diff --git a/src/ruby/nodes/patterns.js b/src/ruby/nodes/patterns.ts similarity index 82% rename from src/ruby/nodes/patterns.js rename to src/ruby/nodes/patterns.ts index 00fe250e..ceaf864b 100644 --- a/src/ruby/nodes/patterns.js +++ b/src/ruby/nodes/patterns.ts @@ -1,3 +1,5 @@ +import type { Plugin, Ruby } from "./types"; + const { align, concat, @@ -10,7 +12,7 @@ const { const patterns = ["aryptn", "binary", "fndptn", "hshptn", "rassign"]; -function printPatternArg(path, opts, print) { +const printPatternArg: Plugin.Printer = (path, opts, print) => { // Pinning is a really special syntax in pattern matching that's not really // all that well supported in ripper. Here we're just going to the original // source to see if the variable is pinned. @@ -22,11 +24,11 @@ function printPatternArg(path, opts, print) { } return path.call(print); -} +}; -function printAryPtn(path, opts, print) { +const printAryPtn: Plugin.Printer = (path, opts, print) => { const [constant, preargs, splatarg, postargs] = path.getValue().body; - let args = []; + let args: Plugin.Doc[] = []; if (preargs) { args = args.concat( @@ -53,9 +55,9 @@ function printAryPtn(path, opts, print) { } return args; -} +}; -function printFndPtn(path, opts, print) { +const printFndPtn: Plugin.Printer = (path, opts, print) => { const [constant] = path.getValue().body; let args = [concat(["*", path.call(print, "body", 1)])] @@ -69,14 +71,14 @@ function printFndPtn(path, opts, print) { } return args; -} +}; -function printHshPtn(path, opts, print) { +const printHshPtn: Plugin.Printer = (path, opts, print) => { const [constant, keyValuePairs, keyValueRest] = path.getValue().body; - let args = []; + let args: Plugin.Doc[] = []; if (keyValuePairs.length > 0) { - const printPair = (pairPath) => { + const printPair = (pairPath: Plugin.Path<[Ruby.Label, Ruby.AnyNode]>) => { const parts = [pairPath.call(print, 0)]; if (pairPath.getValue()[1]) { @@ -112,9 +114,9 @@ function printHshPtn(path, opts, print) { } return args; -} +}; -function printIn(path, opts, print) { +const printIn: Plugin.Printer = (path, opts, print) => { const parts = [ "in ", align( @@ -133,9 +135,9 @@ function printIn(path, opts, print) { } return group(concat(parts)); -} +}; -function printRAssign(path, opts, print) { +const printRAssign: Plugin.Printer = (path, opts, print) => { const { keyword } = path.getValue(); const [leftDoc, rightDoc] = path.map(print, "body"); @@ -146,7 +148,7 @@ function printRAssign(path, opts, print) { group(indent(concat([line, rightDoc]))) ]) ); -} +}; module.exports = { aryptn: printAryPtn, diff --git a/src/ruby/nodes/regexp.js b/src/ruby/nodes/regexp.ts similarity index 81% rename from src/ruby/nodes/regexp.js rename to src/ruby/nodes/regexp.ts index faa496aa..2c53b032 100644 --- a/src/ruby/nodes/regexp.js +++ b/src/ruby/nodes/regexp.ts @@ -1,7 +1,9 @@ +import type { Plugin, Ruby } from "./types"; + const { concat } = require("../../prettier"); const { hasAncestor } = require("../../utils"); -function hasContent(node, pattern) { +function hasContent(node: Ruby.RegexpLiteral, pattern: RegExp) { return node.body.some( (child) => child.type === "@tstring_content" && pattern.test(child.body) ); @@ -11,7 +13,7 @@ function hasContent(node, pattern) { // or an =, and we're contained within a command or command_call node, then we // want to use braces because otherwise we could end up with an ambiguous // operator, e.g. foo / bar/ or foo /=bar/ -function forwardSlashIsAmbiguous(path) { +function forwardSlashIsAmbiguous(path: Plugin.Path) { const node = path.getValue(); const firstChildNode = node.body[0]; @@ -30,7 +32,7 @@ function forwardSlashIsAmbiguous(path) { // // We favor the use of forward slashes unless the regex contains a forward slash // itself. In that case we switch over to using %r with braces. -function printRegexpLiteral(path, opts, print) { +const printRegexpLiteral: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); const docs = path.map(print, "body"); @@ -41,15 +43,15 @@ function printRegexpLiteral(path, opts, print) { // If we should be using braces but we have braces in the body of the regexp, // then we're just going to resort to using whatever the original content was. if (useBraces && hasContent(node, /[{}]/)) { - return concat([node.beging].concat(docs).concat(node.ending)); + return concat(([node.beging] as Plugin.Doc[]).concat(docs).concat(node.ending)); } return concat( - [useBraces ? "%r{" : "/"] + ([useBraces ? "%r{" : "/"] as Plugin.Doc[]) .concat(docs) .concat(useBraces ? "}" : "/", node.ending.slice(1)) ); -} +}; module.exports = { regexp_literal: printRegexpLiteral diff --git a/src/ruby/nodes/rescue.js b/src/ruby/nodes/rescue.ts similarity index 79% rename from src/ruby/nodes/rescue.js rename to src/ruby/nodes/rescue.ts index e1e6f472..e649462c 100644 --- a/src/ruby/nodes/rescue.js +++ b/src/ruby/nodes/rescue.ts @@ -1,3 +1,6 @@ +import type * as Prettier from "prettier"; +import type { Plugin, Ruby } from "./types"; + const { align, concat, @@ -9,23 +12,23 @@ const { } = require("../../prettier"); const { literal } = require("../../utils"); -function printBegin(path, opts, print) { +const printBegin: Plugin.Printer = (path, opts, print) => { return concat([ "begin", indent(concat([hardline, concat(path.map(print, "body"))])), hardline, "end" ]); -} +}; -function printEnsure(path, opts, print) { +const printEnsure: Plugin.Printer = (path, opts, print) => { return concat([ path.call(print, "body", 0), indent(concat([hardline, path.call(print, "body", 1)])) ]); -} +}; -function printRescue(path, opts, print) { +const printRescue: Plugin.Printer = (path, opts, print) => { const parts = ["rescue"]; if (path.getValue().body[0]) { @@ -37,7 +40,7 @@ function printRescue(path, opts, print) { parts.push(" StandardError"); } - const bodystmt = path.call(print, "body", 1); + const bodystmt = path.call(print, "body", 1) as Prettier.doc.builders.Concat; if (bodystmt.parts.length > 0) { parts.push(indent(concat([hardline, bodystmt]))); @@ -50,11 +53,11 @@ function printRescue(path, opts, print) { } return group(concat(parts)); -} +}; // This is a container node that we're adding into the AST that isn't present in // Ripper solely so that we have a nice place to attach inline comments. -function printRescueEx(path, opts, print) { +const printRescueEx: Plugin.Printer = (path, opts, print) => { const [exception, variable] = path.getValue().body; const parts = []; @@ -74,9 +77,9 @@ function printRescueEx(path, opts, print) { } return group(concat(parts)); -} +}; -function printRescueMod(path, opts, print) { +const printRescueMod: Plugin.Printer = (path, opts, print) => { const [statementDoc, valueDoc] = path.map(print, "body"); return concat([ @@ -88,7 +91,7 @@ function printRescueMod(path, opts, print) { hardline, "end" ]); -} +}; module.exports = { begin: printBegin, diff --git a/src/ruby/nodes/return.js b/src/ruby/nodes/return.ts similarity index 81% rename from src/ruby/nodes/return.js rename to src/ruby/nodes/return.ts index fcd46466..580ef8dd 100644 --- a/src/ruby/nodes/return.js +++ b/src/ruby/nodes/return.ts @@ -1,3 +1,5 @@ +import type { Plugin, Ruby } from "./types"; + const { concat, group, @@ -11,8 +13,8 @@ const { literal } = require("../../utils"); // You can't skip the parentheses if you have comments or certain operators with // lower precedence than the return keyword. -const canSkipParens = (args) => { - const stmts = args.body[0].body[0]; +function canSkipParens(args: Ruby.Args | Ruby.ArgsAddStar) { + const stmts = (args.body[0] as any).body[0] as Ruby.Stmts; // return( // # a @@ -35,10 +37,12 @@ const canSkipParens = (args) => { } return true; -}; +} + +type CallArgs = [Plugin.Print, ...PropertyKey[]]; -const printReturn = (path, opts, print) => { - let args = path.getValue().body[0].body[0]; +const printReturn: Plugin.Printer = (path, opts, print) => { + let args = path.getValue().body[0].body[0] as Ruby.Args | Ruby.ArgsAddStar; let steps = ["body", 0, "body", 0]; if (args.body.length === 1) { @@ -46,7 +50,7 @@ const printReturn = (path, opts, print) => { // content of the parens so that we can skip printing parens if we don't // want them. if (args.body[0] && args.body[0].type === "paren" && canSkipParens(args)) { - args = args.body[0].body[0]; + args = args.body[0].body[0] as any as Ruby.Args | Ruby.ArgsAddStar; steps = steps.concat("body", 0, "body", 0); } @@ -66,7 +70,7 @@ const printReturn = (path, opts, print) => { // Now that we've established which actual node is the arguments to return, // we grab it out of the path by diving down the steps that we've set up. - const parts = path.call.apply(path, [print].concat(steps)); + const parts = path.call.apply(path, ([print] as CallArgs).concat(steps) as CallArgs) as Plugin.Doc[]; // If we got the value straight out of the parens, then `parts` would only // be a singular doc as opposed to an array. diff --git a/src/ruby/nodes/statements.js b/src/ruby/nodes/statements.js deleted file mode 100644 index 0c40114a..00000000 --- a/src/ruby/nodes/statements.js +++ /dev/null @@ -1,142 +0,0 @@ -const { - breakParent, - concat, - dedent, - group, - hardline, - indent, - join, - line, - literalline, - softline, - trim -} = require("../../prettier"); - -const { isEmptyStmts } = require("../../utils"); - -function printBodyStmt(path, opts, print) { - const [stmts, rescue, elseClause, ensure] = path.getValue().body; - const parts = []; - - if (!isEmptyStmts(stmts)) { - parts.push(path.call(print, "body", 0)); - } - - if (rescue) { - parts.push(dedent(concat([hardline, path.call(print, "body", 1)]))); - } - - if (elseClause) { - // Before Ruby 2.6, this piece of bodystmt was an explicit "else" node - /* istanbul ignore next */ - const stmts = - elseClause.type === "else" - ? path.call(print, "body", 2, "body", 0) - : path.call(print, "body", 2); - - parts.push(concat([dedent(concat([hardline, "else"])), hardline, stmts])); - } - - if (ensure) { - parts.push(dedent(concat([hardline, path.call(print, "body", 3)]))); - } - - return group(concat(parts)); -} - -const argNodeTypes = ["args", "args_add_star", "args_add_block"]; - -function printParen(path, opts, print) { - const contentNode = path.getValue().body[0]; - - if (!contentNode) { - return "()"; - } - - let contentDoc = path.call(print, "body", 0); - - // If the content is params, we're going to let it handle its own parentheses - // so that it breaks nicely. - if (contentNode.type === "params") { - return contentDoc; - } - - // If we have an arg type node as the contents, then it's going to return an - // array, so we need to explicitly join that content here. - if (argNodeTypes.includes(contentNode.type)) { - contentDoc = join(concat([",", line]), contentDoc); - } - - return group( - concat(["(", indent(concat([softline, contentDoc])), softline, ")"]) - ); -} - -module.exports = { - "@__end__": (path, _opts, _print) => { - const { body } = path.getValue(); - return concat([trim, "__END__", literalline, body]); - }, - "@comment"(path, opts, _print) { - return opts.printer.printComment(path); - }, - bodystmt: printBodyStmt, - paren: printParen, - program: (path, opts, print) => - concat([join(hardline, path.map(print, "body")), hardline]), - stmts: (path, opts, print) => { - const stmts = path.getValue().body; - - // This is a special case where we have only comments inside a statement - // list. In this case we want to avoid doing any kind of line number - // tracking and just print out the comments. - if ( - stmts.length === 1 && - stmts[0].type === "void_stmt" && - stmts[0].comments - ) { - const comments = path.map( - (commentPath) => { - commentPath.getValue().printed = true; - return opts.printer.printComment(commentPath); - }, - "body", - 0, - "comments" - ); - - return concat([breakParent, join(hardline, comments)]); - } - - const parts = []; - let lineNo = null; - - stmts.forEach((stmt, index) => { - if (stmt.type === "void_stmt") { - return; - } - - const printed = path.call(print, "body", index); - - if (lineNo === null) { - parts.push(printed); - } else if ( - stmt.sl - lineNo > 1 || - [stmt.type, stmts[index - 1].type].includes("access_ctrl") - ) { - parts.push(hardline, hardline, printed); - } else if ( - stmt.sl !== lineNo || - path.getParentNode().type !== "string_embexpr" - ) { - parts.push(hardline, printed); - } else { - parts.push("; ", printed); - } - - lineNo = stmt.el; - }); - - return concat(parts); - } -}; diff --git a/src/ruby/nodes/statements.ts b/src/ruby/nodes/statements.ts new file mode 100644 index 00000000..6052f961 --- /dev/null +++ b/src/ruby/nodes/statements.ts @@ -0,0 +1,153 @@ +import type { Plugin, Ruby } from "./types"; + +const { + breakParent, + concat, + dedent, + group, + hardline, + indent, + join, + line, + literalline, + softline, + trim +} = require("../../prettier"); + +const { isEmptyStmts } = require("../../utils"); + +const printBodyStmt: Plugin.Printer = (path, opts, print) => { + const [stmts, rescue, elseClause, ensure] = path.getValue().body; + const parts = []; + + if (!isEmptyStmts(stmts)) { + parts.push(path.call(print, "body", 0)); + } + + if (rescue) { + parts.push(dedent(concat([hardline, path.call(print, "body", 1)]))); + } + + if (elseClause) { + // Before Ruby 2.6, this piece of bodystmt was an explicit "else" node + /* istanbul ignore next */ + const stmts = + (elseClause as any).type === "else" + ? path.call(print, "body", 2, "body", 0) + : path.call(print, "body", 2); + + parts.push(concat([dedent(concat([hardline, "else"])), hardline, stmts])); + } + + if (ensure) { + parts.push(dedent(concat([hardline, path.call(print, "body", 3)]))); + } + + return group(concat(parts)); +}; + +const argNodeTypes = ["args", "args_add_star", "args_add_block"]; + +const printParen: Plugin.Printer = (path, opts, print) => { + const contentNode = path.getValue().body[0]; + + if (!contentNode) { + return "()"; + } + + let contentDoc = path.call(print, "body", 0); + + // If the content is params, we're going to let it handle its own parentheses + // so that it breaks nicely. + if (contentNode.type === "params") { + return contentDoc; + } + + // If we have an arg type node as the contents, then it's going to return an + // array, so we need to explicitly join that content here. + if (argNodeTypes.includes(contentNode.type)) { + contentDoc = join(concat([",", line]), contentDoc); + } + + return group( + concat(["(", indent(concat([softline, contentDoc])), softline, ")"]) + ); +}; + +const printEndContent: Plugin.Printer = (path, opts, print) => { + const { body } = path.getValue(); + return concat([trim, "__END__", literalline, body]); +}; + +const printComment: Plugin.Printer = (path, opts, print) => { + return opts.printer.printComment(path); +}; + +const printProgram: Plugin.Printer = (path, opts, print) => { + return concat([join(hardline, path.map(print, "body")), hardline]); +}; + +const printStmts: Plugin.Printer = (path, opts, print) => { + const stmts = path.getValue().body; + + // This is a special case where we have only comments inside a statement + // list. In this case we want to avoid doing any kind of line number + // tracking and just print out the comments. + if ( + stmts.length === 1 && + stmts[0].type === "void_stmt" && + stmts[0].comments + ) { + const comments = path.map( + (commentPath) => { + commentPath.getValue().printed = true; + return opts.printer.printComment(commentPath); + }, + "body", + 0, + "comments" + ); + + return concat([breakParent, join(hardline, comments)]); + } + + const parts: Plugin.Doc[] = []; + let lineNo: null | number = null; + + stmts.forEach((stmt, index) => { + if (stmt.type === "void_stmt") { + return; + } + + const printed = path.call(print, "body", index); + + if (lineNo === null) { + parts.push(printed); + } else if ( + stmt.sl - lineNo > 1 || + [stmt.type, stmts[index - 1].type].includes("access_ctrl") + ) { + parts.push(hardline, hardline, printed); + } else if ( + stmt.sl !== lineNo || + path.getParentNode().type !== "string_embexpr" + ) { + parts.push(hardline, printed); + } else { + parts.push("; ", printed); + } + + lineNo = stmt.el; + }); + + return concat(parts); +}; + +module.exports = { + "@__end__": printEndContent, + "@comment": printComment, + bodystmt: printBodyStmt, + paren: printParen, + program: printProgram, + stmts: printStmts +}; diff --git a/src/ruby/nodes/strings.js b/src/ruby/nodes/strings.ts similarity index 81% rename from src/ruby/nodes/strings.js rename to src/ruby/nodes/strings.ts index bb78e76a..f5b654d4 100644 --- a/src/ruby/nodes/strings.js +++ b/src/ruby/nodes/strings.ts @@ -1,3 +1,5 @@ +import type { Plugin, Ruby } from "./types"; + const { concat, group, @@ -14,7 +16,7 @@ const { // quote the user chose. (If they chose single quotes, then double quoting // would activate the escape sequence, and if they chose double quotes, then // single quotes would deactivate it.) -function isQuoteLocked(node) { +function isQuoteLocked(node: Ruby.DynaSymbol | Ruby.StringLiteral) { return node.body.some( (part) => part.type === "@tstring_content" && @@ -24,7 +26,7 @@ function isQuoteLocked(node) { // A string is considered to be able to use single quotes if it contains only // plain string content and that content does not contain a single quote. -function isSingleQuotable(node) { +function isSingleQuotable(node: Ruby.DynaSymbol | Ruby.StringLiteral) { return node.body.every( (part) => part.type === "@tstring_content" && !part.body.includes("'") ); @@ -32,7 +34,7 @@ function isSingleQuotable(node) { const quotePattern = new RegExp("\\\\([\\s\\S])|(['\"])", "g"); -function normalizeQuotes(content, enclosingQuote) { +function normalizeQuotes(content: string, enclosingQuote: string) { // Escape and unescape single and double quotes as needed to be able to // enclose `content` with `enclosingQuote`. return content.replace(quotePattern, (match, escaped, quote) => { @@ -55,14 +57,16 @@ const quotePairs = { "<": ">" }; -function getClosingQuote(quote) { +type Quote = keyof typeof quotePairs; + +function getClosingQuote(quote: string) { if (!quote.startsWith("%")) { return quote; } - const boundary = /%[Qq]?(.)/.exec(quote)[1]; + const boundary = /%[Qq]?(.)/.exec(quote)![1]; if (boundary in quotePairs) { - return quotePairs[boundary]; + return quotePairs[boundary as Quote]; } return boundary; @@ -71,7 +75,7 @@ function getClosingQuote(quote) { // Prints a @CHAR node. @CHAR nodes are special character strings that usually // are strings of length 1. If they're any longer than we'll try to apply the // correct quotes. -function printChar(path, { rubySingleQuote }, _print) { +const printChar: Plugin.Printer = (path, { rubySingleQuote }, _print) => { const { body } = path.getValue(); if (body.length !== 2) { @@ -80,9 +84,9 @@ function printChar(path, { rubySingleQuote }, _print) { const quote = rubySingleQuote ? "'" : '"'; return concat([quote, body.slice(1), quote]); -} +}; -function printPercentSDynaSymbol(path, opts, print) { +const printPercentSDynaSymbol: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); const parts = []; @@ -103,15 +107,15 @@ function printPercentSDynaSymbol(path, opts, print) { // Push on the closing character, which is the opposite of the third // character from the opening. - parts.push(quotePairs[node.quote[2]]); + parts.push(quotePairs[node.quote[2] as Quote]); return concat(parts); -} +}; // We don't actually want to print %s symbols, as they're much more rarely seen // in the wild. But we're going to be forced into it if it's a multi-line symbol // or if the quoting would get super complicated. -function shouldPrintPercentSDynaSymbol(node) { +function shouldPrintPercentSDynaSymbol(node: Ruby.DynaSymbol) { // We shouldn't print a %s dyna symbol if it was not already that way in the // original source. if (node.quote[0] !== "%") { @@ -121,7 +125,7 @@ function shouldPrintPercentSDynaSymbol(node) { // Here we're going to check if there is a closing character, a new line, or a // quote in the content of the dyna symbol. If there is, then quoting could // get weird, so just bail out and stick to the original bounds in the source. - const closing = quotePairs[node.quote[2]]; + const closing = quotePairs[node.quote[2] as Quote]; return node.body.some( (child) => @@ -139,7 +143,7 @@ function shouldPrintPercentSDynaSymbol(node) { // // In the case of a plain dyna symbol, node.quote will be either :" or :' // For %s dyna symbols, node.quote will be %s[, %s(, %s{, or %s< -function printDynaSymbol(path, opts, print) { +const printDynaSymbol: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); if (shouldPrintPercentSDynaSymbol(node)) { @@ -147,7 +151,7 @@ function printDynaSymbol(path, opts, print) { } const parts = []; - let quote; + let quote: string; if (isQuoteLocked(node)) { if (node.quote.startsWith("%")) { @@ -162,8 +166,9 @@ function printDynaSymbol(path, opts, print) { } parts.push(quote); + path.each((childPath) => { - const child = childPath.getValue(); + const child = childPath.getValue() as Ruby.StringContent; if (child.type !== "@tstring_content") { parts.push(print(childPath)); @@ -184,21 +189,21 @@ function printDynaSymbol(path, opts, print) { } return concat(parts); -} +}; -function printStringConcat(path, opts, print) { +const printStringConcat: Plugin.Printer = (path, opts, print) => { const [leftDoc, rightDoc] = path.map(print, "body"); return group(concat([leftDoc, " \\", indent(concat([hardline, rightDoc]))])); -} +}; // Prints out an interpolated variable in the string by converting it into an // embedded expression. -function printStringDVar(path, opts, print) { +const printStringDVar: Plugin.Printer = (path, opts, print) => { return concat(["#{", path.call(print, "body", 0), "}"]); -} +}; -function printStringEmbExpr(path, opts, print) { +const printStringEmbExpr: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); const parts = path.call(print, "body", 0); @@ -212,13 +217,13 @@ function printStringEmbExpr(path, opts, print) { return group( concat(["#{", indent(concat([softline, parts])), concat([softline, "}"])]) ); -} +}; // Prints out a literal string. This function does its best to respect the // wishes of the user with regards to single versus double quotes, but if the // string contains any escape expressions then it will just keep the original // quotes. -function printStringLiteral(path, { rubySingleQuote }, print) { +const printStringLiteral: Plugin.Printer = (path, { rubySingleQuote }, print) => { const node = path.getValue(); // If the string is empty, it will not have any parts, so just print out the @@ -228,7 +233,7 @@ function printStringLiteral(path, { rubySingleQuote }, print) { } // Determine the quote that should enclose the new string - let quote; + let quote: string; if (isQuoteLocked(node)) { quote = node.quote; } else { @@ -246,19 +251,19 @@ function printStringLiteral(path, { rubySingleQuote }, print) { }); return concat([quote].concat(parts).concat(getClosingQuote(quote))); -} +}; // Prints out a symbol literal. Its child will always be the ident that // represents the string content of the symbol. -function printSymbolLiteral(path, opts, print) { +const printSymbolLiteral: Plugin.Printer = (path, opts, print) => { return concat([":", path.call(print, "body", 0)]); -} +}; // Prints out an xstring literal. Its child is an array of string parts, // including plain string content and interpolated content. -function printXStringLiteral(path, opts, print) { - return concat(["`"].concat(path.map(print, "body")).concat("`")); -} +const printXStringLiteral: Plugin.Printer = (path, opts, print) => { + return concat((["`"] as Plugin.Doc[]).concat(path.map(print, "body")).concat("`")); +}; module.exports = { "@CHAR": printChar, diff --git a/src/ruby/nodes/super.js b/src/ruby/nodes/super.ts similarity index 87% rename from src/ruby/nodes/super.js rename to src/ruby/nodes/super.ts index 32d625eb..2bf68c7f 100644 --- a/src/ruby/nodes/super.js +++ b/src/ruby/nodes/super.ts @@ -1,7 +1,9 @@ +import type { Plugin, Ruby } from "./types"; + const { align, concat, group, join, line } = require("../../prettier"); const { literal } = require("../../utils"); -function printSuper(path, opts, print) { +const printSuper: Plugin.Printer = (path, opts, print) => { const args = path.getValue().body[0]; if (args.type === "arg_paren") { @@ -24,7 +26,7 @@ function printSuper(path, opts, print) { align(keyword.length, group(join(concat([",", line]), argsDocs))) ]) ); -} +}; // Version of super without any parens or args. const printZSuper = literal("super"); diff --git a/src/ruby/nodes/types.ts b/src/ruby/nodes/types.ts index dd176bd6..ceb3a224 100644 --- a/src/ruby/nodes/types.ts +++ b/src/ruby/nodes/types.ts @@ -1,16 +1,58 @@ +import type * as Prettier from "prettier"; + +// This namespace contains everything to do with the Ruby prettier plugin. +export namespace Plugin { + // We're doing weird things here with the types because if you pass a generic + // type to AstPath it gets overly restrictive. + + // This is just a simple alias for the doc nodes. + export type Doc = Prettier.doc.builders.Doc; + + // We're overwriting call and map here because if you restrict the AST for the + // main path then presumably you're printing a lower node in the tree that + // won't match the current AST type. + export type Path = Omit, "call" | "each" | "getParentNode" | "map"> & { + call: (callback: (path: Path) => U, ...names: PropertyKey[]) => U, + each: (callback: (path: Path, index: number, value: any) => void, ...names: PropertyKey[]) => void, + getParentNode: (count?: number | undefined) => any | null, + map: (callback: (path: Path, index: number, value: any) => U, ...names: PropertyKey[]) => U[] + }; + + // This is the regular prettier options + the options defined by this plugin. + type Options = Prettier.ParserOptions & { + printer: any, // TODO: make this the ruby printer + rubyArrayLiteral: boolean, + rubyHashLabel: boolean, + rubyModifier: boolean, + rubyNetcatCommand?: string, + rubySingleQuote: boolean, + rubyToProc: boolean + }; + + // This is the regular print node, except it's not restricted by the AST that + // is passed to the parent AST. + export type Print = (path: Path) => Doc; + + export type Printer = (path: Path, options: Options, print: Print) => Doc; +} + +// This namespace contains everything to do with the types of the various nodes +// within the syntax tree generated from the Ruby parser. export namespace Ruby { // These are utility types used to construct the various node types. - type ScannerEvent = { type: `@${T}`, body: string, comments?: Comment[] }; - type ParserEvent0 = ScannerEvent; - type ParserEvent = { type: T, sl: number, el: number, sc: number, ec: number, comments?: Comment[] } & V; + type Location = { sl: number, el: number, sc: number, ec: number }; + type ScannerEvent = { type: `@${T}`, body: string, comments?: Comment[] } & Location; + type ParserEvent0 = { type: T, body: string, comments?: Comment[] } & Location; + type ParserEvent = { type: T, comments?: Comment[] } & Location & V; // This is the main expression type that goes in places where the AST will // accept just about anything. - type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgsForward | Array | Assign | BEGIN | Backref | Begin | Binary | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | Defsl | Dot2 | Dot3 | DynaSymbol | END | Fcall | Field | Float | For | GVar | Hash | Heredoc | IVar | Identifier | If | IfModifier | Ternary | Imaginary | Int | Keyword | Lambda | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsAddPost | MlhsAddStar | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Op | Opassign | Paren | Qsymbols | Qwords | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueModifier | Retry | Return | Return0 | Sclass | String | StringConcat | StringLiteral | Super | SymbolLiteral | Symbols | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VarAlias | VarField | VarRef | VCall | VoidStmt | While | WhileModifier | Words | XStringLiteral | Yield | Yield0 | Zsuper; + export type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgsForward | Array | Assign | BEGIN | Backref | Begin | Binary | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | Defsl | Dot2 | Dot3 | DynaSymbol | END | Fcall | Field | Float | For | GVar | Hash | Heredoc | IVar | Identifier | If | IfModifier | Ternary | Imaginary | Int | Keyword | Label | Lambda | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsAddPost | MlhsAddStar | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Op | Opassign | Params | Paren | Qsymbols | Qwords | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueModifier | Retry | Return | Return0 | Sclass | String | StringConcat | StringLiteral | Super | SymbolLiteral | Symbols | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VarAlias | VarField | VarRef | VCall | VoidStmt | While | WhileModifier | Words | XStringLiteral | Yield | Yield0 | Zsuper; // This is a special scanner event that contains a comment. It can be attached // to almost any kind of node, which is why it's pulled out here separately. - export type Comment = { type: "@comment", value: string, inline: boolean }; + type UndecoratedComment = { type: "@comment", value: string, inline: boolean }; + export type Comment = UndecoratedComment & { leading: boolean }; // These are the scanner events that contain only a single string. They're // always leaves in the tree. Ignored ones that can't show up in the tree but @@ -71,7 +113,7 @@ export namespace Ruby { // These are various parser events that have to do with string or string-like // nodes. - type StringContent = StringDVar | StringEmbExpr | TStringContent; + export type StringContent = StringDVar | StringEmbExpr | TStringContent; export type DynaSymbol = ParserEvent<"dyna_symbol", { body: StringContent[], quote: string }>; export type Heredoc = ParserEvent<"heredoc", { beging: HeredocBegin, ending: string, body: StringContent[] }>; export type RegexpLiteral = ParserEvent<"regexp_literal", { body: StringContent[], beging: string, ending: string }>; @@ -149,17 +191,19 @@ export namespace Ruby { // These are various parser events for pattern matching. export type Aryptn = ParserEvent<"aryptn", { body: [null | VarRef, AnyNode[], null | VarField, null | AnyNode[]] }>; - export type FndPtn = ParserEvent<"fndptn", { body: [null | AnyNode, AnyNode[], Stmts, null | AnyNode[]] }>; - export type Hshptn = ParserEvent<"hshptn", { body: [null | AnyNode, [Label, AnyNode][] | Stmts, null | VarField] }>; + export type FndPtn = ParserEvent<"fndptn", { body: [null | AnyNode, VarField, AnyNode[], VarField] }>; + export type Hshptn = ParserEvent<"hshptn", { body: [null | AnyNode, [Label, AnyNode][], null | VarField] }>; export type Rassign = ParserEvent<"rassign", { body: [AnyNode, AnyNode], keyword: boolean }>; // These are various parser events for method declarations. + type ParenAroundParams = Omit & { body: [Params] }; export type Blockarg = ParserEvent<"blockarg", { body: [Identifier] }>; export type Def = ParserEvent<"def", { body: [Backtick | Const | Identifier | Keyword | Op, Params | Paren, Bodystmt] }>; export type Defs = ParserEvent<"defs", { body: [AnyNode, Op | Period, Const | Op | Identifier | Keyword, Params | Paren, Bodystmt] }>; - export type Defsl = ParserEvent<"defsl", { body: [Identifier, null | Paren, AnyNode] }>; + export type Defsl = ParserEvent<"defsl", { body: [Identifier, null | ParenAroundParams, AnyNode] }>; export type KeywordRestParam = ParserEvent<"kwrest_param", { body: [null | Identifier] }>; - export type Params = ParserEvent<"params", { body: [Identifier[], null | [Identifier, AnyNode][], null | ArgsForward | RestParam, Identifier[], null | [Label, AnyNode][], null | "nil" | KeywordRestParam, null | Blockarg] }>; + export type Lambda = ParserEvent<"lambda", { body: [Params | ParenAroundParams, Bodystmt | Stmts] }>; + export type Params = ParserEvent<"params", { body: [Identifier[], null | [Identifier, AnyNode][], null | ArgsForward | ExcessedComma | RestParam, Identifier[], null | [Label, AnyNode][], null | "nil" | KeywordRestParam, null | Blockarg] }>; export type RestParam = ParserEvent<"rest_param", { body: [null | Identifier] }>; // These are various parser events for method calls. @@ -189,7 +233,6 @@ export namespace Ruby { export type Dot2 = ParserEvent<"dot2", { body: [AnyNode, null] | [null, AnyNode] | [AnyNode, AnyNode] }>; export type Dot3 = ParserEvent<"dot3", { body: [AnyNode, null] | [null, AnyNode] | [AnyNode, AnyNode] }>; export type END = ParserEvent<"END", { body: [Lbrace, Stmts] }>; - export type Lambda = ParserEvent<"lambda", { body: [Params | Paren, Bodystmt | Stmts] }>; export type Paren = ParserEvent<"paren", { body: [AnyNode] }>; export type TopConstRef = ParserEvent<"top_const_ref", { body: [Const] }>; export type Unary = ParserEvent<"unary", { body: AnyNode, oper: string, paren: boolean | undefined }>; diff --git a/src/ruby/nodes/undef.js b/src/ruby/nodes/undef.ts similarity index 78% rename from src/ruby/nodes/undef.js rename to src/ruby/nodes/undef.ts index 1e2bbb34..d35b7f20 100644 --- a/src/ruby/nodes/undef.js +++ b/src/ruby/nodes/undef.ts @@ -1,3 +1,5 @@ +import type { Plugin, Ruby } from "./types"; + const { addTrailingComment, align, @@ -7,7 +9,7 @@ const { line } = require("../../prettier"); -function printUndefSymbol(path, opts, print) { +const printUndefSymbol: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); // Since we're going to descend into the symbol literal to grab out the ident @@ -20,9 +22,9 @@ function printUndefSymbol(path, opts, print) { } return path.call(print, "body", 0); -} +}; -function printUndef(path, opts, print) { +const printUndef: Plugin.Printer = (path, opts, print) => { const keyword = "undef "; const argNodes = path.map( (symbolPath) => printUndefSymbol(symbolPath, opts, print), @@ -35,7 +37,7 @@ function printUndef(path, opts, print) { align(keyword.length, join(concat([",", line]), argNodes)) ]) ); -} +}; module.exports = { undef: printUndef From e0c8f390c3444baadfe5595fe8bb396daeed3d80 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 17 Sep 2021 16:52:05 -0400 Subject: [PATCH 223/785] Start to convert the ruby plugin declaration parts --- src/ruby/embed.js | 2 +- src/ruby/nodes/types.ts | 18 ++-- src/ruby/parser.js | 37 -------- src/ruby/parser.ts | 32 +++++++ src/ruby/printer.js | 147 ------------------------------ src/ruby/printer.ts | 145 +++++++++++++++++++++++++++++ src/ruby/{toProc.js => toProc.ts} | 24 +++-- 7 files changed, 207 insertions(+), 198 deletions(-) delete mode 100644 src/ruby/parser.js create mode 100644 src/ruby/parser.ts delete mode 100644 src/ruby/printer.js create mode 100644 src/ruby/printer.ts rename src/ruby/{toProc.js => toProc.ts} (82%) diff --git a/src/ruby/embed.js b/src/ruby/embed.js index aa19e737..6e000807 100644 --- a/src/ruby/embed.js +++ b/src/ruby/embed.js @@ -73,7 +73,7 @@ function stripCommonLeadingWhitespace(content) { function embed(path, print, textToDoc, _opts) { const node = path.getValue(); - + // Currently we only support embedded formatting on heredoc nodes if (node.type !== "heredoc") { return null; diff --git a/src/ruby/nodes/types.ts b/src/ruby/nodes/types.ts index ceb3a224..15f81395 100644 --- a/src/ruby/nodes/types.ts +++ b/src/ruby/nodes/types.ts @@ -19,8 +19,8 @@ export namespace Plugin { }; // This is the regular prettier options + the options defined by this plugin. - type Options = Prettier.ParserOptions & { - printer: any, // TODO: make this the ruby printer + export type Options = Prettier.ParserOptions & { + printer: Prettier.Printer, rubyArrayLiteral: boolean, rubyHashLabel: boolean, rubyModifier: boolean, @@ -40,10 +40,16 @@ export namespace Plugin { // within the syntax tree generated from the Ruby parser. export namespace Ruby { // These are utility types used to construct the various node types. + type Comments = { comments?: Comment[] }; type Location = { sl: number, el: number, sc: number, ec: number }; - type ScannerEvent = { type: `@${T}`, body: string, comments?: Comment[] } & Location; - type ParserEvent0 = { type: T, body: string, comments?: Comment[] } & Location; - type ParserEvent = { type: T, comments?: Comment[] } & Location & V; + + type ScannerEvent = { type: `@${T}`, body: string } & Comments & Location; + type ParserEvent0 = { type: T, body: string } & Comments & Location; + type ParserEvent = { type: T } & Comments & Location & V; + + // This is a useful node type to have around when you're just looking at + // comparing any generic node. + export type Node = { type: string } & Comments & Location; // This is the main expression type that goes in places where the AST will // accept just about anything. @@ -207,7 +213,7 @@ export namespace Ruby { export type RestParam = ParserEvent<"rest_param", { body: [null | Identifier] }>; // These are various parser events for method calls. - type CallOperator = Op | Period | "::"; + export type CallOperator = Op | Period | "::"; export type ArgParen = ParserEvent<"arg_paren", { body: [Args | ArgsAddBlock | ArgsForward | null] }>; export type Args = ParserEvent<"args", { body: AnyNode[] }>; export type ArgsAddBlock = ParserEvent<"args_add_block", { body: [Args | ArgsAddStar, false | AnyNode] }>; diff --git a/src/ruby/parser.js b/src/ruby/parser.js deleted file mode 100644 index 62aaf3fe..00000000 --- a/src/ruby/parser.js +++ /dev/null @@ -1,37 +0,0 @@ -const parseSync = require("../parser/parseSync"); - -// This function is responsible for taking an input string of text and returning -// to prettier a JavaScript object that is the equivalent AST that represents -// the code stored in that string. We accomplish this by spawning a new Ruby -// process of parser.rb and reading JSON off STDOUT. -function parse(text, _parsers, opts) { - return parseSync("ruby", text, opts); -} - -// This function handles checking whether or not the source string has the -// pragma for prettier. This is an optional workflow for incremental adoption. -function hasPragma(text) { - return /^\s*#[^\S\n]*@(format|prettier)\s*(\n|$)/.test(text); -} - -// This function is critical for comments and cursor support, and is responsible -// for returning the index of the character within the source string that is the -// beginning of the given node. -function locStart(node) { - return node.sc; -} - -// This function is critical for comments and cursor support, and is responsible -// for returning the index of the character within the source string that is the -// ending of the given node. -function locEnd(node) { - return node.ec; -} - -module.exports = { - parse, - astFormat: "ruby", - hasPragma, - locStart, - locEnd -}; diff --git a/src/ruby/parser.ts b/src/ruby/parser.ts new file mode 100644 index 00000000..3ef3b94c --- /dev/null +++ b/src/ruby/parser.ts @@ -0,0 +1,32 @@ +import type { Parser } from "prettier"; +import parseSync from "../parser/parseSync"; + +const parser: Parser = { + // This function is responsible for taking an input string of text and returning + // to prettier a JavaScript object that is the equivalent AST that represents + // the code stored in that string. We accomplish this by spawning a new Ruby + // process of parser.rb and reading JSON off STDOUT. + parse(text, _parsers, opts) { + return parseSync("ruby", text, opts); + }, + astFormat: "ruby", + // This function handles checking whether or not the source string has the + // pragma for prettier. This is an optional workflow for incremental adoption. + hasPragma(text) { + return /^\s*#[^\S\n]*@(format|prettier)\s*(\n|$)/.test(text); + }, + // This function is critical for comments and cursor support, and is responsible + // for returning the index of the character within the source string that is the + // beginning of the given node. + locStart(node) { + return node.sc; + }, + // This function is critical for comments and cursor support, and is responsible + // for returning the index of the character within the source string that is the + // ending of the given node. + locEnd(node) { + return node.ec; + } +}; + +module.exports = parser; diff --git a/src/ruby/printer.js b/src/ruby/printer.js deleted file mode 100644 index b0a91e6c..00000000 --- a/src/ruby/printer.js +++ /dev/null @@ -1,147 +0,0 @@ -const { concat, trim } = require("../prettier"); - -const embed = require("./embed"); -const nodes = require("./nodes"); - -// This is the generic node print function, used to convert any node in the AST -// into its equivalent Doc representation. -function printNode(path, opts, print) { - const { type, body } = path.getValue(); - - if (type in nodes) { - return nodes[type](path, opts, print); - } - - if (type[0] === "@") { - return body; - } - - const ast = JSON.stringify(body, null, 2); - throw new Error(`Unsupported node encountered: ${type}\n${ast}`); -} - -// This is an escape-hatch to ignore nodes in the tree. If you have a comment -// that includes this pattern, then the entire node will be ignored and just the -// original source will be printed out. -function hasPrettierIgnore(path) { - const node = path.getValue(); - - return ( - node.comments && - node.comments.some((comment) => comment.value.includes("prettier-ignore")) - ); -} - -const noComments = [ - "args", - "args_add_block", - "args_add_star", - "mlhs", - "mlhs_add_post", - "mlhs_add_star", - "mlhs_paren" -]; - -// Certain nodes are used more for organizational purposed than for actually -// displaying content, so we tell prettier that we don't want comments attached -// to them. -function canAttachComment(node) { - return !noComments.includes(node.type); -} - -// This function tells prettier how to recurse down our AST so that it can find -// where it needs to attach the comments. -function getCommentChildNodes(node) { - switch (node.type) { - case "heredoc": - return [node.beging]; - case "aryptn": - return [node.body[0]] - .concat(node.body[1]) - .concat(node.body[2]) - .concat(node.body[3]); - case "hshptn": { - const pairs = node.body[1]; - const values = pairs.reduce((left, right) => left.concat(right), []); - - return [node.body[0]].concat(values).concat(node.body[2]); - } - case "params": { - const [reqs, optls, rest, post, kwargs, kwargRest, block] = node.body; - let parts = reqs || []; - - (optls || []).forEach((optl) => { - parts = parts.concat(optl); - }); - - if (rest) { - parts.push(rest); - } - - parts = parts.concat(post || []); - - (kwargs || []).forEach((kwarg) => { - if (kwarg[1]) { - parts = parts.concat(kwarg); - } else { - parts.push(kwarg[0]); - } - }); - - if (kwargRest && kwargRest !== "nil") { - parts.push(kwargRest); - } - - if (block) { - parts.push(block); - } - - return parts; - } - default: { - if (Array.isArray(node.body)) { - return node.body.filter((child) => child && typeof child === "object"); - } - return []; - } - } -} - -// This is the generic print function for any comment in the AST. It handles -// both regular comments that begin with a # and embdoc comments, which are -// surrounded by =begin..=end. -function printComment(path, _opts) { - const comment = path.getValue(); - - if (comment.type === "@comment") { - return `#${comment.value}`; - } - - return concat([trim, comment.value]); -} - -// To be honest I'm not 100% sure this function is actually necessary, but it -// *feels* like a block comment equivalent in JavaScript so I'm going to leave -// it in place for now. -function isBlockComment(comment) { - return comment.type === "@embdoc"; -} - -// This function handles adding the format pragma to a source string. This is an -// optional workflow for incremental adoption. -function insertPragma(text) { - const boundary = text.startsWith("#") ? "\n" : "\n\n"; - - return `# @format${boundary}${text}`; -} - -module.exports = { - embed, - print: printNode, - hasPrettierIgnore, - canAttachComment, - getCommentChildNodes, - printComment, - isBlockComment, - insertPragma -}; diff --git a/src/ruby/printer.ts b/src/ruby/printer.ts new file mode 100644 index 00000000..472cee16 --- /dev/null +++ b/src/ruby/printer.ts @@ -0,0 +1,145 @@ +import type { Printer } from "prettier"; +import type { Plugin, Ruby } from "./nodes/types"; + +const { concat, trim } = require("../prettier"); + +const embed = require("./embed"); +const nodes = require("./nodes"); + +const noComments = [ + "args", + "args_add_block", + "args_add_star", + "mlhs", + "mlhs_add_post", + "mlhs_add_star", + "mlhs_paren" +]; + +type PluginPrinter = Printer & { + getCommentChildNodes: (node: any) => any[], + isBlockComment: (comment: any, options: Plugin.Options) => boolean +}; + +const printer: PluginPrinter = { + // Certain nodes are used more for organizational purposed than for actually + // displaying content, so we tell prettier that we don't want comments attached + // to them. + canAttachComment(node) { + return !noComments.includes(node.type); + }, + embed, + // This function tells prettier how to recurse down our AST so that it can + // find where it needs to attach the comments. The types on this are a little + // abysmal, but we're going to leave it as is to get this out. + getCommentChildNodes(node) { + switch (node.type) { + case "heredoc": + return [node.beging]; + case "aryptn": + return [node.body[0]] + .concat(node.body[1]) + .concat(node.body[2]) + .concat(node.body[3]); + case "hshptn": { + const pairs = node.body[1]; + const values = pairs.reduce((left: any, right: any) => left.concat(right), []); + + return [node.body[0]].concat(values).concat(node.body[2]); + } + case "params": { + const [reqs, optls, rest, post, kwargs, kwargRest, block] = node.body; + let parts = reqs || []; + + (optls || []).forEach((optl: any) => { + parts = parts.concat(optl); + }); + + if (rest) { + parts.push(rest); + } + + parts = parts.concat(post || []); + + (kwargs || []).forEach((kwarg: any) => { + if (kwarg[1]) { + parts = parts.concat(kwarg); + } else { + parts.push(kwarg[0]); + } + }); + + if (kwargRest && kwargRest !== "nil") { + parts.push(kwargRest); + } + + if (block) { + parts.push(block); + } + + return parts; + } + default: { + if (Array.isArray(node.body)) { + return node.body.filter((child: any) => child && typeof child === "object"); + } + return []; + } + } + }, + // This is an escape-hatch to ignore nodes in the tree. If you have a comment + // that includes this pattern, then the entire node will be ignored and just the + // original source will be printed out. + hasPrettierIgnore(path) { + const node = path.getValue(); + + return ( + node.comments && + node.comments.some((comment) => comment.value.includes("prettier-ignore")) || + false + ); + }, + // To be honest I'm not 100% sure this function is actually necessary, but it + // *feels* like a block comment equivalent in JavaScript so I'm going to leave + // it in place for now. + isBlockComment(comment) { + return comment.type === "@embdoc"; + }, + // This function handles adding the format pragma to a source string. This is an + // optional workflow for incremental adoption. + insertPragma(text) { + const boundary = text.startsWith("#") ? "\n" : "\n\n"; + + return `# @format${boundary}${text}`; + }, + // This is the generic node print function, used to convert any node in the AST + // into its equivalent Doc representation. + print(path, opts, print) { + const { type, body } = path.getValue() as any; + + if (type in nodes) { + return nodes[type](path, opts, print); + } + + if (type[0] === "@") { + return body; + } + + const ast = JSON.stringify(body, null, 2); + throw new Error(`Unsupported node encountered: ${type}\n${ast}`); + }, + // This is the generic print function for any comment in the AST. It handles + // both regular comments that begin with a # and embdoc comments, which are + // surrounded by =begin..=end. + printComment(path, _opts) { + const comment = (path as any as Plugin.Path).getValue(); + + if (comment.type === "@comment") { + return `#${comment.value}`; + } + + return concat([trim, comment.value]); + } +}; + +module.exports = printer; diff --git a/src/ruby/toProc.js b/src/ruby/toProc.ts similarity index 82% rename from src/ruby/toProc.js rename to src/ruby/toProc.ts index 5e88c969..1895dc06 100644 --- a/src/ruby/toProc.js +++ b/src/ruby/toProc.ts @@ -1,4 +1,14 @@ -const isCall = (node) => ["::", "."].includes(node) || node.type === "@period"; +import type { Plugin, Ruby } from "./nodes/types"; + +function isCall(node: Ruby.CallOperator) { + // Older versions of Ruby didn't have a @period ripper event, so we need to + // explicitly cast to any here. + if (node === "::" || (node as any) === ".") { + return true; + } + + return node.type === "@period"; +} // If you have a simple block that only calls a method on the single required // parameter that is passed to it, then you can replace that block with the @@ -11,7 +21,7 @@ const isCall = (node) => ["::", "."].includes(node) || node.type === "@period"; // [1, 2, 3].map(&:to_s) // // This works with `do` blocks as well. -const toProc = (path, node) => { +function toProc(path: Plugin.Path, node: Ruby.BraceBlock | Ruby.DoBlock) { const [variables, blockContents] = node.body; // Ensure that there are variables being passed to this block. @@ -31,7 +41,7 @@ const toProc = (path, node) => { return null; } - let statements; + let statements: Ruby.Stmts; if (blockContents.type === "bodystmt") { // We’re in a `do` block const blockStatements = blockContents.body[0]; @@ -60,14 +70,14 @@ const toProc = (path, node) => { } // Ensure the call is a method of the block argument - const [varRef, call, method, args] = statement.body; + const [varRef, call, method] = statement.body; if ( varRef.type !== "var_ref" || varRef.body[0].body !== reqParams[0].body || !isCall(call) || - method.type !== "@ident" || - args + method === "call" || + method.type !== "@ident" ) { return null; } @@ -100,6 +110,6 @@ const toProc = (path, node) => { } return `&:${method.body}`; -}; +} module.exports = toProc; From 3ab18d6255b89b97490a0efc2a64da6e593e61a9 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 17 Sep 2021 16:59:50 -0400 Subject: [PATCH 224/785] Convert over the utilities to TS --- src/ruby/nodes/args.ts | 4 +++- src/ruby/nodes/arrays.ts | 2 +- src/ruby/nodes/assign.ts | 2 +- src/ruby/nodes/blocks.ts | 2 +- src/ruby/nodes/calls.ts | 2 +- src/ruby/nodes/case.ts | 8 ++++---- src/ruby/nodes/class.ts | 2 +- src/ruby/nodes/commands.ts | 2 +- src/ruby/nodes/conditionals.ts | 13 +++++++++--- src/ruby/nodes/constants.ts | 2 +- src/ruby/nodes/flow.ts | 2 +- src/ruby/nodes/hashes.ts | 4 ++-- src/ruby/nodes/heredocs.ts | 2 +- src/ruby/nodes/lambdas.ts | 2 +- src/ruby/nodes/loops.ts | 3 +-- src/ruby/nodes/methods.ts | 19 +++++++++++++----- src/ruby/nodes/operators.ts | 2 +- src/ruby/nodes/params.ts | 2 +- src/ruby/nodes/regexp.ts | 2 +- src/ruby/nodes/rescue.ts | 2 +- src/ruby/nodes/return.ts | 2 +- src/ruby/nodes/statements.ts | 6 +++--- src/ruby/nodes/super.ts | 2 +- src/ruby/nodes/types.ts | 6 +++--- src/utils.js | 13 ------------ src/utils.ts | 12 +++++++++++ src/utils/containsAssignment.js | 11 ---------- src/utils/containsAssignment.ts | 18 +++++++++++++++++ src/utils/containsSingleConditional.js | 11 ---------- src/utils/getTrailingComma.js | 5 ----- src/utils/getTrailingComma.ts | 7 +++++++ src/utils/{hasAncestor.js => hasAncestor.ts} | 6 ++++-- ...eEnsureParens.js => inlineEnsureParens.ts} | 10 ++++++---- src/utils/isEmptyBodyStmt.js | 7 ------- src/utils/isEmptyBodyStmt.ts | 8 ++++++++ .../{isEmptyStmts.js => isEmptyStmts.ts} | 6 ++++-- src/utils/literal.js | 7 ------- src/utils/literal.ts | 9 +++++++++ src/utils/literallineWithoutBreakParent.js | 7 ------- src/utils/literallineWithoutBreakParent.ts | 9 +++++++++ src/utils/makeCall.js | 14 ------------- src/utils/makeCall.ts | 20 +++++++++++++++++++ src/utils/{noIndent.js => noIndent.ts} | 2 +- ...yCollection.js => printEmptyCollection.ts} | 14 +++++++------ ...kipAssignIndent.js => skipAssignIndent.ts} | 6 ++++-- 45 files changed, 166 insertions(+), 131 deletions(-) delete mode 100644 src/utils.js create mode 100644 src/utils.ts delete mode 100644 src/utils/containsAssignment.js create mode 100644 src/utils/containsAssignment.ts delete mode 100644 src/utils/containsSingleConditional.js delete mode 100644 src/utils/getTrailingComma.js create mode 100644 src/utils/getTrailingComma.ts rename src/utils/{hasAncestor.js => hasAncestor.ts} (60%) rename src/utils/{inlineEnsureParens.js => inlineEnsureParens.ts} (86%) delete mode 100644 src/utils/isEmptyBodyStmt.js create mode 100644 src/utils/isEmptyBodyStmt.ts rename src/utils/{isEmptyStmts.js => isEmptyStmts.ts} (53%) delete mode 100644 src/utils/literal.js create mode 100644 src/utils/literal.ts delete mode 100644 src/utils/literallineWithoutBreakParent.js create mode 100644 src/utils/literallineWithoutBreakParent.ts delete mode 100644 src/utils/makeCall.js create mode 100644 src/utils/makeCall.ts rename src/utils/{noIndent.js => noIndent.ts} (78%) rename src/utils/{printEmptyCollection.js => printEmptyCollection.ts} (72%) rename src/utils/{skipAssignIndent.js => skipAssignIndent.ts} (61%) diff --git a/src/ruby/nodes/args.ts b/src/ruby/nodes/args.ts index 06ffe43f..664bb2e9 100644 --- a/src/ruby/nodes/args.ts +++ b/src/ruby/nodes/args.ts @@ -1,6 +1,8 @@ import type * as Prettier from "prettier"; import type { Plugin, Ruby } from "./types"; +import { getTrailingComma } from "../../utils"; + const { concat, group, @@ -10,7 +12,7 @@ const { line, softline } = require("../../prettier"); -const { getTrailingComma } = require("../../utils"); + const toProc = require("../toProc"); const noTrailingComma = ["command", "command_call"]; diff --git a/src/ruby/nodes/arrays.ts b/src/ruby/nodes/arrays.ts index f60b2533..ce17c6f2 100644 --- a/src/ruby/nodes/arrays.ts +++ b/src/ruby/nodes/arrays.ts @@ -9,7 +9,7 @@ const { line, softline } = require("../../prettier"); -const { getTrailingComma, printEmptyCollection } = require("../../utils"); +import { getTrailingComma, printEmptyCollection } from "../../utils"; // Checks that every argument within this args node is a string_literal node // that has no spaces or interpolations. This means we're dealing with an array diff --git a/src/ruby/nodes/assign.ts b/src/ruby/nodes/assign.ts index 2a19be9c..3cdc2d8b 100644 --- a/src/ruby/nodes/assign.ts +++ b/src/ruby/nodes/assign.ts @@ -1,7 +1,7 @@ import type { Plugin, Ruby } from "./types"; const { concat, group, indent, join, line } = require("../../prettier"); -const { skipAssignIndent } = require("../../utils"); +import { skipAssignIndent } from "../../utils"; const printAssign: Plugin.Printer = (path, opts, print) => { const [_targetNode, valueNode] = path.getValue().body; diff --git a/src/ruby/nodes/blocks.ts b/src/ruby/nodes/blocks.ts index 1cd04765..c4b73c6c 100644 --- a/src/ruby/nodes/blocks.ts +++ b/src/ruby/nodes/blocks.ts @@ -10,7 +10,7 @@ const { removeLines, softline } = require("../../prettier"); -const { hasAncestor } = require("../../utils"); +import { hasAncestor } from "../../utils"; const printBlockVar: Plugin.Printer = (path, opts, print) => { const parts = ["|", removeLines(path.call(print, "body", 0))]; diff --git a/src/ruby/nodes/calls.ts b/src/ruby/nodes/calls.ts index fa2a17eb..39cd1cea 100644 --- a/src/ruby/nodes/calls.ts +++ b/src/ruby/nodes/calls.ts @@ -9,7 +9,7 @@ const { join, softline } = require("../../prettier"); -const { makeCall, noIndent } = require("../../utils"); +import { makeCall, noIndent } from "../../utils"; const toProc = require("../toProc"); diff --git a/src/ruby/nodes/case.ts b/src/ruby/nodes/case.ts index 66babacf..88d332d0 100644 --- a/src/ruby/nodes/case.ts +++ b/src/ruby/nodes/case.ts @@ -31,17 +31,17 @@ const printWhen: Plugin.Printer = (path, opts, print) => { // The `fill` builder command expects an array of docs alternating with // line breaks. This is so it can loop through and determine where to break. const preds = fill( - (path.call(print, "body", 0) as Plugin.Doc[]).reduce((accum, pred, index) => { + (path.call(print, "body", 0) as Plugin.Doc[]).reduce((accum: Plugin.Doc[], pred, index) => { if (index === 0) { return [pred]; } // Pull off the last element and make it concat with a comma so that // we can maintain alternating lines and docs. - return accum! + return accum .slice(0, -1) - .concat([concat([accum![accum!.length - 1], ","]), line, pred]); - }, null as (null | Plugin.Doc[])) + .concat([concat([accum![accum.length - 1], ","]), line, pred]); + }, [] as Plugin.Doc[]) ); const stmts = path.call(print, "body", 1) as Prettier.doc.builders.Concat; diff --git a/src/ruby/nodes/class.ts b/src/ruby/nodes/class.ts index dae75d84..46c33319 100644 --- a/src/ruby/nodes/class.ts +++ b/src/ruby/nodes/class.ts @@ -1,7 +1,7 @@ import type { Plugin, Ruby } from "./types"; const { concat, group, hardline, indent } = require("../../prettier"); -const { isEmptyBodyStmt } = require("../../utils"); +import { isEmptyBodyStmt } from "../../utils"; const printClass: Plugin.Printer = (path, opts, print) => { const [_constant, superclass, bodystmt] = path.getValue().body; diff --git a/src/ruby/nodes/commands.ts b/src/ruby/nodes/commands.ts index 310cd191..5ccdb652 100644 --- a/src/ruby/nodes/commands.ts +++ b/src/ruby/nodes/commands.ts @@ -11,7 +11,7 @@ const { line, softline } = require("../../prettier"); -const { makeCall } = require("../../utils"); +import { makeCall } from "../../utils"; function docLength(doc: any): number { if (doc.length) { diff --git a/src/ruby/nodes/conditionals.ts b/src/ruby/nodes/conditionals.ts index a938caee..3ea3bd01 100644 --- a/src/ruby/nodes/conditionals.ts +++ b/src/ruby/nodes/conditionals.ts @@ -12,14 +12,21 @@ const { softline } = require("../../prettier"); -const { containsAssignment, isEmptyStmts } = require("../../utils"); -const containsSingleConditional = require("../../utils/containsSingleConditional"); -const inlineEnsureParens = require("../../utils/inlineEnsureParens"); +import { containsAssignment, inlineEnsureParens, isEmptyStmts } from "../../utils"; function isConcat(doc: any): doc is Prettier.doc.builders.Concat { return doc.type === "concat"; } +// If the statements are just a single if/unless, in block or modifier form, or +// a ternary +function containsSingleConditional(stmts: Ruby.Stmts) { + return ( + stmts.body.length === 1 && + ["if", "if_mod", "ifop", "unless", "unless_mod"].includes(stmts.body[0].type) + ); +} + function printWithAddition(keyword: string, path: Plugin.Path, print: Plugin.Print, breaking: boolean) { return concat([ `${keyword} `, diff --git a/src/ruby/nodes/constants.ts b/src/ruby/nodes/constants.ts index 368c4d4b..9ff45400 100644 --- a/src/ruby/nodes/constants.ts +++ b/src/ruby/nodes/constants.ts @@ -1,7 +1,7 @@ import type { Plugin, Ruby } from "./types"; const { concat, group, indent, join, softline } = require("../../prettier"); -const { makeCall } = require("../../utils"); +import { makeCall } from "../../utils"; const printConstPath: Plugin.Printer = (path, opts, print) => { return join("::", path.map(print, "body")); diff --git a/src/ruby/nodes/flow.ts b/src/ruby/nodes/flow.ts index 8dcaa284..eec52de3 100644 --- a/src/ruby/nodes/flow.ts +++ b/src/ruby/nodes/flow.ts @@ -1,7 +1,7 @@ import type { Plugin, Ruby } from "./types"; const { concat, join } = require("../../prettier"); -const { literal } = require("../../utils"); +import { literal } from "../../utils"; function nodeDive(node: any, steps: PropertyKey[]) { let current = node; diff --git a/src/ruby/nodes/hashes.ts b/src/ruby/nodes/hashes.ts index 9afa4e5a..eae277a8 100644 --- a/src/ruby/nodes/hashes.ts +++ b/src/ruby/nodes/hashes.ts @@ -10,11 +10,11 @@ const { line } = require("../../prettier"); -const { +import { getTrailingComma, printEmptyCollection, skipAssignIndent -} = require("../../utils"); +} from "../../utils"; type KeyPrinter = (path: Plugin.Path, print: Plugin.Print) => Doc; type HashContents = (Ruby.AssoclistFromArgs | Ruby.BareAssocHash) & { keyPrinter: KeyPrinter }; diff --git a/src/ruby/nodes/heredocs.ts b/src/ruby/nodes/heredocs.ts index 163541ee..4aa9b9f7 100644 --- a/src/ruby/nodes/heredocs.ts +++ b/src/ruby/nodes/heredocs.ts @@ -1,7 +1,7 @@ import type { Plugin, Ruby } from "./types"; const { concat, group, lineSuffix, join } = require("../../prettier"); -const { literallineWithoutBreakParent } = require("../../utils"); +import { literallineWithoutBreakParent } from "../../utils"; const printHeredoc: Plugin.Printer = (path, opts, print) => { const { body, ending } = path.getValue(); diff --git a/src/ruby/nodes/lambdas.ts b/src/ruby/nodes/lambdas.ts index 3eaf4272..6e953f8c 100644 --- a/src/ruby/nodes/lambdas.ts +++ b/src/ruby/nodes/lambdas.ts @@ -1,7 +1,7 @@ import type { Plugin, Ruby } from "./types"; const { concat, group, ifBreak, indent, line } = require("../../prettier"); -const { hasAncestor } = require("../../utils"); +import { hasAncestor } from "../../utils"; // We can have our params coming in as the first child of the main lambda node, // or if we have them wrapped in parens then they'll be one level deeper. Even diff --git a/src/ruby/nodes/loops.ts b/src/ruby/nodes/loops.ts index 61aa74f6..275ff89d 100644 --- a/src/ruby/nodes/loops.ts +++ b/src/ruby/nodes/loops.ts @@ -12,8 +12,7 @@ const { softline } = require("../../prettier"); -const { containsAssignment, isEmptyStmts } = require("../../utils"); -const inlineEnsureParens = require("../../utils/inlineEnsureParens"); +import { containsAssignment, inlineEnsureParens, isEmptyStmts } from "../../utils"; function printLoop(keyword: string, modifier: boolean): Plugin.Printer { return function printLoopWithOptions(path, { rubyModifier }, print) { diff --git a/src/ruby/nodes/methods.ts b/src/ruby/nodes/methods.ts index caca8773..1528b82b 100644 --- a/src/ruby/nodes/methods.ts +++ b/src/ruby/nodes/methods.ts @@ -1,20 +1,29 @@ import type { Plugin, Ruby } from "./types"; const { concat, group, hardline, indent, line } = require("../../prettier"); -const { isEmptyBodyStmt } = require("../../utils"); +import { isEmptyBodyStmt } from "../../utils"; function printMethod(offset: number): Plugin.Printer { return function printMethodWithOffset(path, opts, print) { - const [_name, params, bodystmt] = path.getValue().body.slice(offset); + const node = path.getValue(); const declaration: Plugin.Doc[] = ["def "]; - // In this case, we're printing a method that's defined as a singleton, so - // we need to include the target and the operator - if (offset > 0) { + let params: Ruby.Params | Ruby.Paren; + let bodystmt: Ruby.Bodystmt; + + if (node.type === "def") { + params = node.body[1]; + bodystmt = node.body[2]; + } else { + // In this case, we're printing a method that's defined as a singleton, so + // we need to include the target and the operator declaration.push( path.call(print, "body", 0), path.call(print, "body", 1) ); + + params = node.body[3]; + bodystmt = node.body[4]; } // In case there are no parens but there are arguments diff --git a/src/ruby/nodes/operators.ts b/src/ruby/nodes/operators.ts index 648f40db..d7d0ef50 100644 --- a/src/ruby/nodes/operators.ts +++ b/src/ruby/nodes/operators.ts @@ -1,7 +1,7 @@ import type { Plugin, Ruby } from "./types"; const { concat, group, indent, line, softline } = require("../../prettier"); -const { noIndent } = require("../../utils"); +import { noIndent } from "../../utils"; const printBinary: Plugin.Printer = (path, opts, print) => { const [_leftNode, operator, rightNode] = path.getValue().body; diff --git a/src/ruby/nodes/params.ts b/src/ruby/nodes/params.ts index 9bf3ec38..e411bcca 100644 --- a/src/ruby/nodes/params.ts +++ b/src/ruby/nodes/params.ts @@ -8,7 +8,7 @@ const { line, softline } = require("../../prettier"); -const { literal } = require("../../utils"); +import { literal } from "../../utils"; function printRestParam(symbol: string): Plugin.Printer { return function printRestParamWithSymbol(path, opts, print) { diff --git a/src/ruby/nodes/regexp.ts b/src/ruby/nodes/regexp.ts index 2c53b032..1fab331c 100644 --- a/src/ruby/nodes/regexp.ts +++ b/src/ruby/nodes/regexp.ts @@ -1,7 +1,7 @@ import type { Plugin, Ruby } from "./types"; const { concat } = require("../../prettier"); -const { hasAncestor } = require("../../utils"); +import { hasAncestor } from "../../utils"; function hasContent(node: Ruby.RegexpLiteral, pattern: RegExp) { return node.body.some( diff --git a/src/ruby/nodes/rescue.ts b/src/ruby/nodes/rescue.ts index e649462c..33de007d 100644 --- a/src/ruby/nodes/rescue.ts +++ b/src/ruby/nodes/rescue.ts @@ -10,7 +10,7 @@ const { join, line } = require("../../prettier"); -const { literal } = require("../../utils"); +import { literal } from "../../utils"; const printBegin: Plugin.Printer = (path, opts, print) => { return concat([ diff --git a/src/ruby/nodes/return.ts b/src/ruby/nodes/return.ts index 580ef8dd..f2a7ba25 100644 --- a/src/ruby/nodes/return.ts +++ b/src/ruby/nodes/return.ts @@ -9,7 +9,7 @@ const { join, softline } = require("../../prettier"); -const { literal } = require("../../utils"); +import { literal } from "../../utils"; // You can't skip the parentheses if you have comments or certain operators with // lower precedence than the return keyword. diff --git a/src/ruby/nodes/statements.ts b/src/ruby/nodes/statements.ts index 6052f961..b0a1f419 100644 --- a/src/ruby/nodes/statements.ts +++ b/src/ruby/nodes/statements.ts @@ -14,7 +14,7 @@ const { trim } = require("../../prettier"); -const { isEmptyStmts } = require("../../utils"); +import { isEmptyStmts } from "../../utils"; const printBodyStmt: Plugin.Printer = (path, opts, print) => { const [stmts, rescue, elseClause, ensure] = path.getValue().body; @@ -80,7 +80,7 @@ const printEndContent: Plugin.Printer = (path, opts, print) => }; const printComment: Plugin.Printer = (path, opts, print) => { - return opts.printer.printComment(path); + return opts.printer.printComment(path, opts); }; const printProgram: Plugin.Printer = (path, opts, print) => { @@ -101,7 +101,7 @@ const printStmts: Plugin.Printer = (path, opts, print) => { const comments = path.map( (commentPath) => { commentPath.getValue().printed = true; - return opts.printer.printComment(commentPath); + return opts.printer.printComment(commentPath, opts); }, "body", 0, diff --git a/src/ruby/nodes/super.ts b/src/ruby/nodes/super.ts index 2bf68c7f..2f87da20 100644 --- a/src/ruby/nodes/super.ts +++ b/src/ruby/nodes/super.ts @@ -1,7 +1,7 @@ import type { Plugin, Ruby } from "./types"; const { align, concat, group, join, line } = require("../../prettier"); -const { literal } = require("../../utils"); +import { literal } from "../../utils"; const printSuper: Plugin.Printer = (path, opts, print) => { const args = path.getValue().body[0]; diff --git a/src/ruby/nodes/types.ts b/src/ruby/nodes/types.ts index 15f81395..993dd634 100644 --- a/src/ruby/nodes/types.ts +++ b/src/ruby/nodes/types.ts @@ -20,7 +20,7 @@ export namespace Plugin { // This is the regular prettier options + the options defined by this plugin. export type Options = Prettier.ParserOptions & { - printer: Prettier.Printer, + printer: Omit & Required>, rubyArrayLiteral: boolean, rubyHashLabel: boolean, rubyModifier: boolean, @@ -57,8 +57,8 @@ export namespace Ruby { // This is a special scanner event that contains a comment. It can be attached // to almost any kind of node, which is why it's pulled out here separately. - type UndecoratedComment = { type: "@comment", value: string, inline: boolean }; - export type Comment = UndecoratedComment & { leading: boolean }; + type UndecoratedComment = { type: "@comment", value: string, inline: boolean } & Location; + export type Comment = UndecoratedComment & { leading: boolean, printed: boolean }; // These are the scanner events that contain only a single string. They're // always leaves in the tree. Ignored ones that can't show up in the tree but diff --git a/src/utils.js b/src/utils.js deleted file mode 100644 index 96f3f15c..00000000 --- a/src/utils.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = { - containsAssignment: require("./utils/containsAssignment"), - getTrailingComma: require("./utils/getTrailingComma"), - isEmptyBodyStmt: require("./utils/isEmptyBodyStmt"), - isEmptyStmts: require("./utils/isEmptyStmts"), - hasAncestor: require("./utils/hasAncestor"), - literal: require("./utils/literal"), - literallineWithoutBreakParent: require("./utils/literallineWithoutBreakParent"), - makeCall: require("./utils/makeCall"), - noIndent: require("./utils/noIndent"), - printEmptyCollection: require("./utils/printEmptyCollection"), - skipAssignIndent: require("./utils/skipAssignIndent") -}; diff --git a/src/utils.ts b/src/utils.ts new file mode 100644 index 00000000..55fec0f2 --- /dev/null +++ b/src/utils.ts @@ -0,0 +1,12 @@ +export { default as containsAssignment } from "./utils/containsAssignment"; +export { default as getTrailingComma } from "./utils/getTrailingComma"; +export { default as isEmptyBodyStmt } from "./utils/isEmptyBodyStmt"; +export { default as isEmptyStmts } from "./utils/isEmptyStmts"; +export { default as hasAncestor } from "./utils/hasAncestor"; +export { default as inlineEnsureParens } from "./utils/inlineEnsureParens"; +export { default as literal } from "./utils/literal"; +export { default as literallineWithoutBreakParent } from "./utils/literallineWithoutBreakParent"; +export { default as makeCall } from "./utils/makeCall"; +export { default as noIndent } from "./utils/noIndent"; +export { default as printEmptyCollection } from "./utils/printEmptyCollection"; +export { default as skipAssignIndent } from "./utils/skipAssignIndent"; diff --git a/src/utils/containsAssignment.js b/src/utils/containsAssignment.js deleted file mode 100644 index 5d778391..00000000 --- a/src/utils/containsAssignment.js +++ /dev/null @@ -1,11 +0,0 @@ -// If the node is a type of assignment or if the node is a paren and nested -// inside that paren is a node that is a type of assignment. -function containsAssignment(node) { - return ( - node && - (["assign", "massign", "opassign"].includes(node.type) || - (Array.isArray(node.body) && node.body.some(containsAssignment))) - ); -} - -module.exports = containsAssignment; diff --git a/src/utils/containsAssignment.ts b/src/utils/containsAssignment.ts new file mode 100644 index 00000000..7455096f --- /dev/null +++ b/src/utils/containsAssignment.ts @@ -0,0 +1,18 @@ +import type { Ruby } from "../ruby/nodes/types"; + +// If the node is a type of assignment or if the node is a paren and nested +// inside that paren is a node that is a type of assignment. +function containsAssignment(node: Ruby.AnyNode | Ruby.Stmts) { + if (!node) { + return false; + } + + if (["assign", "massign", "opassign"].includes(node.type)) { + return true; + } + + const anyNode = node as any; + return Array.isArray(anyNode.body) && anyNode.body.some(containsAssignment); +} + +export default containsAssignment; diff --git a/src/utils/containsSingleConditional.js b/src/utils/containsSingleConditional.js deleted file mode 100644 index b4b63b51..00000000 --- a/src/utils/containsSingleConditional.js +++ /dev/null @@ -1,11 +0,0 @@ -// If the statements are just a single if/unless, in block or modifier form, or a ternary -function containsSingleConditional(statements) { - return ( - statements.body.length === 1 && - ["if", "if_mod", "ifop", "unless", "unless_mod"].includes( - statements.body[0].type - ) - ); -} - -module.exports = containsSingleConditional; diff --git a/src/utils/getTrailingComma.js b/src/utils/getTrailingComma.js deleted file mode 100644 index a262f96f..00000000 --- a/src/utils/getTrailingComma.js +++ /dev/null @@ -1,5 +0,0 @@ -function getTrailingComma(opts) { - return ["all", "es5"].includes(opts.trailingComma); -} - -module.exports = getTrailingComma; diff --git a/src/utils/getTrailingComma.ts b/src/utils/getTrailingComma.ts new file mode 100644 index 00000000..01e1d8c7 --- /dev/null +++ b/src/utils/getTrailingComma.ts @@ -0,0 +1,7 @@ +import type { Plugin } from "../ruby/nodes/types"; + +function getTrailingComma(opts: Plugin.Options) { + return ["all", "es5"].includes(opts.trailingComma); +} + +export default getTrailingComma; diff --git a/src/utils/hasAncestor.js b/src/utils/hasAncestor.ts similarity index 60% rename from src/utils/hasAncestor.js rename to src/utils/hasAncestor.ts index ed86847b..d6394997 100644 --- a/src/utils/hasAncestor.js +++ b/src/utils/hasAncestor.ts @@ -1,4 +1,6 @@ -function hasAncestor(path, types) { +import type { Plugin } from "../ruby/nodes/types"; + +function hasAncestor(path: Plugin.Path<{ type: string }>, types: string[]) { let parent = 0; let parentNode = path.getParentNode(); @@ -14,4 +16,4 @@ function hasAncestor(path, types) { return false; } -module.exports = hasAncestor; +export default hasAncestor; diff --git a/src/utils/inlineEnsureParens.js b/src/utils/inlineEnsureParens.ts similarity index 86% rename from src/utils/inlineEnsureParens.js rename to src/utils/inlineEnsureParens.ts index f3060f2c..22e6f410 100644 --- a/src/utils/inlineEnsureParens.js +++ b/src/utils/inlineEnsureParens.ts @@ -1,3 +1,5 @@ +import type { Plugin, Ruby } from "../ruby/nodes/types"; + const needsParens = [ "args", "assign", @@ -39,12 +41,12 @@ const needsParens = [ // // This approach maintains the nice conciseness of the inline version, while // keeping the correct semantic meaning. -const inlineEnsureParens = (path, parts) => { +function inlineEnsureParens(path: Plugin.Path, parts: Plugin.Doc) { if (needsParens.includes(path.getParentNode().type)) { - return ["("].concat(parts, ")"); + return (["("] as Plugin.Doc[]).concat(parts, ")"); } return parts; -}; +} -module.exports = inlineEnsureParens; +export default inlineEnsureParens; diff --git a/src/utils/isEmptyBodyStmt.js b/src/utils/isEmptyBodyStmt.js deleted file mode 100644 index 72668019..00000000 --- a/src/utils/isEmptyBodyStmt.js +++ /dev/null @@ -1,7 +0,0 @@ -const isEmptyStmts = require("./isEmptyStmts"); - -function isEmptyBodyStmt(node) { - return isEmptyStmts(node.body[0]) && !node.body.slice(1).some(Boolean); -} - -module.exports = isEmptyBodyStmt; diff --git a/src/utils/isEmptyBodyStmt.ts b/src/utils/isEmptyBodyStmt.ts new file mode 100644 index 00000000..9e205c23 --- /dev/null +++ b/src/utils/isEmptyBodyStmt.ts @@ -0,0 +1,8 @@ +import type { Ruby } from "../ruby/nodes/types"; +import isEmptyStmts from "./isEmptyStmts"; + +function isEmptyBodyStmt(node: Ruby.Bodystmt) { + return isEmptyStmts(node.body[0]) && !node.body.slice(1).some(Boolean); +} + +export default isEmptyBodyStmt; diff --git a/src/utils/isEmptyStmts.js b/src/utils/isEmptyStmts.ts similarity index 53% rename from src/utils/isEmptyStmts.js rename to src/utils/isEmptyStmts.ts index 665df85e..2344c29a 100644 --- a/src/utils/isEmptyStmts.js +++ b/src/utils/isEmptyStmts.ts @@ -1,4 +1,6 @@ -function isEmptyStmts(node) { +import type { Ruby } from "../ruby/nodes/types"; + +function isEmptyStmts(node: Ruby.AnyNode | Ruby.Stmts) { return ( node && node.type === "stmts" && @@ -8,4 +10,4 @@ function isEmptyStmts(node) { ); } -module.exports = isEmptyStmts; +export default isEmptyStmts; diff --git a/src/utils/literal.js b/src/utils/literal.js deleted file mode 100644 index 082ff434..00000000 --- a/src/utils/literal.js +++ /dev/null @@ -1,7 +0,0 @@ -function literal(value) { - return function printLiteral() { - return value; - }; -} - -module.exports = literal; diff --git a/src/utils/literal.ts b/src/utils/literal.ts new file mode 100644 index 00000000..4556386c --- /dev/null +++ b/src/utils/literal.ts @@ -0,0 +1,9 @@ +import { Plugin } from "../ruby/nodes/types"; + +function literal(value: string): Plugin.Printer<{}> { + return function printLiteral() { + return value; + }; +} + +export default literal; diff --git a/src/utils/literallineWithoutBreakParent.js b/src/utils/literallineWithoutBreakParent.js deleted file mode 100644 index 2bd16c14..00000000 --- a/src/utils/literallineWithoutBreakParent.js +++ /dev/null @@ -1,7 +0,0 @@ -const literallineWithoutBreakParent = { - type: "line", - hard: true, - literal: true -}; - -module.exports = literallineWithoutBreakParent; diff --git a/src/utils/literallineWithoutBreakParent.ts b/src/utils/literallineWithoutBreakParent.ts new file mode 100644 index 00000000..d83d1ad2 --- /dev/null +++ b/src/utils/literallineWithoutBreakParent.ts @@ -0,0 +1,9 @@ +import { Plugin } from "../ruby/nodes/types"; + +const literallineWithoutBreakParent = { + type: "line", + hard: true, + literal: true +} as Plugin.Doc; + +export default literallineWithoutBreakParent; diff --git a/src/utils/makeCall.js b/src/utils/makeCall.js deleted file mode 100644 index 568c354a..00000000 --- a/src/utils/makeCall.js +++ /dev/null @@ -1,14 +0,0 @@ -function makeCall(path, opts, print) { - const operation = path.getValue().body[1]; - - // Ignoring the next block for coverage information because it's only relevant - // in Ruby 2.5 and below. - /* istanbul ignore next */ - if ([".", "&."].includes(operation)) { - return operation; - } - - return operation === "::" ? "." : path.call(print, "body", 1); -} - -module.exports = makeCall; diff --git a/src/utils/makeCall.ts b/src/utils/makeCall.ts new file mode 100644 index 00000000..67a8e8ff --- /dev/null +++ b/src/utils/makeCall.ts @@ -0,0 +1,20 @@ +import type { Plugin, Ruby } from "../ruby/nodes/types"; + +type Callable = { + body: [any, Ruby.CallOperator, ...any[]] +}; + +const makeCall: Plugin.Printer = (path, opts, print) => { + const operation = path.getValue().body[1]; + + // Ignoring the next block for coverage information because it's only relevant + // in Ruby 2.5 and below. + /* istanbul ignore next */ + if ([".", "&."].includes(operation as any)) { + return operation as Plugin.Doc; + } + + return operation === "::" ? "." : path.call(print, "body", 1); +}; + +export default makeCall; diff --git a/src/utils/noIndent.js b/src/utils/noIndent.ts similarity index 78% rename from src/utils/noIndent.js rename to src/utils/noIndent.ts index 4257ebdf..defbd741 100644 --- a/src/utils/noIndent.js +++ b/src/utils/noIndent.ts @@ -7,4 +7,4 @@ const noIndent = [ "xstring_literal" ]; -module.exports = noIndent; +export default noIndent; diff --git a/src/utils/printEmptyCollection.js b/src/utils/printEmptyCollection.ts similarity index 72% rename from src/utils/printEmptyCollection.js rename to src/utils/printEmptyCollection.ts index a6944bd1..159d7f71 100644 --- a/src/utils/printEmptyCollection.js +++ b/src/utils/printEmptyCollection.ts @@ -1,6 +1,8 @@ +import type { Plugin, Ruby } from "../ruby/nodes/types"; + const { concat, group, hardline, indent, join, line } = require("../prettier"); -function containedWithin(node) { +function containedWithin(node: Ruby.Array | Ruby.Hash): (comment: Ruby.Comment) => boolean { return function containedWithinNode(comment) { return comment.sc >= node.sc && comment.ec <= node.ec; }; @@ -11,7 +13,7 @@ function containedWithin(node) { // this by having a child node inside the array that gets the comments attached // to it, but that requires modifying the parser. Instead, we can just manually // print out the non-leading comments here. -function printEmptyCollection(path, opts, startToken, endToken) { +function printEmptyCollection(path: Plugin.Path, opts: Plugin.Options, startToken: string, endToken: string) { const node = path.getValue(); const containedWithinNode = containedWithin(node); @@ -22,15 +24,15 @@ function printEmptyCollection(path, opts, startToken, endToken) { return `${startToken}${endToken}`; } - const comments = []; + const comments: Plugin.Doc[] = []; // For each comment, go through its path and print it out manually. - const printComment = (commentPath) => { + const printComment = (commentPath: Plugin.Path) => { const comment = commentPath.getValue(); if (containedWithinNode(comment)) { comment.printed = true; - comments.push(opts.printer.printComment(commentPath)); + comments.push(opts.printer.printComment(commentPath, opts)); } }; @@ -46,4 +48,4 @@ function printEmptyCollection(path, opts, startToken, endToken) { ); } -module.exports = printEmptyCollection; +export default printEmptyCollection; diff --git a/src/utils/skipAssignIndent.js b/src/utils/skipAssignIndent.ts similarity index 61% rename from src/utils/skipAssignIndent.js rename to src/utils/skipAssignIndent.ts index a6070d86..ed4408cd 100644 --- a/src/utils/skipAssignIndent.js +++ b/src/utils/skipAssignIndent.ts @@ -1,3 +1,5 @@ +import type { Ruby } from "../ruby/nodes/types"; + const skippable = [ "array", "dyna_symbol", @@ -7,11 +9,11 @@ const skippable = [ "regexp_literal" ]; -function skipAssignIndent(node) { +function skipAssignIndent(node: Ruby.AnyNode): boolean { return ( skippable.includes(node.type) || (node.type === "call" && skipAssignIndent(node.body[0])) ); } -module.exports = skipAssignIndent; +export default skipAssignIndent; From 5b84658639693a189994dbcb53e6083c1bab0f82 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Sep 2021 12:37:14 -0400 Subject: [PATCH 225/785] Clean up exports from various ruby nodes --- src/ruby/{embed.js => embed.ts} | 22 ++--- src/ruby/nodes.js | 34 ------- src/ruby/nodes.ts | 153 ++++++++++++++++++++++++++++++++ src/ruby/nodes/alias.ts | 7 +- src/ruby/nodes/aref.ts | 9 +- src/ruby/nodes/args.ts | 23 ++--- src/ruby/nodes/arrays.ts | 9 +- src/ruby/nodes/assign.ts | 15 +--- src/ruby/nodes/blocks.ts | 9 +- src/ruby/nodes/calls.ts | 20 ++--- src/ruby/nodes/case.ts | 9 +- src/ruby/nodes/class.ts | 12 +-- src/ruby/nodes/commands.ts | 9 +- src/ruby/nodes/conditionals.ts | 19 ++-- src/ruby/nodes/constants.ts | 20 ++--- src/ruby/nodes/flow.ts | 13 +-- src/ruby/nodes/hashes.ts | 16 +--- src/ruby/nodes/heredocs.ts | 6 +- src/ruby/nodes/hooks.ts | 6 +- src/ruby/nodes/ints.ts | 6 +- src/ruby/nodes/lambdas.ts | 6 +- src/ruby/nodes/loops.ts | 13 ++- src/ruby/nodes/massign.ts | 27 ++---- src/ruby/nodes/methods.ts | 12 +-- src/ruby/nodes/operators.ts | 15 +--- src/ruby/nodes/params.ts | 13 ++- src/ruby/nodes/patterns.ts | 18 ++-- src/ruby/nodes/regexp.ts | 6 +- src/ruby/nodes/rescue.ts | 21 ++--- src/ruby/nodes/return.ts | 7 +- src/ruby/nodes/statements.ts | 21 ++--- src/ruby/nodes/strings.ts | 27 ++---- src/ruby/nodes/super.ts | 9 +- src/ruby/nodes/types.ts | 37 +++++--- src/ruby/nodes/undef.ts | 6 +- src/ruby/printer.ts | 26 +++--- src/ruby/toProc.ts | 2 +- 37 files changed, 314 insertions(+), 369 deletions(-) rename src/ruby/{embed.js => embed.ts} (88%) delete mode 100644 src/ruby/nodes.js create mode 100644 src/ruby/nodes.ts diff --git a/src/ruby/embed.js b/src/ruby/embed.ts similarity index 88% rename from src/ruby/embed.js rename to src/ruby/embed.ts index 6e000807..284733bc 100644 --- a/src/ruby/embed.js +++ b/src/ruby/embed.ts @@ -1,3 +1,5 @@ +import type { Plugin } from "./nodes/types"; + const { concat, group, @@ -8,9 +10,9 @@ const { stripTrailingHardline } = require("../prettier"); -const { literallineWithoutBreakParent } = require("../utils"); +import { literallineWithoutBreakParent } from "../utils"; -const parsers = { +const parsers: Record = { css: "css", javascript: "babel", js: "babel", @@ -24,8 +26,8 @@ const parsers = { // have a test that exercises it because I'm not sure for which parser it is // necessary, but since it's in prettier core I'm keeping it here. /* istanbul ignore next */ -function replaceNewlines(doc) { - return mapDoc(doc, (currentDoc) => +function replaceNewlines(doc: Plugin.Doc) { + return mapDoc(doc, (currentDoc: Plugin.Doc) => typeof currentDoc === "string" && currentDoc.includes("\n") ? concat( currentDoc @@ -48,7 +50,7 @@ function replaceNewlines(doc) { // // then the return value of this function would be 2. If you indented every line // of the inner content 2 more spaces then this function would return 4. -function getCommonLeadingWhitespace(content) { +function getCommonLeadingWhitespace(content: string) { const pattern = /^\s+/; return content @@ -59,19 +61,19 @@ function getCommonLeadingWhitespace(content) { const length = matched ? matched[0].length : 0; return minimum === null ? length : Math.min(minimum, length); - }, null); + }, content.length); } // Returns a new string with the common whitespace stripped out. Effectively it // emulates what a squiggly heredoc does in Ruby. -function stripCommonLeadingWhitespace(content) { +function stripCommonLeadingWhitespace(content: string) { const lines = content.split("\n"); const minimum = getCommonLeadingWhitespace(content); return lines.map((line) => line.slice(minimum)).join("\n"); } -function embed(path, print, textToDoc, _opts) { +const embed: Plugin.Embed = (path, print, textToDoc, _opts) => { const node = path.getValue(); // Currently we only support embedded formatting on heredoc nodes @@ -137,6 +139,6 @@ function embed(path, print, textToDoc, _opts) { ) ]) ); -} +}; -module.exports = embed; +export default embed; diff --git a/src/ruby/nodes.js b/src/ruby/nodes.js deleted file mode 100644 index 12de34af..00000000 --- a/src/ruby/nodes.js +++ /dev/null @@ -1,34 +0,0 @@ -module.exports = Object.assign( - {}, - require("./nodes/alias"), - require("./nodes/aref"), - require("./nodes/args"), - require("./nodes/arrays"), - require("./nodes/assign"), - require("./nodes/blocks"), - require("./nodes/calls"), - require("./nodes/case"), - require("./nodes/class"), - require("./nodes/commands"), - require("./nodes/conditionals"), - require("./nodes/constants"), - require("./nodes/flow"), - require("./nodes/hashes"), - require("./nodes/heredocs"), - require("./nodes/hooks"), - require("./nodes/ints"), - require("./nodes/lambdas"), - require("./nodes/loops"), - require("./nodes/massign"), - require("./nodes/methods"), - require("./nodes/operators"), - require("./nodes/params"), - require("./nodes/patterns"), - require("./nodes/regexp"), - require("./nodes/rescue"), - require("./nodes/return"), - require("./nodes/statements"), - require("./nodes/strings"), - require("./nodes/super"), - require("./nodes/undef") -); diff --git a/src/ruby/nodes.ts b/src/ruby/nodes.ts new file mode 100644 index 00000000..589e021b --- /dev/null +++ b/src/ruby/nodes.ts @@ -0,0 +1,153 @@ +import type { Plugin, Ruby } from "./nodes/types"; + +import { printAlias } from "./nodes/alias"; +import { printAref, printArefField } from "./nodes/aref"; +import { printArgParen, printArgs, printArgsAddBlock, printArgsAddStar, printBlockArg } from "./nodes/args"; +import { printArray, printWord } from "./nodes/arrays"; +import { printAssign, printOpAssign, printVarField, printVarRef } from "./nodes/assign"; +import { printBlockVar, printBraceBlock, printDoBlock } from "./nodes/blocks"; +import { printCall, printCallContainer, printMethodAddArg, printMethodAddBlock } from "./nodes/calls"; +import { printCase, printWhen } from "./nodes/case"; +import { printClass, printModule, printSClass } from "./nodes/class"; +import { printCommand, printCommandCall } from "./nodes/commands"; +import { printElse, printElsif, printIf, printIfModifier, printTernary, printUnless, printUnlessModifier } from "./nodes/conditionals"; +import { printConstPath, printConstRef, printDefined, printField, printTopConst } from "./nodes/constants"; +import { printBreak, printNext, printYield, printYield0 } from "./nodes/flow"; +import { printAssocNew, printAssocSplat, printHash, printHashContents } from "./nodes/hashes"; +import { printHeredoc } from "./nodes/heredocs"; +import { printBEGIN, printEND } from "./nodes/hooks"; +import { printInt } from "./nodes/ints"; +import { printLambda } from "./nodes/lambdas"; +import { printFor, printUntil, printUntilModifer, printWhile, printWhileModifier } from "./nodes/loops"; +import { printMAssign, printMLHS, printMLHSAddPost, printMLHSAddStar, printMLHSParen, printMRHS, printMRHSAddStar, printMRHSNewFromArgs } from "./nodes/massign"; +import { printAccessControl, printDef, printDefs, printSingleLineMethod } from "./nodes/methods"; +import { printBinary, printDot2, printDot3, printUnary } from "./nodes/operators"; +import { printArgsForward, printKeywordRestParam, printParams, printRestParam } from "./nodes/params"; +import { printAryPtn, printFndPtn, printHshPtn, printIn, printRAssign } from "./nodes/patterns"; +import { printRegexpLiteral } from "./nodes/regexp"; +import { printBegin, printEnsure, printRedo, printRescue, printRescueEx, printRescueMod, printRetry } from "./nodes/rescue"; +import { printReturn, printReturn0 } from "./nodes/return"; +import { printBodyStmt, printComment, printEndContent, printParen, printProgram, printStmts } from "./nodes/statements"; +import { printChar, printDynaSymbol, printStringConcat, printStringDVar, printStringEmbExpr, printStringLiteral, printSymbolLiteral, printXStringLiteral } from "./nodes/strings"; +import { printSuper, printZSuper } from "./nodes/super"; +import { printUndef } from "./nodes/undef"; + +const nodes: Partial<{ [T in Ruby.AnyNode["type"] | "@comment"]: Plugin.Printer }> = { + "@__end__": printEndContent, + "@CHAR": printChar, + "@comment": printComment, + "@int": printInt, + access_ctrl: printAccessControl, + alias: printAlias, + aref: printAref, + aref_field: printArefField, + arg_paren: printArgParen, + args: printArgs, + args_add_block: printArgsAddBlock, + args_add_star: printArgsAddStar, + args_forward: printArgsForward, + array: printArray, + aryptn: printAryPtn, + assign: printAssign, + assoc_new: printAssocNew, + assoc_splat: printAssocSplat, + assoclist_from_args: printHashContents, + bare_assoc_hash: printHashContents, + BEGIN: printBEGIN, + begin: printBegin, + binary: printBinary, + blockarg: printBlockArg, + block_var: printBlockVar, + bodystmt: printBodyStmt, + brace_block: printBraceBlock, + break: printBreak, + call: printCall, + case: printCase, + class: printClass, + command: printCommand, + command_call: printCommandCall, + const_path_field: printConstPath, + const_path_ref: printConstPath, + const_ref: printConstRef, + def: printDef, + defs: printDefs, + defsl: printSingleLineMethod, + defined: printDefined, + do_block: printDoBlock, + dot2: printDot2, + dot3: printDot3, + dyna_symbol: printDynaSymbol, + else: printElse, + elsif: printElsif, + END: printEND, + ensure: printEnsure, + fcall: printCallContainer, + fndptn: printFndPtn, + field: printField, + for: printFor, + hash: printHash, + heredoc: printHeredoc, + hshptn: printHshPtn, + if: printIf, + ifop: printTernary, + if_mod: printIfModifier, + in: printIn, + kwrest_param: printKeywordRestParam, + lambda: printLambda, + massign: printMAssign, + method_add_arg: printMethodAddArg, + method_add_block: printMethodAddBlock, + mlhs: printMLHS, + mlhs_add_post: printMLHSAddPost, + mlhs_add_star: printMLHSAddStar, + mlhs_paren: printMLHSParen, + mrhs: printMRHS, + mrhs_add_star: printMRHSAddStar, + mrhs_new_from_args: printMRHSNewFromArgs, + module: printModule, + next: printNext, + opassign: printOpAssign, + params: printParams, + paren: printParen, + program: printProgram, + rassign: printRAssign, + redo: printRedo, + regexp_literal: printRegexpLiteral, + rescue: printRescue, + rescue_ex: printRescueEx, + rescue_mod: printRescueMod, + rest_param: printRestParam, + retry: printRetry, + return: printReturn, + return0: printReturn0, + sclass: printSClass, + stmts: printStmts, + string_concat: printStringConcat, + string_dvar: printStringDVar, + string_embexpr: printStringEmbExpr, + string_literal: printStringLiteral, + super: printSuper, + symbol_literal: printSymbolLiteral, + top_const_field: printTopConst, + top_const_ref: printTopConst, + unary: printUnary, + undef: printUndef, + unless: printUnless, + unless_mod: printUnlessModifier, + until: printUntil, + until_mod: printUntilModifer, + var_alias: printAlias, + var_field: printVarField, + var_ref: printVarRef, + vcall: printCallContainer, + when: printWhen, + while: printWhile, + while_mod: printWhileModifier, + word: printWord, + xstring_literal: printXStringLiteral, + yield: printYield, + yield0: printYield0, + zsuper: printZSuper +}; + +export default nodes; diff --git a/src/ruby/nodes/alias.ts b/src/ruby/nodes/alias.ts index 87d93254..025c3e25 100644 --- a/src/ruby/nodes/alias.ts +++ b/src/ruby/nodes/alias.ts @@ -28,7 +28,7 @@ const { // The `alias` node contains two children. The left and right align with the // arguments passed to the keyword. So, for the above example the left would be // the symbol literal `bar` and the right could be the symbol literal `foo`. -const printAlias: Plugin.Printer = (path, opts, print) => { +export const printAlias: Plugin.Printer = (path, opts, print) => { const keyword = "alias "; // In general, return the printed doc of the argument at the provided index. @@ -68,8 +68,3 @@ const printAlias: Plugin.Printer = (path, opts, prin ]) ); }; - -module.exports = { - alias: printAlias, - var_alias: printAlias -}; diff --git a/src/ruby/nodes/aref.ts b/src/ruby/nodes/aref.ts index dc30c41d..0fcdfced 100644 --- a/src/ruby/nodes/aref.ts +++ b/src/ruby/nodes/aref.ts @@ -21,7 +21,7 @@ const { // // foo[] // -const printAref: Plugin.Printer = (path, opts, print) => { +export const printAref: Plugin.Printer = (path, opts, print) => { const indexNode = path.getValue().body[1]; if (!indexNode) { @@ -45,7 +45,7 @@ const printAref: Plugin.Printer = (path, opts, print) => { // // foo[bar] = baz // -const printArefField: Plugin.Printer = (path, opts, print) => { +export const printArefField: Plugin.Printer = (path, opts, print) => { const [printedArray, printedIndex] = path.map(print, "body"); return group( @@ -57,8 +57,3 @@ const printArefField: Plugin.Printer = (path, opts, ]) ); }; - -module.exports = { - aref: printAref, - aref_field: printArefField -}; diff --git a/src/ruby/nodes/args.ts b/src/ruby/nodes/args.ts index 664bb2e9..b7f025cb 100644 --- a/src/ruby/nodes/args.ts +++ b/src/ruby/nodes/args.ts @@ -1,8 +1,6 @@ import type * as Prettier from "prettier"; import type { Plugin, Ruby } from "./types"; -import { getTrailingComma } from "../../utils"; - const { concat, group, @@ -13,7 +11,8 @@ const { softline } = require("../../prettier"); -const toProc = require("../toProc"); +import { getTrailingComma } from "../../utils"; +import toProc from "../toProc"; const noTrailingComma = ["command", "command_call"]; @@ -33,7 +32,7 @@ function getArgParenTrailingComma(node: Ruby.Args | Ruby.ArgsAddBlock) { return ifBreak(",", ""); } -const printArgParen: Plugin.Printer = (path, opts, print) => { +export const printArgParen: Plugin.Printer = (path, opts, print) => { const argsNode = path.getValue().body[0]; if (argsNode === null) { @@ -72,7 +71,7 @@ const printArgParen: Plugin.Printer = (path, opts, print) => { ); }; -const printArgs: Plugin.Printer = (path, { rubyToProc }, print) => { +export const printArgs: Plugin.Printer = (path, { rubyToProc }, print) => { const args = path.map(print, "body"); // Don't bother trying to do any kind of fancy toProc transform if the @@ -111,7 +110,7 @@ const printArgs: Plugin.Printer = (path, { rubyToProc }, print) => { return args; }; -const printArgsAddBlock: Plugin.Printer = (path, opts, print) => { +export const printArgsAddBlock: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); const blockNode = node.body[1]; @@ -157,7 +156,7 @@ const printArgsAddBlock: Plugin.Printer = (path, opts, print) return parts; }; -const printArgsAddStar: Plugin.Printer = (path, opts, print) => { +export const printArgsAddStar: Plugin.Printer = (path, opts, print) => { let docs: Plugin.Doc[] = []; path.each((argPath, argIndex) => { @@ -217,14 +216,6 @@ const printArgsAddStar: Plugin.Printer = (path, opts, print) = return docs; }; -const printBlockArg: Plugin.Printer = (path, opts, print) => { +export const printBlockArg: Plugin.Printer = (path, opts, print) => { return concat(["&", path.call(print, "body", 0)]); }; - -module.exports = { - arg_paren: printArgParen, - args: printArgs, - args_add_block: printArgsAddBlock, - args_add_star: printArgsAddStar, - blockarg: printBlockArg -}; diff --git a/src/ruby/nodes/arrays.ts b/src/ruby/nodes/arrays.ts index ce17c6f2..4e35ebed 100644 --- a/src/ruby/nodes/arrays.ts +++ b/src/ruby/nodes/arrays.ts @@ -65,7 +65,7 @@ function isSymbolArray(args: Ruby.Args | Ruby.ArgsAddStar) { // Prints out a word that is a part of a special array literal that accepts // interpolation. The body is an array of either plain strings or interpolated // expressions. -const printArrayLiteralWord: Plugin.Printer = (path, opts, print) => { +export const printWord: Plugin.Printer = (path, opts, print) => { return concat(path.map(print, "body")); }; @@ -94,7 +94,7 @@ const arrayLiteralStarts = { // array literals as well as regular arrays. If it is a special array literal // then it will have one child that represents the special array, otherwise it // will have one child that contains all of the elements of the array. -const printArray: Plugin.Printer = (path, opts, print) => { +export const printArray: Plugin.Printer = (path, opts, print) => { const array = path.getValue(); const args = array.body[0]; @@ -159,8 +159,3 @@ const printArray: Plugin.Printer = (path, opts, print) => { ]) ); }; - -module.exports = { - array: printArray, - word: printArrayLiteralWord -}; diff --git a/src/ruby/nodes/assign.ts b/src/ruby/nodes/assign.ts index 3cdc2d8b..bbaa9549 100644 --- a/src/ruby/nodes/assign.ts +++ b/src/ruby/nodes/assign.ts @@ -3,7 +3,7 @@ import type { Plugin, Ruby } from "./types"; const { concat, group, indent, join, line } = require("../../prettier"); import { skipAssignIndent } from "../../utils"; -const printAssign: Plugin.Printer = (path, opts, print) => { +export const printAssign: Plugin.Printer = (path, opts, print) => { const [_targetNode, valueNode] = path.getValue().body; const [targetDoc, valueDoc] = path.map(print, "body"); @@ -22,7 +22,7 @@ const printAssign: Plugin.Printer = (path, opts, print) => { return group(concat([targetDoc, " =", indent(concat([line, rightSideDoc]))])); }; -const printOpAssign: Plugin.Printer = (path, opts, print) => { +export const printOpAssign: Plugin.Printer = (path, opts, print) => { return group( concat([ path.call(print, "body", 0), @@ -33,17 +33,10 @@ const printOpAssign: Plugin.Printer = (path, opts, print) => { ); }; -const printVarField: Plugin.Printer = (path, opts, print) => { +export const printVarField: Plugin.Printer = (path, opts, print) => { return path.getValue().body ? path.call(print, "body", 0) : ""; }; -const printVarRef: Plugin.Printer = (path, opts, print) => { +export const printVarRef: Plugin.Printer = (path, opts, print) => { return path.call(print, "body", 0); }; - -module.exports = { - assign: printAssign, - opassign: printOpAssign, - var_field: printVarField, - var_ref: printVarRef -}; diff --git a/src/ruby/nodes/blocks.ts b/src/ruby/nodes/blocks.ts index c4b73c6c..f29f7ef2 100644 --- a/src/ruby/nodes/blocks.ts +++ b/src/ruby/nodes/blocks.ts @@ -12,7 +12,7 @@ const { } = require("../../prettier"); import { hasAncestor } from "../../utils"; -const printBlockVar: Plugin.Printer = (path, opts, print) => { +export const printBlockVar: Plugin.Printer = (path, opts, print) => { const parts = ["|", removeLines(path.call(print, "body", 0))]; // The second part of this node is a list of optional block-local variables @@ -85,8 +85,5 @@ function printBlock(braces: boolean): Plugin.Printer = (path, opts, print) => { +export const printCall: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); const [receiverNode, _operatorNode, messageNode] = node.body; @@ -90,7 +90,7 @@ const printCall: Plugin.Printer = (path, opts, print) => { return group(concat([receiverDoc, group(indent(rightSideDoc))])); }; -const printMethodAddArg: Plugin.Printer = (path, opts, print) => { +export const printMethodAddArg: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); const [methodNode, argNode] = node.body; @@ -199,7 +199,7 @@ const printMethodAddArg: Plugin.Printer = (path, opts, prin return concat([methodDoc, " ", join(", ", argsDoc), " "]); }; -const printMethodAddBlock: Plugin.Printer = (path, opts, print) => { +export const printMethodAddBlock: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); const [callNode, blockNode] = node.body; @@ -249,14 +249,6 @@ const printMethodAddBlock: Plugin.Printer = (path, opts, return concat([callDoc, blockDoc]); }; -const printCallContainer: Plugin.Printer = (path, opts, print) => { +export const printCallContainer: Plugin.Printer = (path, opts, print) => { return path.call(print, "body", 0); }; - -module.exports = { - call: printCall, - fcall: printCallContainer, - method_add_arg: printMethodAddArg, - method_add_block: printMethodAddBlock, - vcall: printCallContainer -}; diff --git a/src/ruby/nodes/case.ts b/src/ruby/nodes/case.ts index 88d332d0..6ed4e4a0 100644 --- a/src/ruby/nodes/case.ts +++ b/src/ruby/nodes/case.ts @@ -11,7 +11,7 @@ const { line } = require("../../prettier"); -const printCase: Plugin.Printer = (path, opts, print) => { +export const printCase: Plugin.Printer = (path, opts, print) => { const statement: Plugin.Doc[] = ["case"]; // You don't need to explicitly have something to test against in a case @@ -25,7 +25,7 @@ const printCase: Plugin.Printer = (path, opts, print) => { ); }; -const printWhen: Plugin.Printer = (path, opts, print) => { +export const printWhen: Plugin.Printer = (path, opts, print) => { const [_preds, _stmts, addition] = path.getValue().body; // The `fill` builder command expects an array of docs alternating with @@ -61,8 +61,3 @@ const printWhen: Plugin.Printer = (path, opts, print) => { return group(concat(parts)); }; - -module.exports = { - case: printCase, - when: printWhen -}; diff --git a/src/ruby/nodes/class.ts b/src/ruby/nodes/class.ts index 46c33319..cc33531e 100644 --- a/src/ruby/nodes/class.ts +++ b/src/ruby/nodes/class.ts @@ -3,7 +3,7 @@ import type { Plugin, Ruby } from "./types"; const { concat, group, hardline, indent } = require("../../prettier"); import { isEmptyBodyStmt } from "../../utils"; -const printClass: Plugin.Printer = (path, opts, print) => { +export const printClass: Plugin.Printer = (path, opts, print) => { const [_constant, superclass, bodystmt] = path.getValue().body; const parts = ["class ", path.call(print, "body", 0)]; @@ -25,7 +25,7 @@ const printClass: Plugin.Printer = (path, opts, print) => { ); }; -const printModule: Plugin.Printer = (path, opts, print) => { +export const printModule: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); const declaration = group(concat(["module ", path.call(print, "body", 0)])); @@ -42,7 +42,7 @@ const printModule: Plugin.Printer = (path, opts, print) => { ); }; -const printSClass: Plugin.Printer = (path, opts, print) => { +export const printSClass: Plugin.Printer = (path, opts, print) => { const bodystmt = path.getValue().body[1]; const declaration = concat(["class << ", path.call(print, "body", 0)]); @@ -58,9 +58,3 @@ const printSClass: Plugin.Printer = (path, opts, print) => { ]) ); }; - -module.exports = { - class: printClass, - module: printModule, - sclass: printSClass -}; diff --git a/src/ruby/nodes/commands.ts b/src/ruby/nodes/commands.ts index 5ccdb652..5341129b 100644 --- a/src/ruby/nodes/commands.ts +++ b/src/ruby/nodes/commands.ts @@ -62,7 +62,7 @@ function hasTernaryArg(node: Ruby.Args | Ruby.ArgsAddBlock) { return (node.body[0] as any).body.some((child: Ruby.AnyNode) => child.type === "ifop"); } -const printCommand: Plugin.Printer = (path, opts, print) => { +export const printCommand: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); const command = path.call(print, "body", 0); @@ -92,7 +92,7 @@ const printCommand: Plugin.Printer = (path, opts, print) => { ); }; -const printCommandCall: Plugin.Printer = (path, opts, print) => { +export const printCommandCall: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); const parts = [ path.call(print, "body", 0), @@ -127,8 +127,3 @@ const printCommandCall: Plugin.Printer = (path, opts, print) = return group(ifBreak(concat(breakDoc), concat(joinedDoc))); }; - -module.exports = { - command: printCommand, - command_call: printCommandCall -}; diff --git a/src/ruby/nodes/conditionals.ts b/src/ruby/nodes/conditionals.ts index 3ea3bd01..ff72d9a2 100644 --- a/src/ruby/nodes/conditionals.ts +++ b/src/ruby/nodes/conditionals.ts @@ -74,7 +74,7 @@ function printTernaryClauses(keyword: string, truthyClause: Plugin.Doc, falsyCla // Handles ternary nodes. If it does not fit on one line, then we break out into // an if/else statement. Otherwise we remain as a ternary. -const printTernary: Plugin.Printer = (path, _opts, print) => { +export const printTernary: Plugin.Printer = (path, _opts, print) => { const [predicate, truthyClause, falsyClause] = path.map(print, "body"); const ternaryClauses = printTernaryClauses("if", truthyClause, falsyClause); @@ -270,7 +270,7 @@ function printConditional(keyword: string): Plugin.Printer = (path, opts, print) => { +export const printElse: Plugin.Printer = (path, opts, print) => { const stmts = path.getValue().body[0]; return concat([ @@ -282,7 +282,7 @@ const printElse: Plugin.Printer = (path, opts, print) => { ]); }; -const printElsif: Plugin.Printer = (path, opts, print) => { +export const printElsif: Plugin.Printer = (path, opts, print) => { const [_predicate, _statements, addition] = path.getValue().body; const parts = [ group( @@ -301,12 +301,7 @@ const printElsif: Plugin.Printer = (path, opts, print) => { return group(concat(parts)); }; -module.exports = { - else: printElse, - elsif: printElsif, - if: printConditional("if"), - ifop: printTernary, - if_mod: printSingle("if", true), - unless: printConditional("unless"), - unless_mod: printSingle("unless", true) -}; +export const printIf = printConditional("if"); +export const printIfModifier = printSingle("if", true); +export const printUnless = printConditional("unless"); +export const printUnlessModifier = printSingle("unless", true); diff --git a/src/ruby/nodes/constants.ts b/src/ruby/nodes/constants.ts index 9ff45400..37642881 100644 --- a/src/ruby/nodes/constants.ts +++ b/src/ruby/nodes/constants.ts @@ -3,15 +3,15 @@ import type { Plugin, Ruby } from "./types"; const { concat, group, indent, join, softline } = require("../../prettier"); import { makeCall } from "../../utils"; -const printConstPath: Plugin.Printer = (path, opts, print) => { +export const printConstPath: Plugin.Printer = (path, opts, print) => { return join("::", path.map(print, "body")); }; -const printConstRef: Plugin.Printer = (path, opts, print) => { +export const printConstRef: Plugin.Printer = (path, opts, print) => { return path.call(print, "body", 0); }; -const printDefined: Plugin.Printer = (path, opts, print) => { +export const printDefined: Plugin.Printer = (path, opts, print) => { return group( concat([ "defined?(", @@ -21,7 +21,7 @@ const printDefined: Plugin.Printer = (path, opts, print) => { ); }; -const printField: Plugin.Printer = (path, opts, print) => { +export const printField: Plugin.Printer = (path, opts, print) => { return group( concat([ path.call(print, "body", 0), @@ -30,16 +30,6 @@ const printField: Plugin.Printer = (path, opts, print) => { ); }; -const printTopConst: Plugin.Printer = (path, opts, print) => { +export const printTopConst: Plugin.Printer = (path, opts, print) => { return concat(["::", path.call(print, "body", 0)]); }; - -module.exports = { - const_path_field: printConstPath, - const_path_ref: printConstPath, - const_ref: printConstRef, - defined: printDefined, - field: printField, - top_const_field: printTopConst, - top_const_ref: printTopConst -}; diff --git a/src/ruby/nodes/flow.ts b/src/ruby/nodes/flow.ts index eec52de3..1665fc75 100644 --- a/src/ruby/nodes/flow.ts +++ b/src/ruby/nodes/flow.ts @@ -41,7 +41,7 @@ function maybeHandleParens(path: Plugin.Path, print: Plu return concat([keyword, path.call.apply(path, args)]); } -const printBreak: Plugin.Printer = (path, opts, print) => { +export const printBreak: Plugin.Printer = (path, opts, print) => { const content = path.getValue().body[0]; if (content.body.length === 0) { @@ -55,7 +55,7 @@ const printBreak: Plugin.Printer = (path, opts, print) => { ); }; -const printNext: Plugin.Printer = (path, opts, print) => { +export const printNext: Plugin.Printer = (path, opts, print) => { const args = path.getValue().body[0].body[0]; if (!args) { @@ -69,7 +69,7 @@ const printNext: Plugin.Printer = (path, opts, print) => { ); }; -const printYield: Plugin.Printer = (path, opts, print) => { +export const printYield: Plugin.Printer = (path, opts, print) => { if (path.getValue().body[0].type === "paren") { return concat(["yield", path.call(print, "body", 0)]); } @@ -77,9 +77,4 @@ const printYield: Plugin.Printer = (path, opts, print) => { return concat(["yield ", join(", ", path.call(print, "body", 0))]); }; -module.exports = { - break: printBreak, - next: printNext, - yield: printYield, - yield0: literal("yield") -}; +export const printYield0 = literal("yield"); diff --git a/src/ruby/nodes/hashes.ts b/src/ruby/nodes/hashes.ts index eae277a8..4516ccdd 100644 --- a/src/ruby/nodes/hashes.ts +++ b/src/ruby/nodes/hashes.ts @@ -81,7 +81,7 @@ const printHashKeyRocket: KeyPrinter = (path, print) => { return concat([doc, " =>"]); }; -const printAssocNew: Plugin.Printer = (path, opts, print) => { +export const printAssocNew: Plugin.Printer = (path, opts, print) => { const [keyNode, valueNode] = path.getValue().body; const { keyPrinter } = path.getParentNode() as HashContents; @@ -104,11 +104,11 @@ const printAssocNew: Plugin.Printer = (path, opts, print) => { return group(concat(parts)); }; -const printAssocSplat: Plugin.Printer = (path, opts, print) => { +export const printAssocSplat: Plugin.Printer = (path, opts, print) => { return concat(["**", path.call(print, "body", 0)]); }; -const printHashContents: Plugin.Printer = (path, opts, print) => { +export const printHashContents: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); // First determine which key printer we're going to use, so that the child @@ -121,7 +121,7 @@ const printHashContents: Plugin.Printer = (path, opts, print) => { return join(concat([",", line]), path.map(print, "body")); }; -const printHash: Plugin.Printer = (path, opts, print) => { +export const printHash: Plugin.Printer = (path, opts, print) => { const hashNode = path.getValue(); // Hashes normally have a single assoclist_from_args child node. If it's @@ -152,11 +152,3 @@ const printHash: Plugin.Printer = (path, opts, print) => { return group(hashDoc); }; - -module.exports = { - assoc_new: printAssocNew, - assoc_splat: printAssocSplat, - assoclist_from_args: printHashContents, - bare_assoc_hash: printHashContents, - hash: printHash -}; diff --git a/src/ruby/nodes/heredocs.ts b/src/ruby/nodes/heredocs.ts index 4aa9b9f7..1ab0fd02 100644 --- a/src/ruby/nodes/heredocs.ts +++ b/src/ruby/nodes/heredocs.ts @@ -3,7 +3,7 @@ import type { Plugin, Ruby } from "./types"; const { concat, group, lineSuffix, join } = require("../../prettier"); import { literallineWithoutBreakParent } from "../../utils"; -const printHeredoc: Plugin.Printer = (path, opts, print) => { +export const printHeredoc: Plugin.Printer = (path, opts, print) => { const { body, ending } = path.getValue(); const parts = body.map((part, index) => { @@ -32,7 +32,3 @@ const printHeredoc: Plugin.Printer = (path, opts, print) => { ]) ); }; - -module.exports = { - heredoc: printHeredoc -}; diff --git a/src/ruby/nodes/hooks.ts b/src/ruby/nodes/hooks.ts index 4395aafc..1fc42920 100644 --- a/src/ruby/nodes/hooks.ts +++ b/src/ruby/nodes/hooks.ts @@ -30,7 +30,5 @@ function printHook(name: string): Plugin.Printer { }; } -module.exports = { - BEGIN: printHook("BEGIN"), - END: printHook("END") -}; +export const printBEGIN = printHook("BEGIN"); +export const printEND = printHook("END"); diff --git a/src/ruby/nodes/ints.ts b/src/ruby/nodes/ints.ts index cd4398f8..4572cb60 100644 --- a/src/ruby/nodes/ints.ts +++ b/src/ruby/nodes/ints.ts @@ -11,7 +11,7 @@ import type { Plugin, Ruby } from "./types"; // If it's a decimal number, it can be optional separated by any number of // arbitrarily places underscores. This can be useful for dollars and cents // (34_99), dates (2020_11_30), and normal 3 digit separation (1_222_333). -const printInt: Plugin.Printer = (path, _opts, _print) => { +export const printInt: Plugin.Printer = (path, _opts, _print) => { const { body } = path.getValue(); // If the number is a base 10 number, is sufficiently large, and is not @@ -27,7 +27,3 @@ const printInt: Plugin.Printer = (path, _opts, _print) => { return body; }; - -module.exports = { - "@int": printInt -}; diff --git a/src/ruby/nodes/lambdas.ts b/src/ruby/nodes/lambdas.ts index 6e953f8c..091e514d 100644 --- a/src/ruby/nodes/lambdas.ts +++ b/src/ruby/nodes/lambdas.ts @@ -53,7 +53,7 @@ function printLambdaParams(path: Plugin.Path, print: Plugin.Print) // for the single-line form. However, if we have an ancestor that is a command // or command_call node, then we'll need to use braces either way because of // operator precendence. -const printLambda: Plugin.Printer = (path, opts, print) => { +export const printLambda: Plugin.Printer = (path, opts, print) => { const params = printLambdaParams(path, print); const inCommand = hasAncestor(path, ["command", "command_call"]); @@ -72,7 +72,3 @@ const printLambda: Plugin.Printer = (path, opts, print) => { ) ); }; - -module.exports = { - lambda: printLambda -}; diff --git a/src/ruby/nodes/loops.ts b/src/ruby/nodes/loops.ts index 275ff89d..76caa975 100644 --- a/src/ruby/nodes/loops.ts +++ b/src/ruby/nodes/loops.ts @@ -73,7 +73,7 @@ function printLoop(keyword: string, modifier: boolean): Plugin.Printer = (path, opts, print) => { +export const printFor: Plugin.Printer = (path, opts, print) => { const [varDoc, rangeDoc, stmtsDoc] = path.map(print, "body"); const varsDoc = path.getValue().body[0].type === "mlhs" ? join(", ", varDoc) : varDoc; @@ -90,10 +90,7 @@ const printFor: Plugin.Printer = (path, opts, print) => { ); }; -module.exports = { - while: printLoop("while", false), - while_mod: printLoop("while", true), - until: printLoop("until", false), - until_mod: printLoop("until", true), - for: printFor -}; +export const printWhile = printLoop("while", false); +export const printWhileModifier = printLoop("while", true); +export const printUntil = printLoop("until", false); +export const printUntilModifer = printLoop("until", true); diff --git a/src/ruby/nodes/massign.ts b/src/ruby/nodes/massign.ts index c52274bd..bcc9892e 100644 --- a/src/ruby/nodes/massign.ts +++ b/src/ruby/nodes/massign.ts @@ -9,7 +9,7 @@ const { softline } = require("../../prettier"); -const printMAssign: Plugin.Printer = (path, opts, print) => { +export const printMAssign: Plugin.Printer = (path, opts, print) => { let right = path.call(print, "body", 1); if ( @@ -30,15 +30,15 @@ const printMAssign: Plugin.Printer = (path, opts, print) => { ); }; -const printMLHS: Plugin.Printer = (path, opts, print) => { +export const printMLHS: Plugin.Printer = (path, opts, print) => { return path.map(print, "body"); }; -const printMLHSAddPost: Plugin.Printer = (path, opts, print) => { +export const printMLHSAddPost: Plugin.Printer = (path, opts, print) => { return (path.call(print, "body", 0) as Plugin.Doc[]).concat(path.call(print, "body", 1)); }; -const printMLHSAddStar: Plugin.Printer = (path, opts, print) => { +export const printMLHSAddStar: Plugin.Printer = (path, opts, print) => { const rightParts: Plugin.Doc[] = ["*"]; if (path.getValue().body[1]) { @@ -48,7 +48,7 @@ const printMLHSAddStar: Plugin.Printer = (path, opts, print) = return (path.call(print, "body", 0) as Plugin.Doc[]).concat(concat(rightParts)); }; -const printMLHSParen: Plugin.Printer = (path, opts, print) => { +export const printMLHSParen: Plugin.Printer = (path, opts, print) => { if (["massign", "mlhs_paren"].includes(path.getParentNode().type)) { // If we're nested in brackets as part of the left hand side of an // assignment, i.e., (a, b, c) = 1, 2, 3 @@ -68,17 +68,17 @@ const printMLHSParen: Plugin.Printer = (path, opts, print) => { return group(concat(["(", indent(concat(parts)), concat([softline, ")"])])); }; -const printMRHS: Plugin.Printer = (path, opts, print) => { +export const printMRHS: Plugin.Printer = (path, opts, print) => { return path.map(print, "body"); }; -const printMRHSAddStar: Plugin.Printer = (path, opts, print) => { +export const printMRHSAddStar: Plugin.Printer = (path, opts, print) => { const [leftDoc, rightDoc] = path.map(print, "body"); return (leftDoc as Plugin.Doc[]).concat([concat(["*", rightDoc])]); }; -const printMRHSNewFromArgs: Plugin.Printer = (path, opts, print) => { +export const printMRHSNewFromArgs: Plugin.Printer = (path, opts, print) => { const parts = path.call(print, "body", 0) as Plugin.Doc[]; if (path.getValue().body[1]) { @@ -87,14 +87,3 @@ const printMRHSNewFromArgs: Plugin.Printer = (path, opts, return parts; }; - -module.exports = { - massign: printMAssign, - mlhs: printMLHS, - mlhs_add_post: printMLHSAddPost, - mlhs_add_star: printMLHSAddStar, - mlhs_paren: printMLHSParen, - mrhs: printMRHS, - mrhs_add_star: printMRHSAddStar, - mrhs_new_from_args: printMRHSNewFromArgs -}; diff --git a/src/ruby/nodes/methods.ts b/src/ruby/nodes/methods.ts index 1528b82b..7d0ce513 100644 --- a/src/ruby/nodes/methods.ts +++ b/src/ruby/nodes/methods.ts @@ -50,7 +50,7 @@ function printMethod(offset: number): Plugin.Printer { }; } -const printSingleLineMethod: Plugin.Printer = (path, opts, print) => { +export const printSingleLineMethod: Plugin.Printer = (path, opts, print) => { let parensNode = path.getValue().body[1]; let paramsDoc: Plugin.Doc = ""; @@ -73,13 +73,9 @@ const printSingleLineMethod: Plugin.Printer = (path, opts, print) => ); }; -const printAccessControl: Plugin.Printer = (path, opts, print) => { +export const printAccessControl: Plugin.Printer = (path, opts, print) => { return path.call(print, "body", 0); }; -module.exports = { - access_ctrl: printAccessControl, - def: printMethod(0), - defs: printMethod(2), - defsl: printSingleLineMethod -}; +export const printDef = printMethod(0); +export const printDefs = printMethod(2); diff --git a/src/ruby/nodes/operators.ts b/src/ruby/nodes/operators.ts index d7d0ef50..ec3dadaf 100644 --- a/src/ruby/nodes/operators.ts +++ b/src/ruby/nodes/operators.ts @@ -3,7 +3,7 @@ import type { Plugin, Ruby } from "./types"; const { concat, group, indent, line, softline } = require("../../prettier"); import { noIndent } from "../../utils"; -const printBinary: Plugin.Printer = (path, opts, print) => { +export const printBinary: Plugin.Printer = (path, opts, print) => { const [_leftNode, operator, rightNode] = path.getValue().body; const space = operator === "**" ? "" : " "; @@ -38,7 +38,7 @@ const printBinary: Plugin.Printer = (path, opts, print) => { // dot2 nodes are used with ranges (or flip-flops). They can optionally drop // their left side for beginless ranges or their right side for endless ranges. -const printDot2: Plugin.Printer = (path, opts, print) => { +export const printDot2: Plugin.Printer = (path, opts, print) => { const [leftNode, rightNode] = path.getValue().body; return concat([ @@ -50,7 +50,7 @@ const printDot2: Plugin.Printer = (path, opts, print) => { // dot3 nodes are used with ranges (or flip-flops). They can optionally drop // their left side for beginless ranges or their right side for endless ranges. -const printDot3: Plugin.Printer = (path, opts, print) => { +export const printDot3: Plugin.Printer = (path, opts, print) => { const [leftNode, rightNode] = path.getValue().body; return concat([ @@ -60,7 +60,7 @@ const printDot3: Plugin.Printer = (path, opts, print) => { ]); }; -const printUnary: Plugin.Printer = (path, opts, print) => { +export const printUnary: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); const contentsDoc = path.call(print, "body", 0); @@ -76,10 +76,3 @@ const printUnary: Plugin.Printer = (path, opts, print) => { return concat([node.oper, contentsDoc]); }; - -module.exports = { - binary: printBinary, - dot2: printDot2, - dot3: printDot3, - unary: printUnary -}; diff --git a/src/ruby/nodes/params.ts b/src/ruby/nodes/params.ts index e411bcca..9a56647a 100644 --- a/src/ruby/nodes/params.ts +++ b/src/ruby/nodes/params.ts @@ -10,7 +10,7 @@ const { } = require("../../prettier"); import { literal } from "../../utils"; -function printRestParam(symbol: string): Plugin.Printer { +function printRestParamSymbol(symbol: string): Plugin.Printer { return function printRestParamWithSymbol(path, opts, print) { return path.getValue().body[0] ? concat([symbol, path.call(print, "body", 0)]) @@ -18,7 +18,7 @@ function printRestParam(symbol: string): Plugin.Printer = (path, opts, print) => { +export const printParams: Plugin.Printer = (path, opts, print) => { const [reqs, optls, rest, post, kwargs, kwargRest, block] = path.getValue().body; let parts: Plugin.Doc[] = []; @@ -100,9 +100,6 @@ const printParams: Plugin.Printer = (path, opts, print) => { return group(concat(contents)); }; -module.exports = { - args_forward: literal("..."), - kwrest_param: printRestParam("**"), - rest_param: printRestParam("*"), - params: printParams -}; +export const printArgsForward = literal("..."); +export const printKeywordRestParam = printRestParamSymbol("**"); +export const printRestParam = printRestParamSymbol("*"); diff --git a/src/ruby/nodes/patterns.ts b/src/ruby/nodes/patterns.ts index ceaf864b..1e4bb353 100644 --- a/src/ruby/nodes/patterns.ts +++ b/src/ruby/nodes/patterns.ts @@ -26,7 +26,7 @@ const printPatternArg: Plugin.Printer = (path, opts, print) => { return path.call(print); }; -const printAryPtn: Plugin.Printer = (path, opts, print) => { +export const printAryPtn: Plugin.Printer = (path, opts, print) => { const [constant, preargs, splatarg, postargs] = path.getValue().body; let args: Plugin.Doc[] = []; @@ -57,7 +57,7 @@ const printAryPtn: Plugin.Printer = (path, opts, print) => { return args; }; -const printFndPtn: Plugin.Printer = (path, opts, print) => { +export const printFndPtn: Plugin.Printer = (path, opts, print) => { const [constant] = path.getValue().body; let args = [concat(["*", path.call(print, "body", 1)])] @@ -73,7 +73,7 @@ const printFndPtn: Plugin.Printer = (path, opts, print) => { return args; }; -const printHshPtn: Plugin.Printer = (path, opts, print) => { +export const printHshPtn: Plugin.Printer = (path, opts, print) => { const [constant, keyValuePairs, keyValueRest] = path.getValue().body; let args: Plugin.Doc[] = []; @@ -116,7 +116,7 @@ const printHshPtn: Plugin.Printer = (path, opts, print) => { return args; }; -const printIn: Plugin.Printer = (path, opts, print) => { +export const printIn: Plugin.Printer = (path, opts, print) => { const parts = [ "in ", align( @@ -137,7 +137,7 @@ const printIn: Plugin.Printer = (path, opts, print) => { return group(concat(parts)); }; -const printRAssign: Plugin.Printer = (path, opts, print) => { +export const printRAssign: Plugin.Printer = (path, opts, print) => { const { keyword } = path.getValue(); const [leftDoc, rightDoc] = path.map(print, "body"); @@ -149,11 +149,3 @@ const printRAssign: Plugin.Printer = (path, opts, print) => { ]) ); }; - -module.exports = { - aryptn: printAryPtn, - fndptn: printFndPtn, - hshptn: printHshPtn, - in: printIn, - rassign: printRAssign -}; diff --git a/src/ruby/nodes/regexp.ts b/src/ruby/nodes/regexp.ts index 1fab331c..efc1f1dc 100644 --- a/src/ruby/nodes/regexp.ts +++ b/src/ruby/nodes/regexp.ts @@ -32,7 +32,7 @@ function forwardSlashIsAmbiguous(path: Plugin.Path) { // // We favor the use of forward slashes unless the regex contains a forward slash // itself. In that case we switch over to using %r with braces. -const printRegexpLiteral: Plugin.Printer = (path, opts, print) => { +export const printRegexpLiteral: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); const docs = path.map(print, "body"); @@ -52,7 +52,3 @@ const printRegexpLiteral: Plugin.Printer = (path, opts, prin .concat(useBraces ? "}" : "/", node.ending.slice(1)) ); }; - -module.exports = { - regexp_literal: printRegexpLiteral -}; diff --git a/src/ruby/nodes/rescue.ts b/src/ruby/nodes/rescue.ts index 33de007d..c0929db1 100644 --- a/src/ruby/nodes/rescue.ts +++ b/src/ruby/nodes/rescue.ts @@ -12,7 +12,7 @@ const { } = require("../../prettier"); import { literal } from "../../utils"; -const printBegin: Plugin.Printer = (path, opts, print) => { +export const printBegin: Plugin.Printer = (path, opts, print) => { return concat([ "begin", indent(concat([hardline, concat(path.map(print, "body"))])), @@ -21,14 +21,14 @@ const printBegin: Plugin.Printer = (path, opts, print) => { ]); }; -const printEnsure: Plugin.Printer = (path, opts, print) => { +export const printEnsure: Plugin.Printer = (path, opts, print) => { return concat([ path.call(print, "body", 0), indent(concat([hardline, path.call(print, "body", 1)])) ]); }; -const printRescue: Plugin.Printer = (path, opts, print) => { +export const printRescue: Plugin.Printer = (path, opts, print) => { const parts = ["rescue"]; if (path.getValue().body[0]) { @@ -57,7 +57,7 @@ const printRescue: Plugin.Printer = (path, opts, print) => { // This is a container node that we're adding into the AST that isn't present in // Ripper solely so that we have a nice place to attach inline comments. -const printRescueEx: Plugin.Printer = (path, opts, print) => { +export const printRescueEx: Plugin.Printer = (path, opts, print) => { const [exception, variable] = path.getValue().body; const parts = []; @@ -79,7 +79,7 @@ const printRescueEx: Plugin.Printer = (path, opts, print) => { return group(concat(parts)); }; -const printRescueMod: Plugin.Printer = (path, opts, print) => { +export const printRescueMod: Plugin.Printer = (path, opts, print) => { const [statementDoc, valueDoc] = path.map(print, "body"); return concat([ @@ -93,12 +93,5 @@ const printRescueMod: Plugin.Printer = (path, opts, print) ]); }; -module.exports = { - begin: printBegin, - ensure: printEnsure, - redo: literal("redo"), - rescue: printRescue, - rescue_ex: printRescueEx, - rescue_mod: printRescueMod, - retry: literal("retry") -}; +export const printRedo = literal("redo"); +export const printRetry = literal("retry"); diff --git a/src/ruby/nodes/return.ts b/src/ruby/nodes/return.ts index f2a7ba25..c86a40a5 100644 --- a/src/ruby/nodes/return.ts +++ b/src/ruby/nodes/return.ts @@ -41,7 +41,7 @@ function canSkipParens(args: Ruby.Args | Ruby.ArgsAddStar) { type CallArgs = [Plugin.Print, ...PropertyKey[]]; -const printReturn: Plugin.Printer = (path, opts, print) => { +export const printReturn: Plugin.Printer = (path, opts, print) => { let args = path.getValue().body[0].body[0] as Ruby.Args | Ruby.ArgsAddStar; let steps = ["body", 0, "body", 0]; @@ -92,7 +92,4 @@ const printReturn: Plugin.Printer = (path, opts, print) => { ); }; -module.exports = { - return: printReturn, - return0: literal("return") -}; +export const printReturn0 = literal("return"); diff --git a/src/ruby/nodes/statements.ts b/src/ruby/nodes/statements.ts index b0a1f419..427b9a49 100644 --- a/src/ruby/nodes/statements.ts +++ b/src/ruby/nodes/statements.ts @@ -16,7 +16,7 @@ const { import { isEmptyStmts } from "../../utils"; -const printBodyStmt: Plugin.Printer = (path, opts, print) => { +export const printBodyStmt: Plugin.Printer = (path, opts, print) => { const [stmts, rescue, elseClause, ensure] = path.getValue().body; const parts = []; @@ -48,7 +48,7 @@ const printBodyStmt: Plugin.Printer = (path, opts, print) => { const argNodeTypes = ["args", "args_add_star", "args_add_block"]; -const printParen: Plugin.Printer = (path, opts, print) => { +export const printParen: Plugin.Printer = (path, opts, print) => { const contentNode = path.getValue().body[0]; if (!contentNode) { @@ -74,20 +74,20 @@ const printParen: Plugin.Printer = (path, opts, print) => { ); }; -const printEndContent: Plugin.Printer = (path, opts, print) => { +export const printEndContent: Plugin.Printer = (path, opts, print) => { const { body } = path.getValue(); return concat([trim, "__END__", literalline, body]); }; -const printComment: Plugin.Printer = (path, opts, print) => { +export const printComment: Plugin.Printer = (path, opts, print) => { return opts.printer.printComment(path, opts); }; -const printProgram: Plugin.Printer = (path, opts, print) => { +export const printProgram: Plugin.Printer = (path, opts, print) => { return concat([join(hardline, path.map(print, "body")), hardline]); }; -const printStmts: Plugin.Printer = (path, opts, print) => { +export const printStmts: Plugin.Printer = (path, opts, print) => { const stmts = path.getValue().body; // This is a special case where we have only comments inside a statement @@ -142,12 +142,3 @@ const printStmts: Plugin.Printer = (path, opts, print) => { return concat(parts); }; - -module.exports = { - "@__end__": printEndContent, - "@comment": printComment, - bodystmt: printBodyStmt, - paren: printParen, - program: printProgram, - stmts: printStmts -}; diff --git a/src/ruby/nodes/strings.ts b/src/ruby/nodes/strings.ts index f5b654d4..dec3e317 100644 --- a/src/ruby/nodes/strings.ts +++ b/src/ruby/nodes/strings.ts @@ -75,7 +75,7 @@ function getClosingQuote(quote: string) { // Prints a @CHAR node. @CHAR nodes are special character strings that usually // are strings of length 1. If they're any longer than we'll try to apply the // correct quotes. -const printChar: Plugin.Printer = (path, { rubySingleQuote }, _print) => { +export const printChar: Plugin.Printer = (path, { rubySingleQuote }, _print) => { const { body } = path.getValue(); if (body.length !== 2) { @@ -143,7 +143,7 @@ function shouldPrintPercentSDynaSymbol(node: Ruby.DynaSymbol) { // // In the case of a plain dyna symbol, node.quote will be either :" or :' // For %s dyna symbols, node.quote will be %s[, %s(, %s{, or %s< -const printDynaSymbol: Plugin.Printer = (path, opts, print) => { +export const printDynaSymbol: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); if (shouldPrintPercentSDynaSymbol(node)) { @@ -191,7 +191,7 @@ const printDynaSymbol: Plugin.Printer = (path, opts, print) => return concat(parts); }; -const printStringConcat: Plugin.Printer = (path, opts, print) => { +export const printStringConcat: Plugin.Printer = (path, opts, print) => { const [leftDoc, rightDoc] = path.map(print, "body"); return group(concat([leftDoc, " \\", indent(concat([hardline, rightDoc]))])); @@ -199,11 +199,11 @@ const printStringConcat: Plugin.Printer = (path, opts, print) // Prints out an interpolated variable in the string by converting it into an // embedded expression. -const printStringDVar: Plugin.Printer = (path, opts, print) => { +export const printStringDVar: Plugin.Printer = (path, opts, print) => { return concat(["#{", path.call(print, "body", 0), "}"]); }; -const printStringEmbExpr: Plugin.Printer = (path, opts, print) => { +export const printStringEmbExpr: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); const parts = path.call(print, "body", 0); @@ -223,7 +223,7 @@ const printStringEmbExpr: Plugin.Printer = (path, opts, prin // wishes of the user with regards to single versus double quotes, but if the // string contains any escape expressions then it will just keep the original // quotes. -const printStringLiteral: Plugin.Printer = (path, { rubySingleQuote }, print) => { +export const printStringLiteral: Plugin.Printer = (path, { rubySingleQuote }, print) => { const node = path.getValue(); // If the string is empty, it will not have any parts, so just print out the @@ -255,23 +255,12 @@ const printStringLiteral: Plugin.Printer = (path, { rubySing // Prints out a symbol literal. Its child will always be the ident that // represents the string content of the symbol. -const printSymbolLiteral: Plugin.Printer = (path, opts, print) => { +export const printSymbolLiteral: Plugin.Printer = (path, opts, print) => { return concat([":", path.call(print, "body", 0)]); }; // Prints out an xstring literal. Its child is an array of string parts, // including plain string content and interpolated content. -const printXStringLiteral: Plugin.Printer = (path, opts, print) => { +export const printXStringLiteral: Plugin.Printer = (path, opts, print) => { return concat((["`"] as Plugin.Doc[]).concat(path.map(print, "body")).concat("`")); }; - -module.exports = { - "@CHAR": printChar, - dyna_symbol: printDynaSymbol, - string_concat: printStringConcat, - string_dvar: printStringDVar, - string_embexpr: printStringEmbExpr, - string_literal: printStringLiteral, - symbol_literal: printSymbolLiteral, - xstring_literal: printXStringLiteral -}; diff --git a/src/ruby/nodes/super.ts b/src/ruby/nodes/super.ts index 2f87da20..2a1d93f3 100644 --- a/src/ruby/nodes/super.ts +++ b/src/ruby/nodes/super.ts @@ -3,7 +3,7 @@ import type { Plugin, Ruby } from "./types"; const { align, concat, group, join, line } = require("../../prettier"); import { literal } from "../../utils"; -const printSuper: Plugin.Printer = (path, opts, print) => { +export const printSuper: Plugin.Printer = (path, opts, print) => { const args = path.getValue().body[0]; if (args.type === "arg_paren") { @@ -29,9 +29,4 @@ const printSuper: Plugin.Printer = (path, opts, print) => { }; // Version of super without any parens or args. -const printZSuper = literal("super"); - -module.exports = { - super: printSuper, - zsuper: printZSuper -}; +export const printZSuper = literal("super"); diff --git a/src/ruby/nodes/types.ts b/src/ruby/nodes/types.ts index 993dd634..27a8996d 100644 --- a/src/ruby/nodes/types.ts +++ b/src/ruby/nodes/types.ts @@ -8,15 +8,9 @@ export namespace Plugin { // This is just a simple alias for the doc nodes. export type Doc = Prettier.doc.builders.Doc; - // We're overwriting call and map here because if you restrict the AST for the - // main path then presumably you're printing a lower node in the tree that - // won't match the current AST type. - export type Path = Omit, "call" | "each" | "getParentNode" | "map"> & { - call: (callback: (path: Path) => U, ...names: PropertyKey[]) => U, - each: (callback: (path: Path, index: number, value: any) => void, ...names: PropertyKey[]) => void, - getParentNode: (count?: number | undefined) => any | null, - map: (callback: (path: Path, index: number, value: any) => U, ...names: PropertyKey[]) => U[] - }; + // This is the regular embed except that it's required and it's restricted to + // our AST. + export type Embed = Required>["embed"]; // This is the regular prettier options + the options defined by this plugin. export type Options = Prettier.ParserOptions & { @@ -29,10 +23,29 @@ export namespace Plugin { rubyToProc: boolean }; + // We're overwriting call and map here because if you restrict the AST for the + // main path then presumably you're printing a lower node in the tree that + // won't match the current AST type. + export type Path = Omit, "call" | "each" | "getParentNode" | "map"> & { + call: (callback: (path: Path) => U, ...names: PropertyKey[]) => U, + each: (callback: (path: Path, index: number, value: any) => void, ...names: PropertyKey[]) => void, + getParentNode: (count?: number | undefined) => any | null, + map: (callback: (path: Path, index: number, value: any) => U, ...names: PropertyKey[]) => U[] + }; + + // The Prettier Printer type is missing some options. + export type PrinterConfig = Omit, "print"> & { + getCommentChildNodes: (node: any) => any[], + isBlockComment: (comment: any, options: Plugin.Options) => boolean, + print: Printer + }; + // This is the regular print node, except it's not restricted by the AST that // is passed to the parent AST. export type Print = (path: Path) => Doc; + // This is the regular printer, except it uses our overridden options and + // print types. export type Printer = (path: Path, options: Options, print: Print) => Doc; } @@ -47,13 +60,9 @@ export namespace Ruby { type ParserEvent0 = { type: T, body: string } & Comments & Location; type ParserEvent = { type: T } & Comments & Location & V; - // This is a useful node type to have around when you're just looking at - // comparing any generic node. - export type Node = { type: string } & Comments & Location; - // This is the main expression type that goes in places where the AST will // accept just about anything. - export type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgsForward | Array | Assign | BEGIN | Backref | Begin | Binary | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | Defsl | Dot2 | Dot3 | DynaSymbol | END | Fcall | Field | Float | For | GVar | Hash | Heredoc | IVar | Identifier | If | IfModifier | Ternary | Imaginary | Int | Keyword | Label | Lambda | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsAddPost | MlhsAddStar | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Op | Opassign | Params | Paren | Qsymbols | Qwords | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueModifier | Retry | Return | Return0 | Sclass | String | StringConcat | StringLiteral | Super | SymbolLiteral | Symbols | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VarAlias | VarField | VarRef | VCall | VoidStmt | While | WhileModifier | Words | XStringLiteral | Yield | Yield0 | Zsuper; + export type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgParen | Args | ArgsAddBlock | ArgsAddStar | ArgsForward | Array | Aryptn | Assign | AssocNew | AssocSplat | AssoclistFromArgs | BEGIN | Backref | Backtick | BareAssocHash | Begin | Binary | BlockVar | Blockarg | Bodystmt | BraceBlock | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | Defsl | DoBlock | Dot2 | Dot3 | DynaSymbol | END | Else | Elsif | EndContent | Ensure | ExcessedComma | Fcall | Field | Float | FndPtn | For | GVar | Hash | Heredoc | HeredocBegin | Hshptn | IVar | Identifier | If | IfModifier | Imaginary | In | Int | Keyword | KeywordRestParam | Label | Lambda | Lbrace | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Op | Opassign | Params | Paren | Period | Program | Qsymbols | Qwords | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueEx | RescueModifier | RestParam | Retry | Return | Return0 | Sclass | Stmts | String | StringConcat | StringDVar | StringEmbExpr | StringLiteral | Super | SymbolLiteral | Symbols | TStringContent | Ternary | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VCall | VarAlias | VarField | VarRef | VoidStmt | When | While | WhileModifier | Word | Words | XStringLiteral | Yield | Yield0 | Zsuper // This is a special scanner event that contains a comment. It can be attached // to almost any kind of node, which is why it's pulled out here separately. diff --git a/src/ruby/nodes/undef.ts b/src/ruby/nodes/undef.ts index d35b7f20..3227ace5 100644 --- a/src/ruby/nodes/undef.ts +++ b/src/ruby/nodes/undef.ts @@ -24,7 +24,7 @@ const printUndefSymbol: Plugin.Printer = ( return path.call(print, "body", 0); }; -const printUndef: Plugin.Printer = (path, opts, print) => { +export const printUndef: Plugin.Printer = (path, opts, print) => { const keyword = "undef "; const argNodes = path.map( (symbolPath) => printUndefSymbol(symbolPath, opts, print), @@ -38,7 +38,3 @@ const printUndef: Plugin.Printer = (path, opts, print) => { ]) ); }; - -module.exports = { - undef: printUndef -}; diff --git a/src/ruby/printer.ts b/src/ruby/printer.ts index 472cee16..2f127be2 100644 --- a/src/ruby/printer.ts +++ b/src/ruby/printer.ts @@ -1,10 +1,9 @@ -import type { Printer } from "prettier"; import type { Plugin, Ruby } from "./nodes/types"; const { concat, trim } = require("../prettier"); -const embed = require("./embed"); -const nodes = require("./nodes"); +import embed from "./embed"; +import nodes from "./nodes"; const noComments = [ "args", @@ -16,12 +15,7 @@ const noComments = [ "mlhs_paren" ]; -type PluginPrinter = Printer & { - getCommentChildNodes: (node: any) => any[], - isBlockComment: (comment: any, options: Plugin.Options) => boolean -}; - -const printer: PluginPrinter = { +const printer: Plugin.PrinterConfig = { // Certain nodes are used more for organizational purposed than for actually // displaying content, so we tell prettier that we don't want comments attached // to them. @@ -115,18 +109,18 @@ const printer: PluginPrinter = { // This is the generic node print function, used to convert any node in the AST // into its equivalent Doc representation. print(path, opts, print) { - const { type, body } = path.getValue() as any; + const node = path.getValue(); + const printer = nodes[node.type]; - if (type in nodes) { - return nodes[type](path, opts, print); + if (printer) { + return printer(path, opts, print); } - if (type[0] === "@") { - return body; + if (node.type[0] === "@") { + return (node as any).body; } - const ast = JSON.stringify(body, null, 2); - throw new Error(`Unsupported node encountered: ${type}\n${ast}`); + throw new Error(`Unsupported node encountered: ${node.type}`); }, // This is the generic print function for any comment in the AST. It handles // both regular comments that begin with a # and embdoc comments, which are diff --git a/src/ruby/toProc.ts b/src/ruby/toProc.ts index 1895dc06..3a34e29f 100644 --- a/src/ruby/toProc.ts +++ b/src/ruby/toProc.ts @@ -112,4 +112,4 @@ function toProc(path: Plugin.Path, node: Ruby.B return `&:${method.body}`; } -module.exports = toProc; +export default toProc; From 43f59a13530f9efc512b4548236df7c9763637c6 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Sep 2021 12:41:37 -0400 Subject: [PATCH 226/785] Move types down into Ruby directory --- src/ruby/embed.ts | 2 +- src/ruby/nodes.ts | 2 +- src/ruby/nodes/alias.ts | 2 +- src/ruby/nodes/aref.ts | 2 +- src/ruby/nodes/args.ts | 2 +- src/ruby/nodes/arrays.ts | 2 +- src/ruby/nodes/assign.ts | 2 +- src/ruby/nodes/blocks.ts | 2 +- src/ruby/nodes/calls.ts | 2 +- src/ruby/nodes/case.ts | 2 +- src/ruby/nodes/class.ts | 2 +- src/ruby/nodes/commands.ts | 2 +- src/ruby/nodes/conditionals.ts | 2 +- src/ruby/nodes/constants.ts | 2 +- src/ruby/nodes/flow.ts | 2 +- src/ruby/nodes/hashes.ts | 2 +- src/ruby/nodes/heredocs.ts | 2 +- src/ruby/nodes/hooks.ts | 2 +- src/ruby/nodes/ints.ts | 2 +- src/ruby/nodes/lambdas.ts | 2 +- src/ruby/nodes/loops.ts | 2 +- src/ruby/nodes/massign.ts | 2 +- src/ruby/nodes/methods.ts | 2 +- src/ruby/nodes/operators.ts | 2 +- src/ruby/nodes/params.ts | 2 +- src/ruby/nodes/patterns.ts | 2 +- src/ruby/nodes/regexp.ts | 2 +- src/ruby/nodes/rescue.ts | 2 +- src/ruby/nodes/return.ts | 2 +- src/ruby/nodes/statements.ts | 2 +- src/ruby/nodes/strings.ts | 2 +- src/ruby/nodes/super.ts | 2 +- src/ruby/nodes/undef.ts | 2 +- src/ruby/printer.ts | 2 +- src/ruby/toProc.ts | 2 +- src/ruby/{nodes => }/types.ts | 0 src/utils/containsAssignment.ts | 2 +- src/utils/getTrailingComma.ts | 2 +- src/utils/hasAncestor.ts | 2 +- src/utils/inlineEnsureParens.ts | 2 +- src/utils/isEmptyBodyStmt.ts | 2 +- src/utils/isEmptyStmts.ts | 2 +- src/utils/literal.ts | 2 +- src/utils/literallineWithoutBreakParent.ts | 2 +- src/utils/makeCall.ts | 2 +- src/utils/printEmptyCollection.ts | 2 +- src/utils/skipAssignIndent.ts | 2 +- 47 files changed, 46 insertions(+), 46 deletions(-) rename src/ruby/{nodes => }/types.ts (100%) diff --git a/src/ruby/embed.ts b/src/ruby/embed.ts index 284733bc..3fa7bb31 100644 --- a/src/ruby/embed.ts +++ b/src/ruby/embed.ts @@ -1,4 +1,4 @@ -import type { Plugin } from "./nodes/types"; +import type { Plugin } from "./types"; const { concat, diff --git a/src/ruby/nodes.ts b/src/ruby/nodes.ts index 589e021b..1aba958c 100644 --- a/src/ruby/nodes.ts +++ b/src/ruby/nodes.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./nodes/types"; +import type { Plugin, Ruby } from "./types"; import { printAlias } from "./nodes/alias"; import { printAref, printArefField } from "./nodes/aref"; diff --git a/src/ruby/nodes/alias.ts b/src/ruby/nodes/alias.ts index 025c3e25..c810794f 100644 --- a/src/ruby/nodes/alias.ts +++ b/src/ruby/nodes/alias.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { addTrailingComment, diff --git a/src/ruby/nodes/aref.ts b/src/ruby/nodes/aref.ts index 0fcdfced..f2e77cb3 100644 --- a/src/ruby/nodes/aref.ts +++ b/src/ruby/nodes/aref.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { concat, diff --git a/src/ruby/nodes/args.ts b/src/ruby/nodes/args.ts index b7f025cb..a05e9cc5 100644 --- a/src/ruby/nodes/args.ts +++ b/src/ruby/nodes/args.ts @@ -1,5 +1,5 @@ import type * as Prettier from "prettier"; -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { concat, diff --git a/src/ruby/nodes/arrays.ts b/src/ruby/nodes/arrays.ts index 4e35ebed..1c1042ce 100644 --- a/src/ruby/nodes/arrays.ts +++ b/src/ruby/nodes/arrays.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { concat, diff --git a/src/ruby/nodes/assign.ts b/src/ruby/nodes/assign.ts index bbaa9549..bd161c96 100644 --- a/src/ruby/nodes/assign.ts +++ b/src/ruby/nodes/assign.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { concat, group, indent, join, line } = require("../../prettier"); import { skipAssignIndent } from "../../utils"; diff --git a/src/ruby/nodes/blocks.ts b/src/ruby/nodes/blocks.ts index f29f7ef2..116eb3df 100644 --- a/src/ruby/nodes/blocks.ts +++ b/src/ruby/nodes/blocks.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { breakParent, diff --git a/src/ruby/nodes/calls.ts b/src/ruby/nodes/calls.ts index 1c87fd06..00316a8f 100644 --- a/src/ruby/nodes/calls.ts +++ b/src/ruby/nodes/calls.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { concat, diff --git a/src/ruby/nodes/case.ts b/src/ruby/nodes/case.ts index 6ed4e4a0..8f2bced7 100644 --- a/src/ruby/nodes/case.ts +++ b/src/ruby/nodes/case.ts @@ -1,5 +1,5 @@ import type * as Prettier from "prettier"; -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { align, diff --git a/src/ruby/nodes/class.ts b/src/ruby/nodes/class.ts index cc33531e..3c4c69f1 100644 --- a/src/ruby/nodes/class.ts +++ b/src/ruby/nodes/class.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { concat, group, hardline, indent } = require("../../prettier"); import { isEmptyBodyStmt } from "../../utils"; diff --git a/src/ruby/nodes/commands.ts b/src/ruby/nodes/commands.ts index 5341129b..c10cc513 100644 --- a/src/ruby/nodes/commands.ts +++ b/src/ruby/nodes/commands.ts @@ -1,5 +1,5 @@ import type * as Prettier from "prettier"; -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { align, diff --git a/src/ruby/nodes/conditionals.ts b/src/ruby/nodes/conditionals.ts index ff72d9a2..40cbb434 100644 --- a/src/ruby/nodes/conditionals.ts +++ b/src/ruby/nodes/conditionals.ts @@ -1,5 +1,5 @@ import type * as Prettier from "prettier"; -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { align, diff --git a/src/ruby/nodes/constants.ts b/src/ruby/nodes/constants.ts index 37642881..20af8839 100644 --- a/src/ruby/nodes/constants.ts +++ b/src/ruby/nodes/constants.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { concat, group, indent, join, softline } = require("../../prettier"); import { makeCall } from "../../utils"; diff --git a/src/ruby/nodes/flow.ts b/src/ruby/nodes/flow.ts index 1665fc75..56faef87 100644 --- a/src/ruby/nodes/flow.ts +++ b/src/ruby/nodes/flow.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { concat, join } = require("../../prettier"); import { literal } from "../../utils"; diff --git a/src/ruby/nodes/hashes.ts b/src/ruby/nodes/hashes.ts index 4516ccdd..5d370fbb 100644 --- a/src/ruby/nodes/hashes.ts +++ b/src/ruby/nodes/hashes.ts @@ -1,5 +1,5 @@ import { Doc } from "prettier"; -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { concat, diff --git a/src/ruby/nodes/heredocs.ts b/src/ruby/nodes/heredocs.ts index 1ab0fd02..54110a43 100644 --- a/src/ruby/nodes/heredocs.ts +++ b/src/ruby/nodes/heredocs.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { concat, group, lineSuffix, join } = require("../../prettier"); import { literallineWithoutBreakParent } from "../../utils"; diff --git a/src/ruby/nodes/hooks.ts b/src/ruby/nodes/hooks.ts index 1fc42920..de089370 100644 --- a/src/ruby/nodes/hooks.ts +++ b/src/ruby/nodes/hooks.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { concat, group, indent, line } = require("../../prettier"); diff --git a/src/ruby/nodes/ints.ts b/src/ruby/nodes/ints.ts index 4572cb60..a15974de 100644 --- a/src/ruby/nodes/ints.ts +++ b/src/ruby/nodes/ints.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; // An @int node is any literal integer in Ruby. They can come in a number of // bases, and look like the following: diff --git a/src/ruby/nodes/lambdas.ts b/src/ruby/nodes/lambdas.ts index 091e514d..668e95a3 100644 --- a/src/ruby/nodes/lambdas.ts +++ b/src/ruby/nodes/lambdas.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { concat, group, ifBreak, indent, line } = require("../../prettier"); import { hasAncestor } from "../../utils"; diff --git a/src/ruby/nodes/loops.ts b/src/ruby/nodes/loops.ts index 76caa975..34483d30 100644 --- a/src/ruby/nodes/loops.ts +++ b/src/ruby/nodes/loops.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { align, diff --git a/src/ruby/nodes/massign.ts b/src/ruby/nodes/massign.ts index bcc9892e..27868a9f 100644 --- a/src/ruby/nodes/massign.ts +++ b/src/ruby/nodes/massign.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { concat, diff --git a/src/ruby/nodes/methods.ts b/src/ruby/nodes/methods.ts index 7d0ce513..01c41040 100644 --- a/src/ruby/nodes/methods.ts +++ b/src/ruby/nodes/methods.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { concat, group, hardline, indent, line } = require("../../prettier"); import { isEmptyBodyStmt } from "../../utils"; diff --git a/src/ruby/nodes/operators.ts b/src/ruby/nodes/operators.ts index ec3dadaf..ada113ad 100644 --- a/src/ruby/nodes/operators.ts +++ b/src/ruby/nodes/operators.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { concat, group, indent, line, softline } = require("../../prettier"); import { noIndent } from "../../utils"; diff --git a/src/ruby/nodes/params.ts b/src/ruby/nodes/params.ts index 9a56647a..8b3dfa14 100644 --- a/src/ruby/nodes/params.ts +++ b/src/ruby/nodes/params.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { concat, diff --git a/src/ruby/nodes/patterns.ts b/src/ruby/nodes/patterns.ts index 1e4bb353..289b25b7 100644 --- a/src/ruby/nodes/patterns.ts +++ b/src/ruby/nodes/patterns.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { align, diff --git a/src/ruby/nodes/regexp.ts b/src/ruby/nodes/regexp.ts index efc1f1dc..9e19cca7 100644 --- a/src/ruby/nodes/regexp.ts +++ b/src/ruby/nodes/regexp.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { concat } = require("../../prettier"); import { hasAncestor } from "../../utils"; diff --git a/src/ruby/nodes/rescue.ts b/src/ruby/nodes/rescue.ts index c0929db1..74428c52 100644 --- a/src/ruby/nodes/rescue.ts +++ b/src/ruby/nodes/rescue.ts @@ -1,5 +1,5 @@ import type * as Prettier from "prettier"; -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { align, diff --git a/src/ruby/nodes/return.ts b/src/ruby/nodes/return.ts index c86a40a5..71786d8f 100644 --- a/src/ruby/nodes/return.ts +++ b/src/ruby/nodes/return.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { concat, diff --git a/src/ruby/nodes/statements.ts b/src/ruby/nodes/statements.ts index 427b9a49..e0999932 100644 --- a/src/ruby/nodes/statements.ts +++ b/src/ruby/nodes/statements.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { breakParent, diff --git a/src/ruby/nodes/strings.ts b/src/ruby/nodes/strings.ts index dec3e317..1a7c9e65 100644 --- a/src/ruby/nodes/strings.ts +++ b/src/ruby/nodes/strings.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { concat, diff --git a/src/ruby/nodes/super.ts b/src/ruby/nodes/super.ts index 2a1d93f3..2e3d87dd 100644 --- a/src/ruby/nodes/super.ts +++ b/src/ruby/nodes/super.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { align, concat, group, join, line } = require("../../prettier"); import { literal } from "../../utils"; diff --git a/src/ruby/nodes/undef.ts b/src/ruby/nodes/undef.ts index 3227ace5..5053c72c 100644 --- a/src/ruby/nodes/undef.ts +++ b/src/ruby/nodes/undef.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { addTrailingComment, diff --git a/src/ruby/printer.ts b/src/ruby/printer.ts index 2f127be2..80c81f13 100644 --- a/src/ruby/printer.ts +++ b/src/ruby/printer.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./nodes/types"; +import type { Plugin, Ruby } from "./types"; const { concat, trim } = require("../prettier"); diff --git a/src/ruby/toProc.ts b/src/ruby/toProc.ts index 3a34e29f..5cb23187 100644 --- a/src/ruby/toProc.ts +++ b/src/ruby/toProc.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./nodes/types"; +import type { Plugin, Ruby } from "./types"; function isCall(node: Ruby.CallOperator) { // Older versions of Ruby didn't have a @period ripper event, so we need to diff --git a/src/ruby/nodes/types.ts b/src/ruby/types.ts similarity index 100% rename from src/ruby/nodes/types.ts rename to src/ruby/types.ts diff --git a/src/utils/containsAssignment.ts b/src/utils/containsAssignment.ts index 7455096f..f87921e6 100644 --- a/src/utils/containsAssignment.ts +++ b/src/utils/containsAssignment.ts @@ -1,4 +1,4 @@ -import type { Ruby } from "../ruby/nodes/types"; +import type { Ruby } from "../ruby/types"; // If the node is a type of assignment or if the node is a paren and nested // inside that paren is a node that is a type of assignment. diff --git a/src/utils/getTrailingComma.ts b/src/utils/getTrailingComma.ts index 01e1d8c7..f37b6254 100644 --- a/src/utils/getTrailingComma.ts +++ b/src/utils/getTrailingComma.ts @@ -1,4 +1,4 @@ -import type { Plugin } from "../ruby/nodes/types"; +import type { Plugin } from "../ruby/types"; function getTrailingComma(opts: Plugin.Options) { return ["all", "es5"].includes(opts.trailingComma); diff --git a/src/utils/hasAncestor.ts b/src/utils/hasAncestor.ts index d6394997..2ee15744 100644 --- a/src/utils/hasAncestor.ts +++ b/src/utils/hasAncestor.ts @@ -1,4 +1,4 @@ -import type { Plugin } from "../ruby/nodes/types"; +import type { Plugin } from "../ruby/types"; function hasAncestor(path: Plugin.Path<{ type: string }>, types: string[]) { let parent = 0; diff --git a/src/utils/inlineEnsureParens.ts b/src/utils/inlineEnsureParens.ts index 22e6f410..cd65aa8b 100644 --- a/src/utils/inlineEnsureParens.ts +++ b/src/utils/inlineEnsureParens.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../ruby/nodes/types"; +import type { Plugin, Ruby } from "../ruby/types"; const needsParens = [ "args", diff --git a/src/utils/isEmptyBodyStmt.ts b/src/utils/isEmptyBodyStmt.ts index 9e205c23..db84426c 100644 --- a/src/utils/isEmptyBodyStmt.ts +++ b/src/utils/isEmptyBodyStmt.ts @@ -1,4 +1,4 @@ -import type { Ruby } from "../ruby/nodes/types"; +import type { Ruby } from "../ruby/types"; import isEmptyStmts from "./isEmptyStmts"; function isEmptyBodyStmt(node: Ruby.Bodystmt) { diff --git a/src/utils/isEmptyStmts.ts b/src/utils/isEmptyStmts.ts index 2344c29a..5a155b9c 100644 --- a/src/utils/isEmptyStmts.ts +++ b/src/utils/isEmptyStmts.ts @@ -1,4 +1,4 @@ -import type { Ruby } from "../ruby/nodes/types"; +import type { Ruby } from "../ruby/types"; function isEmptyStmts(node: Ruby.AnyNode | Ruby.Stmts) { return ( diff --git a/src/utils/literal.ts b/src/utils/literal.ts index 4556386c..2df73f64 100644 --- a/src/utils/literal.ts +++ b/src/utils/literal.ts @@ -1,4 +1,4 @@ -import { Plugin } from "../ruby/nodes/types"; +import { Plugin } from "../ruby/types"; function literal(value: string): Plugin.Printer<{}> { return function printLiteral() { diff --git a/src/utils/literallineWithoutBreakParent.ts b/src/utils/literallineWithoutBreakParent.ts index d83d1ad2..fca98509 100644 --- a/src/utils/literallineWithoutBreakParent.ts +++ b/src/utils/literallineWithoutBreakParent.ts @@ -1,4 +1,4 @@ -import { Plugin } from "../ruby/nodes/types"; +import { Plugin } from "../ruby/types"; const literallineWithoutBreakParent = { type: "line", diff --git a/src/utils/makeCall.ts b/src/utils/makeCall.ts index 67a8e8ff..9f61bff9 100644 --- a/src/utils/makeCall.ts +++ b/src/utils/makeCall.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../ruby/nodes/types"; +import type { Plugin, Ruby } from "../ruby/types"; type Callable = { body: [any, Ruby.CallOperator, ...any[]] diff --git a/src/utils/printEmptyCollection.ts b/src/utils/printEmptyCollection.ts index 159d7f71..6f8941a0 100644 --- a/src/utils/printEmptyCollection.ts +++ b/src/utils/printEmptyCollection.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../ruby/nodes/types"; +import type { Plugin, Ruby } from "../ruby/types"; const { concat, group, hardline, indent, join, line } = require("../prettier"); diff --git a/src/utils/skipAssignIndent.ts b/src/utils/skipAssignIndent.ts index ed4408cd..0fff82fe 100644 --- a/src/utils/skipAssignIndent.ts +++ b/src/utils/skipAssignIndent.ts @@ -1,4 +1,4 @@ -import type { Ruby } from "../ruby/nodes/types"; +import type { Ruby } from "../ruby/types"; const skippable = [ "array", From ec23b67e44704e5db34fc25375a7c1a54e6f1f1a Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Sep 2021 13:13:05 -0400 Subject: [PATCH 227/785] Convert HAML to TypeScript --- src/haml/{embed.js => embed.ts} | 77 +++--- src/haml/parser.js | 23 -- src/haml/parser.ts | 30 +++ src/haml/printer.js | 438 -------------------------------- src/haml/printer.ts | 414 ++++++++++++++++++++++++++++++ src/haml/types.ts | 80 ++++++ src/ruby/printer.ts | 2 +- src/ruby/types.ts | 8 +- 8 files changed, 566 insertions(+), 506 deletions(-) rename src/haml/{embed.js => embed.ts} (70%) delete mode 100644 src/haml/parser.js create mode 100644 src/haml/parser.ts delete mode 100644 src/haml/printer.js create mode 100644 src/haml/printer.ts create mode 100644 src/haml/types.ts diff --git a/src/haml/embed.js b/src/haml/embed.ts similarity index 70% rename from src/haml/embed.js rename to src/haml/embed.ts index 249d95a0..3f8cf332 100644 --- a/src/haml/embed.js +++ b/src/haml/embed.ts @@ -1,3 +1,6 @@ +import type { Doc, Printer } from "prettier"; +import type { HAML } from "./types"; + const { concat, hardline, @@ -8,45 +11,12 @@ const { stripTrailingHardline } = require("../prettier"); -// Get the name of the parser that is represented by the given element node, -// return null if a matching parser cannot be found -function getParser(name, opts) { - let parser = name; - - // We don't want to deal with some weird recursive parser situation, so we - // need to explicitly call out the HAML parser here and just return null - if (parser === "haml") { - return null; - } - - // In HAML the name of the JS filter is :javascript, whereas in prettier the - // name of the JS parser is babel. Here we explicitly handle that conversion. - if (parser === "javascript") { - parser = "babel"; - } - - // If there is a plugin that has a parser that matches the name of this - // element, then we're going to assume that's correct for embedding and go - // ahead and switch to that parser - if ( - opts.plugins.some( - (plugin) => - plugin.parsers && - Object.prototype.hasOwnProperty.call(plugin.parsers, parser) - ) - ) { - return parser; - } - - return null; -} - // This function is in here because it handles embedded parser values. I don't // have a test that exercises it because I'm not sure for which parser it is // necessary, but since it's in prettier core I'm keeping it here. /* istanbul ignore next */ -function replaceNewlines(doc) { - return mapDoc(doc, (currentDoc) => +function replaceNewlines(doc: Doc) { + return mapDoc(doc, (currentDoc: Doc) => typeof currentDoc === "string" && currentDoc.includes("\n") ? concat( currentDoc @@ -57,17 +27,44 @@ function replaceNewlines(doc) { ); } -function embed(path, _print, textToDoc, opts) { +const embed: Printer["embed"] = (path, _print, textToDoc, opts) => { const node = path.getValue(); + + // We're only going to embed other languages on filter nodes. if (node.type !== "filter") { return null; } - const parser = getParser(node.value.name, opts); - if (!parser) { + let parser = node.value.name; + + // We don't want to deal with some weird recursive parser situation, so we + // need to explicitly call out the HAML parser here and just return null. + if (parser === "haml") { + return null; + } + + // In HAML the name of the JS filter is :javascript, whereas in prettier the + // name of the JS parser is babel. Here we explicitly handle that conversion. + if (parser === "javascript") { + parser = "babel"; + } + + // If there aren't any plugins that look like the name of the filter, then we + // will just exit early. + if ( + !opts.plugins.some( + (plugin) => + typeof plugin !== "string" && + plugin.parsers && + Object.prototype.hasOwnProperty.call(plugin.parsers, parser) + ) + ) { return null; } + // If there is a plugin that has a parser that matches the name of this + // filter, then we're going to assume that's correct for embedding and go + // ahead and switch to that parser. return markAsRoot( concat([ ":", @@ -82,6 +79,6 @@ function embed(path, _print, textToDoc, opts) { ) ]) ); -} +}; -module.exports = embed; +export default embed; diff --git a/src/haml/parser.js b/src/haml/parser.js deleted file mode 100644 index 2591357f..00000000 --- a/src/haml/parser.js +++ /dev/null @@ -1,23 +0,0 @@ -const parseSync = require("../parser/parseSync"); - -function parse(text, _parsers, opts) { - return parseSync("haml", text, opts); -} - -function hasPragma(text) { - return /^\s*-#\s*@(prettier|format)/.test(text); -} - -// These functions are just placeholders until we can actually perform this -// properly. The functions are necessary otherwise the format with cursor -// functions break. -const locStart = (_node) => 0; -const locEnd = (_node) => 0; - -module.exports = { - parse, - astFormat: "haml", - hasPragma, - locStart, - locEnd -}; diff --git a/src/haml/parser.ts b/src/haml/parser.ts new file mode 100644 index 00000000..4b1034f0 --- /dev/null +++ b/src/haml/parser.ts @@ -0,0 +1,30 @@ +import type { Parser } from "prettier"; +import type { HAML } from "./types"; +import parseSync from "../parser/parseSync"; + +const parser: Parser = { + // This function is responsible for taking an input string of text and returning + // to prettier a JavaScript object that is the equivalent AST that represents + // the code stored in that string. We accomplish this by spawning a new process + // and reading JSON off STDOUT. + parse(text, _parsers, opts) { + return parseSync("haml", text, opts); + }, + astFormat: "haml", + // This function handles checking whether or not the source string has the + // pragma for prettier. This is an optional workflow for incremental adoption. + hasPragma(text) { + return /^\s*-#\s*@(prettier|format)/.test(text); + }, + // These functions are just placeholders until we can actually perform this + // properly. The functions are necessary otherwise the format with cursor + // functions break. + locStart(_node) { + return 0; + }, + locEnd(_node) { + return 0; + } +}; + +module.exports = parser; diff --git a/src/haml/printer.js b/src/haml/printer.js deleted file mode 100644 index e9b45123..00000000 --- a/src/haml/printer.js +++ /dev/null @@ -1,438 +0,0 @@ -const { - align, - concat, - fill, - group, - hardline, - ifBreak, - indent, - join, - line, - softline -} = require("../prettier"); -const embed = require("./embed"); - -const docTypes = { - basic: "Basic", - frameset: "Frameset", - mobile: "Mobile", - rdfa: "RDFa", - strict: "Strict", - xml: "XML" -}; - -const docVersions = ["1.1", "5"]; - -// Prints out a hash key according to the configured prettier options. -function printHashKey(key, opts) { - let quoted = key; - const joiner = opts.rubyHashLabel ? ":" : " =>"; - - if (key.includes(":") || key.includes("-")) { - const quote = opts.rubySingleQuote ? "'" : '"'; - quoted = `${quote}${key}${quote}`; - } - - return `${opts.rubyHashLabel ? "" : ":"}${quoted}${joiner}`; -} - -// Prints out the value inside of a hash key-value pair according to the -// configured prettier options. -function printHashValue(value, opts) { - if (typeof value !== "string") { - return value.toString(); - } - - // This is a very special syntax created by the parser to let us know that - // this should be printed literally instead of as a string. - if (value.startsWith("&")) { - return value.slice(1); - } - - const quote = opts.rubySingleQuote && !value.includes("#{") ? "'" : '"'; - return `${quote}${value}${quote}`; -} - -// This will print an attributes object to a Doc node. It handles nesting on -// multiple levels and will print out according to whether or not the version of -// HAML being used supports multi-line attributes. -function printAttributes(object, opts, level = 0) { - if (typeof object !== "object") { - return printHashValue(object, opts); - } - - const boundary = level === 0 ? softline : line; - const parts = Object.keys(object).map((key) => - concat([ - printHashKey(key, opts), - " ", - printAttributes(object[key], opts, level + 1) - ]) - ); - - // If we have support for multi-line attributes laid out like a regular hash, - // then we print them that way here. - if (opts.supportsMultiline) { - return group( - concat([ - "{", - indent(group(concat([boundary, join(concat([",", line]), parts)]))), - boundary, - "}" - ]) - ); - } - - // Otherwise, if we only have one attribute, then just print it inline - // regardless of how long it is. - if (parts.length === 0) { - return group(concat(["{", parts[0], "}"])); - } - - // Otherwise, depending on how long the line is it will split the content into - // multi-line attributes that old Haml understands. - return group( - concat([ - "{", - parts[0], - ",", - align( - opts.headerLength + 1, - concat([line, join(concat([",", line]), parts.slice(1))]) - ), - "}" - ]) - ); -} - -// A utility function used in a silent script that is meant to determine if a -// child node is a continuation of a parent node (as in a when clause within a -// case statement or an else clause within an if). -function isContinuation(parentNode, childNode) { - if (childNode.type !== "silent_script") { - return false; - } - - const parent = parentNode.value.keyword; - const child = childNode.value.keyword; - - return ( - (parent === "case" && ["when", "else"].includes(child)) || - (["if", "unless"].includes(parent) && ["elsif", "else"].includes(child)) - ); -} - -// This is our printer's main print function that will switch on the type of -// node and print it out by returning a Doc tree. -function printNode(path, opts, print) { - const node = path.getValue(); - const { value } = node; - - switch (node.type) { - case "comment": - return printComment(); - case "doctype": - return printDoctype(); - case "filter": - return printFilter(); - case "haml_comment": - return printHamlComment(); - case "plain": - return printPlain(); - case "root": - return printRoot(); - case "script": - return printScript(); - case "silent_script": - return printSilentScript(); - case "tag": - return printTag(); - default: - throw new Error(`Unsupported node encountered: ${node.type}`); - } - - // It's common to a couple of nodes to attach nested child nodes on the - // children property. This utility prints them out grouped together with their - // parent node docs. - function printWithChildren(docs) { - if (node.children.length === 0) { - return docs; - } - - return group( - concat([ - docs, - indent(concat([hardline, join(hardline, path.map(print, "children"))])) - ]) - ); - } - - // https://haml.info/docs/yardoc/file.REFERENCE.html#html-comments- - function printComment() { - const parts = ["/"]; - - if (value.revealed) { - parts.push("!"); - } - - if (value.conditional) { - parts.push(value.conditional); - } else if (value.text) { - parts.push(" ", value.text); - } - - return printWithChildren(group(concat(parts))); - } - - // https://haml.info/docs/yardoc/file.REFERENCE.html#doctype- - function printDoctype() { - const parts = ["!!!"]; - - if (value.type in docTypes) { - parts.push(docTypes[value.type]); - } else if (docVersions.includes(value.version)) { - parts.push(value.version); - } else { - parts.push(value.type); - } - - if (value.encoding) { - parts.push(value.encoding); - } - - return group(join(" ", parts)); - } - - // https://haml.info/docs/yardoc/file.REFERENCE.html#filters - function printFilter() { - return group( - concat([ - ":", - value.name, - indent( - concat([hardline, join(hardline, value.text.trim().split("\n"))]) - ) - ]) - ); - } - - // https://haml.info/docs/yardoc/file.REFERENCE.html#haml-comments-- - function printHamlComment() { - const parts = ["-#"]; - - if (value.text) { - if (opts.originalText.split("\n")[node.line - 1].trim() === "-#") { - const lines = value.text.trim().split("\n"); - - parts.push(indent(concat([hardline, join(hardline, lines)]))); - } else { - parts.push(" ", value.text.trim()); - } - } - - return concat(parts); - } - - // https://haml.info/docs/yardoc/file.REFERENCE.html#plain-text - function printPlain() { - return value.text; - } - - // The root node in the AST that we build in the parser. - function printRoot() { - return concat([join(hardline, path.map(print, "children")), hardline]); - } - - // https://haml.info/docs/yardoc/file.REFERENCE.html#inserting_ruby - function printScript() { - const parts = []; - - if (value.escape_html) { - parts.unshift("&"); - } - - if (value.preserve) { - parts.push("~"); - } else if (!value.interpolate) { - parts.push("="); - } - - if (value.escape_html && !value.preserve && value.interpolate) { - parts.push(" ", value.text.trim().slice(1, -1)); - } else { - parts.push(" ", value.text.trim()); - } - - return printWithChildren(group(concat(parts))); - } - - // https://haml.info/docs/yardoc/file.REFERENCE.html#running-ruby-- - function printSilentScript() { - const parts = [`- ${value.text.trim()}`]; - - if (node.children.length > 0) { - parts.push( - concat( - path.map((childPath) => { - const child = childPath.getValue(); - const concated = concat([hardline, print(childPath)]); - - return isContinuation(node, child) ? concated : indent(concated); - }, "children") - ) - ); - } - - return group(concat(parts)); - } - - // https://haml.info/docs/yardoc/file.REFERENCE.html#element-name- - function printTag() { - const { attributes, dynamic_attributes } = value; - const parts = []; - - // If we have a tag that isn't a div, then we need to print out that name of - // that tag first. If it is a div, first we'll check if there are any other - // things that would force us to print out the div explicitly, and otherwise - // we'll leave it off. - if (value.name !== "div") { - parts.push(`%${value.name}`); - } - - // If we have a class attribute, then we're going to print that here using - // the special class syntax. - if (attributes.class) { - parts.push(`.${attributes.class.replace(/ /g, ".")}`); - } - - // If we have an id attribute, then we're going to print that here using the - // special id syntax. - if (attributes.id) { - parts.push(`#${attributes.id}`); - } - - // If we're using dynamic attributes on this tag, then they come in as a - // string that looks like the output of Hash#inspect from Ruby. So here - // we're going to split it all up and print it out nicely. - if (dynamic_attributes.new) { - const pairs = dynamic_attributes.new - .slice(1, -2) - .split(",") - .map((pair) => join("=", pair.slice(1).split('" => '))); - - parts.push( - group( - concat([ - "(", - align(parts.join("").length + 1, fill(join(line, pairs).parts)), - ")" - ]) - ) - ); - } - - // If there are any static attributes that are not class or id (because we - // already took care of those), then we're going to print them out here. - const staticAttributes = Object.keys(attributes).filter( - (name) => !["class", "id"].includes(name) - ); - - if (staticAttributes.length > 0) { - const docs = staticAttributes.reduce((accum, key) => { - const doc = `${printHashKey(key, opts)} ${printHashValue( - attributes[key], - opts - )}`; - - return accum.length === 0 ? [doc] : accum.concat(",", line, doc); - }, []); - - parts.push( - group(concat(["{", align(parts.join("").length + 1, fill(docs)), "}"])) - ); - } - - // If there are dynamic attributes that don't use the newer syntax, then - // we're going to print them out here. - if (dynamic_attributes.old) { - if (parts.length === 0) { - parts.push("%div"); - } - - if (typeof dynamic_attributes.old === "string") { - parts.push(dynamic_attributes.old); - } else { - const attrOptions = { - // This is kind of a total hack in that I don't think you're really - // supposed to directly use `path.stack`, but it's the easiest way to - // get the root node without having to know how many levels deep we - // are. - supportsMultiline: path.stack[0].supports_multiline, - headerLength: parts.join("").length - }; - - parts.push( - printAttributes( - dynamic_attributes.old, - Object.assign({}, opts, attrOptions) - ) - ); - } - } - - // https://haml.info/docs/yardoc/file.REFERENCE.html#object-reference- - if (value.object_ref) { - if (parts.length === 0) { - parts.push("%div"); - } - parts.push(value.object_ref); - } - - // https://haml.info/docs/yardoc/file.REFERENCE.html#whitespace-removal--and- - if (value.nuke_outer_whitespace) { - parts.push(">"); - } - - if (value.nuke_inner_whitespace) { - parts.push("<"); - } - - // https://haml.info/docs/yardoc/file.REFERENCE.html#empty-void-tags- - if (value.self_closing) { - parts.push("/"); - } - - if (value.value) { - const prefix = value.parse ? "= " : ifBreak("", " "); - - return printWithChildren( - group( - concat([ - group(concat(parts)), - indent(concat([softline, prefix, value.value])) - ]) - ) - ); - } - - // In case none of the other if statements have matched and we're printing - // a div, we need to explicitly add it back into the array. - if (parts.length === 0 && value.name === "div") { - parts.push("%div"); - } - - return printWithChildren(group(concat(parts))); - } -} - -// This function handles adding the format pragma to a source string. This is an -// optional workflow for incremental adoption. -function insertPragma(text) { - return `-# @format${text.startsWith("-#") ? "\n" : "\n\n"}${text}`; -} - -module.exports = { - embed, - print: printNode, - insertPragma -}; diff --git a/src/haml/printer.ts b/src/haml/printer.ts new file mode 100644 index 00000000..bdf89de4 --- /dev/null +++ b/src/haml/printer.ts @@ -0,0 +1,414 @@ +import type { Plugin } from "../ruby/types"; +import type { HAML } from "./types"; + +const { + align, + concat, + fill, + group, + hardline, + ifBreak, + indent, + join, + line, + softline +} = require("../prettier"); +import embed from "./embed"; + +const docTypes = { + basic: "Basic", + frameset: "Frameset", + mobile: "Mobile", + rdfa: "RDFa", + strict: "Strict", + xml: "XML" +} as const; + +const docVersions = ["1.1", "5"]; + +// Prints out a hash key according to the configured prettier options. +function printHashKey(key: string, opts: Plugin.Options) { + let quoted = key; + const joiner = opts.rubyHashLabel ? ":" : " =>"; + + if (key.includes(":") || key.includes("-")) { + const quote = opts.rubySingleQuote ? "'" : '"'; + quoted = `${quote}${key}${quote}`; + } + + return `${opts.rubyHashLabel ? "" : ":"}${quoted}${joiner}`; +} + +// Prints out the value inside of a hash key-value pair according to the +// configured prettier options. +function printHashValue(value: string | number, opts: Plugin.Options) { + if (typeof value !== "string") { + return value.toString(); + } + + // This is a very special syntax created by the parser to let us know that + // this should be printed literally instead of as a string. + if (value.startsWith("&")) { + return value.slice(1); + } + + const quote = opts.rubySingleQuote && !value.includes("#{") ? "'" : '"'; + return `${quote}${value}${quote}`; +} + +// This will print an attributes object to a Doc node. It handles nesting on +// multiple levels and will print out according to whether or not the version of +// HAML being used supports multi-line attributes. +function printAttributes(object: HAML.TagAttrs, opts: Plugin.Options & { supportsMultiline: boolean, headerLength: number }, level = 0) { + if (typeof object !== "object") { + return printHashValue(object, opts); + } + + const boundary = level === 0 ? softline : line; + const parts: Plugin.Doc[] = Object.keys(object).map((key) => + concat([ + printHashKey(key, opts), + " ", + printAttributes(object[key], opts, level + 1) + ]) + ); + + // If we have support for multi-line attributes laid out like a regular hash, + // then we print them that way here. + if (opts.supportsMultiline) { + return group( + concat([ + "{", + indent(group(concat([boundary, join(concat([",", line]), parts)]))), + boundary, + "}" + ]) + ); + } + + // Otherwise, if we only have one attribute, then just print it inline + // regardless of how long it is. + if (parts.length === 0) { + return group(concat(["{", parts[0], "}"])); + } + + // Otherwise, depending on how long the line is it will split the content into + // multi-line attributes that old Haml understands. + return group( + concat([ + "{", + parts[0], + ",", + align( + opts.headerLength + 1, + concat([line, join(concat([",", line]), parts.slice(1))]) + ), + "}" + ]) + ); +} + +// A utility function used in a silent script that is meant to determine if a +// child node is a continuation of a parent node (as in a when clause within a +// case statement or an else clause within an if). +function isContinuation(parentNode: HAML.SilentScript, childNode: HAML.AnyNode) { + if (childNode.type !== "silent_script") { + return false; + } + + const parent = parentNode.value.keyword; + const child = childNode.value.keyword; + + return ( + (parent === "case" && ["when", "else"].includes(child)) || + (["if", "unless"].includes(parent) && ["elsif", "else"].includes(child)) + ); +} + +const printer: Plugin.PrinterConfig = { + embed, + // This is our printer's main print function that will switch on the type of + // node and print it out by returning a Doc tree. + print(path, opts, print) { + const node = path.getValue(); + + switch (node.type) { + // https://haml.info/docs/yardoc/file.REFERENCE.html#html-comments- + case "comment": { + const { value } = node; + const parts = ["/"]; + + if (value.revealed) { + parts.push("!"); + } + + if (value.conditional) { + parts.push(value.conditional); + } else if (value.text) { + parts.push(" ", value.text); + } + + return printWithChildren(node, group(concat(parts))); + } + // https://haml.info/docs/yardoc/file.REFERENCE.html#doctype- + case "doctype": { + const { value } = node; + const parts = ["!!!"]; + + if (value.type in docTypes) { + parts.push(docTypes[value.type as keyof typeof docTypes]); + } else if (value.version && docVersions.includes(value.version)) { + parts.push(value.version); + } else { + parts.push(value.type); + } + + if (value.encoding) { + parts.push(value.encoding); + } + + return group(join(" ", parts)); + } + // https://haml.info/docs/yardoc/file.REFERENCE.html#filters + case "filter": + return group( + concat([ + ":", + node.value.name, + indent( + concat([hardline, join(hardline, node.value.text.trim().split("\n"))]) + ) + ]) + ); + // https://haml.info/docs/yardoc/file.REFERENCE.html#haml-comments-- + case "haml_comment": { + const { value } = node; + const parts = ["-#"]; + + if (value.text) { + if (opts.originalText.split("\n")[node.line - 1].trim() === "-#") { + const lines = value.text.trim().split("\n"); + + parts.push(indent(concat([hardline, join(hardline, lines)]))); + } else { + parts.push(" ", value.text.trim()); + } + } + + return concat(parts); + } + // https://haml.info/docs/yardoc/file.REFERENCE.html#plain-text + case "plain": + return node.value.text; + // The root node in the AST that we build in the parser. + case "root": + return concat([join(hardline, path.map(print, "children")), hardline]); + // https://haml.info/docs/yardoc/file.REFERENCE.html#inserting_ruby + case "script": { + const { value } = node; + const parts = []; + + if (value.escape_html) { + parts.unshift("&"); + } + + if (value.preserve) { + parts.push("~"); + } else if (!value.interpolate) { + parts.push("="); + } + + if (value.escape_html && !value.preserve && value.interpolate) { + parts.push(" ", value.text.trim().slice(1, -1)); + } else { + parts.push(" ", value.text.trim()); + } + + return printWithChildren(node, group(concat(parts))); + } + // https://haml.info/docs/yardoc/file.REFERENCE.html#running-ruby-- + case "silent_script": { + const parts = [`- ${node.value.text.trim()}`]; + + if (node.children.length > 0) { + parts.push( + concat( + path.map((childPath) => { + const child = childPath.getValue(); + const concated = concat([hardline, print(childPath)]); + + return isContinuation(node, child) ? concated : indent(concated); + }, "children") + ) + ); + } + + return group(concat(parts)); + } + // https://haml.info/docs/yardoc/file.REFERENCE.html#element-name- + case "tag": { + const { value } = node; + const { attributes, dynamic_attributes } = value; + const parts = []; + + // If we have a tag that isn't a div, then we need to print out that name of + // that tag first. If it is a div, first we'll check if there are any other + // things that would force us to print out the div explicitly, and otherwise + // we'll leave it off. + if (value.name !== "div") { + parts.push(`%${value.name}`); + } + + // If we have a class attribute, then we're going to print that here using + // the special class syntax. + if (attributes.class) { + parts.push(`.${attributes.class.replace(/ /g, ".")}`); + } + + // If we have an id attribute, then we're going to print that here using the + // special id syntax. + if (attributes.id) { + parts.push(`#${attributes.id}`); + } + + // If we're using dynamic attributes on this tag, then they come in as a + // string that looks like the output of Hash#inspect from Ruby. So here + // we're going to split it all up and print it out nicely. + if (dynamic_attributes.new) { + const pairs = dynamic_attributes.new + .slice(1, -2) + .split(",") + .map((pair) => join("=", pair.slice(1).split('" => '))); + + parts.push( + group( + concat([ + "(", + align(parts.join("").length + 1, fill(join(line, pairs).parts)), + ")" + ]) + ) + ); + } + + // If there are any static attributes that are not class or id (because we + // already took care of those), then we're going to print them out here. + const staticAttributes = Object.keys(attributes).filter( + (name) => !["class", "id"].includes(name) + ); + + if (staticAttributes.length > 0) { + const docs = staticAttributes.reduce((accum, key) => { + const doc = `${printHashKey(key, opts)} ${printHashValue( + attributes[key], + opts + )}`; + + return accum.length === 0 ? [doc] : accum.concat(",", line, doc); + }, [] as Plugin.Doc[]); + + parts.push( + group(concat(["{", align(parts.join("").length + 1, fill(docs)), "}"])) + ); + } + + // If there are dynamic attributes that don't use the newer syntax, then + // we're going to print them out here. + if (dynamic_attributes.old) { + if (parts.length === 0) { + parts.push("%div"); + } + + if (typeof dynamic_attributes.old === "string") { + parts.push(dynamic_attributes.old); + } else { + const attrOptions = { + // This is kind of a total hack in that I don't think you're really + // supposed to directly use `path.stack`, but it's the easiest way to + // get the root node without having to know how many levels deep we + // are. + supportsMultiline: (path.stack[0] as HAML.Root).supports_multiline, + headerLength: parts.join("").length + }; + + parts.push( + printAttributes( + dynamic_attributes.old, + { ...opts, ...attrOptions } + ) + ); + } + } + + // https://haml.info/docs/yardoc/file.REFERENCE.html#object-reference- + if (value.object_ref) { + if (parts.length === 0) { + parts.push("%div"); + } + parts.push(value.object_ref); + } + + // https://haml.info/docs/yardoc/file.REFERENCE.html#whitespace-removal--and- + if (value.nuke_outer_whitespace) { + parts.push(">"); + } + + if (value.nuke_inner_whitespace) { + parts.push("<"); + } + + // https://haml.info/docs/yardoc/file.REFERENCE.html#empty-void-tags- + if (value.self_closing) { + parts.push("/"); + } + + if (value.value) { + const prefix = value.parse ? "= " : ifBreak("", " "); + + return printWithChildren( + node, + group( + concat([ + group(concat(parts)), + indent(concat([softline, prefix, value.value])) + ]) + ) + ); + } + + // In case none of the other if statements have matched and we're printing + // a div, we need to explicitly add it back into the array. + if (parts.length === 0 && value.name === "div") { + parts.push("%div"); + } + + return printWithChildren(node, group(concat(parts))); + } + default: + throw new Error(`Unsupported node encountered: ${(node as any).type}`); + } + + // It's common to a couple of nodes to attach nested child nodes on the + // children property. This utility prints them out grouped together with their + // parent node docs. + function printWithChildren(node: HAML.Comment | HAML.Script | HAML.Tag, docs: Plugin.Doc) { + if (node.children.length === 0) { + return docs; + } + + return group( + concat([ + docs, + indent(concat([hardline, join(hardline, path.map(print, "children"))])) + ]) + ); + } + }, + // This function handles adding the format pragma to a source string. This is an + // optional workflow for incremental adoption. + insertPragma(text) { + return `-# @format${text.startsWith("-#") ? "\n" : "\n\n"}${text}`; + } +}; + +module.exports = printer; diff --git a/src/haml/types.ts b/src/haml/types.ts new file mode 100644 index 00000000..2784ed25 --- /dev/null +++ b/src/haml/types.ts @@ -0,0 +1,80 @@ +export namespace HAML { + export type AnyNode = ( + | Comment + | DocType + | Filter + | HAMLComment + | Plain + | Root + | Script + | SilentScript + | Tag + ); + + export type Comment = { + type: "comment", + value: { revealed: boolean, conditional?: string, text?: string }, + children: AnyNode[] + }; + + export type DocType = { + type: "doctype", + value: { type: string, version?: string, encoding?: string } + }; + + export type Filter = { + type: "filter", + value: { name: string, text: string } + }; + + export type HAMLComment = { + type: "haml_comment", + value: { text?: string }, + line: number + }; + + export type Plain = { + type: "plain", + value: { text: string } + }; + + export type Root = { + type: "root", + children: AnyNode[], + supports_multiline: boolean + }; + + export type Script = { + type: "script", + value: { + escape_html: boolean, + preserve: boolean, + interpolate: boolean, + text: string + }, + children: AnyNode[] + }; + + export type SilentScript = { + type: "silent_script", + value: { text: string, keyword: string }, + children: AnyNode[] + }; + + export type TagAttrs = string | { [property: string]: TagAttrs } + export type Tag = { + type: "tag", + value: { + name: string, + attributes: { class?: string, id?: string } & Record, + dynamic_attributes: { new?: string, old?: TagAttrs }, + object_ref?: string, + nuke_outer_whitespace: boolean, + nuke_inner_whitespace: boolean, + self_closing: boolean, + value?: string, + parse: boolean + }, + children: AnyNode[] + }; +} diff --git a/src/ruby/printer.ts b/src/ruby/printer.ts index 80c81f13..c5c4699c 100644 --- a/src/ruby/printer.ts +++ b/src/ruby/printer.ts @@ -15,7 +15,7 @@ const noComments = [ "mlhs_paren" ]; -const printer: Plugin.PrinterConfig = { +const printer: Plugin.PrinterConfig = { // Certain nodes are used more for organizational purposed than for actually // displaying content, so we tell prettier that we don't want comments attached // to them. diff --git a/src/ruby/types.ts b/src/ruby/types.ts index 27a8996d..ede9e7b6 100644 --- a/src/ruby/types.ts +++ b/src/ruby/types.ts @@ -34,10 +34,10 @@ export namespace Plugin { }; // The Prettier Printer type is missing some options. - export type PrinterConfig = Omit, "print"> & { - getCommentChildNodes: (node: any) => any[], - isBlockComment: (comment: any, options: Plugin.Options) => boolean, - print: Printer + export type PrinterConfig = Omit, "print"> & { + getCommentChildNodes?: (node: any) => any[], + isBlockComment?: (comment: any, options: Plugin.Options) => boolean, + print: Printer }; // This is the regular print node, except it's not restricted by the AST that From c094477701129a6741ff6e12f82df5337af4fd33 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Sep 2021 13:19:24 -0400 Subject: [PATCH 228/785] Combine type files with HAML and Ruby --- src/haml/embed.ts | 9 +-- src/haml/parser.ts | 5 +- src/haml/printer.ts | 3 +- src/haml/types.ts | 80 ------------------- src/ruby/embed.ts | 4 +- src/ruby/nodes.ts | 2 +- src/ruby/nodes/alias.ts | 2 +- src/ruby/nodes/aref.ts | 2 +- src/ruby/nodes/args.ts | 2 +- src/ruby/nodes/arrays.ts | 2 +- src/ruby/nodes/assign.ts | 2 +- src/ruby/nodes/blocks.ts | 2 +- src/ruby/nodes/calls.ts | 2 +- src/ruby/nodes/case.ts | 2 +- src/ruby/nodes/class.ts | 2 +- src/ruby/nodes/commands.ts | 2 +- src/ruby/nodes/conditionals.ts | 2 +- src/ruby/nodes/constants.ts | 2 +- src/ruby/nodes/flow.ts | 2 +- src/ruby/nodes/hashes.ts | 5 +- src/ruby/nodes/heredocs.ts | 2 +- src/ruby/nodes/hooks.ts | 2 +- src/ruby/nodes/ints.ts | 2 +- src/ruby/nodes/lambdas.ts | 2 +- src/ruby/nodes/loops.ts | 2 +- src/ruby/nodes/massign.ts | 2 +- src/ruby/nodes/methods.ts | 2 +- src/ruby/nodes/operators.ts | 2 +- src/ruby/nodes/params.ts | 2 +- src/ruby/nodes/patterns.ts | 2 +- src/ruby/nodes/regexp.ts | 2 +- src/ruby/nodes/rescue.ts | 2 +- src/ruby/nodes/return.ts | 2 +- src/ruby/nodes/statements.ts | 2 +- src/ruby/nodes/strings.ts | 2 +- src/ruby/nodes/super.ts | 2 +- src/ruby/nodes/undef.ts | 2 +- src/ruby/parser.ts | 4 +- src/ruby/printer.ts | 2 +- src/ruby/toProc.ts | 2 +- src/{ruby => }/types.ts | 90 ++++++++++++++++++++-- src/utils/containsAssignment.ts | 2 +- src/utils/getTrailingComma.ts | 2 +- src/utils/hasAncestor.ts | 2 +- src/utils/inlineEnsureParens.ts | 2 +- src/utils/isEmptyBodyStmt.ts | 2 +- src/utils/isEmptyStmts.ts | 2 +- src/utils/literal.ts | 2 +- src/utils/literallineWithoutBreakParent.ts | 2 +- src/utils/makeCall.ts | 2 +- src/utils/printEmptyCollection.ts | 2 +- src/utils/skipAssignIndent.ts | 2 +- 52 files changed, 141 insertions(+), 147 deletions(-) delete mode 100644 src/haml/types.ts rename src/{ruby => }/types.ts (91%) diff --git a/src/haml/embed.ts b/src/haml/embed.ts index 3f8cf332..d2e29531 100644 --- a/src/haml/embed.ts +++ b/src/haml/embed.ts @@ -1,5 +1,4 @@ -import type { Doc, Printer } from "prettier"; -import type { HAML } from "./types"; +import type { Plugin, HAML } from "../types"; const { concat, @@ -15,8 +14,8 @@ const { // have a test that exercises it because I'm not sure for which parser it is // necessary, but since it's in prettier core I'm keeping it here. /* istanbul ignore next */ -function replaceNewlines(doc: Doc) { - return mapDoc(doc, (currentDoc: Doc) => +function replaceNewlines(doc: Plugin.Doc) { + return mapDoc(doc, (currentDoc: Plugin.Doc) => typeof currentDoc === "string" && currentDoc.includes("\n") ? concat( currentDoc @@ -27,7 +26,7 @@ function replaceNewlines(doc: Doc) { ); } -const embed: Printer["embed"] = (path, _print, textToDoc, opts) => { +const embed: Plugin.Embed = (path, _print, textToDoc, opts) => { const node = path.getValue(); // We're only going to embed other languages on filter nodes. diff --git a/src/haml/parser.ts b/src/haml/parser.ts index 4b1034f0..bd0dc6e3 100644 --- a/src/haml/parser.ts +++ b/src/haml/parser.ts @@ -1,8 +1,7 @@ -import type { Parser } from "prettier"; -import type { HAML } from "./types"; +import type { Plugin, HAML } from "../types"; import parseSync from "../parser/parseSync"; -const parser: Parser = { +const parser: Plugin.Parser = { // This function is responsible for taking an input string of text and returning // to prettier a JavaScript object that is the equivalent AST that represents // the code stored in that string. We accomplish this by spawning a new process diff --git a/src/haml/printer.ts b/src/haml/printer.ts index bdf89de4..72b11b4e 100644 --- a/src/haml/printer.ts +++ b/src/haml/printer.ts @@ -1,5 +1,4 @@ -import type { Plugin } from "../ruby/types"; -import type { HAML } from "./types"; +import type { Plugin, HAML } from "../types"; const { align, diff --git a/src/haml/types.ts b/src/haml/types.ts deleted file mode 100644 index 2784ed25..00000000 --- a/src/haml/types.ts +++ /dev/null @@ -1,80 +0,0 @@ -export namespace HAML { - export type AnyNode = ( - | Comment - | DocType - | Filter - | HAMLComment - | Plain - | Root - | Script - | SilentScript - | Tag - ); - - export type Comment = { - type: "comment", - value: { revealed: boolean, conditional?: string, text?: string }, - children: AnyNode[] - }; - - export type DocType = { - type: "doctype", - value: { type: string, version?: string, encoding?: string } - }; - - export type Filter = { - type: "filter", - value: { name: string, text: string } - }; - - export type HAMLComment = { - type: "haml_comment", - value: { text?: string }, - line: number - }; - - export type Plain = { - type: "plain", - value: { text: string } - }; - - export type Root = { - type: "root", - children: AnyNode[], - supports_multiline: boolean - }; - - export type Script = { - type: "script", - value: { - escape_html: boolean, - preserve: boolean, - interpolate: boolean, - text: string - }, - children: AnyNode[] - }; - - export type SilentScript = { - type: "silent_script", - value: { text: string, keyword: string }, - children: AnyNode[] - }; - - export type TagAttrs = string | { [property: string]: TagAttrs } - export type Tag = { - type: "tag", - value: { - name: string, - attributes: { class?: string, id?: string } & Record, - dynamic_attributes: { new?: string, old?: TagAttrs }, - object_ref?: string, - nuke_outer_whitespace: boolean, - nuke_inner_whitespace: boolean, - self_closing: boolean, - value?: string, - parse: boolean - }, - children: AnyNode[] - }; -} diff --git a/src/ruby/embed.ts b/src/ruby/embed.ts index 3fa7bb31..73060329 100644 --- a/src/ruby/embed.ts +++ b/src/ruby/embed.ts @@ -1,4 +1,4 @@ -import type { Plugin } from "./types"; +import type { Plugin, Ruby } from "../types"; const { concat, @@ -73,7 +73,7 @@ function stripCommonLeadingWhitespace(content: string) { return lines.map((line) => line.slice(minimum)).join("\n"); } -const embed: Plugin.Embed = (path, print, textToDoc, _opts) => { +const embed: Plugin.Embed = (path, print, textToDoc, _opts) => { const node = path.getValue(); // Currently we only support embedded formatting on heredoc nodes diff --git a/src/ruby/nodes.ts b/src/ruby/nodes.ts index 1aba958c..7957074c 100644 --- a/src/ruby/nodes.ts +++ b/src/ruby/nodes.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; import { printAlias } from "./nodes/alias"; import { printAref, printArefField } from "./nodes/aref"; diff --git a/src/ruby/nodes/alias.ts b/src/ruby/nodes/alias.ts index c810794f..5c941b64 100644 --- a/src/ruby/nodes/alias.ts +++ b/src/ruby/nodes/alias.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { addTrailingComment, diff --git a/src/ruby/nodes/aref.ts b/src/ruby/nodes/aref.ts index f2e77cb3..df258cfb 100644 --- a/src/ruby/nodes/aref.ts +++ b/src/ruby/nodes/aref.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { concat, diff --git a/src/ruby/nodes/args.ts b/src/ruby/nodes/args.ts index a05e9cc5..1c961153 100644 --- a/src/ruby/nodes/args.ts +++ b/src/ruby/nodes/args.ts @@ -1,5 +1,5 @@ import type * as Prettier from "prettier"; -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { concat, diff --git a/src/ruby/nodes/arrays.ts b/src/ruby/nodes/arrays.ts index 1c1042ce..d774493a 100644 --- a/src/ruby/nodes/arrays.ts +++ b/src/ruby/nodes/arrays.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { concat, diff --git a/src/ruby/nodes/assign.ts b/src/ruby/nodes/assign.ts index bd161c96..1769b5ff 100644 --- a/src/ruby/nodes/assign.ts +++ b/src/ruby/nodes/assign.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { concat, group, indent, join, line } = require("../../prettier"); import { skipAssignIndent } from "../../utils"; diff --git a/src/ruby/nodes/blocks.ts b/src/ruby/nodes/blocks.ts index 116eb3df..ef3d2b18 100644 --- a/src/ruby/nodes/blocks.ts +++ b/src/ruby/nodes/blocks.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { breakParent, diff --git a/src/ruby/nodes/calls.ts b/src/ruby/nodes/calls.ts index 00316a8f..8fb982da 100644 --- a/src/ruby/nodes/calls.ts +++ b/src/ruby/nodes/calls.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { concat, diff --git a/src/ruby/nodes/case.ts b/src/ruby/nodes/case.ts index 8f2bced7..c2912e4f 100644 --- a/src/ruby/nodes/case.ts +++ b/src/ruby/nodes/case.ts @@ -1,5 +1,5 @@ import type * as Prettier from "prettier"; -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { align, diff --git a/src/ruby/nodes/class.ts b/src/ruby/nodes/class.ts index 3c4c69f1..6f61da3e 100644 --- a/src/ruby/nodes/class.ts +++ b/src/ruby/nodes/class.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { concat, group, hardline, indent } = require("../../prettier"); import { isEmptyBodyStmt } from "../../utils"; diff --git a/src/ruby/nodes/commands.ts b/src/ruby/nodes/commands.ts index c10cc513..a6af1e04 100644 --- a/src/ruby/nodes/commands.ts +++ b/src/ruby/nodes/commands.ts @@ -1,5 +1,5 @@ import type * as Prettier from "prettier"; -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { align, diff --git a/src/ruby/nodes/conditionals.ts b/src/ruby/nodes/conditionals.ts index 40cbb434..947d9390 100644 --- a/src/ruby/nodes/conditionals.ts +++ b/src/ruby/nodes/conditionals.ts @@ -1,5 +1,5 @@ import type * as Prettier from "prettier"; -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { align, diff --git a/src/ruby/nodes/constants.ts b/src/ruby/nodes/constants.ts index 20af8839..1fedc926 100644 --- a/src/ruby/nodes/constants.ts +++ b/src/ruby/nodes/constants.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { concat, group, indent, join, softline } = require("../../prettier"); import { makeCall } from "../../utils"; diff --git a/src/ruby/nodes/flow.ts b/src/ruby/nodes/flow.ts index 56faef87..c6805757 100644 --- a/src/ruby/nodes/flow.ts +++ b/src/ruby/nodes/flow.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { concat, join } = require("../../prettier"); import { literal } from "../../utils"; diff --git a/src/ruby/nodes/hashes.ts b/src/ruby/nodes/hashes.ts index 5d370fbb..9e999faa 100644 --- a/src/ruby/nodes/hashes.ts +++ b/src/ruby/nodes/hashes.ts @@ -1,5 +1,4 @@ -import { Doc } from "prettier"; -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { concat, @@ -16,7 +15,7 @@ import { skipAssignIndent } from "../../utils"; -type KeyPrinter = (path: Plugin.Path, print: Plugin.Print) => Doc; +type KeyPrinter = (path: Plugin.Path, print: Plugin.Print) => Plugin.Doc; type HashContents = (Ruby.AssoclistFromArgs | Ruby.BareAssocHash) & { keyPrinter: KeyPrinter }; // When attempting to convert a hash rocket into a hash label, you need to take diff --git a/src/ruby/nodes/heredocs.ts b/src/ruby/nodes/heredocs.ts index 54110a43..6617d8cb 100644 --- a/src/ruby/nodes/heredocs.ts +++ b/src/ruby/nodes/heredocs.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { concat, group, lineSuffix, join } = require("../../prettier"); import { literallineWithoutBreakParent } from "../../utils"; diff --git a/src/ruby/nodes/hooks.ts b/src/ruby/nodes/hooks.ts index de089370..e221cb76 100644 --- a/src/ruby/nodes/hooks.ts +++ b/src/ruby/nodes/hooks.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { concat, group, indent, line } = require("../../prettier"); diff --git a/src/ruby/nodes/ints.ts b/src/ruby/nodes/ints.ts index a15974de..fe7fa5f5 100644 --- a/src/ruby/nodes/ints.ts +++ b/src/ruby/nodes/ints.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; // An @int node is any literal integer in Ruby. They can come in a number of // bases, and look like the following: diff --git a/src/ruby/nodes/lambdas.ts b/src/ruby/nodes/lambdas.ts index 668e95a3..50d25aff 100644 --- a/src/ruby/nodes/lambdas.ts +++ b/src/ruby/nodes/lambdas.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { concat, group, ifBreak, indent, line } = require("../../prettier"); import { hasAncestor } from "../../utils"; diff --git a/src/ruby/nodes/loops.ts b/src/ruby/nodes/loops.ts index 34483d30..b04be7ee 100644 --- a/src/ruby/nodes/loops.ts +++ b/src/ruby/nodes/loops.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { align, diff --git a/src/ruby/nodes/massign.ts b/src/ruby/nodes/massign.ts index 27868a9f..deeae018 100644 --- a/src/ruby/nodes/massign.ts +++ b/src/ruby/nodes/massign.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { concat, diff --git a/src/ruby/nodes/methods.ts b/src/ruby/nodes/methods.ts index 01c41040..9aabbe88 100644 --- a/src/ruby/nodes/methods.ts +++ b/src/ruby/nodes/methods.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { concat, group, hardline, indent, line } = require("../../prettier"); import { isEmptyBodyStmt } from "../../utils"; diff --git a/src/ruby/nodes/operators.ts b/src/ruby/nodes/operators.ts index ada113ad..9096168f 100644 --- a/src/ruby/nodes/operators.ts +++ b/src/ruby/nodes/operators.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { concat, group, indent, line, softline } = require("../../prettier"); import { noIndent } from "../../utils"; diff --git a/src/ruby/nodes/params.ts b/src/ruby/nodes/params.ts index 8b3dfa14..a03aa96d 100644 --- a/src/ruby/nodes/params.ts +++ b/src/ruby/nodes/params.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { concat, diff --git a/src/ruby/nodes/patterns.ts b/src/ruby/nodes/patterns.ts index 289b25b7..430cdb9c 100644 --- a/src/ruby/nodes/patterns.ts +++ b/src/ruby/nodes/patterns.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { align, diff --git a/src/ruby/nodes/regexp.ts b/src/ruby/nodes/regexp.ts index 9e19cca7..1cff7ada 100644 --- a/src/ruby/nodes/regexp.ts +++ b/src/ruby/nodes/regexp.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { concat } = require("../../prettier"); import { hasAncestor } from "../../utils"; diff --git a/src/ruby/nodes/rescue.ts b/src/ruby/nodes/rescue.ts index 74428c52..99d6577b 100644 --- a/src/ruby/nodes/rescue.ts +++ b/src/ruby/nodes/rescue.ts @@ -1,5 +1,5 @@ import type * as Prettier from "prettier"; -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { align, diff --git a/src/ruby/nodes/return.ts b/src/ruby/nodes/return.ts index 71786d8f..589c511a 100644 --- a/src/ruby/nodes/return.ts +++ b/src/ruby/nodes/return.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { concat, diff --git a/src/ruby/nodes/statements.ts b/src/ruby/nodes/statements.ts index e0999932..d50123ad 100644 --- a/src/ruby/nodes/statements.ts +++ b/src/ruby/nodes/statements.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { breakParent, diff --git a/src/ruby/nodes/strings.ts b/src/ruby/nodes/strings.ts index 1a7c9e65..7b42eff1 100644 --- a/src/ruby/nodes/strings.ts +++ b/src/ruby/nodes/strings.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { concat, diff --git a/src/ruby/nodes/super.ts b/src/ruby/nodes/super.ts index 2e3d87dd..aa7d8dba 100644 --- a/src/ruby/nodes/super.ts +++ b/src/ruby/nodes/super.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { align, concat, group, join, line } = require("../../prettier"); import { literal } from "../../utils"; diff --git a/src/ruby/nodes/undef.ts b/src/ruby/nodes/undef.ts index 5053c72c..8154a69d 100644 --- a/src/ruby/nodes/undef.ts +++ b/src/ruby/nodes/undef.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby } from "../../types"; const { addTrailingComment, diff --git a/src/ruby/parser.ts b/src/ruby/parser.ts index 3ef3b94c..30cf89c1 100644 --- a/src/ruby/parser.ts +++ b/src/ruby/parser.ts @@ -1,7 +1,7 @@ -import type { Parser } from "prettier"; +import type { Plugin, Ruby } from "../types"; import parseSync from "../parser/parseSync"; -const parser: Parser = { +const parser: Plugin.Parser = { // This function is responsible for taking an input string of text and returning // to prettier a JavaScript object that is the equivalent AST that represents // the code stored in that string. We accomplish this by spawning a new Ruby diff --git a/src/ruby/printer.ts b/src/ruby/printer.ts index c5c4699c..9c58c8c2 100644 --- a/src/ruby/printer.ts +++ b/src/ruby/printer.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; const { concat, trim } = require("../prettier"); diff --git a/src/ruby/toProc.ts b/src/ruby/toProc.ts index 5cb23187..85bdf12b 100644 --- a/src/ruby/toProc.ts +++ b/src/ruby/toProc.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "./types"; +import type { Plugin, Ruby } from "../types"; function isCall(node: Ruby.CallOperator) { // Older versions of Ruby didn't have a @period ripper event, so we need to diff --git a/src/ruby/types.ts b/src/types.ts similarity index 91% rename from src/ruby/types.ts rename to src/types.ts index ede9e7b6..ec7977b9 100644 --- a/src/ruby/types.ts +++ b/src/types.ts @@ -5,14 +5,10 @@ export namespace Plugin { // We're doing weird things here with the types because if you pass a generic // type to AstPath it gets overly restrictive. - // This is just a simple alias for the doc nodes. export type Doc = Prettier.doc.builders.Doc; - // This is the regular embed except that it's required and it's restricted to - // our AST. - export type Embed = Required>["embed"]; + export type Embed = Required>["embed"]; - // This is the regular prettier options + the options defined by this plugin. export type Options = Prettier.ParserOptions & { printer: Omit & Required>, rubyArrayLiteral: boolean, @@ -23,6 +19,8 @@ export namespace Plugin { rubyToProc: boolean }; + export type Parser = Prettier.Parser; + // We're overwriting call and map here because if you restrict the AST for the // main path then presumably you're printing a lower node in the tree that // won't match the current AST type. @@ -33,7 +31,6 @@ export namespace Plugin { map: (callback: (path: Path, index: number, value: any) => U, ...names: PropertyKey[]) => U[] }; - // The Prettier Printer type is missing some options. export type PrinterConfig = Omit, "print"> & { getCommentChildNodes?: (node: any) => any[], isBlockComment?: (comment: any, options: Plugin.Options) => boolean, @@ -268,3 +265,84 @@ export namespace Ruby { export type Program = ParserEvent<"program", { body: [Stmts] }>; export type Stmts = ParserEvent<"stmts", { body: AnyNode[] }>; } + +export namespace HAML { + export type AnyNode = ( + | Comment + | DocType + | Filter + | HAMLComment + | Plain + | Root + | Script + | SilentScript + | Tag + ); + + export type Comment = { + type: "comment", + value: { revealed: boolean, conditional?: string, text?: string }, + children: AnyNode[] + }; + + export type DocType = { + type: "doctype", + value: { type: string, version?: string, encoding?: string } + }; + + export type Filter = { + type: "filter", + value: { name: string, text: string } + }; + + export type HAMLComment = { + type: "haml_comment", + value: { text?: string }, + line: number + }; + + export type Plain = { + type: "plain", + value: { text: string } + }; + + export type Root = { + type: "root", + children: AnyNode[], + supports_multiline: boolean + }; + + export type Script = { + type: "script", + value: { + escape_html: boolean, + preserve: boolean, + interpolate: boolean, + text: string + }, + children: AnyNode[] + }; + + export type SilentScript = { + type: "silent_script", + value: { text: string, keyword: string }, + children: AnyNode[] + }; + + export type TagAttrs = string | { [property: string]: TagAttrs } + export type Tag = { + type: "tag", + value: { + name: string, + attributes: { class?: string, id?: string } & Record, + dynamic_attributes: { new?: string, old?: TagAttrs }, + object_ref?: string, + nuke_outer_whitespace: boolean, + nuke_inner_whitespace: boolean, + self_closing: boolean, + value?: string, + parse: boolean + }, + children: AnyNode[] + }; +} diff --git a/src/utils/containsAssignment.ts b/src/utils/containsAssignment.ts index f87921e6..ee760501 100644 --- a/src/utils/containsAssignment.ts +++ b/src/utils/containsAssignment.ts @@ -1,4 +1,4 @@ -import type { Ruby } from "../ruby/types"; +import type { Ruby } from "../types"; // If the node is a type of assignment or if the node is a paren and nested // inside that paren is a node that is a type of assignment. diff --git a/src/utils/getTrailingComma.ts b/src/utils/getTrailingComma.ts index f37b6254..41e17724 100644 --- a/src/utils/getTrailingComma.ts +++ b/src/utils/getTrailingComma.ts @@ -1,4 +1,4 @@ -import type { Plugin } from "../ruby/types"; +import type { Plugin } from "../types"; function getTrailingComma(opts: Plugin.Options) { return ["all", "es5"].includes(opts.trailingComma); diff --git a/src/utils/hasAncestor.ts b/src/utils/hasAncestor.ts index 2ee15744..6cf917e6 100644 --- a/src/utils/hasAncestor.ts +++ b/src/utils/hasAncestor.ts @@ -1,4 +1,4 @@ -import type { Plugin } from "../ruby/types"; +import type { Plugin } from "../types"; function hasAncestor(path: Plugin.Path<{ type: string }>, types: string[]) { let parent = 0; diff --git a/src/utils/inlineEnsureParens.ts b/src/utils/inlineEnsureParens.ts index cd65aa8b..b1700f8a 100644 --- a/src/utils/inlineEnsureParens.ts +++ b/src/utils/inlineEnsureParens.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../ruby/types"; +import type { Plugin, Ruby } from "../types"; const needsParens = [ "args", diff --git a/src/utils/isEmptyBodyStmt.ts b/src/utils/isEmptyBodyStmt.ts index db84426c..ad7743c0 100644 --- a/src/utils/isEmptyBodyStmt.ts +++ b/src/utils/isEmptyBodyStmt.ts @@ -1,4 +1,4 @@ -import type { Ruby } from "../ruby/types"; +import type { Ruby } from "../types"; import isEmptyStmts from "./isEmptyStmts"; function isEmptyBodyStmt(node: Ruby.Bodystmt) { diff --git a/src/utils/isEmptyStmts.ts b/src/utils/isEmptyStmts.ts index 5a155b9c..cd95e7b4 100644 --- a/src/utils/isEmptyStmts.ts +++ b/src/utils/isEmptyStmts.ts @@ -1,4 +1,4 @@ -import type { Ruby } from "../ruby/types"; +import type { Ruby } from "../types"; function isEmptyStmts(node: Ruby.AnyNode | Ruby.Stmts) { return ( diff --git a/src/utils/literal.ts b/src/utils/literal.ts index 2df73f64..1e3016bb 100644 --- a/src/utils/literal.ts +++ b/src/utils/literal.ts @@ -1,4 +1,4 @@ -import { Plugin } from "../ruby/types"; +import { Plugin } from "../types"; function literal(value: string): Plugin.Printer<{}> { return function printLiteral() { diff --git a/src/utils/literallineWithoutBreakParent.ts b/src/utils/literallineWithoutBreakParent.ts index fca98509..4262f364 100644 --- a/src/utils/literallineWithoutBreakParent.ts +++ b/src/utils/literallineWithoutBreakParent.ts @@ -1,4 +1,4 @@ -import { Plugin } from "../ruby/types"; +import { Plugin } from "../types"; const literallineWithoutBreakParent = { type: "line", diff --git a/src/utils/makeCall.ts b/src/utils/makeCall.ts index 9f61bff9..9122c575 100644 --- a/src/utils/makeCall.ts +++ b/src/utils/makeCall.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../ruby/types"; +import type { Plugin, Ruby } from "../types"; type Callable = { body: [any, Ruby.CallOperator, ...any[]] diff --git a/src/utils/printEmptyCollection.ts b/src/utils/printEmptyCollection.ts index 6f8941a0..510f4a21 100644 --- a/src/utils/printEmptyCollection.ts +++ b/src/utils/printEmptyCollection.ts @@ -1,4 +1,4 @@ -import type { Plugin, Ruby } from "../ruby/types"; +import type { Plugin, Ruby } from "../types"; const { concat, group, hardline, indent, join, line } = require("../prettier"); diff --git a/src/utils/skipAssignIndent.ts b/src/utils/skipAssignIndent.ts index 0fff82fe..e9a3f8b7 100644 --- a/src/utils/skipAssignIndent.ts +++ b/src/utils/skipAssignIndent.ts @@ -1,4 +1,4 @@ -import type { Ruby } from "../ruby/types"; +import type { Ruby } from "../types"; const skippable = [ "array", From f057e58d7ed1d41a8ae6fcb11923fb681d7f3e07 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Sep 2021 13:27:13 -0400 Subject: [PATCH 229/785] Convert over the RBS parser --- src/rbs/parser.js | 37 ---------------- src/rbs/parser.ts | 32 ++++++++++++++ src/types.ts | 106 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 138 insertions(+), 37 deletions(-) delete mode 100644 src/rbs/parser.js create mode 100644 src/rbs/parser.ts diff --git a/src/rbs/parser.js b/src/rbs/parser.js deleted file mode 100644 index 617ea32c..00000000 --- a/src/rbs/parser.js +++ /dev/null @@ -1,37 +0,0 @@ -const parseSync = require("../parser/parseSync"); - -// This function is responsible for taking an input string of text and returning -// to prettier a JavaScript object that is the equivalent AST that represents -// the code stored in that string. We accomplish this by spawning a new Ruby -// process of parser.rb and reading JSON off STDOUT. -function parse(text, _parsers, opts) { - return parseSync("rbs", text, opts); -} - -// This function handles checking whether or not the source string has the -// pragma for prettier. This is an optional workflow for incremental adoption. -function hasPragma(text) { - return /^\s*#[^\S\n]*@(format|prettier)\s*(\n|$)/.test(text); -} - -// This function is critical for comments and cursor support, and is responsible -// for returning the index of the character within the source string that is the -// beginning of the given node. -function locStart(node) { - return (node.location || node.type.location).start_pos; -} - -// This function is critical for comments and cursor support, and is responsible -// for returning the index of the character within the source string that is the -// ending of the given node. -function locEnd(node) { - return (node.location || node.type.location).end_pos; -} - -module.exports = { - parse, - astFormat: "rbs", - hasPragma, - locStart, - locEnd -}; diff --git a/src/rbs/parser.ts b/src/rbs/parser.ts new file mode 100644 index 00000000..c6c4738e --- /dev/null +++ b/src/rbs/parser.ts @@ -0,0 +1,32 @@ +import parseSync from "../parser/parseSync"; +import { Plugin, RBS } from "../types"; + +const parser: Plugin.Parser = { + // This function is responsible for taking an input string of text and returning + // to prettier a JavaScript object that is the equivalent AST that represents + // the code stored in that string. We accomplish this by spawning a new Ruby + // process of parser.rb and reading JSON off STDOUT. + parse(text, _parsers, opts) { + return parseSync("rbs", text, opts); + }, + astFormat: "rbs", + // This function handles checking whether or not the source string has the + // pragma for prettier. This is an optional workflow for incremental adoption. + hasPragma(text) { + return /^\s*#[^\S\n]*@(format|prettier)\s*(\n|$)/.test(text); + }, + // This function is critical for comments and cursor support, and is responsible + // for returning the index of the character within the source string that is the + // beginning of the given node. + locStart(node: any) { + return (node.location || node.type.location).start_pos; + }, + // This function is critical for comments and cursor support, and is responsible + // for returning the index of the character within the source string that is the + // ending of the given node. + locEnd(node: any) { + return (node.location || node.type.location).end_pos; + } +}; + +module.exports = parser; diff --git a/src/types.ts b/src/types.ts index ec7977b9..069e0924 100644 --- a/src/types.ts +++ b/src/types.ts @@ -346,3 +346,109 @@ export namespace HAML { children: AnyNode[] }; } + +export namespace RBS { + export type MethodParam = { + name?: string + escaped: boolean, + type: Type + }; + + export type MethodParams = { + required_positionals: MethodParam[], + optional_positionals: MethodParam[], + rest_positionals?: MethodParam, + trailing_positionals: MethodParam[] + required_keywords: Record, + optional_keywords: Record, + rest_keywords?: MethodParam + }; + + export type MethodSignature = { + type_params: string[], + type: MethodParams, + block: { required: boolean } & MethodSignature, + return_type: { type: Type } + }; + + export type Type = { location: Location } & ( + | { class: "literal", literal: string } + | { class: "optional", type: Type } + | { class: "tuple", types: Type[] } + | { class: "union", types: Type[] } + | { class: "intersection", types: Type[] } + | { class: "class_singleton", name: string } + | { class: "proc" } & MethodSignature + | { class: "record", fields: Record } + | { class: "class_instance" } & NameAndArgs + | { class: "interface" } & NameAndArgs + | { class: "alias", name: string } + | { class: "variable", name: string } + | { class: "bool" } + | { class: "bot" } + | { class: "class" } + | { class: "instance" } + | { class: "nil" } + | { class: "self" } + | { class: "top" } + | { class: "untyped" } + | { class: "void" } + ); + + export type Literal = Type & { class: "literal" }; + + export type NameAndArgs = { name: string, args: Type[] }; + + export type Location = { + start: { line: number, column: number }, + end: { line: number, column: number }, + start_pos: number, + end_pos: number + }; + + export type Member = { location: Location } & ( + | { member: "alias", new_name: string, old_name: string, kind: "instance" | "singleton" } + | { member: "attr_accessor" | "attr_reader" | "attr_writer", name: string, ivar_name?: string | false, kind: "instance" | "singleton", type: Type } + | { member: "class_variable" | "class_instance_variable" | "instance_variable", name: string, type: Type } + | { member: "include" } + | { member: "extend" } + | { member: "prepend" } + | { member: "public" } + | { member: "private" } + | { member: "method_definition", overload: boolean, name: string, types: MethodSignature[], kind: "instance" | "singleton" | "singleton_instance" } + ); + + export type MethodDefinition = Member & { member: "method_definition" }; + + export type Param = { + name: string, + skip_validation: boolean, + variance: "invariant" | "covariant" | "contravariant" + }; + + export type NameAndTypeParams = { + name: string, + type_params: { params: Param[] } + }; + + type Declaration = ( + | { declaration: "alias", name: string, type: Type } + | { declaration: "class", super_class?: NameAndArgs, members: Member[] } & NameAndTypeParams + | { declaration: "constant", name: string, type: Type } + | { declaration: "global", name: string, type: Type } + | { declaration: "interface", members: Member[] } & NameAndTypeParams + | { declaration: "module", self_types: NameAndArgs[], members: Member[] } & NameAndTypeParams + ); + + type Root = ( + { declarations: Declaration[] } + ); + + export type Annotation = { string: string, location: Location }; + + export type AnyNode = { comment?: { string: string }, annotations?: Annotation[] } & ( + | ({ declaration: undefined, member: undefined } & Root) + | ({ declarations: undefined, member: undefined } & Declaration) + | ({ declaration: undefined, declarations: undefined } & Member) + ); +} From b486bdb64d22d8544b8337c386af684a4ca577ae Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Sep 2021 13:57:18 -0400 Subject: [PATCH 230/785] Convert RBS printer to TS --- src/rbs/printer.js | 643 --------------------------------------------- src/rbs/printer.ts | 607 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 607 insertions(+), 643 deletions(-) delete mode 100644 src/rbs/printer.js create mode 100644 src/rbs/printer.ts diff --git a/src/rbs/printer.js b/src/rbs/printer.js deleted file mode 100644 index dc7e3816..00000000 --- a/src/rbs/printer.js +++ /dev/null @@ -1,643 +0,0 @@ -const { - concat, - group, - hardline, - indent, - makeString, - join, - line, - softline -} = require("../prettier"); - -// For some lists of entities in the AST, the parser returns them as an unsorted -// object (presumably because Ruby hashes have implicit ordering). We do not -// have that in JavaScript, so here we sort each object by its position in the -// source string. -function getSortedKeys(object) { - return Object.keys(object).sort( - (left, right) => - object[left].type.location.start_pos - - object[right].type.location.start_pos - ); -} - -// In some cases, we want to just defer to whatever was in the source. -function getSource(node, opts) { - return opts.originalText.slice( - node.location.start_pos, - node.location.end_pos - ); -} - -// This is the generic node print function, used to convert any node in the AST -// into its equivalent Doc representation. -function printNode(path, opts, print) { - const node = path.getValue(); - let doc = null; - - if (node.declarations) { - return printRoot(); - } - - /* istanbul ignore else */ - if (node.declaration) { - switch (node.declaration) { - case "alias": - doc = printTypeAlias(); - break; - case "class": - doc = printClass(); - break; - case "constant": - case "global": - doc = printConstant(); - break; - case "interface": - doc = printInterface(); - break; - case "module": - doc = printModule(); - break; - /* istanbul ignore next */ - default: - throw new Error(`unknown declaration: ${node.declaration}`); - } - } else if (node.member) { - switch (node.member) { - case "alias": - doc = printAlias(); - break; - case "attr_accessor": - case "attr_reader": - case "attr_writer": - doc = printAttr(); - break; - case "class_variable": - case "instance_variable": - doc = printVariable(); - break; - case "class_instance_variable": - doc = concat(["self.", printVariable()]); - break; - case "include": - case "extend": - case "prepend": - doc = printMixin(); - break; - case "public": - case "private": - doc = node.member; - break; - case "method_definition": - doc = printMethodDefinition(); - break; - /* istanbul ignore next */ - default: - throw new Error(`unknown member: ${node.member}`); - } - } else { - const ast = JSON.stringify(node, null, 2); - throw new Error(`Unsupported node encountered:\n${ast}`); - } - - // Certain nodes can't have annotations at all - if (node.annotations && node.annotations.length > 0) { - doc = concat([printAnnotations(), hardline, doc]); - } - - if (node.comment) { - doc = concat([printComment(), hardline, doc]); - } - - return doc; - - // Prints out a string in the source, which looks like: - // 'foo' - function printString(node) { - // We're going to go straight to the source here, as if we don't then we're - // going to end up with the result of String#inspect, which does weird - // things to escape sequences. - const value = getSource(node, opts); - - // Get the quote that was used in the source and the quote that we want to - // be using. - const originalQuote = value[0]; - const preferredQuote = opts.rubySingleQuote ? "'" : '"'; - - // Determine if we're allowed to change the quote based on whether or not - // there is an escape sequence in the source string. - const quote = node.literal.includes("\\") ? originalQuote : preferredQuote; - - return makeString(value.slice(1, -1), quote, false); - } - - // Certain nodes are names with optional arguments attached, as in Array[A]. - // We handle all of that printing centralized here. - function printNameAndArgs(path) { - const node = path.getValue(); - - if (node.args.length === 0) { - return node.name; - } - - return group( - concat([node.name, "[", join(", ", path.map(printType, "args")), "]"]) - ); - } - - // This is the big function that prints out any individual type, which can - // look like all kinds of things, listed in the case statement below. - function printType(path, { forceParens = false } = {}) { - const node = path.getValue(); - - switch (node.class) { - case "literal": - if (node.literal[0] === '"') { - return printString(node); - } - return node.literal; - case "optional": - return concat([ - path.call( - (typePath) => printType(typePath, { forceParens: true }), - "type" - ), - "?" - ]); - case "tuple": - // If we don't have any sub types, we explicitly need the space in between - // the brackets to not confuse the parser. - if (node.types.length === 0) { - return "[ ]"; - } - - return group( - concat(["[", join(", ", path.map(printType, "types")), "]"]) - ); - case "union": { - const doc = group( - join(concat([line, "| "]), path.map(printType, "types")) - ); - - if (forceParens) { - return concat(["(", doc, ")"]); - } - - return doc; - } - case "intersection": { - const doc = group( - join( - concat([line, "& "]), - path.map( - (typePath) => printType(typePath, { forceParens: true }), - "types" - ) - ) - ); - - if (forceParens) { - return concat(["(", doc, ")"]); - } - - return doc; - } - case "class_singleton": - return concat(["singleton(", node.name, ")"]); - case "proc": - return concat(["^", printMethodSignature(path)]); - case "record": { - const parts = []; - - getSortedKeys(node.fields).forEach((field) => { - const fieldParts = []; - - if (node.fields[field].joiner === "rocket") { - fieldParts.push(`${field} => `); - } else { - fieldParts.push(`${field}: `); - } - - fieldParts.push(path.call(printType, "fields", field, "type")); - parts.push(concat(fieldParts)); - }); - - return group( - concat([ - "{", - indent(concat([line, join(concat([",", line]), parts)])), - line, - "}" - ]) - ); - } - case "class_instance": - case "interface": - return printNameAndArgs(path); - case "alias": - case "variable": - return node.name; - case "bool": - case "bot": - case "class": - case "instance": - case "nil": - case "self": - case "top": - case "untyped": - case "void": - return node.class; - /* istanbul ignore next */ - default: - throw new Error(`unknown type: ${node.class}`); - } - } - - // Prints out the root of the tree, which includes zero or more declarations. - function printRoot() { - return concat([ - join(concat([hardline, hardline]), path.map(print, "declarations")), - hardline - ]); - } - - // Prints out the members of a class, module, or interface. - function printMembers() { - let lastLine = null; - const docs = []; - - path.each((memberPath) => { - const memberNode = memberPath.getValue(); - - if (lastLine !== null && memberNode.location.start.line - lastLine >= 2) { - docs.push(concat([hardline, hardline])); - } else { - docs.push(hardline); - } - - docs.push(print(memberPath)); - lastLine = memberNode.location.end.line; - }, "members"); - - return concat(docs); - } - - // Prints out a type alias, which is a declaration that looks like: - // type foo = String - function printTypeAlias() { - return group( - concat([ - "type ", - node.name, - " =", - indent(group(concat([line, path.call(printType, "type")]))) - ]) - ); - } - - // Prints out the name of a class, interface, or module declaration. - // Additionally loops through each type parameter if there are any and print - // them out joined by commas. Checks for validation and variance. - function printNameAndTypeParams() { - if (node.type_params.params.length === 0) { - return node.name; - } - - const docs = path.map( - (paramPath) => { - const node = paramPath.getValue(); - const parts = []; - - if (node.skip_validation) { - parts.push("unchecked"); - } - - if (node.variance === "covariant") { - parts.push("out"); - } else if (node.variance === "contravariant") { - parts.push("in"); - } - - return join(" ", parts.concat(node.name)); - }, - "type_params", - "params" - ); - - return concat([node.name, "[", join(", ", docs), "]"]); - } - - // Prints out a class declarations, which looks like: - // class Foo end - function printClass() { - const parts = ["class ", printNameAndTypeParams()]; - - if (node.super_class) { - parts.push(" < ", path.call(printNameAndArgs, "super_class")); - } - - parts.push(indent(printMembers()), hardline, "end"); - - return group(concat(parts)); - } - - // Prints out a constant or a global declaration, which looks like: - // Foo: String - // $foo: String - function printConstant() { - return group(concat([node.name, ": ", path.call(printType, "type")])); - } - - // Prints out an interface declaration, which looks like: - // interface _Foo end - function printInterface() { - return group( - concat([ - "interface ", - printNameAndTypeParams(), - indent(printMembers()), - hardline, - "end" - ]) - ); - } - - // Prints out a module declaration, which looks like: - // module Foo end - function printModule() { - const parts = ["module ", printNameAndTypeParams()]; - - if (node.self_types.length > 0) { - parts.push(" : ", join(", ", path.map(printNameAndArgs, "self_types"))); - } - - parts.push(indent(printMembers()), hardline, "end"); - - return group(concat(parts)); - } - - // Prints out an alias within a declaration, which looks like: - // alias foo bar - // alias self.foo self.bar - function printAlias() { - if (node.kind === "singleton") { - return concat(["alias self.", node.new_name, " self.", node.old_name]); - } - - return concat(["alias ", node.new_name, " ", node.old_name]); - } - - // Prints out an attr_* meta method, which looks like: - // attr_accessor foo - // attr_reader self.foo() - // attr_writer self.foo(@bar): String - function printAttr() { - const parts = [node.member, " "]; - - if (node.kind === "singleton") { - parts.push("self."); - } - - parts.push(node.name); - - if (node.ivar_name === false) { - parts.push("()"); - } else if (node.ivar_name) { - parts.push("(", node.ivar_name, ")"); - } - - parts.push(": ", path.call(printType, "type")); - - return group(concat(parts)); - } - - // Prints out a variable member, which looks like: - // @foo: String - // self.@foo: String - // @@foo: String - function printVariable() { - return group(concat([node.name, ": ", path.call(printType, "type")])); - } - - // Prints out a mixin, which looks like: - // include Foo - // prepend Foo - // extend Foo - function printMixin() { - return group(concat([node.member, " ", printNameAndArgs(path)])); - } - - // Returns an array of printed parameters so that the calling function can - // join them together in whatever way. - function printMethodParams(path) { - const node = path.getValue(); - let parts = []; - - // required positionals, as in (A) - parts = parts.concat(path.map(printMethodParam, "required_positionals")); - - // optional positionals, as in (?A) - parts = parts.concat( - path.map( - (paramPath) => concat(["?", printMethodParam(paramPath)]), - "optional_positionals" - ) - ); - - // rest positional, as in (*A) - if (node.rest_positionals) { - parts.push( - concat(["*", path.call(printMethodParam, "rest_positionals")]) - ); - } - - // trailing positionals are required positionals after a rest - parts = parts.concat(path.map(printMethodParam, "trailing_positionals")); - - // required keywords, as in (a: A) - getSortedKeys(node.required_keywords).forEach((name) => { - parts.push( - concat([ - name, - ": ", - path.call(printMethodParam, "required_keywords", name) - ]) - ); - }); - - // optional keywords, as in (?a: A) - getSortedKeys(node.optional_keywords).forEach((name) => { - parts.push( - concat([ - "?", - name, - ": ", - path.call(printMethodParam, "optional_keywords", name) - ]) - ); - }); - - // rest keyword, as in (**A) - if (node.rest_keywords) { - parts.push(concat(["**", path.call(printMethodParam, "rest_keywords")])); - } - - return parts; - - // Prints out a method parameter at a given path. Handles printing out the - // name if there is one (and whether or not it's escaped). - function printMethodParam(path) { - const node = path.getValue(); - const parts = [path.call(printType, "type")]; - - if (node.name) { - parts.push(" "); - - if (node.escaped) { - parts.push("`", node.name, "`"); - } else { - parts.push(node.name); - } - } - - return concat(parts); - } - } - - // Prints out a specific method signature, which looks like: - // (T t) -> void - function printMethodSignature(path) { - const node = path.getValue(); - const parts = []; - - // We won't have a type_params key if we're printing a block - if (node.type_params && node.type_params.length > 0) { - parts.push("[", join(", ", node.type_params), "] "); - } - - let params = path.call(printMethodParams, "type"); - - if (params.length > 0) { - parts.push( - "(", - indent(concat([softline, join(concat([",", line]), params)])), - softline, - ") " - ); - } - - if (node.block) { - if (!node.block.required) { - parts.push("?"); - } - - parts.push( - "{", - indent(concat([line, path.call(printMethodSignature, "block")])), - line, - "} " - ); - } - - parts.push( - "-> ", - path.call( - (typePath) => printType(typePath, { forceParens: true }), - "type", - "return_type" - ) - ); - - return group(concat(parts)); - } - - // Prints out a method definition, which looks like: - // def t: (T t) -> void - function printMethodDefinition() { - let typeDocs = path.map(printMethodSignature, "types"); - - if (node.overload) { - typeDocs.push("..."); - } - - if (typeDocs.length === 1) { - typeDocs = concat([" ", typeDocs[0]]); - } else { - typeDocs = indent( - group(concat([line, join(concat([line, "| "]), typeDocs)])) - ); - } - - const parts = ["def "]; - - if (node.kind === "singleton") { - parts.push("self."); - } else if (node.kind === "singleton_instance") { - parts.push("self?."); - } - - const escaped = isMethodNameEscaped(); - parts.push(escaped ? `\`${node.name}\`` : node.name, ":", typeDocs); - - return group(concat(parts)); - - // Determine if a method name is escaped in the original source. - function isMethodNameEscaped() { - const pos = node.location.start_pos + 4; - const name = opts.originalText.slice(pos, pos + 2).trimStart(); - - return name[0] === "`" && name[1] !== ":"; - } - } - - // An annotation can be attached to most kinds of nodes, and should be printed - // using %a{}. - function printAnnotations() { - return join(hardline, path.map(printAnnotation, "annotations")); - - function printAnnotation(path) { - const node = path.getValue(); - - // If there are already braces inside the annotation, then we're just - // going to print out the original string to avoid having to escape - // anything. - if (/[{}]/.test(node.string)) { - return getSource(node, opts); - } - - return concat(["%a{", node.string, "}"]); - } - } - - // Comments come in as one whole string, so here we split it up into multiple - // lines and then prefix it with the pound sign. - function printComment() { - const lines = node.comment.string.slice(0, -1).split("\n"); - - return join( - hardline, - lines.map((segment) => `# ${segment}`) - ); - } -} - -// This is an escape-hatch to ignore nodes in the tree. If you have a comment -// that includes this pattern, then the entire node will be ignored and just the -// original source will be printed out. -function hasPrettierIgnore(path) { - const node = path.getValue(); - - return node.comment && node.comment.string.includes("prettier-ignore"); -} - -// This function handles adding the format pragma to a source string. This is an -// optional workflow for incremental adoption. -function insertPragma(text) { - return `# @format\n${text}`; -} - -module.exports = { - print: printNode, - hasPrettierIgnore, - insertPragma -}; diff --git a/src/rbs/printer.ts b/src/rbs/printer.ts new file mode 100644 index 00000000..98830cc2 --- /dev/null +++ b/src/rbs/printer.ts @@ -0,0 +1,607 @@ +import type { Plugin, RBS } from "../types"; + +const { + concat, + group, + hardline, + indent, + makeString, + join, + line, + softline +} = require("../prettier"); + +// For some lists of entities in the AST, the parser returns them as an unsorted +// object (presumably because Ruby hashes have implicit ordering). We do not +// have that in JavaScript, so here we sort each object by its position in the +// source string. +function getSortedKeys(object: Record) { + return Object.keys(object).sort( + (left, right) => + object[left].type.location.start_pos - + object[right].type.location.start_pos + ); +} + +// In some cases, we want to just defer to whatever was in the source. +function getSource(node: { location: RBS.Location }, opts: Plugin.Options) { + return opts.originalText.slice( + node.location.start_pos, + node.location.end_pos + ); +} + +const printer: Plugin.PrinterConfig = { + // This is the generic node print function, used to convert any node in the AST + // into its equivalent Doc representation. + print(path, opts, print) { + const node = path.getValue(); + let doc = null; + + if (node.declarations) { + // Prints out the root of the tree, which includes zero or more declarations. + return concat([ + join(concat([hardline, hardline]), path.map(print, "declarations")), + hardline + ]); + } + + /* istanbul ignore else */ + if (node.declaration) { + switch (node.declaration) { + // Prints out a type alias, which is a declaration that looks like: + // type foo = String + case "alias": { + doc = group( + concat([ + "type ", + node.name, + " =", + indent(group(concat([line, path.call(printType, "type")]))) + ]) + ); + break; + } + // Prints out a class declarations, which looks like: + // class Foo end + case "class": { + const parts = ["class ", printNameAndTypeParams(node)]; + + if (node.super_class) { + parts.push(" < ", path.call(printNameAndArgs, "super_class")); + } + + parts.push(indent(printMembers()), hardline, "end"); + doc = group(concat(parts)); + break; + } + // Prints out a constant or a global declaration, which looks like: + // Foo: String + // $foo: String + case "constant": + case "global": { + doc = group(concat([node.name, ": ", path.call(printType, "type")])); + break; + } + // Prints out an interface declaration, which looks like: + // interface _Foo end + case "interface": { + doc = group( + concat([ + "interface ", + printNameAndTypeParams(node), + indent(printMembers()), + hardline, + "end" + ]) + ); + break; + } + // Prints out a module declaration, which looks like: + // module Foo end + case "module": { + const parts = ["module ", printNameAndTypeParams(node)]; + + if (node.self_types.length > 0) { + parts.push(" : ", join(", ", path.map(printNameAndArgs, "self_types"))); + } + + parts.push(indent(printMembers()), hardline, "end"); + doc = group(concat(parts)); + break; + } + /* istanbul ignore next */ + default: + throw new Error(`unknown declaration: ${(node as any).declaration}`); + } + } else if (node.member) { + switch (node.member) { + // Prints out an alias within a declaration, which looks like: + // alias foo bar + // alias self.foo self.bar + case "alias": { + if (node.kind === "singleton") { + doc = concat(["alias self.", node.new_name, " self.", node.old_name]); + } else { + doc = concat(["alias ", node.new_name, " ", node.old_name]); + } + break; + } + // Prints out an attr_* meta method, which looks like: + // attr_accessor foo + // attr_reader self.foo() + // attr_writer self.foo(@bar): String + case "attr_accessor": + case "attr_reader": + case "attr_writer": { + const parts: Plugin.Doc[] = [node.member, " "]; + + if (node.kind === "singleton") { + parts.push("self."); + } + + parts.push(node.name); + + if (node.ivar_name === false) { + parts.push("()"); + } else if (node.ivar_name) { + parts.push("(", node.ivar_name, ")"); + } + + parts.push(": ", path.call(printType, "type")); + doc = group(concat(parts)); + break; + } + // Prints out a class or instance variable member, which looks like: + // @foo: String + // @@foo: String + case "class_variable": + case "instance_variable": { + doc = group(concat([node.name, ": ", path.call(printType, "type")])); + break; + } + // Prints out a class instance variable member, which looks like: + // self.@foo: String + case "class_instance_variable": { + doc = concat(["self.", node.name, ": ", path.call(printType, "type")]); + break; + } + // Prints out a mixin, which looks like: + // include Foo + // prepend Foo + // extend Foo + case "include": + case "extend": + case "prepend": { + doc = group(concat([ + node.member, + " ", + printNameAndArgs(path as any as Plugin.Path) + ])); + break; + } + case "public": + case "private": { + doc = node.member; + break; + } + case "method_definition": + doc = printMethodDefinition(node); + break; + /* istanbul ignore next */ + default: + throw new Error(`unknown member: ${(node as any).member}`); + } + } else { + const ast = JSON.stringify(node, null, 2); + throw new Error(`Unsupported node encountered:\n${ast}`); + } + + // An annotation can be attached to most kinds of nodes, and should be printed + // using %a{}. Certain nodes can't have annotations at all. + if (node.annotations && node.annotations.length > 0) { + doc = concat([ + join(hardline, path.map((annotationPath: Plugin.Path) => { + const annotationNode = annotationPath.getValue(); + + // If there are already braces inside the annotation, then we're just + // going to print out the original string to avoid having to escape + // anything. + if (/[{}]/.test(annotationNode.string)) { + return getSource(annotationNode, opts); + } + + return concat(["%a{", annotationNode.string, "}"]); + }, "annotations")), + hardline, + doc + ]); + } + + // Comments come in as one whole string, so here we split it up into + // multiple lines and then prefix it with the pound sign. + if (node.comment) { + doc = concat([ + join(hardline, node.comment.string.slice(0, -1).split("\n").map((segment) => `# ${segment}`)), + hardline, + doc + ]); + } + + return doc; + + // Prints out a string in the source, which looks like: + // 'foo' + function printString(node: RBS.Literal) { + // We're going to go straight to the source here, as if we don't then we're + // going to end up with the result of String#inspect, which does weird + // things to escape sequences. + const value = getSource(node, opts); + + // Get the quote that was used in the source and the quote that we want to + // be using. + const originalQuote = value[0]; + const preferredQuote = opts.rubySingleQuote ? "'" : '"'; + + // Determine if we're allowed to change the quote based on whether or not + // there is an escape sequence in the source string. + const quote = node.literal.includes("\\") ? originalQuote : preferredQuote; + + return makeString(value.slice(1, -1), quote, false); + } + + // Certain nodes are names with optional arguments attached, as in Array[A]. + // We handle all of that printing centralized here. + function printNameAndArgs(path: Plugin.Path) { + const node = path.getValue(); + + if (node.args.length === 0) { + return node.name; + } + + return group( + concat([node.name, "[", join(", ", path.map(printType, "args")), "]"]) + ); + } + + // This is the big function that prints out any individual type, which can + // look like all kinds of things, listed in the case statement below. + function printType(path: Plugin.Path, options?: number | { forceParens: boolean }): Plugin.Doc { + const node = path.getValue(); + const forceParens = typeof options === "object" && options.forceParens; + + switch (node.class) { + case "literal": + if (node.literal[0] === '"') { + return printString(node); + } + return node.literal; + case "optional": + return concat([ + path.call( + (typePath) => printType(typePath, { forceParens: true }), + "type" + ), + "?" + ]); + case "tuple": + // If we don't have any sub types, we explicitly need the space in between + // the brackets to not confuse the parser. + if (node.types.length === 0) { + return "[ ]"; + } + + return group( + concat(["[", join(", ", path.map(printType, "types")), "]"]) + ); + case "union": { + const doc = group( + join(concat([line, "| "]), path.map(printType, "types")) + ); + + if (forceParens) { + return concat(["(", doc, ")"]); + } + + return doc; + } + case "intersection": { + const doc = group( + join( + concat([line, "& "]), + path.map( + (typePath) => printType(typePath, { forceParens: true }), + "types" + ) + ) + ); + + if (forceParens) { + return concat(["(", doc, ")"]); + } + + return doc; + } + case "class_singleton": + return concat(["singleton(", node.name, ")"]); + case "proc": + return concat(["^", printMethodSignature(path as Plugin.Path)]); + case "record": { + const parts: Plugin.Doc[] = []; + + getSortedKeys(node.fields).forEach((field) => { + const fieldParts = []; + + if (node.fields[field].joiner === "rocket") { + fieldParts.push(`${field} => `); + } else { + fieldParts.push(`${field}: `); + } + + fieldParts.push(path.call(printType, "fields", field, "type")); + parts.push(concat(fieldParts)); + }); + + return group( + concat([ + "{", + indent(concat([line, join(concat([",", line]), parts)])), + line, + "}" + ]) + ); + } + case "class_instance": + case "interface": + return printNameAndArgs(path as Plugin.Path); + case "alias": + case "variable": + return node.name; + case "bool": + case "bot": + case "class": + case "instance": + case "nil": + case "self": + case "top": + case "untyped": + case "void": + return node.class; + /* istanbul ignore next */ + default: + throw new Error(`unknown type: ${(node as any).class}`); + } + } + + // Prints out the members of a class, module, or interface. + function printMembers() { + let lastLine: number | null = null; + const docs: Plugin.Doc[] = []; + + path.each((memberPath) => { + const memberNode = memberPath.getValue(); + + if (lastLine !== null && memberNode.location.start.line - lastLine >= 2) { + docs.push(concat([hardline, hardline])); + } else { + docs.push(hardline); + } + + docs.push(print(memberPath)); + lastLine = memberNode.location.end.line; + }, "members"); + + return concat(docs); + } + + // Prints out the name of a class, interface, or module declaration. + // Additionally loops through each type parameter if there are any and print + // them out joined by commas. Checks for validation and variance. + function printNameAndTypeParams(node: RBS.NameAndTypeParams) { + if (node.type_params.params.length === 0) { + return node.name; + } + + const docs = path.map( + (paramPath) => { + const node = paramPath.getValue(); + const parts = []; + + if (node.skip_validation) { + parts.push("unchecked"); + } + + if (node.variance === "covariant") { + parts.push("out"); + } else if (node.variance === "contravariant") { + parts.push("in"); + } + + return join(" ", parts.concat(node.name)); + }, + "type_params", + "params" + ); + + return concat([node.name, "[", join(", ", docs), "]"]); + } + + // Returns an array of printed parameters so that the calling function can + // join them together in whatever way. + function printMethodParams(path: Plugin.Path) { + const node = path.getValue(); + let parts: Plugin.Doc[] = []; + + // required positionals, as in (A) + parts = parts.concat(path.map(printMethodParam, "required_positionals")); + + // optional positionals, as in (?A) + parts = parts.concat( + path.map( + (paramPath) => concat(["?", printMethodParam(paramPath)]), + "optional_positionals" + ) + ); + + // rest positional, as in (*A) + if (node.rest_positionals) { + parts.push( + concat(["*", path.call(printMethodParam, "rest_positionals")]) + ); + } + + // trailing positionals are required positionals after a rest + parts = parts.concat(path.map(printMethodParam, "trailing_positionals")); + + // required keywords, as in (a: A) + getSortedKeys(node.required_keywords).forEach((name) => { + parts.push( + concat([ + name, + ": ", + path.call(printMethodParam, "required_keywords", name) + ]) + ); + }); + + // optional keywords, as in (?a: A) + getSortedKeys(node.optional_keywords).forEach((name) => { + parts.push( + concat([ + "?", + name, + ": ", + path.call(printMethodParam, "optional_keywords", name) + ]) + ); + }); + + // rest keyword, as in (**A) + if (node.rest_keywords) { + parts.push(concat(["**", path.call(printMethodParam, "rest_keywords")])); + } + + return parts; + + // Prints out a method parameter at a given path. Handles printing out the + // name if there is one (and whether or not it's escaped). + function printMethodParam(path: Plugin.Path) { + const node = path.getValue(); + const parts = [path.call(printType, "type")]; + + if (node.name) { + parts.push(" "); + + if (node.escaped) { + parts.push("`", node.name, "`"); + } else { + parts.push(node.name); + } + } + + return concat(parts); + } + } + + // Prints out a specific method signature, which looks like: + // (T t) -> void + function printMethodSignature(path: Plugin.Path): Plugin.Doc { + const node = path.getValue(); + const parts = []; + + // We won't have a type_params key if we're printing a block + if (node.type_params && node.type_params.length > 0) { + parts.push("[", join(", ", node.type_params), "] "); + } + + let params = path.call(printMethodParams, "type"); + + if (params.length > 0) { + parts.push( + "(", + indent(concat([softline, join(concat([",", line]), params)])), + softline, + ") " + ); + } + + if (node.block) { + if (!node.block.required) { + parts.push("?"); + } + + parts.push( + "{", + indent(concat([line, path.call(printMethodSignature, "block")])), + line, + "} " + ); + } + + parts.push( + "-> ", + path.call( + (typePath) => printType(typePath, { forceParens: true }), + "type", + "return_type" + ) + ); + + return group(concat(parts)); + } + + // Prints out a method definition, which looks like: + // def t: (T t) -> void + function printMethodDefinition(node: RBS.MethodDefinition) { + let typeDocs = path.map(printMethodSignature, "types"); + + if (node.overload) { + typeDocs.push("..."); + } + + if (typeDocs.length === 1) { + typeDocs = concat([" ", typeDocs[0]]); + } else { + typeDocs = indent( + group(concat([line, join(concat([line, "| "]), typeDocs)])) + ); + } + + const parts: Plugin.Doc[] = ["def "]; + + if (node.kind === "singleton") { + parts.push("self."); + } else if (node.kind === "singleton_instance") { + parts.push("self?."); + } + + const escaped = isMethodNameEscaped(); + parts.push(escaped ? `\`${node.name}\`` : node.name, ":", typeDocs); + + return group(concat(parts)); + + // Determine if a method name is escaped in the original source. + function isMethodNameEscaped() { + const pos = node.location.start_pos + 4; + const name = opts.originalText.slice(pos, pos + 2).trimStart(); + + return name[0] === "`" && name[1] !== ":"; + } + } + }, + // This is an escape-hatch to ignore nodes in the tree. If you have a comment + // that includes this pattern, then the entire node will be ignored and just the + // original source will be printed out. + hasPrettierIgnore(path) { + const node = path.getValue(); + + return node.comment && node.comment.string.includes("prettier-ignore") || false; + }, + // This function handles adding the format pragma to a source string. This is an + // optional workflow for incremental adoption. + insertPragma(text) { + return `# @format\n${text}`; + } +}; + +export default printer; From c7f1bc3f10033af45251d89235b11ee89883eab0 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Sep 2021 15:23:04 -0400 Subject: [PATCH 231/785] Correctly type prettier module exports --- src/haml/embed.ts | 3 ++- src/haml/printer.ts | 9 +++++---- src/prettier.js | 16 ---------------- src/prettier.ts | 21 +++++++++++++++++++++ src/rbs/printer.ts | 21 +++++++-------------- src/ruby/embed.ts | 6 +++--- src/ruby/nodes/alias.ts | 3 ++- src/ruby/nodes/aref.ts | 3 ++- src/ruby/nodes/args.ts | 11 ++++++----- src/ruby/nodes/arrays.ts | 5 +++-- src/ruby/nodes/assign.ts | 5 +++-- src/ruby/nodes/blocks.ts | 7 ++++--- src/ruby/nodes/calls.ts | 12 ++++++------ src/ruby/nodes/case.ts | 5 +++-- src/ruby/nodes/class.ts | 5 +++-- src/ruby/nodes/commands.ts | 5 +++-- src/ruby/nodes/conditionals.ts | 6 +++--- src/ruby/nodes/constants.ts | 5 +++-- src/ruby/nodes/flow.ts | 9 +++++---- src/ruby/nodes/hashes.ts | 14 +++++++------- src/ruby/nodes/heredocs.ts | 5 +++-- src/ruby/nodes/hooks.ts | 3 ++- src/ruby/nodes/lambdas.ts | 5 +++-- src/ruby/nodes/loops.ts | 6 +++--- src/ruby/nodes/massign.ts | 7 ++++--- src/ruby/nodes/methods.ts | 5 +++-- src/ruby/nodes/operators.ts | 5 +++-- src/ruby/nodes/params.ts | 9 +++++---- src/ruby/nodes/patterns.ts | 18 +++++++++--------- src/ruby/nodes/regexp.ts | 5 +++-- src/ruby/nodes/rescue.ts | 7 ++++--- src/ruby/nodes/return.ts | 5 +++-- src/ruby/nodes/statements.ts | 6 +++--- src/ruby/nodes/strings.ts | 5 +++-- src/ruby/nodes/super.ts | 5 +++-- src/ruby/nodes/undef.ts | 3 ++- src/ruby/printer.ts | 5 +++-- src/utils/inlineEnsureParens.ts | 2 +- src/utils/printEmptyCollection.ts | 3 ++- 39 files changed, 153 insertions(+), 127 deletions(-) delete mode 100644 src/prettier.js create mode 100644 src/prettier.ts diff --git a/src/haml/embed.ts b/src/haml/embed.ts index d2e29531..71c5deab 100644 --- a/src/haml/embed.ts +++ b/src/haml/embed.ts @@ -1,4 +1,5 @@ import type { Plugin, HAML } from "../types"; +import prettier from "../prettier"; const { concat, @@ -8,7 +9,7 @@ const { markAsRoot, mapDoc, stripTrailingHardline -} = require("../prettier"); +} = prettier; // This function is in here because it handles embedded parser values. I don't // have a test that exercises it because I'm not sure for which parser it is diff --git a/src/haml/printer.ts b/src/haml/printer.ts index 72b11b4e..4eef1765 100644 --- a/src/haml/printer.ts +++ b/src/haml/printer.ts @@ -1,4 +1,6 @@ import type { Plugin, HAML } from "../types"; +import prettier from "../prettier"; +import embed from "./embed"; const { align, @@ -11,8 +13,7 @@ const { join, line, softline -} = require("../prettier"); -import embed from "./embed"; +} = prettier; const docTypes = { basic: "Basic", @@ -182,7 +183,7 @@ const printer: Plugin.PrinterConfig = { // https://haml.info/docs/yardoc/file.REFERENCE.html#haml-comments-- case "haml_comment": { const { value } = node; - const parts = ["-#"]; + const parts: Plugin.Doc[] = ["-#"]; if (value.text) { if (opts.originalText.split("\n")[node.line - 1].trim() === "-#") { @@ -227,7 +228,7 @@ const printer: Plugin.PrinterConfig = { } // https://haml.info/docs/yardoc/file.REFERENCE.html#running-ruby-- case "silent_script": { - const parts = [`- ${node.value.text.trim()}`]; + const parts: Plugin.Doc[] = [`- ${node.value.text.trim()}`]; if (node.children.length > 0) { parts.push( diff --git a/src/prettier.js b/src/prettier.js deleted file mode 100644 index 47744683..00000000 --- a/src/prettier.js +++ /dev/null @@ -1,16 +0,0 @@ -// If `RBPRETTIER` is set, then this is being run from the `Prettier::run` ruby -// method. In that case, we need to pull `prettier` from the node_modules -// directly, as it's been shipped with the gem. -/* istanbul ignore next */ -const source = process.env.RBPRETTIER ? "../node_modules/prettier" : "prettier"; - -const prettier = require(source); - -// Just combine all the things into one big object so that we can import -// whatever we need from prettier without having to dive too deeply. -module.exports = Object.assign( - {}, - prettier.doc.builders, - prettier.doc.utils, - prettier.util -); diff --git a/src/prettier.ts b/src/prettier.ts new file mode 100644 index 00000000..97cb2aa4 --- /dev/null +++ b/src/prettier.ts @@ -0,0 +1,21 @@ +import type * as Prettier from "prettier"; + +type Doc = Prettier.doc.builders.Doc; +type Builders = Omit & { + // Explicitly overwriting the type of the join builder because I don't want to + // have to go around saying "as Doc[]" everywhere. + join: (sep: Doc, docs: Doc | Doc[]) => Prettier.doc.builders.Concat +}; + +// If `RBPRETTIER` is set, then this is being run from the `Prettier::run` ruby +// method. In that case, we need to pull `prettier` from the node_modules +// directly, as it's been shipped with the gem. +/* istanbul ignore next */ +const source: typeof Prettier = require(process.env.RBPRETTIER ? "../node_modules/prettier" : "prettier"); + +// Cramming everything together to make it simpler to pull in all of the right +// utilities and builders. +const builders = source.doc.builders as Builders; +const exported = { ...builders, ...source.doc.utils, ...source.util }; + +export default exported; diff --git a/src/rbs/printer.ts b/src/rbs/printer.ts index 98830cc2..5f3c1808 100644 --- a/src/rbs/printer.ts +++ b/src/rbs/printer.ts @@ -1,15 +1,8 @@ +import type * as Prettier from "prettier"; import type { Plugin, RBS } from "../types"; +import prettier from "../prettier"; -const { - concat, - group, - hardline, - indent, - makeString, - join, - line, - softline -} = require("../prettier"); +const { concat, group, hardline, indent, makeString, join, line, softline } = prettier; // For some lists of entities in the AST, the parser returns them as an unsorted // object (presumably because Ruby hashes have implicit ordering). We do not @@ -65,7 +58,7 @@ const printer: Plugin.PrinterConfig = { // Prints out a class declarations, which looks like: // class Foo end case "class": { - const parts = ["class ", printNameAndTypeParams(node)]; + const parts: Plugin.Doc[] = ["class ", printNameAndTypeParams(node)]; if (node.super_class) { parts.push(" < ", path.call(printNameAndArgs, "super_class")); @@ -100,7 +93,7 @@ const printer: Plugin.PrinterConfig = { // Prints out a module declaration, which looks like: // module Foo end case "module": { - const parts = ["module ", printNameAndTypeParams(node)]; + const parts: Plugin.Doc[] = ["module ", printNameAndTypeParams(node)]; if (node.self_types.length > 0) { parts.push(" : ", join(", ", path.map(printNameAndArgs, "self_types"))); @@ -247,7 +240,7 @@ const printer: Plugin.PrinterConfig = { // there is an escape sequence in the source string. const quote = node.literal.includes("\\") ? originalQuote : preferredQuote; - return makeString(value.slice(1, -1), quote, false); + return makeString(value.slice(1, -1), quote as Prettier.util.Quote, false); } // Certain nodes are names with optional arguments attached, as in Array[A]. @@ -553,7 +546,7 @@ const printer: Plugin.PrinterConfig = { // Prints out a method definition, which looks like: // def t: (T t) -> void function printMethodDefinition(node: RBS.MethodDefinition) { - let typeDocs = path.map(printMethodSignature, "types"); + let typeDocs: Plugin.Doc = path.map(printMethodSignature, "types"); if (node.overload) { typeDocs.push("..."); diff --git a/src/ruby/embed.ts b/src/ruby/embed.ts index 73060329..9ab738ed 100644 --- a/src/ruby/embed.ts +++ b/src/ruby/embed.ts @@ -1,4 +1,6 @@ import type { Plugin, Ruby } from "../types"; +import prettier from "../prettier"; +import { literallineWithoutBreakParent } from "../utils"; const { concat, @@ -8,9 +10,7 @@ const { mapDoc, markAsRoot, stripTrailingHardline -} = require("../prettier"); - -import { literallineWithoutBreakParent } from "../utils"; +} = prettier; const parsers: Record = { css: "css", diff --git a/src/ruby/nodes/alias.ts b/src/ruby/nodes/alias.ts index 5c941b64..e5c7bbfd 100644 --- a/src/ruby/nodes/alias.ts +++ b/src/ruby/nodes/alias.ts @@ -1,4 +1,5 @@ import type { Plugin, Ruby } from "../../types"; +import prettier from "../../prettier"; const { addTrailingComment, @@ -7,7 +8,7 @@ const { group, hardline, line -} = require("../../prettier"); +} = prettier; // The `alias` keyword is used to make a method respond to another name as well // as the current one. For example, to get the method `foo` to also respond to diff --git a/src/ruby/nodes/aref.ts b/src/ruby/nodes/aref.ts index df258cfb..3020a5e6 100644 --- a/src/ruby/nodes/aref.ts +++ b/src/ruby/nodes/aref.ts @@ -1,4 +1,5 @@ import type { Plugin, Ruby } from "../../types"; +import prettier from "../../prettier"; const { concat, @@ -7,7 +8,7 @@ const { join, line, softline -} = require("../../prettier"); +} = prettier; // `aref` nodes are when you're pulling a value out of a collection at a // specific index. Put another way, it's any time you're calling the method diff --git a/src/ruby/nodes/args.ts b/src/ruby/nodes/args.ts index 1c961153..5669f8e1 100644 --- a/src/ruby/nodes/args.ts +++ b/src/ruby/nodes/args.ts @@ -1,5 +1,9 @@ import type * as Prettier from "prettier"; import type { Plugin, Ruby } from "../../types"; +import prettier from "../../prettier"; + +import { getTrailingComma } from "../../utils"; +import toProc from "../toProc"; const { concat, @@ -9,10 +13,7 @@ const { join, line, softline -} = require("../../prettier"); - -import { getTrailingComma } from "../../utils"; -import toProc from "../toProc"; +} = prettier; const noTrailingComma = ["command", "command_call"]; @@ -117,7 +118,7 @@ export const printArgsAddBlock: Plugin.Printer = (path, opts, const parts = path.call(print, "body", 0) as Plugin.Doc[]; if (blockNode) { - let blockDoc = path.call(print, "body", 1) as Plugin.Doc[]; + let blockDoc = path.call(print, "body", 1) as any; if (!(blockNode.comments || []).some(({ leading }) => leading)) { // If we don't have any leading comments, we can just prepend the diff --git a/src/ruby/nodes/arrays.ts b/src/ruby/nodes/arrays.ts index d774493a..431e6d9a 100644 --- a/src/ruby/nodes/arrays.ts +++ b/src/ruby/nodes/arrays.ts @@ -1,4 +1,6 @@ import type { Plugin, Ruby } from "../../types"; +import prettier from "../../prettier"; +import { getTrailingComma, printEmptyCollection } from "../../utils"; const { concat, @@ -8,8 +10,7 @@ const { join, line, softline -} = require("../../prettier"); -import { getTrailingComma, printEmptyCollection } from "../../utils"; +} = prettier; // Checks that every argument within this args node is a string_literal node // that has no spaces or interpolations. This means we're dealing with an array diff --git a/src/ruby/nodes/assign.ts b/src/ruby/nodes/assign.ts index 1769b5ff..90ec266d 100644 --- a/src/ruby/nodes/assign.ts +++ b/src/ruby/nodes/assign.ts @@ -1,8 +1,9 @@ import type { Plugin, Ruby } from "../../types"; - -const { concat, group, indent, join, line } = require("../../prettier"); +import prettier from "../../prettier"; import { skipAssignIndent } from "../../utils"; +const { concat, group, indent, join, line } = prettier; + export const printAssign: Plugin.Printer = (path, opts, print) => { const [_targetNode, valueNode] = path.getValue().body; const [targetDoc, valueDoc] = path.map(print, "body"); diff --git a/src/ruby/nodes/blocks.ts b/src/ruby/nodes/blocks.ts index ef3d2b18..410089e6 100644 --- a/src/ruby/nodes/blocks.ts +++ b/src/ruby/nodes/blocks.ts @@ -1,4 +1,6 @@ import type { Plugin, Ruby } from "../../types"; +import prettier from "../../prettier"; +import { hasAncestor } from "../../utils"; const { breakParent, @@ -9,8 +11,7 @@ const { join, removeLines, softline -} = require("../../prettier"); -import { hasAncestor } from "../../utils"; +} = prettier; export const printBlockVar: Plugin.Printer = (path, opts, print) => { const parts = ["|", removeLines(path.call(print, "body", 0))]; @@ -30,7 +31,7 @@ function printBlock(braces: boolean): Plugin.Printer = (path, opt // If we're at the top of a chain, then we're going to print out a nice // multi-line layout if this doesn't break into multiple lines. - if (!chained.includes(parentNode.type) && (node.chain || 0) >= threshold) { + if (!chained.includes(parentNode.type) && (node.chain || 0) >= threshold && node.breakDoc) { // This is pretty specialized behavior. Basically if we're at the top of a // chain but we've only had method calls without arguments and now we have // arguments, then we're effectively trying to call a method with arguments @@ -185,7 +185,7 @@ export const printMethodAddArg: Plugin.Printer = (path, opt } return ifBreak( - group(indent(concat(node.breakDoc!.concat(argsDoc)))), + group(indent(concat(node.breakDoc.concat(argsDoc)))), concat([methodDoc, argsDoc]) ); } diff --git a/src/ruby/nodes/case.ts b/src/ruby/nodes/case.ts index c2912e4f..dfab65bf 100644 --- a/src/ruby/nodes/case.ts +++ b/src/ruby/nodes/case.ts @@ -1,5 +1,6 @@ import type * as Prettier from "prettier"; import type { Plugin, Ruby } from "../../types"; +import prettier from "../../prettier"; const { align, @@ -9,7 +10,7 @@ const { hardline, indent, line -} = require("../../prettier"); +} = prettier; export const printCase: Plugin.Printer = (path, opts, print) => { const statement: Plugin.Doc[] = ["case"]; @@ -45,7 +46,7 @@ export const printWhen: Plugin.Printer = (path, opts, print) => { ); const stmts = path.call(print, "body", 1) as Prettier.doc.builders.Concat; - const parts = [concat(["when ", align("when ".length, preds)])]; + const parts: Plugin.Doc[] = [concat(["when ", align("when ".length, preds)])]; // It's possible in a when to just have empty void statements, in which case // we would skip adding the body. diff --git a/src/ruby/nodes/class.ts b/src/ruby/nodes/class.ts index 6f61da3e..1cae97a5 100644 --- a/src/ruby/nodes/class.ts +++ b/src/ruby/nodes/class.ts @@ -1,8 +1,9 @@ import type { Plugin, Ruby } from "../../types"; - -const { concat, group, hardline, indent } = require("../../prettier"); +import prettier from "../../prettier"; import { isEmptyBodyStmt } from "../../utils"; +const { concat, group, hardline, indent } = prettier; + export const printClass: Plugin.Printer = (path, opts, print) => { const [_constant, superclass, bodystmt] = path.getValue().body; diff --git a/src/ruby/nodes/commands.ts b/src/ruby/nodes/commands.ts index a6af1e04..13ac75d6 100644 --- a/src/ruby/nodes/commands.ts +++ b/src/ruby/nodes/commands.ts @@ -1,5 +1,7 @@ import type * as Prettier from "prettier"; import type { Plugin, Ruby } from "../../types"; +import prettier from "../../prettier"; +import { makeCall } from "../../utils"; const { align, @@ -10,8 +12,7 @@ const { join, line, softline -} = require("../../prettier"); -import { makeCall } from "../../utils"; +} = prettier; function docLength(doc: any): number { if (doc.length) { diff --git a/src/ruby/nodes/conditionals.ts b/src/ruby/nodes/conditionals.ts index 947d9390..44dce4cc 100644 --- a/src/ruby/nodes/conditionals.ts +++ b/src/ruby/nodes/conditionals.ts @@ -1,5 +1,7 @@ import type * as Prettier from "prettier"; import type { Plugin, Ruby } from "../../types"; +import prettier from "../../prettier"; +import { containsAssignment, inlineEnsureParens, isEmptyStmts } from "../../utils"; const { align, @@ -10,9 +12,7 @@ const { ifBreak, indent, softline -} = require("../../prettier"); - -import { containsAssignment, inlineEnsureParens, isEmptyStmts } from "../../utils"; +} = prettier; function isConcat(doc: any): doc is Prettier.doc.builders.Concat { return doc.type === "concat"; diff --git a/src/ruby/nodes/constants.ts b/src/ruby/nodes/constants.ts index 1fedc926..9ae377ea 100644 --- a/src/ruby/nodes/constants.ts +++ b/src/ruby/nodes/constants.ts @@ -1,8 +1,9 @@ import type { Plugin, Ruby } from "../../types"; - -const { concat, group, indent, join, softline } = require("../../prettier"); +import prettier from "../../prettier"; import { makeCall } from "../../utils"; +const { concat, group, indent, join, softline } = prettier; + export const printConstPath: Plugin.Printer = (path, opts, print) => { return join("::", path.map(print, "body")); }; diff --git a/src/ruby/nodes/flow.ts b/src/ruby/nodes/flow.ts index c6805757..25473d6e 100644 --- a/src/ruby/nodes/flow.ts +++ b/src/ruby/nodes/flow.ts @@ -1,8 +1,9 @@ import type { Plugin, Ruby } from "../../types"; - -const { concat, join } = require("../../prettier"); +import prettier from "../../prettier"; import { literal } from "../../utils"; +const { concat, join } = prettier; + function nodeDive(node: any, steps: PropertyKey[]) { let current = node; @@ -34,11 +35,11 @@ function maybeHandleParens(path: Plugin.Path, print: Plu if (stmts.length === 1 && !unskippableParens.includes(stmts[0].type)) { args = args.concat(steps).concat("body", 0) as CallArgs; - return concat([`${keyword} `, path.call.apply(path, args)]); + return concat([`${keyword} `, path.call.apply(path, args) as Plugin.Doc]); } args = args.concat(steps) as CallArgs; - return concat([keyword, path.call.apply(path, args)]); + return concat([keyword, path.call.apply(path, args) as Plugin.Doc]); } export const printBreak: Plugin.Printer = (path, opts, print) => { diff --git a/src/ruby/nodes/hashes.ts b/src/ruby/nodes/hashes.ts index 9e999faa..78e1fa81 100644 --- a/src/ruby/nodes/hashes.ts +++ b/src/ruby/nodes/hashes.ts @@ -1,4 +1,10 @@ import type { Plugin, Ruby } from "../../types"; +import prettier from "../../prettier"; +import { + getTrailingComma, + printEmptyCollection, + skipAssignIndent +} from "../../utils"; const { concat, @@ -7,13 +13,7 @@ const { indent, join, line -} = require("../../prettier"); - -import { - getTrailingComma, - printEmptyCollection, - skipAssignIndent -} from "../../utils"; +} = prettier; type KeyPrinter = (path: Plugin.Path, print: Plugin.Print) => Plugin.Doc; type HashContents = (Ruby.AssoclistFromArgs | Ruby.BareAssocHash) & { keyPrinter: KeyPrinter }; diff --git a/src/ruby/nodes/heredocs.ts b/src/ruby/nodes/heredocs.ts index 6617d8cb..03e1273d 100644 --- a/src/ruby/nodes/heredocs.ts +++ b/src/ruby/nodes/heredocs.ts @@ -1,8 +1,9 @@ import type { Plugin, Ruby } from "../../types"; - -const { concat, group, lineSuffix, join } = require("../../prettier"); +import prettier from "../../prettier"; import { literallineWithoutBreakParent } from "../../utils"; +const { concat, group, lineSuffix, join } = prettier; + export const printHeredoc: Plugin.Printer = (path, opts, print) => { const { body, ending } = path.getValue(); diff --git a/src/ruby/nodes/hooks.ts b/src/ruby/nodes/hooks.ts index e221cb76..9fcb1a6f 100644 --- a/src/ruby/nodes/hooks.ts +++ b/src/ruby/nodes/hooks.ts @@ -1,6 +1,7 @@ import type { Plugin, Ruby } from "../../types"; +import prettier from "../../prettier"; -const { concat, group, indent, line } = require("../../prettier"); +const { concat, group, indent, line } = prettier; // The `BEGIN` and `END` keywords are used to hook into the Ruby process. Any // `BEGIN` blocks are executed right when the process starts up, and the `END` diff --git a/src/ruby/nodes/lambdas.ts b/src/ruby/nodes/lambdas.ts index 50d25aff..8335ceca 100644 --- a/src/ruby/nodes/lambdas.ts +++ b/src/ruby/nodes/lambdas.ts @@ -1,8 +1,9 @@ import type { Plugin, Ruby } from "../../types"; - -const { concat, group, ifBreak, indent, line } = require("../../prettier"); +import prettier from "../../prettier"; import { hasAncestor } from "../../utils"; +const { concat, group, ifBreak, indent, line } = prettier; + // We can have our params coming in as the first child of the main lambda node, // or if we have them wrapped in parens then they'll be one level deeper. Even // though it's possible to omit the parens if you only have one argument, we're diff --git a/src/ruby/nodes/loops.ts b/src/ruby/nodes/loops.ts index b04be7ee..86a79e5e 100644 --- a/src/ruby/nodes/loops.ts +++ b/src/ruby/nodes/loops.ts @@ -1,4 +1,6 @@ import type { Plugin, Ruby } from "../../types"; +import prettier from "../../prettier"; +import { containsAssignment, inlineEnsureParens, isEmptyStmts } from "../../utils"; const { align, @@ -10,9 +12,7 @@ const { indent, join, softline -} = require("../../prettier"); - -import { containsAssignment, inlineEnsureParens, isEmptyStmts } from "../../utils"; +} = prettier; function printLoop(keyword: string, modifier: boolean): Plugin.Printer { return function printLoopWithOptions(path, { rubyModifier }, print) { diff --git a/src/ruby/nodes/massign.ts b/src/ruby/nodes/massign.ts index deeae018..967259da 100644 --- a/src/ruby/nodes/massign.ts +++ b/src/ruby/nodes/massign.ts @@ -1,4 +1,5 @@ import type { Plugin, Ruby } from "../../types"; +import prettier from "../../prettier"; const { concat, @@ -7,7 +8,7 @@ const { join, line, softline -} = require("../../prettier"); +} = prettier; export const printMAssign: Plugin.Printer = (path, opts, print) => { let right = path.call(print, "body", 1); @@ -20,7 +21,7 @@ export const printMAssign: Plugin.Printer = (path, opts, print) => right = group(join(concat([",", line]), right)); } - const parts = [join(concat([",", line]), path.call(print, "body", 0))]; + const parts: Plugin.Doc[] = [join(concat([",", line]), path.call(print, "body", 0))]; if ((path.getValue().body[0] as any).comma) { parts.push(","); } @@ -56,7 +57,7 @@ export const printMLHSParen: Plugin.Printer = (path, opts, print return path.call(print, "body", 0); } - const parts = [ + const parts: Plugin.Doc[] = [ softline, join(concat([",", line]), path.call(print, "body", 0)) ]; diff --git a/src/ruby/nodes/methods.ts b/src/ruby/nodes/methods.ts index 9aabbe88..8545c7f7 100644 --- a/src/ruby/nodes/methods.ts +++ b/src/ruby/nodes/methods.ts @@ -1,8 +1,9 @@ import type { Plugin, Ruby } from "../../types"; - -const { concat, group, hardline, indent, line } = require("../../prettier"); +import prettier from "../../prettier"; import { isEmptyBodyStmt } from "../../utils"; +const { concat, group, hardline, indent, line } = prettier; + function printMethod(offset: number): Plugin.Printer { return function printMethodWithOffset(path, opts, print) { const node = path.getValue(); diff --git a/src/ruby/nodes/operators.ts b/src/ruby/nodes/operators.ts index 9096168f..181e7dc2 100644 --- a/src/ruby/nodes/operators.ts +++ b/src/ruby/nodes/operators.ts @@ -1,8 +1,9 @@ import type { Plugin, Ruby } from "../../types"; - -const { concat, group, indent, line, softline } = require("../../prettier"); +import prettier from "../../prettier"; import { noIndent } from "../../utils"; +const { concat, group, indent, line, softline } = prettier; + export const printBinary: Plugin.Printer = (path, opts, print) => { const [_leftNode, operator, rightNode] = path.getValue().body; const space = operator === "**" ? "" : " "; diff --git a/src/ruby/nodes/params.ts b/src/ruby/nodes/params.ts index a03aa96d..c6d06e85 100644 --- a/src/ruby/nodes/params.ts +++ b/src/ruby/nodes/params.ts @@ -1,4 +1,6 @@ import type { Plugin, Ruby } from "../../types"; +import prettier from "../../prettier"; +import { literal } from "../../utils"; const { concat, @@ -7,8 +9,7 @@ const { indent, line, softline -} = require("../../prettier"); -import { literal } from "../../utils"; +} = prettier; function printRestParamSymbol(symbol: string): Plugin.Printer { return function printRestParamWithSymbol(path, opts, print) { @@ -74,7 +75,7 @@ export const printParams: Plugin.Printer = (path, opts, print) => { parts.push(path.call(print, "body", 6)); } - const contents = [join(concat([",", line]), parts)]; + const contents: Plugin.Doc[] = [join(concat([",", line]), parts)]; // You can put an extra comma at the end of block args between pipes to // change what it does. Below is the difference: @@ -93,7 +94,7 @@ export const printParams: Plugin.Printer = (path, opts, print) => { // that we could handle them here and get nicer formatting. if (["lambda", "paren"].includes(path.getParentNode().type)) { return group( - concat(["(", indent(concat([softline].concat(contents))), softline, ")"]) + concat(["(", indent(concat(([softline] as Plugin.Doc[]).concat(contents))), softline, ")"]) ); } diff --git a/src/ruby/nodes/patterns.ts b/src/ruby/nodes/patterns.ts index 430cdb9c..459afe7b 100644 --- a/src/ruby/nodes/patterns.ts +++ b/src/ruby/nodes/patterns.ts @@ -1,4 +1,5 @@ import type { Plugin, Ruby } from "../../types"; +import prettier from "../../prettier"; const { align, @@ -8,7 +9,7 @@ const { indent, join, line -} = require("../../prettier"); +} = prettier; const patterns = ["aryptn", "binary", "fndptn", "hshptn", "rassign"]; @@ -28,7 +29,7 @@ const printPatternArg: Plugin.Printer = (path, opts, print) => { export const printAryPtn: Plugin.Printer = (path, opts, print) => { const [constant, preargs, splatarg, postargs] = path.getValue().body; - let args: Plugin.Doc[] = []; + let args: Plugin.Doc | Plugin.Doc[] = []; if (preargs) { args = args.concat( @@ -59,23 +60,22 @@ export const printAryPtn: Plugin.Printer = (path, opts, print) => { export const printFndPtn: Plugin.Printer = (path, opts, print) => { const [constant] = path.getValue().body; - - let args = [concat(["*", path.call(print, "body", 1)])] + const args = ([concat(["*", path.call(print, "body", 1)])] as Plugin.Doc[]) .concat(path.map(print, "body", 2)) .concat(concat(["*", path.call(print, "body", 3)])); - args = concat(["[", group(join(concat([",", line]), args)), "]"]); + const docs = concat(["[", group(join(concat([",", line]), args)), "]"]); if (constant) { - return concat([path.call(print, "body", 0), args]); + return concat([path.call(print, "body", 0), docs]); } - return args; + return docs; }; export const printHshPtn: Plugin.Printer = (path, opts, print) => { const [constant, keyValuePairs, keyValueRest] = path.getValue().body; - let args: Plugin.Doc[] = []; + let args: Plugin.Doc | Plugin.Doc[] = []; if (keyValuePairs.length > 0) { const printPair = (pairPath: Plugin.Path<[Ruby.Label, Ruby.AnyNode]>) => { @@ -117,7 +117,7 @@ export const printHshPtn: Plugin.Printer = (path, opts, print) => { }; export const printIn: Plugin.Printer = (path, opts, print) => { - const parts = [ + const parts: Plugin.Doc[] = [ "in ", align( "in ".length, diff --git a/src/ruby/nodes/regexp.ts b/src/ruby/nodes/regexp.ts index 1cff7ada..b28769c1 100644 --- a/src/ruby/nodes/regexp.ts +++ b/src/ruby/nodes/regexp.ts @@ -1,8 +1,9 @@ import type { Plugin, Ruby } from "../../types"; - -const { concat } = require("../../prettier"); +import prettier from "../../prettier"; import { hasAncestor } from "../../utils"; +const { concat } = prettier; + function hasContent(node: Ruby.RegexpLiteral, pattern: RegExp) { return node.body.some( (child) => child.type === "@tstring_content" && pattern.test(child.body) diff --git a/src/ruby/nodes/rescue.ts b/src/ruby/nodes/rescue.ts index 99d6577b..3d8519cb 100644 --- a/src/ruby/nodes/rescue.ts +++ b/src/ruby/nodes/rescue.ts @@ -1,5 +1,7 @@ import type * as Prettier from "prettier"; import type { Plugin, Ruby } from "../../types"; +import prettier from "../../prettier"; +import { literal } from "../../utils"; const { align, @@ -9,8 +11,7 @@ const { indent, join, line -} = require("../../prettier"); -import { literal } from "../../utils"; +} = prettier; export const printBegin: Plugin.Printer = (path, opts, print) => { return concat([ @@ -29,7 +30,7 @@ export const printEnsure: Plugin.Printer = (path, opts, print) => { }; export const printRescue: Plugin.Printer = (path, opts, print) => { - const parts = ["rescue"]; + const parts: Plugin.Doc[] = ["rescue"]; if (path.getValue().body[0]) { parts.push(align("rescue ".length, path.call(print, "body", 0))); diff --git a/src/ruby/nodes/return.ts b/src/ruby/nodes/return.ts index 589c511a..96378ea7 100644 --- a/src/ruby/nodes/return.ts +++ b/src/ruby/nodes/return.ts @@ -1,4 +1,6 @@ import type { Plugin, Ruby } from "../../types"; +import prettier from "../../prettier"; +import { literal } from "../../utils"; const { concat, @@ -8,8 +10,7 @@ const { line, join, softline -} = require("../../prettier"); -import { literal } from "../../utils"; +} = prettier; // You can't skip the parentheses if you have comments or certain operators with // lower precedence than the return keyword. diff --git a/src/ruby/nodes/statements.ts b/src/ruby/nodes/statements.ts index d50123ad..f00a149c 100644 --- a/src/ruby/nodes/statements.ts +++ b/src/ruby/nodes/statements.ts @@ -1,4 +1,6 @@ import type { Plugin, Ruby } from "../../types"; +import prettier from "../../prettier"; +import { isEmptyStmts } from "../../utils"; const { breakParent, @@ -12,9 +14,7 @@ const { literalline, softline, trim -} = require("../../prettier"); - -import { isEmptyStmts } from "../../utils"; +} = prettier; export const printBodyStmt: Plugin.Printer = (path, opts, print) => { const [stmts, rescue, elseClause, ensure] = path.getValue().body; diff --git a/src/ruby/nodes/strings.ts b/src/ruby/nodes/strings.ts index 7b42eff1..610b3d34 100644 --- a/src/ruby/nodes/strings.ts +++ b/src/ruby/nodes/strings.ts @@ -1,4 +1,5 @@ import type { Plugin, Ruby } from "../../types"; +import prettier from "../../prettier"; const { concat, @@ -9,7 +10,7 @@ const { removeLines, softline, join -} = require("../../prettier"); +} = prettier; // If there is some part of this string that matches an escape sequence or that // contains the interpolation pattern ("#{"), then we are locked into whichever @@ -250,7 +251,7 @@ export const printStringLiteral: Plugin.Printer = (path, { r return join(literalline, normalizeQuotes(part.body, quote).split("\n")); }); - return concat([quote].concat(parts).concat(getClosingQuote(quote))); + return concat(([quote] as Plugin.Doc[]).concat(parts).concat(getClosingQuote(quote))); }; // Prints out a symbol literal. Its child will always be the ident that diff --git a/src/ruby/nodes/super.ts b/src/ruby/nodes/super.ts index aa7d8dba..cac15fb6 100644 --- a/src/ruby/nodes/super.ts +++ b/src/ruby/nodes/super.ts @@ -1,8 +1,9 @@ import type { Plugin, Ruby } from "../../types"; - -const { align, concat, group, join, line } = require("../../prettier"); +import prettier from "../../prettier"; import { literal } from "../../utils"; +const { align, concat, group, join, line } = prettier; + export const printSuper: Plugin.Printer = (path, opts, print) => { const args = path.getValue().body[0]; diff --git a/src/ruby/nodes/undef.ts b/src/ruby/nodes/undef.ts index 8154a69d..6dc04fc3 100644 --- a/src/ruby/nodes/undef.ts +++ b/src/ruby/nodes/undef.ts @@ -1,4 +1,5 @@ import type { Plugin, Ruby } from "../../types"; +import prettier from "../../prettier"; const { addTrailingComment, @@ -7,7 +8,7 @@ const { group, join, line -} = require("../../prettier"); +} = prettier; const printUndefSymbol: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); diff --git a/src/ruby/printer.ts b/src/ruby/printer.ts index 9c58c8c2..9a4e08c0 100644 --- a/src/ruby/printer.ts +++ b/src/ruby/printer.ts @@ -1,10 +1,11 @@ import type { Plugin, Ruby } from "../types"; - -const { concat, trim } = require("../prettier"); +import prettier from "../prettier"; import embed from "./embed"; import nodes from "./nodes"; +const { concat, trim } = prettier; + const noComments = [ "args", "args_add_block", diff --git a/src/utils/inlineEnsureParens.ts b/src/utils/inlineEnsureParens.ts index b1700f8a..ec4e075f 100644 --- a/src/utils/inlineEnsureParens.ts +++ b/src/utils/inlineEnsureParens.ts @@ -41,7 +41,7 @@ const needsParens = [ // // This approach maintains the nice conciseness of the inline version, while // keeping the correct semantic meaning. -function inlineEnsureParens(path: Plugin.Path, parts: Plugin.Doc) { +function inlineEnsureParens(path: Plugin.Path, parts: Plugin.Doc[]) { if (needsParens.includes(path.getParentNode().type)) { return (["("] as Plugin.Doc[]).concat(parts, ")"); } diff --git a/src/utils/printEmptyCollection.ts b/src/utils/printEmptyCollection.ts index 510f4a21..5fd1c59c 100644 --- a/src/utils/printEmptyCollection.ts +++ b/src/utils/printEmptyCollection.ts @@ -1,6 +1,7 @@ import type { Plugin, Ruby } from "../types"; +import prettier from "../prettier"; -const { concat, group, hardline, indent, join, line } = require("../prettier"); +const { concat, group, hardline, indent, join, line } = prettier; function containedWithin(node: Ruby.Array | Ruby.Hash): (comment: Ruby.Comment) => boolean { return function containedWithinNode(comment) { From e20a9672a532aaee99cdb1913d6f88f0e4103f66 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Sep 2021 15:42:42 -0400 Subject: [PATCH 232/785] Finish converting source over to TypeScript --- src/haml/parser.ts | 2 +- src/haml/printer.ts | 2 +- src/parser/{parseSync.js => parseSync.ts} | 49 ++++++++++++++--------- src/plugin.js | 1 - src/rbs/parser.ts | 4 +- src/ruby/parser.ts | 2 +- src/ruby/printer.ts | 2 +- src/types.ts | 7 ++-- 8 files changed, 40 insertions(+), 29 deletions(-) rename src/parser/{parseSync.js => parseSync.ts} (79%) diff --git a/src/haml/parser.ts b/src/haml/parser.ts index bd0dc6e3..cd2829d4 100644 --- a/src/haml/parser.ts +++ b/src/haml/parser.ts @@ -26,4 +26,4 @@ const parser: Plugin.Parser = { } }; -module.exports = parser; +export default parser; diff --git a/src/haml/printer.ts b/src/haml/printer.ts index 4eef1765..cba2b4ee 100644 --- a/src/haml/printer.ts +++ b/src/haml/printer.ts @@ -411,4 +411,4 @@ const printer: Plugin.PrinterConfig = { } }; -module.exports = printer; +export default printer; diff --git a/src/parser/parseSync.js b/src/parser/parseSync.ts similarity index 79% rename from src/parser/parseSync.js rename to src/parser/parseSync.ts index fb8010f5..ab63be6d 100644 --- a/src/parser/parseSync.js +++ b/src/parser/parseSync.ts @@ -1,11 +1,14 @@ -const { spawn, spawnSync, execSync } = require("child_process"); -const { existsSync, mkdtempSync } = require("fs"); -const os = require("os"); -const path = require("path"); -const process = require("process"); +import type { Plugin } from "../types"; +import { spawn, spawnSync, execSync } from "child_process"; +import { existsSync, mkdtempSync } from "fs"; +import os from "os"; +import path from "path"; +import process from "process"; -let netcatConfig; -let parserArgs = process.env.PRETTIER_RUBY_HOST; +type NetcatConfig = { command: string, args: string[] }; + +let netcatConfig: NetcatConfig; +let parserArgs: undefined | string | string[] = process.env.PRETTIER_RUBY_HOST; const isWindows = os.type() === "Windows_NT"; @@ -31,16 +34,20 @@ function getLang() { // https://nodejs.org/api/process.html#process_process_platform return { aix: "C.UTF-8", + android: "C.UTF-8", + cygwin: "C.UTF-8", darwin: "en_US.UTF-8", freebsd: "C.UTF-8", + haiku: "C.UTF-8", linux: "C.UTF-8", + netbsd: "C.UTF-8", openbsd: "C.UTF-8", sunos: "C.UTF-8", win32: ".UTF-8" }[platform]; } -function spawnParseServerWithArgs(args) { +function spawnParseServerWithArgs(args: string[]) { const server = spawn( "ruby", [path.join(__dirname, "./server.rb")].concat(args), @@ -53,7 +60,9 @@ function spawnParseServerWithArgs(args) { process.on("exit", () => { try { - process.kill(-server.pid); + if (server.pid) { + process.kill(-server.pid); + } } catch (e) { // ignore } @@ -67,10 +76,10 @@ function spawnUnixParseServer() { const tmpFile = path.join(tmpDir, `${process.pid}.sock`); spawnParseServerWithArgs(["--unix", tmpFile]); - const now = new Date(); + const now = new Date().getTime(); // Wait for server to go live. - while (!existsSync(tmpFile) && new Date() - now < 3000) { + while (!existsSync(tmpFile) && new Date().getTime() - now < 3000) { execSync("sleep 0.1"); } @@ -78,7 +87,7 @@ function spawnUnixParseServer() { } function spawnTCPParseServer() { - const port = 8912; + const port = "8912"; spawnParseServerWithArgs(["--tcp", port]); execSync("sleep 1"); @@ -88,7 +97,7 @@ function spawnTCPParseServer() { // Finds a netcat-like adapter to use for sending data to a socket. We order // these by likelihood of being found so we can avoid some shell-outs. -function findNetcatConfig(opts) { +function findNetcatConfig(opts: Plugin.Options): NetcatConfig { if (opts.rubyNetcatCommand) { const splits = opts.rubyNetcatCommand.split(" "); return { command: splits[0], args: splits.slice(1) }; @@ -119,11 +128,15 @@ function findNetcatConfig(opts) { return { command: "node", args: [require.resolve("./netcat.js")] }; } +// You can optionally return location information from the source string when +// raising an error that prettier will handle for you nicely. +type LocatedError = Error & { loc?: any }; + // Formats and sends a request to the parser server. We use netcat (or something // like it) here since Prettier requires the results of `parse` to be // synchronous and Node.js does not offer a mechanism for synchronous socket // requests. -function parseSync(parser, source, opts) { +function parseSync(parser: string, source: string, opts: Plugin.Options) { if (!netcatConfig) { netcatConfig = findNetcatConfig(opts); } @@ -131,11 +144,11 @@ function parseSync(parser, source, opts) { if (!parserArgs) { parserArgs = isWindows ? spawnTCPParseServer() : spawnUnixParseServer(); - let ping = { status: 1 }; + let ping: { status: null | number } = { status: 1 }; while (ping.status !== 0) { ping = spawnSync( netcatConfig.command, - netcatConfig.args.concat(parserArgs), + [...netcatConfig.args, ...parserArgs], { input: "ping" } ); } @@ -181,7 +194,7 @@ function parseSync(parser, source, opts) { const parsed = JSON.parse(stdout); if (parsed.error) { - const error = new Error(parsed.error); + const error: LocatedError = new Error(parsed.error); if (parsed.loc) { error.loc = parsed.loc; } @@ -192,4 +205,4 @@ function parseSync(parser, source, opts) { return parsed; } -module.exports = parseSync; +export default parseSync; diff --git a/src/plugin.js b/src/plugin.js index 8ccfa233..4704f3e6 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -12,7 +12,6 @@ const hamlParser = require("./haml/parser"); * https://github.com/github/linguist/blob/master/lib/linguist/languages.yml * https://github.com/rubocop/rubocop/blob/master/spec/rubocop/target_finder_spec.rb */ - module.exports = { languages: [ { diff --git a/src/rbs/parser.ts b/src/rbs/parser.ts index c6c4738e..26127510 100644 --- a/src/rbs/parser.ts +++ b/src/rbs/parser.ts @@ -1,5 +1,5 @@ -import parseSync from "../parser/parseSync"; import { Plugin, RBS } from "../types"; +import parseSync from "../parser/parseSync"; const parser: Plugin.Parser = { // This function is responsible for taking an input string of text and returning @@ -29,4 +29,4 @@ const parser: Plugin.Parser = { } }; -module.exports = parser; +export default parser; diff --git a/src/ruby/parser.ts b/src/ruby/parser.ts index 30cf89c1..ef657628 100644 --- a/src/ruby/parser.ts +++ b/src/ruby/parser.ts @@ -29,4 +29,4 @@ const parser: Plugin.Parser = { } }; -module.exports = parser; +export default parser; diff --git a/src/ruby/printer.ts b/src/ruby/printer.ts index 9a4e08c0..c872bb6a 100644 --- a/src/ruby/printer.ts +++ b/src/ruby/printer.ts @@ -137,4 +137,4 @@ const printer: Plugin.PrinterConfig = { } }; -module.exports = printer; +export default printer; diff --git a/src/types.ts b/src/types.ts index 069e0924..26617c50 100644 --- a/src/types.ts +++ b/src/types.ts @@ -2,9 +2,6 @@ import type * as Prettier from "prettier"; // This namespace contains everything to do with the Ruby prettier plugin. export namespace Plugin { - // We're doing weird things here with the types because if you pass a generic - // type to AstPath it gets overly restrictive. - export type Doc = Prettier.doc.builders.Doc; export type Embed = Required>["embed"]; @@ -19,7 +16,9 @@ export namespace Plugin { rubyToProc: boolean }; - export type Parser = Prettier.Parser; + export type Parser = Omit, "parse"> & { + parse: (text: string, parsers: { [name: string]: Prettier.Parser }, options: Options) => any + }; // We're overwriting call and map here because if you restrict the AST for the // main path then presumably you're printing a lower node in the tree that From a343a9dbc14f1e20f0fd515f94c9f0b0cb3e648b Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Sep 2021 15:47:30 -0400 Subject: [PATCH 233/785] Fix up tests now that exports have changed --- src/plugin.js | 12 ++++++------ src/rbs/parser.ts | 2 +- test/js/haml/parser.test.js | 2 +- test/js/rbs/parser.test.js | 2 +- test/js/ruby/errors.test.js | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/plugin.js b/src/plugin.js index 4704f3e6..b2fa3644 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -1,11 +1,11 @@ -const rubyPrinter = require("./ruby/printer"); -const rubyParser = require("./ruby/parser"); +const rubyPrinter = require("./ruby/printer").default; +const rubyParser = require("./ruby/parser").default; -const rbsPrinter = require("./rbs/printer"); -const rbsParser = require("./rbs/parser"); +const rbsPrinter = require("./rbs/printer").default; +const rbsParser = require("./rbs/parser").default; -const hamlPrinter = require("./haml/printer"); -const hamlParser = require("./haml/parser"); +const hamlPrinter = require("./haml/printer").default; +const hamlParser = require("./haml/parser").default; /* * metadata mostly pulled from linguist and rubocop: diff --git a/src/rbs/parser.ts b/src/rbs/parser.ts index 26127510..525b97e1 100644 --- a/src/rbs/parser.ts +++ b/src/rbs/parser.ts @@ -1,4 +1,4 @@ -import { Plugin, RBS } from "../types"; +import type { Plugin, RBS } from "../types"; import parseSync from "../parser/parseSync"; const parser: Plugin.Parser = { diff --git a/test/js/haml/parser.test.js b/test/js/haml/parser.test.js index a177873f..0c3d90c3 100644 --- a/test/js/haml/parser.test.js +++ b/test/js/haml/parser.test.js @@ -3,7 +3,7 @@ const { hasPragma, locStart, locEnd -} = require("../../../src/haml/parser"); +} = require("../../../src/haml/parser").default; describe("parser", () => { test("parse", () => { diff --git a/test/js/rbs/parser.test.js b/test/js/rbs/parser.test.js index 06e4fe35..4ab6b3a5 100644 --- a/test/js/rbs/parser.test.js +++ b/test/js/rbs/parser.test.js @@ -4,7 +4,7 @@ const { hasPragma, locStart, locEnd -} = require("../../../src/rbs/parser"); +} = require("../../../src/rbs/parser").default; describe("parser", () => { test("parse", () => { diff --git a/test/js/ruby/errors.test.js b/test/js/ruby/errors.test.js index fd831836..9a7dfd58 100644 --- a/test/js/ruby/errors.test.js +++ b/test/js/ruby/errors.test.js @@ -1,5 +1,5 @@ const prettier = require("prettier"); -const { print } = require("../../../src/ruby/printer"); +const { print } = require("../../../src/ruby/printer").default; describe("errors", () => { const cases = [ From 7ba86e0ad9f4e3f6acbfd08b7686854bc8d5b866 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Sep 2021 16:32:18 -0400 Subject: [PATCH 234/785] Convert over the test cases --- package.json | 8 ++-- src/types.ts | 2 +- test/js/{files.test.js => files.test.ts} | 9 ++-- test/js/{globalSetup.js => globalSetup.ts} | 8 ++-- .../{globalTeardown.js => globalTeardown.ts} | 4 +- .../haml/{comment.test.js => comment.test.ts} | 2 +- .../haml/{doctype.test.js => doctype.test.ts} | 2 +- .../haml/{filter.test.js => filter.test.ts} | 2 +- ...amlComment.test.js => hamlComment.test.ts} | 2 +- test/js/haml/parser.test.js | 32 -------------- test/js/haml/parser.test.ts | 28 ++++++++++++ test/js/haml/{plain.test.js => plain.test.ts} | 2 +- .../haml/{script.test.js => script.test.ts} | 2 +- ...entScript.test.js => silentScript.test.ts} | 2 +- test/js/haml/{tag.test.js => tag.test.ts} | 4 +- test/js/rbs/parser.test.js | 43 ------------------- test/js/rbs/parser.test.ts | 39 +++++++++++++++++ test/js/rbs/{rbs.test.js => rbs.test.ts} | 12 +++--- .../{comments.test.js => comments.test.ts} | 2 +- test/js/ruby/{embed.test.js => embed.test.ts} | 2 +- .../{encoding.test.js => encoding.test.ts} | 0 .../ruby/{errors.test.js => errors.test.ts} | 7 +-- test/js/ruby/hasPragma.test.js | 15 ------- test/js/ruby/hasPragma.test.ts | 15 +++++++ .../ruby/{ignore.test.js => ignore.test.ts} | 2 +- .../ruby/{layout.test.js => layout.test.ts} | 2 +- test/js/ruby/locations.test.js | 10 ----- test/js/ruby/locations.test.ts | 10 +++++ .../nodes/{alias.test.js => alias.test.ts} | 2 +- .../ruby/nodes/{aref.test.js => aref.test.ts} | 2 +- .../nodes/{arrays.test.js => arrays.test.ts} | 2 +- .../nodes/{assign.test.js => assign.test.ts} | 2 +- .../nodes/{binary.test.js => binary.test.ts} | 2 +- .../nodes/{blocks.test.js => blocks.test.ts} | 2 +- .../nodes/{break.test.js => break.test.ts} | 2 +- .../nodes/{calls.test.js => calls.test.ts} | 2 +- .../ruby/nodes/{case.test.js => case.test.ts} | 2 +- .../nodes/{class.test.js => class.test.ts} | 2 +- ...ditionals.test.js => conditionals.test.ts} | 8 ++-- .../{defined.test.js => defined.test.ts} | 2 +- .../nodes/{embdoc.test.js => embdoc.test.ts} | 2 +- .../nodes/{field.test.js => field.test.ts} | 0 .../nodes/{hashes.test.js => hashes.test.ts} | 2 +- .../{heredocs.test.js => heredocs.test.ts} | 4 +- .../nodes/{hooks.test.js => hooks.test.ts} | 2 +- .../nodes/{kwargs.test.js => kwargs.test.ts} | 0 .../nodes/{lambda.test.js => lambda.test.ts} | 2 +- .../nodes/{loops.test.js => loops.test.ts} | 4 +- .../{massign.test.js => massign.test.ts} | 0 .../nodes/{method.test.js => method.test.ts} | 6 +-- .../ruby/nodes/{next.test.js => next.test.ts} | 2 +- .../{numbers.test.js => numbers.test.ts} | 0 .../{patterns.test.js => patterns.test.ts} | 6 +-- .../nodes/{ranges.test.js => ranges.test.ts} | 6 ++- .../nodes/{regexp.test.js => regexp.test.ts} | 2 +- .../nodes/{rescue.test.js => rescue.test.ts} | 2 +- .../nodes/{return.test.js => return.test.ts} | 2 +- .../{strings.test.js => strings.test.ts} | 2 +- .../nodes/{super.test.js => super.test.ts} | 2 +- .../nodes/{unary.test.js => unary.test.ts} | 0 .../nodes/{undef.test.js => undef.test.ts} | 2 +- .../nodes/{yield.test.js => yield.test.ts} | 0 .../ruby/{toProc.test.js => toProc.test.ts} | 2 +- test/js/{setupTests.js => setupTests.ts} | 38 ++++++++++------ test/js/types.ts | 1 + test/js/utils.js | 28 ------------ test/js/utils.ts | 41 ++++++++++++++++++ tsconfig.build.json | 4 ++ tsconfig.json | 6 +-- 69 files changed, 245 insertions(+), 221 deletions(-) rename test/js/{files.test.js => files.test.ts} (59%) rename test/js/{globalSetup.js => globalSetup.ts} (83%) rename test/js/{globalTeardown.js => globalTeardown.ts} (66%) rename test/js/haml/{comment.test.js => comment.test.ts} (94%) rename test/js/haml/{doctype.test.js => doctype.test.ts} (94%) rename test/js/haml/{filter.test.js => filter.test.ts} (97%) rename test/js/haml/{hamlComment.test.js => hamlComment.test.ts} (92%) delete mode 100644 test/js/haml/parser.test.js create mode 100644 test/js/haml/parser.test.ts rename test/js/haml/{plain.test.js => plain.test.ts} (90%) rename test/js/haml/{script.test.js => script.test.ts} (95%) rename test/js/haml/{silentScript.test.js => silentScript.test.ts} (96%) rename test/js/haml/{tag.test.js => tag.test.ts} (97%) delete mode 100644 test/js/rbs/parser.test.js create mode 100644 test/js/rbs/parser.test.ts rename test/js/rbs/{rbs.test.js => rbs.test.ts} (95%) rename test/js/ruby/{comments.test.js => comments.test.ts} (99%) rename test/js/ruby/{embed.test.js => embed.test.ts} (97%) rename test/js/ruby/{encoding.test.js => encoding.test.ts} (100%) rename test/js/ruby/{errors.test.js => errors.test.ts} (72%) delete mode 100644 test/js/ruby/hasPragma.test.js create mode 100644 test/js/ruby/hasPragma.test.ts rename test/js/ruby/{ignore.test.js => ignore.test.ts} (85%) rename test/js/ruby/{layout.test.js => layout.test.ts} (95%) delete mode 100644 test/js/ruby/locations.test.js create mode 100644 test/js/ruby/locations.test.ts rename test/js/ruby/nodes/{alias.test.js => alias.test.ts} (96%) rename test/js/ruby/nodes/{aref.test.js => aref.test.ts} (93%) rename test/js/ruby/nodes/{arrays.test.js => arrays.test.ts} (98%) rename test/js/ruby/nodes/{assign.test.js => assign.test.ts} (97%) rename test/js/ruby/nodes/{binary.test.js => binary.test.ts} (93%) rename test/js/ruby/nodes/{blocks.test.js => blocks.test.ts} (98%) rename test/js/ruby/nodes/{break.test.js => break.test.ts} (94%) rename test/js/ruby/nodes/{calls.test.js => calls.test.ts} (98%) rename test/js/ruby/nodes/{case.test.js => case.test.ts} (97%) rename test/js/ruby/nodes/{class.test.js => class.test.ts} (98%) rename test/js/ruby/nodes/{conditionals.test.js => conditionals.test.ts} (98%) rename test/js/ruby/nodes/{defined.test.js => defined.test.ts} (94%) rename test/js/ruby/nodes/{embdoc.test.js => embdoc.test.ts} (94%) rename test/js/ruby/nodes/{field.test.js => field.test.ts} (100%) rename test/js/ruby/nodes/{hashes.test.js => hashes.test.ts} (99%) rename test/js/ruby/nodes/{heredocs.test.js => heredocs.test.ts} (99%) rename test/js/ruby/nodes/{hooks.test.js => hooks.test.ts} (94%) rename test/js/ruby/nodes/{kwargs.test.js => kwargs.test.ts} (100%) rename test/js/ruby/nodes/{lambda.test.js => lambda.test.ts} (98%) rename test/js/ruby/nodes/{loops.test.js => loops.test.ts} (97%) rename test/js/ruby/nodes/{massign.test.js => massign.test.ts} (100%) rename test/js/ruby/nodes/{method.test.js => method.test.ts} (98%) rename test/js/ruby/nodes/{next.test.js => next.test.ts} (93%) rename test/js/ruby/nodes/{numbers.test.js => numbers.test.ts} (100%) rename test/js/ruby/nodes/{patterns.test.js => patterns.test.ts} (93%) rename test/js/ruby/nodes/{ranges.test.js => ranges.test.ts} (84%) rename test/js/ruby/nodes/{regexp.test.js => regexp.test.ts} (97%) rename test/js/ruby/nodes/{rescue.test.js => rescue.test.ts} (98%) rename test/js/ruby/nodes/{return.test.js => return.test.ts} (97%) rename test/js/ruby/nodes/{strings.test.js => strings.test.ts} (99%) rename test/js/ruby/nodes/{super.test.js => super.test.ts} (97%) rename test/js/ruby/nodes/{unary.test.js => unary.test.ts} (100%) rename test/js/ruby/nodes/{undef.test.js => undef.test.ts} (95%) rename test/js/ruby/nodes/{yield.test.js => yield.test.ts} (100%) rename test/js/ruby/{toProc.test.js => toProc.test.ts} (99%) rename test/js/{setupTests.js => setupTests.ts} (60%) create mode 100644 test/js/types.ts delete mode 100644 test/js/utils.js create mode 100644 test/js/utils.ts create mode 100644 tsconfig.build.json diff --git a/package.json b/package.json index 05aa9fdb..af466d81 100644 --- a/package.json +++ b/package.json @@ -55,13 +55,13 @@ } }, "jest": { - "globalSetup": "./test/js/globalSetup.js", - "globalTeardown": "./test/js/globalTeardown.js", + "globalSetup": "./test/js/globalSetup.ts", + "globalTeardown": "./test/js/globalTeardown.ts", "preset": "ts-jest", "setupFilesAfterEnv": [ - "./test/js/setupTests.js" + "./test/js/setupTests.ts" ], - "testRegex": ".test.js$" + "testRegex": ".test.ts$" }, "husky": { "hooks": { diff --git a/src/types.ts b/src/types.ts index 26617c50..b68d5490 100644 --- a/src/types.ts +++ b/src/types.ts @@ -16,7 +16,7 @@ export namespace Plugin { rubyToProc: boolean }; - export type Parser = Omit, "parse"> & { + export type Parser = Omit, "hasPragma" | "parse"> & Required, "hasPragma">> & { parse: (text: string, parsers: { [name: string]: Prettier.Parser }, options: Options) => any }; diff --git a/test/js/files.test.js b/test/js/files.test.ts similarity index 59% rename from test/js/files.test.js rename to test/js/files.test.ts index 9303884f..08107e6c 100644 --- a/test/js/files.test.js +++ b/test/js/files.test.ts @@ -1,12 +1,13 @@ -const path = require("path"); -const { getFileInfo } = require("prettier"); +import path from "path"; +import { FileInfoOptions, getFileInfo } from "prettier"; const plugin = require("../../src/plugin"); -function getInferredParser(filename) { +function getInferredParser(filename: string) { const filepath = path.join(__dirname, filename); + const fileInfoOptions = { plugins: [plugin] } as any as FileInfoOptions; - return getFileInfo(filepath, { plugins: [plugin] }).then( + return getFileInfo(filepath, fileInfoOptions).then( ({ inferredParser }) => inferredParser ); } diff --git a/test/js/globalSetup.js b/test/js/globalSetup.ts similarity index 83% rename from test/js/globalSetup.js rename to test/js/globalSetup.ts index e4de1a59..22146f77 100644 --- a/test/js/globalSetup.js +++ b/test/js/globalSetup.ts @@ -1,5 +1,5 @@ -const { spawn, spawnSync } = require("child_process"); -const os = require("os"); +import { spawn, spawnSync } from "child_process"; +import os from "os"; // Set a RUBY_VERSION environment variable because certain tests will only run // for certain versions of Ruby. @@ -21,10 +21,10 @@ function globalSetup() { process.env.PRETTIER_RUBY_HOST = parserArgs[1]; } - global.__ASYNC_PARSER__ = spawn( + (global as any).__ASYNC_PARSER__ = spawn( "ruby", ["./src/parser/server.rb"].concat(parserArgs) ); } -module.exports = globalSetup; +export default globalSetup; diff --git a/test/js/globalTeardown.js b/test/js/globalTeardown.ts similarity index 66% rename from test/js/globalTeardown.js rename to test/js/globalTeardown.ts index b5648b04..a580b073 100644 --- a/test/js/globalTeardown.js +++ b/test/js/globalTeardown.ts @@ -1,7 +1,7 @@ function globalTeardown() { // Send a SIGINT over to the async parser process so that we can be sure we've // terminated it before we finish the test suite. - global.__ASYNC_PARSER__.kill("SIGINT"); + (global as any).__ASYNC_PARSER__.kill("SIGINT"); } -module.exports = globalTeardown; +export default globalTeardown; diff --git a/test/js/haml/comment.test.js b/test/js/haml/comment.test.ts similarity index 94% rename from test/js/haml/comment.test.js rename to test/js/haml/comment.test.ts index 742fbb34..40263ba9 100644 --- a/test/js/haml/comment.test.js +++ b/test/js/haml/comment.test.ts @@ -1,4 +1,4 @@ -const { haml } = require("../utils"); +import { haml } from "../utils"; describe("comment", () => { test("single line", () => diff --git a/test/js/haml/doctype.test.js b/test/js/haml/doctype.test.ts similarity index 94% rename from test/js/haml/doctype.test.js rename to test/js/haml/doctype.test.ts index d8d67660..6f71b1e6 100644 --- a/test/js/haml/doctype.test.js +++ b/test/js/haml/doctype.test.ts @@ -1,4 +1,4 @@ -const { haml } = require("../utils"); +import { haml } from "../utils"; describe("doctype", () => { test("basic", () => expect(haml("!!! Basic")).toMatchFormat()); diff --git a/test/js/haml/filter.test.js b/test/js/haml/filter.test.ts similarity index 97% rename from test/js/haml/filter.test.js rename to test/js/haml/filter.test.ts index 6f345aa1..429a8882 100644 --- a/test/js/haml/filter.test.js +++ b/test/js/haml/filter.test.ts @@ -1,4 +1,4 @@ -const { haml } = require("../utils"); +import { haml } from "../utils"; describe("filter", () => { test("self", () => { diff --git a/test/js/haml/hamlComment.test.js b/test/js/haml/hamlComment.test.ts similarity index 92% rename from test/js/haml/hamlComment.test.js rename to test/js/haml/hamlComment.test.ts index a6c69fa4..55b4823b 100644 --- a/test/js/haml/hamlComment.test.js +++ b/test/js/haml/hamlComment.test.ts @@ -1,4 +1,4 @@ -const { haml } = require("../utils"); +import { haml } from "../utils"; describe("haml comment", () => { test("empty", () => expect(haml("-#")).toMatchFormat()); diff --git a/test/js/haml/parser.test.js b/test/js/haml/parser.test.js deleted file mode 100644 index 0c3d90c3..00000000 --- a/test/js/haml/parser.test.js +++ /dev/null @@ -1,32 +0,0 @@ -const { - parse, - hasPragma, - locStart, - locEnd -} = require("../../../src/haml/parser").default; - -describe("parser", () => { - test("parse", () => { - expect(parse("= foo", [], {}).type).toEqual("root"); - }); - - test("parse failure", () => { - expect(() => parse(`%div("invalid ": 1)`, [], {})).toThrowError(); - }); - - test("hasPragma", () => { - const withPragma = "-# @prettier"; - const withoutPragma = "-# foo"; - - expect(hasPragma(withPragma)).toBe(true); - expect(hasPragma(withoutPragma)).toBe(false); - }); - - test("locStart", () => { - expect(locStart({})).toEqual(0); - }); - - test("locEnd", () => { - expect(locEnd({})).toEqual(0); - }); -}); diff --git a/test/js/haml/parser.test.ts b/test/js/haml/parser.test.ts new file mode 100644 index 00000000..374b5bb3 --- /dev/null +++ b/test/js/haml/parser.test.ts @@ -0,0 +1,28 @@ +import type { HAML, Plugin } from "../../../src/types"; +import parser from "../../../src/haml/parser"; + +describe("parser", () => { + test("parse", () => { + expect(parser.parse("= foo", {}, {} as Plugin.Options).type).toEqual("root"); + }); + + test("parse failure", () => { + expect(() => parser.parse(`%div("invalid ": 1)`, {}, {} as Plugin.Options)).toThrowError(); + }); + + test("hasPragma", () => { + const withPragma = "-# @prettier"; + const withoutPragma = "-# foo"; + + expect(parser.hasPragma(withPragma)).toBe(true); + expect(parser.hasPragma(withoutPragma)).toBe(false); + }); + + test("locStart", () => { + expect(parser.locStart({} as HAML.AnyNode)).toEqual(0); + }); + + test("locEnd", () => { + expect(parser.locEnd({} as HAML.AnyNode)).toEqual(0); + }); +}); diff --git a/test/js/haml/plain.test.js b/test/js/haml/plain.test.ts similarity index 90% rename from test/js/haml/plain.test.js rename to test/js/haml/plain.test.ts index 4dd75614..99ba5694 100644 --- a/test/js/haml/plain.test.js +++ b/test/js/haml/plain.test.ts @@ -1,4 +1,4 @@ -const { haml } = require("../utils"); +import { haml } from "../utils"; describe("plain", () => { const specialChars = ["%", ".", "#", "/", "!", "=", "&", "~", "-", "\\", ":"]; diff --git a/test/js/haml/script.test.js b/test/js/haml/script.test.ts similarity index 95% rename from test/js/haml/script.test.js rename to test/js/haml/script.test.ts index f45a028d..c9e86b4e 100644 --- a/test/js/haml/script.test.js +++ b/test/js/haml/script.test.ts @@ -1,4 +1,4 @@ -const { haml } = require("../utils"); +import { haml } from "../utils"; describe("script", () => { test("single line", () => expect(haml('%p= "hello"')).toMatchFormat()); diff --git a/test/js/haml/silentScript.test.js b/test/js/haml/silentScript.test.ts similarity index 96% rename from test/js/haml/silentScript.test.js rename to test/js/haml/silentScript.test.ts index 437a5d16..f585a826 100644 --- a/test/js/haml/silentScript.test.js +++ b/test/js/haml/silentScript.test.ts @@ -1,4 +1,4 @@ -const { haml } = require("../utils"); +import { haml } from "../utils"; describe("silent script", () => { test("single line", () => expect(haml('- foo = "hello"')).toMatchFormat()); diff --git a/test/js/haml/tag.test.js b/test/js/haml/tag.test.ts similarity index 97% rename from test/js/haml/tag.test.js rename to test/js/haml/tag.test.ts index 00c2ff60..573ead89 100644 --- a/test/js/haml/tag.test.js +++ b/test/js/haml/tag.test.ts @@ -1,4 +1,4 @@ -const { long, haml } = require("../utils"); +import { long, haml } from "../utils"; describe("tag", () => { test("class", () => expect(haml("%p.foo")).toMatchFormat()); @@ -65,7 +65,7 @@ describe("tag", () => { test("hash label, single quote, interpolation", () => { const content = haml(`%section{title: "#{title}"}`); - return expect(content).toMatchFormat(content); + return expect(content).toMatchFormat(); }); test("hash rocket, single quote", () => { diff --git a/test/js/rbs/parser.test.js b/test/js/rbs/parser.test.js deleted file mode 100644 index 4ab6b3a5..00000000 --- a/test/js/rbs/parser.test.js +++ /dev/null @@ -1,43 +0,0 @@ -const { ruby } = require("../utils"); -const { - parse, - hasPragma, - locStart, - locEnd -} = require("../../../src/rbs/parser").default; - -describe("parser", () => { - test("parse", () => { - expect(parse("class Foo end", [], {}).declarations).toHaveLength(1); - }); - - test("parse failure", () => { - expect(() => parse("<>", [], {})).toThrowError(); - }); - - test("hasPragma", () => { - const withPragma = ruby(` - # @prettier - module Foo - end - `); - - const withoutPragma = ruby(` - module Foo - end - `); - - expect(hasPragma(withPragma)).toBe(true); - expect(hasPragma(withoutPragma)).toBe(false); - }); - - test("locStart", () => { - expect(locStart({ location: { start_pos: 5 } })).toEqual(5); - expect(locStart({ type: { location: { start_pos: 10 } } })).toEqual(10); - }); - - test("locEnd", () => { - expect(locEnd({ location: { end_pos: 5 } })).toEqual(5); - expect(locEnd({ type: { location: { end_pos: 10 } } })).toEqual(10); - }); -}); diff --git a/test/js/rbs/parser.test.ts b/test/js/rbs/parser.test.ts new file mode 100644 index 00000000..7fb9bce3 --- /dev/null +++ b/test/js/rbs/parser.test.ts @@ -0,0 +1,39 @@ +import type { Plugin, RBS } from "../../../src/types"; +import { ruby } from "../utils"; +import parser from "../../../src/rbs/parser"; + +describe("parser", () => { + test("parse", () => { + expect(parser.parse("class Foo end", {}, {} as Plugin.Options).declarations).toHaveLength(1); + }); + + test("parse failure", () => { + expect(() => parser.parse("<>", {}, {} as Plugin.Options)).toThrowError(); + }); + + test("hasPragma", () => { + const withPragma = ruby(` + # @prettier + module Foo + end + `); + + const withoutPragma = ruby(` + module Foo + end + `); + + expect(parser.hasPragma(withPragma)).toBe(true); + expect(parser.hasPragma(withoutPragma)).toBe(false); + }); + + test("locStart", () => { + expect(parser.locStart({ location: { start_pos: 5 } } as RBS.AnyNode)).toEqual(5); + expect(parser.locStart({ type: { location: { start_pos: 10 } } } as RBS.AnyNode)).toEqual(10); + }); + + test("locEnd", () => { + expect(parser.locEnd({ location: { end_pos: 5 } } as RBS.AnyNode)).toEqual(5); + expect(parser.locEnd({ type: { location: { end_pos: 10 } } } as RBS.AnyNode)).toEqual(10); + }); +}); diff --git a/test/js/rbs/rbs.test.js b/test/js/rbs/rbs.test.ts similarity index 95% rename from test/js/rbs/rbs.test.js rename to test/js/rbs/rbs.test.ts index b0280ac9..b4386498 100644 --- a/test/js/rbs/rbs.test.js +++ b/test/js/rbs/rbs.test.ts @@ -1,9 +1,9 @@ -const fs = require("fs"); -const path = require("path"); +import fs from "fs"; +import path from "path"; -const { rbs } = require("../utils"); +import { rbs } from "../utils"; -function testCases(name, transform) { +function testCases(name: string, transform: (source: string) => string) { const buffer = fs.readFileSync(path.resolve(__dirname, `${name}.txt`)); const sources = buffer.toString().slice(0, -1).split(/\r?\n/); @@ -12,13 +12,13 @@ function testCases(name, transform) { }); } -function describeCases(name, transform) { +function describeCases(name: string, transform: (source: string) => string) { describe(name, () => { testCases(name, transform); }); } -describe.skip("rbs", () => { +describe("rbs", () => { describeCases("combination", (source) => `T: ${source}`); describeCases("constant", (source) => `T: ${source}`); diff --git a/test/js/ruby/comments.test.js b/test/js/ruby/comments.test.ts similarity index 99% rename from test/js/ruby/comments.test.js rename to test/js/ruby/comments.test.ts index 2d9e1da2..4c59d76f 100644 --- a/test/js/ruby/comments.test.js +++ b/test/js/ruby/comments.test.ts @@ -1,4 +1,4 @@ -const { ruby } = require("../utils"); +import { ruby } from "../utils"; describe("comments", () => { describe("on their own line", () => { diff --git a/test/js/ruby/embed.test.js b/test/js/ruby/embed.test.ts similarity index 97% rename from test/js/ruby/embed.test.js rename to test/js/ruby/embed.test.ts index 2d9c940b..78978968 100644 --- a/test/js/ruby/embed.test.js +++ b/test/js/ruby/embed.test.ts @@ -1,4 +1,4 @@ -const { ruby } = require("../utils"); +import { ruby } from "../utils"; describe("embed", () => { test("ignores parsers it can't find", () => { diff --git a/test/js/ruby/encoding.test.js b/test/js/ruby/encoding.test.ts similarity index 100% rename from test/js/ruby/encoding.test.js rename to test/js/ruby/encoding.test.ts diff --git a/test/js/ruby/errors.test.js b/test/js/ruby/errors.test.ts similarity index 72% rename from test/js/ruby/errors.test.js rename to test/js/ruby/errors.test.ts index 9a7dfd58..bf313a51 100644 --- a/test/js/ruby/errors.test.js +++ b/test/js/ruby/errors.test.ts @@ -1,5 +1,6 @@ -const prettier = require("prettier"); -const { print } = require("../../../src/ruby/printer").default; +import type { Plugin, Ruby } from "../../../src/types"; +import prettier from "prettier"; +import printer from "../../../src/ruby/printer"; describe("errors", () => { const cases = [ @@ -24,6 +25,6 @@ describe("errors", () => { test("when encountering an unsupported node type", () => { const path = { getValue: () => ({ type: "unsupported", body: {} }) }; - expect(() => print(path)).toThrow("Unsupported"); + expect(() => (printer as any).print(path)).toThrow("Unsupported"); }); }); diff --git a/test/js/ruby/hasPragma.test.js b/test/js/ruby/hasPragma.test.js deleted file mode 100644 index 639dca29..00000000 --- a/test/js/ruby/hasPragma.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const { hasPragma } = require("../../../src/plugin").parsers.ruby; - -describe("hasPragma", () => { - test("checks for @prettier comments", () => { - expect(hasPragma("# @prettier")).toBe(true); - }); - - test("checks for @format comments", () => { - expect(hasPragma("# @format")).toBe(true); - }); - - test("does not check for anything else", () => { - expect(hasPragma("# @foobar")).toBe(false); - }); -}); diff --git a/test/js/ruby/hasPragma.test.ts b/test/js/ruby/hasPragma.test.ts new file mode 100644 index 00000000..7c4fe8fc --- /dev/null +++ b/test/js/ruby/hasPragma.test.ts @@ -0,0 +1,15 @@ +import parser from "../../../src/ruby/parser"; + +describe("hasPragma", () => { + test("checks for @prettier comments", () => { + expect(parser.hasPragma("# @prettier")).toBe(true); + }); + + test("checks for @format comments", () => { + expect(parser.hasPragma("# @format")).toBe(true); + }); + + test("does not check for anything else", () => { + expect(parser.hasPragma("# @foobar")).toBe(false); + }); +}); diff --git a/test/js/ruby/ignore.test.js b/test/js/ruby/ignore.test.ts similarity index 85% rename from test/js/ruby/ignore.test.js rename to test/js/ruby/ignore.test.ts index bd389d31..7dee033e 100644 --- a/test/js/ruby/ignore.test.js +++ b/test/js/ruby/ignore.test.ts @@ -1,4 +1,4 @@ -const { ruby } = require("../utils"); +import { ruby } from "../utils"; describe("ignore", () => { test("you can ignore code blocks", () => { diff --git a/test/js/ruby/layout.test.js b/test/js/ruby/layout.test.ts similarity index 95% rename from test/js/ruby/layout.test.js rename to test/js/ruby/layout.test.ts index b9bf4a72..fe394b96 100644 --- a/test/js/ruby/layout.test.js +++ b/test/js/ruby/layout.test.ts @@ -1,4 +1,4 @@ -const { ruby } = require("../utils"); +import { ruby } from "../utils"; describe("layout", () => { test("turns multiple blank lines into just one blank line", () => diff --git a/test/js/ruby/locations.test.js b/test/js/ruby/locations.test.js deleted file mode 100644 index fa1519d1..00000000 --- a/test/js/ruby/locations.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const { ruby } = require("../../../src/plugin").parsers; - -describe("locations", () => { - test("locStart and locEnd are defined", () => { - const { hasOwnProperty } = Object.prototype; - - expect(hasOwnProperty.call(ruby, "locStart")).toBe(true); - expect(hasOwnProperty.call(ruby, "locEnd")).toBe(true); - }); -}); diff --git a/test/js/ruby/locations.test.ts b/test/js/ruby/locations.test.ts new file mode 100644 index 00000000..c3239faa --- /dev/null +++ b/test/js/ruby/locations.test.ts @@ -0,0 +1,10 @@ +import parser from "../../../src/ruby/parser"; + +describe("locations", () => { + test("locStart and locEnd are defined", () => { + const { hasOwnProperty } = Object.prototype; + + expect(hasOwnProperty.call(parser, "locStart")).toBe(true); + expect(hasOwnProperty.call(parser, "locEnd")).toBe(true); + }); +}); diff --git a/test/js/ruby/nodes/alias.test.js b/test/js/ruby/nodes/alias.test.ts similarity index 96% rename from test/js/ruby/nodes/alias.test.js rename to test/js/ruby/nodes/alias.test.ts index 902e7e45..f44f50cc 100644 --- a/test/js/ruby/nodes/alias.test.js +++ b/test/js/ruby/nodes/alias.test.ts @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils"; describe("alias", () => { test("bare word aliases", () => expect("alias foo bar").toMatchFormat()); diff --git a/test/js/ruby/nodes/aref.test.js b/test/js/ruby/nodes/aref.test.ts similarity index 93% rename from test/js/ruby/nodes/aref.test.js rename to test/js/ruby/nodes/aref.test.ts index a191ebd0..2e9e0dc4 100644 --- a/test/js/ruby/nodes/aref.test.js +++ b/test/js/ruby/nodes/aref.test.ts @@ -1,4 +1,4 @@ -const { ruby } = require("../../utils"); +import { ruby } from "../../utils"; describe("aref", () => { test("literal reference", () => expect("array[5]").toMatchFormat()); diff --git a/test/js/ruby/nodes/arrays.test.js b/test/js/ruby/nodes/arrays.test.ts similarity index 98% rename from test/js/ruby/nodes/arrays.test.js rename to test/js/ruby/nodes/arrays.test.ts index daf171b4..7a075d30 100644 --- a/test/js/ruby/nodes/arrays.test.js +++ b/test/js/ruby/nodes/arrays.test.ts @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils"; describe("array", () => { test("empty arrays", () => expect("[]").toMatchFormat()); diff --git a/test/js/ruby/nodes/assign.test.js b/test/js/ruby/nodes/assign.test.ts similarity index 97% rename from test/js/ruby/nodes/assign.test.js rename to test/js/ruby/nodes/assign.test.ts index 0c29b326..cee8ecea 100644 --- a/test/js/ruby/nodes/assign.test.js +++ b/test/js/ruby/nodes/assign.test.ts @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils"; describe("assign", () => { describe("single assignment", () => { diff --git a/test/js/ruby/nodes/binary.test.js b/test/js/ruby/nodes/binary.test.ts similarity index 93% rename from test/js/ruby/nodes/binary.test.js rename to test/js/ruby/nodes/binary.test.ts index 97225700..6d0550a9 100644 --- a/test/js/ruby/nodes/binary.test.js +++ b/test/js/ruby/nodes/binary.test.ts @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils"; describe("binary", () => { test("single line", () => expect("foo && bar && baz").toMatchFormat()); diff --git a/test/js/ruby/nodes/blocks.test.js b/test/js/ruby/nodes/blocks.test.ts similarity index 98% rename from test/js/ruby/nodes/blocks.test.js rename to test/js/ruby/nodes/blocks.test.ts index 9a547f38..45df0af1 100644 --- a/test/js/ruby/nodes/blocks.test.js +++ b/test/js/ruby/nodes/blocks.test.ts @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils"; describe("blocks", () => { test("empty", () => expect("loop {}").toMatchFormat()); diff --git a/test/js/ruby/nodes/break.test.js b/test/js/ruby/nodes/break.test.ts similarity index 94% rename from test/js/ruby/nodes/break.test.js rename to test/js/ruby/nodes/break.test.ts index 3f82888e..e9a01af5 100644 --- a/test/js/ruby/nodes/break.test.js +++ b/test/js/ruby/nodes/break.test.ts @@ -1,4 +1,4 @@ -const { ruby } = require("../../utils"); +import { ruby } from "../../utils"; describe("break", () => { test("empty break", () => expect("break").toMatchFormat()); diff --git a/test/js/ruby/nodes/calls.test.js b/test/js/ruby/nodes/calls.test.ts similarity index 98% rename from test/js/ruby/nodes/calls.test.js rename to test/js/ruby/nodes/calls.test.ts index 040d0d35..0cc6f78a 100644 --- a/test/js/ruby/nodes/calls.test.js +++ b/test/js/ruby/nodes/calls.test.ts @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils"; describe("calls", () => { test("simple calls", () => { diff --git a/test/js/ruby/nodes/case.test.js b/test/js/ruby/nodes/case.test.ts similarity index 97% rename from test/js/ruby/nodes/case.test.js rename to test/js/ruby/nodes/case.test.ts index b0632fa6..d317a06a 100644 --- a/test/js/ruby/nodes/case.test.js +++ b/test/js/ruby/nodes/case.test.ts @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils"; describe("case", () => { test("empty case", () => { diff --git a/test/js/ruby/nodes/class.test.js b/test/js/ruby/nodes/class.test.ts similarity index 98% rename from test/js/ruby/nodes/class.test.js rename to test/js/ruby/nodes/class.test.ts index 27fdc136..eed56a97 100644 --- a/test/js/ruby/nodes/class.test.js +++ b/test/js/ruby/nodes/class.test.ts @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils"; describe("class", () => { test("basic nesting", () => { diff --git a/test/js/ruby/nodes/conditionals.test.js b/test/js/ruby/nodes/conditionals.test.ts similarity index 98% rename from test/js/ruby/nodes/conditionals.test.js rename to test/js/ruby/nodes/conditionals.test.ts index 7a4960ef..89b8fceb 100644 --- a/test/js/ruby/nodes/conditionals.test.js +++ b/test/js/ruby/nodes/conditionals.test.ts @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby, atLeastVersion } from "../../utils"; describe("conditionals", () => { describe("not operator", () => { @@ -188,7 +188,7 @@ describe("conditionals", () => { expect(`foo ${keyword} ${long} || ${long}a`).toChangeFormat( ruby(` ${keyword} ${long} || - ${Array(keyword.length).fill().join(" ")}${long}a + ${Array(keyword.length).fill("").join(" ")}${long}a foo end `) @@ -298,7 +298,7 @@ describe("conditionals", () => { expect(`foo ${keyword} ${long} || ${long}a`).toChangeFormat( ruby(` ${keyword} ${long} || - ${Array(keyword.length).fill().join(" ")}${long}a + ${Array(keyword.length).fill("").join(" ")}${long}a foo end `) @@ -731,7 +731,7 @@ describe("conditionals", () => { )); }); - if (process.env.RUBY_VERSION >= "3.0") { + if (atLeastVersion("3.0")) { test.each(["if", "unless"])("%s with pattern matching", (keyword) => { const content = ruby(` user = { role: 'admin', login: 'matz' } diff --git a/test/js/ruby/nodes/defined.test.js b/test/js/ruby/nodes/defined.test.ts similarity index 94% rename from test/js/ruby/nodes/defined.test.js rename to test/js/ruby/nodes/defined.test.ts index 447ef00e..b2289ae9 100644 --- a/test/js/ruby/nodes/defined.test.js +++ b/test/js/ruby/nodes/defined.test.ts @@ -1,4 +1,4 @@ -const { long } = require("../../utils"); +import { long } from "../../utils"; describe("defined", () => { test("no parens", () => expect("defined? a").toChangeFormat("defined?(a)")); diff --git a/test/js/ruby/nodes/embdoc.test.js b/test/js/ruby/nodes/embdoc.test.ts similarity index 94% rename from test/js/ruby/nodes/embdoc.test.js rename to test/js/ruby/nodes/embdoc.test.ts index 0a80d63e..3db230ee 100644 --- a/test/js/ruby/nodes/embdoc.test.js +++ b/test/js/ruby/nodes/embdoc.test.ts @@ -1,4 +1,4 @@ -const { ruby } = require("../../utils"); +import { ruby } from "../../utils"; describe("embdoc", () => { test("basic embdocs", () => { diff --git a/test/js/ruby/nodes/field.test.js b/test/js/ruby/nodes/field.test.ts similarity index 100% rename from test/js/ruby/nodes/field.test.js rename to test/js/ruby/nodes/field.test.ts diff --git a/test/js/ruby/nodes/hashes.test.js b/test/js/ruby/nodes/hashes.test.ts similarity index 99% rename from test/js/ruby/nodes/hashes.test.js rename to test/js/ruby/nodes/hashes.test.ts index 91bc7170..dbd71201 100644 --- a/test/js/ruby/nodes/hashes.test.js +++ b/test/js/ruby/nodes/hashes.test.ts @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils"; describe("hash", () => { test("empty", () => expect("{}").toMatchFormat()); diff --git a/test/js/ruby/nodes/heredocs.test.js b/test/js/ruby/nodes/heredocs.test.ts similarity index 99% rename from test/js/ruby/nodes/heredocs.test.js rename to test/js/ruby/nodes/heredocs.test.ts index b61b2c0c..6f969f36 100644 --- a/test/js/ruby/nodes/heredocs.test.js +++ b/test/js/ruby/nodes/heredocs.test.ts @@ -1,6 +1,6 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils"; -describe.skip("heredocs", () => { +describe("heredocs", () => { describe("straight", () => { test("basic", () => { const content = ruby(` diff --git a/test/js/ruby/nodes/hooks.test.js b/test/js/ruby/nodes/hooks.test.ts similarity index 94% rename from test/js/ruby/nodes/hooks.test.js rename to test/js/ruby/nodes/hooks.test.ts index 95c8fcac..cdc74b74 100644 --- a/test/js/ruby/nodes/hooks.test.js +++ b/test/js/ruby/nodes/hooks.test.ts @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils"; describe.each(["BEGIN", "END"])("%s hook", (hook) => { test("shortens to one line", () => diff --git a/test/js/ruby/nodes/kwargs.test.js b/test/js/ruby/nodes/kwargs.test.ts similarity index 100% rename from test/js/ruby/nodes/kwargs.test.js rename to test/js/ruby/nodes/kwargs.test.ts diff --git a/test/js/ruby/nodes/lambda.test.js b/test/js/ruby/nodes/lambda.test.ts similarity index 98% rename from test/js/ruby/nodes/lambda.test.js rename to test/js/ruby/nodes/lambda.test.ts index f86bf7e9..e354e553 100644 --- a/test/js/ruby/nodes/lambda.test.js +++ b/test/js/ruby/nodes/lambda.test.ts @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils"; describe("lambda", () => { test("plain stabby lambda literal", () => expect("-> { 1 }").toMatchFormat()); diff --git a/test/js/ruby/nodes/loops.test.js b/test/js/ruby/nodes/loops.test.ts similarity index 97% rename from test/js/ruby/nodes/loops.test.js rename to test/js/ruby/nodes/loops.test.ts index be0ef566..dcba0675 100644 --- a/test/js/ruby/nodes/loops.test.js +++ b/test/js/ruby/nodes/loops.test.ts @@ -1,11 +1,11 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils"; describe.each(["while", "until"])("%s", (keyword) => { test("aligns predicates", () => expect(`foo ${keyword} ${long} || ${long}`).toChangeFormat( ruby(` ${keyword} ${long} || - ${Array(keyword.length).fill().join(" ")}${long} + ${Array(keyword.length).fill("").join(" ")}${long} foo end `) diff --git a/test/js/ruby/nodes/massign.test.js b/test/js/ruby/nodes/massign.test.ts similarity index 100% rename from test/js/ruby/nodes/massign.test.js rename to test/js/ruby/nodes/massign.test.ts diff --git a/test/js/ruby/nodes/method.test.js b/test/js/ruby/nodes/method.test.ts similarity index 98% rename from test/js/ruby/nodes/method.test.js rename to test/js/ruby/nodes/method.test.ts index 498c4307..60b3777d 100644 --- a/test/js/ruby/nodes/method.test.js +++ b/test/js/ruby/nodes/method.test.ts @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { atLeastVersion, long, ruby } from "../../utils"; describe("method", () => { describe("definitions", () => { @@ -111,7 +111,7 @@ describe("method", () => { return expect(content).toMatchFormat(); }); - if (process.env.RUBY_VERSION >= "2.7") { + if (atLeastVersion("2.7")) { test("nokw_param", () => expect("def foo(**nil); end").toMatchFormat()); test("args_forward", () => { @@ -125,7 +125,7 @@ describe("method", () => { }); } - if (process.env.RUBY_VERSION >= "3.0") { + if (atLeastVersion("3.0")) { test("args_forward with other arguments", () => { const content = ruby(` def get(...) diff --git a/test/js/ruby/nodes/next.test.js b/test/js/ruby/nodes/next.test.ts similarity index 93% rename from test/js/ruby/nodes/next.test.js rename to test/js/ruby/nodes/next.test.ts index 549589b8..5f84e084 100644 --- a/test/js/ruby/nodes/next.test.js +++ b/test/js/ruby/nodes/next.test.ts @@ -1,4 +1,4 @@ -const { ruby } = require("../../utils"); +import { ruby } from "../../utils"; describe("next", () => { test("bare", () => expect("next").toMatchFormat()); diff --git a/test/js/ruby/nodes/numbers.test.js b/test/js/ruby/nodes/numbers.test.ts similarity index 100% rename from test/js/ruby/nodes/numbers.test.js rename to test/js/ruby/nodes/numbers.test.ts diff --git a/test/js/ruby/nodes/patterns.test.js b/test/js/ruby/nodes/patterns.test.ts similarity index 93% rename from test/js/ruby/nodes/patterns.test.js rename to test/js/ruby/nodes/patterns.test.ts index 50a3c486..99bd7799 100644 --- a/test/js/ruby/nodes/patterns.test.js +++ b/test/js/ruby/nodes/patterns.test.ts @@ -1,7 +1,7 @@ -const { ruby } = require("../../utils"); +import { atLeastVersion, atMostVersion, ruby } from "../../utils"; describe("patterns", () => { - if (process.env.RUBY_VERSION <= "2.7") { + if (atMostVersion("2.7")) { test("pattern matching does not exist before ruby 2.7", () => { // this is here because test files must contain at least one test, so for // earlier versions of ruby this is just going to chill here @@ -29,7 +29,7 @@ describe("patterns", () => { "a, b if b == a * 2" ]; - if (process.env.RUBY_VERSION >= "3.0") { + if (atLeastVersion("3.0")) { cases.push("[*, 0, *]", "[*, 0, 1, 2, *]", "FooBar[*, 0, *]"); test("rassign", () => { diff --git a/test/js/ruby/nodes/ranges.test.js b/test/js/ruby/nodes/ranges.test.ts similarity index 84% rename from test/js/ruby/nodes/ranges.test.js rename to test/js/ruby/nodes/ranges.test.ts index a6c429b6..7df14f92 100644 --- a/test/js/ruby/nodes/ranges.test.js +++ b/test/js/ruby/nodes/ranges.test.ts @@ -1,3 +1,5 @@ +import { atLeastVersion } from "../../utils"; + describe("ranges", () => { test("two dot", () => expect("1..2").toMatchFormat()); @@ -7,13 +9,13 @@ describe("ranges", () => { test("negative three dot", () => expect("-4...-3").toMatchFormat()); - if (process.env.RUBY_VERSION >= "2.6") { + if (atLeastVersion("2.6")) { test("two dot with no ending", () => expect("1..").toMatchFormat()); test("three dot with no ending", () => expect("1...").toMatchFormat()); } - if (process.env.RUBY_VERSION >= "2.7") { + if (atLeastVersion("2.7")) { test("two dot with no beginning", () => expect("..2").toMatchFormat()); test("three dot with no beginning", () => expect("...2").toMatchFormat()); diff --git a/test/js/ruby/nodes/regexp.test.js b/test/js/ruby/nodes/regexp.test.ts similarity index 97% rename from test/js/ruby/nodes/regexp.test.js rename to test/js/ruby/nodes/regexp.test.ts index ddc10ce9..7220a0bf 100644 --- a/test/js/ruby/nodes/regexp.test.js +++ b/test/js/ruby/nodes/regexp.test.ts @@ -1,4 +1,4 @@ -const { ruby } = require("../../utils"); +import { ruby } from "../../utils"; describe("regexp", () => { test("basic", () => expect("/abc/").toMatchFormat()); diff --git a/test/js/ruby/nodes/rescue.test.js b/test/js/ruby/nodes/rescue.test.ts similarity index 98% rename from test/js/ruby/nodes/rescue.test.js rename to test/js/ruby/nodes/rescue.test.ts index 4fc4dcac..ffbff7f7 100644 --- a/test/js/ruby/nodes/rescue.test.js +++ b/test/js/ruby/nodes/rescue.test.ts @@ -1,4 +1,4 @@ -const { ruby } = require("../../utils"); +import { ruby } from "../../utils"; describe("rescue", () => { test("inline", () => { diff --git a/test/js/ruby/nodes/return.test.js b/test/js/ruby/nodes/return.test.ts similarity index 97% rename from test/js/ruby/nodes/return.test.js rename to test/js/ruby/nodes/return.test.ts index 8a63339b..09f1b25d 100644 --- a/test/js/ruby/nodes/return.test.js +++ b/test/js/ruby/nodes/return.test.ts @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils"; describe("return", () => { test("bare", () => expect("return").toMatchFormat()); diff --git a/test/js/ruby/nodes/strings.test.js b/test/js/ruby/nodes/strings.test.ts similarity index 99% rename from test/js/ruby/nodes/strings.test.js rename to test/js/ruby/nodes/strings.test.ts index f15d92be..47a12f0d 100644 --- a/test/js/ruby/nodes/strings.test.js +++ b/test/js/ruby/nodes/strings.test.ts @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils"; describe("strings", () => { describe("%-literals with escape sequences in the middle", () => { diff --git a/test/js/ruby/nodes/super.test.js b/test/js/ruby/nodes/super.test.ts similarity index 97% rename from test/js/ruby/nodes/super.test.js rename to test/js/ruby/nodes/super.test.ts index e2d9c672..fea3404e 100644 --- a/test/js/ruby/nodes/super.test.js +++ b/test/js/ruby/nodes/super.test.ts @@ -1,4 +1,4 @@ -const { ruby } = require("../../utils"); +import { ruby } from "../../utils"; describe("super", () => { test("bare", () => expect("super").toMatchFormat()); diff --git a/test/js/ruby/nodes/unary.test.js b/test/js/ruby/nodes/unary.test.ts similarity index 100% rename from test/js/ruby/nodes/unary.test.js rename to test/js/ruby/nodes/unary.test.ts diff --git a/test/js/ruby/nodes/undef.test.js b/test/js/ruby/nodes/undef.test.ts similarity index 95% rename from test/js/ruby/nodes/undef.test.js rename to test/js/ruby/nodes/undef.test.ts index 9cf10963..36d5e390 100644 --- a/test/js/ruby/nodes/undef.test.js +++ b/test/js/ruby/nodes/undef.test.ts @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils"; describe("undef", () => { test("single inline", () => expect("undef foo").toMatchFormat()); diff --git a/test/js/ruby/nodes/yield.test.js b/test/js/ruby/nodes/yield.test.ts similarity index 100% rename from test/js/ruby/nodes/yield.test.js rename to test/js/ruby/nodes/yield.test.ts diff --git a/test/js/ruby/toProc.test.js b/test/js/ruby/toProc.test.ts similarity index 99% rename from test/js/ruby/toProc.test.js rename to test/js/ruby/toProc.test.ts index 0d7b4bd5..7e073aee 100644 --- a/test/js/ruby/toProc.test.js +++ b/test/js/ruby/toProc.test.ts @@ -1,4 +1,4 @@ -const { ruby } = require("../utils"); +import { ruby } from "../utils"; describe("to_proc transform", () => { test("basic inline", () => diff --git a/test/js/setupTests.js b/test/js/setupTests.ts similarity index 60% rename from test/js/setupTests.js rename to test/js/setupTests.ts index abaa7ebb..754957fc 100644 --- a/test/js/setupTests.js +++ b/test/js/setupTests.ts @@ -1,10 +1,13 @@ -const net = require("net"); -const prettier = require("prettier"); +import net from "net"; +import prettier from "prettier"; + +import type { Plugin } from "../../src/types"; +import type { Code } from "./types"; // eslint-disable-next-line no-underscore-dangle -const { formatAST } = prettier.__debug; +const { formatAST } = (prettier as any).__debug; -function parseAsync(parser, source) { +function parseAsync(parser: string, source: string) { return new Promise((resolve, reject) => { const client = new net.Socket(); @@ -30,15 +33,15 @@ function parseAsync(parser, source) { (response.error ? reject : resolve)(response); }); - client.connect(process.env.PRETTIER_RUBY_HOST, () => { + client.connect(process.env.PRETTIER_RUBY_HOST || "", () => { client.end(`${parser}|${source}`); }); }); } -function checkFormat(before, after, config) { - const parser = before.parser || "ruby"; - const originalText = before.code || before; +function checkFormat(before: Code, after: Code, config: Partial) { + const parser = (before as any).parser || "ruby"; + const originalText = (before as any).code || before; const opts = Object.assign({ parser, plugins: ["."], originalText }, config); @@ -60,7 +63,7 @@ function checkFormat(before, after, config) { } }) .then((formatted) => ({ - pass: formatted.replace(/\r\n/g, "\n") === `${after}\n`, + pass: (formatted as string).replace(/\r\n/g, "\n") === `${after}\n`, message: () => `Expected:\n${after}\nReceived:\n${formatted}` })) .catch((error) => ({ @@ -70,10 +73,19 @@ function checkFormat(before, after, config) { } expect.extend({ - toChangeFormat(before, after, config = {}) { - return checkFormat(before, after.code || after, config); + toChangeFormat(before: Code, after: Code, config: Partial = {}) { + return checkFormat(before, (after as any).code || after, config); }, - toMatchFormat(before, config = {}) { - return checkFormat(before, before.code || before, config); + toMatchFormat(before: Code, config: Partial = {}) { + return checkFormat(before, (before as any).code || before, config); } }); + +declare global { + namespace jest { + interface Matchers { + toChangeFormat(after: Code, config?: Partial): Promise; + toMatchFormat(config?: Partial): Promise; + } + } +} diff --git a/test/js/types.ts b/test/js/types.ts new file mode 100644 index 00000000..0ae5d07d --- /dev/null +++ b/test/js/types.ts @@ -0,0 +1 @@ +export type Code = string | { code: string, parser: "rbs" } | { code: string, parser: "haml" }; diff --git a/test/js/utils.js b/test/js/utils.js deleted file mode 100644 index ebe161bf..00000000 --- a/test/js/utils.js +++ /dev/null @@ -1,28 +0,0 @@ -const long = Array(80).fill("a").join(""); - -function stripLeadingWhitespace(code) { - if (!code.includes("\n")) { - return code; - } - - const lines = code.split("\n"); - - const indent = lines[1].split("").findIndex((char) => /[^\s]/.test(char)); - const content = lines.slice(1, lines.length - 1); - - return content.map((line) => line.slice(indent)).join("\n"); -} - -function ruby(code) { - return stripLeadingWhitespace(code); -} - -function rbs(code) { - return { code: stripLeadingWhitespace(code), parser: "rbs" }; -} - -function haml(code) { - return { code: stripLeadingWhitespace(code), parser: "haml" }; -} - -module.exports = { long, ruby, rbs, haml }; diff --git a/test/js/utils.ts b/test/js/utils.ts new file mode 100644 index 00000000..bb19e0f1 --- /dev/null +++ b/test/js/utils.ts @@ -0,0 +1,41 @@ +import type { Code } from "./types"; + +export const long = Array(80).fill("a").join(""); + +function stripLeadingWhitespace(code: string) { + if (!code.includes("\n")) { + return code; + } + + const lines = code.split("\n"); + + const indent = lines[1].split("").findIndex((char) => /[^\s]/.test(char)); + const content = lines.slice(1, lines.length - 1); + + return content.map((line) => line.slice(indent)).join("\n"); +} + +export function ruby(code: string) { + return stripLeadingWhitespace(code); +} + +export function rbs(code: string): Code { + return { code: stripLeadingWhitespace(code), parser: "rbs" }; +} + +export function haml(code: string): Code { + return { code: stripLeadingWhitespace(code), parser: "haml" }; +} + +// The follow are two functions used for comparing against the provided +// RUBY_VERSION environment variable. That variable is set in globalSetup so it +// should be always available. TypeScript doesn't know that though, so we +// explicitly allow it to be undefined by coalescing with the empty string. + +export function atLeastVersion(version: string) { + return process.env.RUBY_VERSION || "" >= version; +} + +export function atMostVersion(version: string) { + return process.env.RUBY_VERSION || "" < version; +} diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 00000000..27722617 --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig.json", + "exclude": ["test"] +} diff --git a/tsconfig.json b/tsconfig.json index 9ad9f322..043f24e5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "allowJs": true, + "allowJs": false, "esModuleInterop": true, "module": "commonjs", "moduleResolution": "node", @@ -8,7 +8,5 @@ "sourceMap": false, "strict": true, "target": "es2019" - }, - "include": ["**/src/*"], - "exclude": ["**/test/*"] + } } From 9f39d6de3744fd084220a0a35c182897f4a38dfc Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Sep 2021 16:51:51 -0400 Subject: [PATCH 235/785] Convert over the bin utilities --- .gitignore | 1 + bin/doc | 14 -------------- bin/doc.ts | 15 +++++++++++++++ bin/pragma | 6 ------ bin/pragma.ts | 6 ++++++ bin/{print => print.ts} | 10 ++++++---- package.json | 3 ++- src/{plugin.js => plugin.ts} | 34 +++++++++++++++++++++------------- tsconfig.build.json | 2 +- 9 files changed, 52 insertions(+), 39 deletions(-) delete mode 100755 bin/doc create mode 100755 bin/doc.ts delete mode 100755 bin/pragma create mode 100755 bin/pragma.ts rename bin/{print => print.ts} (78%) rename src/{plugin.js => plugin.ts} (82%) diff --git a/.gitignore b/.gitignore index 1a035cd8..37e289b9 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ /test.rbs /test.haml *.gem +/dist/ # This is to better support the GitHub actions checking - since bundler changes # to being shipped by default with Ruby starting on 2.6. diff --git a/bin/doc b/bin/doc deleted file mode 100755 index 54411c6f..00000000 --- a/bin/doc +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env node - -const fs = require("fs"); -const prettier = require("prettier"); - -const code = fs.existsSync(process.argv[2]) - ? fs.readFileSync(process.argv[2], "utf-8") - : process.argv.slice(2).join(" ").replace(/\\n/g, "\n"); - -const doc = prettier.__debug.printToDoc(code, { - parser: "ruby", - plugins: ["."] -}); -console.log(prettier.__debug.formatDoc(doc)); diff --git a/bin/doc.ts b/bin/doc.ts new file mode 100755 index 00000000..89aa9955 --- /dev/null +++ b/bin/doc.ts @@ -0,0 +1,15 @@ +#!./node_modules/.bin/ts-node + +import fs from "fs"; +import prettier from "prettier"; + +import plugin from "../src/plugin"; + +const debug = (prettier as any).__debug; + +const code = fs.existsSync(process.argv[2]) + ? fs.readFileSync(process.argv[2], "utf-8") + : process.argv.slice(2).join(" ").replace(/\\n/g, "\n"); + +const doc = debug.printToDoc(code, { parser: "ruby", plugins: [plugin] }); +console.log(debug.formatDoc(doc)); diff --git a/bin/pragma b/bin/pragma deleted file mode 100755 index 08b2565a..00000000 --- a/bin/pragma +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env node - -const fs = require("fs"); -const { hasPragma } = require("../src/plugin").parsers.ruby; - -console.log(hasPragma(fs.readFileSync(process.argv[2], "utf-8"))); diff --git a/bin/pragma.ts b/bin/pragma.ts new file mode 100755 index 00000000..501cdae8 --- /dev/null +++ b/bin/pragma.ts @@ -0,0 +1,6 @@ +#!./node_modules/.bin/ts-node + +import fs from "fs"; +import parser from "../src/ruby/parser"; + +console.log(parser.hasPragma(fs.readFileSync(process.argv[2], "utf-8"))); diff --git a/bin/print b/bin/print.ts similarity index 78% rename from bin/print rename to bin/print.ts index 2889b994..eb438aa4 100755 --- a/bin/print +++ b/bin/print.ts @@ -1,7 +1,9 @@ -#!/usr/bin/env node +#!./node_modules/.bin/ts-node -const fs = require("fs"); -const prettier = require("prettier"); +import fs from "fs" +import prettier from "prettier"; + +import plugin from "../src/plugin"; let parser = "ruby"; let contentIdx = 2; @@ -24,7 +26,7 @@ if (fs.existsSync(process.argv[contentIdx])) { const { formatted } = prettier.formatWithCursor(content, { parser, - plugins: ["."], + plugins: [plugin as any as string], // hacky, but it works cursorOffset: 1 }); diff --git a/package.json b/package.json index af466d81..1461bb43 100644 --- a/package.json +++ b/package.json @@ -2,10 +2,11 @@ "name": "@prettier/plugin-ruby", "version": "1.6.1", "description": "prettier plugin for the Ruby programming language", - "main": "src/plugin.js", + "main": "dist/plugin.js", "scripts": { "check-format": "prettier --check '**/*'", "lint": "eslint --cache .", + "prepublishOnly": "tsc -p tsconfig.build.json", "test": "jest" }, "repository": { diff --git a/src/plugin.js b/src/plugin.ts similarity index 82% rename from src/plugin.js rename to src/plugin.ts index b2fa3644..4b2bf1dd 100644 --- a/src/plugin.js +++ b/src/plugin.ts @@ -1,18 +1,18 @@ -const rubyPrinter = require("./ruby/printer").default; -const rubyParser = require("./ruby/parser").default; +import rubyPrinter from "./ruby/printer"; +import rubyParser from "./ruby/parser"; -const rbsPrinter = require("./rbs/printer").default; -const rbsParser = require("./rbs/parser").default; +import rbsPrinter from "./rbs/printer"; +import rbsParser from "./rbs/parser"; -const hamlPrinter = require("./haml/printer").default; -const hamlParser = require("./haml/parser").default; +import hamlPrinter from "./haml/printer"; +import hamlParser from "./haml/parser"; /* * metadata mostly pulled from linguist and rubocop: * https://github.com/github/linguist/blob/master/lib/linguist/languages.yml * https://github.com/rubocop/rubocop/blob/master/spec/rubocop/target_finder_spec.rb */ -module.exports = { +const plugin = { languages: [ { name: "Ruby", @@ -102,41 +102,47 @@ module.exports = { category: "Ruby", default: true, description: - "When possible, favor the use of string and symbol array literals." + "When possible, favor the use of string and symbol array literals.", + since: "1.0.0" }, rubyHashLabel: { type: "boolean", category: "Ruby", default: true, description: - "When possible, uses the shortened hash key syntax, as opposed to hash rockets." + "When possible, uses the shortened hash key syntax, as opposed to hash rockets.", + since: "1.0.0" }, rubyModifier: { type: "boolean", category: "Ruby", default: true, description: - "When it fits on one line, allows if, unless, while, and until statements to use the modifier form." + "When it fits on one line, allows if, unless, while, and until statements to use the modifier form.", + since: "1.0.0" }, rubyNetcatCommand: { type: "string", category: "Ruby", description: - 'The prefix of the command to execute to communicate between the node.js process and the Ruby process. (For example, "nc -U" or "telnet -u") Normally you should not set this option.' + 'The prefix of the command to execute to communicate between the node.js process and the Ruby process. (For example, "nc -U" or "telnet -u") Normally you should not set this option.', + since: "1.4.0" }, rubySingleQuote: { type: "boolean", category: "Ruby", default: true, description: - "When double quotes are not necessary for interpolation, prefers the use of single quotes for string literals." + "When double quotes are not necessary for interpolation, prefers the use of single quotes for string literals.", + since: "1.0.0" }, rubyToProc: { type: "boolean", category: "Ruby", default: false, description: - "When possible, convert blocks to the more concise Symbol#to_proc syntax." + "When possible, convert blocks to the more concise Symbol#to_proc syntax.", + since: "1.0.0" } }, defaultOptions: { @@ -145,3 +151,5 @@ module.exports = { trailingComma: "none" } }; + +export = plugin; diff --git a/tsconfig.build.json b/tsconfig.build.json index 27722617..f4f4548c 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -1,4 +1,4 @@ { "extends": "./tsconfig.json", - "exclude": ["test"] + "exclude": ["bin", "test"] } From 6a7145b68b34158fd2c6a5d3aaf30e0cc2b2f8aa Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Sep 2021 17:04:50 -0400 Subject: [PATCH 236/785] Fix up linter errors --- .eslintignore | 1 + package.json | 16 +++ src/parser/netcat.js | 1 + src/prettier.ts | 3 +- src/rbs/printer.ts | 2 +- src/ruby/nodes.ts | 2 +- src/ruby/nodes/conditionals.ts | 2 +- src/ruby/nodes/hashes.ts | 4 +- src/ruby/nodes/methods.ts | 2 +- src/ruby/nodes/statements.ts | 4 +- src/types.ts | 21 ++-- src/utils/literal.ts | 2 +- src/utils/printEmptyCollection.ts | 2 +- test/js/files.test.ts | 1 + test/js/rbs/rbs.test.ts | 4 +- test/js/ruby/errors.test.ts | 1 - test/js/setupTests.ts | 5 +- yarn.lock | 187 +++++++++++++++++++++++++++++- 18 files changed, 233 insertions(+), 27 deletions(-) diff --git a/.eslintignore b/.eslintignore index 7053dc17..e55c14fb 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,2 @@ /coverage/ +/dist/ diff --git a/package.json b/package.json index 1461bb43..bfe70c09 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,8 @@ "@types/jest": "^27.0.1", "@types/node": "^16.9.1", "@types/prettier": "^2.3.2", + "@typescript-eslint/eslint-plugin": "^4.31.2", + "@typescript-eslint/parser": "^4.31.2", "eslint": "^7.22.0", "eslint-config-prettier": "^8.0.0", "husky": "^7.0.0", @@ -38,6 +40,7 @@ "eslintConfig": { "extends": [ "eslint:recommended", + "plugin:@typescript-eslint/recommended", "prettier" ], "env": { @@ -45,6 +48,7 @@ "jest": true, "node": true }, + "parser": "@typescript-eslint/parser", "rules": { "no-unused-vars": [ "error", @@ -52,6 +56,18 @@ "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" } + ], + "prefer-spread": "off", + "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-namespace": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-unused-vars": [ + "error", + { + "argsIgnorePattern": "^_", + "varsIgnorePattern": "^_" + } ] } }, diff --git a/src/parser/netcat.js b/src/parser/netcat.js index c36e465a..4a6971a0 100644 --- a/src/parser/netcat.js +++ b/src/parser/netcat.js @@ -2,6 +2,7 @@ // On average, this is 2-3x slower than netcat, but still much faster than // spawning a new Ruby process. +// eslint-disable-next-line @typescript-eslint/no-var-requires const { createConnection } = require("net"); const sock = process.argv[process.argv.length - 1]; diff --git a/src/prettier.ts b/src/prettier.ts index 97cb2aa4..3c1cfe9c 100644 --- a/src/prettier.ts +++ b/src/prettier.ts @@ -4,13 +4,14 @@ type Doc = Prettier.doc.builders.Doc; type Builders = Omit & { // Explicitly overwriting the type of the join builder because I don't want to // have to go around saying "as Doc[]" everywhere. - join: (sep: Doc, docs: Doc | Doc[]) => Prettier.doc.builders.Concat + join: (_sep: Doc, _docs: Doc | Doc[]) => Prettier.doc.builders.Concat }; // If `RBPRETTIER` is set, then this is being run from the `Prettier::run` ruby // method. In that case, we need to pull `prettier` from the node_modules // directly, as it's been shipped with the gem. /* istanbul ignore next */ +// eslint-disable-next-line @typescript-eslint/no-var-requires const source: typeof Prettier = require(process.env.RBPRETTIER ? "../node_modules/prettier" : "prettier"); // Cramming everything together to make it simpler to pull in all of the right diff --git a/src/rbs/printer.ts b/src/rbs/printer.ts index 5f3c1808..69b75c21 100644 --- a/src/rbs/printer.ts +++ b/src/rbs/printer.ts @@ -507,7 +507,7 @@ const printer: Plugin.PrinterConfig = { parts.push("[", join(", ", node.type_params), "] "); } - let params = path.call(printMethodParams, "type"); + const params = path.call(printMethodParams, "type"); if (params.length > 0) { parts.push( diff --git a/src/ruby/nodes.ts b/src/ruby/nodes.ts index 7957074c..79199225 100644 --- a/src/ruby/nodes.ts +++ b/src/ruby/nodes.ts @@ -32,7 +32,7 @@ import { printChar, printDynaSymbol, printStringConcat, printStringDVar, printSt import { printSuper, printZSuper } from "./nodes/super"; import { printUndef } from "./nodes/undef"; -const nodes: Partial<{ [T in Ruby.AnyNode["type"] | "@comment"]: Plugin.Printer }> = { +const nodes: Partial<{ [_T in Ruby.AnyNode["type"] | "@comment"]: Plugin.Printer }> = { "@__end__": printEndContent, "@CHAR": printChar, "@comment": printComment, diff --git a/src/ruby/nodes/conditionals.ts b/src/ruby/nodes/conditionals.ts index 44dce4cc..6cf41150 100644 --- a/src/ruby/nodes/conditionals.ts +++ b/src/ruby/nodes/conditionals.ts @@ -96,7 +96,7 @@ export const printTernary: Plugin.Printer = (path, _opts, print) = // Prints an `if_mod` or `unless_mod` node. Because it was previously in the // modifier form, we're guaranteed to not have an additional node, so we can // just work with the predicate and the body. -function printSingle(keyword: string, modifier: boolean = false): Plugin.Printer { +function printSingle(keyword: string, modifier = false): Plugin.Printer { return function printSingleWithKeyword(path, { rubyModifier }, print) { const [_predicateNode, statementsNode] = path.getValue().body; const predicateDoc = path.call(print, "body", 0); diff --git a/src/ruby/nodes/hashes.ts b/src/ruby/nodes/hashes.ts index 78e1fa81..06f7ceca 100644 --- a/src/ruby/nodes/hashes.ts +++ b/src/ruby/nodes/hashes.ts @@ -15,7 +15,7 @@ const { line } = prettier; -type KeyPrinter = (path: Plugin.Path, print: Plugin.Print) => Plugin.Doc; +type KeyPrinter = (_path: Plugin.Path, _print: Plugin.Print) => Plugin.Doc; type HashContents = (Ruby.AssoclistFromArgs | Ruby.BareAssocHash) & { keyPrinter: KeyPrinter }; // When attempting to convert a hash rocket into a hash label, you need to take @@ -130,7 +130,7 @@ export const printHash: Plugin.Printer = (path, opts, print) => { return printEmptyCollection(path, opts, "{", "}"); } - let hashDoc = concat([ + const hashDoc = concat([ "{", indent( concat([ diff --git a/src/ruby/nodes/methods.ts b/src/ruby/nodes/methods.ts index 8545c7f7..2548fb0c 100644 --- a/src/ruby/nodes/methods.ts +++ b/src/ruby/nodes/methods.ts @@ -52,7 +52,7 @@ function printMethod(offset: number): Plugin.Printer { } export const printSingleLineMethod: Plugin.Printer = (path, opts, print) => { - let parensNode = path.getValue().body[1]; + const parensNode = path.getValue().body[1]; let paramsDoc: Plugin.Doc = ""; if (parensNode) { diff --git a/src/ruby/nodes/statements.ts b/src/ruby/nodes/statements.ts index f00a149c..3fb880ce 100644 --- a/src/ruby/nodes/statements.ts +++ b/src/ruby/nodes/statements.ts @@ -74,12 +74,12 @@ export const printParen: Plugin.Printer = (path, opts, print) => { ); }; -export const printEndContent: Plugin.Printer = (path, opts, print) => { +export const printEndContent: Plugin.Printer = (path, _opts, _print) => { const { body } = path.getValue(); return concat([trim, "__END__", literalline, body]); }; -export const printComment: Plugin.Printer = (path, opts, print) => { +export const printComment: Plugin.Printer = (path, opts, _print) => { return opts.printer.printComment(path, opts); }; diff --git a/src/types.ts b/src/types.ts index b68d5490..dd182c31 100644 --- a/src/types.ts +++ b/src/types.ts @@ -17,32 +17,32 @@ export namespace Plugin { }; export type Parser = Omit, "hasPragma" | "parse"> & Required, "hasPragma">> & { - parse: (text: string, parsers: { [name: string]: Prettier.Parser }, options: Options) => any + parse: (_text: string, _parsers: { [name: string]: Prettier.Parser }, _options: Options) => any }; // We're overwriting call and map here because if you restrict the AST for the // main path then presumably you're printing a lower node in the tree that // won't match the current AST type. export type Path = Omit, "call" | "each" | "getParentNode" | "map"> & { - call: (callback: (path: Path) => U, ...names: PropertyKey[]) => U, - each: (callback: (path: Path, index: number, value: any) => void, ...names: PropertyKey[]) => void, - getParentNode: (count?: number | undefined) => any | null, - map: (callback: (path: Path, index: number, value: any) => U, ...names: PropertyKey[]) => U[] + call: (_callback: (_path: Path) => U, ..._names: PropertyKey[]) => U, + each: (_callback: (_path: Path, _index: number, _value: any) => void, ..._names: PropertyKey[]) => void, + getParentNode: (_count?: number | undefined) => any | null, + map: (_callback: (_path: Path, _index: number, _value: any) => U, ..._names: PropertyKey[]) => U[] }; export type PrinterConfig = Omit, "print"> & { - getCommentChildNodes?: (node: any) => any[], - isBlockComment?: (comment: any, options: Plugin.Options) => boolean, + getCommentChildNodes?: (_node: any) => any[], + isBlockComment?: (_comment: any, _options: Plugin.Options) => boolean, print: Printer }; // This is the regular print node, except it's not restricted by the AST that // is passed to the parent AST. - export type Print = (path: Path) => Doc; + export type Print = (_path: Path) => Doc; // This is the regular printer, except it uses our overridden options and // print types. - export type Printer = (path: Path, options: Options, print: Print) => Doc; + export type Printer = (_path: Path, _options: Options, _print: Print) => Doc; } // This namespace contains everything to do with the types of the various nodes @@ -54,10 +54,11 @@ export namespace Ruby { type ScannerEvent = { type: `@${T}`, body: string } & Comments & Location; type ParserEvent0 = { type: T, body: string } & Comments & Location; - type ParserEvent = { type: T } & Comments & Location & V; + type ParserEvent> = { type: T } & Comments & Location & V; // This is the main expression type that goes in places where the AST will // accept just about anything. + // eslint-disable-next-line @typescript-eslint/ban-types export type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgParen | Args | ArgsAddBlock | ArgsAddStar | ArgsForward | Array | Aryptn | Assign | AssocNew | AssocSplat | AssoclistFromArgs | BEGIN | Backref | Backtick | BareAssocHash | Begin | Binary | BlockVar | Blockarg | Bodystmt | BraceBlock | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | Defsl | DoBlock | Dot2 | Dot3 | DynaSymbol | END | Else | Elsif | EndContent | Ensure | ExcessedComma | Fcall | Field | Float | FndPtn | For | GVar | Hash | Heredoc | HeredocBegin | Hshptn | IVar | Identifier | If | IfModifier | Imaginary | In | Int | Keyword | KeywordRestParam | Label | Lambda | Lbrace | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Op | Opassign | Params | Paren | Period | Program | Qsymbols | Qwords | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueEx | RescueModifier | RestParam | Retry | Return | Return0 | Sclass | Stmts | String | StringConcat | StringDVar | StringEmbExpr | StringLiteral | Super | SymbolLiteral | Symbols | TStringContent | Ternary | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VCall | VarAlias | VarField | VarRef | VoidStmt | When | While | WhileModifier | Word | Words | XStringLiteral | Yield | Yield0 | Zsuper // This is a special scanner event that contains a comment. It can be attached diff --git a/src/utils/literal.ts b/src/utils/literal.ts index 1e3016bb..845cf4cb 100644 --- a/src/utils/literal.ts +++ b/src/utils/literal.ts @@ -1,6 +1,6 @@ import { Plugin } from "../types"; -function literal(value: string): Plugin.Printer<{}> { +function literal(value: string): Plugin.Printer> { return function printLiteral() { return value; }; diff --git a/src/utils/printEmptyCollection.ts b/src/utils/printEmptyCollection.ts index 5fd1c59c..4b37468a 100644 --- a/src/utils/printEmptyCollection.ts +++ b/src/utils/printEmptyCollection.ts @@ -3,7 +3,7 @@ import prettier from "../prettier"; const { concat, group, hardline, indent, join, line } = prettier; -function containedWithin(node: Ruby.Array | Ruby.Hash): (comment: Ruby.Comment) => boolean { +function containedWithin(node: Ruby.Array | Ruby.Hash): (_comment: Ruby.Comment) => boolean { return function containedWithinNode(comment) { return comment.sc >= node.sc && comment.ec <= node.ec; }; diff --git a/test/js/files.test.ts b/test/js/files.test.ts index 08107e6c..4ecb7eca 100644 --- a/test/js/files.test.ts +++ b/test/js/files.test.ts @@ -1,6 +1,7 @@ import path from "path"; import { FileInfoOptions, getFileInfo } from "prettier"; +// eslint-disable-next-line @typescript-eslint/no-var-requires const plugin = require("../../src/plugin"); function getInferredParser(filename: string) { diff --git a/test/js/rbs/rbs.test.ts b/test/js/rbs/rbs.test.ts index b4386498..3ecc9f71 100644 --- a/test/js/rbs/rbs.test.ts +++ b/test/js/rbs/rbs.test.ts @@ -3,7 +3,7 @@ import path from "path"; import { rbs } from "../utils"; -function testCases(name: string, transform: (source: string) => string) { +function testCases(name: string, transform: (_source: string) => string) { const buffer = fs.readFileSync(path.resolve(__dirname, `${name}.txt`)); const sources = buffer.toString().slice(0, -1).split(/\r?\n/); @@ -12,7 +12,7 @@ function testCases(name: string, transform: (source: string) => string) { }); } -function describeCases(name: string, transform: (source: string) => string) { +function describeCases(name: string, transform: (_source: string) => string) { describe(name, () => { testCases(name, transform); }); diff --git a/test/js/ruby/errors.test.ts b/test/js/ruby/errors.test.ts index bf313a51..b1054e33 100644 --- a/test/js/ruby/errors.test.ts +++ b/test/js/ruby/errors.test.ts @@ -1,4 +1,3 @@ -import type { Plugin, Ruby } from "../../../src/types"; import prettier from "prettier"; import printer from "../../../src/ruby/printer"; diff --git a/test/js/setupTests.ts b/test/js/setupTests.ts index 754957fc..823431a9 100644 --- a/test/js/setupTests.ts +++ b/test/js/setupTests.ts @@ -83,9 +83,10 @@ expect.extend({ declare global { namespace jest { + // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars interface Matchers { - toChangeFormat(after: Code, config?: Partial): Promise; - toMatchFormat(config?: Partial): Promise; + toChangeFormat(_after: Code, _config?: Partial): Promise; + toMatchFormat(_config?: Partial): Promise; } } } diff --git a/yarn.lock b/yarn.lock index 4f559ac8..481795d6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -527,6 +527,27 @@ "@types/yargs" "^16.0.0" chalk "^4.0.0" +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== + dependencies: + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + +"@nodelib/fs.walk@^1.2.3": + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== + dependencies: + "@nodelib/fs.scandir" "2.1.5" + fastq "^1.6.0" + "@sinonjs/commons@^1.7.0": version "1.8.3" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" @@ -633,6 +654,11 @@ jest-diff "^27.0.0" pretty-format "^27.0.0" +"@types/json-schema@^7.0.7": + version "7.0.9" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" + integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== + "@types/minimatch@^3.0.3": version "3.0.4" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.4.tgz#f0ec25dbf2f0e4b18647313ac031134ca5b24b21" @@ -675,6 +701,75 @@ dependencies: "@types/yargs-parser" "*" +"@typescript-eslint/eslint-plugin@^4.31.2": + version "4.31.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.31.2.tgz#9f41efaee32cdab7ace94b15bd19b756dd099b0a" + integrity sha512-w63SCQ4bIwWN/+3FxzpnWrDjQRXVEGiTt9tJTRptRXeFvdZc/wLiz3FQUwNQ2CVoRGI6KUWMNUj/pk63noUfcA== + dependencies: + "@typescript-eslint/experimental-utils" "4.31.2" + "@typescript-eslint/scope-manager" "4.31.2" + debug "^4.3.1" + functional-red-black-tree "^1.0.1" + regexpp "^3.1.0" + semver "^7.3.5" + tsutils "^3.21.0" + +"@typescript-eslint/experimental-utils@4.31.2": + version "4.31.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.31.2.tgz#98727a9c1e977dd5d20c8705e69cd3c2a86553fa" + integrity sha512-3tm2T4nyA970yQ6R3JZV9l0yilE2FedYg8dcXrTar34zC9r6JB7WyBQbpIVongKPlhEMjhQ01qkwrzWy38Bk1Q== + dependencies: + "@types/json-schema" "^7.0.7" + "@typescript-eslint/scope-manager" "4.31.2" + "@typescript-eslint/types" "4.31.2" + "@typescript-eslint/typescript-estree" "4.31.2" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" + +"@typescript-eslint/parser@^4.31.2": + version "4.31.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.31.2.tgz#54aa75986e3302d91eff2bbbaa6ecfa8084e9c34" + integrity sha512-EcdO0E7M/sv23S/rLvenHkb58l3XhuSZzKf6DBvLgHqOYdL6YFMYVtreGFWirxaU2mS1GYDby3Lyxco7X5+Vjw== + dependencies: + "@typescript-eslint/scope-manager" "4.31.2" + "@typescript-eslint/types" "4.31.2" + "@typescript-eslint/typescript-estree" "4.31.2" + debug "^4.3.1" + +"@typescript-eslint/scope-manager@4.31.2": + version "4.31.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.31.2.tgz#1d528cb3ed3bcd88019c20a57c18b897b073923a" + integrity sha512-2JGwudpFoR/3Czq6mPpE8zBPYdHWFGL6lUNIGolbKQeSNv4EAiHaR5GVDQaLA0FwgcdcMtRk+SBJbFGL7+La5w== + dependencies: + "@typescript-eslint/types" "4.31.2" + "@typescript-eslint/visitor-keys" "4.31.2" + +"@typescript-eslint/types@4.31.2": + version "4.31.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.31.2.tgz#2aea7177d6d744521a168ed4668eddbd912dfadf" + integrity sha512-kWiTTBCTKEdBGrZKwFvOlGNcAsKGJSBc8xLvSjSppFO88AqGxGNYtF36EuEYG6XZ9vT0xX8RNiHbQUKglbSi1w== + +"@typescript-eslint/typescript-estree@4.31.2": + version "4.31.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.2.tgz#abfd50594d8056b37e7428df3b2d185ef2d0060c" + integrity sha512-ieBq8U9at6PvaC7/Z6oe8D3czeW5d//Fo1xkF/s9394VR0bg/UaMYPdARiWyKX+lLEjY3w/FNZJxitMsiWv+wA== + dependencies: + "@typescript-eslint/types" "4.31.2" + "@typescript-eslint/visitor-keys" "4.31.2" + debug "^4.3.1" + globby "^11.0.3" + is-glob "^4.0.1" + semver "^7.3.5" + tsutils "^3.21.0" + +"@typescript-eslint/visitor-keys@4.31.2": + version "4.31.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.2.tgz#7d5b4a4705db7fe59ecffb273c1d082760f635cc" + integrity sha512-PrBId7EQq2Nibns7dd/ch6S6/M4/iwLM9McbgeEbCXfxdwRUNxJ4UNreJ6Gh3fI2GNKNrWnQxKL7oCPmngKBug== + dependencies: + "@typescript-eslint/types" "4.31.2" + eslint-visitor-keys "^2.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" @@ -1116,6 +1211,13 @@ debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: dependencies: ms "2.1.2" +debug@^4.3.1: + version "4.3.2" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" + integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== + dependencies: + ms "2.1.2" + decimal.js@^10.2.1: version "10.2.1" resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.2.1.tgz#238ae7b0f0c793d3e3cea410108b35a2c01426a3" @@ -1156,6 +1258,13 @@ diff@^4.0.1: resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + doctrine@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" @@ -1251,6 +1360,13 @@ eslint-utils@^2.1.0: dependencies: eslint-visitor-keys "^1.1.0" +eslint-utils@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" + integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== + dependencies: + eslint-visitor-keys "^2.0.0" + eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" @@ -1402,6 +1518,17 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== +fast-glob@^3.1.1: + version "3.2.7" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1" + integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" @@ -1412,6 +1539,13 @@ fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= +fastq@^1.6.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" + integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== + dependencies: + reusify "^1.0.4" + fb-watchman@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85" @@ -1541,6 +1675,18 @@ globals@^13.6.0, globals@^13.9.0: dependencies: type-fest "^0.20.2" +globby@^11.0.3: + version "11.0.4" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" + integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.1.1" + ignore "^5.1.4" + merge2 "^1.3.0" + slash "^3.0.0" + graceful-fs@^4.2.4: version "4.2.6" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee" @@ -2328,6 +2474,11 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== +merge2@^1.3.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + micromatch@^4.0.4: version "4.0.4" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" @@ -2517,6 +2668,11 @@ path-parse@^1.0.6: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + picomatch@^2.0.4, picomatch@^2.2.3: version "2.3.0" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" @@ -2604,6 +2760,11 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== +queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + react-is@^17.0.1: version "17.0.2" resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" @@ -2649,6 +2810,11 @@ resolve@^1.20.0: is-core-module "^2.2.0" path-parse "^1.0.6" +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + rimraf@^3.0.0, rimraf@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" @@ -2656,6 +2822,13 @@ rimraf@^3.0.0, rimraf@^3.0.2: dependencies: glob "^7.1.3" +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" @@ -2673,7 +2846,7 @@ saxes@^5.0.1: dependencies: xmlchars "^2.2.0" -semver@7.x, semver@^7.2.1, semver@^7.3.2: +semver@7.x, semver@^7.2.1, semver@^7.3.2, semver@^7.3.5: version "7.3.5" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== @@ -2933,6 +3106,18 @@ ts-node@^10.2.1: make-error "^1.1.1" yn "3.1.1" +tslib@^1.8.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + +tsutils@^3.21.0: + version "3.21.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" + integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== + dependencies: + tslib "^1.8.1" + type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" From 19f7369bae515315ff873351137d8470818ccd13 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Sep 2021 17:09:36 -0400 Subject: [PATCH 237/785] Call prepublishOnly first --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e7c4d6dd..6f921efc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,7 +38,7 @@ jobs: restore-keys: ${{ runner.os }}-yarn- - run: yarn install --frozen-lockfile - name: Test - run: yarn test && bundle exec rake test + run: yarn prepublishOnly && yarn test && bundle exec rake test lint: name: Lint @@ -85,6 +85,7 @@ jobs: restore-keys: ${{ runner.os }}-yarn- - run: yarn install --frozen-lockfile - run: | + yarn prepublishOnly gem build -o prettier.gem gem unpack prettier.gem prettier/exe/rbprettier --help From 6368d44a0f50d09d124e52933b754dcc6ee86b2c Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Sep 2021 20:24:45 -0400 Subject: [PATCH 238/785] Pass the plugin explicitly --- test/js/setupTests.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/js/setupTests.ts b/test/js/setupTests.ts index 823431a9..7ef644bd 100644 --- a/test/js/setupTests.ts +++ b/test/js/setupTests.ts @@ -3,6 +3,7 @@ import prettier from "prettier"; import type { Plugin } from "../../src/types"; import type { Code } from "./types"; +import plugin from "../../src/plugin"; // eslint-disable-next-line no-underscore-dangle const { formatAST } = (prettier as any).__debug; @@ -43,7 +44,7 @@ function checkFormat(before: Code, after: Code, config: Partial) const parser = (before as any).parser || "ruby"; const originalText = (before as any).code || before; - const opts = Object.assign({ parser, plugins: ["."], originalText }, config); + const opts = Object.assign({ parser, plugins: [plugin], originalText }, config); return new Promise((resolve, reject) => { if ( From 3f0ca6c7e024ab852698fba758b2f5fa0b98f2c8 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Sep 2021 20:36:26 -0400 Subject: [PATCH 239/785] General cleanup --- .github/workflows/main.yml | 40 ++++----- .prettierignore | 6 ++ bin/print.ts | 2 +- package.json | 4 +- src/haml/printer.ts | 44 +++++++--- src/parser/parseSync.ts | 2 +- src/prettier.ts | 6 +- src/rbs/printer.ts | 106 +++++++++++++++++------- src/ruby/embed.ts | 2 +- src/ruby/nodes.ts | 129 ++++++++++++++++++++++++++---- src/ruby/nodes/alias.ts | 25 +++--- src/ruby/nodes/aref.ts | 15 ++-- src/ruby/nodes/args.ts | 40 +++++---- src/ruby/nodes/arrays.ts | 10 +-- src/ruby/nodes/assign.ts | 12 ++- src/ruby/nodes/blocks.ts | 10 ++- src/ruby/nodes/calls.ts | 47 ++++++----- src/ruby/nodes/case.ts | 35 ++++---- src/ruby/nodes/commands.ts | 33 ++++---- src/ruby/nodes/conditionals.ts | 55 ++++++++++--- src/ruby/nodes/constants.ts | 20 ++++- src/ruby/nodes/flow.ts | 11 ++- src/ruby/nodes/hashes.ts | 38 +++++---- src/ruby/nodes/heredocs.ts | 6 +- src/ruby/nodes/lambdas.ts | 5 +- src/ruby/nodes/loops.ts | 13 ++- src/ruby/nodes/massign.ts | 59 +++++++++----- src/ruby/nodes/methods.ts | 12 ++- src/ruby/nodes/params.ts | 20 ++--- src/ruby/nodes/patterns.ts | 16 ++-- src/ruby/nodes/regexp.ts | 10 ++- src/ruby/nodes/rescue.ts | 22 ++--- src/ruby/nodes/return.ts | 15 ++-- src/ruby/nodes/statements.ts | 24 +++++- src/ruby/nodes/strings.ts | 62 +++++++++++--- src/ruby/nodes/undef.ts | 15 ++-- src/ruby/printer.ts | 15 +++- src/ruby/toProc.ts | 5 +- src/utils/inlineEnsureParens.ts | 5 +- src/utils/makeCall.ts | 2 +- src/utils/printEmptyCollection.ts | 11 ++- test/js/haml/parser.test.ts | 8 +- test/js/rbs/parser.test.ts | 20 +++-- test/js/setupTests.ts | 26 ++++-- test/js/types.ts | 5 +- 45 files changed, 730 insertions(+), 338 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6f921efc..e61f1f32 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,16 +29,12 @@ jobs: - uses: actions/setup-node@v2 with: node-version: 12.x - - id: yarn-cache - run: echo "::set-output name=directory::$(yarn cache dir)" - - uses: actions/cache@v1 - with: - path: ${{ steps.yarn-cache.outputs.directory }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: ${{ runner.os }}-yarn- - - run: yarn install --frozen-lockfile + cache: yarn - name: Test - run: yarn prepublishOnly && yarn test && bundle exec rake test + run: | + yarn install --frozen-lockfile + yarn test + bundle exec rake test lint: name: Lint @@ -54,15 +50,13 @@ jobs: - uses: actions/setup-node@v2 with: node-version: 12.x - - id: yarn-cache - run: echo "::set-output name=directory::$(yarn cache dir)" - - uses: actions/cache@v1 - with: - path: ${{ steps.yarn-cache.outputs.directory }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: ${{ runner.os }}-yarn- - - run: yarn install --frozen-lockfile - - run: yarn check-format && yarn lint + cache: yarn + - name: Check format and lint + run: | + yarn install --frozen-lockfile + yarn prepublishOnly + yarn checkFormat + yarn lint gem: name: Gem @@ -76,15 +70,9 @@ jobs: - uses: actions/setup-node@v2 with: node-version: 12.x - - id: yarn-cache - run: echo "::set-output name=directory::$(yarn cache dir)" - - uses: actions/cache@v1 - with: - path: ${{ steps.yarn-cache.outputs.directory }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: ${{ runner.os }}-yarn- - - run: yarn install --frozen-lockfile + cache: yarn - run: | + yarn install --frozen-lockfile yarn prepublishOnly gem build -o prettier.gem gem unpack prettier.gem diff --git a/.prettierignore b/.prettierignore index 983e4c4a..8fa0eb9d 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,5 +1,6 @@ /.bundle/ /coverage/ +/dist/ /pkg/ /playground/ /vendor/ @@ -15,3 +16,8 @@ /test.haml *.txt +*.gem + +# I'm ignoring this for now because it's a dump of a bunch of types that I don't +# want running onto multiple lines at the moment. +/src/types.ts diff --git a/bin/print.ts b/bin/print.ts index eb438aa4..05188d8a 100755 --- a/bin/print.ts +++ b/bin/print.ts @@ -1,6 +1,6 @@ #!./node_modules/.bin/ts-node -import fs from "fs" +import fs from "fs"; import prettier from "prettier"; import plugin from "../src/plugin"; diff --git a/package.json b/package.json index bfe70c09..4b3f02bc 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,9 @@ "description": "prettier plugin for the Ruby programming language", "main": "dist/plugin.js", "scripts": { - "check-format": "prettier --check '**/*'", + "checkFormat": "prettier --check '**/*'", "lint": "eslint --cache .", - "prepublishOnly": "tsc -p tsconfig.build.json", + "prepublishOnly": "tsc -p tsconfig.build.json && cp src/parser/{netcat.js,server.rb} dist/parser && cp src/haml/parser.rb dist/haml && cp src/rbs/parser.rb dist/rbs && cp src/ruby/parser.rb dist/ruby", "test": "jest" }, "repository": { diff --git a/src/haml/printer.ts b/src/haml/printer.ts index cba2b4ee..d706ba9d 100644 --- a/src/haml/printer.ts +++ b/src/haml/printer.ts @@ -59,7 +59,11 @@ function printHashValue(value: string | number, opts: Plugin.Options) { // This will print an attributes object to a Doc node. It handles nesting on // multiple levels and will print out according to whether or not the version of // HAML being used supports multi-line attributes. -function printAttributes(object: HAML.TagAttrs, opts: Plugin.Options & { supportsMultiline: boolean, headerLength: number }, level = 0) { +function printAttributes( + object: HAML.TagAttrs, + opts: Plugin.Options & { supportsMultiline: boolean; headerLength: number }, + level = 0 +) { if (typeof object !== "object") { return printHashValue(object, opts); } @@ -111,7 +115,10 @@ function printAttributes(object: HAML.TagAttrs, opts: Plugin.Options & { support // A utility function used in a silent script that is meant to determine if a // child node is a continuation of a parent node (as in a when clause within a // case statement or an else clause within an if). -function isContinuation(parentNode: HAML.SilentScript, childNode: HAML.AnyNode) { +function isContinuation( + parentNode: HAML.SilentScript, + childNode: HAML.AnyNode +) { if (childNode.type !== "silent_script") { return false; } @@ -176,7 +183,10 @@ const printer: Plugin.PrinterConfig = { ":", node.value.name, indent( - concat([hardline, join(hardline, node.value.text.trim().split("\n"))]) + concat([ + hardline, + join(hardline, node.value.text.trim().split("\n")) + ]) ) ]) ); @@ -237,7 +247,9 @@ const printer: Plugin.PrinterConfig = { const child = childPath.getValue(); const concated = concat([hardline, print(childPath)]); - return isContinuation(node, child) ? concated : indent(concated); + return isContinuation(node, child) + ? concated + : indent(concated); }, "children") ) ); @@ -308,7 +320,9 @@ const printer: Plugin.PrinterConfig = { }, [] as Plugin.Doc[]); parts.push( - group(concat(["{", align(parts.join("").length + 1, fill(docs)), "}"])) + group( + concat(["{", align(parts.join("").length + 1, fill(docs)), "}"]) + ) ); } @@ -327,15 +341,16 @@ const printer: Plugin.PrinterConfig = { // supposed to directly use `path.stack`, but it's the easiest way to // get the root node without having to know how many levels deep we // are. - supportsMultiline: (path.stack[0] as HAML.Root).supports_multiline, + supportsMultiline: (path.stack[0] as HAML.Root) + .supports_multiline, headerLength: parts.join("").length }; parts.push( - printAttributes( - dynamic_attributes.old, - { ...opts, ...attrOptions } - ) + printAttributes(dynamic_attributes.old, { + ...opts, + ...attrOptions + }) ); } } @@ -391,7 +406,10 @@ const printer: Plugin.PrinterConfig = { // It's common to a couple of nodes to attach nested child nodes on the // children property. This utility prints them out grouped together with their // parent node docs. - function printWithChildren(node: HAML.Comment | HAML.Script | HAML.Tag, docs: Plugin.Doc) { + function printWithChildren( + node: HAML.Comment | HAML.Script | HAML.Tag, + docs: Plugin.Doc + ) { if (node.children.length === 0) { return docs; } @@ -399,7 +417,9 @@ const printer: Plugin.PrinterConfig = { return group( concat([ docs, - indent(concat([hardline, join(hardline, path.map(print, "children"))])) + indent( + concat([hardline, join(hardline, path.map(print, "children"))]) + ) ]) ); } diff --git a/src/parser/parseSync.ts b/src/parser/parseSync.ts index ab63be6d..b302e8ff 100644 --- a/src/parser/parseSync.ts +++ b/src/parser/parseSync.ts @@ -5,7 +5,7 @@ import os from "os"; import path from "path"; import process from "process"; -type NetcatConfig = { command: string, args: string[] }; +type NetcatConfig = { command: string; args: string[] }; let netcatConfig: NetcatConfig; let parserArgs: undefined | string | string[] = process.env.PRETTIER_RUBY_HOST; diff --git a/src/prettier.ts b/src/prettier.ts index 3c1cfe9c..8f153724 100644 --- a/src/prettier.ts +++ b/src/prettier.ts @@ -4,7 +4,7 @@ type Doc = Prettier.doc.builders.Doc; type Builders = Omit & { // Explicitly overwriting the type of the join builder because I don't want to // have to go around saying "as Doc[]" everywhere. - join: (_sep: Doc, _docs: Doc | Doc[]) => Prettier.doc.builders.Concat + join: (_sep: Doc, _docs: Doc | Doc[]) => Prettier.doc.builders.Concat; }; // If `RBPRETTIER` is set, then this is being run from the `Prettier::run` ruby @@ -12,7 +12,9 @@ type Builders = Omit & { // directly, as it's been shipped with the gem. /* istanbul ignore next */ // eslint-disable-next-line @typescript-eslint/no-var-requires -const source: typeof Prettier = require(process.env.RBPRETTIER ? "../node_modules/prettier" : "prettier"); +const source: typeof Prettier = require(process.env.RBPRETTIER + ? "../node_modules/prettier" + : "prettier"); // Cramming everything together to make it simpler to pull in all of the right // utilities and builders. diff --git a/src/rbs/printer.ts b/src/rbs/printer.ts index 69b75c21..a75341e0 100644 --- a/src/rbs/printer.ts +++ b/src/rbs/printer.ts @@ -2,7 +2,8 @@ import type * as Prettier from "prettier"; import type { Plugin, RBS } from "../types"; import prettier from "../prettier"; -const { concat, group, hardline, indent, makeString, join, line, softline } = prettier; +const { concat, group, hardline, indent, makeString, join, line, softline } = + prettier; // For some lists of entities in the AST, the parser returns them as an unsorted // object (presumably because Ruby hashes have implicit ordering). We do not @@ -96,7 +97,10 @@ const printer: Plugin.PrinterConfig = { const parts: Plugin.Doc[] = ["module ", printNameAndTypeParams(node)]; if (node.self_types.length > 0) { - parts.push(" : ", join(", ", path.map(printNameAndArgs, "self_types"))); + parts.push( + " : ", + join(", ", path.map(printNameAndArgs, "self_types")) + ); } parts.push(indent(printMembers()), hardline, "end"); @@ -114,7 +118,12 @@ const printer: Plugin.PrinterConfig = { // alias self.foo self.bar case "alias": { if (node.kind === "singleton") { - doc = concat(["alias self.", node.new_name, " self.", node.old_name]); + doc = concat([ + "alias self.", + node.new_name, + " self.", + node.old_name + ]); } else { doc = concat(["alias ", node.new_name, " ", node.old_name]); } @@ -156,7 +165,12 @@ const printer: Plugin.PrinterConfig = { // Prints out a class instance variable member, which looks like: // self.@foo: String case "class_instance_variable": { - doc = concat(["self.", node.name, ": ", path.call(printType, "type")]); + doc = concat([ + "self.", + node.name, + ": ", + path.call(printType, "type") + ]); break; } // Prints out a mixin, which looks like: @@ -166,11 +180,13 @@ const printer: Plugin.PrinterConfig = { case "include": case "extend": case "prepend": { - doc = group(concat([ - node.member, - " ", - printNameAndArgs(path as any as Plugin.Path) - ])); + doc = group( + concat([ + node.member, + " ", + printNameAndArgs(path as any as Plugin.Path) + ]) + ); break; } case "public": @@ -194,18 +210,21 @@ const printer: Plugin.PrinterConfig = { // using %a{}. Certain nodes can't have annotations at all. if (node.annotations && node.annotations.length > 0) { doc = concat([ - join(hardline, path.map((annotationPath: Plugin.Path) => { - const annotationNode = annotationPath.getValue(); - - // If there are already braces inside the annotation, then we're just - // going to print out the original string to avoid having to escape - // anything. - if (/[{}]/.test(annotationNode.string)) { - return getSource(annotationNode, opts); - } + join( + hardline, + path.map((annotationPath: Plugin.Path) => { + const annotationNode = annotationPath.getValue(); + + // If there are already braces inside the annotation, then we're just + // going to print out the original string to avoid having to escape + // anything. + if (/[{}]/.test(annotationNode.string)) { + return getSource(annotationNode, opts); + } - return concat(["%a{", annotationNode.string, "}"]); - }, "annotations")), + return concat(["%a{", annotationNode.string, "}"]); + }, "annotations") + ), hardline, doc ]); @@ -215,7 +234,13 @@ const printer: Plugin.PrinterConfig = { // multiple lines and then prefix it with the pound sign. if (node.comment) { doc = concat([ - join(hardline, node.comment.string.slice(0, -1).split("\n").map((segment) => `# ${segment}`)), + join( + hardline, + node.comment.string + .slice(0, -1) + .split("\n") + .map((segment) => `# ${segment}`) + ), hardline, doc ]); @@ -238,9 +263,15 @@ const printer: Plugin.PrinterConfig = { // Determine if we're allowed to change the quote based on whether or not // there is an escape sequence in the source string. - const quote = node.literal.includes("\\") ? originalQuote : preferredQuote; - - return makeString(value.slice(1, -1), quote as Prettier.util.Quote, false); + const quote = node.literal.includes("\\") + ? originalQuote + : preferredQuote; + + return makeString( + value.slice(1, -1), + quote as Prettier.util.Quote, + false + ); } // Certain nodes are names with optional arguments attached, as in Array[A]. @@ -259,7 +290,10 @@ const printer: Plugin.PrinterConfig = { // This is the big function that prints out any individual type, which can // look like all kinds of things, listed in the case statement below. - function printType(path: Plugin.Path, options?: number | { forceParens: boolean }): Plugin.Doc { + function printType( + path: Plugin.Path, + options?: number | { forceParens: boolean } + ): Plugin.Doc { const node = path.getValue(); const forceParens = typeof options === "object" && options.forceParens; @@ -318,7 +352,10 @@ const printer: Plugin.PrinterConfig = { case "class_singleton": return concat(["singleton(", node.name, ")"]); case "proc": - return concat(["^", printMethodSignature(path as Plugin.Path)]); + return concat([ + "^", + printMethodSignature(path as Plugin.Path) + ]); case "record": { const parts: Plugin.Doc[] = []; @@ -374,7 +411,10 @@ const printer: Plugin.PrinterConfig = { path.each((memberPath) => { const memberNode = memberPath.getValue(); - if (lastLine !== null && memberNode.location.start.line - lastLine >= 2) { + if ( + lastLine !== null && + memberNode.location.start.line - lastLine >= 2 + ) { docs.push(concat([hardline, hardline])); } else { docs.push(hardline); @@ -471,7 +511,9 @@ const printer: Plugin.PrinterConfig = { // rest keyword, as in (**A) if (node.rest_keywords) { - parts.push(concat(["**", path.call(printMethodParam, "rest_keywords")])); + parts.push( + concat(["**", path.call(printMethodParam, "rest_keywords")]) + ); } return parts; @@ -498,7 +540,9 @@ const printer: Plugin.PrinterConfig = { // Prints out a specific method signature, which looks like: // (T t) -> void - function printMethodSignature(path: Plugin.Path): Plugin.Doc { + function printMethodSignature( + path: Plugin.Path + ): Plugin.Doc { const node = path.getValue(); const parts = []; @@ -588,7 +632,9 @@ const printer: Plugin.PrinterConfig = { hasPrettierIgnore(path) { const node = path.getValue(); - return node.comment && node.comment.string.includes("prettier-ignore") || false; + return ( + (node.comment && node.comment.string.includes("prettier-ignore")) || false + ); }, // This function handles adding the format pragma to a source string. This is an // optional workflow for incremental adoption. diff --git a/src/ruby/embed.ts b/src/ruby/embed.ts index 9ab738ed..e547421e 100644 --- a/src/ruby/embed.ts +++ b/src/ruby/embed.ts @@ -75,7 +75,7 @@ function stripCommonLeadingWhitespace(content: string) { const embed: Plugin.Embed = (path, print, textToDoc, _opts) => { const node = path.getValue(); - + // Currently we only support embedded formatting on heredoc nodes if (node.type !== "heredoc") { return null; diff --git a/src/ruby/nodes.ts b/src/ruby/nodes.ts index 79199225..b0707ae2 100644 --- a/src/ruby/nodes.ts +++ b/src/ruby/nodes.ts @@ -2,37 +2,134 @@ import type { Plugin, Ruby } from "../types"; import { printAlias } from "./nodes/alias"; import { printAref, printArefField } from "./nodes/aref"; -import { printArgParen, printArgs, printArgsAddBlock, printArgsAddStar, printBlockArg } from "./nodes/args"; +import { + printArgParen, + printArgs, + printArgsAddBlock, + printArgsAddStar, + printBlockArg +} from "./nodes/args"; import { printArray, printWord } from "./nodes/arrays"; -import { printAssign, printOpAssign, printVarField, printVarRef } from "./nodes/assign"; +import { + printAssign, + printOpAssign, + printVarField, + printVarRef +} from "./nodes/assign"; import { printBlockVar, printBraceBlock, printDoBlock } from "./nodes/blocks"; -import { printCall, printCallContainer, printMethodAddArg, printMethodAddBlock } from "./nodes/calls"; +import { + printCall, + printCallContainer, + printMethodAddArg, + printMethodAddBlock +} from "./nodes/calls"; import { printCase, printWhen } from "./nodes/case"; import { printClass, printModule, printSClass } from "./nodes/class"; import { printCommand, printCommandCall } from "./nodes/commands"; -import { printElse, printElsif, printIf, printIfModifier, printTernary, printUnless, printUnlessModifier } from "./nodes/conditionals"; -import { printConstPath, printConstRef, printDefined, printField, printTopConst } from "./nodes/constants"; +import { + printElse, + printElsif, + printIf, + printIfModifier, + printTernary, + printUnless, + printUnlessModifier +} from "./nodes/conditionals"; +import { + printConstPath, + printConstRef, + printDefined, + printField, + printTopConst +} from "./nodes/constants"; import { printBreak, printNext, printYield, printYield0 } from "./nodes/flow"; -import { printAssocNew, printAssocSplat, printHash, printHashContents } from "./nodes/hashes"; +import { + printAssocNew, + printAssocSplat, + printHash, + printHashContents +} from "./nodes/hashes"; import { printHeredoc } from "./nodes/heredocs"; import { printBEGIN, printEND } from "./nodes/hooks"; import { printInt } from "./nodes/ints"; import { printLambda } from "./nodes/lambdas"; -import { printFor, printUntil, printUntilModifer, printWhile, printWhileModifier } from "./nodes/loops"; -import { printMAssign, printMLHS, printMLHSAddPost, printMLHSAddStar, printMLHSParen, printMRHS, printMRHSAddStar, printMRHSNewFromArgs } from "./nodes/massign"; -import { printAccessControl, printDef, printDefs, printSingleLineMethod } from "./nodes/methods"; -import { printBinary, printDot2, printDot3, printUnary } from "./nodes/operators"; -import { printArgsForward, printKeywordRestParam, printParams, printRestParam } from "./nodes/params"; -import { printAryPtn, printFndPtn, printHshPtn, printIn, printRAssign } from "./nodes/patterns"; +import { + printFor, + printUntil, + printUntilModifer, + printWhile, + printWhileModifier +} from "./nodes/loops"; +import { + printMAssign, + printMLHS, + printMLHSAddPost, + printMLHSAddStar, + printMLHSParen, + printMRHS, + printMRHSAddStar, + printMRHSNewFromArgs +} from "./nodes/massign"; +import { + printAccessControl, + printDef, + printDefs, + printSingleLineMethod +} from "./nodes/methods"; +import { + printBinary, + printDot2, + printDot3, + printUnary +} from "./nodes/operators"; +import { + printArgsForward, + printKeywordRestParam, + printParams, + printRestParam +} from "./nodes/params"; +import { + printAryPtn, + printFndPtn, + printHshPtn, + printIn, + printRAssign +} from "./nodes/patterns"; import { printRegexpLiteral } from "./nodes/regexp"; -import { printBegin, printEnsure, printRedo, printRescue, printRescueEx, printRescueMod, printRetry } from "./nodes/rescue"; +import { + printBegin, + printEnsure, + printRedo, + printRescue, + printRescueEx, + printRescueMod, + printRetry +} from "./nodes/rescue"; import { printReturn, printReturn0 } from "./nodes/return"; -import { printBodyStmt, printComment, printEndContent, printParen, printProgram, printStmts } from "./nodes/statements"; -import { printChar, printDynaSymbol, printStringConcat, printStringDVar, printStringEmbExpr, printStringLiteral, printSymbolLiteral, printXStringLiteral } from "./nodes/strings"; +import { + printBodyStmt, + printComment, + printEndContent, + printParen, + printProgram, + printStmts +} from "./nodes/statements"; +import { + printChar, + printDynaSymbol, + printStringConcat, + printStringDVar, + printStringEmbExpr, + printStringLiteral, + printSymbolLiteral, + printXStringLiteral +} from "./nodes/strings"; import { printSuper, printZSuper } from "./nodes/super"; import { printUndef } from "./nodes/undef"; -const nodes: Partial<{ [_T in Ruby.AnyNode["type"] | "@comment"]: Plugin.Printer }> = { +const nodes: Partial<{ + [_T in Ruby.AnyNode["type"] | "@comment"]: Plugin.Printer; +}> = { "@__end__": printEndContent, "@CHAR": printChar, "@comment": printComment, diff --git a/src/ruby/nodes/alias.ts b/src/ruby/nodes/alias.ts index e5c7bbfd..6ab3d776 100644 --- a/src/ruby/nodes/alias.ts +++ b/src/ruby/nodes/alias.ts @@ -1,14 +1,7 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; -const { - addTrailingComment, - align, - concat, - group, - hardline, - line -} = prettier; +const { addTrailingComment, align, concat, group, hardline, line } = prettier; // The `alias` keyword is used to make a method respond to another name as well // as the current one. For example, to get the method `foo` to also respond to @@ -29,13 +22,21 @@ const { // The `alias` node contains two children. The left and right align with the // arguments passed to the keyword. So, for the above example the left would be // the symbol literal `bar` and the right could be the symbol literal `foo`. -export const printAlias: Plugin.Printer = (path, opts, print) => { +export const printAlias: Plugin.Printer = ( + path, + opts, + print +) => { const keyword = "alias "; // In general, return the printed doc of the argument at the provided index. // Special handling is given for symbol literals that are not bare words, as // we convert those into bare words by just pulling out the ident node. - const printAliasArg = (argPath: Plugin.Path) => { + const printAliasArg = ( + argPath: Plugin.Path< + Ruby.Backref | Ruby.DynaSymbol | Ruby.GVar | Ruby.SymbolLiteral + > + ) => { const argNode = argPath.getValue(); if (argNode.type === "symbol_literal") { @@ -47,10 +48,10 @@ export const printAlias: Plugin.Printer = (path, opt addTrailingComment(argNode.body[0], comment); }); } - + return argPath.call(print, "body", 0); } - + return print(argPath); }; diff --git a/src/ruby/nodes/aref.ts b/src/ruby/nodes/aref.ts index 3020a5e6..e5bc37ee 100644 --- a/src/ruby/nodes/aref.ts +++ b/src/ruby/nodes/aref.ts @@ -1,14 +1,7 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; -const { - concat, - group, - indent, - join, - line, - softline -} = prettier; +const { concat, group, indent, join, line, softline } = prettier; // `aref` nodes are when you're pulling a value out of a collection at a // specific index. Put another way, it's any time you're calling the method @@ -46,7 +39,11 @@ export const printAref: Plugin.Printer = (path, opts, print) => { // // foo[bar] = baz // -export const printArefField: Plugin.Printer = (path, opts, print) => { +export const printArefField: Plugin.Printer = ( + path, + opts, + print +) => { const [printedArray, printedIndex] = path.map(print, "body"); return group( diff --git a/src/ruby/nodes/args.ts b/src/ruby/nodes/args.ts index 5669f8e1..11d74a73 100644 --- a/src/ruby/nodes/args.ts +++ b/src/ruby/nodes/args.ts @@ -5,15 +5,7 @@ import prettier from "../../prettier"; import { getTrailingComma } from "../../utils"; import toProc from "../toProc"; -const { - concat, - group, - ifBreak, - indent, - join, - line, - softline -} = prettier; +const { concat, group, ifBreak, indent, join, line, softline } = prettier; const noTrailingComma = ["command", "command_call"]; @@ -33,7 +25,11 @@ function getArgParenTrailingComma(node: Ruby.Args | Ruby.ArgsAddBlock) { return ifBreak(",", ""); } -export const printArgParen: Plugin.Printer = (path, opts, print) => { +export const printArgParen: Plugin.Printer = ( + path, + opts, + print +) => { const argsNode = path.getValue().body[0]; if (argsNode === null) { @@ -72,7 +68,11 @@ export const printArgParen: Plugin.Printer = (path, opts, print) ); }; -export const printArgs: Plugin.Printer = (path, { rubyToProc }, print) => { +export const printArgs: Plugin.Printer = ( + path, + { rubyToProc }, + print +) => { const args = path.map(print, "body"); // Don't bother trying to do any kind of fancy toProc transform if the @@ -111,7 +111,11 @@ export const printArgs: Plugin.Printer = (path, { rubyToProc }, print return args; }; -export const printArgsAddBlock: Plugin.Printer = (path, opts, print) => { +export const printArgsAddBlock: Plugin.Printer = ( + path, + opts, + print +) => { const node = path.getValue(); const blockNode = node.body[1]; @@ -157,7 +161,11 @@ export const printArgsAddBlock: Plugin.Printer = (path, opts, return parts; }; -export const printArgsAddStar: Plugin.Printer = (path, opts, print) => { +export const printArgsAddStar: Plugin.Printer = ( + path, + opts, + print +) => { let docs: Plugin.Doc[] = []; path.each((argPath, argIndex) => { @@ -217,6 +225,10 @@ export const printArgsAddStar: Plugin.Printer = (path, opts, p return docs; }; -export const printBlockArg: Plugin.Printer = (path, opts, print) => { +export const printBlockArg: Plugin.Printer = ( + path, + opts, + print +) => { return concat(["&", path.call(print, "body", 0)]); }; diff --git a/src/ruby/nodes/arrays.ts b/src/ruby/nodes/arrays.ts index 431e6d9a..a38ad2e8 100644 --- a/src/ruby/nodes/arrays.ts +++ b/src/ruby/nodes/arrays.ts @@ -2,15 +2,7 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; import { getTrailingComma, printEmptyCollection } from "../../utils"; -const { - concat, - group, - ifBreak, - indent, - join, - line, - softline -} = prettier; +const { concat, group, ifBreak, indent, join, line, softline } = prettier; // Checks that every argument within this args node is a string_literal node // that has no spaces or interpolations. This means we're dealing with an array diff --git a/src/ruby/nodes/assign.ts b/src/ruby/nodes/assign.ts index 90ec266d..2d7d147e 100644 --- a/src/ruby/nodes/assign.ts +++ b/src/ruby/nodes/assign.ts @@ -23,7 +23,11 @@ export const printAssign: Plugin.Printer = (path, opts, print) => { return group(concat([targetDoc, " =", indent(concat([line, rightSideDoc]))])); }; -export const printOpAssign: Plugin.Printer = (path, opts, print) => { +export const printOpAssign: Plugin.Printer = ( + path, + opts, + print +) => { return group( concat([ path.call(print, "body", 0), @@ -34,7 +38,11 @@ export const printOpAssign: Plugin.Printer = (path, opts, print) ); }; -export const printVarField: Plugin.Printer = (path, opts, print) => { +export const printVarField: Plugin.Printer = ( + path, + opts, + print +) => { return path.getValue().body ? path.call(print, "body", 0) : ""; }; diff --git a/src/ruby/nodes/blocks.ts b/src/ruby/nodes/blocks.ts index 410089e6..10cf9b62 100644 --- a/src/ruby/nodes/blocks.ts +++ b/src/ruby/nodes/blocks.ts @@ -13,7 +13,11 @@ const { softline } = prettier; -export const printBlockVar: Plugin.Printer = (path, opts, print) => { +export const printBlockVar: Plugin.Printer = ( + path, + opts, + print +) => { const parts = ["|", removeLines(path.call(print, "body", 0))]; // The second part of this node is a list of optional block-local variables @@ -25,7 +29,9 @@ export const printBlockVar: Plugin.Printer = (path, opts, print) return concat(parts); }; -function printBlock(braces: boolean): Plugin.Printer { +function printBlock( + braces: boolean +): Plugin.Printer { return function printBlockWithBraces(path, opts, print) { const [variables, statements] = path.getValue().body; const stmts = diff --git a/src/ruby/nodes/calls.ts b/src/ruby/nodes/calls.ts index d46c6947..0bf4f08e 100644 --- a/src/ruby/nodes/calls.ts +++ b/src/ruby/nodes/calls.ts @@ -3,25 +3,17 @@ import prettier from "../../prettier"; import { makeCall, noIndent } from "../../utils"; import toProc from "../toProc"; -const { - concat, - group, - hardline, - ifBreak, - indent, - join, - softline -} = prettier; +const { concat, group, hardline, ifBreak, indent, join, softline } = prettier; const chained = ["call", "method_add_arg", "method_add_block"]; // We decorate these nodes with a bunch of extra stuff so that we can display // nice method chains. type Chain = { - chain?: number, - callChain?: number, - breakDoc?: Plugin.Doc[], - firstReceiverType?: string + chain?: number; + callChain?: number; + breakDoc?: Plugin.Doc[]; + firstReceiverType?: string; }; type ChainedCall = Ruby.Call & Chain; @@ -90,11 +82,18 @@ export const printCall: Plugin.Printer = (path, opts, print) => { return group(concat([receiverDoc, group(indent(rightSideDoc))])); }; -export const printMethodAddArg: Plugin.Printer = (path, opts, print) => { +export const printMethodAddArg: Plugin.Printer = ( + path, + opts, + print +) => { const node = path.getValue(); const [methodNode, argNode] = node.body; - const [methodDoc, argsDoc] = path.map(print, "body") as [Plugin.Doc, Plugin.Doc[]]; + const [methodDoc, argsDoc] = path.map(print, "body") as [ + Plugin.Doc, + Plugin.Doc[] + ]; // You can end up here if you have a method with a ? ending, presumably // because the parser knows that it cannot be a local variable. You can also @@ -168,7 +167,11 @@ export const printMethodAddArg: Plugin.Printer = (path, opt // If we're at the top of a chain, then we're going to print out a nice // multi-line layout if this doesn't break into multiple lines. - if (!chained.includes(parentNode.type) && (node.chain || 0) >= threshold && node.breakDoc) { + if ( + !chained.includes(parentNode.type) && + (node.chain || 0) >= threshold && + node.breakDoc + ) { // This is pretty specialized behavior. Basically if we're at the top of a // chain but we've only had method calls without arguments and now we have // arguments, then we're effectively trying to call a method with arguments @@ -199,7 +202,11 @@ export const printMethodAddArg: Plugin.Printer = (path, opt return concat([methodDoc, " ", join(", ", argsDoc), " "]); }; -export const printMethodAddBlock: Plugin.Printer = (path, opts, print) => { +export const printMethodAddBlock: Plugin.Printer = ( + path, + opts, + print +) => { const node = path.getValue(); const [callNode, blockNode] = node.body; @@ -249,6 +256,10 @@ export const printMethodAddBlock: Plugin.Printer = (path, return concat([callDoc, blockDoc]); }; -export const printCallContainer: Plugin.Printer = (path, opts, print) => { +export const printCallContainer: Plugin.Printer = ( + path, + opts, + print +) => { return path.call(print, "body", 0); }; diff --git a/src/ruby/nodes/case.ts b/src/ruby/nodes/case.ts index dfab65bf..07ebf5e7 100644 --- a/src/ruby/nodes/case.ts +++ b/src/ruby/nodes/case.ts @@ -2,15 +2,7 @@ import type * as Prettier from "prettier"; import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; -const { - align, - concat, - fill, - group, - hardline, - indent, - line -} = prettier; +const { align, concat, fill, group, hardline, indent, line } = prettier; export const printCase: Plugin.Printer = (path, opts, print) => { const statement: Plugin.Doc[] = ["case"]; @@ -32,17 +24,20 @@ export const printWhen: Plugin.Printer = (path, opts, print) => { // The `fill` builder command expects an array of docs alternating with // line breaks. This is so it can loop through and determine where to break. const preds = fill( - (path.call(print, "body", 0) as Plugin.Doc[]).reduce((accum: Plugin.Doc[], pred, index) => { - if (index === 0) { - return [pred]; - } - - // Pull off the last element and make it concat with a comma so that - // we can maintain alternating lines and docs. - return accum - .slice(0, -1) - .concat([concat([accum![accum.length - 1], ","]), line, pred]); - }, [] as Plugin.Doc[]) + (path.call(print, "body", 0) as Plugin.Doc[]).reduce( + (accum: Plugin.Doc[], pred, index) => { + if (index === 0) { + return [pred]; + } + + // Pull off the last element and make it concat with a comma so that + // we can maintain alternating lines and docs. + return accum + .slice(0, -1) + .concat([concat([accum![accum.length - 1], ","]), line, pred]); + }, + [] as Plugin.Doc[] + ) ); const stmts = path.call(print, "body", 1) as Prettier.doc.builders.Concat; diff --git a/src/ruby/nodes/commands.ts b/src/ruby/nodes/commands.ts index 13ac75d6..ba107fc7 100644 --- a/src/ruby/nodes/commands.ts +++ b/src/ruby/nodes/commands.ts @@ -3,16 +3,8 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; import { makeCall } from "../../utils"; -const { - align, - concat, - group, - ifBreak, - indent, - join, - line, - softline -} = prettier; +const { align, concat, group, ifBreak, indent, join, line, softline } = + prettier; function docLength(doc: any): number { if (doc.length) { @@ -20,7 +12,10 @@ function docLength(doc: any): number { } if (doc.parts) { - return (doc as Prettier.doc.builders.Concat).parts.reduce((sum, child) => sum + docLength(child), 0); + return (doc as Prettier.doc.builders.Concat).parts.reduce( + (sum, child) => sum + docLength(child), + 0 + ); } if (doc.contents) { @@ -60,10 +55,16 @@ function skipArgsAlign(path: Plugin.Path) { // into multiple lines, then we're going to have to use parentheses around the // command in order to make sure operator precedence doesn't get messed up. function hasTernaryArg(node: Ruby.Args | Ruby.ArgsAddBlock) { - return (node.body[0] as any).body.some((child: Ruby.AnyNode) => child.type === "ifop"); + return (node.body[0] as any).body.some( + (child: Ruby.AnyNode) => child.type === "ifop" + ); } -export const printCommand: Plugin.Printer = (path, opts, print) => { +export const printCommand: Plugin.Printer = ( + path, + opts, + print +) => { const node = path.getValue(); const command = path.call(print, "body", 0); @@ -93,7 +94,11 @@ export const printCommand: Plugin.Printer = (path, opts, print) => ); }; -export const printCommandCall: Plugin.Printer = (path, opts, print) => { +export const printCommandCall: Plugin.Printer = ( + path, + opts, + print +) => { const node = path.getValue(); const parts = [ path.call(print, "body", 0), diff --git a/src/ruby/nodes/conditionals.ts b/src/ruby/nodes/conditionals.ts index 6cf41150..0379c47a 100644 --- a/src/ruby/nodes/conditionals.ts +++ b/src/ruby/nodes/conditionals.ts @@ -1,7 +1,11 @@ import type * as Prettier from "prettier"; import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; -import { containsAssignment, inlineEnsureParens, isEmptyStmts } from "../../utils"; +import { + containsAssignment, + inlineEnsureParens, + isEmptyStmts +} from "../../utils"; const { align, @@ -23,11 +27,18 @@ function isConcat(doc: any): doc is Prettier.doc.builders.Concat { function containsSingleConditional(stmts: Ruby.Stmts) { return ( stmts.body.length === 1 && - ["if", "if_mod", "ifop", "unless", "unless_mod"].includes(stmts.body[0].type) + ["if", "if_mod", "ifop", "unless", "unless_mod"].includes( + stmts.body[0].type + ) ); } -function printWithAddition(keyword: string, path: Plugin.Path, print: Plugin.Print, breaking: boolean) { +function printWithAddition( + keyword: string, + path: Plugin.Path, + print: Plugin.Print, + breaking: boolean +) { return concat([ `${keyword} `, align(keyword.length + 1, path.call(print, "body", 0)), @@ -62,7 +73,11 @@ function printTernaryClause(clause: Plugin.Doc) { // The conditions for a ternary look like `foo : bar` where `foo` represents // the truthy clause and `bar` represents the falsy clause. In the case that the // parent node is an `unless`, these have to flip in order. -function printTernaryClauses(keyword: string, truthyClause: Plugin.Doc, falsyClause: Plugin.Doc) { +function printTernaryClauses( + keyword: string, + truthyClause: Plugin.Doc, + falsyClause: Plugin.Doc +) { const parts = [ printTernaryClause(truthyClause), " : ", @@ -74,7 +89,11 @@ function printTernaryClauses(keyword: string, truthyClause: Plugin.Doc, falsyCla // Handles ternary nodes. If it does not fit on one line, then we break out into // an if/else statement. Otherwise we remain as a ternary. -export const printTernary: Plugin.Printer = (path, _opts, print) => { +export const printTernary: Plugin.Printer = ( + path, + _opts, + print +) => { const [predicate, truthyClause, falsyClause] = path.map(print, "body"); const ternaryClauses = printTernaryClauses("if", truthyClause, falsyClause); @@ -96,7 +115,12 @@ export const printTernary: Plugin.Printer = (path, _opts, print) = // Prints an `if_mod` or `unless_mod` node. Because it was previously in the // modifier form, we're guaranteed to not have an additional node, so we can // just work with the predicate and the body. -function printSingle(keyword: string, modifier = false): Plugin.Printer { +function printSingle( + keyword: string, + modifier = false +): Plugin.Printer< + Ruby.If | Ruby.IfModifier | Ruby.Unless | Ruby.UnlessModifier +> { return function printSingleWithKeyword(path, { rubyModifier }, print) { const [_predicateNode, statementsNode] = path.getValue().body; const predicateDoc = path.call(print, "body", 0); @@ -113,7 +137,10 @@ function printSingle(keyword: string, modifier = false): Plugin.Printer) { } // A normalized print function for both `if` and `unless` nodes. -function printConditional(keyword: string): Plugin.Printer { +function printConditional( + keyword: string +): Plugin.Printer { return (path, opts, print) => { if (canTernary(path)) { let ternaryParts = [path.call(print, "body", 0), " ? "].concat( @@ -225,7 +254,10 @@ function printConditional(keyword: string): Plugin.Printer = (path, opts, print) => { const [_predicate, _statements, addition] = path.getValue().body; const parts = [ group( - concat([ - "elsif ", - align("elsif".length - 1, path.call(print, "body", 0)) - ]) + concat(["elsif ", align("elsif".length - 1, path.call(print, "body", 0))]) ), indent(concat([hardline, path.call(print, "body", 1)])) ]; diff --git a/src/ruby/nodes/constants.ts b/src/ruby/nodes/constants.ts index 9ae377ea..fb556735 100644 --- a/src/ruby/nodes/constants.ts +++ b/src/ruby/nodes/constants.ts @@ -4,15 +4,25 @@ import { makeCall } from "../../utils"; const { concat, group, indent, join, softline } = prettier; -export const printConstPath: Plugin.Printer = (path, opts, print) => { +export const printConstPath: Plugin.Printer< + Ruby.ConstPathField | Ruby.ConstPathRef +> = (path, opts, print) => { return join("::", path.map(print, "body")); }; -export const printConstRef: Plugin.Printer = (path, opts, print) => { +export const printConstRef: Plugin.Printer = ( + path, + opts, + print +) => { return path.call(print, "body", 0); }; -export const printDefined: Plugin.Printer = (path, opts, print) => { +export const printDefined: Plugin.Printer = ( + path, + opts, + print +) => { return group( concat([ "defined?(", @@ -31,6 +41,8 @@ export const printField: Plugin.Printer = (path, opts, print) => { ); }; -export const printTopConst: Plugin.Printer = (path, opts, print) => { +export const printTopConst: Plugin.Printer< + Ruby.TopConstField | Ruby.TopConstRef +> = (path, opts, print) => { return concat(["::", path.call(print, "body", 0)]); }; diff --git a/src/ruby/nodes/flow.ts b/src/ruby/nodes/flow.ts index 25473d6e..d5fe7522 100644 --- a/src/ruby/nodes/flow.ts +++ b/src/ruby/nodes/flow.ts @@ -22,9 +22,14 @@ const unskippableParens = [ "while_mod" ]; -type CallArgs = [Plugin.Print, ...(PropertyKey[])]; - -function maybeHandleParens(path: Plugin.Path, print: Plugin.Print, keyword: string, steps: PropertyKey[]) { +type CallArgs = [Plugin.Print, ...PropertyKey[]]; + +function maybeHandleParens( + path: Plugin.Path, + print: Plugin.Print, + keyword: string, + steps: PropertyKey[] +) { const node = nodeDive(path.getValue(), steps); if (node.type !== "paren") { return null; diff --git a/src/ruby/nodes/hashes.ts b/src/ruby/nodes/hashes.ts index 06f7ceca..290d8bb9 100644 --- a/src/ruby/nodes/hashes.ts +++ b/src/ruby/nodes/hashes.ts @@ -6,17 +6,15 @@ import { skipAssignIndent } from "../../utils"; -const { - concat, - group, - ifBreak, - indent, - join, - line -} = prettier; - -type KeyPrinter = (_path: Plugin.Path, _print: Plugin.Print) => Plugin.Doc; -type HashContents = (Ruby.AssoclistFromArgs | Ruby.BareAssocHash) & { keyPrinter: KeyPrinter }; +const { concat, group, ifBreak, indent, join, line } = prettier; + +type KeyPrinter = ( + _path: Plugin.Path, + _print: Plugin.Print +) => Plugin.Doc; +type HashContents = (Ruby.AssoclistFromArgs | Ruby.BareAssocHash) & { + keyPrinter: KeyPrinter; +}; // When attempting to convert a hash rocket into a hash label, you need to take // care because only certain patterns are allowed. Ruby source says that they @@ -80,7 +78,11 @@ const printHashKeyRocket: KeyPrinter = (path, print) => { return concat([doc, " =>"]); }; -export const printAssocNew: Plugin.Printer = (path, opts, print) => { +export const printAssocNew: Plugin.Printer = ( + path, + opts, + print +) => { const [keyNode, valueNode] = path.getValue().body; const { keyPrinter } = path.getParentNode() as HashContents; @@ -103,11 +105,19 @@ export const printAssocNew: Plugin.Printer = (path, opts, print) return group(concat(parts)); }; -export const printAssocSplat: Plugin.Printer = (path, opts, print) => { +export const printAssocSplat: Plugin.Printer = ( + path, + opts, + print +) => { return concat(["**", path.call(print, "body", 0)]); }; -export const printHashContents: Plugin.Printer = (path, opts, print) => { +export const printHashContents: Plugin.Printer = ( + path, + opts, + print +) => { const node = path.getValue(); // First determine which key printer we're going to use, so that the child diff --git a/src/ruby/nodes/heredocs.ts b/src/ruby/nodes/heredocs.ts index 03e1273d..37054656 100644 --- a/src/ruby/nodes/heredocs.ts +++ b/src/ruby/nodes/heredocs.ts @@ -4,7 +4,11 @@ import { literallineWithoutBreakParent } from "../../utils"; const { concat, group, lineSuffix, join } = prettier; -export const printHeredoc: Plugin.Printer = (path, opts, print) => { +export const printHeredoc: Plugin.Printer = ( + path, + opts, + print +) => { const { body, ending } = path.getValue(); const parts = body.map((part, index) => { diff --git a/src/ruby/nodes/lambdas.ts b/src/ruby/nodes/lambdas.ts index 8335ceca..a728f8b2 100644 --- a/src/ruby/nodes/lambdas.ts +++ b/src/ruby/nodes/lambdas.ts @@ -8,7 +8,10 @@ const { concat, group, ifBreak, indent, line } = prettier; // or if we have them wrapped in parens then they'll be one level deeper. Even // though it's possible to omit the parens if you only have one argument, we're // going to keep them in no matter what for consistency. -function printLambdaParams(path: Plugin.Path, print: Plugin.Print) { +function printLambdaParams( + path: Plugin.Path, + print: Plugin.Print +) { let node = path.getValue().body[0]; // In this case we had something like -> (foo) { bar } which would mean that diff --git a/src/ruby/nodes/loops.ts b/src/ruby/nodes/loops.ts index 86a79e5e..f597f97b 100644 --- a/src/ruby/nodes/loops.ts +++ b/src/ruby/nodes/loops.ts @@ -1,6 +1,10 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; -import { containsAssignment, inlineEnsureParens, isEmptyStmts } from "../../utils"; +import { + containsAssignment, + inlineEnsureParens, + isEmptyStmts +} from "../../utils"; const { align, @@ -14,7 +18,12 @@ const { softline } = prettier; -function printLoop(keyword: string, modifier: boolean): Plugin.Printer { +function printLoop( + keyword: string, + modifier: boolean +): Plugin.Printer< + Ruby.While | Ruby.WhileModifier | Ruby.Until | Ruby.UntilModifier +> { return function printLoopWithOptions(path, { rubyModifier }, print) { const [_predicate, stmts] = path.getValue().body; diff --git a/src/ruby/nodes/massign.ts b/src/ruby/nodes/massign.ts index 967259da..b9398603 100644 --- a/src/ruby/nodes/massign.ts +++ b/src/ruby/nodes/massign.ts @@ -1,16 +1,13 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; -const { - concat, - group, - indent, - join, - line, - softline -} = prettier; - -export const printMAssign: Plugin.Printer = (path, opts, print) => { +const { concat, group, indent, join, line, softline } = prettier; + +export const printMAssign: Plugin.Printer = ( + path, + opts, + print +) => { let right = path.call(print, "body", 1); if ( @@ -21,7 +18,9 @@ export const printMAssign: Plugin.Printer = (path, opts, print) => right = group(join(concat([",", line]), right)); } - const parts: Plugin.Doc[] = [join(concat([",", line]), path.call(print, "body", 0))]; + const parts: Plugin.Doc[] = [ + join(concat([",", line]), path.call(print, "body", 0)) + ]; if ((path.getValue().body[0] as any).comma) { parts.push(","); } @@ -35,21 +34,37 @@ export const printMLHS: Plugin.Printer = (path, opts, print) => { return path.map(print, "body"); }; -export const printMLHSAddPost: Plugin.Printer = (path, opts, print) => { - return (path.call(print, "body", 0) as Plugin.Doc[]).concat(path.call(print, "body", 1)); +export const printMLHSAddPost: Plugin.Printer = ( + path, + opts, + print +) => { + return (path.call(print, "body", 0) as Plugin.Doc[]).concat( + path.call(print, "body", 1) + ); }; -export const printMLHSAddStar: Plugin.Printer = (path, opts, print) => { +export const printMLHSAddStar: Plugin.Printer = ( + path, + opts, + print +) => { const rightParts: Plugin.Doc[] = ["*"]; if (path.getValue().body[1]) { rightParts.push(path.call(print, "body", 1)); } - return (path.call(print, "body", 0) as Plugin.Doc[]).concat(concat(rightParts)); + return (path.call(print, "body", 0) as Plugin.Doc[]).concat( + concat(rightParts) + ); }; -export const printMLHSParen: Plugin.Printer = (path, opts, print) => { +export const printMLHSParen: Plugin.Printer = ( + path, + opts, + print +) => { if (["massign", "mlhs_paren"].includes(path.getParentNode().type)) { // If we're nested in brackets as part of the left hand side of an // assignment, i.e., (a, b, c) = 1, 2, 3 @@ -73,13 +88,21 @@ export const printMRHS: Plugin.Printer = (path, opts, print) => { return path.map(print, "body"); }; -export const printMRHSAddStar: Plugin.Printer = (path, opts, print) => { +export const printMRHSAddStar: Plugin.Printer = ( + path, + opts, + print +) => { const [leftDoc, rightDoc] = path.map(print, "body"); return (leftDoc as Plugin.Doc[]).concat([concat(["*", rightDoc])]); }; -export const printMRHSNewFromArgs: Plugin.Printer = (path, opts, print) => { +export const printMRHSNewFromArgs: Plugin.Printer = ( + path, + opts, + print +) => { const parts = path.call(print, "body", 0) as Plugin.Doc[]; if (path.getValue().body[1]) { diff --git a/src/ruby/nodes/methods.ts b/src/ruby/nodes/methods.ts index 2548fb0c..07b5d766 100644 --- a/src/ruby/nodes/methods.ts +++ b/src/ruby/nodes/methods.ts @@ -51,7 +51,11 @@ function printMethod(offset: number): Plugin.Printer { }; } -export const printSingleLineMethod: Plugin.Printer = (path, opts, print) => { +export const printSingleLineMethod: Plugin.Printer = ( + path, + opts, + print +) => { const parensNode = path.getValue().body[1]; let paramsDoc: Plugin.Doc = ""; @@ -74,7 +78,11 @@ export const printSingleLineMethod: Plugin.Printer = (path, opts, pr ); }; -export const printAccessControl: Plugin.Printer = (path, opts, print) => { +export const printAccessControl: Plugin.Printer = ( + path, + opts, + print +) => { return path.call(print, "body", 0); }; diff --git a/src/ruby/nodes/params.ts b/src/ruby/nodes/params.ts index c6d06e85..053b7789 100644 --- a/src/ruby/nodes/params.ts +++ b/src/ruby/nodes/params.ts @@ -2,16 +2,11 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; import { literal } from "../../utils"; -const { - concat, - group, - join, - indent, - line, - softline -} = prettier; +const { concat, group, join, indent, line, softline } = prettier; -function printRestParamSymbol(symbol: string): Plugin.Printer { +function printRestParamSymbol( + symbol: string +): Plugin.Printer { return function printRestParamWithSymbol(path, opts, print) { return path.getValue().body[0] ? concat([symbol, path.call(print, "body", 0)]) @@ -94,7 +89,12 @@ export const printParams: Plugin.Printer = (path, opts, print) => { // that we could handle them here and get nicer formatting. if (["lambda", "paren"].includes(path.getParentNode().type)) { return group( - concat(["(", indent(concat(([softline] as Plugin.Doc[]).concat(contents))), softline, ")"]) + concat([ + "(", + indent(concat(([softline] as Plugin.Doc[]).concat(contents))), + softline, + ")" + ]) ); } diff --git a/src/ruby/nodes/patterns.ts b/src/ruby/nodes/patterns.ts index 459afe7b..7c962c38 100644 --- a/src/ruby/nodes/patterns.ts +++ b/src/ruby/nodes/patterns.ts @@ -1,15 +1,7 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; -const { - align, - concat, - group, - hardline, - indent, - join, - line -} = prettier; +const { align, concat, group, hardline, indent, join, line } = prettier; const patterns = ["aryptn", "binary", "fndptn", "hshptn", "rassign"]; @@ -137,7 +129,11 @@ export const printIn: Plugin.Printer = (path, opts, print) => { return group(concat(parts)); }; -export const printRAssign: Plugin.Printer = (path, opts, print) => { +export const printRAssign: Plugin.Printer = ( + path, + opts, + print +) => { const { keyword } = path.getValue(); const [leftDoc, rightDoc] = path.map(print, "body"); diff --git a/src/ruby/nodes/regexp.ts b/src/ruby/nodes/regexp.ts index b28769c1..77118404 100644 --- a/src/ruby/nodes/regexp.ts +++ b/src/ruby/nodes/regexp.ts @@ -33,7 +33,11 @@ function forwardSlashIsAmbiguous(path: Plugin.Path) { // // We favor the use of forward slashes unless the regex contains a forward slash // itself. In that case we switch over to using %r with braces. -export const printRegexpLiteral: Plugin.Printer = (path, opts, print) => { +export const printRegexpLiteral: Plugin.Printer = ( + path, + opts, + print +) => { const node = path.getValue(); const docs = path.map(print, "body"); @@ -44,7 +48,9 @@ export const printRegexpLiteral: Plugin.Printer = (path, opt // If we should be using braces but we have braces in the body of the regexp, // then we're just going to resort to using whatever the original content was. if (useBraces && hasContent(node, /[{}]/)) { - return concat(([node.beging] as Plugin.Doc[]).concat(docs).concat(node.ending)); + return concat( + ([node.beging] as Plugin.Doc[]).concat(docs).concat(node.ending) + ); } return concat( diff --git a/src/ruby/nodes/rescue.ts b/src/ruby/nodes/rescue.ts index 3d8519cb..705a0bed 100644 --- a/src/ruby/nodes/rescue.ts +++ b/src/ruby/nodes/rescue.ts @@ -3,15 +3,7 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; import { literal } from "../../utils"; -const { - align, - concat, - group, - hardline, - indent, - join, - line -} = prettier; +const { align, concat, group, hardline, indent, join, line } = prettier; export const printBegin: Plugin.Printer = (path, opts, print) => { return concat([ @@ -58,7 +50,11 @@ export const printRescue: Plugin.Printer = (path, opts, print) => { // This is a container node that we're adding into the AST that isn't present in // Ripper solely so that we have a nice place to attach inline comments. -export const printRescueEx: Plugin.Printer = (path, opts, print) => { +export const printRescueEx: Plugin.Printer = ( + path, + opts, + print +) => { const [exception, variable] = path.getValue().body; const parts = []; @@ -80,7 +76,11 @@ export const printRescueEx: Plugin.Printer = (path, opts, print) return group(concat(parts)); }; -export const printRescueMod: Plugin.Printer = (path, opts, print) => { +export const printRescueMod: Plugin.Printer = ( + path, + opts, + print +) => { const [statementDoc, valueDoc] = path.map(print, "body"); return concat([ diff --git a/src/ruby/nodes/return.ts b/src/ruby/nodes/return.ts index 96378ea7..ab188de6 100644 --- a/src/ruby/nodes/return.ts +++ b/src/ruby/nodes/return.ts @@ -2,15 +2,7 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; import { literal } from "../../utils"; -const { - concat, - group, - ifBreak, - indent, - line, - join, - softline -} = prettier; +const { concat, group, ifBreak, indent, line, join, softline } = prettier; // You can't skip the parentheses if you have comments or certain operators with // lower precedence than the return keyword. @@ -71,7 +63,10 @@ export const printReturn: Plugin.Printer = (path, opts, print) => { // Now that we've established which actual node is the arguments to return, // we grab it out of the path by diving down the steps that we've set up. - const parts = path.call.apply(path, ([print] as CallArgs).concat(steps) as CallArgs) as Plugin.Doc[]; + const parts = path.call.apply( + path, + ([print] as CallArgs).concat(steps) as CallArgs + ) as Plugin.Doc[]; // If we got the value straight out of the parens, then `parts` would only // be a singular doc as opposed to an array. diff --git a/src/ruby/nodes/statements.ts b/src/ruby/nodes/statements.ts index 3fb880ce..8932a8bd 100644 --- a/src/ruby/nodes/statements.ts +++ b/src/ruby/nodes/statements.ts @@ -16,7 +16,11 @@ const { trim } = prettier; -export const printBodyStmt: Plugin.Printer = (path, opts, print) => { +export const printBodyStmt: Plugin.Printer = ( + path, + opts, + print +) => { const [stmts, rescue, elseClause, ensure] = path.getValue().body; const parts = []; @@ -74,16 +78,28 @@ export const printParen: Plugin.Printer = (path, opts, print) => { ); }; -export const printEndContent: Plugin.Printer = (path, _opts, _print) => { +export const printEndContent: Plugin.Printer = ( + path, + _opts, + _print +) => { const { body } = path.getValue(); return concat([trim, "__END__", literalline, body]); }; -export const printComment: Plugin.Printer = (path, opts, _print) => { +export const printComment: Plugin.Printer = ( + path, + opts, + _print +) => { return opts.printer.printComment(path, opts); }; -export const printProgram: Plugin.Printer = (path, opts, print) => { +export const printProgram: Plugin.Printer = ( + path, + opts, + print +) => { return concat([join(hardline, path.map(print, "body")), hardline]); }; diff --git a/src/ruby/nodes/strings.ts b/src/ruby/nodes/strings.ts index 610b3d34..c486c02b 100644 --- a/src/ruby/nodes/strings.ts +++ b/src/ruby/nodes/strings.ts @@ -76,7 +76,11 @@ function getClosingQuote(quote: string) { // Prints a @CHAR node. @CHAR nodes are special character strings that usually // are strings of length 1. If they're any longer than we'll try to apply the // correct quotes. -export const printChar: Plugin.Printer = (path, { rubySingleQuote }, _print) => { +export const printChar: Plugin.Printer = ( + path, + { rubySingleQuote }, + _print +) => { const { body } = path.getValue(); if (body.length !== 2) { @@ -87,7 +91,11 @@ export const printChar: Plugin.Printer = (path, { rubySingleQuote }, return concat([quote, body.slice(1), quote]); }; -const printPercentSDynaSymbol: Plugin.Printer = (path, opts, print) => { +const printPercentSDynaSymbol: Plugin.Printer = ( + path, + opts, + print +) => { const node = path.getValue(); const parts = []; @@ -144,7 +152,11 @@ function shouldPrintPercentSDynaSymbol(node: Ruby.DynaSymbol) { // // In the case of a plain dyna symbol, node.quote will be either :" or :' // For %s dyna symbols, node.quote will be %s[, %s(, %s{, or %s< -export const printDynaSymbol: Plugin.Printer = (path, opts, print) => { +export const printDynaSymbol: Plugin.Printer = ( + path, + opts, + print +) => { const node = path.getValue(); if (shouldPrintPercentSDynaSymbol(node)) { @@ -192,7 +204,11 @@ export const printDynaSymbol: Plugin.Printer = (path, opts, pri return concat(parts); }; -export const printStringConcat: Plugin.Printer = (path, opts, print) => { +export const printStringConcat: Plugin.Printer = ( + path, + opts, + print +) => { const [leftDoc, rightDoc] = path.map(print, "body"); return group(concat([leftDoc, " \\", indent(concat([hardline, rightDoc]))])); @@ -200,11 +216,19 @@ export const printStringConcat: Plugin.Printer = (path, opts, // Prints out an interpolated variable in the string by converting it into an // embedded expression. -export const printStringDVar: Plugin.Printer = (path, opts, print) => { +export const printStringDVar: Plugin.Printer = ( + path, + opts, + print +) => { return concat(["#{", path.call(print, "body", 0), "}"]); }; -export const printStringEmbExpr: Plugin.Printer = (path, opts, print) => { +export const printStringEmbExpr: Plugin.Printer = ( + path, + opts, + print +) => { const node = path.getValue(); const parts = path.call(print, "body", 0); @@ -224,7 +248,11 @@ export const printStringEmbExpr: Plugin.Printer = (path, opt // wishes of the user with regards to single versus double quotes, but if the // string contains any escape expressions then it will just keep the original // quotes. -export const printStringLiteral: Plugin.Printer = (path, { rubySingleQuote }, print) => { +export const printStringLiteral: Plugin.Printer = ( + path, + { rubySingleQuote }, + print +) => { const node = path.getValue(); // If the string is empty, it will not have any parts, so just print out the @@ -251,17 +279,29 @@ export const printStringLiteral: Plugin.Printer = (path, { r return join(literalline, normalizeQuotes(part.body, quote).split("\n")); }); - return concat(([quote] as Plugin.Doc[]).concat(parts).concat(getClosingQuote(quote))); + return concat( + ([quote] as Plugin.Doc[]).concat(parts).concat(getClosingQuote(quote)) + ); }; // Prints out a symbol literal. Its child will always be the ident that // represents the string content of the symbol. -export const printSymbolLiteral: Plugin.Printer = (path, opts, print) => { +export const printSymbolLiteral: Plugin.Printer = ( + path, + opts, + print +) => { return concat([":", path.call(print, "body", 0)]); }; // Prints out an xstring literal. Its child is an array of string parts, // including plain string content and interpolated content. -export const printXStringLiteral: Plugin.Printer = (path, opts, print) => { - return concat((["`"] as Plugin.Doc[]).concat(path.map(print, "body")).concat("`")); +export const printXStringLiteral: Plugin.Printer = ( + path, + opts, + print +) => { + return concat( + (["`"] as Plugin.Doc[]).concat(path.map(print, "body")).concat("`") + ); }; diff --git a/src/ruby/nodes/undef.ts b/src/ruby/nodes/undef.ts index 6dc04fc3..172daf56 100644 --- a/src/ruby/nodes/undef.ts +++ b/src/ruby/nodes/undef.ts @@ -1,16 +1,13 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; -const { - addTrailingComment, - align, - concat, - group, - join, - line -} = prettier; +const { addTrailingComment, align, concat, group, join, line } = prettier; -const printUndefSymbol: Plugin.Printer = (path, opts, print) => { +const printUndefSymbol: Plugin.Printer = ( + path, + opts, + print +) => { const node = path.getValue(); // Since we're going to descend into the symbol literal to grab out the ident diff --git a/src/ruby/printer.ts b/src/ruby/printer.ts index c872bb6a..0a9538ff 100644 --- a/src/ruby/printer.ts +++ b/src/ruby/printer.ts @@ -38,7 +38,10 @@ const printer: Plugin.PrinterConfig = { .concat(node.body[3]); case "hshptn": { const pairs = node.body[1]; - const values = pairs.reduce((left: any, right: any) => left.concat(right), []); + const values = pairs.reduce( + (left: any, right: any) => left.concat(right), + [] + ); return [node.body[0]].concat(values).concat(node.body[2]); } @@ -76,7 +79,9 @@ const printer: Plugin.PrinterConfig = { } default: { if (Array.isArray(node.body)) { - return node.body.filter((child: any) => child && typeof child === "object"); + return node.body.filter( + (child: any) => child && typeof child === "object" + ); } return []; } @@ -89,8 +94,10 @@ const printer: Plugin.PrinterConfig = { const node = path.getValue(); return ( - node.comments && - node.comments.some((comment) => comment.value.includes("prettier-ignore")) || + (node.comments && + node.comments.some((comment) => + comment.value.includes("prettier-ignore") + )) || false ); }, diff --git a/src/ruby/toProc.ts b/src/ruby/toProc.ts index 85bdf12b..ddbd189f 100644 --- a/src/ruby/toProc.ts +++ b/src/ruby/toProc.ts @@ -21,7 +21,10 @@ function isCall(node: Ruby.CallOperator) { // [1, 2, 3].map(&:to_s) // // This works with `do` blocks as well. -function toProc(path: Plugin.Path, node: Ruby.BraceBlock | Ruby.DoBlock) { +function toProc( + path: Plugin.Path, + node: Ruby.BraceBlock | Ruby.DoBlock +) { const [variables, blockContents] = node.body; // Ensure that there are variables being passed to this block. diff --git a/src/utils/inlineEnsureParens.ts b/src/utils/inlineEnsureParens.ts index ec4e075f..361c754b 100644 --- a/src/utils/inlineEnsureParens.ts +++ b/src/utils/inlineEnsureParens.ts @@ -41,7 +41,10 @@ const needsParens = [ // // This approach maintains the nice conciseness of the inline version, while // keeping the correct semantic meaning. -function inlineEnsureParens(path: Plugin.Path, parts: Plugin.Doc[]) { +function inlineEnsureParens( + path: Plugin.Path, + parts: Plugin.Doc[] +) { if (needsParens.includes(path.getParentNode().type)) { return (["("] as Plugin.Doc[]).concat(parts, ")"); } diff --git a/src/utils/makeCall.ts b/src/utils/makeCall.ts index 9122c575..27f0297b 100644 --- a/src/utils/makeCall.ts +++ b/src/utils/makeCall.ts @@ -1,7 +1,7 @@ import type { Plugin, Ruby } from "../types"; type Callable = { - body: [any, Ruby.CallOperator, ...any[]] + body: [any, Ruby.CallOperator, ...any[]]; }; const makeCall: Plugin.Printer = (path, opts, print) => { diff --git a/src/utils/printEmptyCollection.ts b/src/utils/printEmptyCollection.ts index 4b37468a..47f58192 100644 --- a/src/utils/printEmptyCollection.ts +++ b/src/utils/printEmptyCollection.ts @@ -3,7 +3,9 @@ import prettier from "../prettier"; const { concat, group, hardline, indent, join, line } = prettier; -function containedWithin(node: Ruby.Array | Ruby.Hash): (_comment: Ruby.Comment) => boolean { +function containedWithin( + node: Ruby.Array | Ruby.Hash +): (_comment: Ruby.Comment) => boolean { return function containedWithinNode(comment) { return comment.sc >= node.sc && comment.ec <= node.ec; }; @@ -14,7 +16,12 @@ function containedWithin(node: Ruby.Array | Ruby.Hash): (_comment: Ruby.Comment) // this by having a child node inside the array that gets the comments attached // to it, but that requires modifying the parser. Instead, we can just manually // print out the non-leading comments here. -function printEmptyCollection(path: Plugin.Path, opts: Plugin.Options, startToken: string, endToken: string) { +function printEmptyCollection( + path: Plugin.Path, + opts: Plugin.Options, + startToken: string, + endToken: string +) { const node = path.getValue(); const containedWithinNode = containedWithin(node); diff --git a/test/js/haml/parser.test.ts b/test/js/haml/parser.test.ts index 374b5bb3..8a6b1068 100644 --- a/test/js/haml/parser.test.ts +++ b/test/js/haml/parser.test.ts @@ -3,11 +3,15 @@ import parser from "../../../src/haml/parser"; describe("parser", () => { test("parse", () => { - expect(parser.parse("= foo", {}, {} as Plugin.Options).type).toEqual("root"); + expect(parser.parse("= foo", {}, {} as Plugin.Options).type).toEqual( + "root" + ); }); test("parse failure", () => { - expect(() => parser.parse(`%div("invalid ": 1)`, {}, {} as Plugin.Options)).toThrowError(); + expect(() => + parser.parse(`%div("invalid ": 1)`, {}, {} as Plugin.Options) + ).toThrowError(); }); test("hasPragma", () => { diff --git a/test/js/rbs/parser.test.ts b/test/js/rbs/parser.test.ts index 7fb9bce3..d9c1df45 100644 --- a/test/js/rbs/parser.test.ts +++ b/test/js/rbs/parser.test.ts @@ -4,7 +4,9 @@ import parser from "../../../src/rbs/parser"; describe("parser", () => { test("parse", () => { - expect(parser.parse("class Foo end", {}, {} as Plugin.Options).declarations).toHaveLength(1); + expect( + parser.parse("class Foo end", {}, {} as Plugin.Options).declarations + ).toHaveLength(1); }); test("parse failure", () => { @@ -28,12 +30,20 @@ describe("parser", () => { }); test("locStart", () => { - expect(parser.locStart({ location: { start_pos: 5 } } as RBS.AnyNode)).toEqual(5); - expect(parser.locStart({ type: { location: { start_pos: 10 } } } as RBS.AnyNode)).toEqual(10); + expect( + parser.locStart({ location: { start_pos: 5 } } as RBS.AnyNode) + ).toEqual(5); + expect( + parser.locStart({ type: { location: { start_pos: 10 } } } as RBS.AnyNode) + ).toEqual(10); }); test("locEnd", () => { - expect(parser.locEnd({ location: { end_pos: 5 } } as RBS.AnyNode)).toEqual(5); - expect(parser.locEnd({ type: { location: { end_pos: 10 } } } as RBS.AnyNode)).toEqual(10); + expect(parser.locEnd({ location: { end_pos: 5 } } as RBS.AnyNode)).toEqual( + 5 + ); + expect( + parser.locEnd({ type: { location: { end_pos: 10 } } } as RBS.AnyNode) + ).toEqual(10); }); }); diff --git a/test/js/setupTests.ts b/test/js/setupTests.ts index 7ef644bd..ee2db847 100644 --- a/test/js/setupTests.ts +++ b/test/js/setupTests.ts @@ -40,11 +40,18 @@ function parseAsync(parser: string, source: string) { }); } -function checkFormat(before: Code, after: Code, config: Partial) { +function checkFormat( + before: Code, + after: Code, + config: Partial +) { const parser = (before as any).parser || "ruby"; const originalText = (before as any).code || before; - const opts = Object.assign({ parser, plugins: [plugin], originalText }, config); + const opts = Object.assign( + { parser, plugins: [plugin], originalText }, + config + ); return new Promise((resolve, reject) => { if ( @@ -74,7 +81,11 @@ function checkFormat(before: Code, after: Code, config: Partial) } expect.extend({ - toChangeFormat(before: Code, after: Code, config: Partial = {}) { + toChangeFormat( + before: Code, + after: Code, + config: Partial = {} + ) { return checkFormat(before, (after as any).code || after, config); }, toMatchFormat(before: Code, config: Partial = {}) { @@ -86,8 +97,13 @@ declare global { namespace jest { // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars interface Matchers { - toChangeFormat(_after: Code, _config?: Partial): Promise; - toMatchFormat(_config?: Partial): Promise; + toChangeFormat( + _after: Code, + _config?: Partial + ): Promise; + toMatchFormat( + _config?: Partial + ): Promise; } } } diff --git a/test/js/types.ts b/test/js/types.ts index 0ae5d07d..26de5835 100644 --- a/test/js/types.ts +++ b/test/js/types.ts @@ -1 +1,4 @@ -export type Code = string | { code: string, parser: "rbs" } | { code: string, parser: "haml" }; +export type Code = + | string + | { code: string; parser: "rbs" } + | { code: string; parser: "haml" }; From fe37ef5558eb2e87101031923bb40837571341aa Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Sep 2021 20:37:35 -0400 Subject: [PATCH 240/785] src -> dist in the gem --- prettier.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prettier.gemspec b/prettier.gemspec index b1c9fc98..c2dbbbf5 100644 --- a/prettier.gemspec +++ b/prettier.gemspec @@ -15,7 +15,7 @@ Gem::Specification.new do |spec| spec.files = Dir.chdir(__dir__) do %w[LICENSE bin/console package.json rubocop.yml] + - Dir['{{exe,lib,src}/**/*,*.md}'] + + Dir['{{exe,lib,dist}/**/*,*.md}'] + Dir[ 'node_modules/prettier/{package.json,index.js,doc.js,bin-prettier.js,third-party.js,parser-*.js}' ] From f462c24fbefa5ab4fcdb3a502a741d096a7eb302 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Sep 2021 20:41:52 -0400 Subject: [PATCH 241/785] Fix up test cases for most modern RBS --- test/js/rbs/interface.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/js/rbs/interface.txt b/test/js/rbs/interface.txt index 026e2c31..ebfb7c53 100644 --- a/test/js/rbs/interface.txt +++ b/test/js/rbs/interface.txt @@ -1,5 +1,5 @@ -_foo +_Foo ::_Foo -Foo::_foo +Foo::_Foo ::Foo::_Foo _Foo[untyped, nil] From 73e107190e75bd27c9cce9de3d0b666f4f5ddbc0 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Sep 2021 20:44:48 -0400 Subject: [PATCH 242/785] Fix up atLeastVersion and atMostVersion functions --- test/js/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/js/utils.ts b/test/js/utils.ts index bb19e0f1..2d0f0242 100644 --- a/test/js/utils.ts +++ b/test/js/utils.ts @@ -33,9 +33,9 @@ export function haml(code: string): Code { // explicitly allow it to be undefined by coalescing with the empty string. export function atLeastVersion(version: string) { - return process.env.RUBY_VERSION || "" >= version; + return (process.env.RUBY_VERSION || "") >= version; } export function atMostVersion(version: string) { - return process.env.RUBY_VERSION || "" < version; + return (process.env.RUBY_VERSION || "") < version; } From 38240f5523a0fc9eb27bbfa09209ef6d12672c29 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Sep 2021 20:46:05 -0400 Subject: [PATCH 243/785] Better cross-platform copying --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4b3f02bc..9ea8f189 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "checkFormat": "prettier --check '**/*'", "lint": "eslint --cache .", - "prepublishOnly": "tsc -p tsconfig.build.json && cp src/parser/{netcat.js,server.rb} dist/parser && cp src/haml/parser.rb dist/haml && cp src/rbs/parser.rb dist/rbs && cp src/ruby/parser.rb dist/ruby", + "prepublishOnly": "tsc -p tsconfig.build.json && cp src/parser/netcat.js dist/parser && cp src/parser/server.rb dist/parser && cp src/haml/parser.rb dist/haml && cp src/rbs/parser.rb dist/rbs && cp src/ruby/parser.rb dist/ruby", "test": "jest" }, "repository": { From 17f61c4318e1ac17d47a471165de850926543114 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Sep 2021 00:53:57 +0000 Subject: [PATCH 244/785] Bump tmpl from 1.0.4 to 1.0.5 Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5. - [Release notes](https://github.com/daaku/nodejs-tmpl/releases) - [Commits](https://github.com/daaku/nodejs-tmpl/commits/v1.0.5) --- updated-dependencies: - dependency-name: tmpl dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 481795d6..d04ccdd8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3042,9 +3042,9 @@ throat@^6.0.1: integrity sha512-8hmiGIJMDlwjg7dlJ4yKGLK8EsYqKgPWbG3b4wjJddKNwc7N7Dpn08Df4szr/sZdMVeOstrdYSsqzX6BYbcB+w== tmpl@1.0.x: - version "1.0.4" - resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" - integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE= + version "1.0.5" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" + integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== to-fast-properties@^2.0.0: version "2.0.0" From 21e80862862b1b7e7dc08728126d920af905e433 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Sep 2021 12:01:22 +0000 Subject: [PATCH 245/785] Bump @types/jest from 27.0.1 to 27.0.2 Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 27.0.1 to 27.0.2. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index d04ccdd8..5553cd9a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -647,9 +647,9 @@ "@types/istanbul-lib-report" "*" "@types/jest@^27.0.1": - version "27.0.1" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.0.1.tgz#fafcc997da0135865311bb1215ba16dba6bdf4ca" - integrity sha512-HTLpVXHrY69556ozYkcq47TtQJXpcWAWfkoqz+ZGz2JnmZhzlRjprCIyFnetSy8gpDWwTTGBcRVv1J1I1vBrHw== + version "27.0.2" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.0.2.tgz#ac383c4d4aaddd29bbf2b916d8d105c304a5fcd7" + integrity sha512-4dRxkS/AFX0c5XW6IPMNOydLn2tEhNhJV7DnYK+0bjoJZ+QTmfucBlihX7aoEsh/ocYtkLC73UbnBXBXIxsULA== dependencies: jest-diff "^27.0.0" pretty-format "^27.0.0" From e5a28efe0c380d0f3aa81644fa7d98b785aae6ce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Sep 2021 12:01:35 +0000 Subject: [PATCH 246/785] Bump jest from 27.2.0 to 27.2.1 Bumps [jest](https://github.com/facebook/jest) from 27.2.0 to 27.2.1. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v27.2.0...v27.2.1) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 194 +++++++++++++++++++++++++++--------------------------- 1 file changed, 97 insertions(+), 97 deletions(-) diff --git a/yarn.lock b/yarn.lock index d04ccdd8..215ea4b5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -370,15 +370,15 @@ jest-util "^27.2.0" slash "^3.0.0" -"@jest/core@^27.2.0": - version "27.2.0" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.2.0.tgz#61fc27b244e9709170ed9ffe41b006add569f1b3" - integrity sha512-E/2NHhq+VMo18DpKkoty8Sjey8Kps5Cqa88A8NP757s6JjYqPdioMuyUBhDiIOGCdQByEp0ou3jskkTszMS0nw== +"@jest/core@^27.2.1": + version "27.2.1" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.2.1.tgz#93dc50e2aaba2c944e5765cf658dcd98d804c970" + integrity sha512-XcGt9UgPyzylThvezwUIMCNVp8xxN78Ic3WwhJZehZt4n2hPHR6Bd85A1nKFZBeqW58Vd+Cx/LaN6YL4n58KlA== dependencies: "@jest/console" "^27.2.0" - "@jest/reporters" "^27.2.0" + "@jest/reporters" "^27.2.1" "@jest/test-result" "^27.2.0" - "@jest/transform" "^27.2.0" + "@jest/transform" "^27.2.1" "@jest/types" "^27.1.1" "@types/node" "*" ansi-escapes "^4.2.1" @@ -387,15 +387,15 @@ exit "^0.1.2" graceful-fs "^4.2.4" jest-changed-files "^27.1.1" - jest-config "^27.2.0" + jest-config "^27.2.1" jest-haste-map "^27.2.0" jest-message-util "^27.2.0" jest-regex-util "^27.0.6" jest-resolve "^27.2.0" - jest-resolve-dependencies "^27.2.0" - jest-runner "^27.2.0" - jest-runtime "^27.2.0" - jest-snapshot "^27.2.0" + jest-resolve-dependencies "^27.2.1" + jest-runner "^27.2.1" + jest-runtime "^27.2.1" + jest-snapshot "^27.2.1" jest-util "^27.2.0" jest-validate "^27.2.0" jest-watcher "^27.2.0" @@ -427,24 +427,24 @@ jest-mock "^27.1.1" jest-util "^27.2.0" -"@jest/globals@^27.2.0": - version "27.2.0" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.2.0.tgz#4d7085f51df5ac70c8240eb3501289676503933d" - integrity sha512-raqk9Gf9WC3hlBa57rmRmJfRl9hom2b+qEE/ifheMtwn5USH5VZxzrHHOZg0Zsd/qC2WJ8UtyTwHKQAnNlDMdg== +"@jest/globals@^27.2.1": + version "27.2.1" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.2.1.tgz#6842c70b6713fbe2fcaf89eac20d77eeeb0e282c" + integrity sha512-4P46Zr4cckSitsWtOMRvgMMn7mOKbBsQdYxHeGSIG3kpI4gNR2vk51balPulZHnBQCQb/XBptprtoSv1REfaew== dependencies: "@jest/environment" "^27.2.0" "@jest/types" "^27.1.1" - expect "^27.2.0" + expect "^27.2.1" -"@jest/reporters@^27.2.0": - version "27.2.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.2.0.tgz#629886d9a42218e504a424889a293abb27919e25" - integrity sha512-7wfkE3iRTLaT0F51h1mnxH3nQVwDCdbfgXiLuCcNkF1FnxXLH9utHqkSLIiwOTV1AtmiE0YagHbOvx4rnMP/GA== +"@jest/reporters@^27.2.1": + version "27.2.1" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.2.1.tgz#2e43361b962e26975d40eafd7b4f14c70b4fe9a0" + integrity sha512-ILqR+bIIBlhaHjDtQR/0Z20YkKAQVM+NVRuJLaWFCoRx/rKQQSxG01ZLiLV0MsA6wkBHf6J9fzFuXp0k5l7epw== dependencies: "@bcoe/v8-coverage" "^0.2.3" "@jest/console" "^27.2.0" "@jest/test-result" "^27.2.0" - "@jest/transform" "^27.2.0" + "@jest/transform" "^27.2.1" "@jest/types" "^27.1.1" chalk "^4.0.0" collect-v8-coverage "^1.0.0" @@ -485,20 +485,20 @@ "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.2.0": - version "27.2.0" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.2.0.tgz#b02b507687825af2fdc84e90c539d36fd8cf7bc9" - integrity sha512-PrqarcpzOU1KSAK7aPwfL8nnpaqTMwPe7JBPnaOYRDSe/C6AoJiL5Kbnonqf1+DregxZIRAoDg69R9/DXMGqXA== +"@jest/test-sequencer@^27.2.1": + version "27.2.1" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.2.1.tgz#1682cd3a16198fa358ff9565b0d2792919f36562" + integrity sha512-fWcEgWQXgvU4DFY5YHfQsGwqfJWyuCUzdOzLZTYtyLB3WK1mFPQGYAszM7mCEZjyVon5XRuCa+2/+hif/uMucQ== dependencies: "@jest/test-result" "^27.2.0" graceful-fs "^4.2.4" jest-haste-map "^27.2.0" - jest-runtime "^27.2.0" + jest-runtime "^27.2.1" -"@jest/transform@^27.2.0": - version "27.2.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.2.0.tgz#e7e6e49d2591792db2385c33cdbb4379d407068d" - integrity sha512-Q8Q/8xXIZYllk1AF7Ou5sV3egOZsdY/Wlv09CSbcexBRcC1Qt6lVZ7jRFAZtbHsEEzvOCyFEC4PcrwKwyjXtCg== +"@jest/transform@^27.2.1": + version "27.2.1" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.2.1.tgz#743443adb84b3b7419951fc702515ce20ba6285e" + integrity sha512-xmB5vh81KK8DiiCMtI5vI59mP+GggNmc9BiN+fg4mKdQHV369+WuZc1Lq2xWFCOCsRPHt24D9h7Idp4YaMB1Ww== dependencies: "@babel/core" "^7.1.0" "@jest/types" "^27.1.1" @@ -921,12 +921,12 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= -babel-jest@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.2.0.tgz#c0f129a81f1197028aeb4447acbc04564c8bfc52" - integrity sha512-bS2p+KGGVVmWXBa8+i6SO/xzpiz2Q/2LnqLbQknPKefWXVZ67YIjA4iXup/jMOEZplga9PpWn+wrdb3UdDwRaA== +babel-jest@^27.2.1: + version "27.2.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.2.1.tgz#48edfa5cf8d59ab293da94321a369ccc7b67a4b1" + integrity sha512-kkaekSJHew1zfDW3cA2QiSBPg4uiLpiW0OwJKqFv0r2/mFgym/IBn7hxPntL6FvS66G/ROh+lz4pRiCJAH1/UQ== dependencies: - "@jest/transform" "^27.2.0" + "@jest/transform" "^27.2.1" "@jest/types" "^27.1.1" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.0.0" @@ -1501,10 +1501,10 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.2.0.tgz#40eb89a492afb726a3929ccf3611ee0799ab976f" - integrity sha512-oOTbawMQv7AK1FZURbPTgGSzmhxkjFzoARSvDjOMnOpeWuYQx1tP6rXu9MIX5mrACmyCAM7fSNP8IJO2f1p0CQ== +expect@^27.2.1: + version "27.2.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.2.1.tgz#5f882b308716618613f0106a488b46c303908157" + integrity sha512-ekOA2mBtT2phxcoPVHCXIzbJxCvRXhx2fr7m28IgGdZxUOh8UvxvoRz1FcPlfgZMpE92biHB6woIcAKXqR28hA== dependencies: "@jest/types" "^27.1.1" ansi-styles "^5.0.0" @@ -1915,10 +1915,10 @@ jest-changed-files@^27.1.1: execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.2.0.tgz#ad0d6d75514050f539d422bae41344224d2328f9" - integrity sha512-WwENhaZwOARB1nmcboYPSv/PwHBUGRpA4MEgszjr9DLCl97MYw0qZprBwLb7rNzvMwfIvNGG7pefQ5rxyBlzIA== +jest-circus@^27.2.1: + version "27.2.1" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.2.1.tgz#c5166052b328c0df932cdaf89f5982085e7b4812" + integrity sha512-9q/8X8DgJmW8IqXsJNnS2E28iarx990hf6D+frS3P0lB+avhFDD33alLwZzKgm45u0wvEi6iFh43WjNbp5fhjw== dependencies: "@jest/environment" "^27.2.0" "@jest/test-result" "^27.2.0" @@ -1927,59 +1927,59 @@ jest-circus@^27.2.0: chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" - expect "^27.2.0" + expect "^27.2.1" is-generator-fn "^2.0.0" jest-each "^27.2.0" jest-matcher-utils "^27.2.0" jest-message-util "^27.2.0" - jest-runtime "^27.2.0" - jest-snapshot "^27.2.0" + jest-runtime "^27.2.1" + jest-snapshot "^27.2.1" jest-util "^27.2.0" pretty-format "^27.2.0" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.2.0.tgz#6da5ecca5bd757e20449f5ec1f1cad5b0303d16b" - integrity sha512-bq1X/B/b1kT9y1zIFMEW3GFRX1HEhFybiqKdbxM+j11XMMYSbU9WezfyWIhrSOmPT+iODLATVjfsCnbQs7cfIA== +jest-cli@^27.2.1: + version "27.2.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.2.1.tgz#031e887245945864cc6ed8605c939f1937858c09" + integrity sha512-IfxuGkBZS/ogY7yFvvD1dFidzQRXlSBHtUZQ3UTIHydzNMF4/ZRTdGFso6HkbCkemwLh4hnNybONexEqWmYwjw== dependencies: - "@jest/core" "^27.2.0" + "@jest/core" "^27.2.1" "@jest/test-result" "^27.2.0" "@jest/types" "^27.1.1" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.2.0" + jest-config "^27.2.1" jest-util "^27.2.0" jest-validate "^27.2.0" prompts "^2.0.1" yargs "^16.0.3" -jest-config@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.2.0.tgz#d1c359253927005c53d11ab3e50d3b2f402a673a" - integrity sha512-Z1romHpxeNwLxQtouQ4xt07bY6HSFGKTo0xJcvOK3u6uJHveA4LB2P+ty9ArBLpTh3AqqPxsyw9l9GMnWBYS9A== +jest-config@^27.2.1: + version "27.2.1" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.2.1.tgz#2e727e023fc4b77a9f067a40c5448a939aa8386b" + integrity sha512-BAOemP8udmFw9nkgaLAac7vXORdvrt4yrJWoh7uYb0nPZeSsu0kGwJU18SwtY4paq9fed5OgAssC3A+Bf4WMQA== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.2.0" + "@jest/test-sequencer" "^27.2.1" "@jest/types" "^27.1.1" - babel-jest "^27.2.0" + babel-jest "^27.2.1" chalk "^4.0.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" is-ci "^3.0.0" - jest-circus "^27.2.0" + jest-circus "^27.2.1" jest-environment-jsdom "^27.2.0" jest-environment-node "^27.2.0" jest-get-type "^27.0.6" - jest-jasmine2 "^27.2.0" + jest-jasmine2 "^27.2.1" jest-regex-util "^27.0.6" jest-resolve "^27.2.0" - jest-runner "^27.2.0" + jest-runner "^27.2.1" jest-util "^27.2.0" jest-validate "^27.2.0" micromatch "^4.0.4" @@ -2063,10 +2063,10 @@ jest-haste-map@^27.2.0: optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.2.0.tgz#1ece0ee37c348b59ed3dfcfe509fc24e3377b12d" - integrity sha512-NcPzZBk6IkDW3Z2V8orGueheGJJYfT5P0zI/vTO/Jp+R9KluUdgFrgwfvZ0A34Kw6HKgiWFILZmh3oQ/eS+UxA== +jest-jasmine2@^27.2.1: + version "27.2.1" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.2.1.tgz#30ee71f38670a621ecf3b6dcb89875933f780de6" + integrity sha512-3vytj3+S49+XYsxGJyjlchDo4xblYzjDY4XK7pV2IAdspbMFOpmeNMOeDonYuvlbUtcV8yrFLA6XtliXapDmMA== dependencies: "@babel/traverse" "^7.1.0" "@jest/environment" "^27.2.0" @@ -2076,13 +2076,13 @@ jest-jasmine2@^27.2.0: "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^27.2.0" + expect "^27.2.1" is-generator-fn "^2.0.0" jest-each "^27.2.0" jest-matcher-utils "^27.2.0" jest-message-util "^27.2.0" - jest-runtime "^27.2.0" - jest-snapshot "^27.2.0" + jest-runtime "^27.2.1" + jest-snapshot "^27.2.1" jest-util "^27.2.0" pretty-format "^27.2.0" throat "^6.0.1" @@ -2138,14 +2138,14 @@ jest-regex-util@^27.0.6: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.6.tgz#02e112082935ae949ce5d13b2675db3d8c87d9c5" integrity sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ== -jest-resolve-dependencies@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.2.0.tgz#b56a1aab95b0fd21e0a69a15fda985c05f902b8a" - integrity sha512-EY5jc/Y0oxn+oVEEldTidmmdVoZaknKPyDORA012JUdqPyqPL+lNdRyI3pGti0RCydds6coaw6xt4JQY54dKsg== +jest-resolve-dependencies@^27.2.1: + version "27.2.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.2.1.tgz#239be969ece749d4dc2e1efcf3d2b86c99525c2e" + integrity sha512-9bKEwmz4YshGPjGZAVZOVw6jt7pq2/FjWJmyhnWhvDuiRCHVZBcJhycinX+e/EJ7jafsq26bTpzBIQas3xql1g== dependencies: "@jest/types" "^27.1.1" jest-regex-util "^27.0.6" - jest-snapshot "^27.2.0" + jest-snapshot "^27.2.1" jest-resolve@^27.2.0: version "27.2.0" @@ -2163,15 +2163,15 @@ jest-resolve@^27.2.0: resolve "^1.20.0" slash "^3.0.0" -jest-runner@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.2.0.tgz#281b255d88a473aebc0b5cb46e58a83a1251cab3" - integrity sha512-Cl+BHpduIc0cIVTjwoyx0pQk4Br8gn+wkr35PmKCmzEdOUnQ2wN7QVXA8vXnMQXSlFkN/+KWnk20TAVBmhgrww== +jest-runner@^27.2.1: + version "27.2.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.2.1.tgz#3443b1fc08b8a50f305dfc2d41dd2badf335843b" + integrity sha512-USHitkUUzcB3Y5mRdzlp+KHgRRR2VsXDq5OeATuDmq1qXfT/RwwnQykUhn+KVx3FotxK3pID74UY7o6HYIR8vA== dependencies: "@jest/console" "^27.2.0" "@jest/environment" "^27.2.0" "@jest/test-result" "^27.2.0" - "@jest/transform" "^27.2.0" + "@jest/transform" "^27.2.1" "@jest/types" "^27.1.1" "@types/node" "*" chalk "^4.0.0" @@ -2185,24 +2185,24 @@ jest-runner@^27.2.0: jest-leak-detector "^27.2.0" jest-message-util "^27.2.0" jest-resolve "^27.2.0" - jest-runtime "^27.2.0" + jest-runtime "^27.2.1" jest-util "^27.2.0" jest-worker "^27.2.0" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.2.0.tgz#998295ccd80008b3031eeb5cc60e801e8551024b" - integrity sha512-6gRE9AVVX49hgBbWQ9PcNDeM4upMUXzTpBs0kmbrjyotyUyIJixLPsYjpeTFwAA07PVLDei1iAm2chmWycdGdQ== +jest-runtime@^27.2.1: + version "27.2.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.2.1.tgz#db506f679356f5b94b7be20e770f2541b7c2b339" + integrity sha512-QJNnwL4iteDE/Jq4TfQK7AjhPoUZflBKTtUIkRnFYFkTAZTP/o8k7ekaROiVjmo+NYop5+DQPqX6pz4vWbZSOQ== dependencies: "@jest/console" "^27.2.0" "@jest/environment" "^27.2.0" "@jest/fake-timers" "^27.2.0" - "@jest/globals" "^27.2.0" + "@jest/globals" "^27.2.1" "@jest/source-map" "^27.0.6" "@jest/test-result" "^27.2.0" - "@jest/transform" "^27.2.0" + "@jest/transform" "^27.2.1" "@jest/types" "^27.1.1" "@types/yargs" "^16.0.0" chalk "^4.0.0" @@ -2217,7 +2217,7 @@ jest-runtime@^27.2.0: jest-mock "^27.1.1" jest-regex-util "^27.0.6" jest-resolve "^27.2.0" - jest-snapshot "^27.2.0" + jest-snapshot "^27.2.1" jest-util "^27.2.0" jest-validate "^27.2.0" slash "^3.0.0" @@ -2232,10 +2232,10 @@ jest-serializer@^27.0.6: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.2.0.tgz#7961e7107ac666a46fbb23e7bb48ce0b8c6a9285" - integrity sha512-MukJvy3KEqemCT2FoT3Gum37CQqso/62PKTfIzWmZVTsLsuyxQmJd2PI5KPcBYFqLlA8LgZLHM8ZlazkVt8LsQ== +jest-snapshot@^27.2.1: + version "27.2.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.2.1.tgz#385accf3bb71ac84e9a6bda4fc9bb458d53abb35" + integrity sha512-8CTg2YrgZuQbPHW7G0YvLTj4yTRXLmSeEO+ka3eC5lbu5dsTRyoDNS1L7x7EFUTyYQhFH9HQG1/TNlbUgR9Lug== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" @@ -2243,13 +2243,13 @@ jest-snapshot@^27.2.0: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/transform" "^27.2.0" + "@jest/transform" "^27.2.1" "@jest/types" "^27.1.1" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.2.0" + expect "^27.2.1" graceful-fs "^4.2.4" jest-diff "^27.2.0" jest-get-type "^27.0.6" @@ -2309,13 +2309,13 @@ jest-worker@^27.2.0: supports-color "^8.0.0" jest@^27.0.1: - version "27.2.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.2.0.tgz#3bc329287d699d26361e2094919630eefdf1ac0d" - integrity sha512-oUqVXyvh5YwEWl263KWdPUAqEzBFzGHdFLQ05hUnITr1tH+9SscEI9A/GH9eBClA+Nw1ct+KNuuOV6wlnmBPcg== + version "27.2.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.2.1.tgz#9263102056fe152fd2478d181cf9bbbd2a6a8da4" + integrity sha512-0MyvNS7J1HbkeotYaqKNGioN+p1/AAPtI1Z8iwMtCBE+PwBT+M4l25D9Pve8/KdhktYLgZaGyyj9CoDytD+R2Q== dependencies: - "@jest/core" "^27.2.0" + "@jest/core" "^27.2.1" import-local "^3.0.2" - jest-cli "^27.2.0" + jest-cli "^27.2.1" js-tokens@^4.0.0: version "4.0.0" From 86b0012bb6c5c3549a62a7daddc5c654dbc95b39 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Sep 2021 12:01:43 +0000 Subject: [PATCH 247/785] Bump @types/node from 16.9.1 to 16.9.4 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.9.1 to 16.9.4. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/yarn.lock b/yarn.lock index d04ccdd8..0e43d6b3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -664,15 +664,10 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.4.tgz#f0ec25dbf2f0e4b18647313ac031134ca5b24b21" integrity sha512-1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA== -"@types/node@*": - version "15.6.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-15.6.1.tgz#32d43390d5c62c5b6ec486a9bc9c59544de39a08" - integrity sha512-7EIraBEyRHEe7CH+Fm1XvgqU6uwZN8Q7jppJGcqjROMT29qhAuuOxYB1uEY5UMYQKEmA5D+5tBnhdaPXSsLONA== - -"@types/node@^16.9.1": - version "16.9.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.9.1.tgz#0611b37db4246c937feef529ddcc018cf8e35708" - integrity sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g== +"@types/node@*", "@types/node@^16.9.1": + version "16.9.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.9.4.tgz#a12f0ee7847cf17a97f6fdf1093cb7a9af23cca4" + integrity sha512-KDazLNYAGIuJugdbULwFZULF9qQ13yNWEBFnfVpqlpgAAo6H/qnM9RjBgh0A0kmHf3XxAKLdN5mTIng9iUvVLA== "@types/prettier@^2.1.5": version "2.2.3" From 3073a629bbc7b5e05b91e404fa08ec39f1fea928 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 21 Sep 2021 09:19:04 -0400 Subject: [PATCH 248/785] Bump transitive dep to remove sec warning --- package.json | 3 + yarn.lock | 672 +++++++++++++++++++++++++-------------------------- 2 files changed, 332 insertions(+), 343 deletions(-) diff --git a/package.json b/package.json index 9ea8f189..8d9dc825 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,9 @@ "ts-node": "^10.2.1", "typescript": "^4.4.3" }, + "resolutions": { + "ansi-regex": "^6.0.1" + }, "eslintConfig": { "extends": [ "eslint:recommended", diff --git a/yarn.lock b/yarn.lock index e760ff29..1ed50f2a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9,32 +9,32 @@ dependencies: "@babel/highlight" "^7.10.4" -"@babel/code-frame@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658" - integrity sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g== +"@babel/code-frame@^7.12.13", "@babel/code-frame@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.14.5.tgz#23b08d740e83f49c5e59945fbf1b43e80bbf4edb" + integrity sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw== dependencies: - "@babel/highlight" "^7.12.13" + "@babel/highlight" "^7.14.5" -"@babel/compat-data@^7.13.15": - version "7.14.0" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.14.0.tgz#a901128bce2ad02565df95e6ecbf195cf9465919" - integrity sha512-vu9V3uMM/1o5Hl5OekMUowo3FqXLJSw+s+66nt0fSWVWTtmosdzn45JHOB3cPtZoe6CTBDzvSw0RdOY85Q37+Q== +"@babel/compat-data@^7.15.0": + version "7.15.0" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.15.0.tgz#2dbaf8b85334796cafbb0f5793a90a2fc010b176" + integrity sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA== "@babel/core@^7.1.0", "@babel/core@^7.7.2", "@babel/core@^7.7.5": - version "7.14.3" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.14.3.tgz#5395e30405f0776067fbd9cf0884f15bfb770a38" - integrity sha512-jB5AmTKOCSJIZ72sd78ECEhuPiDMKlQdDI/4QRI6lzYATx5SSogS1oQA2AoPecRCknm30gHi2l+QVvNUu3wZAg== - dependencies: - "@babel/code-frame" "^7.12.13" - "@babel/generator" "^7.14.3" - "@babel/helper-compilation-targets" "^7.13.16" - "@babel/helper-module-transforms" "^7.14.2" - "@babel/helpers" "^7.14.0" - "@babel/parser" "^7.14.3" - "@babel/template" "^7.12.13" - "@babel/traverse" "^7.14.2" - "@babel/types" "^7.14.2" + version "7.15.5" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.15.5.tgz#f8ed9ace730722544609f90c9bb49162dc3bf5b9" + integrity sha512-pYgXxiwAgQpgM1bNkZsDEq85f0ggXMA5L7c+o3tskGMh2BunCI9QUwB9Z4jpvXUOuMdyGKiGKQiRe11VS6Jzvg== + dependencies: + "@babel/code-frame" "^7.14.5" + "@babel/generator" "^7.15.4" + "@babel/helper-compilation-targets" "^7.15.4" + "@babel/helper-module-transforms" "^7.15.4" + "@babel/helpers" "^7.15.4" + "@babel/parser" "^7.15.5" + "@babel/template" "^7.15.4" + "@babel/traverse" "^7.15.4" + "@babel/types" "^7.15.4" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" @@ -42,137 +42,144 @@ semver "^6.3.0" source-map "^0.5.0" -"@babel/generator@^7.14.2", "@babel/generator@^7.14.3", "@babel/generator@^7.7.2": - version "7.14.3" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.14.3.tgz#0c2652d91f7bddab7cccc6ba8157e4f40dcedb91" - integrity sha512-bn0S6flG/j0xtQdz3hsjJ624h3W0r3llttBMfyHX3YrZ/KtLYr15bjA0FXkgW7FpvrDuTuElXeVjiKlYRpnOFA== +"@babel/generator@^7.15.4", "@babel/generator@^7.7.2": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.15.4.tgz#85acb159a267ca6324f9793986991ee2022a05b0" + integrity sha512-d3itta0tu+UayjEORPNz6e1T3FtvWlP5N4V5M+lhp/CxT4oAA7/NcScnpRyspUMLK6tu9MNHmQHxRykuN2R7hw== dependencies: - "@babel/types" "^7.14.2" + "@babel/types" "^7.15.4" jsesc "^2.5.1" source-map "^0.5.0" -"@babel/helper-compilation-targets@^7.13.16": - version "7.13.16" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.16.tgz#6e91dccf15e3f43e5556dffe32d860109887563c" - integrity sha512-3gmkYIrpqsLlieFwjkGgLaSHmhnvlAYzZLlYVjlW+QwI+1zE17kGxuJGmIqDQdYp56XdmGeD+Bswx0UTyG18xA== +"@babel/helper-compilation-targets@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.4.tgz#cf6d94f30fbefc139123e27dd6b02f65aeedb7b9" + integrity sha512-rMWPCirulnPSe4d+gwdWXLfAXTTBj8M3guAf5xFQJ0nvFY7tfNAFnWdqaHegHlgDZOCT4qvhF3BYlSJag8yhqQ== dependencies: - "@babel/compat-data" "^7.13.15" - "@babel/helper-validator-option" "^7.12.17" - browserslist "^4.14.5" + "@babel/compat-data" "^7.15.0" + "@babel/helper-validator-option" "^7.14.5" + browserslist "^4.16.6" semver "^6.3.0" -"@babel/helper-function-name@^7.14.2": - version "7.14.2" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.14.2.tgz#397688b590760b6ef7725b5f0860c82427ebaac2" - integrity sha512-NYZlkZRydxw+YT56IlhIcS8PAhb+FEUiOzuhFTfqDyPmzAhRge6ua0dQYT/Uh0t/EDHq05/i+e5M2d4XvjgarQ== - dependencies: - "@babel/helper-get-function-arity" "^7.12.13" - "@babel/template" "^7.12.13" - "@babel/types" "^7.14.2" - -"@babel/helper-get-function-arity@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz#bc63451d403a3b3082b97e1d8b3fe5bd4091e583" - integrity sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg== - dependencies: - "@babel/types" "^7.12.13" - -"@babel/helper-member-expression-to-functions@^7.13.12": - version "7.13.12" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz#dfe368f26d426a07299d8d6513821768216e6d72" - integrity sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw== - dependencies: - "@babel/types" "^7.13.12" - -"@babel/helper-module-imports@^7.13.12": - version "7.13.12" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz#c6a369a6f3621cb25da014078684da9196b61977" - integrity sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA== - dependencies: - "@babel/types" "^7.13.12" - -"@babel/helper-module-transforms@^7.14.2": - version "7.14.2" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.14.2.tgz#ac1cc30ee47b945e3e0c4db12fa0c5389509dfe5" - integrity sha512-OznJUda/soKXv0XhpvzGWDnml4Qnwp16GN+D/kZIdLsWoHj05kyu8Rm5kXmMef+rVJZ0+4pSGLkeixdqNUATDA== - dependencies: - "@babel/helper-module-imports" "^7.13.12" - "@babel/helper-replace-supers" "^7.13.12" - "@babel/helper-simple-access" "^7.13.12" - "@babel/helper-split-export-declaration" "^7.12.13" - "@babel/helper-validator-identifier" "^7.14.0" - "@babel/template" "^7.12.13" - "@babel/traverse" "^7.14.2" - "@babel/types" "^7.14.2" - -"@babel/helper-optimise-call-expression@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz#5c02d171b4c8615b1e7163f888c1c81c30a2aaea" - integrity sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA== - dependencies: - "@babel/types" "^7.12.13" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.8.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz#806526ce125aed03373bc416a828321e3a6a33af" - integrity sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ== - -"@babel/helper-replace-supers@^7.13.12": - version "7.14.3" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.14.3.tgz#ca17b318b859d107f0e9b722d58cf12d94436600" - integrity sha512-Rlh8qEWZSTfdz+tgNV/N4gz1a0TMNwCUcENhMjHTHKp3LseYH5Jha0NSlyTQWMnjbYcwFt+bqAMqSLHVXkQ6UA== - dependencies: - "@babel/helper-member-expression-to-functions" "^7.13.12" - "@babel/helper-optimise-call-expression" "^7.12.13" - "@babel/traverse" "^7.14.2" - "@babel/types" "^7.14.2" - -"@babel/helper-simple-access@^7.13.12": - version "7.13.12" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz#dd6c538afb61819d205a012c31792a39c7a5eaf6" - integrity sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA== - dependencies: - "@babel/types" "^7.13.12" - -"@babel/helper-split-export-declaration@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz#e9430be00baf3e88b0e13e6f9d4eaf2136372b05" - integrity sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg== - dependencies: - "@babel/types" "^7.12.13" - -"@babel/helper-validator-identifier@^7.14.0": - version "7.14.0" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz#d26cad8a47c65286b15df1547319a5d0bcf27288" - integrity sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A== - -"@babel/helper-validator-option@^7.12.17": - version "7.12.17" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.12.17.tgz#d1fbf012e1a79b7eebbfdc6d270baaf8d9eb9831" - integrity sha512-TopkMDmLzq8ngChwRlyjR6raKD6gMSae4JdYDB8bByKreQgG0RBTuKe9LRxW3wFtUnjxOPRKBDwEH6Mg5KeDfw== - -"@babel/helpers@^7.14.0": - version "7.14.0" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.14.0.tgz#ea9b6be9478a13d6f961dbb5f36bf75e2f3b8f62" - integrity sha512-+ufuXprtQ1D1iZTO/K9+EBRn+qPWMJjZSw/S0KlFrxCw4tkrzv9grgpDHkY9MeQTjTY8i2sp7Jep8DfU6tN9Mg== - dependencies: - "@babel/template" "^7.12.13" - "@babel/traverse" "^7.14.0" - "@babel/types" "^7.14.0" - -"@babel/highlight@^7.10.4", "@babel/highlight@^7.12.13": - version "7.14.0" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.0.tgz#3197e375711ef6bf834e67d0daec88e4f46113cf" - integrity sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg== - dependencies: - "@babel/helper-validator-identifier" "^7.14.0" +"@babel/helper-function-name@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.15.4.tgz#845744dafc4381a4a5fb6afa6c3d36f98a787ebc" + integrity sha512-Z91cOMM4DseLIGOnog+Z8OI6YseR9bua+HpvLAQ2XayUGU+neTtX+97caALaLdyu53I/fjhbeCnWnRH1O3jFOw== + dependencies: + "@babel/helper-get-function-arity" "^7.15.4" + "@babel/template" "^7.15.4" + "@babel/types" "^7.15.4" + +"@babel/helper-get-function-arity@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.15.4.tgz#098818934a137fce78b536a3e015864be1e2879b" + integrity sha512-1/AlxSF92CmGZzHnC515hm4SirTxtpDnLEJ0UyEMgTMZN+6bxXKg04dKhiRx5Enel+SUA1G1t5Ed/yQia0efrA== + dependencies: + "@babel/types" "^7.15.4" + +"@babel/helper-hoist-variables@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.15.4.tgz#09993a3259c0e918f99d104261dfdfc033f178df" + integrity sha512-VTy085egb3jUGVK9ycIxQiPbquesq0HUQ+tPO0uv5mPEBZipk+5FkRKiWq5apuyTE9FUrjENB0rCf8y+n+UuhA== + dependencies: + "@babel/types" "^7.15.4" + +"@babel/helper-member-expression-to-functions@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.4.tgz#bfd34dc9bba9824a4658b0317ec2fd571a51e6ef" + integrity sha512-cokOMkxC/BTyNP1AlY25HuBWM32iCEsLPI4BHDpJCHHm1FU2E7dKWWIXJgQgSFiu4lp8q3bL1BIKwqkSUviqtA== + dependencies: + "@babel/types" "^7.15.4" + +"@babel/helper-module-imports@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.15.4.tgz#e18007d230632dea19b47853b984476e7b4e103f" + integrity sha512-jeAHZbzUwdW/xHgHQ3QmWR4Jg6j15q4w/gCfwZvtqOxoo5DKtLHk8Bsf4c5RZRC7NmLEs+ohkdq8jFefuvIxAA== + dependencies: + "@babel/types" "^7.15.4" + +"@babel/helper-module-transforms@^7.15.4": + version "7.15.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.15.7.tgz#7da80c8cbc1f02655d83f8b79d25866afe50d226" + integrity sha512-ZNqjjQG/AuFfekFTY+7nY4RgBSklgTu970c7Rj3m/JOhIu5KPBUuTA9AY6zaKcUvk4g6EbDXdBnhi35FAssdSw== + dependencies: + "@babel/helper-module-imports" "^7.15.4" + "@babel/helper-replace-supers" "^7.15.4" + "@babel/helper-simple-access" "^7.15.4" + "@babel/helper-split-export-declaration" "^7.15.4" + "@babel/helper-validator-identifier" "^7.15.7" + "@babel/template" "^7.15.4" + "@babel/traverse" "^7.15.4" + "@babel/types" "^7.15.6" + +"@babel/helper-optimise-call-expression@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.15.4.tgz#f310a5121a3b9cc52d9ab19122bd729822dee171" + integrity sha512-E/z9rfbAOt1vDW1DR7k4SzhzotVV5+qMciWV6LaG1g4jeFrkDlJedjtV4h0i4Q/ITnUu+Pk08M7fczsB9GXBDw== + dependencies: + "@babel/types" "^7.15.4" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.8.0": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz#5ac822ce97eec46741ab70a517971e443a70c5a9" + integrity sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ== + +"@babel/helper-replace-supers@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.15.4.tgz#52a8ab26ba918c7f6dee28628b07071ac7b7347a" + integrity sha512-/ztT6khaXF37MS47fufrKvIsiQkx1LBRvSJNzRqmbyeZnTwU9qBxXYLaaT/6KaxfKhjs2Wy8kG8ZdsFUuWBjzw== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.15.4" + "@babel/helper-optimise-call-expression" "^7.15.4" + "@babel/traverse" "^7.15.4" + "@babel/types" "^7.15.4" + +"@babel/helper-simple-access@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.15.4.tgz#ac368905abf1de8e9781434b635d8f8674bcc13b" + integrity sha512-UzazrDoIVOZZcTeHHEPYrr1MvTR/K+wgLg6MY6e1CJyaRhbibftF6fR2KU2sFRtI/nERUZR9fBd6aKgBlIBaPg== + dependencies: + "@babel/types" "^7.15.4" + +"@babel/helper-split-export-declaration@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz#aecab92dcdbef6a10aa3b62ab204b085f776e257" + integrity sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw== + dependencies: + "@babel/types" "^7.15.4" + +"@babel/helper-validator-identifier@^7.14.5", "@babel/helper-validator-identifier@^7.14.9", "@babel/helper-validator-identifier@^7.15.7": + version "7.15.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz#220df993bfe904a4a6b02ab4f3385a5ebf6e2389" + integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w== + +"@babel/helper-validator-option@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" + integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow== + +"@babel/helpers@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.15.4.tgz#5f40f02050a3027121a3cf48d497c05c555eaf43" + integrity sha512-V45u6dqEJ3w2rlryYYXf6i9rQ5YMNu4FLS6ngs8ikblhu2VdR1AqAd6aJjBzmf2Qzh6KOLqKHxEN9+TFbAkAVQ== + dependencies: + "@babel/template" "^7.15.4" + "@babel/traverse" "^7.15.4" + "@babel/types" "^7.15.4" + +"@babel/highlight@^7.10.4", "@babel/highlight@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9" + integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg== + dependencies: + "@babel/helper-validator-identifier" "^7.14.5" chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.14.2", "@babel/parser@^7.14.3", "@babel/parser@^7.7.2": - version "7.14.3" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.3.tgz#9b530eecb071fd0c93519df25c5ff9f14759f298" - integrity sha512-7MpZDIfI7sUC5zWo2+foJ50CSI5lcqDehZ0lVgIhSi4bFEk94fLAKlF3Q0nzSQQ+ca0lm+O6G9ztKVBeu8PMRQ== +"@babel/parser@^7.1.0", "@babel/parser@^7.15.4", "@babel/parser@^7.15.5", "@babel/parser@^7.7.2": + version "7.15.7" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.7.tgz#0c3ed4a2eb07b165dfa85b3cc45c727334c4edae" + integrity sha512-rycZXvQ+xS9QyIcJ9HXeDWf1uxqlbVFAUq0Rq0dbc50Zb/+wUe/ehyfzGfm9KZZF0kBejYgxltBXocP+gKdL2g== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -252,48 +259,49 @@ "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-top-level-await@^7.8.3": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.13.tgz#c5f0fa6e249f5b739727f923540cf7a806130178" - integrity sha512-A81F9pDwyS7yM//KwbCSDqy3Uj4NMIurtplxphWxoYtNPov7cJsDkAFNNyVlIZ3jwGycVsurZ+LtOA8gZ376iQ== + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" + integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== dependencies: - "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-typescript@^7.7.2": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.12.13.tgz#9dff111ca64154cef0f4dc52cf843d9f12ce4474" - integrity sha512-cHP3u1JiUiG2LFDKbXnwVad81GvfyIOmCD6HIEId6ojrY0Drfy2q1jw7BwN7dE84+kTnBjLkXoL3IEy/3JPu2w== - dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - -"@babel/template@^7.12.13", "@babel/template@^7.3.3": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327" - integrity sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA== - dependencies: - "@babel/code-frame" "^7.12.13" - "@babel/parser" "^7.12.13" - "@babel/types" "^7.12.13" - -"@babel/traverse@^7.1.0", "@babel/traverse@^7.14.0", "@babel/traverse@^7.14.2", "@babel/traverse@^7.7.2": - version "7.14.2" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.14.2.tgz#9201a8d912723a831c2679c7ebbf2fe1416d765b" - integrity sha512-TsdRgvBFHMyHOOzcP9S6QU0QQtjxlRpEYOy3mcCO5RgmC305ki42aSAmfZEMSSYBla2oZ9BMqYlncBaKmD/7iA== - dependencies: - "@babel/code-frame" "^7.12.13" - "@babel/generator" "^7.14.2" - "@babel/helper-function-name" "^7.14.2" - "@babel/helper-split-export-declaration" "^7.12.13" - "@babel/parser" "^7.14.2" - "@babel/types" "^7.14.2" + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.14.5.tgz#b82c6ce471b165b5ce420cf92914d6fb46225716" + integrity sha512-u6OXzDaIXjEstBRRoBCQ/uKQKlbuaeE5in0RvWdA4pN6AhqxTIwUsnHPU1CFZA/amYObMsuWhYfRl3Ch90HD0Q== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/template@^7.15.4", "@babel/template@^7.3.3": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.15.4.tgz#51898d35dcf3faa670c4ee6afcfd517ee139f194" + integrity sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg== + dependencies: + "@babel/code-frame" "^7.14.5" + "@babel/parser" "^7.15.4" + "@babel/types" "^7.15.4" + +"@babel/traverse@^7.1.0", "@babel/traverse@^7.15.4", "@babel/traverse@^7.7.2": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.15.4.tgz#ff8510367a144bfbff552d9e18e28f3e2889c22d" + integrity sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA== + dependencies: + "@babel/code-frame" "^7.14.5" + "@babel/generator" "^7.15.4" + "@babel/helper-function-name" "^7.15.4" + "@babel/helper-hoist-variables" "^7.15.4" + "@babel/helper-split-export-declaration" "^7.15.4" + "@babel/parser" "^7.15.4" + "@babel/types" "^7.15.4" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.12.13", "@babel/types@^7.13.12", "@babel/types@^7.14.0", "@babel/types@^7.14.2", "@babel/types@^7.3.0", "@babel/types@^7.3.3": - version "7.14.2" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.14.2.tgz#4208ae003107ef8a057ea8333e56eb64d2f6a2c3" - integrity sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw== +"@babel/types@^7.0.0", "@babel/types@^7.15.4", "@babel/types@^7.15.6", "@babel/types@^7.3.0", "@babel/types@^7.3.3": + version "7.15.6" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.15.6.tgz#99abdc48218b2881c058dd0a7ab05b99c9be758f" + integrity sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig== dependencies: - "@babel/helper-validator-identifier" "^7.14.0" + "@babel/helper-validator-identifier" "^7.14.9" to-fast-properties "^2.0.0" "@bcoe/v8-coverage@^0.2.3": @@ -556,9 +564,9 @@ type-detect "4.0.8" "@sinonjs/fake-timers@^7.0.2": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-7.1.0.tgz#8f13af27d842cbf51ad4502e05562fe9391d084e" - integrity sha512-hAEzXi6Wbvlb67NnGMGSNOeAflLVnMa4yliPU/ty1qjgW/vAletH15/v/esJwASSIA0YlIyjnloenFbEZc9q9A== + version "7.1.2" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-7.1.2.tgz#2524eae70c4910edccf99b2f4e6efc5894aff7b5" + integrity sha512-iQADsW4LBMISqZ6Ci1dupJL9pprqwcVFTcOsEmQOEhW+KLCVn/Y4Jrvg2k19fIHCp+iFprriYPTdRcQR8NbUPg== dependencies: "@sinonjs/commons" "^1.7.0" @@ -588,9 +596,9 @@ integrity sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA== "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": - version "7.1.14" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.14.tgz#faaeefc4185ec71c389f4501ee5ec84b170cc402" - integrity sha512-zGZJzzBUVDo/eV6KgbE0f0ZI7dInEYvo12Rb70uNQDshC3SkRMb67ja0GgRHZgAX3Za6rhaWlvbDO8rrGyAb1g== + version "7.1.16" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.16.tgz#bc12c74b7d65e82d29876b5d0baf5c625ac58702" + integrity sha512-EAEHtisTMM+KaKwfWdC3oyllIqswlznXCIVCt7/oRNrh+DhgT4UEBNC/jlADNjvw7UnfbcdkGQcPVZ1xYiLcrQ== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" @@ -599,24 +607,24 @@ "@types/babel__traverse" "*" "@types/babel__generator@*": - version "7.6.2" - resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.2.tgz#f3d71178e187858f7c45e30380f8f1b7415a12d8" - integrity sha512-MdSJnBjl+bdwkLskZ3NGFp9YcXGx5ggLpQQPqtgakVhsWK0hTtNYhjpZLlWQTviGTvF8at+Bvli3jV7faPdgeQ== + version "7.6.3" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.3.tgz#f456b4b2ce79137f768aa130d2423d2f0ccfaba5" + integrity sha512-/GWCmzJWqV7diQW54smJZzWbSFf4QYtF71WCKhcx6Ru/tFyQIY2eiiITcCAeuPbNSvT9YCGkVMqqvSk2Z0mXiA== dependencies: "@babel/types" "^7.0.0" "@types/babel__template@*": - version "7.4.0" - resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.0.tgz#0c888dd70b3ee9eebb6e4f200e809da0076262be" - integrity sha512-NTPErx4/FiPCGScH7foPyr+/1Dkzkni+rHiYHHoTjvwou7AQzJkNeD60A9CXRy+ZEN2B1bggmkTMCDb+Mv5k+A== + version "7.4.1" + resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.1.tgz#3d1a48fd9d6c0edfd56f2ff578daed48f36c8969" + integrity sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.4", "@types/babel__traverse@^7.0.6": - version "7.11.1" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.11.1.tgz#654f6c4f67568e24c23b367e947098c6206fa639" - integrity sha512-Vs0hm0vPahPMYi9tDjtP66llufgO3ST16WXaSTtDGEl9cewAl3AibmxWw6TINOqHPT9z0uABKAYjT9jNSg4npw== + version "7.14.2" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.14.2.tgz#ffcd470bbb3f8bf30481678fb5502278ca833a43" + integrity sha512-K2waXdXBi2302XUdcHcR1jCeU0LL4TD9HRs/gk0N2Xvrht+G/BfJa4QObBQZfhMdxiCpV3COl5Nfq4uKTeTnJA== dependencies: "@babel/types" "^7.3.0" @@ -640,9 +648,9 @@ "@types/istanbul-lib-coverage" "*" "@types/istanbul-reports@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz#508b13aa344fa4976234e75dddcc34925737d821" - integrity sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA== + version "3.0.1" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz#9153fe98bba2bd565a63add9436d6f0d7f8468ff" + integrity sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw== dependencies: "@types/istanbul-lib-report" "*" @@ -660,39 +668,34 @@ integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== "@types/minimatch@^3.0.3": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.4.tgz#f0ec25dbf2f0e4b18647313ac031134ca5b24b21" - integrity sha512-1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA== + version "3.0.5" + resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" + integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^16.9.1": version "16.9.4" resolved "https://registry.yarnpkg.com/@types/node/-/node-16.9.4.tgz#a12f0ee7847cf17a97f6fdf1093cb7a9af23cca4" integrity sha512-KDazLNYAGIuJugdbULwFZULF9qQ13yNWEBFnfVpqlpgAAo6H/qnM9RjBgh0A0kmHf3XxAKLdN5mTIng9iUvVLA== -"@types/prettier@^2.1.5": - version "2.2.3" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.2.3.tgz#ef65165aea2924c9359205bf748865b8881753c0" - integrity sha512-PijRCG/K3s3w1We6ynUKdxEc5AcuuH3NBmMDP8uvKVp6X43UY7NQlTzczakXP3DJR0F4dfNQIGjU2cUeRYs2AA== - -"@types/prettier@^2.3.2": +"@types/prettier@^2.1.5", "@types/prettier@^2.3.2": version "2.3.2" resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.3.2.tgz#fc8c2825e4ed2142473b4a81064e6e081463d1b3" integrity sha512-eI5Yrz3Qv4KPUa/nSIAi0h+qX0XyewOliug5F2QAtuRg6Kjg6jfmxe1GIwoIRhZspD1A0RP8ANrPwvEXXtRFog== "@types/stack-utils@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.0.tgz#7036640b4e21cc2f259ae826ce843d277dad8cff" - integrity sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw== + version "2.0.1" + resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" + integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== "@types/yargs-parser@*": - version "20.2.0" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.0.tgz#dd3e6699ba3237f0348cd085e4698780204842f9" - integrity sha512-37RSHht+gzzgYeobbG+KWryeAW8J33Nhr69cjTqSYymXVZEN9NbRYWoYlRtDhHKPVT1FyNKwaTPC1NynKZpzRA== + version "20.2.1" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.1.tgz#3b9ce2489919d9e4fea439b76916abc34b2df129" + integrity sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw== "@types/yargs@^16.0.0": - version "16.0.3" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.3.tgz#4b6d35bb8e680510a7dc2308518a80ee1ef27e01" - integrity sha512-YlFfTGS+zqCgXuXNV26rOIeETOkXnGQXP/pjjL9P0gO/EP9jTmc7pUBhx+jVEIxpq41RX33GQ7N3DzOSfZoglQ== + version "16.0.4" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.4.tgz#26aad98dd2c2a38e421086ea9ad42b9e51642977" + integrity sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw== dependencies: "@types/yargs-parser" "*" @@ -779,9 +782,9 @@ acorn-globals@^6.0.0: acorn-walk "^7.1.1" acorn-jsx@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" - integrity sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng== + version "5.3.2" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" + integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== acorn-walk@^7.1.1: version "7.2.0" @@ -798,12 +801,7 @@ acorn@^7.1.1, acorn@^7.4.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.2.4: - version "8.2.4" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.2.4.tgz#caba24b08185c3b56e3168e97d15ed17f4d31fd0" - integrity sha512-Ibt84YwBDDA890eDiDCEqcbwvHlBvzzDkU2cGBBDDI1QWT12jTiXIOn2CIw5KK4i6N5Z2HUxwYjzriDyqaqqZg== - -acorn@^8.4.1: +acorn@^8.2.4, acorn@^8.4.1: version "8.5.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.5.0.tgz#4512ccb99b3698c752591e9bb4472e38ad43cee2" integrity sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q== @@ -826,9 +824,9 @@ ajv@^6.10.0, ajv@^6.12.4: uri-js "^4.2.2" ajv@^8.0.1: - version "8.5.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.5.0.tgz#695528274bcb5afc865446aa275484049a18ae4b" - integrity sha512-Y2l399Tt1AguU3BPRP9Fn4eN+Or+StUGWCUpbnFyXSo8NZ9S4uj+AG2pjs5apK+ZMOwYOz1+a+VKvKH7CudXgQ== + version "8.6.3" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.6.3.tgz#11a66527761dc3e9a3845ea775d2d3c0414e8764" + integrity sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw== dependencies: fast-deep-equal "^3.1.1" json-schema-traverse "^1.0.0" @@ -847,10 +845,10 @@ ansi-escapes@^4.2.1: dependencies: type-fest "^0.21.3" -ansi-regex@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" - integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== +ansi-regex@^5.0.0, ansi-regex@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" + integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== ansi-styles@^3.2.1: version "3.2.1" @@ -1002,16 +1000,16 @@ browser-process-hrtime@^1.0.0: resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== -browserslist@^4.14.5: - version "4.16.6" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.6.tgz#d7901277a5a88e554ed305b183ec9b0c08f66fa2" - integrity sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ== +browserslist@^4.16.6: + version "4.17.0" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.0.tgz#1fcd81ec75b41d6d4994fb0831b92ac18c01649c" + integrity sha512-g2BJ2a0nEYvEFQC208q8mVAhfNwpZ5Mu8BwgtCdZKO3qx98HChmeg448fPdUzld8aFmfLgVh7yymqV+q1lJZ5g== dependencies: - caniuse-lite "^1.0.30001219" - colorette "^1.2.2" - electron-to-chromium "^1.3.723" + caniuse-lite "^1.0.30001254" + colorette "^1.3.0" + electron-to-chromium "^1.3.830" escalade "^3.1.1" - node-releases "^1.1.71" + node-releases "^1.1.75" bs-logger@0.x: version "0.2.6" @@ -1028,9 +1026,9 @@ bser@2.1.1: node-int64 "^0.4.0" buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== callsites@^3.0.0: version "3.1.0" @@ -1047,10 +1045,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== -caniuse-lite@^1.0.30001219: - version "1.0.30001230" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001230.tgz#8135c57459854b2240b57a4a6786044bdc5a9f71" - integrity sha512-5yBd5nWCBS+jWKTcHOzXwo5xzcj4ePE/yjtkZyUV1BTUmrBaA9MRGC+e7mxnqXSA90CmCA8L3eKLaSUkt099IQ== +caniuse-lite@^1.0.30001254: + version "1.0.30001259" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001259.tgz#ae21691d3da9c4be6144403ac40f71d9f6efd790" + integrity sha512-V7mQTFhjITxuk9zBpI6nYsiTXhcPe05l+364nZjK7MFK/E7ibvYBSAXr4YcA6oPR8j3ZLM/LN+lUqUVAQEUZFg== chalk@^2.0.0: version "2.4.2" @@ -1070,9 +1068,9 @@ chalk@^3.0.0: supports-color "^7.1.0" chalk@^4.0.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.1.tgz#c80b3fab28bf6371e6863325eee67e618b77e6ad" - integrity sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg== + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== dependencies: ansi-styles "^4.1.0" supports-color "^7.1.0" @@ -1083,14 +1081,14 @@ char-regex@^1.0.2: integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== ci-info@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.1.1.tgz#9a32fcefdf7bcdb6f0a7e1c0f8098ec57897b80a" - integrity sha512-kdRWLBIJwdsYJWYJFtAFFYxybguqeF91qpZaggjG5Nf8QKdizFG2hjqvaTXbxFIcYbSaD74KpAXv6BSm17DHEQ== + version "3.2.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.2.0.tgz#2876cb948a498797b5236f0095bc057d0dca38b6" + integrity sha512-dVqRX7fLUm8J6FgHJ418XuIgDLZDkYcDFTeL6TA2gt5WlIZUQrrH6EZrNClwT/H0FateUsZkGIOPRrLbP+PR9A== cjs-module-lexer@^1.0.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.1.tgz#2fd46d9906a126965aa541345c499aaa18e8cd73" - integrity sha512-jVamGdJPDeuQilKhvVn1h3knuMOZzr8QDnpk+M9aMlCaMkTDd6fBWPhiDqFvFZ07pL0liqabAiuy8SY4jGHeaw== + version "1.2.2" + resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40" + integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA== cliui@^7.0.2: version "7.0.4" @@ -1135,10 +1133,10 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -colorette@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94" - integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w== +colorette@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.4.0.tgz#5190fbb87276259a86ad700bff2c6d6faa3fca40" + integrity sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g== combined-stream@^1.0.8: version "1.0.8" @@ -1153,9 +1151,9 @@ concat-map@0.0.1: integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" - integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== + version "1.8.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" + integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== dependencies: safe-buffer "~5.1.1" @@ -1199,14 +1197,7 @@ data-urls@^2.0.0: whatwg-mimetype "^2.3.0" whatwg-url "^8.0.0" -debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" - integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== - dependencies: - ms "2.1.2" - -debug@^4.3.1: +debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: version "4.3.2" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== @@ -1214,9 +1205,9 @@ debug@^4.3.1: ms "2.1.2" decimal.js@^10.2.1: - version "10.2.1" - resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.2.1.tgz#238ae7b0f0c793d3e3cea410108b35a2c01426a3" - integrity sha512-KaL7+6Fw6i5A2XSnsbhm/6B+NuEA7TZ4vqxnd5tXz9sbKtrN9Srj8ab4vKVdK8YAqZO9P1kg45Y6YLoduPf+kw== + version "10.3.1" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.3.1.tgz#d8c3a444a9c6774ba60ca6ad7261c3a94fd5e783" + integrity sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ== dedent@^0.7.0: version "0.7.0" @@ -1224,9 +1215,9 @@ dedent@^0.7.0: integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= deep-is@^0.1.3, deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + version "0.1.4" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== deepmerge@^4.2.2: version "4.2.2" @@ -1274,10 +1265,10 @@ domexception@^2.0.1: dependencies: webidl-conversions "^5.0.0" -electron-to-chromium@^1.3.723: - version "1.3.739" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.739.tgz#f07756aa92cabd5a6eec6f491525a64fe62f98b9" - integrity sha512-+LPJVRsN7hGZ9EIUUiWCpO7l4E3qBYHNadazlucBfsXBbccDFNKUBAgzE68FnkWGJPwD/AfKhSzL+G+Iqb8A4A== +electron-to-chromium@^1.3.830: + version "1.3.845" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.845.tgz#326d3be3ee5d2c065f689119d441c997f9fd41d8" + integrity sha512-y0RorqmExFDI4RjLEC6j365bIT5UAXf9WIRcknvSFHVhbC/dRnCgJnPA3DUUW6SCC85QGKEafgqcHJ6uPdEP1Q== emittery@^0.8.1: version "0.8.1" @@ -1477,9 +1468,9 @@ execa@^4.0.0: strip-final-newline "^2.0.0" execa@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-5.0.0.tgz#4029b0007998a841fbd1032e5f4de86a3c1e3376" - integrity sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ== + version "5.1.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" + integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== dependencies: cross-spawn "^7.0.3" get-stream "^6.0.0" @@ -1579,9 +1570,9 @@ flat-cache@^3.0.4: rimraf "^3.0.2" flatted@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.1.1.tgz#c4b489e80096d9df1dfc97c79871aea7c617c469" - integrity sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA== + version "3.2.2" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.2.tgz#64bfed5cb68fe3ca78b3eb214ad97b63bedce561" + integrity sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA== form-data@^3.0.0: version "3.0.1" @@ -1664,9 +1655,9 @@ globals@^11.1.0: integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== globals@^13.6.0, globals@^13.9.0: - version "13.9.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.9.0.tgz#4bf2bf635b334a173fb1daf7c5e6b218ecdc06cb" - integrity sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA== + version "13.11.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.11.0.tgz#40ef678da117fe7bd2e28f1fab24951bd0255be7" + integrity sha512-08/xrJ7wQjK9kkkRoI3OFUBbLx4f+6x3SGwcPvQ0QH6goFDrOU2oyAWrmh3dJezu65buo+HBMzAMQy6rovVC3g== dependencies: type-fest "^0.20.2" @@ -1683,9 +1674,9 @@ globby@^11.0.3: slash "^3.0.0" graceful-fs@^4.2.4: - version "4.2.6" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee" - integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ== + version "4.2.8" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" + integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== has-flag@^3.0.0: version "3.0.0" @@ -1807,9 +1798,9 @@ is-ci@^3.0.0: ci-info "^3.1.1" is-core-module@^2.2.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.4.0.tgz#8e9fc8e15027b011418026e98f0e6f4d86305cc1" - integrity sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A== + version "2.6.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.6.0.tgz#d7553b2526fe59b92ba3e40c8df757ec8a709e19" + integrity sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ== dependencies: has "^1.0.3" @@ -1846,9 +1837,9 @@ is-potential-custom-element-name@^1.0.1: integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== is-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" - integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" + integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== is-typedarray@^1.0.0: version "1.0.0" @@ -2326,9 +2317,9 @@ js-yaml@^3.13.1: esprima "^4.0.0" jsdom@^16.6.0: - version "16.6.0" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.6.0.tgz#f79b3786682065492a3da6a60a4695da983805ac" - integrity sha512-Ty1vmF4NHJkolaEmdjtxTfSfkdb8Ywarwf63f+F8/mDD1uLSSWDxDuMiZxiPhwunLrn9LOSVItWj4bLYsLN3Dg== + version "16.7.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.7.0.tgz#918ae71965424b197c819f8183a754e18977b710" + integrity sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw== dependencies: abab "^2.0.5" acorn "^8.2.4" @@ -2355,7 +2346,7 @@ jsdom@^16.6.0: whatwg-encoding "^1.0.5" whatwg-mimetype "^2.3.0" whatwg-url "^8.5.0" - ws "^7.4.5" + ws "^7.4.6" xml-name-validator "^3.0.0" jsesc@^2.5.1: @@ -2482,17 +2473,17 @@ micromatch@^4.0.4: braces "^3.0.1" picomatch "^2.2.3" -mime-db@1.47.0: - version "1.47.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.47.0.tgz#8cb313e59965d3c05cfbf898915a267af46a335c" - integrity sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw== +mime-db@1.49.0: + version "1.49.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.49.0.tgz#f3dfde60c99e9cf3bc9701d687778f537001cbed" + integrity sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA== mime-types@^2.1.12: - version "2.1.30" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.30.tgz#6e7be8b4c479825f85ed6326695db73f9305d62d" - integrity sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg== + version "2.1.32" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.32.tgz#1d00e89e7de7fe02008db61001d9e02852670fd5" + integrity sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A== dependencies: - mime-db "1.47.0" + mime-db "1.49.0" mimic-fn@^2.1.0: version "2.1.0" @@ -2512,9 +2503,9 @@ minimist@^1.2.5: integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== mri@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/mri/-/mri-1.1.6.tgz#49952e1044db21dbf90f6cd92bc9c9a777d415a6" - integrity sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ== + version "1.2.0" + resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b" + integrity sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA== ms@2.1.2: version "2.1.2" @@ -2547,10 +2538,10 @@ node-modules-regexp@^1.0.0: resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= -node-releases@^1.1.71: - version "1.1.72" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.72.tgz#14802ab6b1039a79a0c7d662b610a5bbd76eacbe" - integrity sha512-LLUo+PpH3dU6XizX3iVoubUNheF/owjXCZZ5yACDxNnPtgFuludV1ZL3ayK1kVep42Rmm0+R9/Y60NQbZ2bifw== +node-releases@^1.1.75: + version "1.1.76" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.76.tgz#df245b062b0cafbd5282ab6792f7dccc2d97f36e" + integrity sha512-9/IECtNr8dXNmPWmFXepT0/7o5eolGesHUa3mtr0KlgnCvnZxwh2qensKL42JJY2vQKC3nIBXetFAqR+PW1CmA== normalize-path@^3.0.0: version "3.0.0" @@ -2766,9 +2757,9 @@ react-is@^17.0.1: integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== regexpp@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2" - integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q== + version "3.2.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" + integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== require-directory@^2.1.1: version "2.1.1" @@ -2866,9 +2857,9 @@ shebang-regex@^3.0.0: integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== signal-exit@^3.0.2, signal-exit@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" - integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== + version "3.0.4" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.4.tgz#366a4684d175b9cab2081e3681fda3747b6c51d7" + integrity sha512-rqYhcAnZ6d/vTPGghdrw7iumdcbXpsk1b8IG/rz+VWV51DM0p7XCtMoJ3qhPLIbp3tvyt3pKRbaaEMZYpHto8Q== sisteransi@^1.0.5: version "1.0.5" @@ -2890,9 +2881,9 @@ slice-ansi@^4.0.0: is-fullwidth-code-point "^3.0.0" source-map-support@^0.5.6: - version "0.5.19" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" - integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== + version "0.5.20" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9" + integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -2918,9 +2909,9 @@ sprintf-js@~1.0.2: integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= stack-utils@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.3.tgz#cd5f030126ff116b78ccb3c027fe302713b61277" - integrity sha512-gL//fkxfWUsIlFL2Tl42Cl6+HFALEaB1FU76I/Fy+oZjRreP7OPMXFlGbxM7NQsI0ZpUfw76sHnv0WNYuTb7Iw== + version "2.0.5" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.5.tgz#d25265fca995154659dbbfba3b49254778d2fdd5" + integrity sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA== dependencies: escape-string-regexp "^2.0.0" @@ -3062,7 +3053,7 @@ tough-cookie@^4.0.0: punycode "^2.1.1" universalify "^0.1.2" -tr46@^2.0.2: +tr46@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.1.0.tgz#fa87aa81ca5d5941da8cbf1f9b749dc969a4e240" integrity sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw== @@ -3224,12 +3215,12 @@ whatwg-mimetype@^2.3.0: integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== whatwg-url@^8.0.0, whatwg-url@^8.5.0: - version "8.5.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.5.0.tgz#7752b8464fc0903fec89aa9846fc9efe07351fd3" - integrity sha512-fy+R77xWv0AiqfLl4nuGUlQ3/6b5uNfQ4WAbGQVMYshCTCCPK9psC1nWh3XHuxGVCtlcDDQPQW1csmmIQo+fwg== + version "8.7.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.7.0.tgz#656a78e510ff8f3937bc0bcbe9f5c0ac35941b77" + integrity sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg== dependencies: lodash "^4.7.0" - tr46 "^2.0.2" + tr46 "^2.1.0" webidl-conversions "^6.1.0" which@^2.0.1: @@ -3268,10 +3259,10 @@ write-file-atomic@^3.0.0: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" -ws@^7.4.5: - version "7.4.6" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" - integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== +ws@^7.4.6: + version "7.5.5" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.5.tgz#8b4bc4af518cfabd0473ae4f99144287b33eb881" + integrity sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w== xml-name-validator@^3.0.0: version "3.0.0" @@ -3293,16 +3284,11 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yargs-parser@20.x: +yargs-parser@20.x, yargs-parser@^20.2.2: version "20.2.9" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== -yargs-parser@^20.2.2: - version "20.2.7" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.7.tgz#61df85c113edfb5a7a4e36eb8aa60ef423cbc90a" - integrity sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw== - yargs@^16.0.3: version "16.2.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" From 86e4bcd50dfe16431c3c3d74c3e1fe866c9cc365 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 21 Sep 2021 09:23:24 -0400 Subject: [PATCH 249/785] netcat.js -> netcat.ts --- package.json | 2 +- src/parser/{netcat.js => netcat.ts} | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) rename src/parser/{netcat.js => netcat.ts} (66%) diff --git a/package.json b/package.json index 8d9dc825..8fdc5e38 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "checkFormat": "prettier --check '**/*'", "lint": "eslint --cache .", - "prepublishOnly": "tsc -p tsconfig.build.json && cp src/parser/netcat.js dist/parser && cp src/parser/server.rb dist/parser && cp src/haml/parser.rb dist/haml && cp src/rbs/parser.rb dist/rbs && cp src/ruby/parser.rb dist/ruby", + "prepublishOnly": "tsc -p tsconfig.build.json && cp src/parser/server.rb dist/parser && cp src/haml/parser.rb dist/haml && cp src/rbs/parser.rb dist/rbs && cp src/ruby/parser.rb dist/ruby", "test": "jest" }, "repository": { diff --git a/src/parser/netcat.js b/src/parser/netcat.ts similarity index 66% rename from src/parser/netcat.js rename to src/parser/netcat.ts index 4a6971a0..26f29716 100644 --- a/src/parser/netcat.js +++ b/src/parser/netcat.ts @@ -2,11 +2,10 @@ // On average, this is 2-3x slower than netcat, but still much faster than // spawning a new Ruby process. -// eslint-disable-next-line @typescript-eslint/no-var-requires -const { createConnection } = require("net"); +import { Socket, createConnection } from "net"; const sock = process.argv[process.argv.length - 1]; -const client = createConnection(sock, () => process.stdin.pipe(client)); +const client: Socket = createConnection(sock, () => process.stdin.pipe(client)); client.on("data", (data) => process.stdout.write(data)); client.on("error", (error) => { From 66d76b938bd4a67f625981fbdf3620945fd3237d Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 21 Sep 2021 10:13:47 -0400 Subject: [PATCH 250/785] Revert netcat back to JavaScript --- package.json | 2 +- src/parser/{netcat.ts => netcat.js} | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename src/parser/{netcat.ts => netcat.js} (73%) diff --git a/package.json b/package.json index 8fdc5e38..8d9dc825 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "checkFormat": "prettier --check '**/*'", "lint": "eslint --cache .", - "prepublishOnly": "tsc -p tsconfig.build.json && cp src/parser/server.rb dist/parser && cp src/haml/parser.rb dist/haml && cp src/rbs/parser.rb dist/rbs && cp src/ruby/parser.rb dist/ruby", + "prepublishOnly": "tsc -p tsconfig.build.json && cp src/parser/netcat.js dist/parser && cp src/parser/server.rb dist/parser && cp src/haml/parser.rb dist/haml && cp src/rbs/parser.rb dist/rbs && cp src/ruby/parser.rb dist/ruby", "test": "jest" }, "repository": { diff --git a/src/parser/netcat.ts b/src/parser/netcat.js similarity index 73% rename from src/parser/netcat.ts rename to src/parser/netcat.js index 26f29716..c36e465a 100644 --- a/src/parser/netcat.ts +++ b/src/parser/netcat.js @@ -2,10 +2,10 @@ // On average, this is 2-3x slower than netcat, but still much faster than // spawning a new Ruby process. -import { Socket, createConnection } from "net"; +const { createConnection } = require("net"); const sock = process.argv[process.argv.length - 1]; -const client: Socket = createConnection(sock, () => process.stdin.pipe(client)); +const client = createConnection(sock, () => process.stdin.pipe(client)); client.on("data", (data) => process.stdout.write(data)); client.on("error", (error) => { From bdd08143a9cc8a28fbd846e80b3798882e3abc65 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 21 Sep 2021 10:22:15 -0400 Subject: [PATCH 251/785] Remove deprecated concat usage --- CONTRIBUTING.md | 15 +-- package.json | 5 +- src/haml/embed.ts | 27 ++-- src/haml/printer.ts | 152 ++++++++-------------- src/rbs/printer.ts | 204 +++++++++++++----------------- src/ruby/embed.ts | 51 +++----- src/ruby/nodes/alias.ts | 26 ++-- src/ruby/nodes/aref.ts | 19 ++- src/ruby/nodes/args.ts | 73 ++++------- src/ruby/nodes/arrays.ts | 41 +++--- src/ruby/nodes/assign.ts | 22 ++-- src/ruby/nodes/blocks.ts | 32 ++--- src/ruby/nodes/calls.ts | 76 ++++++----- src/ruby/nodes/case.ts | 31 ++--- src/ruby/nodes/class.ts | 52 ++++---- src/ruby/nodes/commands.ts | 77 ++++++----- src/ruby/nodes/conditionals.ts | 118 ++++++++--------- src/ruby/nodes/constants.ts | 28 ++-- src/ruby/nodes/flow.ts | 28 ++-- src/ruby/nodes/hashes.ts | 38 +++--- src/ruby/nodes/heredocs.ts | 16 +-- src/ruby/nodes/hooks.ts | 18 ++- src/ruby/nodes/lambdas.ts | 10 +- src/ruby/nodes/loops.ts | 72 ++++------- src/ruby/nodes/massign.ts | 33 ++--- src/ruby/nodes/methods.ts | 33 +++-- src/ruby/nodes/operators.ts | 58 ++++----- src/ruby/nodes/params.ts | 17 +-- src/ruby/nodes/patterns.ts | 61 +++++---- src/ruby/nodes/regexp.ts | 13 +- src/ruby/nodes/rescue.ts | 37 +++--- src/ruby/nodes/return.ts | 21 ++- src/ruby/nodes/statements.ts | 23 ++-- src/ruby/nodes/strings.ts | 38 ++---- src/ruby/nodes/super.ts | 14 +- src/ruby/nodes/undef.ts | 9 +- src/ruby/printer.ts | 4 +- src/utils/inlineEnsureParens.ts | 2 +- src/utils/printEmptyCollection.ts | 16 +-- test/js/globalSetup.ts | 2 +- yarn.lock | 10 +- 41 files changed, 696 insertions(+), 926 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index de1229f0..8994fa43 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -78,16 +78,14 @@ Effectively, it walks the AST in the reverse direction from the way `Ripper` bui As the nodes are printing themselves and their children, they're additionally building up a second AST. That AST is built using the `builder` commands from prettier core, described [here](https://github.com/prettier/prettier/blob/main/commands.md). As an example, below is how a `binary` node (like the one representing the `1 + 1` above) would handle printing itself: ```javascript -const { concat, group, indent, line } = require("prettier").doc.builders; +const { group, indent, line } = require("prettier").doc.builders; const printBinary = (path, opts, print) => - group( - concat([ - concat([path.call(print, "body", 0), " "]), - path.getValue().body[1], - indent(concat([line, path.call(print, "body", 2)])) - ]) - ); + group([ + [path.call(print, "body", 0), " "], + path.getValue().body[1], + indent([line, path.call(print, "body", 2)]) + ]); ``` Recall that the `binary` node looks like this: @@ -100,7 +98,6 @@ This means that there is a node in the `0` position of the array that represents So, the `printBinary` function is going to use the following `prettier` builders to build up the intermediate represention: -- `concat` - puts multiple nodes together and prints them without breaking them apart - `group` - marks places where `prettier` could split text if the line gets too long; if the max line length is hit, `prettier` will break apart the outermost `group` node first - `indent` - increases the current print indent for the contents of the node if the parent node is broken, e.g., if the `binary` node is too long to fit on one line, it will indent the right-hand operand - `line` - puts a space if the group is not broken, otherwise puts a newline diff --git a/package.json b/package.json index 8d9dc825..83cb7b53 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ }, "homepage": "https://github.com/prettier/plugin-ruby#readme", "dependencies": { - "prettier": ">=1.10" + "prettier": ">=2.3.0" }, "devDependencies": { "@types/jest": "^27.0.1", @@ -37,9 +37,6 @@ "ts-node": "^10.2.1", "typescript": "^4.4.3" }, - "resolutions": { - "ansi-regex": "^6.0.1" - }, "eslintConfig": { "extends": [ "eslint:recommended", diff --git a/src/haml/embed.ts b/src/haml/embed.ts index 71c5deab..0334b7c8 100644 --- a/src/haml/embed.ts +++ b/src/haml/embed.ts @@ -2,7 +2,6 @@ import type { Plugin, HAML } from "../types"; import prettier from "../prettier"; const { - concat, hardline, indent, literalline, @@ -18,11 +17,7 @@ const { function replaceNewlines(doc: Plugin.Doc) { return mapDoc(doc, (currentDoc: Plugin.Doc) => typeof currentDoc === "string" && currentDoc.includes("\n") - ? concat( - currentDoc - .split(/(\n)/g) - .map((v, i) => (i % 2 === 0 ? v : literalline)) - ) + ? currentDoc.split(/(\n)/g).map((v, i) => (i % 2 === 0 ? v : literalline)) : currentDoc ); } @@ -65,20 +60,16 @@ const embed: Plugin.Embed = (path, _print, textToDoc, opts) => { // If there is a plugin that has a parser that matches the name of this // filter, then we're going to assume that's correct for embedding and go // ahead and switch to that parser. - return markAsRoot( - concat([ - ":", - node.value.name, - indent( - concat([ - hardline, - replaceNewlines( - stripTrailingHardline(textToDoc(node.value.text, { parser })) - ) - ]) + return markAsRoot([ + ":", + node.value.name, + indent([ + hardline, + replaceNewlines( + stripTrailingHardline(textToDoc(node.value.text, { parser })) ) ]) - ); + ]); }; export default embed; diff --git a/src/haml/printer.ts b/src/haml/printer.ts index d706ba9d..1de6f177 100644 --- a/src/haml/printer.ts +++ b/src/haml/printer.ts @@ -2,18 +2,8 @@ import type { Plugin, HAML } from "../types"; import prettier from "../prettier"; import embed from "./embed"; -const { - align, - concat, - fill, - group, - hardline, - ifBreak, - indent, - join, - line, - softline -} = prettier; +const { align, fill, group, hardline, ifBreak, indent, join, line, softline } = + prettier; const docTypes = { basic: "Basic", @@ -69,47 +59,38 @@ function printAttributes( } const boundary = level === 0 ? softline : line; - const parts: Plugin.Doc[] = Object.keys(object).map((key) => - concat([ - printHashKey(key, opts), - " ", - printAttributes(object[key], opts, level + 1) - ]) - ); + const parts: Plugin.Doc[] = Object.keys(object).map((key) => [ + printHashKey(key, opts), + " ", + printAttributes(object[key], opts, level + 1) + ]); // If we have support for multi-line attributes laid out like a regular hash, // then we print them that way here. if (opts.supportsMultiline) { - return group( - concat([ - "{", - indent(group(concat([boundary, join(concat([",", line]), parts)]))), - boundary, - "}" - ]) - ); + return group([ + "{", + indent(group([boundary, join([",", line], parts)])), + boundary, + "}" + ]); } // Otherwise, if we only have one attribute, then just print it inline // regardless of how long it is. if (parts.length === 0) { - return group(concat(["{", parts[0], "}"])); + return group(["{", parts[0], "}"]); } // Otherwise, depending on how long the line is it will split the content into // multi-line attributes that old Haml understands. - return group( - concat([ - "{", - parts[0], - ",", - align( - opts.headerLength + 1, - concat([line, join(concat([",", line]), parts.slice(1))]) - ), - "}" - ]) - ); + return group([ + "{", + parts[0], + ",", + align(opts.headerLength + 1, [line, join([",", line], parts.slice(1))]), + "}" + ]); } // A utility function used in a silent script that is meant to determine if a @@ -155,7 +136,7 @@ const printer: Plugin.PrinterConfig = { parts.push(" ", value.text); } - return printWithChildren(node, group(concat(parts))); + return printWithChildren(node, group(parts)); } // https://haml.info/docs/yardoc/file.REFERENCE.html#doctype- case "doctype": { @@ -178,18 +159,11 @@ const printer: Plugin.PrinterConfig = { } // https://haml.info/docs/yardoc/file.REFERENCE.html#filters case "filter": - return group( - concat([ - ":", - node.value.name, - indent( - concat([ - hardline, - join(hardline, node.value.text.trim().split("\n")) - ]) - ) - ]) - ); + return group([ + ":", + node.value.name, + indent([hardline, join(hardline, node.value.text.trim().split("\n"))]) + ]); // https://haml.info/docs/yardoc/file.REFERENCE.html#haml-comments-- case "haml_comment": { const { value } = node; @@ -199,20 +173,20 @@ const printer: Plugin.PrinterConfig = { if (opts.originalText.split("\n")[node.line - 1].trim() === "-#") { const lines = value.text.trim().split("\n"); - parts.push(indent(concat([hardline, join(hardline, lines)]))); + parts.push(indent([hardline, join(hardline, lines)])); } else { parts.push(" ", value.text.trim()); } } - return concat(parts); + return parts; } // https://haml.info/docs/yardoc/file.REFERENCE.html#plain-text case "plain": return node.value.text; // The root node in the AST that we build in the parser. case "root": - return concat([join(hardline, path.map(print, "children")), hardline]); + return [join(hardline, path.map(print, "children")), hardline]; // https://haml.info/docs/yardoc/file.REFERENCE.html#inserting_ruby case "script": { const { value } = node; @@ -234,7 +208,7 @@ const printer: Plugin.PrinterConfig = { parts.push(" ", value.text.trim()); } - return printWithChildren(node, group(concat(parts))); + return printWithChildren(node, group(parts)); } // https://haml.info/docs/yardoc/file.REFERENCE.html#running-ruby-- case "silent_script": { @@ -242,20 +216,16 @@ const printer: Plugin.PrinterConfig = { if (node.children.length > 0) { parts.push( - concat( - path.map((childPath) => { - const child = childPath.getValue(); - const concated = concat([hardline, print(childPath)]); - - return isContinuation(node, child) - ? concated - : indent(concated); - }, "children") - ) + path.map((childPath) => { + const child = childPath.getValue(); + const concated = [hardline, print(childPath)]; + + return isContinuation(node, child) ? concated : indent(concated); + }, "children") ); } - return group(concat(parts)); + return group(parts); } // https://haml.info/docs/yardoc/file.REFERENCE.html#element-name- case "tag": { @@ -287,19 +257,20 @@ const printer: Plugin.PrinterConfig = { // string that looks like the output of Hash#inspect from Ruby. So here // we're going to split it all up and print it out nicely. if (dynamic_attributes.new) { - const pairs = dynamic_attributes.new + const docs: Plugin.Doc[] = []; + + dynamic_attributes.new .slice(1, -2) .split(",") - .map((pair) => join("=", pair.slice(1).split('" => '))); + .forEach((pair, index) => { + if (index !== 0) { + docs.push(line); + } + docs.push(join("=", pair.slice(1).split('" => '))); + }); parts.push( - group( - concat([ - "(", - align(parts.join("").length + 1, fill(join(line, pairs).parts)), - ")" - ]) - ) + group(["(", align(parts.join("").length + 1, fill(docs)), ")"]) ); } @@ -316,13 +287,11 @@ const printer: Plugin.PrinterConfig = { opts )}`; - return accum.length === 0 ? [doc] : accum.concat(",", line, doc); + return accum.length === 0 ? [doc] : [...accum, ",", line, doc]; }, [] as Plugin.Doc[]); parts.push( - group( - concat(["{", align(parts.join("").length + 1, fill(docs)), "}"]) - ) + group(["{", align(parts.join("").length + 1, fill(docs)), "}"]) ); } @@ -382,12 +351,7 @@ const printer: Plugin.PrinterConfig = { return printWithChildren( node, - group( - concat([ - group(concat(parts)), - indent(concat([softline, prefix, value.value])) - ]) - ) + group([group(parts), indent([softline, prefix, value.value])]) ); } @@ -397,7 +361,7 @@ const printer: Plugin.PrinterConfig = { parts.push("%div"); } - return printWithChildren(node, group(concat(parts))); + return printWithChildren(node, group(parts)); } default: throw new Error(`Unsupported node encountered: ${(node as any).type}`); @@ -414,14 +378,10 @@ const printer: Plugin.PrinterConfig = { return docs; } - return group( - concat([ - docs, - indent( - concat([hardline, join(hardline, path.map(print, "children"))]) - ) - ]) - ); + return group([ + docs, + indent([hardline, join(hardline, path.map(print, "children"))]) + ]); } }, // This function handles adding the format pragma to a source string. This is an diff --git a/src/rbs/printer.ts b/src/rbs/printer.ts index a75341e0..b381aba9 100644 --- a/src/rbs/printer.ts +++ b/src/rbs/printer.ts @@ -1,9 +1,8 @@ -import type * as Prettier from "prettier"; +import type { util } from "prettier"; import type { Plugin, RBS } from "../types"; import prettier from "../prettier"; -const { concat, group, hardline, indent, makeString, join, line, softline } = - prettier; +const { group, hardline, indent, makeString, join, line, softline } = prettier; // For some lists of entities in the AST, the parser returns them as an unsorted // object (presumably because Ruby hashes have implicit ordering). We do not @@ -34,10 +33,10 @@ const printer: Plugin.PrinterConfig = { if (node.declarations) { // Prints out the root of the tree, which includes zero or more declarations. - return concat([ - join(concat([hardline, hardline]), path.map(print, "declarations")), + return [ + join([hardline, hardline], path.map(print, "declarations")), hardline - ]); + ]; } /* istanbul ignore else */ @@ -46,14 +45,12 @@ const printer: Plugin.PrinterConfig = { // Prints out a type alias, which is a declaration that looks like: // type foo = String case "alias": { - doc = group( - concat([ - "type ", - node.name, - " =", - indent(group(concat([line, path.call(printType, "type")]))) - ]) - ); + doc = group([ + "type ", + node.name, + " =", + indent(group([line, path.call(printType, "type")])) + ]); break; } // Prints out a class declarations, which looks like: @@ -66,7 +63,7 @@ const printer: Plugin.PrinterConfig = { } parts.push(indent(printMembers()), hardline, "end"); - doc = group(concat(parts)); + doc = group(parts); break; } // Prints out a constant or a global declaration, which looks like: @@ -74,21 +71,19 @@ const printer: Plugin.PrinterConfig = { // $foo: String case "constant": case "global": { - doc = group(concat([node.name, ": ", path.call(printType, "type")])); + doc = group([node.name, ": ", path.call(printType, "type")]); break; } // Prints out an interface declaration, which looks like: // interface _Foo end case "interface": { - doc = group( - concat([ - "interface ", - printNameAndTypeParams(node), - indent(printMembers()), - hardline, - "end" - ]) - ); + doc = group([ + "interface ", + printNameAndTypeParams(node), + indent(printMembers()), + hardline, + "end" + ]); break; } // Prints out a module declaration, which looks like: @@ -104,7 +99,7 @@ const printer: Plugin.PrinterConfig = { } parts.push(indent(printMembers()), hardline, "end"); - doc = group(concat(parts)); + doc = group(parts); break; } /* istanbul ignore next */ @@ -118,14 +113,9 @@ const printer: Plugin.PrinterConfig = { // alias self.foo self.bar case "alias": { if (node.kind === "singleton") { - doc = concat([ - "alias self.", - node.new_name, - " self.", - node.old_name - ]); + doc = ["alias self.", node.new_name, " self.", node.old_name]; } else { - doc = concat(["alias ", node.new_name, " ", node.old_name]); + doc = ["alias ", node.new_name, " ", node.old_name]; } break; } @@ -151,7 +141,7 @@ const printer: Plugin.PrinterConfig = { } parts.push(": ", path.call(printType, "type")); - doc = group(concat(parts)); + doc = group(parts); break; } // Prints out a class or instance variable member, which looks like: @@ -159,18 +149,13 @@ const printer: Plugin.PrinterConfig = { // @@foo: String case "class_variable": case "instance_variable": { - doc = group(concat([node.name, ": ", path.call(printType, "type")])); + doc = group([node.name, ": ", path.call(printType, "type")]); break; } // Prints out a class instance variable member, which looks like: // self.@foo: String case "class_instance_variable": { - doc = concat([ - "self.", - node.name, - ": ", - path.call(printType, "type") - ]); + doc = ["self.", node.name, ": ", path.call(printType, "type")]; break; } // Prints out a mixin, which looks like: @@ -180,13 +165,11 @@ const printer: Plugin.PrinterConfig = { case "include": case "extend": case "prepend": { - doc = group( - concat([ - node.member, - " ", - printNameAndArgs(path as any as Plugin.Path) - ]) - ); + doc = group([ + node.member, + " ", + printNameAndArgs(path as any as Plugin.Path) + ]); break; } case "public": @@ -209,7 +192,7 @@ const printer: Plugin.PrinterConfig = { // An annotation can be attached to most kinds of nodes, and should be printed // using %a{}. Certain nodes can't have annotations at all. if (node.annotations && node.annotations.length > 0) { - doc = concat([ + doc = [ join( hardline, path.map((annotationPath: Plugin.Path) => { @@ -222,18 +205,18 @@ const printer: Plugin.PrinterConfig = { return getSource(annotationNode, opts); } - return concat(["%a{", annotationNode.string, "}"]); + return ["%a{", annotationNode.string, "}"]; }, "annotations") ), hardline, doc - ]); + ]; } // Comments come in as one whole string, so here we split it up into // multiple lines and then prefix it with the pound sign. if (node.comment) { - doc = concat([ + doc = [ join( hardline, node.comment.string @@ -243,7 +226,7 @@ const printer: Plugin.PrinterConfig = { ), hardline, doc - ]); + ]; } return doc; @@ -267,11 +250,7 @@ const printer: Plugin.PrinterConfig = { ? originalQuote : preferredQuote; - return makeString( - value.slice(1, -1), - quote as Prettier.util.Quote, - false - ); + return makeString(value.slice(1, -1), quote as util.Quote, false); } // Certain nodes are names with optional arguments attached, as in Array[A]. @@ -283,9 +262,12 @@ const printer: Plugin.PrinterConfig = { return node.name; } - return group( - concat([node.name, "[", join(", ", path.map(printType, "args")), "]"]) - ); + return group([ + node.name, + "[", + join(", ", path.map(printType, "args")), + "]" + ]); } // This is the big function that prints out any individual type, which can @@ -304,13 +286,13 @@ const printer: Plugin.PrinterConfig = { } return node.literal; case "optional": - return concat([ + return [ path.call( (typePath) => printType(typePath, { forceParens: true }), "type" ), "?" - ]); + ]; case "tuple": // If we don't have any sub types, we explicitly need the space in between // the brackets to not confuse the parser. @@ -318,16 +300,12 @@ const printer: Plugin.PrinterConfig = { return "[ ]"; } - return group( - concat(["[", join(", ", path.map(printType, "types")), "]"]) - ); + return group(["[", join(", ", path.map(printType, "types")), "]"]); case "union": { - const doc = group( - join(concat([line, "| "]), path.map(printType, "types")) - ); + const doc = group(join([line, "| "], path.map(printType, "types"))); if (forceParens) { - return concat(["(", doc, ")"]); + return ["(", doc, ")"]; } return doc; @@ -335,7 +313,7 @@ const printer: Plugin.PrinterConfig = { case "intersection": { const doc = group( join( - concat([line, "& "]), + [line, "& "], path.map( (typePath) => printType(typePath, { forceParens: true }), "types" @@ -344,18 +322,18 @@ const printer: Plugin.PrinterConfig = { ); if (forceParens) { - return concat(["(", doc, ")"]); + return ["(", doc, ")"]; } return doc; } case "class_singleton": - return concat(["singleton(", node.name, ")"]); + return ["singleton(", node.name, ")"]; case "proc": - return concat([ + return [ "^", printMethodSignature(path as Plugin.Path) - ]); + ]; case "record": { const parts: Plugin.Doc[] = []; @@ -369,17 +347,15 @@ const printer: Plugin.PrinterConfig = { } fieldParts.push(path.call(printType, "fields", field, "type")); - parts.push(concat(fieldParts)); + parts.push(fieldParts); }); - return group( - concat([ - "{", - indent(concat([line, join(concat([",", line]), parts)])), - line, - "}" - ]) - ); + return group([ + "{", + indent([line, join([",", line], parts)]), + line, + "}" + ]); } case "class_instance": case "interface": @@ -415,7 +391,7 @@ const printer: Plugin.PrinterConfig = { lastLine !== null && memberNode.location.start.line - lastLine >= 2 ) { - docs.push(concat([hardline, hardline])); + docs.push([hardline, hardline]); } else { docs.push(hardline); } @@ -424,7 +400,7 @@ const printer: Plugin.PrinterConfig = { lastLine = memberNode.location.end.line; }, "members"); - return concat(docs); + return docs; } // Prints out the name of a class, interface, or module declaration. @@ -450,13 +426,13 @@ const printer: Plugin.PrinterConfig = { parts.push("in"); } - return join(" ", parts.concat(node.name)); + return join(" ", [...parts, node.name]); }, "type_params", "params" ); - return concat([node.name, "[", join(", ", docs), "]"]); + return [node.name, "[", join(", ", docs), "]"]; } // Returns an array of printed parameters so that the calling function can @@ -471,16 +447,14 @@ const printer: Plugin.PrinterConfig = { // optional positionals, as in (?A) parts = parts.concat( path.map( - (paramPath) => concat(["?", printMethodParam(paramPath)]), + (paramPath) => ["?", printMethodParam(paramPath)], "optional_positionals" ) ); // rest positional, as in (*A) if (node.rest_positionals) { - parts.push( - concat(["*", path.call(printMethodParam, "rest_positionals")]) - ); + parts.push(["*", path.call(printMethodParam, "rest_positionals")]); } // trailing positionals are required positionals after a rest @@ -488,32 +462,26 @@ const printer: Plugin.PrinterConfig = { // required keywords, as in (a: A) getSortedKeys(node.required_keywords).forEach((name) => { - parts.push( - concat([ - name, - ": ", - path.call(printMethodParam, "required_keywords", name) - ]) - ); + parts.push([ + name, + ": ", + path.call(printMethodParam, "required_keywords", name) + ]); }); // optional keywords, as in (?a: A) getSortedKeys(node.optional_keywords).forEach((name) => { - parts.push( - concat([ - "?", - name, - ": ", - path.call(printMethodParam, "optional_keywords", name) - ]) - ); + parts.push([ + "?", + name, + ": ", + path.call(printMethodParam, "optional_keywords", name) + ]); }); // rest keyword, as in (**A) if (node.rest_keywords) { - parts.push( - concat(["**", path.call(printMethodParam, "rest_keywords")]) - ); + parts.push(["**", path.call(printMethodParam, "rest_keywords")]); } return parts; @@ -534,7 +502,7 @@ const printer: Plugin.PrinterConfig = { } } - return concat(parts); + return parts; } } @@ -556,7 +524,7 @@ const printer: Plugin.PrinterConfig = { if (params.length > 0) { parts.push( "(", - indent(concat([softline, join(concat([",", line]), params)])), + indent([softline, join([",", line], params)]), softline, ") " ); @@ -569,7 +537,7 @@ const printer: Plugin.PrinterConfig = { parts.push( "{", - indent(concat([line, path.call(printMethodSignature, "block")])), + indent([line, path.call(printMethodSignature, "block")]), line, "} " ); @@ -584,7 +552,7 @@ const printer: Plugin.PrinterConfig = { ) ); - return group(concat(parts)); + return group(parts); } // Prints out a method definition, which looks like: @@ -597,11 +565,9 @@ const printer: Plugin.PrinterConfig = { } if (typeDocs.length === 1) { - typeDocs = concat([" ", typeDocs[0]]); + typeDocs = [" ", typeDocs[0]]; } else { - typeDocs = indent( - group(concat([line, join(concat([line, "| "]), typeDocs)])) - ); + typeDocs = indent(group([line, join([line, "| "], typeDocs)])); } const parts: Plugin.Doc[] = ["def "]; @@ -615,7 +581,7 @@ const printer: Plugin.PrinterConfig = { const escaped = isMethodNameEscaped(); parts.push(escaped ? `\`${node.name}\`` : node.name, ":", typeDocs); - return group(concat(parts)); + return group(parts); // Determine if a method name is escaped in the original source. function isMethodNameEscaped() { diff --git a/src/ruby/embed.ts b/src/ruby/embed.ts index e547421e..f875f0fb 100644 --- a/src/ruby/embed.ts +++ b/src/ruby/embed.ts @@ -2,15 +2,8 @@ import type { Plugin, Ruby } from "../types"; import prettier from "../prettier"; import { literallineWithoutBreakParent } from "../utils"; -const { - concat, - group, - indent, - lineSuffix, - mapDoc, - markAsRoot, - stripTrailingHardline -} = prettier; +const { group, indent, lineSuffix, mapDoc, markAsRoot, stripTrailingHardline } = + prettier; const parsers: Record = { css: "css", @@ -29,11 +22,9 @@ const parsers: Record = { function replaceNewlines(doc: Plugin.Doc) { return mapDoc(doc, (currentDoc: Plugin.Doc) => typeof currentDoc === "string" && currentDoc.includes("\n") - ? concat( - currentDoc - .split(/(\n)/g) - .map((v, i) => (i % 2 === 0 ? v : literallineWithoutBreakParent)) - ) + ? currentDoc + .split(/(\n)/g) + .map((v, i) => (i % 2 === 0 ? v : literallineWithoutBreakParent)) : currentDoc ); } @@ -107,38 +98,32 @@ const embed: Plugin.Embed = (path, print, textToDoc, _opts) => { } // Pass that content into the embedded parser. Get back the doc node. - const formatted = concat([ + const formatted = [ literallineWithoutBreakParent, replaceNewlines(stripTrailingHardline(textToDoc(content, { parser }))) - ]); + ]; // If we're using a squiggly heredoc, then we can properly handle indentation // ourselves. if (isSquiggly) { - return concat([ + return [ path.call(print, "beging"), lineSuffix( - group( - concat([ - indent(markAsRoot(formatted)), - literallineWithoutBreakParent, - ending.trim() - ]) - ) + group([ + indent(markAsRoot(formatted)), + literallineWithoutBreakParent, + ending.trim() + ]) ) - ]); + ]; } // Otherwise, we need to just assume it's formatted correctly and return the // content as it is. - return markAsRoot( - concat([ - path.call(print, "beging"), - lineSuffix( - group(concat([formatted, literallineWithoutBreakParent, ending.trim()])) - ) - ]) - ); + return markAsRoot([ + path.call(print, "beging"), + lineSuffix(group([formatted, literallineWithoutBreakParent, ending.trim()])) + ]); }; export default embed; diff --git a/src/ruby/nodes/alias.ts b/src/ruby/nodes/alias.ts index 6ab3d776..9fd23d34 100644 --- a/src/ruby/nodes/alias.ts +++ b/src/ruby/nodes/alias.ts @@ -1,7 +1,7 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; -const { addTrailingComment, align, concat, group, hardline, line } = prettier; +const { addTrailingComment, align, group, hardline, line } = prettier; // The `alias` keyword is used to make a method respond to another name as well // as the current one. For example, to get the method `foo` to also respond to @@ -55,18 +55,16 @@ export const printAlias: Plugin.Printer = ( return print(argPath); }; - const rightSide = concat([ - // If the left child has any comments, then we need to explicitly break this - // into two lines - path.getValue().body[0].comments ? hardline : line, - path.call(printAliasArg, "body", 1) + return group([ + keyword, + path.call(printAliasArg, "body", 0), + group( + align(keyword.length, [ + // If the left child has any comments, then we need to explicitly break + // this into two lines + path.getValue().body[0].comments ? hardline : line, + path.call(printAliasArg, "body", 1) + ]) + ) ]); - - return group( - concat([ - keyword, - path.call(printAliasArg, "body", 0), - group(align(keyword.length, rightSide)) - ]) - ); }; diff --git a/src/ruby/nodes/aref.ts b/src/ruby/nodes/aref.ts index e5bc37ee..fdc855ca 100644 --- a/src/ruby/nodes/aref.ts +++ b/src/ruby/nodes/aref.ts @@ -1,7 +1,7 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; -const { concat, group, indent, join, line, softline } = prettier; +const { group, indent, join, line, softline } = prettier; // `aref` nodes are when you're pulling a value out of a collection at a // specific index. Put another way, it's any time you're calling the method @@ -19,7 +19,7 @@ export const printAref: Plugin.Printer = (path, opts, print) => { const indexNode = path.getValue().body[1]; if (!indexNode) { - return concat([path.call(print, "body", 0), "[]"]); + return [path.call(print, "body", 0), "[]"]; } return printArefField(path, opts, print); @@ -46,12 +46,11 @@ export const printArefField: Plugin.Printer = ( ) => { const [printedArray, printedIndex] = path.map(print, "body"); - return group( - concat([ - printedArray, - "[", - indent(concat([softline, join(concat([",", line]), printedIndex)])), - concat([softline, "]"]) - ]) - ); + return group([ + printedArray, + "[", + indent([softline, join([",", line], printedIndex)]), + softline, + "]" + ]); }; diff --git a/src/ruby/nodes/args.ts b/src/ruby/nodes/args.ts index 11d74a73..49a70758 100644 --- a/src/ruby/nodes/args.ts +++ b/src/ruby/nodes/args.ts @@ -1,11 +1,10 @@ -import type * as Prettier from "prettier"; import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; import { getTrailingComma } from "../../utils"; import toProc from "../toProc"; -const { concat, group, ifBreak, indent, join, line, softline } = prettier; +const { group, ifBreak, indent, join, line, softline } = prettier; const noTrailingComma = ["command", "command_call"]; @@ -40,32 +39,26 @@ export const printArgParen: Plugin.Printer = ( // an args_forward node, as we're guaranteed that there are no other arg // nodes. if (argsNode.type === "args_forward") { - return group( - concat([ - "(", - indent(concat([softline, path.call(print, "body", 0)])), - softline, - ")" - ]) - ); + return group([ + "(", + indent([softline, path.call(print, "body", 0)]), + softline, + ")" + ]); } // Now here we return a doc that represents the whole grouped expression, // including the surrouding parentheses. - return group( - concat([ - "(", - indent( - concat([ - softline, - join(concat([",", line]), path.call(print, "body", 0)), - getTrailingComma(opts) ? getArgParenTrailingComma(argsNode) : "" - ]) - ), + return group([ + "(", + indent([ softline, - ")" - ]) - ); + join([",", line], path.call(print, "body", 0)), + getTrailingComma(opts) ? getArgParenTrailingComma(argsNode) : "" + ]), + softline, + ")" + ]); }; export const printArgs: Plugin.Printer = ( @@ -127,8 +120,8 @@ export const printArgsAddBlock: Plugin.Printer = ( if (!(blockNode.comments || []).some(({ leading }) => leading)) { // If we don't have any leading comments, we can just prepend the // operator. - blockDoc = concat(["&", blockDoc]); - } else if (Array.isArray(blockDoc[0])) { + blockDoc = ["&", blockDoc]; + } else { // If we have a method call like: // // foo( @@ -142,17 +135,7 @@ export const printArgsAddBlock: Plugin.Printer = ( // In prettier >= 2.3.0, the comments are printed as an array before the // content. I don't love this kind of reflection, but it's the simplest // way at the moment to get this right. - blockDoc = blockDoc[0].concat( - concat(["&", blockDoc[1]]), - blockDoc.slice(2) - ); - } else { - // In prettier < 2.3.0, the comments are printed as part of a concat, so - // we can reflect on how many leading comments there are to determine - // which doc node we should modify. - const index = blockNode.comments!.filter(({ leading }) => leading).length; - const cBlockDoc = blockDoc as any as Prettier.doc.builders.Concat; - cBlockDoc.parts[index] = concat(["&", cBlockDoc.parts[index]]); + blockDoc = blockDoc[0].concat(["&", blockDoc[1]], blockDoc.slice(2)); } parts.push(blockDoc); @@ -190,7 +173,7 @@ export const printArgsAddStar: Plugin.Printer = ( // If we don't have any leading comments, we can just prepend the operator. const argsNode = argPath.getValue() as Ruby.AnyNode; if (!(argsNode.comments || []).some(({ leading }) => leading)) { - docs.push(concat(["*", doc])); + docs.push(["*", doc]); return; } @@ -207,19 +190,7 @@ export const printArgsAddStar: Plugin.Printer = ( // In prettier >= 2.3.0, the comments are printed as an array before the // content. I don't love this kind of reflection, but it's the simplest way // at the moment to get this right. - if (Array.isArray(doc[0])) { - docs.push(doc[0].concat(concat(["*", doc[1]]), doc.slice(2))); - return; - } - - // In prettier < 2.3.0, the comments are printed as part of a concat, so - // we can reflect on how many leading comments there are to determine which - // doc node we should modify. - const index = argsNode.comments!.filter(({ leading }) => leading).length; - const cDoc = doc as any as Prettier.doc.builders.Concat; - - cDoc.parts[index] = concat(["*", cDoc.parts[index]]); - docs = docs.concat(cDoc); + docs.push((doc[0] as Plugin.Doc[]).concat(["*", doc[1]], doc.slice(2))); }, "body"); return docs; @@ -230,5 +201,5 @@ export const printBlockArg: Plugin.Printer = ( opts, print ) => { - return concat(["&", path.call(print, "body", 0)]); + return ["&", path.call(print, "body", 0)]; }; diff --git a/src/ruby/nodes/arrays.ts b/src/ruby/nodes/arrays.ts index a38ad2e8..47363723 100644 --- a/src/ruby/nodes/arrays.ts +++ b/src/ruby/nodes/arrays.ts @@ -2,7 +2,7 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; import { getTrailingComma, printEmptyCollection } from "../../utils"; -const { concat, group, ifBreak, indent, join, line, softline } = prettier; +const { group, ifBreak, indent, join, line, softline } = prettier; // Checks that every argument within this args node is a string_literal node // that has no spaces or interpolations. This means we're dealing with an array @@ -59,21 +59,20 @@ function isSymbolArray(args: Ruby.Args | Ruby.ArgsAddStar) { // interpolation. The body is an array of either plain strings or interpolated // expressions. export const printWord: Plugin.Printer = (path, opts, print) => { - return concat(path.map(print, "body")); + return path.map(print, "body"); }; // Prints out a special array literal. Accepts the parts of the array literal as // an argument, where the first element of the parts array is a string that // contains the special start. function printArrayLiteral(start: string, parts: Plugin.Doc[]) { - return group( - concat([ - start, - "[", - indent(concat([softline, join(line, parts)])), - concat([softline, "]"]) - ]) - ); + return group([ + start, + "[", + indent([softline, join(line, parts)]), + softline, + "]" + ]); } const arrayLiteralStarts = { @@ -137,18 +136,14 @@ export const printArray: Plugin.Printer = (path, opts, print) => { // Here we have a normal array of any type of object with no special literal // types or anything. - return group( - concat([ - "[", - indent( - concat([ - softline, - join(concat([",", line]), path.call(print, "body", 0)), - getTrailingComma(opts) ? ifBreak(",", "") : "" - ]) - ), + return group([ + "[", + indent([ softline, - "]" - ]) - ); + join([",", line], path.call(print, "body", 0)), + getTrailingComma(opts) ? ifBreak(",", "") : "" + ]), + softline, + "]" + ]); }; diff --git a/src/ruby/nodes/assign.ts b/src/ruby/nodes/assign.ts index 2d7d147e..26a51cc4 100644 --- a/src/ruby/nodes/assign.ts +++ b/src/ruby/nodes/assign.ts @@ -2,7 +2,7 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; import { skipAssignIndent } from "../../utils"; -const { concat, group, indent, join, line } = prettier; +const { group, indent, join, line } = prettier; export const printAssign: Plugin.Printer = (path, opts, print) => { const [_targetNode, valueNode] = path.getValue().body; @@ -13,14 +13,14 @@ export const printAssign: Plugin.Printer = (path, opts, print) => { // If the right side of this assignment is a multiple assignment, then we need // to join it together with commas. if (["mrhs_add_star", "mrhs_new_from_args"].includes(valueNode.type)) { - rightSideDoc = group(join(concat([",", line]), valueDoc)); + rightSideDoc = group(join([",", line], valueDoc)); } if (skipAssignIndent(valueNode)) { - return group(concat([targetDoc, " = ", rightSideDoc])); + return group([targetDoc, " = ", rightSideDoc]); } - return group(concat([targetDoc, " =", indent(concat([line, rightSideDoc]))])); + return group([targetDoc, " =", indent([line, rightSideDoc])]); }; export const printOpAssign: Plugin.Printer = ( @@ -28,14 +28,12 @@ export const printOpAssign: Plugin.Printer = ( opts, print ) => { - return group( - concat([ - path.call(print, "body", 0), - " ", - path.call(print, "body", 1), - indent(concat([line, path.call(print, "body", 2)])) - ]) - ); + return group([ + path.call(print, "body", 0), + " ", + path.call(print, "body", 1), + indent([line, path.call(print, "body", 2)]) + ]); }; export const printVarField: Plugin.Printer = ( diff --git a/src/ruby/nodes/blocks.ts b/src/ruby/nodes/blocks.ts index 10cf9b62..9edec7e1 100644 --- a/src/ruby/nodes/blocks.ts +++ b/src/ruby/nodes/blocks.ts @@ -2,16 +2,8 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; import { hasAncestor } from "../../utils"; -const { - breakParent, - concat, - group, - ifBreak, - indent, - join, - removeLines, - softline -} = prettier; +const { breakParent, group, ifBreak, indent, join, removeLines, softline } = + prettier; export const printBlockVar: Plugin.Printer = ( path, @@ -26,7 +18,7 @@ export const printBlockVar: Plugin.Printer = ( } parts.push("| "); - return concat(parts); + return parts; }; function printBlock( @@ -43,7 +35,7 @@ function printBlock( stmts[0].type !== "void_stmt" || stmts[0].comments ) { - doBlockBody = indent(concat([softline, path.call(print, "body", 1)])); + doBlockBody = indent([softline, path.call(print, "body", 1)]); } // If this block is nested underneath a command or command_call node, then @@ -53,12 +45,12 @@ function printBlock( // switch to using braces instead. const useBraces = braces && hasAncestor(path, ["command", "command_call"]); - const doBlock = concat([ + const doBlock = [ useBraces ? " {" : " do", - variables ? concat([" ", path.call(print, "body", 0)]) : "", + variables ? [" ", path.call(print, "body", 0)] : "", doBlockBody, - concat([softline, useBraces ? "}" : "end"]) - ]); + [softline, useBraces ? "}" : "end"] + ]; // We can hit this next pattern if within the block the only statement is a // comment. @@ -67,7 +59,7 @@ function printBlock( stmts[0].type === "void_stmt" && stmts[0].comments ) { - return concat([breakParent, doBlock]); + return [breakParent, doBlock]; } const blockReceiver = path.getParentNode().body[0]; @@ -75,18 +67,18 @@ function printBlock( // If the parent node is a command node, then there are no parentheses // around the arguments to that command, so we need to break the block if (["command", "command_call"].includes(blockReceiver.type)) { - return concat([breakParent, doBlock]); + return [breakParent, doBlock]; } const hasBody = stmts.some(({ type }) => type !== "void_stmt"); - const braceBlock = concat([ + const braceBlock = [ " {", hasBody || variables ? " " : "", variables ? path.call(print, "body", 0) : "", path.call(print, "body", 1), hasBody ? " " : "", "}" - ]); + ]; return group(ifBreak(doBlock, braceBlock)); }; diff --git a/src/ruby/nodes/calls.ts b/src/ruby/nodes/calls.ts index 0bf4f08e..a75bd111 100644 --- a/src/ruby/nodes/calls.ts +++ b/src/ruby/nodes/calls.ts @@ -3,7 +3,7 @@ import prettier from "../../prettier"; import { makeCall, noIndent } from "../../utils"; import toProc from "../toProc"; -const { concat, group, hardline, ifBreak, indent, join, softline } = prettier; +const { group, hardline, ifBreak, indent, join, softline } = prettier; const chained = ["call", "method_add_arg", "method_add_block"]; @@ -35,16 +35,16 @@ export const printCall: Plugin.Printer = (path, opts, print) => { // For certain left sides of the call nodes, we want to attach directly to // the } or end. if (noIndent.includes(receiverNode.type)) { - return concat([receiverDoc, operatorDoc, messageDoc]); + return [receiverDoc, operatorDoc, messageDoc]; } // The right side of the call node, as in everything including the operator // and beyond. - let rightSideDoc = concat([ + let rightSideDoc = [ receiverNode.comments ? hardline : softline, operatorDoc, messageDoc - ]); + ]; // This is very specialized behavior wherein we group .where.not calls // together because it looks better. For more information, see @@ -55,7 +55,7 @@ export const printCall: Plugin.Printer = (path, opts, print) => { receiverNode.body[2].body === "where" && messageDoc === "not" ) { - rightSideDoc = concat([operatorDoc, messageDoc]); + rightSideDoc = [operatorDoc, messageDoc]; } // Get a reference to the parent node so we can check if we're inside a chain @@ -72,14 +72,18 @@ export const printCall: Plugin.Printer = (path, opts, print) => { // If we're at the top of a chain, then we're going to print out a nice // multi-line layout if this doesn't break into multiple lines. - if (!chained.includes(parentNode.type) && (node.chain || 0) >= 3) { - return ifBreak( - group(indent(concat(node.breakDoc!.concat(rightSideDoc)))), - concat([receiverDoc, group(rightSideDoc)]) - ); + if ( + !chained.includes(parentNode.type) && + (node.chain || 0) >= 3 && + node.breakDoc + ) { + return ifBreak(group(indent(node.breakDoc.concat(rightSideDoc))), [ + receiverDoc, + group(rightSideDoc) + ]); } - return group(concat([receiverDoc, group(indent(rightSideDoc))])); + return group([receiverDoc, group(indent(rightSideDoc))]); }; export const printMethodAddArg: Plugin.Printer = ( @@ -104,7 +108,7 @@ export const printMethodAddArg: Plugin.Printer = ( // Ruby. For example, you could do something like Foo(), on which we would // need to keep the parentheses to make it look like a method call. if (methodNode.type === "fcall" && methodNode.body[0].type === "@const") { - return concat([methodDoc, "()"]); + return [methodDoc, "()"]; } // If you're using an explicit set parentheses with the special call syntax, @@ -113,7 +117,7 @@ export const printMethodAddArg: Plugin.Printer = ( // #call method on a new instance of the Foo class), then we have to print // out those parentheses, otherwise we'll end up with Foo.new. if (methodNode.type === "call" && methodNode.body[2] === "call") { - return concat([methodDoc, "()"]); + return [methodDoc, "()"]; } return methodDoc; @@ -122,7 +126,7 @@ export const printMethodAddArg: Plugin.Printer = ( // This case will ONLY be hit if we can successfully turn the block into a // to_proc call. In that case, we just explicitly add the parens around it. if (argNode.type === "args" && argsDoc.length > 0) { - return concat([methodDoc, "("].concat(argsDoc).concat(")")); + return [methodDoc, "(", ...argsDoc, ")"]; } // Get a reference to the parent node so we can check if we're inside a chain @@ -184,22 +188,22 @@ export const printMethodAddArg: Plugin.Printer = ( // ) // if (node.callChain === node.chain) { - return concat([group(indent(concat(node.breakDoc))), group(argsDoc)]); + return [group(indent(node.breakDoc)), group(argsDoc)]; } - return ifBreak( - group(indent(concat(node.breakDoc.concat(argsDoc)))), - concat([methodDoc, argsDoc]) - ); + return ifBreak(group(indent(node.breakDoc.concat(argsDoc))), [ + methodDoc, + argsDoc + ]); } // If there are already parentheses, then we can just use the doc that's // already printed. if (argNode.type == "arg_paren") { - return concat([methodDoc, argsDoc]); + return [methodDoc, argsDoc]; } - return concat([methodDoc, " ", join(", ", argsDoc), " "]); + return [methodDoc, " ", join(", ", argsDoc), " "]; }; export const printMethodAddBlock: Plugin.Printer = ( @@ -218,14 +222,12 @@ export const printMethodAddBlock: Plugin.Printer = ( const proc = toProc(path, blockNode); if (proc && callNode.type === "call") { - return group( - concat([ - path.call(print, "body", 0), - "(", - indent(concat([softline, proc])), - concat([softline, ")"]) - ]) - ); + return group([ + path.call(print, "body", 0), + "(", + indent([softline, proc]), + [softline, ")"] + ]); } if (proc) { @@ -246,14 +248,18 @@ export const printMethodAddBlock: Plugin.Printer = ( // If we're at the top of a chain, then we're going to print out a nice // multi-line layout if this doesn't break into multiple lines. - if (!chained.includes(parentNode.type) && (node.chain || 0) >= 3) { - return ifBreak( - group(indent(concat(node.breakDoc!.concat(blockDoc)))), - concat([callDoc, blockDoc]) - ); + if ( + !chained.includes(parentNode.type) && + (node.chain || 0) >= 3 && + node.breakDoc + ) { + return ifBreak(group(indent(node.breakDoc.concat(blockDoc))), [ + callDoc, + blockDoc + ]); } - return concat([callDoc, blockDoc]); + return [callDoc, blockDoc]; }; export const printCallContainer: Plugin.Printer = ( diff --git a/src/ruby/nodes/case.ts b/src/ruby/nodes/case.ts index 07ebf5e7..e0650028 100644 --- a/src/ruby/nodes/case.ts +++ b/src/ruby/nodes/case.ts @@ -1,21 +1,24 @@ -import type * as Prettier from "prettier"; import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; -const { align, concat, fill, group, hardline, indent, line } = prettier; +const { align, fill, group, hardline, indent, line } = prettier; export const printCase: Plugin.Printer = (path, opts, print) => { - const statement: Plugin.Doc[] = ["case"]; + const parts: Plugin.Doc[] = ["case"]; // You don't need to explicitly have something to test against in a case // statement (without it it effectively becomes an if/elsif chain). if (path.getValue().body[0]) { - statement.push(" ", path.call(print, "body", 0)); + parts.push(" ", path.call(print, "body", 0)); } - return concat( - statement.concat([hardline, path.call(print, "body", 1), hardline, "end"]) - ); + return [ + ...parts, + hardline, + path.call(print, "body", 1), + hardline, + "end" + ]; }; export const printWhen: Plugin.Printer = (path, opts, print) => { @@ -32,21 +35,19 @@ export const printWhen: Plugin.Printer = (path, opts, print) => { // Pull off the last element and make it concat with a comma so that // we can maintain alternating lines and docs. - return accum - .slice(0, -1) - .concat([concat([accum![accum.length - 1], ","]), line, pred]); + return [...accum.slice(0, -1), [accum[accum.length - 1], ","], line, pred]; }, [] as Plugin.Doc[] ) ); - const stmts = path.call(print, "body", 1) as Prettier.doc.builders.Concat; - const parts: Plugin.Doc[] = [concat(["when ", align("when ".length, preds)])]; + const stmts = path.call(print, "body", 1) as Plugin.Doc[]; + const parts: Plugin.Doc[] = [["when ", align("when ".length, preds)]]; // It's possible in a when to just have empty void statements, in which case // we would skip adding the body. - if (!stmts.parts.every((part) => !part)) { - parts.push(indent(concat([hardline, stmts]))); + if (!stmts.every((part) => !part)) { + parts.push(indent([hardline, stmts])); } // This is the next clause on the case statement, either another `when` or @@ -55,5 +56,5 @@ export const printWhen: Plugin.Printer = (path, opts, print) => { parts.push(hardline, path.call(print, "body", 2)); } - return group(concat(parts)); + return group(parts); }; diff --git a/src/ruby/nodes/class.ts b/src/ruby/nodes/class.ts index 1cae97a5..877cdbcf 100644 --- a/src/ruby/nodes/class.ts +++ b/src/ruby/nodes/class.ts @@ -2,7 +2,7 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; import { isEmptyBodyStmt } from "../../utils"; -const { concat, group, hardline, indent } = prettier; +const { group, hardline, indent } = prettier; export const printClass: Plugin.Printer = (path, opts, print) => { const [_constant, superclass, bodystmt] = path.getValue().body; @@ -12,50 +12,46 @@ export const printClass: Plugin.Printer = (path, opts, print) => { parts.push(" < ", path.call(print, "body", 1)); } - const declaration = group(concat(parts)); + const declaration = group(parts); if (isEmptyBodyStmt(bodystmt)) { - return group(concat([declaration, hardline, "end"])); + return group([declaration, hardline, "end"]); } - return group( - concat([ - declaration, - indent(concat([hardline, path.call(print, "body", 2)])), - concat([hardline, "end"]) - ]) - ); + return group([ + declaration, + indent([hardline, path.call(print, "body", 2)]), + [hardline, "end"] + ]); }; export const printModule: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); - const declaration = group(concat(["module ", path.call(print, "body", 0)])); + const declaration = group(["module ", path.call(print, "body", 0)]); if (isEmptyBodyStmt(node.body[1])) { - return group(concat([declaration, hardline, "end"])); + return group([declaration, hardline, "end"]); } - return group( - concat([ - declaration, - indent(concat([hardline, path.call(print, "body", 1)])), - concat([hardline, "end"]) - ]) - ); + return group([ + declaration, + indent([hardline, path.call(print, "body", 1)]), + hardline, + "end" + ]); }; export const printSClass: Plugin.Printer = (path, opts, print) => { const bodystmt = path.getValue().body[1]; - const declaration = concat(["class << ", path.call(print, "body", 0)]); + const declaration = ["class << ", path.call(print, "body", 0)]; if (isEmptyBodyStmt(bodystmt)) { - return group(concat([declaration, hardline, "end"])); + return group([declaration, hardline, "end"]); } - return group( - concat([ - declaration, - indent(concat([hardline, path.call(print, "body", 1)])), - concat([hardline, "end"]) - ]) - ); + return group([ + declaration, + indent([hardline, path.call(print, "body", 1)]), + hardline, + "end" + ]); }; diff --git a/src/ruby/nodes/commands.ts b/src/ruby/nodes/commands.ts index ba107fc7..f9214202 100644 --- a/src/ruby/nodes/commands.ts +++ b/src/ruby/nodes/commands.ts @@ -1,28 +1,48 @@ -import type * as Prettier from "prettier"; import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; import { makeCall } from "../../utils"; -const { align, concat, group, ifBreak, indent, join, line, softline } = - prettier; +const { align, group, ifBreak, indent, join, line, softline } = prettier; -function docLength(doc: any): number { - if (doc.length) { - return doc.length; - } +function throwBadDoc(_doc: never): never; +function throwBadDoc(doc: Plugin.Doc) { + throw new Error(`Unknown doc ${doc}`); +} - if (doc.parts) { - return (doc as Prettier.doc.builders.Concat).parts.reduce( - (sum, child) => sum + docLength(child), - 0 - ); +// Loop through the already created doc nodes and determine the overall length +// so that we can properly align the command arguments. +function docLength(doc: Plugin.Doc): number { + if (Array.isArray(doc)) { + return doc.reduce((sum, child) => sum + docLength(child), 0); } - if (doc.contents) { - return docLength(doc.contents); + if (typeof doc === "string") { + return doc.length; } - return 0; + switch (doc.type) { + case "concat": + case "fill": + return doc.parts.reduce((sum, child) => sum + docLength(child), 0); + case "align": + case "group": + case "indent": + case "line-suffix": + return docLength(doc.contents); + case "if-break": + return docLength(doc.flatContents); + case "line": + return doc.soft ? 0 : 1; + case "break-parent": + case "cursor": + case "indent-if-break": + case "label": + case "line-suffix-boundary": + case "trim": + return 0; + default: + throwBadDoc(doc); + } } function hasDef(node: Ruby.Command) { @@ -68,13 +88,13 @@ export const printCommand: Plugin.Printer = ( const node = path.getValue(); const command = path.call(print, "body", 0); - const joinedArgs = join(concat([",", line]), path.call(print, "body", 1)); + const joinedArgs = join([",", line], path.call(print, "body", 1)); const hasTernary = hasTernaryArg(node.body[1]); let breakArgs; if (hasTernary) { - breakArgs = indent(concat([softline, joinedArgs])); + breakArgs = indent([softline, joinedArgs]); } else if (hasDef(node)) { breakArgs = joinedArgs; } else { @@ -83,13 +103,13 @@ export const printCommand: Plugin.Printer = ( return group( ifBreak( - concat([ + [ command, hasTernary ? "(" : " ", breakArgs, - hasTernary ? concat([softline, ")"]) : "" - ]), - concat([command, " ", joinedArgs]) + hasTernary ? [softline, ")"] : "" + ], + [command, " ", joinedArgs] ) ); }; @@ -107,29 +127,24 @@ export const printCommandCall: Plugin.Printer = ( ]; if (!node.body[3]) { - return concat(parts); + return parts; } - const argDocs = join(concat([",", line]), path.call(print, "body", 3)); + const argDocs = join([",", line], path.call(print, "body", 3)); let breakDoc; if (hasTernaryArg(node.body[3])) { - breakDoc = parts.concat( - "(", - indent(concat([softline, argDocs])), - softline, - ")" - ); + breakDoc = parts.concat("(", indent([softline, argDocs]), softline, ")"); parts.push(" "); } else if (skipArgsAlign(path)) { parts.push(" "); breakDoc = parts.concat(argDocs); } else { parts.push(" "); - breakDoc = parts.concat(align(docLength(concat(parts)), argDocs)); + breakDoc = parts.concat(align(docLength(parts), argDocs)); } const joinedDoc = parts.concat(argDocs); - return group(ifBreak(concat(breakDoc), concat(joinedDoc))); + return group(ifBreak(breakDoc, joinedDoc)); }; diff --git a/src/ruby/nodes/conditionals.ts b/src/ruby/nodes/conditionals.ts index 0379c47a..16d0594e 100644 --- a/src/ruby/nodes/conditionals.ts +++ b/src/ruby/nodes/conditionals.ts @@ -1,4 +1,3 @@ -import type * as Prettier from "prettier"; import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; import { @@ -7,20 +6,8 @@ import { isEmptyStmts } from "../../utils"; -const { - align, - breakParent, - concat, - hardline, - group, - ifBreak, - indent, - softline -} = prettier; - -function isConcat(doc: any): doc is Prettier.doc.builders.Concat { - return doc.type === "concat"; -} +const { align, breakParent, hardline, group, ifBreak, indent, softline } = + prettier; // If the statements are just a single if/unless, in block or modifier form, or // a ternary @@ -39,31 +26,31 @@ function printWithAddition( print: Plugin.Print, breaking: boolean ) { - return concat([ + return [ `${keyword} `, align(keyword.length + 1, path.call(print, "body", 0)), - indent(concat([softline, path.call(print, "body", 1)])), - concat([softline, path.call(print, "body", 2)]), - concat([softline, "end"]), + indent([softline, path.call(print, "body", 1)]), + [softline, path.call(print, "body", 2)], + [softline, "end"], breaking ? breakParent : "" - ]); + ]; } // For the unary `not` operator, we need to explicitly add parentheses to it in // order for it to be valid from within a ternary. Otherwise if the clause of // the ternary isn't a unary `not`, we can just pass it along. function printTernaryClause(clause: Plugin.Doc) { - if (isConcat(clause)) { - const [part] = clause.parts; + if (Array.isArray(clause)) { + const [part] = clause; - if (isConcat(part) && part.parts[0] === "not") { + if (Array.isArray(part) && part[0] === "not") { // We are inside of a statements list and the statement is a unary `not`. - return concat(["not(", part.parts[2], ")"]); + return ["not(", part[2], ")"]; } - if (clause.parts[0] === "not") { + if (clause[0] === "not") { // We are inside a ternary condition and the clause is a unary `not`. - return concat(["not(", clause.parts[2], ")"]); + return ["not(", clause[2], ")"]; } } @@ -99,15 +86,15 @@ export const printTernary: Plugin.Printer = ( return group( ifBreak( - concat([ + [ "if ", align(3, predicate), - indent(concat([softline, truthyClause])), - concat([softline, "else"]), - indent(concat([softline, falsyClause])), - concat([softline, "end"]) - ]), - concat([predicate, " ? "].concat(ternaryClauses)) + indent([softline, truthyClause]), + [softline, "else"], + indent([softline, falsyClause]), + [softline, "end"] + ], + [predicate, " ? ", ...ternaryClauses] ) ); }; @@ -129,7 +116,7 @@ function printSingle( const multilineParts = [ `${keyword} `, align(keyword.length + 1, predicateDoc), - indent(concat([softline, statementsDoc])), + indent([softline, statementsDoc]), softline, "end" ]; @@ -141,16 +128,14 @@ function printSingle( !rubyModifier || (!modifier && (statementsNode as Ruby.If | Ruby.Unless).body[0].comments) ) { - return concat([concat(multilineParts), breakParent]); + return [multilineParts, breakParent]; } - const inline = concat( - inlineEnsureParens(path, [ - path.call(print, "body", 1), - ` ${keyword} `, - path.call(print, "body", 0) - ]) - ); + const inline = inlineEnsureParens(path, [ + path.call(print, "body", 1), + ` ${keyword} `, + path.call(print, "body", 0) + ]); // An expression with a conditional modifier (expression if true), the // conditional body is parsed before the predicate expression, meaning that @@ -162,7 +147,7 @@ function printSingle( return inline; } - return group(ifBreak(concat(multilineParts), inline)); + return group(ifBreak(multilineParts, inline)); }; } @@ -241,23 +226,22 @@ function printConditional( ): Plugin.Printer { return (path, opts, print) => { if (canTernary(path)) { - let ternaryParts = [path.call(print, "body", 0), " ? "].concat( - printTernaryClauses( + let ternaryParts = [ + path.call(print, "body", 0), + " ? ", + ...printTernaryClauses( keyword, path.call(print, "body", 1), path.call(print, "body", 2, "body", 0) ) - ); + ]; if (["binary", "call"].includes(path.getParentNode().type)) { - ternaryParts = (["("] as Plugin.Doc[]).concat(ternaryParts).concat(")"); + ternaryParts = ["(", ...ternaryParts, ")"]; } return group( - ifBreak( - printWithAddition(keyword, path, print, false), - concat(ternaryParts) - ) + ifBreak(printWithAddition(keyword, path, print, false), ternaryParts) ); } @@ -272,11 +256,12 @@ function printConditional( // If the body of the conditional is empty, then we explicitly have to use the // block form. if (isEmptyStmts(statements)) { - return concat([ + return [ `${keyword} `, align(keyword.length + 1, path.call(print, "body", 0)), - concat([hardline, "end"]) - ]); + hardline, + "end" + ]; } // Two situations in which we need to use the block form: @@ -290,12 +275,13 @@ function printConditional( containsAssignment(predicate) || containsSingleConditional(statements) ) { - return concat([ + return [ `${keyword} `, align(keyword.length + 1, path.call(print, "body", 0)), - indent(concat([hardline, path.call(print, "body", 1)])), - concat([hardline, "end"]) - ]); + indent([hardline, path.call(print, "body", 1)]), + hardline, + "end" + ]; } return printSingle(keyword)(path, opts, print); @@ -305,29 +291,27 @@ function printConditional( export const printElse: Plugin.Printer = (path, opts, print) => { const stmts = path.getValue().body[0]; - return concat([ + return [ stmts.body.length === 1 && stmts.body[0].type === "command" ? breakParent : "", "else", - indent(concat([softline, path.call(print, "body", 0)])) - ]); + indent([softline, path.call(print, "body", 0)]) + ]; }; export const printElsif: Plugin.Printer = (path, opts, print) => { const [_predicate, _statements, addition] = path.getValue().body; const parts = [ - group( - concat(["elsif ", align("elsif".length - 1, path.call(print, "body", 0))]) - ), - indent(concat([hardline, path.call(print, "body", 1)])) + group(["elsif ", align("elsif".length - 1, path.call(print, "body", 0))]), + indent([hardline, path.call(print, "body", 1)]) ]; if (addition) { - parts.push(group(concat([hardline, path.call(print, "body", 2)]))); + parts.push(group([hardline, path.call(print, "body", 2)])); } - return group(concat(parts)); + return group(parts); }; export const printIf = printConditional("if"); diff --git a/src/ruby/nodes/constants.ts b/src/ruby/nodes/constants.ts index fb556735..d99d3d80 100644 --- a/src/ruby/nodes/constants.ts +++ b/src/ruby/nodes/constants.ts @@ -2,7 +2,7 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; import { makeCall } from "../../utils"; -const { concat, group, indent, join, softline } = prettier; +const { group, indent, join, softline } = prettier; export const printConstPath: Plugin.Printer< Ruby.ConstPathField | Ruby.ConstPathRef @@ -23,26 +23,24 @@ export const printDefined: Plugin.Printer = ( opts, print ) => { - return group( - concat([ - "defined?(", - indent(concat([softline, path.call(print, "body", 0)])), - concat([softline, ")"]) - ]) - ); + return group([ + "defined?(", + indent([softline, path.call(print, "body", 0)]), + softline, + ")" + ]); }; export const printField: Plugin.Printer = (path, opts, print) => { - return group( - concat([ - path.call(print, "body", 0), - concat([makeCall(path, opts, print), path.call(print, "body", 2)]) - ]) - ); + return group([ + path.call(print, "body", 0), + makeCall(path, opts, print), + path.call(print, "body", 2) + ]); }; export const printTopConst: Plugin.Printer< Ruby.TopConstField | Ruby.TopConstRef > = (path, opts, print) => { - return concat(["::", path.call(print, "body", 0)]); + return ["::", path.call(print, "body", 0)]; }; diff --git a/src/ruby/nodes/flow.ts b/src/ruby/nodes/flow.ts index d5fe7522..463cfebb 100644 --- a/src/ruby/nodes/flow.ts +++ b/src/ruby/nodes/flow.ts @@ -2,7 +2,7 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; import { literal } from "../../utils"; -const { concat, join } = prettier; +const { join } = prettier; function nodeDive(node: any, steps: PropertyKey[]) { let current = node; @@ -22,8 +22,6 @@ const unskippableParens = [ "while_mod" ]; -type CallArgs = [Plugin.Print, ...PropertyKey[]]; - function maybeHandleParens( path: Plugin.Path, print: Plugin.Print, @@ -35,16 +33,12 @@ function maybeHandleParens( return null; } - let args = [print] as CallArgs; const stmts = node.body[0].body; - if (stmts.length === 1 && !unskippableParens.includes(stmts[0].type)) { - args = args.concat(steps).concat("body", 0) as CallArgs; - return concat([`${keyword} `, path.call.apply(path, args) as Plugin.Doc]); + return [`${keyword} `, path.call(print, ...steps, "body", 0)]; } - args = args.concat(steps) as CallArgs; - return concat([keyword, path.call.apply(path, args) as Plugin.Doc]); + return [keyword, path.call(print, ...steps)]; } export const printBreak: Plugin.Printer = (path, opts, print) => { @@ -56,8 +50,10 @@ export const printBreak: Plugin.Printer = (path, opts, print) => { const steps = ["body", 0, "body", 0, "body", 0]; return ( - maybeHandleParens(path, print, "break", steps) || - concat(["break ", join(", ", path.call(print, "body", 0))]) + maybeHandleParens(path, print, "break", steps) || [ + "break ", + join(", ", path.call(print, "body", 0)) + ] ); }; @@ -70,17 +66,19 @@ export const printNext: Plugin.Printer = (path, opts, print) => { const steps = ["body", 0, "body", 0, "body", 0]; return ( - maybeHandleParens(path, print, "next", steps) || - concat(["next ", join(", ", path.call(print, "body", 0))]) + maybeHandleParens(path, print, "next", steps) || [ + "next ", + join(", ", path.call(print, "body", 0)) + ] ); }; export const printYield: Plugin.Printer = (path, opts, print) => { if (path.getValue().body[0].type === "paren") { - return concat(["yield", path.call(print, "body", 0)]); + return ["yield", path.call(print, "body", 0)]; } - return concat(["yield ", join(", ", path.call(print, "body", 0))]); + return ["yield ", join(", ", path.call(print, "body", 0))]; }; export const printYield0 = literal("yield"); diff --git a/src/ruby/nodes/hashes.ts b/src/ruby/nodes/hashes.ts index 290d8bb9..1e2174e8 100644 --- a/src/ruby/nodes/hashes.ts +++ b/src/ruby/nodes/hashes.ts @@ -6,7 +6,7 @@ import { skipAssignIndent } from "../../utils"; -const { concat, group, ifBreak, indent, join, line } = prettier; +const { group, ifBreak, indent, join, line } = prettier; type KeyPrinter = ( _path: Plugin.Path, @@ -57,9 +57,9 @@ const printHashKeyLabel: KeyPrinter = (path, print) => { case "@label": return print(path); case "symbol_literal": - return concat([path.call(print, "body", 0), ":"]); + return [path.call(print, "body", 0), ":"]; case "dyna_symbol": { - return concat([print(path), ":"]); + return [print(path), ":"]; } } }; @@ -70,12 +70,12 @@ const printHashKeyRocket: KeyPrinter = (path, print) => { if (node.type === "@label") { const sDoc = doc as string; // since we know this is a label - doc = concat([":", sDoc.slice(0, sDoc.length - 1)]); + doc = [":", sDoc.slice(0, sDoc.length - 1)]; } else if (node.type === "dyna_symbol") { - doc = concat([":", doc]); + doc = [":", doc]; } - return concat([doc, " =>"]); + return [doc, " =>"]; }; export const printAssocNew: Plugin.Printer = ( @@ -93,16 +93,16 @@ export const printAssocNew: Plugin.Printer = ( // parent hash, so we don't group the parts. if (valueNode.type === "hash") { parts.push(" ", valueDoc); - return concat(parts); + return parts; } if (!skipAssignIndent(valueNode) || keyNode.comments) { - parts.push(indent(concat([line, valueDoc]))); + parts.push(indent([line, valueDoc])); } else { parts.push(" ", valueDoc); } - return group(concat(parts)); + return group(parts); }; export const printAssocSplat: Plugin.Printer = ( @@ -110,7 +110,7 @@ export const printAssocSplat: Plugin.Printer = ( opts, print ) => { - return concat(["**", path.call(print, "body", 0)]); + return ["**", path.call(print, "body", 0)]; }; export const printHashContents: Plugin.Printer = ( @@ -127,7 +127,7 @@ export const printHashContents: Plugin.Printer = ( ? printHashKeyLabel : printHashKeyRocket; - return join(concat([",", line]), path.map(print, "body")); + return join([",", line], path.map(print, "body")); }; export const printHash: Plugin.Printer = (path, opts, print) => { @@ -140,18 +140,16 @@ export const printHash: Plugin.Printer = (path, opts, print) => { return printEmptyCollection(path, opts, "{", "}"); } - const hashDoc = concat([ + const hashDoc = [ "{", - indent( - concat([ - line, - path.call(print, "body", 0), - getTrailingComma(opts) ? ifBreak(",", "") : "" - ]) - ), + indent([ + line, + path.call(print, "body", 0), + getTrailingComma(opts) ? ifBreak(",", "") : "" + ]), line, "}" - ]); + ]; // If we're inside another hash, then we don't want to group our contents // because we want this hash to break along with its parent hash. diff --git a/src/ruby/nodes/heredocs.ts b/src/ruby/nodes/heredocs.ts index 37054656..390b42a7 100644 --- a/src/ruby/nodes/heredocs.ts +++ b/src/ruby/nodes/heredocs.ts @@ -2,7 +2,7 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; import { literallineWithoutBreakParent } from "../../utils"; -const { concat, group, lineSuffix, join } = prettier; +const { group, lineSuffix, join } = prettier; export const printHeredoc: Plugin.Printer = ( path, @@ -26,14 +26,8 @@ export const printHeredoc: Plugin.Printer = ( // break-parent, all ancestral groups are broken, and heredocs automatically // break lines in groups they appear in. We prefer them to appear in-line if // possible, so we use a literalline without the break-parent. - return group( - concat([ - path.call(print, "beging"), - lineSuffix( - group( - concat([literallineWithoutBreakParent].concat(parts).concat(ending)) - ) - ) - ]) - ); + return group([ + path.call(print, "beging"), + lineSuffix(group([literallineWithoutBreakParent, ...parts, ending])) + ]); }; diff --git a/src/ruby/nodes/hooks.ts b/src/ruby/nodes/hooks.ts index 9fcb1a6f..85f05caf 100644 --- a/src/ruby/nodes/hooks.ts +++ b/src/ruby/nodes/hooks.ts @@ -1,7 +1,7 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; -const { concat, group, indent, line } = prettier; +const { group, indent, line } = prettier; // The `BEGIN` and `END` keywords are used to hook into the Ruby process. Any // `BEGIN` blocks are executed right when the process starts up, and the `END` @@ -19,15 +19,13 @@ const { concat, group, indent, line } = prettier; // nodes contain one child which is a `stmts` node. function printHook(name: string): Plugin.Printer { return function printHookWithName(path, opts, print) { - return group( - concat([ - name, - " ", - path.call(print, "body", 0), - indent(concat([line, path.call(print, "body", 1)])), - concat([line, "}"]) - ]) - ); + return group([ + name, + " ", + path.call(print, "body", 0), + indent([line, path.call(print, "body", 1)]), + [line, "}"] + ]); }; } diff --git a/src/ruby/nodes/lambdas.ts b/src/ruby/nodes/lambdas.ts index a728f8b2..f1f8180b 100644 --- a/src/ruby/nodes/lambdas.ts +++ b/src/ruby/nodes/lambdas.ts @@ -2,7 +2,7 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; import { hasAncestor } from "../../utils"; -const { concat, group, ifBreak, indent, line } = prettier; +const { group, ifBreak, indent, line } = prettier; // We can have our params coming in as the first child of the main lambda node, // or if we have them wrapped in parens then they'll be one level deeper. Even @@ -63,16 +63,16 @@ export const printLambda: Plugin.Printer = (path, opts, print) => { return group( ifBreak( - concat([ + [ "->", params, " ", inCommand ? "{" : "do", - indent(concat([line, path.call(print, "body", 1)])), + indent([line, path.call(print, "body", 1)]), line, inCommand ? "}" : "end" - ]), - concat(["->", params, " { ", path.call(print, "body", 1), " }"]) + ], + ["->", params, " { ", path.call(print, "body", 1), " }"] ) ); }; diff --git a/src/ruby/nodes/loops.ts b/src/ruby/nodes/loops.ts index f597f97b..da89a8be 100644 --- a/src/ruby/nodes/loops.ts +++ b/src/ruby/nodes/loops.ts @@ -6,17 +6,8 @@ import { isEmptyStmts } from "../../utils"; -const { - align, - breakParent, - concat, - group, - hardline, - ifBreak, - indent, - join, - softline -} = prettier; +const { align, breakParent, group, hardline, ifBreak, indent, join, softline } = + prettier; function printLoop( keyword: string, @@ -30,22 +21,18 @@ function printLoop( // If the only statement inside this while loop is a void statement, then we // can shorten to just displaying the predicate and then a semicolon. if (isEmptyStmts(stmts)) { - return group( - concat([ - group(concat([keyword, " ", path.call(print, "body", 0)])), - hardline, - "end" - ]) - ); + return group([ + group([keyword, " ", path.call(print, "body", 0)]), + hardline, + "end" + ]); } - const inlineLoop = concat( - inlineEnsureParens(path, [ - path.call(print, "body", 1), - ` ${keyword} `, - path.call(print, "body", 0) - ]) - ); + const inlineLoop = inlineEnsureParens(path, [ + path.call(print, "body", 1), + ` ${keyword} `, + path.call(print, "body", 0) + ]); // If we're in the modifier form and we're modifying a `begin`, then this is // a special case where we need to explicitly use the modifier form because @@ -61,21 +48,19 @@ function printLoop( return inlineLoop; } - const blockLoop = concat([ - concat([ - `${keyword} `, - align(keyword.length + 1, path.call(print, "body", 0)) - ]), - indent(concat([softline, path.call(print, "body", 1)])), - concat([softline, "end"]) - ]); + const blockLoop = [ + [`${keyword} `, align(keyword.length + 1, path.call(print, "body", 0))], + indent([softline, path.call(print, "body", 1)]), + softline, + "end" + ]; // If we're disallowing inline loops or if the predicate of the loop // contains an assignment (in which case we can't know for certain that that // assignment doesn't impact the statements inside the loop) then we can't // use the modifier form and we must use the block form. if (!rubyModifier || containsAssignment(path.getValue().body[0])) { - return concat([breakParent, blockLoop]); + return [breakParent, blockLoop]; } return group(ifBreak(blockLoop, inlineLoop)); @@ -87,16 +72,15 @@ export const printFor: Plugin.Printer = (path, opts, print) => { const varsDoc = path.getValue().body[0].type === "mlhs" ? join(", ", varDoc) : varDoc; - return group( - concat([ - "for ", - varsDoc, - " in ", - rangeDoc, - indent(concat([hardline, stmtsDoc])), - concat([hardline, "end"]) - ]) - ); + return group([ + "for ", + varsDoc, + " in ", + rangeDoc, + indent([hardline, stmtsDoc]), + hardline, + "end" + ]); }; export const printWhile = printLoop("while", false); diff --git a/src/ruby/nodes/massign.ts b/src/ruby/nodes/massign.ts index b9398603..e0c8f278 100644 --- a/src/ruby/nodes/massign.ts +++ b/src/ruby/nodes/massign.ts @@ -1,7 +1,7 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; -const { concat, group, indent, join, line, softline } = prettier; +const { group, indent, join, line, softline } = prettier; export const printMAssign: Plugin.Printer = ( path, @@ -15,19 +15,15 @@ export const printMAssign: Plugin.Printer = ( path.getValue().body[1].type ) ) { - right = group(join(concat([",", line]), right)); + right = group(join([",", line], right)); } - const parts: Plugin.Doc[] = [ - join(concat([",", line]), path.call(print, "body", 0)) - ]; + const parts: Plugin.Doc[] = [join([",", line], path.call(print, "body", 0))]; if ((path.getValue().body[0] as any).comma) { parts.push(","); } - return group( - concat([group(concat(parts)), " =", indent(concat([line, right]))]) - ); + return group([group(parts), " =", indent([line, right])]); }; export const printMLHS: Plugin.Printer = (path, opts, print) => { @@ -39,9 +35,10 @@ export const printMLHSAddPost: Plugin.Printer = ( opts, print ) => { - return (path.call(print, "body", 0) as Plugin.Doc[]).concat( - path.call(print, "body", 1) - ); + return [ + ...path.call(print, "body", 0) as Plugin.Doc[], + ...path.call(print, "body", 1) as Plugin.Doc[] + ]; }; export const printMLHSAddStar: Plugin.Printer = ( @@ -49,15 +46,13 @@ export const printMLHSAddStar: Plugin.Printer = ( opts, print ) => { - const rightParts: Plugin.Doc[] = ["*"]; + const parts: Plugin.Doc[] = ["*"]; if (path.getValue().body[1]) { - rightParts.push(path.call(print, "body", 1)); + parts.push(path.call(print, "body", 1)); } - return (path.call(print, "body", 0) as Plugin.Doc[]).concat( - concat(rightParts) - ); + return [...path.call(print, "body", 0) as Plugin.Doc[], parts]; }; export const printMLHSParen: Plugin.Printer = ( @@ -74,14 +69,14 @@ export const printMLHSParen: Plugin.Printer = ( const parts: Plugin.Doc[] = [ softline, - join(concat([",", line]), path.call(print, "body", 0)) + join([",", line], path.call(print, "body", 0)) ]; if ((path.getValue().body[0] as any).comma) { parts.push(","); } - return group(concat(["(", indent(concat(parts)), concat([softline, ")"])])); + return group(["(", indent(parts), [softline, ")"]]); }; export const printMRHS: Plugin.Printer = (path, opts, print) => { @@ -95,7 +90,7 @@ export const printMRHSAddStar: Plugin.Printer = ( ) => { const [leftDoc, rightDoc] = path.map(print, "body"); - return (leftDoc as Plugin.Doc[]).concat([concat(["*", rightDoc])]); + return [...leftDoc as Plugin.Doc[], ["*", rightDoc]]; }; export const printMRHSNewFromArgs: Plugin.Printer = ( diff --git a/src/ruby/nodes/methods.ts b/src/ruby/nodes/methods.ts index 07b5d766..a51b90fd 100644 --- a/src/ruby/nodes/methods.ts +++ b/src/ruby/nodes/methods.ts @@ -2,7 +2,7 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; import { isEmptyBodyStmt } from "../../utils"; -const { concat, group, hardline, indent, line } = prettier; +const { group, hardline, indent, line } = prettier; function printMethod(offset: number): Plugin.Printer { return function printMethodWithOffset(path, opts, print) { @@ -38,16 +38,15 @@ function printMethod(offset: number): Plugin.Printer { ); if (isEmptyBodyStmt(bodystmt)) { - return group(concat(declaration.concat("; end"))); + return group([...declaration, "; end"]); } - return group( - concat([ - group(concat(declaration)), - indent(concat([hardline, path.call(print, "body", offset + 2)])), - group(concat([hardline, "end"])) - ]) - ); + return group([ + group(declaration), + indent([hardline, path.call(print, "body", offset + 2)]), + hardline, + "end" + ]); }; } @@ -67,15 +66,13 @@ export const printSingleLineMethod: Plugin.Printer = ( } } - return group( - concat([ - "def ", - path.call(print, "body", 0), - paramsDoc, - " =", - indent(group(concat([line, path.call(print, "body", 2)]))) - ]) - ); + return group([ + "def ", + path.call(print, "body", 0), + paramsDoc, + " =", + indent(group([line, path.call(print, "body", 2)])) + ]); }; export const printAccessControl: Plugin.Printer = ( diff --git a/src/ruby/nodes/operators.ts b/src/ruby/nodes/operators.ts index 181e7dc2..db1e4925 100644 --- a/src/ruby/nodes/operators.ts +++ b/src/ruby/nodes/operators.ts @@ -2,39 +2,33 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; import { noIndent } from "../../utils"; -const { concat, group, indent, line, softline } = prettier; +const { group, indent, line, softline } = prettier; export const printBinary: Plugin.Printer = (path, opts, print) => { const [_leftNode, operator, rightNode] = path.getValue().body; const space = operator === "**" ? "" : " "; if (noIndent.includes(rightNode.type)) { - return group( - concat([ - group(path.call(print, "body", 0)), - space, - operator, - space, - group(path.call(print, "body", 2)) - ]) - ); - } - - return group( - concat([ + return group([ group(path.call(print, "body", 0)), space, - group( - indent( - concat([ - operator, - space === "" ? softline : line, - path.call(print, "body", 2) - ]) - ) - ) - ]) - ); + operator, + space, + group(path.call(print, "body", 2)) + ]); + } + + return group([ + group(path.call(print, "body", 0)), + space, + group( + indent([ + operator, + space === "" ? softline : line, + path.call(print, "body", 2) + ]) + ) + ]); }; // dot2 nodes are used with ranges (or flip-flops). They can optionally drop @@ -42,11 +36,11 @@ export const printBinary: Plugin.Printer = (path, opts, print) => { export const printDot2: Plugin.Printer = (path, opts, print) => { const [leftNode, rightNode] = path.getValue().body; - return concat([ + return [ leftNode ? path.call(print, "body", 0) : "", "..", rightNode ? path.call(print, "body", 1) : "" - ]); + ]; }; // dot3 nodes are used with ranges (or flip-flops). They can optionally drop @@ -54,11 +48,11 @@ export const printDot2: Plugin.Printer = (path, opts, print) => { export const printDot3: Plugin.Printer = (path, opts, print) => { const [leftNode, rightNode] = path.getValue().body; - return concat([ + return [ leftNode ? path.call(print, "body", 0) : "", "...", rightNode ? path.call(print, "body", 1) : "" - ]); + ]; }; export const printUnary: Plugin.Printer = (path, opts, print) => { @@ -69,11 +63,11 @@ export const printUnary: Plugin.Printer = (path, opts, print) => { // Here we defer to the original source, as it's kind of difficult to // determine if we can actually remove the parentheses being used. if (node.paren) { - return concat(["not", "(", contentsDoc, ")"]); + return ["not", "(", contentsDoc, ")"]; } else { - return concat(["not", " ", contentsDoc]); + return ["not", " ", contentsDoc]; } } - return concat([node.oper, contentsDoc]); + return [node.oper, contentsDoc]; }; diff --git a/src/ruby/nodes/params.ts b/src/ruby/nodes/params.ts index 053b7789..2db888b9 100644 --- a/src/ruby/nodes/params.ts +++ b/src/ruby/nodes/params.ts @@ -2,14 +2,14 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; import { literal } from "../../utils"; -const { concat, group, join, indent, line, softline } = prettier; +const { group, join, indent, line, softline } = prettier; function printRestParamSymbol( symbol: string ): Plugin.Printer { return function printRestParamWithSymbol(path, opts, print) { return path.getValue().body[0] - ? concat([symbol, path.call(print, "body", 0)]) + ? [symbol, path.call(print, "body", 0)] : symbol; }; } @@ -70,7 +70,7 @@ export const printParams: Plugin.Printer = (path, opts, print) => { parts.push(path.call(print, "body", 6)); } - const contents: Plugin.Doc[] = [join(concat([",", line]), parts)]; + const contents: Plugin.Doc[] = [join([",", line], parts)]; // You can put an extra comma at the end of block args between pipes to // change what it does. Below is the difference: @@ -88,17 +88,10 @@ export const printParams: Plugin.Printer = (path, opts, print) => { // If the parent node is a paren then we skipped printing the parentheses so // that we could handle them here and get nicer formatting. if (["lambda", "paren"].includes(path.getParentNode().type)) { - return group( - concat([ - "(", - indent(concat(([softline] as Plugin.Doc[]).concat(contents))), - softline, - ")" - ]) - ); + return group(["(", indent([softline, ...contents]), softline, ")"]); } - return group(concat(contents)); + return group(contents); }; export const printArgsForward = literal("..."); diff --git a/src/ruby/nodes/patterns.ts b/src/ruby/nodes/patterns.ts index 7c962c38..2fb095d5 100644 --- a/src/ruby/nodes/patterns.ts +++ b/src/ruby/nodes/patterns.ts @@ -1,7 +1,7 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; -const { align, concat, group, hardline, indent, join, line } = prettier; +const { align, group, hardline, indent, join, line } = prettier; const patterns = ["aryptn", "binary", "fndptn", "hshptn", "rassign"]; @@ -13,7 +13,7 @@ const printPatternArg: Plugin.Printer = (path, opts, print) => { opts.originalText && opts.originalText[opts.locStart(path.getValue()) - 1] === "^" ) { - return concat(["^", path.call(print)]); + return ["^", path.call(print)]; } return path.call(print); @@ -30,21 +30,21 @@ export const printAryPtn: Plugin.Printer = (path, opts, print) => { } if (splatarg) { - args.push(concat(["*", path.call(print, "body", 2)])); + args.push(["*", path.call(print, "body", 2)]); } if (postargs) { args = args.concat(path.map(print, "body", 3)); } - args = group(join(concat([",", line]), args)); + args = group(join([",", line], args)); if (constant || patterns.includes(path.getParentNode().type)) { - args = concat(["[", args, "]"]); + args = ["[", args, "]"]; } if (constant) { - return concat([path.call(print, "body", 0), args]); + return [path.call(print, "body", 0), args]; } return args; @@ -52,14 +52,23 @@ export const printAryPtn: Plugin.Printer = (path, opts, print) => { export const printFndPtn: Plugin.Printer = (path, opts, print) => { const [constant] = path.getValue().body; - const args = ([concat(["*", path.call(print, "body", 1)])] as Plugin.Doc[]) - .concat(path.map(print, "body", 2)) - .concat(concat(["*", path.call(print, "body", 3)])); - - const docs = concat(["[", group(join(concat([",", line]), args)), "]"]); + const docs = [ + "[", + group( + join( + [",", line], + [ + ["*", path.call(print, "body", 1)], + ...path.map(print, "body", 2), + ["*", path.call(print, "body", 3)] + ] + ) + ), + "]" + ]; if (constant) { - return concat([path.call(print, "body", 0), docs]); + return [path.call(print, "body", 0), docs]; } return docs; @@ -83,26 +92,26 @@ export const printHshPtn: Plugin.Printer = (path, opts, print) => { ); } - return concat(parts); + return parts; }; args = args.concat(path.map(printPair, "body", 1)); } if (keyValueRest) { - args.push(concat(["**", path.call(print, "body", 2)])); + args.push(["**", path.call(print, "body", 2)]); } - args = group(join(concat([",", line]), args)); + args = group(join([",", line], args)); if (constant) { - args = concat(["[", args, "]"]); + args = ["[", args, "]"]; } else if (patterns.includes(path.getParentNode().type)) { - args = concat(["{ ", args, " }"]); + args = ["{ ", args, " }"]; } if (constant) { - return concat([path.call(print, "body", 0), args]); + return [path.call(print, "body", 0), args]; } return args; @@ -119,14 +128,14 @@ export const printIn: Plugin.Printer = (path, opts, print) => { 0 ) ), - indent(concat([hardline, path.call(print, "body", 1)])) + indent([hardline, path.call(print, "body", 1)]) ]; if (path.getValue().body[2]) { parts.push(hardline, path.call(print, "body", 2)); } - return group(concat(parts)); + return group(parts); }; export const printRAssign: Plugin.Printer = ( @@ -137,11 +146,9 @@ export const printRAssign: Plugin.Printer = ( const { keyword } = path.getValue(); const [leftDoc, rightDoc] = path.map(print, "body"); - return group( - concat([ - leftDoc, - keyword ? " in" : " =>", - group(indent(concat([line, rightDoc]))) - ]) - ); + return group([ + leftDoc, + keyword ? " in" : " =>", + group(indent([line, rightDoc])) + ]); }; diff --git a/src/ruby/nodes/regexp.ts b/src/ruby/nodes/regexp.ts index 77118404..6ed22ed3 100644 --- a/src/ruby/nodes/regexp.ts +++ b/src/ruby/nodes/regexp.ts @@ -1,9 +1,6 @@ import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; import { hasAncestor } from "../../utils"; -const { concat } = prettier; - function hasContent(node: Ruby.RegexpLiteral, pattern: RegExp) { return node.body.some( (child) => child.type === "@tstring_content" && pattern.test(child.body) @@ -48,14 +45,8 @@ export const printRegexpLiteral: Plugin.Printer = ( // If we should be using braces but we have braces in the body of the regexp, // then we're just going to resort to using whatever the original content was. if (useBraces && hasContent(node, /[{}]/)) { - return concat( - ([node.beging] as Plugin.Doc[]).concat(docs).concat(node.ending) - ); + return [node.beging, ...docs, node.ending]; } - return concat( - ([useBraces ? "%r{" : "/"] as Plugin.Doc[]) - .concat(docs) - .concat(useBraces ? "}" : "/", node.ending.slice(1)) - ); + return [useBraces ? "%r{" : "/", ...docs, useBraces ? "}" : "/", node.ending.slice(1)]; }; diff --git a/src/ruby/nodes/rescue.ts b/src/ruby/nodes/rescue.ts index 705a0bed..18ebc651 100644 --- a/src/ruby/nodes/rescue.ts +++ b/src/ruby/nodes/rescue.ts @@ -1,24 +1,23 @@ -import type * as Prettier from "prettier"; import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; import { literal } from "../../utils"; -const { align, concat, group, hardline, indent, join, line } = prettier; +const { align, group, hardline, indent, join, line } = prettier; export const printBegin: Plugin.Printer = (path, opts, print) => { - return concat([ + return [ "begin", - indent(concat([hardline, concat(path.map(print, "body"))])), + indent([hardline, path.map(print, "body")]), hardline, "end" - ]); + ]; }; export const printEnsure: Plugin.Printer = (path, opts, print) => { - return concat([ + return [ path.call(print, "body", 0), - indent(concat([hardline, path.call(print, "body", 1)])) - ]); + indent([hardline, path.call(print, "body", 1)]) + ]; }; export const printRescue: Plugin.Printer = (path, opts, print) => { @@ -33,19 +32,19 @@ export const printRescue: Plugin.Printer = (path, opts, print) => { parts.push(" StandardError"); } - const bodystmt = path.call(print, "body", 1) as Prettier.doc.builders.Concat; + const bodystmt = path.call(print, "body", 1) as Plugin.Doc[]; - if (bodystmt.parts.length > 0) { - parts.push(indent(concat([hardline, bodystmt]))); + if (bodystmt.length > 0) { + parts.push(indent([hardline, bodystmt])); } // This is the next clause on the `begin` statement, either another // `rescue`, and `ensure`, or an `else` clause. if (path.getValue().body[2]) { - parts.push(concat([hardline, path.call(print, "body", 2)])); + parts.push([hardline, path.call(print, "body", 2)]); } - return group(concat(parts)); + return group(parts); }; // This is a container node that we're adding into the AST that isn't present in @@ -62,7 +61,7 @@ export const printRescueEx: Plugin.Printer = ( let exceptionDoc = path.call(print, "body", 0); if (Array.isArray(exceptionDoc)) { - const joiner = concat([",", line]); + const joiner = [",", line]; exceptionDoc = group(join(joiner, exceptionDoc)); } @@ -73,7 +72,7 @@ export const printRescueEx: Plugin.Printer = ( parts.push(" => ", path.call(print, "body", 1)); } - return group(concat(parts)); + return group(parts); }; export const printRescueMod: Plugin.Printer = ( @@ -83,15 +82,15 @@ export const printRescueMod: Plugin.Printer = ( ) => { const [statementDoc, valueDoc] = path.map(print, "body"); - return concat([ + return [ "begin", - indent(concat([hardline, statementDoc])), + indent([hardline, statementDoc]), hardline, "rescue StandardError", - indent(concat([hardline, valueDoc])), + indent([hardline, valueDoc]), hardline, "end" - ]); + ]; }; export const printRedo = literal("redo"); diff --git a/src/ruby/nodes/return.ts b/src/ruby/nodes/return.ts index ab188de6..81ae1a89 100644 --- a/src/ruby/nodes/return.ts +++ b/src/ruby/nodes/return.ts @@ -2,7 +2,7 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; import { literal } from "../../utils"; -const { concat, group, ifBreak, indent, line, join, softline } = prettier; +const { group, ifBreak, indent, line, join, softline } = prettier; // You can't skip the parentheses if you have comments or certain operators with // lower precedence than the return keyword. @@ -70,22 +70,21 @@ export const printReturn: Plugin.Printer = (path, opts, print) => { // If we got the value straight out of the parens, then `parts` would only // be a singular doc as opposed to an array. - const value = Array.isArray(parts) ? join(concat([",", line]), parts) : parts; + const value = Array.isArray(parts) ? join([",", line], parts) : parts; // We only get here if we have comments somewhere that would prevent us from // skipping the parentheses. if (args.body.length === 1 && args.body[0].type === "paren") { - return concat(["return", value]); + return ["return", value]; } - return group( - concat([ - "return", - ifBreak(parts.length > 1 ? " [" : "(", " "), - indent(concat([softline, value])), - concat([softline, ifBreak(parts.length > 1 ? "]" : ")", "")]) - ]) - ); + return group([ + "return", + ifBreak(parts.length > 1 ? " [" : "(", " "), + indent([softline, value]), + softline, + ifBreak(parts.length > 1 ? "]" : ")", "") + ]); }; export const printReturn0 = literal("return"); diff --git a/src/ruby/nodes/statements.ts b/src/ruby/nodes/statements.ts index 8932a8bd..f7e61c0f 100644 --- a/src/ruby/nodes/statements.ts +++ b/src/ruby/nodes/statements.ts @@ -4,7 +4,6 @@ import { isEmptyStmts } from "../../utils"; const { breakParent, - concat, dedent, group, hardline, @@ -29,7 +28,7 @@ export const printBodyStmt: Plugin.Printer = ( } if (rescue) { - parts.push(dedent(concat([hardline, path.call(print, "body", 1)]))); + parts.push(dedent([hardline, path.call(print, "body", 1)])); } if (elseClause) { @@ -40,14 +39,14 @@ export const printBodyStmt: Plugin.Printer = ( ? path.call(print, "body", 2, "body", 0) : path.call(print, "body", 2); - parts.push(concat([dedent(concat([hardline, "else"])), hardline, stmts])); + parts.push([dedent([hardline, "else"]), hardline, stmts]); } if (ensure) { - parts.push(dedent(concat([hardline, path.call(print, "body", 3)]))); + parts.push(dedent([hardline, path.call(print, "body", 3)])); } - return group(concat(parts)); + return group(parts); }; const argNodeTypes = ["args", "args_add_star", "args_add_block"]; @@ -70,12 +69,10 @@ export const printParen: Plugin.Printer = (path, opts, print) => { // If we have an arg type node as the contents, then it's going to return an // array, so we need to explicitly join that content here. if (argNodeTypes.includes(contentNode.type)) { - contentDoc = join(concat([",", line]), contentDoc); + contentDoc = join([",", line], contentDoc); } - return group( - concat(["(", indent(concat([softline, contentDoc])), softline, ")"]) - ); + return group(["(", indent([softline, contentDoc]), softline, ")"]); }; export const printEndContent: Plugin.Printer = ( @@ -84,7 +81,7 @@ export const printEndContent: Plugin.Printer = ( _print ) => { const { body } = path.getValue(); - return concat([trim, "__END__", literalline, body]); + return [trim, "__END__", literalline, body]; }; export const printComment: Plugin.Printer = ( @@ -100,7 +97,7 @@ export const printProgram: Plugin.Printer = ( opts, print ) => { - return concat([join(hardline, path.map(print, "body")), hardline]); + return [join(hardline, path.map(print, "body")), hardline]; }; export const printStmts: Plugin.Printer = (path, opts, print) => { @@ -124,7 +121,7 @@ export const printStmts: Plugin.Printer = (path, opts, print) => { "comments" ); - return concat([breakParent, join(hardline, comments)]); + return [breakParent, join(hardline, comments)]; } const parts: Plugin.Doc[] = []; @@ -156,5 +153,5 @@ export const printStmts: Plugin.Printer = (path, opts, print) => { lineNo = stmt.el; }); - return concat(parts); + return parts; }; diff --git a/src/ruby/nodes/strings.ts b/src/ruby/nodes/strings.ts index c486c02b..1251a9ad 100644 --- a/src/ruby/nodes/strings.ts +++ b/src/ruby/nodes/strings.ts @@ -1,16 +1,8 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; -const { - concat, - group, - hardline, - indent, - literalline, - removeLines, - softline, - join -} = prettier; +const { group, hardline, indent, literalline, removeLines, softline, join } = + prettier; // If there is some part of this string that matches an escape sequence or that // contains the interpolation pattern ("#{"), then we are locked into whichever @@ -88,7 +80,7 @@ export const printChar: Plugin.Printer = ( } const quote = rubySingleQuote ? "'" : '"'; - return concat([quote, body.slice(1), quote]); + return [quote, body.slice(1), quote]; }; const printPercentSDynaSymbol: Plugin.Printer = ( @@ -118,7 +110,7 @@ const printPercentSDynaSymbol: Plugin.Printer = ( // character from the opening. parts.push(quotePairs[node.quote[2] as Quote]); - return concat(parts); + return parts; }; // We don't actually want to print %s symbols, as they're much more rarely seen @@ -201,7 +193,7 @@ export const printDynaSymbol: Plugin.Printer = ( parts.unshift(":"); } - return concat(parts); + return parts; }; export const printStringConcat: Plugin.Printer = ( @@ -211,7 +203,7 @@ export const printStringConcat: Plugin.Printer = ( ) => { const [leftDoc, rightDoc] = path.map(print, "body"); - return group(concat([leftDoc, " \\", indent(concat([hardline, rightDoc]))])); + return group([leftDoc, " \\", indent([hardline, rightDoc])]); }; // Prints out an interpolated variable in the string by converting it into an @@ -221,7 +213,7 @@ export const printStringDVar: Plugin.Printer = ( opts, print ) => { - return concat(["#{", path.call(print, "body", 0), "}"]); + return ["#{", path.call(print, "body", 0), "}"]; }; export const printStringEmbExpr: Plugin.Printer = ( @@ -236,12 +228,10 @@ export const printStringEmbExpr: Plugin.Printer = ( // line in the source, then we're going to leave them in place and assume // that's the way the developer wanted this expression represented. if (node.sl === node.el) { - return concat(["#{", removeLines(parts), "}"]); + return ["#{", removeLines(parts), "}"]; } - return group( - concat(["#{", indent(concat([softline, parts])), concat([softline, "}"])]) - ); + return group(["#{", indent([softline, parts]), [softline, "}"]]); }; // Prints out a literal string. This function does its best to respect the @@ -279,9 +269,7 @@ export const printStringLiteral: Plugin.Printer = ( return join(literalline, normalizeQuotes(part.body, quote).split("\n")); }); - return concat( - ([quote] as Plugin.Doc[]).concat(parts).concat(getClosingQuote(quote)) - ); + return [quote, ...parts, getClosingQuote(quote)]; }; // Prints out a symbol literal. Its child will always be the ident that @@ -291,7 +279,7 @@ export const printSymbolLiteral: Plugin.Printer = ( opts, print ) => { - return concat([":", path.call(print, "body", 0)]); + return [":", path.call(print, "body", 0)]; }; // Prints out an xstring literal. Its child is an array of string parts, @@ -301,7 +289,5 @@ export const printXStringLiteral: Plugin.Printer = ( opts, print ) => { - return concat( - (["`"] as Plugin.Doc[]).concat(path.map(print, "body")).concat("`") - ); + return ["`", ...path.map(print, "body"), "`"]; }; diff --git a/src/ruby/nodes/super.ts b/src/ruby/nodes/super.ts index cac15fb6..db349c51 100644 --- a/src/ruby/nodes/super.ts +++ b/src/ruby/nodes/super.ts @@ -2,7 +2,7 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; import { literal } from "../../utils"; -const { align, concat, group, join, line } = prettier; +const { align, group, join, line } = prettier; export const printSuper: Plugin.Printer = (path, opts, print) => { const args = path.getValue().body[0]; @@ -15,18 +15,16 @@ export const printSuper: Plugin.Printer = (path, opts, print) => { return "super()"; } - return concat(["super", path.call(print, "body", 0)]); + return ["super", path.call(print, "body", 0)]; } const keyword = "super "; const argsDocs = path.call(print, "body", 0); - return group( - concat([ - keyword, - align(keyword.length, group(join(concat([",", line]), argsDocs))) - ]) - ); + return group([ + keyword, + align(keyword.length, group(join([",", line], argsDocs))) + ]); }; // Version of super without any parens or args. diff --git a/src/ruby/nodes/undef.ts b/src/ruby/nodes/undef.ts index 172daf56..17cf8aa2 100644 --- a/src/ruby/nodes/undef.ts +++ b/src/ruby/nodes/undef.ts @@ -1,7 +1,7 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; -const { addTrailingComment, align, concat, group, join, line } = prettier; +const { addTrailingComment, align, group, join, line } = prettier; const printUndefSymbol: Plugin.Printer = ( path, @@ -29,10 +29,5 @@ export const printUndef: Plugin.Printer = (path, opts, print) => { "body" ); - return group( - concat([ - keyword, - align(keyword.length, join(concat([",", line]), argNodes)) - ]) - ); + return group([keyword, align(keyword.length, join([",", line], argNodes))]); }; diff --git a/src/ruby/printer.ts b/src/ruby/printer.ts index 0a9538ff..b8db90a8 100644 --- a/src/ruby/printer.ts +++ b/src/ruby/printer.ts @@ -4,7 +4,7 @@ import prettier from "../prettier"; import embed from "./embed"; import nodes from "./nodes"; -const { concat, trim } = prettier; +const { trim } = prettier; const noComments = [ "args", @@ -140,7 +140,7 @@ const printer: Plugin.PrinterConfig = { return `#${comment.value}`; } - return concat([trim, comment.value]); + return [trim, comment.value]; } }; diff --git a/src/utils/inlineEnsureParens.ts b/src/utils/inlineEnsureParens.ts index 361c754b..d5cb1557 100644 --- a/src/utils/inlineEnsureParens.ts +++ b/src/utils/inlineEnsureParens.ts @@ -46,7 +46,7 @@ function inlineEnsureParens( parts: Plugin.Doc[] ) { if (needsParens.includes(path.getParentNode().type)) { - return (["("] as Plugin.Doc[]).concat(parts, ")"); + return ["(", ...parts, ")"]; } return parts; diff --git a/src/utils/printEmptyCollection.ts b/src/utils/printEmptyCollection.ts index 47f58192..df2477bb 100644 --- a/src/utils/printEmptyCollection.ts +++ b/src/utils/printEmptyCollection.ts @@ -1,7 +1,7 @@ import type { Plugin, Ruby } from "../types"; import prettier from "../prettier"; -const { concat, group, hardline, indent, join, line } = prettier; +const { group, hardline, indent, join, line } = prettier; function containedWithin( node: Ruby.Array | Ruby.Hash @@ -46,14 +46,12 @@ function printEmptyCollection( path.each(printComment, "comments"); - return group( - concat([ - startToken, - indent(concat([hardline, join(hardline, comments)])), - line, - endToken - ]) - ); + return group([ + startToken, + indent([hardline, join(hardline, comments)]), + line, + endToken + ]); } export default printEmptyCollection; diff --git a/test/js/globalSetup.ts b/test/js/globalSetup.ts index 22146f77..4eb2a3d0 100644 --- a/test/js/globalSetup.ts +++ b/test/js/globalSetup.ts @@ -23,7 +23,7 @@ function globalSetup() { (global as any).__ASYNC_PARSER__ = spawn( "ruby", - ["./src/parser/server.rb"].concat(parserArgs) + ["./src/parser/server.rb", ...parserArgs] ); } diff --git a/yarn.lock b/yarn.lock index 1ed50f2a..055d9713 100644 --- a/yarn.lock +++ b/yarn.lock @@ -845,10 +845,10 @@ ansi-escapes@^4.2.1: dependencies: type-fest "^0.21.3" -ansi-regex@^5.0.0, ansi-regex@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" - integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== +ansi-regex@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== ansi-styles@^3.2.1: version "3.2.1" @@ -2688,7 +2688,7 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= -prettier@>=1.10: +prettier@>=2.3.0: version "2.4.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c" integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA== From 3003c5467877184eafcb39c5a20b283169077c8e Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 21 Sep 2021 12:23:33 -0400 Subject: [PATCH 252/785] Fix up some lint violations --- package.json | 2 -- src/parser/netcat.js | 1 + src/ruby/nodes/ints.ts | 8 +++----- src/ruby/nodes/return.ts | 12 ++++-------- src/ruby/nodes/strings.ts | 1 + 5 files changed, 9 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 83cb7b53..466d5f2d 100644 --- a/package.json +++ b/package.json @@ -57,11 +57,9 @@ "varsIgnorePattern": "^_" } ], - "prefer-spread": "off", "@typescript-eslint/explicit-module-boundary-types": "off", "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-namespace": "off", - "@typescript-eslint/no-non-null-assertion": "off", "@typescript-eslint/no-unused-vars": [ "error", { diff --git a/src/parser/netcat.js b/src/parser/netcat.js index c36e465a..4a6971a0 100644 --- a/src/parser/netcat.js +++ b/src/parser/netcat.js @@ -2,6 +2,7 @@ // On average, this is 2-3x slower than netcat, but still much faster than // spawning a new Ruby process. +// eslint-disable-next-line @typescript-eslint/no-var-requires const { createConnection } = require("net"); const sock = process.argv[process.argv.length - 1]; diff --git a/src/ruby/nodes/ints.ts b/src/ruby/nodes/ints.ts index fe7fa5f5..6f11d3c9 100644 --- a/src/ruby/nodes/ints.ts +++ b/src/ruby/nodes/ints.ts @@ -18,11 +18,9 @@ export const printInt: Plugin.Printer = (path, _opts, _print) => { // already formatted with underscores, then add them in in between the // numbers every three characters starting from the right. if (!body.startsWith("0") && body.length >= 5 && !body.includes("_")) { - return ` ${body}` - .slice((body.length + 2) % 3) - .match(/.{3}/g)! - .join("_") - .trim(); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const segments = ` ${body}`.slice((body.length + 2) % 3).match(/.{3}/g)!; + return segments.join("_").trim(); } return body; diff --git a/src/ruby/nodes/return.ts b/src/ruby/nodes/return.ts index 81ae1a89..84be1ea7 100644 --- a/src/ruby/nodes/return.ts +++ b/src/ruby/nodes/return.ts @@ -32,8 +32,6 @@ function canSkipParens(args: Ruby.Args | Ruby.ArgsAddStar) { return true; } -type CallArgs = [Plugin.Print, ...PropertyKey[]]; - export const printReturn: Plugin.Printer = (path, opts, print) => { let args = path.getValue().body[0].body[0] as Ruby.Args | Ruby.ArgsAddStar; let steps = ["body", 0, "body", 0]; @@ -63,10 +61,8 @@ export const printReturn: Plugin.Printer = (path, opts, print) => { // Now that we've established which actual node is the arguments to return, // we grab it out of the path by diving down the steps that we've set up. - const parts = path.call.apply( - path, - ([print] as CallArgs).concat(steps) as CallArgs - ) as Plugin.Doc[]; + const parts = path.call(print, ...steps) as Plugin.Doc | Plugin.Doc[]; + const useBrackets = Array.isArray(parts) && parts.length > 1; // If we got the value straight out of the parens, then `parts` would only // be a singular doc as opposed to an array. @@ -80,10 +76,10 @@ export const printReturn: Plugin.Printer = (path, opts, print) => { return group([ "return", - ifBreak(parts.length > 1 ? " [" : "(", " "), + ifBreak(useBrackets ? " [" : "(", " "), indent([softline, value]), softline, - ifBreak(parts.length > 1 ? "]" : ")", "") + ifBreak(useBrackets ? "]" : ")", "") ]); }; diff --git a/src/ruby/nodes/strings.ts b/src/ruby/nodes/strings.ts index 1251a9ad..6ff1f361 100644 --- a/src/ruby/nodes/strings.ts +++ b/src/ruby/nodes/strings.ts @@ -57,6 +57,7 @@ function getClosingQuote(quote: string) { return quote; } + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const boundary = /%[Qq]?(.)/.exec(quote)![1]; if (boundary in quotePairs) { return quotePairs[boundary as Quote]; From 80dd1e46be0eaab9d51001d33967d839275b96b1 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 21 Sep 2021 12:34:49 -0400 Subject: [PATCH 253/785] General cleanup and organization --- src/haml/embed.ts | 2 +- src/haml/parser.ts | 8 +++--- src/haml/printer.ts | 50 ++++++++++++++++++-------------------- src/parser/parseSync.ts | 8 +++--- src/rbs/parser.ts | 28 ++++++++++----------- src/rbs/printer.ts | 41 +++++++++++++++---------------- src/ruby/nodes/case.ts | 15 ++++++------ src/ruby/nodes/commands.ts | 2 +- src/ruby/nodes/massign.ts | 8 +++--- src/ruby/nodes/regexp.ts | 7 +++++- src/ruby/parser.ts | 20 +++++++-------- src/ruby/printer.ts | 16 ++++++------ src/types.ts | 6 ++--- test/js/globalSetup.ts | 8 +++--- test/js/rbs/parser.test.ts | 18 +++++--------- 15 files changed, 115 insertions(+), 122 deletions(-) diff --git a/src/haml/embed.ts b/src/haml/embed.ts index 0334b7c8..a5b89a9c 100644 --- a/src/haml/embed.ts +++ b/src/haml/embed.ts @@ -15,7 +15,7 @@ const { // necessary, but since it's in prettier core I'm keeping it here. /* istanbul ignore next */ function replaceNewlines(doc: Plugin.Doc) { - return mapDoc(doc, (currentDoc: Plugin.Doc) => + return mapDoc(doc, (currentDoc) => typeof currentDoc === "string" && currentDoc.includes("\n") ? currentDoc.split(/(\n)/g).map((v, i) => (i % 2 === 0 ? v : literalline)) : currentDoc diff --git a/src/haml/parser.ts b/src/haml/parser.ts index cd2829d4..53cb8424 100644 --- a/src/haml/parser.ts +++ b/src/haml/parser.ts @@ -2,10 +2,10 @@ import type { Plugin, HAML } from "../types"; import parseSync from "../parser/parseSync"; const parser: Plugin.Parser = { - // This function is responsible for taking an input string of text and returning - // to prettier a JavaScript object that is the equivalent AST that represents - // the code stored in that string. We accomplish this by spawning a new process - // and reading JSON off STDOUT. + // This function is responsible for taking an input string of text and + // returning to prettier a JavaScript object that is the equivalent AST that + // represents the code stored in that string. We accomplish this by spawning a + // new process and reading JSON off STDOUT. parse(text, _parsers, opts) { return parseSync("haml", text, opts); }, diff --git a/src/haml/printer.ts b/src/haml/printer.ts index 1de6f177..b980155f 100644 --- a/src/haml/printer.ts +++ b/src/haml/printer.ts @@ -233,22 +233,22 @@ const printer: Plugin.PrinterConfig = { const { attributes, dynamic_attributes } = value; const parts = []; - // If we have a tag that isn't a div, then we need to print out that name of - // that tag first. If it is a div, first we'll check if there are any other - // things that would force us to print out the div explicitly, and otherwise - // we'll leave it off. + // If we have a tag that isn't a div, then we need to print out that + // name of that tag first. If it is a div, first we'll check if there + // are any other things that would force us to print out the div + // explicitly, and otherwise we'll leave it off. if (value.name !== "div") { parts.push(`%${value.name}`); } - // If we have a class attribute, then we're going to print that here using - // the special class syntax. + // If we have a class attribute, then we're going to print that here + // using the special class syntax. if (attributes.class) { parts.push(`.${attributes.class.replace(/ /g, ".")}`); } - // If we have an id attribute, then we're going to print that here using the - // special id syntax. + // If we have an id attribute, then we're going to print that here using + // the special id syntax. if (attributes.id) { parts.push(`#${attributes.id}`); } @@ -274,8 +274,9 @@ const printer: Plugin.PrinterConfig = { ); } - // If there are any static attributes that are not class or id (because we - // already took care of those), then we're going to print them out here. + // If there are any static attributes that are not class or id (because + // we already took care of those), then we're going to print them out + // here. const staticAttributes = Object.keys(attributes).filter( (name) => !["class", "id"].includes(name) ); @@ -305,20 +306,17 @@ const printer: Plugin.PrinterConfig = { if (typeof dynamic_attributes.old === "string") { parts.push(dynamic_attributes.old); } else { - const attrOptions = { - // This is kind of a total hack in that I don't think you're really - // supposed to directly use `path.stack`, but it's the easiest way to - // get the root node without having to know how many levels deep we - // are. - supportsMultiline: (path.stack[0] as HAML.Root) - .supports_multiline, - headerLength: parts.join("").length - }; + // This is kind of a total hack in that I don't think you're + // really supposed to directly use `path.stack`, but it's the + // easiest way to get the root node without having to know how + // many levels deep we are. + const root = path.stack[0] as HAML.Root; parts.push( printAttributes(dynamic_attributes.old, { ...opts, - ...attrOptions + supportsMultiline: root.supports_multiline, + headerLength: parts.join("").length }) ); } @@ -355,8 +353,8 @@ const printer: Plugin.PrinterConfig = { ); } - // In case none of the other if statements have matched and we're printing - // a div, we need to explicitly add it back into the array. + // In case none of the other if statements have matched and we're + // printing a div, we need to explicitly add it back into the array. if (parts.length === 0 && value.name === "div") { parts.push("%div"); } @@ -368,8 +366,8 @@ const printer: Plugin.PrinterConfig = { } // It's common to a couple of nodes to attach nested child nodes on the - // children property. This utility prints them out grouped together with their - // parent node docs. + // children property. This utility prints them out grouped together with + // their parent node docs. function printWithChildren( node: HAML.Comment | HAML.Script | HAML.Tag, docs: Plugin.Doc @@ -384,8 +382,8 @@ const printer: Plugin.PrinterConfig = { ]); } }, - // This function handles adding the format pragma to a source string. This is an - // optional workflow for incremental adoption. + // This function handles adding the format pragma to a source string. This is + // an optional workflow for incremental adoption. insertPragma(text) { return `-# @format${text.startsWith("-#") ? "\n" : "\n\n"}${text}`; } diff --git a/src/parser/parseSync.ts b/src/parser/parseSync.ts index b302e8ff..c1f485ff 100644 --- a/src/parser/parseSync.ts +++ b/src/parser/parseSync.ts @@ -178,10 +178,10 @@ function parseSync(parser: string, source: string, opts: Plugin.Options) { @prettier/plugin-ruby uses unix sockets to communicate between the node.js process running prettier and an underlying Ruby process used for parsing. Unfortunately the command that it tried to use to do that - (${netcatConfig.command}) does not support unix sockets. To solve this either - uninstall the version of ${netcatConfig.command} that you're using and use a - different implementation, or change the value of the rubyNetcatCommand - option in your prettier configuration. + (${netcatConfig.command}) does not support unix sockets. To solve this + either uninstall the version of ${netcatConfig.command} that you're using + and use a different implementation, or change the value of the + rubyNetcatCommand option in your prettier configuration. `); } diff --git a/src/rbs/parser.ts b/src/rbs/parser.ts index 525b97e1..f263a76b 100644 --- a/src/rbs/parser.ts +++ b/src/rbs/parser.ts @@ -2,10 +2,10 @@ import type { Plugin, RBS } from "../types"; import parseSync from "../parser/parseSync"; const parser: Plugin.Parser = { - // This function is responsible for taking an input string of text and returning - // to prettier a JavaScript object that is the equivalent AST that represents - // the code stored in that string. We accomplish this by spawning a new Ruby - // process of parser.rb and reading JSON off STDOUT. + // This function is responsible for taking an input string of text and + // returning to prettier a JavaScript object that is the equivalent AST that + // represents the code stored in that string. We accomplish this by spawning a + // new Ruby process of parser.rb and reading JSON off STDOUT. parse(text, _parsers, opts) { return parseSync("rbs", text, opts); }, @@ -15,17 +15,17 @@ const parser: Plugin.Parser = { hasPragma(text) { return /^\s*#[^\S\n]*@(format|prettier)\s*(\n|$)/.test(text); }, - // This function is critical for comments and cursor support, and is responsible - // for returning the index of the character within the source string that is the - // beginning of the given node. - locStart(node: any) { - return (node.location || node.type.location).start_pos; + // This function is critical for comments and cursor support, and is + // responsible for returning the index of the character within the source + // string that is the beginning of the given node. + locStart(node) { + return node.location.start_pos; }, - // This function is critical for comments and cursor support, and is responsible - // for returning the index of the character within the source string that is the - // ending of the given node. - locEnd(node: any) { - return (node.location || node.type.location).end_pos; + // This function is critical for comments and cursor support, and is + // responsible for returning the index of the character within the source + // string that is the ending of the given node. + locEnd(node) { + return node.location.end_pos; } }; diff --git a/src/rbs/printer.ts b/src/rbs/printer.ts index b381aba9..3fc9d083 100644 --- a/src/rbs/printer.ts +++ b/src/rbs/printer.ts @@ -18,21 +18,20 @@ function getSortedKeys(object: Record) { // In some cases, we want to just defer to whatever was in the source. function getSource(node: { location: RBS.Location }, opts: Plugin.Options) { - return opts.originalText.slice( - node.location.start_pos, - node.location.end_pos - ); + const { location } = node; + return opts.originalText.slice(location.start_pos, location.end_pos); } const printer: Plugin.PrinterConfig = { - // This is the generic node print function, used to convert any node in the AST - // into its equivalent Doc representation. + // This is the generic node print function, used to convert any node in the + // AST into its equivalent Doc representation. print(path, opts, print) { const node = path.getValue(); let doc = null; if (node.declarations) { - // Prints out the root of the tree, which includes zero or more declarations. + // Prints out the root of the tree, which includes zero or more + // declarations. return [ join([hardline, hardline], path.map(print, "declarations")), hardline @@ -189,8 +188,8 @@ const printer: Plugin.PrinterConfig = { throw new Error(`Unsupported node encountered:\n${ast}`); } - // An annotation can be attached to most kinds of nodes, and should be printed - // using %a{}. Certain nodes can't have annotations at all. + // An annotation can be attached to most kinds of nodes, and should be + // printed using %a{}. Certain nodes can't have annotations at all. if (node.annotations && node.annotations.length > 0) { doc = [ join( @@ -198,9 +197,9 @@ const printer: Plugin.PrinterConfig = { path.map((annotationPath: Plugin.Path) => { const annotationNode = annotationPath.getValue(); - // If there are already braces inside the annotation, then we're just - // going to print out the original string to avoid having to escape - // anything. + // If there are already braces inside the annotation, then we're + // just going to print out the original string to avoid having to + // escape anything. if (/[{}]/.test(annotationNode.string)) { return getSource(annotationNode, opts); } @@ -234,9 +233,9 @@ const printer: Plugin.PrinterConfig = { // Prints out a string in the source, which looks like: // 'foo' function printString(node: RBS.Literal) { - // We're going to go straight to the source here, as if we don't then we're - // going to end up with the result of String#inspect, which does weird - // things to escape sequences. + // We're going to go straight to the source here, as if we don't then + // we're going to end up with the result of String#inspect, which does + // weird things to escape sequences. const value = getSource(node, opts); // Get the quote that was used in the source and the quote that we want to @@ -294,8 +293,8 @@ const printer: Plugin.PrinterConfig = { "?" ]; case "tuple": - // If we don't have any sub types, we explicitly need the space in between - // the brackets to not confuse the parser. + // If we don't have any sub types, we explicitly need the space in + // between the brackets to not confuse the parser. if (node.types.length === 0) { return "[ ]"; } @@ -593,8 +592,8 @@ const printer: Plugin.PrinterConfig = { } }, // This is an escape-hatch to ignore nodes in the tree. If you have a comment - // that includes this pattern, then the entire node will be ignored and just the - // original source will be printed out. + // that includes this pattern, then the entire node will be ignored and just + // the original source will be printed out. hasPrettierIgnore(path) { const node = path.getValue(); @@ -602,8 +601,8 @@ const printer: Plugin.PrinterConfig = { (node.comment && node.comment.string.includes("prettier-ignore")) || false ); }, - // This function handles adding the format pragma to a source string. This is an - // optional workflow for incremental adoption. + // This function handles adding the format pragma to a source string. This is + // an optional workflow for incremental adoption. insertPragma(text) { return `# @format\n${text}`; } diff --git a/src/ruby/nodes/case.ts b/src/ruby/nodes/case.ts index e0650028..83982bb2 100644 --- a/src/ruby/nodes/case.ts +++ b/src/ruby/nodes/case.ts @@ -12,13 +12,7 @@ export const printCase: Plugin.Printer = (path, opts, print) => { parts.push(" ", path.call(print, "body", 0)); } - return [ - ...parts, - hardline, - path.call(print, "body", 1), - hardline, - "end" - ]; + return [...parts, hardline, path.call(print, "body", 1), hardline, "end"]; }; export const printWhen: Plugin.Printer = (path, opts, print) => { @@ -35,7 +29,12 @@ export const printWhen: Plugin.Printer = (path, opts, print) => { // Pull off the last element and make it concat with a comma so that // we can maintain alternating lines and docs. - return [...accum.slice(0, -1), [accum[accum.length - 1], ","], line, pred]; + return [ + ...accum.slice(0, -1), + [accum[accum.length - 1], ","], + line, + pred + ]; }, [] as Plugin.Doc[] ) diff --git a/src/ruby/nodes/commands.ts b/src/ruby/nodes/commands.ts index f9214202..971496de 100644 --- a/src/ruby/nodes/commands.ts +++ b/src/ruby/nodes/commands.ts @@ -6,7 +6,7 @@ const { align, group, ifBreak, indent, join, line, softline } = prettier; function throwBadDoc(_doc: never): never; function throwBadDoc(doc: Plugin.Doc) { - throw new Error(`Unknown doc ${doc}`); + throw new Error(`Unknown doc ${doc}`); } // Loop through the already created doc nodes and determine the overall length diff --git a/src/ruby/nodes/massign.ts b/src/ruby/nodes/massign.ts index e0c8f278..65779a65 100644 --- a/src/ruby/nodes/massign.ts +++ b/src/ruby/nodes/massign.ts @@ -36,8 +36,8 @@ export const printMLHSAddPost: Plugin.Printer = ( print ) => { return [ - ...path.call(print, "body", 0) as Plugin.Doc[], - ...path.call(print, "body", 1) as Plugin.Doc[] + ...(path.call(print, "body", 0) as Plugin.Doc[]), + ...(path.call(print, "body", 1) as Plugin.Doc[]) ]; }; @@ -52,7 +52,7 @@ export const printMLHSAddStar: Plugin.Printer = ( parts.push(path.call(print, "body", 1)); } - return [...path.call(print, "body", 0) as Plugin.Doc[], parts]; + return [...(path.call(print, "body", 0) as Plugin.Doc[]), parts]; }; export const printMLHSParen: Plugin.Printer = ( @@ -90,7 +90,7 @@ export const printMRHSAddStar: Plugin.Printer = ( ) => { const [leftDoc, rightDoc] = path.map(print, "body"); - return [...leftDoc as Plugin.Doc[], ["*", rightDoc]]; + return [...(leftDoc as Plugin.Doc[]), ["*", rightDoc]]; }; export const printMRHSNewFromArgs: Plugin.Printer = ( diff --git a/src/ruby/nodes/regexp.ts b/src/ruby/nodes/regexp.ts index 6ed22ed3..4570aee7 100644 --- a/src/ruby/nodes/regexp.ts +++ b/src/ruby/nodes/regexp.ts @@ -48,5 +48,10 @@ export const printRegexpLiteral: Plugin.Printer = ( return [node.beging, ...docs, node.ending]; } - return [useBraces ? "%r{" : "/", ...docs, useBraces ? "}" : "/", node.ending.slice(1)]; + return [ + useBraces ? "%r{" : "/", + ...docs, + useBraces ? "}" : "/", + node.ending.slice(1) + ]; }; diff --git a/src/ruby/parser.ts b/src/ruby/parser.ts index ef657628..97d4af00 100644 --- a/src/ruby/parser.ts +++ b/src/ruby/parser.ts @@ -2,10 +2,10 @@ import type { Plugin, Ruby } from "../types"; import parseSync from "../parser/parseSync"; const parser: Plugin.Parser = { - // This function is responsible for taking an input string of text and returning - // to prettier a JavaScript object that is the equivalent AST that represents - // the code stored in that string. We accomplish this by spawning a new Ruby - // process of parser.rb and reading JSON off STDOUT. + // This function is responsible for taking an input string of text and + // returning to prettier a JavaScript object that is the equivalent AST that + // represents the code stored in that string. We accomplish this by spawning a + // new Ruby process of parser.rb and reading JSON off STDOUT. parse(text, _parsers, opts) { return parseSync("ruby", text, opts); }, @@ -15,15 +15,15 @@ const parser: Plugin.Parser = { hasPragma(text) { return /^\s*#[^\S\n]*@(format|prettier)\s*(\n|$)/.test(text); }, - // This function is critical for comments and cursor support, and is responsible - // for returning the index of the character within the source string that is the - // beginning of the given node. + // This function is critical for comments and cursor support, and is + // responsible for returning the index of the character within the source + // string that is the beginning of the given node. locStart(node) { return node.sc; }, - // This function is critical for comments and cursor support, and is responsible - // for returning the index of the character within the source string that is the - // ending of the given node. + // This function is critical for comments and cursor support, and is + // responsible for returning the index of the character within the source + // string that is the ending of the given node. locEnd(node) { return node.ec; } diff --git a/src/ruby/printer.ts b/src/ruby/printer.ts index b8db90a8..99e82e54 100644 --- a/src/ruby/printer.ts +++ b/src/ruby/printer.ts @@ -18,8 +18,8 @@ const noComments = [ const printer: Plugin.PrinterConfig = { // Certain nodes are used more for organizational purposed than for actually - // displaying content, so we tell prettier that we don't want comments attached - // to them. + // displaying content, so we tell prettier that we don't want comments + // attached to them. canAttachComment(node) { return !noComments.includes(node.type); }, @@ -88,8 +88,8 @@ const printer: Plugin.PrinterConfig = { } }, // This is an escape-hatch to ignore nodes in the tree. If you have a comment - // that includes this pattern, then the entire node will be ignored and just the - // original source will be printed out. + // that includes this pattern, then the entire node will be ignored and just + // the original source will be printed out. hasPrettierIgnore(path) { const node = path.getValue(); @@ -107,15 +107,15 @@ const printer: Plugin.PrinterConfig = { isBlockComment(comment) { return comment.type === "@embdoc"; }, - // This function handles adding the format pragma to a source string. This is an - // optional workflow for incremental adoption. + // This function handles adding the format pragma to a source string. This is + // an optional workflow for incremental adoption. insertPragma(text) { const boundary = text.startsWith("#") ? "\n" : "\n\n"; return `# @format${boundary}${text}`; }, - // This is the generic node print function, used to convert any node in the AST - // into its equivalent Doc representation. + // This is the generic node print function, used to convert any node in the + // AST into its equivalent Doc representation. print(path, opts, print) { const node = path.getValue(); const printer = nodes[node.type]; diff --git a/src/types.ts b/src/types.ts index dd182c31..032a8db9 100644 --- a/src/types.ts +++ b/src/types.ts @@ -431,7 +431,7 @@ export namespace RBS { type_params: { params: Param[] } }; - type Declaration = ( + type Declaration = { location: Location } & ( | { declaration: "alias", name: string, type: Type } | { declaration: "class", super_class?: NameAndArgs, members: Member[] } & NameAndTypeParams | { declaration: "constant", name: string, type: Type } @@ -440,9 +440,7 @@ export namespace RBS { | { declaration: "module", self_types: NameAndArgs[], members: Member[] } & NameAndTypeParams ); - type Root = ( - { declarations: Declaration[] } - ); + type Root = { declarations: Declaration[], location: Location }; export type Annotation = { string: string, location: Location }; diff --git a/test/js/globalSetup.ts b/test/js/globalSetup.ts index 4eb2a3d0..262b2e43 100644 --- a/test/js/globalSetup.ts +++ b/test/js/globalSetup.ts @@ -21,10 +21,10 @@ function globalSetup() { process.env.PRETTIER_RUBY_HOST = parserArgs[1]; } - (global as any).__ASYNC_PARSER__ = spawn( - "ruby", - ["./src/parser/server.rb", ...parserArgs] - ); + (global as any).__ASYNC_PARSER__ = spawn("ruby", [ + "./src/parser/server.rb", + ...parserArgs + ]); } export default globalSetup; diff --git a/test/js/rbs/parser.test.ts b/test/js/rbs/parser.test.ts index d9c1df45..6d23def1 100644 --- a/test/js/rbs/parser.test.ts +++ b/test/js/rbs/parser.test.ts @@ -30,20 +30,14 @@ describe("parser", () => { }); test("locStart", () => { - expect( - parser.locStart({ location: { start_pos: 5 } } as RBS.AnyNode) - ).toEqual(5); - expect( - parser.locStart({ type: { location: { start_pos: 10 } } } as RBS.AnyNode) - ).toEqual(10); + const node = { location: { start_pos: 5 } } as RBS.AnyNode; + + expect(parser.locStart(node)).toEqual(5); }); test("locEnd", () => { - expect(parser.locEnd({ location: { end_pos: 5 } } as RBS.AnyNode)).toEqual( - 5 - ); - expect( - parser.locEnd({ type: { location: { end_pos: 10 } } } as RBS.AnyNode) - ).toEqual(10); + const node = { location: { end_pos: 5 } } as RBS.AnyNode; + + expect(parser.locEnd(node)).toEqual(5); }); }); From 0947ae1e2b93abf560cc7e1b89addb4b984baebe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Sep 2021 12:01:13 +0000 Subject: [PATCH 254/785] Bump @types/node from 16.9.4 to 16.9.6 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.9.4 to 16.9.6. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 055d9713..78fd833b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -673,9 +673,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^16.9.1": - version "16.9.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.9.4.tgz#a12f0ee7847cf17a97f6fdf1093cb7a9af23cca4" - integrity sha512-KDazLNYAGIuJugdbULwFZULF9qQ13yNWEBFnfVpqlpgAAo6H/qnM9RjBgh0A0kmHf3XxAKLdN5mTIng9iUvVLA== + version "16.9.6" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.9.6.tgz#040a64d7faf9e5d9e940357125f0963012e66f04" + integrity sha512-YHUZhBOMTM3mjFkXVcK+WwAcYmyhe1wL4lfqNtzI0b3qAy7yuSetnM7QJazgE5PFmgVTNGiLOgRFfJMqW7XpSQ== "@types/prettier@^2.1.5", "@types/prettier@^2.3.2": version "2.3.2" From 4cf9a036b1d064ee4b6fc9551bc3f6b59550e9bf Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 22 Sep 2021 10:35:09 -0400 Subject: [PATCH 255/785] Stricter types on printing --- .prettierignore | 2 +- package.json | 18 +- src/haml/parser.ts | 4 +- src/haml/printer.ts | 15 +- src/prettier.ts | 2 +- src/rbs/printer.ts | 120 +++++--- src/ruby/embed.ts | 2 +- src/ruby/nodes.ts | 3 +- src/ruby/nodes/arrays.ts | 12 +- src/ruby/nodes/assign.ts | 2 +- src/ruby/nodes/calls.ts | 2 +- src/ruby/nodes/case.ts | 2 +- src/ruby/nodes/class.ts | 2 +- src/ruby/nodes/commands.ts | 2 +- src/ruby/nodes/conditionals.ts | 4 +- src/ruby/nodes/flow.ts | 4 +- src/ruby/nodes/hashes.ts | 17 +- src/ruby/nodes/ints.ts | 2 +- src/ruby/nodes/loops.ts | 2 +- src/ruby/nodes/methods.ts | 91 +++--- src/ruby/nodes/operators.ts | 2 +- src/ruby/nodes/params.ts | 2 +- src/ruby/nodes/return.ts | 4 +- src/ruby/nodes/statements.ts | 19 +- src/ruby/nodes/strings.ts | 18 +- src/ruby/printer.ts | 2 +- src/types.ts | 457 +----------------------------- src/types/haml.ts | 81 ++++++ src/types/plugin.ts | 98 +++++++ src/types/rbs.ts | 107 +++++++ src/types/ruby.ts | 224 +++++++++++++++ src/types/utils.ts | 24 ++ src/utils/printEmptyCollection.ts | 15 +- test/js/setupTests.ts | 9 +- 34 files changed, 758 insertions(+), 612 deletions(-) create mode 100644 src/types/haml.ts create mode 100644 src/types/plugin.ts create mode 100644 src/types/rbs.ts create mode 100644 src/types/ruby.ts create mode 100644 src/types/utils.ts diff --git a/.prettierignore b/.prettierignore index 8fa0eb9d..577f115a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -20,4 +20,4 @@ # I'm ignoring this for now because it's a dump of a bunch of types that I don't # want running onto multiple lines at the moment. -/src/types.ts +/src/types diff --git a/package.json b/package.json index 466d5f2d..99604db2 100644 --- a/package.json +++ b/package.json @@ -50,23 +50,9 @@ }, "parser": "@typescript-eslint/parser", "rules": { - "no-unused-vars": [ - "error", - { - "argsIgnorePattern": "^_", - "varsIgnorePattern": "^_" - } - ], + "no-unused-vars": "off", "@typescript-eslint/explicit-module-boundary-types": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-namespace": "off", - "@typescript-eslint/no-unused-vars": [ - "error", - { - "argsIgnorePattern": "^_", - "varsIgnorePattern": "^_" - } - ] + "@typescript-eslint/no-explicit-any": "off" } }, "jest": { diff --git a/src/haml/parser.ts b/src/haml/parser.ts index 53cb8424..50d34e31 100644 --- a/src/haml/parser.ts +++ b/src/haml/parser.ts @@ -18,10 +18,10 @@ const parser: Plugin.Parser = { // These functions are just placeholders until we can actually perform this // properly. The functions are necessary otherwise the format with cursor // functions break. - locStart(_node) { + locStart() { return 0; }, - locEnd(_node) { + locEnd() { return 0; } }; diff --git a/src/haml/printer.ts b/src/haml/printer.ts index b980155f..64442346 100644 --- a/src/haml/printer.ts +++ b/src/haml/printer.ts @@ -185,8 +185,11 @@ const printer: Plugin.PrinterConfig = { case "plain": return node.value.text; // The root node in the AST that we build in the parser. - case "root": - return [join(hardline, path.map(print, "children")), hardline]; + case "root": { + const nodePath = path as Plugin.Path; + + return [join(hardline, nodePath.map(print, "children")), hardline]; + } // https://haml.info/docs/yardoc/file.REFERENCE.html#inserting_ruby case "script": { const { value } = node; @@ -215,8 +218,10 @@ const printer: Plugin.PrinterConfig = { const parts: Plugin.Doc[] = [`- ${node.value.text.trim()}`]; if (node.children.length > 0) { + const nodePath = path as Plugin.Path; + parts.push( - path.map((childPath) => { + nodePath.map((childPath) => { const child = childPath.getValue(); const concated = [hardline, print(childPath)]; @@ -376,9 +381,11 @@ const printer: Plugin.PrinterConfig = { return docs; } + const nodePath = path as Plugin.Path; + return group([ docs, - indent([hardline, join(hardline, path.map(print, "children"))]) + indent([hardline, join(hardline, nodePath.map(print, "children"))]) ]); } }, diff --git a/src/prettier.ts b/src/prettier.ts index 8f153724..4f4f5a82 100644 --- a/src/prettier.ts +++ b/src/prettier.ts @@ -4,7 +4,7 @@ type Doc = Prettier.doc.builders.Doc; type Builders = Omit & { // Explicitly overwriting the type of the join builder because I don't want to // have to go around saying "as Doc[]" everywhere. - join: (_sep: Doc, _docs: Doc | Doc[]) => Prettier.doc.builders.Concat; + join: (sep: Doc, docs: Doc | Doc[]) => Prettier.doc.builders.Concat; }; // If `RBPRETTIER` is set, then this is being run from the `Prettier::run` ruby diff --git a/src/rbs/printer.ts b/src/rbs/printer.ts index 3fc9d083..4e2156a7 100644 --- a/src/rbs/printer.ts +++ b/src/rbs/printer.ts @@ -1,5 +1,5 @@ import type { util } from "prettier"; -import type { Plugin, RBS } from "../types"; +import type { RequiredKeys, Plugin, RBS } from "../types"; import prettier from "../prettier"; const { group, hardline, indent, makeString, join, line, softline } = prettier; @@ -8,7 +8,9 @@ const { group, hardline, indent, makeString, join, line, softline } = prettier; // object (presumably because Ruby hashes have implicit ordering). We do not // have that in JavaScript, so here we sort each object by its position in the // source string. -function getSortedKeys(object: Record) { +function getSortedKeys>( + object: T +): (keyof T)[] { return Object.keys(object).sort( (left, right) => object[left].type.location.start_pos - @@ -55,13 +57,20 @@ const printer: Plugin.PrinterConfig = { // Prints out a class declarations, which looks like: // class Foo end case "class": { - const parts: Plugin.Doc[] = ["class ", printNameAndTypeParams(node)]; + const nodePath = path as Plugin.Path; + const parts: Plugin.Doc[] = [ + "class ", + printNameAndTypeParams(nodePath, node) + ]; if (node.super_class) { - parts.push(" < ", path.call(printNameAndArgs, "super_class")); + const superPath = nodePath as Plugin.Path< + RequiredKeys + >; + parts.push(" < ", superPath.call(printNameAndArgs, "super_class")); } - parts.push(indent(printMembers()), hardline, "end"); + parts.push(indent(printMembers(nodePath)), hardline, "end"); doc = group(parts); break; } @@ -76,10 +85,12 @@ const printer: Plugin.PrinterConfig = { // Prints out an interface declaration, which looks like: // interface _Foo end case "interface": { + const nodePath = path as Plugin.Path; + doc = group([ "interface ", - printNameAndTypeParams(node), - indent(printMembers()), + printNameAndTypeParams(nodePath, node), + indent(printMembers(nodePath)), hardline, "end" ]); @@ -88,16 +99,20 @@ const printer: Plugin.PrinterConfig = { // Prints out a module declaration, which looks like: // module Foo end case "module": { - const parts: Plugin.Doc[] = ["module ", printNameAndTypeParams(node)]; + const nodePath = path as Plugin.Path; + const parts: Plugin.Doc[] = [ + "module ", + printNameAndTypeParams(nodePath, node) + ]; if (node.self_types.length > 0) { parts.push( " : ", - join(", ", path.map(printNameAndArgs, "self_types")) + join(", ", nodePath.map(printNameAndArgs, "self_types")) ); } - parts.push(indent(printMembers()), hardline, "end"); + parts.push(indent(printMembers(nodePath)), hardline, "end"); doc = group(parts); break; } @@ -164,11 +179,9 @@ const printer: Plugin.PrinterConfig = { case "include": case "extend": case "prepend": { - doc = group([ - node.member, - " ", - printNameAndArgs(path as any as Plugin.Path) - ]); + const nodePath = path as Plugin.Path; + + doc = group([node.member, " ", printNameAndArgs(nodePath)]); break; } case "public": @@ -176,9 +189,12 @@ const printer: Plugin.PrinterConfig = { doc = node.member; break; } - case "method_definition": - doc = printMethodDefinition(node); + case "method_definition": { + const nodePath = path as Plugin.Path; + + doc = printMethodDefinition(nodePath, node); break; + } /* istanbul ignore next */ default: throw new Error(`unknown member: ${(node as any).member}`); @@ -191,10 +207,14 @@ const printer: Plugin.PrinterConfig = { // An annotation can be attached to most kinds of nodes, and should be // printed using %a{}. Certain nodes can't have annotations at all. if (node.annotations && node.annotations.length > 0) { + const annotationsPath = path as Plugin.Path<{ + annotations: RBS.Annotation[]; + }>; + doc = [ join( hardline, - path.map((annotationPath: Plugin.Path) => { + annotationsPath.map((annotationPath) => { const annotationNode = annotationPath.getValue(); // If there are already braces inside the annotation, then we're @@ -284,24 +304,36 @@ const printer: Plugin.PrinterConfig = { return printString(node); } return node.literal; - case "optional": + case "optional": { + const nodePath = path as Plugin.Path; + return [ - path.call( + nodePath.call( (typePath) => printType(typePath, { forceParens: true }), "type" ), "?" ]; - case "tuple": + } + case "tuple": { // If we don't have any sub types, we explicitly need the space in // between the brackets to not confuse the parser. if (node.types.length === 0) { return "[ ]"; } - return group(["[", join(", ", path.map(printType, "types")), "]"]); + const nodePath = path as Plugin.Path; + return group([ + "[", + join(", ", nodePath.map(printType, "types")), + "]" + ]); + } case "union": { - const doc = group(join([line, "| "], path.map(printType, "types"))); + const nodePath = path as Plugin.Path; + const doc = group( + join([line, "| "], nodePath.map(printType, "types")) + ); if (forceParens) { return ["(", doc, ")"]; @@ -310,10 +342,11 @@ const printer: Plugin.PrinterConfig = { return doc; } case "intersection": { + const nodePath = path as Plugin.Path; const doc = group( join( [line, "& "], - path.map( + nodePath.map( (typePath) => printType(typePath, { forceParens: true }), "types" ) @@ -334,6 +367,7 @@ const printer: Plugin.PrinterConfig = { printMethodSignature(path as Plugin.Path) ]; case "record": { + const nodePath = path as Plugin.Path; const parts: Plugin.Doc[] = []; getSortedKeys(node.fields).forEach((field) => { @@ -345,7 +379,7 @@ const printer: Plugin.PrinterConfig = { fieldParts.push(`${field}: `); } - fieldParts.push(path.call(printType, "fields", field, "type")); + fieldParts.push(nodePath.call(printType, "fields", field, "type")); parts.push(fieldParts); }); @@ -357,8 +391,10 @@ const printer: Plugin.PrinterConfig = { ]); } case "class_instance": - case "interface": - return printNameAndArgs(path as Plugin.Path); + case "interface": { + const nodePath = path as Plugin.Path; + return printNameAndArgs(nodePath); + } case "alias": case "variable": return node.name; @@ -379,7 +415,9 @@ const printer: Plugin.PrinterConfig = { } // Prints out the members of a class, module, or interface. - function printMembers() { + function printMembers( + path: Plugin.Path + ) { let lastLine: number | null = null; const docs: Plugin.Doc[] = []; @@ -405,7 +443,10 @@ const printer: Plugin.PrinterConfig = { // Prints out the name of a class, interface, or module declaration. // Additionally loops through each type parameter if there are any and print // them out joined by commas. Checks for validation and variance. - function printNameAndTypeParams(node: RBS.NameAndTypeParams) { + function printNameAndTypeParams( + path: Plugin.Path, + node: RBS.NameAndTypeParams + ) { if (node.type_params.params.length === 0) { return node.name; } @@ -453,7 +494,13 @@ const printer: Plugin.PrinterConfig = { // rest positional, as in (*A) if (node.rest_positionals) { - parts.push(["*", path.call(printMethodParam, "rest_positionals")]); + const restPositionalsPath = path as Plugin.Path< + RequiredKeys + >; + parts.push([ + "*", + restPositionalsPath.call(printMethodParam, "rest_positionals") + ]); } // trailing positionals are required positionals after a rest @@ -480,7 +527,13 @@ const printer: Plugin.PrinterConfig = { // rest keyword, as in (**A) if (node.rest_keywords) { - parts.push(["**", path.call(printMethodParam, "rest_keywords")]); + const restKeywordsPath = path as Plugin.Path< + RequiredKeys + >; + parts.push([ + "**", + restKeywordsPath.call(printMethodParam, "rest_keywords") + ]); } return parts; @@ -556,7 +609,10 @@ const printer: Plugin.PrinterConfig = { // Prints out a method definition, which looks like: // def t: (T t) -> void - function printMethodDefinition(node: RBS.MethodDefinition) { + function printMethodDefinition( + path: Plugin.Path, + node: RBS.MethodDefinition + ) { let typeDocs: Plugin.Doc = path.map(printMethodSignature, "types"); if (node.overload) { diff --git a/src/ruby/embed.ts b/src/ruby/embed.ts index f875f0fb..91df4dd3 100644 --- a/src/ruby/embed.ts +++ b/src/ruby/embed.ts @@ -64,7 +64,7 @@ function stripCommonLeadingWhitespace(content: string) { return lines.map((line) => line.slice(minimum)).join("\n"); } -const embed: Plugin.Embed = (path, print, textToDoc, _opts) => { +const embed: Plugin.Embed = (path, print, textToDoc) => { const node = path.getValue(); // Currently we only support embedded formatting on heredoc nodes diff --git a/src/ruby/nodes.ts b/src/ruby/nodes.ts index b0707ae2..ac1e00d5 100644 --- a/src/ruby/nodes.ts +++ b/src/ruby/nodes.ts @@ -73,7 +73,6 @@ import { import { printAccessControl, printDef, - printDefs, printSingleLineMethod } from "./nodes/methods"; import { @@ -167,7 +166,7 @@ const nodes: Partial<{ const_path_ref: printConstPath, const_ref: printConstRef, def: printDef, - defs: printDefs, + defs: printDef, defsl: printSingleLineMethod, defined: printDefined, do_block: printDoBlock, diff --git a/src/ruby/nodes/arrays.ts b/src/ruby/nodes/arrays.ts index 47363723..d77f2f77 100644 --- a/src/ruby/nodes/arrays.ts +++ b/src/ruby/nodes/arrays.ts @@ -119,7 +119,11 @@ export const printArray: Plugin.Printer = (path, opts, print) => { const printString = (stringPath: Plugin.Path) => stringPath.call(print, "body", 0); - const parts = path.map(printString, "body", 0, "body"); + const nodePath = path as Plugin.Path<{ + body: [{ body: Ruby.StringLiteral[] }]; + }>; + const parts = nodePath.map(printString, "body", 0, "body"); + return printArrayLiteral("%w", parts); } @@ -129,7 +133,11 @@ export const printArray: Plugin.Printer = (path, opts, print) => { const printSymbol = (symbolPath: Plugin.Path) => symbolPath.call(print, "body", 0); - const parts = path.map(printSymbol, "body", 0, "body"); + const nodePath = path as Plugin.Path<{ + body: [{ body: Ruby.SymbolLiteral[] }]; + }>; + const parts = nodePath.map(printSymbol, "body", 0, "body"); + return printArrayLiteral("%i", parts); } } diff --git a/src/ruby/nodes/assign.ts b/src/ruby/nodes/assign.ts index 26a51cc4..30918557 100644 --- a/src/ruby/nodes/assign.ts +++ b/src/ruby/nodes/assign.ts @@ -5,7 +5,7 @@ import { skipAssignIndent } from "../../utils"; const { group, indent, join, line } = prettier; export const printAssign: Plugin.Printer = (path, opts, print) => { - const [_targetNode, valueNode] = path.getValue().body; + const [, valueNode] = path.getValue().body; const [targetDoc, valueDoc] = path.map(print, "body"); let rightSideDoc = valueDoc; diff --git a/src/ruby/nodes/calls.ts b/src/ruby/nodes/calls.ts index a75bd111..dbb55964 100644 --- a/src/ruby/nodes/calls.ts +++ b/src/ruby/nodes/calls.ts @@ -22,7 +22,7 @@ type ChainedMethodAddBlock = Ruby.MethodAddBlock & Chain; export const printCall: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); - const [receiverNode, _operatorNode, messageNode] = node.body; + const [receiverNode, , messageNode] = node.body; const receiverDoc = path.call(print, "body", 0); const operatorDoc = makeCall(path, opts, print); diff --git a/src/ruby/nodes/case.ts b/src/ruby/nodes/case.ts index 83982bb2..d0ad9692 100644 --- a/src/ruby/nodes/case.ts +++ b/src/ruby/nodes/case.ts @@ -16,7 +16,7 @@ export const printCase: Plugin.Printer = (path, opts, print) => { }; export const printWhen: Plugin.Printer = (path, opts, print) => { - const [_preds, _stmts, addition] = path.getValue().body; + const [, , addition] = path.getValue().body; // The `fill` builder command expects an array of docs alternating with // line breaks. This is so it can loop through and determine where to break. diff --git a/src/ruby/nodes/class.ts b/src/ruby/nodes/class.ts index 877cdbcf..039a51a8 100644 --- a/src/ruby/nodes/class.ts +++ b/src/ruby/nodes/class.ts @@ -5,7 +5,7 @@ import { isEmptyBodyStmt } from "../../utils"; const { group, hardline, indent } = prettier; export const printClass: Plugin.Printer = (path, opts, print) => { - const [_constant, superclass, bodystmt] = path.getValue().body; + const [, superclass, bodystmt] = path.getValue().body; const parts = ["class ", path.call(print, "body", 0)]; if (superclass) { diff --git a/src/ruby/nodes/commands.ts b/src/ruby/nodes/commands.ts index 971496de..787d9add 100644 --- a/src/ruby/nodes/commands.ts +++ b/src/ruby/nodes/commands.ts @@ -4,7 +4,7 @@ import { makeCall } from "../../utils"; const { align, group, ifBreak, indent, join, line, softline } = prettier; -function throwBadDoc(_doc: never): never; +function throwBadDoc(doc: never): never; function throwBadDoc(doc: Plugin.Doc) { throw new Error(`Unknown doc ${doc}`); } diff --git a/src/ruby/nodes/conditionals.ts b/src/ruby/nodes/conditionals.ts index 16d0594e..9d835622 100644 --- a/src/ruby/nodes/conditionals.ts +++ b/src/ruby/nodes/conditionals.ts @@ -109,7 +109,7 @@ function printSingle( Ruby.If | Ruby.IfModifier | Ruby.Unless | Ruby.UnlessModifier > { return function printSingleWithKeyword(path, { rubyModifier }, print) { - const [_predicateNode, statementsNode] = path.getValue().body; + const [, statementsNode] = path.getValue().body; const predicateDoc = path.call(print, "body", 0); const statementsDoc = path.call(print, "body", 1); @@ -301,7 +301,7 @@ export const printElse: Plugin.Printer = (path, opts, print) => { }; export const printElsif: Plugin.Printer = (path, opts, print) => { - const [_predicate, _statements, addition] = path.getValue().body; + const [, , addition] = path.getValue().body; const parts = [ group(["elsif ", align("elsif".length - 1, path.call(print, "body", 0))]), indent([hardline, path.call(print, "body", 1)]) diff --git a/src/ruby/nodes/flow.ts b/src/ruby/nodes/flow.ts index 463cfebb..d3628e72 100644 --- a/src/ruby/nodes/flow.ts +++ b/src/ruby/nodes/flow.ts @@ -35,10 +35,10 @@ function maybeHandleParens( const stmts = node.body[0].body; if (stmts.length === 1 && !unskippableParens.includes(stmts[0].type)) { - return [`${keyword} `, path.call(print, ...steps, "body", 0)]; + return [`${keyword} `, (path as any).call(print, ...steps, "body", 0)]; } - return [keyword, path.call(print, ...steps)]; + return [keyword, (path as any).call(print, ...steps)]; } export const printBreak: Plugin.Printer = (path, opts, print) => { diff --git a/src/ruby/nodes/hashes.ts b/src/ruby/nodes/hashes.ts index 1e2174e8..20e02219 100644 --- a/src/ruby/nodes/hashes.ts +++ b/src/ruby/nodes/hashes.ts @@ -9,8 +9,8 @@ import { const { group, ifBreak, indent, join, line } = prettier; type KeyPrinter = ( - _path: Plugin.Path, - _print: Plugin.Print + path: Plugin.Path, + print: Plugin.Print ) => Plugin.Doc; type HashContents = (Ruby.AssoclistFromArgs | Ruby.BareAssocHash) & { keyPrinter: KeyPrinter; @@ -56,11 +56,16 @@ const printHashKeyLabel: KeyPrinter = (path, print) => { switch (node.type) { case "@label": return print(path); - case "symbol_literal": - return [path.call(print, "body", 0), ":"]; - case "dyna_symbol": { - return [print(path), ":"]; + case "symbol_literal": { + const nodePath = path as Plugin.Path; + return [nodePath.call(print, "body", 0), ":"]; } + case "dyna_symbol": + return [print(path), ":"]; + default: + // This should never happen, but keeping it here so that the two key + // printers can maintain the same signature. + return ""; } }; diff --git a/src/ruby/nodes/ints.ts b/src/ruby/nodes/ints.ts index 6f11d3c9..45437f82 100644 --- a/src/ruby/nodes/ints.ts +++ b/src/ruby/nodes/ints.ts @@ -11,7 +11,7 @@ import type { Plugin, Ruby } from "../../types"; // If it's a decimal number, it can be optional separated by any number of // arbitrarily places underscores. This can be useful for dollars and cents // (34_99), dates (2020_11_30), and normal 3 digit separation (1_222_333). -export const printInt: Plugin.Printer = (path, _opts, _print) => { +export const printInt: Plugin.Printer = (path) => { const { body } = path.getValue(); // If the number is a base 10 number, is sufficiently large, and is not diff --git a/src/ruby/nodes/loops.ts b/src/ruby/nodes/loops.ts index da89a8be..7be9f9dc 100644 --- a/src/ruby/nodes/loops.ts +++ b/src/ruby/nodes/loops.ts @@ -16,7 +16,7 @@ function printLoop( Ruby.While | Ruby.WhileModifier | Ruby.Until | Ruby.UntilModifier > { return function printLoopWithOptions(path, { rubyModifier }, print) { - const [_predicate, stmts] = path.getValue().body; + const [, stmts] = path.getValue().body; // If the only statement inside this while loop is a void statement, then we // can shorten to just displaying the predicate and then a semicolon. diff --git a/src/ruby/nodes/methods.ts b/src/ruby/nodes/methods.ts index a51b90fd..ce227f85 100644 --- a/src/ruby/nodes/methods.ts +++ b/src/ruby/nodes/methods.ts @@ -4,51 +4,57 @@ import { isEmptyBodyStmt } from "../../utils"; const { group, hardline, indent, line } = prettier; -function printMethod(offset: number): Plugin.Printer { - return function printMethodWithOffset(path, opts, print) { - const node = path.getValue(); - const declaration: Plugin.Doc[] = ["def "]; - - let params: Ruby.Params | Ruby.Paren; - let bodystmt: Ruby.Bodystmt; - - if (node.type === "def") { - params = node.body[1]; - bodystmt = node.body[2]; - } else { - // In this case, we're printing a method that's defined as a singleton, so - // we need to include the target and the operator - declaration.push( - path.call(print, "body", 0), - path.call(print, "body", 1) - ); - - params = node.body[3]; - bodystmt = node.body[4]; - } +export const printDef: Plugin.Printer = ( + path, + opts, + print +) => { + const node = path.getValue(); + const declaration: Plugin.Doc[] = ["def "]; - // In case there are no parens but there are arguments - const parens = params.type === "params" && params.body.some((type) => type); + let paramsNode: Ruby.Params | Ruby.Paren; + let bodystmtNode: Ruby.Bodystmt; - declaration.push( - path.call(print, "body", offset), - parens ? "(" : "", - path.call(print, "body", offset + 1), - parens ? ")" : "" - ); + let nameDoc: Plugin.Doc; + let paramsDoc: Plugin.Doc; + let bodystmtDoc: Plugin.Doc; - if (isEmptyBodyStmt(bodystmt)) { - return group([...declaration, "; end"]); - } + if (node.type === "def") { + paramsNode = node.body[1]; + bodystmtNode = node.body[2]; + + nameDoc = path.call(print, "body", 0); + paramsDoc = path.call(print, "body", 1); + bodystmtDoc = path.call(print, "body", 2); + } else { + // In this case, we're printing a method that's defined as a singleton, so + // we need to include the target and the operator + declaration.push(path.call(print, "body", 0), path.call(print, "body", 1)); - return group([ - group(declaration), - indent([hardline, path.call(print, "body", offset + 2)]), - hardline, - "end" - ]); - }; -} + paramsNode = node.body[3]; + bodystmtNode = node.body[4]; + + nameDoc = path.call(print, "body", 2); + paramsDoc = path.call(print, "body", 3); + bodystmtDoc = path.call(print, "body", 4); + } + + // In case there are no parens but there are arguments + const parens = + paramsNode.type === "params" && paramsNode.body.some((type) => type); + declaration.push(nameDoc, parens ? "(" : "", paramsDoc, parens ? ")" : ""); + + if (isEmptyBodyStmt(bodystmtNode)) { + return group([...declaration, "; end"]); + } + + return group([ + group(declaration), + indent([hardline, bodystmtDoc]), + hardline, + "end" + ]); +}; export const printSingleLineMethod: Plugin.Printer = ( path, @@ -82,6 +88,3 @@ export const printAccessControl: Plugin.Printer = ( ) => { return path.call(print, "body", 0); }; - -export const printDef = printMethod(0); -export const printDefs = printMethod(2); diff --git a/src/ruby/nodes/operators.ts b/src/ruby/nodes/operators.ts index db1e4925..65eb4da0 100644 --- a/src/ruby/nodes/operators.ts +++ b/src/ruby/nodes/operators.ts @@ -5,7 +5,7 @@ import { noIndent } from "../../utils"; const { group, indent, line, softline } = prettier; export const printBinary: Plugin.Printer = (path, opts, print) => { - const [_leftNode, operator, rightNode] = path.getValue().body; + const [, operator, rightNode] = path.getValue().body; const space = operator === "**" ? "" : " "; if (noIndent.includes(rightNode.type)) { diff --git a/src/ruby/nodes/params.ts b/src/ruby/nodes/params.ts index 2db888b9..3689ed11 100644 --- a/src/ruby/nodes/params.ts +++ b/src/ruby/nodes/params.ts @@ -24,7 +24,7 @@ export const printParams: Plugin.Printer = (path, opts, print) => { (reqPath) => { // For some very strange reason, if you have a comment attached to a // rest_param, it shows up here in the list of required params. - if (reqPath.getValue().type !== "rest_param") { + if ((reqPath.getValue().type as any) !== "rest_param") { parts.push(print(reqPath)); } }, diff --git a/src/ruby/nodes/return.ts b/src/ruby/nodes/return.ts index 84be1ea7..ba99eb14 100644 --- a/src/ruby/nodes/return.ts +++ b/src/ruby/nodes/return.ts @@ -61,7 +61,9 @@ export const printReturn: Plugin.Printer = (path, opts, print) => { // Now that we've established which actual node is the arguments to return, // we grab it out of the path by diving down the steps that we've set up. - const parts = path.call(print, ...steps) as Plugin.Doc | Plugin.Doc[]; + const parts = (path as any).call(print, ...steps) as + | Plugin.Doc + | Plugin.Doc[]; const useBrackets = Array.isArray(parts) && parts.length > 1; // If we got the value straight out of the parens, then `parts` would only diff --git a/src/ruby/nodes/statements.ts b/src/ruby/nodes/statements.ts index f7e61c0f..8e6bda35 100644 --- a/src/ruby/nodes/statements.ts +++ b/src/ruby/nodes/statements.ts @@ -75,20 +75,12 @@ export const printParen: Plugin.Printer = (path, opts, print) => { return group(["(", indent([softline, contentDoc]), softline, ")"]); }; -export const printEndContent: Plugin.Printer = ( - path, - _opts, - _print -) => { +export const printEndContent: Plugin.Printer = (path) => { const { body } = path.getValue(); return [trim, "__END__", literalline, body]; }; -export const printComment: Plugin.Printer = ( - path, - opts, - _print -) => { +export const printComment: Plugin.Printer = (path, opts) => { return opts.printer.printComment(path, opts); }; @@ -100,6 +92,10 @@ export const printProgram: Plugin.Printer = ( return [join(hardline, path.map(print, "body")), hardline]; }; +type StmtsVoidWithComments = Ruby.Stmts & { + body: [{ type: "void_stmt"; comments: Ruby.Comment[] }]; +}; + export const printStmts: Plugin.Printer = (path, opts, print) => { const stmts = path.getValue().body; @@ -111,7 +107,8 @@ export const printStmts: Plugin.Printer = (path, opts, print) => { stmts[0].type === "void_stmt" && stmts[0].comments ) { - const comments = path.map( + const nodePath = path as Plugin.Path; + const comments = nodePath.map( (commentPath) => { commentPath.getValue().printed = true; return opts.printer.printComment(commentPath, opts); diff --git a/src/ruby/nodes/strings.ts b/src/ruby/nodes/strings.ts index 6ff1f361..950991cb 100644 --- a/src/ruby/nodes/strings.ts +++ b/src/ruby/nodes/strings.ts @@ -69,18 +69,14 @@ function getClosingQuote(quote: string) { // Prints a @CHAR node. @CHAR nodes are special character strings that usually // are strings of length 1. If they're any longer than we'll try to apply the // correct quotes. -export const printChar: Plugin.Printer = ( - path, - { rubySingleQuote }, - _print -) => { +export const printChar: Plugin.Printer = (path, opts) => { const { body } = path.getValue(); if (body.length !== 2) { return body; } - const quote = rubySingleQuote ? "'" : '"'; + const quote = opts.rubySingleQuote ? "'" : '"'; return [quote, body.slice(1), quote]; }; @@ -260,15 +256,17 @@ export const printStringLiteral: Plugin.Printer = ( quote = rubySingleQuote && isSingleQuotable(node) ? "'" : '"'; } - const parts = node.body.map((part, index) => { + const parts = path.map((partPath) => { + const part = partPath.getValue(); + + // In this case, the part of the string is an embedded expression if (part.type !== "@tstring_content") { - // In this case, the part of the string is an embedded expression - return path.call(print, "body", index); + return print(partPath); } // In this case, the part of the string is just regular string content return join(literalline, normalizeQuotes(part.body, quote).split("\n")); - }); + }, "body"); return [quote, ...parts, getClosingQuote(quote)]; }; diff --git a/src/ruby/printer.ts b/src/ruby/printer.ts index 99e82e54..4a405b76 100644 --- a/src/ruby/printer.ts +++ b/src/ruby/printer.ts @@ -133,7 +133,7 @@ const printer: Plugin.PrinterConfig = { // This is the generic print function for any comment in the AST. It handles // both regular comments that begin with a # and embdoc comments, which are // surrounded by =begin..=end. - printComment(path, _opts) { + printComment(path) { const comment = (path as any as Plugin.Path).getValue(); if (comment.type === "@comment") { diff --git a/src/types.ts b/src/types.ts index 032a8db9..a42a842b 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,452 +1,5 @@ -import type * as Prettier from "prettier"; - -// This namespace contains everything to do with the Ruby prettier plugin. -export namespace Plugin { - export type Doc = Prettier.doc.builders.Doc; - - export type Embed = Required>["embed"]; - - export type Options = Prettier.ParserOptions & { - printer: Omit & Required>, - rubyArrayLiteral: boolean, - rubyHashLabel: boolean, - rubyModifier: boolean, - rubyNetcatCommand?: string, - rubySingleQuote: boolean, - rubyToProc: boolean - }; - - export type Parser = Omit, "hasPragma" | "parse"> & Required, "hasPragma">> & { - parse: (_text: string, _parsers: { [name: string]: Prettier.Parser }, _options: Options) => any - }; - - // We're overwriting call and map here because if you restrict the AST for the - // main path then presumably you're printing a lower node in the tree that - // won't match the current AST type. - export type Path = Omit, "call" | "each" | "getParentNode" | "map"> & { - call: (_callback: (_path: Path) => U, ..._names: PropertyKey[]) => U, - each: (_callback: (_path: Path, _index: number, _value: any) => void, ..._names: PropertyKey[]) => void, - getParentNode: (_count?: number | undefined) => any | null, - map: (_callback: (_path: Path, _index: number, _value: any) => U, ..._names: PropertyKey[]) => U[] - }; - - export type PrinterConfig = Omit, "print"> & { - getCommentChildNodes?: (_node: any) => any[], - isBlockComment?: (_comment: any, _options: Plugin.Options) => boolean, - print: Printer - }; - - // This is the regular print node, except it's not restricted by the AST that - // is passed to the parent AST. - export type Print = (_path: Path) => Doc; - - // This is the regular printer, except it uses our overridden options and - // print types. - export type Printer = (_path: Path, _options: Options, _print: Print) => Doc; -} - -// This namespace contains everything to do with the types of the various nodes -// within the syntax tree generated from the Ruby parser. -export namespace Ruby { - // These are utility types used to construct the various node types. - type Comments = { comments?: Comment[] }; - type Location = { sl: number, el: number, sc: number, ec: number }; - - type ScannerEvent = { type: `@${T}`, body: string } & Comments & Location; - type ParserEvent0 = { type: T, body: string } & Comments & Location; - type ParserEvent> = { type: T } & Comments & Location & V; - - // This is the main expression type that goes in places where the AST will - // accept just about anything. - // eslint-disable-next-line @typescript-eslint/ban-types - export type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgParen | Args | ArgsAddBlock | ArgsAddStar | ArgsForward | Array | Aryptn | Assign | AssocNew | AssocSplat | AssoclistFromArgs | BEGIN | Backref | Backtick | BareAssocHash | Begin | Binary | BlockVar | Blockarg | Bodystmt | BraceBlock | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | Defsl | DoBlock | Dot2 | Dot3 | DynaSymbol | END | Else | Elsif | EndContent | Ensure | ExcessedComma | Fcall | Field | Float | FndPtn | For | GVar | Hash | Heredoc | HeredocBegin | Hshptn | IVar | Identifier | If | IfModifier | Imaginary | In | Int | Keyword | KeywordRestParam | Label | Lambda | Lbrace | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Op | Opassign | Params | Paren | Period | Program | Qsymbols | Qwords | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueEx | RescueModifier | RestParam | Retry | Return | Return0 | Sclass | Stmts | String | StringConcat | StringDVar | StringEmbExpr | StringLiteral | Super | SymbolLiteral | Symbols | TStringContent | Ternary | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VCall | VarAlias | VarField | VarRef | VoidStmt | When | While | WhileModifier | Word | Words | XStringLiteral | Yield | Yield0 | Zsuper - - // This is a special scanner event that contains a comment. It can be attached - // to almost any kind of node, which is why it's pulled out here separately. - type UndecoratedComment = { type: "@comment", value: string, inline: boolean } & Location; - export type Comment = UndecoratedComment & { leading: boolean, printed: boolean }; - - // These are the scanner events that contain only a single string. They're - // always leaves in the tree. Ignored ones that can't show up in the tree but - // are present in ripper include: - // - // comma, embdoc, embdoc_beg, embdoc_end, embexpr_beg, embexpr_end, embvar, - // heredoc_end, ignored_nl, ignored_sp, label_end, lbracket, lparen, nl, - // qsymbols_beg, qwords_beg, rbrace, rbracket, regexp_beg, regexp_end, rparen, - // semicolon, sp, symbbeg, symbols_beg, tlambda, tlambeg, tstring_beg, - // tstring_nd, words_beg, words_sep - // - export type Backref = ScannerEvent<"backref">; - export type Backtick = ScannerEvent<"backtick">; - export type Char = ScannerEvent<"CHAR">; - export type Const = ScannerEvent<"const">; - export type CVar = ScannerEvent<"cvar">; - export type EndContent = ScannerEvent<"__end__">; - export type Float = ScannerEvent<"float">; - export type GVar = ScannerEvent<"gvar">; - export type HeredocBegin = ScannerEvent<"heredoc_beg">; - export type Identifier = ScannerEvent<"ident">; - export type Imaginary = ScannerEvent<"imaginary">; - export type Int = ScannerEvent<"int">; - export type IVar = ScannerEvent<"ivar">; - export type Keyword = ScannerEvent<"kw">; - export type Label = ScannerEvent<"label">; - export type Lbrace = ScannerEvent<"lbrace">; - export type Op = ScannerEvent<"op">; - export type Period = ScannerEvent<"period">; - export type Rational = ScannerEvent<"rational">; - export type TStringContent = ScannerEvent<"tstring_content">; - - // These are the parser events that don't receive any arguments. (In earlier - // versions of ripper they were scanner events, now they're parser events with - // arity 0.) Ignored ones that can't show up in the tree but are present in - // ripper include: - // - // args_new, mlhs_new, mrhs_new, qsymbols_new, qwords_new, regexp_new, - // stmts_new, string_content, symbols_new, word_new, words_new, xstring_new - // - export type ArgsForward = ParserEvent0<"args_forward">; - export type ExcessedComma = ParserEvent0<"excessed_comma">; - export type Redo = ParserEvent0<"redo">; - export type Retry = ParserEvent0<"retry">; - export type Return0 = ParserEvent0<"return0">; - export type VoidStmt = ParserEvent<"void_stmt">; - export type Yield0 = ParserEvent0<"yield0">; - export type Zsuper = ParserEvent0<"zsuper">; - - // Below are various parser events grouped by their relative functionality. - // The grouping is pretty loose, but it should convey a certain sense of the - // area of Ruby that it's related to. It does not include certain events that - // are present in ripper that we remove from tree before they get to this - // form, including: - // - // heredoc_dedent, magic_comment, nokw_param, symbol - // - - // These are various parser events that have to do with string or string-like - // nodes. - export type StringContent = StringDVar | StringEmbExpr | TStringContent; - export type DynaSymbol = ParserEvent<"dyna_symbol", { body: StringContent[], quote: string }>; - export type Heredoc = ParserEvent<"heredoc", { beging: HeredocBegin, ending: string, body: StringContent[] }>; - export type RegexpLiteral = ParserEvent<"regexp_literal", { body: StringContent[], beging: string, ending: string }>; - export type String = ParserEvent<"string", { body: [TStringContent] }>; - export type StringConcat = ParserEvent<"string_concat", { body: [StringConcat | StringLiteral, StringLiteral] }>; - export type StringDVar = ParserEvent<"string_dvar", { body: [Backref | VarRef] }>; - export type StringEmbExpr = ParserEvent<"string_embexpr", { body: [Stmts] }>; - export type StringLiteral = ParserEvent<"string_literal", { body: StringContent[], quote: string }>; - export type SymbolLiteral = ParserEvent<"symbol_literal", { body: [Backtick | Const | CVar | GVar | Identifier | IVar | Keyword | Op] }>; - export type XStringLiteral = ParserEvent<"xstring_literal", { body: StringContent[] }>; - - // These are various parser events that have to do with arrays. - export type Array = ParserEvent<"array", { body: [null | Args | ArgsAddStar | Qsymbols | Qwords | Symbols | Words] }>; - export type Qsymbols = ParserEvent<"qsymbols", { body: TStringContent[] }>; - export type Qwords = ParserEvent<"qwords", { body: TStringContent[] }>; - export type Symbols = ParserEvent<"symbols", { body: Word[] }>; - export type Word = ParserEvent<"word", { body: StringContent[] }>; - export type Words = ParserEvent<"words", { body: Word[] }>; - - // These are various parser events that have to do with hashes. - type HashContent = AssocNew | AssocSplat; - export type AssocNew = ParserEvent<"assoc_new", { body: [AnyNode, AnyNode] }>; - export type AssocSplat = ParserEvent<"assoc_splat", { body: [AnyNode] }>; - export type AssoclistFromArgs = ParserEvent<"assoclist_from_args", { body: HashContent[] }>; - export type BareAssocHash = ParserEvent<"bare_assoc_hash", { body: HashContent[] }>; - export type Hash = ParserEvent<"hash", { body: [null | AssoclistFromArgs] }>; - - // These are various parser events for assignment. - type Assignable = ArefField | ConstPathField | Field | TopConstField | VarField; - export type ArefField = ParserEvent<"aref_field", { body: [AnyNode, ArgsAddBlock | null] }>; - export type Assign = ParserEvent<"assign", { body: [Assignable, AnyNode] }>; - export type ConstPathField = ParserEvent<"const_path_field", { body: [ConstPathRef | Paren | TopConstRef | VarRef, Const] }>; - export type Field = ParserEvent<"field", { body: [AnyNode, CallOperator, Const | Identifier] }>; - export type Opassign = ParserEvent<"opassign", { body: [Assignable, Op, AnyNode] }>; - export type TopConstField = ParserEvent<"top_const_field", { body: [Const] }>; - export type VarField = ParserEvent<"var_field", { body: [null | Const | CVar | GVar | Identifier | IVar] }>; - - // These are various parser events that have to do with multiple assignment. - export type Massign = ParserEvent<"massign", { body: [Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen, AnyNode] }>; - export type Mlhs = ParserEvent<"mlhs", { body: (ArefField | Field | Identifier | MlhsParen | VarField)[], comma: undefined | true }>; - export type MlhsAddPost = ParserEvent<"mlhs_add_post", { body: [MlhsAddStar, Mlhs] }>; - export type MlhsAddStar = ParserEvent<"mlhs_add_star", { body: [Mlhs, null | ArefField | Field | Identifier | VarField] }>; - export type MlhsParen = ParserEvent<"mlhs_paren", { body: [Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen] }>; - export type Mrhs = ParserEvent<"mrhs", { body: [] }>; - export type MrhsAddStar = ParserEvent<"mrhs_add_star", { body: [Mrhs | MrhsNewFromArgs, AnyNode] }>; - export type MrhsNewFromArgs = ParserEvent<"mrhs_new_from_args", { body: [Args | ArgsAddStar, AnyNode], oper: string }>; - - // These are various parser events for control flow constructs. - export type Case = ParserEvent<"case", { body: [AnyNode, In | When] }>; - export type Else = ParserEvent<"else", { body: [Stmts] }>; - export type Elsif = ParserEvent<"elsif", { body: [AnyNode, Stmts, null | Elsif | Else] }>; - export type Ensure = ParserEvent<"ensure", { body: [Keyword, Stmts] }>; - export type For = ParserEvent<"for", { body: [Mlhs | MlhsAddStar | VarField, AnyNode, Stmts] }>; - export type If = ParserEvent<"if", { body: [AnyNode, Stmts, null | Elsif | Else] }>; - export type IfModifier = ParserEvent<"if_mod", { body: [AnyNode, AnyNode] }>; - export type In = ParserEvent<"in", { body: [AnyNode, Stmts, null | In | Else] }>; - export type Rescue = ParserEvent<"rescue", { body: [null | RescueEx, Stmts, null | Stmts] }>; - export type RescueEx = ParserEvent<"rescue_ex", { body: [AnyNode, null | Field | VarField] }>; - export type RescueModifier = ParserEvent<"rescue_mod", { body: [AnyNode, AnyNode] }>; - export type Ternary = ParserEvent<"ifop", { body: [AnyNode, AnyNode, AnyNode] }>; - export type Unless = ParserEvent<"unless", { body: [AnyNode, Stmts, null | Elsif | Else] }>; - export type UnlessModifier = ParserEvent<"unless_mod", { body: [AnyNode, AnyNode] }>; - export type Until = ParserEvent<"until", { body: [AnyNode, Stmts] }>; - export type UntilModifier = ParserEvent<"until_mod", { body: [AnyNode, AnyNode] }>; - export type When = ParserEvent<"when", { body: [Args | ArgsAddStar, Stmts, null | Else | When] }>; - export type While = ParserEvent<"while", { body: [AnyNode, Stmts] }>; - export type WhileModifier = ParserEvent<"while_mod", { body: [AnyNode, AnyNode] }>; - - // These are various parser events for control flow keywords. - export type Break = ParserEvent<"break", { body: [Args | ArgsAddBlock] }>; - export type Next = ParserEvent<"next", { body: [Args | ArgsAddBlock] }>; - export type Return = ParserEvent<"return", { body: [Args | ArgsAddBlock] }>; - export type Super = ParserEvent<"super", { body: [Args | ArgParen | ArgsAddBlock] }>; - export type Yield = ParserEvent<"yield", { body: [ArgsAddBlock | Paren] }>; - - // These are various parser events for pattern matching. - export type Aryptn = ParserEvent<"aryptn", { body: [null | VarRef, AnyNode[], null | VarField, null | AnyNode[]] }>; - export type FndPtn = ParserEvent<"fndptn", { body: [null | AnyNode, VarField, AnyNode[], VarField] }>; - export type Hshptn = ParserEvent<"hshptn", { body: [null | AnyNode, [Label, AnyNode][], null | VarField] }>; - export type Rassign = ParserEvent<"rassign", { body: [AnyNode, AnyNode], keyword: boolean }>; - - // These are various parser events for method declarations. - type ParenAroundParams = Omit & { body: [Params] }; - export type Blockarg = ParserEvent<"blockarg", { body: [Identifier] }>; - export type Def = ParserEvent<"def", { body: [Backtick | Const | Identifier | Keyword | Op, Params | Paren, Bodystmt] }>; - export type Defs = ParserEvent<"defs", { body: [AnyNode, Op | Period, Const | Op | Identifier | Keyword, Params | Paren, Bodystmt] }>; - export type Defsl = ParserEvent<"defsl", { body: [Identifier, null | ParenAroundParams, AnyNode] }>; - export type KeywordRestParam = ParserEvent<"kwrest_param", { body: [null | Identifier] }>; - export type Lambda = ParserEvent<"lambda", { body: [Params | ParenAroundParams, Bodystmt | Stmts] }>; - export type Params = ParserEvent<"params", { body: [Identifier[], null | [Identifier, AnyNode][], null | ArgsForward | ExcessedComma | RestParam, Identifier[], null | [Label, AnyNode][], null | "nil" | KeywordRestParam, null | Blockarg] }>; - export type RestParam = ParserEvent<"rest_param", { body: [null | Identifier] }>; - - // These are various parser events for method calls. - export type CallOperator = Op | Period | "::"; - export type ArgParen = ParserEvent<"arg_paren", { body: [Args | ArgsAddBlock | ArgsForward | null] }>; - export type Args = ParserEvent<"args", { body: AnyNode[] }>; - export type ArgsAddBlock = ParserEvent<"args_add_block", { body: [Args | ArgsAddStar, false | AnyNode] }>; - export type ArgsAddStar = ParserEvent<"args_add_star", { body: [Args | ArgsAddStar, ...AnyNode[]] }>; - export type BlockVar = ParserEvent<"block_var", { body: [Params, false | Identifier[]] }>; - export type BraceBlock = ParserEvent<"brace_block", { body: [null | BlockVar, Stmts] }>; - export type Call = ParserEvent<"call", { body: [AnyNode, CallOperator, Backtick | Op | Identifier | Const | "call"] }>; - export type Command = ParserEvent<"command", { body: [Const | Identifier, Args | ArgsAddBlock] }>; - export type CommandCall = ParserEvent<"command_call", { body: [AnyNode, CallOperator, Op | Identifier | Const, Args | ArgsAddBlock] }>; - export type DoBlock = ParserEvent<"do_block", { body: [null | BlockVar, Bodystmt] }>; - export type Fcall = ParserEvent<"fcall", { body: [Const | Identifier] }>; - export type MethodAddArg = ParserEvent<"method_add_arg", { body: [Call | Fcall, Args | ArgParen | ArgsAddBlock] }>; - export type MethodAddBlock = ParserEvent<"method_add_block", { body: [AnyNode, BraceBlock | DoBlock] }>; - export type VCall = ParserEvent<"vcall", { body: [Identifier] }>; - - // These are various parser events for statements you would find in a method body. - export type Aref = ParserEvent<"aref", { body: [AnyNode, Args | ArgsAddBlock | null] }>; - export type BEGIN = ParserEvent<"BEGIN", { body: [Lbrace, Stmts] }>; - export type Binary = ParserEvent<"binary", { body: [AnyNode, string, AnyNode] }>; - export type ConstPathRef = ParserEvent<"const_path_ref", { body: [AnyNode, Const] }>; - export type ConstRef = ParserEvent<"const_ref", { body: [Const] }>; - export type Defined = ParserEvent<"defined", { body: [AnyNode] }>; - export type Dot2 = ParserEvent<"dot2", { body: [AnyNode, null] | [null, AnyNode] | [AnyNode, AnyNode] }>; - export type Dot3 = ParserEvent<"dot3", { body: [AnyNode, null] | [null, AnyNode] | [AnyNode, AnyNode] }>; - export type END = ParserEvent<"END", { body: [Lbrace, Stmts] }>; - export type Paren = ParserEvent<"paren", { body: [AnyNode] }>; - export type TopConstRef = ParserEvent<"top_const_ref", { body: [Const] }>; - export type Unary = ParserEvent<"unary", { body: AnyNode, oper: string, paren: boolean | undefined }>; - export type VarRef = ParserEvent<"var_ref", { body: [Const | CVar | GVar | Identifier | IVar | Keyword] }>; - - // These are various parser events for statements you would find in a class definition body. - export type AccessCtrl = ParserEvent<"access_ctrl", { body: [Identifier] }>; - export type Alias = ParserEvent<"alias", { body: [DynaSymbol | SymbolLiteral, DynaSymbol | SymbolLiteral] }>; - export type Class = ParserEvent<"class", { body: [ConstPathRef | ConstRef | TopConstRef, null | AnyNode, Bodystmt] }>; - export type Module = ParserEvent<"module", { body: [ConstPathRef | ConstRef | TopConstRef, Bodystmt] }>; - export type Sclass = ParserEvent<"sclass", { body: [AnyNode, Bodystmt] }>; - export type VarAlias = ParserEvent<"var_alias", { body: [GVar, Backref | GVar] }>; - export type Undef = ParserEvent<"undef", { body: (DynaSymbol | SymbolLiteral)[] }>; - - // These are various parser events for statement containers, generally pretty high in the tree. - export type Begin = ParserEvent<"begin", { body: [Bodystmt] }>; - export type Bodystmt = ParserEvent<"bodystmt", { body: [Stmts, null | Rescue, null | Stmts, null | Ensure] }>; - export type Program = ParserEvent<"program", { body: [Stmts] }>; - export type Stmts = ParserEvent<"stmts", { body: AnyNode[] }>; -} - -export namespace HAML { - export type AnyNode = ( - | Comment - | DocType - | Filter - | HAMLComment - | Plain - | Root - | Script - | SilentScript - | Tag - ); - - export type Comment = { - type: "comment", - value: { revealed: boolean, conditional?: string, text?: string }, - children: AnyNode[] - }; - - export type DocType = { - type: "doctype", - value: { type: string, version?: string, encoding?: string } - }; - - export type Filter = { - type: "filter", - value: { name: string, text: string } - }; - - export type HAMLComment = { - type: "haml_comment", - value: { text?: string }, - line: number - }; - - export type Plain = { - type: "plain", - value: { text: string } - }; - - export type Root = { - type: "root", - children: AnyNode[], - supports_multiline: boolean - }; - - export type Script = { - type: "script", - value: { - escape_html: boolean, - preserve: boolean, - interpolate: boolean, - text: string - }, - children: AnyNode[] - }; - - export type SilentScript = { - type: "silent_script", - value: { text: string, keyword: string }, - children: AnyNode[] - }; - - export type TagAttrs = string | { [property: string]: TagAttrs } - export type Tag = { - type: "tag", - value: { - name: string, - attributes: { class?: string, id?: string } & Record, - dynamic_attributes: { new?: string, old?: TagAttrs }, - object_ref?: string, - nuke_outer_whitespace: boolean, - nuke_inner_whitespace: boolean, - self_closing: boolean, - value?: string, - parse: boolean - }, - children: AnyNode[] - }; -} - -export namespace RBS { - export type MethodParam = { - name?: string - escaped: boolean, - type: Type - }; - - export type MethodParams = { - required_positionals: MethodParam[], - optional_positionals: MethodParam[], - rest_positionals?: MethodParam, - trailing_positionals: MethodParam[] - required_keywords: Record, - optional_keywords: Record, - rest_keywords?: MethodParam - }; - - export type MethodSignature = { - type_params: string[], - type: MethodParams, - block: { required: boolean } & MethodSignature, - return_type: { type: Type } - }; - - export type Type = { location: Location } & ( - | { class: "literal", literal: string } - | { class: "optional", type: Type } - | { class: "tuple", types: Type[] } - | { class: "union", types: Type[] } - | { class: "intersection", types: Type[] } - | { class: "class_singleton", name: string } - | { class: "proc" } & MethodSignature - | { class: "record", fields: Record } - | { class: "class_instance" } & NameAndArgs - | { class: "interface" } & NameAndArgs - | { class: "alias", name: string } - | { class: "variable", name: string } - | { class: "bool" } - | { class: "bot" } - | { class: "class" } - | { class: "instance" } - | { class: "nil" } - | { class: "self" } - | { class: "top" } - | { class: "untyped" } - | { class: "void" } - ); - - export type Literal = Type & { class: "literal" }; - - export type NameAndArgs = { name: string, args: Type[] }; - - export type Location = { - start: { line: number, column: number }, - end: { line: number, column: number }, - start_pos: number, - end_pos: number - }; - - export type Member = { location: Location } & ( - | { member: "alias", new_name: string, old_name: string, kind: "instance" | "singleton" } - | { member: "attr_accessor" | "attr_reader" | "attr_writer", name: string, ivar_name?: string | false, kind: "instance" | "singleton", type: Type } - | { member: "class_variable" | "class_instance_variable" | "instance_variable", name: string, type: Type } - | { member: "include" } - | { member: "extend" } - | { member: "prepend" } - | { member: "public" } - | { member: "private" } - | { member: "method_definition", overload: boolean, name: string, types: MethodSignature[], kind: "instance" | "singleton" | "singleton_instance" } - ); - - export type MethodDefinition = Member & { member: "method_definition" }; - - export type Param = { - name: string, - skip_validation: boolean, - variance: "invariant" | "covariant" | "contravariant" - }; - - export type NameAndTypeParams = { - name: string, - type_params: { params: Param[] } - }; - - type Declaration = { location: Location } & ( - | { declaration: "alias", name: string, type: Type } - | { declaration: "class", super_class?: NameAndArgs, members: Member[] } & NameAndTypeParams - | { declaration: "constant", name: string, type: Type } - | { declaration: "global", name: string, type: Type } - | { declaration: "interface", members: Member[] } & NameAndTypeParams - | { declaration: "module", self_types: NameAndArgs[], members: Member[] } & NameAndTypeParams - ); - - type Root = { declarations: Declaration[], location: Location }; - - export type Annotation = { string: string, location: Location }; - - export type AnyNode = { comment?: { string: string }, annotations?: Annotation[] } & ( - | ({ declaration: undefined, member: undefined } & Root) - | ({ declarations: undefined, member: undefined } & Declaration) - | ({ declaration: undefined, declarations: undefined } & Member) - ); -} +export * as HAML from "./types/haml"; +export * as Plugin from "./types/plugin"; +export * as RBS from "./types/rbs"; +export * as Ruby from "./types/ruby"; +export * from "./types/utils"; diff --git a/src/types/haml.ts b/src/types/haml.ts new file mode 100644 index 00000000..6184c870 --- /dev/null +++ b/src/types/haml.ts @@ -0,0 +1,81 @@ +// This file contains all of the types that represent objects being returned +// from the HAML parser. + +export type AnyNode = ( + | Comment + | DocType + | Filter + | HAMLComment + | Plain + | Root + | Script + | SilentScript + | Tag +); + +export type Comment = { + type: "comment", + value: { revealed: boolean, conditional?: string, text?: string }, + children: AnyNode[] +}; + +export type DocType = { + type: "doctype", + value: { type: string, version?: string, encoding?: string } +}; + +export type Filter = { + type: "filter", + value: { name: string, text: string } +}; + +export type HAMLComment = { + type: "haml_comment", + value: { text?: string }, + line: number +}; + +export type Plain = { + type: "plain", + value: { text: string } +}; + +export type Root = { + type: "root", + children: AnyNode[], + supports_multiline: boolean +}; + +export type Script = { + type: "script", + value: { + escape_html: boolean, + preserve: boolean, + interpolate: boolean, + text: string + }, + children: AnyNode[] +}; + +export type SilentScript = { + type: "silent_script", + value: { text: string, keyword: string }, + children: AnyNode[] +}; + +export type TagAttrs = string | { [property: string]: TagAttrs } +export type Tag = { + type: "tag", + value: { + name: string, + attributes: { class?: string, id?: string } & Record, + dynamic_attributes: { new?: string, old?: TagAttrs }, + object_ref?: string, + nuke_outer_whitespace: boolean, + nuke_inner_whitespace: boolean, + self_closing: boolean, + value?: string, + parse: boolean + }, + children: AnyNode[] +}; diff --git a/src/types/plugin.ts b/src/types/plugin.ts new file mode 100644 index 00000000..1a7e87e5 --- /dev/null +++ b/src/types/plugin.ts @@ -0,0 +1,98 @@ +import type * as Prettier from "prettier"; +import type { ArrayElement, ArrayProperties, IndexProperties, IndexValue, RequiredKeys } from "./utils"; + +type CallProperties = T extends any[] ? IndexProperties : keyof T; +type IterProperties = T extends any[] ? IndexProperties : ArrayProperties; + +type CallCallback = (path: Path, index: number, value: any) => U; +type EachCallback = (path: Path>, index: number, value: any) => void; +type MapCallback = (path: Path>, index: number, value: any) => U; + +// This path interface is going to override a bunch of functions on the regular +// prettier AstPath interface. This is because we want stricter types than the +// current version of @types/prettier provides. +// +// For each of the tree walk functions (call, each, and map) this provides 5 +// strict type signatures, along with a fallback at the end if you end up +// calling more than 5 properties deep (we don't do that but I've included it +// for completeness). +// +// getParentNode is being overridden because previously it was restricted to the +// type T of the given AST, but it's very unlikely you're going to be receiving +// a parent node that exactly matches your current node. So for now just +// returning any. +interface StrictPath { + call(callback: CallCallback): U; + call>(callback: CallCallback, U>, prop1: P1): U; + call>(callback: CallCallback, P2>, U>, prop1: P1, prop2: P2): U; + call, P3 extends CallProperties>>(callback: CallCallback, P2>, P3>, U>, prop1: P1, prop2: P2, prop3: P3): U; + call, P3 extends CallProperties>, P4 extends CallProperties, P3>>>(callback: CallCallback, P2>, P3>, P4>, U>, prop1: P1, prop2: P2, prop3: P3, prop4: P4): U; + call(callback: CallCallback, prop1: P, prop2: P, prop3: P, prop4: P, ...props: P[]): U; + + each(callback: EachCallback): void; + each>(callback: EachCallback>, prop1: P1): void; + each>(callback: EachCallback, P2>>, prop1: P1, prop2: P2): void; + each, P3 extends IterProperties>>(callback: EachCallback, P2>, P3>>, prop1: P1, prop2: P2, prop3: P3): void; + each, P3 extends IterProperties>, P4 extends IterProperties, P3>>>(callback: EachCallback, P2>, P3>, P4>>, prop1: P1, prop2: P2, prop3: P3, prop4: P4): void; + each

(callback: EachCallback, prop1: P, prop2: P, prop3: P, prop4: P, ...props: P[]): void; + + getParentNode: (count?: number | undefined) => any | null, + + map(callback: MapCallback): U[]; + map>(callback: MapCallback, U>, prop1: P1): U[]; + map>(callback: MapCallback, P2>, U>, prop1: P1, prop2: P2): U[]; + map, P3 extends IterProperties>>(callback: MapCallback, P2>, P3>, U>, prop1: P1, prop2: P2, prop3: P3): U[]; + map, P3 extends IterProperties>, P4 extends IterProperties, P3>>>(callback: MapCallback, P2>, P3>, P4>, U>, prop1: P1, prop2: P2, prop3: P3, prop4: P4): U[]; + map(callback: MapCallback, prop1: P, prop2: P, prop3: P, prop4: P, ...props: P[]): U[]; +}; + +// Reexporting the Doc type mostly because it's annoying to have to reference +// type so deeply in the Prettier namespace. Also because we only really want to +// be pulling in types from this file as they're less likely to change. +export type Doc = Prettier.doc.builders.Doc; + +// This is the same embed as is present in prettier, except that it's required. +export type Embed = Required>["embed"]; + +// These are the regular options from prettier except they also include all of +// the options we defined in our plugin configuration. +export type Options = Prettier.ParserOptions & { + printer: RequiredKeys, + rubyArrayLiteral: boolean, + rubyHashLabel: boolean, + rubyModifier: boolean, + rubyNetcatCommand?: string, + rubySingleQuote: boolean, + rubyToProc: boolean +}; + +// hasPragma was not required, but since we're testing it explicitly we're going +// to add that into the parser object as being required. Additionally we're +// going to change the signature of our parse function to accept our options as +// opposed to the generic options that don't contain the options we defined in +// our plugin configuration. +export type Parser = Omit, "hasPragma" | "parse"> & Required, "hasPragma">> & { + parse: (text: string, parsers: { [name: string]: Prettier.Parser }, options: Options) => any +}; + +// We're overwriting a bunch of function here that walk around the tree here +// because if you restrict the AST for the main path then presumably you're +// printing a lower node in the tree that won't match the current AST type. +export type Path = Omit, keyof StrictPath> & StrictPath; + +// The printer from prettier is missing a couple of keys. We should presumably +// upstream this so that it's accurate in all plugins. +export type PrinterConfig = Omit, "print"> & { + getCommentChildNodes?: (node: any) => any[], + isBlockComment?: (comment: any, options: Options) => boolean, + print: Printer +}; + +// This is the regular print node, except it's not restricted by the AST that +// is passed to the parent AST. That's because when you're using it, you are not +// typically printing the same node type again. +export type Print = (path: Path) => Doc; + +// This is the regular printer, except it uses our overridden options and print +// types. +export type Printer = (path: Path, options: Options, print: Print) => Doc; diff --git a/src/types/rbs.ts b/src/types/rbs.ts new file mode 100644 index 00000000..58aa5e0a --- /dev/null +++ b/src/types/rbs.ts @@ -0,0 +1,107 @@ +// This file contains all of the types that represent objects being returned +// from the RBS parser. + +export type MethodParam = { + name?: string + escaped: boolean, + type: Type +}; + +export type MethodParams = { + required_positionals: MethodParam[], + optional_positionals: MethodParam[], + rest_positionals?: MethodParam, + trailing_positionals: MethodParam[] + required_keywords: Record, + optional_keywords: Record, + rest_keywords?: MethodParam +}; + +export type MethodSignature = { + type_params: string[], + type: MethodParams & { return_type: Type }, + block: { required: boolean } & MethodSignature +}; + +export type Type = { location: Location } & ( + | { class: "literal", literal: string } + | { class: "optional", type: Type } + | { class: "tuple", types: Type[] } + | { class: "union", types: Type[] } + | { class: "intersection", types: Type[] } + | { class: "class_singleton", name: string } + | { class: "proc" } & MethodSignature + | { class: "record", fields: Record } + | { class: "class_instance" } & NameAndArgs + | { class: "interface" } & NameAndArgs + | { class: "alias", name: string } + | { class: "variable", name: string } + | { class: "bool" } + | { class: "bot" } + | { class: "class" } + | { class: "instance" } + | { class: "nil" } + | { class: "self" } + | { class: "top" } + | { class: "untyped" } + | { class: "void" } +); + +export type Literal = Type & { class: "literal" }; + +export type NameAndArgs = { name: string, args: Type[] }; + +export type Location = { + start: { line: number, column: number }, + end: { line: number, column: number }, + start_pos: number, + end_pos: number +}; + +export type Member = { location: Location } & ( + | { member: "alias", new_name: string, old_name: string, kind: "instance" | "singleton" } + | { member: "attr_accessor" | "attr_reader" | "attr_writer", name: string, ivar_name?: string | false, kind: "instance" | "singleton", type: Type } + | { member: "class_variable" | "class_instance_variable" | "instance_variable", name: string, type: Type } + | { member: "include" } & NameAndArgs + | { member: "extend" } & NameAndArgs + | { member: "prepend" } & NameAndArgs + | { member: "public" } + | { member: "private" } + | { member: "method_definition", overload: boolean, name: string, types: MethodSignature[], kind: "instance" | "singleton" | "singleton_instance" } +); + +export type MethodDefinition = Member & { member: "method_definition" }; + +export type Param = { + name: string, + skip_validation: boolean, + variance: "invariant" | "covariant" | "contravariant" +}; + +export type NameAndTypeParams = { + name: string, + type_params: { params: Param[] } +}; + +export type Class = { declaration: "class", super_class?: NameAndArgs, members: Member[] } & NameAndTypeParams; +export type Interface = { declaration: "interface", members: Member[] } & NameAndTypeParams; +export type Module = { declaration: "module", self_types: NameAndArgs[], members: Member[] } & NameAndTypeParams; + +type Declaration = { location: Location } & ( + | { declaration: "alias", name: string, type: Type } + | Class + | { declaration: "constant", name: string, type: Type } + | { declaration: "global", name: string, type: Type } + | Interface + | Module +); + +type Root = { declarations: Declaration[], location: Location }; + +export type Annotation = { string: string, location: Location }; + +export type AnyNode = { comment?: { string: string }, annotations?: Annotation[] } & ( + | ({ declaration: undefined, member: undefined } & Root) + | ({ declarations: undefined, member: undefined } & Declaration) + | ({ declaration: undefined, declarations: undefined } & Member) +); diff --git a/src/types/ruby.ts b/src/types/ruby.ts new file mode 100644 index 00000000..0538afee --- /dev/null +++ b/src/types/ruby.ts @@ -0,0 +1,224 @@ +// This file contains all of the types that represent objects being returned +// from our ripper-based parser. + +// These are common additions to the various node types. +type Comments = { comments?: Comment[] }; +type Location = { sl: number, el: number, sc: number, ec: number }; + +// These are utility types used to construct the various node types. +type ScannerEvent = { type: `@${T}`, body: string } & Comments & Location; +type ParserEvent0 = { type: T, body: string } & Comments & Location; +type ParserEvent> = { type: T } & Comments & Location & V; + +// This is the main expression type that goes in places where the AST will +// accept just about anything. +// eslint-disable-next-line @typescript-eslint/ban-types +export type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgParen | Args | ArgsAddBlock | ArgsAddStar | ArgsForward | Array | Aryptn | Assign | AssocNew | AssocSplat | AssoclistFromArgs | BEGIN | Backref | Backtick | BareAssocHash | Begin | Binary | BlockVar | Blockarg | Bodystmt | BraceBlock | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | Defsl | DoBlock | Dot2 | Dot3 | DynaSymbol | END | Else | Elsif | EndContent | Ensure | ExcessedComma | Fcall | Field | Float | FndPtn | For | GVar | Hash | Heredoc | HeredocBegin | Hshptn | IVar | Identifier | If | IfModifier | Imaginary | In | Int | Keyword | KeywordRestParam | Label | Lambda | Lbrace | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Op | Opassign | Params | Paren | Period | Program | Qsymbols | Qwords | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueEx | RescueModifier | RestParam | Retry | Return | Return0 | Sclass | Stmts | String | StringConcat | StringDVar | StringEmbExpr | StringLiteral | Super | SymbolLiteral | Symbols | TStringContent | Ternary | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VCall | VarAlias | VarField | VarRef | VoidStmt | When | While | WhileModifier | Word | Words | XStringLiteral | Yield | Yield0 | Zsuper + +// This is a special scanner event that contains a comment. It can be attached +// to almost any kind of node, which is why it's pulled out here separately. +type UndecoratedComment = { type: "@comment", value: string, inline: boolean } & Location; + +// Prettier will attach various metadata to comment nodes, which we're adding in +// to the type here. +type CommentDecorations = { leading: boolean, printed: boolean }; +export type Comment = UndecoratedComment & CommentDecorations; + +// These are the scanner events that contain only a single string. They're +// always leaves in the tree. Ignored ones that can't show up in the tree but +// are present in ripper include: +// +// comma, embdoc, embdoc_beg, embdoc_end, embexpr_beg, embexpr_end, embvar, +// heredoc_end, ignored_nl, ignored_sp, label_end, lbracket, lparen, nl, +// qsymbols_beg, qwords_beg, rbrace, rbracket, regexp_beg, regexp_end, rparen, +// semicolon, sp, symbbeg, symbols_beg, tlambda, tlambeg, tstring_beg, +// tstring_nd, words_beg, words_sep +// +export type Backref = ScannerEvent<"backref">; +export type Backtick = ScannerEvent<"backtick">; +export type Char = ScannerEvent<"CHAR">; +export type Const = ScannerEvent<"const">; +export type CVar = ScannerEvent<"cvar">; +export type EndContent = ScannerEvent<"__end__">; +export type Float = ScannerEvent<"float">; +export type GVar = ScannerEvent<"gvar">; +export type HeredocBegin = ScannerEvent<"heredoc_beg">; +export type Identifier = ScannerEvent<"ident">; +export type Imaginary = ScannerEvent<"imaginary">; +export type Int = ScannerEvent<"int">; +export type IVar = ScannerEvent<"ivar">; +export type Keyword = ScannerEvent<"kw">; +export type Label = ScannerEvent<"label">; +export type Lbrace = ScannerEvent<"lbrace">; +export type Op = ScannerEvent<"op">; +export type Period = ScannerEvent<"period">; +export type Rational = ScannerEvent<"rational">; +export type TStringContent = ScannerEvent<"tstring_content">; + +// These are the parser events that don't receive any arguments. (In earlier +// versions of ripper they were scanner events, now they're parser events with +// arity 0.) Ignored ones that can't show up in the tree but are present in +// ripper include: +// +// args_new, mlhs_new, mrhs_new, qsymbols_new, qwords_new, regexp_new, +// stmts_new, string_content, symbols_new, word_new, words_new, xstring_new +// +export type ArgsForward = ParserEvent0<"args_forward">; +export type ExcessedComma = ParserEvent0<"excessed_comma">; +export type Redo = ParserEvent0<"redo">; +export type Retry = ParserEvent0<"retry">; +export type Return0 = ParserEvent0<"return0">; +export type VoidStmt = ParserEvent<"void_stmt">; +export type Yield0 = ParserEvent0<"yield0">; +export type Zsuper = ParserEvent0<"zsuper">; + +// Below are various parser events grouped by their relative functionality. +// The grouping is pretty loose, but it should convey a certain sense of the +// area of Ruby that it's related to. It does not include certain events that +// are present in ripper that we remove from tree before they get to this +// form, including: +// +// heredoc_dedent, magic_comment, nokw_param, symbol +// + +// These are various parser events that have to do with string or string-like +// nodes. +export type StringContent = StringDVar | StringEmbExpr | TStringContent; +export type DynaSymbol = ParserEvent<"dyna_symbol", { body: StringContent[], quote: string }>; +export type Heredoc = ParserEvent<"heredoc", { beging: HeredocBegin, ending: string, body: StringContent[] }>; +export type RegexpLiteral = ParserEvent<"regexp_literal", { body: StringContent[], beging: string, ending: string }>; +export type String = ParserEvent<"string", { body: [TStringContent] }>; +export type StringConcat = ParserEvent<"string_concat", { body: [StringConcat | StringLiteral, StringLiteral] }>; +export type StringDVar = ParserEvent<"string_dvar", { body: [Backref | VarRef] }>; +export type StringEmbExpr = ParserEvent<"string_embexpr", { body: [Stmts] }>; +export type StringLiteral = ParserEvent<"string_literal", { body: StringContent[], quote: string }>; +export type SymbolLiteral = ParserEvent<"symbol_literal", { body: [Backtick | Const | CVar | GVar | Identifier | IVar | Keyword | Op] }>; +export type XStringLiteral = ParserEvent<"xstring_literal", { body: StringContent[] }>; + +// These are various parser events that have to do with arrays. +export type Array = ParserEvent<"array", { body: [null | Args | ArgsAddStar | Qsymbols | Qwords | Symbols | Words] }>; +export type Qsymbols = ParserEvent<"qsymbols", { body: TStringContent[] }>; +export type Qwords = ParserEvent<"qwords", { body: TStringContent[] }>; +export type Symbols = ParserEvent<"symbols", { body: Word[] }>; +export type Word = ParserEvent<"word", { body: StringContent[] }>; +export type Words = ParserEvent<"words", { body: Word[] }>; + +// These are various parser events that have to do with hashes. +type HashContent = AssocNew | AssocSplat; +export type AssocNew = ParserEvent<"assoc_new", { body: [AnyNode, AnyNode] }>; +export type AssocSplat = ParserEvent<"assoc_splat", { body: [AnyNode] }>; +export type AssoclistFromArgs = ParserEvent<"assoclist_from_args", { body: HashContent[] }>; +export type BareAssocHash = ParserEvent<"bare_assoc_hash", { body: HashContent[] }>; +export type Hash = ParserEvent<"hash", { body: [null | AssoclistFromArgs] }>; + +// These are various parser events for assignment. +type Assignable = ArefField | ConstPathField | Field | TopConstField | VarField; +export type ArefField = ParserEvent<"aref_field", { body: [AnyNode, ArgsAddBlock | null] }>; +export type Assign = ParserEvent<"assign", { body: [Assignable, AnyNode] }>; +export type ConstPathField = ParserEvent<"const_path_field", { body: [ConstPathRef | Paren | TopConstRef | VarRef, Const] }>; +export type Field = ParserEvent<"field", { body: [AnyNode, CallOperator, Const | Identifier] }>; +export type Opassign = ParserEvent<"opassign", { body: [Assignable, Op, AnyNode] }>; +export type TopConstField = ParserEvent<"top_const_field", { body: [Const] }>; +export type VarField = ParserEvent<"var_field", { body: [null | Const | CVar | GVar | Identifier | IVar] }>; + +// These are various parser events that have to do with multiple assignment. +export type Massign = ParserEvent<"massign", { body: [Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen, AnyNode] }>; +export type Mlhs = ParserEvent<"mlhs", { body: (ArefField | Field | Identifier | MlhsParen | VarField)[], comma: undefined | true }>; +export type MlhsAddPost = ParserEvent<"mlhs_add_post", { body: [MlhsAddStar, Mlhs] }>; +export type MlhsAddStar = ParserEvent<"mlhs_add_star", { body: [Mlhs, null | ArefField | Field | Identifier | VarField] }>; +export type MlhsParen = ParserEvent<"mlhs_paren", { body: [Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen] }>; +export type Mrhs = ParserEvent<"mrhs", { body: [] }>; +export type MrhsAddStar = ParserEvent<"mrhs_add_star", { body: [Mrhs | MrhsNewFromArgs, AnyNode] }>; +export type MrhsNewFromArgs = ParserEvent<"mrhs_new_from_args", { body: [Args | ArgsAddStar, AnyNode], oper: string }>; + +// These are various parser events for control flow constructs. +export type Case = ParserEvent<"case", { body: [AnyNode, In | When] }>; +export type Else = ParserEvent<"else", { body: [Stmts] }>; +export type Elsif = ParserEvent<"elsif", { body: [AnyNode, Stmts, null | Elsif | Else] }>; +export type Ensure = ParserEvent<"ensure", { body: [Keyword, Stmts] }>; +export type For = ParserEvent<"for", { body: [Mlhs | MlhsAddStar | VarField, AnyNode, Stmts] }>; +export type If = ParserEvent<"if", { body: [AnyNode, Stmts, null | Elsif | Else] }>; +export type IfModifier = ParserEvent<"if_mod", { body: [AnyNode, AnyNode] }>; +export type In = ParserEvent<"in", { body: [AnyNode, Stmts, null | In | Else] }>; +export type Rescue = ParserEvent<"rescue", { body: [null | RescueEx, Stmts, null | Stmts] }>; +export type RescueEx = ParserEvent<"rescue_ex", { body: [AnyNode, null | Field | VarField] }>; +export type RescueModifier = ParserEvent<"rescue_mod", { body: [AnyNode, AnyNode] }>; +export type Ternary = ParserEvent<"ifop", { body: [AnyNode, AnyNode, AnyNode] }>; +export type Unless = ParserEvent<"unless", { body: [AnyNode, Stmts, null | Elsif | Else] }>; +export type UnlessModifier = ParserEvent<"unless_mod", { body: [AnyNode, AnyNode] }>; +export type Until = ParserEvent<"until", { body: [AnyNode, Stmts] }>; +export type UntilModifier = ParserEvent<"until_mod", { body: [AnyNode, AnyNode] }>; +export type When = ParserEvent<"when", { body: [Args | ArgsAddStar, Stmts, null | Else | When] }>; +export type While = ParserEvent<"while", { body: [AnyNode, Stmts] }>; +export type WhileModifier = ParserEvent<"while_mod", { body: [AnyNode, AnyNode] }>; + +// These are various parser events for control flow keywords. +export type Break = ParserEvent<"break", { body: [Args | ArgsAddBlock] }>; +export type Next = ParserEvent<"next", { body: [Args | ArgsAddBlock] }>; +export type Return = ParserEvent<"return", { body: [Args | ArgsAddBlock] }>; +export type Super = ParserEvent<"super", { body: [Args | ArgParen | ArgsAddBlock] }>; +export type Yield = ParserEvent<"yield", { body: [ArgsAddBlock | Paren] }>; + +// These are various parser events for pattern matching. +export type Aryptn = ParserEvent<"aryptn", { body: [null | VarRef, AnyNode[], null | VarField, null | AnyNode[]] }>; +export type FndPtn = ParserEvent<"fndptn", { body: [null | AnyNode, VarField, AnyNode[], VarField] }>; +export type Hshptn = ParserEvent<"hshptn", { body: [null | AnyNode, [Label, AnyNode][], null | VarField] }>; +export type Rassign = ParserEvent<"rassign", { body: [AnyNode, AnyNode], keyword: boolean }>; + +// These are various parser events for method declarations. +type ParenAroundParams = Omit & { body: [Params] }; +export type Blockarg = ParserEvent<"blockarg", { body: [Identifier] }>; +export type Def = ParserEvent<"def", { body: [Backtick | Const | Identifier | Keyword | Op, Params | Paren, Bodystmt] }>; +export type Defs = ParserEvent<"defs", { body: [AnyNode, Op | Period, Const | Op | Identifier | Keyword, Params | Paren, Bodystmt] }>; +export type Defsl = ParserEvent<"defsl", { body: [Identifier, null | ParenAroundParams, AnyNode] }>; +export type KeywordRestParam = ParserEvent<"kwrest_param", { body: [null | Identifier] }>; +export type Lambda = ParserEvent<"lambda", { body: [Params | ParenAroundParams, Bodystmt | Stmts] }>; +export type Params = ParserEvent<"params", { body: [Identifier[], null | [Identifier, AnyNode][], null | ArgsForward | ExcessedComma | RestParam, Identifier[], null | [Label, AnyNode][], null | "nil" | KeywordRestParam, null | Blockarg] }>; +export type RestParam = ParserEvent<"rest_param", { body: [null | Identifier] }>; + +// These are various parser events for method calls. +export type CallOperator = Op | Period | "::"; +export type ArgParen = ParserEvent<"arg_paren", { body: [Args | ArgsAddBlock | ArgsForward | null] }>; +export type Args = ParserEvent<"args", { body: AnyNode[] }>; +export type ArgsAddBlock = ParserEvent<"args_add_block", { body: [Args | ArgsAddStar, false | AnyNode] }>; +export type ArgsAddStar = ParserEvent<"args_add_star", { body: [Args | ArgsAddStar, ...AnyNode[]] }>; +export type BlockVar = ParserEvent<"block_var", { body: [Params, false | Identifier[]] }>; +export type BraceBlock = ParserEvent<"brace_block", { body: [null | BlockVar, Stmts] }>; +export type Call = ParserEvent<"call", { body: [AnyNode, CallOperator, Backtick | Op | Identifier | Const | "call"] }>; +export type Command = ParserEvent<"command", { body: [Const | Identifier, Args | ArgsAddBlock] }>; +export type CommandCall = ParserEvent<"command_call", { body: [AnyNode, CallOperator, Op | Identifier | Const, Args | ArgsAddBlock] }>; +export type DoBlock = ParserEvent<"do_block", { body: [null | BlockVar, Bodystmt] }>; +export type Fcall = ParserEvent<"fcall", { body: [Const | Identifier] }>; +export type MethodAddArg = ParserEvent<"method_add_arg", { body: [Call | Fcall, Args | ArgParen | ArgsAddBlock] }>; +export type MethodAddBlock = ParserEvent<"method_add_block", { body: [AnyNode, BraceBlock | DoBlock] }>; +export type VCall = ParserEvent<"vcall", { body: [Identifier] }>; + +// These are various parser events for statements you would find in a method body. +export type Aref = ParserEvent<"aref", { body: [AnyNode, Args | ArgsAddBlock | null] }>; +export type BEGIN = ParserEvent<"BEGIN", { body: [Lbrace, Stmts] }>; +export type Binary = ParserEvent<"binary", { body: [AnyNode, string, AnyNode] }>; +export type ConstPathRef = ParserEvent<"const_path_ref", { body: [AnyNode, Const] }>; +export type ConstRef = ParserEvent<"const_ref", { body: [Const] }>; +export type Defined = ParserEvent<"defined", { body: [AnyNode] }>; +export type Dot2 = ParserEvent<"dot2", { body: [AnyNode, null] | [null, AnyNode] | [AnyNode, AnyNode] }>; +export type Dot3 = ParserEvent<"dot3", { body: [AnyNode, null] | [null, AnyNode] | [AnyNode, AnyNode] }>; +export type END = ParserEvent<"END", { body: [Lbrace, Stmts] }>; +export type Paren = ParserEvent<"paren", { body: [AnyNode] }>; +export type TopConstRef = ParserEvent<"top_const_ref", { body: [Const] }>; +export type Unary = ParserEvent<"unary", { body: [AnyNode], oper: string, paren: boolean | undefined }>; +export type VarRef = ParserEvent<"var_ref", { body: [Const | CVar | GVar | Identifier | IVar | Keyword] }>; + +// These are various parser events for statements you would find in a class definition body. +export type AccessCtrl = ParserEvent<"access_ctrl", { body: [Identifier] }>; +export type Alias = ParserEvent<"alias", { body: [DynaSymbol | SymbolLiteral, DynaSymbol | SymbolLiteral] }>; +export type Class = ParserEvent<"class", { body: [ConstPathRef | ConstRef | TopConstRef, null | AnyNode, Bodystmt] }>; +export type Module = ParserEvent<"module", { body: [ConstPathRef | ConstRef | TopConstRef, Bodystmt] }>; +export type Sclass = ParserEvent<"sclass", { body: [AnyNode, Bodystmt] }>; +export type VarAlias = ParserEvent<"var_alias", { body: [GVar, Backref | GVar] }>; +export type Undef = ParserEvent<"undef", { body: (DynaSymbol | SymbolLiteral)[] }>; + +// These are various parser events for statement containers, generally pretty high in the tree. +export type Begin = ParserEvent<"begin", { body: [Bodystmt] }>; +export type Bodystmt = ParserEvent<"bodystmt", { body: [Stmts, null | Rescue, null | Stmts, null | Ensure] }>; +export type Program = ParserEvent<"program", { body: [Stmts] }>; +export type Stmts = ParserEvent<"stmts", { body: AnyNode[] }>; diff --git a/src/types/utils.ts b/src/types/utils.ts new file mode 100644 index 00000000..cdd68a5e --- /dev/null +++ b/src/types/utils.ts @@ -0,0 +1,24 @@ +// The type of elements that make up the given array T. +export type ArrayElement = T extends (infer E)[] ? E : never; + +// A union of the properties of the given object that are arrays. +export type ArrayProperties = { [K in keyof T]: T[K] extends any[] ? K : never }[keyof T]; + +// A union of the properties of the given array T that can be used to index it. +// If the array is a tuple, then that's going to be the explicit indices of the +// array, otherwise it's going to just be number. +export type IndexProperties = IsTuple extends true ? Exclude["length"], T["length"]> : number; + +// Effectively performing T[P], except that it's telling TypeScript that it's +// safe to do this for tuples, arrays, or objects. +export type IndexValue = T extends any[] ? P extends number ? T[P] : never : P extends keyof T ? T[P] : never; + +// Determines if an object T is an array like string[] (in which case this +// evaluates to false) or a tuple like [string] (in which case this evaluates to +// true). +// eslint-disable-next-line @typescript-eslint/no-unused-vars +type IsTuple = T extends [] ? true : T extends [infer First, ...infer Remain] ? IsTuple : false; + +// The same object T as currently exists, except the keys provided by P are +// required instead of optional. +export type RequiredKeys = T & Required>; diff --git a/src/utils/printEmptyCollection.ts b/src/utils/printEmptyCollection.ts index df2477bb..2c13fb78 100644 --- a/src/utils/printEmptyCollection.ts +++ b/src/utils/printEmptyCollection.ts @@ -1,12 +1,10 @@ -import type { Plugin, Ruby } from "../types"; +import type { Plugin, Ruby, RequiredKeys } from "../types"; import prettier from "../prettier"; const { group, hardline, indent, join, line } = prettier; -function containedWithin( - node: Ruby.Array | Ruby.Hash -): (_comment: Ruby.Comment) => boolean { - return function containedWithinNode(comment) { +function containedWithin(node: Ruby.Array | Ruby.Hash) { + return function containedWithinNode(comment: Ruby.Comment) { return comment.sc >= node.sc && comment.ec <= node.ec; }; } @@ -33,18 +31,17 @@ function printEmptyCollection( } const comments: Plugin.Doc[] = []; + const nodePath = path as Plugin.Path>; // For each comment, go through its path and print it out manually. - const printComment = (commentPath: Plugin.Path) => { + nodePath.each((commentPath) => { const comment = commentPath.getValue(); if (containedWithinNode(comment)) { comment.printed = true; comments.push(opts.printer.printComment(commentPath, opts)); } - }; - - path.each(printComment, "comments"); + }, "comments"); return group([ startToken, diff --git a/test/js/setupTests.ts b/test/js/setupTests.ts index ee2db847..bb5b8a87 100644 --- a/test/js/setupTests.ts +++ b/test/js/setupTests.ts @@ -94,15 +94,16 @@ expect.extend({ }); declare global { + // eslint-disable-next-line @typescript-eslint/no-namespace namespace jest { - // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-unused-vars interface Matchers { toChangeFormat( - _after: Code, - _config?: Partial + after: Code, + config?: Partial ): Promise; toMatchFormat( - _config?: Partial + config?: Partial ): Promise; } } From 9c6558381929789f6e8cad4a0f0fda5bc120b49b Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 23 Sep 2021 16:46:11 -0400 Subject: [PATCH 256/785] Fix for #958 --- CHANGELOG.md | 4 ++++ src/ruby/parser.rb | 13 ++++++++++--- test/js/ruby/nodes/blocks.test.ts | 22 ++++++++++++++++++++++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c6dc763..38a0a22f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Changed + +- [#958](https://github.com/prettier/plugin-ruby/issues/958) - mharris-figma, kddnewton - Handle optional `do` keyword in `for` loop expressions. + ## [1.6.1] - 2021-06-30 ### Changed diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 56f6c55d..9d4140be 100755 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -1273,15 +1273,22 @@ def on_fndptn(const, presplat, args, postsplat) # loop. It accepts as arguments an ident which is the iterating variable, # an enumerable for that which is being enumerated, and a stmts event that # represents the statements inside the for loop. - def on_for(ident, enumerable, stmts) + def on_for(ident, enum, stmts) beging = find_scanner_event(:@kw, 'for') ending = find_scanner_event(:@kw, 'end') - stmts.bind(enumerable[:ec], ending[:sc]) + # Consume the do keyword if it exists so that it doesn't get confused for + # some other block + do_event = find_scanner_event(:@kw, 'do', consume: false) + if do_event && do_event[:sc] > enum[:ec] && do_event[:ec] < ending[:sc] + scanner_events.delete(do_event) + end + + stmts.bind((do_event || enum)[:ec], ending[:sc]) { type: :for, - body: [ident, enumerable, stmts], + body: [ident, enum, stmts], sl: beging[:sl], sc: beging[:sc], el: ending[:el], diff --git a/test/js/ruby/nodes/blocks.test.ts b/test/js/ruby/nodes/blocks.test.ts index 45df0af1..d22e5355 100644 --- a/test/js/ruby/nodes/blocks.test.ts +++ b/test/js/ruby/nodes/blocks.test.ts @@ -82,6 +82,28 @@ describe("blocks", () => { return expect(content).toMatchFormat(); }); + + test("optional do keyword", () => { + const content = ruby(` + a do + # comment + for b in c do + puts b + end + end + `); + + const expected = ruby(` + a do + # comment + for b in c + puts b + end + end + `); + + return expect(content).toChangeFormat(expected); + }); }); // from ruby test/ruby/test_call.rb From f2dadfd4bce5af3f0f4f692b37870f2c7dbab97b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Sep 2021 12:01:49 +0000 Subject: [PATCH 257/785] Bump jest from 27.2.1 to 27.2.2 Bumps [jest](https://github.com/facebook/jest) from 27.2.1 to 27.2.2. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v27.2.1...v27.2.2) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 496 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 258 insertions(+), 238 deletions(-) diff --git a/yarn.lock b/yarn.lock index 78fd833b..dcc4383c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -366,27 +366,27 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^27.2.0": - version "27.2.0" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.2.0.tgz#57f702837ec52899be58c3794dce5941c77a8b63" - integrity sha512-35z+RqsK2CCgNxn+lWyK8X4KkaDtfL4BggT7oeZ0JffIiAiEYFYPo5B67V50ZubqDS1ehBrdCR2jduFnIrZOYw== +"@jest/console@^27.2.2": + version "27.2.2" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.2.2.tgz#a977245155c519ac2ef713ec0e722d13eda893c9" + integrity sha512-m7tbzPWyvSFfoanTknJoDnaeruDARsUe555tkVjG/qeaRDKwyPqqbgs4yFx583gmoETiAts1deeYozR5sVRhNA== dependencies: "@jest/types" "^27.1.1" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^27.2.0" + jest-message-util "^27.2.2" jest-util "^27.2.0" slash "^3.0.0" -"@jest/core@^27.2.1": - version "27.2.1" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.2.1.tgz#93dc50e2aaba2c944e5765cf658dcd98d804c970" - integrity sha512-XcGt9UgPyzylThvezwUIMCNVp8xxN78Ic3WwhJZehZt4n2hPHR6Bd85A1nKFZBeqW58Vd+Cx/LaN6YL4n58KlA== +"@jest/core@^27.2.2": + version "27.2.2" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.2.2.tgz#9eea16101b2f04bf799dcdbdf1792d4ef7553ecf" + integrity sha512-4b9km/h9pAGdCkwWYtbfoeiOtajOlGmr5rL1Eq6JCAVbOevOqxWHxJ6daWxRJW9eF6keXJoJ1H+uVAVcdZu8Bg== dependencies: - "@jest/console" "^27.2.0" - "@jest/reporters" "^27.2.1" - "@jest/test-result" "^27.2.0" - "@jest/transform" "^27.2.1" + "@jest/console" "^27.2.2" + "@jest/reporters" "^27.2.2" + "@jest/test-result" "^27.2.2" + "@jest/transform" "^27.2.2" "@jest/types" "^27.1.1" "@types/node" "*" ansi-escapes "^4.2.1" @@ -395,64 +395,64 @@ exit "^0.1.2" graceful-fs "^4.2.4" jest-changed-files "^27.1.1" - jest-config "^27.2.1" - jest-haste-map "^27.2.0" - jest-message-util "^27.2.0" + jest-config "^27.2.2" + jest-haste-map "^27.2.2" + jest-message-util "^27.2.2" jest-regex-util "^27.0.6" - jest-resolve "^27.2.0" - jest-resolve-dependencies "^27.2.1" - jest-runner "^27.2.1" - jest-runtime "^27.2.1" - jest-snapshot "^27.2.1" + jest-resolve "^27.2.2" + jest-resolve-dependencies "^27.2.2" + jest-runner "^27.2.2" + jest-runtime "^27.2.2" + jest-snapshot "^27.2.2" jest-util "^27.2.0" - jest-validate "^27.2.0" - jest-watcher "^27.2.0" + jest-validate "^27.2.2" + jest-watcher "^27.2.2" micromatch "^4.0.4" p-each-series "^2.1.0" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.2.0": - version "27.2.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.2.0.tgz#48d1dbfa65f8e4a5a5c6cbeb9c59d1a5c2776f6b" - integrity sha512-iPWmQI0wRIYSZX3wKu4FXHK4eIqkfq6n1DCDJS+v3uby7SOXrHvX4eiTBuEdSvtDRMTIH2kjrSkjHf/F9JIYyQ== +"@jest/environment@^27.2.2": + version "27.2.2" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.2.2.tgz#2e57b9d2cc01028b0e35fae5833c1c63df4c5e41" + integrity sha512-gO9gVnZfn5ldeOJ5q+35Kru9QWGHEqZCB7W/M+8mD6uCwOGC9HR6mzpLSNRuDsxY/KhaGBYHpgFqtpe4Rl1gDQ== dependencies: - "@jest/fake-timers" "^27.2.0" + "@jest/fake-timers" "^27.2.2" "@jest/types" "^27.1.1" "@types/node" "*" jest-mock "^27.1.1" -"@jest/fake-timers@^27.2.0": - version "27.2.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.2.0.tgz#560841bc21ae7fbeff0cbff8de8f5cf43ad3561d" - integrity sha512-gSu3YHvQOoVaTWYGgHFB7IYFtcF2HBzX4l7s47VcjvkUgL4/FBnE20x7TNLa3W6ABERtGd5gStSwsA8bcn+c4w== +"@jest/fake-timers@^27.2.2": + version "27.2.2" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.2.2.tgz#43e6f191c95ae74e95d0ddba2ecb8470b4a288b7" + integrity sha512-gDIIqs0yxyjyxEI9HlJ8SEJ4uCc8qr8BupG1Hcx7tvyk/SLocyXE63rFxL+HQ0ZLMvSyEcJUmYnvvHH1osWiGA== dependencies: "@jest/types" "^27.1.1" "@sinonjs/fake-timers" "^7.0.2" "@types/node" "*" - jest-message-util "^27.2.0" + jest-message-util "^27.2.2" jest-mock "^27.1.1" jest-util "^27.2.0" -"@jest/globals@^27.2.1": - version "27.2.1" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.2.1.tgz#6842c70b6713fbe2fcaf89eac20d77eeeb0e282c" - integrity sha512-4P46Zr4cckSitsWtOMRvgMMn7mOKbBsQdYxHeGSIG3kpI4gNR2vk51balPulZHnBQCQb/XBptprtoSv1REfaew== +"@jest/globals@^27.2.2": + version "27.2.2" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.2.2.tgz#df66aaafda5c69b2bb0dae548e3cfb345f549c31" + integrity sha512-fWa/Luwod1hyehnuep+zCnOTqTVvyc4HLUU/1VpFNOEu0tCWNSODyvKSSOjtb1bGOpCNjgaDcyjzo5f7rl6a7g== dependencies: - "@jest/environment" "^27.2.0" + "@jest/environment" "^27.2.2" "@jest/types" "^27.1.1" - expect "^27.2.1" + expect "^27.2.2" -"@jest/reporters@^27.2.1": - version "27.2.1" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.2.1.tgz#2e43361b962e26975d40eafd7b4f14c70b4fe9a0" - integrity sha512-ILqR+bIIBlhaHjDtQR/0Z20YkKAQVM+NVRuJLaWFCoRx/rKQQSxG01ZLiLV0MsA6wkBHf6J9fzFuXp0k5l7epw== +"@jest/reporters@^27.2.2": + version "27.2.2" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.2.2.tgz#e2d41cd9f8088676b81b9a9908cb1ba67bdbee78" + integrity sha512-ufwZ8XoLChEfPffDeVGroYbhbcYPom3zKDiv4Flhe97rr/o2IfUXoWkDUDoyJ3/V36RFIMjokSu0IJ/pbFtbHg== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.2.0" - "@jest/test-result" "^27.2.0" - "@jest/transform" "^27.2.1" + "@jest/console" "^27.2.2" + "@jest/test-result" "^27.2.2" + "@jest/transform" "^27.2.2" "@jest/types" "^27.1.1" chalk "^4.0.0" collect-v8-coverage "^1.0.0" @@ -464,10 +464,10 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^27.2.0" - jest-resolve "^27.2.0" + jest-haste-map "^27.2.2" + jest-resolve "^27.2.2" jest-util "^27.2.0" - jest-worker "^27.2.0" + jest-worker "^27.2.2" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" @@ -483,30 +483,30 @@ graceful-fs "^4.2.4" source-map "^0.6.0" -"@jest/test-result@^27.2.0": - version "27.2.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.2.0.tgz#377b46a41a6415dd4839fd0bed67b89fecea6b20" - integrity sha512-JPPqn8h0RGr4HyeY1Km+FivDIjTFzDROU46iAvzVjD42ooGwYoqYO/MQTilhfajdz6jpVnnphFrKZI5OYrBONA== +"@jest/test-result@^27.2.2": + version "27.2.2" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.2.2.tgz#cd4ba1ca9b0521e463bd4b32349ba1842277563b" + integrity sha512-yENoDEoWlEFI7l5z7UYyJb/y5Q8RqbPd4neAVhKr6l+vVaQOPKf8V/IseSMJI9+urDUIxgssA7RGNyCRhGjZvw== dependencies: - "@jest/console" "^27.2.0" + "@jest/console" "^27.2.2" "@jest/types" "^27.1.1" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.2.1": - version "27.2.1" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.2.1.tgz#1682cd3a16198fa358ff9565b0d2792919f36562" - integrity sha512-fWcEgWQXgvU4DFY5YHfQsGwqfJWyuCUzdOzLZTYtyLB3WK1mFPQGYAszM7mCEZjyVon5XRuCa+2/+hif/uMucQ== +"@jest/test-sequencer@^27.2.2": + version "27.2.2" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.2.2.tgz#9a6d735317f525741a5913ee3cdefeffc9b0aba6" + integrity sha512-YnJqwNQP2Zeu0S4TMqkxg6NN7Y1EFq715n/nThNKrvIS9wmRZjDt2XYqsHbuvhAFjshi0iKDQ813NewFITBH+Q== dependencies: - "@jest/test-result" "^27.2.0" + "@jest/test-result" "^27.2.2" graceful-fs "^4.2.4" - jest-haste-map "^27.2.0" - jest-runtime "^27.2.1" + jest-haste-map "^27.2.2" + jest-runtime "^27.2.2" -"@jest/transform@^27.2.1": - version "27.2.1" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.2.1.tgz#743443adb84b3b7419951fc702515ce20ba6285e" - integrity sha512-xmB5vh81KK8DiiCMtI5vI59mP+GggNmc9BiN+fg4mKdQHV369+WuZc1Lq2xWFCOCsRPHt24D9h7Idp4YaMB1Ww== +"@jest/transform@^27.2.2": + version "27.2.2" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.2.2.tgz#89b16b4de84354fb48d15712b3ea34cadc1cb600" + integrity sha512-l4Z/7PpajrOjCiXLWLfMY7fgljY0H8EwW7qdzPXXuv2aQF8kY2+Uyj3O+9Popnaw1V7JCw32L8EeI/thqFDkPA== dependencies: "@babel/core" "^7.1.0" "@jest/types" "^27.1.1" @@ -515,7 +515,7 @@ convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.2.0" + jest-haste-map "^27.2.2" jest-regex-util "^27.0.6" jest-util "^27.2.0" micromatch "^4.0.4" @@ -845,7 +845,7 @@ ansi-escapes@^4.2.1: dependencies: type-fest "^0.21.3" -ansi-regex@^5.0.0: +ansi-regex@^5.0.0, ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== @@ -914,12 +914,12 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= -babel-jest@^27.2.1: - version "27.2.1" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.2.1.tgz#48edfa5cf8d59ab293da94321a369ccc7b67a4b1" - integrity sha512-kkaekSJHew1zfDW3cA2QiSBPg4uiLpiW0OwJKqFv0r2/mFgym/IBn7hxPntL6FvS66G/ROh+lz4pRiCJAH1/UQ== +babel-jest@^27.2.2: + version "27.2.2" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.2.2.tgz#d7e96f3f6f56be692de948092697e1bfea7f1184" + integrity sha512-XNFNNfGKnZXzhej7TleVP4s9ktH5JjRW8Rmcbb223JJwKB/gmTyeWN0JfiPtSgnjIjDXtKNoixiy0QUHtv3vFA== dependencies: - "@jest/transform" "^27.2.1" + "@jest/transform" "^27.2.2" "@jest/types" "^27.1.1" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.0.0" @@ -1487,16 +1487,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^27.2.1: - version "27.2.1" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.2.1.tgz#5f882b308716618613f0106a488b46c303908157" - integrity sha512-ekOA2mBtT2phxcoPVHCXIzbJxCvRXhx2fr7m28IgGdZxUOh8UvxvoRz1FcPlfgZMpE92biHB6woIcAKXqR28hA== +expect@^27.2.2: + version "27.2.2" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.2.2.tgz#65c414697415c0867ef588813e9c729ebab8a9a9" + integrity sha512-sjHBeEk47/eshN9oLbvPJZMgHQihOXXQzSMPCJ4MqKShbU9HOVFSNHEEU4dp4ujzxFSiNvPFzB2AMOFmkizhvA== dependencies: "@jest/types" "^27.1.1" ansi-styles "^5.0.0" jest-get-type "^27.0.6" - jest-matcher-utils "^27.2.0" - jest-message-util "^27.2.0" + jest-matcher-utils "^27.2.2" + jest-message-util "^27.2.2" jest-regex-util "^27.0.6" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: @@ -1901,77 +1901,77 @@ jest-changed-files@^27.1.1: execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.2.1: - version "27.2.1" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.2.1.tgz#c5166052b328c0df932cdaf89f5982085e7b4812" - integrity sha512-9q/8X8DgJmW8IqXsJNnS2E28iarx990hf6D+frS3P0lB+avhFDD33alLwZzKgm45u0wvEi6iFh43WjNbp5fhjw== +jest-circus@^27.2.2: + version "27.2.2" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.2.2.tgz#a3647082f3eba1226f7664a36a2b7ebf45ceaf7b" + integrity sha512-8txlqs0EDrvPasCgwfLMkG0l3F4FxqQa6lxOsvYfOl04eSJjRw3F4gk9shakuC00nMD+VT+SMtFYXxe64f0VZw== dependencies: - "@jest/environment" "^27.2.0" - "@jest/test-result" "^27.2.0" + "@jest/environment" "^27.2.2" + "@jest/test-result" "^27.2.2" "@jest/types" "^27.1.1" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" - expect "^27.2.1" + expect "^27.2.2" is-generator-fn "^2.0.0" - jest-each "^27.2.0" - jest-matcher-utils "^27.2.0" - jest-message-util "^27.2.0" - jest-runtime "^27.2.1" - jest-snapshot "^27.2.1" + jest-each "^27.2.2" + jest-matcher-utils "^27.2.2" + jest-message-util "^27.2.2" + jest-runtime "^27.2.2" + jest-snapshot "^27.2.2" jest-util "^27.2.0" - pretty-format "^27.2.0" + pretty-format "^27.2.2" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.2.1: - version "27.2.1" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.2.1.tgz#031e887245945864cc6ed8605c939f1937858c09" - integrity sha512-IfxuGkBZS/ogY7yFvvD1dFidzQRXlSBHtUZQ3UTIHydzNMF4/ZRTdGFso6HkbCkemwLh4hnNybONexEqWmYwjw== +jest-cli@^27.2.2: + version "27.2.2" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.2.2.tgz#0973a717c109f23de642b63486f3cb71c5a971be" + integrity sha512-jbEythw22LR/IHYgNrjWdO74wO9wyujCxTMjbky0GLav4rC4y6qDQr4TqQ2JPP51eDYJ2awVn83advEVSs5Brg== dependencies: - "@jest/core" "^27.2.1" - "@jest/test-result" "^27.2.0" + "@jest/core" "^27.2.2" + "@jest/test-result" "^27.2.2" "@jest/types" "^27.1.1" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.2.1" + jest-config "^27.2.2" jest-util "^27.2.0" - jest-validate "^27.2.0" + jest-validate "^27.2.2" prompts "^2.0.1" yargs "^16.0.3" -jest-config@^27.2.1: - version "27.2.1" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.2.1.tgz#2e727e023fc4b77a9f067a40c5448a939aa8386b" - integrity sha512-BAOemP8udmFw9nkgaLAac7vXORdvrt4yrJWoh7uYb0nPZeSsu0kGwJU18SwtY4paq9fed5OgAssC3A+Bf4WMQA== +jest-config@^27.2.2: + version "27.2.2" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.2.2.tgz#970d8466c60ac106ac9d7d0b8dcf3ff150fa713a" + integrity sha512-2nhms3lp52ZpU0636bB6zIFHjDVtYxzFQIOHZjBFUeXcb6b41sEkWojbHaJ4FEIO44UbccTLa7tvNpiFCgPE7w== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.2.1" + "@jest/test-sequencer" "^27.2.2" "@jest/types" "^27.1.1" - babel-jest "^27.2.1" + babel-jest "^27.2.2" chalk "^4.0.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" is-ci "^3.0.0" - jest-circus "^27.2.1" - jest-environment-jsdom "^27.2.0" - jest-environment-node "^27.2.0" + jest-circus "^27.2.2" + jest-environment-jsdom "^27.2.2" + jest-environment-node "^27.2.2" jest-get-type "^27.0.6" - jest-jasmine2 "^27.2.1" + jest-jasmine2 "^27.2.2" jest-regex-util "^27.0.6" - jest-resolve "^27.2.0" - jest-runner "^27.2.1" + jest-resolve "^27.2.2" + jest-runner "^27.2.2" jest-util "^27.2.0" - jest-validate "^27.2.0" + jest-validate "^27.2.2" micromatch "^4.0.4" - pretty-format "^27.2.0" + pretty-format "^27.2.2" -jest-diff@^27.0.0, jest-diff@^27.2.0: +jest-diff@^27.0.0: version "27.2.0" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.2.0.tgz#bda761c360f751bab1e7a2fe2fc2b0a35ce8518c" integrity sha512-QSO9WC6btFYWtRJ3Hac0sRrkspf7B01mGrrQEiCW6TobtViJ9RWL0EmOs/WnBsZDsI/Y2IoSHZA2x6offu0sYw== @@ -1981,6 +1981,16 @@ jest-diff@^27.0.0, jest-diff@^27.2.0: jest-get-type "^27.0.6" pretty-format "^27.2.0" +jest-diff@^27.2.2: + version "27.2.2" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.2.2.tgz#3992fe5f55f209676c5d3fd956e3f3d4145f76b8" + integrity sha512-o3LaDbQDSaMJif4yztJAULI4xVatxbBasbKLbEw3K8CiRdDdbxMrLArS9EKDHQFYh6Tgfrm1PC2mIYR1xhu0hQ== + dependencies: + chalk "^4.0.0" + diff-sequences "^27.0.6" + jest-get-type "^27.0.6" + pretty-format "^27.2.2" + jest-docblock@^27.0.6: version "27.0.6" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.0.6.tgz#cc78266acf7fe693ca462cbbda0ea4e639e4e5f3" @@ -1988,37 +1998,37 @@ jest-docblock@^27.0.6: dependencies: detect-newline "^3.0.0" -jest-each@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.2.0.tgz#4c531c7223de289429fc7b2473a86e653c86d61f" - integrity sha512-biDmmUQjg+HZOB7MfY2RHSFL3j418nMoC3TK3pGAj880fQQSxvQe1y2Wy23JJJNUlk6YXiGU0yWy86Le1HBPmA== +jest-each@^27.2.2: + version "27.2.2" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.2.2.tgz#62da8dd68b9fc61ab6e9e344692eeb1251f8c91d" + integrity sha512-ZCDhkvwHeXHsxoFxvW43fabL18iLiVDxaipG5XWG7dSd+XWXXpzMQvBWYT9Wvzhg5x4hvrLQ24LtiOKw3I09xA== dependencies: "@jest/types" "^27.1.1" chalk "^4.0.0" jest-get-type "^27.0.6" jest-util "^27.2.0" - pretty-format "^27.2.0" + pretty-format "^27.2.2" -jest-environment-jsdom@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.2.0.tgz#c654dfae50ca2272c2a2e2bb95ff0af298283a3c" - integrity sha512-wNQJi6Rd/AkUWqTc4gWhuTIFPo7tlMK0RPZXeM6AqRHZA3D3vwvTa9ktAktyVyWYmUoXdYstOfyYMG3w4jt7eA== +jest-environment-jsdom@^27.2.2: + version "27.2.2" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.2.2.tgz#fb3075b4be6289961dcc4942e98f1862b3a8c4cb" + integrity sha512-mzCLEdnpGWDJmNB6WIPLlZM+hpXdeiya9TryiByqcUdpliNV1O+LGC2SewzjmB4IblabGfvr3KcPN0Nme2wnDw== dependencies: - "@jest/environment" "^27.2.0" - "@jest/fake-timers" "^27.2.0" + "@jest/environment" "^27.2.2" + "@jest/fake-timers" "^27.2.2" "@jest/types" "^27.1.1" "@types/node" "*" jest-mock "^27.1.1" jest-util "^27.2.0" jsdom "^16.6.0" -jest-environment-node@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.2.0.tgz#73ef2151cb62206669becb94cd84f33276252de5" - integrity sha512-WbW+vdM4u88iy6Q3ftUEQOSgMPtSgjm3qixYYK2AKEuqmFO2zmACTw1vFUB0qI/QN88X6hA6ZkVKIdIWWzz+yg== +jest-environment-node@^27.2.2: + version "27.2.2" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.2.2.tgz#60ba7d7fee956f68964d47a785d0195ce125aaa3" + integrity sha512-XgUscWs6H6UNqC96/QJjmUGZzzpql/JyprLSXVu7wkgM8tjbJdEkSqwrVAvJPm1yu526ImrmsIoh2BTHxkwL/g== dependencies: - "@jest/environment" "^27.2.0" - "@jest/fake-timers" "^27.2.0" + "@jest/environment" "^27.2.2" + "@jest/fake-timers" "^27.2.2" "@jest/types" "^27.1.1" "@types/node" "*" jest-mock "^27.1.1" @@ -2029,10 +2039,10 @@ jest-get-type@^27.0.6: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.6.tgz#0eb5c7f755854279ce9b68a9f1a4122f69047cfe" integrity sha512-XTkK5exIeUbbveehcSR8w0bhH+c0yloW/Wpl+9vZrjzztCPWrxhHwkIFpZzCt71oRBsgxmuUfxEqOYoZI2macg== -jest-haste-map@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.2.0.tgz#703b3a473e3f2e27d75ab07864ffd7bbaad0d75e" - integrity sha512-laFet7QkNlWjwZtMGHCucLvF8o9PAh2cgePRck1+uadSM4E4XH9J4gnx4do+a6do8ZV5XHNEAXEkIoNg5XUH2Q== +jest-haste-map@^27.2.2: + version "27.2.2" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.2.2.tgz#81ccb57b1e1cd513aaaadf5016aad5dab0ede552" + integrity sha512-kaKiq+GbAvk6/sq++Ymor4Vzk6+lr0vbKs2HDVPdkKsHX2lIJRyvhypZG/QsNfQnROKWIZSpUpGuv2HySSosvA== dependencies: "@jest/types" "^27.1.1" "@types/graceful-fs" "^4.1.2" @@ -2043,58 +2053,58 @@ jest-haste-map@^27.2.0: jest-regex-util "^27.0.6" jest-serializer "^27.0.6" jest-util "^27.2.0" - jest-worker "^27.2.0" + jest-worker "^27.2.2" micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.2.1: - version "27.2.1" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.2.1.tgz#30ee71f38670a621ecf3b6dcb89875933f780de6" - integrity sha512-3vytj3+S49+XYsxGJyjlchDo4xblYzjDY4XK7pV2IAdspbMFOpmeNMOeDonYuvlbUtcV8yrFLA6XtliXapDmMA== +jest-jasmine2@^27.2.2: + version "27.2.2" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.2.2.tgz#bf87c8820a192c86b65a7c4c1a54caae52124f04" + integrity sha512-SczhZNfmZID9HbJ1GHhO4EzeL/PMRGeAUw23ddPUdd6kFijEZpT2yOxyNCBUKAsVQ/14OB60kjgnbuFOboZUNg== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^27.2.0" + "@jest/environment" "^27.2.2" "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.2.0" + "@jest/test-result" "^27.2.2" "@jest/types" "^27.1.1" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^27.2.1" + expect "^27.2.2" is-generator-fn "^2.0.0" - jest-each "^27.2.0" - jest-matcher-utils "^27.2.0" - jest-message-util "^27.2.0" - jest-runtime "^27.2.1" - jest-snapshot "^27.2.1" + jest-each "^27.2.2" + jest-matcher-utils "^27.2.2" + jest-message-util "^27.2.2" + jest-runtime "^27.2.2" + jest-snapshot "^27.2.2" jest-util "^27.2.0" - pretty-format "^27.2.0" + pretty-format "^27.2.2" throat "^6.0.1" -jest-leak-detector@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.2.0.tgz#9a7ca2dad1a21c4e49ad2a8ad7f1214ffdb86a28" - integrity sha512-e91BIEmbZw5+MHkB4Hnrq7S86coTxUMCkz4n7DLmQYvl9pEKmRx9H/JFH87bBqbIU5B2Ju1soKxRWX6/eGFGpA== +jest-leak-detector@^27.2.2: + version "27.2.2" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.2.2.tgz#5af54273efcf5114ad406f4448860c2396319e12" + integrity sha512-fQIYKkhXUs/4EpE4wO1AVsv7aNH3o0km1BGq3vxvSfYdwG9GLMf+b0z/ghLmBYNxb+tVpm/zv2caoKm3GfTazg== dependencies: jest-get-type "^27.0.6" - pretty-format "^27.2.0" + pretty-format "^27.2.2" -jest-matcher-utils@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.2.0.tgz#b4d224ab88655d5fab64b96b989ac349e2f5da43" - integrity sha512-F+LG3iTwJ0gPjxBX6HCyrARFXq6jjiqhwBQeskkJQgSLeF1j6ui1RTV08SR7O51XTUhtc8zqpDj8iCG4RGmdKw== +jest-matcher-utils@^27.2.2: + version "27.2.2" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.2.2.tgz#a6c0a10dce6bfe8250bbed3e2f1b206568d73bde" + integrity sha512-xN3wT4p2i9DGB6zmL3XxYp5lJmq9Q6ff8XKlMtVVBS2SAshmgsPBALJFQ8dWRd2G/xf5q/N0SD0Mipt8QBA26A== dependencies: chalk "^4.0.0" - jest-diff "^27.2.0" + jest-diff "^27.2.2" jest-get-type "^27.0.6" - pretty-format "^27.2.0" + pretty-format "^27.2.2" -jest-message-util@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.2.0.tgz#2f65c71df55267208686b1d7514e18106c91ceaf" - integrity sha512-y+sfT/94CiP8rKXgwCOzO1mUazIEdEhrLjuiu+RKmCP+8O/TJTSne9dqQRbFIHBtlR2+q7cddJlWGir8UATu5w== +jest-message-util@^27.2.2: + version "27.2.2" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.2.2.tgz#cdbb1b82dfe5f601ae35f5c6a28bf7823e6bcf99" + integrity sha512-/iS5/m2FSF7Nn6APFoxFymJpyhB/gPf0CJa7uFSkbYaWvrADUfQ9NTsuyjpszKErOS2/huFs44ysWhlQTKvL8Q== dependencies: "@babel/code-frame" "^7.12.13" "@jest/types" "^27.1.1" @@ -2102,7 +2112,7 @@ jest-message-util@^27.2.0: chalk "^4.0.0" graceful-fs "^4.2.4" micromatch "^4.0.4" - pretty-format "^27.2.0" + pretty-format "^27.2.2" slash "^3.0.0" stack-utils "^2.0.3" @@ -2124,40 +2134,40 @@ jest-regex-util@^27.0.6: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.6.tgz#02e112082935ae949ce5d13b2675db3d8c87d9c5" integrity sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ== -jest-resolve-dependencies@^27.2.1: - version "27.2.1" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.2.1.tgz#239be969ece749d4dc2e1efcf3d2b86c99525c2e" - integrity sha512-9bKEwmz4YshGPjGZAVZOVw6jt7pq2/FjWJmyhnWhvDuiRCHVZBcJhycinX+e/EJ7jafsq26bTpzBIQas3xql1g== +jest-resolve-dependencies@^27.2.2: + version "27.2.2" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.2.2.tgz#7467c67cb8b5630ec28e2f0c72a0b62e56668083" + integrity sha512-nvJS+DyY51HHdZnMIwXg7fimQ5ylFx4+quQXspQXde2rXYy+4v75UYoX/J65Ln8mKCNc6YF8HEhfGaRBOrxxHg== dependencies: "@jest/types" "^27.1.1" jest-regex-util "^27.0.6" - jest-snapshot "^27.2.1" + jest-snapshot "^27.2.2" -jest-resolve@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.2.0.tgz#f5d053693ab3806ec2f778e6df8b0aa4cfaef95f" - integrity sha512-v09p9Ib/VtpHM6Cz+i9lEAv1Z/M5NVxsyghRHRMEUOqwPQs3zwTdwp1xS3O/k5LocjKiGS0OTaJoBSpjbM2Jlw== +jest-resolve@^27.2.2: + version "27.2.2" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.2.2.tgz#1bad93dbc6c20edb874e6720e82e4e48900b120b" + integrity sha512-tfbHcBs/hJTb3fPQ/3hLWR+TsLNTzzK98TU+zIAsrL9nNzWfWROwopUOmiSUqmHMZW5t9au/433kSF2/Af+tTw== dependencies: "@jest/types" "^27.1.1" chalk "^4.0.0" escalade "^3.1.1" graceful-fs "^4.2.4" - jest-haste-map "^27.2.0" + jest-haste-map "^27.2.2" jest-pnp-resolver "^1.2.2" jest-util "^27.2.0" - jest-validate "^27.2.0" + jest-validate "^27.2.2" resolve "^1.20.0" slash "^3.0.0" -jest-runner@^27.2.1: - version "27.2.1" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.2.1.tgz#3443b1fc08b8a50f305dfc2d41dd2badf335843b" - integrity sha512-USHitkUUzcB3Y5mRdzlp+KHgRRR2VsXDq5OeATuDmq1qXfT/RwwnQykUhn+KVx3FotxK3pID74UY7o6HYIR8vA== +jest-runner@^27.2.2: + version "27.2.2" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.2.2.tgz#e719a8ce2a16575677105f692fdff7cd00602325" + integrity sha512-+bUFwBq+yTnvsOFuxetoQtkuOnqdAk2YuIGjlLmc7xLAXn/V1vjhXrLencgij0BUTTUvG9Aul3+5XDss4Wa8Eg== dependencies: - "@jest/console" "^27.2.0" - "@jest/environment" "^27.2.0" - "@jest/test-result" "^27.2.0" - "@jest/transform" "^27.2.1" + "@jest/console" "^27.2.2" + "@jest/environment" "^27.2.2" + "@jest/test-result" "^27.2.2" + "@jest/transform" "^27.2.2" "@jest/types" "^27.1.1" "@types/node" "*" chalk "^4.0.0" @@ -2165,30 +2175,30 @@ jest-runner@^27.2.1: exit "^0.1.2" graceful-fs "^4.2.4" jest-docblock "^27.0.6" - jest-environment-jsdom "^27.2.0" - jest-environment-node "^27.2.0" - jest-haste-map "^27.2.0" - jest-leak-detector "^27.2.0" - jest-message-util "^27.2.0" - jest-resolve "^27.2.0" - jest-runtime "^27.2.1" + jest-environment-jsdom "^27.2.2" + jest-environment-node "^27.2.2" + jest-haste-map "^27.2.2" + jest-leak-detector "^27.2.2" + jest-message-util "^27.2.2" + jest-resolve "^27.2.2" + jest-runtime "^27.2.2" jest-util "^27.2.0" - jest-worker "^27.2.0" + jest-worker "^27.2.2" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.2.1: - version "27.2.1" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.2.1.tgz#db506f679356f5b94b7be20e770f2541b7c2b339" - integrity sha512-QJNnwL4iteDE/Jq4TfQK7AjhPoUZflBKTtUIkRnFYFkTAZTP/o8k7ekaROiVjmo+NYop5+DQPqX6pz4vWbZSOQ== +jest-runtime@^27.2.2: + version "27.2.2" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.2.2.tgz#cc29d3adde948d531657a67d33c9f8d9bb58a6fc" + integrity sha512-PtTHCK5jT+KrIpKpjJsltu/dK5uGhBtTNLOk1Z+ZD2Jrxam2qQsOqDFYLszcK0jc2TLTNsrVpclqSftn7y3aXA== dependencies: - "@jest/console" "^27.2.0" - "@jest/environment" "^27.2.0" - "@jest/fake-timers" "^27.2.0" - "@jest/globals" "^27.2.1" + "@jest/console" "^27.2.2" + "@jest/environment" "^27.2.2" + "@jest/fake-timers" "^27.2.2" + "@jest/globals" "^27.2.2" "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.2.0" - "@jest/transform" "^27.2.1" + "@jest/test-result" "^27.2.2" + "@jest/transform" "^27.2.2" "@jest/types" "^27.1.1" "@types/yargs" "^16.0.0" chalk "^4.0.0" @@ -2198,14 +2208,14 @@ jest-runtime@^27.2.1: exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-haste-map "^27.2.0" - jest-message-util "^27.2.0" + jest-haste-map "^27.2.2" + jest-message-util "^27.2.2" jest-mock "^27.1.1" jest-regex-util "^27.0.6" - jest-resolve "^27.2.0" - jest-snapshot "^27.2.1" + jest-resolve "^27.2.2" + jest-snapshot "^27.2.2" jest-util "^27.2.0" - jest-validate "^27.2.0" + jest-validate "^27.2.2" slash "^3.0.0" strip-bom "^4.0.0" yargs "^16.0.3" @@ -2218,10 +2228,10 @@ jest-serializer@^27.0.6: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^27.2.1: - version "27.2.1" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.2.1.tgz#385accf3bb71ac84e9a6bda4fc9bb458d53abb35" - integrity sha512-8CTg2YrgZuQbPHW7G0YvLTj4yTRXLmSeEO+ka3eC5lbu5dsTRyoDNS1L7x7EFUTyYQhFH9HQG1/TNlbUgR9Lug== +jest-snapshot@^27.2.2: + version "27.2.2" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.2.2.tgz#898f0eedde658e723461d3cdcaedb404e716fa01" + integrity sha512-7ODSvULMiiOVuuLvLZpDlpqqTqX9hDfdmijho5auVu9qRYREolvrvgH4kSNOKfcqV3EZOTuLKNdqsz1PM20PQA== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" @@ -2229,23 +2239,23 @@ jest-snapshot@^27.2.1: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/transform" "^27.2.1" + "@jest/transform" "^27.2.2" "@jest/types" "^27.1.1" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.2.1" + expect "^27.2.2" graceful-fs "^4.2.4" - jest-diff "^27.2.0" + jest-diff "^27.2.2" jest-get-type "^27.0.6" - jest-haste-map "^27.2.0" - jest-matcher-utils "^27.2.0" - jest-message-util "^27.2.0" - jest-resolve "^27.2.0" + jest-haste-map "^27.2.2" + jest-matcher-utils "^27.2.2" + jest-message-util "^27.2.2" + jest-resolve "^27.2.2" jest-util "^27.2.0" natural-compare "^1.4.0" - pretty-format "^27.2.0" + pretty-format "^27.2.2" semver "^7.3.2" jest-util@^27.0.0, jest-util@^27.2.0: @@ -2260,24 +2270,24 @@ jest-util@^27.0.0, jest-util@^27.2.0: is-ci "^3.0.0" picomatch "^2.2.3" -jest-validate@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.2.0.tgz#b7535f12d95dd3b4382831f4047384ca098642ab" - integrity sha512-uIEZGkFKk3+4liA81Xu0maG5aGDyPLdp+4ed244c+Ql0k3aLWQYcMbaMLXOIFcb83LPHzYzqQ8hwNnIxTqfAGQ== +jest-validate@^27.2.2: + version "27.2.2" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.2.2.tgz#e672118f1d9aa57b25b4c7998edc101dabd7020b" + integrity sha512-01mwTAs2kgDuX98Ua3Xhdhp5lXsLU4eyg6k56adTtrXnU/GbLd9uAsh5nc4MWVtUXMeNmHUyEiD4ibLqE8MuNw== dependencies: "@jest/types" "^27.1.1" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^27.0.6" leven "^3.1.0" - pretty-format "^27.2.0" + pretty-format "^27.2.2" -jest-watcher@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.2.0.tgz#dc2eef4c13c6d41cebf3f1fc5f900a54b51c2ea0" - integrity sha512-SjRWhnr+qO8aBsrcnYIyF+qRxNZk6MZH8TIDgvi+VlsyrvOyqg0d+Rm/v9KHiTtC9mGGeFi9BFqgavyWib6xLg== +jest-watcher@^27.2.2: + version "27.2.2" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.2.2.tgz#8b00253d7e880c6637b402228a76f2fe5ea08132" + integrity sha512-7HJwZq06BCfM99RacCVzXO90B20/dNJvq+Ouiu/VrFdFRCpbnnqlQUEk4KAhBSllgDrTPgKu422SCF5KKBHDRA== dependencies: - "@jest/test-result" "^27.2.0" + "@jest/test-result" "^27.2.2" "@jest/types" "^27.1.1" "@types/node" "*" ansi-escapes "^4.2.1" @@ -2285,23 +2295,23 @@ jest-watcher@^27.2.0: jest-util "^27.2.0" string-length "^4.0.1" -jest-worker@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.2.0.tgz#11eef39f1c88f41384ca235c2f48fe50bc229bc0" - integrity sha512-laB0ZVIBz+voh/QQy9dmUuuDsadixeerrKqyVpgPz+CCWiOYjOBabUXHIXZhsdvkWbLqSHbgkAHWl5cg24Q6RA== +jest-worker@^27.2.2: + version "27.2.2" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.2.2.tgz#636deeae8068abbf2b34b4eb9505f8d4e5bd625c" + integrity sha512-aG1xq9KgWB2CPC8YdMIlI8uZgga2LFNcGbHJxO8ctfXAydSaThR4EewKQGg3tBOC+kS3vhPGgymsBdi9VINjPw== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^27.0.1: - version "27.2.1" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.2.1.tgz#9263102056fe152fd2478d181cf9bbbd2a6a8da4" - integrity sha512-0MyvNS7J1HbkeotYaqKNGioN+p1/AAPtI1Z8iwMtCBE+PwBT+M4l25D9Pve8/KdhktYLgZaGyyj9CoDytD+R2Q== + version "27.2.2" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.2.2.tgz#445a4c16aa4c4ae6e512d62fb6f8b2624cbd6c26" + integrity sha512-XAB/9akDTe3/V0wPNKWfP9Y/NT1QPiCqyRBYGbC66EA9EvgAzdaFEqhFGLaDJ5UP2yIyXUMtju9a9IMrlYbZTQ== dependencies: - "@jest/core" "^27.2.1" + "@jest/core" "^27.2.2" import-local "^3.0.2" - jest-cli "^27.2.1" + jest-cli "^27.2.2" js-tokens@^4.0.0: version "4.0.0" @@ -2703,6 +2713,16 @@ pretty-format@^27.0.0, pretty-format@^27.2.0: ansi-styles "^5.0.0" react-is "^17.0.1" +pretty-format@^27.2.2: + version "27.2.2" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.2.2.tgz#c080f1ab7ac64302e4d438f208596fc649dbeeb3" + integrity sha512-+DdLh+rtaElc2SQOE/YPH8k2g3Rf2OXWEpy06p8Szs3hdVSYD87QOOlYRHWAeb/59XTmeVmRKvDD0svHqf6ycA== + dependencies: + "@jest/types" "^27.1.1" + ansi-regex "^5.0.1" + ansi-styles "^5.0.0" + react-is "^17.0.1" + pretty-quick@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/pretty-quick/-/pretty-quick-3.1.1.tgz#93ca4e2dd38cc4e970e3f54a0ead317a25454688" From eab05904c6fe1970f32a5302bd807e6d76605ef5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Sep 2021 12:08:53 +0000 Subject: [PATCH 258/785] Bump @types/node from 16.9.6 to 16.10.1 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.9.6 to 16.10.1. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index dcc4383c..dba24576 100644 --- a/yarn.lock +++ b/yarn.lock @@ -673,9 +673,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^16.9.1": - version "16.9.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.9.6.tgz#040a64d7faf9e5d9e940357125f0963012e66f04" - integrity sha512-YHUZhBOMTM3mjFkXVcK+WwAcYmyhe1wL4lfqNtzI0b3qAy7yuSetnM7QJazgE5PFmgVTNGiLOgRFfJMqW7XpSQ== + version "16.10.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.1.tgz#f3647623199ca920960006b3dccf633ea905f243" + integrity sha512-4/Z9DMPKFexZj/Gn3LylFgamNKHm4K3QDi0gz9B26Uk0c8izYf97B5fxfpspMNkWlFupblKM/nV8+NA9Ffvr+w== "@types/prettier@^2.1.5", "@types/prettier@^2.3.2": version "2.3.2" From 56d750546323fd9cd6441856c2e5fa93f449fb6b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Sep 2021 12:10:20 +0000 Subject: [PATCH 259/785] Bump @types/prettier from 2.3.2 to 2.4.0 Bumps [@types/prettier](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/prettier) from 2.3.2 to 2.4.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/prettier) --- updated-dependencies: - dependency-name: "@types/prettier" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index dba24576..47420b72 100644 --- a/yarn.lock +++ b/yarn.lock @@ -678,9 +678,9 @@ integrity sha512-4/Z9DMPKFexZj/Gn3LylFgamNKHm4K3QDi0gz9B26Uk0c8izYf97B5fxfpspMNkWlFupblKM/nV8+NA9Ffvr+w== "@types/prettier@^2.1.5", "@types/prettier@^2.3.2": - version "2.3.2" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.3.2.tgz#fc8c2825e4ed2142473b4a81064e6e081463d1b3" - integrity sha512-eI5Yrz3Qv4KPUa/nSIAi0h+qX0XyewOliug5F2QAtuRg6Kjg6jfmxe1GIwoIRhZspD1A0RP8ANrPwvEXXtRFog== + version "2.4.0" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.0.tgz#900b13362610ccd3570fb6eefb911a6732973d00" + integrity sha512-WHRsy5nMpjXfU9B0LqOqPT06EI2+8Xv5NERy0pLxJLbU98q7uhcGogQzfX+rXpU7S5mgHsLxHrLCufZcV/P8TQ== "@types/stack-utils@^2.0.0": version "2.0.1" From 02d7ae1116601901db4deb37ccbb735c461ef9d0 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 27 Sep 2021 10:33:33 -0400 Subject: [PATCH 260/785] Split out the scanner events --- src/ruby/parser.rb | 1058 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 865 insertions(+), 193 deletions(-) diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 9d4140be..6b70f43b 100755 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -160,105 +160,39 @@ def find_scanner_event(type, body = :any, consume: true) consume ? scanner_events.delete_at(index) : (index && scanner_events[index]) end - # Scanner events occur when the lexer hits a new token, like a keyword or an - # end. These nodes always contain just one argument which is a string - # representing the content. For the most part these can just be printed - # directly, which very few exceptions. - defined = %i[ - comment - embdoc - embdoc_beg - embdoc_end - heredoc_beg - heredoc_end - ignored_nl - ] - - (SCANNER_EVENTS - defined).each do |event| - define_method(:"on_#{event}") do |value| - ec = char_pos + value.size - node = { - type: :"@#{event}", - body: value, - sl: lineno, - el: lineno, - sc: char_pos, - ec: ec - } - - scanner_events << node - node - end - end + # A helper function to find a :: operator. We do special handling instead of + # using find_scanner_event here because we don't pop off all of the :: + # operators so you could end up getting the wrong information if you have for + # instance ::X::Y::Z. + def find_colon2_before(const) + index = + scanner_events.rindex do |event| + event[:type] == :@op && event[:body] == '::' && event[:sc] < const[:sc] + end - # We keep track of each comment as it comes in and then eventually add - # them to the top of the generated AST so that prettier can start adding - # them back into the final representation. Comments come in including - # their starting pound sign and the newline at the end, so we also chop - # those off. - # - # If there is an encoding magic comment at the top of the file, ripper - # will actually change into that encoding for the storage of the string. - # This will break everything, so we need to force the encoding back into - # UTF-8 so that the JSON library won't break. - def on_comment(value) - @comments << { - type: :@comment, - value: value[1..-1].chomp.force_encoding('UTF-8'), - inline: value.strip != lines[lineno - 1], - sl: lineno, - el: lineno, - sc: char_pos, - ec: char_pos + value.length - 1 - } + scanner_events[index] end - # ignored_nl is a special kind of scanner event that passes nil as the value, - # so we can't do our normal tracking of value.size. Instead of adding a - # condition to the main SCANNER_EVENTS loop above, we'll just explicitly - # define the method here. You can trigger the ignored_nl event with the - # following snippet: + # Finds the next position in the source string that begins a statement. This + # is used to bind statements lists and make sure they don't include a + # preceding comment. For example, we want the following comment to be attached + # to the class node and not the statement node: # - # foo.bar - # .baz + # class Foo # :nodoc: + # ... + # end # - def on_ignored_nl(value) - { - type: :ignored_nl, - body: nil, - sl: lineno, - el: lineno, - sc: char_pos, - ec: char_pos - } - end - - prepend( - Module.new do - private - - # Handles __END__ syntax, which allows individual scripts to keep content - # after the main ruby code that can be read through DATA. It looks like: - # - # foo.bar - # - # __END__ - # some other content that isn't normally read by ripper - def on___end__(*) - @__end__ = super(lines[lineno..-1].join("\n")) - end - - # Like comments, we need to force the encoding here so JSON doesn't break. - def on_ident(value) - super(value.force_encoding('UTF-8')) - end + # By finding the next non-space character, we can make sure that the bounds of + # the statement list are correct. + def find_next_statement_start(position) + remaining = source[position..-1] - # Like comments, we need to force the encoding here so JSON doesn't break. - def on_tstring_content(value) - super(value.force_encoding('UTF-8')) - end + if remaining.sub(/\A +/, '')[0] == '#' + return position + remaining.index("\n") end - ) + + position + end # A BEGIN node is a parser event that represents the use of the BEGIN # keyword, which hooks into the lifecycle of the interpreter. It's a bit @@ -284,6 +218,23 @@ def on_BEGIN(stmts) ) end + def on_CHAR(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@CHAR, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + # A END node is a parser event that represents the use of the END keyword, # which hooks into the lifecycle of the interpreter. It's a bit of a # legacy from the stream operating days, and gets its inspiration from @@ -308,6 +259,27 @@ def on_END(stmts) ) end + # Handles __END__ syntax, which allows individual scripts to keep content + # after the main ruby code that can be read through DATA. It looks like: + # + # foo.bar + # + # __END__ + # some other content that isn't normally read by ripper + def on___end__(value) + start_line = lineno + start_char = char_pos + + @__end__ = { + type: :@__end__, + body: lines[lineno..-1].join("\n"), + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + end + # alias is a parser event that represents when you're using the alias # keyword with regular arguments. This can be either symbol literals or # bare words. You can optionally use parentheses with this keyword, so we @@ -373,17 +345,24 @@ def on_aref_field(collection, index) } end - # args_new is a parser event that represents the beginning of a list of - # arguments to any method call or an array. It can be followed by any - # number of args_add events, which we'll append onto an array body. - def on_args_new + # arg_paren is a parser event that represents wrapping arguments to a + # method inside a set of parentheses. + def on_arg_paren(args) + beging = find_scanner_event(:@lparen) + rparen = find_scanner_event(:@rparen) + + # If the arguments exceed the ending of the parentheses, then we know we + # have a heredoc in the arguments, and we need to use the bounds of the + # arguments to determine how large the arg_paren is. + ending = (args && args[:el] > rparen[:el]) ? args : rparen + { - type: :args, - body: [], - sl: lineno, - sc: char_pos, - el: lineno, - ec: char_pos + type: :arg_paren, + body: [args], + sl: beging[:sl], + sc: beging[:sc], + el: ending[:el], + ec: ending[:ec] } end @@ -436,24 +415,17 @@ def on_args_forward find_scanner_event(:@op, '...').merge!(type: :args_forward) end - # arg_paren is a parser event that represents wrapping arguments to a - # method inside a set of parentheses. - def on_arg_paren(args) - beging = find_scanner_event(:@lparen) - rparen = find_scanner_event(:@rparen) - - # If the arguments exceed the ending of the parentheses, then we know we - # have a heredoc in the arguments, and we need to use the bounds of the - # arguments to determine how large the arg_paren is. - ending = (args && args[:el] > rparen[:el]) ? args : rparen - + # args_new is a parser event that represents the beginning of a list of + # arguments to any method call or an array. It can be followed by any + # number of args_add events, which we'll append onto an array body. + def on_args_new { - type: :arg_paren, - body: [args], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + type: :args, + body: [], + sl: lineno, + sc: char_pos, + el: lineno, + ec: char_pos } end @@ -554,6 +526,40 @@ def on_assoclist_from_args(assocs) } end + def on_backref(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@backref, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + + def on_backtick(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@backtick, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + # bare_assoc_hash is a parser event that represents a hash of contents # being passed as a method argument (and therefore has omitted braces). It # accepts as an argument an array of assoc events (either assoc_new or @@ -768,27 +774,6 @@ def on_case(switch, consequent) ) end - # Finds the next position in the source string that begins a statement. This - # is used to bind statements lists and make sure they don't include a - # preceding comment. For example, we want the following comment to be attached - # to the class node and not the statement node: - # - # class Foo # :nodoc: - # ... - # end - # - # By finding the next non-space character, we can make sure that the bounds of - # the statement list are correct. - def find_next_statement_start(position) - remaining = source[position..-1] - - if remaining.sub(/\A +/, '')[0] == '#' - return position + remaining.index("\n") - end - - position - end - # class is a parser event that represents defining a class. It accepts as # arguments the name of the class, the optional name of the superclass, # and the bodystmt event that represents the statements evaluated within @@ -812,6 +797,23 @@ def on_class(const, superclass, bodystmt) } end + def on_comma(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@comma, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + # command is a parser event representing a method call with arguments and # no parentheses. It accepts as arguments the name of the method and the # arguments being passed to the method. @@ -843,6 +845,48 @@ def on_command_call(receiver, oper, ident, args) } end + # We keep track of each comment as it comes in and then eventually add + # them to the top of the generated AST so that prettier can start adding + # them back into the final representation. Comments come in including + # their starting pound sign and the newline at the end, so we also chop + # those off. + # + # If there is an encoding magic comment at the top of the file, ripper + # will actually change into that encoding for the storage of the string. + # This will break everything, so we need to force the encoding back into + # UTF-8 so that the JSON library won't break. + def on_comment(value) + start_line = lineno + start_char = char_pos + + @comments << { + type: :@comment, + value: value[1..-1].chomp.force_encoding('UTF-8'), + inline: value.strip != lines[lineno - 1], + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.length - 1 + } + end + + def on_const(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@const, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + # A const_path_field is a parser event that is always the child of some # kind of assignment. It represents when you're assigning to a constant # that is being referenced as a child of another variable. For example: @@ -887,6 +931,23 @@ def on_const_ref(const) const.merge(type: :const_ref, body: [const]) end + def on_cvar(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@cvar, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + # A def is a parser event that represents defining a regular method on the # current self object. It accepts as arguments the ident (the name of the # method being defined), the params (the parameter declaration for the @@ -1113,25 +1174,22 @@ def on_dyna_symbol(string) end end - # else can either end with an end keyword (in which case we'll want to - # consume that event) or it can end with an ensure keyword (in which case - # we'll leave that to the ensure to handle). - def find_else_ending + # else is a parser event that represents the end of a if, unless, or begin + # chain. It accepts as an argument the statements that are contained + # within the else clause. + def on_else(stmts) + beging = find_scanner_event(:@kw, 'else') + + # else can either end with an end keyword (in which case we'll want to + # consume that event) or it can end with an ensure keyword (in which case + # we'll leave that to the ensure to handle). index = scanner_events.rindex do |event| event[:type] == :@kw && %w[end ensure].include?(event[:body]) end event = scanner_events[index] - event[:body] == 'end' ? scanner_events.delete_at(index) : event - end - - # else is a parser event that represents the end of a if, unless, or begin - # chain. It accepts as an argument the statements that are contained - # within the else clause. - def on_else(stmts) - beging = find_scanner_event(:@kw, 'else') - ending = find_else_ending + ending = event[:body] == 'end' ? scanner_events.delete_at(index) : event stmts.bind(beging[:ec], ending[:sc]) @@ -1165,6 +1223,14 @@ def on_elsif(predicate, stmts, consequent) } end + # This is a scanner event that gets hit when we're inside an embdoc and + # receive a new line of content. Here we are guaranteed to already have + # initialized the @embdoc variable so we can just append the new line onto + # the existing content. + def on_embdoc(value) + @embdoc[:value] << value + end + # embdocs are long comments that are surrounded by =begin..=end. They # cannot be nested, so we don't need to worry about keeping a stack around # like we do with heredocs. Instead we can just track the current embdoc @@ -1174,14 +1240,6 @@ def on_embdoc_beg(value) @embdoc = { type: :@embdoc, value: value, sl: lineno, sc: char_pos } end - # This is a scanner event that gets hit when we're inside an embdoc and - # receive a new line of content. Here we are guaranteed to already have - # initialized the @embdoc variable so we can just append the new line onto - # the existing content. - def on_embdoc(value) - @embdoc[:value] << value - end - # This is the final scanner event for embdocs. It receives the =end. Here # we can finalize the embdoc with its location information and the final # piece of the string. We then add it to the list of comments so that @@ -1197,6 +1255,57 @@ def on_embdoc_end(value) @embdoc = nil end + def on_embexpr_beg(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@embexpr_beg, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + + def on_embexpr_end(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@embexpr_end, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + + def on_embvar(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@embvar, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + # ensure is a parser event that represents the use of the ensure keyword # and its subsequent statements. def on_ensure(stmts) @@ -1253,6 +1362,23 @@ def on_field(left, oper, right) } end + def on_float(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@float, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + # fndptn is a parser event that represents matching against a pattern where # you find a pattern in an array using the Ruby 3.0+ pattern matching syntax. def on_fndptn(const, presplat, args, postsplat) @@ -1296,6 +1422,23 @@ def on_for(ident, enum, stmts) } end + def on_gvar(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@gvar, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + # hash is a parser event that represents a hash literal. It accepts as an # argument an optional assoclist_from_args event which contains the # contents of the hash. @@ -1370,6 +1513,24 @@ def on_hshptn(const, kw, kwrest) } end + # Like comments, we need to force the encoding here so JSON doesn't break. + def on_ident(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@ident, + body: value.force_encoding('UTF-8'), + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + # if is a parser event that represents the first clause in an if chain. # It accepts as arguments the predicate of the if, the statements that are # contained within the if clause, and the optional consequent clause. @@ -1417,6 +1578,40 @@ def on_if_mod(predicate, statement) } end + # ignored_nl is a special kind of scanner event that passes nil as the value. + # You can trigger the ignored_nl event with the following snippet: + # + # foo.bar + # .baz + # + # We don't need to track this event in the AST that we're generating, so we're + # not going to define an explicit handler for it. + # + # def on_ignored_nl(value) + # value + # end + + def on_ignored_sp(value) + value + end + + def on_imaginary(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@imaginary, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + # in is a parser event that represents using the in keyword within the # Ruby 2.7+ pattern matching syntax. Alternatively in Ruby 3+ it is also used # to handle rightward assignment for pattern matching. @@ -1437,6 +1632,57 @@ def on_in(pattern, stmts, consequent) ) end + def on_int(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@int, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + + def on_ivar(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@ivar, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + + def on_kw(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@kw, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + # kwrest_param is a parser event that represents defining a parameter in a # method definition that accepts all remaining keyword parameters. def on_kwrest_param(ident) @@ -1451,6 +1697,40 @@ def on_kwrest_param(ident) ) end + def on_label(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@label, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + + def on_label_end(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@label_end, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + # lambda is a parser event that represents using a "stabby" lambda # literal. It accepts as arguments a params event that represents any # parameters to the lambda and a stmts event that represents the @@ -1481,6 +1761,57 @@ def on_lambda(params, stmts) } end + def on_lbrace(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@lbrace, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + + def on_lbracket(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@lbracket, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + + def on_lparen(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@lparen, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + # massign is a parser event that is a parent node of any kind of multiple # assignment. This includes splitting out variables on the left like: # @@ -1711,6 +2042,37 @@ def on_next(args_add_block) ) end + def on_nl(value) + start_line = lineno + start_char = char_pos + + { + type: :@nl, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + end + + def on_op(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@op, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + # opassign is a parser event that represents assigning something to a # variable or constant using an operator like += or ||=. It accepts as # arguments the left side of the expression before the operator, the @@ -1787,6 +2149,20 @@ def on_parse_error(error, *) alias on_class_name_error on_parse_error alias on_param_error on_parse_error + def on_period(value) + start_line = lineno + start_char = char_pos + + { + type: :@period, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + end + # The program node is the very top of the AST. Here we'll attach all of # the comments that we've gathered up over the course of parsing the # source string. We'll also attach on the __END__ content if there was @@ -1800,6 +2176,23 @@ def on_program(stmts) range.merge(type: :program, body: [stmts], comments: @comments) end + def on_qsymbols_beg(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@qsymbols_beg, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + # qsymbols_new is a parser event that represents the beginning of a symbol # literal array, like %i[one two three]. It can be followed by any number # of qsymbols_add events, which we'll append onto an array body. @@ -1819,6 +2212,23 @@ def on_qsymbols_add(qsymbols, tstring_content) ) end + def on_qwords_beg(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@qwords_beg, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + # qwords_new is a parser event that represents the beginning of a string # literal array, like %w[one two three]. It can be followed by any number # of qwords_add events, which we'll append onto an array body. @@ -1838,20 +2248,63 @@ def on_qwords_add(qwords, tstring_content) ) end + def on_rational(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@rational, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + + def on_rbrace(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@rbrace, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + + def on_rbracket(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@rbracket, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + # redo is a parser event that represents the bare redo keyword. It has no # body as it accepts no arguments. def on_redo find_scanner_event(:@kw, 'redo').merge!(type: :redo) end - # regexp_new is a parser event that represents the beginning of a regular - # expression literal, like /foo/. It can be followed by any number of - # regexp_add events, which we'll append onto an array body. - def on_regexp_new - beging = find_scanner_event(:@regexp_beg) - beging.merge!(type: :regexp, body: [], beging: beging[:body]) - end - # regexp_add is a parser event that represents a piece of a regular # body. It accepts as arguments the parent regexp node as well as a # tstring_content scanner event representing string content or a @@ -1864,6 +2317,37 @@ def on_regexp_add(regexp, piece) ) end + def on_regexp_beg(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@regexp_beg, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + + def on_regexp_end(value) + start_line = lineno + start_char = char_pos + + { + type: :@regexp_end, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + end + # regexp_literal is a parser event that represents a regular expression. # It accepts as arguments a regexp node which is a built-up array of # pieces that go into the regexp content, as well as the ending used to @@ -1877,6 +2361,14 @@ def on_regexp_literal(regexp, ending) ) end + # regexp_new is a parser event that represents the beginning of a regular + # expression literal, like /foo/. It can be followed by any number of + # regexp_add events, which we'll append onto an array body. + def on_regexp_new + beging = find_scanner_event(:@regexp_beg) + beging.merge!(type: :regexp, body: [], beging: beging[:body]) + end + # rescue is a special kind of node where you have a rescue chain but it # doesn't really have all of the information that it needs in order to # determine its ending. Therefore it relies on its parent bodystmt node to @@ -1990,6 +2482,23 @@ def on_return0 find_scanner_event(:@kw, 'return').merge!(type: :return0) end + def on_rparen(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@rparen, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + # sclass is a parser event that represents a block of statements that # should be evaluated within the context of the singleton class of an # object. It's frequently used to define singleton methods. It looks like @@ -2016,6 +2525,42 @@ def on_sclass(target, bodystmt) } end + def on_semicolon(value) + start_line = lineno + start_char = char_pos + + { + type: :@semicolon, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + end + + def on_sp(value) + start_line = lineno + start_char = char_pos + + { + type: :@sp, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + end + + # stmts_add is a parser event that represents a single statement inside a + # list of statements within any lexical block. It accepts as arguments the + # parent stmts node as well as an stmt which can be any expression in + # Ruby. + def on_stmts_add(stmts, stmt) + stmts << stmt + end + # Everything that has a block of code inside of it has a list of statements. # Normally we would just track those as a node that has an array body, but we # have some special handling in order to handle empty statement lists. They @@ -2081,12 +2626,12 @@ def on_stmts_new ) end - # stmts_add is a parser event that represents a single statement inside a - # list of statements within any lexical block. It accepts as arguments the - # parent stmts node as well as an stmt which can be any expression in - # Ruby. - def on_stmts_add(stmts, stmt) - stmts << stmt + # string_add is a parser event that represents a piece of a string. It + # could be plain @tstring_content, string_embexpr, or string_dvar nodes. + # It accepts as arguments the parent string node as well as the additional + # piece of the string. + def on_string_add(string, piece) + string.merge!(body: string[:body] << piece, el: piece[:el], ec: piece[:ec]) end # string_concat is a parser event that represents concatenating two @@ -2122,14 +2667,6 @@ def on_string_content } end - # string_add is a parser event that represents a piece of a string. It - # could be plain @tstring_content, string_embexpr, or string_dvar nodes. - # It accepts as arguments the parent string node as well as the additional - # piece of the string. - def on_string_add(string, piece) - string.merge!(body: string[:body] << piece, el: piece[:el], ec: piece[:ec]) - end - # string_dvar is a parser event that represents a very special kind of # interpolation into string. It allows you to take an instance variable, # class variable, or global variable and omit the braces when @@ -2200,6 +2737,23 @@ def on_super(contents) ) end + def on_symbeg(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@symbeg, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + # A symbol is a parser event that immediately descends from a symbol # literal and contains an ident representing the contents of the symbol. def on_symbol(ident) @@ -2231,6 +2785,23 @@ def on_symbol_literal(contents) end end + def on_symbols_beg(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@symbols_beg, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + # symbols_new is a parser event that represents the beginning of a symbol # literal array that accepts interpolation, like %I[one #{two} three]. It # can be followed by any number of symbols_add events, which we'll append @@ -2251,17 +2822,38 @@ def on_symbols_add(symbols, word_add) ) end - # A helper function to find a :: operator for the next two nodes. We do - # special handling instead of using find_scanner_event here because we - # don't pop off all of the :: operators so you could end up getting the - # wrong information if you have for instance ::X::Y::Z. - def find_colon2_before(const) - index = - scanner_events.rindex do |event| - event[:type] == :@op && event[:body] == '::' && event[:sc] < const[:sc] - end + def on_tlambda(value) + start_line = lineno + start_char = char_pos - scanner_events[index] + node = { + type: :@tlambda, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + + def on_tlambeg(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@tlambeg, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node end # A top_const_field is a parser event that is always the child of some @@ -2296,6 +2888,55 @@ def on_top_const_ref(const) ) end + def on_tstring_beg(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@tstring_beg, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + + # Like comments, we need to force the encoding here so JSON doesn't break. + def on_tstring_content(value) + start_line = lineno + start_char = char_pos + + { + type: :@tstring_content, + body: value.force_encoding('UTF-8'), + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + end + + def on_tstring_end(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@tstring_end, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + # A unary node represents a unary method being called on an expression, as # in !, ~, or not. We have somewhat special handling of the not operator # since if it has parentheses they don't get reported as a paren node for @@ -2593,6 +3234,37 @@ def on_word_add(word, piece) end end + def on_words_beg(value) + start_line = lineno + start_char = char_pos + + node = { + type: :@words_beg, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + + scanner_events << node + node + end + + def on_words_sep(value) + start_line = lineno + start_char = char_pos + + { + type: :@words_sep, + body: value, + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + value.size + } + end + # words_new is a parser event that represents the beginning of a string # literal array that accepts interpolation, like %W[one #{two} three]. It # can be followed by any number of words_add events, which we'll append From 9aef92eb65fbe1ba7e6045a18caefe3d8c766ca3 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 27 Sep 2021 11:49:06 -0400 Subject: [PATCH 261/785] More documentation for the scanner events --- src/ruby/parser.rb | 343 ++++++++++++++++++++++++++++++++------------- 1 file changed, 245 insertions(+), 98 deletions(-) diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 6b70f43b..29565f79 100755 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -16,6 +16,8 @@ require 'json' unless defined?(JSON) require 'ripper' +# Ensure the module is already defined. This is mostly so that we don't have to +# indent the Parser definition one more time. module Prettier end @@ -194,11 +196,10 @@ def find_next_statement_start(position) position end - # A BEGIN node is a parser event that represents the use of the BEGIN - # keyword, which hooks into the lifecycle of the interpreter. It's a bit - # of a legacy from the stream operating days, and gets its inspiration - # from tools like awk. Whatever is inside the "block" will get executed - # when the program starts. The syntax looks like the following: + # BEGIN is a parser event that represents the use of the BEGIN keyword, which + # hooks into the lifecycle of the interpreter. Whatever is inside the "block" + # will get executed when the program starts. The syntax looks like the + # following: # # BEGIN { # # execute stuff here @@ -218,6 +219,14 @@ def on_BEGIN(stmts) ) end + # CHAR is a parser event that represents a single codepoint in the script + # encoding. For example: + # + # ?a + # + # is a representation of the string literal "a". You can use control + # characters with this as well, as in ?\C-a. + # def on_CHAR(value) start_line = lineno start_char = char_pos @@ -235,11 +244,10 @@ def on_CHAR(value) node end - # A END node is a parser event that represents the use of the END keyword, - # which hooks into the lifecycle of the interpreter. It's a bit of a - # legacy from the stream operating days, and gets its inspiration from - # tools like awk. Whatever is inside the "block" will get executed when - # the program ends. The syntax looks like the following: + # END is a parser event that represents the use of the END keyword, which + # hooks into the lifecycle of the interpreter. Whatever is inside the "block" + # will get executed when the program ends. The syntax looks like the + # following: # # END { # # execute stuff here @@ -259,13 +267,15 @@ def on_END(stmts) ) end - # Handles __END__ syntax, which allows individual scripts to keep content - # after the main ruby code that can be read through DATA. It looks like: + # __END__ is a scanner event that represents __END__ syntax, which allows + # individual scripts to keep content after the main ruby code that can be read + # through the DATA constant. It looks like: # - # foo.bar + # puts DATA.read + # + # __END__ + # some other content that isn't executed by the program # - # __END__ - # some other content that isn't normally read by ripper def on___end__(value) start_line = lineno start_char = char_pos @@ -280,11 +290,11 @@ def on___end__(value) } end - # alias is a parser event that represents when you're using the alias - # keyword with regular arguments. This can be either symbol literals or - # bare words. You can optionally use parentheses with this keyword, so we - # either track the location information based on those or the final - # argument to the alias method. + # alias is a parser event that represents the use of the alias keyword with + # regular arguments. This can be either symbol literals or bare words. You can + # optionally use parentheses with this keyword, so we either track the + # location information based on those or the final argument to the alias + # method. def on_alias(left, right) beging = find_scanner_event(:@kw, 'alias') @@ -301,7 +311,7 @@ def on_alias(left, right) } end - # aref nodes are when you're pulling a value out of a collection at a + # aref is a parser event when you're pulling a value out of a collection at a # specific index. Put another way, it's any time you're calling the method # #[]. As an example: # @@ -345,8 +355,17 @@ def on_aref_field(collection, index) } end - # arg_paren is a parser event that represents wrapping arguments to a - # method inside a set of parentheses. + # arg_paren is a parser event that represents wrapping arguments to a method + # inside a set of parentheses. For example, in the follow snippet: + # + # foo(bar) + # + # there would be an arg_paren node around the args_add_block node that + # represents the set of arguments being sent to the foo method. The args child + # node can be nil if no arguments were passed, as in: + # + # foo() + # def on_arg_paren(args) beging = find_scanner_event(:@lparen) rparen = find_scanner_event(:@rparen) @@ -366,12 +385,15 @@ def on_arg_paren(args) } end - # args_add is a parser event that represents a single argument inside a - # list of arguments to any method call or an array. It accepts as - # arguments the parent args node as well as an arg which can be anything - # that could be passed as an argument. + # args_add is a parser event that represents a single argument inside a list + # of arguments to any method call or an array. It accepts as arguments the + # parent args node as well as an arg which can be anything that could be + # passed as an argument. def on_args_add(args, arg) if args[:body].empty? + # If this is the first argument being passed into the list of arguments, + # then we're going to use the bounds of the argument to override the + # parent node's location since this will be more accurate. arg.merge(type: :args, body: [arg]) else args.merge!(body: args[:body] << arg, el: arg[:el], ec: arg[:ec]) @@ -380,7 +402,7 @@ def on_args_add(args, arg) # args_add_block is a parser event that represents a list of arguments and # potentially a block argument. If no block is passed, then the second - # argument will be false. + # argument will be the literal false. def on_args_add_block(args, block) ending = block || args @@ -526,6 +548,8 @@ def on_assoclist_from_args(assocs) } end + # backref is a scanner event that represents a global variable referencing a + # matched value. It comes in the form of a $ followed by a positive integer. def on_backref(value) start_line = lineno start_char = char_pos @@ -543,6 +567,9 @@ def on_backref(value) node end + # backtick is a scanner event that represents the use of the ` operator. It's + # usually found being used for an xstring, but could also be found as the name + # of a method being defined. def on_backtick(value) start_line = lineno start_char = char_pos @@ -797,6 +824,7 @@ def on_class(const, superclass, bodystmt) } end + # comma is a scanner event that represents the use of the comma operator. def on_comma(value) start_line = lineno start_char = char_pos @@ -870,6 +898,11 @@ def on_comment(value) } end + # const is a scanner event that represents a literal value that _looks like_ + # a constant. This could actually be a reference to a constant. It could also + # be something that looks like a constant in another context, as in a method + # call to a capitalized method, a symbol that starts with a capital letter, + # etc. def on_const(value) start_line = lineno start_char = char_pos @@ -931,6 +964,7 @@ def on_const_ref(const) const.merge(type: :const_ref, body: [const]) end + # cvar is a scanner event that represents the use of a class variable. def on_cvar(value) start_line = lineno start_char = char_pos @@ -1255,6 +1289,8 @@ def on_embdoc_end(value) @embdoc = nil end + # embexpr_beg is a scanner event that represents using interpolation inside of + # a string, xstring, heredoc, or regexp. Its value is the string literal "#{". def on_embexpr_beg(value) start_line = lineno start_char = char_pos @@ -1272,6 +1308,9 @@ def on_embexpr_beg(value) node end + # embexpr_end is a scanner event that represents the end of an interpolated + # expression in a string, xstring, heredoc, or regexp. Its value is the string + # literal "}". def on_embexpr_end(value) start_line = lineno start_char = char_pos @@ -1289,6 +1328,16 @@ def on_embexpr_end(value) node end + # embvar is a scanner event that represents the use of shorthand interpolation + # for an instance, class, or global variable into a string, xstring, heredoc, + # or regexp. Its value is the string literal "#". For example, in the + # following snippet: + # + # "#@foo" + # + # the embvar would be triggered by the "#", then an ivar event for the @foo + # instance variable. That would all get bound up into a string_dvar node in + # the final AST. def on_embvar(value) start_line = lineno start_char = char_pos @@ -1362,6 +1411,7 @@ def on_field(left, oper, right) } end + # float is a scanner event that represents a floating point value literal. def on_float(value) start_line = lineno start_char = char_pos @@ -1422,6 +1472,7 @@ def on_for(ident, enum, stmts) } end + # gvar is a scanner event that represents a global variable literal. def on_gvar(value) start_line = lineno start_char = char_pos @@ -1513,7 +1564,10 @@ def on_hshptn(const, kw, kwrest) } end - # Like comments, we need to force the encoding here so JSON doesn't break. + # ident is a scanner event that represents an identifier anywhere in code. It + # can actually represent a whole bunch of stuff, depending on where it is in + # the AST. Like comments, we need to force the encoding here so JSON doesn't + # break. def on_ident(value) start_line = lineno start_char = char_pos @@ -1587,14 +1641,30 @@ def on_if_mod(predicate, statement) # We don't need to track this event in the AST that we're generating, so we're # not going to define an explicit handler for it. # - # def on_ignored_nl(value) - # value - # end + # def on_ignored_nl(value) + # value + # end - def on_ignored_sp(value) - value - end + # ignored_sp is a scanner event that represents the space before the content + # of each line of a squiggly heredoc that will be removed from the string + # before it gets transformed into a string literal. For example, in the + # following snippet: + # + # <<~HERE + # foo + # bar + # HERE + # + # You would have two ignored_sp events, the first with two spaces and the + # second with four. We don't need to track this event in the AST that we're + # generating, so we're not going to define an explicit handler for it. + # + # def on_ignored_sp(value) + # value + # end + # imaginary is a scanner event that represents an imaginary number literal. + # They become instances of the Complex class. def on_imaginary(value) start_line = lineno start_char = char_pos @@ -1632,6 +1702,7 @@ def on_in(pattern, stmts, consequent) ) end + # int is a scanner event the represents a number literal. def on_int(value) start_line = lineno start_char = char_pos @@ -1649,6 +1720,7 @@ def on_int(value) node end + # ivar is a scanner event the represents an instance variable literal. def on_ivar(value) start_line = lineno start_char = char_pos @@ -1666,6 +1738,8 @@ def on_ivar(value) node end + # kw is a scanner event the represents the use of a keyword. It can be + # anywhere in the AST, so you end up seeing it quite a lot. def on_kw(value) start_line = lineno start_char = char_pos @@ -1697,6 +1771,20 @@ def on_kwrest_param(ident) ) end + # label is a scanner event that represents the use of an identifier to + # associate with an object. You can find it in a hash key, as in: + # + # { foo: bar } + # + # in this case "foo:" would be the body of the label. You can also find it in + # pattern matching, as in: + # + # case foo + # in bar: + # bar + # end + # + # in this case "bar:" would be the body of the label. def on_label(value) start_line = lineno start_char = char_pos @@ -1714,6 +1802,13 @@ def on_label(value) node end + # label_end is a scanner event that represents the end of a dynamic symbol. If + # for example you had the following hash: + # + # { "foo": bar } + # + # then the string "\":" would be the value of this label_end. It's useful for + # determining the type of quote being used by the label. def on_label_end(value) start_line = lineno start_char = char_pos @@ -1761,6 +1856,7 @@ def on_lambda(params, stmts) } end + # lbrace is a scanner event representing the use of a left brace, i.e., "{". def on_lbrace(value) start_line = lineno start_char = char_pos @@ -1778,6 +1874,8 @@ def on_lbrace(value) node end + # lbracket is a scanner event representing the use of a left bracket, i.e., + # "[". def on_lbracket(value) start_line = lineno start_char = char_pos @@ -1795,6 +1893,8 @@ def on_lbracket(value) node end + # lparen is a scanner event representing the use of a left parenthesis, i.e., + # "(". def on_lparen(value) start_line = lineno start_char = char_pos @@ -2042,20 +2142,21 @@ def on_next(args_add_block) ) end - def on_nl(value) - start_line = lineno - start_char = char_pos - - { - type: :@nl, - body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size - } - end + # nl is a scanner event representing a newline in the source. As you can + # imagine, it will typically get triggered quite a few times. We don't need to + # track this event in the AST that we're generating, so we're not going to + # define an explicit handler for it. + # + # def on_nl(value) + # value + # end + # op is a scanner event representing an operator literal in the source. For + # example, in the following snippet: + # + # 1 + 2 + # + # the + sign is an operator. def on_op(value) start_line = lineno start_char = char_pos @@ -2149,6 +2250,8 @@ def on_parse_error(error, *) alias on_class_name_error on_parse_error alias on_param_error on_parse_error + # period is a scanner event that represents the use of the period operator. It + # is usually found in method calls. def on_period(value) start_line = lineno start_char = char_pos @@ -2176,6 +2279,12 @@ def on_program(stmts) range.merge(type: :program, body: [stmts], comments: @comments) end + # qsymbols_beg is a scanner event that represents the beginning of a symbol + # literal array. For example in the following snippet: + # + # %i[foo bar baz] + # + # a qsymbols_beg would be triggered with the value of "%i[". def on_qsymbols_beg(value) start_line = lineno start_char = char_pos @@ -2212,6 +2321,12 @@ def on_qsymbols_add(qsymbols, tstring_content) ) end + # qwords_beg is a scanner event that represents the beginning of a word + # literal array. For example in the following snippet: + # + # %w[foo bar baz] + # + # a qwords_beg would be triggered with the value of "%w[". def on_qwords_beg(value) start_line = lineno start_char = char_pos @@ -2248,6 +2363,7 @@ def on_qwords_add(qwords, tstring_content) ) end + # rational is a scanner event that represents a rational number literal. def on_rational(value) start_line = lineno start_char = char_pos @@ -2265,6 +2381,8 @@ def on_rational(value) node end + # rbrace is a scanner event that represents the use of a right brace, i.e., + # "}". def on_rbrace(value) start_line = lineno start_char = char_pos @@ -2282,6 +2400,8 @@ def on_rbrace(value) node end + # rbracket is a scanner event that represents the use of a right bracket, + # i.e., "]". def on_rbracket(value) start_line = lineno start_char = char_pos @@ -2305,10 +2425,11 @@ def on_redo find_scanner_event(:@kw, 'redo').merge!(type: :redo) end - # regexp_add is a parser event that represents a piece of a regular + # regexp_add is a parser event that represents a piece of a regular expression # body. It accepts as arguments the parent regexp node as well as a - # tstring_content scanner event representing string content or a - # string_embexpr parser event representing interpolated content. + # tstring_content scanner event representing string content, a + # string_embexpr parser event representing interpolated content, or a + # string_dvar parser event representing an interpolated variable. def on_regexp_add(regexp, piece) regexp.merge!( body: regexp[:body] << piece, @@ -2317,6 +2438,9 @@ def on_regexp_add(regexp, piece) ) end + # regexp_beg is a scanner event that represents the start of a regular + # expression. It can take a couple of forms since regexp can either start with + # a forward slash or a %r. def on_regexp_beg(value) start_line = lineno start_char = char_pos @@ -2334,6 +2458,9 @@ def on_regexp_beg(value) node end + # regexp_end is a scanner event that represents the end of a regular + # expression. It will contain the closing brace or slash, as well as any flags + # being passed to the regexp. def on_regexp_end(value) start_line = lineno start_char = char_pos @@ -2482,6 +2609,8 @@ def on_return0 find_scanner_event(:@kw, 'return').merge!(type: :return0) end + # rparen is a scanner event that represents the use of a right parenthesis, + # i.e., ")". def on_rparen(value) start_line = lineno start_char = char_pos @@ -2525,33 +2654,22 @@ def on_sclass(target, bodystmt) } end - def on_semicolon(value) - start_line = lineno - start_char = char_pos - - { - type: :@semicolon, - body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size - } - end - - def on_sp(value) - start_line = lineno - start_char = char_pos + # semicolon is a scanner event that represents the use of a semicolon in the + # source. We don't need to track this event in the AST that we're generating, + # so we're not going to define an explicit handler for it. + # + # def on_semicolon(value) + # value + # end - { - type: :@sp, - body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size - } - end + # sp is a scanner event that represents the use of a space in the source. As + # you can imagine, this event gets triggered quite often. We don't need to + # track this event in the AST that we're generating, so we're not going to + # define an explicit handler for it. + # + # def on_sp(value) + # value + # end # stmts_add is a parser event that represents a single statement inside a # list of statements within any lexical block. It accepts as arguments the @@ -2737,6 +2855,9 @@ def on_super(contents) ) end + # symbeg is a scanner event that represents the beginning of a symbol literal. + # In most cases it will contain just ":" as in the value, but if its a dynamic + # symbol being defined it will contain ":'" or ":\"". def on_symbeg(value) start_line = lineno start_char = char_pos @@ -2757,13 +2878,10 @@ def on_symbeg(value) # A symbol is a parser event that immediately descends from a symbol # literal and contains an ident representing the contents of the symbol. def on_symbol(ident) - # What the heck is this here for you ask!? Turns out when Ripper is lexing - # source text, it turns symbols into keywords if their contents match, which - # will mess up the location information of all of our other nodes. - # - # So for example instead of { type: :@ident, body: "class" } you would - # instead get { type: :@kw, body: "class" } which is all kinds of - # problematic. + # When ripper is lexing source text, it turns symbols into keywords if their + # contents match, which will mess up the location information of all of our + # other nodes. So for example instead of { type: :@ident, body: "class" } + # you would instead get { type: :@kw, body: "class" }. # # In order to take care of this, we explicitly delete this scanner event # from the stack to make sure it doesn't screw things up. @@ -2785,6 +2903,12 @@ def on_symbol_literal(contents) end end + # symbols_beg is a scanner event that represents the start of a symbol literal + # array with interpolation. For example, in the following snippet: + # + # %I[foo bar baz] + # + # symbols_beg would be triggered with the value of "%I". def on_symbols_beg(value) start_line = lineno start_char = char_pos @@ -2822,6 +2946,8 @@ def on_symbols_add(symbols, word_add) ) end + # tlambda is a scanner event that represents the beginning of a lambda + # literal. It always has the value of "->". def on_tlambda(value) start_line = lineno start_char = char_pos @@ -2839,6 +2965,8 @@ def on_tlambda(value) node end + # tlambeg is a scanner event that represents the beginning of the body of a + # lambda literal. It always has the value of "{". def on_tlambeg(value) start_line = lineno start_char = char_pos @@ -2888,6 +3016,9 @@ def on_top_const_ref(const) ) end + # tstring_beg is a scanner event that represents the beginning of a string + # literal. It can represent either of the quotes for its value, or it can have + # a %q/%Q with delimiter. def on_tstring_beg(value) start_line = lineno start_char = char_pos @@ -2905,7 +3036,9 @@ def on_tstring_beg(value) node end - # Like comments, we need to force the encoding here so JSON doesn't break. + # tstring_content is a scanner event that represents plain characters inside + # of a string, heredoc, xstring, or regexp. Like comments, we need to force + # the encoding here so JSON doesn't break. def on_tstring_content(value) start_line = lineno start_char = char_pos @@ -2920,6 +3053,9 @@ def on_tstring_content(value) } end + # tstring_end is a scanner event that represents the end of a string literal. + # It can either contain quotes, or it can have the end delimiter of a %q/%Q + # literal. def on_tstring_end(value) start_line = lineno start_char = char_pos @@ -3234,6 +3370,12 @@ def on_word_add(word, piece) end end + # words_beg is a scanner event that represents the start of a word literal + # array with interpolation. For example, in the following snippet: + # + # %W[foo bar baz] + # + # words_beg would be triggered with the value of "%W". def on_words_beg(value) start_line = lineno start_char = char_pos @@ -3251,19 +3393,24 @@ def on_words_beg(value) node end - def on_words_sep(value) - start_line = lineno - start_char = char_pos - - { - type: :@words_sep, - body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size - } - end + # words_sep is a scanner event that represents the separate between two words + # inside of a word literal array. It contains any amount of whitespace + # characters that are used to delimit the words. For example, + # + # %w[ + # foo + # bar + # baz + # ] + # + # in the snippet above there would be two words_sep events triggered, one + # between foo and bar and one between bar and baz. We don't need to track this + # event in the AST that we're generating, so we're not going to define an + # explicit handler for it. + # + # def on_words_sep(value) + # value + # end # words_new is a parser event that represents the beginning of a string # literal array that accepts interpolation, like %W[one #{two} three]. It From d225b32d153606e622610df21ab84840fdbebac2 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 27 Sep 2021 12:33:56 -0400 Subject: [PATCH 262/785] Remove executability of the ruby parser --- src/ruby/parser.rb | 73 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 1 deletion(-) mode change 100755 => 100644 src/ruby/parser.rb diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb old mode 100755 new mode 100644 index 29565f79..de1cb27d --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -1,4 +1,4 @@ -#!/usr/bin/env ruby +# frozen_string_literal: true # We implement our own version checking here instead of using Gem::Version so # that we can use the --disable-gems flag. @@ -99,6 +99,7 @@ def initialize(source, *args) @comments = [] @embdoc = nil @__end__ = nil + @magic_comment = nil @heredocs = [] @@ -355,6 +356,20 @@ def on_aref_field(collection, index) } end + # arg_ambiguous is a parser event that represents when the parser sees an + # argument as ambiguous. For example, in the following snippet: + # + # foo // + # + # the question becomes if the forward slash is being used as a division + # operation or if it's the start of a regular expression. We don't need to + # track this event in the AST that we're generating, so we're not going to + # define an explicit handler for it. + # + # def on_arg_ambiguous(value) + # value + # end + # arg_paren is a parser event that represents wrapping arguments to a method # inside a set of parentheses. For example, in the follow snippet: # @@ -884,6 +899,16 @@ def on_command_call(receiver, oper, ident, args) # This will break everything, so we need to force the encoding back into # UTF-8 so that the JSON library won't break. def on_comment(value) + # If we already had special handling of a magic comment, then we can just + # skip and return the value of that node. + if @magic_comment + comment = @magic_comment + @magic_comment = nil + + @comments << comment + return comment + end + start_line = lineno start_char = char_pos @@ -1912,6 +1937,24 @@ def on_lparen(value) node end + # magic_comment is a scanner event that represents the use of a pragma at the + # beginning of the file. Usually it will inside something like + # frozen_string_literal (the key) with a value of true (the value). Both + # children come is a string literals. + def on_magic_comment(key, value) + start_line = lineno + start_char = char_pos + + @magic_comment = { + type: :@comment, + value: " #{key}: #{value}", + sl: start_line, + el: start_line, + sc: start_char, + ec: start_char + @line_counts[start_line][-1] + } + end + # massign is a parser event that is a parent node of any kind of multiple # assignment. This includes splitting out variables on the left like: # @@ -2151,6 +2194,20 @@ def on_next(args_add_block) # value # end + # nokw_param is a parser event that represents the use of the special 2.7+ + # syntax to indicate a method should take no additional keyword arguments. For + # example in the following snippet: + # + # def foo(**nil) end + # + # this is saying that foo should not accept any keyword arguments. Its value + # is always nil. We don't need to track this event in the AST that we're + # generating, so we're not going to define an explicit handler for it. + # + # def on_nokw_param(value) + # value + # end + # op is a scanner event representing an operator literal in the source. For # example, in the following snippet: # @@ -2187,6 +2244,20 @@ def on_opassign(left, oper, right) ) end + # operator_ambiguous is a parser event that represents when the parsers sees + # an operator as ambiguous. For example, in the following snippet: + # + # foo %[] + # + # the question becomes if the percent sign is being used as a method call or + # if it's the start of a string literal. We don't need to track this event in + # the AST that we're generating, so we're not going to define an explicit + # handler for it. + # + # def on_operator_ambiguous(value) + # value + # end + # params is a parser event that represents defining parameters on a # method. They have a somewhat interesting structure in that they are an # array of arrays where the position in the top-level array indicates the From ddd9652d129f7900554ace24c68c61f9796e22cf Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 27 Sep 2021 12:37:22 -0400 Subject: [PATCH 263/785] Document magic_comment usage --- src/ruby/parser.rb | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index de1cb27d..299b3aaa 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -893,28 +893,41 @@ def on_command_call(receiver, oper, ident, args) # them back into the final representation. Comments come in including # their starting pound sign and the newline at the end, so we also chop # those off. - # - # If there is an encoding magic comment at the top of the file, ripper - # will actually change into that encoding for the storage of the string. - # This will break everything, so we need to force the encoding back into - # UTF-8 so that the JSON library won't break. def on_comment(value) + # If there is an encoding magic comment at the top of the file, ripper + # will actually change into that encoding for the storage of the string. + # This will break everything when we attempt to print as JSON, so we need to + # force the encoding back into UTF-8 so that it won't break. + body = value[1..-1].chomp.force_encoding('UTF-8') + + start_line = lineno + start_char = char_pos + # If we already had special handling of a magic comment, then we can just # skip and return the value of that node. if @magic_comment comment = @magic_comment @magic_comment = nil - @comments << comment + # At the moment, merging in the value of the string being passed into + # here. In the next major version I'd like to remove this and just use the + # value of the magic comment. At the moment though that would change + # comments like: + # + # # -*- encoding: UTF-8 -*- + # + # into + # + # # encoding: UTF-8 + # + # so need to wait for a major version to do that. + @comments << comment.merge(value: body, ec: start_char + value.length - 1) return comment end - - start_line = lineno - start_char = char_pos @comments << { type: :@comment, - value: value[1..-1].chomp.force_encoding('UTF-8'), + value: body, inline: value.strip != lines[lineno - 1], sl: start_line, el: start_line, From 79c3f421a35ed100be8e76cec612f37a1ed5e758 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 27 Sep 2021 12:52:26 -0400 Subject: [PATCH 264/785] Even more documentation --- src/ruby/parser.rb | 69 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 51 insertions(+), 18 deletions(-) diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 299b3aaa..39fcfa00 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -93,23 +93,64 @@ def pretty_print(q) def initialize(source, *args) super(source, *args) + # We keep the source around so that we can refer back to it when we're + # generating the AST. Sometimes it's easier to just reference the source + # string when you want to check if it contains a certain character, for + # example. @source = source + + # Similarly, we keep the lines of the source string around to be able to + # check if certain lines contain certain characters. For example, we'll use + # this to generate the content that goes after the __END__ keyword. Or we'll + # use this to check if a comment has other content on its line. @lines = source.split("\n") + # This is the full set of comments that have been found by the parser. It's + # a running list. At the end of every block of statements, they will go in + # and attempt to grab any comments that are on their own line and turn them + # into regular statements. So at the end of parsing the only comments left + # in here will be comments on lines that also contain code. @comments = [] + + # This is the current embdoc (comments that start with =begin and end with + # =end). Since they can't be nested, there's no need for a stack here, as + # there can only be one active. These end up getting dumped into the + # comments list before getting picked up by the statements that surround + # them. @embdoc = nil + + # This is an optional node that can be present if the __END__ keyword is + # used in the file. In that case, this will represent the content after that + # keyword. @__end__ = nil + + # Magic comments are a certain kind of comment that can impact the way the + # file is parsed (encoding/string frozen default/etc.). These scanner events + # are immediately followed by a comment scanner event, so we only need the + # one variable to set/unset it immediately. @magic_comment = nil + # Heredocs can actually be nested together if you're using interpolation, so + # this is a stack of heredoc nodes that are currently being created. When we + # get to the scanner event that finishes off a heredoc node, we pop the top + # one off. If there are others surrounding it, then the body events will now + # be added to the correct nodes. @heredocs = [] + # This is a running list of scanner events that have fired. It's useful + # mostly for maintaining location information. For example, if you're inside + # the handle of a def event, then in order to determine where the AST node + # started, you need to look backward in the scanner events to find a def + # keyword. Most of the time, when a parser event consumes one of these + # events, it will be deleted from the list. So ideally, this list stays + # pretty short over the course of parsing a source string. @scanner_events = [] - @line_counts = [] # Here we're going to build up a list of SingleByteString or MultiByteString # objects. They're each going to represent a string in the source. They are # used by the `char_pos` method to determine where we are in the source # string. + @line_counts = [] last_index = 0 @source.lines.each do |line| @@ -292,7 +333,7 @@ def on___end__(value) end # alias is a parser event that represents the use of the alias keyword with - # regular arguments. This can be either symbol literals or bare words. You can + # regular arguments. This can be either symbol literals or bare words. You can # optionally use parentheses with this keyword, so we either track the # location information based on those or the final argument to the alias # method. @@ -912,15 +953,9 @@ def on_comment(value) # At the moment, merging in the value of the string being passed into # here. In the next major version I'd like to remove this and just use the # value of the magic comment. At the moment though that would change - # comments like: - # - # # -*- encoding: UTF-8 -*- - # - # into - # - # # encoding: UTF-8 - # - # so need to wait for a major version to do that. + # comments like -*- encoding: UTF-8 -*- into encoding: UTF-8 so need to + + # wait for a major version to do that. @comments << comment.merge(value: body, ec: start_char + value.length - 1) return comment end @@ -977,10 +1012,8 @@ def on_const_path_field(left, const) # A const_path_ref is a parser event that is a very similar to # const_path_field except that it is not involved in an assignment. It - # looks like the following example: - # - # foo::X - # + # looks like the following example: foo::Bar, where left is foo and const is + # Bar. def on_const_path_ref(left, const) { type: :const_path_ref, @@ -1462,7 +1495,7 @@ def on_float(value) sc: start_char, ec: start_char + value.size } - + scanner_events << node node end @@ -1618,7 +1651,7 @@ def on_ident(value) sc: start_char, ec: start_char + value.size } - + scanner_events << node node end @@ -1813,7 +1846,7 @@ def on_kwrest_param(ident) # associate with an object. You can find it in a hash key, as in: # # { foo: bar } - # + # # in this case "foo:" would be the body of the label. You can also find it in # pattern matching, as in: # From 65d900474c56d6df3cfbef463c630fe05534e4ae Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 27 Sep 2021 13:34:34 -0400 Subject: [PATCH 265/785] Fix for #926 --- CHANGELOG.md | 1 + src/ruby/parser.rb | 40 +++++++++++++++++++++++++++------------- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38a0a22f..f1dc05a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Changed - [#958](https://github.com/prettier/plugin-ruby/issues/958) - mharris-figma, kddnewton - Handle optional `do` keyword in `for` loop expressions. +- [#926](https://github.com/prettier/plugin-ruby/issues/926) - jscheid, kddnewton - Better error handling in case certain expected keywords or operators are missing. ## [1.6.1] - 2021-06-30 diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 39fcfa00..295fdf4c 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -84,6 +84,18 @@ def pretty_print(q) end end + # A special parser error so that we can get nice syntax displays on the error + # message when prettier prints out the results. + class ParserError < StandardError + attr_reader :lineno, :column + + def initialize(error, lineno, column) + super(error) + @lineno = lineno + @column = column + end + end + attr_reader :source, :lines, :scanner_events # This is an attr_accessor so Stmts objects can grab comments out of this @@ -201,7 +213,21 @@ def find_scanner_event(type, body = :any, consume: true) (body == :any || (scanner_event[:body] == body)) end - consume ? scanner_events.delete_at(index) : (index && scanner_events[index]) + if consume + # If we're expecting to be able to find a scanner event and consume it, + # but can't actually find it, then we need to raise an error. This is + # _usually_ caused by a syntax error in the source that we're printing. It + # could also be caused by accidentally attempting to consume a scanner + # event twice by two different parser event handlers. + unless index + message = "Cannot find expected #{body == :any ? type : body}" + raise ParserError.new(message, lineno, column) + end + + scanner_events.delete_at(index) + elsif index + scanner_events[index] + end end # A helper function to find a :: operator. We do special handling instead of @@ -2345,18 +2371,6 @@ def on_paren(contents) ) end - # A special parser error so that we can get nice syntax displays on the error - # message when prettier prints out the results. - class ParserError < StandardError - attr_reader :lineno, :column - - def initialize(error, lineno, column) - super(error) - @lineno = lineno - @column = column - end - end - # If we encounter a parse error, just immediately bail out so that our runner # can catch it. def on_parse_error(error, *) From f1a347494692268ad21cac37097b94aa864b60d0 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 27 Sep 2021 14:09:15 -0400 Subject: [PATCH 266/785] Fix for #819 --- CHANGELOG.md | 1 + src/ruby/nodes/params.ts | 25 ++++++++++++++++++++++--- src/ruby/nodes/statements.ts | 9 +++++++-- src/ruby/parser.rb | 20 +++++++++++++------- src/ruby/printer.ts | 2 ++ src/types/ruby.ts | 11 ++++++----- test/js/ruby/nodes/method.test.ts | 12 ++++++++++++ 7 files changed, 63 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1dc05a3..667d7921 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#958](https://github.com/prettier/plugin-ruby/issues/958) - mharris-figma, kddnewton - Handle optional `do` keyword in `for` loop expressions. - [#926](https://github.com/prettier/plugin-ruby/issues/926) - jscheid, kddnewton - Better error handling in case certain expected keywords or operators are missing. +- [#819](https://github.com/prettier/plugin-ruby/issues/819) - coisnepe, kddnewton - Ensure that comments placed immediately after the left parenthesis of a method definition are not moved into the body of the methods. ## [1.6.1] - 2021-06-30 diff --git a/src/ruby/nodes/params.ts b/src/ruby/nodes/params.ts index 3689ed11..247ee7a7 100644 --- a/src/ruby/nodes/params.ts +++ b/src/ruby/nodes/params.ts @@ -2,7 +2,7 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; import { literal } from "../../utils"; -const { group, join, indent, line, softline } = prettier; +const { group, hardline, join, indent, line, lineSuffix, softline } = prettier; function printRestParamSymbol( symbol: string @@ -87,8 +87,27 @@ export const printParams: Plugin.Printer = (path, opts, print) => { // If the parent node is a paren then we skipped printing the parentheses so // that we could handle them here and get nicer formatting. - if (["lambda", "paren"].includes(path.getParentNode().type)) { - return group(["(", indent([softline, ...contents]), softline, ")"]); + const parentNode = path.getParentNode(); + + if (["lambda", "paren"].includes(parentNode.type)) { + const parts: Plugin.Doc[] = ["("]; + + // If the parent node is a paren and the paren has comments that are + // attached to the left paren, then we need to print those out explicitly + // here. + if (parentNode.type === "paren" && parentNode.lparen.comments) { + const comments: Plugin.Doc[] = []; + + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + (parentNode as Ruby.Paren).lparen.comments!.forEach((comment, index) => { + comment.printed = true; + comments.push(lineSuffix(`${index === 0 ? " " : ""}#${comment.value}`)); + }); + + parts.push(join(hardline, comments)); + } + + return group([...parts, indent([softline, ...contents]), softline, ")"]); } return group(contents); diff --git a/src/ruby/nodes/statements.ts b/src/ruby/nodes/statements.ts index 8e6bda35..a5ec65e5 100644 --- a/src/ruby/nodes/statements.ts +++ b/src/ruby/nodes/statements.ts @@ -55,7 +55,7 @@ export const printParen: Plugin.Printer = (path, opts, print) => { const contentNode = path.getValue().body[0]; if (!contentNode) { - return "()"; + return [path.call(print, "lparen"), ")"]; } let contentDoc = path.call(print, "body", 0); @@ -72,7 +72,12 @@ export const printParen: Plugin.Printer = (path, opts, print) => { contentDoc = join([",", line], contentDoc); } - return group(["(", indent([softline, contentDoc]), softline, ")"]); + return group([ + path.call(print, "lparen"), + indent([softline, contentDoc]), + softline, + ")" + ]); }; export const printEndContent: Plugin.Printer = (path) => { diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 295fdf4c..cb5afbf5 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -2356,19 +2356,25 @@ def on_params(*types) # anywhere in a Ruby program. It accepts as arguments the contents, which # can be either params or statements. def on_paren(contents) - beging = find_scanner_event(:@lparen) - ending = find_scanner_event(:@rparen) + lparen = find_scanner_event(:@lparen) + rparen = find_scanner_event(:@rparen) if contents && contents[:type] == :params - contents.merge!(sc: beging[:ec], ec: ending[:sc]) + contents.merge!( + sc: find_next_statement_start(lparen[:ec]), + ec: rparen[:sc] + ) end - beging.merge!( + { type: :paren, + lparen: lparen, body: [contents], - el: ending[:el], - ec: ending[:ec] - ) + sl: lparen[:sl], + sc: lparen[:sc], + el: rparen[:el], + ec: rparen[:ec] + } end # If we encounter a parse error, just immediately bail out so that our runner diff --git a/src/ruby/printer.ts b/src/ruby/printer.ts index 4a405b76..d88ec3e2 100644 --- a/src/ruby/printer.ts +++ b/src/ruby/printer.ts @@ -77,6 +77,8 @@ const printer: Plugin.PrinterConfig = { return parts; } + case "paren": + return [node.lparen, node.body[0]]; default: { if (Array.isArray(node.body)) { return node.body.filter( diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 0538afee..7dfec51d 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -29,10 +29,10 @@ export type Comment = UndecoratedComment & CommentDecorations; // are present in ripper include: // // comma, embdoc, embdoc_beg, embdoc_end, embexpr_beg, embexpr_end, embvar, -// heredoc_end, ignored_nl, ignored_sp, label_end, lbracket, lparen, nl, -// qsymbols_beg, qwords_beg, rbrace, rbracket, regexp_beg, regexp_end, rparen, -// semicolon, sp, symbbeg, symbols_beg, tlambda, tlambeg, tstring_beg, -// tstring_nd, words_beg, words_sep +// heredoc_end, ignored_nl, ignored_sp, label_end, lbracket, nl, qsymbols_beg, +// qwords_beg, rbrace, rbracket, regexp_beg, regexp_end, rparen, semicolon, sp, +// symbbeg, symbols_beg, tlambda, tlambeg, tstring_beg, tstring_nd, words_beg, +// words_sep // export type Backref = ScannerEvent<"backref">; export type Backtick = ScannerEvent<"backtick">; @@ -50,6 +50,7 @@ export type IVar = ScannerEvent<"ivar">; export type Keyword = ScannerEvent<"kw">; export type Label = ScannerEvent<"label">; export type Lbrace = ScannerEvent<"lbrace">; +export type Lparen = ScannerEvent<"lparen">; export type Op = ScannerEvent<"op">; export type Period = ScannerEvent<"period">; export type Rational = ScannerEvent<"rational">; @@ -203,7 +204,7 @@ export type Defined = ParserEvent<"defined", { body: [AnyNode] }>; export type Dot2 = ParserEvent<"dot2", { body: [AnyNode, null] | [null, AnyNode] | [AnyNode, AnyNode] }>; export type Dot3 = ParserEvent<"dot3", { body: [AnyNode, null] | [null, AnyNode] | [AnyNode, AnyNode] }>; export type END = ParserEvent<"END", { body: [Lbrace, Stmts] }>; -export type Paren = ParserEvent<"paren", { body: [AnyNode] }>; +export type Paren = ParserEvent<"paren", { body: [AnyNode], lparen: Lparen }>; export type TopConstRef = ParserEvent<"top_const_ref", { body: [Const] }>; export type Unary = ParserEvent<"unary", { body: [AnyNode], oper: string, paren: boolean | undefined }>; export type VarRef = ParserEvent<"var_ref", { body: [Const | CVar | GVar | Identifier | IVar | Keyword] }>; diff --git a/test/js/ruby/nodes/method.test.ts b/test/js/ruby/nodes/method.test.ts index 60b3777d..7a819629 100644 --- a/test/js/ruby/nodes/method.test.ts +++ b/test/js/ruby/nodes/method.test.ts @@ -81,6 +81,18 @@ describe("method", () => { return expect(content).toChangeFormat(expected); }); + test("with comments on method definition", () => { + const content = ruby(` + def foo( # bar + ${long}: + ) + ${long} + end + `); + + return expect(content).toMatchFormat(); + }); + test("with comments on params", () => { const content = ruby(` def method( From 709be4adead3c65340b8fcf207ee90c16485d676 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 27 Sep 2021 14:27:32 -0400 Subject: [PATCH 267/785] Fix for #957 --- CHANGELOG.md | 1 + src/rbs/printer.ts | 2 +- src/ruby/parser.ts | 2 +- src/types/plugin.ts | 2 +- test/js/ruby/hasPragma.test.ts | 15 ----------- test/js/ruby/pragma.test.ts | 46 ++++++++++++++++++++++++++++++++++ 6 files changed, 50 insertions(+), 18 deletions(-) delete mode 100644 test/js/ruby/hasPragma.test.ts create mode 100644 test/js/ruby/pragma.test.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 667d7921..d3207b4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#958](https://github.com/prettier/plugin-ruby/issues/958) - mharris-figma, kddnewton - Handle optional `do` keyword in `for` loop expressions. - [#926](https://github.com/prettier/plugin-ruby/issues/926) - jscheid, kddnewton - Better error handling in case certain expected keywords or operators are missing. - [#819](https://github.com/prettier/plugin-ruby/issues/819) - coisnepe, kddnewton - Ensure that comments placed immediately after the left parenthesis of a method definition are not moved into the body of the methods. +- [#957](https://github.com/prettier/plugin-ruby/issues/957) - azz, kddnewton - Make it so that the format pragma does not have to be on the first line of the file. ## [1.6.1] - 2021-06-30 diff --git a/src/rbs/printer.ts b/src/rbs/printer.ts index 4e2156a7..f9277261 100644 --- a/src/rbs/printer.ts +++ b/src/rbs/printer.ts @@ -660,7 +660,7 @@ const printer: Plugin.PrinterConfig = { // This function handles adding the format pragma to a source string. This is // an optional workflow for incremental adoption. insertPragma(text) { - return `# @format\n${text}`; + return `# @format${text[0] === "#" ? "\n" : "\n\n"}${text}`; } }; diff --git a/src/ruby/parser.ts b/src/ruby/parser.ts index 97d4af00..eb374290 100644 --- a/src/ruby/parser.ts +++ b/src/ruby/parser.ts @@ -13,7 +13,7 @@ const parser: Plugin.Parser = { // This function handles checking whether or not the source string has the // pragma for prettier. This is an optional workflow for incremental adoption. hasPragma(text) { - return /^\s*#[^\S\n]*@(format|prettier)\s*(\n|$)/.test(text); + return /^\s*#[^\S\n]*@(?:prettier|format)\s*?(?:\n|$)/m.test(text); }, // This function is critical for comments and cursor support, and is // responsible for returning the index of the character within the source diff --git a/src/types/plugin.ts b/src/types/plugin.ts index 1a7e87e5..b5d15815 100644 --- a/src/types/plugin.ts +++ b/src/types/plugin.ts @@ -82,7 +82,7 @@ export type Path = Omit, keyof StrictPath> & StrictPat // The printer from prettier is missing a couple of keys. We should presumably // upstream this so that it's accurate in all plugins. -export type PrinterConfig = Omit, "print"> & { +export type PrinterConfig = Omit, "insertPragma" | "print"> & Required, "insertPragma">> & { getCommentChildNodes?: (node: any) => any[], isBlockComment?: (comment: any, options: Options) => boolean, print: Printer diff --git a/test/js/ruby/hasPragma.test.ts b/test/js/ruby/hasPragma.test.ts deleted file mode 100644 index 7c4fe8fc..00000000 --- a/test/js/ruby/hasPragma.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -import parser from "../../../src/ruby/parser"; - -describe("hasPragma", () => { - test("checks for @prettier comments", () => { - expect(parser.hasPragma("# @prettier")).toBe(true); - }); - - test("checks for @format comments", () => { - expect(parser.hasPragma("# @format")).toBe(true); - }); - - test("does not check for anything else", () => { - expect(parser.hasPragma("# @foobar")).toBe(false); - }); -}); diff --git a/test/js/ruby/pragma.test.ts b/test/js/ruby/pragma.test.ts new file mode 100644 index 00000000..b763f3e0 --- /dev/null +++ b/test/js/ruby/pragma.test.ts @@ -0,0 +1,46 @@ +import parser from "../../../src/ruby/parser"; +import printer from "../../../src/ruby/printer"; +import { ruby } from "../utils"; + +describe("pragma", () => { + describe("hasPragma", () => { + test("checks for @prettier comments", () => { + expect(parser.hasPragma("# @prettier")).toBe(true); + }); + + test("checks for @format comments", () => { + expect(parser.hasPragma("# @format")).toBe(true); + }); + + test("does not check for anything else", () => { + expect(parser.hasPragma("# @foobar")).toBe(false); + }); + + test("works when the comment is not on the first line", () => { + const content = ruby(` + # typed: true + # @format + `); + + expect(parser.hasPragma(content)).toBe(true); + }); + }); + + describe("insertPragma", () => { + test("inserts normally", () => { + const content = "foo + bar"; + + expect(printer.insertPragma(content)).toEqual(`# @format\n\n${content}`); + }); + + test("inserts when there is already a comment at the top", () => { + const content = ruby(` + # frozen_string_literal: true + + foo + `); + + expect(printer.insertPragma(content)).toEqual(`# @format\n${content}`); + }); + }); +}); From 56c731bc0b94d3ac6a26e2ac5db4d3c051e4171d Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 27 Sep 2021 15:08:35 -0400 Subject: [PATCH 268/785] Fix for #895 --- CHANGELOG.md | 1 + src/haml/printer.ts | 22 ++++++++++++++++++---- test/js/haml/tag.test.ts | 6 ++++++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3207b4c..c3d12396 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#926](https://github.com/prettier/plugin-ruby/issues/926) - jscheid, kddnewton - Better error handling in case certain expected keywords or operators are missing. - [#819](https://github.com/prettier/plugin-ruby/issues/819) - coisnepe, kddnewton - Ensure that comments placed immediately after the left parenthesis of a method definition are not moved into the body of the methods. - [#957](https://github.com/prettier/plugin-ruby/issues/957) - azz, kddnewton - Make it so that the format pragma does not have to be on the first line of the file. +- [#895](https://github.com/prettier/plugin-ruby/issues/895) - rsslldnphy, kddnewton - Ensure quotes are properly escaped in the content of a hash value for HAML attributes. ## [1.6.1] - 2021-06-30 diff --git a/src/haml/printer.ts b/src/haml/printer.ts index 64442346..4cd0dbea 100644 --- a/src/haml/printer.ts +++ b/src/haml/printer.ts @@ -2,8 +2,18 @@ import type { Plugin, HAML } from "../types"; import prettier from "../prettier"; import embed from "./embed"; -const { align, fill, group, hardline, ifBreak, indent, join, line, softline } = - prettier; +const { + align, + fill, + group, + hardline, + ifBreak, + indent, + join, + line, + makeString, + softline +} = prettier; const docTypes = { basic: "Basic", @@ -42,8 +52,12 @@ function printHashValue(value: string | number, opts: Plugin.Options) { return value.slice(1); } - const quote = opts.rubySingleQuote && !value.includes("#{") ? "'" : '"'; - return `${quote}${value}${quote}`; + const quote = + opts.rubySingleQuote && !value.includes("#{") && !value.includes("'") + ? "'" + : '"'; + + return makeString(value, quote); } // This will print an attributes object to a Doc node. It handles nesting on diff --git a/test/js/haml/tag.test.ts b/test/js/haml/tag.test.ts index 573ead89..96e78a5f 100644 --- a/test/js/haml/tag.test.ts +++ b/test/js/haml/tag.test.ts @@ -116,4 +116,10 @@ describe("tag", () => { return expect(content).toChangeFormat(expected); }); + + test("with quotes in string", () => { + const content = haml(`%div{title: "escaping quotes, it's annoying"}`); + + return expect(content).toMatchFormat(); + }); }); From 2304cc61e7c1660b6bbacd830e3eb6656883dff6 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 27 Sep 2021 15:29:33 -0400 Subject: [PATCH 269/785] Fix for #900 --- CHANGELOG.md | 1 + src/haml/printer.ts | 18 ++++++++++++++++-- test/js/haml/tag.test.ts | 6 ++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3d12396..8f7d5b08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#819](https://github.com/prettier/plugin-ruby/issues/819) - coisnepe, kddnewton - Ensure that comments placed immediately after the left parenthesis of a method definition are not moved into the body of the methods. - [#957](https://github.com/prettier/plugin-ruby/issues/957) - azz, kddnewton - Make it so that the format pragma does not have to be on the first line of the file. - [#895](https://github.com/prettier/plugin-ruby/issues/895) - rsslldnphy, kddnewton - Ensure quotes are properly escaped in the content of a hash value for HAML attributes. +- [#900](https://github.com/prettier/plugin-ruby/issues/900) - rsslldnphy, kddnewton - Ensure that in a HAML line where you have interpolation inside of a tag content that you print it properly. ## [1.6.1] - 2021-06-30 diff --git a/src/haml/printer.ts b/src/haml/printer.ts index 4cd0dbea..3a964a09 100644 --- a/src/haml/printer.ts +++ b/src/haml/printer.ts @@ -364,11 +364,25 @@ const printer: Plugin.PrinterConfig = { } if (value.value) { - const prefix = value.parse ? "= " : ifBreak("", " "); + let contents: Plugin.Doc[]; + + if (value.parse && value.value.match(/#[{$@]/)) { + // There's a weird case here where if the value includes + // interpolation and it's marked as { parse: true }, then we don't + // actually want the = prefix, and we want to remove extra escaping. + contents = [ + ifBreak("", " "), + value.value.slice(1, -1).replace(/\\"/g, '"') + ]; + } else if (value.parse) { + contents = ["= ", value.value]; + } else { + contents = [ifBreak("", " "), value.value]; + } return printWithChildren( node, - group([group(parts), indent([softline, prefix, value.value])]) + group([group(parts), indent([softline, ...contents])]) ); } diff --git a/test/js/haml/tag.test.ts b/test/js/haml/tag.test.ts index 96e78a5f..ede8ad46 100644 --- a/test/js/haml/tag.test.ts +++ b/test/js/haml/tag.test.ts @@ -122,4 +122,10 @@ describe("tag", () => { return expect(content).toMatchFormat(); }); + + test("with interpolation in the value", () => { + const content = haml(`%p hello"#{1 + 2} little pigs"`); + + return expect(content).toMatchFormat(); + }); }); From d3e3c82c32701fc8929c46080c5e83ceb8b59745 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Sep 2021 12:01:35 +0000 Subject: [PATCH 270/785] Bump @types/prettier from 2.4.0 to 2.4.1 Bumps [@types/prettier](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/prettier) from 2.4.0 to 2.4.1. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/prettier) --- updated-dependencies: - dependency-name: "@types/prettier" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 47420b72..4b313bc6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -678,9 +678,9 @@ integrity sha512-4/Z9DMPKFexZj/Gn3LylFgamNKHm4K3QDi0gz9B26Uk0c8izYf97B5fxfpspMNkWlFupblKM/nV8+NA9Ffvr+w== "@types/prettier@^2.1.5", "@types/prettier@^2.3.2": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.0.tgz#900b13362610ccd3570fb6eefb911a6732973d00" - integrity sha512-WHRsy5nMpjXfU9B0LqOqPT06EI2+8Xv5NERy0pLxJLbU98q7uhcGogQzfX+rXpU7S5mgHsLxHrLCufZcV/P8TQ== + version "2.4.1" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.1.tgz#e1303048d5389563e130f5bdd89d37a99acb75eb" + integrity sha512-Fo79ojj3vdEZOHg3wR9ksAMRz4P3S5fDB5e/YWZiFnyFQI1WY2Vftu9XoXVVtJfxB7Bpce/QTqWSSntkz2Znrw== "@types/stack-utils@^2.0.0": version "2.0.1" From 3bf628ca17dc8838e1c520b89ae13451a13e1bdc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Sep 2021 12:01:46 +0000 Subject: [PATCH 271/785] Bump @typescript-eslint/parser from 4.31.2 to 4.32.0 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.31.2 to 4.32.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.32.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index 47420b72..16636ebe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -725,13 +725,13 @@ eslint-utils "^3.0.0" "@typescript-eslint/parser@^4.31.2": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.31.2.tgz#54aa75986e3302d91eff2bbbaa6ecfa8084e9c34" - integrity sha512-EcdO0E7M/sv23S/rLvenHkb58l3XhuSZzKf6DBvLgHqOYdL6YFMYVtreGFWirxaU2mS1GYDby3Lyxco7X5+Vjw== + version "4.32.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.32.0.tgz#751ecca0e2fecd3d44484a9b3049ffc1871616e5" + integrity sha512-lhtYqQ2iEPV5JqV7K+uOVlPePjClj4dOw7K4/Z1F2yvjIUvyr13yJnDzkK6uon4BjHYuHy3EG0c2Z9jEhFk56w== dependencies: - "@typescript-eslint/scope-manager" "4.31.2" - "@typescript-eslint/types" "4.31.2" - "@typescript-eslint/typescript-estree" "4.31.2" + "@typescript-eslint/scope-manager" "4.32.0" + "@typescript-eslint/types" "4.32.0" + "@typescript-eslint/typescript-estree" "4.32.0" debug "^4.3.1" "@typescript-eslint/scope-manager@4.31.2": @@ -742,11 +742,24 @@ "@typescript-eslint/types" "4.31.2" "@typescript-eslint/visitor-keys" "4.31.2" +"@typescript-eslint/scope-manager@4.32.0": + version "4.32.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.32.0.tgz#e03c8668f8b954072b3f944d5b799c0c9225a7d5" + integrity sha512-DK+fMSHdM216C0OM/KR1lHXjP1CNtVIhJ54kQxfOE6x8UGFAjha8cXgDMBEIYS2XCYjjCtvTkjQYwL3uvGOo0w== + dependencies: + "@typescript-eslint/types" "4.32.0" + "@typescript-eslint/visitor-keys" "4.32.0" + "@typescript-eslint/types@4.31.2": version "4.31.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.31.2.tgz#2aea7177d6d744521a168ed4668eddbd912dfadf" integrity sha512-kWiTTBCTKEdBGrZKwFvOlGNcAsKGJSBc8xLvSjSppFO88AqGxGNYtF36EuEYG6XZ9vT0xX8RNiHbQUKglbSi1w== +"@typescript-eslint/types@4.32.0": + version "4.32.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.32.0.tgz#52c633c18da47aee09449144bf59565ab36df00d" + integrity sha512-LE7Z7BAv0E2UvqzogssGf1x7GPpUalgG07nGCBYb1oK4mFsOiFC/VrSMKbZQzFJdN2JL5XYmsx7C7FX9p9ns0w== + "@typescript-eslint/typescript-estree@4.31.2": version "4.31.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.2.tgz#abfd50594d8056b37e7428df3b2d185ef2d0060c" @@ -760,6 +773,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@4.32.0": + version "4.32.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.32.0.tgz#db00ccc41ccedc8d7367ea3f50c6994b8efa9f3b" + integrity sha512-tRYCgJ3g1UjMw1cGG8Yn1KzOzNlQ6u1h9AmEtPhb5V5a1TmiHWcRyF/Ic+91M4f43QeChyYlVTcf3DvDTZR9vw== + dependencies: + "@typescript-eslint/types" "4.32.0" + "@typescript-eslint/visitor-keys" "4.32.0" + debug "^4.3.1" + globby "^11.0.3" + is-glob "^4.0.1" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/visitor-keys@4.31.2": version "4.31.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.2.tgz#7d5b4a4705db7fe59ecffb273c1d082760f635cc" @@ -768,6 +794,14 @@ "@typescript-eslint/types" "4.31.2" eslint-visitor-keys "^2.0.0" +"@typescript-eslint/visitor-keys@4.32.0": + version "4.32.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.32.0.tgz#455ba8b51242f2722a497ffae29313f33b14cb7f" + integrity sha512-e7NE0qz8W+atzv3Cy9qaQ7BTLwWsm084Z0c4nIO2l3Bp6u9WIgdqCgyPyV5oSPDMIW3b20H59OOCmVk3jw3Ptw== + dependencies: + "@typescript-eslint/types" "4.32.0" + eslint-visitor-keys "^2.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 e40aec1d814ffc306ef5adc62c18786f692adc33 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Sep 2021 12:02:07 +0000 Subject: [PATCH 272/785] Bump jest from 27.2.2 to 27.2.3 Bumps [jest](https://github.com/facebook/jest) from 27.2.2 to 27.2.3. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v27.2.2...v27.2.3) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 657 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 340 insertions(+), 317 deletions(-) diff --git a/yarn.lock b/yarn.lock index 47420b72..dd0b8410 100644 --- a/yarn.lock +++ b/yarn.lock @@ -366,94 +366,94 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^27.2.2": - version "27.2.2" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.2.2.tgz#a977245155c519ac2ef713ec0e722d13eda893c9" - integrity sha512-m7tbzPWyvSFfoanTknJoDnaeruDARsUe555tkVjG/qeaRDKwyPqqbgs4yFx583gmoETiAts1deeYozR5sVRhNA== +"@jest/console@^27.2.3": + version "27.2.3" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.2.3.tgz#c87fe48397dc7511089be71da93fb41869b75b7e" + integrity sha512-7akAz7p6T31EEYVVKxs6fKaR7CUgem22M/0TjCP7a64FIhNif2EiWcRzMkkDZbYhImG+Tz5qy9gMk2Wtl5GV1g== dependencies: - "@jest/types" "^27.1.1" + "@jest/types" "^27.2.3" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^27.2.2" - jest-util "^27.2.0" + jest-message-util "^27.2.3" + jest-util "^27.2.3" slash "^3.0.0" -"@jest/core@^27.2.2": - version "27.2.2" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.2.2.tgz#9eea16101b2f04bf799dcdbdf1792d4ef7553ecf" - integrity sha512-4b9km/h9pAGdCkwWYtbfoeiOtajOlGmr5rL1Eq6JCAVbOevOqxWHxJ6daWxRJW9eF6keXJoJ1H+uVAVcdZu8Bg== +"@jest/core@^27.2.3": + version "27.2.3" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.2.3.tgz#b21a3ffb69bef017c4562d27689bb798c0194501" + integrity sha512-I+VX+X8pkw2I057swT3ufNp6V5EBeFO1dl+gvIexdV0zg1kZ+cz9CrPbWL75dYrJIInf5uWPwDwOoJCALrTxWw== dependencies: - "@jest/console" "^27.2.2" - "@jest/reporters" "^27.2.2" - "@jest/test-result" "^27.2.2" - "@jest/transform" "^27.2.2" - "@jest/types" "^27.1.1" + "@jest/console" "^27.2.3" + "@jest/reporters" "^27.2.3" + "@jest/test-result" "^27.2.3" + "@jest/transform" "^27.2.3" + "@jest/types" "^27.2.3" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" - jest-changed-files "^27.1.1" - jest-config "^27.2.2" - jest-haste-map "^27.2.2" - jest-message-util "^27.2.2" + jest-changed-files "^27.2.3" + jest-config "^27.2.3" + jest-haste-map "^27.2.3" + jest-message-util "^27.2.3" jest-regex-util "^27.0.6" - jest-resolve "^27.2.2" - jest-resolve-dependencies "^27.2.2" - jest-runner "^27.2.2" - jest-runtime "^27.2.2" - jest-snapshot "^27.2.2" - jest-util "^27.2.0" - jest-validate "^27.2.2" - jest-watcher "^27.2.2" + jest-resolve "^27.2.3" + jest-resolve-dependencies "^27.2.3" + jest-runner "^27.2.3" + jest-runtime "^27.2.3" + jest-snapshot "^27.2.3" + jest-util "^27.2.3" + jest-validate "^27.2.3" + jest-watcher "^27.2.3" micromatch "^4.0.4" p-each-series "^2.1.0" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.2.2": - version "27.2.2" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.2.2.tgz#2e57b9d2cc01028b0e35fae5833c1c63df4c5e41" - integrity sha512-gO9gVnZfn5ldeOJ5q+35Kru9QWGHEqZCB7W/M+8mD6uCwOGC9HR6mzpLSNRuDsxY/KhaGBYHpgFqtpe4Rl1gDQ== +"@jest/environment@^27.2.3": + version "27.2.3" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.2.3.tgz#3ae328d778a67e027bad27541d1c09ed94312609" + integrity sha512-xXZk/Uhq6TTRydg4RyNawNZ82lX88r3997t5ykzQBfB3Wd+mqzSyC4XWzw4lTZJISldwn9/FunexTSGBFcvVAg== dependencies: - "@jest/fake-timers" "^27.2.2" - "@jest/types" "^27.1.1" + "@jest/fake-timers" "^27.2.3" + "@jest/types" "^27.2.3" "@types/node" "*" - jest-mock "^27.1.1" + jest-mock "^27.2.3" -"@jest/fake-timers@^27.2.2": - version "27.2.2" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.2.2.tgz#43e6f191c95ae74e95d0ddba2ecb8470b4a288b7" - integrity sha512-gDIIqs0yxyjyxEI9HlJ8SEJ4uCc8qr8BupG1Hcx7tvyk/SLocyXE63rFxL+HQ0ZLMvSyEcJUmYnvvHH1osWiGA== +"@jest/fake-timers@^27.2.3": + version "27.2.3" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.2.3.tgz#21cdef9cb9edd30c80026a0176eba58f5fbcaa67" + integrity sha512-A8+X35briNiabUPcLqYQY+dsvBUozX9DCa7HgJLdvRK/JPAKUpthYHjnI9y6QUYaDTqGZEo4rLf7LXE51MwP3Q== dependencies: - "@jest/types" "^27.1.1" - "@sinonjs/fake-timers" "^7.0.2" + "@jest/types" "^27.2.3" + "@sinonjs/fake-timers" "^8.0.1" "@types/node" "*" - jest-message-util "^27.2.2" - jest-mock "^27.1.1" - jest-util "^27.2.0" + jest-message-util "^27.2.3" + jest-mock "^27.2.3" + jest-util "^27.2.3" -"@jest/globals@^27.2.2": - version "27.2.2" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.2.2.tgz#df66aaafda5c69b2bb0dae548e3cfb345f549c31" - integrity sha512-fWa/Luwod1hyehnuep+zCnOTqTVvyc4HLUU/1VpFNOEu0tCWNSODyvKSSOjtb1bGOpCNjgaDcyjzo5f7rl6a7g== +"@jest/globals@^27.2.3": + version "27.2.3" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.2.3.tgz#6b8d652083d78709b243d9571457058f1c6c5fea" + integrity sha512-JVjQDs5z34XvFME0qHmKwWtgzRnBa/i22nfWjzlIUvkdFCzndN+JTLEWNXAgyBbGnNYuMZ8CpvgF9uhKt/cR3g== dependencies: - "@jest/environment" "^27.2.2" - "@jest/types" "^27.1.1" - expect "^27.2.2" + "@jest/environment" "^27.2.3" + "@jest/types" "^27.2.3" + expect "^27.2.3" -"@jest/reporters@^27.2.2": - version "27.2.2" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.2.2.tgz#e2d41cd9f8088676b81b9a9908cb1ba67bdbee78" - integrity sha512-ufwZ8XoLChEfPffDeVGroYbhbcYPom3zKDiv4Flhe97rr/o2IfUXoWkDUDoyJ3/V36RFIMjokSu0IJ/pbFtbHg== +"@jest/reporters@^27.2.3": + version "27.2.3" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.2.3.tgz#47c27be7c3e2069042b6fba12c1f8f62f91302db" + integrity sha512-zc9gQDjUAnkRQ5C0LW2u4JU9Ojqp9qc8OXQkMSmAbou6lN0mvDGEl4PG5HrZxpW4nE2FjIYyX6JAn05QT3gLbw== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.2.2" - "@jest/test-result" "^27.2.2" - "@jest/transform" "^27.2.2" - "@jest/types" "^27.1.1" + "@jest/console" "^27.2.3" + "@jest/test-result" "^27.2.3" + "@jest/transform" "^27.2.3" + "@jest/types" "^27.2.3" chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" @@ -464,15 +464,15 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^27.2.2" - jest-resolve "^27.2.2" - jest-util "^27.2.0" - jest-worker "^27.2.2" + jest-haste-map "^27.2.3" + jest-resolve "^27.2.3" + jest-util "^27.2.3" + jest-worker "^27.2.3" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" terminal-link "^2.0.0" - v8-to-istanbul "^8.0.0" + v8-to-istanbul "^8.1.0" "@jest/source-map@^27.0.6": version "27.0.6" @@ -483,41 +483,41 @@ graceful-fs "^4.2.4" source-map "^0.6.0" -"@jest/test-result@^27.2.2": - version "27.2.2" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.2.2.tgz#cd4ba1ca9b0521e463bd4b32349ba1842277563b" - integrity sha512-yENoDEoWlEFI7l5z7UYyJb/y5Q8RqbPd4neAVhKr6l+vVaQOPKf8V/IseSMJI9+urDUIxgssA7RGNyCRhGjZvw== +"@jest/test-result@^27.2.3": + version "27.2.3" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.2.3.tgz#7d8f790186c7ec7600edc1d8781656268f038255" + integrity sha512-+pRxO4xSJyUxoA0ENiTq8wT+5RCFOxK4nlNY2lUes/VF33uB54GBkZeXlljZcZjuzS1Yarz4hZI/a4mBtv9jQA== dependencies: - "@jest/console" "^27.2.2" - "@jest/types" "^27.1.1" + "@jest/console" "^27.2.3" + "@jest/types" "^27.2.3" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.2.2": - version "27.2.2" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.2.2.tgz#9a6d735317f525741a5913ee3cdefeffc9b0aba6" - integrity sha512-YnJqwNQP2Zeu0S4TMqkxg6NN7Y1EFq715n/nThNKrvIS9wmRZjDt2XYqsHbuvhAFjshi0iKDQ813NewFITBH+Q== +"@jest/test-sequencer@^27.2.3": + version "27.2.3" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.2.3.tgz#a9e376b91a64c6f5ab37f05e9d304340609125d7" + integrity sha512-QskUVqLU2zzRYchI2Q9I9A2xnbDqGo70WIWkKf4+tD+BAkohDxOF46Q7iYxznPiRTcoYtqttSZiNSS4rgQDxrQ== dependencies: - "@jest/test-result" "^27.2.2" + "@jest/test-result" "^27.2.3" graceful-fs "^4.2.4" - jest-haste-map "^27.2.2" - jest-runtime "^27.2.2" + jest-haste-map "^27.2.3" + jest-runtime "^27.2.3" -"@jest/transform@^27.2.2": - version "27.2.2" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.2.2.tgz#89b16b4de84354fb48d15712b3ea34cadc1cb600" - integrity sha512-l4Z/7PpajrOjCiXLWLfMY7fgljY0H8EwW7qdzPXXuv2aQF8kY2+Uyj3O+9Popnaw1V7JCw32L8EeI/thqFDkPA== +"@jest/transform@^27.2.3": + version "27.2.3" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.2.3.tgz#1df37dbfe5bc29c00f227acae11348437a76b77e" + integrity sha512-ZpYsc9vK+OfV/9hMsVOrCH/9rvzBHAp91OOzkLqdWf3FWpDzjxAH+OlLGcS4U8WeWsdpe8/rOMKLwFs9DwL/2A== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^27.1.1" + "@jest/types" "^27.2.3" babel-plugin-istanbul "^6.0.0" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.2.2" + jest-haste-map "^27.2.3" jest-regex-util "^27.0.6" - jest-util "^27.2.0" + jest-util "^27.2.3" micromatch "^4.0.4" pirates "^4.0.1" slash "^3.0.0" @@ -535,6 +535,17 @@ "@types/yargs" "^16.0.0" chalk "^4.0.0" +"@jest/types@^27.2.3": + version "27.2.3" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.2.3.tgz#e0242545f442242c2538656d947a147443eee8f2" + integrity sha512-UJMDg90+W2i/QsS1NIN6Go8O/rSHLFWUkofGqKsUQs54mhmCVyLTiDy1cwKhoNO5fpmr9fctm9L/bRp/YzA1uQ== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^16.0.0" + chalk "^4.0.0" + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -563,10 +574,10 @@ dependencies: type-detect "4.0.8" -"@sinonjs/fake-timers@^7.0.2": - version "7.1.2" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-7.1.2.tgz#2524eae70c4910edccf99b2f4e6efc5894aff7b5" - integrity sha512-iQADsW4LBMISqZ6Ci1dupJL9pprqwcVFTcOsEmQOEhW+KLCVn/Y4Jrvg2k19fIHCp+iFprriYPTdRcQR8NbUPg== +"@sinonjs/fake-timers@^8.0.1": + version "8.0.1" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-8.0.1.tgz#1c1c9a91419f804e59ae8df316a07dd1c3a76b94" + integrity sha512-AU7kwFxreVd6OAXcAFlKSmZquiRUU0FvYm44k1Y1QbK7Co4m0aqfGMhjykIeQp/H6rcl+nFmj0zfdUcGVs9Dew== dependencies: "@sinonjs/commons" "^1.7.0" @@ -914,13 +925,13 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= -babel-jest@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.2.2.tgz#d7e96f3f6f56be692de948092697e1bfea7f1184" - integrity sha512-XNFNNfGKnZXzhej7TleVP4s9ktH5JjRW8Rmcbb223JJwKB/gmTyeWN0JfiPtSgnjIjDXtKNoixiy0QUHtv3vFA== +babel-jest@^27.2.3: + version "27.2.3" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.2.3.tgz#f48599a507cd33c10f58058149eb3079198d0ed7" + integrity sha512-lXslrpae1L9cXnB5F8vvD/Yj70g47sG7CGSxT+qqveK/To72X3nuCtDux0s3HN7X351IbwYoYyfDxQ7CqVbkNw== dependencies: - "@jest/transform" "^27.2.2" - "@jest/types" "^27.1.1" + "@jest/transform" "^27.2.3" + "@jest/types" "^27.2.3" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.0.0" babel-preset-jest "^27.2.0" @@ -1487,16 +1498,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.2.2.tgz#65c414697415c0867ef588813e9c729ebab8a9a9" - integrity sha512-sjHBeEk47/eshN9oLbvPJZMgHQihOXXQzSMPCJ4MqKShbU9HOVFSNHEEU4dp4ujzxFSiNvPFzB2AMOFmkizhvA== +expect@^27.2.3: + version "27.2.3" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.2.3.tgz#9ce766b50c6a5f22edd07ca5510845ac8bcb0b10" + integrity sha512-qT+ItBIdpS2QkRzZNGFmqpV2xTjK20gftUnJ4CLmpjdGzpoEtjxb43Y80GraXLtwB+wt5kRmXURINeM3s2fQtQ== dependencies: - "@jest/types" "^27.1.1" + "@jest/types" "^27.2.3" ansi-styles "^5.0.0" jest-get-type "^27.0.6" - jest-matcher-utils "^27.2.2" - jest-message-util "^27.2.2" + jest-matcher-utils "^27.2.3" + jest-message-util "^27.2.3" jest-regex-util "^27.0.6" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: @@ -1892,84 +1903,84 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.1.1.tgz#9b3f67a34cc58e3e811e2e1e21529837653e4200" - integrity sha512-5TV9+fYlC2A6hu3qtoyGHprBwCAn0AuGA77bZdUgYvVlRMjHXo063VcWTEAyx6XAZ85DYHqp0+aHKbPlfRDRvA== +jest-changed-files@^27.2.3: + version "27.2.3" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.2.3.tgz#83c42171d87c26d5a72e8464412cc4e239c01dda" + integrity sha512-UiT98eMtPySry7E0RmkDTL/GyoZBvJVWZBlHpHYc3ilRLxHBUxPkbMK/bcImDJKqyKbj83EaeIpeaMXPlPQ72A== dependencies: - "@jest/types" "^27.1.1" + "@jest/types" "^27.2.3" execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.2.2.tgz#a3647082f3eba1226f7664a36a2b7ebf45ceaf7b" - integrity sha512-8txlqs0EDrvPasCgwfLMkG0l3F4FxqQa6lxOsvYfOl04eSJjRw3F4gk9shakuC00nMD+VT+SMtFYXxe64f0VZw== +jest-circus@^27.2.3: + version "27.2.3" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.2.3.tgz#e46ed567b316323f0b7c12dc72cd12fe46656356" + integrity sha512-msCZkvudSDhUtCCEU/Dsnp5DRzX5MQGwfuRjDwhxJxjSJ0g4c3Qwhk5Q2AjFjZS9EVm4qs9fGCf+W3BU69h3pw== dependencies: - "@jest/environment" "^27.2.2" - "@jest/test-result" "^27.2.2" - "@jest/types" "^27.1.1" + "@jest/environment" "^27.2.3" + "@jest/test-result" "^27.2.3" + "@jest/types" "^27.2.3" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" - expect "^27.2.2" + expect "^27.2.3" is-generator-fn "^2.0.0" - jest-each "^27.2.2" - jest-matcher-utils "^27.2.2" - jest-message-util "^27.2.2" - jest-runtime "^27.2.2" - jest-snapshot "^27.2.2" - jest-util "^27.2.0" - pretty-format "^27.2.2" + jest-each "^27.2.3" + jest-matcher-utils "^27.2.3" + jest-message-util "^27.2.3" + jest-runtime "^27.2.3" + jest-snapshot "^27.2.3" + jest-util "^27.2.3" + pretty-format "^27.2.3" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.2.2.tgz#0973a717c109f23de642b63486f3cb71c5a971be" - integrity sha512-jbEythw22LR/IHYgNrjWdO74wO9wyujCxTMjbky0GLav4rC4y6qDQr4TqQ2JPP51eDYJ2awVn83advEVSs5Brg== +jest-cli@^27.2.3: + version "27.2.3" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.2.3.tgz#68add5b1626bd5502df6c7a4a4d574ebf797221a" + integrity sha512-QHXxxqE1zxMlti6wIHSbkl4Brg5Dnc0xzAVqRlVa6y2Ygv2X4ejhfMjl4VB5gWeHNsVA9C+KOm8TawpjZX8d3g== dependencies: - "@jest/core" "^27.2.2" - "@jest/test-result" "^27.2.2" - "@jest/types" "^27.1.1" + "@jest/core" "^27.2.3" + "@jest/test-result" "^27.2.3" + "@jest/types" "^27.2.3" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.2.2" - jest-util "^27.2.0" - jest-validate "^27.2.2" + jest-config "^27.2.3" + jest-util "^27.2.3" + jest-validate "^27.2.3" prompts "^2.0.1" yargs "^16.0.3" -jest-config@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.2.2.tgz#970d8466c60ac106ac9d7d0b8dcf3ff150fa713a" - integrity sha512-2nhms3lp52ZpU0636bB6zIFHjDVtYxzFQIOHZjBFUeXcb6b41sEkWojbHaJ4FEIO44UbccTLa7tvNpiFCgPE7w== +jest-config@^27.2.3: + version "27.2.3" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.2.3.tgz#64606cd1f194fb9527cbbc3e4ff23b324653b992" + integrity sha512-15fKPBZ+eiDUj02bENeBNL6IrH9ZQg7mcOlJ+SG8HwEkjpy0K+NHAREFIJbPFBaq75syWk9SYkB77fH0XtoZOQ== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.2.2" - "@jest/types" "^27.1.1" - babel-jest "^27.2.2" + "@jest/test-sequencer" "^27.2.3" + "@jest/types" "^27.2.3" + babel-jest "^27.2.3" chalk "^4.0.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" is-ci "^3.0.0" - jest-circus "^27.2.2" - jest-environment-jsdom "^27.2.2" - jest-environment-node "^27.2.2" + jest-circus "^27.2.3" + jest-environment-jsdom "^27.2.3" + jest-environment-node "^27.2.3" jest-get-type "^27.0.6" - jest-jasmine2 "^27.2.2" + jest-jasmine2 "^27.2.3" jest-regex-util "^27.0.6" - jest-resolve "^27.2.2" - jest-runner "^27.2.2" - jest-util "^27.2.0" - jest-validate "^27.2.2" + jest-resolve "^27.2.3" + jest-runner "^27.2.3" + jest-util "^27.2.3" + jest-validate "^27.2.3" micromatch "^4.0.4" - pretty-format "^27.2.2" + pretty-format "^27.2.3" jest-diff@^27.0.0: version "27.2.0" @@ -1981,15 +1992,15 @@ jest-diff@^27.0.0: jest-get-type "^27.0.6" pretty-format "^27.2.0" -jest-diff@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.2.2.tgz#3992fe5f55f209676c5d3fd956e3f3d4145f76b8" - integrity sha512-o3LaDbQDSaMJif4yztJAULI4xVatxbBasbKLbEw3K8CiRdDdbxMrLArS9EKDHQFYh6Tgfrm1PC2mIYR1xhu0hQ== +jest-diff@^27.2.3: + version "27.2.3" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.2.3.tgz#4298ecc53f7476571d0625e8fda3ade13607a864" + integrity sha512-ihRKT1mbm/Lw+vaB1un4BEof3WdfYIXT0VLvEyLUTU3XbIUgyiljis3YzFf2RFn+ECFAeyilqJa35DeeRV2NeQ== dependencies: chalk "^4.0.0" diff-sequences "^27.0.6" jest-get-type "^27.0.6" - pretty-format "^27.2.2" + pretty-format "^27.2.3" jest-docblock@^27.0.6: version "27.0.6" @@ -1998,53 +2009,53 @@ jest-docblock@^27.0.6: dependencies: detect-newline "^3.0.0" -jest-each@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.2.2.tgz#62da8dd68b9fc61ab6e9e344692eeb1251f8c91d" - integrity sha512-ZCDhkvwHeXHsxoFxvW43fabL18iLiVDxaipG5XWG7dSd+XWXXpzMQvBWYT9Wvzhg5x4hvrLQ24LtiOKw3I09xA== +jest-each@^27.2.3: + version "27.2.3" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.2.3.tgz#7eaf7c7b362019f23c5a7998b57d82e78e6f6672" + integrity sha512-Aza5Lr+tml8x+rBGsi3A8VLqhYN1UBa2M7FLtgkUvVFQBORlV9irLl/ZE0tvk4hRqp4jW7nbGDrRo2Ey8Wl9rg== dependencies: - "@jest/types" "^27.1.1" + "@jest/types" "^27.2.3" chalk "^4.0.0" jest-get-type "^27.0.6" - jest-util "^27.2.0" - pretty-format "^27.2.2" + jest-util "^27.2.3" + pretty-format "^27.2.3" -jest-environment-jsdom@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.2.2.tgz#fb3075b4be6289961dcc4942e98f1862b3a8c4cb" - integrity sha512-mzCLEdnpGWDJmNB6WIPLlZM+hpXdeiya9TryiByqcUdpliNV1O+LGC2SewzjmB4IblabGfvr3KcPN0Nme2wnDw== +jest-environment-jsdom@^27.2.3: + version "27.2.3" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.2.3.tgz#36ad673f93f1948dd5daa6dcb1c9b1ad09d60165" + integrity sha512-QEcgd5bloEfugjvYFACFtFkn5sW9fGYS/vJaTQZ2kj8/q1semDYWssbUWeT8Lmm/4utv9G50+bTq/vGP/LZwvQ== dependencies: - "@jest/environment" "^27.2.2" - "@jest/fake-timers" "^27.2.2" - "@jest/types" "^27.1.1" + "@jest/environment" "^27.2.3" + "@jest/fake-timers" "^27.2.3" + "@jest/types" "^27.2.3" "@types/node" "*" - jest-mock "^27.1.1" - jest-util "^27.2.0" + jest-mock "^27.2.3" + jest-util "^27.2.3" jsdom "^16.6.0" -jest-environment-node@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.2.2.tgz#60ba7d7fee956f68964d47a785d0195ce125aaa3" - integrity sha512-XgUscWs6H6UNqC96/QJjmUGZzzpql/JyprLSXVu7wkgM8tjbJdEkSqwrVAvJPm1yu526ImrmsIoh2BTHxkwL/g== +jest-environment-node@^27.2.3: + version "27.2.3" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.2.3.tgz#651b15f52310b12660a5fd53812b8b2e696ee9b9" + integrity sha512-OmxFyQ81n1pQ+WJW7tOkGPQL/nt0+UeubHlZJEdAzuOvYAA8zleamw0BpK7QsITdJ5euSI6t/HW3a5ihqMB4yQ== dependencies: - "@jest/environment" "^27.2.2" - "@jest/fake-timers" "^27.2.2" - "@jest/types" "^27.1.1" + "@jest/environment" "^27.2.3" + "@jest/fake-timers" "^27.2.3" + "@jest/types" "^27.2.3" "@types/node" "*" - jest-mock "^27.1.1" - jest-util "^27.2.0" + jest-mock "^27.2.3" + jest-util "^27.2.3" jest-get-type@^27.0.6: version "27.0.6" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.6.tgz#0eb5c7f755854279ce9b68a9f1a4122f69047cfe" integrity sha512-XTkK5exIeUbbveehcSR8w0bhH+c0yloW/Wpl+9vZrjzztCPWrxhHwkIFpZzCt71oRBsgxmuUfxEqOYoZI2macg== -jest-haste-map@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.2.2.tgz#81ccb57b1e1cd513aaaadf5016aad5dab0ede552" - integrity sha512-kaKiq+GbAvk6/sq++Ymor4Vzk6+lr0vbKs2HDVPdkKsHX2lIJRyvhypZG/QsNfQnROKWIZSpUpGuv2HySSosvA== +jest-haste-map@^27.2.3: + version "27.2.3" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.2.3.tgz#cec807c59c312872f0ea4cc1b6b5ca7b46131705" + integrity sha512-5KE0vRSGv1Ymhd6s1t6xhTm/77otdkzqJl+9pSIYfKKCKJ7cniyE2zVC/Xj2HKuMX++aJYzQvQCIS0kqIFukAw== dependencies: - "@jest/types" "^27.1.1" + "@jest/types" "^27.2.3" "@types/graceful-fs" "^4.1.2" "@types/node" "*" anymatch "^3.0.3" @@ -2052,76 +2063,76 @@ jest-haste-map@^27.2.2: graceful-fs "^4.2.4" jest-regex-util "^27.0.6" jest-serializer "^27.0.6" - jest-util "^27.2.0" - jest-worker "^27.2.2" + jest-util "^27.2.3" + jest-worker "^27.2.3" micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.2.2.tgz#bf87c8820a192c86b65a7c4c1a54caae52124f04" - integrity sha512-SczhZNfmZID9HbJ1GHhO4EzeL/PMRGeAUw23ddPUdd6kFijEZpT2yOxyNCBUKAsVQ/14OB60kjgnbuFOboZUNg== +jest-jasmine2@^27.2.3: + version "27.2.3" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.2.3.tgz#19fe549b7e86128cd7d0d1668ebf4377dd3981f9" + integrity sha512-pjgANGYj1l6qxBkSPEYuxGvqVVf20uJ26XpNnYV/URC7ayt+UdRavUhEwzDboiewq/lCgNFCDBEqd6eeQVEs8w== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^27.2.2" + "@jest/environment" "^27.2.3" "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.2.2" - "@jest/types" "^27.1.1" + "@jest/test-result" "^27.2.3" + "@jest/types" "^27.2.3" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^27.2.2" + expect "^27.2.3" is-generator-fn "^2.0.0" - jest-each "^27.2.2" - jest-matcher-utils "^27.2.2" - jest-message-util "^27.2.2" - jest-runtime "^27.2.2" - jest-snapshot "^27.2.2" - jest-util "^27.2.0" - pretty-format "^27.2.2" + jest-each "^27.2.3" + jest-matcher-utils "^27.2.3" + jest-message-util "^27.2.3" + jest-runtime "^27.2.3" + jest-snapshot "^27.2.3" + jest-util "^27.2.3" + pretty-format "^27.2.3" throat "^6.0.1" -jest-leak-detector@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.2.2.tgz#5af54273efcf5114ad406f4448860c2396319e12" - integrity sha512-fQIYKkhXUs/4EpE4wO1AVsv7aNH3o0km1BGq3vxvSfYdwG9GLMf+b0z/ghLmBYNxb+tVpm/zv2caoKm3GfTazg== +jest-leak-detector@^27.2.3: + version "27.2.3" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.2.3.tgz#6c60a795fe9b07442c604140373571559d4d467d" + integrity sha512-hoV8d7eJvayIaPrISBoLaMN0DE+GRSR2/vbAcOONffO+RYzbuW3klsOievx+pCShYKxSKlhxxO90zWice+LLew== dependencies: jest-get-type "^27.0.6" - pretty-format "^27.2.2" + pretty-format "^27.2.3" -jest-matcher-utils@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.2.2.tgz#a6c0a10dce6bfe8250bbed3e2f1b206568d73bde" - integrity sha512-xN3wT4p2i9DGB6zmL3XxYp5lJmq9Q6ff8XKlMtVVBS2SAshmgsPBALJFQ8dWRd2G/xf5q/N0SD0Mipt8QBA26A== +jest-matcher-utils@^27.2.3: + version "27.2.3" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.2.3.tgz#db7f992f3921f5004f4de36aafa0c03f2565122a" + integrity sha512-8n2/iAEOtNoDxVtUuaGtQdbSVYtZn6saT+PyV8UIf9fJErzDdozjB4fUxJm7TX1DzhhoAKFpIFH8UNvG4942PA== dependencies: chalk "^4.0.0" - jest-diff "^27.2.2" + jest-diff "^27.2.3" jest-get-type "^27.0.6" - pretty-format "^27.2.2" + pretty-format "^27.2.3" -jest-message-util@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.2.2.tgz#cdbb1b82dfe5f601ae35f5c6a28bf7823e6bcf99" - integrity sha512-/iS5/m2FSF7Nn6APFoxFymJpyhB/gPf0CJa7uFSkbYaWvrADUfQ9NTsuyjpszKErOS2/huFs44ysWhlQTKvL8Q== +jest-message-util@^27.2.3: + version "27.2.3" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.2.3.tgz#cd1091a3f0f3ff919756b15cfccc0ba43eeeeff0" + integrity sha512-yjVqTQ2Ds1WCGXsTuW0m1uK8RXOE44SJDw7tWUrhn6ZttWDbPmLhH8npDsGGfAmSayKFSo2C0NX0tP2qblc3Gw== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^27.1.1" + "@jest/types" "^27.2.3" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.4" micromatch "^4.0.4" - pretty-format "^27.2.2" + pretty-format "^27.2.3" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^27.1.1: - version "27.1.1" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.1.1.tgz#c7a2e81301fdcf3dab114931d23d89ec9d0c3a82" - integrity sha512-SClsFKuYBf+6SSi8jtAYOuPw8DDMsTElUWEae3zq7vDhH01ayVSIHUSIa8UgbDOUalCFp6gNsaikN0rbxN4dbw== +jest-mock@^27.2.3: + version "27.2.3" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.2.3.tgz#f532d2c8c158e8b899f2a0a5bd3077af37619c29" + integrity sha512-IvgCdUQBU/XDJl9/NLYtKG9o2XlJOQ8hFYDiX7QmNv2195Y1nNGM7hw1H58wT01zz7bohfhJplqwFfULZlrXjg== dependencies: - "@jest/types" "^27.1.1" + "@jest/types" "^27.2.3" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -2134,72 +2145,72 @@ jest-regex-util@^27.0.6: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.6.tgz#02e112082935ae949ce5d13b2675db3d8c87d9c5" integrity sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ== -jest-resolve-dependencies@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.2.2.tgz#7467c67cb8b5630ec28e2f0c72a0b62e56668083" - integrity sha512-nvJS+DyY51HHdZnMIwXg7fimQ5ylFx4+quQXspQXde2rXYy+4v75UYoX/J65Ln8mKCNc6YF8HEhfGaRBOrxxHg== +jest-resolve-dependencies@^27.2.3: + version "27.2.3" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.2.3.tgz#fcb620684108fe7a099185052434d26f17de98e6" + integrity sha512-H03NyzmKfYHCciaYBJqbJOrWCVCdwdt32xZDPFP5dBbe39wsfz41aOkhw8FUZ6qVYVO6rz0nLZ3G7wgbsQQsYQ== dependencies: - "@jest/types" "^27.1.1" + "@jest/types" "^27.2.3" jest-regex-util "^27.0.6" - jest-snapshot "^27.2.2" + jest-snapshot "^27.2.3" -jest-resolve@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.2.2.tgz#1bad93dbc6c20edb874e6720e82e4e48900b120b" - integrity sha512-tfbHcBs/hJTb3fPQ/3hLWR+TsLNTzzK98TU+zIAsrL9nNzWfWROwopUOmiSUqmHMZW5t9au/433kSF2/Af+tTw== +jest-resolve@^27.2.3: + version "27.2.3" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.2.3.tgz#868911cf705c537f433befcfc65e6ddc70c9d7f9" + integrity sha512-+tbm53gKpwuRsqCV+zhhjq/6NxMs/I9zECEMzu0LtmbYD5Gusj+rU497f6lkl5LG/GndvfTjJlysYrnSCcZUJA== dependencies: - "@jest/types" "^27.1.1" + "@jest/types" "^27.2.3" chalk "^4.0.0" escalade "^3.1.1" graceful-fs "^4.2.4" - jest-haste-map "^27.2.2" + jest-haste-map "^27.2.3" jest-pnp-resolver "^1.2.2" - jest-util "^27.2.0" - jest-validate "^27.2.2" + jest-util "^27.2.3" + jest-validate "^27.2.3" resolve "^1.20.0" slash "^3.0.0" -jest-runner@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.2.2.tgz#e719a8ce2a16575677105f692fdff7cd00602325" - integrity sha512-+bUFwBq+yTnvsOFuxetoQtkuOnqdAk2YuIGjlLmc7xLAXn/V1vjhXrLencgij0BUTTUvG9Aul3+5XDss4Wa8Eg== +jest-runner@^27.2.3: + version "27.2.3" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.2.3.tgz#22f6ef7bd4140fec74cec18eef29c24d07cb6ad5" + integrity sha512-bvGlIh3wR/LGjSHPW/IpQU6K2atO45U5p7UDqWThPKT622Wm/ZJ2DNbgNzb4P9ZO/UxB22jXoKJPsMAdWGEdmA== dependencies: - "@jest/console" "^27.2.2" - "@jest/environment" "^27.2.2" - "@jest/test-result" "^27.2.2" - "@jest/transform" "^27.2.2" - "@jest/types" "^27.1.1" + "@jest/console" "^27.2.3" + "@jest/environment" "^27.2.3" + "@jest/test-result" "^27.2.3" + "@jest/transform" "^27.2.3" + "@jest/types" "^27.2.3" "@types/node" "*" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" jest-docblock "^27.0.6" - jest-environment-jsdom "^27.2.2" - jest-environment-node "^27.2.2" - jest-haste-map "^27.2.2" - jest-leak-detector "^27.2.2" - jest-message-util "^27.2.2" - jest-resolve "^27.2.2" - jest-runtime "^27.2.2" - jest-util "^27.2.0" - jest-worker "^27.2.2" + jest-environment-jsdom "^27.2.3" + jest-environment-node "^27.2.3" + jest-haste-map "^27.2.3" + jest-leak-detector "^27.2.3" + jest-message-util "^27.2.3" + jest-resolve "^27.2.3" + jest-runtime "^27.2.3" + jest-util "^27.2.3" + jest-worker "^27.2.3" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.2.2.tgz#cc29d3adde948d531657a67d33c9f8d9bb58a6fc" - integrity sha512-PtTHCK5jT+KrIpKpjJsltu/dK5uGhBtTNLOk1Z+ZD2Jrxam2qQsOqDFYLszcK0jc2TLTNsrVpclqSftn7y3aXA== +jest-runtime@^27.2.3: + version "27.2.3" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.2.3.tgz#e6fc25bbbc63b19fae50c3994060efb1b2922b7e" + integrity sha512-8WPgxENQchmUM0jpDjK1IxacseK9vDDz6T471xs5pNIQrj8typeT0coRigRCb1sPYeXQ66SqVERMgPj6SEeblQ== dependencies: - "@jest/console" "^27.2.2" - "@jest/environment" "^27.2.2" - "@jest/fake-timers" "^27.2.2" - "@jest/globals" "^27.2.2" + "@jest/console" "^27.2.3" + "@jest/environment" "^27.2.3" + "@jest/fake-timers" "^27.2.3" + "@jest/globals" "^27.2.3" "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.2.2" - "@jest/transform" "^27.2.2" - "@jest/types" "^27.1.1" + "@jest/test-result" "^27.2.3" + "@jest/transform" "^27.2.3" + "@jest/types" "^27.2.3" "@types/yargs" "^16.0.0" chalk "^4.0.0" cjs-module-lexer "^1.0.0" @@ -2208,14 +2219,14 @@ jest-runtime@^27.2.2: exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-haste-map "^27.2.2" - jest-message-util "^27.2.2" - jest-mock "^27.1.1" + jest-haste-map "^27.2.3" + jest-message-util "^27.2.3" + jest-mock "^27.2.3" jest-regex-util "^27.0.6" - jest-resolve "^27.2.2" - jest-snapshot "^27.2.2" - jest-util "^27.2.0" - jest-validate "^27.2.2" + jest-resolve "^27.2.3" + jest-snapshot "^27.2.3" + jest-util "^27.2.3" + jest-validate "^27.2.3" slash "^3.0.0" strip-bom "^4.0.0" yargs "^16.0.3" @@ -2228,10 +2239,10 @@ jest-serializer@^27.0.6: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.2.2.tgz#898f0eedde658e723461d3cdcaedb404e716fa01" - integrity sha512-7ODSvULMiiOVuuLvLZpDlpqqTqX9hDfdmijho5auVu9qRYREolvrvgH4kSNOKfcqV3EZOTuLKNdqsz1PM20PQA== +jest-snapshot@^27.2.3: + version "27.2.3" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.2.3.tgz#e3f39e1708a4d93dfa1297e73b5d2feec44f6d0c" + integrity sha512-NJz+PNvTNTxVfNdLXccKUMeVH5O7jZ+9dNXH5TP2WtkLR+CiPRiPveWDgM8o3aaxB6R0Mm8vsD7ieEkEh6ZBBQ== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" @@ -2239,26 +2250,26 @@ jest-snapshot@^27.2.2: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/transform" "^27.2.2" - "@jest/types" "^27.1.1" + "@jest/transform" "^27.2.3" + "@jest/types" "^27.2.3" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.2.2" + expect "^27.2.3" graceful-fs "^4.2.4" - jest-diff "^27.2.2" + jest-diff "^27.2.3" jest-get-type "^27.0.6" - jest-haste-map "^27.2.2" - jest-matcher-utils "^27.2.2" - jest-message-util "^27.2.2" - jest-resolve "^27.2.2" - jest-util "^27.2.0" + jest-haste-map "^27.2.3" + jest-matcher-utils "^27.2.3" + jest-message-util "^27.2.3" + jest-resolve "^27.2.3" + jest-util "^27.2.3" natural-compare "^1.4.0" - pretty-format "^27.2.2" + pretty-format "^27.2.3" semver "^7.3.2" -jest-util@^27.0.0, jest-util@^27.2.0: +jest-util@^27.0.0: version "27.2.0" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.2.0.tgz#bfccb85cfafae752257319e825a5b8d4ada470dc" integrity sha512-T5ZJCNeFpqcLBpx+Hl9r9KoxBCUqeWlJ1Htli+vryigZVJ1vuLB9j35grEBASp4R13KFkV7jM52bBGnArpJN6A== @@ -2270,48 +2281,60 @@ jest-util@^27.0.0, jest-util@^27.2.0: is-ci "^3.0.0" picomatch "^2.2.3" -jest-validate@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.2.2.tgz#e672118f1d9aa57b25b4c7998edc101dabd7020b" - integrity sha512-01mwTAs2kgDuX98Ua3Xhdhp5lXsLU4eyg6k56adTtrXnU/GbLd9uAsh5nc4MWVtUXMeNmHUyEiD4ibLqE8MuNw== +jest-util@^27.2.3: + version "27.2.3" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.2.3.tgz#f766354b7c489c1f9ea88cd1d96d044fbd2b5d4d" + integrity sha512-78BEka2+77lqD7LN4mSzUdZMngHZtVAsmZ5B8+qOWfN4bCYNUmi/eGNLm91jA77gG1QZJSXsDOCWB0qbXDT1Fw== dependencies: - "@jest/types" "^27.1.1" + "@jest/types" "^27.2.3" + "@types/node" "*" + chalk "^4.0.0" + graceful-fs "^4.2.4" + is-ci "^3.0.0" + picomatch "^2.2.3" + +jest-validate@^27.2.3: + version "27.2.3" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.2.3.tgz#4fcc49e581f13fbe260a77e711a80f0256138a7a" + integrity sha512-HUfTZ/W87zoxOuEGC01ujXzoLzRpJqvhMdIrRilpXGmso2vJWw3bHpbWKhivYMr0X/BjitLrHywj/+niNfIcEA== + dependencies: + "@jest/types" "^27.2.3" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^27.0.6" leven "^3.1.0" - pretty-format "^27.2.2" + pretty-format "^27.2.3" -jest-watcher@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.2.2.tgz#8b00253d7e880c6637b402228a76f2fe5ea08132" - integrity sha512-7HJwZq06BCfM99RacCVzXO90B20/dNJvq+Ouiu/VrFdFRCpbnnqlQUEk4KAhBSllgDrTPgKu422SCF5KKBHDRA== +jest-watcher@^27.2.3: + version "27.2.3" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.2.3.tgz#2989228bdd05138094f7ec19a23cbb2665f2efb7" + integrity sha512-SvUmnL/QMb55B6iWJ3Jpq6bG2fSRcrMaGakY60i6j8p9+Ct42mpkq90qaYB+rnSLaiW/QQN+lTJZmK+lA6vksA== dependencies: - "@jest/test-result" "^27.2.2" - "@jest/types" "^27.1.1" + "@jest/test-result" "^27.2.3" + "@jest/types" "^27.2.3" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^27.2.0" + jest-util "^27.2.3" string-length "^4.0.1" -jest-worker@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.2.2.tgz#636deeae8068abbf2b34b4eb9505f8d4e5bd625c" - integrity sha512-aG1xq9KgWB2CPC8YdMIlI8uZgga2LFNcGbHJxO8ctfXAydSaThR4EewKQGg3tBOC+kS3vhPGgymsBdi9VINjPw== +jest-worker@^27.2.3: + version "27.2.3" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.2.3.tgz#396e83d04ca575230a9bcb255c2b66aec07cb931" + integrity sha512-ZwOvv4GCIPviL+Ie4pVguz4N5w/6IGbTaHBYOl3ZcsZZktaL7d8JOU0rmovoED7AJZKA8fvmLbBg8yg80u/tGA== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^27.0.1: - version "27.2.2" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.2.2.tgz#445a4c16aa4c4ae6e512d62fb6f8b2624cbd6c26" - integrity sha512-XAB/9akDTe3/V0wPNKWfP9Y/NT1QPiCqyRBYGbC66EA9EvgAzdaFEqhFGLaDJ5UP2yIyXUMtju9a9IMrlYbZTQ== + version "27.2.3" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.2.3.tgz#9c2af9ce874a3eb202f83d92fbc1cc61ccc73248" + integrity sha512-r4ggA29J5xUg93DpvbsX+AXlFMWE3hZ5Y6BfgTl8PJvWelVezNPkmrsixuGoDBTHTCwScRSH0O4wsoeUgLie2w== dependencies: - "@jest/core" "^27.2.2" + "@jest/core" "^27.2.3" import-local "^3.0.2" - jest-cli "^27.2.2" + jest-cli "^27.2.3" js-tokens@^4.0.0: version "4.0.0" @@ -2713,12 +2736,12 @@ pretty-format@^27.0.0, pretty-format@^27.2.0: ansi-styles "^5.0.0" react-is "^17.0.1" -pretty-format@^27.2.2: - version "27.2.2" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.2.2.tgz#c080f1ab7ac64302e4d438f208596fc649dbeeb3" - integrity sha512-+DdLh+rtaElc2SQOE/YPH8k2g3Rf2OXWEpy06p8Szs3hdVSYD87QOOlYRHWAeb/59XTmeVmRKvDD0svHqf6ycA== +pretty-format@^27.2.3: + version "27.2.3" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.2.3.tgz#c76710de6ebd8b1b412a5668bacf4a6c2f21a029" + integrity sha512-wvg2HzuGKKEE/nKY4VdQ/LM8w8pRZvp0XpqhwgaZBbjTwd5UdF2I4wvwZjyUwu8G+HI6g4t6u9b2FZlKhlzxcQ== dependencies: - "@jest/types" "^27.1.1" + "@jest/types" "^27.2.3" ansi-regex "^5.0.1" ansi-styles "^5.0.0" react-is "^17.0.1" @@ -3182,10 +3205,10 @@ v8-compile-cache@^2.0.3: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== -v8-to-istanbul@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.0.0.tgz#4229f2a99e367f3f018fa1d5c2b8ec684667c69c" - integrity sha512-LkmXi8UUNxnCC+JlH7/fsfsKr5AU110l+SYGJimWNkWhxbN5EyeOtm1MJ0hhvqMMOhGwBj1Fp70Yv9i+hX0QAg== +v8-to-istanbul@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.0.tgz#0aeb763894f1a0a1676adf8a8b7612a38902446c" + integrity sha512-/PRhfd8aTNp9Ggr62HPzXg2XasNFGy5PBt0Rp04du7/8GNNSgxFL6WBTkgMKSL9bFjH+8kKEG3f37FmxiTqUUA== dependencies: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" From 70e7dc0e4e624565b37c90e19d5d483452d63e8b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Sep 2021 12:02:19 +0000 Subject: [PATCH 273/785] Bump @typescript-eslint/eslint-plugin from 4.31.2 to 4.32.0 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.31.2 to 4.32.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.32.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 61 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 48 insertions(+), 13 deletions(-) diff --git a/yarn.lock b/yarn.lock index 47420b72..b38e28f1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -700,27 +700,28 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^4.31.2": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.31.2.tgz#9f41efaee32cdab7ace94b15bd19b756dd099b0a" - integrity sha512-w63SCQ4bIwWN/+3FxzpnWrDjQRXVEGiTt9tJTRptRXeFvdZc/wLiz3FQUwNQ2CVoRGI6KUWMNUj/pk63noUfcA== + version "4.32.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.32.0.tgz#46d2370ae9311092f2a6f7246d28357daf2d4e89" + integrity sha512-+OWTuWRSbWI1KDK8iEyG/6uK2rTm3kpS38wuVifGUTDB6kjEuNrzBI1MUtxnkneuWG/23QehABe2zHHrj+4yuA== dependencies: - "@typescript-eslint/experimental-utils" "4.31.2" - "@typescript-eslint/scope-manager" "4.31.2" + "@typescript-eslint/experimental-utils" "4.32.0" + "@typescript-eslint/scope-manager" "4.32.0" debug "^4.3.1" functional-red-black-tree "^1.0.1" + ignore "^5.1.8" regexpp "^3.1.0" semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/experimental-utils@4.31.2": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.31.2.tgz#98727a9c1e977dd5d20c8705e69cd3c2a86553fa" - integrity sha512-3tm2T4nyA970yQ6R3JZV9l0yilE2FedYg8dcXrTar34zC9r6JB7WyBQbpIVongKPlhEMjhQ01qkwrzWy38Bk1Q== +"@typescript-eslint/experimental-utils@4.32.0": + version "4.32.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.32.0.tgz#53a8267d16ca5a79134739129871966c56a59dc4" + integrity sha512-WLoXcc+cQufxRYjTWr4kFt0DyEv6hDgSaFqYhIzQZ05cF+kXfqXdUh+//kgquPJVUBbL3oQGKQxwPbLxHRqm6A== dependencies: "@types/json-schema" "^7.0.7" - "@typescript-eslint/scope-manager" "4.31.2" - "@typescript-eslint/types" "4.31.2" - "@typescript-eslint/typescript-estree" "4.31.2" + "@typescript-eslint/scope-manager" "4.32.0" + "@typescript-eslint/types" "4.32.0" + "@typescript-eslint/typescript-estree" "4.32.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -742,11 +743,24 @@ "@typescript-eslint/types" "4.31.2" "@typescript-eslint/visitor-keys" "4.31.2" +"@typescript-eslint/scope-manager@4.32.0": + version "4.32.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.32.0.tgz#e03c8668f8b954072b3f944d5b799c0c9225a7d5" + integrity sha512-DK+fMSHdM216C0OM/KR1lHXjP1CNtVIhJ54kQxfOE6x8UGFAjha8cXgDMBEIYS2XCYjjCtvTkjQYwL3uvGOo0w== + dependencies: + "@typescript-eslint/types" "4.32.0" + "@typescript-eslint/visitor-keys" "4.32.0" + "@typescript-eslint/types@4.31.2": version "4.31.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.31.2.tgz#2aea7177d6d744521a168ed4668eddbd912dfadf" integrity sha512-kWiTTBCTKEdBGrZKwFvOlGNcAsKGJSBc8xLvSjSppFO88AqGxGNYtF36EuEYG6XZ9vT0xX8RNiHbQUKglbSi1w== +"@typescript-eslint/types@4.32.0": + version "4.32.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.32.0.tgz#52c633c18da47aee09449144bf59565ab36df00d" + integrity sha512-LE7Z7BAv0E2UvqzogssGf1x7GPpUalgG07nGCBYb1oK4mFsOiFC/VrSMKbZQzFJdN2JL5XYmsx7C7FX9p9ns0w== + "@typescript-eslint/typescript-estree@4.31.2": version "4.31.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.2.tgz#abfd50594d8056b37e7428df3b2d185ef2d0060c" @@ -760,6 +774,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@4.32.0": + version "4.32.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.32.0.tgz#db00ccc41ccedc8d7367ea3f50c6994b8efa9f3b" + integrity sha512-tRYCgJ3g1UjMw1cGG8Yn1KzOzNlQ6u1h9AmEtPhb5V5a1TmiHWcRyF/Ic+91M4f43QeChyYlVTcf3DvDTZR9vw== + dependencies: + "@typescript-eslint/types" "4.32.0" + "@typescript-eslint/visitor-keys" "4.32.0" + debug "^4.3.1" + globby "^11.0.3" + is-glob "^4.0.1" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/visitor-keys@4.31.2": version "4.31.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.2.tgz#7d5b4a4705db7fe59ecffb273c1d082760f635cc" @@ -768,6 +795,14 @@ "@typescript-eslint/types" "4.31.2" eslint-visitor-keys "^2.0.0" +"@typescript-eslint/visitor-keys@4.32.0": + version "4.32.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.32.0.tgz#455ba8b51242f2722a497ffae29313f33b14cb7f" + integrity sha512-e7NE0qz8W+atzv3Cy9qaQ7BTLwWsm084Z0c4nIO2l3Bp6u9WIgdqCgyPyV5oSPDMIW3b20H59OOCmVk3jw3Ptw== + dependencies: + "@typescript-eslint/types" "4.32.0" + eslint-visitor-keys "^2.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" @@ -1751,7 +1786,7 @@ ignore@^4.0.6: resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== -ignore@^5.1.4: +ignore@^5.1.4, ignore@^5.1.8: version "5.1.8" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== From 714007ebf5a765dc60d8d63d2fd6095f3587a006 Mon Sep 17 00:00:00 2001 From: Nat Budin Date: Fri, 13 Aug 2021 12:44:52 -0700 Subject: [PATCH 274/785] Embedded formatter indentation fixes * Change the strategy for how we indent squiggly heredocs: dedent the entire heredoc one level (to be on the same level as the statement that started it) and then indent the formatted doc, using a hard line break to separate the ending heredoc token * Don't consider empty lines as part of the common leading whitespace calculation Co-authored-by: Miriam Lauter --- src/ruby/embed.ts | 16 +++++++--- test/js/ruby/embed.test.ts | 62 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 4 deletions(-) diff --git a/src/ruby/embed.ts b/src/ruby/embed.ts index 91df4dd3..2df3d380 100644 --- a/src/ruby/embed.ts +++ b/src/ruby/embed.ts @@ -2,8 +2,15 @@ import type { Plugin, Ruby } from "../types"; import prettier from "../prettier"; import { literallineWithoutBreakParent } from "../utils"; -const { group, indent, lineSuffix, mapDoc, markAsRoot, stripTrailingHardline } = - prettier; +const { + group, + indent, + dedent, + lineSuffix, + mapDoc, + markAsRoot, + stripTrailingHardline +} = prettier; const parsers: Record = { css: "css", @@ -47,6 +54,7 @@ function getCommonLeadingWhitespace(content: string) { return content .split("\n") .slice(0, -1) + .filter((line) => line.trim().length > 0) .reduce((minimum, line) => { const matched = pattern.exec(line); const length = matched ? matched[0].length : 0; @@ -109,9 +117,9 @@ const embed: Plugin.Embed = (path, print, textToDoc) => { return [ path.call(print, "beging"), lineSuffix( - group([ + dedent([ indent(markAsRoot(formatted)), - literallineWithoutBreakParent, + { type: "line", hard: true }, ending.trim() ]) ) diff --git a/test/js/ruby/embed.test.ts b/test/js/ruby/embed.test.ts index 78978968..c294f107 100644 --- a/test/js/ruby/embed.test.ts +++ b/test/js/ruby/embed.test.ts @@ -78,4 +78,66 @@ describe("embed", () => { return expect(content).toChangeFormat(expected); }); + + test("keeps parent indentation", () => { + const content = ruby(` + some_block do + another_block do + x += 1 + description <<~JS + // This is a DSL method on the another_block inner block. + // This is another line of the string. + JS + end + end + `); + + return expect(content).toMatchFormat(); + }); + + test("correctly indents nested code while keeping parent indentation", () => { + const content = ruby(` + some_block do + another_block do + x += 1 + description <<~JS + [1, function () { return 2; }, 3]; + JS + end + end + `); + const expected = ruby(` + some_block do + another_block do + x += 1 + description <<~JS + [ + 1, + function () { + return 2; + }, + 3 + ]; + JS + end + end + `); + + return expect(content).toChangeFormat(expected); + }); + + test("doesn't consider empty lines as part of the common leading whitespace", () => { + const content = ruby(` + some_block do + x += 1 + description <<~MARKDOWN + This is a line. It's followed by two literal line breaks. + + This is another line of the string. + MARKDOWN + end + `); + + return expect(content).toMatchFormat(); + }); }); From 882f5480347f6e0beb156590ab964b058452ba87 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 28 Sep 2021 23:00:02 -0400 Subject: [PATCH 275/785] Fix for #929 --- CHANGELOG.md | 1 + src/ruby/nodes/calls.ts | 16 ++++++++++++++++ test/js/ruby/nodes/calls.test.ts | 10 +--------- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f7d5b08..80f951ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#957](https://github.com/prettier/plugin-ruby/issues/957) - azz, kddnewton - Make it so that the format pragma does not have to be on the first line of the file. - [#895](https://github.com/prettier/plugin-ruby/issues/895) - rsslldnphy, kddnewton - Ensure quotes are properly escaped in the content of a hash value for HAML attributes. - [#900](https://github.com/prettier/plugin-ruby/issues/900) - rsslldnphy, kddnewton - Ensure that in a HAML line where you have interpolation inside of a tag content that you print it properly. +- [#929](https://github.com/prettier/plugin-ruby/issues/929) - ryanb, kddnewton - Deeply nested blocks should not break their call chains. ## [1.6.1] - 2021-06-30 diff --git a/src/ruby/nodes/calls.ts b/src/ruby/nodes/calls.ts index dbb55964..2db30a65 100644 --- a/src/ruby/nodes/calls.ts +++ b/src/ruby/nodes/calls.ts @@ -253,6 +253,22 @@ export const printMethodAddBlock: Plugin.Printer = ( (node.chain || 0) >= 3 && node.breakDoc ) { + // This is pretty specialized behavior. Basically if we're at the top of a + // chain but we've only had method calls without arguments and now we have + // a method call with a block, then we're effectively trying to call a + // method with arguments that is nested under a bunch of stuff. So we group + // together to first part to make it so just the block breaks. This looks + // like, for example: + // + // Rails.application.routes.draw do + // root 'articles#index' + // resources :articles + // end + // + if (node.callChain === node.chain) { + return [group(indent(node.breakDoc)), group(blockDoc)]; + } + return ifBreak(group(indent(node.breakDoc.concat(blockDoc))), [ callDoc, blockDoc diff --git a/test/js/ruby/nodes/calls.test.ts b/test/js/ruby/nodes/calls.test.ts index 0cc6f78a..ea8af45a 100644 --- a/test/js/ruby/nodes/calls.test.ts +++ b/test/js/ruby/nodes/calls.test.ts @@ -47,15 +47,7 @@ describe("calls", () => { end `); - const expected = ruby(` - aaa - .bbb - .ccc - .ddd - .eee { ${block} } - `); - - return expect(content).toChangeFormat(expected); + return expect(content).toMatchFormat(); }); test("tons of calls that fit on one line", () => { From ceae941939ce046741b65d123d8142ecdb8a034d Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 28 Sep 2021 23:03:18 -0400 Subject: [PATCH 276/785] Update CHANGELOG with entry for embedded formatting --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80f951ba..5e5768cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#895](https://github.com/prettier/plugin-ruby/issues/895) - rsslldnphy, kddnewton - Ensure quotes are properly escaped in the content of a hash value for HAML attributes. - [#900](https://github.com/prettier/plugin-ruby/issues/900) - rsslldnphy, kddnewton - Ensure that in a HAML line where you have interpolation inside of a tag content that you print it properly. - [#929](https://github.com/prettier/plugin-ruby/issues/929) - ryanb, kddnewton - Deeply nested blocks should not break their call chains. +- [#935](https://github.com/prettier/plugin-ruby/pull/935) - nbudin, mlauter - Ensure embedded formatting heredocs are properly indented. ## [1.6.1] - 2021-06-30 From 5d8f83757e5b88e1a9631f250151cdb61b27df6c Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 28 Sep 2021 23:28:23 -0400 Subject: [PATCH 277/785] Document the TypeScript change --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e5768cd..cf77c475 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Added + +- [#949](https://github.com/prettier/plugin-ruby/pull/949) - kddnewton - Converted over to using TypeScript for development. + ### Changed - [#958](https://github.com/prettier/plugin-ruby/issues/958) - mharris-figma, kddnewton - Handle optional `do` keyword in `for` loop expressions. From 5d8cc3cf9d52465296adc05642c942a7a4ecdae1 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 12:13:59 -0400 Subject: [PATCH 278/785] Spawn the server without using sleep --- package.json | 2 +- src/parser/getInfo.js | 10 ++++ src/parser/parseSync.ts | 106 ++++++++++++++++------------------------ src/parser/server.rb | 37 +++++++------- 4 files changed, 70 insertions(+), 85 deletions(-) create mode 100644 src/parser/getInfo.js diff --git a/package.json b/package.json index 99604db2..9e2905de 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "checkFormat": "prettier --check '**/*'", "lint": "eslint --cache .", - "prepublishOnly": "tsc -p tsconfig.build.json && cp src/parser/netcat.js dist/parser && cp src/parser/server.rb dist/parser && cp src/haml/parser.rb dist/haml && cp src/rbs/parser.rb dist/rbs && cp src/ruby/parser.rb dist/ruby", + "prepublishOnly": "tsc -p tsconfig.build.json && cp src/parser/getInfo.js dist/parser && cp src/parser/netcat.js dist/parser && cp src/parser/server.rb dist/parser && cp src/haml/parser.rb dist/haml && cp src/rbs/parser.rb dist/rbs && cp src/ruby/parser.rb dist/ruby", "test": "jest" }, "repository": { diff --git a/src/parser/getInfo.js b/src/parser/getInfo.js new file mode 100644 index 00000000..ba9bf4ba --- /dev/null +++ b/src/parser/getInfo.js @@ -0,0 +1,10 @@ +// eslint-disable-next-line @typescript-eslint/no-var-requires +const { existsSync, readFileSync } = require("fs"); + +const filepath = process.argv[process.argv.length - 1]; +const timeout = setInterval(() => { + if (existsSync(filepath)) { + process.stdout.write(readFileSync(filepath).toString("utf8")); + clearTimeout(timeout); + } +}, 50); diff --git a/src/parser/parseSync.ts b/src/parser/parseSync.ts index c1f485ff..497224c3 100644 --- a/src/parser/parseSync.ts +++ b/src/parser/parseSync.ts @@ -1,6 +1,6 @@ import type { Plugin } from "../types"; -import { spawn, spawnSync, execSync } from "child_process"; -import { existsSync, mkdtempSync } from "fs"; +import { spawn, spawnSync } from "child_process"; +import fs, { readFileSync, unlinkSync } from "fs"; import os from "os"; import path from "path"; import process from "process"; @@ -10,8 +10,6 @@ type NetcatConfig = { command: string; args: string[] }; let netcatConfig: NetcatConfig; let parserArgs: undefined | string | string[] = process.env.PRETTIER_RUBY_HOST; -const isWindows = os.type() === "Windows_NT"; - // In order to properly parse ruby code, we need to tell the ruby process to // parse using UTF-8. Unfortunately, the way that you accomplish this looks // differently depending on your platform. @@ -47,54 +45,6 @@ function getLang() { }[platform]; } -function spawnParseServerWithArgs(args: string[]) { - const server = spawn( - "ruby", - [path.join(__dirname, "./server.rb")].concat(args), - { - env: Object.assign({}, process.env, { LANG: getLang() }), - detached: true, - stdio: "inherit" - } - ); - - process.on("exit", () => { - try { - if (server.pid) { - process.kill(-server.pid); - } - } catch (e) { - // ignore - } - }); - - server.unref(); -} - -function spawnUnixParseServer() { - const tmpDir = mkdtempSync(path.join(os.tmpdir(), "prettier-ruby")); - const tmpFile = path.join(tmpDir, `${process.pid}.sock`); - - spawnParseServerWithArgs(["--unix", tmpFile]); - const now = new Date().getTime(); - - // Wait for server to go live. - while (!existsSync(tmpFile) && new Date().getTime() - now < 3000) { - execSync("sleep 0.1"); - } - - return tmpFile; -} - -function spawnTCPParseServer() { - const port = "8912"; - - spawnParseServerWithArgs(["--tcp", port]); - execSync("sleep 1"); - - return ["127.0.0.1", port]; -} - // Finds a netcat-like adapter to use for sending data to a socket. We order // these by likelihood of being found so we can avoid some shell-outs. function findNetcatConfig(opts: Plugin.Options): NetcatConfig { @@ -103,7 +53,7 @@ function findNetcatConfig(opts: Plugin.Options): NetcatConfig { return { command: splits[0], args: splits.slice(1) }; } - if (isWindows) { + if (os.type() === "Windows_NT") { if (spawnSync("command", ["-v", "nc"]).status === 0) { return { command: "nc", args: [] }; } @@ -112,15 +62,15 @@ function findNetcatConfig(opts: Plugin.Options): NetcatConfig { return { command: "telnet", args: [] }; } } else { - if (spawnSync("where", ["nc"]).status === 0) { + if (spawnSync("which", ["nc"]).status === 0) { return { command: "nc", args: ["-U"] }; } - if (spawnSync("where", ["telnet"]).status === 0) { + if (spawnSync("which", ["telnet"]).status === 0) { return { command: "telnet", args: ["-u"] }; } - if (spawnSync("where", ["ncat"]).status === 0) { + if (spawnSync("which", ["ncat"]).status === 0) { return { command: "ncat", args: ["-U"] }; } } @@ -142,16 +92,42 @@ function parseSync(parser: string, source: string, opts: Plugin.Options) { } if (!parserArgs) { - parserArgs = isWindows ? spawnTCPParseServer() : spawnUnixParseServer(); - - let ping: { status: null | number } = { status: 1 }; - while (ping.status !== 0) { - ping = spawnSync( - netcatConfig.command, - [...netcatConfig.args, ...parserArgs], - { input: "ping" } - ); + const filepath = `/tmp/prettier-ruby-parser-${process.pid}`; + process.on("exit", () => unlinkSync(filepath)); + + const server = spawn( + "ruby", + [path.join(__dirname, "./server.rb"), filepath], + { + env: Object.assign({}, process.env, { LANG: getLang() }), + detached: true, + stdio: "inherit" + } + ); + + process.on("exit", () => { + try { + if (server.pid) { + process.kill(-server.pid); + } + } catch (e) { + // ignore + } + }); + + server.unref(); + + const info = spawnSync("node", [path.join(__dirname, "./getInfo.js"), filepath]); + if (info.status !== 0) { + throw new Error(` + We failed to spawn our parser server. Please report this error on GitHub + at https://github.com/prettier/plugin-ruby. The error message was: + + ${info.stderr.toString()}. + `); } + + parserArgs = info.stdout.toString(); } const response = spawnSync( diff --git a/src/parser/server.rb b/src/parser/server.rb index 7eaa1ba0..54d21558 100644 --- a/src/parser/server.rb +++ b/src/parser/server.rb @@ -3,14 +3,12 @@ require 'bundler/setup' if ENV['PLUGIN_RUBY_CI'] require 'socket' require 'json' +require 'fileutils' require_relative '../ruby/parser' require_relative '../rbs/parser' require_relative '../haml/parser' -# Set the program name so that it's easy to find if we need it -$PROGRAM_NAME = 'prettier-ruby-parser' - # Make sure we trap these signals to be sure we get the quit command coming from # the parent node process quit = false @@ -18,25 +16,28 @@ trap(:TERM) { quit = true } trap(:QUIT) { quit = true } if Signal.list.key?('QUIT') -case ARGV[0] -when '--tcp' - server = TCPServer.new('127.0.0.1', ARGV[1]) +if Gem.win_platform? + # If we're on windows, we're going to start up a TCP server. The 0 here means + # to bind to some available port. + server = TCPServer.new('127.0.0.1', 0) + + address = server.local_address + File.write(ARGV[0], "#{address.ip_address} #{address.ip_port}") + at_exit { server.close } -when '--unix' - server = UNIXServer.new(ARGV[1]) +else + # If we're not on windows, then we're going to assume we can use unix socket + # files (since they're faster than a TCP server). + filepath = "/tmp/prettier-ruby-parser-#{Process.pid}.sock" + server = UNIXServer.new(filepath) + + address = server.local_address + File.write(ARGV[0], address.unix_path) at_exit do server.close - File.unlink(ARGV[1]) + File.unlink(filepath) end -else - warn(<<~USAGE) - Run the server with one of: - - ruby server.rb --tcp [PORT] - ruby server.rb --unix [PATH] - USAGE - exit 1 end loop do @@ -48,8 +49,6 @@ response = case parser - when 'ping' - :ok when 'ruby' Prettier::Parser.parse(source) when 'rbs' From 1a41c765071b68be5ff9aef550504a5166b73b7a Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 13:56:26 -0400 Subject: [PATCH 279/785] Just use a single parser server for the test suite --- src/parser/parseSync.ts | 80 ++++++++++++++++++++------------------- test/js/globalSetup.ts | 55 +++++++++++++++++---------- test/js/globalTeardown.ts | 8 ++-- test/js/setupTests.ts | 54 +------------------------- 4 files changed, 84 insertions(+), 113 deletions(-) diff --git a/src/parser/parseSync.ts b/src/parser/parseSync.ts index 497224c3..32b20f86 100644 --- a/src/parser/parseSync.ts +++ b/src/parser/parseSync.ts @@ -1,6 +1,6 @@ import type { Plugin } from "../types"; import { spawn, spawnSync } from "child_process"; -import fs, { readFileSync, unlinkSync } from "fs"; +import { unlinkSync } from "fs"; import os from "os"; import path from "path"; import process from "process"; @@ -14,7 +14,7 @@ let parserArgs: undefined | string | string[] = process.env.PRETTIER_RUBY_HOST; // parse using UTF-8. Unfortunately, the way that you accomplish this looks // differently depending on your platform. /* istanbul ignore next */ -function getLang() { +export function getLang() { const { env, platform } = process; const envValue = env.LC_ALL || env.LC_CTYPE || env.LANG; @@ -45,6 +45,45 @@ function getLang() { }[platform]; } +function spawnServer() { + const filepath = `/tmp/prettier-ruby-parser-${process.pid}.info`; + const server = spawn( + "ruby", + [path.join(__dirname, "./server.rb"), filepath], + { + env: Object.assign({}, process.env, { LANG: getLang() }), + detached: true, + stdio: "inherit" + } + ); + + server.unref(); + process.on("exit", () => { + unlinkSync(filepath); + + if (server?.pid) { + try { + server.kill(-server.pid); + } catch (e) { + // ignore + } + } + }); + + const info = spawnSync("node", [path.join(__dirname, "./getInfo.js"), filepath]); + if (info.status !== 0) { + throw new Error(` + We failed to spawn our parser server. Please report this error on GitHub + at https://github.com/prettier/plugin-ruby. The error message was: + + ${info.stderr.toString()}. + `); + } + + parserArgs = info.stdout.toString(); + return parserArgs; +} + // Finds a netcat-like adapter to use for sending data to a socket. We order // these by likelihood of being found so we can avoid some shell-outs. function findNetcatConfig(opts: Plugin.Options): NetcatConfig { @@ -92,42 +131,7 @@ function parseSync(parser: string, source: string, opts: Plugin.Options) { } if (!parserArgs) { - const filepath = `/tmp/prettier-ruby-parser-${process.pid}`; - process.on("exit", () => unlinkSync(filepath)); - - const server = spawn( - "ruby", - [path.join(__dirname, "./server.rb"), filepath], - { - env: Object.assign({}, process.env, { LANG: getLang() }), - detached: true, - stdio: "inherit" - } - ); - - process.on("exit", () => { - try { - if (server.pid) { - process.kill(-server.pid); - } - } catch (e) { - // ignore - } - }); - - server.unref(); - - const info = spawnSync("node", [path.join(__dirname, "./getInfo.js"), filepath]); - if (info.status !== 0) { - throw new Error(` - We failed to spawn our parser server. Please report this error on GitHub - at https://github.com/prettier/plugin-ruby. The error message was: - - ${info.stderr.toString()}. - `); - } - - parserArgs = info.stdout.toString(); + parserArgs = spawnServer(); } const response = spawnSync( diff --git a/test/js/globalSetup.ts b/test/js/globalSetup.ts index 262b2e43..33a4a172 100644 --- a/test/js/globalSetup.ts +++ b/test/js/globalSetup.ts @@ -1,30 +1,47 @@ import { spawn, spawnSync } from "child_process"; -import os from "os"; +import { unlinkSync } from "fs"; +import path from "path"; -// Set a RUBY_VERSION environment variable because certain tests will only run -// for certain versions of Ruby. -const args = ["--disable-gems", "-e", "puts RUBY_VERSION"]; -process.env.RUBY_VERSION = spawnSync("ruby", args).stdout.toString().trim(); +import { getLang } from "../../src/parser/parseSync"; -// Spawn the async parser process so that tests can send their content over to -// it to get back the AST. function globalSetup() { - let parserArgs; + // Set a RUBY_VERSION environment variable because certain tests will only run + // for certain versions of Ruby. + const args = ["--disable-gems", "-e", "puts RUBY_VERSION"]; + process.env.RUBY_VERSION = spawnSync("ruby", args).stdout.toString().trim(); - if (os.type() === "Windows_NT") { - parserArgs = ["--tcp", "8912"]; - } else { - parserArgs = ["--unix", `/tmp/prettier-ruby-test-${process.pid}.sock`]; - } + // Set up just one parsing server for the entirety of the test suite. + const filepath = `/tmp/prettier-ruby-parser-${process.pid}.info`; + const server = spawn( + "ruby", + [path.join(__dirname, "../../src/parser/server.rb"), filepath], + { + env: Object.assign({}, process.env, { LANG: getLang() }), + detached: true, + stdio: "inherit" + } + ); + + // Get the connection information from the parsing server. + const info = spawnSync("node", [ + path.join(__dirname, "../../src/parser/getInfo.js"), + filepath + ]); - if (!process.env.PRETTIER_RUBY_HOST) { - process.env.PRETTIER_RUBY_HOST = parserArgs[1]; + if (info.status !== 0) { + throw new Error(` + We failed to spawn our parser server. Please report this error on GitHub + at https://github.com/prettier/plugin-ruby. The error message was: + + ${info.stderr.toString()}. + `); } - (global as any).__ASYNC_PARSER__ = spawn("ruby", [ - "./src/parser/server.rb", - ...parserArgs - ]); + process.env.PRETTIER_RUBY_HOST = info.stdout.toString(); + process.env.PRETTIER_RUBY_PID = `${server.pid}`; + + unlinkSync(filepath); + server.unref(); } export default globalSetup; diff --git a/test/js/globalTeardown.ts b/test/js/globalTeardown.ts index a580b073..e9d6151c 100644 --- a/test/js/globalTeardown.ts +++ b/test/js/globalTeardown.ts @@ -1,7 +1,9 @@ function globalTeardown() { - // Send a SIGINT over to the async parser process so that we can be sure we've - // terminated it before we finish the test suite. - (global as any).__ASYNC_PARSER__.kill("SIGINT"); + const prettierRubyPID = process.env.PRETTIER_RUBY_PID; + + if (prettierRubyPID) { + process.kill(-parseInt(prettierRubyPID, 10)); + } } export default globalTeardown; diff --git a/test/js/setupTests.ts b/test/js/setupTests.ts index bb5b8a87..686bfb1f 100644 --- a/test/js/setupTests.ts +++ b/test/js/setupTests.ts @@ -1,45 +1,9 @@ -import net from "net"; import prettier from "prettier"; import type { Plugin } from "../../src/types"; import type { Code } from "./types"; import plugin from "../../src/plugin"; -// eslint-disable-next-line no-underscore-dangle -const { formatAST } = (prettier as any).__debug; - -function parseAsync(parser: string, source: string) { - return new Promise((resolve, reject) => { - const client = new net.Socket(); - - client.setTimeout(10 * 1000, () => { - client.destroy(); - reject(new Error("Connection to the server timed out.")); - }); - - client.on("error", (error) => { - client.destroy(); - reject(error); - }); - - client.on("end", () => { - client.destroy(); - reject(new Error("Server closed the connection.")); - }); - - client.on("data", (data) => { - client.destroy(); - - const response = JSON.parse(data.toString()); - (response.error ? reject : resolve)(response); - }); - - client.connect(process.env.PRETTIER_RUBY_HOST || "", () => { - client.end(`${parser}|${source}`); - }); - }); -} - function checkFormat( before: Code, after: Code, @@ -53,23 +17,7 @@ function checkFormat( config ); - return new Promise((resolve, reject) => { - if ( - opts.parser === "ruby" && - (originalText.includes("#") || originalText.includes("=begin")) - ) { - // If the source includes an #, then this test has a comment in it. - // Unfortunately, formatAST expects comments to already be attached, but - // prettier doesn't export anything that allows you to hook into their - // attachComments function. So in this case, we need to instead go through - // the normal format function and spawn a process. - resolve(prettier.format(originalText, opts)); - } else { - parseAsync(opts.parser, originalText) - .then((ast) => resolve(formatAST(ast, opts).formatted)) - .catch(reject); - } - }) + return new Promise((resolve) => resolve(prettier.format(originalText, opts))) .then((formatted) => ({ pass: (formatted as string).replace(/\r\n/g, "\n") === `${after}\n`, message: () => `Expected:\n${after}\nReceived:\n${formatted}` From 867b56f565e84db2985e7a2820c4fbd7afae3ae0 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 14:34:21 -0400 Subject: [PATCH 280/785] Switch over all the tests to not return promises --- src/parser/parseSync.ts | 5 +- test/js/haml/comment.test.ts | 11 +- test/js/haml/doctype.test.ts | 40 +++- test/js/haml/filter.test.ts | 14 +- test/js/haml/hamlComment.test.ts | 15 +- test/js/haml/plain.test.ts | 11 +- test/js/haml/script.test.ts | 23 ++- test/js/haml/silentScript.test.ts | 14 +- test/js/haml/tag.test.ts | 68 ++++--- test/js/rbs/parser.test.ts | 10 +- test/js/rbs/rbs.test.ts | 92 +++++---- test/js/ruby/comments.test.ts | 45 +++-- test/js/ruby/embed.test.ts | 17 +- test/js/ruby/encoding.test.ts | 18 +- test/js/ruby/ignore.test.ts | 2 +- test/js/ruby/layout.test.ts | 22 ++- test/js/ruby/nodes/alias.test.ts | 49 +++-- test/js/ruby/nodes/aref.test.ts | 23 ++- test/js/ruby/nodes/arrays.test.ts | 107 ++++++---- test/js/ruby/nodes/assign.test.ts | 95 +++++---- test/js/ruby/nodes/binary.test.ts | 17 +- test/js/ruby/nodes/blocks.test.ts | 129 +++++++----- test/js/ruby/nodes/break.test.ts | 30 +-- test/js/ruby/nodes/calls.test.ts | 56 +++--- test/js/ruby/nodes/case.test.ts | 16 +- test/js/ruby/nodes/class.test.ts | 32 +-- test/js/ruby/nodes/conditionals.test.ts | 238 ++++++++++++---------- test/js/ruby/nodes/defined.test.ts | 28 ++- test/js/ruby/nodes/embdoc.test.ts | 6 +- test/js/ruby/nodes/field.test.ts | 13 +- test/js/ruby/nodes/hashes.test.ts | 153 +++++++++------ test/js/ruby/nodes/heredocs.test.ts | 88 ++++----- test/js/ruby/nodes/hooks.test.ts | 24 ++- test/js/ruby/nodes/kwargs.test.ts | 13 +- test/js/ruby/nodes/lambda.test.ts | 112 ++++++----- test/js/ruby/nodes/loops.test.ts | 98 ++++++---- test/js/ruby/nodes/massign.test.ts | 75 ++++--- test/js/ruby/nodes/method.test.ts | 249 ++++++++++++++---------- test/js/ruby/nodes/next.test.ts | 24 ++- test/js/ruby/nodes/numbers.test.ts | 58 +++--- test/js/ruby/nodes/patterns.test.ts | 12 +- test/js/ruby/nodes/ranges.test.ts | 32 ++- test/js/ruby/nodes/regexp.test.ts | 71 ++++--- test/js/ruby/nodes/rescue.test.ts | 20 +- test/js/ruby/nodes/return.test.ts | 77 +++++--- test/js/ruby/nodes/strings.test.ts | 239 ++++++++++++++--------- test/js/ruby/nodes/super.test.ts | 57 ++++-- test/js/ruby/nodes/unary.test.ts | 8 +- test/js/ruby/nodes/undef.test.ts | 25 ++- test/js/ruby/nodes/yield.test.ts | 24 ++- test/js/ruby/toProc.test.ts | 78 ++++---- test/js/setupTests.ts | 46 ++--- 52 files changed, 1690 insertions(+), 1139 deletions(-) diff --git a/src/parser/parseSync.ts b/src/parser/parseSync.ts index 32b20f86..00f826a3 100644 --- a/src/parser/parseSync.ts +++ b/src/parser/parseSync.ts @@ -70,7 +70,10 @@ function spawnServer() { } }); - const info = spawnSync("node", [path.join(__dirname, "./getInfo.js"), filepath]); + const info = spawnSync("node", [ + path.join(__dirname, "./getInfo.js"), + filepath + ]); if (info.status !== 0) { throw new Error(` We failed to spawn our parser server. Please report this error on GitHub diff --git a/test/js/haml/comment.test.ts b/test/js/haml/comment.test.ts index 40263ba9..0b29db72 100644 --- a/test/js/haml/comment.test.ts +++ b/test/js/haml/comment.test.ts @@ -1,8 +1,9 @@ import { haml } from "../utils"; describe("comment", () => { - test("single line", () => - expect(haml("/ This is the peanutbutterjelly element")).toMatchFormat()); + test("single line", () => { + expect(haml("/ This is the peanutbutterjelly element")).toMatchFormat(); + }); test("multi line", () => { const content = haml(` @@ -10,7 +11,7 @@ describe("comment", () => { %p This doesn't render, because it's commented out! `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("conditional", () => { @@ -19,7 +20,7 @@ describe("comment", () => { %h1 Get Firefox `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("revealed", () => { @@ -28,6 +29,6 @@ describe("comment", () => { You are not using Internet Explorer, or are using version 10+. `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); diff --git a/test/js/haml/doctype.test.ts b/test/js/haml/doctype.test.ts index 6f71b1e6..bd1ffe58 100644 --- a/test/js/haml/doctype.test.ts +++ b/test/js/haml/doctype.test.ts @@ -1,23 +1,43 @@ import { haml } from "../utils"; describe("doctype", () => { - test("basic", () => expect(haml("!!! Basic")).toMatchFormat()); + test("basic", () => { + expect(haml("!!! Basic")).toMatchFormat(); + }); - test("frameset", () => expect(haml("!!! Frameset")).toMatchFormat()); + test("frameset", () => { + expect(haml("!!! Frameset")).toMatchFormat(); + }); - test("mobile", () => expect(haml("!!! Mobile")).toMatchFormat()); + test("mobile", () => { + expect(haml("!!! Mobile")).toMatchFormat(); + }); - test("rdfa", () => expect(haml("!!! RDFa")).toMatchFormat()); + test("rdfa", () => { + expect(haml("!!! RDFa")).toMatchFormat(); + }); - test("strict", () => expect(haml("!!! Strict")).toMatchFormat()); + test("strict", () => { + expect(haml("!!! Strict")).toMatchFormat(); + }); - test("xml", () => expect(haml("!!! XML")).toMatchFormat()); + test("xml", () => { + expect(haml("!!! XML")).toMatchFormat(); + }); - test("encoding", () => expect(haml("!!! XML iso-8859-1")).toMatchFormat()); + test("encoding", () => { + expect(haml("!!! XML iso-8859-1")).toMatchFormat(); + }); - test("1.1", () => expect(haml("!!! 1.1")).toMatchFormat()); + test("1.1", () => { + expect(haml("!!! 1.1")).toMatchFormat(); + }); - test("5", () => expect(haml("!!! 5")).toMatchFormat()); + test("5", () => { + expect(haml("!!! 5")).toMatchFormat(); + }); - test("misc", () => expect(haml("!!! foo")).toMatchFormat()); + test("misc", () => { + expect(haml("!!! foo")).toMatchFormat(); + }); }); diff --git a/test/js/haml/filter.test.ts b/test/js/haml/filter.test.ts index 429a8882..f00aad6c 100644 --- a/test/js/haml/filter.test.ts +++ b/test/js/haml/filter.test.ts @@ -7,7 +7,7 @@ describe("filter", () => { -# comment `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("custom", () => { @@ -17,7 +17,7 @@ describe("filter", () => { bar `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("css", () => { @@ -26,7 +26,7 @@ describe("filter", () => { .foo { height: 100px; width: 100px; } `); - return expect(content).toChangeFormat( + expect(content).toChangeFormat( haml(` :css .foo { @@ -43,7 +43,7 @@ describe("filter", () => { 1+1 `); - return expect(content).toChangeFormat( + expect(content).toChangeFormat( haml(` :javascript 1 + 1; @@ -57,7 +57,7 @@ describe("filter", () => { .foo { .bar { height: 100px; } } `); - return expect(content).toChangeFormat( + expect(content).toChangeFormat( haml(` :less .foo { @@ -75,7 +75,7 @@ describe("filter", () => { *Hello, world!* `); - return expect(content).toChangeFormat( + expect(content).toChangeFormat( haml(` :markdown _Hello, world!_ @@ -89,7 +89,7 @@ describe("filter", () => { .foo { .bar { height: 100px; } } `); - return expect(content).toChangeFormat( + expect(content).toChangeFormat( haml(` :scss .foo { diff --git a/test/js/haml/hamlComment.test.ts b/test/js/haml/hamlComment.test.ts index 55b4823b..de38dfae 100644 --- a/test/js/haml/hamlComment.test.ts +++ b/test/js/haml/hamlComment.test.ts @@ -1,9 +1,13 @@ import { haml } from "../utils"; describe("haml comment", () => { - test("empty", () => expect(haml("-#")).toMatchFormat()); + test("empty", () => { + expect(haml("-#")).toMatchFormat(); + }); - test("same line", () => expect(haml("-# comment")).toMatchFormat()); + test("same line", () => { + expect(haml("-# comment")).toMatchFormat(); + }); test("multi line", () => { const content = haml(` @@ -13,9 +17,10 @@ describe("haml comment", () => { comment `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); - test("weird spacing same line", () => - expect(haml("-# foobar ")).toChangeFormat("-# foobar")); + test("weird spacing same line", () => { + expect(haml("-# foobar ")).toChangeFormat("-# foobar"); + }); }); diff --git a/test/js/haml/plain.test.ts b/test/js/haml/plain.test.ts index 99ba5694..4f824053 100644 --- a/test/js/haml/plain.test.ts +++ b/test/js/haml/plain.test.ts @@ -3,10 +3,11 @@ import { haml } from "../utils"; describe("plain", () => { const specialChars = ["%", ".", "#", "/", "!", "=", "&", "~", "-", "\\", ":"]; - test.each(specialChars)("escapes starting %s", (specialChar) => - expect(haml(`\\${specialChar}`)).toMatchFormat() - ); + test.each(specialChars)("escapes starting %s", (specialChar) => { + expect(haml(`\\${specialChar}`)).toMatchFormat(); + }); - test("does not unnecessarily escape other characters", () => - expect(haml("foo")).toMatchFormat()); + test("does not unnecessarily escape other characters", () => { + expect(haml("foo")).toMatchFormat(); + }); }); diff --git a/test/js/haml/script.test.ts b/test/js/haml/script.test.ts index c9e86b4e..35569303 100644 --- a/test/js/haml/script.test.ts +++ b/test/js/haml/script.test.ts @@ -1,7 +1,9 @@ import { haml } from "../utils"; describe("script", () => { - test("single line", () => expect(haml('%p= "hello"')).toMatchFormat()); + test("single line", () => { + expect(haml('%p= "hello"')).toMatchFormat(); + }); test("multi line", () => { const content = haml(` @@ -10,14 +12,16 @@ describe("script", () => { = "yo" `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); - test("escape", () => - expect(haml(`& I like #{"cheese & crackers"}`)).toMatchFormat()); + test("escape", () => { + expect(haml(`& I like #{"cheese & crackers"}`)).toMatchFormat(); + }); - test("escape with interpolate", () => - expect(haml(`&= "I like cheese & crackers"`)).toMatchFormat()); + test("escape with interpolate", () => { + expect(haml(`&= "I like cheese & crackers"`)).toMatchFormat(); + }); test("children", () => { const content = haml(` @@ -25,9 +29,10 @@ describe("script", () => { = bar `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); - test("preserve", () => - expect(haml('~ "Foo\\n

Bar\\nBaz
"')).toMatchFormat()); + test("preserve", () => { + expect(haml('~ "Foo\\n
Bar\\nBaz
"')).toMatchFormat(); + }); }); diff --git a/test/js/haml/silentScript.test.ts b/test/js/haml/silentScript.test.ts index f585a826..d263bd14 100644 --- a/test/js/haml/silentScript.test.ts +++ b/test/js/haml/silentScript.test.ts @@ -1,7 +1,9 @@ import { haml } from "../utils"; describe("silent script", () => { - test("single line", () => expect(haml('- foo = "hello"')).toMatchFormat()); + test("single line", () => { + expect(haml('- foo = "hello"')).toMatchFormat(); + }); test("multi-line", () => { const content = haml(` @@ -9,7 +11,7 @@ describe("silent script", () => { - bar `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("multi line with case", () => { @@ -24,7 +26,7 @@ describe("silent script", () => { = "3" `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("multi line with if/else", () => { @@ -38,7 +40,7 @@ describe("silent script", () => { -# qix `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("multi line with unless/else", () => { @@ -52,7 +54,7 @@ describe("silent script", () => { -# qix `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("multi line with embedded", () => { @@ -65,6 +67,6 @@ describe("silent script", () => { %span baz `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); diff --git a/test/js/haml/tag.test.ts b/test/js/haml/tag.test.ts index ede8ad46..6d050a89 100644 --- a/test/js/haml/tag.test.ts +++ b/test/js/haml/tag.test.ts @@ -1,21 +1,33 @@ import { long, haml } from "../utils"; describe("tag", () => { - test("class", () => expect(haml("%p.foo")).toMatchFormat()); + test("class", () => { + expect(haml("%p.foo")).toMatchFormat(); + }); - test("class multiple", () => expect(haml("%p.foo.bar.baz")).toMatchFormat()); + test("class multiple", () => { + expect(haml("%p.foo.bar.baz")).toMatchFormat(); + }); - test("id", () => expect(haml("%p#foo")).toMatchFormat()); + test("id", () => { + expect(haml("%p#foo")).toMatchFormat(); + }); - test("classes and id", () => expect(haml("%p.foo.bar#baz")).toMatchFormat()); + test("classes and id", () => { + expect(haml("%p.foo.bar#baz")).toMatchFormat(); + }); - test("self closing", () => expect(haml("%br/")).toMatchFormat()); + test("self closing", () => { + expect(haml("%br/")).toMatchFormat(); + }); - test("whitespace removal left single line", () => - expect(haml('%p>= "Foo\\nBar"')).toMatchFormat()); + test("whitespace removal left single line", () => { + expect(haml('%p>= "Foo\\nBar"')).toMatchFormat(); + }); - test("whitespace removal right single line", () => - expect(haml('%p<= "Foo\\nBar"')).toMatchFormat()); + test("whitespace removal right single line", () => { + expect(haml('%p<= "Foo\\nBar"')).toMatchFormat(); + }); test("whitespace removal right multi line", () => { const content = haml(` @@ -24,62 +36,62 @@ describe("tag", () => { Foo! `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); - test("dynamic attribute", () => - expect(haml("%span{html_attrs('fr-fr')}")).toMatchFormat()); + test("dynamic attribute", () => { + expect(haml("%span{html_attrs('fr-fr')}")).toMatchFormat(); + }); test("dynamic attributes (ruby hash)", () => { const content = haml("%div{data: { controller: 'lesson-evaluation' }}"); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("dynamic attributes (html-style)", () => { const content = haml("%img(title=@title alt=@alt)/"); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); describe("static attributes", () => { - test("basic", () => - expect(haml("%span(foo)")).toChangeFormat("%span{foo: true}")); + test("basic", () => { + expect(haml("%span(foo)")).toChangeFormat("%span{foo: true}"); + }); test("hash label, single quote", () => { const content = haml(`%section(xml:lang="en" title="title")`); const expected = "%section{'xml:lang': 'en', title: 'title'}"; - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); test("hash label, double quote", () => { const content = haml(`%section(xml:lang="en" title="title")`); const expected = `%section{"xml:lang": "en", title: "title"}`; - return expect(content).toChangeFormat(expected, { - rubySingleQuote: false - }); + expect(content).toChangeFormat(expected, { rubySingleQuote: false }); }); test("hash label, single quote, interpolation", () => { const content = haml(`%section{title: "#{title}"}`); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("hash rocket, single quote", () => { const content = haml(`%section(xml:lang="en" title="title")`); const expected = `%section{:'xml:lang' => 'en', :title => 'title'}`; - return expect(content).toChangeFormat(expected, { rubyHashLabel: false }); + expect(content).toChangeFormat(expected, { rubyHashLabel: false }); }); test("hash rocket, double quote", () => { const content = haml(`%section(xml:lang="en" title="title")`); const expected = '%section{:"xml:lang" => "en", :title => "title"}'; - return expect(content).toChangeFormat(expected, { + expect(content).toChangeFormat(expected, { rubyHashLabel: false, rubySingleQuote: false }); @@ -89,7 +101,7 @@ describe("tag", () => { const content = haml(`%section(foo=1 bar=2)`); const expected = `%section(foo=1 bar=2)`; - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); }); @@ -100,7 +112,7 @@ describe("tag", () => { Hello! `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("long declaration before text", () => { @@ -114,18 +126,18 @@ describe("tag", () => { foo `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); test("with quotes in string", () => { const content = haml(`%div{title: "escaping quotes, it's annoying"}`); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("with interpolation in the value", () => { const content = haml(`%p hello"#{1 + 2} little pigs"`); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); diff --git a/test/js/rbs/parser.test.ts b/test/js/rbs/parser.test.ts index 6d23def1..efa7ea76 100644 --- a/test/js/rbs/parser.test.ts +++ b/test/js/rbs/parser.test.ts @@ -2,15 +2,17 @@ import type { Plugin, RBS } from "../../../src/types"; import { ruby } from "../utils"; import parser from "../../../src/rbs/parser"; +function parse(source: string) { + return parser.parse(source, {}, {} as Plugin.Options); +} + describe("parser", () => { test("parse", () => { - expect( - parser.parse("class Foo end", {}, {} as Plugin.Options).declarations - ).toHaveLength(1); + expect(parse("class Foo end").declarations).toHaveLength(1); }); test("parse failure", () => { - expect(() => parser.parse("<>", {}, {} as Plugin.Options)).toThrowError(); + expect(() => parse("<>")).toThrowError(); }); test("hasPragma", () => { diff --git a/test/js/rbs/rbs.test.ts b/test/js/rbs/rbs.test.ts index 3ecc9f71..6874e6fa 100644 --- a/test/js/rbs/rbs.test.ts +++ b/test/js/rbs/rbs.test.ts @@ -8,7 +8,9 @@ function testCases(name: string, transform: (_source: string) => string) { const sources = buffer.toString().slice(0, -1).split(/\r?\n/); sources.forEach((source) => { - test(source, () => expect(rbs(transform(source))).toMatchFormat()); + test(source, () => { + expect(rbs(transform(source))).toMatchFormat(); + }); }); } @@ -32,7 +34,7 @@ describe("rbs", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("interface with type params", () => { @@ -41,7 +43,7 @@ describe("rbs", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("class", () => { @@ -50,7 +52,7 @@ describe("rbs", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("class with type params", () => { @@ -59,7 +61,7 @@ describe("rbs", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("class with complicated type params", () => { @@ -68,7 +70,7 @@ describe("rbs", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("class with annotations", () => { @@ -78,7 +80,7 @@ describe("rbs", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("class with annotations that cannot be switched to braces", () => { @@ -88,7 +90,7 @@ describe("rbs", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("class with comments", () => { @@ -98,7 +100,7 @@ describe("rbs", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("class with superclass", () => { @@ -107,7 +109,7 @@ describe("rbs", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("module", () => { @@ -116,7 +118,7 @@ describe("rbs", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("module with type params", () => { @@ -125,7 +127,7 @@ describe("rbs", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("module with self types", () => { @@ -134,7 +136,7 @@ describe("rbs", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("multiple empty lines", () => { @@ -157,17 +159,17 @@ describe("rbs", () => { end `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); }); describeCases( "generic", (source) => ` - class T - def t: ${source} - end - ` + class T + def t: ${source} + end + ` ); describeCases("interface", (source) => `T: ${source}`); @@ -175,29 +177,37 @@ describe("rbs", () => { describe("literal", () => { testCases("literal", (source) => `T: ${source}`); - test("+1 drops the plus sign", () => - expect(rbs("T: +1")).toChangeFormat("T: 1")); + test("+1 drops the plus sign", () => { + expect(rbs("T: +1")).toChangeFormat("T: 1"); + }); - test("uses default quotes", () => expect(rbs("T: 'foo'")).toMatchFormat()); + test("uses default quotes", () => { + expect(rbs("T: 'foo'")).toMatchFormat(); + }); - test("changes quotes to match", () => + test("changes quotes to match", () => { expect(rbs("T: 'foo'")).toChangeFormat(`T: "foo"`, { rubySingleQuote: false - })); + }); + }); - test("keeps string the same when there is an escape sequence", () => - expect(rbs(`T: "super \\" duper"`)).toMatchFormat()); + test("keeps string the same when there is an escape sequence", () => { + expect(rbs(`T: "super \\" duper"`)).toMatchFormat(); + }); - test("unescapes single quotes when using double quotes", () => + test("unescapes single quotes when using double quotes", () => { expect(rbs(`T: 'super \\' duper'`)).toChangeFormat(`T: "super ' duper"`, { rubySingleQuote: false - })); + }); + }); - test("maintains escape sequences when using double quotes", () => - expect(rbs(`T: "escape sequences \\a\\b\\e\\f\\n\\r"`)).toMatchFormat()); + test("maintains escape sequences when using double quotes", () => { + expect(rbs(`T: "escape sequences \\a\\b\\e\\f\\n\\r"`)).toMatchFormat(); + }); - test("maintains not escape sequences when using single quotes", () => - expect(rbs(`T: 'escape sequences \\a\\b\\e\\f\\n\\r'`)).toMatchFormat()); + test("maintains not escape sequences when using single quotes", () => { + expect(rbs(`T: 'escape sequences \\a\\b\\e\\f\\n\\r'`)).toMatchFormat(); + }); }); describeCases( @@ -221,27 +231,31 @@ describe("rbs", () => { describe("optional", () => { testCases("optional", (source) => `T: ${source}`); - test("removes optional space before question mark", () => - expect(rbs("T: :foo ?")).toChangeFormat("T: :foo?")); + test("removes optional space before question mark", () => { + expect(rbs("T: :foo ?")).toChangeFormat("T: :foo?"); + }); }); describe("plain", () => { testCases("plain", (source) => `T: ${source}`); - test("any gets transformed into untyped", () => - expect(rbs("T: any")).toChangeFormat("T: untyped")); + test("any gets transformed into untyped", () => { + expect(rbs("T: any")).toChangeFormat("T: untyped"); + }); }); describe("proc", () => { testCases("proc", (source) => `T: ${source}`); - test("drops optional parentheses when there are no params", () => - expect(rbs("T: ^() -> void")).toChangeFormat("T: ^-> void")); + test("drops optional parentheses when there are no params", () => { + expect(rbs("T: ^() -> void")).toChangeFormat("T: ^-> void"); + }); - test("drops optional parentheses with block param when there are no params to the block", () => + test("drops optional parentheses with block param when there are no params to the block", () => { expect(rbs("T: ^{ () -> void } -> void")).toChangeFormat( "T: ^{ -> void } -> void" - )); + ); + }); }); describeCases("record", (source) => `T: ${source}`); diff --git a/test/js/ruby/comments.test.ts b/test/js/ruby/comments.test.ts index 4c59d76f..5c34fbf1 100644 --- a/test/js/ruby/comments.test.ts +++ b/test/js/ruby/comments.test.ts @@ -10,7 +10,7 @@ describe("comments", () => { a = 1 `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("at the end of the file", () => { @@ -21,7 +21,7 @@ describe("comments", () => { # the end of the file `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); const commentBlocks = [ @@ -46,7 +46,7 @@ describe("comments", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("as the first statement", () => { @@ -58,7 +58,7 @@ describe("comments", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("as the last statement", () => { @@ -70,7 +70,7 @@ describe("comments", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); @@ -91,7 +91,7 @@ describe("comments", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("case/when/end statements", () => { @@ -110,7 +110,7 @@ describe("comments", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("begin/rescue/ensure/end statements", () => { @@ -130,7 +130,7 @@ describe("comments", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); /* eslint-disable no-useless-escape */ @@ -146,19 +146,22 @@ describe("comments", () => { /_/ /_/ /_/ /____/ /_/ /_/ /_____/ /____/ /_/ /_/ `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); describe("inline", () => { - test("basic", () => - expect("foo # this is an inline comment").toMatchFormat()); + test("basic", () => { + expect("foo # this is an inline comment").toMatchFormat(); + }); - test("commands", () => - expect("command 'foo' # this is an inline comment").toMatchFormat()); + test("commands", () => { + expect("command 'foo' # this is an inline comment").toMatchFormat(); + }); - test("command calls", () => - expect("command.call 'foo' # this is an inline comment").toMatchFormat()); + test("command calls", () => { + expect("command.call 'foo' # this is an inline comment").toMatchFormat(); + }); }); describe("arrays", () => { @@ -173,7 +176,7 @@ describe("comments", () => { ] `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); @@ -189,7 +192,7 @@ describe("comments", () => { } `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); @@ -205,7 +208,7 @@ describe("comments", () => { ) `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); @@ -215,7 +218,7 @@ describe("comments", () => { .baz `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); describe("declaration style comments", () => { @@ -234,7 +237,7 @@ describe("comments", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); @@ -246,6 +249,6 @@ describe("comments", () => { ] `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); diff --git a/test/js/ruby/embed.test.ts b/test/js/ruby/embed.test.ts index c294f107..beeca9ac 100644 --- a/test/js/ruby/embed.test.ts +++ b/test/js/ruby/embed.test.ts @@ -8,7 +8,7 @@ describe("embed", () => { JAVA `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("formats correctly on straight heredocs", () => { @@ -28,7 +28,7 @@ describe("embed", () => { JS `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); test("formats correctly on squiggly heredocs", () => { @@ -48,7 +48,7 @@ describe("embed", () => { JS `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); test("does not format if the heredoc has an interpolation", () => { @@ -60,7 +60,7 @@ describe("embed", () => { JS `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("removes whitespace so embedded parsers don't misinterpret", () => { @@ -76,7 +76,7 @@ describe("embed", () => { MARKDOWN `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); test("keeps parent indentation", () => { @@ -92,7 +92,7 @@ describe("embed", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("correctly indents nested code while keeping parent indentation", () => { @@ -106,6 +106,7 @@ describe("embed", () => { end end `); + const expected = ruby(` some_block do another_block do @@ -123,7 +124,7 @@ describe("embed", () => { end `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); test("doesn't consider empty lines as part of the common leading whitespace", () => { @@ -138,6 +139,6 @@ describe("embed", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); diff --git a/test/js/ruby/encoding.test.ts b/test/js/ruby/encoding.test.ts index 313c38c8..39693dbe 100644 --- a/test/js/ruby/encoding.test.ts +++ b/test/js/ruby/encoding.test.ts @@ -1,13 +1,19 @@ describe("encoding", () => { const header = "# -*- encoding: binary -*-"; - test("comments", () => expect(`${header}\n# il était`).toMatchFormat()); + test("comments", () => { + expect(`${header}\n# il était`).toMatchFormat(); + }); - test("symbol literals", () => expect(`${header}\n:il_était`).toMatchFormat()); + test("symbol literals", () => { + expect(`${header}\n:il_était`).toMatchFormat(); + }); - test("string literals", () => - expect(`${header}\n'ひらがな'`).toMatchFormat()); + test("string literals", () => { + expect(`${header}\n'ひらがな'`).toMatchFormat(); + }); - test("regexp literals", () => - expect(`${header}\n/ひらがな/`).toMatchFormat()); + test("regexp literals", () => { + expect(`${header}\n/ひらがな/`).toMatchFormat(); + }); }); diff --git a/test/js/ruby/ignore.test.ts b/test/js/ruby/ignore.test.ts index 7dee033e..f0626f20 100644 --- a/test/js/ruby/ignore.test.ts +++ b/test/js/ruby/ignore.test.ts @@ -7,6 +7,6 @@ describe("ignore", () => { class Foo; def bar; 1+1+1; end; end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); diff --git a/test/js/ruby/layout.test.ts b/test/js/ruby/layout.test.ts index fe394b96..37da3f63 100644 --- a/test/js/ruby/layout.test.ts +++ b/test/js/ruby/layout.test.ts @@ -1,17 +1,21 @@ import { ruby } from "../utils"; describe("layout", () => { - test("turns multiple blank lines into just one blank line", () => - expect("1\n\n\n\n\n2").toChangeFormat("1\n\n2")); + test("turns multiple blank lines into just one blank line", () => { + expect("1\n\n\n\n\n2").toChangeFormat("1\n\n2"); + }); - test("turns semicolons into adjacent lines", () => - expect("1; 2; 3").toChangeFormat("1\n2\n3")); + test("turns semicolons into adjacent lines", () => { + expect("1; 2; 3").toChangeFormat("1\n2\n3"); + }); - test("maintains semicolons from within interpolation", () => - expect(`"a#{b; c}"`).toMatchFormat()); + test("maintains semicolons from within interpolation", () => { + expect(`"a#{b; c}"`).toMatchFormat(); + }); - test("handles multiple newlines at the end of the file", () => - expect("foo\n\n\n").toChangeFormat("foo")); + test("handles multiple newlines at the end of the file", () => { + expect("foo\n\n\n").toChangeFormat("foo"); + }); test("keeps comments in their place when nothing to attach to", () => { const content = ruby(` @@ -32,6 +36,6 @@ describe("layout", () => { # Comment `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/alias.test.ts b/test/js/ruby/nodes/alias.test.ts index f44f50cc..f1f67398 100644 --- a/test/js/ruby/nodes/alias.test.ts +++ b/test/js/ruby/nodes/alias.test.ts @@ -1,27 +1,37 @@ import { long, ruby } from "../../utils"; describe("alias", () => { - test("bare word aliases", () => expect("alias foo bar").toMatchFormat()); + test("bare word aliases", () => { + expect("alias foo bar").toMatchFormat(); + }); - test("bare word operator aliases", () => - expect("alias << push").toMatchFormat()); + test("bare word operator aliases", () => { + expect("alias << push").toMatchFormat(); + }); - test("bare word keyword aliases", () => - expect("alias in within").toMatchFormat()); + test("bare word keyword aliases", () => { + expect("alias in within").toMatchFormat(); + }); - test("bare word constant aliases", () => - expect("alias in IN").toMatchFormat()); + test("bare word constant aliases", () => { + expect("alias in IN").toMatchFormat(); + }); - test("symbol aliases become bare word aliases", () => - expect("alias :foo :bar").toChangeFormat("alias foo bar")); + test("symbol aliases become bare word aliases", () => { + expect("alias :foo :bar").toChangeFormat("alias foo bar"); + }); - test("dynamic symbols do not get transformed (left)", () => - expect("alias :'foo' :bar").toChangeFormat("alias :'foo' bar")); + test("dynamic symbols do not get transformed (left)", () => { + expect("alias :'foo' :bar").toChangeFormat("alias :'foo' bar"); + }); - test("dynamic symbols do not get transformed (right)", () => - expect("alias :foo :'bar'").toChangeFormat("alias foo :'bar'")); + test("dynamic symbols do not get transformed (right)", () => { + expect("alias :foo :'bar'").toChangeFormat("alias foo :'bar'"); + }); - test("global aliases", () => expect("alias $foo $bar").toMatchFormat()); + test("global aliases", () => { + expect("alias $foo $bar").toMatchFormat(); + }); test("handles long symbols", () => { const expected = ruby(` @@ -29,11 +39,12 @@ describe("alias", () => { bar `); - return expect(`alias ${long} bar`).toChangeFormat(expected); + expect(`alias ${long} bar`).toChangeFormat(expected); }); - test("handles comments on the right node", () => - expect("alias foo bar # baz").toMatchFormat()); + test("handles comments on the right node", () => { + expect("alias foo bar # baz").toMatchFormat(); + }); test("handles comments on the left node", () => { const content = ruby(` @@ -41,7 +52,7 @@ describe("alias", () => { bar `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("handles comments on both nodes", () => { @@ -50,6 +61,6 @@ describe("alias", () => { bar # bar `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/aref.test.ts b/test/js/ruby/nodes/aref.test.ts index 2e9e0dc4..8bb699cd 100644 --- a/test/js/ruby/nodes/aref.test.ts +++ b/test/js/ruby/nodes/aref.test.ts @@ -1,16 +1,25 @@ import { ruby } from "../../utils"; describe("aref", () => { - test("literal reference", () => expect("array[5]").toMatchFormat()); + test("literal reference", () => { + expect("array[5]").toMatchFormat(); + }); - test("dynamic reference", () => expect("array[idx]").toMatchFormat()); + test("dynamic reference", () => { + expect("array[idx]").toMatchFormat(); + }); - test("reference with comment", () => - expect("array[idx] # foo").toMatchFormat()); + test("reference with comment", () => { + expect("array[idx] # foo").toMatchFormat(); + }); - test("literal assignment", () => expect("array[5] = 6").toMatchFormat()); + test("literal assignment", () => { + expect("array[5] = 6").toMatchFormat(); + }); - test("dynamic assignment", () => expect("array[idx] = 6").toMatchFormat()); + test("dynamic assignment", () => { + expect("array[idx] = 6").toMatchFormat(); + }); test("comments within assignment", () => { const contents = ruby(` @@ -21,6 +30,6 @@ describe("aref", () => { ] `); - return expect(contents).toMatchFormat(); + expect(contents).toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/arrays.test.ts b/test/js/ruby/nodes/arrays.test.ts index 7a075d30..1bd4311b 100644 --- a/test/js/ruby/nodes/arrays.test.ts +++ b/test/js/ruby/nodes/arrays.test.ts @@ -1,53 +1,73 @@ import { long, ruby } from "../../utils"; describe("array", () => { - test("empty arrays", () => expect("[]").toMatchFormat()); + test("empty arrays", () => { + expect("[]").toMatchFormat(); + }); - test("basic formatting", () => expect("[1, 2, 3]").toMatchFormat()); + test("basic formatting", () => { + expect("[1, 2, 3]").toMatchFormat(); + }); - test("does not transform single string arrays", () => - expect("['a']").toMatchFormat()); + test("does not transform single string arrays", () => { + expect("['a']").toMatchFormat(); + }); - test("does not transform single symbol arrays", () => - expect("[:a]").toMatchFormat()); + test("does not transform single symbol arrays", () => { + expect("[:a]").toMatchFormat(); + }); - test("transforms basic string arrays", () => - expect("['a', 'b', 'c', 'd', 'e']").toChangeFormat("%w[a b c d e]")); + test("transforms basic string arrays", () => { + expect("['a', 'b', 'c', 'd', 'e']").toChangeFormat("%w[a b c d e]"); + }); - test("does not transform string arrays with interpolation", () => - expect(`['a', "#{b}", 'c']`).toMatchFormat()); + test("does not transform string arrays with interpolation", () => { + expect(`['a', "#{b}", 'c']`).toMatchFormat(); + }); - test("does not transform string arrays with spaces", () => - expect("['a', 'b c', 'd', 'e']").toMatchFormat()); + test("does not transform string arrays with spaces", () => { + expect("['a', 'b c', 'd', 'e']").toMatchFormat(); + }); - test("does not transform string arrays with tabs", () => - expect(`['a', "b\\tc", 'd', 'e']`).toMatchFormat()); + test("does not transform string arrays with tabs", () => { + expect(`['a', "b\\tc", 'd', 'e']`).toMatchFormat(); + }); - test("does not transform string arrays with newlines", () => - expect(`['a', "b\\nc", 'd', 'e']`).toMatchFormat()); + test("does not transform string arrays with newlines", () => { + expect(`['a', "b\\nc", 'd', 'e']`).toMatchFormat(); + }); - test("does not transform string arrays with carriage returns", () => - expect(`['a', "b\\rc", 'd', 'e']`).toMatchFormat()); + test("does not transform string arrays with carriage returns", () => { + expect(`['a', "b\\rc", 'd', 'e']`).toMatchFormat(); + }); - test("does not transform string arrays with interpolation", () => - expect(`['a', "b#{c}d", 'e']`).toMatchFormat()); + test("does not transform string arrays with interpolation", () => { + expect(`['a', "b#{c}d", 'e']`).toMatchFormat(); + }); - test("does not transform string arrays with brackets", () => - expect(`['a [] b', 'c [] d']`).toMatchFormat()); + test("does not transform string arrays with brackets", () => { + expect(`['a [] b', 'c [] d']`).toMatchFormat(); + }); - test("does not transform string arrays if disabled", () => - expect(`['a', 'b']`).toMatchFormat({ rubyArrayLiteral: false })); + test("does not transform string arrays if disabled", () => { + expect(`['a', 'b']`).toMatchFormat({ rubyArrayLiteral: false }); + }); - test("does not transform symbol arrays if disabled", () => - expect("[:a, :b]").toMatchFormat({ rubyArrayLiteral: false })); + test("does not transform symbol arrays if disabled", () => { + expect("[:a, :b]").toMatchFormat({ rubyArrayLiteral: false }); + }); - test("transforms basic symbol arrays", () => - expect("[:a, :b, :c]").toChangeFormat("%i[a b c]")); + test("transforms basic symbol arrays", () => { + expect("[:a, :b, :c]").toChangeFormat("%i[a b c]"); + }); - test("does not transform symbol arrays with dynamic symbols", () => - expect("[:'a + b']").toMatchFormat()); + test("does not transform symbol arrays with dynamic symbols", () => { + expect("[:'a + b']").toMatchFormat(); + }); - test("handles splats", () => expect("[1, 2, *[3, 4], 5, 6]").toMatchFormat()); + test("handles splats", () => { + expect("[1, 2, *[3, 4], 5, 6]").toMatchFormat(); + }); test("breaks appropriately", () => { const contents = ruby(` @@ -62,18 +82,19 @@ describe("array", () => { ] `); - return expect(contents).toMatchFormat(); + expect(contents).toMatchFormat(); }); test("adds trailing commas when requested", () => { const before = `[${long}, ${long}, ${long}]`; const after = `[\n ${long},\n ${long},\n ${long},\n]`; - return expect(before).toChangeFormat(after, { trailingComma: "all" }); + expect(before).toChangeFormat(after, { trailingComma: "all" }); }); - test("breaking maintains calls on the end", () => - expect(`[${long}].freeze`).toChangeFormat(`[\n ${long}\n].freeze`)); + test("breaking maintains calls on the end", () => { + expect(`[${long}].freeze`).toChangeFormat(`[\n ${long}\n].freeze`); + }); describe("heredocs", () => { test("as the first value", () => { @@ -83,7 +104,7 @@ describe("array", () => { HERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("as the last value", () => { @@ -93,7 +114,7 @@ describe("array", () => { HERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("with splats in the array", () => { @@ -103,7 +124,7 @@ describe("array", () => { HERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("with trailing commas", () => { @@ -116,7 +137,7 @@ describe("array", () => { ] `); - return expect(content).toMatchFormat({ trailingComma: "all" }); + expect(content).toMatchFormat({ trailingComma: "all" }); }); }); @@ -126,7 +147,7 @@ describe("array", () => { [] `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("with leading comments and comments in the body", () => { @@ -138,7 +159,7 @@ describe("array", () => { ] `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("with comments just in the body", () => { @@ -149,7 +170,7 @@ describe("array", () => { ] `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("with comments just outside but attached", () => { @@ -159,7 +180,7 @@ describe("array", () => { ) `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test.each(["%w", "%W", "%i", "%I"])("%s special array literals", (start) => diff --git a/test/js/ruby/nodes/assign.test.ts b/test/js/ruby/nodes/assign.test.ts index cee8ecea..9dddd72a 100644 --- a/test/js/ruby/nodes/assign.test.ts +++ b/test/js/ruby/nodes/assign.test.ts @@ -2,7 +2,9 @@ import { long, ruby } from "../../utils"; describe("assign", () => { describe("single assignment", () => { - test("basic", () => expect("a = 1").toMatchFormat()); + test("basic", () => { + expect("a = 1").toMatchFormat(); + }); test("multiline", () => { const content = ruby(` @@ -12,10 +14,12 @@ describe("assign", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); - test("other operator", () => expect("a ||= b").toMatchFormat()); + test("other operator", () => { + expect("a ||= b").toMatchFormat(); + }); }); test("heredoc", () => { @@ -25,63 +29,70 @@ describe("assign", () => { TEXT `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); describe("breaking", () => { - test("inline becomes multi line", () => - expect(`${long} = ${long}`).toChangeFormat(`${long} =\n ${long}`)); + test("inline becomes multi line", () => { + expect(`${long} = ${long}`).toChangeFormat(`${long} =\n ${long}`); + }); - test("arrays don't get force indented", () => + test("arrays don't get force indented", () => { expect(`a = [${long}, ${long}, ${long}]`).toChangeFormat( ruby(` - a = [ - ${long}, - ${long}, - ${long} - ] - `) - )); - - test("hashes don't get force indented", () => - expect(`a = { a: ${long}, b: ${long}, c: ${long} }`).toChangeFormat( - ruby(` - a = { - a: + a = [ ${long}, - b: ${long}, - c: ${long} - } - `) - )); + ] + `) + ); + }); - test("chained methods on array literals don't get oddly indented", () => + test("hashes don't get force indented", () => { + expect(`a = { a: ${long}, b: ${long}, c: ${long} }`).toChangeFormat( + ruby(` + a = { + a: + ${long}, + b: + ${long}, + c: + ${long} + } + `) + ); + }); + + test("chained methods on array literals don't get oddly indented", () => { expect(`a = [${long}].freeze`).toChangeFormat( ruby(` - a = [ - ${long} - ].freeze - `) - )); + a = [ + ${long} + ].freeze + `) + ); + }); - test("chained methods on hash literals don't get oddly indented", () => + test("chained methods on hash literals don't get oddly indented", () => { expect(`a = { a: ${long} }.freeze`).toChangeFormat( ruby(` - a = { - a: - ${long} - }.freeze - `) - )); + a = { + a: + ${long} + }.freeze + `) + ); + }); }); describe("constants", () => { - test("assigning to constant", () => - expect("Pret::TIER = 'config'").toMatchFormat()); + test("assigning to constant", () => { + expect("Pret::TIER = 'config'").toMatchFormat(); + }); - test("assigning to top level constants", () => - expect("::PRETTIER = 'config'").toMatchFormat()); + test("assigning to top level constants", () => { + expect("::PRETTIER = 'config'").toMatchFormat(); + }); }); }); diff --git a/test/js/ruby/nodes/binary.test.ts b/test/js/ruby/nodes/binary.test.ts index 6d0550a9..a04618c4 100644 --- a/test/js/ruby/nodes/binary.test.ts +++ b/test/js/ruby/nodes/binary.test.ts @@ -1,12 +1,15 @@ import { long, ruby } from "../../utils"; describe("binary", () => { - test("single line", () => expect("foo && bar && baz").toMatchFormat()); + test("single line", () => { + expect("foo && bar && baz").toMatchFormat(); + }); - test("multi line", () => + test("multi line", () => { expect(`${long} && ${long} && ${long}`).toChangeFormat( `${long} &&\n ${long} &&\n ${long}` - )); + ); + }); test("no indent on the right", () => { const content = `foo << [${long}]`; @@ -16,7 +19,7 @@ describe("binary", () => { ] `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); test("with heredoc and comment", () => { @@ -26,8 +29,10 @@ describe("binary", () => { HERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); - test("no spaces for **", () => expect("a**b").toMatchFormat()); + test("no spaces for **", () => { + expect("a**b").toMatchFormat(); + }); }); diff --git a/test/js/ruby/nodes/blocks.test.ts b/test/js/ruby/nodes/blocks.test.ts index d22e5355..0d56f211 100644 --- a/test/js/ruby/nodes/blocks.test.ts +++ b/test/js/ruby/nodes/blocks.test.ts @@ -1,33 +1,45 @@ import { long, ruby } from "../../utils"; describe("blocks", () => { - test("empty", () => expect("loop {}").toMatchFormat()); + test("empty", () => { + expect("loop {}").toMatchFormat(); + }); - test("single line non-breaking", () => expect("loop { 1 }").toMatchFormat()); + test("single line non-breaking", () => { + expect("loop { 1 }").toMatchFormat(); + }); - test("single line breaking", () => - expect(`loop { ${long} }`).toChangeFormat(`loop do\n ${long}\nend`)); + test("single line breaking", () => { + expect(`loop { ${long} }`).toChangeFormat(`loop do\n ${long}\nend`); + }); - test("multi line non-breaking", () => - expect("loop do\n 1\nend").toChangeFormat("loop { 1 }")); + test("multi line non-breaking", () => { + expect("loop do\n 1\nend").toChangeFormat("loop { 1 }"); + }); - test("multi-line breaking", () => - expect(`loop do\n ${long}\nend`).toMatchFormat()); + test("multi-line breaking", () => { + expect(`loop do\n ${long}\nend`).toMatchFormat(); + }); - test("multi-line with comment", () => - expect("loop do\n # foobar\nend").toMatchFormat()); + test("multi-line with comment", () => { + expect("loop do\n # foobar\nend").toMatchFormat(); + }); - test("multi-line on command, no body", () => - expect("command 'foobar' do\nend").toMatchFormat()); + test("multi-line on command, no body", () => { + expect("command 'foobar' do\nend").toMatchFormat(); + }); - test("multi-line on command call, no body", () => - expect("command.call 'foobar' do\nend").toMatchFormat()); + test("multi-line on command call, no body", () => { + expect("command.call 'foobar' do\nend").toMatchFormat(); + }); - test("multi-line on command, with body", () => - expect("command 'foobar' do\n foo\nend").toMatchFormat()); + test("multi-line on command, with body", () => { + expect("command 'foobar' do\n foo\nend").toMatchFormat(); + }); - test("multi-line on command call, with body", () => - expect("command.call 'foobar' do\n foo\nend").toMatchFormat()); + test("multi-line on command call, with body", () => { + expect("command.call 'foobar' do\n foo\nend").toMatchFormat(); + }); test("blocks nested inside commands use braces", () => { const expected = ruby(` @@ -36,7 +48,7 @@ describe("blocks", () => { }.bar `); - return expect(`foo ${long} { ${long} }.bar`).toChangeFormat(expected); + expect(`foo ${long} { ${long} }.bar`).toChangeFormat(expected); }); test("breaking maintains calls on the end", () => { @@ -47,7 +59,7 @@ describe("blocks", () => { end.to_i `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("doesn't do weird things with comments", () => { @@ -59,7 +71,7 @@ describe("blocks", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); describe("for loops", () => { @@ -70,7 +82,7 @@ describe("blocks", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("multiple variables", () => { @@ -80,7 +92,7 @@ describe("blocks", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("optional do keyword", () => { @@ -102,53 +114,70 @@ describe("blocks", () => { end `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); }); // from ruby test/ruby/test_call.rb - test("inline do end", () => + test("inline do end", () => { expect(`assert_nil(("a".sub! "b" do end&.foo {}))`).toChangeFormat( ruby(` - assert_nil( - ( - 'a'.sub! 'b' do - end&.foo do - end + assert_nil( + ( + 'a'.sub! 'b' do + end&.foo do + end + ) ) - ) - `) - )); + `) + ); + }); - test("excessed_comma nodes", () => expect("proc { |x,| }").toMatchFormat()); + test("excessed_comma nodes", () => { + expect("proc { |x,| }").toMatchFormat(); + }); describe("args", () => { - test("no body", () => expect("loop { |i| }").toMatchFormat()); + test("no body", () => { + expect("loop { |i| }").toMatchFormat(); + }); - test("single line non-breaking", () => - expect("loop { |i| 1 }").toMatchFormat()); + test("single line non-breaking", () => { + expect("loop { |i| 1 }").toMatchFormat(); + }); - test("single line breaking", () => + test("single line breaking", () => { expect(`loop { |i| ${long} }`).toChangeFormat( `loop do |i|\n ${long}\nend` - )); + ); + }); - test("multi-line non-breaking", () => - expect("loop do |i|\n i\nend").toChangeFormat("loop { |i| i }")); + test("multi-line non-breaking", () => { + expect("loop do |i|\n i\nend").toChangeFormat("loop { |i| i }"); + }); - test("multi-line breaking", () => - expect(`loop do |i|\n ${long}\nend`).toMatchFormat()); + test("multi-line breaking", () => { + expect(`loop do |i|\n ${long}\nend`).toMatchFormat(); + }); - test("block-local args", () => expect("loop { |i; j| 1 }").toMatchFormat()); + test("block-local args", () => { + expect("loop { |i; j| 1 }").toMatchFormat(); + }); - test("splat", () => expect("loop { |*| i }").toMatchFormat()); + test("splat", () => { + expect("loop { |*| i }").toMatchFormat(); + }); - test("destructure", () => expect("loop { |(a, b)| i }").toMatchFormat()); + test("destructure", () => { + expect("loop { |(a, b)| i }").toMatchFormat(); + }); - test("lots of args types", () => - expect("loop { |a, (b, c), d, *e| i }").toMatchFormat()); + test("lots of args types", () => { + expect("loop { |a, (b, c), d, *e| i }").toMatchFormat(); + }); - test("does not split up args inside pipes", () => - expect(`loop do |${long} = 1, a${long} = 2|\nend`).toMatchFormat()); + test("does not split up args inside pipes", () => { + expect(`loop do |${long} = 1, a${long} = 2|\nend`).toMatchFormat(); + }); }); }); diff --git a/test/js/ruby/nodes/break.test.ts b/test/js/ruby/nodes/break.test.ts index e9a01af5..8a51b2bb 100644 --- a/test/js/ruby/nodes/break.test.ts +++ b/test/js/ruby/nodes/break.test.ts @@ -1,16 +1,21 @@ import { ruby } from "../../utils"; describe("break", () => { - test("empty break", () => expect("break").toMatchFormat()); + test("empty break", () => { + expect("break").toMatchFormat(); + }); - test("break with one argument, no parens", () => - expect("break 1").toMatchFormat()); + test("break with one argument, no parens", () => { + expect("break 1").toMatchFormat(); + }); - test("break with parens drops parens", () => - expect("break(1)").toChangeFormat("break 1")); + test("break with parens drops parens", () => { + expect("break(1)").toChangeFormat("break 1"); + }); - test("break with multiple arguments", () => - expect("break 1, 2, 3").toMatchFormat()); + test("break with multiple arguments", () => { + expect("break 1, 2, 3").toMatchFormat(); + }); test("keeps parens for multiple statements", () => { const expected = ruby(` @@ -20,11 +25,14 @@ describe("break", () => { ) `); - return expect("break(a = 1; a == 1)").toChangeFormat(expected); + expect("break(a = 1; a == 1)").toChangeFormat(expected); }); - test("keeps parens for _mod nodes", () => - expect("break(1 if true)").toMatchFormat()); + test("keeps parens for _mod nodes", () => { + expect("break(1 if true)").toMatchFormat(); + }); - test("works with comments", () => expect("break # foo").toMatchFormat()); + test("works with comments", () => { + expect("break # foo").toMatchFormat(); + }); }); diff --git a/test/js/ruby/nodes/calls.test.ts b/test/js/ruby/nodes/calls.test.ts index ea8af45a..3dc60e1a 100644 --- a/test/js/ruby/nodes/calls.test.ts +++ b/test/js/ruby/nodes/calls.test.ts @@ -4,10 +4,12 @@ describe("calls", () => { test("simple calls", () => { const content = "posts.active.where('created_at > ?', 1.year.ago)"; - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); - test("short chains", () => expect("foo.bar.baz qux").toMatchFormat()); + test("short chains", () => { + expect("foo.bar.baz qux").toMatchFormat(); + }); test("chain methods", () => { const before = ruby(` @@ -25,7 +27,7 @@ describe("calls", () => { .hhhhhhhhhh `); - return expect(before).toChangeFormat(after); + expect(before).toChangeFormat(after); }); test("chains of methods with one with arguments right at the top", () => { @@ -36,7 +38,7 @@ describe("calls", () => { ) `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("chains of methods with a block right at the top", () => { @@ -47,13 +49,13 @@ describe("calls", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("tons of calls that fit on one line", () => { const content = "a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z"; - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("chains which contain a .where.not", () => { @@ -66,7 +68,7 @@ describe("calls", () => { .limit(10) `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); describe("within sig blocks", () => { @@ -78,7 +80,7 @@ describe("calls", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("chains with other methods", () => { @@ -90,7 +92,7 @@ describe("calls", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); @@ -107,26 +109,32 @@ describe("calls", () => { .select_all(:table1) `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); - test("no explicit call doesn't add call", () => - expect("a.(1, 2, 3)").toMatchFormat()); + test("no explicit call doesn't add call", () => { + expect("a.(1, 2, 3)").toMatchFormat(); + }); - test("explicit call maintains call", () => - expect("a.call(1, 2, 3)").toMatchFormat()); + test("explicit call maintains call", () => { + expect("a.call(1, 2, 3)").toMatchFormat(); + }); - test("double bang with a special operator on a call", () => - expect("!!object&.topic_list").toMatchFormat()); + test("double bang with a special operator on a call", () => { + expect("!!object&.topic_list").toMatchFormat(); + }); - test("bang with a special operator on a command_call", () => - expect("!domain&.include? '@'").toMatchFormat()); + test("bang with a special operator on a command_call", () => { + expect("!domain&.include? '@'").toMatchFormat(); + }); - test("#call shorthand does not eliminate empty parentheses", () => - expect("Foo.new.()").toMatchFormat()); + test("#call shorthand does not eliminate empty parentheses", () => { + expect("Foo.new.()").toMatchFormat(); + }); - test("methods that look like constants do not eliminate empty parens", () => - expect("Foo()").toMatchFormat()); + test("methods that look like constants do not eliminate empty parens", () => { + expect("Foo()").toMatchFormat(); + }); test("call chains with no indent on the first receiver", () => { const item = long.slice(0, 30); @@ -141,7 +149,7 @@ describe("calls", () => { ].map(&:foo?).bbb.ccc `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); test("chained method_add_arg after a block", () => { @@ -150,6 +158,6 @@ describe("calls", () => { end.d e, f `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/case.test.ts b/test/js/ruby/nodes/case.test.ts index d317a06a..f9d4e71f 100644 --- a/test/js/ruby/nodes/case.test.ts +++ b/test/js/ruby/nodes/case.test.ts @@ -9,7 +9,7 @@ describe("case", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("single when", () => { @@ -20,7 +20,7 @@ describe("case", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("multiple predicates, one when", () => { @@ -31,7 +31,7 @@ describe("case", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("breaking with multiple predicates, one when", () => { @@ -44,7 +44,7 @@ describe("case", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("breaking with multiple predicates, each one not too long", () => { @@ -63,7 +63,7 @@ describe("case", () => { end `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); test("multiple consecutive whens", () => { @@ -75,7 +75,7 @@ describe("case", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("basic multiple branches", () => { @@ -88,7 +88,7 @@ describe("case", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("else clauses", () => { @@ -101,6 +101,6 @@ describe("case", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/class.test.ts b/test/js/ruby/nodes/class.test.ts index eed56a97..a69c4d6e 100644 --- a/test/js/ruby/nodes/class.test.ts +++ b/test/js/ruby/nodes/class.test.ts @@ -14,7 +14,7 @@ describe("class", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("inheritance", () => { @@ -25,14 +25,16 @@ describe("class", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); - test("breaking class name", () => - expect(`class P${long}; end`).toChangeFormat(`class P${long}\nend`)); + test("breaking class name", () => { + expect(`class P${long}; end`).toChangeFormat(`class P${long}\nend`); + }); - test("breaking module name", () => - expect(`module P${long}; end`).toChangeFormat(`module P${long}\nend`)); + test("breaking module name", () => { + expect(`module P${long}; end`).toChangeFormat(`module P${long}\nend`); + }); test("class push blocks", () => { const content = ruby(` @@ -41,7 +43,7 @@ describe("class", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("multiple access controls", () => { @@ -67,7 +69,7 @@ describe("class", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("method helper", () => { @@ -79,7 +81,7 @@ describe("class", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); describe.each(["public", "protected", "private"])( @@ -96,7 +98,7 @@ describe("class", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("inline", () => { @@ -108,14 +110,18 @@ describe("class", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); } ); describe("constant reference", () => { - test("regular", () => expect("Pret::Tier::Ruby").toMatchFormat()); + test("regular", () => { + expect("Pret::Tier::Ruby").toMatchFormat(); + }); - test("top-level", () => expect("::Pret::Tier::Ruby").toMatchFormat()); + test("top-level", () => { + expect("::Pret::Tier::Ruby").toMatchFormat(); + }); }); }); diff --git a/test/js/ruby/nodes/conditionals.test.ts b/test/js/ruby/nodes/conditionals.test.ts index 89b8fceb..cbd3c15b 100644 --- a/test/js/ruby/nodes/conditionals.test.ts +++ b/test/js/ruby/nodes/conditionals.test.ts @@ -3,11 +3,12 @@ import { long, ruby, atLeastVersion } from "../../utils"; describe("conditionals", () => { describe("not operator", () => { // from ruby test/ruby/test_not.rb - test("not operator, empty parens", () => - expect("assert_equal(true, (not ()))").toMatchFormat()); + test("not operator, empty parens", () => { + expect("assert_equal(true, (not ()))").toMatchFormat(); + }); test("not operator from within a ternary adds parens", () => { - return expect("a ? not(b) : c").toMatchFormat(); + expect("a ? not(b) : c").toMatchFormat(); }); test("not operator from within an if/else adds parens", () => { @@ -19,7 +20,7 @@ describe("conditionals", () => { end `); - return expect(content).toChangeFormat("a ? not(b) : c"); + expect(content).toChangeFormat("a ? not(b) : c"); }); }); @@ -32,7 +33,7 @@ describe("conditionals", () => { '${long}' ${keyword} text `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); test("when modifying an abbreviated assignment expression", () => { @@ -42,7 +43,7 @@ describe("conditionals", () => { '${long}' ${keyword} text `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); test("when modifying an expression with an assignment descendant", () => { @@ -55,7 +56,7 @@ describe("conditionals", () => { ) ${keyword} text `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); }); @@ -71,7 +72,7 @@ describe("conditionals", () => { end `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); test("does not insert double modifiers on a single line for nested conditionals", () => { @@ -88,26 +89,33 @@ describe("conditionals", () => { end `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); }); describe("when inline allowed", () => { describe.each(["if", "unless"])("%s keyword", (keyword) => { - test("inline stays", () => expect(`1 ${keyword} a`).toMatchFormat()); + test("inline stays", () => { + expect(`1 ${keyword} a`).toMatchFormat(); + }); - test("multi line changes", () => - expect(`${keyword} a\n 1\nend`).toChangeFormat(`1 ${keyword} a`)); + test("multi line changes", () => { + expect(`${keyword} a\n 1\nend`).toChangeFormat(`1 ${keyword} a`); + }); - test("inline breaking changes", () => + test("inline breaking changes", () => { expect(`${long} ${keyword} ${long}`).toChangeFormat( `${keyword} ${long}\n ${long}\nend` - )); + ); + }); - test("multi line breaking stays", () => - expect(`${keyword} ${long}\n ${long}\nend`).toMatchFormat()); + test("multi line breaking stays", () => { + expect(`${keyword} ${long}\n ${long}\nend`).toMatchFormat(); + }); - test("not operator", () => expect(`b ${keyword} not a`).toMatchFormat()); + test("not operator", () => { + expect(`b ${keyword} not a`).toMatchFormat(); + }); test("empty first body", () => { const content = ruby(` @@ -115,7 +123,7 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("empty first body with present second body", () => { @@ -127,7 +135,7 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("comment in body", () => { @@ -137,7 +145,7 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("comment in body with question mark method", () => { @@ -147,7 +155,7 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("comment on node in body", () => { @@ -157,7 +165,7 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("breaks if the predicate is an assignment", () => { @@ -169,7 +177,7 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("breaks if the predicate is an op assignment", () => { @@ -181,10 +189,10 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); - test("align long predicates", () => + test("align long predicates", () => { expect(`foo ${keyword} ${long} || ${long}a`).toChangeFormat( ruby(` ${keyword} ${long} || @@ -192,12 +200,14 @@ describe("conditionals", () => { foo end `) - )); + ); + }); - test("wraps single lines in parens when assigning", () => + test("wraps single lines in parens when assigning", () => { expect(`hash[:key] = ${keyword} false then :value end`).toChangeFormat( `hash[:key] = (:value ${keyword} false)` - )); + ); + }); test("wraps inline version with calls", () => { const content = ruby(` @@ -206,7 +216,7 @@ describe("conditionals", () => { end.to_s `); - return expect(content).toChangeFormat("(false if true).to_s"); + expect(content).toChangeFormat("(false if true).to_s"); }); test("wraps inline version within binary", () => { @@ -216,42 +226,49 @@ describe("conditionals", () => { end || baz `); - return expect(content).toChangeFormat("(bar if foo) || baz"); + expect(content).toChangeFormat("(bar if foo) || baz"); }); }); }); describe("when inline not allowed", () => { describe.each(["if", "unless"])("%s keyword", (keyword) => { - test("inline changes", () => + test("inline changes", () => { expect(`1 ${keyword} a`).toChangeFormat(`${keyword} a\n 1\nend`, { rubyModifier: false - })); + }); + }); - test("multi line stays", () => + test("multi line stays", () => { expect(`${keyword} a\n 1\nend`).toMatchFormat({ rubyModifier: false - })); + }); + }); - test("inline breaking changes", () => + test("inline breaking changes", () => { expect(`${long} ${keyword} ${long}`).toChangeFormat( `${keyword} ${long}\n ${long}\nend`, { rubyModifier: false } - )); + ); + }); - test("multi line breaking stays", () => + test("multi line breaking stays", () => { expect(`${keyword} ${long}\n ${long}\nend`).toMatchFormat({ rubyModifier: false - })); + }); + }); - test("not operator", () => + test("not operator", () => { expect(`${keyword} not a\n b\nend`).toMatchFormat({ rubyModifier: false - })); + }); + }); - test("not operator parens", () => expect("not(true)").toMatchFormat()); + test("not operator parens", () => { + expect("not(true)").toMatchFormat(); + }); test("empty first body", () => { const content = ruby(` @@ -259,7 +276,7 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat({ rubyModifier: false }); + expect(content).toMatchFormat({ rubyModifier: false }); }); test("empty first body with present second body", () => { @@ -271,7 +288,7 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat({ rubyModifier: false }); + expect(content).toMatchFormat({ rubyModifier: false }); }); test("comment in body", () => { @@ -281,7 +298,7 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat({ rubyModifier: false }); + expect(content).toMatchFormat({ rubyModifier: false }); }); test("comment on node in body", () => { @@ -291,10 +308,10 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat({ rubyModifier: false }); + expect(content).toMatchFormat({ rubyModifier: false }); }); - test("align long predicates", () => + test("align long predicates", () => { expect(`foo ${keyword} ${long} || ${long}a`).toChangeFormat( ruby(` ${keyword} ${long} || @@ -302,7 +319,8 @@ describe("conditionals", () => { foo end `) - )); + ); + }); test("single line should break up", () => { const content = "foo = if bar? then baz end"; @@ -313,7 +331,7 @@ describe("conditionals", () => { end `); - return expect(content).toChangeFormat(expected, { + expect(content).toChangeFormat(expected, { rubyModifier: false }); }); @@ -321,18 +339,21 @@ describe("conditionals", () => { }); describe("ternaries", () => { - test("non-breaking", () => expect("a ? 1 : 2").toMatchFormat()); + test("non-breaking", () => { + expect("a ? 1 : 2").toMatchFormat(); + }); - test("breaking", () => + test("breaking", () => { expect(`a ? ${long} : ${long}`).toChangeFormat( ruby(` - if a - ${long} - else - ${long} - end - `) - )); + if a + ${long} + else + ${long} + end + `) + ); + }); test("transform from if/else", () => { const content = ruby(` @@ -343,7 +364,7 @@ describe("conditionals", () => { end `); - return expect(content).toChangeFormat("a ? 1 : 2"); + expect(content).toChangeFormat("a ? 1 : 2"); }); test("transform for unless/else", () => { @@ -355,7 +376,7 @@ describe("conditionals", () => { end `); - return expect(content).toChangeFormat("a ? 2 : 1"); + expect(content).toChangeFormat("a ? 2 : 1"); }); test("adds parens if inside of a call", () => { @@ -367,7 +388,7 @@ describe("conditionals", () => { end.to_s `); - return expect(content).toChangeFormat("(a ? 1 : 2).to_s"); + expect(content).toChangeFormat("(a ? 1 : 2).to_s"); }); test("does not add parens if it breaks", () => { @@ -379,7 +400,7 @@ describe("conditionals", () => { end.to_s `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("adds parens if inside of a binary", () => { @@ -391,7 +412,7 @@ describe("conditionals", () => { end + 1 `); - return expect(content).toChangeFormat("(a ? 1 : 2) + 1"); + expect(content).toChangeFormat("(a ? 1 : 2) + 1"); }); test("adds parens if within a command", () => { @@ -406,11 +427,12 @@ describe("conditionals", () => { ) `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); - test("does not add parens if within a command_call non-breaking", () => - expect("foo.bar baz ? foo : bar").toMatchFormat()); + test("does not add parens if within a command_call non-breaking", () => { + expect("foo.bar baz ? foo : bar").toMatchFormat(); + }); test("adds parens if within a command_call", () => { const content = `foo.bar baz ? ${long} : ${long}`; @@ -424,7 +446,7 @@ describe("conditionals", () => { ) `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); describe("unable to transform", () => { @@ -437,7 +459,7 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("command in if body", () => { @@ -449,7 +471,7 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("command in else body", () => { @@ -461,7 +483,7 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("command call in if body", () => { @@ -473,7 +495,7 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("command call in else body", () => { @@ -485,7 +507,7 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("heredoc in if body", () => { @@ -500,7 +522,7 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("heredoc in else body", () => { @@ -515,7 +537,7 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("nested conditional in if body", () => { @@ -539,7 +561,7 @@ describe("conditionals", () => { end `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); test("nested conditional in else body", () => { @@ -562,7 +584,7 @@ describe("conditionals", () => { end `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); test("nested ternary in if body", () => { @@ -572,7 +594,7 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("nested ternary in else body", () => { @@ -584,7 +606,7 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("command with argument predicate", () => { @@ -596,7 +618,7 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("command call with argument predicate", () => { @@ -608,20 +630,21 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); - test("align long predicates", () => + test("align long predicates", () => { expect(`${long} || ${long}a ? foo : bar`).toChangeFormat( ruby(` - if ${long} || - ${long}a - foo - else - bar - end - `) - )); + if ${long} || + ${long}a + foo + else + bar + end + `) + ); + }); test("lower precendence operators", () => { const content = ruby(` @@ -632,7 +655,7 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("assign nodes in predicate", () => { @@ -644,7 +667,7 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("opassign nodes in predicate", () => { @@ -656,7 +679,7 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("cannot transform with multiple statements", () => { @@ -669,7 +692,7 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); }); @@ -684,7 +707,7 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("multiple clauses", () => { @@ -700,35 +723,40 @@ describe("conditionals", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); describe.each(["if", "unless"])("add parens when necessary %s", (keyword) => { - test("args", () => + test("args", () => { expect(`[${keyword} foo? then bar end]`).toChangeFormat( `[(bar ${keyword} foo?)]` - )); + ); + }); - test("assign", () => + test("assign", () => { expect(`foo = ${keyword} bar? then baz end`).toChangeFormat( `foo = (baz ${keyword} bar?)` - )); + ); + }); - test("assoc_new", () => + test("assoc_new", () => { expect(`{ foo: ${keyword} bar? then baz end }`).toChangeFormat( `{ foo: (baz ${keyword} bar?) }` - )); + ); + }); - test("massign", () => + test("massign", () => { expect(`f, o, o = ${keyword} bar? then baz end`).toChangeFormat( `f, o, o = (baz ${keyword} bar?)` - )); + ); + }); - test("opassign", () => + test("opassign", () => { expect(`foo ||= ${keyword} bar? then baz end`).toChangeFormat( `foo ||= (baz ${keyword} bar?)` - )); + ); + }); }); if (atLeastVersion("3.0")) { @@ -738,7 +766,7 @@ describe("conditionals", () => { puts "admin: #{name}" ${keyword} user in { role: 'admin', name: } `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); } }); diff --git a/test/js/ruby/nodes/defined.test.ts b/test/js/ruby/nodes/defined.test.ts index b2289ae9..3e23e252 100644 --- a/test/js/ruby/nodes/defined.test.ts +++ b/test/js/ruby/nodes/defined.test.ts @@ -1,19 +1,27 @@ import { long } from "../../utils"; describe("defined", () => { - test("no parens", () => expect("defined? a").toChangeFormat("defined?(a)")); + test("no parens", () => { + expect("defined? a").toChangeFormat("defined?(a)"); + }); - test("parens", () => expect("defined?(a)").toMatchFormat()); + test("parens", () => { + expect("defined?(a)").toMatchFormat(); + }); - test("breaks on long identifier, no parens", () => - expect(`defined? ${long}`).toChangeFormat(`defined?(\n ${long}\n)`)); + test("breaks on long identifier, no parens", () => { + expect(`defined? ${long}`).toChangeFormat(`defined?(\n ${long}\n)`); + }); - test("breaks on long identifier, with parens", () => - expect(`defined?(${long})`).toChangeFormat(`defined?(\n ${long}\n)`)); + test("breaks on long identifier, with parens", () => { + expect(`defined?(${long})`).toChangeFormat(`defined?(\n ${long}\n)`); + }); - test("breaking keeps breaking", () => - expect(`defined?(\n ${long}\n)`).toMatchFormat()); + test("breaking keeps breaking", () => { + expect(`defined?(\n ${long}\n)`).toMatchFormat(); + }); - test("unnecessary breaking reverts to inline", () => - expect("defined?(\n a\n)").toChangeFormat("defined?(a)")); + test("unnecessary breaking reverts to inline", () => { + expect("defined?(\n a\n)").toChangeFormat("defined?(a)"); + }); }); diff --git a/test/js/ruby/nodes/embdoc.test.ts b/test/js/ruby/nodes/embdoc.test.ts index 3db230ee..592c1a70 100644 --- a/test/js/ruby/nodes/embdoc.test.ts +++ b/test/js/ruby/nodes/embdoc.test.ts @@ -14,7 +14,7 @@ describe("embdoc", () => { =end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("within a class", () => { @@ -26,7 +26,7 @@ describe("embdoc", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("within a nested class", () => { @@ -40,6 +40,6 @@ describe("embdoc", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/field.test.ts b/test/js/ruby/nodes/field.test.ts index 6a13170a..daabe636 100644 --- a/test/js/ruby/nodes/field.test.ts +++ b/test/js/ruby/nodes/field.test.ts @@ -1,8 +1,13 @@ describe("field", () => { - test("basic", () => expect("foo.x = 1").toMatchFormat()); + test("basic", () => { + expect("foo.x = 1").toMatchFormat(); + }); - test("replaces :: with .", () => - expect("foo::x = 1").toChangeFormat("foo.x = 1")); + test("replaces :: with .", () => { + expect("foo::x = 1").toChangeFormat("foo.x = 1"); + }); - test("with lonely operator", () => expect("foo&.x = 1").toMatchFormat()); + test("with lonely operator", () => { + expect("foo&.x = 1").toMatchFormat(); + }); }); diff --git a/test/js/ruby/nodes/hashes.test.ts b/test/js/ruby/nodes/hashes.test.ts index dbd71201..d32ab7ae 100644 --- a/test/js/ruby/nodes/hashes.test.ts +++ b/test/js/ruby/nodes/hashes.test.ts @@ -1,7 +1,9 @@ import { long, ruby } from "../../utils"; describe("hash", () => { - test("empty", () => expect("{}").toMatchFormat()); + test("empty", () => { + expect("{}").toMatchFormat(); + }); test("empty with comments", () => { const content = ruby(` @@ -11,7 +13,7 @@ describe("hash", () => { } `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("breaking", () => { @@ -26,18 +28,19 @@ describe("hash", () => { } `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); - test("breaking maintains calls on the end", () => + test("breaking maintains calls on the end", () => { expect(`{ a: ${long} }.freeze`).toChangeFormat( `{\n a:\n ${long}\n}.freeze` - )); + ); + }); test("breaking with trailing commas", () => { const expected = `{\n ${long}:\n ${long},\n}`; - return expect(`{ ${long}: ${long} }`).toChangeFormat(expected, { + expect(`{ ${long}: ${long} }`).toChangeFormat(expected, { trailingComma: "all" }); }); @@ -50,7 +53,7 @@ describe("hash", () => { HERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("as the last value", () => { @@ -60,7 +63,7 @@ describe("hash", () => { HERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("with trailing commas", () => { @@ -74,7 +77,7 @@ describe("hash", () => { } `); - return expect(content).toMatchFormat({ trailingComma: "all" }); + expect(content).toMatchFormat({ trailingComma: "all" }); }); test("when exceeding line length", () => { @@ -94,34 +97,42 @@ describe("hash", () => { } `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); }); describe("dynamic string keys", () => { - test("basic", () => expect(`{ 'foo': 'bar' }`).toMatchFormat()); + test("basic", () => { + expect(`{ 'foo': 'bar' }`).toMatchFormat(); + }); - test("with interpolation", () => - expect(`{ "#{1 + 1}": 2 }`).toMatchFormat()); + test("with interpolation", () => { + expect(`{ "#{1 + 1}": 2 }`).toMatchFormat(); + }); - test("basic without hash labels", () => - expect(`{ :'foo' => 'bar' }`).toMatchFormat({ rubyHashLabel: false })); + test("basic without hash labels", () => { + expect(`{ :'foo' => 'bar' }`).toMatchFormat({ rubyHashLabel: false }); + }); - test("with interpolation without hash labels", () => - expect(`{ :"#{1 + 1}" => 2 }`).toMatchFormat({ rubyHashLabel: false })); + test("with interpolation without hash labels", () => { + expect(`{ :"#{1 + 1}" => 2 }`).toMatchFormat({ rubyHashLabel: false }); + }); }); describe("bare assoc hash", () => { - test("commands", () => - expect("foobar alpha: alpha, beta: beta").toMatchFormat()); + test("commands", () => { + expect("foobar alpha: alpha, beta: beta").toMatchFormat(); + }); - test("command calls", () => - expect("foo.bar alpha: alpha, beta: beta").toMatchFormat()); + test("command calls", () => { + expect("foo.bar alpha: alpha, beta: beta").toMatchFormat(); + }); - test("calls", () => - expect("foobar(alpha: alpha, beta: beta)").toMatchFormat()); + test("calls", () => { + expect("foobar(alpha: alpha, beta: beta)").toMatchFormat(); + }); - test("does not add trailing commas on breaking commands", () => + test("does not add trailing commas on breaking commands", () => { expect(`foobar ${long}: ${long}, a${long}: a${long}`).toChangeFormat( ruby(` foobar ${long}: @@ -130,9 +141,10 @@ describe("hash", () => { a${long} `), { trailingComma: "all" } - )); + ); + }); - test("does not add trailing commas on breaking command calls", () => + test("does not add trailing commas on breaking command calls", () => { expect(`foo.bar ${long}: ${long}, a${long}: a${long}`).toChangeFormat( ruby(` foo.bar ${long}: @@ -141,9 +153,10 @@ describe("hash", () => { a${long} `), { trailingComma: "all" } - )); + ); + }); - test("does add trailing commas on breaking calls", () => + test("does add trailing commas on breaking calls", () => { expect(`foobar(${long}: ${long}, a${long}: a${long})`).toChangeFormat( ruby(` foobar( @@ -154,7 +167,8 @@ describe("hash", () => { ) `), { trailingComma: "all" } - )); + ); + }); test("breaks contents and parens together", () => { const content = ruby(` @@ -168,69 +182,82 @@ describe("hash", () => { ) `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); }); describe("when hash labels allowed", () => { - test("hash labels stay", () => - expect("{ a: 'a', b: 'b', c: 'c' }").toMatchFormat()); + test("hash labels stay", () => { + expect("{ a: 'a', b: 'b', c: 'c' }").toMatchFormat(); + }); - test("hash rockets get replaced", () => + test("hash rockets get replaced", () => { expect("{ :a => 'a', :b => 'b', :c => 'c' }").toChangeFormat( "{ a: 'a', b: 'b', c: 'c' }" - )); + ); + }); - test("hash rockets stay when needed", () => - expect("{ Foo => 1, Bar => 2 }").toMatchFormat()); + test("hash rockets stay when needed", () => { + expect("{ Foo => 1, Bar => 2 }").toMatchFormat(); + }); - test("ending in equals stays", () => - expect("{ :foo= => 'bar' }").toMatchFormat()); + test("ending in equals stays", () => { + expect("{ :foo= => 'bar' }").toMatchFormat(); + }); - test("starting with non-letter/non-underscore stays", () => - expect("{ :@foo => 'bar' }").toMatchFormat()); + test("starting with non-letter/non-underscore stays", () => { + expect("{ :@foo => 'bar' }").toMatchFormat(); + }); - test("starting with underscore converts", () => - expect("{ :_foo => 'bar' }").toChangeFormat("{ _foo: 'bar' }")); + test("starting with underscore converts", () => { + expect("{ :_foo => 'bar' }").toChangeFormat("{ _foo: 'bar' }"); + }); }); describe("when hash labels disallowed", () => { - test("hash labels get replaced", () => + test("hash labels get replaced", () => { expect("{ a: 'a', b: 'b', c: 'c' }").toChangeFormat( "{ :a => 'a', :b => 'b', :c => 'c' }", { rubyHashLabel: false } - )); + ); + }); - test("hash rockets stay", () => + test("hash rockets stay", () => { expect("{ :a => 'a', :b => 'b', :c => 'c' }").toMatchFormat({ rubyHashLabel: false - })); + }); + }); - test("hash rockets stay when needed", () => + test("hash rockets stay when needed", () => { expect("{ Foo => 1, Bar => 2 }").toMatchFormat({ rubyHashLabel: false - })); + }); + }); - test("ending in equals stays", () => + test("ending in equals stays", () => { expect("{ :foo= => 'bar' }").toMatchFormat({ rubyHashLabel: false - })); + }); + }); - test("starting with non-letter/non-underscore stays", () => + test("starting with non-letter/non-underscore stays", () => { expect("{ :@foo => 'bar' }").toMatchFormat({ rubyHashLabel: false - })); + }); + }); - test("starting with underscore stays", () => + test("starting with underscore stays", () => { expect("{ :_foo => 'bar' }").toMatchFormat({ rubyHashLabel: false - })); + }); + }); }); - test("prints hashes with consistent keys", () => - expect("{ a: 'a', b => 'b' }").toChangeFormat("{ :a => 'a', b => 'b' }")); + test("prints hashes with consistent keys", () => { + expect("{ a: 'a', b => 'b' }").toChangeFormat("{ :a => 'a', b => 'b' }"); + }); test("print hashes with correct braces when contents fits", () => { const content = ruby(` @@ -240,7 +267,7 @@ describe("hash", () => { } `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("with leading comments but none in body", () => { @@ -249,7 +276,7 @@ describe("hash", () => { {} `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("with leading comments and comments in the body", () => { @@ -261,7 +288,7 @@ describe("hash", () => { } `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("with comments just in the body", () => { @@ -272,7 +299,7 @@ describe("hash", () => { } `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); // https://github.com/prettier/plugin-ruby/issues/758 @@ -291,7 +318,7 @@ describe("hash", () => { } `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); test("child hashes break assoc_news if their parents break", () => { @@ -309,7 +336,7 @@ describe("hash", () => { } `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); test("child hashes break hashes if their parents break", () => { @@ -332,6 +359,6 @@ describe("hash", () => { } `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); }); diff --git a/test/js/ruby/nodes/heredocs.test.ts b/test/js/ruby/nodes/heredocs.test.ts index 6f969f36..668fb7f1 100644 --- a/test/js/ruby/nodes/heredocs.test.ts +++ b/test/js/ruby/nodes/heredocs.test.ts @@ -9,7 +9,7 @@ describe("heredocs", () => { HERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("with interpolation", () => { @@ -21,7 +21,7 @@ describe("heredocs", () => { HERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("on an assignment", () => { @@ -31,7 +31,7 @@ describe("heredocs", () => { HERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("nested within another", () => { @@ -44,7 +44,7 @@ describe("heredocs", () => { PARENT `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("with embedded expressions", () => { @@ -58,7 +58,7 @@ describe("heredocs", () => { HERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("with a call and indented", () => { @@ -70,7 +70,7 @@ describe("heredocs", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); @@ -82,7 +82,7 @@ describe("heredocs", () => { HERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("with interpolation", () => { @@ -94,7 +94,7 @@ describe("heredocs", () => { HERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("on an assignment", () => { @@ -104,7 +104,7 @@ describe("heredocs", () => { HERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("nested within another", () => { @@ -117,7 +117,7 @@ describe("heredocs", () => { PARENT `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("with a call and indented", () => { @@ -129,7 +129,7 @@ describe("heredocs", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); @@ -141,7 +141,7 @@ describe("heredocs", () => { HERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("on calls with multiple", () => { @@ -153,7 +153,7 @@ describe("heredocs", () => { THERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("on commands", () => { @@ -163,7 +163,7 @@ describe("heredocs", () => { HERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("on commands with multiple", () => { @@ -175,7 +175,7 @@ describe("heredocs", () => { THERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("on command calls", () => { @@ -185,7 +185,7 @@ describe("heredocs", () => { HERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("on command calls with multiple", () => { @@ -197,7 +197,7 @@ describe("heredocs", () => { THERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); @@ -209,7 +209,7 @@ describe("heredocs", () => { TEXT `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("squiggly indent", () => { @@ -219,7 +219,7 @@ describe("heredocs", () => { TEXT `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("straight no indent", () => { @@ -229,7 +229,7 @@ describe("heredocs", () => { TEXT `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); @@ -244,7 +244,7 @@ describe("heredocs", () => { ) `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("arg w/ block", () => { @@ -261,7 +261,7 @@ describe("heredocs", () => { TEXT `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); test("in an activerecord scope arg w/ chaining", () => { @@ -284,7 +284,7 @@ describe("heredocs", () => { EOS `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); test("long breakable arg after heredoc literal", () => { @@ -303,7 +303,7 @@ describe("heredocs", () => { ] `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); test("call w/ short breakable arg after heredoc literal", () => { @@ -313,7 +313,7 @@ describe("heredocs", () => { BAR `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("on calls", () => { @@ -331,7 +331,7 @@ describe("heredocs", () => { HERE `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); test("on calls with trailing arguments", () => { @@ -341,7 +341,7 @@ describe("heredocs", () => { HERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("in parens args with trailing args after", () => { @@ -352,7 +352,7 @@ describe("heredocs", () => { ARG1 `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("in paren args with a call", () => { @@ -363,7 +363,7 @@ describe("heredocs", () => { ARG1 `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("on calls with multiple", () => { @@ -375,7 +375,7 @@ describe("heredocs", () => { THERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("on commands", () => { @@ -385,7 +385,7 @@ describe("heredocs", () => { HERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("on commands with multiple", () => { @@ -397,7 +397,7 @@ describe("heredocs", () => { THERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("on command calls with trailing arg", () => { @@ -407,7 +407,7 @@ describe("heredocs", () => { HERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("on command calls with multiple", () => { @@ -419,7 +419,7 @@ describe("heredocs", () => { THERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("assign with call", () => { @@ -429,7 +429,7 @@ describe("heredocs", () => { TEXT `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("assign with squiggly indent", () => { @@ -440,7 +440,7 @@ describe("heredocs", () => { ).strip `); - return expect(content).toChangeFormat( + expect(content).toChangeFormat( ruby(` foo = (<<~TEXT).strip bar @@ -456,7 +456,7 @@ describe("heredocs", () => { TEXT `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("with a call and indented", () => { @@ -468,7 +468,7 @@ describe("heredocs", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("with a method call", () => { @@ -479,7 +479,7 @@ describe("heredocs", () => { HERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("with two calls and indented", () => { @@ -491,7 +491,7 @@ describe("heredocs", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("xstring", () => { @@ -501,7 +501,7 @@ describe("heredocs", () => { SHELL `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("with a comment after the declaration", () => { @@ -511,7 +511,7 @@ describe("heredocs", () => { HERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("with a comment after the declaration in a call", () => { @@ -521,7 +521,7 @@ describe("heredocs", () => { HERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("spilling out from another node keeps subsequent formatting", () => { @@ -532,6 +532,6 @@ describe("heredocs", () => { qaz `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/hooks.test.ts b/test/js/ruby/nodes/hooks.test.ts index cdc74b74..39987281 100644 --- a/test/js/ruby/nodes/hooks.test.ts +++ b/test/js/ruby/nodes/hooks.test.ts @@ -1,17 +1,21 @@ import { long, ruby } from "../../utils"; describe.each(["BEGIN", "END"])("%s hook", (hook) => { - test("shortens to one line", () => - expect(`${hook} {\n p 'hook'\n}`).toChangeFormat(`${hook} { p 'hook' }`)); + test("shortens to one line", () => { + expect(`${hook} {\n p 'hook'\n}`).toChangeFormat(`${hook} { p 'hook' }`); + }); - test("maintains single lines", () => - expect(`${hook} { p 'hook' }`).toMatchFormat()); + test("maintains single lines", () => { + expect(`${hook} { p 'hook' }`).toMatchFormat(); + }); - test("maintains multi line", () => - expect(`${hook} {\n ${long}\n}`).toMatchFormat()); + test("maintains multi line", () => { + expect(`${hook} {\n ${long}\n}`).toMatchFormat(); + }); - test("expands to multi line", () => - expect(`${hook} { ${long} }`).toChangeFormat(`${hook} {\n ${long}\n}`)); + test("expands to multi line", () => { + expect(`${hook} { ${long} }`).toChangeFormat(`${hook} {\n ${long}\n}`); + }); test("does not move comments on the declaration", () => { const content = ruby(` @@ -20,7 +24,7 @@ describe.each(["BEGIN", "END"])("%s hook", (hook) => { } `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("works for comments in the body", () => { @@ -30,6 +34,6 @@ describe.each(["BEGIN", "END"])("%s hook", (hook) => { } `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/kwargs.test.ts b/test/js/ruby/nodes/kwargs.test.ts index be5ad7cb..86351a6e 100644 --- a/test/js/ruby/nodes/kwargs.test.ts +++ b/test/js/ruby/nodes/kwargs.test.ts @@ -1,8 +1,13 @@ describe("kwargs", () => { - test("basic", () => expect("def foo(bar: baz); end").toMatchFormat()); + test("basic", () => { + expect("def foo(bar: baz); end").toMatchFormat(); + }); - test("optional", () => expect("def foo(bar:); end").toMatchFormat()); + test("optional", () => { + expect("def foo(bar:); end").toMatchFormat(); + }); - test("double splat", () => - expect("def foo(bar:, **baz); end").toMatchFormat()); + test("double splat", () => { + expect("def foo(bar:, **baz); end").toMatchFormat(); + }); }); diff --git a/test/js/ruby/nodes/lambda.test.ts b/test/js/ruby/nodes/lambda.test.ts index e354e553..a2222910 100644 --- a/test/js/ruby/nodes/lambda.test.ts +++ b/test/js/ruby/nodes/lambda.test.ts @@ -1,82 +1,96 @@ import { long, ruby } from "../../utils"; describe("lambda", () => { - test("plain stabby lambda literal", () => expect("-> { 1 }").toMatchFormat()); + test("plain stabby lambda literal", () => { + expect("-> { 1 }").toMatchFormat(); + }); - test("stabby lambda literal with args", () => - expect("->(a, b, c) { a + b + c }").toMatchFormat()); + test("stabby lambda literal with args", () => { + expect("->(a, b, c) { a + b + c }").toMatchFormat(); + }); - test("stabby lambda literal with arg, no parens", () => - expect("-> a { a }").toChangeFormat("->(a) { a }")); + test("stabby lambda literal with arg, no parens", () => { + expect("-> a { a }").toChangeFormat("->(a) { a }"); + }); - test("stabby lambda with parens, no args", () => - expect("-> () { 1 }").toChangeFormat("-> { 1 }")); + test("stabby lambda with parens, no args", () => { + expect("-> () { 1 }").toChangeFormat("-> { 1 }"); + }); - test("breaking stabby lambda literal", () => - expect(`-> { ${long} }`).toChangeFormat(`-> do\n ${long}\nend`)); + test("breaking stabby lambda literal", () => { + expect(`-> { ${long} }`).toChangeFormat(`-> do\n ${long}\nend`); + }); test("breaking stabby lambda literal with args", () => { const content = `->(a) { a + ${long} }`; const expected = `->(a) do\n a +\n ${long}\nend`; - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); - test("stabby lambda literal within a command node", () => - expect("command :foo, ->(arg) { arg + arg }").toMatchFormat()); + test("stabby lambda literal within a command node", () => { + expect("command :foo, ->(arg) { arg + arg }").toMatchFormat(); + }); - test("stabby lambda literal that breaks within a command node", () => + test("stabby lambda literal that breaks within a command node", () => { expect(`command :foo, -> { ${long} }`).toChangeFormat( ruby(` - command :foo, - -> { - ${long} - } - `) - )); + command :foo, + -> { + ${long} + } + `) + ); + }); - test("stabby lambda literal with a command call node", () => - expect("command.call :foo, ->(arg) { arg + arg }").toMatchFormat()); + test("stabby lambda literal with a command call node", () => { + expect("command.call :foo, ->(arg) { arg + arg }").toMatchFormat(); + }); - test("stabby lambda literal that breaks with a command call node", () => + test("stabby lambda literal that breaks with a command call node", () => { expect(`command.call :foo, -> { ${long} }`).toChangeFormat( ruby(` - command.call :foo, - -> { - ${long} - } - `) - )); - - test("stabby lambda literal that breaks deeply within a command node", () => + command.call :foo, + -> { + ${long} + } + `) + ); + }); + + test("stabby lambda literal that breaks deeply within a command node", () => { expect(`command :foo, bar: -> { ${long} }`).toChangeFormat( ruby(` - command :foo, - bar: -> { - ${long} - } - `) - )); + command :foo, + bar: -> { + ${long} + } + `) + ); + }); test("very long arguments list doesn't break within pipes", () => { const content = `command :foo, ->(${long}, a${long}, aa${long}) { true }`; - return expect(content).toChangeFormat( + expect(content).toChangeFormat( ruby(` - command :foo, - ->( - ${long}, - a${long}, - aa${long} - ) { - true - } - `) + command :foo, + ->( + ${long}, + a${long}, + aa${long} + ) { + true + } + `) ); }); - test("empty brackets", () => expect("a[]").toMatchFormat()); + test("empty brackets", () => { + expect("a[]").toMatchFormat(); + }); - test("brackets with multiple args", () => - expect("a[1, 2, 3]").toMatchFormat()); + test("brackets with multiple args", () => { + expect("a[1, 2, 3]").toMatchFormat(); + }); }); diff --git a/test/js/ruby/nodes/loops.test.ts b/test/js/ruby/nodes/loops.test.ts index dcba0675..69056d03 100644 --- a/test/js/ruby/nodes/loops.test.ts +++ b/test/js/ruby/nodes/loops.test.ts @@ -1,7 +1,7 @@ import { long, ruby } from "../../utils"; describe.each(["while", "until"])("%s", (keyword) => { - test("aligns predicates", () => + test("aligns predicates", () => { expect(`foo ${keyword} ${long} || ${long}`).toChangeFormat( ruby(` ${keyword} ${long} || @@ -9,21 +9,27 @@ describe.each(["while", "until"])("%s", (keyword) => { foo end `) - )); + ); + }); describe("inlines allowed", () => { - test("transforms to inline", () => - expect(`${keyword} a\n 1\nend`).toChangeFormat(`1 ${keyword} a`)); + test("transforms to inline", () => { + expect(`${keyword} a\n 1\nend`).toChangeFormat(`1 ${keyword} a`); + }); - test("maintains inlines", () => expect(`1 ${keyword} a`).toMatchFormat()); + test("maintains inlines", () => { + expect(`1 ${keyword} a`).toMatchFormat(); + }); - test("breaks on large predicates", () => - expect(`${keyword} ${long}\n 1\nend`).toMatchFormat()); + test("breaks on large predicates", () => { + expect(`${keyword} ${long}\n 1\nend`).toMatchFormat(); + }); - test("breaks inlines on large predicates", () => + test("breaks inlines on large predicates", () => { expect(`1 ${keyword} ${long}`).toChangeFormat( `${keyword} ${long}\n 1\nend` - )); + ); + }); test("does not break into block when modifying a begin", () => { const content = ruby(` @@ -32,7 +38,7 @@ describe.each(["while", "until"])("%s", (keyword) => { end ${keyword} bar `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("breaks when an assignment is in the predicate", () => { @@ -42,7 +48,7 @@ describe.each(["while", "until"])("%s", (keyword) => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("breaks when a multi assignment is in the predicate", () => { @@ -52,7 +58,7 @@ describe.each(["while", "until"])("%s", (keyword) => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("breaks the parent when there is an assignment", () => { @@ -64,13 +70,14 @@ describe.each(["while", "until"])("%s", (keyword) => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); - test("wraps single lines in parens when assigning", () => + test("wraps single lines in parens when assigning", () => { expect( `hash[:key] = ${keyword} false do break :value end` - ).toChangeFormat(`hash[:key] = (break :value ${keyword} false)`)); + ).toChangeFormat(`hash[:key] = (break :value ${keyword} false)`); + }); test("empty body", () => { const content = ruby(` @@ -78,7 +85,7 @@ describe.each(["while", "until"])("%s", (keyword) => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("empty body, long predicate", () => { @@ -87,31 +94,33 @@ describe.each(["while", "until"])("%s", (keyword) => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); describe("inlines not allowed", () => { - test("maintains multiline", () => - expect(`${keyword} a\n 1\nend`).toMatchFormat({ rubyModifier: false })); + test("maintains multiline", () => { + expect(`${keyword} a\n 1\nend`).toMatchFormat({ rubyModifier: false }); + }); - test("transforms to multiline", () => + test("transforms to multiline", () => { expect(`1 ${keyword} a`).toChangeFormat(`${keyword} a\n 1\nend`, { rubyModifier: false - })); + }); + }); - test("breaks on large predicates", () => + test("breaks on large predicates", () => { expect(`${keyword} ${long}\n 1\nend`).toMatchFormat({ rubyModifier: false - })); + }); + }); - test("breaks inlines on large predicates", () => + test("breaks inlines on large predicates", () => { expect(`1 ${keyword} ${long}`).toChangeFormat( `${keyword} ${long}\n 1\nend`, - { - rubyModifier: false - } - )); + { rubyModifier: false } + ); + }); test("does not break into block when modifying a begin", () => { const content = ruby(` @@ -120,7 +129,7 @@ describe.each(["while", "until"])("%s", (keyword) => { end ${keyword} bar `); - return expect(content).toMatchFormat({ rubyModifier: false }); + expect(content).toMatchFormat({ rubyModifier: false }); }); test("empty body", () => { @@ -129,7 +138,7 @@ describe.each(["while", "until"])("%s", (keyword) => { end `); - return expect(content).toMatchFormat({ rubyModifier: false }); + expect(content).toMatchFormat({ rubyModifier: false }); }); test("empty body, long predicate", () => { @@ -138,37 +147,42 @@ describe.each(["while", "until"])("%s", (keyword) => { end `); - return expect(content).toMatchFormat({ rubyModifier: false }); + expect(content).toMatchFormat({ rubyModifier: false }); }); }); describe.each(["while", "until"])( "add parens when necessary %s", (keyword) => { - test("args", () => + test("args", () => { expect(`[${keyword} foo? do bar end]`).toChangeFormat( `[(bar ${keyword} foo?)]` - )); + ); + }); - test("assign", () => + test("assign", () => { expect(`foo = ${keyword} bar? do baz end`).toChangeFormat( `foo = (baz ${keyword} bar?)` - )); + ); + }); - test("assoc_new", () => + test("assoc_new", () => { expect(`{ foo: ${keyword} bar? do baz end }`).toChangeFormat( `{ foo: (baz ${keyword} bar?) }` - )); + ); + }); - test("massign", () => + test("massign", () => { expect(`f, o, o = ${keyword} bar? do baz end`).toChangeFormat( `f, o, o = (baz ${keyword} bar?)` - )); + ); + }); - test("opassign", () => + test("opassign", () => { expect(`foo ||= ${keyword} bar? do baz end`).toChangeFormat( `foo ||= (baz ${keyword} bar?)` - )); + ); + }); } ); @@ -194,6 +208,6 @@ describe.each(["while", "until"])("%s", (keyword) => { end `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); }); diff --git a/test/js/ruby/nodes/massign.test.ts b/test/js/ruby/nodes/massign.test.ts index cdacb5b1..5ff61845 100644 --- a/test/js/ruby/nodes/massign.test.ts +++ b/test/js/ruby/nodes/massign.test.ts @@ -1,46 +1,67 @@ describe("massign", () => { - test("multi on left, multi on right", () => - expect("a, b, c = 1, 2, 3").toMatchFormat()); + test("multi on left, multi on right", () => { + expect("a, b, c = 1, 2, 3").toMatchFormat(); + }); - test("single on left, multi on right", () => - expect("a = 1, 2, 3").toMatchFormat()); + test("single on left, multi on right", () => { + expect("a = 1, 2, 3").toMatchFormat(); + }); - test("multi on left, array on right", () => - expect("a, b, c = [1, 2, 3]").toMatchFormat()); + test("multi on left, array on right", () => { + expect("a, b, c = [1, 2, 3]").toMatchFormat(); + }); - test("parens on left, multi on right", () => - expect("(a, b, c) = 1, 2, 3").toChangeFormat("a, b, c = 1, 2, 3")); + test("parens on left, multi on right", () => { + expect("(a, b, c) = 1, 2, 3").toChangeFormat("a, b, c = 1, 2, 3"); + }); - test("double parens on left, multi on right", () => - expect("((a, b, c)) = 1, 2, 3").toChangeFormat("a, b, c = 1, 2, 3")); + test("double parens on left, multi on right", () => { + expect("((a, b, c)) = 1, 2, 3").toChangeFormat("a, b, c = 1, 2, 3"); + }); - test("parens on some of left, multi on right", () => - expect("(a, b), c = [1, 2], 3").toMatchFormat()); + test("parens on some of left, multi on right", () => { + expect("(a, b), c = [1, 2], 3").toMatchFormat(); + }); - test("extra commas at the end", () => expect("a, = 1").toMatchFormat()); + test("extra commas at the end", () => { + expect("a, = 1").toMatchFormat(); + }); - test("extra commas at the end with multiple", () => - expect("a, b, c, = 1").toMatchFormat()); + test("extra commas at the end with multiple", () => { + expect("a, b, c, = 1").toMatchFormat(); + }); - test("extra commas with parens", () => - expect("(a, b,), c, = 1").toMatchFormat()); + test("extra commas with parens", () => { + expect("(a, b,), c, = 1").toMatchFormat(); + }); - test("extra commas with doubled parens", () => - expect("((a, b,), c,), = 1").toMatchFormat()); + test("extra commas with doubled parens", () => { + expect("((a, b,), c,), = 1").toMatchFormat(); + }); describe("splat", () => { - test("after ident", () => expect("a, *b = 1, 2, 3").toMatchFormat()); + test("after ident", () => { + expect("a, *b = 1, 2, 3").toMatchFormat(); + }); - test("between idents", () => - expect("a, *b, c, d = 1, 2, 3").toMatchFormat()); + test("between idents", () => { + expect("a, *b, c, d = 1, 2, 3").toMatchFormat(); + }); - test("with no name", () => expect("a, * = 1, 2, 3").toMatchFormat()); + test("with no name", () => { + expect("a, * = 1, 2, 3").toMatchFormat(); + }); - test("on right side", () => expect("a = *a").toMatchFormat()); + test("on right side", () => { + expect("a = *a").toMatchFormat(); + }); - test("only on left side", () => expect("* = [1, 2, 3]").toMatchFormat()); + test("only on left side", () => { + expect("* = [1, 2, 3]").toMatchFormat(); + }); - test("and then ident on left side", () => - expect("*, a = [1, 2, 3]").toMatchFormat()); + test("and then ident on left side", () => { + expect("*, a = [1, 2, 3]").toMatchFormat(); + }); }); }); diff --git a/test/js/ruby/nodes/method.test.ts b/test/js/ruby/nodes/method.test.ts index 7a819629..5c95db44 100644 --- a/test/js/ruby/nodes/method.test.ts +++ b/test/js/ruby/nodes/method.test.ts @@ -2,42 +2,51 @@ import { atLeastVersion, long, ruby } from "../../utils"; describe("method", () => { describe("definitions", () => { - test("shorthand for empty methods", () => - expect("def foo; end").toMatchFormat()); + test("shorthand for empty methods", () => { + expect("def foo; end").toMatchFormat(); + }); - test("shorthand for empty methods with parens", () => - expect("def foo(); end").toMatchFormat()); + test("shorthand for empty methods with parens", () => { + expect("def foo(); end").toMatchFormat(); + }); - test("single arg, no parens", () => - expect("def foo bar\nend").toChangeFormat("def foo(bar); end")); + test("single arg, no parens", () => { + expect("def foo bar\nend").toChangeFormat("def foo(bar); end"); + }); - test("single arg, with parens", () => - expect("def foo(bar)\nend").toChangeFormat("def foo(bar); end")); + test("single arg, with parens", () => { + expect("def foo(bar)\nend").toChangeFormat("def foo(bar); end"); + }); - test("shorthand for empty singleton methods", () => - expect("def self.foo; end").toMatchFormat()); + test("shorthand for empty singleton methods", () => { + expect("def self.foo; end").toMatchFormat(); + }); - test("shorthand for empty singleton methods with parens", () => - expect("def self.foo(); end").toMatchFormat()); + test("shorthand for empty singleton methods with parens", () => { + expect("def self.foo(); end").toMatchFormat(); + }); - test("singleton, single arg, no parens", () => - expect("def self.foo bar\nend").toChangeFormat("def self.foo(bar); end")); + test("singleton, single arg, no parens", () => { + expect("def self.foo bar\nend").toChangeFormat("def self.foo(bar); end"); + }); - test("singleton, single arg, with parens", () => - expect("def self.foo(bar)\nend").toChangeFormat( - "def self.foo(bar); end" - )); + test("singleton, single arg, with parens", () => { + expect("def self.foo(bar)\nend").toChangeFormat("def self.foo(bar); end"); + }); - test("shorthand with a body", () => + test("shorthand with a body", () => { expect("def foo(alpha); 1; end").toChangeFormat( "def foo(alpha)\n 1\nend" - )); + ); + }); - test("single splat arg with no name", () => - expect("def foo(*); end").toMatchFormat()); + test("single splat arg with no name", () => { + expect("def foo(*); end").toMatchFormat(); + }); - test("double splat arg with no name", () => - expect("def foo(**); end").toMatchFormat()); + test("double splat arg with no name", () => { + expect("def foo(**); end").toMatchFormat(); + }); test("with helper method", () => { const content = ruby(` @@ -46,7 +55,7 @@ describe("method", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("with helper method on defs", () => { @@ -56,7 +65,7 @@ describe("method", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("every single arg type", () => { @@ -66,7 +75,7 @@ describe("method", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("breaking", () => { @@ -78,7 +87,7 @@ describe("method", () => { ); end `); - return expect(content).toChangeFormat(expected); + expect(content).toChangeFormat(expected); }); test("with comments on method definition", () => { @@ -90,7 +99,7 @@ describe("method", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("with comments on params", () => { @@ -108,7 +117,7 @@ describe("method", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("with comments on optional params", () => { @@ -120,11 +129,13 @@ describe("method", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); if (atLeastVersion("2.7")) { - test("nokw_param", () => expect("def foo(**nil); end").toMatchFormat()); + test("nokw_param", () => { + expect("def foo(**nil); end").toMatchFormat(); + }); test("args_forward", () => { const content = ruby(` @@ -133,7 +144,7 @@ describe("method", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); } @@ -145,17 +156,20 @@ describe("method", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); - test("single-line methods", () => - expect("def foo = bar").toMatchFormat()); + test("single-line methods", () => { + expect("def foo = bar").toMatchFormat(); + }); - test("single-line methods with empty params", () => - expect("def foo() = bar").toChangeFormat("def foo = bar")); + test("single-line methods with empty params", () => { + expect("def foo() = bar").toChangeFormat("def foo = bar"); + }); - test("single-line methods with params", () => - expect("def foo(name) = bar").toMatchFormat()); + test("single-line methods with params", () => { + expect("def foo(name) = bar").toMatchFormat(); + }); } test("comments on kwargs", () => { @@ -168,18 +182,26 @@ describe("method", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); describe("method calls", () => { - test("empty parens", () => expect("foo()").toChangeFormat("foo")); + test("empty parens", () => { + expect("foo()").toChangeFormat("foo"); + }); - test("single args", () => expect("foo(1)").toMatchFormat()); + test("single args", () => { + expect("foo(1)").toMatchFormat(); + }); - test("multi arg", () => expect("foo(1, 2)").toMatchFormat()); + test("multi arg", () => { + expect("foo(1, 2)").toMatchFormat(); + }); - test("just block", () => expect("foo(&block)").toMatchFormat()); + test("just block", () => { + expect("foo(&block)").toMatchFormat(); + }); describe("commands", () => { test("alignment", () => { @@ -189,7 +211,7 @@ describe("method", () => { ) `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("alignment for `to`", () => { @@ -199,7 +221,7 @@ describe("method", () => { ) `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("alignment for `not_to`", () => { @@ -209,7 +231,7 @@ describe("method", () => { ) `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("just block", () => { @@ -219,17 +241,22 @@ describe("method", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); describe("single splat", () => { - test("plain", () => expect("foo(*bar)").toMatchFormat()); + test("plain", () => { + expect("foo(*bar)").toMatchFormat(); + }); - test("with multi args", () => expect("foo(1, 2, *abc)").toMatchFormat()); + test("with multi args", () => { + expect("foo(1, 2, *abc)").toMatchFormat(); + }); - test("between multi args", () => - expect("foo(1, 2, *abc, 3, 4)").toMatchFormat()); + test("between multi args", () => { + expect("foo(1, 2, *abc, 3, 4)").toMatchFormat(); + }); test("with comments", () => { const content = ruby(` @@ -241,7 +268,7 @@ describe("method", () => { ) `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("with trailing comments", () => { @@ -254,10 +281,12 @@ describe("method", () => { ) `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); - test("with block", () => expect("foo(*bar, &block)").toMatchFormat()); + test("with block", () => { + expect("foo(*bar, &block)").toMatchFormat(); + }); test("with comments and block", () => { const content = ruby(` @@ -267,116 +296,138 @@ describe("method", () => { ) `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); describe("double splat", () => { - test("plain", () => expect("foo(**bar)").toMatchFormat()); + test("plain", () => { + expect("foo(**bar)").toMatchFormat(); + }); - test("with block", () => expect("foo(**bar, &block)").toMatchFormat()); + test("with block", () => { + expect("foo(**bar, &block)").toMatchFormat(); + }); - test("with splat and block", () => - expect("foo(*bar, **baz, &block)").toMatchFormat()); + test("with splat and block", () => { + expect("foo(*bar, **baz, &block)").toMatchFormat(); + }); - test("after kwarg", () => - expect("foo(kwarg: 1, **splat)").toMatchFormat()); + test("after kwarg", () => { + expect("foo(kwarg: 1, **splat)").toMatchFormat(); + }); - test("before kwarg", () => - expect("foo(**splat, kwarg: 1)").toMatchFormat()); + test("before kwarg", () => { + expect("foo(**splat, kwarg: 1)").toMatchFormat(); + }); - test("before kwargs", () => - expect("foo(before: 1, **splat, after: 1)").toMatchFormat()); + test("before kwargs", () => { + expect("foo(before: 1, **splat, after: 1)").toMatchFormat(); + }); }); describe("different operators", () => { - test("double colon gets changed", () => - expect("Foo::foo").toChangeFormat("Foo.foo")); + test("double colon gets changed", () => { + expect("Foo::foo").toChangeFormat("Foo.foo"); + }); - test("lonely operator", () => expect("foo&.foo").toMatchFormat()); + test("lonely operator", () => { + expect("foo&.foo").toMatchFormat(); + }); }); describe("breaking", () => { describe("without trailing commas", () => { - test("starting with no trailing comma stays", () => + test("starting with no trailing comma stays", () => { expect(`foo(${long}, a${long})`).toChangeFormat( `foo(\n ${long},\n a${long}\n)` - )); + ); + }); - test("with breaking ternary as first argument", () => + test("with breaking ternary as first argument", () => { expect(`foo bar ? ${long} : a${long}`).toChangeFormat( `foo(\n if bar\n ${long}\n else\n a${long}\n end\n)` - )); + ); + }); - test("starting with trailing comma changes", () => + test("starting with trailing comma changes", () => { expect(`foo(${long}, a${long},)`).toChangeFormat( `foo(\n ${long},\n a${long}\n)` - )); + ); + }); - test("with block on the end", () => + test("with block on the end", () => { expect(`foo(${long}, &block)`).toChangeFormat( `foo(\n ${long},\n &block\n)` - )); + ); + }); - test("on commands", () => + test("on commands", () => { expect(`command ${long}, a${long}`).toChangeFormat( ruby(` - command ${long}, - a${long} - `) - )); + command ${long}, + a${long} + `) + ); + }); - test("on command calls", () => + test("on command calls", () => { expect(`command.call ${long}, a${long}`).toChangeFormat( ruby(` - command.call ${long}, - a${long} - `) - )); + command.call ${long}, + a${long} + `) + ); + }); }); describe("with trailing commas", () => { - test("starting with no trailing comma changes", () => + test("starting with no trailing comma changes", () => { expect(`foo(${long}, a${long})`).toChangeFormat( `foo(\n ${long},\n a${long},\n)`, { trailingComma: "all" } - )); + ); + }); - test("starting with trailing comma stays", () => + test("starting with trailing comma stays", () => { expect(`foo(${long}, a${long},)`).toChangeFormat( `foo(\n ${long},\n a${long},\n)`, { trailingComma: "all" } - )); + ); + }); - test("with block on the end", () => + test("with block on the end", () => { expect(`foo(${long}, &block)`).toChangeFormat( `foo(\n ${long},\n &block\n)`, { trailingComma: "all" } - )); + ); + }); - test("on commands", () => + test("on commands", () => { expect(`command ${long}, a${long}`).toChangeFormat( ruby(` command ${long}, a${long} `), { trailingComma: "all" } - )); + ); + }); - test("on command calls", () => + test("on command calls", () => { expect(`command.call ${long}, a${long}`).toChangeFormat( ruby(` command.call ${long}, a${long} `), { trailingComma: "all" } - )); + ); + }); test("on long commands within an arg_paren", () => { const expected = ruby(` @@ -385,7 +436,7 @@ describe("method", () => { ) `); - return expect(`foo(${long} 'bar')`).toChangeFormat(expected, { + expect(`foo(${long} 'bar')`).toChangeFormat(expected, { trailingComma: "all" }); }); diff --git a/test/js/ruby/nodes/next.test.ts b/test/js/ruby/nodes/next.test.ts index 5f84e084..9e2dbdd4 100644 --- a/test/js/ruby/nodes/next.test.ts +++ b/test/js/ruby/nodes/next.test.ts @@ -1,14 +1,21 @@ import { ruby } from "../../utils"; describe("next", () => { - test("bare", () => expect("next").toMatchFormat()); + test("bare", () => { + expect("next").toMatchFormat(); + }); - test("one arg, no parens", () => expect("next 1").toMatchFormat()); + test("one arg, no parens", () => { + expect("next 1").toMatchFormat(); + }); - test("one arg, with parens", () => - expect("next(1)").toChangeFormat("next 1")); + test("one arg, with parens", () => { + expect("next(1)").toChangeFormat("next 1"); + }); - test("multiple args", () => expect("next 1, 2").toMatchFormat()); + test("multiple args", () => { + expect("next 1, 2").toMatchFormat(); + }); test("keeps parens for multiple statements", () => { const expected = ruby(` @@ -18,9 +25,10 @@ describe("next", () => { ) `); - return expect("next(a = 1; a == 1)").toChangeFormat(expected); + expect("next(a = 1; a == 1)").toChangeFormat(expected); }); - test("keeps parens for _mod nodes", () => - expect("next(1 if true)").toMatchFormat()); + test("keeps parens for _mod nodes", () => { + expect("next(1 if true)").toMatchFormat(); + }); }); diff --git a/test/js/ruby/nodes/numbers.test.ts b/test/js/ruby/nodes/numbers.test.ts index bdbbf6da..82266637 100644 --- a/test/js/ruby/nodes/numbers.test.ts +++ b/test/js/ruby/nodes/numbers.test.ts @@ -1,35 +1,49 @@ describe("numbers", () => { - test("basic", () => expect("123").toMatchFormat()); + test("basic", () => { + expect("123").toMatchFormat(); + }); - test("preserves sign", () => expect("-123").toMatchFormat()); + test("preserves sign", () => { + expect("-123").toMatchFormat(); + }); - test("respects no o for octal numbers", () => - expect("0123").toChangeFormat("0123")); + test("respects no o for octal numbers", () => { + expect("0123").toChangeFormat("0123"); + }); - test("respects o for octal numbers", () => - expect("0o123").toChangeFormat("0o123")); + test("respects o for octal numbers", () => { + expect("0o123").toChangeFormat("0o123"); + }); - test("does not consider numbers large until they have more than 4 digits", () => - expect("1234").toMatchFormat()); + test("does not consider numbers large until they have more than 4 digits", () => { + expect("1234").toMatchFormat(); + }); - test("for large numbers adds underscores (mod 3 ==== 0)", () => - expect("123456").toChangeFormat("123_456")); + test("for large numbers adds underscores (mod 3 ==== 0)", () => { + expect("123456").toChangeFormat("123_456"); + }); - test("for large numbers adds underscores (mod 3 === 1)", () => - expect("1234567").toChangeFormat("1_234_567")); + test("for large numbers adds underscores (mod 3 === 1)", () => { + expect("1234567").toChangeFormat("1_234_567"); + }); - test("for large numbers add underscores (mod 3 ==== 2)", () => - expect("12345678").toChangeFormat("12_345_678")); + test("for large numbers add underscores (mod 3 ==== 2)", () => { + expect("12345678").toChangeFormat("12_345_678"); + }); - test("ignores numbers that already have underscores", () => - expect("2019_04_17_17_09_00").toMatchFormat()); + test("ignores numbers that already have underscores", () => { + expect("2019_04_17_17_09_00").toMatchFormat(); + }); - test("ignores formatting on binary numbers", () => - expect("0b01101001").toMatchFormat()); + test("ignores formatting on binary numbers", () => { + expect("0b01101001").toMatchFormat(); + }); - test("ignores formatting on octal numbers", () => - expect("0o123401234").toMatchFormat()); + test("ignores formatting on octal numbers", () => { + expect("0o123401234").toMatchFormat(); + }); - test("ignores formatting on hex numbers", () => - expect("0x123401234").toMatchFormat()); + test("ignores formatting on hex numbers", () => { + expect("0x123401234").toMatchFormat(); + }); }); diff --git a/test/js/ruby/nodes/patterns.test.ts b/test/js/ruby/nodes/patterns.test.ts index 99bd7799..26eb5162 100644 --- a/test/js/ruby/nodes/patterns.test.ts +++ b/test/js/ruby/nodes/patterns.test.ts @@ -35,13 +35,13 @@ describe("patterns", () => { test("rassign", () => { const content = "{ db: { user: 'John' } } => { db: { user: } }"; - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("rassign with fndptn", () => { const content = "(1..10).to_a.shuffle => [*bef, 2..4 => thresh, *aft]"; - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); } @@ -53,7 +53,7 @@ describe("patterns", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("with comments in an array pattern", () => { @@ -65,7 +65,7 @@ describe("patterns", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("with comments in an array pattern", () => { @@ -77,7 +77,7 @@ describe("patterns", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("multiple clauses", () => { @@ -90,6 +90,6 @@ describe("patterns", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/ranges.test.ts b/test/js/ruby/nodes/ranges.test.ts index 7df14f92..3e3d67d2 100644 --- a/test/js/ruby/nodes/ranges.test.ts +++ b/test/js/ruby/nodes/ranges.test.ts @@ -1,23 +1,39 @@ import { atLeastVersion } from "../../utils"; describe("ranges", () => { - test("two dot", () => expect("1..2").toMatchFormat()); + test("two dot", () => { + expect("1..2").toMatchFormat(); + }); - test("negative two dot", () => expect("-2..-1").toMatchFormat()); + test("negative two dot", () => { + expect("-2..-1").toMatchFormat(); + }); - test("three dot", () => expect("3...4").toMatchFormat()); + test("three dot", () => { + expect("3...4").toMatchFormat(); + }); - test("negative three dot", () => expect("-4...-3").toMatchFormat()); + test("negative three dot", () => { + expect("-4...-3").toMatchFormat(); + }); if (atLeastVersion("2.6")) { - test("two dot with no ending", () => expect("1..").toMatchFormat()); + test("two dot with no ending", () => { + expect("1..").toMatchFormat(); + }); - test("three dot with no ending", () => expect("1...").toMatchFormat()); + test("three dot with no ending", () => { + expect("1...").toMatchFormat(); + }); } if (atLeastVersion("2.7")) { - test("two dot with no beginning", () => expect("..2").toMatchFormat()); + test("two dot with no beginning", () => { + expect("..2").toMatchFormat(); + }); - test("three dot with no beginning", () => expect("...2").toMatchFormat()); + test("three dot with no beginning", () => { + expect("...2").toMatchFormat(); + }); } }); diff --git a/test/js/ruby/nodes/regexp.test.ts b/test/js/ruby/nodes/regexp.test.ts index 7220a0bf..59866495 100644 --- a/test/js/ruby/nodes/regexp.test.ts +++ b/test/js/ruby/nodes/regexp.test.ts @@ -1,33 +1,57 @@ import { ruby } from "../../utils"; describe("regexp", () => { - test("basic", () => expect("/abc/").toMatchFormat()); + test("basic", () => { + expect("/abc/").toMatchFormat(); + }); - test("unnecessary braces", () => expect("%r{abc}").toChangeFormat("/abc/")); + test("unnecessary braces", () => { + expect("%r{abc}").toChangeFormat("/abc/"); + }); - test("unnecessary slashes", () => expect("%r/abc/").toChangeFormat("/abc/")); + test("unnecessary slashes", () => { + expect("%r/abc/").toChangeFormat("/abc/"); + }); - test("unnecessary brackets", () => expect("%r[abc]").toChangeFormat("/abc/")); + test("unnecessary brackets", () => { + expect("%r[abc]").toChangeFormat("/abc/"); + }); - test("unnecessary parens", () => expect("%r(abc)").toChangeFormat("/abc/")); + test("unnecessary parens", () => { + expect("%r(abc)").toChangeFormat("/abc/"); + }); - test("necessary braces", () => expect("%r{a/b/c}").toMatchFormat()); + test("necessary braces", () => { + expect("%r{a/b/c}").toMatchFormat(); + }); - test("interpolation", () => expect("/a#{inter}c/").toMatchFormat()); + test("interpolation", () => { + expect("/a#{inter}c/").toMatchFormat(); + }); - test("modifiers", () => expect("/abc/i").toMatchFormat()); + test("modifiers", () => { + expect("/abc/i").toMatchFormat(); + }); - test("braces and modifiers", () => expect("%r{a/b/c}mi").toMatchFormat()); + test("braces and modifiers", () => { + expect("%r{a/b/c}mi").toMatchFormat(); + }); - test("global interpolation", () => expect("/#$&/").toChangeFormat("/#{$&}/")); + test("global interpolation", () => { + expect("/#$&/").toChangeFormat("/#{$&}/"); + }); - test("do not change if { and / in regexp literal", () => - expect("%r(a{b/c)").toMatchFormat()); + test("do not change if { and / in regexp literal", () => { + expect("%r(a{b/c)").toMatchFormat(); + }); - test("do not change if } and / in regexp literal", () => - expect("%r[a}b/c]").toMatchFormat()); + test("do not change if } and / in regexp literal", () => { + expect("%r[a}b/c]").toMatchFormat(); + }); - test("parens with }", () => expect("%r(a}bc)").toChangeFormat("/a}bc/")); + test("parens with }", () => { + expect("%r(a}bc)").toChangeFormat("/a}bc/"); + }); test("comments in regex", () => { const content = ruby(` @@ -39,15 +63,18 @@ describe("regexp", () => { \\Z/x `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); - test("forces braces if could be ambiguous with space in command", () => - expect("foo %r{ bar}").toMatchFormat()); + test("forces braces if could be ambiguous with space in command", () => { + expect("foo %r{ bar}").toMatchFormat(); + }); - test("forces braces if could be ambiguous with equals in command", () => - expect("foo %r{= bar}").toMatchFormat()); + test("forces braces if could be ambiguous with equals in command", () => { + expect("foo %r{= bar}").toMatchFormat(); + }); - test("do not force braces if space is in parens", () => - expect("foo(/ bar/)").toMatchFormat()); + test("do not force braces if space is in parens", () => { + expect("foo(/ bar/)").toMatchFormat(); + }); }); diff --git a/test/js/ruby/nodes/rescue.test.ts b/test/js/ruby/nodes/rescue.test.ts index ffbff7f7..43334bf9 100644 --- a/test/js/ruby/nodes/rescue.test.ts +++ b/test/js/ruby/nodes/rescue.test.ts @@ -10,7 +10,7 @@ describe("rescue", () => { end `); - return expect("a rescue nil").toChangeFormat(expected); + expect("a rescue nil").toChangeFormat(expected); }); test("rescue just variable", () => { @@ -22,7 +22,7 @@ describe("rescue", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); // from ruby spec/ruby/language/rescue_spec.rb @@ -35,7 +35,7 @@ describe("rescue", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test.each(["begin", "def foo"])("%s with every clause", (declaration) => { @@ -61,7 +61,7 @@ describe("rescue", () => { end `); - return expect(content).toChangeFormat( + expect(content).toChangeFormat( ruby(` ${declaration} 1 @@ -95,7 +95,7 @@ describe("rescue", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("comment inline", () => { @@ -107,7 +107,7 @@ describe("rescue", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("comment inline with multiple", () => { @@ -119,7 +119,7 @@ describe("rescue", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("comment inline with splat", () => { @@ -131,7 +131,7 @@ describe("rescue", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("one error with a comment", () => { @@ -143,7 +143,7 @@ describe("rescue", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("two errors with a comment", () => { @@ -155,6 +155,6 @@ describe("rescue", () => { end `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/return.test.ts b/test/js/ruby/nodes/return.test.ts index 09f1b25d..754188c6 100644 --- a/test/js/ruby/nodes/return.test.ts +++ b/test/js/ruby/nodes/return.test.ts @@ -1,54 +1,75 @@ import { long, ruby } from "../../utils"; describe("return", () => { - test("bare", () => expect("return").toMatchFormat()); + test("bare", () => { + expect("return").toMatchFormat(); + }); - test("one arg, no parens", () => expect("return 1").toMatchFormat()); + test("one arg, no parens", () => { + expect("return 1").toMatchFormat(); + }); - test("one arg, with parens", () => - expect("return(1)").toChangeFormat("return 1")); + test("one arg, with parens", () => { + expect("return(1)").toChangeFormat("return 1"); + }); - test("multiple args", () => expect("return 1, 2").toMatchFormat()); + test("multiple args", () => { + expect("return 1, 2").toMatchFormat(); + }); - test("return method call", () => expect("return foo :bar").toMatchFormat()); + test("return method call", () => { + expect("return foo :bar").toMatchFormat(); + }); - test("return with breaking", () => - expect(`return ${long}`).toChangeFormat(`return(\n ${long}\n)`)); + test("return with breaking", () => { + expect(`return ${long}`).toChangeFormat(`return(\n ${long}\n)`); + }); - test("returning an array", () => - expect("return [1, 2, 3]").toChangeFormat("return 1, 2, 3")); + test("returning an array", () => { + expect("return [1, 2, 3]").toChangeFormat("return 1, 2, 3"); + }); - test("returning an empty array", () => expect("return []").toMatchFormat()); + test("returning an empty array", () => { + expect("return []").toMatchFormat(); + }); - test("returning a single element array", () => - expect("return [1]").toMatchFormat()); + test("returning a single element array", () => { + expect("return [1]").toMatchFormat(); + }); - test("returning a list that breaks", () => + test("returning a list that breaks", () => { expect(`return ${long}, ${long}`).toChangeFormat( `return [\n ${long},\n ${long}\n]` - )); + ); + }); - test("returning an array within parens", () => - expect("return([1, 2, 3])").toChangeFormat("return 1, 2, 3")); + test("returning an array within parens", () => { + expect("return([1, 2, 3])").toChangeFormat("return 1, 2, 3"); + }); - test("returning a long special array", () => + test("returning a long special array", () => { expect(`return %w[${long}]`).toChangeFormat( `return(\n %w[\n ${long}\n ]\n)` - )); + ); + }); - test("returning two arguments, one that breaks", () => + test("returning two arguments, one that breaks", () => { expect(`return foo, ${long}`).toChangeFormat( `return [\n foo,\n ${long}\n]` - )); + ); + }); - test("returning two arguments, the first with parentheses", () => - expect("return (1), 2").toMatchFormat()); + test("returning two arguments, the first with parentheses", () => { + expect("return (1), 2").toMatchFormat(); + }); - test("returning with the or keyword", () => - expect("return(a or b)").toMatchFormat()); + test("returning with the or keyword", () => { + expect("return(a or b)").toMatchFormat(); + }); - test("returning with the not keyword", () => - expect("return(not a)").toMatchFormat()); + test("returning with the not keyword", () => { + expect("return(not a)").toMatchFormat(); + }); test("comment inside of return parentheses", () => { const content = ruby(` @@ -58,6 +79,6 @@ describe("return", () => { ) `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/strings.test.ts b/test/js/ruby/nodes/strings.test.ts index 47a12f0d..c7fee41a 100644 --- a/test/js/ruby/nodes/strings.test.ts +++ b/test/js/ruby/nodes/strings.test.ts @@ -24,89 +24,121 @@ describe("strings", () => { }); describe("with single quotes", () => { - test("empty single quote strings stay", () => expect("''").toMatchFormat()); + test("empty single quote strings stay", () => { + expect("''").toMatchFormat(); + }); - test("empty double quote strings change", () => - expect(`""`).toChangeFormat("''")); + test("empty double quote strings change", () => { + expect(`""`).toChangeFormat("''"); + }); - test("basic strings with single quotes stay", () => - expect("'abc'").toMatchFormat()); + test("basic strings with single quotes stay", () => { + expect("'abc'").toMatchFormat(); + }); - test("basic strings with double quotes change", () => - expect(`"abc"`).toChangeFormat("'abc'")); + test("basic strings with double quotes change", () => { + expect(`"abc"`).toChangeFormat("'abc'"); + }); - test("double quotes with inner single quotes stay", () => - expect(`"abc's"`).toMatchFormat()); + test("double quotes with inner single quotes stay", () => { + expect(`"abc's"`).toMatchFormat(); + }); describe("escape sequences", () => { - test("single quotes stay", () => expect("'abc\\n'").toMatchFormat()); + test("single quotes stay", () => { + expect("'abc\\n'").toMatchFormat(); + }); - test("double quotes stay", () => expect(`"abc\\n"`).toMatchFormat()); + test("double quotes stay", () => { + expect(`"abc\\n"`).toMatchFormat(); + }); - test("interpolation within single quotes stay", () => - expect(`'#{"\\n"}'`).toMatchFormat()); + test("interpolation within single quotes stay", () => { + expect(`'#{"\\n"}'`).toMatchFormat(); + }); - test("interpolation within double quotes stay", () => - expect(`"#{"\\n"}"`).toMatchFormat()); + test("interpolation within double quotes stay", () => { + expect(`"#{"\\n"}"`).toMatchFormat(); + }); - test("escaped double quotes are not unquoted", () => - expect("'abc \\\"def\\\" ghi'").toMatchFormat()); + test("escaped double quotes are not unquoted", () => { + expect("'abc \\\"def\\\" ghi'").toMatchFormat(); + }); }); }); describe("with double quotes", () => { - test("empty single quote strings change", () => - expect("''").toChangeFormat(`""`, { rubySingleQuote: false })); + test("empty single quote strings change", () => { + expect("''").toChangeFormat(`""`, { rubySingleQuote: false }); + }); - test("empty double quote strings stay", () => - expect(`""`).toMatchFormat({ rubySingleQuote: false })); + test("empty double quote strings stay", () => { + expect(`""`).toMatchFormat({ rubySingleQuote: false }); + }); - test("basic strings with single quotes change", () => - expect("'abc'").toChangeFormat(`"abc"`, { rubySingleQuote: false })); + test("basic strings with single quotes change", () => { + expect("'abc'").toChangeFormat(`"abc"`, { rubySingleQuote: false }); + }); - test("basic strings with double quotes stay", () => - expect(`"abc"`).toMatchFormat({ rubySingleQuote: false })); + test("basic strings with double quotes stay", () => { + expect(`"abc"`).toMatchFormat({ rubySingleQuote: false }); + }); - test("double quotes with inner single quotes stay", () => - expect(`"abc's"`).toMatchFormat({ rubySingleQuote: false })); + test("double quotes with inner single quotes stay", () => { + expect(`"abc's"`).toMatchFormat({ rubySingleQuote: false }); + }); - test("double quotes get escaped", () => + test("double quotes get escaped", () => { expect(`'"foo"'`).toChangeFormat(`"\\"foo\\""`, { rubySingleQuote: false - })); + }); + }); describe("escape sequences", () => { - test("single quotes stay", () => expect("'abc\\n'").toMatchFormat()); + test("single quotes stay", () => { + expect("'abc\\n'").toMatchFormat(); + }); - test("double quotes stay", () => expect(`"abc\\n"`).toMatchFormat()); + test("double quotes stay", () => { + expect(`"abc\\n"`).toMatchFormat(); + }); - test("interpolation within single quotes stay", () => - expect(`'#{"\\n"}'`).toMatchFormat()); + test("interpolation within single quotes stay", () => { + expect(`'#{"\\n"}'`).toMatchFormat(); + }); - test("interpolation within double quotes stay", () => - expect(`"#{"\\n"}"`).toMatchFormat()); + test("interpolation within double quotes stay", () => { + expect(`"#{"\\n"}"`).toMatchFormat(); + }); }); }); describe("with %{} quotes", () => { - test("matches correctly", () => - expect("%{foo\\n#{bar}\\nbaz}").toMatchFormat()); + test("matches correctly", () => { + expect("%{foo\\n#{bar}\\nbaz}").toMatchFormat(); + }); }); - test("concatenation", () => - expect(`'abc' \\\n 'def' \\\n 'ghi'`).toMatchFormat()); + test("concatenation", () => { + expect(`'abc' \\\n 'def' \\\n 'ghi'`).toMatchFormat(); + }); describe("interpolation", () => { - test("with keywords", () => expect(`"abc #{super} abc"`).toMatchFormat()); + test("with keywords", () => { + expect(`"abc #{super} abc"`).toMatchFormat(); + }); - test("at the beginning of the string", () => - expect(`"#{abc} abc"`).toMatchFormat()); + test("at the beginning of the string", () => { + expect(`"#{abc} abc"`).toMatchFormat(); + }); - test("very interpolated", () => - expect(`"abc #{"abc #{abc} abc"} abc"`).toMatchFormat()); + test("very interpolated", () => { + expect(`"abc #{"abc #{abc} abc"} abc"`).toMatchFormat(); + }); - test("long strings with interpolation do not break", () => - expect(`"${long} #{foo[:bar]} ${long}"`).toMatchFormat()); + test("long strings with interpolation do not break", () => { + expect(`"${long} #{foo[:bar]} ${long}"`).toMatchFormat(); + }); test("long strings with interpolation that were broken do break", () => { const content = ruby(` @@ -117,7 +149,7 @@ describe("strings", () => { HERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("within a heredoc there is no indentation", () => { @@ -127,77 +159,108 @@ describe("strings", () => { HERE `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); describe("char literals", () => { - test("single chars get changed", () => expect("?a").toChangeFormat("'a'")); + test("single chars get changed", () => { + expect("?a").toChangeFormat("'a'"); + }); - test("single chars get changed with double quotes", () => - expect("?a").toChangeFormat(`"a"`, { rubySingleQuote: false })); + test("single chars get changed with double quotes", () => { + expect("?a").toChangeFormat(`"a"`, { rubySingleQuote: false }); + }); - test("control escape sequences stay", () => - expect("?\\C-a").toMatchFormat()); + test("control escape sequences stay", () => { + expect("?\\C-a").toMatchFormat(); + }); - test("meta escape sequences stay", () => expect("?\\M-a").toMatchFormat()); + test("meta escape sequences stay", () => { + expect("?\\M-a").toMatchFormat(); + }); - test("meta and control sequences stay", () => - expect("?\\M-\\C-a").toMatchFormat()); + test("meta and control sequences stay", () => { + expect("?\\M-\\C-a").toMatchFormat(); + }); }); describe("xstrings", () => { - test("backtick literals", () => expect("`abc`").toMatchFormat()); + test("backtick literals", () => { + expect("`abc`").toMatchFormat(); + }); - test("breaking backtick literals", () => - expect(`\`${long}\``).toMatchFormat()); + test("breaking backtick literals", () => { + expect(`\`${long}\``).toMatchFormat(); + }); - test("breaking backtick literals with method chains", () => - expect(`\`${long}\`.to_s`).toMatchFormat()); + test("breaking backtick literals with method chains", () => { + expect(`\`${long}\`.to_s`).toMatchFormat(); + }); - test("%x literals", () => expect("%x[abc]").toChangeFormat("`abc`")); + test("%x literals", () => { + expect("%x[abc]").toChangeFormat("`abc`"); + }); - test("breaking %x literals", () => - expect(`%x[${long}]`).toChangeFormat(`\`${long}\``)); + test("breaking %x literals", () => { + expect(`%x[${long}]`).toChangeFormat(`\`${long}\``); + }); - test("breaking %x literals with method chains", () => - expect(`%x[${long}].to_s`).toChangeFormat(`\`${long}\`.to_s`)); + test("breaking %x literals with method chains", () => { + expect(`%x[${long}].to_s`).toChangeFormat(`\`${long}\`.to_s`); + }); }); describe("symbols", () => { - test("basic", () => expect(":abc").toMatchFormat()); + test("basic", () => { + expect(":abc").toMatchFormat(); + }); - test("with single quotes", () => expect(":'abc'").toMatchFormat()); + test("with single quotes", () => { + expect(":'abc'").toMatchFormat(); + }); - test("with double quotes", () => expect(`:"abc"`).toChangeFormat(":'abc'")); + test("with double quotes", () => { + expect(`:"abc"`).toChangeFormat(":'abc'"); + }); - test("with double quotes with double quotes desired", () => - expect(`:"abc"`).toMatchFormat({ rubySingleQuote: false })); + test("with double quotes with double quotes desired", () => { + expect(`:"abc"`).toMatchFormat({ rubySingleQuote: false }); + }); - test("with false interpolation and single quotes, no rubySingleQuote", () => - expect(":'abc#{foo}abc'").toMatchFormat({ rubySingleQuote: false })); + test("with false interpolation and single quotes, no rubySingleQuote", () => { + expect(":'abc#{foo}abc'").toMatchFormat({ rubySingleQuote: false }); + }); - test("with real interpolation and double quotes", () => - expect(`:"abc#{foo}abc"`).toMatchFormat()); + test("with real interpolation and double quotes", () => { + expect(`:"abc#{foo}abc"`).toMatchFormat(); + }); - test("with real interpolation and double quotes, rubySingleQuote", () => - expect(`:"abc#{foo}abc"`).toMatchFormat({ rubySingleQuote: true })); + test("with real interpolation and double quotes, rubySingleQuote", () => { + expect(`:"abc#{foo}abc"`).toMatchFormat({ rubySingleQuote: true }); + }); - test("%s literal", () => expect("%s[abc]").toChangeFormat(":'abc'")); + test("%s literal", () => { + expect("%s[abc]").toChangeFormat(":'abc'"); + }); - test("%s literal with false interpolation", () => - expect("%s[abc#{d}]").toChangeFormat(":'abc#{d}'")); + test("%s literal with false interpolation", () => { + expect("%s[abc#{d}]").toChangeFormat(":'abc#{d}'"); + }); - test("%s literal as hash key", () => - expect("{ %s[abc] => d }").toChangeFormat("{ 'abc': d }")); + test("%s literal as hash key", () => { + expect("{ %s[abc] => d }").toChangeFormat("{ 'abc': d }"); + }); - test("%s literal as hash key, no rubySingleQuote", () => + test("%s literal as hash key, no rubySingleQuote", () => { expect("{ %s[abc] => d }").toChangeFormat(`{ "abc": d }`, { rubySingleQuote: false - })); + }); + }); - test("symbol literal as a hash key", () => - expect("{ '\\d' => 1 }").toMatchFormat()); + test("symbol literal as a hash key", () => { + expect("{ '\\d' => 1 }").toMatchFormat(); + }); test("%s literal with newlines", () => { const content = ruby(` @@ -206,13 +269,13 @@ describe("strings", () => { ] `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("gets correct quotes", () => { const content = "where('lint_tool_configs.plugin': plugins + %w[core])"; - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/super.test.ts b/test/js/ruby/nodes/super.test.ts index fea3404e..76a9cd62 100644 --- a/test/js/ruby/nodes/super.test.ts +++ b/test/js/ruby/nodes/super.test.ts @@ -1,32 +1,50 @@ import { ruby } from "../../utils"; describe("super", () => { - test("bare", () => expect("super").toMatchFormat()); + test("bare", () => { + expect("super").toMatchFormat(); + }); - test("empty parens", () => expect("super()").toMatchFormat()); + test("empty parens", () => { + expect("super()").toMatchFormat(); + }); - test("one arg, no parens", () => expect("super 1").toMatchFormat()); + test("one arg, no parens", () => { + expect("super 1").toMatchFormat(); + }); - test("one arg, with parens", () => expect("super(1)").toMatchFormat()); + test("one arg, with parens", () => { + expect("super(1)").toMatchFormat(); + }); - test("multiple args, no parens", () => expect("super 1, 2").toMatchFormat()); + test("multiple args, no parens", () => { + expect("super 1, 2").toMatchFormat(); + }); - test("multiple args, with parens", () => - expect("super(1, 2)").toMatchFormat()); + test("multiple args, with parens", () => { + expect("super(1, 2)").toMatchFormat(); + }); describe("with comments", () => { - test("bare", () => expect("super # comment").toMatchFormat()); + test("bare", () => { + expect("super # comment").toMatchFormat(); + }); - test("empty parens", () => expect("super() # comment").toMatchFormat()); + test("empty parens", () => { + expect("super() # comment").toMatchFormat(); + }); - test("one arg, no parens", () => - expect("super 1 # comment").toMatchFormat()); + test("one arg, no parens", () => { + expect("super 1 # comment").toMatchFormat(); + }); - test("one arg, with parens", () => - expect("super(1) # comment").toMatchFormat()); + test("one arg, with parens", () => { + expect("super(1) # comment").toMatchFormat(); + }); - test("multiple args, no parens", () => - expect("super 1, 2 # comment").toMatchFormat()); + test("multiple args, no parens", () => { + expect("super 1, 2 # comment").toMatchFormat(); + }); test("multiple args, multiple lines, no parens", () => { const content = ruby(` @@ -34,11 +52,12 @@ describe("super", () => { 2 # second comment `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); - test("multiple args, with parens", () => - expect("super(1, 2) # comment").toMatchFormat()); + test("multiple args, with parens", () => { + expect("super(1, 2) # comment").toMatchFormat(); + }); test("multiple args, multiple lines, no parens", () => { const content = ruby(` @@ -48,7 +67,7 @@ describe("super", () => { ) `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); }); }); diff --git a/test/js/ruby/nodes/unary.test.ts b/test/js/ruby/nodes/unary.test.ts index 27372a9b..cebf7b98 100644 --- a/test/js/ruby/nodes/unary.test.ts +++ b/test/js/ruby/nodes/unary.test.ts @@ -1,6 +1,10 @@ describe("unary", () => { - test("regular", () => expect("!foo").toMatchFormat()); + test("regular", () => { + expect("!foo").toMatchFormat(); + }); // https://github.com/prettier/plugin-ruby/issues/764 - test("with other operator", () => expect("!(x&.>(0))").toMatchFormat()); + test("with other operator", () => { + expect("!(x&.>(0))").toMatchFormat(); + }); }); diff --git a/test/js/ruby/nodes/undef.test.ts b/test/js/ruby/nodes/undef.test.ts index 36d5e390..fb4f81c1 100644 --- a/test/js/ruby/nodes/undef.test.ts +++ b/test/js/ruby/nodes/undef.test.ts @@ -1,9 +1,13 @@ import { long, ruby } from "../../utils"; describe("undef", () => { - test("single inline", () => expect("undef foo").toMatchFormat()); + test("single inline", () => { + expect("undef foo").toMatchFormat(); + }); - test("multiple inline", () => expect("undef foo, bar").toMatchFormat()); + test("multiple inline", () => { + expect("undef foo, bar").toMatchFormat(); + }); test("multiple breaking", () => { const expected = ruby(` @@ -11,13 +15,16 @@ describe("undef", () => { a${long} `); - return expect(`undef ${long}, a${long}`).toChangeFormat(expected); + expect(`undef ${long}, a${long}`).toChangeFormat(expected); }); - test("single with comment", () => expect("undef foo # bar").toMatchFormat()); + test("single with comment", () => { + expect("undef foo # bar").toMatchFormat(); + }); - test("multiple inline with comment", () => - expect("undef foo, bar # baz").toMatchFormat()); + test("multiple inline with comment", () => { + expect("undef foo, bar # baz").toMatchFormat(); + }); test("multiple lines comment on first", () => { const content = ruby(` @@ -25,7 +32,7 @@ describe("undef", () => { bar `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("multiple lines comment on each", () => { @@ -34,7 +41,7 @@ describe("undef", () => { bar # bam `); - return expect(content).toMatchFormat(); + expect(content).toMatchFormat(); }); test("multiple breaking with comment", () => { @@ -43,6 +50,6 @@ describe("undef", () => { a${long} # foo `); - return expect(`undef ${long}, a${long} # foo`).toChangeFormat(expected); + expect(`undef ${long}, a${long} # foo`).toChangeFormat(expected); }); }); diff --git a/test/js/ruby/nodes/yield.test.ts b/test/js/ruby/nodes/yield.test.ts index 79b4a37f..f6bafbeb 100644 --- a/test/js/ruby/nodes/yield.test.ts +++ b/test/js/ruby/nodes/yield.test.ts @@ -1,15 +1,21 @@ describe("yield", () => { - test("bare yield", () => expect("yield").toMatchFormat()); + test("bare yield", () => { + expect("yield").toMatchFormat(); + }); - test("yield with one argument, no parens", () => - expect("yield i").toMatchFormat()); + test("yield with one argument, no parens", () => { + expect("yield i").toMatchFormat(); + }); - test("yield with one argument, with parens", () => - expect("yield(i)").toMatchFormat()); + test("yield with one argument, with parens", () => { + expect("yield(i)").toMatchFormat(); + }); - test("yield with multiple arguments, no parens", () => - expect("yield i, 2").toMatchFormat()); + test("yield with multiple arguments, no parens", () => { + expect("yield i, 2").toMatchFormat(); + }); - test("yield with multiple arguments, with parens", () => - expect("yield(i, 2)").toMatchFormat()); + test("yield with multiple arguments, with parens", () => { + expect("yield(i, 2)").toMatchFormat(); + }); }); diff --git a/test/js/ruby/toProc.test.ts b/test/js/ruby/toProc.test.ts index 7e073aee..a10b746c 100644 --- a/test/js/ruby/toProc.test.ts +++ b/test/js/ruby/toProc.test.ts @@ -1,13 +1,15 @@ import { ruby } from "../utils"; describe("to_proc transform", () => { - test("basic inline", () => + test("basic inline", () => { expect("loop { |i| i.to_s }").toChangeFormat("loop(&:to_s)", { rubyToProc: true - })); + }); + }); - test("basic inline with option turned off", () => - expect("loop { |i| i.to_s }").toMatchFormat({ rubyToProc: false })); + test("basic inline with option turned off", () => { + expect("loop { |i| i.to_s }").toMatchFormat({ rubyToProc: false }); + }); test("basic multi-line", () => { const content = ruby(` @@ -16,16 +18,18 @@ describe("to_proc transform", () => { end `); - return expect(content).toChangeFormat("list.each(&:print)", { + expect(content).toChangeFormat("list.each(&:print)", { rubyToProc: true }); }); - test("maintains to_proc if already in use when rubyToProc false", () => - expect("loop(&:to_s)").toMatchFormat({ rubyToProc: false })); + test("maintains to_proc if already in use when rubyToProc false", () => { + expect("loop(&:to_s)").toMatchFormat({ rubyToProc: false }); + }); - test("maintains to_proc if already in use when rubyToProc true", () => - expect("loop(&:to_s)").toMatchFormat({ rubyToProc: true })); + test("maintains to_proc if already in use when rubyToProc true", () => { + expect("loop(&:to_s)").toMatchFormat({ rubyToProc: true }); + }); test("multi-line with comment", () => { const content = ruby(` @@ -35,7 +39,7 @@ describe("to_proc transform", () => { end `); - return expect(content).toMatchFormat({ rubyToProc: true }); + expect(content).toMatchFormat({ rubyToProc: true }); }); test("happens for command nodes", () => { @@ -45,7 +49,7 @@ describe("to_proc transform", () => { end `); - return expect(content).toChangeFormat("command 'foo', &:to_s", { + expect(content).toChangeFormat("command 'foo', &:to_s", { rubyToProc: true }); }); @@ -57,15 +61,16 @@ describe("to_proc transform", () => { end `); - return expect(content).toChangeFormat("command.call 'foo', &:to_s", { + expect(content).toChangeFormat("command.call 'foo', &:to_s", { rubyToProc: true }); }); - test("with args and parens", () => + test("with args and parens", () => { expect("foo(bar) { |baz| baz.to_i }").toChangeFormat("foo(bar, &:to_i)", { rubyToProc: true - })); + }); + }); test("with commands", () => { const content = ruby(` @@ -74,7 +79,7 @@ describe("to_proc transform", () => { end `); - return expect(content).toChangeFormat("command bar, &:to_i", { + expect(content).toChangeFormat("command bar, &:to_i", { rubyToProc: true }); }); @@ -86,7 +91,7 @@ describe("to_proc transform", () => { end `); - return expect(content).toChangeFormat("command.call bar, &:to_i", { + expect(content).toChangeFormat("command.call bar, &:to_i", { rubyToProc: true }); }); @@ -95,7 +100,7 @@ describe("to_proc transform", () => { const content = "foo[:bar].each { |baz| baz.to_s }"; const expected = "foo[:bar].each(&:to_s)"; - return expect(content).toChangeFormat(expected, { rubyToProc: true }); + expect(content).toChangeFormat(expected, { rubyToProc: true }); }); describe("when not to transform", () => { @@ -113,7 +118,7 @@ describe("to_proc transform", () => { end `); - return expect(content).toMatchFormat({ rubyToProc: true }); + expect(content).toMatchFormat({ rubyToProc: true }); }); test("when there is a rescue, else, or ensure", () => { @@ -125,7 +130,7 @@ describe("to_proc transform", () => { end `); - return expect(content).toMatchFormat({ rubyToProc: true }); + expect(content).toMatchFormat({ rubyToProc: true }); }); test("when there are args to the method call", () => { @@ -137,64 +142,69 @@ describe("to_proc transform", () => { test("when there are multiple args", () => { const content = "loop { |i, j| i.to_s }"; - return expect(content).toMatchFormat({ rubyToProc: true }); + expect(content).toMatchFormat({ rubyToProc: true }); }); test("when we're inside an if:", () => { const content = "{ if: proc { |i| i.to_s } }"; - return expect(content).toMatchFormat({ rubyToProc: true }); + expect(content).toMatchFormat({ rubyToProc: true }); }); test("when we're inside an :if =>", () => { const content = "{ :if => proc { |i| i.to_s } }"; const expected = "{ if: proc { |i| i.to_s } }"; - return expect(content).toChangeFormat(expected, { rubyToProc: true }); + expect(content).toChangeFormat(expected, { rubyToProc: true }); }); test("when we're inside a regular hash", () => { const content = "{ when: proc { |i| i.to_s } }"; const expected = "{ when: proc(&:to_s) }"; - return expect(content).toChangeFormat(expected, { rubyToProc: true }); + expect(content).toChangeFormat(expected, { rubyToProc: true }); }); test("when we're inside a regular hash", () => { const content = "{ when: proc { |i| i.to_s } }"; const expected = "{ when: proc(&:to_s) }"; - return expect(content).toChangeFormat(expected, { rubyToProc: true }); + expect(content).toChangeFormat(expected, { rubyToProc: true }); }); - test("when there are no variables", () => - expect("loop { i.to_s }").toMatchFormat({ rubyToProc: true })); + test("when there are no variables", () => { + expect("loop { i.to_s }").toMatchFormat({ rubyToProc: true }); + }); }); describe.each(["if", "unless"])( "does not transform when used inside hash with %s", (keyword) => { - test(`hash literal with :${keyword} key`, () => + test(`hash literal with :${keyword} key`, () => { expect(`{ ${keyword}: ->(foo) { foo.to_s } }`).toMatchFormat({ rubyToProc: true - })); + }); + }); - test(`hash literal with hashrocket :${keyword} key`, () => + test(`hash literal with hashrocket :${keyword} key`, () => { expect(`{ :${keyword} => ->(foo) { foo.to_s } }`).toMatchFormat({ rubyHashLabel: false, rubyToProc: true - })); + }); + }); - test(`method arguments with :${keyword} key`, () => + test(`method arguments with :${keyword} key`, () => { expect(`bar ${keyword}: ->(foo) { foo.to_s }`).toMatchFormat({ rubyToProc: true - })); + }); + }); - test(`method arguments with hashrocket :${keyword} key`, () => + test(`method arguments with hashrocket :${keyword} key`, () => { expect(`bar :${keyword} => ->(foo) { foo.to_s }`).toMatchFormat({ rubyHashLabel: false, rubyToProc: true - })); + }); + }); } ); }); diff --git a/test/js/setupTests.ts b/test/js/setupTests.ts index 686bfb1f..b36794f9 100644 --- a/test/js/setupTests.ts +++ b/test/js/setupTests.ts @@ -4,28 +4,25 @@ import type { Plugin } from "../../src/types"; import type { Code } from "./types"; import plugin from "../../src/plugin"; -function checkFormat( - before: Code, - after: Code, - config: Partial -) { - const parser = (before as any).parser || "ruby"; - const originalText = (before as any).code || before; +type Config = Partial; + +function normalizeCode(code: Code) { + return (typeof code === "string" ? code : code.code).replace(/\r\n/g, "\n"); +} - const opts = Object.assign( - { parser, plugins: [plugin], originalText }, - config - ); +function checkFormat(before: Code, after: Code, config: Config) { + const originalText = (before as any).code || before; + const formatted = prettier.format(originalText, { + parser: (before as any).parser || "ruby", + originalText, + plugins: [plugin as any as string], + ...config + }); - return new Promise((resolve) => resolve(prettier.format(originalText, opts))) - .then((formatted) => ({ - pass: (formatted as string).replace(/\r\n/g, "\n") === `${after}\n`, - message: () => `Expected:\n${after}\nReceived:\n${formatted}` - })) - .catch((error) => ({ - pass: false, - message: () => error.message - })); + return { + pass: normalizeCode(formatted) === `${normalizeCode(after)}\n`, + message: () => `Expected:\n${after}\nReceived:\n${formatted}` + }; } expect.extend({ @@ -46,13 +43,8 @@ declare global { namespace jest { // eslint-disable-next-line @typescript-eslint/no-unused-vars interface Matchers { - toChangeFormat( - after: Code, - config?: Partial - ): Promise; - toMatchFormat( - config?: Partial - ): Promise; + toChangeFormat(after: Code, config?: Config): CustomMatcherResult; + toMatchFormat(config?: Config): CustomMatcherResult; } } } From 3fee1898751ab2cb12fe01c545d83ff961883899 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 14:38:34 -0400 Subject: [PATCH 281/785] More documentation --- src/parser/parseSync.ts | 73 ++++++++++++++++++++------------------- test/js/globalSetup.ts | 10 +++--- test/js/globalTeardown.ts | 3 ++ 3 files changed, 45 insertions(+), 41 deletions(-) diff --git a/src/parser/parseSync.ts b/src/parser/parseSync.ts index 00f826a3..86f0bab7 100644 --- a/src/parser/parseSync.ts +++ b/src/parser/parseSync.ts @@ -45,6 +45,43 @@ export function getLang() { }[platform]; } +// Finds a netcat-like adapter to use for sending data to a socket. We order +// these by likelihood of being found so we can avoid some shell-outs. +function findNetcatConfig(opts: Plugin.Options): NetcatConfig { + if (opts.rubyNetcatCommand) { + const splits = opts.rubyNetcatCommand.split(" "); + return { command: splits[0], args: splits.slice(1) }; + } + + if (os.type() === "Windows_NT") { + if (spawnSync("command", ["-v", "nc"]).status === 0) { + return { command: "nc", args: [] }; + } + + if (spawnSync("command", ["-v", "telnet"]).status === 0) { + return { command: "telnet", args: [] }; + } + } else { + if (spawnSync("which", ["nc"]).status === 0) { + return { command: "nc", args: ["-U"] }; + } + + if (spawnSync("which", ["telnet"]).status === 0) { + return { command: "telnet", args: ["-u"] }; + } + + if (spawnSync("which", ["ncat"]).status === 0) { + return { command: "ncat", args: ["-U"] }; + } + } + + return { command: "node", args: [require.resolve("./netcat.js")] }; +} + +// Create a file that will act as a communication mechanism, spawn a parser +// server with that filepath as an argument, then spawn another process that +// will read that information in order to enable us to connect to it in the +// spawnSync function. function spawnServer() { const filepath = `/tmp/prettier-ruby-parser-${process.pid}.info`; const server = spawn( @@ -83,41 +120,7 @@ function spawnServer() { `); } - parserArgs = info.stdout.toString(); - return parserArgs; -} - -// Finds a netcat-like adapter to use for sending data to a socket. We order -// these by likelihood of being found so we can avoid some shell-outs. -function findNetcatConfig(opts: Plugin.Options): NetcatConfig { - if (opts.rubyNetcatCommand) { - const splits = opts.rubyNetcatCommand.split(" "); - return { command: splits[0], args: splits.slice(1) }; - } - - if (os.type() === "Windows_NT") { - if (spawnSync("command", ["-v", "nc"]).status === 0) { - return { command: "nc", args: [] }; - } - - if (spawnSync("command", ["-v", "telnet"]).status === 0) { - return { command: "telnet", args: [] }; - } - } else { - if (spawnSync("which", ["nc"]).status === 0) { - return { command: "nc", args: ["-U"] }; - } - - if (spawnSync("which", ["telnet"]).status === 0) { - return { command: "telnet", args: ["-u"] }; - } - - if (spawnSync("which", ["ncat"]).status === 0) { - return { command: "ncat", args: ["-U"] }; - } - } - - return { command: "node", args: [require.resolve("./netcat.js")] }; + return info.stdout.toString(); } // You can optionally return location information from the source string when diff --git a/test/js/globalSetup.ts b/test/js/globalSetup.ts index 33a4a172..ee6aafb9 100644 --- a/test/js/globalSetup.ts +++ b/test/js/globalSetup.ts @@ -4,6 +4,9 @@ import path from "path"; import { getLang } from "../../src/parser/parseSync"; +// This is somewhat similar to the spawnServer function in parseSync but +// slightly different in that it logs its information into environment variables +// so that it can be reused across the test suite. function globalSetup() { // Set a RUBY_VERSION environment variable because certain tests will only run // for certain versions of Ruby. @@ -29,12 +32,7 @@ function globalSetup() { ]); if (info.status !== 0) { - throw new Error(` - We failed to spawn our parser server. Please report this error on GitHub - at https://github.com/prettier/plugin-ruby. The error message was: - - ${info.stderr.toString()}. - `); + throw new Error("Failed to spawn parse server."); } process.env.PRETTIER_RUBY_HOST = info.stdout.toString(); diff --git a/test/js/globalTeardown.ts b/test/js/globalTeardown.ts index e9d6151c..f6790eae 100644 --- a/test/js/globalTeardown.ts +++ b/test/js/globalTeardown.ts @@ -1,3 +1,6 @@ +// If a parse server was successfully spawned, then its process ID will be in +// the PRETTIER_RUBY_PID environment variable. At the end of the test suite we +// should send a kill signal to it. function globalTeardown() { const prettierRubyPID = process.env.PRETTIER_RUBY_PID; From b3d2f78c7efb124fdd4a90303df8a8e011392671 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 14:46:25 -0400 Subject: [PATCH 282/785] Add a timeout to the getInfo function --- src/parser/getInfo.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/parser/getInfo.js b/src/parser/getInfo.js index ba9bf4ba..8be7f967 100644 --- a/src/parser/getInfo.js +++ b/src/parser/getInfo.js @@ -2,9 +2,16 @@ const { existsSync, readFileSync } = require("fs"); const filepath = process.argv[process.argv.length - 1]; -const timeout = setInterval(() => { + +const timeout = setTimeout(() => { + clearInterval(interval); + throw new Error("Failed to get information from parse server in time."); +}, 3000); + +const interval = setInterval(() => { if (existsSync(filepath)) { process.stdout.write(readFileSync(filepath).toString("utf8")); clearTimeout(timeout); + clearInterval(interval); } }, 50); From e0e412ff5b51be325c799062cee36e7a479d7e51 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 15:02:35 -0400 Subject: [PATCH 283/785] Try File.open instead of File.write --- .github/workflows/main.yml | 24 ++++++++++----------- src/parser/parseSync.ts | 1 + src/parser/server.rb | 43 ++++++++++++++++++++++---------------- 3 files changed, 38 insertions(+), 30 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e61f1f32..16134cea 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,9 +32,9 @@ jobs: cache: yarn - name: Test run: | - yarn install --frozen-lockfile - yarn test - bundle exec rake test + yarn install --frozen-lockfile && \ + yarn test && \ + bundle exec rake test lint: name: Lint @@ -53,10 +53,10 @@ jobs: cache: yarn - name: Check format and lint run: | - yarn install --frozen-lockfile - yarn prepublishOnly - yarn checkFormat - yarn lint + yarn install --frozen-lockfile && \ + yarn prepublishOnly && \ + yarn checkFormat && \ + yarn lint gem: name: Gem @@ -72,11 +72,11 @@ jobs: node-version: 12.x cache: yarn - run: | - yarn install --frozen-lockfile - yarn prepublishOnly - gem build -o prettier.gem - gem unpack prettier.gem - prettier/exe/rbprettier --help + yarn install --frozen-lockfile && \ + yarn prepublishOnly && \ + gem build -o prettier.gem && \ + gem unpack prettier.gem && \ + prettier/exe/rbprettier --help # Saves pull request details for later workflow runs which can run in # a privileged environment diff --git a/src/parser/parseSync.ts b/src/parser/parseSync.ts index 86f0bab7..954d6377 100644 --- a/src/parser/parseSync.ts +++ b/src/parser/parseSync.ts @@ -111,6 +111,7 @@ function spawnServer() { path.join(__dirname, "./getInfo.js"), filepath ]); + if (info.status !== 0) { throw new Error(` We failed to spawn our parser server. Please report this error on GitHub diff --git a/src/parser/server.rb b/src/parser/server.rb index 54d21558..9238f3ec 100644 --- a/src/parser/server.rb +++ b/src/parser/server.rb @@ -16,29 +16,36 @@ trap(:TERM) { quit = true } trap(:QUIT) { quit = true } if Signal.list.key?('QUIT') -if Gem.win_platform? - # If we're on windows, we're going to start up a TCP server. The 0 here means - # to bind to some available port. - server = TCPServer.new('127.0.0.1', 0) +info = + if Gem.win_platform? + # If we're on windows, we're going to start up a TCP server. The 0 here means + # to bind to some available port. + server = TCPServer.new('127.0.0.1', 0) - address = server.local_address - File.write(ARGV[0], "#{address.ip_address} #{address.ip_port}") + # Ensure that we close the server when this process exits. + at_exit { server.close } - at_exit { server.close } -else - # If we're not on windows, then we're going to assume we can use unix socket - # files (since they're faster than a TCP server). - filepath = "/tmp/prettier-ruby-parser-#{Process.pid}.sock" - server = UNIXServer.new(filepath) + address = server.local_address + "#{address.ip_address} #{address.ip_port}" + else + # If we're not on windows, then we're going to assume we can use unix socket + # files (since they're faster than a TCP server). + filepath = "/tmp/prettier-ruby-parser-#{Process.pid}.sock" + server = UNIXServer.new(filepath) - address = server.local_address - File.write(ARGV[0], address.unix_path) + # Ensure that we close the server and delete the socket file when this + # process exits. + at_exit do + server.close + File.unlink(filepath) + end - at_exit do - server.close - File.unlink(filepath) + server.local_address.unix_path end -end + +# Write out our connection information to the file given as the first argument +# to this script. +File.open(ARGV[0], "w") { |file| file.write(info) } loop do break if quit From 56f6adede40fda0be1b5c0c41beee905bb84f5bc Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 15:08:41 -0400 Subject: [PATCH 284/785] Use os.tmpdir() --- src/parser/parseSync.ts | 8 +++++++- test/js/globalSetup.ts | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/parser/parseSync.ts b/src/parser/parseSync.ts index 954d6377..1edcff8b 100644 --- a/src/parser/parseSync.ts +++ b/src/parser/parseSync.ts @@ -78,12 +78,18 @@ function findNetcatConfig(opts: Plugin.Options): NetcatConfig { return { command: "node", args: [require.resolve("./netcat.js")] }; } +// Generate the filepath that should be used to communicate the connection +// information between this process and the parser server. +export function getInfoFilepath() { + return path.join(os.tmpdir(), `prettier-ruby-parser-${process.pid}.info`); +} + // Create a file that will act as a communication mechanism, spawn a parser // server with that filepath as an argument, then spawn another process that // will read that information in order to enable us to connect to it in the // spawnSync function. function spawnServer() { - const filepath = `/tmp/prettier-ruby-parser-${process.pid}.info`; + const filepath = getInfoFilepath(); const server = spawn( "ruby", [path.join(__dirname, "./server.rb"), filepath], diff --git a/test/js/globalSetup.ts b/test/js/globalSetup.ts index ee6aafb9..e9da4dbe 100644 --- a/test/js/globalSetup.ts +++ b/test/js/globalSetup.ts @@ -2,7 +2,7 @@ import { spawn, spawnSync } from "child_process"; import { unlinkSync } from "fs"; import path from "path"; -import { getLang } from "../../src/parser/parseSync"; +import { getLang, getInfoFilepath } from "../../src/parser/parseSync"; // This is somewhat similar to the spawnServer function in parseSync but // slightly different in that it logs its information into environment variables @@ -14,7 +14,7 @@ function globalSetup() { process.env.RUBY_VERSION = spawnSync("ruby", args).stdout.toString().trim(); // Set up just one parsing server for the entirety of the test suite. - const filepath = `/tmp/prettier-ruby-parser-${process.pid}.info`; + const filepath = getInfoFilepath(); const server = spawn( "ruby", [path.join(__dirname, "../../src/parser/server.rb"), filepath], From b952caf598a7fe981a28694b4424a0da0dbc5273 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 15:12:52 -0400 Subject: [PATCH 285/785] Split up actions in CI --- .github/workflows/main.yml | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 16134cea..d93e6fb6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,11 +30,9 @@ jobs: with: node-version: 12.x cache: yarn - - name: Test - run: | - yarn install --frozen-lockfile && \ - yarn test && \ - bundle exec rake test + - run: yarn install --frozen-lockfile + - run: yarn test + - run: bundle exec rake test lint: name: Lint @@ -51,12 +49,10 @@ jobs: with: node-version: 12.x cache: yarn - - name: Check format and lint - run: | - yarn install --frozen-lockfile && \ - yarn prepublishOnly && \ - yarn checkFormat && \ - yarn lint + - run: yarn install --frozen-lockfile + - run: yarn prepublishOnly + - run: yarn checkFormat + - run: yarn lint gem: name: Gem @@ -71,12 +67,11 @@ jobs: with: node-version: 12.x cache: yarn - - run: | - yarn install --frozen-lockfile && \ - yarn prepublishOnly && \ - gem build -o prettier.gem && \ - gem unpack prettier.gem && \ - prettier/exe/rbprettier --help + - run: yarn install --frozen-lockfile + - run: yarn prepublishOnly + - run: gem build -o prettier.gem + - run: gem unpack prettier.gem + - run: prettier/exe/rbprettier --help # Saves pull request details for later workflow runs which can run in # a privileged environment From 816fd2e423ecb002a535674f67c5b6426a83ce75 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 15:20:57 -0400 Subject: [PATCH 286/785] Handle if globalTeardown fails --- test/js/globalTeardown.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/js/globalTeardown.ts b/test/js/globalTeardown.ts index f6790eae..b4b20e9a 100644 --- a/test/js/globalTeardown.ts +++ b/test/js/globalTeardown.ts @@ -5,7 +5,11 @@ function globalTeardown() { const prettierRubyPID = process.env.PRETTIER_RUBY_PID; if (prettierRubyPID) { - process.kill(-parseInt(prettierRubyPID, 10)); + try { + process.kill(parseInt(prettierRubyPID, 10), "SIGINT"); + } catch (e) { + throw new Error("Failed to kill the parser process in globalTeardown."); + } } } From 240d67c6e8df85ad1f4e1703ba34fc5da1d33d02 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 15:38:59 -0400 Subject: [PATCH 287/785] Split up the host and port into an array --- src/parser/parseSync.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/parser/parseSync.ts b/src/parser/parseSync.ts index 1edcff8b..7d7eddc7 100644 --- a/src/parser/parseSync.ts +++ b/src/parser/parseSync.ts @@ -8,7 +8,11 @@ import process from "process"; type NetcatConfig = { command: string; args: string[] }; let netcatConfig: NetcatConfig; -let parserArgs: undefined | string | string[] = process.env.PRETTIER_RUBY_HOST; +let parserArgs: undefined | string[]; + +if (process.env.PRETTIER_RUBY_HOST) { + parserArgs = process.env.PRETTIER_RUBY_HOST.split(" "); +} // In order to properly parse ruby code, we need to tell the ruby process to // parse using UTF-8. Unfortunately, the way that you accomplish this looks @@ -127,7 +131,7 @@ function spawnServer() { `); } - return info.stdout.toString(); + return info.stdout.toString().split(" "); } // You can optionally return location information from the source string when From 7338d83e7e2973828a046758f2d5f195860624b2 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 15:52:02 -0400 Subject: [PATCH 288/785] Temporarily just use node to communicate --- src/parser/parseSync.ts | 52 +++++++++++++++++++++-------------------- src/parser/server.rb | 2 +- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/src/parser/parseSync.ts b/src/parser/parseSync.ts index 7d7eddc7..44627f38 100644 --- a/src/parser/parseSync.ts +++ b/src/parser/parseSync.ts @@ -57,27 +57,27 @@ function findNetcatConfig(opts: Plugin.Options): NetcatConfig { return { command: splits[0], args: splits.slice(1) }; } - if (os.type() === "Windows_NT") { - if (spawnSync("command", ["-v", "nc"]).status === 0) { - return { command: "nc", args: [] }; - } - - if (spawnSync("command", ["-v", "telnet"]).status === 0) { - return { command: "telnet", args: [] }; - } - } else { - if (spawnSync("which", ["nc"]).status === 0) { - return { command: "nc", args: ["-U"] }; - } - - if (spawnSync("which", ["telnet"]).status === 0) { - return { command: "telnet", args: ["-u"] }; - } - - if (spawnSync("which", ["ncat"]).status === 0) { - return { command: "ncat", args: ["-U"] }; - } - } + // if (os.type() === "Windows_NT") { + // if (spawnSync("command", ["-v", "nc"]).status === 0) { + // return { command: "nc", args: [] }; + // } + + // if (spawnSync("command", ["-v", "telnet"]).status === 0) { + // return { command: "telnet", args: [] }; + // } + // } else { + // if (spawnSync("which", ["nc"]).status === 0) { + // return { command: "nc", args: ["-U"] }; + // } + + // if (spawnSync("which", ["telnet"]).status === 0) { + // return { command: "telnet", args: ["-u"] }; + // } + + // if (spawnSync("which", ["ncat"]).status === 0) { + // return { command: "ncat", args: ["-U"] }; + // } + // } return { command: "node", args: [require.resolve("./netcat.js")] }; } @@ -108,11 +108,13 @@ function spawnServer() { process.on("exit", () => { unlinkSync(filepath); - if (server?.pid) { - try { + try { + if (server.pid) { server.kill(-server.pid); - } catch (e) { - // ignore + } + } catch (e) { + if (process.env.PLUGIN_RUBY_CI) { + throw new Error(`Failed to kill the parser server: ${e}`) } } }); diff --git a/src/parser/server.rb b/src/parser/server.rb index 9238f3ec..381c0d72 100644 --- a/src/parser/server.rb +++ b/src/parser/server.rb @@ -45,7 +45,7 @@ # Write out our connection information to the file given as the first argument # to this script. -File.open(ARGV[0], "w") { |file| file.write(info) } +File.write(ARGV[0], info) loop do break if quit From a21632d3831a32a8557d4893cdd4a70aa5b76331 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 18:40:00 -0400 Subject: [PATCH 289/785] Normalize strings in matching --- test/js/setupTests.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/test/js/setupTests.ts b/test/js/setupTests.ts index b36794f9..dc947b80 100644 --- a/test/js/setupTests.ts +++ b/test/js/setupTests.ts @@ -7,7 +7,7 @@ import plugin from "../../src/plugin"; type Config = Partial; function normalizeCode(code: Code) { - return (typeof code === "string" ? code : code.code).replace(/\r\n/g, "\n"); + return (typeof code === "string" ? code : code.code).trim(); } function checkFormat(before: Code, after: Code, config: Config) { @@ -20,20 +20,16 @@ function checkFormat(before: Code, after: Code, config: Config) { }); return { - pass: normalizeCode(formatted) === `${normalizeCode(after)}\n`, + pass: normalizeCode(formatted) === normalizeCode(after), message: () => `Expected:\n${after}\nReceived:\n${formatted}` }; } expect.extend({ - toChangeFormat( - before: Code, - after: Code, - config: Partial = {} - ) { + toChangeFormat(before: Code, after: Code, config: Config = {}) { return checkFormat(before, (after as any).code || after, config); }, - toMatchFormat(before: Code, config: Partial = {}) { + toMatchFormat(before: Code, config: Config = {}) { return checkFormat(before, (before as any).code || before, config); } }); From d51d92fc5fa583db22d1d728fe42da5692e5eb3a Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 18:48:59 -0400 Subject: [PATCH 290/785] Even more windows debugging --- test/js/setupTests.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/test/js/setupTests.ts b/test/js/setupTests.ts index dc947b80..a7bb6f90 100644 --- a/test/js/setupTests.ts +++ b/test/js/setupTests.ts @@ -6,8 +6,8 @@ import plugin from "../../src/plugin"; type Config = Partial; -function normalizeCode(code: Code) { - return (typeof code === "string" ? code : code.code).trim(); +function normalize(code: Code) { + return (typeof code === "string" ? code : code.code).replace(/\r?\n/g, "\n").trim(); } function checkFormat(before: Code, after: Code, config: Config) { @@ -19,18 +19,21 @@ function checkFormat(before: Code, after: Code, config: Config) { ...config }); + const expected = normalize(after); + const received = normalize(formatted); + return { - pass: normalizeCode(formatted) === normalizeCode(after), - message: () => `Expected:\n${after}\nReceived:\n${formatted}` + pass: received === expected, + message: () => `Expected:\n${expected}\nReceived:\n${received}` }; } expect.extend({ toChangeFormat(before: Code, after: Code, config: Config = {}) { - return checkFormat(before, (after as any).code || after, config); + return checkFormat(before, after, config); }, toMatchFormat(before: Code, config: Config = {}) { - return checkFormat(before, (before as any).code || before, config); + return checkFormat(before, before, config); } }); From c4a8dc6308177eb4e057aeff03e94fa4b8275c8b Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 19:14:59 -0400 Subject: [PATCH 291/785] Pull non-ASCII values out of the test file --- src/parser/parseSync.ts | 2 +- test/js/rbs/rbs.test.ts | 10 ++++++++++ test/js/rbs/record.txt | 2 -- test/js/setupTests.ts | 7 ++++--- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/parser/parseSync.ts b/src/parser/parseSync.ts index 44627f38..6f745c68 100644 --- a/src/parser/parseSync.ts +++ b/src/parser/parseSync.ts @@ -114,7 +114,7 @@ function spawnServer() { } } catch (e) { if (process.env.PLUGIN_RUBY_CI) { - throw new Error(`Failed to kill the parser server: ${e}`) + throw new Error(`Failed to kill the parser server: ${e}`); } } }); diff --git a/test/js/rbs/rbs.test.ts b/test/js/rbs/rbs.test.ts index 6874e6fa..570f1279 100644 --- a/test/js/rbs/rbs.test.ts +++ b/test/js/rbs/rbs.test.ts @@ -260,5 +260,15 @@ describe("rbs", () => { describeCases("record", (source) => `T: ${source}`); + describe("non-ASCII", () => { + test("emoji", () => { + expect(rbs(`{ "🌼" => Integer }`)).toMatchFormat(); + }); + + test("kanji", () => { + expect(rbs(`{ "日本語" => Integer }`)).toMatchFormat(); + }); + }); + describeCases("tuple", (source) => `T: ${source}`); }); diff --git a/test/js/rbs/record.txt b/test/js/rbs/record.txt index 7ade9b86..debba3ed 100644 --- a/test/js/rbs/record.txt +++ b/test/js/rbs/record.txt @@ -1,5 +1,3 @@ { foo: Integer } { foo: untyped, 3 => 'hoge' } { :+ => 1 } -{ "🌼" => Integer } -{ "日本語" => Integer } diff --git a/test/js/setupTests.ts b/test/js/setupTests.ts index a7bb6f90..d6bb28d5 100644 --- a/test/js/setupTests.ts +++ b/test/js/setupTests.ts @@ -7,13 +7,14 @@ import plugin from "../../src/plugin"; type Config = Partial; function normalize(code: Code) { - return (typeof code === "string" ? code : code.code).replace(/\r?\n/g, "\n").trim(); + const string = typeof code === "string" ? code : code.code; + return string.replace(/\r?\n/g, "\n").trim(); } function checkFormat(before: Code, after: Code, config: Config) { - const originalText = (before as any).code || before; + const originalText = typeof before === "string" ? before : before.code; const formatted = prettier.format(originalText, { - parser: (before as any).parser || "ruby", + parser: typeof before === "string" ? "ruby" : before.parser, originalText, plugins: [plugin as any as string], ...config From ea09c655e4d9301787677f6ead26641e33b64552 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 19:22:17 -0400 Subject: [PATCH 292/785] Fix mapping for RBS test --- test/js/rbs/rbs.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/js/rbs/rbs.test.ts b/test/js/rbs/rbs.test.ts index 570f1279..caf7e1cf 100644 --- a/test/js/rbs/rbs.test.ts +++ b/test/js/rbs/rbs.test.ts @@ -262,11 +262,11 @@ describe("rbs", () => { describe("non-ASCII", () => { test("emoji", () => { - expect(rbs(`{ "🌼" => Integer }`)).toMatchFormat(); + expect(rbs(`T: { "🌼" => Integer }`)).toMatchFormat(); }); test("kanji", () => { - expect(rbs(`{ "日本語" => Integer }`)).toMatchFormat(); + expect(rbs(`T: { "日本語" => Integer }`)).toMatchFormat(); }); }); From 3f5c40def471b5fa2ad6909c00e360821616744d Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 19:38:32 -0400 Subject: [PATCH 293/785] Fix up process killing --- src/parser/parseSync.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parser/parseSync.ts b/src/parser/parseSync.ts index 6f745c68..f525732e 100644 --- a/src/parser/parseSync.ts +++ b/src/parser/parseSync.ts @@ -110,7 +110,7 @@ function spawnServer() { try { if (server.pid) { - server.kill(-server.pid); + process.kill(-server.pid); } } catch (e) { if (process.env.PLUGIN_RUBY_CI) { From 1e3f7457a8ab71b41f6d140633dec3ae8df1310a Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 19:51:31 -0400 Subject: [PATCH 294/785] Fix up RBS tests for windows --- test/js/rbs/rbs.test.ts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/test/js/rbs/rbs.test.ts b/test/js/rbs/rbs.test.ts index caf7e1cf..00f4cf46 100644 --- a/test/js/rbs/rbs.test.ts +++ b/test/js/rbs/rbs.test.ts @@ -1,7 +1,8 @@ import fs from "fs"; +import os from "os"; import path from "path"; -import { rbs } from "../utils"; +import { atLeastVersion, rbs } from "../utils"; function testCases(name: string, transform: (_source: string) => string) { const buffer = fs.readFileSync(path.resolve(__dirname, `${name}.txt`)); @@ -260,15 +261,19 @@ describe("rbs", () => { describeCases("record", (source) => `T: ${source}`); - describe("non-ASCII", () => { - test("emoji", () => { - expect(rbs(`T: { "🌼" => Integer }`)).toMatchFormat(); - }); + // For some reason these tests are failing on windows on Ruby < 3.0. I'm not + // sure why, but I'm leaving it here for now. + if (os.platform() !== "win32" || atLeastVersion("3.0")) { + describe("non-ASCII", () => { + test("emoji", () => { + expect(rbs(`T: { "🌼" => Integer }`)).toMatchFormat(); + }); - test("kanji", () => { - expect(rbs(`T: { "日本語" => Integer }`)).toMatchFormat(); + test("kanji", () => { + expect(rbs(`T: { "日本語" => Integer }`)).toMatchFormat(); + }); }); - }); + } describeCases("tuple", (source) => `T: ${source}`); }); From defd6f3f0b8a1aa4ecf2dac64a0558a38beb429d Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 21:41:23 -0400 Subject: [PATCH 295/785] Perform candidate checking on the ruby side --- src/haml/parser.ts | 4 +- src/parser/parseSync.ts | 84 +++++------------------------- src/parser/server.rb | 110 ++++++++++++++++++++++++++-------------- src/rbs/parser.ts | 4 +- src/ruby/parser.ts | 4 +- 5 files changed, 91 insertions(+), 115 deletions(-) diff --git a/src/haml/parser.ts b/src/haml/parser.ts index 50d34e31..44a8a736 100644 --- a/src/haml/parser.ts +++ b/src/haml/parser.ts @@ -6,8 +6,8 @@ const parser: Plugin.Parser = { // returning to prettier a JavaScript object that is the equivalent AST that // represents the code stored in that string. We accomplish this by spawning a // new process and reading JSON off STDOUT. - parse(text, _parsers, opts) { - return parseSync("haml", text, opts); + parse(text) { + return parseSync("haml", text); }, astFormat: "haml", // This function handles checking whether or not the source string has the diff --git a/src/parser/parseSync.ts b/src/parser/parseSync.ts index f525732e..76e14332 100644 --- a/src/parser/parseSync.ts +++ b/src/parser/parseSync.ts @@ -1,17 +1,15 @@ -import type { Plugin } from "../types"; import { spawn, spawnSync } from "child_process"; import { unlinkSync } from "fs"; import os from "os"; import path from "path"; import process from "process"; -type NetcatConfig = { command: string; args: string[] }; - -let netcatConfig: NetcatConfig; -let parserArgs: undefined | string[]; +type ParserArgs = { cmd: string; args: string[] }; +let parserArgs: undefined | ParserArgs; if (process.env.PRETTIER_RUBY_HOST) { - parserArgs = process.env.PRETTIER_RUBY_HOST.split(" "); + const [cmd, ...args] = process.env.PRETTIER_RUBY_HOST.split(" "); + parserArgs = { cmd, args }; } // In order to properly parse ruby code, we need to tell the ruby process to @@ -49,39 +47,6 @@ export function getLang() { }[platform]; } -// Finds a netcat-like adapter to use for sending data to a socket. We order -// these by likelihood of being found so we can avoid some shell-outs. -function findNetcatConfig(opts: Plugin.Options): NetcatConfig { - if (opts.rubyNetcatCommand) { - const splits = opts.rubyNetcatCommand.split(" "); - return { command: splits[0], args: splits.slice(1) }; - } - - // if (os.type() === "Windows_NT") { - // if (spawnSync("command", ["-v", "nc"]).status === 0) { - // return { command: "nc", args: [] }; - // } - - // if (spawnSync("command", ["-v", "telnet"]).status === 0) { - // return { command: "telnet", args: [] }; - // } - // } else { - // if (spawnSync("which", ["nc"]).status === 0) { - // return { command: "nc", args: ["-U"] }; - // } - - // if (spawnSync("which", ["telnet"]).status === 0) { - // return { command: "telnet", args: ["-u"] }; - // } - - // if (spawnSync("which", ["ncat"]).status === 0) { - // return { command: "ncat", args: ["-U"] }; - // } - // } - - return { command: "node", args: [require.resolve("./netcat.js")] }; -} - // Generate the filepath that should be used to communicate the connection // information between this process and the parser server. export function getInfoFilepath() { @@ -92,7 +57,7 @@ export function getInfoFilepath() { // server with that filepath as an argument, then spawn another process that // will read that information in order to enable us to connect to it in the // spawnSync function. -function spawnServer() { +function spawnServer(): ParserArgs { const filepath = getInfoFilepath(); const server = spawn( "ruby", @@ -133,7 +98,8 @@ function spawnServer() { `); } - return info.stdout.toString().split(" "); + const [cmd, ...args] = info.stdout.toString().split(" "); + return { cmd, args }; } // You can optionally return location information from the source string when @@ -144,46 +110,20 @@ type LocatedError = Error & { loc?: any }; // like it) here since Prettier requires the results of `parse` to be // synchronous and Node.js does not offer a mechanism for synchronous socket // requests. -function parseSync(parser: string, source: string, opts: Plugin.Options) { - if (!netcatConfig) { - netcatConfig = findNetcatConfig(opts); - } - +function parseSync(parser: string, source: string) { if (!parserArgs) { parserArgs = spawnServer(); } - const response = spawnSync( - netcatConfig.command, - netcatConfig.args.concat(parserArgs), - { - input: `${parser}|${source}`, - maxBuffer: 15 * 1024 * 1024 - } - ); + const response = spawnSync(parserArgs.cmd, parserArgs.args, { + input: `${parser}|${source}`, + maxBuffer: 15 * 1024 * 1024 + }); const stdout = response.stdout.toString(); const stderr = response.stderr.toString(); const { status } = response; - // We need special handling in case the user's version of nc doesn't support - // using unix sockets. - if ( - stderr.includes("invalid option -- U") || - stderr.includes("invalid option -- 'u'") || - stderr.includes("Protocol not supported") - ) { - throw new Error(` - @prettier/plugin-ruby uses unix sockets to communicate between the node.js - process running prettier and an underlying Ruby process used for parsing. - Unfortunately the command that it tried to use to do that - (${netcatConfig.command}) does not support unix sockets. To solve this - either uninstall the version of ${netcatConfig.command} that you're using - and use a different implementation, or change the value of the - rubyNetcatCommand option in your prettier configuration. - `); - } - // If we didn't receive anything over stdout or we have a bad exit status, // then throw whatever we can. if (stdout.length === 0 || (status !== null && status !== 0)) { diff --git a/src/parser/server.rb b/src/parser/server.rb index 381c0d72..2999b667 100644 --- a/src/parser/server.rb +++ b/src/parser/server.rb @@ -4,6 +4,7 @@ require 'socket' require 'json' require 'fileutils' +require 'open3' require_relative '../ruby/parser' require_relative '../rbs/parser' @@ -16,7 +17,7 @@ trap(:TERM) { quit = true } trap(:QUIT) { quit = true } if Signal.list.key?('QUIT') -info = +information = if Gem.win_platform? # If we're on windows, we're going to start up a TCP server. The 0 here means # to bind to some available port. @@ -43,45 +44,80 @@ server.local_address.unix_path end -# Write out our connection information to the file given as the first argument -# to this script. -File.write(ARGV[0], info) - -loop do - break if quit - - # Start up a new thread that will handle each successive connection. - Thread.new(server.accept_nonblock) do |socket| - parser, source = socket.read.force_encoding('UTF-8').split('|', 2) - - response = - case parser - when 'ruby' - Prettier::Parser.parse(source) - when 'rbs' - Prettier::RBSParser.parse(source) - when 'haml' - Prettier::HAMLParser.parse(source) +listener = + Thread.new do + loop do + break if quit + + # Start up a new thread that will handle each successive connection. + Thread.new(server.accept_nonblock) do |socket| + parser, source = socket.read.force_encoding('UTF-8').split('|', 2) + + response = + case parser + when 'ping' + 'pong' + when 'ruby' + Prettier::Parser.parse(source) + when 'rbs' + Prettier::RBSParser.parse(source) + when 'haml' + Prettier::HAMLParser.parse(source) + end + + if response + socket.write(JSON.fast_generate(response)) + else + socket.write('{ "error": true }') + end + rescue Prettier::Parser::ParserError => error + loc = { start: { line: error.lineno, column: error.column } } + socket.write(JSON.fast_generate(error: error.message, loc: loc)) + rescue StandardError => error + socket.write(JSON.fast_generate(error: error.message)) + ensure + socket.close end + rescue IO::WaitReadable, Errno::EINTR + # Wait for select(2) to give us a connection that has content for 1 second. + # Otherwise timeout and continue on (so that we hit our "break if quit" + # pretty often). + IO.select([server], nil, nil, 1) - if response - socket.write(JSON.fast_generate(response)) - else - socket.write('{ "error": true }') + retry unless quit end - rescue Prettier::Parser::ParserError => error - loc = { start: { line: error.lineno, column: error.column } } - socket.write(JSON.fast_generate(error: error.message, loc: loc)) - rescue StandardError => error - socket.write(JSON.fast_generate(error: error.message)) - ensure - socket.close end -rescue IO::WaitReadable, Errno::EINTR - # Wait for select(2) to give us a connection that has content for 1 second. - # Otherwise timeout and continue on (so that we hit our "break if quit" - # pretty often). - IO.select([server], nil, nil, 1) - retry unless quit +# Enumerate all of the potential ways to communicate with the server. +prefixes = Gem.win_platform? ? %w[nc telnet] : ['nc -U', 'telnet -u', 'ncat -U'] + +# Map each candidate connection method to a thread that will check if it works. +prefixes.map! do |prefix| + Thread.new do + # We don't actually want the backtrace here. If it fails to connect then + # it's fine for this to just not work. + Thread.current.report_on_exception = false + + stdout, status = + Open3.capture2("#{prefix} #{information}", stdin_data: 'ping') + + prefix if JSON.parse(stdout) == 'pong' && status.exitstatus == 0 + end end + +# Find the first one prefix that successfully returned the correct value. +connection = + prefixes.detect do |prefix| + value = prefix.value + break value if value + end + +# Default to running the netcat.js script that we ship with the plugin. It's a +# good fallback as it will always work, but it is slower than the other options. +connection ||= "node #{File.expand_path('netcat.js', __dir__)}" + +# Write out our connection information to the file given as the first argument +# to this script. +File.write(ARGV[0], "#{connection} #{information}") + +listener.join diff --git a/src/rbs/parser.ts b/src/rbs/parser.ts index f263a76b..646b1515 100644 --- a/src/rbs/parser.ts +++ b/src/rbs/parser.ts @@ -6,8 +6,8 @@ const parser: Plugin.Parser = { // returning to prettier a JavaScript object that is the equivalent AST that // represents the code stored in that string. We accomplish this by spawning a // new Ruby process of parser.rb and reading JSON off STDOUT. - parse(text, _parsers, opts) { - return parseSync("rbs", text, opts); + parse(text) { + return parseSync("rbs", text); }, astFormat: "rbs", // This function handles checking whether or not the source string has the diff --git a/src/ruby/parser.ts b/src/ruby/parser.ts index eb374290..dd79c93b 100644 --- a/src/ruby/parser.ts +++ b/src/ruby/parser.ts @@ -6,8 +6,8 @@ const parser: Plugin.Parser = { // returning to prettier a JavaScript object that is the equivalent AST that // represents the code stored in that string. We accomplish this by spawning a // new Ruby process of parser.rb and reading JSON off STDOUT. - parse(text, _parsers, opts) { - return parseSync("ruby", text, opts); + parse(text) { + return parseSync("ruby", text); }, astFormat: "ruby", // This function handles checking whether or not the source string has the From 82046aa87b04862b64740e28db670d32d15079f1 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 21:54:56 -0400 Subject: [PATCH 296/785] Try explicitly rescuing the thread --- src/parser/server.rb | 96 ++++++++++++++++++++++++-------------------- 1 file changed, 53 insertions(+), 43 deletions(-) diff --git a/src/parser/server.rb b/src/parser/server.rb index 2999b667..ccc39d48 100644 --- a/src/parser/server.rb +++ b/src/parser/server.rb @@ -17,33 +17,47 @@ trap(:TERM) { quit = true } trap(:QUIT) { quit = true } if Signal.list.key?('QUIT') -information = - if Gem.win_platform? - # If we're on windows, we're going to start up a TCP server. The 0 here means - # to bind to some available port. - server = TCPServer.new('127.0.0.1', 0) - - # Ensure that we close the server when this process exits. - at_exit { server.close } - - address = server.local_address - "#{address.ip_address} #{address.ip_port}" - else - # If we're not on windows, then we're going to assume we can use unix socket - # files (since they're faster than a TCP server). - filepath = "/tmp/prettier-ruby-parser-#{Process.pid}.sock" - server = UNIXServer.new(filepath) - - # Ensure that we close the server and delete the socket file when this - # process exits. - at_exit do - server.close - File.unlink(filepath) - end - - server.local_address.unix_path +# The information variable stores the actual connection information, which will +# either be an IP address and port or a path to a unix socket file. +information = "" + +# The candidates array is a list of potential programs that could be used to +# connect to our server. We'll run through them after the server starts to find +# the best one to use. +candidates = [] + +if Gem.win_platform? + # If we're on windows, we're going to start up a TCP server. The 0 here means + # to bind to some available port. + server = TCPServer.new('127.0.0.1', 0) + address = server.local_address + + # Ensure that we close the server when this process exits. + at_exit { server.close } + + information = "#{address.ip_address} #{address.ip_port}" + candidates = %w[nc telnet] +else + # If we're not on windows, then we're going to assume we can use unix socket + # files (since they're faster than a TCP server). + filepath = "/tmp/prettier-ruby-parser-#{Process.pid}.sock" + server = UNIXServer.new(filepath) + + # Ensure that we close the server and delete the socket file when this + # process exits. + at_exit do + server.close + File.unlink(filepath) end + information = server.local_address.unix_path + candidates = ['nc -U', 'telnet -u', 'ncat -U'] +end + +# This is the actual listening thread that will be acting as our server. We have +# to start it in another thread to begin with so that we can run through our +# candidate connection programs. Eventually we'll just join into this thread +# though and it will act as a daemon. listener = Thread.new do loop do @@ -79,45 +93,41 @@ socket.close end rescue IO::WaitReadable, Errno::EINTR - # Wait for select(2) to give us a connection that has content for 1 second. - # Otherwise timeout and continue on (so that we hit our "break if quit" - # pretty often). + # Wait for select(2) to give us a connection that has content for 1 + # second. Otherwise timeout and continue on (so that we hit our + # "break if quit" pretty often). IO.select([server], nil, nil, 1) retry unless quit end end -# Enumerate all of the potential ways to communicate with the server. -prefixes = Gem.win_platform? ? %w[nc telnet] : ['nc -U', 'telnet -u', 'ncat -U'] - # Map each candidate connection method to a thread that will check if it works. -prefixes.map! do |prefix| +candidates.map! do |candidate| Thread.new do - # We don't actually want the backtrace here. If it fails to connect then - # it's fine for this to just not work. - Thread.current.report_on_exception = false - stdout, status = - Open3.capture2("#{prefix} #{information}", stdin_data: 'ping') + Open3.capture2("#{candidate} #{information}", stdin_data: 'ping') - prefix if JSON.parse(stdout) == 'pong' && status.exitstatus == 0 + candidate if JSON.parse(stdout) == 'pong' && status.exitstatus == 0 + rescue + # We don't actually care if this fails, because we'll just skip that + # connection option. end end # Find the first one prefix that successfully returned the correct value. -connection = - prefixes.detect do |prefix| - value = prefix.value +prefix = + candidates.detect do |candidate| + value = candidate.value break value if value end # Default to running the netcat.js script that we ship with the plugin. It's a # good fallback as it will always work, but it is slower than the other options. -connection ||= "node #{File.expand_path('netcat.js', __dir__)}" +prefix ||= "node #{File.expand_path('netcat.js', __dir__)}" # Write out our connection information to the file given as the first argument # to this script. -File.write(ARGV[0], "#{connection} #{information}") +File.write(ARGV[0], "#{prefix} #{information}") listener.join From 9e2505f7970c5a671078def9a67012dbd9666e6e Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 22:03:45 -0400 Subject: [PATCH 297/785] Don't report exception in candidate threads --- src/parser/server.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/parser/server.rb b/src/parser/server.rb index ccc39d48..4fd8a6cd 100644 --- a/src/parser/server.rb +++ b/src/parser/server.rb @@ -51,7 +51,7 @@ end information = server.local_address.unix_path - candidates = ['nc -U', 'telnet -u', 'ncat -U'] + candidates = ['nc -U', 'ncat -U'] end # This is the actual listening thread that will be acting as our server. We have @@ -88,7 +88,12 @@ loc = { start: { line: error.lineno, column: error.column } } socket.write(JSON.fast_generate(error: error.message, loc: loc)) rescue StandardError => error - socket.write(JSON.fast_generate(error: error.message)) + begin + socket.write(JSON.fast_generate(error: error.message)) + rescue Errno::EPIPE + # Do nothing, the pipe has been closed by the parent process so we don't + # actually care about writing to it anymore. + end ensure socket.close end @@ -105,6 +110,8 @@ # Map each candidate connection method to a thread that will check if it works. candidates.map! do |candidate| Thread.new do + Thread.current.report_on_exception = false + stdout, status = Open3.capture2("#{candidate} #{information}", stdin_data: 'ping') From 9922d800a02c310f78a477db5852048c0a3d79b4 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 22:08:40 -0400 Subject: [PATCH 298/785] Even more debugging --- src/parser/getInfo.js | 4 ++-- src/parser/parseSync.ts | 6 ++++-- test/js/globalSetup.ts | 8 ++++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/parser/getInfo.js b/src/parser/getInfo.js index 8be7f967..1243c224 100644 --- a/src/parser/getInfo.js +++ b/src/parser/getInfo.js @@ -6,7 +6,7 @@ const filepath = process.argv[process.argv.length - 1]; const timeout = setTimeout(() => { clearInterval(interval); throw new Error("Failed to get information from parse server in time."); -}, 3000); +}, 5000); const interval = setInterval(() => { if (existsSync(filepath)) { @@ -14,4 +14,4 @@ const interval = setInterval(() => { clearTimeout(timeout); clearInterval(interval); } -}, 50); +}, 100); diff --git a/src/parser/parseSync.ts b/src/parser/parseSync.ts index 76e14332..b9e1978f 100644 --- a/src/parser/parseSync.ts +++ b/src/parser/parseSync.ts @@ -1,5 +1,5 @@ import { spawn, spawnSync } from "child_process"; -import { unlinkSync } from "fs"; +import { existsSync, unlinkSync } from "fs"; import os from "os"; import path from "path"; import process from "process"; @@ -71,7 +71,9 @@ function spawnServer(): ParserArgs { server.unref(); process.on("exit", () => { - unlinkSync(filepath); + if (existsSync(filepath)) { + unlinkSync(filepath); + } try { if (server.pid) { diff --git a/test/js/globalSetup.ts b/test/js/globalSetup.ts index e9da4dbe..8cd5001d 100644 --- a/test/js/globalSetup.ts +++ b/test/js/globalSetup.ts @@ -26,16 +26,16 @@ function globalSetup() { ); // Get the connection information from the parsing server. - const info = spawnSync("node", [ + const information = spawnSync("node", [ path.join(__dirname, "../../src/parser/getInfo.js"), filepath ]); - if (info.status !== 0) { - throw new Error("Failed to spawn parse server."); + if (information.status !== 0) { + throw new Error(information.stderr.toString()); } - process.env.PRETTIER_RUBY_HOST = info.stdout.toString(); + process.env.PRETTIER_RUBY_HOST = information.stdout.toString(); process.env.PRETTIER_RUBY_PID = `${server.pid}`; unlinkSync(filepath); From feb836658e57c17faf527d941f0705754688bb07 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 22:13:03 -0400 Subject: [PATCH 299/785] Some puts debugging --- src/parser/server.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/parser/server.rb b/src/parser/server.rb index 4fd8a6cd..e60a379c 100644 --- a/src/parser/server.rb +++ b/src/parser/server.rb @@ -108,6 +108,7 @@ end # Map each candidate connection method to a thread that will check if it works. +puts "DETECTING THE CANDIDATES! #{candidates}" candidates.map! do |candidate| Thread.new do Thread.current.report_on_exception = false @@ -123,6 +124,7 @@ end # Find the first one prefix that successfully returned the correct value. +puts "CANDIDATES SPAWNED!" prefix = candidates.detect do |candidate| value = candidate.value @@ -132,9 +134,11 @@ # Default to running the netcat.js script that we ship with the plugin. It's a # good fallback as it will always work, but it is slower than the other options. prefix ||= "node #{File.expand_path('netcat.js', __dir__)}" +puts "PREFIX DETERMINED: #{prefix}" # Write out our connection information to the file given as the first argument # to this script. File.write(ARGV[0], "#{prefix} #{information}") +puts "WRITTEN OUT TO THE FILE!" listener.join From 07f7bf0c3d4ee149e90d9c57a799d72e03111061 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 22:15:20 -0400 Subject: [PATCH 300/785] Add timeouts to netcat --- src/parser/server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parser/server.rb b/src/parser/server.rb index e60a379c..d4ac1440 100644 --- a/src/parser/server.rb +++ b/src/parser/server.rb @@ -51,7 +51,7 @@ end information = server.local_address.unix_path - candidates = ['nc -U', 'ncat -U'] + candidates = ['nc -w 3 -U', 'ncat -w 3 -U'] end # This is the actual listening thread that will be acting as our server. We have From d4276f55eb259bd87d2a0164de20a5b1918d5796 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 22:18:09 -0400 Subject: [PATCH 301/785] Remove puts debugging --- src/parser/server.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/parser/server.rb b/src/parser/server.rb index d4ac1440..086d2787 100644 --- a/src/parser/server.rb +++ b/src/parser/server.rb @@ -108,7 +108,6 @@ end # Map each candidate connection method to a thread that will check if it works. -puts "DETECTING THE CANDIDATES! #{candidates}" candidates.map! do |candidate| Thread.new do Thread.current.report_on_exception = false @@ -124,7 +123,6 @@ end # Find the first one prefix that successfully returned the correct value. -puts "CANDIDATES SPAWNED!" prefix = candidates.detect do |candidate| value = candidate.value @@ -134,11 +132,9 @@ # Default to running the netcat.js script that we ship with the plugin. It's a # good fallback as it will always work, but it is slower than the other options. prefix ||= "node #{File.expand_path('netcat.js', __dir__)}" -puts "PREFIX DETERMINED: #{prefix}" # Write out our connection information to the file given as the first argument # to this script. File.write(ARGV[0], "#{prefix} #{information}") -puts "WRITTEN OUT TO THE FILE!" listener.join From 763c2a7a6d139149ef0f06e37631155d09206ee4 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 22:19:07 -0400 Subject: [PATCH 302/785] prettier format --- src/parser/server.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parser/server.rb b/src/parser/server.rb index 086d2787..d60f48ab 100644 --- a/src/parser/server.rb +++ b/src/parser/server.rb @@ -19,7 +19,7 @@ # The information variable stores the actual connection information, which will # either be an IP address and port or a path to a unix socket file. -information = "" +information = '' # The candidates array is a list of potential programs that could be used to # connect to our server. We'll run through them after the server starts to find @@ -116,7 +116,7 @@ Open3.capture2("#{candidate} #{information}", stdin_data: 'ping') candidate if JSON.parse(stdout) == 'pong' && status.exitstatus == 0 - rescue + rescue StandardError # We don't actually care if this fails, because we'll just skip that # connection option. end From 6bbc8ccba83ebdaf8468301ae5b040379afbddd0 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 22:34:43 -0400 Subject: [PATCH 303/785] Remove rubyNetcatCommand as it should no longer be necessary --- .github/ISSUE_TEMPLATE/bug.md | 1 - .github/ISSUE_TEMPLATE/formatting.md | 1 - CHANGELOG.md | 5 +++++ README.md | 23 +++++++++++------------ src/plugin.ts | 7 ------- src/types/plugin.ts | 1 - 6 files changed, 16 insertions(+), 22 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md index 318ae337..c1f2fbd7 100644 --- a/.github/ISSUE_TEMPLATE/bug.md +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -13,7 +13,6 @@ about: Issues with prettier crashing - `rubyArrayLiteral` - `true` - `rubyHashLabel` - `true` - `rubyModifier` - `true` - - `rubyNetcatCommand` - `null` - `rubySingleQuote` - `true` - `rubyToProc` - `false` - `trailingComma` - `"none"` diff --git a/.github/ISSUE_TEMPLATE/formatting.md b/.github/ISSUE_TEMPLATE/formatting.md index 3efda83b..e18e8565 100644 --- a/.github/ISSUE_TEMPLATE/formatting.md +++ b/.github/ISSUE_TEMPLATE/formatting.md @@ -13,7 +13,6 @@ about: Issues for ugly or incorrect code - `rubyArrayLiteral` - `true` - `rubyHashLabel` - `true` - `rubyModifier` - `true` - - `rubyNetcatCommand` - `null` - `rubySingleQuote` - `true` - `rubyToProc` - `false` - `trailingComma` - `"none"` diff --git a/CHANGELOG.md b/CHANGELOG.md index cf77c475..8c4de4f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#900](https://github.com/prettier/plugin-ruby/issues/900) - rsslldnphy, kddnewton - Ensure that in a HAML line where you have interpolation inside of a tag content that you print it properly. - [#929](https://github.com/prettier/plugin-ruby/issues/929) - ryanb, kddnewton - Deeply nested blocks should not break their call chains. - [#935](https://github.com/prettier/plugin-ruby/pull/935) - nbudin, mlauter - Ensure embedded formatting heredocs are properly indented. +- [#975](https://github.com/prettier/plugin-ruby/pull/975) - kddnewton - Refactor the way we determine how to connect to the parser server. + +### Removed + +- [#976](https://github.com/prettier/plugin-ruby/pull/976) - kddnewton - Remove the `rubyNetcatCommand` option, as it should no longer be necessary. ## [1.6.1] - 2021-06-30 diff --git a/README.md b/README.md index e5485a66..b96517c2 100644 --- a/README.md +++ b/README.md @@ -128,18 +128,17 @@ The `prettier` executable is now installed and ready for use: Below are the options (from [`src/plugin.js`](src/plugin.js)) that `@prettier/plugin-ruby` currently supports: -| API Option | CLI Option | Default | Description | -| ------------------- | ----------------------- | :------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `printWidth` | `--print-width` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)). | -| `requirePragma` | `--require-pragma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#require-pragma)). | -| `rubyArrayLiteral` | `--ruby-array-literal` | `true` | When possible, favor the use of string and symbol array literals. | -| `rubyHashLabel` | `--ruby-hash-label` | `true` | When possible, uses the shortened hash key syntax, as opposed to hash rockets. | -| `rubyModifier` | `--ruby-modifier` | `true` | When it fits on one line, allows while and until statements to use the modifier form. | -| `rubyNetcatCommand` | `--ruby-netcat-command` | | The prefix of the command to execute to communicate between the node.js process and the Ruby process. (For example, `"nc -U"` or `"telnet -u"`) Normally you should not set this option. | -| `rubySingleQuote` | `--ruby-single-quote` | `true` | When double quotes are not necessary for interpolation, prefers the use of single quotes for string literals. | -| `rubyToProc` | `--ruby-to-proc` | `false` | When possible, convert blocks to the more concise `Symbol#to_proc` syntax. | -| `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). | -| `trailingComma` | `--trailing-comma` | `"none"` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#trailing-comma)). `"es5"` is equivalent to `true`. | +| API Option | CLI Option | Default | Description | +| ------------------ | ---------------------- | :------: | ------------------------------------------------------------------------------------------------------------------------------------ | +| `printWidth` | `--print-width` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)). | +| `requirePragma` | `--require-pragma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#require-pragma)). | +| `rubyArrayLiteral` | `--ruby-array-literal` | `true` | When possible, favor the use of string and symbol array literals. | +| `rubyHashLabel` | `--ruby-hash-label` | `true` | When possible, uses the shortened hash key syntax, as opposed to hash rockets. | +| `rubyModifier` | `--ruby-modifier` | `true` | When it fits on one line, allows while and until statements to use the modifier form. | +| `rubySingleQuote` | `--ruby-single-quote` | `true` | When double quotes are not necessary for interpolation, prefers the use of single quotes for string literals. | +| `rubyToProc` | `--ruby-to-proc` | `false` | When possible, convert blocks to the more concise `Symbol#to_proc` syntax. | +| `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). | +| `trailingComma` | `--trailing-comma` | `"none"` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#trailing-comma)). `"es5"` is equivalent to `true`. | Any of these can be added to your existing [prettier configuration file](https://prettier.io/docs/en/configuration.html). For example: diff --git a/src/plugin.ts b/src/plugin.ts index 4b2bf1dd..77f47ee5 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -121,13 +121,6 @@ const plugin = { "When it fits on one line, allows if, unless, while, and until statements to use the modifier form.", since: "1.0.0" }, - rubyNetcatCommand: { - type: "string", - category: "Ruby", - description: - 'The prefix of the command to execute to communicate between the node.js process and the Ruby process. (For example, "nc -U" or "telnet -u") Normally you should not set this option.', - since: "1.4.0" - }, rubySingleQuote: { type: "boolean", category: "Ruby", diff --git a/src/types/plugin.ts b/src/types/plugin.ts index b5d15815..2de62dc6 100644 --- a/src/types/plugin.ts +++ b/src/types/plugin.ts @@ -61,7 +61,6 @@ export type Options = Prettier.ParserOptions & { rubyArrayLiteral: boolean, rubyHashLabel: boolean, rubyModifier: boolean, - rubyNetcatCommand?: string, rubySingleQuote: boolean, rubyToProc: boolean }; From c6364e939aae54be53d833b43498f5f775fa29f8 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 29 Sep 2021 22:43:45 -0400 Subject: [PATCH 304/785] Bump version to 2.0.0 pre-release --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c4de4f6..0d8d6cd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [2.0.0-rc1] + ### Added - [#949](https://github.com/prettier/plugin-ruby/pull/949) - kddnewton - Converted over to using TypeScript for development. @@ -1149,7 +1151,8 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.6.1...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v2.0.0-rc1...HEAD +[2.0.0-rc1]: https://github.com/prettier/plugin-ruby/compare/v1.6.1...v2.0.0-rc1 [1.6.1]: https://github.com/prettier/plugin-ruby/compare/v1.6.0...v1.6.1 [1.6.0]: https://github.com/prettier/plugin-ruby/compare/v1.5.5...v1.6.0 [1.5.5]: https://github.com/prettier/plugin-ruby/compare/v1.5.4...v1.5.5 diff --git a/package.json b/package.json index 9e2905de..562c9359 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "1.6.1", + "version": "2.0.0-rc1", "description": "prettier plugin for the Ruby programming language", "main": "dist/plugin.js", "scripts": { From 5183dd8c42628d6b4a8774d87ece34b2e9797462 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Sep 2021 12:53:33 +0000 Subject: [PATCH 305/785] Bump @types/node from 16.10.1 to 16.10.2 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.10.1 to 16.10.2. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 40 +++------------------------------------- 1 file changed, 3 insertions(+), 37 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9ba98552..2cf88993 100644 --- a/yarn.lock +++ b/yarn.lock @@ -684,9 +684,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^16.9.1": - version "16.10.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.1.tgz#f3647623199ca920960006b3dccf633ea905f243" - integrity sha512-4/Z9DMPKFexZj/Gn3LylFgamNKHm4K3QDi0gz9B26Uk0c8izYf97B5fxfpspMNkWlFupblKM/nV8+NA9Ffvr+w== + version "16.10.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.2.tgz#5764ca9aa94470adb4e1185fe2e9f19458992b2e" + integrity sha512-zCclL4/rx+W5SQTzFs9wyvvyCwoK9QtBpratqz2IYJ3O8Umrn0m3nsTv0wQBk9sRGpvUe9CwPDrQFB10f1FIjQ== "@types/prettier@^2.1.5", "@types/prettier@^2.3.2": version "2.4.1" @@ -746,14 +746,6 @@ "@typescript-eslint/typescript-estree" "4.32.0" debug "^4.3.1" -"@typescript-eslint/scope-manager@4.31.2": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.31.2.tgz#1d528cb3ed3bcd88019c20a57c18b897b073923a" - integrity sha512-2JGwudpFoR/3Czq6mPpE8zBPYdHWFGL6lUNIGolbKQeSNv4EAiHaR5GVDQaLA0FwgcdcMtRk+SBJbFGL7+La5w== - dependencies: - "@typescript-eslint/types" "4.31.2" - "@typescript-eslint/visitor-keys" "4.31.2" - "@typescript-eslint/scope-manager@4.32.0": version "4.32.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.32.0.tgz#e03c8668f8b954072b3f944d5b799c0c9225a7d5" @@ -762,29 +754,11 @@ "@typescript-eslint/types" "4.32.0" "@typescript-eslint/visitor-keys" "4.32.0" -"@typescript-eslint/types@4.31.2": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.31.2.tgz#2aea7177d6d744521a168ed4668eddbd912dfadf" - integrity sha512-kWiTTBCTKEdBGrZKwFvOlGNcAsKGJSBc8xLvSjSppFO88AqGxGNYtF36EuEYG6XZ9vT0xX8RNiHbQUKglbSi1w== - "@typescript-eslint/types@4.32.0": version "4.32.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.32.0.tgz#52c633c18da47aee09449144bf59565ab36df00d" integrity sha512-LE7Z7BAv0E2UvqzogssGf1x7GPpUalgG07nGCBYb1oK4mFsOiFC/VrSMKbZQzFJdN2JL5XYmsx7C7FX9p9ns0w== -"@typescript-eslint/typescript-estree@4.31.2": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.2.tgz#abfd50594d8056b37e7428df3b2d185ef2d0060c" - integrity sha512-ieBq8U9at6PvaC7/Z6oe8D3czeW5d//Fo1xkF/s9394VR0bg/UaMYPdARiWyKX+lLEjY3w/FNZJxitMsiWv+wA== - dependencies: - "@typescript-eslint/types" "4.31.2" - "@typescript-eslint/visitor-keys" "4.31.2" - debug "^4.3.1" - globby "^11.0.3" - is-glob "^4.0.1" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@4.32.0": version "4.32.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.32.0.tgz#db00ccc41ccedc8d7367ea3f50c6994b8efa9f3b" @@ -798,14 +772,6 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@4.31.2": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.2.tgz#7d5b4a4705db7fe59ecffb273c1d082760f635cc" - integrity sha512-PrBId7EQq2Nibns7dd/ch6S6/M4/iwLM9McbgeEbCXfxdwRUNxJ4UNreJ6Gh3fI2GNKNrWnQxKL7oCPmngKBug== - dependencies: - "@typescript-eslint/types" "4.31.2" - eslint-visitor-keys "^2.0.0" - "@typescript-eslint/visitor-keys@4.32.0": version "4.32.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.32.0.tgz#455ba8b51242f2722a497ffae29313f33b14cb7f" From e581e1578b19c22650febf8ce1bbc35a68006173 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Sep 2021 12:53:50 +0000 Subject: [PATCH 306/785] Bump jest from 27.2.3 to 27.2.4 Bumps [jest](https://github.com/facebook/jest) from 27.2.3 to 27.2.4. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v27.2.3...v27.2.4) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 676 +++++++++++++++++++++++++----------------------------- 1 file changed, 318 insertions(+), 358 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9ba98552..d398e066 100644 --- a/yarn.lock +++ b/yarn.lock @@ -366,94 +366,93 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^27.2.3": - version "27.2.3" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.2.3.tgz#c87fe48397dc7511089be71da93fb41869b75b7e" - integrity sha512-7akAz7p6T31EEYVVKxs6fKaR7CUgem22M/0TjCP7a64FIhNif2EiWcRzMkkDZbYhImG+Tz5qy9gMk2Wtl5GV1g== +"@jest/console@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.2.4.tgz#2f1a4bf82b9940065d4818fac271def99ec55e5e" + integrity sha512-94znCKynPZpDpYHQ6esRJSc11AmONrVkBOBZiD7S+bSubHhrUfbS95EY5HIOxhm4PQO7cnvZkL3oJcY0oMA+Wg== dependencies: - "@jest/types" "^27.2.3" + "@jest/types" "^27.2.4" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^27.2.3" - jest-util "^27.2.3" + jest-message-util "^27.2.4" + jest-util "^27.2.4" slash "^3.0.0" -"@jest/core@^27.2.3": - version "27.2.3" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.2.3.tgz#b21a3ffb69bef017c4562d27689bb798c0194501" - integrity sha512-I+VX+X8pkw2I057swT3ufNp6V5EBeFO1dl+gvIexdV0zg1kZ+cz9CrPbWL75dYrJIInf5uWPwDwOoJCALrTxWw== +"@jest/core@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.2.4.tgz#0b932da787d64848eab720dbb88e5b7a3f86e539" + integrity sha512-UNQLyy+rXoojNm2MGlapgzWhZD1CT1zcHZQYeiD0xE7MtJfC19Q6J5D/Lm2l7i4V97T30usKDoEtjI8vKwWcLg== dependencies: - "@jest/console" "^27.2.3" - "@jest/reporters" "^27.2.3" - "@jest/test-result" "^27.2.3" - "@jest/transform" "^27.2.3" - "@jest/types" "^27.2.3" + "@jest/console" "^27.2.4" + "@jest/reporters" "^27.2.4" + "@jest/test-result" "^27.2.4" + "@jest/transform" "^27.2.4" + "@jest/types" "^27.2.4" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" - jest-changed-files "^27.2.3" - jest-config "^27.2.3" - jest-haste-map "^27.2.3" - jest-message-util "^27.2.3" + jest-changed-files "^27.2.4" + jest-config "^27.2.4" + jest-haste-map "^27.2.4" + jest-message-util "^27.2.4" jest-regex-util "^27.0.6" - jest-resolve "^27.2.3" - jest-resolve-dependencies "^27.2.3" - jest-runner "^27.2.3" - jest-runtime "^27.2.3" - jest-snapshot "^27.2.3" - jest-util "^27.2.3" - jest-validate "^27.2.3" - jest-watcher "^27.2.3" + jest-resolve "^27.2.4" + jest-resolve-dependencies "^27.2.4" + jest-runner "^27.2.4" + jest-runtime "^27.2.4" + jest-snapshot "^27.2.4" + jest-util "^27.2.4" + jest-validate "^27.2.4" + jest-watcher "^27.2.4" micromatch "^4.0.4" - p-each-series "^2.1.0" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.2.3": - version "27.2.3" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.2.3.tgz#3ae328d778a67e027bad27541d1c09ed94312609" - integrity sha512-xXZk/Uhq6TTRydg4RyNawNZ82lX88r3997t5ykzQBfB3Wd+mqzSyC4XWzw4lTZJISldwn9/FunexTSGBFcvVAg== +"@jest/environment@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.2.4.tgz#db3e60f7dd30ab950f6ce2d6d7293ed9a6b7cbcd" + integrity sha512-wkuui5yr3SSQW0XD0Qm3TATUbL/WE3LDEM3ulC+RCQhMf2yxhci8x7svGkZ4ivJ6Pc94oOzpZ6cdHBAMSYd1ew== dependencies: - "@jest/fake-timers" "^27.2.3" - "@jest/types" "^27.2.3" + "@jest/fake-timers" "^27.2.4" + "@jest/types" "^27.2.4" "@types/node" "*" - jest-mock "^27.2.3" + jest-mock "^27.2.4" -"@jest/fake-timers@^27.2.3": - version "27.2.3" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.2.3.tgz#21cdef9cb9edd30c80026a0176eba58f5fbcaa67" - integrity sha512-A8+X35briNiabUPcLqYQY+dsvBUozX9DCa7HgJLdvRK/JPAKUpthYHjnI9y6QUYaDTqGZEo4rLf7LXE51MwP3Q== +"@jest/fake-timers@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.2.4.tgz#00df08bd60332bd59503cb5b6db21e4903785f86" + integrity sha512-cs/TzvwWUM7kAA6Qm/890SK6JJ2pD5RfDNM3SSEom6BmdyV6OiWP1qf/pqo6ts6xwpcM36oN0wSEzcZWc6/B6w== dependencies: - "@jest/types" "^27.2.3" + "@jest/types" "^27.2.4" "@sinonjs/fake-timers" "^8.0.1" "@types/node" "*" - jest-message-util "^27.2.3" - jest-mock "^27.2.3" - jest-util "^27.2.3" + jest-message-util "^27.2.4" + jest-mock "^27.2.4" + jest-util "^27.2.4" -"@jest/globals@^27.2.3": - version "27.2.3" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.2.3.tgz#6b8d652083d78709b243d9571457058f1c6c5fea" - integrity sha512-JVjQDs5z34XvFME0qHmKwWtgzRnBa/i22nfWjzlIUvkdFCzndN+JTLEWNXAgyBbGnNYuMZ8CpvgF9uhKt/cR3g== +"@jest/globals@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.2.4.tgz#0aeb22b011f8c8c4b8ff3b4dbd1ee0392fe0dd8a" + integrity sha512-DRsRs5dh0i+fA9mGHylTU19+8fhzNJoEzrgsu+zgJoZth3x8/0juCQ8nVVdW1er4Cqifb/ET7/hACYVPD0dBEA== dependencies: - "@jest/environment" "^27.2.3" - "@jest/types" "^27.2.3" - expect "^27.2.3" + "@jest/environment" "^27.2.4" + "@jest/types" "^27.2.4" + expect "^27.2.4" -"@jest/reporters@^27.2.3": - version "27.2.3" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.2.3.tgz#47c27be7c3e2069042b6fba12c1f8f62f91302db" - integrity sha512-zc9gQDjUAnkRQ5C0LW2u4JU9Ojqp9qc8OXQkMSmAbou6lN0mvDGEl4PG5HrZxpW4nE2FjIYyX6JAn05QT3gLbw== +"@jest/reporters@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.2.4.tgz#1482ff007f2e919d85c54b1563abb8b2ea2d5198" + integrity sha512-LHeSdDnDZkDnJ8kvnjcqV8P1Yv/32yL4d4XfR5gBiy3xGO0onwll1QEbvtW96fIwhx2nejug0GTaEdNDoyr3fQ== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.2.3" - "@jest/test-result" "^27.2.3" - "@jest/transform" "^27.2.3" - "@jest/types" "^27.2.3" + "@jest/console" "^27.2.4" + "@jest/test-result" "^27.2.4" + "@jest/transform" "^27.2.4" + "@jest/types" "^27.2.4" chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" @@ -464,10 +463,10 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^27.2.3" - jest-resolve "^27.2.3" - jest-util "^27.2.3" - jest-worker "^27.2.3" + jest-haste-map "^27.2.4" + jest-resolve "^27.2.4" + jest-util "^27.2.4" + jest-worker "^27.2.4" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" @@ -483,41 +482,41 @@ graceful-fs "^4.2.4" source-map "^0.6.0" -"@jest/test-result@^27.2.3": - version "27.2.3" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.2.3.tgz#7d8f790186c7ec7600edc1d8781656268f038255" - integrity sha512-+pRxO4xSJyUxoA0ENiTq8wT+5RCFOxK4nlNY2lUes/VF33uB54GBkZeXlljZcZjuzS1Yarz4hZI/a4mBtv9jQA== +"@jest/test-result@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.2.4.tgz#d1ca8298d168f1b0be834bfb543b1ac0294c05d7" + integrity sha512-eU+PRo0+lIS01b0dTmMdVZ0TtcRSxEaYquZTRFMQz6CvsehGhx9bRzi9Zdw6VROviJyv7rstU+qAMX5pNBmnfQ== dependencies: - "@jest/console" "^27.2.3" - "@jest/types" "^27.2.3" + "@jest/console" "^27.2.4" + "@jest/types" "^27.2.4" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.2.3": - version "27.2.3" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.2.3.tgz#a9e376b91a64c6f5ab37f05e9d304340609125d7" - integrity sha512-QskUVqLU2zzRYchI2Q9I9A2xnbDqGo70WIWkKf4+tD+BAkohDxOF46Q7iYxznPiRTcoYtqttSZiNSS4rgQDxrQ== +"@jest/test-sequencer@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.2.4.tgz#df66422a3e9e7440ce8b7498e255fa6b52c0bc03" + integrity sha512-fpk5eknU3/DXE2QCCG1wv/a468+cfPo3Asu6d6yUtM9LOPh709ubZqrhuUOYfM8hXMrIpIdrv1CdCrWWabX0rQ== dependencies: - "@jest/test-result" "^27.2.3" + "@jest/test-result" "^27.2.4" graceful-fs "^4.2.4" - jest-haste-map "^27.2.3" - jest-runtime "^27.2.3" + jest-haste-map "^27.2.4" + jest-runtime "^27.2.4" -"@jest/transform@^27.2.3": - version "27.2.3" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.2.3.tgz#1df37dbfe5bc29c00f227acae11348437a76b77e" - integrity sha512-ZpYsc9vK+OfV/9hMsVOrCH/9rvzBHAp91OOzkLqdWf3FWpDzjxAH+OlLGcS4U8WeWsdpe8/rOMKLwFs9DwL/2A== +"@jest/transform@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.2.4.tgz#2fe5b6836895f7a1b8bdec442c51e83943c62733" + integrity sha512-n5FlX2TH0oQGwyVDKPxdJ5nI2sO7TJBFe3u3KaAtt7TOiV4yL+Y+rSFDl+Ic5MpbiA/eqXmLAQxjnBmWgS2rEA== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^27.2.3" + "@jest/types" "^27.2.4" babel-plugin-istanbul "^6.0.0" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.2.3" + jest-haste-map "^27.2.4" jest-regex-util "^27.0.6" - jest-util "^27.2.3" + jest-util "^27.2.4" micromatch "^4.0.4" pirates "^4.0.1" slash "^3.0.0" @@ -535,10 +534,10 @@ "@types/yargs" "^16.0.0" chalk "^4.0.0" -"@jest/types@^27.2.3": - version "27.2.3" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.2.3.tgz#e0242545f442242c2538656d947a147443eee8f2" - integrity sha512-UJMDg90+W2i/QsS1NIN6Go8O/rSHLFWUkofGqKsUQs54mhmCVyLTiDy1cwKhoNO5fpmr9fctm9L/bRp/YzA1uQ== +"@jest/types@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.2.4.tgz#2430042a66e00dc5b140c3636f4474d464c21ee8" + integrity sha512-IDO2ezTxeMvQAHxzG/ZvEyA47q0aVfzT95rGFl7bZs/Go0aIucvfDbS2rmnoEdXxlLQhcolmoG/wvL/uKx4tKA== dependencies: "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" @@ -746,14 +745,6 @@ "@typescript-eslint/typescript-estree" "4.32.0" debug "^4.3.1" -"@typescript-eslint/scope-manager@4.31.2": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.31.2.tgz#1d528cb3ed3bcd88019c20a57c18b897b073923a" - integrity sha512-2JGwudpFoR/3Czq6mPpE8zBPYdHWFGL6lUNIGolbKQeSNv4EAiHaR5GVDQaLA0FwgcdcMtRk+SBJbFGL7+La5w== - dependencies: - "@typescript-eslint/types" "4.31.2" - "@typescript-eslint/visitor-keys" "4.31.2" - "@typescript-eslint/scope-manager@4.32.0": version "4.32.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.32.0.tgz#e03c8668f8b954072b3f944d5b799c0c9225a7d5" @@ -762,29 +753,11 @@ "@typescript-eslint/types" "4.32.0" "@typescript-eslint/visitor-keys" "4.32.0" -"@typescript-eslint/types@4.31.2": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.31.2.tgz#2aea7177d6d744521a168ed4668eddbd912dfadf" - integrity sha512-kWiTTBCTKEdBGrZKwFvOlGNcAsKGJSBc8xLvSjSppFO88AqGxGNYtF36EuEYG6XZ9vT0xX8RNiHbQUKglbSi1w== - "@typescript-eslint/types@4.32.0": version "4.32.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.32.0.tgz#52c633c18da47aee09449144bf59565ab36df00d" integrity sha512-LE7Z7BAv0E2UvqzogssGf1x7GPpUalgG07nGCBYb1oK4mFsOiFC/VrSMKbZQzFJdN2JL5XYmsx7C7FX9p9ns0w== -"@typescript-eslint/typescript-estree@4.31.2": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.2.tgz#abfd50594d8056b37e7428df3b2d185ef2d0060c" - integrity sha512-ieBq8U9at6PvaC7/Z6oe8D3czeW5d//Fo1xkF/s9394VR0bg/UaMYPdARiWyKX+lLEjY3w/FNZJxitMsiWv+wA== - dependencies: - "@typescript-eslint/types" "4.31.2" - "@typescript-eslint/visitor-keys" "4.31.2" - debug "^4.3.1" - globby "^11.0.3" - is-glob "^4.0.1" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@4.32.0": version "4.32.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.32.0.tgz#db00ccc41ccedc8d7367ea3f50c6994b8efa9f3b" @@ -798,14 +771,6 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@4.31.2": - version "4.31.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.2.tgz#7d5b4a4705db7fe59ecffb273c1d082760f635cc" - integrity sha512-PrBId7EQq2Nibns7dd/ch6S6/M4/iwLM9McbgeEbCXfxdwRUNxJ4UNreJ6Gh3fI2GNKNrWnQxKL7oCPmngKBug== - dependencies: - "@typescript-eslint/types" "4.31.2" - eslint-visitor-keys "^2.0.0" - "@typescript-eslint/visitor-keys@4.32.0": version "4.32.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.32.0.tgz#455ba8b51242f2722a497ffae29313f33b14cb7f" @@ -960,13 +925,13 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= -babel-jest@^27.2.3: - version "27.2.3" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.2.3.tgz#f48599a507cd33c10f58058149eb3079198d0ed7" - integrity sha512-lXslrpae1L9cXnB5F8vvD/Yj70g47sG7CGSxT+qqveK/To72X3nuCtDux0s3HN7X351IbwYoYyfDxQ7CqVbkNw== +babel-jest@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.2.4.tgz#21ed6729d51bdd75470bbbf3c8b08d86209fb0dc" + integrity sha512-f24OmxyWymk5jfgLdlCMu4fTs4ldxFBIdn5sJdhvGC1m08rSkJ5hYbWkNmfBSvE/DjhCVNSHXepxsI6THGfGsg== dependencies: - "@jest/transform" "^27.2.3" - "@jest/types" "^27.2.3" + "@jest/transform" "^27.2.4" + "@jest/types" "^27.2.4" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.0.0" babel-preset-jest "^27.2.0" @@ -1533,16 +1498,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^27.2.3: - version "27.2.3" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.2.3.tgz#9ce766b50c6a5f22edd07ca5510845ac8bcb0b10" - integrity sha512-qT+ItBIdpS2QkRzZNGFmqpV2xTjK20gftUnJ4CLmpjdGzpoEtjxb43Y80GraXLtwB+wt5kRmXURINeM3s2fQtQ== +expect@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.2.4.tgz#4debf546050bcdad8914a8c95fec7662e02bf67c" + integrity sha512-gOtuonQ8TCnbNNCSw2fhVzRf8EFYDII4nB5NmG4IEV0rbUnW1I5zXvoTntU4iicB/Uh0oZr20NGlOLdJiwsOZA== dependencies: - "@jest/types" "^27.2.3" + "@jest/types" "^27.2.4" ansi-styles "^5.0.0" jest-get-type "^27.0.6" - jest-matcher-utils "^27.2.3" - jest-message-util "^27.2.3" + jest-matcher-utils "^27.2.4" + jest-message-util "^27.2.4" jest-regex-util "^27.0.6" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: @@ -1938,84 +1903,84 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^27.2.3: - version "27.2.3" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.2.3.tgz#83c42171d87c26d5a72e8464412cc4e239c01dda" - integrity sha512-UiT98eMtPySry7E0RmkDTL/GyoZBvJVWZBlHpHYc3ilRLxHBUxPkbMK/bcImDJKqyKbj83EaeIpeaMXPlPQ72A== +jest-changed-files@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.2.4.tgz#d7de46e90e5a599c47e260760f5ab53516e835e6" + integrity sha512-eeO1C1u4ex7pdTroYXezr+rbr957myyVoKGjcY4R1TJi3A+9v+4fu1Iv9J4eLq1bgFyT3O3iRWU9lZsEE7J72Q== dependencies: - "@jest/types" "^27.2.3" + "@jest/types" "^27.2.4" execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.2.3: - version "27.2.3" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.2.3.tgz#e46ed567b316323f0b7c12dc72cd12fe46656356" - integrity sha512-msCZkvudSDhUtCCEU/Dsnp5DRzX5MQGwfuRjDwhxJxjSJ0g4c3Qwhk5Q2AjFjZS9EVm4qs9fGCf+W3BU69h3pw== +jest-circus@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.2.4.tgz#3bd898a29dcaf6a506f3f1b780dff5f67ca83c23" + integrity sha512-TtheheTElrGjlsY9VxkzUU1qwIx05ItIusMVKnvNkMt4o/PeegLRcjq3Db2Jz0GGdBalJdbzLZBgeulZAJxJWA== dependencies: - "@jest/environment" "^27.2.3" - "@jest/test-result" "^27.2.3" - "@jest/types" "^27.2.3" + "@jest/environment" "^27.2.4" + "@jest/test-result" "^27.2.4" + "@jest/types" "^27.2.4" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" - expect "^27.2.3" + expect "^27.2.4" is-generator-fn "^2.0.0" - jest-each "^27.2.3" - jest-matcher-utils "^27.2.3" - jest-message-util "^27.2.3" - jest-runtime "^27.2.3" - jest-snapshot "^27.2.3" - jest-util "^27.2.3" - pretty-format "^27.2.3" + jest-each "^27.2.4" + jest-matcher-utils "^27.2.4" + jest-message-util "^27.2.4" + jest-runtime "^27.2.4" + jest-snapshot "^27.2.4" + jest-util "^27.2.4" + pretty-format "^27.2.4" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.2.3: - version "27.2.3" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.2.3.tgz#68add5b1626bd5502df6c7a4a4d574ebf797221a" - integrity sha512-QHXxxqE1zxMlti6wIHSbkl4Brg5Dnc0xzAVqRlVa6y2Ygv2X4ejhfMjl4VB5gWeHNsVA9C+KOm8TawpjZX8d3g== +jest-cli@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.2.4.tgz#acda7f367aa6e674723fc1a7334e0ae1799448d2" + integrity sha512-4kpQQkg74HYLaXo3nzwtg4PYxSLgL7puz1LXHj5Tu85KmlIpxQFjRkXlx4V47CYFFIDoyl3rHA/cXOxUWyMpNg== dependencies: - "@jest/core" "^27.2.3" - "@jest/test-result" "^27.2.3" - "@jest/types" "^27.2.3" + "@jest/core" "^27.2.4" + "@jest/test-result" "^27.2.4" + "@jest/types" "^27.2.4" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.2.3" - jest-util "^27.2.3" - jest-validate "^27.2.3" + jest-config "^27.2.4" + jest-util "^27.2.4" + jest-validate "^27.2.4" prompts "^2.0.1" - yargs "^16.0.3" + yargs "^16.2.0" -jest-config@^27.2.3: - version "27.2.3" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.2.3.tgz#64606cd1f194fb9527cbbc3e4ff23b324653b992" - integrity sha512-15fKPBZ+eiDUj02bENeBNL6IrH9ZQg7mcOlJ+SG8HwEkjpy0K+NHAREFIJbPFBaq75syWk9SYkB77fH0XtoZOQ== +jest-config@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.2.4.tgz#0204969f5ae2e5190d47be2c14c04d631b7836e2" + integrity sha512-tWy0UxhdzqiKyp4l5Vq4HxLyD+gH5td+GCF3c22/DJ0bYAOsMo+qi2XtbJI6oYMH5JOJQs9nLW/r34nvFCehjA== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.2.3" - "@jest/types" "^27.2.3" - babel-jest "^27.2.3" + "@jest/test-sequencer" "^27.2.4" + "@jest/types" "^27.2.4" + babel-jest "^27.2.4" chalk "^4.0.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" is-ci "^3.0.0" - jest-circus "^27.2.3" - jest-environment-jsdom "^27.2.3" - jest-environment-node "^27.2.3" + jest-circus "^27.2.4" + jest-environment-jsdom "^27.2.4" + jest-environment-node "^27.2.4" jest-get-type "^27.0.6" - jest-jasmine2 "^27.2.3" + jest-jasmine2 "^27.2.4" jest-regex-util "^27.0.6" - jest-resolve "^27.2.3" - jest-runner "^27.2.3" - jest-util "^27.2.3" - jest-validate "^27.2.3" + jest-resolve "^27.2.4" + jest-runner "^27.2.4" + jest-util "^27.2.4" + jest-validate "^27.2.4" micromatch "^4.0.4" - pretty-format "^27.2.3" + pretty-format "^27.2.4" jest-diff@^27.0.0: version "27.2.0" @@ -2027,15 +1992,15 @@ jest-diff@^27.0.0: jest-get-type "^27.0.6" pretty-format "^27.2.0" -jest-diff@^27.2.3: - version "27.2.3" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.2.3.tgz#4298ecc53f7476571d0625e8fda3ade13607a864" - integrity sha512-ihRKT1mbm/Lw+vaB1un4BEof3WdfYIXT0VLvEyLUTU3XbIUgyiljis3YzFf2RFn+ECFAeyilqJa35DeeRV2NeQ== +jest-diff@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.2.4.tgz#171c51d3d2c105c457100fee6e7bf7cee51c8d8c" + integrity sha512-bLAVlDSCR3gqUPGv+4nzVpEXGsHh98HjUL7Vb2hVyyuBDoQmja8eJb0imUABsuxBeUVmf47taJSAd9nDrwWKEg== dependencies: chalk "^4.0.0" diff-sequences "^27.0.6" jest-get-type "^27.0.6" - pretty-format "^27.2.3" + pretty-format "^27.2.4" jest-docblock@^27.0.6: version "27.0.6" @@ -2044,53 +2009,53 @@ jest-docblock@^27.0.6: dependencies: detect-newline "^3.0.0" -jest-each@^27.2.3: - version "27.2.3" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.2.3.tgz#7eaf7c7b362019f23c5a7998b57d82e78e6f6672" - integrity sha512-Aza5Lr+tml8x+rBGsi3A8VLqhYN1UBa2M7FLtgkUvVFQBORlV9irLl/ZE0tvk4hRqp4jW7nbGDrRo2Ey8Wl9rg== +jest-each@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.2.4.tgz#b4f280aafd63129ba82e345f0e74c5a10200aeef" + integrity sha512-w9XVc+0EDBUTJS4xBNJ7N2JCcWItFd006lFjz77OarAQcQ10eFDBMrfDv2GBJMKlXe9aq0HrIIF51AXcZrRJyg== dependencies: - "@jest/types" "^27.2.3" + "@jest/types" "^27.2.4" chalk "^4.0.0" jest-get-type "^27.0.6" - jest-util "^27.2.3" - pretty-format "^27.2.3" + jest-util "^27.2.4" + pretty-format "^27.2.4" -jest-environment-jsdom@^27.2.3: - version "27.2.3" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.2.3.tgz#36ad673f93f1948dd5daa6dcb1c9b1ad09d60165" - integrity sha512-QEcgd5bloEfugjvYFACFtFkn5sW9fGYS/vJaTQZ2kj8/q1semDYWssbUWeT8Lmm/4utv9G50+bTq/vGP/LZwvQ== +jest-environment-jsdom@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.2.4.tgz#39ae80bbb8675306bfaf0440be1e5f877554539a" + integrity sha512-X70pTXFSypD7AIzKT1mLnDi5hP9w9mdTRcOGOmoDoBrNyNEg4rYm6d4LQWFLc9ps1VnMuDOkFSG0wjSNYGjkng== dependencies: - "@jest/environment" "^27.2.3" - "@jest/fake-timers" "^27.2.3" - "@jest/types" "^27.2.3" + "@jest/environment" "^27.2.4" + "@jest/fake-timers" "^27.2.4" + "@jest/types" "^27.2.4" "@types/node" "*" - jest-mock "^27.2.3" - jest-util "^27.2.3" + jest-mock "^27.2.4" + jest-util "^27.2.4" jsdom "^16.6.0" -jest-environment-node@^27.2.3: - version "27.2.3" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.2.3.tgz#651b15f52310b12660a5fd53812b8b2e696ee9b9" - integrity sha512-OmxFyQ81n1pQ+WJW7tOkGPQL/nt0+UeubHlZJEdAzuOvYAA8zleamw0BpK7QsITdJ5euSI6t/HW3a5ihqMB4yQ== +jest-environment-node@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.2.4.tgz#b79f98cb36e0c9111aac859c9c99f04eb2f74ff6" + integrity sha512-ZbVbFSnbzTvhLOIkqh5lcLuGCCFvtG4xTXIRPK99rV2KzQT3kNg16KZwfTnLNlIiWCE8do960eToeDfcqmpSAw== dependencies: - "@jest/environment" "^27.2.3" - "@jest/fake-timers" "^27.2.3" - "@jest/types" "^27.2.3" + "@jest/environment" "^27.2.4" + "@jest/fake-timers" "^27.2.4" + "@jest/types" "^27.2.4" "@types/node" "*" - jest-mock "^27.2.3" - jest-util "^27.2.3" + jest-mock "^27.2.4" + jest-util "^27.2.4" jest-get-type@^27.0.6: version "27.0.6" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.6.tgz#0eb5c7f755854279ce9b68a9f1a4122f69047cfe" integrity sha512-XTkK5exIeUbbveehcSR8w0bhH+c0yloW/Wpl+9vZrjzztCPWrxhHwkIFpZzCt71oRBsgxmuUfxEqOYoZI2macg== -jest-haste-map@^27.2.3: - version "27.2.3" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.2.3.tgz#cec807c59c312872f0ea4cc1b6b5ca7b46131705" - integrity sha512-5KE0vRSGv1Ymhd6s1t6xhTm/77otdkzqJl+9pSIYfKKCKJ7cniyE2zVC/Xj2HKuMX++aJYzQvQCIS0kqIFukAw== +jest-haste-map@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.2.4.tgz#f8974807bedf07348ca9fd24e5861ab7c8e61aba" + integrity sha512-bkJ4bT00T2K+1NZXbRcyKnbJ42I6QBvoDNMTAQQDBhaGNnZreiQKUNqax0e6hLTx7E75pKDeltVu3V1HAdu+YA== dependencies: - "@jest/types" "^27.2.3" + "@jest/types" "^27.2.4" "@types/graceful-fs" "^4.1.2" "@types/node" "*" anymatch "^3.0.3" @@ -2098,76 +2063,76 @@ jest-haste-map@^27.2.3: graceful-fs "^4.2.4" jest-regex-util "^27.0.6" jest-serializer "^27.0.6" - jest-util "^27.2.3" - jest-worker "^27.2.3" + jest-util "^27.2.4" + jest-worker "^27.2.4" micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.2.3: - version "27.2.3" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.2.3.tgz#19fe549b7e86128cd7d0d1668ebf4377dd3981f9" - integrity sha512-pjgANGYj1l6qxBkSPEYuxGvqVVf20uJ26XpNnYV/URC7ayt+UdRavUhEwzDboiewq/lCgNFCDBEqd6eeQVEs8w== +jest-jasmine2@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.2.4.tgz#4a1608133dbdb4d68b5929bfd785503ed9c9ba51" + integrity sha512-fcffjO/xLWLVnW2ct3No4EksxM5RyPwHDYu9QU+90cC+/eSMLkFAxS55vkqsxexOO5zSsZ3foVpMQcg/amSeIQ== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^27.2.3" + "@jest/environment" "^27.2.4" "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.2.3" - "@jest/types" "^27.2.3" + "@jest/test-result" "^27.2.4" + "@jest/types" "^27.2.4" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^27.2.3" + expect "^27.2.4" is-generator-fn "^2.0.0" - jest-each "^27.2.3" - jest-matcher-utils "^27.2.3" - jest-message-util "^27.2.3" - jest-runtime "^27.2.3" - jest-snapshot "^27.2.3" - jest-util "^27.2.3" - pretty-format "^27.2.3" + jest-each "^27.2.4" + jest-matcher-utils "^27.2.4" + jest-message-util "^27.2.4" + jest-runtime "^27.2.4" + jest-snapshot "^27.2.4" + jest-util "^27.2.4" + pretty-format "^27.2.4" throat "^6.0.1" -jest-leak-detector@^27.2.3: - version "27.2.3" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.2.3.tgz#6c60a795fe9b07442c604140373571559d4d467d" - integrity sha512-hoV8d7eJvayIaPrISBoLaMN0DE+GRSR2/vbAcOONffO+RYzbuW3klsOievx+pCShYKxSKlhxxO90zWice+LLew== +jest-leak-detector@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.2.4.tgz#9bb7eab26a73bb280e9298be8d80f389288ec8f1" + integrity sha512-SrcHWbe0EHg/bw2uBjVoHacTo5xosl068x2Q0aWsjr2yYuW2XwqrSkZV4lurUop0jhv1709ymG4or+8E4sH27Q== dependencies: jest-get-type "^27.0.6" - pretty-format "^27.2.3" + pretty-format "^27.2.4" -jest-matcher-utils@^27.2.3: - version "27.2.3" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.2.3.tgz#db7f992f3921f5004f4de36aafa0c03f2565122a" - integrity sha512-8n2/iAEOtNoDxVtUuaGtQdbSVYtZn6saT+PyV8UIf9fJErzDdozjB4fUxJm7TX1DzhhoAKFpIFH8UNvG4942PA== +jest-matcher-utils@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.2.4.tgz#008fff018151415ad1b6cfc083fd70fe1e012525" + integrity sha512-nQeLfFAIPPkyhkDfifAPfP/U5wm1x0fLtAzqXZSSKckXDNuk2aaOfQiDYv1Mgf5GY6yOsxfUnvNm3dDjXM+BXw== dependencies: chalk "^4.0.0" - jest-diff "^27.2.3" + jest-diff "^27.2.4" jest-get-type "^27.0.6" - pretty-format "^27.2.3" + pretty-format "^27.2.4" -jest-message-util@^27.2.3: - version "27.2.3" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.2.3.tgz#cd1091a3f0f3ff919756b15cfccc0ba43eeeeff0" - integrity sha512-yjVqTQ2Ds1WCGXsTuW0m1uK8RXOE44SJDw7tWUrhn6ZttWDbPmLhH8npDsGGfAmSayKFSo2C0NX0tP2qblc3Gw== +jest-message-util@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.2.4.tgz#667e8c0f2b973156d1bac7398a7f677705cafaca" + integrity sha512-wbKT/BNGnBVB9nzi+IoaLkXt6fbSvqUxx+IYY66YFh96J3goY33BAaNG3uPqaw/Sh/FR9YpXGVDfd5DJdbh4nA== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^27.2.3" + "@jest/types" "^27.2.4" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.4" micromatch "^4.0.4" - pretty-format "^27.2.3" + pretty-format "^27.2.4" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^27.2.3: - version "27.2.3" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.2.3.tgz#f532d2c8c158e8b899f2a0a5bd3077af37619c29" - integrity sha512-IvgCdUQBU/XDJl9/NLYtKG9o2XlJOQ8hFYDiX7QmNv2195Y1nNGM7hw1H58wT01zz7bohfhJplqwFfULZlrXjg== +jest-mock@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.2.4.tgz#c8f0ef33f73d8ff53e3f60b16d59f1128f4072ae" + integrity sha512-iVRU905rutaAoUcrt5Tm1JoHHWi24YabqEGXjPJI4tAyA6wZ7mzDi3GrZ+M7ebgWBqUkZE93GAx1STk7yCMIQA== dependencies: - "@jest/types" "^27.2.3" + "@jest/types" "^27.2.4" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -2180,72 +2145,72 @@ jest-regex-util@^27.0.6: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.6.tgz#02e112082935ae949ce5d13b2675db3d8c87d9c5" integrity sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ== -jest-resolve-dependencies@^27.2.3: - version "27.2.3" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.2.3.tgz#fcb620684108fe7a099185052434d26f17de98e6" - integrity sha512-H03NyzmKfYHCciaYBJqbJOrWCVCdwdt32xZDPFP5dBbe39wsfz41aOkhw8FUZ6qVYVO6rz0nLZ3G7wgbsQQsYQ== +jest-resolve-dependencies@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.2.4.tgz#20c41cc02b66aa45169b282356ec73b133013089" + integrity sha512-i5s7Uh9B3Q6uwxLpMhNKlgBf6pcemvWaORxsW1zNF/YCY3jd5EftvnGBI+fxVwJ1CBxkVfxqCvm1lpZkbaoGmg== dependencies: - "@jest/types" "^27.2.3" + "@jest/types" "^27.2.4" jest-regex-util "^27.0.6" - jest-snapshot "^27.2.3" + jest-snapshot "^27.2.4" -jest-resolve@^27.2.3: - version "27.2.3" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.2.3.tgz#868911cf705c537f433befcfc65e6ddc70c9d7f9" - integrity sha512-+tbm53gKpwuRsqCV+zhhjq/6NxMs/I9zECEMzu0LtmbYD5Gusj+rU497f6lkl5LG/GndvfTjJlysYrnSCcZUJA== +jest-resolve@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.2.4.tgz#d3b999f073ff84a8ae109ce99ff7f3223048701a" + integrity sha512-IsAO/3+3BZnKjI2I4f3835TBK/90dxR7Otgufn3mnrDFTByOSXclDi3G2XJsawGV4/18IMLARJ+V7Wm7t+J89Q== dependencies: - "@jest/types" "^27.2.3" + "@jest/types" "^27.2.4" chalk "^4.0.0" escalade "^3.1.1" graceful-fs "^4.2.4" - jest-haste-map "^27.2.3" + jest-haste-map "^27.2.4" jest-pnp-resolver "^1.2.2" - jest-util "^27.2.3" - jest-validate "^27.2.3" + jest-util "^27.2.4" + jest-validate "^27.2.4" resolve "^1.20.0" slash "^3.0.0" -jest-runner@^27.2.3: - version "27.2.3" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.2.3.tgz#22f6ef7bd4140fec74cec18eef29c24d07cb6ad5" - integrity sha512-bvGlIh3wR/LGjSHPW/IpQU6K2atO45U5p7UDqWThPKT622Wm/ZJ2DNbgNzb4P9ZO/UxB22jXoKJPsMAdWGEdmA== +jest-runner@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.2.4.tgz#d816f4cb4af04f3cba703afcf5a35a335b77cad4" + integrity sha512-hIo5PPuNUyVDidZS8EetntuuJbQ+4IHWxmHgYZz9FIDbG2wcZjrP6b52uMDjAEQiHAn8yn8ynNe+TL8UuGFYKg== dependencies: - "@jest/console" "^27.2.3" - "@jest/environment" "^27.2.3" - "@jest/test-result" "^27.2.3" - "@jest/transform" "^27.2.3" - "@jest/types" "^27.2.3" + "@jest/console" "^27.2.4" + "@jest/environment" "^27.2.4" + "@jest/test-result" "^27.2.4" + "@jest/transform" "^27.2.4" + "@jest/types" "^27.2.4" "@types/node" "*" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" jest-docblock "^27.0.6" - jest-environment-jsdom "^27.2.3" - jest-environment-node "^27.2.3" - jest-haste-map "^27.2.3" - jest-leak-detector "^27.2.3" - jest-message-util "^27.2.3" - jest-resolve "^27.2.3" - jest-runtime "^27.2.3" - jest-util "^27.2.3" - jest-worker "^27.2.3" + jest-environment-jsdom "^27.2.4" + jest-environment-node "^27.2.4" + jest-haste-map "^27.2.4" + jest-leak-detector "^27.2.4" + jest-message-util "^27.2.4" + jest-resolve "^27.2.4" + jest-runtime "^27.2.4" + jest-util "^27.2.4" + jest-worker "^27.2.4" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.2.3: - version "27.2.3" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.2.3.tgz#e6fc25bbbc63b19fae50c3994060efb1b2922b7e" - integrity sha512-8WPgxENQchmUM0jpDjK1IxacseK9vDDz6T471xs5pNIQrj8typeT0coRigRCb1sPYeXQ66SqVERMgPj6SEeblQ== +jest-runtime@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.2.4.tgz#170044041e5d30625ab8d753516bbe503f213a5c" + integrity sha512-ICKzzYdjIi70P17MZsLLIgIQFCQmIjMFf+xYww3aUySiUA/QBPUTdUqo5B2eg4HOn9/KkUsV0z6GVgaqAPBJvg== dependencies: - "@jest/console" "^27.2.3" - "@jest/environment" "^27.2.3" - "@jest/fake-timers" "^27.2.3" - "@jest/globals" "^27.2.3" + "@jest/console" "^27.2.4" + "@jest/environment" "^27.2.4" + "@jest/fake-timers" "^27.2.4" + "@jest/globals" "^27.2.4" "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.2.3" - "@jest/transform" "^27.2.3" - "@jest/types" "^27.2.3" + "@jest/test-result" "^27.2.4" + "@jest/transform" "^27.2.4" + "@jest/types" "^27.2.4" "@types/yargs" "^16.0.0" chalk "^4.0.0" cjs-module-lexer "^1.0.0" @@ -2254,17 +2219,17 @@ jest-runtime@^27.2.3: exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-haste-map "^27.2.3" - jest-message-util "^27.2.3" - jest-mock "^27.2.3" + jest-haste-map "^27.2.4" + jest-message-util "^27.2.4" + jest-mock "^27.2.4" jest-regex-util "^27.0.6" - jest-resolve "^27.2.3" - jest-snapshot "^27.2.3" - jest-util "^27.2.3" - jest-validate "^27.2.3" + jest-resolve "^27.2.4" + jest-snapshot "^27.2.4" + jest-util "^27.2.4" + jest-validate "^27.2.4" slash "^3.0.0" strip-bom "^4.0.0" - yargs "^16.0.3" + yargs "^16.2.0" jest-serializer@^27.0.6: version "27.0.6" @@ -2274,10 +2239,10 @@ jest-serializer@^27.0.6: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^27.2.3: - version "27.2.3" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.2.3.tgz#e3f39e1708a4d93dfa1297e73b5d2feec44f6d0c" - integrity sha512-NJz+PNvTNTxVfNdLXccKUMeVH5O7jZ+9dNXH5TP2WtkLR+CiPRiPveWDgM8o3aaxB6R0Mm8vsD7ieEkEh6ZBBQ== +jest-snapshot@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.2.4.tgz#277b2269437e3ffcb91d95a73b24becf33c5a871" + integrity sha512-5DFxK31rYS8X8C6WXsFx8XxrxW3PGa6+9IrUcZdTLg1aEyXDGIeiBh4jbwvh655bg/9vTETbEj/njfZicHTZZw== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" @@ -2285,23 +2250,23 @@ jest-snapshot@^27.2.3: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/transform" "^27.2.3" - "@jest/types" "^27.2.3" + "@jest/transform" "^27.2.4" + "@jest/types" "^27.2.4" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.2.3" + expect "^27.2.4" graceful-fs "^4.2.4" - jest-diff "^27.2.3" + jest-diff "^27.2.4" jest-get-type "^27.0.6" - jest-haste-map "^27.2.3" - jest-matcher-utils "^27.2.3" - jest-message-util "^27.2.3" - jest-resolve "^27.2.3" - jest-util "^27.2.3" + jest-haste-map "^27.2.4" + jest-matcher-utils "^27.2.4" + jest-message-util "^27.2.4" + jest-resolve "^27.2.4" + jest-util "^27.2.4" natural-compare "^1.4.0" - pretty-format "^27.2.3" + pretty-format "^27.2.4" semver "^7.3.2" jest-util@^27.0.0: @@ -2316,60 +2281,60 @@ jest-util@^27.0.0: is-ci "^3.0.0" picomatch "^2.2.3" -jest-util@^27.2.3: - version "27.2.3" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.2.3.tgz#f766354b7c489c1f9ea88cd1d96d044fbd2b5d4d" - integrity sha512-78BEka2+77lqD7LN4mSzUdZMngHZtVAsmZ5B8+qOWfN4bCYNUmi/eGNLm91jA77gG1QZJSXsDOCWB0qbXDT1Fw== +jest-util@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.2.4.tgz#3d7ce081b2e7f4cfe0156452ac01f3cb456cc656" + integrity sha512-mW++4u+fSvAt3YBWm5IpbmRAceUqa2B++JlUZTiuEt2AmNYn0Yw5oay4cP17TGsMINRNPSGiJ2zNnX60g+VbFg== dependencies: - "@jest/types" "^27.2.3" + "@jest/types" "^27.2.4" "@types/node" "*" chalk "^4.0.0" graceful-fs "^4.2.4" is-ci "^3.0.0" picomatch "^2.2.3" -jest-validate@^27.2.3: - version "27.2.3" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.2.3.tgz#4fcc49e581f13fbe260a77e711a80f0256138a7a" - integrity sha512-HUfTZ/W87zoxOuEGC01ujXzoLzRpJqvhMdIrRilpXGmso2vJWw3bHpbWKhivYMr0X/BjitLrHywj/+niNfIcEA== +jest-validate@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.2.4.tgz#b66d462b2fb93d7e16a47d1aa8763d5600bf2cfa" + integrity sha512-VMtbxbkd7LHnIH7PChdDtrluCFRJ4b1YV2YJzNwwsASMWftq/HgqiqjvptBOWyWOtevgO3f14wPxkPcLlVBRog== dependencies: - "@jest/types" "^27.2.3" + "@jest/types" "^27.2.4" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^27.0.6" leven "^3.1.0" - pretty-format "^27.2.3" + pretty-format "^27.2.4" -jest-watcher@^27.2.3: - version "27.2.3" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.2.3.tgz#2989228bdd05138094f7ec19a23cbb2665f2efb7" - integrity sha512-SvUmnL/QMb55B6iWJ3Jpq6bG2fSRcrMaGakY60i6j8p9+Ct42mpkq90qaYB+rnSLaiW/QQN+lTJZmK+lA6vksA== +jest-watcher@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.2.4.tgz#b1d5c39ab94f59f4f35f66cc96f7761a10e0cfc4" + integrity sha512-LXC/0+dKxhK7cfF7reflRYlzDIaQE+fL4ynhKhzg8IMILNMuI4xcjXXfUJady7OR4/TZeMg7X8eHx8uan9vqaQ== dependencies: - "@jest/test-result" "^27.2.3" - "@jest/types" "^27.2.3" + "@jest/test-result" "^27.2.4" + "@jest/types" "^27.2.4" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^27.2.3" + jest-util "^27.2.4" string-length "^4.0.1" -jest-worker@^27.2.3: - version "27.2.3" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.2.3.tgz#396e83d04ca575230a9bcb255c2b66aec07cb931" - integrity sha512-ZwOvv4GCIPviL+Ie4pVguz4N5w/6IGbTaHBYOl3ZcsZZktaL7d8JOU0rmovoED7AJZKA8fvmLbBg8yg80u/tGA== +jest-worker@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.2.4.tgz#881455df75e22e7726a53f43703ab74d6b36f82d" + integrity sha512-Zq9A2Pw59KkVjBBKD1i3iE2e22oSjXhUKKuAK1HGX8flGwkm6NMozyEYzKd41hXc64dbd/0eWFeEEuxqXyhM+g== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^27.0.1: - version "27.2.3" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.2.3.tgz#9c2af9ce874a3eb202f83d92fbc1cc61ccc73248" - integrity sha512-r4ggA29J5xUg93DpvbsX+AXlFMWE3hZ5Y6BfgTl8PJvWelVezNPkmrsixuGoDBTHTCwScRSH0O4wsoeUgLie2w== + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.2.4.tgz#70e27bef873138afc123aa4769f7124c50ad3efb" + integrity sha512-h4uqb1EQLfPulWyUFFWv9e9Nn8sCqsJ/j3wk/KCY0p4s4s0ICCfP3iMf6hRf5hEhsDyvyrCgKiZXma63gMz16A== dependencies: - "@jest/core" "^27.2.3" + "@jest/core" "^27.2.4" import-local "^3.0.2" - jest-cli "^27.2.3" + jest-cli "^27.2.4" js-tokens@^4.0.0: version "4.0.0" @@ -2666,11 +2631,6 @@ optionator@^0.9.1: type-check "^0.4.0" word-wrap "^1.2.3" -p-each-series@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-2.2.0.tgz#105ab0357ce72b202a8a8b94933672657b5e2a9a" - integrity sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA== - p-limit@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" @@ -2771,12 +2731,12 @@ pretty-format@^27.0.0, pretty-format@^27.2.0: ansi-styles "^5.0.0" react-is "^17.0.1" -pretty-format@^27.2.3: - version "27.2.3" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.2.3.tgz#c76710de6ebd8b1b412a5668bacf4a6c2f21a029" - integrity sha512-wvg2HzuGKKEE/nKY4VdQ/LM8w8pRZvp0XpqhwgaZBbjTwd5UdF2I4wvwZjyUwu8G+HI6g4t6u9b2FZlKhlzxcQ== +pretty-format@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.2.4.tgz#08ea39c5eab41b082852d7093059a091f6ddc748" + integrity sha512-NUjw22WJHldzxyps2YjLZkUj6q1HvjqFezkB9Y2cklN8NtVZN/kZEXGZdFw4uny3oENzV5EEMESrkI0YDUH8vg== dependencies: - "@jest/types" "^27.2.3" + "@jest/types" "^27.2.4" ansi-regex "^5.0.1" ansi-styles "^5.0.0" react-is "^17.0.1" @@ -3367,7 +3327,7 @@ yargs-parser@20.x, yargs-parser@^20.2.2: resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== -yargs@^16.0.3: +yargs@^16.2.0: version "16.2.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== From 3f8e3ff1a0cc994af00b2a7055a07554b1aa8299 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 30 Sep 2021 11:54:11 -0400 Subject: [PATCH 307/785] Fix for #943 --- CHANGELOG.md | 1 + src/ruby/nodes/calls.ts | 76 +++++++++++++++++++++++++------- test/js/ruby/nodes/calls.test.ts | 43 ++++++++++++++++++ 3 files changed, 103 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d8d6cd9..ee9b0543 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#929](https://github.com/prettier/plugin-ruby/issues/929) - ryanb, kddnewton - Deeply nested blocks should not break their call chains. - [#935](https://github.com/prettier/plugin-ruby/pull/935) - nbudin, mlauter - Ensure embedded formatting heredocs are properly indented. - [#975](https://github.com/prettier/plugin-ruby/pull/975) - kddnewton - Refactor the way we determine how to connect to the parser server. +- [#943](https://github.com/prettier/plugin-ruby/issues/943) - valscion, kddnewton - Trailing call operators that are followed by comments should stay on the first line. ### Removed diff --git a/src/ruby/nodes/calls.ts b/src/ruby/nodes/calls.ts index 2db30a65..51502e01 100644 --- a/src/ruby/nodes/calls.ts +++ b/src/ruby/nodes/calls.ts @@ -4,9 +4,12 @@ import { makeCall, noIndent } from "../../utils"; import toProc from "../toProc"; const { group, hardline, ifBreak, indent, join, softline } = prettier; - const chained = ["call", "method_add_arg", "method_add_block"]; +function hasLeadingComments(node: Ruby.AnyNode) { + return node.comments?.some(({ leading }) => leading); +} + // We decorate these nodes with a bunch of extra stuff so that we can display // nice method chains. type Chain = { @@ -32,30 +35,46 @@ export const printCall: Plugin.Printer = (path, opts, print) => { // call syntax so if `call` is implicit, we don't print it out. const messageDoc = messageNode === "call" ? "" : path.call(print, "body", 2); + // Create some arrays that are going to represent each side of our call. + let leftSideDoc = [receiverDoc]; + let rightSideDoc = [operatorDoc, messageDoc]; + + // If there are leading comments on the right side of the call, then it means + // we have a structure where there's a receiver and an operator together, then + // a comment, then the message, as in: + // + // foo. + // # comment + // baz + // + // In the case we need to group the receiver and the operator together or + // we'll end up with a syntax error. + const operatorIsTrailing = + messageNode !== "call" && hasLeadingComments(messageNode); + + if (operatorIsTrailing) { + leftSideDoc = [receiverDoc, operatorDoc]; + rightSideDoc = [messageDoc]; + } + // For certain left sides of the call nodes, we want to attach directly to // the } or end. if (noIndent.includes(receiverNode.type)) { - return [receiverDoc, operatorDoc, messageDoc]; + return [leftSideDoc, rightSideDoc]; } - // The right side of the call node, as in everything including the operator - // and beyond. - let rightSideDoc = [ - receiverNode.comments ? hardline : softline, - operatorDoc, - messageDoc - ]; - - // This is very specialized behavior wherein we group .where.not calls - // together because it looks better. For more information, see - // https://github.com/prettier/plugin-ruby/issues/862. if ( receiverNode.type === "call" && receiverNode.body[2] !== "call" && receiverNode.body[2].body === "where" && messageDoc === "not" ) { - rightSideDoc = [operatorDoc, messageDoc]; + // This is very specialized behavior wherein we group .where.not calls + // together because it looks better. For more information, see + // https://github.com/prettier/plugin-ruby/issues/862. + } else { + // Otherwise, we're going to put a line node into the right side doc. + rightSideDoc.unshift(receiverNode.comments ? hardline : softline); } // Get a reference to the parent node so we can check if we're inside a chain @@ -66,8 +85,31 @@ export const printCall: Plugin.Printer = (path, opts, print) => { if (chained.includes(parentNode.type) && !node.comments) { parentNode.chain = (node.chain || 0) + 1; parentNode.callChain = (node.callChain || 0) + 1; - parentNode.breakDoc = (node.breakDoc || [receiverDoc]).concat(rightSideDoc); parentNode.firstReceiverType = node.firstReceiverType || receiverNode.type; + + // Here we're going to determine what doc nodes to send up to the parent + // node to represent when we're in the multi-line form. + let breakDocLHS: Plugin.Doc[]; + + if (node.breakDoc && operatorIsTrailing) { + // Here we already have a child node that has passed up its + // representation. In this case node.breakDoc represents the receiver + // without any lines inserted. With regard to this node, it means it's + // everything up until the operator. So we're just going to append the + // operator. + breakDocLHS = node.breakDoc.concat(operatorDoc); + } else if (node.breakDoc) { + // Here we don't need a trailing operator, so we're just going to use the + // existing node.breakDoc. The operator will be a part of the rightSideDoc + // variable. + breakDocLHS = node.breakDoc; + } else { + // Here we're at the bottom of the chain, so there's no representation yet + // for the receiver. So we're just going to pass up the left side. + breakDocLHS = leftSideDoc; + } + + parentNode.breakDoc = breakDocLHS.concat(rightSideDoc); } // If we're at the top of a chain, then we're going to print out a nice @@ -78,12 +120,12 @@ export const printCall: Plugin.Printer = (path, opts, print) => { node.breakDoc ) { return ifBreak(group(indent(node.breakDoc.concat(rightSideDoc))), [ - receiverDoc, + leftSideDoc, group(rightSideDoc) ]); } - return group([receiverDoc, group(indent(rightSideDoc))]); + return group([leftSideDoc, group(indent(rightSideDoc))]); }; export const printMethodAddArg: Plugin.Printer = ( diff --git a/test/js/ruby/nodes/calls.test.ts b/test/js/ruby/nodes/calls.test.ts index 3dc60e1a..33c936ca 100644 --- a/test/js/ruby/nodes/calls.test.ts +++ b/test/js/ruby/nodes/calls.test.ts @@ -160,4 +160,47 @@ describe("calls", () => { expect(content).toMatchFormat(); }); + + test("comments in a method chain get printed correctly", () => { + // https://github.com/prettier/plugin-ruby/issues/943 + const content = ruby(` + Organization.includes( + :users, + :venues + ) + .where(id: org_ids) + .flatten. + # first remove rows with duplicate names + uniq { |contact| "#{contact[:first_name]}#{contact[:last_name]}#{contact[:org_name]}" }. + # then remove remaining rows with duplicate emails + uniq { |contact| contact[:email] } + .tap { |res| + CSV.open(OUTPUT_PATH, "wb") { |csv| + csv << HEADERS + res.each { |d| csv << d.values } + } + } + `); + + const expected = ruby(` + Organization + .includes(:users, :venues) + .where(id: org_ids) + .flatten. + # first remove rows with duplicate names + uniq do |contact| + "#{contact[:first_name]}#{contact[:last_name]}#{contact[:org_name]}" + end. + # then remove remaining rows with duplicate emails + uniq { |contact| contact[:email] } + .tap do |res| + CSV.open(OUTPUT_PATH, 'wb') do |csv| + csv << HEADERS + res.each { |d| csv << d.values } + end + end + `); + + expect(content).toChangeFormat(expected); + }); }); From 9d7398fba1368ad95c1fc8abdd70a251a2b34925 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 30 Sep 2021 11:57:05 -0400 Subject: [PATCH 308/785] Fix for #979 --- CHANGELOG.md | 1 + src/ruby/nodes/commands.ts | 6 +++--- test/js/ruby/nodes/method.test.ts | 10 ++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d8d6cd9..3e9f9d94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Added - [#949](https://github.com/prettier/plugin-ruby/pull/949) - kddnewton - Converted over to using TypeScript for development. +- [#979](https://github.com/prettier/plugin-ruby/issues/979) - ronocod, kddnewton - Alignment of `to_not` is explicitly allowed to not indent to better support rspec. ### Changed diff --git a/src/ruby/nodes/commands.ts b/src/ruby/nodes/commands.ts index 787d9add..0710f50d 100644 --- a/src/ruby/nodes/commands.ts +++ b/src/ruby/nodes/commands.ts @@ -67,8 +67,8 @@ function hasDef(node: Ruby.Command) { // // In this case the arguments are aligned to the left side as opposed to being // aligned with the `receive` call. -function skipArgsAlign(path: Plugin.Path) { - return ["to", "not_to"].includes(path.getValue().body[2].body); +function skipArgsAlign(node: Ruby.CommandCall) { + return ["to", "not_to", "to_not"].includes(node.body[2].body); } // If there is a ternary argument to a command and it's going to get broken @@ -136,7 +136,7 @@ export const printCommandCall: Plugin.Printer = ( if (hasTernaryArg(node.body[3])) { breakDoc = parts.concat("(", indent([softline, argDocs]), softline, ")"); parts.push(" "); - } else if (skipArgsAlign(path)) { + } else if (skipArgsAlign(node)) { parts.push(" "); breakDoc = parts.concat(argDocs); } else { diff --git a/test/js/ruby/nodes/method.test.ts b/test/js/ruby/nodes/method.test.ts index 5c95db44..15b63195 100644 --- a/test/js/ruby/nodes/method.test.ts +++ b/test/js/ruby/nodes/method.test.ts @@ -234,6 +234,16 @@ describe("method", () => { expect(content).toMatchFormat(); }); + test("alignment for `to_not`", () => { + const content = ruby(` + expect(value).to_not matcher( + ${long} + ) + `); + + expect(content).toMatchFormat(); + }); + test("just block", () => { const content = ruby(` def curry(&block) From 08bd9b25dd986a2cffb35e8937f9e40174b06f62 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 30 Sep 2021 13:40:10 -0400 Subject: [PATCH 309/785] Warn about plug-n-play --- CHANGELOG.md | 1 + src/parser/parseSync.ts | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b309b2c..25e0bd98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#949](https://github.com/prettier/plugin-ruby/pull/949) - kddnewton - Converted over to using TypeScript for development. - [#979](https://github.com/prettier/plugin-ruby/issues/979) - ronocod, kddnewton - Alignment of `to_not` is explicitly allowed to not indent to better support rspec. +- [#894](https://github.com/prettier/plugin-ruby/issues/894) - mister-what, kddnewton - Add a warning that this plugin will not function with the plug'n'play filesystem provided by yarn berry. ### Changed diff --git a/src/parser/parseSync.ts b/src/parser/parseSync.ts index b9e1978f..ab08c29c 100644 --- a/src/parser/parseSync.ts +++ b/src/parser/parseSync.ts @@ -104,6 +104,20 @@ function spawnServer(): ParserArgs { return { cmd, args }; } +// If we're in a yarn Plug'n'Play environment, then the relative paths being +// used by the parser server and the various scripts used to communicate +// therein are not going to work with its virtual file system. Presumably +// there's a way to fix this but I haven't figured out how yet. +function checkPnP() { + if (process.versions.pnp) { + throw new Error(` + @prettier/plugin-ruby does not current work within the yarn Plug'n'Play + virtual file system. If you would like to help support the effort to fix + this, please see https://github.com/prettier/plugin-ruby/issues/894. + `); + } +} + // You can optionally return location information from the source string when // raising an error that prettier will handle for you nicely. type LocatedError = Error & { loc?: any }; @@ -114,6 +128,7 @@ type LocatedError = Error & { loc?: any }; // requests. function parseSync(parser: string, source: string) { if (!parserArgs) { + checkPnP(); parserArgs = spawnServer(); } From b84445ea1f1531492ffbf8e27cd94369f31ec78e Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 30 Sep 2021 14:00:49 -0400 Subject: [PATCH 310/785] Bump version to 2.0.0 pre-release 2 --- CHANGELOG.md | 17 +++++++++++++---- package.json | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25e0bd98..2d7a7e4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,16 +6,25 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] -## [2.0.0-rc1] +## [2.0.0-rc2] ### Added -- [#949](https://github.com/prettier/plugin-ruby/pull/949) - kddnewton - Converted over to using TypeScript for development. - [#979](https://github.com/prettier/plugin-ruby/issues/979) - ronocod, kddnewton - Alignment of `to_not` is explicitly allowed to not indent to better support rspec. - [#894](https://github.com/prettier/plugin-ruby/issues/894) - mister-what, kddnewton - Add a warning that this plugin will not function with the plug'n'play filesystem provided by yarn berry. ### Changed +- [#943](https://github.com/prettier/plugin-ruby/issues/943) - valscion, kddnewton - Trailing call operators that are followed by comments should stay on the first line. + +## [2.0.0-rc1] + +### Added + +- [#949](https://github.com/prettier/plugin-ruby/pull/949) - kddnewton - Converted over to using TypeScript for development. + +### Changed + - [#958](https://github.com/prettier/plugin-ruby/issues/958) - mharris-figma, kddnewton - Handle optional `do` keyword in `for` loop expressions. - [#926](https://github.com/prettier/plugin-ruby/issues/926) - jscheid, kddnewton - Better error handling in case certain expected keywords or operators are missing. - [#819](https://github.com/prettier/plugin-ruby/issues/819) - coisnepe, kddnewton - Ensure that comments placed immediately after the left parenthesis of a method definition are not moved into the body of the methods. @@ -25,7 +34,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#929](https://github.com/prettier/plugin-ruby/issues/929) - ryanb, kddnewton - Deeply nested blocks should not break their call chains. - [#935](https://github.com/prettier/plugin-ruby/pull/935) - nbudin, mlauter - Ensure embedded formatting heredocs are properly indented. - [#975](https://github.com/prettier/plugin-ruby/pull/975) - kddnewton - Refactor the way we determine how to connect to the parser server. -- [#943](https://github.com/prettier/plugin-ruby/issues/943) - valscion, kddnewton - Trailing call operators that are followed by comments should stay on the first line. ### Removed @@ -1154,7 +1162,8 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v2.0.0-rc1...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v2.0.0-rc2...HEAD +[2.0.0-rc2]: https://github.com/prettier/plugin-ruby/compare/v2.0.0-rc1...v2.0.0-rc2 [2.0.0-rc1]: https://github.com/prettier/plugin-ruby/compare/v1.6.1...v2.0.0-rc1 [1.6.1]: https://github.com/prettier/plugin-ruby/compare/v1.6.0...v1.6.1 [1.6.0]: https://github.com/prettier/plugin-ruby/compare/v1.5.5...v1.6.0 diff --git a/package.json b/package.json index 562c9359..02d7afa5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "2.0.0-rc1", + "version": "2.0.0-rc2", "description": "prettier plugin for the Ruby programming language", "main": "dist/plugin.js", "scripts": { From 350f3c903acf306c13fc71122772a058f07600a5 Mon Sep 17 00:00:00 2001 From: Vesa Laakso <482561+valscion@users.noreply.github.com> Date: Fri, 1 Oct 2021 09:37:27 +0300 Subject: [PATCH 311/785] Throw away stderr when testing candidate connection methods This mirrors the way the plugin worked in v1.x where it also ignored stderr when doing this check on the Node side. --- src/parser/server.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/parser/server.rb b/src/parser/server.rb index d60f48ab..8835437d 100644 --- a/src/parser/server.rb +++ b/src/parser/server.rb @@ -112,8 +112,9 @@ Thread.new do Thread.current.report_on_exception = false - stdout, status = - Open3.capture2("#{candidate} #{information}", stdin_data: 'ping') + # We do not care about stderr here, so throw it away + stdout, _stderr, status = + Open3.capture3("#{candidate} #{information}", stdin_data: 'ping') candidate if JSON.parse(stdout) == 'pong' && status.exitstatus == 0 rescue StandardError From 99722ee2e931a020ec2d3f302d7f0a6599eebd44 Mon Sep 17 00:00:00 2001 From: Vesa Laakso <482561+valscion@users.noreply.github.com> Date: Fri, 1 Oct 2021 09:53:17 +0300 Subject: [PATCH 312/785] Add changelog entry --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d7a7e4c..c155c6f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Changed + +- [#987](https://github.com/prettier/plugin-ruby/pull/9870) - valscion - Ignore stderr when checking for node <-> ruby connection clients, restoring the behavior of v1.x + ## [2.0.0-rc2] ### Added From cae5373519cd49bbe4d49735171bd1dd4b9bcd7b Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 1 Oct 2021 10:44:58 -0400 Subject: [PATCH 313/785] Remove magic comment handling It's firing for all kinds of stuff and it's really not that big of a net benefit as it gets handled by comments anyway. So just turning it off for now. This should fix #983, #984, and #988. --- src/ruby/parser.rb | 42 ++++++------------------------------------ 1 file changed, 6 insertions(+), 36 deletions(-) diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index cb5afbf5..f03f5418 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -136,12 +136,6 @@ def initialize(source, *args) # keyword. @__end__ = nil - # Magic comments are a certain kind of comment that can impact the way the - # file is parsed (encoding/string frozen default/etc.). These scanner events - # are immediately followed by a comment scanner event, so we only need the - # one variable to set/unset it immediately. - @magic_comment = nil - # Heredocs can actually be nested together if you're using interpolation, so # this is a stack of heredoc nodes that are currently being created. When we # get to the scanner event that finishes off a heredoc node, we pop the top @@ -970,22 +964,6 @@ def on_comment(value) start_line = lineno start_char = char_pos - # If we already had special handling of a magic comment, then we can just - # skip and return the value of that node. - if @magic_comment - comment = @magic_comment - @magic_comment = nil - - # At the moment, merging in the value of the string being passed into - # here. In the next major version I'd like to remove this and just use the - # value of the magic comment. At the moment though that would change - # comments like -*- encoding: UTF-8 -*- into encoding: UTF-8 so need to - - # wait for a major version to do that. - @comments << comment.merge(value: body, ec: start_char + value.length - 1) - return comment - end - @comments << { type: :@comment, value: body, @@ -2012,20 +1990,12 @@ def on_lparen(value) # magic_comment is a scanner event that represents the use of a pragma at the # beginning of the file. Usually it will inside something like # frozen_string_literal (the key) with a value of true (the value). Both - # children come is a string literals. - def on_magic_comment(key, value) - start_line = lineno - start_char = char_pos - - @magic_comment = { - type: :@comment, - value: " #{key}: #{value}", - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + @line_counts[start_line][-1] - } - end + # children come is a string literals. We're going to leave these alone as they + # come in all kinds of shapes and sizes. + # + # def on_magic_comment(key, value) + # @magic_comment = { value: " #{key}: #{value}" } + # end # massign is a parser event that is a parent node of any kind of multiple # assignment. This includes splitting out variables on the left like: From 3284ee7583c79524fc7dd72a51044537767419c8 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 1 Oct 2021 11:25:57 -0400 Subject: [PATCH 314/785] Fix for #989 --- CHANGELOG.md | 1 + src/ruby/nodes/blocks.ts | 41 +++++++++++++++++++++++++++---- src/ruby/parser.rb | 12 +++++++-- src/ruby/printer.ts | 4 +++ src/types/ruby.ts | 4 +-- test/js/ruby/nodes/blocks.test.ts | 11 +++++++++ 6 files changed, 64 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c155c6f3..0d7d5f2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Changed - [#987](https://github.com/prettier/plugin-ruby/pull/9870) - valscion - Ignore stderr when checking for node <-> ruby connection clients, restoring the behavior of v1.x +- [#989](https://github.com/prettier/plugin-ruby/issues/989) - hubertjakubiak, kddnewton - Make sure comments after the keyword/lbrace are not moved inside the body of the statements of do and brace blocks. ## [2.0.0-rc2] diff --git a/src/ruby/nodes/blocks.ts b/src/ruby/nodes/blocks.ts index 9edec7e1..9a3f315c 100644 --- a/src/ruby/nodes/blocks.ts +++ b/src/ruby/nodes/blocks.ts @@ -21,9 +21,32 @@ export const printBlockVar: Plugin.Printer = ( return parts; }; -function printBlock( - braces: boolean -): Plugin.Printer { +// You have to go through the main print function if you could potentially have +// comments attached. So we're doing this weird reflection on the printed docs +// to retroactively change the printed keyword depending on if we're using +// braces or not. Ideally we wouldn't do this, we would instead do this +// reflection in the child printer, but this keeps the logic to just this file +// and contains it, so keeping it here for now. +function printBlockBeging( + path: Plugin.Path, + print: Plugin.Print, + useBraces: boolean +) { + let docs = print(path); + const doc = useBraces ? "{" : "do"; + + if (Array.isArray(docs)) { + docs[1] = doc; + } else { + docs = doc; + } + + return docs; +} + +type Block = Ruby.BraceBlock | Ruby.DoBlock; + +function printBlock(braces: boolean): Plugin.Printer { return function printBlockWithBraces(path, opts, print) { const [variables, statements] = path.getValue().body; const stmts = @@ -46,7 +69,11 @@ function printBlock( const useBraces = braces && hasAncestor(path, ["command", "command_call"]); const doBlock = [ - useBraces ? " {" : " do", + " ", + path.call( + (begingPath) => printBlockBeging(begingPath, print, useBraces), + "beging" + ), variables ? [" ", path.call(print, "body", 0)] : "", doBlockBody, [softline, useBraces ? "}" : "end"] @@ -72,7 +99,11 @@ function printBlock( const hasBody = stmts.some(({ type }) => type !== "void_stmt"); const braceBlock = [ - " {", + " ", + path.call( + (begingPath) => printBlockBeging(begingPath, print, true), + "beging" + ), hasBody || variables ? " " : "", variables ? path.call(print, "body", 0) : "", path.call(print, "body", 1), diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index f03f5418..691998e9 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -793,11 +793,15 @@ def on_brace_block(block_var, stmts) beging = find_scanner_event(:@lbrace) ending = find_scanner_event(:@rbrace) - stmts.bind((block_var || beging)[:ec], ending[:sc]) + stmts.bind( + find_next_statement_start((block_var || beging)[:ec]), + ending[:sc] + ) { type: :brace_block, body: [block_var, stmts], + beging: beging, sl: beging[:sl], sc: beging[:sc], el: [ending[:el], stmts[:el]].max, @@ -1186,11 +1190,15 @@ def on_do_block(block_var, bodystmt) beging = find_scanner_event(:@kw, 'do') ending = find_scanner_event(:@kw, 'end') - bodystmt.bind((block_var || beging)[:ec], ending[:sc]) + bodystmt.bind( + find_next_statement_start((block_var || beging)[:ec]), + ending[:sc] + ) { type: :do_block, body: [block_var, bodystmt], + beging: beging, sl: beging[:sl], sc: beging[:sc], el: ending[:el], diff --git a/src/ruby/printer.ts b/src/ruby/printer.ts index d88ec3e2..1635dbe8 100644 --- a/src/ruby/printer.ts +++ b/src/ruby/printer.ts @@ -77,6 +77,10 @@ const printer: Plugin.PrinterConfig = { return parts; } + case "brace_block": + return [node.body[0], node.body[1], node.beging]; + case "do_block": + return [node.body[0], node.body[1], node.beging]; case "paren": return [node.lparen, node.body[0]]; default: { diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 7dfec51d..e545494e 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -184,11 +184,11 @@ export type Args = ParserEvent<"args", { body: AnyNode[] }>; export type ArgsAddBlock = ParserEvent<"args_add_block", { body: [Args | ArgsAddStar, false | AnyNode] }>; export type ArgsAddStar = ParserEvent<"args_add_star", { body: [Args | ArgsAddStar, ...AnyNode[]] }>; export type BlockVar = ParserEvent<"block_var", { body: [Params, false | Identifier[]] }>; -export type BraceBlock = ParserEvent<"brace_block", { body: [null | BlockVar, Stmts] }>; +export type BraceBlock = ParserEvent<"brace_block", { body: [null | BlockVar, Stmts], beging: Lbrace }>; export type Call = ParserEvent<"call", { body: [AnyNode, CallOperator, Backtick | Op | Identifier | Const | "call"] }>; export type Command = ParserEvent<"command", { body: [Const | Identifier, Args | ArgsAddBlock] }>; export type CommandCall = ParserEvent<"command_call", { body: [AnyNode, CallOperator, Op | Identifier | Const, Args | ArgsAddBlock] }>; -export type DoBlock = ParserEvent<"do_block", { body: [null | BlockVar, Bodystmt] }>; +export type DoBlock = ParserEvent<"do_block", { body: [null | BlockVar, Bodystmt], beging: Keyword }>; export type Fcall = ParserEvent<"fcall", { body: [Const | Identifier] }>; export type MethodAddArg = ParserEvent<"method_add_arg", { body: [Call | Fcall, Args | ArgParen | ArgsAddBlock] }>; export type MethodAddBlock = ParserEvent<"method_add_block", { body: [AnyNode, BraceBlock | DoBlock] }>; diff --git a/test/js/ruby/nodes/blocks.test.ts b/test/js/ruby/nodes/blocks.test.ts index 0d56f211..443464c0 100644 --- a/test/js/ruby/nodes/blocks.test.ts +++ b/test/js/ruby/nodes/blocks.test.ts @@ -180,4 +180,15 @@ describe("blocks", () => { expect(`loop do |${long} = 1, a${long} = 2|\nend`).toMatchFormat(); }); }); + + // https://github.com/prettier/plugin-ruby/issues/989 + test("comments on a do block", () => { + const content = ruby(` + RSpec.describe Api::V2::OAuth::TokensController, type: :api do # rubocop:disable RSpec/FilePath + foo + end + `); + + expect(content).toMatchFormat(); + }); }); From d1cb0ec695bff0c0b9e299c354c0d674ca89f17d Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 1 Oct 2021 11:31:41 -0400 Subject: [PATCH 315/785] Increment to 3rd release candidate --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d7d5f2d..33cd0d45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [2.0.0-rc3] + ### Changed - [#987](https://github.com/prettier/plugin-ruby/pull/9870) - valscion - Ignore stderr when checking for node <-> ruby connection clients, restoring the behavior of v1.x @@ -1167,7 +1169,8 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v2.0.0-rc2...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v2.0.0-rc3...HEAD +[2.0.0-rc3]: https://github.com/prettier/plugin-ruby/compare/v2.0.0-rc2...v2.0.0-rc3 [2.0.0-rc2]: https://github.com/prettier/plugin-ruby/compare/v2.0.0-rc1...v2.0.0-rc2 [2.0.0-rc1]: https://github.com/prettier/plugin-ruby/compare/v1.6.1...v2.0.0-rc1 [1.6.1]: https://github.com/prettier/plugin-ruby/compare/v1.6.0...v1.6.1 diff --git a/package.json b/package.json index 02d7afa5..424eec30 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "2.0.0-rc2", + "version": "2.0.0-rc3", "description": "prettier plugin for the Ruby programming language", "main": "dist/plugin.js", "scripts": { From f3885c63fbda8b2cdcfa29ef9feaa0279373e040 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 1 Oct 2021 14:07:02 -0400 Subject: [PATCH 316/785] Nicer error message if you do not have the necessary JavaScript files --- exe/rbprettier | 3 +-- lib/prettier.rb | 37 ++++++++++++++++++++++++++++++++----- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/exe/rbprettier b/exe/rbprettier index a5b550e0..3f3ba279 100755 --- a/exe/rbprettier +++ b/exe/rbprettier @@ -4,5 +4,4 @@ $:.unshift(File.expand_path(File.join('..', 'lib'), __dir__)) require 'prettier' -Prettier.run(ARGV) -exit($?.exitstatus) if $?.exited? +exit(Prettier.run(ARGV)) diff --git a/lib/prettier.rb b/lib/prettier.rb index 11ffc6d3..1d64f8ca 100644 --- a/lib/prettier.rb +++ b/lib/prettier.rb @@ -1,18 +1,45 @@ # frozen_string_literal: true require 'json' unless defined?(JSON) +require 'open3' module Prettier PLUGIN = -File.expand_path('..', __dir__) BINARY = -File.join(PLUGIN, 'node_modules', 'prettier', 'bin-prettier.js') VERSION = -JSON.parse(File.read(File.join(PLUGIN, 'package.json')))['version'] - class << self - def run(args) - quoted = args.map { |arg| arg.start_with?('-') ? arg : "\"#{arg}\"" } - command = "node #{BINARY} --plugin \"#{PLUGIN}\" #{quoted.join(' ')}" + def self.run(args) + quoted = args.map { |arg| arg.start_with?('-') ? arg : "\"#{arg}\"" } + command = "node #{BINARY} --plugin \"#{PLUGIN}\" #{quoted.join(' ')}" - system({ 'RBPRETTIER' => '1' }, command) + stdout, stderr, status = Open3.capture3({ 'RBPRETTIER' => '1' }, command) + STDOUT.puts(stdout) + + # If we completed successfully, then just exit out. + exitstatus = status.exitstatus + return exitstatus if exitstatus == 0 + + if stderr.match?(%r{Cannot find module '/.+?/bin-prettier.js'}) + # If we're missing bin-prettier.js, then it's possible the user installed + # the gem through git, which wouldn't have installed the requisite + # JavaScript files. + STDERR.puts(<<~MSG) + Could not find the JavaScript files necessary to run prettier. + + If you installed this dependency through git instead of from rubygems, + it does not install the necessary files by default. To fix this you can + either install them yourself by cd-ing into the directory where this gem + is located (#{File.expand_path('..', __dir__)}) and + running `yarn` or `npm install`, or you can change the source in your + Gemfile to point directly to rubygems. + MSG + else + # Otherwise, just print out the same error that prettier emitted, as it's + # unknown to us. + STDERR.puts(stderr) end + + # Make sure we still exit with the same status code the prettier emitted. + exitstatus end end From 87de527b99f74b92c32ccdb5b520bfd1ade7c32e Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 1 Oct 2021 14:08:03 -0400 Subject: [PATCH 317/785] Update CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 33cd0d45..3320be90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Added + +- [#993](https://github.com/prettier/plugin-ruby/pull/993) - kddnewton - Nicer error message if you don't have the necessary JavaScript files to run prettier. + ## [2.0.0-rc3] ### Changed From 53dbf6e147942d4a6a7e449290b0c729dc334b99 Mon Sep 17 00:00:00 2001 From: Nat Budin Date: Sun, 3 Oct 2021 10:03:32 -0700 Subject: [PATCH 318/785] Allow running @prettier/plugin-ruby unplugged --- src/parser/parseSync.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/parser/parseSync.ts b/src/parser/parseSync.ts index ab08c29c..6874810d 100644 --- a/src/parser/parseSync.ts +++ b/src/parser/parseSync.ts @@ -109,11 +109,14 @@ function spawnServer(): ParserArgs { // therein are not going to work with its virtual file system. Presumably // there's a way to fix this but I haven't figured out how yet. function checkPnP() { - if (process.versions.pnp) { + if (process.versions.pnp && __dirname.includes(".zip")) { throw new Error(` @prettier/plugin-ruby does not current work within the yarn Plug'n'Play virtual file system. If you would like to help support the effort to fix this, please see https://github.com/prettier/plugin-ruby/issues/894. + + If you want to use @prettier/plugin-ruby in a PnP environment before + this issue is fixed, please run \`yarn unplug @prettier/plugin-ruby\`. `); } } From a07784f6b9cae7d5fe259a35a870465e81017de8 Mon Sep 17 00:00:00 2001 From: Nat Budin Date: Sun, 3 Oct 2021 11:22:55 -0700 Subject: [PATCH 319/785] Run all external processes from temp files --- src/parser/parseSync.ts | 105 +++++++++++++++++++++++++++++----------- 1 file changed, 77 insertions(+), 28 deletions(-) diff --git a/src/parser/parseSync.ts b/src/parser/parseSync.ts index 6874810d..388b7313 100644 --- a/src/parser/parseSync.ts +++ b/src/parser/parseSync.ts @@ -1,5 +1,12 @@ import { spawn, spawnSync } from "child_process"; -import { existsSync, unlinkSync } from "fs"; +import { + existsSync, + unlinkSync, + mkdtempSync, + copyFileSync, + mkdirSync, + rmdirSync +} from "fs"; import os from "os"; import path from "path"; import process from "process"; @@ -58,16 +65,68 @@ export function getInfoFilepath() { // will read that information in order to enable us to connect to it in the // spawnSync function. function spawnServer(): ParserArgs { + const tempDir = mkdtempSync(path.join(os.tmpdir(), "prettier-plugin-ruby-")); const filepath = getInfoFilepath(); - const server = spawn( - "ruby", - [path.join(__dirname, "./server.rb"), filepath], - { - env: Object.assign({}, process.env, { LANG: getLang() }), - detached: true, - stdio: "inherit" - } - ); + + let serverRbPath = path.join(__dirname, "./server.rb"); + let getInfoJsPath = path.join(__dirname, "./getInfo.js"); + let cleanupTempFiles: () => void | undefined; + + if (runningInPnPZip()) { + // If we're running in a Yarn PnP environment inside a ZIP file, it's not possible to run + // the Ruby server or the getInfo.js script directly. Instead, we need to copy them and all + // the files they depend on to a temporary directory. + + const sourceFiles = [ + "parser/server.rb", + "parser/getInfo.js", + "parser/netcat.js", + "ruby/parser.rb", + "rbs/parser.rb", + "haml/parser.rb" + ]; + serverRbPath = path.join(tempDir, "parser", "server.rb"); + getInfoJsPath = path.join(tempDir, "parser", "getInfo.js"); + + sourceFiles.forEach((rubyFile) => { + const destDir = path.join(tempDir, path.dirname(rubyFile)); + if (!existsSync(destDir)) { + mkdirSync(destDir); + } + copyFileSync( + path.join(__dirname, "..", rubyFile), + path.join(tempDir, rubyFile) + ); + }); + + cleanupTempFiles = () => { + [ + getInfoJsPath, + ...sourceFiles.map((rubyFile) => path.join(tempDir, rubyFile)) + ].forEach((tmpFilePath) => { + if (existsSync(tmpFilePath)) { + unlinkSync(tmpFilePath); + } + }); + + sourceFiles.forEach((rubyFile) => { + const tempSubdir = path.join(tempDir, path.dirname(rubyFile)); + if (existsSync(tempSubdir)) { + rmdirSync(tempSubdir); + } + }); + + if (existsSync(tempDir)) { + rmdirSync(tempDir); + } + }; + } + + const server = spawn("ruby", [serverRbPath, filepath], { + env: Object.assign({}, process.env, { LANG: getLang() }), + detached: true, + stdio: "inherit" + }); server.unref(); process.on("exit", () => { @@ -75,6 +134,10 @@ function spawnServer(): ParserArgs { unlinkSync(filepath); } + if (cleanupTempFiles != null) { + cleanupTempFiles(); + } + try { if (server.pid) { process.kill(-server.pid); @@ -86,10 +149,7 @@ function spawnServer(): ParserArgs { } }); - const info = spawnSync("node", [ - path.join(__dirname, "./getInfo.js"), - filepath - ]); + const info = spawnSync("node", [getInfoJsPath, filepath]); if (info.status !== 0) { throw new Error(` @@ -106,19 +166,9 @@ function spawnServer(): ParserArgs { // If we're in a yarn Plug'n'Play environment, then the relative paths being // used by the parser server and the various scripts used to communicate -// therein are not going to work with its virtual file system. Presumably -// there's a way to fix this but I haven't figured out how yet. -function checkPnP() { - if (process.versions.pnp && __dirname.includes(".zip")) { - throw new Error(` - @prettier/plugin-ruby does not current work within the yarn Plug'n'Play - virtual file system. If you would like to help support the effort to fix - this, please see https://github.com/prettier/plugin-ruby/issues/894. - - If you want to use @prettier/plugin-ruby in a PnP environment before - this issue is fixed, please run \`yarn unplug @prettier/plugin-ruby\`. - `); - } +// therein are not going to work with its virtual file system. +function runningInPnPZip() { + return process.versions.pnp && __dirname.includes(".zip"); } // You can optionally return location information from the source string when @@ -131,7 +181,6 @@ type LocatedError = Error & { loc?: any }; // requests. function parseSync(parser: string, source: string) { if (!parserArgs) { - checkPnP(); parserArgs = spawnServer(); } From aacd5359a979b0605ea7d9c075b9a3f615af6ffc Mon Sep 17 00:00:00 2001 From: Nat Budin Date: Mon, 4 Oct 2021 08:24:58 -0700 Subject: [PATCH 320/785] Try adding a smoke test for Yarn PnP behavior --- .github/workflows/main.yml | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d93e6fb6..0ea68452 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -54,6 +54,50 @@ jobs: - run: yarn checkFormat - run: yarn lint + smoketest: + name: Yarn PnP smoke test + strategy: + fail-fast: false + matrix: + platform: + - macos-latest + - ubuntu-latest + - windows-latest + yarn: + - 2.x + - 3.x + runs-on: ${{ matrix.platform }} + env: + PLUGIN_RUBY_CI: true + steps: + - uses: actions/checkout@main + - uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + ruby-version: "3.0" + - uses: actions/setup-node@v2 + with: + node-version: 12.x + cache: yarn + - run: yarn install --frozen-lockfile + - run: yarn run prepublishOnly + - run: yarn pack + # Windows runners don't have /tmp, let's make sure it exists + - run: mkdir -p /tmp + - run: mv prettier-plugin-ruby-*.tgz /tmp/prettier-plugin-ruby.tgz + - run: mkdir /tmp/smoketest + - run: | + cd /tmp/smoketest + echo '{ "name": "smoketest" }' > package.json + yarn set version berry # workaround for https://github.com/yarnpkg/berry/issues/3180 + yarn set version ${{ matrix.yarn }} + yarn add ../prettier-plugin-ruby.tgz + yarn add prettier + echo '{ "plugins": ["@prettier/plugin-ruby"] }' >.prettierrc.json + echo 'def add(a, b) ; a + b ; end' >smoketest.rb + yarn run prettier -w smoketest.rb + ruby -c smoketest.rb + gem: name: Gem runs-on: ubuntu-latest From 8c483e3599921ac8735a3f8be000e0948909d6c0 Mon Sep 17 00:00:00 2001 From: Nat Budin Date: Mon, 4 Oct 2021 08:43:20 -0700 Subject: [PATCH 321/785] Make sure the smoke test actually runs with PnP --- .github/workflows/main.yml | 7 ++++--- .npmignore | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0ea68452..89ecd090 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -86,13 +86,14 @@ jobs: - run: mkdir -p /tmp - run: mv prettier-plugin-ruby-*.tgz /tmp/prettier-plugin-ruby.tgz - run: mkdir /tmp/smoketest - - run: | + - name: Smoke test + run: | cd /tmp/smoketest echo '{ "name": "smoketest" }' > package.json yarn set version berry # workaround for https://github.com/yarnpkg/berry/issues/3180 yarn set version ${{ matrix.yarn }} - yarn add ../prettier-plugin-ruby.tgz - yarn add prettier + yarn add prettier @prettier/plugin-ruby@file:/tmp/prettier-plugin-ruby.tgz + npx rimraf .yarn/unplugged # Make sure Yarn didn't unplug anything; this will deliberately break if it did echo '{ "plugins": ["@prettier/plugin-ruby"] }' >.prettierrc.json echo 'def add(a, b) ; a + b ; end' >smoketest.rb yarn run prettier -w smoketest.rb diff --git a/.npmignore b/.npmignore index 61ba492d..bd042760 100644 --- a/.npmignore +++ b/.npmignore @@ -7,6 +7,7 @@ /pkg/ /playground/ /test/ +/vendor/ /.* /Gemfile* From d42bbf0086bac9b2fdd06f65e1e3d309a9088508 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 4 Oct 2021 15:47:59 -0400 Subject: [PATCH 322/785] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3320be90..45c930d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Added - [#993](https://github.com/prettier/plugin-ruby/pull/993) - kddnewton - Nicer error message if you don't have the necessary JavaScript files to run prettier. +- [#996](https://github.com/prettier/plugin-ruby/pull/996) - nbudin - Allow `@prettier/plugin-ruby` to run in yarn's plug'n'play mode. ## [2.0.0-rc3] From 73a43a9d83a8aa18e979fd3bb21939b0a59a80f0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Oct 2021 12:01:40 +0000 Subject: [PATCH 323/785] Bump @typescript-eslint/eslint-plugin from 4.32.0 to 4.33.0 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.32.0 to 4.33.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.33.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 58 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 46 insertions(+), 12 deletions(-) diff --git a/yarn.lock b/yarn.lock index c287d664..e2ef17a1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -710,12 +710,12 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^4.31.2": - version "4.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.32.0.tgz#46d2370ae9311092f2a6f7246d28357daf2d4e89" - integrity sha512-+OWTuWRSbWI1KDK8iEyG/6uK2rTm3kpS38wuVifGUTDB6kjEuNrzBI1MUtxnkneuWG/23QehABe2zHHrj+4yuA== + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz#c24dc7c8069c7706bc40d99f6fa87edcb2005276" + integrity sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg== dependencies: - "@typescript-eslint/experimental-utils" "4.32.0" - "@typescript-eslint/scope-manager" "4.32.0" + "@typescript-eslint/experimental-utils" "4.33.0" + "@typescript-eslint/scope-manager" "4.33.0" debug "^4.3.1" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -723,15 +723,15 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/experimental-utils@4.32.0": - version "4.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.32.0.tgz#53a8267d16ca5a79134739129871966c56a59dc4" - integrity sha512-WLoXcc+cQufxRYjTWr4kFt0DyEv6hDgSaFqYhIzQZ05cF+kXfqXdUh+//kgquPJVUBbL3oQGKQxwPbLxHRqm6A== +"@typescript-eslint/experimental-utils@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz#6f2a786a4209fa2222989e9380b5331b2810f7fd" + integrity sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q== dependencies: "@types/json-schema" "^7.0.7" - "@typescript-eslint/scope-manager" "4.32.0" - "@typescript-eslint/types" "4.32.0" - "@typescript-eslint/typescript-estree" "4.32.0" + "@typescript-eslint/scope-manager" "4.33.0" + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/typescript-estree" "4.33.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -753,11 +753,24 @@ "@typescript-eslint/types" "4.32.0" "@typescript-eslint/visitor-keys" "4.32.0" +"@typescript-eslint/scope-manager@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz#d38e49280d983e8772e29121cf8c6e9221f280a3" + integrity sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ== + dependencies: + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/visitor-keys" "4.33.0" + "@typescript-eslint/types@4.32.0": version "4.32.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.32.0.tgz#52c633c18da47aee09449144bf59565ab36df00d" integrity sha512-LE7Z7BAv0E2UvqzogssGf1x7GPpUalgG07nGCBYb1oK4mFsOiFC/VrSMKbZQzFJdN2JL5XYmsx7C7FX9p9ns0w== +"@typescript-eslint/types@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72" + integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== + "@typescript-eslint/typescript-estree@4.32.0": version "4.32.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.32.0.tgz#db00ccc41ccedc8d7367ea3f50c6994b8efa9f3b" @@ -771,6 +784,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz#0dfb51c2908f68c5c08d82aefeaf166a17c24609" + integrity sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA== + dependencies: + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/visitor-keys" "4.33.0" + debug "^4.3.1" + globby "^11.0.3" + is-glob "^4.0.1" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/visitor-keys@4.32.0": version "4.32.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.32.0.tgz#455ba8b51242f2722a497ffae29313f33b14cb7f" @@ -779,6 +805,14 @@ "@typescript-eslint/types" "4.32.0" eslint-visitor-keys "^2.0.0" +"@typescript-eslint/visitor-keys@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz#2a22f77a41604289b7a186586e9ec48ca92ef1dd" + integrity sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg== + dependencies: + "@typescript-eslint/types" "4.33.0" + eslint-visitor-keys "^2.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 54664652df9cd068de0e38b53062ea1019cb41eb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Oct 2021 12:01:53 +0000 Subject: [PATCH 324/785] Bump @typescript-eslint/parser from 4.32.0 to 4.33.0 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.32.0 to 4.33.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.33.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index c287d664..97b72be5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -736,13 +736,13 @@ eslint-utils "^3.0.0" "@typescript-eslint/parser@^4.31.2": - version "4.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.32.0.tgz#751ecca0e2fecd3d44484a9b3049ffc1871616e5" - integrity sha512-lhtYqQ2iEPV5JqV7K+uOVlPePjClj4dOw7K4/Z1F2yvjIUvyr13yJnDzkK6uon4BjHYuHy3EG0c2Z9jEhFk56w== + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.33.0.tgz#dfe797570d9694e560528d18eecad86c8c744899" + integrity sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA== dependencies: - "@typescript-eslint/scope-manager" "4.32.0" - "@typescript-eslint/types" "4.32.0" - "@typescript-eslint/typescript-estree" "4.32.0" + "@typescript-eslint/scope-manager" "4.33.0" + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/typescript-estree" "4.33.0" debug "^4.3.1" "@typescript-eslint/scope-manager@4.32.0": @@ -753,11 +753,24 @@ "@typescript-eslint/types" "4.32.0" "@typescript-eslint/visitor-keys" "4.32.0" +"@typescript-eslint/scope-manager@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz#d38e49280d983e8772e29121cf8c6e9221f280a3" + integrity sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ== + dependencies: + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/visitor-keys" "4.33.0" + "@typescript-eslint/types@4.32.0": version "4.32.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.32.0.tgz#52c633c18da47aee09449144bf59565ab36df00d" integrity sha512-LE7Z7BAv0E2UvqzogssGf1x7GPpUalgG07nGCBYb1oK4mFsOiFC/VrSMKbZQzFJdN2JL5XYmsx7C7FX9p9ns0w== +"@typescript-eslint/types@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72" + integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== + "@typescript-eslint/typescript-estree@4.32.0": version "4.32.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.32.0.tgz#db00ccc41ccedc8d7367ea3f50c6994b8efa9f3b" @@ -771,6 +784,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz#0dfb51c2908f68c5c08d82aefeaf166a17c24609" + integrity sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA== + dependencies: + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/visitor-keys" "4.33.0" + debug "^4.3.1" + globby "^11.0.3" + is-glob "^4.0.1" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/visitor-keys@4.32.0": version "4.32.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.32.0.tgz#455ba8b51242f2722a497ffae29313f33b14cb7f" @@ -779,6 +805,14 @@ "@typescript-eslint/types" "4.32.0" eslint-visitor-keys "^2.0.0" +"@typescript-eslint/visitor-keys@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz#2a22f77a41604289b7a186586e9ec48ca92ef1dd" + integrity sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg== + dependencies: + "@typescript-eslint/types" "4.33.0" + eslint-visitor-keys "^2.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 c212c53ee122fd4b93459dc1cff7126ce7df9522 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Oct 2021 12:02:06 +0000 Subject: [PATCH 325/785] Bump @types/node from 16.10.2 to 16.10.3 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.10.2 to 16.10.3. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 40 +++------------------------------------- 1 file changed, 3 insertions(+), 37 deletions(-) diff --git a/yarn.lock b/yarn.lock index 294c4e40..8250cd49 100644 --- a/yarn.lock +++ b/yarn.lock @@ -683,9 +683,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^16.9.1": - version "16.10.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.2.tgz#5764ca9aa94470adb4e1185fe2e9f19458992b2e" - integrity sha512-zCclL4/rx+W5SQTzFs9wyvvyCwoK9QtBpratqz2IYJ3O8Umrn0m3nsTv0wQBk9sRGpvUe9CwPDrQFB10f1FIjQ== + version "16.10.3" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.3.tgz#7a8f2838603ea314d1d22bb3171d899e15c57bd5" + integrity sha512-ho3Ruq+fFnBrZhUYI46n/bV2GjwzSkwuT4dTf0GkuNFmnb8nq4ny2z9JEVemFi6bdEJanHLlYfy9c6FN9B9McQ== "@types/prettier@^2.1.5", "@types/prettier@^2.3.2": version "2.4.1" @@ -745,14 +745,6 @@ "@typescript-eslint/typescript-estree" "4.33.0" debug "^4.3.1" -"@typescript-eslint/scope-manager@4.32.0": - version "4.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.32.0.tgz#e03c8668f8b954072b3f944d5b799c0c9225a7d5" - integrity sha512-DK+fMSHdM216C0OM/KR1lHXjP1CNtVIhJ54kQxfOE6x8UGFAjha8cXgDMBEIYS2XCYjjCtvTkjQYwL3uvGOo0w== - dependencies: - "@typescript-eslint/types" "4.32.0" - "@typescript-eslint/visitor-keys" "4.32.0" - "@typescript-eslint/scope-manager@4.33.0": version "4.33.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz#d38e49280d983e8772e29121cf8c6e9221f280a3" @@ -761,29 +753,11 @@ "@typescript-eslint/types" "4.33.0" "@typescript-eslint/visitor-keys" "4.33.0" -"@typescript-eslint/types@4.32.0": - version "4.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.32.0.tgz#52c633c18da47aee09449144bf59565ab36df00d" - integrity sha512-LE7Z7BAv0E2UvqzogssGf1x7GPpUalgG07nGCBYb1oK4mFsOiFC/VrSMKbZQzFJdN2JL5XYmsx7C7FX9p9ns0w== - "@typescript-eslint/types@4.33.0": version "4.33.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72" integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== -"@typescript-eslint/typescript-estree@4.32.0": - version "4.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.32.0.tgz#db00ccc41ccedc8d7367ea3f50c6994b8efa9f3b" - integrity sha512-tRYCgJ3g1UjMw1cGG8Yn1KzOzNlQ6u1h9AmEtPhb5V5a1TmiHWcRyF/Ic+91M4f43QeChyYlVTcf3DvDTZR9vw== - dependencies: - "@typescript-eslint/types" "4.32.0" - "@typescript-eslint/visitor-keys" "4.32.0" - debug "^4.3.1" - globby "^11.0.3" - is-glob "^4.0.1" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@4.33.0": version "4.33.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz#0dfb51c2908f68c5c08d82aefeaf166a17c24609" @@ -797,14 +771,6 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@4.32.0": - version "4.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.32.0.tgz#455ba8b51242f2722a497ffae29313f33b14cb7f" - integrity sha512-e7NE0qz8W+atzv3Cy9qaQ7BTLwWsm084Z0c4nIO2l3Bp6u9WIgdqCgyPyV5oSPDMIW3b20H59OOCmVk3jw3Ptw== - dependencies: - "@typescript-eslint/types" "4.32.0" - eslint-visitor-keys "^2.0.0" - "@typescript-eslint/visitor-keys@4.33.0": version "4.33.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz#2a22f77a41604289b7a186586e9ec48ca92ef1dd" From d2def3cd3e5f329e5f8301cfabe1d6c0c007b7b1 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 6 Oct 2021 13:10:55 -0400 Subject: [PATCH 326/785] Fix for #1000 --- CHANGELOG.md | 4 ++++ src/ruby/nodes/rescue.ts | 11 +++++++---- test/js/ruby/nodes/rescue.test.ts | 13 +++++++++++++ 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45c930d0..513eae8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#993](https://github.com/prettier/plugin-ruby/pull/993) - kddnewton - Nicer error message if you don't have the necessary JavaScript files to run prettier. - [#996](https://github.com/prettier/plugin-ruby/pull/996) - nbudin - Allow `@prettier/plugin-ruby` to run in yarn's plug'n'play mode. +### Changed + +- [#1000](https://github.com/prettier/plugin-ruby/pull/1000) - nbudin, kddnewton - Fix for rescuing single top-level exceptions in `rescue` clauses. + ## [2.0.0-rc3] ### Changed diff --git a/src/ruby/nodes/rescue.ts b/src/ruby/nodes/rescue.ts index 18ebc651..7f3f42a7 100644 --- a/src/ruby/nodes/rescue.ts +++ b/src/ruby/nodes/rescue.ts @@ -55,14 +55,17 @@ export const printRescueEx: Plugin.Printer = ( print ) => { const [exception, variable] = path.getValue().body; - const parts = []; + const parts: Plugin.Doc[] = []; if (exception) { + // If there's just one exception being rescued, then it's just going to be a + // single doc node. let exceptionDoc = path.call(print, "body", 0); - if (Array.isArray(exceptionDoc)) { - const joiner = [",", line]; - exceptionDoc = group(join(joiner, exceptionDoc)); + // If there are multiple exceptions being rescued, then we're going to have + // multiple doc nodes returned as an array that we need to join together. + if (["mrhs_add_star", "mrhs_new_from_args"].includes(exception.type)) { + exceptionDoc = group(join([",", line], exceptionDoc)); } parts.push(" ", exceptionDoc); diff --git a/test/js/ruby/nodes/rescue.test.ts b/test/js/ruby/nodes/rescue.test.ts index 43334bf9..b3948af7 100644 --- a/test/js/ruby/nodes/rescue.test.ts +++ b/test/js/ruby/nodes/rescue.test.ts @@ -38,6 +38,19 @@ describe("rescue", () => { expect(content).toMatchFormat(); }); + // https://github.com/prettier/plugin-ruby/pull/1000 + test("errors with scope resolution operator", () => { + const content = ruby(` + def foo + a + rescue ::A + e + end + `); + + expect(content).toMatchFormat(); + }); + test.each(["begin", "def foo"])("%s with every clause", (declaration) => { const error = "BreakingBreakingBreakingBreakingBreakingError"; const content = ruby(` From f75bdd2933affa192e04e7f061d5357799671cc9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Oct 2021 12:01:50 +0000 Subject: [PATCH 327/785] Bump jest from 27.2.4 to 27.2.5 Bumps [jest](https://github.com/facebook/jest) from 27.2.4 to 27.2.5. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v27.2.4...v27.2.5) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 631 +++++++++++++++++++++++++++--------------------------- 1 file changed, 316 insertions(+), 315 deletions(-) diff --git a/yarn.lock b/yarn.lock index 8250cd49..c07ce038 100644 --- a/yarn.lock +++ b/yarn.lock @@ -366,93 +366,94 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.2.4.tgz#2f1a4bf82b9940065d4818fac271def99ec55e5e" - integrity sha512-94znCKynPZpDpYHQ6esRJSc11AmONrVkBOBZiD7S+bSubHhrUfbS95EY5HIOxhm4PQO7cnvZkL3oJcY0oMA+Wg== +"@jest/console@^27.2.5": + version "27.2.5" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.2.5.tgz#bddbf8d41c191f17b52bf0c9e6c0d18605e35d6e" + integrity sha512-smtlRF9vNKorRMCUtJ+yllIoiY8oFmfFG7xlzsAE76nKEwXNhjPOJIsc7Dv+AUitVt76t+KjIpUP9m98Crn2LQ== dependencies: - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^27.2.4" - jest-util "^27.2.4" + jest-message-util "^27.2.5" + jest-util "^27.2.5" slash "^3.0.0" -"@jest/core@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.2.4.tgz#0b932da787d64848eab720dbb88e5b7a3f86e539" - integrity sha512-UNQLyy+rXoojNm2MGlapgzWhZD1CT1zcHZQYeiD0xE7MtJfC19Q6J5D/Lm2l7i4V97T30usKDoEtjI8vKwWcLg== +"@jest/core@^27.2.5": + version "27.2.5" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.2.5.tgz#854c314708cee0d892ac4f531b9129f00a21ee69" + integrity sha512-VR7mQ+jykHN4WO3OvusRJMk4xCa2MFLipMS+43fpcRGaYrN1KwMATfVEXif7ccgFKYGy5D1TVXTNE4mGq/KMMA== dependencies: - "@jest/console" "^27.2.4" - "@jest/reporters" "^27.2.4" - "@jest/test-result" "^27.2.4" - "@jest/transform" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/console" "^27.2.5" + "@jest/reporters" "^27.2.5" + "@jest/test-result" "^27.2.5" + "@jest/transform" "^27.2.5" + "@jest/types" "^27.2.5" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" - jest-changed-files "^27.2.4" - jest-config "^27.2.4" - jest-haste-map "^27.2.4" - jest-message-util "^27.2.4" + jest-changed-files "^27.2.5" + jest-config "^27.2.5" + jest-haste-map "^27.2.5" + jest-message-util "^27.2.5" jest-regex-util "^27.0.6" - jest-resolve "^27.2.4" - jest-resolve-dependencies "^27.2.4" - jest-runner "^27.2.4" - jest-runtime "^27.2.4" - jest-snapshot "^27.2.4" - jest-util "^27.2.4" - jest-validate "^27.2.4" - jest-watcher "^27.2.4" + jest-resolve "^27.2.5" + jest-resolve-dependencies "^27.2.5" + jest-runner "^27.2.5" + jest-runtime "^27.2.5" + jest-snapshot "^27.2.5" + jest-util "^27.2.5" + jest-validate "^27.2.5" + jest-watcher "^27.2.5" micromatch "^4.0.4" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.2.4.tgz#db3e60f7dd30ab950f6ce2d6d7293ed9a6b7cbcd" - integrity sha512-wkuui5yr3SSQW0XD0Qm3TATUbL/WE3LDEM3ulC+RCQhMf2yxhci8x7svGkZ4ivJ6Pc94oOzpZ6cdHBAMSYd1ew== +"@jest/environment@^27.2.5": + version "27.2.5" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.2.5.tgz#b85517ccfcec55690c82c56f5a01a3b30c5e3c84" + integrity sha512-XvUW3q6OUF+54SYFCgbbfCd/BKTwm5b2MGLoc2jINXQLKQDTCS2P2IrpPOtQ08WWZDGzbhAzVhOYta3J2arubg== dependencies: - "@jest/fake-timers" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/fake-timers" "^27.2.5" + "@jest/types" "^27.2.5" "@types/node" "*" - jest-mock "^27.2.4" + jest-mock "^27.2.5" -"@jest/fake-timers@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.2.4.tgz#00df08bd60332bd59503cb5b6db21e4903785f86" - integrity sha512-cs/TzvwWUM7kAA6Qm/890SK6JJ2pD5RfDNM3SSEom6BmdyV6OiWP1qf/pqo6ts6xwpcM36oN0wSEzcZWc6/B6w== +"@jest/fake-timers@^27.2.5": + version "27.2.5" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.2.5.tgz#0c7e5762d7bfe6e269e7b49279b097a52a42f0a0" + integrity sha512-ZGUb6jg7BgwY+nmO0TW10bc7z7Hl2G/UTAvmxEyZ/GgNFoa31tY9/cgXmqcxnnZ7o5Xs7RAOz3G1SKIj8IVDlg== dependencies: - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" "@sinonjs/fake-timers" "^8.0.1" "@types/node" "*" - jest-message-util "^27.2.4" - jest-mock "^27.2.4" - jest-util "^27.2.4" + jest-message-util "^27.2.5" + jest-mock "^27.2.5" + jest-util "^27.2.5" -"@jest/globals@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.2.4.tgz#0aeb22b011f8c8c4b8ff3b4dbd1ee0392fe0dd8a" - integrity sha512-DRsRs5dh0i+fA9mGHylTU19+8fhzNJoEzrgsu+zgJoZth3x8/0juCQ8nVVdW1er4Cqifb/ET7/hACYVPD0dBEA== +"@jest/globals@^27.2.5": + version "27.2.5" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.2.5.tgz#4115538f98ed6cee4051a90fdbd0854062902099" + integrity sha512-naRI537GM+enFVJQs6DcwGYPn/0vgJNb06zGVbzXfDfe/epDPV73hP1vqO37PqSKDeOXM2KInr6ymYbL1HTP7g== dependencies: - "@jest/environment" "^27.2.4" - "@jest/types" "^27.2.4" - expect "^27.2.4" + "@jest/environment" "^27.2.5" + "@jest/types" "^27.2.5" + expect "^27.2.5" -"@jest/reporters@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.2.4.tgz#1482ff007f2e919d85c54b1563abb8b2ea2d5198" - integrity sha512-LHeSdDnDZkDnJ8kvnjcqV8P1Yv/32yL4d4XfR5gBiy3xGO0onwll1QEbvtW96fIwhx2nejug0GTaEdNDoyr3fQ== +"@jest/reporters@^27.2.5": + version "27.2.5" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.2.5.tgz#65198ed1f3f4449e3f656129764dc6c5bb27ebe3" + integrity sha512-zYuR9fap3Q3mxQ454VWF8I6jYHErh368NwcKHWO2uy2fwByqBzRHkf9j2ekMDM7PaSTWcLBSZyd7NNxR1iHxzQ== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.2.4" - "@jest/test-result" "^27.2.4" - "@jest/transform" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/console" "^27.2.5" + "@jest/test-result" "^27.2.5" + "@jest/transform" "^27.2.5" + "@jest/types" "^27.2.5" + "@types/node" "*" chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" @@ -463,10 +464,10 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^27.2.4" - jest-resolve "^27.2.4" - jest-util "^27.2.4" - jest-worker "^27.2.4" + jest-haste-map "^27.2.5" + jest-resolve "^27.2.5" + jest-util "^27.2.5" + jest-worker "^27.2.5" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" @@ -482,41 +483,41 @@ graceful-fs "^4.2.4" source-map "^0.6.0" -"@jest/test-result@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.2.4.tgz#d1ca8298d168f1b0be834bfb543b1ac0294c05d7" - integrity sha512-eU+PRo0+lIS01b0dTmMdVZ0TtcRSxEaYquZTRFMQz6CvsehGhx9bRzi9Zdw6VROviJyv7rstU+qAMX5pNBmnfQ== +"@jest/test-result@^27.2.5": + version "27.2.5" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.2.5.tgz#e9f73cf6cd5e2cc6eb3105339248dea211f9320e" + integrity sha512-ub7j3BrddxZ0BdSnM5JCF6cRZJ/7j3wgdX0+Dtwhw2Po+HKsELCiXUTvh+mgS4/89mpnU1CPhZxe2mTvuLPJJg== dependencies: - "@jest/console" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/console" "^27.2.5" + "@jest/types" "^27.2.5" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.2.4.tgz#df66422a3e9e7440ce8b7498e255fa6b52c0bc03" - integrity sha512-fpk5eknU3/DXE2QCCG1wv/a468+cfPo3Asu6d6yUtM9LOPh709ubZqrhuUOYfM8hXMrIpIdrv1CdCrWWabX0rQ== +"@jest/test-sequencer@^27.2.5": + version "27.2.5" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.2.5.tgz#ed5ae91c00e623fb719111d58e380395e16cefbb" + integrity sha512-8j8fHZRfnjbbdMitMAGFKaBZ6YqvFRFJlMJzcy3v75edTOqc7RY65S9JpMY6wT260zAcL2sTQRga/P4PglCu3Q== dependencies: - "@jest/test-result" "^27.2.4" + "@jest/test-result" "^27.2.5" graceful-fs "^4.2.4" - jest-haste-map "^27.2.4" - jest-runtime "^27.2.4" + jest-haste-map "^27.2.5" + jest-runtime "^27.2.5" -"@jest/transform@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.2.4.tgz#2fe5b6836895f7a1b8bdec442c51e83943c62733" - integrity sha512-n5FlX2TH0oQGwyVDKPxdJ5nI2sO7TJBFe3u3KaAtt7TOiV4yL+Y+rSFDl+Ic5MpbiA/eqXmLAQxjnBmWgS2rEA== +"@jest/transform@^27.2.5": + version "27.2.5" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.2.5.tgz#02b08862a56dbedddf0ba3c2eae41e049a250e29" + integrity sha512-29lRtAHHYGALbZOx343v0zKmdOg4Sb0rsA1uSv0818bvwRhs3TyElOmTVXlrw0v1ZTqXJCAH/cmoDXimBhQOJQ== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" babel-plugin-istanbul "^6.0.0" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.2.4" + jest-haste-map "^27.2.5" jest-regex-util "^27.0.6" - jest-util "^27.2.4" + jest-util "^27.2.5" micromatch "^4.0.4" pirates "^4.0.1" slash "^3.0.0" @@ -534,10 +535,10 @@ "@types/yargs" "^16.0.0" chalk "^4.0.0" -"@jest/types@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.2.4.tgz#2430042a66e00dc5b140c3636f4474d464c21ee8" - integrity sha512-IDO2ezTxeMvQAHxzG/ZvEyA47q0aVfzT95rGFl7bZs/Go0aIucvfDbS2rmnoEdXxlLQhcolmoG/wvL/uKx4tKA== +"@jest/types@^27.2.5": + version "27.2.5" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.2.5.tgz#420765c052605e75686982d24b061b4cbba22132" + integrity sha512-nmuM4VuDtCZcY+eTpw+0nvstwReMsjPoj7ZR80/BbixulhLaiX+fbv8oeLW8WZlJMcsGQsTmMKT/iTZu1Uy/lQ== dependencies: "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" @@ -925,13 +926,13 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= -babel-jest@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.2.4.tgz#21ed6729d51bdd75470bbbf3c8b08d86209fb0dc" - integrity sha512-f24OmxyWymk5jfgLdlCMu4fTs4ldxFBIdn5sJdhvGC1m08rSkJ5hYbWkNmfBSvE/DjhCVNSHXepxsI6THGfGsg== +babel-jest@^27.2.5: + version "27.2.5" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.2.5.tgz#6bbbc1bb4200fe0bfd1b1fbcbe02fc62ebed16aa" + integrity sha512-GC9pWCcitBhSuF7H3zl0mftoKizlswaF0E3qi+rPL417wKkCB0d+Sjjb0OfXvxj7gWiBf497ldgRMii68Xz+2g== dependencies: - "@jest/transform" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/transform" "^27.2.5" + "@jest/types" "^27.2.5" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.0.0" babel-preset-jest "^27.2.0" @@ -1498,16 +1499,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.2.4.tgz#4debf546050bcdad8914a8c95fec7662e02bf67c" - integrity sha512-gOtuonQ8TCnbNNCSw2fhVzRf8EFYDII4nB5NmG4IEV0rbUnW1I5zXvoTntU4iicB/Uh0oZr20NGlOLdJiwsOZA== +expect@^27.2.5: + version "27.2.5" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.2.5.tgz#16154aaa60b4d9a5b0adacfea3e4d6178f4b93fd" + integrity sha512-ZrO0w7bo8BgGoP/bLz+HDCI+0Hfei9jUSZs5yI/Wyn9VkG9w8oJ7rHRgYj+MA7yqqFa0IwHA3flJzZtYugShJA== dependencies: - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" ansi-styles "^5.0.0" jest-get-type "^27.0.6" - jest-matcher-utils "^27.2.4" - jest-message-util "^27.2.4" + jest-matcher-utils "^27.2.5" + jest-message-util "^27.2.5" jest-regex-util "^27.0.6" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: @@ -1903,84 +1904,84 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.2.4.tgz#d7de46e90e5a599c47e260760f5ab53516e835e6" - integrity sha512-eeO1C1u4ex7pdTroYXezr+rbr957myyVoKGjcY4R1TJi3A+9v+4fu1Iv9J4eLq1bgFyT3O3iRWU9lZsEE7J72Q== +jest-changed-files@^27.2.5: + version "27.2.5" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.2.5.tgz#9dfd550d158260bcb6fa80aff491f5647f7daeca" + integrity sha512-jfnNJzF89csUKRPKJ4MwZ1SH27wTmX2xiAIHUHrsb/OYd9Jbo4/SXxJ17/nnx6RIifpthk3Y+LEeOk+/dDeGdw== dependencies: - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.2.4.tgz#3bd898a29dcaf6a506f3f1b780dff5f67ca83c23" - integrity sha512-TtheheTElrGjlsY9VxkzUU1qwIx05ItIusMVKnvNkMt4o/PeegLRcjq3Db2Jz0GGdBalJdbzLZBgeulZAJxJWA== +jest-circus@^27.2.5: + version "27.2.5" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.2.5.tgz#573256a6fb6e447ac2fc7e0ade9375013309037f" + integrity sha512-eyL9IcrAxm3Saq3rmajFCwpaxaRMGJ1KJs+7hlTDinXpJmeR3P02bheM3CYohE7UfwOBmrFMJHjgo/WPcLTM+Q== dependencies: - "@jest/environment" "^27.2.4" - "@jest/test-result" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/environment" "^27.2.5" + "@jest/test-result" "^27.2.5" + "@jest/types" "^27.2.5" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" - expect "^27.2.4" + expect "^27.2.5" is-generator-fn "^2.0.0" - jest-each "^27.2.4" - jest-matcher-utils "^27.2.4" - jest-message-util "^27.2.4" - jest-runtime "^27.2.4" - jest-snapshot "^27.2.4" - jest-util "^27.2.4" - pretty-format "^27.2.4" + jest-each "^27.2.5" + jest-matcher-utils "^27.2.5" + jest-message-util "^27.2.5" + jest-runtime "^27.2.5" + jest-snapshot "^27.2.5" + jest-util "^27.2.5" + pretty-format "^27.2.5" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.2.4.tgz#acda7f367aa6e674723fc1a7334e0ae1799448d2" - integrity sha512-4kpQQkg74HYLaXo3nzwtg4PYxSLgL7puz1LXHj5Tu85KmlIpxQFjRkXlx4V47CYFFIDoyl3rHA/cXOxUWyMpNg== +jest-cli@^27.2.5: + version "27.2.5" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.2.5.tgz#88718c8f05f1c0f209152952ecd61afe4c3311bb" + integrity sha512-XzfcOXi5WQrXqFYsDxq5RDOKY4FNIgBgvgf3ZBz4e/j5/aWep5KnsAYH5OFPMdX/TP/LFsYQMRH7kzJUMh6JKg== dependencies: - "@jest/core" "^27.2.4" - "@jest/test-result" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/core" "^27.2.5" + "@jest/test-result" "^27.2.5" + "@jest/types" "^27.2.5" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.2.4" - jest-util "^27.2.4" - jest-validate "^27.2.4" + jest-config "^27.2.5" + jest-util "^27.2.5" + jest-validate "^27.2.5" prompts "^2.0.1" yargs "^16.2.0" -jest-config@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.2.4.tgz#0204969f5ae2e5190d47be2c14c04d631b7836e2" - integrity sha512-tWy0UxhdzqiKyp4l5Vq4HxLyD+gH5td+GCF3c22/DJ0bYAOsMo+qi2XtbJI6oYMH5JOJQs9nLW/r34nvFCehjA== +jest-config@^27.2.5: + version "27.2.5" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.2.5.tgz#c2e4ec6ea2bf4ffd2cae3d927999fe6159cba207" + integrity sha512-QdENtn9b5rIIYGlbDNEcgY9LDL5kcokJnXrp7x8AGjHob/XFqw1Z6p+gjfna2sUulQsQ3ce2Fvntnv+7fKYDhQ== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.2.4" - "@jest/types" "^27.2.4" - babel-jest "^27.2.4" + "@jest/test-sequencer" "^27.2.5" + "@jest/types" "^27.2.5" + babel-jest "^27.2.5" chalk "^4.0.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" is-ci "^3.0.0" - jest-circus "^27.2.4" - jest-environment-jsdom "^27.2.4" - jest-environment-node "^27.2.4" + jest-circus "^27.2.5" + jest-environment-jsdom "^27.2.5" + jest-environment-node "^27.2.5" jest-get-type "^27.0.6" - jest-jasmine2 "^27.2.4" + jest-jasmine2 "^27.2.5" jest-regex-util "^27.0.6" - jest-resolve "^27.2.4" - jest-runner "^27.2.4" - jest-util "^27.2.4" - jest-validate "^27.2.4" + jest-resolve "^27.2.5" + jest-runner "^27.2.5" + jest-util "^27.2.5" + jest-validate "^27.2.5" micromatch "^4.0.4" - pretty-format "^27.2.4" + pretty-format "^27.2.5" jest-diff@^27.0.0: version "27.2.0" @@ -1992,15 +1993,15 @@ jest-diff@^27.0.0: jest-get-type "^27.0.6" pretty-format "^27.2.0" -jest-diff@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.2.4.tgz#171c51d3d2c105c457100fee6e7bf7cee51c8d8c" - integrity sha512-bLAVlDSCR3gqUPGv+4nzVpEXGsHh98HjUL7Vb2hVyyuBDoQmja8eJb0imUABsuxBeUVmf47taJSAd9nDrwWKEg== +jest-diff@^27.2.5: + version "27.2.5" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.2.5.tgz#908f7a6aca5653824516ad30e0a9fd9767e53623" + integrity sha512-7gfwwyYkeslOOVQY4tVq5TaQa92mWfC9COsVYMNVYyJTOYAqbIkoD3twi5A+h+tAPtAelRxkqY6/xu+jwTr0dA== dependencies: chalk "^4.0.0" diff-sequences "^27.0.6" jest-get-type "^27.0.6" - pretty-format "^27.2.4" + pretty-format "^27.2.5" jest-docblock@^27.0.6: version "27.0.6" @@ -2009,53 +2010,53 @@ jest-docblock@^27.0.6: dependencies: detect-newline "^3.0.0" -jest-each@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.2.4.tgz#b4f280aafd63129ba82e345f0e74c5a10200aeef" - integrity sha512-w9XVc+0EDBUTJS4xBNJ7N2JCcWItFd006lFjz77OarAQcQ10eFDBMrfDv2GBJMKlXe9aq0HrIIF51AXcZrRJyg== +jest-each@^27.2.5: + version "27.2.5" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.2.5.tgz#378118d516db730b92096a9607b8711165946353" + integrity sha512-HUPWIbJT0bXarRwKu/m7lYzqxR4GM5EhKOsu0z3t0SKtbFN6skQhpAUADM4qFShBXb9zoOuag5lcrR1x/WM+Ag== dependencies: - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" chalk "^4.0.0" jest-get-type "^27.0.6" - jest-util "^27.2.4" - pretty-format "^27.2.4" + jest-util "^27.2.5" + pretty-format "^27.2.5" -jest-environment-jsdom@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.2.4.tgz#39ae80bbb8675306bfaf0440be1e5f877554539a" - integrity sha512-X70pTXFSypD7AIzKT1mLnDi5hP9w9mdTRcOGOmoDoBrNyNEg4rYm6d4LQWFLc9ps1VnMuDOkFSG0wjSNYGjkng== +jest-environment-jsdom@^27.2.5: + version "27.2.5" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.2.5.tgz#21de3ad0e89441d961b592ba7561b16241279208" + integrity sha512-QtRpOh/RQKuXniaWcoFE2ElwP6tQcyxHu0hlk32880g0KczdonCs5P1sk5+weu/OVzh5V4Bt1rXuQthI01mBLg== dependencies: - "@jest/environment" "^27.2.4" - "@jest/fake-timers" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/environment" "^27.2.5" + "@jest/fake-timers" "^27.2.5" + "@jest/types" "^27.2.5" "@types/node" "*" - jest-mock "^27.2.4" - jest-util "^27.2.4" + jest-mock "^27.2.5" + jest-util "^27.2.5" jsdom "^16.6.0" -jest-environment-node@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.2.4.tgz#b79f98cb36e0c9111aac859c9c99f04eb2f74ff6" - integrity sha512-ZbVbFSnbzTvhLOIkqh5lcLuGCCFvtG4xTXIRPK99rV2KzQT3kNg16KZwfTnLNlIiWCE8do960eToeDfcqmpSAw== +jest-environment-node@^27.2.5: + version "27.2.5" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.2.5.tgz#ffa1afb3604c640ec841f044d526c65912e02cef" + integrity sha512-0o1LT4grm7iwrS8fIoLtwJxb/hoa3GsH7pP10P02Jpj7Mi4BXy65u46m89vEM2WfD1uFJQ2+dfDiWZNA2e6bJg== dependencies: - "@jest/environment" "^27.2.4" - "@jest/fake-timers" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/environment" "^27.2.5" + "@jest/fake-timers" "^27.2.5" + "@jest/types" "^27.2.5" "@types/node" "*" - jest-mock "^27.2.4" - jest-util "^27.2.4" + jest-mock "^27.2.5" + jest-util "^27.2.5" jest-get-type@^27.0.6: version "27.0.6" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.6.tgz#0eb5c7f755854279ce9b68a9f1a4122f69047cfe" integrity sha512-XTkK5exIeUbbveehcSR8w0bhH+c0yloW/Wpl+9vZrjzztCPWrxhHwkIFpZzCt71oRBsgxmuUfxEqOYoZI2macg== -jest-haste-map@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.2.4.tgz#f8974807bedf07348ca9fd24e5861ab7c8e61aba" - integrity sha512-bkJ4bT00T2K+1NZXbRcyKnbJ42I6QBvoDNMTAQQDBhaGNnZreiQKUNqax0e6hLTx7E75pKDeltVu3V1HAdu+YA== +jest-haste-map@^27.2.5: + version "27.2.5" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.2.5.tgz#0247b7299250643472bbcf5b4ad85c72d5178e2e" + integrity sha512-pzO+Gw2WLponaSi0ilpzYBE0kuVJstoXBX8YWyUebR8VaXuX4tzzn0Zp23c/WaETo7XYTGv2e8KdnpiskAFMhQ== dependencies: - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" "@types/graceful-fs" "^4.1.2" "@types/node" "*" anymatch "^3.0.3" @@ -2063,76 +2064,76 @@ jest-haste-map@^27.2.4: graceful-fs "^4.2.4" jest-regex-util "^27.0.6" jest-serializer "^27.0.6" - jest-util "^27.2.4" - jest-worker "^27.2.4" + jest-util "^27.2.5" + jest-worker "^27.2.5" micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.2.4.tgz#4a1608133dbdb4d68b5929bfd785503ed9c9ba51" - integrity sha512-fcffjO/xLWLVnW2ct3No4EksxM5RyPwHDYu9QU+90cC+/eSMLkFAxS55vkqsxexOO5zSsZ3foVpMQcg/amSeIQ== +jest-jasmine2@^27.2.5: + version "27.2.5" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.2.5.tgz#baaf96c69913c52bce0100000cf0721027c0fd66" + integrity sha512-hdxY9Cm/CjLqu2tXeAoQHPgA4vcqlweVXYOg1+S9FeFdznB9Rti+eEBKDDkmOy9iqr4Xfbq95OkC4NFbXXPCAQ== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^27.2.4" + "@jest/environment" "^27.2.5" "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/test-result" "^27.2.5" + "@jest/types" "^27.2.5" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^27.2.4" + expect "^27.2.5" is-generator-fn "^2.0.0" - jest-each "^27.2.4" - jest-matcher-utils "^27.2.4" - jest-message-util "^27.2.4" - jest-runtime "^27.2.4" - jest-snapshot "^27.2.4" - jest-util "^27.2.4" - pretty-format "^27.2.4" + jest-each "^27.2.5" + jest-matcher-utils "^27.2.5" + jest-message-util "^27.2.5" + jest-runtime "^27.2.5" + jest-snapshot "^27.2.5" + jest-util "^27.2.5" + pretty-format "^27.2.5" throat "^6.0.1" -jest-leak-detector@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.2.4.tgz#9bb7eab26a73bb280e9298be8d80f389288ec8f1" - integrity sha512-SrcHWbe0EHg/bw2uBjVoHacTo5xosl068x2Q0aWsjr2yYuW2XwqrSkZV4lurUop0jhv1709ymG4or+8E4sH27Q== +jest-leak-detector@^27.2.5: + version "27.2.5" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.2.5.tgz#e2edc3b37d38e8d9a527e10e456b403c3151b206" + integrity sha512-HYsi3GUR72bYhOGB5C5saF9sPdxGzSjX7soSQS+BqDRysc7sPeBwPbhbuT8DnOpijnKjgwWQ8JqvbmReYnt3aQ== dependencies: jest-get-type "^27.0.6" - pretty-format "^27.2.4" + pretty-format "^27.2.5" -jest-matcher-utils@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.2.4.tgz#008fff018151415ad1b6cfc083fd70fe1e012525" - integrity sha512-nQeLfFAIPPkyhkDfifAPfP/U5wm1x0fLtAzqXZSSKckXDNuk2aaOfQiDYv1Mgf5GY6yOsxfUnvNm3dDjXM+BXw== +jest-matcher-utils@^27.2.5: + version "27.2.5" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.2.5.tgz#4684faaa8eb32bf15e6edaead6834031897e2980" + integrity sha512-qNR/kh6bz0Dyv3m68Ck2g1fLW5KlSOUNcFQh87VXHZwWc/gY6XwnKofx76Qytz3x5LDWT09/2+yXndTkaG4aWg== dependencies: chalk "^4.0.0" - jest-diff "^27.2.4" + jest-diff "^27.2.5" jest-get-type "^27.0.6" - pretty-format "^27.2.4" + pretty-format "^27.2.5" -jest-message-util@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.2.4.tgz#667e8c0f2b973156d1bac7398a7f677705cafaca" - integrity sha512-wbKT/BNGnBVB9nzi+IoaLkXt6fbSvqUxx+IYY66YFh96J3goY33BAaNG3uPqaw/Sh/FR9YpXGVDfd5DJdbh4nA== +jest-message-util@^27.2.5: + version "27.2.5" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.2.5.tgz#ed8b7b0965247bb875a49c1f9b9ab2d1d0820028" + integrity sha512-ggXSLoPfIYcbmZ8glgEJZ8b+e0Msw/iddRmgkoO7lDAr9SmI65IIfv7VnvTnV4FGnIIUIjzM+fHRHO5RBvyAbQ== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.4" micromatch "^4.0.4" - pretty-format "^27.2.4" + pretty-format "^27.2.5" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.2.4.tgz#c8f0ef33f73d8ff53e3f60b16d59f1128f4072ae" - integrity sha512-iVRU905rutaAoUcrt5Tm1JoHHWi24YabqEGXjPJI4tAyA6wZ7mzDi3GrZ+M7ebgWBqUkZE93GAx1STk7yCMIQA== +jest-mock@^27.2.5: + version "27.2.5" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.2.5.tgz#0ec38d5ff1e49c4802e7a4a8179e8d7a2fd84de0" + integrity sha512-HiMB3LqE9RzmeMzZARi2Bz3NoymxyP0gCid4y42ca1djffNtYFKgI220aC1VP1mUZ8rbpqZbHZOJ15093bZV/Q== dependencies: - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -2145,72 +2146,72 @@ jest-regex-util@^27.0.6: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.6.tgz#02e112082935ae949ce5d13b2675db3d8c87d9c5" integrity sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ== -jest-resolve-dependencies@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.2.4.tgz#20c41cc02b66aa45169b282356ec73b133013089" - integrity sha512-i5s7Uh9B3Q6uwxLpMhNKlgBf6pcemvWaORxsW1zNF/YCY3jd5EftvnGBI+fxVwJ1CBxkVfxqCvm1lpZkbaoGmg== +jest-resolve-dependencies@^27.2.5: + version "27.2.5" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.2.5.tgz#fcd8eca005b3d11ba32da443045c028164b83be1" + integrity sha512-BSjefped31bcvvCh++/pN9ueqqN1n0+p8/58yScuWfklLm2tbPbS9d251vJhAy0ZI2pL/0IaGhOTJrs9Y4FJlg== dependencies: - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" jest-regex-util "^27.0.6" - jest-snapshot "^27.2.4" + jest-snapshot "^27.2.5" -jest-resolve@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.2.4.tgz#d3b999f073ff84a8ae109ce99ff7f3223048701a" - integrity sha512-IsAO/3+3BZnKjI2I4f3835TBK/90dxR7Otgufn3mnrDFTByOSXclDi3G2XJsawGV4/18IMLARJ+V7Wm7t+J89Q== +jest-resolve@^27.2.5: + version "27.2.5" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.2.5.tgz#04dadbfc1312a2541f5c199c5011945e9cfe5cef" + integrity sha512-q5irwS3oS73SKy3+FM/HL2T7WJftrk9BRzrXF92f7net5HMlS7lJMg/ZwxLB4YohKqjSsdksEw7n/jvMxV7EKg== dependencies: - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" chalk "^4.0.0" escalade "^3.1.1" graceful-fs "^4.2.4" - jest-haste-map "^27.2.4" + jest-haste-map "^27.2.5" jest-pnp-resolver "^1.2.2" - jest-util "^27.2.4" - jest-validate "^27.2.4" + jest-util "^27.2.5" + jest-validate "^27.2.5" resolve "^1.20.0" slash "^3.0.0" -jest-runner@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.2.4.tgz#d816f4cb4af04f3cba703afcf5a35a335b77cad4" - integrity sha512-hIo5PPuNUyVDidZS8EetntuuJbQ+4IHWxmHgYZz9FIDbG2wcZjrP6b52uMDjAEQiHAn8yn8ynNe+TL8UuGFYKg== +jest-runner@^27.2.5: + version "27.2.5" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.2.5.tgz#3d9d0626f351480bb2cffcfbbfac240c0097ebd4" + integrity sha512-n41vw9RLg5TKAnEeJK9d6pGOsBOpwE89XBniK+AD1k26oIIy3V7ogM1scbDjSheji8MUPC9pNgCrZ/FHLVDNgg== dependencies: - "@jest/console" "^27.2.4" - "@jest/environment" "^27.2.4" - "@jest/test-result" "^27.2.4" - "@jest/transform" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/console" "^27.2.5" + "@jest/environment" "^27.2.5" + "@jest/test-result" "^27.2.5" + "@jest/transform" "^27.2.5" + "@jest/types" "^27.2.5" "@types/node" "*" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" jest-docblock "^27.0.6" - jest-environment-jsdom "^27.2.4" - jest-environment-node "^27.2.4" - jest-haste-map "^27.2.4" - jest-leak-detector "^27.2.4" - jest-message-util "^27.2.4" - jest-resolve "^27.2.4" - jest-runtime "^27.2.4" - jest-util "^27.2.4" - jest-worker "^27.2.4" + jest-environment-jsdom "^27.2.5" + jest-environment-node "^27.2.5" + jest-haste-map "^27.2.5" + jest-leak-detector "^27.2.5" + jest-message-util "^27.2.5" + jest-resolve "^27.2.5" + jest-runtime "^27.2.5" + jest-util "^27.2.5" + jest-worker "^27.2.5" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.2.4.tgz#170044041e5d30625ab8d753516bbe503f213a5c" - integrity sha512-ICKzzYdjIi70P17MZsLLIgIQFCQmIjMFf+xYww3aUySiUA/QBPUTdUqo5B2eg4HOn9/KkUsV0z6GVgaqAPBJvg== +jest-runtime@^27.2.5: + version "27.2.5" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.2.5.tgz#d144c3f6889b927aae1e695b63a41a3323b7016b" + integrity sha512-N0WRZ3QszKyZ3Dm27HTBbBuestsSd3Ud5ooVho47XZJ8aSKO/X1Ag8M1dNx9XzfGVRNdB/xCA3lz8MJwIzPLLA== dependencies: - "@jest/console" "^27.2.4" - "@jest/environment" "^27.2.4" - "@jest/fake-timers" "^27.2.4" - "@jest/globals" "^27.2.4" + "@jest/console" "^27.2.5" + "@jest/environment" "^27.2.5" + "@jest/fake-timers" "^27.2.5" + "@jest/globals" "^27.2.5" "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.2.4" - "@jest/transform" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/test-result" "^27.2.5" + "@jest/transform" "^27.2.5" + "@jest/types" "^27.2.5" "@types/yargs" "^16.0.0" chalk "^4.0.0" cjs-module-lexer "^1.0.0" @@ -2219,14 +2220,14 @@ jest-runtime@^27.2.4: exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-haste-map "^27.2.4" - jest-message-util "^27.2.4" - jest-mock "^27.2.4" + jest-haste-map "^27.2.5" + jest-message-util "^27.2.5" + jest-mock "^27.2.5" jest-regex-util "^27.0.6" - jest-resolve "^27.2.4" - jest-snapshot "^27.2.4" - jest-util "^27.2.4" - jest-validate "^27.2.4" + jest-resolve "^27.2.5" + jest-snapshot "^27.2.5" + jest-util "^27.2.5" + jest-validate "^27.2.5" slash "^3.0.0" strip-bom "^4.0.0" yargs "^16.2.0" @@ -2239,10 +2240,10 @@ jest-serializer@^27.0.6: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.2.4.tgz#277b2269437e3ffcb91d95a73b24becf33c5a871" - integrity sha512-5DFxK31rYS8X8C6WXsFx8XxrxW3PGa6+9IrUcZdTLg1aEyXDGIeiBh4jbwvh655bg/9vTETbEj/njfZicHTZZw== +jest-snapshot@^27.2.5: + version "27.2.5" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.2.5.tgz#8a612fe31e2967f58ad364542198dff61f92ef32" + integrity sha512-2/Jkn+VN6Abwz0llBltZaiJMnL8b1j5Bp/gRIxe9YR3FCEh9qp0TXVV0dcpTGZ8AcJV1SZGQkczewkI9LP5yGw== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" @@ -2250,23 +2251,23 @@ jest-snapshot@^27.2.4: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/transform" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/transform" "^27.2.5" + "@jest/types" "^27.2.5" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.2.4" + expect "^27.2.5" graceful-fs "^4.2.4" - jest-diff "^27.2.4" + jest-diff "^27.2.5" jest-get-type "^27.0.6" - jest-haste-map "^27.2.4" - jest-matcher-utils "^27.2.4" - jest-message-util "^27.2.4" - jest-resolve "^27.2.4" - jest-util "^27.2.4" + jest-haste-map "^27.2.5" + jest-matcher-utils "^27.2.5" + jest-message-util "^27.2.5" + jest-resolve "^27.2.5" + jest-util "^27.2.5" natural-compare "^1.4.0" - pretty-format "^27.2.4" + pretty-format "^27.2.5" semver "^7.3.2" jest-util@^27.0.0: @@ -2281,60 +2282,60 @@ jest-util@^27.0.0: is-ci "^3.0.0" picomatch "^2.2.3" -jest-util@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.2.4.tgz#3d7ce081b2e7f4cfe0156452ac01f3cb456cc656" - integrity sha512-mW++4u+fSvAt3YBWm5IpbmRAceUqa2B++JlUZTiuEt2AmNYn0Yw5oay4cP17TGsMINRNPSGiJ2zNnX60g+VbFg== +jest-util@^27.2.5: + version "27.2.5" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.2.5.tgz#88740c4024d223634a82ce7c2263e8bc6df3b3ba" + integrity sha512-QRhDC6XxISntMzFRd/OQ6TGsjbzA5ONO0tlAj2ElHs155x1aEr0rkYJBEysG6H/gZVH3oGFzCdAB/GA8leh8NQ== dependencies: - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" "@types/node" "*" chalk "^4.0.0" graceful-fs "^4.2.4" is-ci "^3.0.0" picomatch "^2.2.3" -jest-validate@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.2.4.tgz#b66d462b2fb93d7e16a47d1aa8763d5600bf2cfa" - integrity sha512-VMtbxbkd7LHnIH7PChdDtrluCFRJ4b1YV2YJzNwwsASMWftq/HgqiqjvptBOWyWOtevgO3f14wPxkPcLlVBRog== +jest-validate@^27.2.5: + version "27.2.5" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.2.5.tgz#2d59bf1627d180f395ba58f24599b0ee0efcfbdf" + integrity sha512-XgYtjS89nhVe+UfkbLgcm+GgXKWgL80t9nTcNeejyO3t0Sj/yHE8BtIJqjZu9NXQksYbGImoQRXmQ1gP+Guffw== dependencies: - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^27.0.6" leven "^3.1.0" - pretty-format "^27.2.4" + pretty-format "^27.2.5" -jest-watcher@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.2.4.tgz#b1d5c39ab94f59f4f35f66cc96f7761a10e0cfc4" - integrity sha512-LXC/0+dKxhK7cfF7reflRYlzDIaQE+fL4ynhKhzg8IMILNMuI4xcjXXfUJady7OR4/TZeMg7X8eHx8uan9vqaQ== +jest-watcher@^27.2.5: + version "27.2.5" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.2.5.tgz#41cd3e64dc5bea8a4327083d71ba7667be400567" + integrity sha512-umV4qGozg2Dn6DTTtqAh9puPw+DGLK9AQas7+mWjiK8t0fWMpxKg8ZXReZw7L4C88DqorsGUiDgwHNZ+jkVrkQ== dependencies: - "@jest/test-result" "^27.2.4" - "@jest/types" "^27.2.4" + "@jest/test-result" "^27.2.5" + "@jest/types" "^27.2.5" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^27.2.4" + jest-util "^27.2.5" string-length "^4.0.1" -jest-worker@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.2.4.tgz#881455df75e22e7726a53f43703ab74d6b36f82d" - integrity sha512-Zq9A2Pw59KkVjBBKD1i3iE2e22oSjXhUKKuAK1HGX8flGwkm6NMozyEYzKd41hXc64dbd/0eWFeEEuxqXyhM+g== +jest-worker@^27.2.5: + version "27.2.5" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.2.5.tgz#ed42865661959488aa020e8a325df010597c36d4" + integrity sha512-HTjEPZtcNKZ4LnhSp02NEH4vE+5OpJ0EsOWYvGQpHgUMLngydESAAMH5Wd/asPf29+XUDQZszxpLg1BkIIA2aw== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^27.0.1: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.2.4.tgz#70e27bef873138afc123aa4769f7124c50ad3efb" - integrity sha512-h4uqb1EQLfPulWyUFFWv9e9Nn8sCqsJ/j3wk/KCY0p4s4s0ICCfP3iMf6hRf5hEhsDyvyrCgKiZXma63gMz16A== + version "27.2.5" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.2.5.tgz#7d8a5c8781a160f693beeb7c68e46c16ef948148" + integrity sha512-vDMzXcpQN4Ycaqu+vO7LX8pZwNNoKMhc+gSp6q1D8S6ftRk8gNW8cni3YFxknP95jxzQo23Lul0BI2FrWgnwYQ== dependencies: - "@jest/core" "^27.2.4" + "@jest/core" "^27.2.5" import-local "^3.0.2" - jest-cli "^27.2.4" + jest-cli "^27.2.5" js-tokens@^4.0.0: version "4.0.0" @@ -2731,12 +2732,12 @@ pretty-format@^27.0.0, pretty-format@^27.2.0: ansi-styles "^5.0.0" react-is "^17.0.1" -pretty-format@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.2.4.tgz#08ea39c5eab41b082852d7093059a091f6ddc748" - integrity sha512-NUjw22WJHldzxyps2YjLZkUj6q1HvjqFezkB9Y2cklN8NtVZN/kZEXGZdFw4uny3oENzV5EEMESrkI0YDUH8vg== +pretty-format@^27.2.5: + version "27.2.5" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.2.5.tgz#7cfe2a8e8f01a5b5b29296a0b70f4140df0830c5" + integrity sha512-+nYn2z9GgicO9JiqmY25Xtq8SYfZ/5VCpEU3pppHHNAhd1y+ZXxmNPd1evmNcAd6Hz4iBV2kf0UpGth5A/VJ7g== dependencies: - "@jest/types" "^27.2.4" + "@jest/types" "^27.2.5" ansi-regex "^5.0.1" ansi-styles "^5.0.0" react-is "^17.0.1" From 135d8c011254b2f246910ba084571ea7431f2f4a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Oct 2021 12:01:56 +0000 Subject: [PATCH 328/785] Bump ts-node from 10.2.1 to 10.3.0 Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 10.2.1 to 10.3.0. - [Release notes](https://github.com/TypeStrong/ts-node/releases) - [Commits](https://github.com/TypeStrong/ts-node/compare/v10.2.1...v10.3.0) --- updated-dependencies: - dependency-name: ts-node dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index c07ce038..8fb982c1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -314,10 +314,10 @@ resolved "https://registry.yarnpkg.com/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz#33bf4b7b39c178821606f669bbc447a6a629786b" integrity sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg== -"@cspotcode/source-map-support@0.6.1": - version "0.6.1" - resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.6.1.tgz#118511f316e2e87ee4294761868e254d3da47960" - integrity sha512-DX3Z+T5dt1ockmPdobJS/FAsQPW4V4SrWEhD2iYQT2Cb2tQsiMnYxrcUH9By/Z3B+v0S5LMBkQtV/XOBbpLEOg== +"@cspotcode/source-map-support@0.7.0": + version "0.7.0" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz#4789840aa859e46d2f3173727ab707c66bf344f5" + integrity sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA== dependencies: "@cspotcode/source-map-consumer" "0.8.0" @@ -3114,11 +3114,11 @@ ts-jest@^27.0.5: yargs-parser "20.x" ts-node@^10.2.1: - version "10.2.1" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.2.1.tgz#4cc93bea0a7aba2179497e65bb08ddfc198b3ab5" - integrity sha512-hCnyOyuGmD5wHleOQX6NIjJtYVIO8bPP8F2acWkB4W06wdlkgyvJtubO/I9NkI88hCFECbsEgoLc0VNkYmcSfw== + version "10.3.0" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.3.0.tgz#a797f2ed3ff50c9a5d814ce400437cb0c1c048b4" + integrity sha512-RYIy3i8IgpFH45AX4fQHExrT8BxDeKTdC83QFJkNzkvt8uFB6QJ8XMyhynYiKMLxt9a7yuXaDBZNOYS3XjDcYw== dependencies: - "@cspotcode/source-map-support" "0.6.1" + "@cspotcode/source-map-support" "0.7.0" "@tsconfig/node10" "^1.0.7" "@tsconfig/node12" "^1.0.7" "@tsconfig/node14" "^1.0.0" From fbe3a7d267ec347b892caed050f56eca7a2562d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Oct 2021 12:01:29 +0000 Subject: [PATCH 329/785] Bump @types/node from 16.10.3 to 16.10.5 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.10.3 to 16.10.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 8fb982c1..bc7a1994 100644 --- a/yarn.lock +++ b/yarn.lock @@ -684,9 +684,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^16.9.1": - version "16.10.3" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.3.tgz#7a8f2838603ea314d1d22bb3171d899e15c57bd5" - integrity sha512-ho3Ruq+fFnBrZhUYI46n/bV2GjwzSkwuT4dTf0GkuNFmnb8nq4ny2z9JEVemFi6bdEJanHLlYfy9c6FN9B9McQ== + version "16.10.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.5.tgz#7fe4123b061753f1a58a6cd077ff0bb069ee752d" + integrity sha512-9iI3OOlkyOjLQQ9s+itIJNMRepDhB/96jW3fqduJ2FTPQj1dJjw6Q3QCImF9FE1wmdBs5QSun4FjDSFS8d8JLw== "@types/prettier@^2.1.5", "@types/prettier@^2.3.2": version "2.4.1" From 5042d4c01af24d78377c83bf82ef09fa2acaf738 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Oct 2021 12:02:07 +0000 Subject: [PATCH 330/785] Bump typescript from 4.4.3 to 4.4.4 Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.4.3 to 4.4.4. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v4.4.3...v4.4.4) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 8fb982c1..4df3d69a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3180,9 +3180,9 @@ typedarray-to-buffer@^3.1.5: is-typedarray "^1.0.0" typescript@^4.4.3: - version "4.4.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.3.tgz#bdc5407caa2b109efd4f82fe130656f977a29324" - integrity sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA== + version "4.4.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.4.tgz#2cd01a1a1f160704d3101fd5a58ff0f9fcb8030c" + integrity sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA== universalify@^0.1.2: version "0.1.2" From d32127907cb81185c83031d5487cc5d444b15d0c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Oct 2021 12:01:45 +0000 Subject: [PATCH 331/785] Bump @types/node from 16.10.5 to 16.10.9 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.10.5 to 16.10.9. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index e4347f7f..3ec319a7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -684,9 +684,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^16.9.1": - version "16.10.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.5.tgz#7fe4123b061753f1a58a6cd077ff0bb069ee752d" - integrity sha512-9iI3OOlkyOjLQQ9s+itIJNMRepDhB/96jW3fqduJ2FTPQj1dJjw6Q3QCImF9FE1wmdBs5QSun4FjDSFS8d8JLw== + version "16.10.9" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.9.tgz#8f1cdd517972f76a3b928298f4c0747cd6fef25a" + integrity sha512-H9ReOt+yqIJPCutkTYjFjlyK6WEMQYT9hLZMlWtOjFQY2ItppsWZ6RJf8Aw+jz5qTYceuHvFgPIaKOHtLAEWBw== "@types/prettier@^2.1.5", "@types/prettier@^2.3.2": version "2.4.1" From 9591c0b5aad9be280af46e7dcec9bde615ee6409 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Oct 2021 12:02:10 +0000 Subject: [PATCH 332/785] Bump @types/node from 16.10.9 to 16.11.0 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.10.9 to 16.11.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 3ec319a7..b699e8d0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -684,9 +684,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^16.9.1": - version "16.10.9" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.9.tgz#8f1cdd517972f76a3b928298f4c0747cd6fef25a" - integrity sha512-H9ReOt+yqIJPCutkTYjFjlyK6WEMQYT9hLZMlWtOjFQY2ItppsWZ6RJf8Aw+jz5qTYceuHvFgPIaKOHtLAEWBw== + version "16.11.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.0.tgz#4b95f2327bacd1ef8f08d8ceda193039c5d7f52e" + integrity sha512-8MLkBIYQMuhRBQzGN9875bYsOhPnf/0rgXGo66S2FemHkhbn9qtsz9ywV1iCG+vbjigE4WUNVvw37Dx+L0qsPg== "@types/prettier@^2.1.5", "@types/prettier@^2.3.2": version "2.4.1" From befd857565068a8e2053711d5fd997128c2f74e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Oct 2021 12:02:19 +0000 Subject: [PATCH 333/785] Bump ts-jest from 27.0.5 to 27.0.6 Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 27.0.5 to 27.0.6. - [Release notes](https://github.com/kulshekhar/ts-jest/releases) - [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/kulshekhar/ts-jest/compare/v27.0.5...v27.0.6) --- updated-dependencies: - dependency-name: ts-jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/yarn.lock b/yarn.lock index 3ec319a7..0f07ca1e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2270,19 +2270,7 @@ jest-snapshot@^27.2.5: pretty-format "^27.2.5" semver "^7.3.2" -jest-util@^27.0.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.2.0.tgz#bfccb85cfafae752257319e825a5b8d4ada470dc" - integrity sha512-T5ZJCNeFpqcLBpx+Hl9r9KoxBCUqeWlJ1Htli+vryigZVJ1vuLB9j35grEBASp4R13KFkV7jM52bBGnArpJN6A== - dependencies: - "@jest/types" "^27.1.1" - "@types/node" "*" - chalk "^4.0.0" - graceful-fs "^4.2.4" - is-ci "^3.0.0" - picomatch "^2.2.3" - -jest-util@^27.2.5: +jest-util@^27.0.0, jest-util@^27.2.5: version "27.2.5" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.2.5.tgz#88740c4024d223634a82ce7c2263e8bc6df3b3ba" integrity sha512-QRhDC6XxISntMzFRd/OQ6TGsjbzA5ONO0tlAj2ElHs155x1aEr0rkYJBEysG6H/gZVH3oGFzCdAB/GA8leh8NQ== @@ -2448,6 +2436,11 @@ lodash.clonedeep@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= +lodash.memoize@4.x: + version "4.1.2" + resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" + integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= + lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" @@ -2458,7 +2451,7 @@ lodash.truncate@^4.4.2: resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= -lodash@4.x, lodash@^4.7.0: +lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -3100,15 +3093,15 @@ tr46@^2.1.0: punycode "^2.1.1" ts-jest@^27.0.5: - version "27.0.5" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.0.5.tgz#0b0604e2271167ec43c12a69770f0bb65ad1b750" - integrity sha512-lIJApzfTaSSbtlksfFNHkWOzLJuuSm4faFAfo5kvzOiRAuoN4/eKxVJ2zEAho8aecE04qX6K1pAzfH5QHL1/8w== + version "27.0.6" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.0.6.tgz#9960dbbdb33792b79c5ee24d1c62514fd7b60052" + integrity sha512-XWkEBbrkyUWJdK9FwiCVdBZ7ZmT7sxcKtyVEZNmo7u8eQw6NHmtYEM2WpkX9VfnRI0DjSr6INfEHC9vCFhsFnQ== dependencies: bs-logger "0.x" fast-json-stable-stringify "2.x" jest-util "^27.0.0" json5 "2.x" - lodash "4.x" + lodash.memoize "4.x" make-error "1.x" semver "7.x" yargs-parser "20.x" From 9d960628d4203c586ded6b13813d50554f61463e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dorian=20Mari=C3=A9?= Date: Sun, 17 Oct 2021 00:50:10 +0200 Subject: [PATCH 334/785] add prepublishOnly instructions to error message when using the gem from github --- lib/prettier.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/prettier.rb b/lib/prettier.rb index 1d64f8ca..47b36b2d 100644 --- a/lib/prettier.rb +++ b/lib/prettier.rb @@ -29,9 +29,13 @@ def self.run(args) If you installed this dependency through git instead of from rubygems, it does not install the necessary files by default. To fix this you can either install them yourself by cd-ing into the directory where this gem - is located (#{File.expand_path('..', __dir__)}) and - running `yarn` or `npm install`, or you can change the source in your - Gemfile to point directly to rubygems. + is located (#{File.expand_path('..', __dir__)}) and running: + + `yarn && yarn prepublishOnly` + or + `npm install && npm run prepublishOnly` + or + you can change the source in your Gemfile to point directly to rubygems. MSG else # Otherwise, just print out the same error that prettier emitted, as it's From 379f5de8c82d51facbb0013ea2829ebaa5823a9e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Oct 2021 12:01:54 +0000 Subject: [PATCH 335/785] Bump jest from 27.2.5 to 27.3.0 Bumps [jest](https://github.com/facebook/jest) from 27.2.5 to 27.3.0. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v27.2.5...v27.3.0) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 574 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 295 insertions(+), 279 deletions(-) diff --git a/yarn.lock b/yarn.lock index e767e3de..7a0670f9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -366,27 +366,27 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^27.2.5": - version "27.2.5" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.2.5.tgz#bddbf8d41c191f17b52bf0c9e6c0d18605e35d6e" - integrity sha512-smtlRF9vNKorRMCUtJ+yllIoiY8oFmfFG7xlzsAE76nKEwXNhjPOJIsc7Dv+AUitVt76t+KjIpUP9m98Crn2LQ== +"@jest/console@^27.3.0": + version "27.3.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.3.0.tgz#a55f03a4f7e1e92a5879bdab2e8b9fe4dd5312ba" + integrity sha512-+Tr/xoNiosjckq96xIGpDaGsybeIm45VWXpSvDR8T9deXmWjYKX85prhz8yFPhLG4UVOeMo/B6RI/+flw3sO8A== dependencies: "@jest/types" "^27.2.5" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^27.2.5" - jest-util "^27.2.5" + jest-message-util "^27.3.0" + jest-util "^27.3.0" slash "^3.0.0" -"@jest/core@^27.2.5": - version "27.2.5" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.2.5.tgz#854c314708cee0d892ac4f531b9129f00a21ee69" - integrity sha512-VR7mQ+jykHN4WO3OvusRJMk4xCa2MFLipMS+43fpcRGaYrN1KwMATfVEXif7ccgFKYGy5D1TVXTNE4mGq/KMMA== +"@jest/core@^27.3.0": + version "27.3.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.3.0.tgz#50a521c663181f3a34ecb24bb9fe717e125dc784" + integrity sha512-0B3PWQouwS651m8AbQDse08dfRlzLHqSmywRPGYn2ZzU6RT4aP2Xwz8mEWfSPXXZmtwAtNgUXy0Cbt6QsBqKvw== dependencies: - "@jest/console" "^27.2.5" - "@jest/reporters" "^27.2.5" - "@jest/test-result" "^27.2.5" - "@jest/transform" "^27.2.5" + "@jest/console" "^27.3.0" + "@jest/reporters" "^27.3.0" + "@jest/test-result" "^27.3.0" + "@jest/transform" "^27.3.0" "@jest/types" "^27.2.5" "@types/node" "*" ansi-escapes "^4.2.1" @@ -394,64 +394,64 @@ emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" - jest-changed-files "^27.2.5" - jest-config "^27.2.5" - jest-haste-map "^27.2.5" - jest-message-util "^27.2.5" + jest-changed-files "^27.3.0" + jest-config "^27.3.0" + jest-haste-map "^27.3.0" + jest-message-util "^27.3.0" jest-regex-util "^27.0.6" - jest-resolve "^27.2.5" - jest-resolve-dependencies "^27.2.5" - jest-runner "^27.2.5" - jest-runtime "^27.2.5" - jest-snapshot "^27.2.5" - jest-util "^27.2.5" - jest-validate "^27.2.5" - jest-watcher "^27.2.5" + jest-resolve "^27.3.0" + jest-resolve-dependencies "^27.3.0" + jest-runner "^27.3.0" + jest-runtime "^27.3.0" + jest-snapshot "^27.3.0" + jest-util "^27.3.0" + jest-validate "^27.3.0" + jest-watcher "^27.3.0" micromatch "^4.0.4" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.2.5": - version "27.2.5" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.2.5.tgz#b85517ccfcec55690c82c56f5a01a3b30c5e3c84" - integrity sha512-XvUW3q6OUF+54SYFCgbbfCd/BKTwm5b2MGLoc2jINXQLKQDTCS2P2IrpPOtQ08WWZDGzbhAzVhOYta3J2arubg== +"@jest/environment@^27.3.0": + version "27.3.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.3.0.tgz#21b85e6f0baa18e92c5bb173a65c0df24565536d" + integrity sha512-OWx5RBd8QaPLlw7fL6l2IVyhYDpamaW3dDXlBnXb4IPGCIwoXAHZkmHV+VPIzb6xAkcPyXOmVm/rSaEneTqweg== dependencies: - "@jest/fake-timers" "^27.2.5" + "@jest/fake-timers" "^27.3.0" "@jest/types" "^27.2.5" "@types/node" "*" - jest-mock "^27.2.5" + jest-mock "^27.3.0" -"@jest/fake-timers@^27.2.5": - version "27.2.5" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.2.5.tgz#0c7e5762d7bfe6e269e7b49279b097a52a42f0a0" - integrity sha512-ZGUb6jg7BgwY+nmO0TW10bc7z7Hl2G/UTAvmxEyZ/GgNFoa31tY9/cgXmqcxnnZ7o5Xs7RAOz3G1SKIj8IVDlg== +"@jest/fake-timers@^27.3.0": + version "27.3.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.3.0.tgz#716f166f56abc01901b7823da503bf16c8a00ade" + integrity sha512-GCWgnItK6metb75QKflFxcVRlraVGomZonBQ+9B5UPc6wxBB3xzS7dATDWe/73R5P6BfnzCEaiizna771M5r9w== dependencies: "@jest/types" "^27.2.5" "@sinonjs/fake-timers" "^8.0.1" "@types/node" "*" - jest-message-util "^27.2.5" - jest-mock "^27.2.5" - jest-util "^27.2.5" + jest-message-util "^27.3.0" + jest-mock "^27.3.0" + jest-util "^27.3.0" -"@jest/globals@^27.2.5": - version "27.2.5" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.2.5.tgz#4115538f98ed6cee4051a90fdbd0854062902099" - integrity sha512-naRI537GM+enFVJQs6DcwGYPn/0vgJNb06zGVbzXfDfe/epDPV73hP1vqO37PqSKDeOXM2KInr6ymYbL1HTP7g== +"@jest/globals@^27.3.0": + version "27.3.0" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.3.0.tgz#8822f9a72aea428e3f11a688ff13c7992bfe1ea4" + integrity sha512-EEqmQHMLXgEZfchMVAavUfJuZmORRrP+zhomfREqVE85d1nccd7nw8uN4FQDJ53m5Glm1XtVCyOIJ9kQLrqjeA== dependencies: - "@jest/environment" "^27.2.5" + "@jest/environment" "^27.3.0" "@jest/types" "^27.2.5" - expect "^27.2.5" + expect "^27.3.0" -"@jest/reporters@^27.2.5": - version "27.2.5" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.2.5.tgz#65198ed1f3f4449e3f656129764dc6c5bb27ebe3" - integrity sha512-zYuR9fap3Q3mxQ454VWF8I6jYHErh368NwcKHWO2uy2fwByqBzRHkf9j2ekMDM7PaSTWcLBSZyd7NNxR1iHxzQ== +"@jest/reporters@^27.3.0": + version "27.3.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.3.0.tgz#8d5fd17916aeb1ab415b3ce0a94a31bda654020b" + integrity sha512-D9QLaLgbH+nIjDbKIvoX7yiRX6aXHO56/GzOxKNzKuvJVYhrzeQHcCMttXpp5SB08TdxVvFOPKZfFvkIcVgfBA== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.2.5" - "@jest/test-result" "^27.2.5" - "@jest/transform" "^27.2.5" + "@jest/console" "^27.3.0" + "@jest/test-result" "^27.3.0" + "@jest/transform" "^27.3.0" "@jest/types" "^27.2.5" "@types/node" "*" chalk "^4.0.0" @@ -464,10 +464,10 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^27.2.5" - jest-resolve "^27.2.5" - jest-util "^27.2.5" - jest-worker "^27.2.5" + jest-haste-map "^27.3.0" + jest-resolve "^27.3.0" + jest-util "^27.3.0" + jest-worker "^27.3.0" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" @@ -483,30 +483,30 @@ graceful-fs "^4.2.4" source-map "^0.6.0" -"@jest/test-result@^27.2.5": - version "27.2.5" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.2.5.tgz#e9f73cf6cd5e2cc6eb3105339248dea211f9320e" - integrity sha512-ub7j3BrddxZ0BdSnM5JCF6cRZJ/7j3wgdX0+Dtwhw2Po+HKsELCiXUTvh+mgS4/89mpnU1CPhZxe2mTvuLPJJg== +"@jest/test-result@^27.3.0": + version "27.3.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.3.0.tgz#e093c5d9eb34afa1b653cdb550c4bcaeb3096233" + integrity sha512-5+rYZgj562oPKjExQngfboobeIF2FSrgAvoxlkrogEMIbgT7FY+VAMIkp03klVfJtqo3XKzVWkTfsDSmZFI29w== dependencies: - "@jest/console" "^27.2.5" + "@jest/console" "^27.3.0" "@jest/types" "^27.2.5" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.2.5": - version "27.2.5" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.2.5.tgz#ed5ae91c00e623fb719111d58e380395e16cefbb" - integrity sha512-8j8fHZRfnjbbdMitMAGFKaBZ6YqvFRFJlMJzcy3v75edTOqc7RY65S9JpMY6wT260zAcL2sTQRga/P4PglCu3Q== +"@jest/test-sequencer@^27.3.0": + version "27.3.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.3.0.tgz#ac245f4f29ce7f81ae5afa441e5bf7bbdd342ef4" + integrity sha512-6eQHyBUCtK06sPfsufzEVijZtAtT7yGR1qaAZBlcz6P+FGJ569VW2O5o7mZc+L++uZc7BH4X2Ks7SMIgy1npJw== dependencies: - "@jest/test-result" "^27.2.5" + "@jest/test-result" "^27.3.0" graceful-fs "^4.2.4" - jest-haste-map "^27.2.5" - jest-runtime "^27.2.5" + jest-haste-map "^27.3.0" + jest-runtime "^27.3.0" -"@jest/transform@^27.2.5": - version "27.2.5" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.2.5.tgz#02b08862a56dbedddf0ba3c2eae41e049a250e29" - integrity sha512-29lRtAHHYGALbZOx343v0zKmdOg4Sb0rsA1uSv0818bvwRhs3TyElOmTVXlrw0v1ZTqXJCAH/cmoDXimBhQOJQ== +"@jest/transform@^27.3.0": + version "27.3.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.3.0.tgz#f2a63883eaada30f8141938ec1ad23ba7fdfb97e" + integrity sha512-IKrFhIT/+WIfeNjIRKTwQN7HYCdjKF/mmBqoD660gyGWVw1MzCO9pQuEJK9GXEnFWIuOcMHlm8XfUaDohP/zxA== dependencies: "@babel/core" "^7.1.0" "@jest/types" "^27.2.5" @@ -515,9 +515,9 @@ convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.2.5" + jest-haste-map "^27.3.0" jest-regex-util "^27.0.6" - jest-util "^27.2.5" + jest-util "^27.3.0" micromatch "^4.0.4" pirates "^4.0.1" slash "^3.0.0" @@ -926,12 +926,12 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= -babel-jest@^27.2.5: - version "27.2.5" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.2.5.tgz#6bbbc1bb4200fe0bfd1b1fbcbe02fc62ebed16aa" - integrity sha512-GC9pWCcitBhSuF7H3zl0mftoKizlswaF0E3qi+rPL417wKkCB0d+Sjjb0OfXvxj7gWiBf497ldgRMii68Xz+2g== +babel-jest@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.3.0.tgz#72237bff40e1fdaaf869bcaaa43bec58b51b6159" + integrity sha512-+Utvd2yZkT7tkgbBqVcH3uRpgRSTKRi0uBtVkjmuw2jFxp45rQ9fROSqqeHKzHYRelgdVOtQ3M745Wnyme/xOg== dependencies: - "@jest/transform" "^27.2.5" + "@jest/transform" "^27.3.0" "@jest/types" "^27.2.5" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.0.0" @@ -1499,16 +1499,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^27.2.5: - version "27.2.5" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.2.5.tgz#16154aaa60b4d9a5b0adacfea3e4d6178f4b93fd" - integrity sha512-ZrO0w7bo8BgGoP/bLz+HDCI+0Hfei9jUSZs5yI/Wyn9VkG9w8oJ7rHRgYj+MA7yqqFa0IwHA3flJzZtYugShJA== +expect@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.3.0.tgz#6cf2864a2553fe8ea68e19a6ce1641b08c3a5a98" + integrity sha512-JBRU82EBkZUBqLBAoF3ovzNGEBm14QQnePK4PmZdm6de6q/UzPnmIuWP3dRCw/FE8wRQhf/1eKzy1p1q8d6EvQ== dependencies: "@jest/types" "^27.2.5" ansi-styles "^5.0.0" jest-get-type "^27.0.6" - jest-matcher-utils "^27.2.5" - jest-message-util "^27.2.5" + jest-matcher-utils "^27.3.0" + jest-message-util "^27.3.0" jest-regex-util "^27.0.6" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: @@ -1904,84 +1904,84 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^27.2.5: - version "27.2.5" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.2.5.tgz#9dfd550d158260bcb6fa80aff491f5647f7daeca" - integrity sha512-jfnNJzF89csUKRPKJ4MwZ1SH27wTmX2xiAIHUHrsb/OYd9Jbo4/SXxJ17/nnx6RIifpthk3Y+LEeOk+/dDeGdw== +jest-changed-files@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.3.0.tgz#22a02cc2b34583fc66e443171dc271c0529d263c" + integrity sha512-9DJs9garMHv4RhylUMZgbdCJ3+jHSkpL9aaVKp13xtXAD80qLTLrqcDZL1PHA9dYA0bCI86Nv2BhkLpLhrBcPg== dependencies: "@jest/types" "^27.2.5" execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.2.5: - version "27.2.5" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.2.5.tgz#573256a6fb6e447ac2fc7e0ade9375013309037f" - integrity sha512-eyL9IcrAxm3Saq3rmajFCwpaxaRMGJ1KJs+7hlTDinXpJmeR3P02bheM3CYohE7UfwOBmrFMJHjgo/WPcLTM+Q== +jest-circus@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.3.0.tgz#adc822231f5e634bd676a1eeaa7f4cd6b840cc1d" + integrity sha512-i2P6t92Z6qujHD7C0nVYWm9YofUBMbOOTE9q9vEGi9qFotKUZv1H8M0H3NPTOWButgFuSXZfcwGBXGDAt7b9NA== dependencies: - "@jest/environment" "^27.2.5" - "@jest/test-result" "^27.2.5" + "@jest/environment" "^27.3.0" + "@jest/test-result" "^27.3.0" "@jest/types" "^27.2.5" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" - expect "^27.2.5" + expect "^27.3.0" is-generator-fn "^2.0.0" - jest-each "^27.2.5" - jest-matcher-utils "^27.2.5" - jest-message-util "^27.2.5" - jest-runtime "^27.2.5" - jest-snapshot "^27.2.5" - jest-util "^27.2.5" - pretty-format "^27.2.5" + jest-each "^27.3.0" + jest-matcher-utils "^27.3.0" + jest-message-util "^27.3.0" + jest-runtime "^27.3.0" + jest-snapshot "^27.3.0" + jest-util "^27.3.0" + pretty-format "^27.3.0" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.2.5: - version "27.2.5" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.2.5.tgz#88718c8f05f1c0f209152952ecd61afe4c3311bb" - integrity sha512-XzfcOXi5WQrXqFYsDxq5RDOKY4FNIgBgvgf3ZBz4e/j5/aWep5KnsAYH5OFPMdX/TP/LFsYQMRH7kzJUMh6JKg== +jest-cli@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.3.0.tgz#f9d4278c6ffa1a77127d9d22d7167c2606b1a0f5" + integrity sha512-PUM2RHhqgGRuGc+7QTuyfqPPWGDTCQNMKhtlVBTBYOvhP+7g8a1a7OztM/wfpsKHfqQLHFIe1Mms6jVSXSi4Vg== dependencies: - "@jest/core" "^27.2.5" - "@jest/test-result" "^27.2.5" + "@jest/core" "^27.3.0" + "@jest/test-result" "^27.3.0" "@jest/types" "^27.2.5" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.2.5" - jest-util "^27.2.5" - jest-validate "^27.2.5" + jest-config "^27.3.0" + jest-util "^27.3.0" + jest-validate "^27.3.0" prompts "^2.0.1" yargs "^16.2.0" -jest-config@^27.2.5: - version "27.2.5" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.2.5.tgz#c2e4ec6ea2bf4ffd2cae3d927999fe6159cba207" - integrity sha512-QdENtn9b5rIIYGlbDNEcgY9LDL5kcokJnXrp7x8AGjHob/XFqw1Z6p+gjfna2sUulQsQ3ce2Fvntnv+7fKYDhQ== +jest-config@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.3.0.tgz#d5d614098e042b4b33ca8a19aca93f8cc82999a4" + integrity sha512-hGknSnu6qJmwENNSUNY4qQjE9PENIYp4P8yHLVzo7qoQN4wuYHZuZEwAKaoQ66iHeSXmcZkCqFvAUa5WFdB0sg== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.2.5" + "@jest/test-sequencer" "^27.3.0" "@jest/types" "^27.2.5" - babel-jest "^27.2.5" + babel-jest "^27.3.0" chalk "^4.0.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" is-ci "^3.0.0" - jest-circus "^27.2.5" - jest-environment-jsdom "^27.2.5" - jest-environment-node "^27.2.5" + jest-circus "^27.3.0" + jest-environment-jsdom "^27.3.0" + jest-environment-node "^27.3.0" jest-get-type "^27.0.6" - jest-jasmine2 "^27.2.5" + jest-jasmine2 "^27.3.0" jest-regex-util "^27.0.6" - jest-resolve "^27.2.5" - jest-runner "^27.2.5" - jest-util "^27.2.5" - jest-validate "^27.2.5" + jest-resolve "^27.3.0" + jest-runner "^27.3.0" + jest-util "^27.3.0" + jest-validate "^27.3.0" micromatch "^4.0.4" - pretty-format "^27.2.5" + pretty-format "^27.3.0" jest-diff@^27.0.0: version "27.2.0" @@ -1993,15 +1993,15 @@ jest-diff@^27.0.0: jest-get-type "^27.0.6" pretty-format "^27.2.0" -jest-diff@^27.2.5: - version "27.2.5" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.2.5.tgz#908f7a6aca5653824516ad30e0a9fd9767e53623" - integrity sha512-7gfwwyYkeslOOVQY4tVq5TaQa92mWfC9COsVYMNVYyJTOYAqbIkoD3twi5A+h+tAPtAelRxkqY6/xu+jwTr0dA== +jest-diff@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.3.0.tgz#4d6f6f9d34f7e2a359b3c7eb142bba4de1e37695" + integrity sha512-Nl2rE58B2ye+RvPcU4hN+6wBCHxX7aWz6RMTMFxe9jAg8ZueMj5QQ+T/nmHRutbBc5BEjrbbEWOrRzp9rUEsYA== dependencies: chalk "^4.0.0" diff-sequences "^27.0.6" jest-get-type "^27.0.6" - pretty-format "^27.2.5" + pretty-format "^27.3.0" jest-docblock@^27.0.6: version "27.0.6" @@ -2010,51 +2010,51 @@ jest-docblock@^27.0.6: dependencies: detect-newline "^3.0.0" -jest-each@^27.2.5: - version "27.2.5" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.2.5.tgz#378118d516db730b92096a9607b8711165946353" - integrity sha512-HUPWIbJT0bXarRwKu/m7lYzqxR4GM5EhKOsu0z3t0SKtbFN6skQhpAUADM4qFShBXb9zoOuag5lcrR1x/WM+Ag== +jest-each@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.3.0.tgz#7976cf15bebeef28aa5108a589f4c335b6f0eec9" + integrity sha512-i7qQt+puYusxOoiNyq/M6EyNcfEbvKvqOp89FbiHfm6/POTxgzpp5wAmoS9+BAssoX20t7Zt1A1M7yT3FLVvdg== dependencies: "@jest/types" "^27.2.5" chalk "^4.0.0" jest-get-type "^27.0.6" - jest-util "^27.2.5" - pretty-format "^27.2.5" + jest-util "^27.3.0" + pretty-format "^27.3.0" -jest-environment-jsdom@^27.2.5: - version "27.2.5" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.2.5.tgz#21de3ad0e89441d961b592ba7561b16241279208" - integrity sha512-QtRpOh/RQKuXniaWcoFE2ElwP6tQcyxHu0hlk32880g0KczdonCs5P1sk5+weu/OVzh5V4Bt1rXuQthI01mBLg== +jest-environment-jsdom@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.3.0.tgz#bdf6282ff12a68fbc77cb26d6f56c6bddddd5f58" + integrity sha512-2R1w1z7ZlQkK22bo/MrMp7ItuCxXXFspn3HNdbusbtW4OfutaPNWPmAch1Shtuu7G75jEnDb2q0PXSfFD6kEHQ== dependencies: - "@jest/environment" "^27.2.5" - "@jest/fake-timers" "^27.2.5" + "@jest/environment" "^27.3.0" + "@jest/fake-timers" "^27.3.0" "@jest/types" "^27.2.5" "@types/node" "*" - jest-mock "^27.2.5" - jest-util "^27.2.5" + jest-mock "^27.3.0" + jest-util "^27.3.0" jsdom "^16.6.0" -jest-environment-node@^27.2.5: - version "27.2.5" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.2.5.tgz#ffa1afb3604c640ec841f044d526c65912e02cef" - integrity sha512-0o1LT4grm7iwrS8fIoLtwJxb/hoa3GsH7pP10P02Jpj7Mi4BXy65u46m89vEM2WfD1uFJQ2+dfDiWZNA2e6bJg== +jest-environment-node@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.3.0.tgz#32483ad819a4b93ba8cf89614a5fb108efba6566" + integrity sha512-bH2Zb73K4x2Yw8j83mmlJUUOFJLzwIpupRvlS9PXiCeIgVTPxL5syBeq5lz310DQBQkNLDTSD5+yYRhheVKvWg== dependencies: - "@jest/environment" "^27.2.5" - "@jest/fake-timers" "^27.2.5" + "@jest/environment" "^27.3.0" + "@jest/fake-timers" "^27.3.0" "@jest/types" "^27.2.5" "@types/node" "*" - jest-mock "^27.2.5" - jest-util "^27.2.5" + jest-mock "^27.3.0" + jest-util "^27.3.0" jest-get-type@^27.0.6: version "27.0.6" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.6.tgz#0eb5c7f755854279ce9b68a9f1a4122f69047cfe" integrity sha512-XTkK5exIeUbbveehcSR8w0bhH+c0yloW/Wpl+9vZrjzztCPWrxhHwkIFpZzCt71oRBsgxmuUfxEqOYoZI2macg== -jest-haste-map@^27.2.5: - version "27.2.5" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.2.5.tgz#0247b7299250643472bbcf5b4ad85c72d5178e2e" - integrity sha512-pzO+Gw2WLponaSi0ilpzYBE0kuVJstoXBX8YWyUebR8VaXuX4tzzn0Zp23c/WaETo7XYTGv2e8KdnpiskAFMhQ== +jest-haste-map@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.3.0.tgz#06305f57064af766fdbb54da4c4bc663f72e8a78" + integrity sha512-HV7BXCWhHFuQyLCnmy+VzvYQDccTdt5gpmt2abwIrWTnQiHNAklLB3Djq7Ze3OypTmWBMLgF8AHcKNmLKx8Rzw== dependencies: "@jest/types" "^27.2.5" "@types/graceful-fs" "^4.1.2" @@ -2064,59 +2064,59 @@ jest-haste-map@^27.2.5: graceful-fs "^4.2.4" jest-regex-util "^27.0.6" jest-serializer "^27.0.6" - jest-util "^27.2.5" - jest-worker "^27.2.5" + jest-util "^27.3.0" + jest-worker "^27.3.0" micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.2.5: - version "27.2.5" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.2.5.tgz#baaf96c69913c52bce0100000cf0721027c0fd66" - integrity sha512-hdxY9Cm/CjLqu2tXeAoQHPgA4vcqlweVXYOg1+S9FeFdznB9Rti+eEBKDDkmOy9iqr4Xfbq95OkC4NFbXXPCAQ== +jest-jasmine2@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.3.0.tgz#d5ac6bec10f6696da99d990bf3df2377578fd331" + integrity sha512-c12xS913sE56pBYZYIuukttDyMJTgK+T/aYKuHse/jyBHk2r78IFxrEl0BL8iiezLZw6g6bKtyww/j9XWOVxqg== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^27.2.5" + "@jest/environment" "^27.3.0" "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.2.5" + "@jest/test-result" "^27.3.0" "@jest/types" "^27.2.5" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^27.2.5" + expect "^27.3.0" is-generator-fn "^2.0.0" - jest-each "^27.2.5" - jest-matcher-utils "^27.2.5" - jest-message-util "^27.2.5" - jest-runtime "^27.2.5" - jest-snapshot "^27.2.5" - jest-util "^27.2.5" - pretty-format "^27.2.5" + jest-each "^27.3.0" + jest-matcher-utils "^27.3.0" + jest-message-util "^27.3.0" + jest-runtime "^27.3.0" + jest-snapshot "^27.3.0" + jest-util "^27.3.0" + pretty-format "^27.3.0" throat "^6.0.1" -jest-leak-detector@^27.2.5: - version "27.2.5" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.2.5.tgz#e2edc3b37d38e8d9a527e10e456b403c3151b206" - integrity sha512-HYsi3GUR72bYhOGB5C5saF9sPdxGzSjX7soSQS+BqDRysc7sPeBwPbhbuT8DnOpijnKjgwWQ8JqvbmReYnt3aQ== +jest-leak-detector@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.3.0.tgz#2a881226a08068f6c2f3f238a65a788d4d3e787e" + integrity sha512-xlCDZUaVVpCOAAiW7b8sgxIzTkEmpElwmWe9wVdU01WnFCvQ0aQiq2JTNbeCgalhjxJVeZlACRHIsLjWrmtlRA== dependencies: jest-get-type "^27.0.6" - pretty-format "^27.2.5" + pretty-format "^27.3.0" -jest-matcher-utils@^27.2.5: - version "27.2.5" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.2.5.tgz#4684faaa8eb32bf15e6edaead6834031897e2980" - integrity sha512-qNR/kh6bz0Dyv3m68Ck2g1fLW5KlSOUNcFQh87VXHZwWc/gY6XwnKofx76Qytz3x5LDWT09/2+yXndTkaG4aWg== +jest-matcher-utils@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.3.0.tgz#82c41750db4384d7a8db319348752df2bb0acf7a" + integrity sha512-AK2ds5J29PJcZhfJ/5J8ycbjCXTHnwc6lQeOV1a1GahU1MCpSvyHG1iIevyvp6PXPy6r0q9ywGdCObWHmkK16g== dependencies: chalk "^4.0.0" - jest-diff "^27.2.5" + jest-diff "^27.3.0" jest-get-type "^27.0.6" - pretty-format "^27.2.5" + pretty-format "^27.3.0" -jest-message-util@^27.2.5: - version "27.2.5" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.2.5.tgz#ed8b7b0965247bb875a49c1f9b9ab2d1d0820028" - integrity sha512-ggXSLoPfIYcbmZ8glgEJZ8b+e0Msw/iddRmgkoO7lDAr9SmI65IIfv7VnvTnV4FGnIIUIjzM+fHRHO5RBvyAbQ== +jest-message-util@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.3.0.tgz#d64d24c2f19111ea916c092fea015076bb7615fe" + integrity sha512-0c79aomiyE3mlta4NCWsICydvv2W0HlM/eVx46YEO+vdDuwUvNuQn8LqOtcHC1hSd25i03RrPvscrWgHBJQpRQ== dependencies: "@babel/code-frame" "^7.12.13" "@jest/types" "^27.2.5" @@ -2124,14 +2124,14 @@ jest-message-util@^27.2.5: chalk "^4.0.0" graceful-fs "^4.2.4" micromatch "^4.0.4" - pretty-format "^27.2.5" + pretty-format "^27.3.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^27.2.5: - version "27.2.5" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.2.5.tgz#0ec38d5ff1e49c4802e7a4a8179e8d7a2fd84de0" - integrity sha512-HiMB3LqE9RzmeMzZARi2Bz3NoymxyP0gCid4y42ca1djffNtYFKgI220aC1VP1mUZ8rbpqZbHZOJ15093bZV/Q== +jest-mock@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.3.0.tgz#ddf0ec3cc3e68c8ccd489bef4d1f525571a1b867" + integrity sha512-ziZiLk0elZOQjD08bLkegBzv5hCABu/c8Ytx45nJKkysQwGaonvmTxwjLqEA4qGdasq9o2I8/HtdGMNnVsMTGw== dependencies: "@jest/types" "^27.2.5" "@types/node" "*" @@ -2146,40 +2146,40 @@ jest-regex-util@^27.0.6: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.6.tgz#02e112082935ae949ce5d13b2675db3d8c87d9c5" integrity sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ== -jest-resolve-dependencies@^27.2.5: - version "27.2.5" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.2.5.tgz#fcd8eca005b3d11ba32da443045c028164b83be1" - integrity sha512-BSjefped31bcvvCh++/pN9ueqqN1n0+p8/58yScuWfklLm2tbPbS9d251vJhAy0ZI2pL/0IaGhOTJrs9Y4FJlg== +jest-resolve-dependencies@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.3.0.tgz#1467ed51d87635aec7133b2e29a283500f4609d1" + integrity sha512-YVmlWHdSUCOLrJl8lOIjda6+DtbgOCfExfoSx9gvHFYaXPq0UP2EELiX514H0rURTbSaLsDTodLNyqqEd/IqeA== dependencies: "@jest/types" "^27.2.5" jest-regex-util "^27.0.6" - jest-snapshot "^27.2.5" + jest-snapshot "^27.3.0" -jest-resolve@^27.2.5: - version "27.2.5" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.2.5.tgz#04dadbfc1312a2541f5c199c5011945e9cfe5cef" - integrity sha512-q5irwS3oS73SKy3+FM/HL2T7WJftrk9BRzrXF92f7net5HMlS7lJMg/ZwxLB4YohKqjSsdksEw7n/jvMxV7EKg== +jest-resolve@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.3.0.tgz#ffd1db6828b3ee2243f4e4973d80d02e988f2443" + integrity sha512-SZxjtEkM0+f5vxJVpaGztQfnzEqgVnQqHzeGW1P9UON9qDtAET01HWaPCnb10SNUaNRG9NhhOMP418zl44FaIA== dependencies: "@jest/types" "^27.2.5" chalk "^4.0.0" - escalade "^3.1.1" graceful-fs "^4.2.4" - jest-haste-map "^27.2.5" + jest-haste-map "^27.3.0" jest-pnp-resolver "^1.2.2" - jest-util "^27.2.5" - jest-validate "^27.2.5" + jest-util "^27.3.0" + jest-validate "^27.3.0" resolve "^1.20.0" + resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^27.2.5: - version "27.2.5" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.2.5.tgz#3d9d0626f351480bb2cffcfbbfac240c0097ebd4" - integrity sha512-n41vw9RLg5TKAnEeJK9d6pGOsBOpwE89XBniK+AD1k26oIIy3V7ogM1scbDjSheji8MUPC9pNgCrZ/FHLVDNgg== +jest-runner@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.3.0.tgz#0affed8232bf50daacb186091a98e4c50cc83c7a" + integrity sha512-gbkXXJdV5YpGjHvHZAAl5905qAgi+HLYO9lvLqGBxAWpx+oPOpBcMZfkRef7u86heZj1lmULzEdLjY459Z+rNQ== dependencies: - "@jest/console" "^27.2.5" - "@jest/environment" "^27.2.5" - "@jest/test-result" "^27.2.5" - "@jest/transform" "^27.2.5" + "@jest/console" "^27.3.0" + "@jest/environment" "^27.3.0" + "@jest/test-result" "^27.3.0" + "@jest/transform" "^27.3.0" "@jest/types" "^27.2.5" "@types/node" "*" chalk "^4.0.0" @@ -2187,30 +2187,29 @@ jest-runner@^27.2.5: exit "^0.1.2" graceful-fs "^4.2.4" jest-docblock "^27.0.6" - jest-environment-jsdom "^27.2.5" - jest-environment-node "^27.2.5" - jest-haste-map "^27.2.5" - jest-leak-detector "^27.2.5" - jest-message-util "^27.2.5" - jest-resolve "^27.2.5" - jest-runtime "^27.2.5" - jest-util "^27.2.5" - jest-worker "^27.2.5" + jest-environment-jsdom "^27.3.0" + jest-environment-node "^27.3.0" + jest-haste-map "^27.3.0" + jest-leak-detector "^27.3.0" + jest-message-util "^27.3.0" + jest-resolve "^27.3.0" + jest-runtime "^27.3.0" + jest-util "^27.3.0" + jest-worker "^27.3.0" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.2.5: - version "27.2.5" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.2.5.tgz#d144c3f6889b927aae1e695b63a41a3323b7016b" - integrity sha512-N0WRZ3QszKyZ3Dm27HTBbBuestsSd3Ud5ooVho47XZJ8aSKO/X1Ag8M1dNx9XzfGVRNdB/xCA3lz8MJwIzPLLA== +jest-runtime@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.3.0.tgz#6957699d74a675441f50627bca9fe8b035c82b83" + integrity sha512-CRhIM45UlYVY2u5IfCx+0jsCm6DLvY9fz34CzDi3c4W1prb7hGKLOJlxbayQIHHMhUx22WhK4eRqXjOKDnKdAQ== dependencies: - "@jest/console" "^27.2.5" - "@jest/environment" "^27.2.5" - "@jest/fake-timers" "^27.2.5" - "@jest/globals" "^27.2.5" + "@jest/console" "^27.3.0" + "@jest/environment" "^27.3.0" + "@jest/globals" "^27.3.0" "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.2.5" - "@jest/transform" "^27.2.5" + "@jest/test-result" "^27.3.0" + "@jest/transform" "^27.3.0" "@jest/types" "^27.2.5" "@types/yargs" "^16.0.0" chalk "^4.0.0" @@ -2220,14 +2219,14 @@ jest-runtime@^27.2.5: exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-haste-map "^27.2.5" - jest-message-util "^27.2.5" - jest-mock "^27.2.5" + jest-haste-map "^27.3.0" + jest-message-util "^27.3.0" + jest-mock "^27.3.0" jest-regex-util "^27.0.6" - jest-resolve "^27.2.5" - jest-snapshot "^27.2.5" - jest-util "^27.2.5" - jest-validate "^27.2.5" + jest-resolve "^27.3.0" + jest-snapshot "^27.3.0" + jest-util "^27.3.0" + jest-validate "^27.3.0" slash "^3.0.0" strip-bom "^4.0.0" yargs "^16.2.0" @@ -2240,10 +2239,10 @@ jest-serializer@^27.0.6: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^27.2.5: - version "27.2.5" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.2.5.tgz#8a612fe31e2967f58ad364542198dff61f92ef32" - integrity sha512-2/Jkn+VN6Abwz0llBltZaiJMnL8b1j5Bp/gRIxe9YR3FCEh9qp0TXVV0dcpTGZ8AcJV1SZGQkczewkI9LP5yGw== +jest-snapshot@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.3.0.tgz#3792e1d22633050a1817c3e0d9a18666d43746ee" + integrity sha512-JaFXNS6D1BxvU2ORKaQwpen3Qic7IJAtGb09lbYiYk/GXXlde67Ts990i2nC5oBs0CstbeQE3jTeRayIZpM1Pw== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" @@ -2251,26 +2250,26 @@ jest-snapshot@^27.2.5: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/transform" "^27.2.5" + "@jest/transform" "^27.3.0" "@jest/types" "^27.2.5" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.2.5" + expect "^27.3.0" graceful-fs "^4.2.4" - jest-diff "^27.2.5" + jest-diff "^27.3.0" jest-get-type "^27.0.6" - jest-haste-map "^27.2.5" - jest-matcher-utils "^27.2.5" - jest-message-util "^27.2.5" - jest-resolve "^27.2.5" - jest-util "^27.2.5" + jest-haste-map "^27.3.0" + jest-matcher-utils "^27.3.0" + jest-message-util "^27.3.0" + jest-resolve "^27.3.0" + jest-util "^27.3.0" natural-compare "^1.4.0" - pretty-format "^27.2.5" + pretty-format "^27.3.0" semver "^7.3.2" -jest-util@^27.0.0, jest-util@^27.2.5: +jest-util@^27.0.0: version "27.2.5" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.2.5.tgz#88740c4024d223634a82ce7c2263e8bc6df3b3ba" integrity sha512-QRhDC6XxISntMzFRd/OQ6TGsjbzA5ONO0tlAj2ElHs155x1aEr0rkYJBEysG6H/gZVH3oGFzCdAB/GA8leh8NQ== @@ -2282,48 +2281,60 @@ jest-util@^27.0.0, jest-util@^27.2.5: is-ci "^3.0.0" picomatch "^2.2.3" -jest-validate@^27.2.5: - version "27.2.5" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.2.5.tgz#2d59bf1627d180f395ba58f24599b0ee0efcfbdf" - integrity sha512-XgYtjS89nhVe+UfkbLgcm+GgXKWgL80t9nTcNeejyO3t0Sj/yHE8BtIJqjZu9NXQksYbGImoQRXmQ1gP+Guffw== +jest-util@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.3.0.tgz#178f211d308c25c9593d1c5a2f2b3aef28411741" + integrity sha512-SFSDBGKkxXi4jClmU1WLp/cMMlb4YX6+5Lb0CUySxmonArio8yJ2NALMWvQuXchgySiH7Rb912hVZ2QZ6t3x7w== + dependencies: + "@jest/types" "^27.2.5" + "@types/node" "*" + chalk "^4.0.0" + graceful-fs "^4.2.4" + is-ci "^3.0.0" + picomatch "^2.2.3" + +jest-validate@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.3.0.tgz#1a92dd52d0a493037f6e1776c49457c031e0adc8" + integrity sha512-5oqWnb9MrkicE+ywR+BxoZr0L7H3WBDAt6LZggnyFHieAk8nnIQAKRpSodNPhiNJTwaMSbNjCe7SxAzKwTsBoA== dependencies: "@jest/types" "^27.2.5" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^27.0.6" leven "^3.1.0" - pretty-format "^27.2.5" + pretty-format "^27.3.0" -jest-watcher@^27.2.5: - version "27.2.5" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.2.5.tgz#41cd3e64dc5bea8a4327083d71ba7667be400567" - integrity sha512-umV4qGozg2Dn6DTTtqAh9puPw+DGLK9AQas7+mWjiK8t0fWMpxKg8ZXReZw7L4C88DqorsGUiDgwHNZ+jkVrkQ== +jest-watcher@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.3.0.tgz#13730b347e2ae8ba3c9435055bdad2ad73e5c348" + integrity sha512-xpTFRhqzUnNwTGaSBoHcyXROGbAfj2u4LS7Xosb+hzgrFgWgiHtCy3PWyN1DQk31Na98bBjXKxAbfSBACrvEiQ== dependencies: - "@jest/test-result" "^27.2.5" + "@jest/test-result" "^27.3.0" "@jest/types" "^27.2.5" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^27.2.5" + jest-util "^27.3.0" string-length "^4.0.1" -jest-worker@^27.2.5: - version "27.2.5" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.2.5.tgz#ed42865661959488aa020e8a325df010597c36d4" - integrity sha512-HTjEPZtcNKZ4LnhSp02NEH4vE+5OpJ0EsOWYvGQpHgUMLngydESAAMH5Wd/asPf29+XUDQZszxpLg1BkIIA2aw== +jest-worker@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.3.0.tgz#6b636b63b6672208b91b92d8dcde112d1d4dba2d" + integrity sha512-xTTvvJqOjKBqE1AmwDHiQN8qzp9VoT981LtfXA+XiJVxHn4435vpnrzVcJ6v/ESiuB+IXPjZakn/ppT00xBCWA== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^27.0.1: - version "27.2.5" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.2.5.tgz#7d8a5c8781a160f693beeb7c68e46c16ef948148" - integrity sha512-vDMzXcpQN4Ycaqu+vO7LX8pZwNNoKMhc+gSp6q1D8S6ftRk8gNW8cni3YFxknP95jxzQo23Lul0BI2FrWgnwYQ== + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.3.0.tgz#25f0e02aaa51d53bc6e1941eb4838a3452f3320e" + integrity sha512-ZSwT6ROUbUs3bXirxzxBvohE/1y7t+IHIu3fL8WgIeJppE2XsFoa2dB03CI9kXA81znW0Kt0t2R+QVOWeY8cYw== dependencies: - "@jest/core" "^27.2.5" + "@jest/core" "^27.3.0" import-local "^3.0.2" - jest-cli "^27.2.5" + jest-cli "^27.3.0" js-tokens@^4.0.0: version "4.0.0" @@ -2725,10 +2736,10 @@ pretty-format@^27.0.0, pretty-format@^27.2.0: ansi-styles "^5.0.0" react-is "^17.0.1" -pretty-format@^27.2.5: - version "27.2.5" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.2.5.tgz#7cfe2a8e8f01a5b5b29296a0b70f4140df0830c5" - integrity sha512-+nYn2z9GgicO9JiqmY25Xtq8SYfZ/5VCpEU3pppHHNAhd1y+ZXxmNPd1evmNcAd6Hz4iBV2kf0UpGth5A/VJ7g== +pretty-format@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.3.0.tgz#ab4679ffc25dd9bc29bab220a4a70a873a19600e" + integrity sha512-Nkdd0xmxZdjCe6GoJomHnrLcCYGYzZKI/fRnUX0sCwDai2mmCHJfC9Ecx33lYgaxAFS/pJCAqhfxmWlm1wNVag== dependencies: "@jest/types" "^27.2.5" ansi-regex "^5.0.1" @@ -2820,6 +2831,11 @@ resolve-from@^5.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== +resolve.exports@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.0.tgz#5ce842b94b05146c0e03076985d1d0e7e48c90c9" + integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== + resolve@^1.20.0: version "1.20.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" From 7f5c9af11ac2abfd3a865ab643011cc2e035404b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Oct 2021 12:02:01 +0000 Subject: [PATCH 336/785] Bump ts-jest from 27.0.6 to 27.0.7 Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 27.0.6 to 27.0.7. - [Release notes](https://github.com/kulshekhar/ts-jest/releases) - [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/kulshekhar/ts-jest/compare/v27.0.6...v27.0.7) --- updated-dependencies: - dependency-name: ts-jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index e767e3de..0f98fadf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3093,9 +3093,9 @@ tr46@^2.1.0: punycode "^2.1.1" ts-jest@^27.0.5: - version "27.0.6" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.0.6.tgz#9960dbbdb33792b79c5ee24d1c62514fd7b60052" - integrity sha512-XWkEBbrkyUWJdK9FwiCVdBZ7ZmT7sxcKtyVEZNmo7u8eQw6NHmtYEM2WpkX9VfnRI0DjSr6INfEHC9vCFhsFnQ== + version "27.0.7" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.0.7.tgz#fb7c8c8cb5526ab371bc1b23d06e745652cca2d0" + integrity sha512-O41shibMqzdafpuP+CkrOL7ykbmLh+FqQrXEmV9CydQ5JBk0Sj0uAEF5TNNe94fZWKm3yYvWa/IbyV4Yg1zK2Q== dependencies: bs-logger "0.x" fast-json-stable-stringify "2.x" From a627ccfcad6d5f69e2d90c6b01afb83e9d038b3d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Oct 2021 12:16:28 +0000 Subject: [PATCH 337/785] Bump @types/node from 16.11.0 to 16.11.1 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.0 to 16.11.1. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 425b1a5a..2042ec1a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -684,9 +684,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^16.9.1": - version "16.11.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.0.tgz#4b95f2327bacd1ef8f08d8ceda193039c5d7f52e" - integrity sha512-8MLkBIYQMuhRBQzGN9875bYsOhPnf/0rgXGo66S2FemHkhbn9qtsz9ywV1iCG+vbjigE4WUNVvw37Dx+L0qsPg== + version "16.11.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.1.tgz#2e50a649a50fc403433a14f829eface1a3443e97" + integrity sha512-PYGcJHL9mwl1Ek3PLiYgyEKtwTMmkMw4vbiyz/ps3pfdRYLVv+SN7qHVAImrjdAXxgluDEw6Ph4lyv+m9UpRmA== "@types/prettier@^2.1.5", "@types/prettier@^2.3.2": version "2.4.1" From 56be1bada41dc131f3fa8f13dbb7dc07a1d57008 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 18 Oct 2021 10:09:00 -0400 Subject: [PATCH 338/785] Bump to rc4 --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 513eae8a..b3da9def 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [2.0.0-rc4] + ### Added - [#993](https://github.com/prettier/plugin-ruby/pull/993) - kddnewton - Nicer error message if you don't have the necessary JavaScript files to run prettier. @@ -1178,7 +1180,8 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v2.0.0-rc3...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v2.0.0-rc4...HEAD +[2.0.0-rc4]: https://github.com/prettier/plugin-ruby/compare/v2.0.0-rc3...v2.0.0-rc4 [2.0.0-rc3]: https://github.com/prettier/plugin-ruby/compare/v2.0.0-rc2...v2.0.0-rc3 [2.0.0-rc2]: https://github.com/prettier/plugin-ruby/compare/v2.0.0-rc1...v2.0.0-rc2 [2.0.0-rc1]: https://github.com/prettier/plugin-ruby/compare/v1.6.1...v2.0.0-rc1 diff --git a/package.json b/package.json index 424eec30..5617d3ad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "2.0.0-rc3", + "version": "2.0.0-rc4", "description": "prettier plugin for the Ruby programming language", "main": "dist/plugin.js", "scripts": { From 6f937662f72513db960efef494f403901ae5f013 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Oct 2021 12:01:54 +0000 Subject: [PATCH 339/785] Bump jest from 27.3.0 to 27.3.1 Bumps [jest](https://github.com/facebook/jest) from 27.3.0 to 27.3.1. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v27.3.0...v27.3.1) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 559 +++++++++++++++++++++++++++--------------------------- 1 file changed, 282 insertions(+), 277 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2042ec1a..f4a860d2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -366,27 +366,27 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^27.3.0": - version "27.3.0" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.3.0.tgz#a55f03a4f7e1e92a5879bdab2e8b9fe4dd5312ba" - integrity sha512-+Tr/xoNiosjckq96xIGpDaGsybeIm45VWXpSvDR8T9deXmWjYKX85prhz8yFPhLG4UVOeMo/B6RI/+flw3sO8A== +"@jest/console@^27.3.1": + version "27.3.1" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.3.1.tgz#e8ea3a475d3f8162f23d69efbfaa9cbe486bee93" + integrity sha512-RkFNWmv0iui+qsOr/29q9dyfKTTT5DCuP31kUwg7rmOKPT/ozLeGLKJKVIiOfbiKyleUZKIrHwhmiZWVe8IMdw== dependencies: "@jest/types" "^27.2.5" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^27.3.0" - jest-util "^27.3.0" + jest-message-util "^27.3.1" + jest-util "^27.3.1" slash "^3.0.0" -"@jest/core@^27.3.0": - version "27.3.0" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.3.0.tgz#50a521c663181f3a34ecb24bb9fe717e125dc784" - integrity sha512-0B3PWQouwS651m8AbQDse08dfRlzLHqSmywRPGYn2ZzU6RT4aP2Xwz8mEWfSPXXZmtwAtNgUXy0Cbt6QsBqKvw== +"@jest/core@^27.3.1": + version "27.3.1" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.3.1.tgz#04992ef1b58b17c459afb87ab56d81e63d386925" + integrity sha512-DMNE90RR5QKx0EA+wqe3/TNEwiRpOkhshKNxtLxd4rt3IZpCt+RSL+FoJsGeblRZmqdK4upHA/mKKGPPRAifhg== dependencies: - "@jest/console" "^27.3.0" - "@jest/reporters" "^27.3.0" - "@jest/test-result" "^27.3.0" - "@jest/transform" "^27.3.0" + "@jest/console" "^27.3.1" + "@jest/reporters" "^27.3.1" + "@jest/test-result" "^27.3.1" + "@jest/transform" "^27.3.1" "@jest/types" "^27.2.5" "@types/node" "*" ansi-escapes "^4.2.1" @@ -395,63 +395,63 @@ exit "^0.1.2" graceful-fs "^4.2.4" jest-changed-files "^27.3.0" - jest-config "^27.3.0" - jest-haste-map "^27.3.0" - jest-message-util "^27.3.0" + jest-config "^27.3.1" + jest-haste-map "^27.3.1" + jest-message-util "^27.3.1" jest-regex-util "^27.0.6" - jest-resolve "^27.3.0" - jest-resolve-dependencies "^27.3.0" - jest-runner "^27.3.0" - jest-runtime "^27.3.0" - jest-snapshot "^27.3.0" - jest-util "^27.3.0" - jest-validate "^27.3.0" - jest-watcher "^27.3.0" + jest-resolve "^27.3.1" + jest-resolve-dependencies "^27.3.1" + jest-runner "^27.3.1" + jest-runtime "^27.3.1" + jest-snapshot "^27.3.1" + jest-util "^27.3.1" + jest-validate "^27.3.1" + jest-watcher "^27.3.1" micromatch "^4.0.4" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.3.0": - version "27.3.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.3.0.tgz#21b85e6f0baa18e92c5bb173a65c0df24565536d" - integrity sha512-OWx5RBd8QaPLlw7fL6l2IVyhYDpamaW3dDXlBnXb4IPGCIwoXAHZkmHV+VPIzb6xAkcPyXOmVm/rSaEneTqweg== +"@jest/environment@^27.3.1": + version "27.3.1" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.3.1.tgz#2182defbce8d385fd51c5e7c7050f510bd4c86b1" + integrity sha512-BCKCj4mOVLme6Tanoyc9k0ultp3pnmuyHw73UHRPeeZxirsU/7E3HC4le/VDb/SMzE1JcPnto+XBKFOcoiJzVw== dependencies: - "@jest/fake-timers" "^27.3.0" + "@jest/fake-timers" "^27.3.1" "@jest/types" "^27.2.5" "@types/node" "*" jest-mock "^27.3.0" -"@jest/fake-timers@^27.3.0": - version "27.3.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.3.0.tgz#716f166f56abc01901b7823da503bf16c8a00ade" - integrity sha512-GCWgnItK6metb75QKflFxcVRlraVGomZonBQ+9B5UPc6wxBB3xzS7dATDWe/73R5P6BfnzCEaiizna771M5r9w== +"@jest/fake-timers@^27.3.1": + version "27.3.1" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.3.1.tgz#1fad860ee9b13034762cdb94266e95609dfce641" + integrity sha512-M3ZFgwwlqJtWZ+QkBG5NmC23A9w+A6ZxNsO5nJxJsKYt4yguBd3i8TpjQz5NfCX91nEve1KqD9RA2Q+Q1uWqoA== dependencies: "@jest/types" "^27.2.5" "@sinonjs/fake-timers" "^8.0.1" "@types/node" "*" - jest-message-util "^27.3.0" + jest-message-util "^27.3.1" jest-mock "^27.3.0" - jest-util "^27.3.0" + jest-util "^27.3.1" -"@jest/globals@^27.3.0": - version "27.3.0" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.3.0.tgz#8822f9a72aea428e3f11a688ff13c7992bfe1ea4" - integrity sha512-EEqmQHMLXgEZfchMVAavUfJuZmORRrP+zhomfREqVE85d1nccd7nw8uN4FQDJ53m5Glm1XtVCyOIJ9kQLrqjeA== +"@jest/globals@^27.3.1": + version "27.3.1" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.3.1.tgz#ce1dfb03d379237a9da6c1b99ecfaca1922a5f9e" + integrity sha512-Q651FWiWQAIFiN+zS51xqhdZ8g9b88nGCobC87argAxA7nMfNQq0Q0i9zTfQYgLa6qFXk2cGANEqfK051CZ8Pg== dependencies: - "@jest/environment" "^27.3.0" + "@jest/environment" "^27.3.1" "@jest/types" "^27.2.5" - expect "^27.3.0" + expect "^27.3.1" -"@jest/reporters@^27.3.0": - version "27.3.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.3.0.tgz#8d5fd17916aeb1ab415b3ce0a94a31bda654020b" - integrity sha512-D9QLaLgbH+nIjDbKIvoX7yiRX6aXHO56/GzOxKNzKuvJVYhrzeQHcCMttXpp5SB08TdxVvFOPKZfFvkIcVgfBA== +"@jest/reporters@^27.3.1": + version "27.3.1" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.3.1.tgz#28b5c1f5789481e23788048fa822ed15486430b9" + integrity sha512-m2YxPmL9Qn1emFVgZGEiMwDntDxRRQ2D58tiDQlwYTg5GvbFOKseYCcHtn0WsI8CG4vzPglo3nqbOiT8ySBT/w== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.3.0" - "@jest/test-result" "^27.3.0" - "@jest/transform" "^27.3.0" + "@jest/console" "^27.3.1" + "@jest/test-result" "^27.3.1" + "@jest/transform" "^27.3.1" "@jest/types" "^27.2.5" "@types/node" "*" chalk "^4.0.0" @@ -464,10 +464,10 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^27.3.0" - jest-resolve "^27.3.0" - jest-util "^27.3.0" - jest-worker "^27.3.0" + jest-haste-map "^27.3.1" + jest-resolve "^27.3.1" + jest-util "^27.3.1" + jest-worker "^27.3.1" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" @@ -483,30 +483,30 @@ graceful-fs "^4.2.4" source-map "^0.6.0" -"@jest/test-result@^27.3.0": - version "27.3.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.3.0.tgz#e093c5d9eb34afa1b653cdb550c4bcaeb3096233" - integrity sha512-5+rYZgj562oPKjExQngfboobeIF2FSrgAvoxlkrogEMIbgT7FY+VAMIkp03klVfJtqo3XKzVWkTfsDSmZFI29w== +"@jest/test-result@^27.3.1": + version "27.3.1" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.3.1.tgz#89adee8b771877c69b3b8d59f52f29dccc300194" + integrity sha512-mLn6Thm+w2yl0opM8J/QnPTqrfS4FoXsXF2WIWJb2O/GBSyResL71BRuMYbYRsGt7ELwS5JGcEcGb52BNrumgg== dependencies: - "@jest/console" "^27.3.0" + "@jest/console" "^27.3.1" "@jest/types" "^27.2.5" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.3.0": - version "27.3.0" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.3.0.tgz#ac245f4f29ce7f81ae5afa441e5bf7bbdd342ef4" - integrity sha512-6eQHyBUCtK06sPfsufzEVijZtAtT7yGR1qaAZBlcz6P+FGJ569VW2O5o7mZc+L++uZc7BH4X2Ks7SMIgy1npJw== +"@jest/test-sequencer@^27.3.1": + version "27.3.1" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.3.1.tgz#4b3bde2dbb05ee74afdae608cf0768e3354683b1" + integrity sha512-siySLo07IMEdSjA4fqEnxfIX8lB/lWYsBPwNFtkOvsFQvmBrL3yj3k3uFNZv/JDyApTakRpxbKLJ3CT8UGVCrA== dependencies: - "@jest/test-result" "^27.3.0" + "@jest/test-result" "^27.3.1" graceful-fs "^4.2.4" - jest-haste-map "^27.3.0" - jest-runtime "^27.3.0" + jest-haste-map "^27.3.1" + jest-runtime "^27.3.1" -"@jest/transform@^27.3.0": - version "27.3.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.3.0.tgz#f2a63883eaada30f8141938ec1ad23ba7fdfb97e" - integrity sha512-IKrFhIT/+WIfeNjIRKTwQN7HYCdjKF/mmBqoD660gyGWVw1MzCO9pQuEJK9GXEnFWIuOcMHlm8XfUaDohP/zxA== +"@jest/transform@^27.3.1": + version "27.3.1" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.3.1.tgz#ff80eafbeabe811e9025e4b6f452126718455220" + integrity sha512-3fSvQ02kuvjOI1C1ssqMVBKJpZf6nwoCiSu00zAKh5nrp3SptNtZy/8s5deayHnqxhjD9CWDJ+yqQwuQ0ZafXQ== dependencies: "@babel/core" "^7.1.0" "@jest/types" "^27.2.5" @@ -515,9 +515,9 @@ convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.3.0" + jest-haste-map "^27.3.1" jest-regex-util "^27.0.6" - jest-util "^27.3.0" + jest-util "^27.3.1" micromatch "^4.0.4" pirates "^4.0.1" slash "^3.0.0" @@ -926,12 +926,12 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= -babel-jest@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.3.0.tgz#72237bff40e1fdaaf869bcaaa43bec58b51b6159" - integrity sha512-+Utvd2yZkT7tkgbBqVcH3uRpgRSTKRi0uBtVkjmuw2jFxp45rQ9fROSqqeHKzHYRelgdVOtQ3M745Wnyme/xOg== +babel-jest@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.3.1.tgz#0636a3404c68e07001e434ac4956d82da8a80022" + integrity sha512-SjIF8hh/ir0peae2D6S6ZKRhUy7q/DnpH7k/V6fT4Bgs/LXXUztOpX4G2tCgq8mLo5HA9mN6NmlFMeYtKmIsTQ== dependencies: - "@jest/transform" "^27.3.0" + "@jest/transform" "^27.3.1" "@jest/types" "^27.2.5" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.0.0" @@ -1092,7 +1092,7 @@ char-regex@^1.0.2: resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== -ci-info@^3.1.1: +ci-info@^3.1.1, ci-info@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.2.0.tgz#2876cb948a498797b5236f0095bc057d0dca38b6" integrity sha512-dVqRX7fLUm8J6FgHJ418XuIgDLZDkYcDFTeL6TA2gt5WlIZUQrrH6EZrNClwT/H0FateUsZkGIOPRrLbP+PR9A== @@ -1499,16 +1499,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.3.0.tgz#6cf2864a2553fe8ea68e19a6ce1641b08c3a5a98" - integrity sha512-JBRU82EBkZUBqLBAoF3ovzNGEBm14QQnePK4PmZdm6de6q/UzPnmIuWP3dRCw/FE8wRQhf/1eKzy1p1q8d6EvQ== +expect@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.3.1.tgz#d0f170b1f5c8a2009bab0beffd4bb94f043e38e7" + integrity sha512-MrNXV2sL9iDRebWPGOGFdPQRl2eDQNu/uhxIMShjjx74T6kC6jFIkmQ6OqXDtevjGUkyB2IT56RzDBqXf/QPCg== dependencies: "@jest/types" "^27.2.5" ansi-styles "^5.0.0" - jest-get-type "^27.0.6" - jest-matcher-utils "^27.3.0" - jest-message-util "^27.3.0" + jest-get-type "^27.3.1" + jest-matcher-utils "^27.3.1" + jest-message-util "^27.3.1" jest-regex-util "^27.0.6" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: @@ -1913,75 +1913,75 @@ jest-changed-files@^27.3.0: execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.3.0.tgz#adc822231f5e634bd676a1eeaa7f4cd6b840cc1d" - integrity sha512-i2P6t92Z6qujHD7C0nVYWm9YofUBMbOOTE9q9vEGi9qFotKUZv1H8M0H3NPTOWButgFuSXZfcwGBXGDAt7b9NA== +jest-circus@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.3.1.tgz#1679e74387cbbf0c6a8b42de963250a6469e0797" + integrity sha512-v1dsM9II6gvXokgqq6Yh2jHCpfg7ZqV4jWY66u7npz24JnhP3NHxI0sKT7+ZMQ7IrOWHYAaeEllOySbDbWsiXw== dependencies: - "@jest/environment" "^27.3.0" - "@jest/test-result" "^27.3.0" + "@jest/environment" "^27.3.1" + "@jest/test-result" "^27.3.1" "@jest/types" "^27.2.5" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" - expect "^27.3.0" + expect "^27.3.1" is-generator-fn "^2.0.0" - jest-each "^27.3.0" - jest-matcher-utils "^27.3.0" - jest-message-util "^27.3.0" - jest-runtime "^27.3.0" - jest-snapshot "^27.3.0" - jest-util "^27.3.0" - pretty-format "^27.3.0" + jest-each "^27.3.1" + jest-matcher-utils "^27.3.1" + jest-message-util "^27.3.1" + jest-runtime "^27.3.1" + jest-snapshot "^27.3.1" + jest-util "^27.3.1" + pretty-format "^27.3.1" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.3.0.tgz#f9d4278c6ffa1a77127d9d22d7167c2606b1a0f5" - integrity sha512-PUM2RHhqgGRuGc+7QTuyfqPPWGDTCQNMKhtlVBTBYOvhP+7g8a1a7OztM/wfpsKHfqQLHFIe1Mms6jVSXSi4Vg== +jest-cli@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.3.1.tgz#b576f9d146ba6643ce0a162d782b40152b6b1d16" + integrity sha512-WHnCqpfK+6EvT62me6WVs8NhtbjAS4/6vZJnk7/2+oOr50cwAzG4Wxt6RXX0hu6m1169ZGMlhYYUNeKBXCph/Q== dependencies: - "@jest/core" "^27.3.0" - "@jest/test-result" "^27.3.0" + "@jest/core" "^27.3.1" + "@jest/test-result" "^27.3.1" "@jest/types" "^27.2.5" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.3.0" - jest-util "^27.3.0" - jest-validate "^27.3.0" + jest-config "^27.3.1" + jest-util "^27.3.1" + jest-validate "^27.3.1" prompts "^2.0.1" yargs "^16.2.0" -jest-config@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.3.0.tgz#d5d614098e042b4b33ca8a19aca93f8cc82999a4" - integrity sha512-hGknSnu6qJmwENNSUNY4qQjE9PENIYp4P8yHLVzo7qoQN4wuYHZuZEwAKaoQ66iHeSXmcZkCqFvAUa5WFdB0sg== +jest-config@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.3.1.tgz#cb3b7f6aaa8c0a7daad4f2b9573899ca7e09bbad" + integrity sha512-KY8xOIbIACZ/vdYCKSopL44I0xboxC751IX+DXL2+Wx6DKNycyEfV3rryC3BPm5Uq/BBqDoMrKuqLEUNJmMKKg== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.3.0" + "@jest/test-sequencer" "^27.3.1" "@jest/types" "^27.2.5" - babel-jest "^27.3.0" + babel-jest "^27.3.1" chalk "^4.0.0" + ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" - is-ci "^3.0.0" - jest-circus "^27.3.0" - jest-environment-jsdom "^27.3.0" - jest-environment-node "^27.3.0" - jest-get-type "^27.0.6" - jest-jasmine2 "^27.3.0" + jest-circus "^27.3.1" + jest-environment-jsdom "^27.3.1" + jest-environment-node "^27.3.1" + jest-get-type "^27.3.1" + jest-jasmine2 "^27.3.1" jest-regex-util "^27.0.6" - jest-resolve "^27.3.0" - jest-runner "^27.3.0" - jest-util "^27.3.0" - jest-validate "^27.3.0" + jest-resolve "^27.3.1" + jest-runner "^27.3.1" + jest-util "^27.3.1" + jest-validate "^27.3.1" micromatch "^4.0.4" - pretty-format "^27.3.0" + pretty-format "^27.3.1" jest-diff@^27.0.0: version "27.2.0" @@ -1993,15 +1993,15 @@ jest-diff@^27.0.0: jest-get-type "^27.0.6" pretty-format "^27.2.0" -jest-diff@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.3.0.tgz#4d6f6f9d34f7e2a359b3c7eb142bba4de1e37695" - integrity sha512-Nl2rE58B2ye+RvPcU4hN+6wBCHxX7aWz6RMTMFxe9jAg8ZueMj5QQ+T/nmHRutbBc5BEjrbbEWOrRzp9rUEsYA== +jest-diff@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.3.1.tgz#d2775fea15411f5f5aeda2a5e02c2f36440f6d55" + integrity sha512-PCeuAH4AWUo2O5+ksW4pL9v5xJAcIKPUPfIhZBcG1RKv/0+dvaWTQK1Nrau8d67dp65fOqbeMdoil+6PedyEPQ== dependencies: chalk "^4.0.0" diff-sequences "^27.0.6" - jest-get-type "^27.0.6" - pretty-format "^27.3.0" + jest-get-type "^27.3.1" + pretty-format "^27.3.1" jest-docblock@^27.0.6: version "27.0.6" @@ -2010,51 +2010,56 @@ jest-docblock@^27.0.6: dependencies: detect-newline "^3.0.0" -jest-each@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.3.0.tgz#7976cf15bebeef28aa5108a589f4c335b6f0eec9" - integrity sha512-i7qQt+puYusxOoiNyq/M6EyNcfEbvKvqOp89FbiHfm6/POTxgzpp5wAmoS9+BAssoX20t7Zt1A1M7yT3FLVvdg== +jest-each@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.3.1.tgz#14c56bb4f18dd18dc6bdd853919b5f16a17761ff" + integrity sha512-E4SwfzKJWYcvOYCjOxhZcxwL+AY0uFMvdCOwvzgutJiaiodFjkxQQDxHm8FQBeTqDnSmKsQWn7ldMRzTn2zJaQ== dependencies: "@jest/types" "^27.2.5" chalk "^4.0.0" - jest-get-type "^27.0.6" - jest-util "^27.3.0" - pretty-format "^27.3.0" + jest-get-type "^27.3.1" + jest-util "^27.3.1" + pretty-format "^27.3.1" -jest-environment-jsdom@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.3.0.tgz#bdf6282ff12a68fbc77cb26d6f56c6bddddd5f58" - integrity sha512-2R1w1z7ZlQkK22bo/MrMp7ItuCxXXFspn3HNdbusbtW4OfutaPNWPmAch1Shtuu7G75jEnDb2q0PXSfFD6kEHQ== +jest-environment-jsdom@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.3.1.tgz#63ac36d68f7a9303494df783494856222b57f73e" + integrity sha512-3MOy8qMzIkQlfb3W1TfrD7uZHj+xx8Olix5vMENkj5djPmRqndMaXtpnaZkxmxM+Qc3lo+yVzJjzuXbCcZjAlg== dependencies: - "@jest/environment" "^27.3.0" - "@jest/fake-timers" "^27.3.0" + "@jest/environment" "^27.3.1" + "@jest/fake-timers" "^27.3.1" "@jest/types" "^27.2.5" "@types/node" "*" jest-mock "^27.3.0" - jest-util "^27.3.0" + jest-util "^27.3.1" jsdom "^16.6.0" -jest-environment-node@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.3.0.tgz#32483ad819a4b93ba8cf89614a5fb108efba6566" - integrity sha512-bH2Zb73K4x2Yw8j83mmlJUUOFJLzwIpupRvlS9PXiCeIgVTPxL5syBeq5lz310DQBQkNLDTSD5+yYRhheVKvWg== +jest-environment-node@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.3.1.tgz#af7d0eed04edafb740311b303f3fe7c8c27014bb" + integrity sha512-T89F/FgkE8waqrTSA7/ydMkcc52uYPgZZ6q8OaZgyiZkJb5QNNCF6oPZjH9IfPFfcc9uBWh1574N0kY0pSvTXw== dependencies: - "@jest/environment" "^27.3.0" - "@jest/fake-timers" "^27.3.0" + "@jest/environment" "^27.3.1" + "@jest/fake-timers" "^27.3.1" "@jest/types" "^27.2.5" "@types/node" "*" jest-mock "^27.3.0" - jest-util "^27.3.0" + jest-util "^27.3.1" jest-get-type@^27.0.6: version "27.0.6" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.6.tgz#0eb5c7f755854279ce9b68a9f1a4122f69047cfe" integrity sha512-XTkK5exIeUbbveehcSR8w0bhH+c0yloW/Wpl+9vZrjzztCPWrxhHwkIFpZzCt71oRBsgxmuUfxEqOYoZI2macg== -jest-haste-map@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.3.0.tgz#06305f57064af766fdbb54da4c4bc663f72e8a78" - integrity sha512-HV7BXCWhHFuQyLCnmy+VzvYQDccTdt5gpmt2abwIrWTnQiHNAklLB3Djq7Ze3OypTmWBMLgF8AHcKNmLKx8Rzw== +jest-get-type@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.3.1.tgz#a8a2b0a12b50169773099eee60a0e6dd11423eff" + integrity sha512-+Ilqi8hgHSAdhlQ3s12CAVNd8H96ZkQBfYoXmArzZnOfAtVAJEiPDBirjByEblvG/4LPJmkL+nBqPO3A1YJAEg== + +jest-haste-map@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.3.1.tgz#7656fbd64bf48bda904e759fc9d93e2c807353ee" + integrity sha512-lYfNZIzwPccDJZIyk9Iz5iQMM/MH56NIIcGj7AFU1YyA4ewWFBl8z+YPJuSCRML/ee2cCt2y3W4K3VXPT6Nhzg== dependencies: "@jest/types" "^27.2.5" "@types/graceful-fs" "^4.1.2" @@ -2064,59 +2069,59 @@ jest-haste-map@^27.3.0: graceful-fs "^4.2.4" jest-regex-util "^27.0.6" jest-serializer "^27.0.6" - jest-util "^27.3.0" - jest-worker "^27.3.0" + jest-util "^27.3.1" + jest-worker "^27.3.1" micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.3.0.tgz#d5ac6bec10f6696da99d990bf3df2377578fd331" - integrity sha512-c12xS913sE56pBYZYIuukttDyMJTgK+T/aYKuHse/jyBHk2r78IFxrEl0BL8iiezLZw6g6bKtyww/j9XWOVxqg== +jest-jasmine2@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.3.1.tgz#df6d3d07c7dafc344feb43a0072a6f09458d32b0" + integrity sha512-WK11ZUetDQaC09w4/j7o4FZDUIp+4iYWH/Lik34Pv7ukL+DuXFGdnmmi7dT58J2ZYKFB5r13GyE0z3NPeyJmsg== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^27.3.0" + "@jest/environment" "^27.3.1" "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.3.0" + "@jest/test-result" "^27.3.1" "@jest/types" "^27.2.5" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^27.3.0" + expect "^27.3.1" is-generator-fn "^2.0.0" - jest-each "^27.3.0" - jest-matcher-utils "^27.3.0" - jest-message-util "^27.3.0" - jest-runtime "^27.3.0" - jest-snapshot "^27.3.0" - jest-util "^27.3.0" - pretty-format "^27.3.0" + jest-each "^27.3.1" + jest-matcher-utils "^27.3.1" + jest-message-util "^27.3.1" + jest-runtime "^27.3.1" + jest-snapshot "^27.3.1" + jest-util "^27.3.1" + pretty-format "^27.3.1" throat "^6.0.1" -jest-leak-detector@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.3.0.tgz#2a881226a08068f6c2f3f238a65a788d4d3e787e" - integrity sha512-xlCDZUaVVpCOAAiW7b8sgxIzTkEmpElwmWe9wVdU01WnFCvQ0aQiq2JTNbeCgalhjxJVeZlACRHIsLjWrmtlRA== +jest-leak-detector@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.3.1.tgz#7fb632c2992ef707a1e73286e1e704f9cc1772b2" + integrity sha512-78QstU9tXbaHzwlRlKmTpjP9k4Pvre5l0r8Spo4SbFFVy/4Abg9I6ZjHwjg2QyKEAMg020XcjP+UgLZIY50yEg== dependencies: - jest-get-type "^27.0.6" - pretty-format "^27.3.0" + jest-get-type "^27.3.1" + pretty-format "^27.3.1" -jest-matcher-utils@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.3.0.tgz#82c41750db4384d7a8db319348752df2bb0acf7a" - integrity sha512-AK2ds5J29PJcZhfJ/5J8ycbjCXTHnwc6lQeOV1a1GahU1MCpSvyHG1iIevyvp6PXPy6r0q9ywGdCObWHmkK16g== +jest-matcher-utils@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.3.1.tgz#257ad61e54a6d4044e080d85dbdc4a08811e9c1c" + integrity sha512-hX8N7zXS4k+8bC1Aj0OWpGb7D3gIXxYvPNK1inP5xvE4ztbz3rc4AkI6jGVaerepBnfWB17FL5lWFJT3s7qo8w== dependencies: chalk "^4.0.0" - jest-diff "^27.3.0" - jest-get-type "^27.0.6" - pretty-format "^27.3.0" + jest-diff "^27.3.1" + jest-get-type "^27.3.1" + pretty-format "^27.3.1" -jest-message-util@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.3.0.tgz#d64d24c2f19111ea916c092fea015076bb7615fe" - integrity sha512-0c79aomiyE3mlta4NCWsICydvv2W0HlM/eVx46YEO+vdDuwUvNuQn8LqOtcHC1hSd25i03RrPvscrWgHBJQpRQ== +jest-message-util@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.3.1.tgz#f7c25688ad3410ab10bcb862bcfe3152345c6436" + integrity sha512-bh3JEmxsTZ/9rTm0jQrPElbY2+y48Rw2t47uMfByNyUVR+OfPh4anuyKsGqsNkXk/TI4JbLRZx+7p7Hdt6q1yg== dependencies: "@babel/code-frame" "^7.12.13" "@jest/types" "^27.2.5" @@ -2124,7 +2129,7 @@ jest-message-util@^27.3.0: chalk "^4.0.0" graceful-fs "^4.2.4" micromatch "^4.0.4" - pretty-format "^27.3.0" + pretty-format "^27.3.1" slash "^3.0.0" stack-utils "^2.0.3" @@ -2146,40 +2151,40 @@ jest-regex-util@^27.0.6: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.6.tgz#02e112082935ae949ce5d13b2675db3d8c87d9c5" integrity sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ== -jest-resolve-dependencies@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.3.0.tgz#1467ed51d87635aec7133b2e29a283500f4609d1" - integrity sha512-YVmlWHdSUCOLrJl8lOIjda6+DtbgOCfExfoSx9gvHFYaXPq0UP2EELiX514H0rURTbSaLsDTodLNyqqEd/IqeA== +jest-resolve-dependencies@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.3.1.tgz#85b99bdbdfa46e2c81c6228fc4c91076f624f6e2" + integrity sha512-X7iLzY8pCiYOnvYo2YrK3P9oSE8/3N2f4pUZMJ8IUcZnT81vlSonya1KTO9ZfKGuC+svE6FHK/XOb8SsoRUV1A== dependencies: "@jest/types" "^27.2.5" jest-regex-util "^27.0.6" - jest-snapshot "^27.3.0" + jest-snapshot "^27.3.1" -jest-resolve@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.3.0.tgz#ffd1db6828b3ee2243f4e4973d80d02e988f2443" - integrity sha512-SZxjtEkM0+f5vxJVpaGztQfnzEqgVnQqHzeGW1P9UON9qDtAET01HWaPCnb10SNUaNRG9NhhOMP418zl44FaIA== +jest-resolve@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.3.1.tgz#0e5542172a1aa0270be6f66a65888647bdd74a3e" + integrity sha512-Dfzt25CFSPo3Y3GCbxynRBZzxq9AdyNN+x/v2IqYx6KVT5Z6me2Z/PsSGFSv3cOSUZqJ9pHxilao/I/m9FouLw== dependencies: "@jest/types" "^27.2.5" chalk "^4.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.3.0" + jest-haste-map "^27.3.1" jest-pnp-resolver "^1.2.2" - jest-util "^27.3.0" - jest-validate "^27.3.0" + jest-util "^27.3.1" + jest-validate "^27.3.1" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.3.0.tgz#0affed8232bf50daacb186091a98e4c50cc83c7a" - integrity sha512-gbkXXJdV5YpGjHvHZAAl5905qAgi+HLYO9lvLqGBxAWpx+oPOpBcMZfkRef7u86heZj1lmULzEdLjY459Z+rNQ== +jest-runner@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.3.1.tgz#1d594dcbf3bd8600a7e839e790384559eaf96e3e" + integrity sha512-r4W6kBn6sPr3TBwQNmqE94mPlYVn7fLBseeJfo4E2uCTmAyDFm2O5DYAQAFP7Q3YfiA/bMwg8TVsciP7k0xOww== dependencies: - "@jest/console" "^27.3.0" - "@jest/environment" "^27.3.0" - "@jest/test-result" "^27.3.0" - "@jest/transform" "^27.3.0" + "@jest/console" "^27.3.1" + "@jest/environment" "^27.3.1" + "@jest/test-result" "^27.3.1" + "@jest/transform" "^27.3.1" "@jest/types" "^27.2.5" "@types/node" "*" chalk "^4.0.0" @@ -2187,29 +2192,29 @@ jest-runner@^27.3.0: exit "^0.1.2" graceful-fs "^4.2.4" jest-docblock "^27.0.6" - jest-environment-jsdom "^27.3.0" - jest-environment-node "^27.3.0" - jest-haste-map "^27.3.0" - jest-leak-detector "^27.3.0" - jest-message-util "^27.3.0" - jest-resolve "^27.3.0" - jest-runtime "^27.3.0" - jest-util "^27.3.0" - jest-worker "^27.3.0" + jest-environment-jsdom "^27.3.1" + jest-environment-node "^27.3.1" + jest-haste-map "^27.3.1" + jest-leak-detector "^27.3.1" + jest-message-util "^27.3.1" + jest-resolve "^27.3.1" + jest-runtime "^27.3.1" + jest-util "^27.3.1" + jest-worker "^27.3.1" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.3.0.tgz#6957699d74a675441f50627bca9fe8b035c82b83" - integrity sha512-CRhIM45UlYVY2u5IfCx+0jsCm6DLvY9fz34CzDi3c4W1prb7hGKLOJlxbayQIHHMhUx22WhK4eRqXjOKDnKdAQ== +jest-runtime@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.3.1.tgz#80fa32eb85fe5af575865ddf379874777ee993d7" + integrity sha512-qtO6VxPbS8umqhEDpjA4pqTkKQ1Hy4ZSi9mDVeE9Za7LKBo2LdW2jmT+Iod3XFaJqINikZQsn2wEi0j9wPRbLg== dependencies: - "@jest/console" "^27.3.0" - "@jest/environment" "^27.3.0" - "@jest/globals" "^27.3.0" + "@jest/console" "^27.3.1" + "@jest/environment" "^27.3.1" + "@jest/globals" "^27.3.1" "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.3.0" - "@jest/transform" "^27.3.0" + "@jest/test-result" "^27.3.1" + "@jest/transform" "^27.3.1" "@jest/types" "^27.2.5" "@types/yargs" "^16.0.0" chalk "^4.0.0" @@ -2219,14 +2224,14 @@ jest-runtime@^27.3.0: exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-haste-map "^27.3.0" - jest-message-util "^27.3.0" + jest-haste-map "^27.3.1" + jest-message-util "^27.3.1" jest-mock "^27.3.0" jest-regex-util "^27.0.6" - jest-resolve "^27.3.0" - jest-snapshot "^27.3.0" - jest-util "^27.3.0" - jest-validate "^27.3.0" + jest-resolve "^27.3.1" + jest-snapshot "^27.3.1" + jest-util "^27.3.1" + jest-validate "^27.3.1" slash "^3.0.0" strip-bom "^4.0.0" yargs "^16.2.0" @@ -2239,10 +2244,10 @@ jest-serializer@^27.0.6: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.3.0.tgz#3792e1d22633050a1817c3e0d9a18666d43746ee" - integrity sha512-JaFXNS6D1BxvU2ORKaQwpen3Qic7IJAtGb09lbYiYk/GXXlde67Ts990i2nC5oBs0CstbeQE3jTeRayIZpM1Pw== +jest-snapshot@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.3.1.tgz#1da5c0712a252d70917d46c037054f5918c49ee4" + integrity sha512-APZyBvSgQgOT0XumwfFu7X3G5elj6TGhCBLbBdn3R1IzYustPGPE38F51dBWMQ8hRXa9je0vAdeVDtqHLvB6lg== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" @@ -2250,23 +2255,23 @@ jest-snapshot@^27.3.0: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/transform" "^27.3.0" + "@jest/transform" "^27.3.1" "@jest/types" "^27.2.5" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.3.0" + expect "^27.3.1" graceful-fs "^4.2.4" - jest-diff "^27.3.0" - jest-get-type "^27.0.6" - jest-haste-map "^27.3.0" - jest-matcher-utils "^27.3.0" - jest-message-util "^27.3.0" - jest-resolve "^27.3.0" - jest-util "^27.3.0" + jest-diff "^27.3.1" + jest-get-type "^27.3.1" + jest-haste-map "^27.3.1" + jest-matcher-utils "^27.3.1" + jest-message-util "^27.3.1" + jest-resolve "^27.3.1" + jest-util "^27.3.1" natural-compare "^1.4.0" - pretty-format "^27.3.0" + pretty-format "^27.3.1" semver "^7.3.2" jest-util@^27.0.0: @@ -2281,60 +2286,60 @@ jest-util@^27.0.0: is-ci "^3.0.0" picomatch "^2.2.3" -jest-util@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.3.0.tgz#178f211d308c25c9593d1c5a2f2b3aef28411741" - integrity sha512-SFSDBGKkxXi4jClmU1WLp/cMMlb4YX6+5Lb0CUySxmonArio8yJ2NALMWvQuXchgySiH7Rb912hVZ2QZ6t3x7w== +jest-util@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.3.1.tgz#a58cdc7b6c8a560caac9ed6bdfc4e4ff23f80429" + integrity sha512-8fg+ifEH3GDryLQf/eKZck1DEs2YuVPBCMOaHQxVVLmQwl/CDhWzrvChTX4efLZxGrw+AA0mSXv78cyytBt/uw== dependencies: "@jest/types" "^27.2.5" "@types/node" "*" chalk "^4.0.0" + ci-info "^3.2.0" graceful-fs "^4.2.4" - is-ci "^3.0.0" picomatch "^2.2.3" -jest-validate@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.3.0.tgz#1a92dd52d0a493037f6e1776c49457c031e0adc8" - integrity sha512-5oqWnb9MrkicE+ywR+BxoZr0L7H3WBDAt6LZggnyFHieAk8nnIQAKRpSodNPhiNJTwaMSbNjCe7SxAzKwTsBoA== +jest-validate@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.3.1.tgz#3a395d61a19cd13ae9054af8cdaf299116ef8a24" + integrity sha512-3H0XCHDFLA9uDII67Bwi1Vy7AqwA5HqEEjyy934lgVhtJ3eisw6ShOF1MDmRPspyikef5MyExvIm0/TuLzZ86Q== dependencies: "@jest/types" "^27.2.5" camelcase "^6.2.0" chalk "^4.0.0" - jest-get-type "^27.0.6" + jest-get-type "^27.3.1" leven "^3.1.0" - pretty-format "^27.3.0" + pretty-format "^27.3.1" -jest-watcher@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.3.0.tgz#13730b347e2ae8ba3c9435055bdad2ad73e5c348" - integrity sha512-xpTFRhqzUnNwTGaSBoHcyXROGbAfj2u4LS7Xosb+hzgrFgWgiHtCy3PWyN1DQk31Na98bBjXKxAbfSBACrvEiQ== +jest-watcher@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.3.1.tgz#ba5e0bc6aa843612b54ddb7f009d1cbff7e05f3e" + integrity sha512-9/xbV6chABsGHWh9yPaAGYVVKurWoP3ZMCv6h+O1v9/+pkOroigs6WzZ0e9gLP/njokUwM7yQhr01LKJVMkaZA== dependencies: - "@jest/test-result" "^27.3.0" + "@jest/test-result" "^27.3.1" "@jest/types" "^27.2.5" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^27.3.0" + jest-util "^27.3.1" string-length "^4.0.1" -jest-worker@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.3.0.tgz#6b636b63b6672208b91b92d8dcde112d1d4dba2d" - integrity sha512-xTTvvJqOjKBqE1AmwDHiQN8qzp9VoT981LtfXA+XiJVxHn4435vpnrzVcJ6v/ESiuB+IXPjZakn/ppT00xBCWA== +jest-worker@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.3.1.tgz#0def7feae5b8042be38479799aeb7b5facac24b2" + integrity sha512-ks3WCzsiZaOPJl/oMsDjaf0TRiSv7ctNgs0FqRr2nARsovz6AWWy4oLElwcquGSz692DzgZQrCLScPNs5YlC4g== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^27.0.1: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.3.0.tgz#25f0e02aaa51d53bc6e1941eb4838a3452f3320e" - integrity sha512-ZSwT6ROUbUs3bXirxzxBvohE/1y7t+IHIu3fL8WgIeJppE2XsFoa2dB03CI9kXA81znW0Kt0t2R+QVOWeY8cYw== + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.3.1.tgz#b5bab64e8f56b6f7e275ba1836898b0d9f1e5c8a" + integrity sha512-U2AX0AgQGd5EzMsiZpYt8HyZ+nSVIh5ujQ9CPp9EQZJMjXIiSZpJNweZl0swatKRoqHWgGKM3zaSwm4Zaz87ng== dependencies: - "@jest/core" "^27.3.0" + "@jest/core" "^27.3.1" import-local "^3.0.2" - jest-cli "^27.3.0" + jest-cli "^27.3.1" js-tokens@^4.0.0: version "4.0.0" @@ -2736,10 +2741,10 @@ pretty-format@^27.0.0, pretty-format@^27.2.0: ansi-styles "^5.0.0" react-is "^17.0.1" -pretty-format@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.3.0.tgz#ab4679ffc25dd9bc29bab220a4a70a873a19600e" - integrity sha512-Nkdd0xmxZdjCe6GoJomHnrLcCYGYzZKI/fRnUX0sCwDai2mmCHJfC9Ecx33lYgaxAFS/pJCAqhfxmWlm1wNVag== +pretty-format@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.3.1.tgz#7e9486365ccdd4a502061fa761d3ab9ca1b78df5" + integrity sha512-DR/c+pvFc52nLimLROYjnXPtolawm+uWDxr4FjuLDLUn+ktWnSN851KoHwHzzqq6rfCOjkzN8FLgDrSub6UDuA== dependencies: "@jest/types" "^27.2.5" ansi-regex "^5.0.1" From b97997ba77a46fe6537acf0908f99709137d0ad1 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 20 Oct 2021 10:33:18 -0400 Subject: [PATCH 340/785] Fix #1018 --- CHANGELOG.md | 4 +++ src/ruby/nodes/patterns.ts | 39 ++++++++++++++++++++--------- test/js/ruby/nodes/patterns.test.ts | 11 ++++++++ 3 files changed, 42 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3da9def..a04c2e48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Changed + +- [#1018](https://github.com/prettier/plugin-ruby/issues/1018) - rindek, kddnewton - Ensure brackets are used when matching an array pattern with a single element. + ## [2.0.0-rc4] ### Added diff --git a/src/ruby/nodes/patterns.ts b/src/ruby/nodes/patterns.ts index 2fb095d5..252ecd7e 100644 --- a/src/ruby/nodes/patterns.ts +++ b/src/ruby/nodes/patterns.ts @@ -21,33 +21,47 @@ const printPatternArg: Plugin.Printer = (path, opts, print) => { export const printAryPtn: Plugin.Printer = (path, opts, print) => { const [constant, preargs, splatarg, postargs] = path.getValue().body; - let args: Plugin.Doc | Plugin.Doc[] = []; + let argDocs: Plugin.Doc[] = []; if (preargs) { - args = args.concat( + argDocs = argDocs.concat( path.map((argPath) => printPatternArg(argPath, opts, print), "body", 1) ); } if (splatarg) { - args.push(["*", path.call(print, "body", 2)]); + argDocs.push(["*", path.call(print, "body", 2)]); } if (postargs) { - args = args.concat(path.map(print, "body", 3)); + argDocs = argDocs.concat(path.map(print, "body", 3)); } - args = group(join([",", line], args)); - - if (constant || patterns.includes(path.getParentNode().type)) { - args = ["[", args, "]"]; + let argDoc: Plugin.Doc = group(join([",", line], argDocs)); + + // There are a couple of cases where we _must_ use brackets. They include: + // + // * When the number of arguments inside the array pattern is one 1, then we + // have to include them, otherwise it matches the whole array. Consider the + // difference between `in [elem]` and `in elem`. + // * If we have a wrapping constant, then we definitely need the brackets. + // Consider the difference between `in Const[elem]` and `in Const elem` + // * If we're nested inside a parent pattern, then we have to have brackets. + // Consider the difference between `in key: first, second` and + // `in key: [first, second]`. + if ( + argDocs.length === 1 || + constant || + patterns.includes(path.getParentNode().type) + ) { + argDoc = ["[", argDoc, "]"]; } if (constant) { - return [path.call(print, "body", 0), args]; + return [path.call(print, "body", 0), argDoc]; } - return args; + return argDoc; }; export const printFndPtn: Plugin.Printer = (path, opts, print) => { @@ -118,10 +132,11 @@ export const printHshPtn: Plugin.Printer = (path, opts, print) => { }; export const printIn: Plugin.Printer = (path, opts, print) => { + const keyword = "in "; const parts: Plugin.Doc[] = [ - "in ", + keyword, align( - "in ".length, + keyword.length, path.call( (valuePath) => printPatternArg(valuePath, opts, print), "body", diff --git a/test/js/ruby/nodes/patterns.test.ts b/test/js/ruby/nodes/patterns.test.ts index 26eb5162..136def0d 100644 --- a/test/js/ruby/nodes/patterns.test.ts +++ b/test/js/ruby/nodes/patterns.test.ts @@ -56,6 +56,17 @@ describe("patterns", () => { expect(content).toMatchFormat(); }); + test("with a single array element", () => { + const content = ruby(` + case value + in [element] + matched + end + `); + + expect(content).toMatchFormat(); + }); + test("with comments in an array pattern", () => { const content = ruby(` case foo From 01639238d7c2ea776cd842bc6d127060d8c03340 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 20 Oct 2021 14:32:57 -0400 Subject: [PATCH 341/785] Turn off Style/MultilineBlockChain --- CHANGELOG.md | 1 + rubocop.yml | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a04c2e48..efff5a0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Changed - [#1018](https://github.com/prettier/plugin-ruby/issues/1018) - rindek, kddnewton - Ensure brackets are used when matching an array pattern with a single element. +- [#906](https://github.com/prettier/plugin-ruby/issues/906) - Hansenq, kddnewton - Turn off the `Style/MultilineBlockChain` rubocop rule in our shipped configuration because multiple chained method calls with blocks can potentially conflict with rubocop's desired output. ## [2.0.0-rc4] diff --git a/rubocop.yml b/rubocop.yml index 32641443..4d960c32 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -13,12 +13,16 @@ Layout: Layout/LineLength: Enabled: true -# Disabling all of the following options because they could conflict with a -# prettier configuration setting. - Style/MultilineIfModifier: # rubyModifier Enabled: false +# When method chains with multiple blocks are chained together, rubocop will let +# them pass if they're using braces but not if they're using do and end +# keywords. Because we will break individual blocks down to using keywords if +# they are multiline, this conflicts with rubocop. +Style/MultilineBlockChain: + Enabled: false + Style/SymbolArray: # rubyArrayLiteral Enabled: false @@ -34,5 +38,7 @@ Style/TrailingCommaInArrayLiteral: # trailingComma Style/TrailingCommaInHashLiteral: # trailingComma Enabled: false +# lambdas that are constructed with the lambda method call cannot be safely +# turned into lambda literals without removing a method call. Style/Lambda: Enabled: false From 7192fe19500bbbcd4d2d5571ad7427b22a532717 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Oct 2021 12:02:07 +0000 Subject: [PATCH 342/785] Bump @types/node from 16.11.1 to 16.11.2 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.1 to 16.11.2. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index f4a860d2..049862c2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -684,9 +684,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^16.9.1": - version "16.11.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.1.tgz#2e50a649a50fc403433a14f829eface1a3443e97" - integrity sha512-PYGcJHL9mwl1Ek3PLiYgyEKtwTMmkMw4vbiyz/ps3pfdRYLVv+SN7qHVAImrjdAXxgluDEw6Ph4lyv+m9UpRmA== + version "16.11.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.2.tgz#31c249c136c3f9b35d4b60fb8e50e01a1f0cc9a5" + integrity sha512-w34LtBB0OkDTs19FQHXy4Ig/TOXI4zqvXS2Kk1PAsRKZ0I+nik7LlMYxckW0tSNGtvWmzB+mrCTbuEjuB9DVsw== "@types/prettier@^2.1.5", "@types/prettier@^2.3.2": version "2.4.1" From cd13ebc16599bea8494fde1ae57c7fc7ec9dd67d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Oct 2021 12:02:15 +0000 Subject: [PATCH 343/785] Bump husky from 7.0.2 to 7.0.4 Bumps [husky](https://github.com/typicode/husky) from 7.0.2 to 7.0.4. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v7.0.2...v7.0.4) --- updated-dependencies: - dependency-name: husky dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index f4a860d2..e81ad53c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1747,9 +1747,9 @@ human-signals@^2.1.0: integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== husky@^7.0.0: - version "7.0.2" - resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.2.tgz#21900da0f30199acca43a46c043c4ad84ae88dff" - integrity sha512-8yKEWNX4z2YsofXAMT7KvA1g8p+GxtB1ffV8XtpAEGuXNAbCV5wdNKH+qTpw8SM9fh4aMPDR+yQuKfgnreyZlg== + version "7.0.4" + resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.4.tgz#242048245dc49c8fb1bf0cc7cfb98dd722531535" + integrity sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ== iconv-lite@0.4.24: version "0.4.24" From f0b2ad0782ba8b7d32f69ecc1f4b373ac0469f4f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Oct 2021 12:01:42 +0000 Subject: [PATCH 344/785] Bump @types/node from 16.11.2 to 16.11.3 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.2 to 16.11.3. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 95c46887..87df00a0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -684,9 +684,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^16.9.1": - version "16.11.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.2.tgz#31c249c136c3f9b35d4b60fb8e50e01a1f0cc9a5" - integrity sha512-w34LtBB0OkDTs19FQHXy4Ig/TOXI4zqvXS2Kk1PAsRKZ0I+nik7LlMYxckW0tSNGtvWmzB+mrCTbuEjuB9DVsw== + version "16.11.3" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.3.tgz#fad0b069ec205b0e81429c805d306d2c12e26be1" + integrity sha512-aIYL9Eemcecs1y77XzFGiSc+FdfN58k4J23UEe6+hynf4Wd9g4DzQPwIKL080vSMuubFqy2hWwOzCtJdc6vFKw== "@types/prettier@^2.1.5", "@types/prettier@^2.3.2": version "2.4.1" From 62e86e1278bcff0d8e66d1a49f8fd0f0825f2cdf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Oct 2021 12:02:15 +0000 Subject: [PATCH 345/785] Bump ts-node from 10.3.0 to 10.3.1 Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 10.3.0 to 10.3.1. - [Release notes](https://github.com/TypeStrong/ts-node/releases) - [Commits](https://github.com/TypeStrong/ts-node/compare/v10.3.0...v10.3.1) --- updated-dependencies: - dependency-name: ts-node dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 95c46887..de82e574 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3128,9 +3128,9 @@ ts-jest@^27.0.5: yargs-parser "20.x" ts-node@^10.2.1: - version "10.3.0" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.3.0.tgz#a797f2ed3ff50c9a5d814ce400437cb0c1c048b4" - integrity sha512-RYIy3i8IgpFH45AX4fQHExrT8BxDeKTdC83QFJkNzkvt8uFB6QJ8XMyhynYiKMLxt9a7yuXaDBZNOYS3XjDcYw== + version "10.3.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.3.1.tgz#739b42839b56d1a3c85026994af7045b2fccc6f5" + integrity sha512-Yw3W2mYzhHfCHOICGNJqa0i+rbL0rAyg7ZIHxU+K4pgY8gd2Lh1j+XbHCusJMykbj6RZMJVOY0MlHVd+GOivcw== dependencies: "@cspotcode/source-map-support" "0.7.0" "@tsconfig/node10" "^1.0.7" From 8a1e2247100c851aeb7545ad8ae4d7f389d614df Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Oct 2021 12:01:40 +0000 Subject: [PATCH 346/785] Bump ts-node from 10.3.1 to 10.4.0 Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 10.3.1 to 10.4.0. - [Release notes](https://github.com/TypeStrong/ts-node/releases) - [Commits](https://github.com/TypeStrong/ts-node/compare/v10.3.1...v10.4.0) --- updated-dependencies: - dependency-name: ts-node dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 32087861..1ee63344 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3128,9 +3128,9 @@ ts-jest@^27.0.5: yargs-parser "20.x" ts-node@^10.2.1: - version "10.3.1" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.3.1.tgz#739b42839b56d1a3c85026994af7045b2fccc6f5" - integrity sha512-Yw3W2mYzhHfCHOICGNJqa0i+rbL0rAyg7ZIHxU+K4pgY8gd2Lh1j+XbHCusJMykbj6RZMJVOY0MlHVd+GOivcw== + version "10.4.0" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.4.0.tgz#680f88945885f4e6cf450e7f0d6223dd404895f7" + integrity sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A== dependencies: "@cspotcode/source-map-support" "0.7.0" "@tsconfig/node10" "^1.0.7" From e3ba2dacddad019397aaf3d195c1349400ea7a8a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Oct 2021 12:02:13 +0000 Subject: [PATCH 347/785] Bump @types/node from 16.11.3 to 16.11.4 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.3 to 16.11.4. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 32087861..64944602 100644 --- a/yarn.lock +++ b/yarn.lock @@ -684,9 +684,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^16.9.1": - version "16.11.3" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.3.tgz#fad0b069ec205b0e81429c805d306d2c12e26be1" - integrity sha512-aIYL9Eemcecs1y77XzFGiSc+FdfN58k4J23UEe6+hynf4Wd9g4DzQPwIKL080vSMuubFqy2hWwOzCtJdc6vFKw== + version "16.11.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.4.tgz#90771124822d6663814f7c1c9b45a6654d8fd964" + integrity sha512-TMgXmy0v2xWyuCSCJM6NCna2snndD8yvQF67J29ipdzMcsPa9u+o0tjF5+EQNdhcuZplYuouYqpc4zcd5I6amQ== "@types/prettier@^2.1.5", "@types/prettier@^2.3.2": version "2.4.1" From bd1a29e103d39b9cec481ba03e7592073a74d4b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Oct 2021 12:02:07 +0000 Subject: [PATCH 348/785] Bump @types/node from 16.11.4 to 16.11.6 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.4 to 16.11.6. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 0341ac51..c21ee788 100644 --- a/yarn.lock +++ b/yarn.lock @@ -684,9 +684,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^16.9.1": - version "16.11.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.4.tgz#90771124822d6663814f7c1c9b45a6654d8fd964" - integrity sha512-TMgXmy0v2xWyuCSCJM6NCna2snndD8yvQF67J29ipdzMcsPa9u+o0tjF5+EQNdhcuZplYuouYqpc4zcd5I6amQ== + version "16.11.6" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.6.tgz#6bef7a2a0ad684cf6e90fcfe31cecabd9ce0a3ae" + integrity sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w== "@types/prettier@^2.1.5", "@types/prettier@^2.3.2": version "2.4.1" From 8904757e9f0308049c80811e844dca50744c9ae0 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 28 Oct 2021 09:32:02 -0400 Subject: [PATCH 349/785] Bump dev deps --- package.json | 6 +- yarn.lock | 599 ++++++++++++++++++++++----------------------------- 2 files changed, 258 insertions(+), 347 deletions(-) diff --git a/package.json b/package.json index 5617d3ad..329bd33e 100644 --- a/package.json +++ b/package.json @@ -26,9 +26,9 @@ "@types/jest": "^27.0.1", "@types/node": "^16.9.1", "@types/prettier": "^2.3.2", - "@typescript-eslint/eslint-plugin": "^4.31.2", - "@typescript-eslint/parser": "^4.31.2", - "eslint": "^7.22.0", + "@typescript-eslint/eslint-plugin": "^5.2.0", + "@typescript-eslint/parser": "^5.2.0", + "eslint": "^8.1.0", "eslint-config-prettier": "^8.0.0", "husky": "^7.0.0", "jest": "^27.0.1", diff --git a/yarn.lock b/yarn.lock index c21ee788..2b340bb4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,17 +2,10 @@ # yarn lockfile v1 -"@babel/code-frame@7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" - integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== - dependencies: - "@babel/highlight" "^7.10.4" - -"@babel/code-frame@^7.12.13", "@babel/code-frame@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.14.5.tgz#23b08d740e83f49c5e59945fbf1b43e80bbf4edb" - integrity sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw== +"@babel/code-frame@^7.12.13", "@babel/code-frame@^7.14.5", "@babel/code-frame@^7.15.8": + version "7.15.8" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.15.8.tgz#45990c47adadb00c03677baa89221f7cc23d2503" + integrity sha512-2IAnmn8zbvC/jKYhq5Ki9I+DwjlrtMPUCH/CpHvqI4dNnlwHwsxoIhlc8WcYY5LSYknXQtAlFYuHfqAFCvQ4Wg== dependencies: "@babel/highlight" "^7.14.5" @@ -21,20 +14,20 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.15.0.tgz#2dbaf8b85334796cafbb0f5793a90a2fc010b176" integrity sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA== -"@babel/core@^7.1.0", "@babel/core@^7.7.2", "@babel/core@^7.7.5": - version "7.15.5" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.15.5.tgz#f8ed9ace730722544609f90c9bb49162dc3bf5b9" - integrity sha512-pYgXxiwAgQpgM1bNkZsDEq85f0ggXMA5L7c+o3tskGMh2BunCI9QUwB9Z4jpvXUOuMdyGKiGKQiRe11VS6Jzvg== +"@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.2", "@babel/core@^7.7.5": + version "7.15.8" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.15.8.tgz#195b9f2bffe995d2c6c159e72fe525b4114e8c10" + integrity sha512-3UG9dsxvYBMYwRv+gS41WKHno4K60/9GPy1CJaH6xy3Elq8CTtvtjT5R5jmNhXfCYLX2mTw+7/aq5ak/gOE0og== dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/generator" "^7.15.4" + "@babel/code-frame" "^7.15.8" + "@babel/generator" "^7.15.8" "@babel/helper-compilation-targets" "^7.15.4" - "@babel/helper-module-transforms" "^7.15.4" + "@babel/helper-module-transforms" "^7.15.8" "@babel/helpers" "^7.15.4" - "@babel/parser" "^7.15.5" + "@babel/parser" "^7.15.8" "@babel/template" "^7.15.4" "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" + "@babel/types" "^7.15.6" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" @@ -42,12 +35,12 @@ semver "^6.3.0" source-map "^0.5.0" -"@babel/generator@^7.15.4", "@babel/generator@^7.7.2": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.15.4.tgz#85acb159a267ca6324f9793986991ee2022a05b0" - integrity sha512-d3itta0tu+UayjEORPNz6e1T3FtvWlP5N4V5M+lhp/CxT4oAA7/NcScnpRyspUMLK6tu9MNHmQHxRykuN2R7hw== +"@babel/generator@^7.15.4", "@babel/generator@^7.15.8", "@babel/generator@^7.7.2": + version "7.15.8" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.15.8.tgz#fa56be6b596952ceb231048cf84ee499a19c0cd1" + integrity sha512-ECmAKstXbp1cvpTTZciZCgfOt6iN64lR0d+euv3UZisU5awfRawOvg07Utn/qBGuH4bRIEZKrA/4LzZyXhZr8g== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.15.6" jsesc "^2.5.1" source-map "^0.5.0" @@ -98,10 +91,10 @@ dependencies: "@babel/types" "^7.15.4" -"@babel/helper-module-transforms@^7.15.4": - version "7.15.7" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.15.7.tgz#7da80c8cbc1f02655d83f8b79d25866afe50d226" - integrity sha512-ZNqjjQG/AuFfekFTY+7nY4RgBSklgTu970c7Rj3m/JOhIu5KPBUuTA9AY6zaKcUvk4g6EbDXdBnhi35FAssdSw== +"@babel/helper-module-transforms@^7.15.8": + version "7.15.8" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.15.8.tgz#d8c0e75a87a52e374a8f25f855174786a09498b2" + integrity sha512-DfAfA6PfpG8t4S6npwzLvTUpp0sS7JrcuaMiy1Y5645laRJIp/LiLGIBbQKaXSInK8tiGNI7FL7L8UvB8gdUZg== dependencies: "@babel/helper-module-imports" "^7.15.4" "@babel/helper-replace-supers" "^7.15.4" @@ -167,7 +160,7 @@ "@babel/traverse" "^7.15.4" "@babel/types" "^7.15.4" -"@babel/highlight@^7.10.4", "@babel/highlight@^7.14.5": +"@babel/highlight@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9" integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg== @@ -176,10 +169,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.15.4", "@babel/parser@^7.15.5", "@babel/parser@^7.7.2": - version "7.15.7" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.7.tgz#0c3ed4a2eb07b165dfa85b3cc45c727334c4edae" - integrity sha512-rycZXvQ+xS9QyIcJ9HXeDWf1uxqlbVFAUq0Rq0dbc50Zb/+wUe/ehyfzGfm9KZZF0kBejYgxltBXocP+gKdL2g== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.15.4", "@babel/parser@^7.15.8", "@babel/parser@^7.7.2": + version "7.15.8" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.8.tgz#7bacdcbe71bdc3ff936d510c15dcea7cf0b99016" + integrity sha512-BRYa3wcQnjS/nqI8Ac94pYYpJfojHVvVXJ97+IDCImX4Jc8W8Xv1+47enbruk+q1etOpsQNwnfFcNGw+gtPGxA== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -321,14 +314,14 @@ dependencies: "@cspotcode/source-map-consumer" "0.8.0" -"@eslint/eslintrc@^0.4.3": - version "0.4.3" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" - integrity sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw== +"@eslint/eslintrc@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.0.3.tgz#41f08c597025605f672251dcc4e8be66b5ed7366" + integrity sha512-DHI1wDPoKCBPoLZA3qDR91+3te/wDSc1YhKg3jR8NxKKRJq2hwHwcWv31cSwSYvIBrmbENoYMWcenW8uproQqg== dependencies: ajv "^6.12.4" - debug "^4.1.1" - espree "^7.3.0" + debug "^4.3.2" + espree "^9.0.0" globals "^13.9.0" ignore "^4.0.6" import-fresh "^3.2.1" @@ -336,10 +329,10 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@humanwhocodes/config-array@^0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" - integrity sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg== +"@humanwhocodes/config-array@^0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.6.0.tgz#b5621fdb3b32309d2d16575456cbc277fa8f021a" + integrity sha512-JQlEKbcgEUjBFhLIF4iqM7u/9lwgHRBcpHrmUNCALK0Q3amXN6lxdoXLnF0sm11E9VqTmBALR87IlUg1bZ8A9A== dependencies: "@humanwhocodes/object-schema" "^1.2.0" debug "^4.1.1" @@ -524,17 +517,6 @@ source-map "^0.6.1" write-file-atomic "^3.0.0" -"@jest/types@^27.1.1": - version "27.1.1" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.1.1.tgz#77a3fc014f906c65752d12123a0134359707c0ad" - integrity sha512-yqJPDDseb0mXgKqmNqypCsb85C22K1aY5+LUxh7syIM9n/b0AsaltxNy+o6tt29VcfGDpYEve175bm3uOhcehA== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^16.0.0" - chalk "^4.0.0" - "@jest/types@^27.2.5": version "27.2.5" resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.2.5.tgz#420765c052605e75686982d24b061b4cbba22132" @@ -673,7 +655,7 @@ jest-diff "^27.0.0" pretty-format "^27.0.0" -"@types/json-schema@^7.0.7": +"@types/json-schema@^7.0.9": version "7.0.9" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== @@ -710,75 +692,75 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^4.31.2": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz#c24dc7c8069c7706bc40d99f6fa87edcb2005276" - integrity sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg== +"@typescript-eslint/eslint-plugin@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.2.0.tgz#2bdb247cc2e2afce7efbce09afb9a6f0a8a08434" + integrity sha512-qQwg7sqYkBF4CIQSyRQyqsYvP+g/J0To9ZPVNJpfxfekl5RmdvQnFFTVVwpRtaUDFNvjfe/34TgY/dpc3MgNTw== dependencies: - "@typescript-eslint/experimental-utils" "4.33.0" - "@typescript-eslint/scope-manager" "4.33.0" - debug "^4.3.1" + "@typescript-eslint/experimental-utils" "5.2.0" + "@typescript-eslint/scope-manager" "5.2.0" + debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" - regexpp "^3.1.0" + regexpp "^3.2.0" semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/experimental-utils@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz#6f2a786a4209fa2222989e9380b5331b2810f7fd" - integrity sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q== +"@typescript-eslint/experimental-utils@5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.2.0.tgz#e3b2cb9cd0aff9b50f68d9a414c299fd26b067e6" + integrity sha512-fWyT3Agf7n7HuZZRpvUYdFYbPk3iDCq6fgu3ulia4c7yxmPnwVBovdSOX7RL+k8u6hLbrXcdAehlWUVpGh6IEw== dependencies: - "@types/json-schema" "^7.0.7" - "@typescript-eslint/scope-manager" "4.33.0" - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/typescript-estree" "4.33.0" + "@types/json-schema" "^7.0.9" + "@typescript-eslint/scope-manager" "5.2.0" + "@typescript-eslint/types" "5.2.0" + "@typescript-eslint/typescript-estree" "5.2.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/parser@^4.31.2": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.33.0.tgz#dfe797570d9694e560528d18eecad86c8c744899" - integrity sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA== - dependencies: - "@typescript-eslint/scope-manager" "4.33.0" - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/typescript-estree" "4.33.0" - debug "^4.3.1" - -"@typescript-eslint/scope-manager@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz#d38e49280d983e8772e29121cf8c6e9221f280a3" - integrity sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ== - dependencies: - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/visitor-keys" "4.33.0" - -"@typescript-eslint/types@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72" - integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== - -"@typescript-eslint/typescript-estree@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz#0dfb51c2908f68c5c08d82aefeaf166a17c24609" - integrity sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA== - dependencies: - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/visitor-keys" "4.33.0" - debug "^4.3.1" - globby "^11.0.3" - is-glob "^4.0.1" +"@typescript-eslint/parser@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.2.0.tgz#dc081aa89de16b5676b10215519af3aa7b58fb72" + integrity sha512-Uyy4TjJBlh3NuA8/4yIQptyJb95Qz5PX//6p8n7zG0QnN4o3NF9Je3JHbVU7fxf5ncSXTmnvMtd/LDQWDk0YqA== + dependencies: + "@typescript-eslint/scope-manager" "5.2.0" + "@typescript-eslint/types" "5.2.0" + "@typescript-eslint/typescript-estree" "5.2.0" + debug "^4.3.2" + +"@typescript-eslint/scope-manager@5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.2.0.tgz#7ce8e4ab2baaa0ad5282913ea8e13ce03ec6a12a" + integrity sha512-RW+wowZqPzQw8MUFltfKYZfKXqA2qgyi6oi/31J1zfXJRpOn6tCaZtd9b5u9ubnDG2n/EMvQLeZrsLNPpaUiFQ== + dependencies: + "@typescript-eslint/types" "5.2.0" + "@typescript-eslint/visitor-keys" "5.2.0" + +"@typescript-eslint/types@5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.2.0.tgz#7ad32d15abddb0ee968a330f0ea182ea544ef7cf" + integrity sha512-cTk6x08qqosps6sPyP2j7NxyFPlCNsJwSDasqPNjEQ8JMD5xxj2NHxcLin5AJQ8pAVwpQ8BMI3bTxR0zxmK9qQ== + +"@typescript-eslint/typescript-estree@5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.2.0.tgz#c22e0ff6f8a4a3f78504a80ebd686fe2870a68ae" + integrity sha512-RsdXq2XmVgKbm9nLsE3mjNUM7BTr/K4DYR9WfFVMUuozHWtH5gMpiNZmtrMG8GR385EOSQ3kC9HiEMJWimxd/g== + dependencies: + "@typescript-eslint/types" "5.2.0" + "@typescript-eslint/visitor-keys" "5.2.0" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz#2a22f77a41604289b7a186586e9ec48ca92ef1dd" - integrity sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg== +"@typescript-eslint/visitor-keys@5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.2.0.tgz#03522d35df98474f08e0357171a7d1b259a88f55" + integrity sha512-Nk7HizaXWWCUBfLA/rPNKMzXzWS8Wg9qHMuGtT+v2/YpPij4nVXrVJc24N/r5WrrmqK31jCrZxeHqIgqRzs0Xg== dependencies: - "@typescript-eslint/types" "4.33.0" - eslint-visitor-keys "^2.0.0" + "@typescript-eslint/types" "5.2.0" + eslint-visitor-keys "^3.0.0" abab@^2.0.3, abab@^2.0.5: version "2.0.5" @@ -808,12 +790,12 @@ acorn-walk@^8.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== -acorn@^7.1.1, acorn@^7.4.0: +acorn@^7.1.1: version "7.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.2.4, acorn@^8.4.1: +acorn@^8.2.4, acorn@^8.4.1, acorn@^8.5.0: version "8.5.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.5.0.tgz#4512ccb99b3698c752591e9bb4472e38ad43cee2" integrity sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q== @@ -835,16 +817,6 @@ ajv@^6.10.0, ajv@^6.12.4: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^8.0.1: - version "8.6.3" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.6.3.tgz#11a66527761dc3e9a3845ea775d2d3c0414e8764" - integrity sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw== - dependencies: - fast-deep-equal "^3.1.1" - json-schema-traverse "^1.0.0" - require-from-string "^2.0.2" - uri-js "^4.2.2" - ansi-colors@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" @@ -857,7 +829,7 @@ ansi-escapes@^4.2.1: dependencies: type-fest "^0.21.3" -ansi-regex@^5.0.0, ansi-regex@^5.0.1: +ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== @@ -901,6 +873,11 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + array-differ@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-3.0.0.tgz#3cbb3d0f316810eafcc47624734237d6aee4ae6b" @@ -916,11 +893,6 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -astral-regex@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" - integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== - asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -941,14 +913,14 @@ babel-jest@^27.3.1: slash "^3.0.0" babel-plugin-istanbul@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.0.0.tgz#e159ccdc9af95e0b570c75b4573b7c34d671d765" - integrity sha512-AF55rZXpe7trmEylbaE1Gv54wn6rwU03aptvRoVIGP8YykoSxqdVLV1TfwflBCE/QtHmqtP8SWlTENqbK8GCSQ== + version "6.1.1" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" + integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@istanbuljs/load-nyc-config" "^1.0.0" "@istanbuljs/schema" "^0.1.2" - istanbul-lib-instrument "^4.0.0" + istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" babel-plugin-jest-hoist@^27.2.0: @@ -1013,15 +985,15 @@ browser-process-hrtime@^1.0.0: integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== browserslist@^4.16.6: - version "4.17.0" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.0.tgz#1fcd81ec75b41d6d4994fb0831b92ac18c01649c" - integrity sha512-g2BJ2a0nEYvEFQC208q8mVAhfNwpZ5Mu8BwgtCdZKO3qx98HChmeg448fPdUzld8aFmfLgVh7yymqV+q1lJZ5g== + version "4.17.5" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.5.tgz#c827bbe172a4c22b123f5e337533ceebadfdd559" + integrity sha512-I3ekeB92mmpctWBoLXe0d5wPS2cBuRvvW0JyyJHMrk9/HmP2ZjrTboNAZ8iuGqaEIlKguljbQY32OkOJIRrgoA== dependencies: - caniuse-lite "^1.0.30001254" - colorette "^1.3.0" - electron-to-chromium "^1.3.830" + caniuse-lite "^1.0.30001271" + electron-to-chromium "^1.3.878" escalade "^3.1.1" - node-releases "^1.1.75" + node-releases "^2.0.1" + picocolors "^1.0.0" bs-logger@0.x: version "0.2.6" @@ -1057,10 +1029,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== -caniuse-lite@^1.0.30001254: - version "1.0.30001259" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001259.tgz#ae21691d3da9c4be6144403ac40f71d9f6efd790" - integrity sha512-V7mQTFhjITxuk9zBpI6nYsiTXhcPe05l+364nZjK7MFK/E7ibvYBSAXr4YcA6oPR8j3ZLM/LN+lUqUVAQEUZFg== +caniuse-lite@^1.0.30001271: + version "1.0.30001272" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001272.tgz#8e9790ff995e9eb6e1f4c45cd07ddaa87cddbb14" + integrity sha512-DV1j9Oot5dydyH1v28g25KoVm7l8MTxazwuiH3utWiAS6iL/9Nh//TGwqFEeqqN8nnWYQ8HHhUq+o4QPt9kvYw== chalk@^2.0.0: version "2.4.2" @@ -1092,7 +1064,7 @@ char-regex@^1.0.2: resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== -ci-info@^3.1.1, ci-info@^3.2.0: +ci-info@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.2.0.tgz#2876cb948a498797b5236f0095bc057d0dca38b6" integrity sha512-dVqRX7fLUm8J6FgHJ418XuIgDLZDkYcDFTeL6TA2gt5WlIZUQrrH6EZrNClwT/H0FateUsZkGIOPRrLbP+PR9A== @@ -1145,11 +1117,6 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -colorette@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.4.0.tgz#5190fbb87276259a86ad700bff2c6d6faa3fca40" - integrity sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g== - combined-stream@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" @@ -1209,7 +1176,7 @@ data-urls@^2.0.0: whatwg-mimetype "^2.3.0" whatwg-url "^8.0.0" -debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2: version "4.3.2" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== @@ -1277,10 +1244,10 @@ domexception@^2.0.1: dependencies: webidl-conversions "^5.0.0" -electron-to-chromium@^1.3.830: - version "1.3.845" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.845.tgz#326d3be3ee5d2c065f689119d441c997f9fd41d8" - integrity sha512-y0RorqmExFDI4RjLEC6j365bIT5UAXf9WIRcknvSFHVhbC/dRnCgJnPA3DUUW6SCC85QGKEafgqcHJ6uPdEP1Q== +electron-to-chromium@^1.3.878: + version "1.3.883" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.883.tgz#cc409921469b3aa6ab6efd65cc2a4375128bb703" + integrity sha512-goyjNx4wB9j911PBteb+AXNbErug7rJVkmDXWdw5SCVn2JlARBwsqucPkvp1h5mXWxHUbBRK3bwXTrqSxSiAIQ== emittery@^0.8.1: version "0.8.1" @@ -1351,12 +1318,13 @@ eslint-scope@^5.1.1: esrecurse "^4.3.0" estraverse "^4.1.1" -eslint-utils@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" - integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== +eslint-scope@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-6.0.0.tgz#9cf45b13c5ac8f3d4c50f46a5121f61b3e318978" + integrity sha512-uRDL9MWmQCkaFus8RF5K9/L/2fn+80yoW3jkD53l4shjCh26fCtvJGasxjUqP5OT87SYTxCVA3BwTUzuELx9kA== dependencies: - eslint-visitor-keys "^1.1.0" + esrecurse "^4.3.0" + estraverse "^5.2.0" eslint-utils@^3.0.0: version "3.0.0" @@ -1365,47 +1333,46 @@ eslint-utils@^3.0.0: dependencies: eslint-visitor-keys "^2.0.0" -eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" - integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== - eslint-visitor-keys@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint@^7.22.0: - version "7.32.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d" - integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA== +eslint-visitor-keys@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.0.0.tgz#e32e99c6cdc2eb063f204eda5db67bfe58bb4186" + integrity sha512-mJOZa35trBTb3IyRmo8xmKBZlxf+N7OnUl4+ZhJHs/r+0770Wh/LEACE2pqMGMe27G/4y8P2bYGk4J70IC5k1Q== + +eslint@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.1.0.tgz#00f1f7dbf4134f26588e6c9f2efe970760f64664" + integrity sha512-JZvNneArGSUsluHWJ8g8MMs3CfIEzwaLx9KyH4tZ2i+R2/rPWzL8c0zg3rHdwYVpN/1sB9gqnjHwz9HoeJpGHw== dependencies: - "@babel/code-frame" "7.12.11" - "@eslint/eslintrc" "^0.4.3" - "@humanwhocodes/config-array" "^0.5.0" + "@eslint/eslintrc" "^1.0.3" + "@humanwhocodes/config-array" "^0.6.0" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" - debug "^4.0.1" + debug "^4.3.2" doctrine "^3.0.0" enquirer "^2.3.5" escape-string-regexp "^4.0.0" - eslint-scope "^5.1.1" - eslint-utils "^2.1.0" - eslint-visitor-keys "^2.0.0" - espree "^7.3.1" + eslint-scope "^6.0.0" + eslint-utils "^3.0.0" + eslint-visitor-keys "^3.0.0" + espree "^9.0.0" esquery "^1.4.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" functional-red-black-tree "^1.0.1" - glob-parent "^5.1.2" + glob-parent "^6.0.1" globals "^13.6.0" ignore "^4.0.6" import-fresh "^3.0.0" imurmurhash "^0.1.4" is-glob "^4.0.0" - js-yaml "^3.13.1" + js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" lodash.merge "^4.6.2" @@ -1413,22 +1380,21 @@ eslint@^7.22.0: natural-compare "^1.4.0" optionator "^0.9.1" progress "^2.0.0" - regexpp "^3.1.0" + regexpp "^3.2.0" semver "^7.2.1" strip-ansi "^6.0.0" strip-json-comments "^3.1.0" - table "^6.0.9" text-table "^0.2.0" v8-compile-cache "^2.0.3" -espree@^7.3.0, espree@^7.3.1: - version "7.3.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6" - integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== +espree@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.0.0.tgz#e90a2965698228502e771c7a58489b1a9d107090" + integrity sha512-r5EQJcYZ2oaGbeR0jR0fFVijGOcwai07/690YRXLINuhmVeRY4UKSAsQPe/0BNuDgwP7Ophoc1PRsr2E3tkbdQ== dependencies: - acorn "^7.4.0" + acorn "^8.5.0" acorn-jsx "^5.3.1" - eslint-visitor-keys "^1.3.0" + eslint-visitor-keys "^3.0.0" esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" @@ -1455,9 +1421,9 @@ estraverse@^4.1.1: integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== estraverse@^5.1.0, estraverse@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" - integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== esutils@^2.0.2: version "2.0.3" @@ -1649,10 +1615,17 @@ glob-parent@^5.1.2: dependencies: is-glob "^4.0.1" +glob-parent@^6.0.1: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" + glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4: - version "7.1.7" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" - integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== + version "7.2.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" + integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -1667,13 +1640,13 @@ globals@^11.1.0: integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== globals@^13.6.0, globals@^13.9.0: - version "13.11.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.11.0.tgz#40ef678da117fe7bd2e28f1fab24951bd0255be7" - integrity sha512-08/xrJ7wQjK9kkkRoI3OFUBbLx4f+6x3SGwcPvQ0QH6goFDrOU2oyAWrmh3dJezu65buo+HBMzAMQy6rovVC3g== + version "13.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.12.0.tgz#4d733760304230a0082ed96e21e5c565f898089e" + integrity sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg== dependencies: type-fest "^0.20.2" -globby@^11.0.3: +globby@^11.0.4: version "11.0.4" resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg== @@ -1777,9 +1750,9 @@ import-fresh@^3.0.0, import-fresh@^3.2.1: resolve-from "^4.0.0" import-local@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.2.tgz#a8cfd0431d1de4a2199703d003e3e62364fa6db6" - integrity sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA== + version "3.0.3" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.3.tgz#4d51c2c495ca9393da259ec66b62e022920211e0" + integrity sha512-bE9iaUY3CXH8Cwfan/abDKAxe1KGT9kyGsBPqf6DMK/z0a2OzAsrukeYNgIH6cH5Xr452jb1TUL8rSfCLjZ9uA== dependencies: pkg-dir "^4.2.0" resolve-cwd "^3.0.0" @@ -1802,17 +1775,10 @@ inherits@2: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -is-ci@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-3.0.0.tgz#c7e7be3c9d8eef7d0fa144390bd1e4b88dc4c994" - integrity sha512-kDXyttuLeslKAHYL/K28F2YkM3x5jvFPEw3yXbRptXydjD9rpLEz+C5K5iutY9ZiUu6AP41JdvRQwF4Iqs4ZCQ== - dependencies: - ci-info "^3.1.1" - is-core-module@^2.2.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.6.0.tgz#d7553b2526fe59b92ba3e40c8df757ec8a709e19" - integrity sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ== + version "2.8.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.0.tgz#0321336c3d0925e497fd97f5d95cb114a5ccd548" + integrity sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw== dependencies: has "^1.0.3" @@ -1831,10 +1797,10 @@ is-generator-fn@^2.0.0: resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== -is-glob@^4.0.0, is-glob@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== dependencies: is-extglob "^2.1.1" @@ -1863,12 +1829,12 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= -istanbul-lib-coverage@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz#f5944a37c70b550b02a78a5c3b2055b280cec8ec" - integrity sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg== +istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" + integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== -istanbul-lib-instrument@^4.0.0, istanbul-lib-instrument@^4.0.3: +istanbul-lib-instrument@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz#873c6fff897450118222774696a3f28902d77c1d" integrity sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ== @@ -1878,6 +1844,17 @@ istanbul-lib-instrument@^4.0.0, istanbul-lib-instrument@^4.0.3: istanbul-lib-coverage "^3.0.0" semver "^6.3.0" +istanbul-lib-instrument@^5.0.4: + version "5.1.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.1.0.tgz#7b49198b657b27a730b8e9cb601f1e1bff24c59a" + integrity sha512-czwUz525rkOFDJxfKK6mYfIs9zBKILyrZQxjz3ABhjQXhbhFsSbo1HW/BFcsDnfJYJWA6thRR5/TUY2qs5W99Q== + dependencies: + "@babel/core" "^7.12.3" + "@babel/parser" "^7.14.7" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-coverage "^3.2.0" + semver "^6.3.0" + istanbul-lib-report@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" @@ -1888,18 +1865,18 @@ istanbul-lib-report@^3.0.0: supports-color "^7.1.0" istanbul-lib-source-maps@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz#75743ce6d96bb86dc7ee4352cf6366a23f0b1ad9" - integrity sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg== + version "4.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz#895f3a709fcfba34c6de5a42939022f3e4358551" + integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== dependencies: debug "^4.1.1" istanbul-lib-coverage "^3.0.0" source-map "^0.6.1" istanbul-reports@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.0.2.tgz#d593210e5000683750cb09fc0644e4b6e27fd53b" - integrity sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw== + version "3.0.5" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.0.5.tgz#a2580107e71279ea6d661ddede929ffc6d693384" + integrity sha512-5+19PlhnGabNWB7kOFnuxT8H3T/iIyQzIbQMxXsURmmvKg86P2sbkrGOT77VnHw0Qr0gc2XzRaRfMZYYbSQCJQ== dependencies: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" @@ -1983,17 +1960,7 @@ jest-config@^27.3.1: micromatch "^4.0.4" pretty-format "^27.3.1" -jest-diff@^27.0.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.2.0.tgz#bda761c360f751bab1e7a2fe2fc2b0a35ce8518c" - integrity sha512-QSO9WC6btFYWtRJ3Hac0sRrkspf7B01mGrrQEiCW6TobtViJ9RWL0EmOs/WnBsZDsI/Y2IoSHZA2x6offu0sYw== - dependencies: - chalk "^4.0.0" - diff-sequences "^27.0.6" - jest-get-type "^27.0.6" - pretty-format "^27.2.0" - -jest-diff@^27.3.1: +jest-diff@^27.0.0, jest-diff@^27.3.1: version "27.3.1" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.3.1.tgz#d2775fea15411f5f5aeda2a5e02c2f36440f6d55" integrity sha512-PCeuAH4AWUo2O5+ksW4pL9v5xJAcIKPUPfIhZBcG1RKv/0+dvaWTQK1Nrau8d67dp65fOqbeMdoil+6PedyEPQ== @@ -2046,11 +2013,6 @@ jest-environment-node@^27.3.1: jest-mock "^27.3.0" jest-util "^27.3.1" -jest-get-type@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.6.tgz#0eb5c7f755854279ce9b68a9f1a4122f69047cfe" - integrity sha512-XTkK5exIeUbbveehcSR8w0bhH+c0yloW/Wpl+9vZrjzztCPWrxhHwkIFpZzCt71oRBsgxmuUfxEqOYoZI2macg== - jest-get-type@^27.3.1: version "27.3.1" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.3.1.tgz#a8a2b0a12b50169773099eee60a0e6dd11423eff" @@ -2274,19 +2236,7 @@ jest-snapshot@^27.3.1: pretty-format "^27.3.1" semver "^7.3.2" -jest-util@^27.0.0: - version "27.2.5" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.2.5.tgz#88740c4024d223634a82ce7c2263e8bc6df3b3ba" - integrity sha512-QRhDC6XxISntMzFRd/OQ6TGsjbzA5ONO0tlAj2ElHs155x1aEr0rkYJBEysG6H/gZVH3oGFzCdAB/GA8leh8NQ== - dependencies: - "@jest/types" "^27.2.5" - "@types/node" "*" - chalk "^4.0.0" - graceful-fs "^4.2.4" - is-ci "^3.0.0" - picomatch "^2.2.3" - -jest-util@^27.3.1: +jest-util@^27.0.0, jest-util@^27.3.1: version "27.3.1" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.3.1.tgz#a58cdc7b6c8a560caac9ed6bdfc4e4ff23f80429" integrity sha512-8fg+ifEH3GDryLQf/eKZck1DEs2YuVPBCMOaHQxVVLmQwl/CDhWzrvChTX4efLZxGrw+AA0mSXv78cyytBt/uw== @@ -2354,6 +2304,13 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + jsdom@^16.6.0: version "16.7.0" resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.7.0.tgz#918ae71965424b197c819f8183a754e18977b710" @@ -2397,11 +2354,6 @@ json-schema-traverse@^0.4.1: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== -json-schema-traverse@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" - integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== - json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" @@ -2447,11 +2399,6 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" -lodash.clonedeep@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" - integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= - lodash.memoize@4.x: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" @@ -2462,11 +2409,6 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lodash.truncate@^4.4.2: - version "4.4.2" - resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" - integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= - lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" @@ -2491,12 +2433,12 @@ make-error@1.x, make-error@^1.1.1: resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== -makeerror@1.0.x: - version "1.0.11" - resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" - integrity sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw= +makeerror@1.0.12: + version "1.0.12" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a" + integrity sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg== dependencies: - tmpl "1.0.x" + tmpl "1.0.5" merge-stream@^2.0.0: version "2.0.0" @@ -2516,17 +2458,17 @@ micromatch@^4.0.4: braces "^3.0.1" picomatch "^2.2.3" -mime-db@1.49.0: - version "1.49.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.49.0.tgz#f3dfde60c99e9cf3bc9701d687778f537001cbed" - integrity sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA== +mime-db@1.50.0: + version "1.50.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.50.0.tgz#abd4ac94e98d3c0e185016c67ab45d5fde40c11f" + integrity sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A== mime-types@^2.1.12: - version "2.1.32" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.32.tgz#1d00e89e7de7fe02008db61001d9e02852670fd5" - integrity sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A== + version "2.1.33" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.33.tgz#1fa12a904472fafd068e48d9e8401f74d3f70edb" + integrity sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g== dependencies: - mime-db "1.49.0" + mime-db "1.50.0" mimic-fn@^2.1.0: version "2.1.0" @@ -2581,10 +2523,10 @@ node-modules-regexp@^1.0.0: resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= -node-releases@^1.1.75: - version "1.1.76" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.76.tgz#df245b062b0cafbd5282ab6792f7dccc2d97f36e" - integrity sha512-9/IECtNr8dXNmPWmFXepT0/7o5eolGesHUa3mtr0KlgnCvnZxwh2qensKL42JJY2vQKC3nIBXetFAqR+PW1CmA== +node-releases@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.1.tgz#3d1d395f204f1f2f29a54358b9fb678765ad2fc5" + integrity sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA== normalize-path@^3.0.0: version "3.0.0" @@ -2697,6 +2639,11 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== +picocolors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" + integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== + picomatch@^2.0.4, picomatch@^2.2.3: version "2.3.0" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" @@ -2731,17 +2678,7 @@ prettier@>=2.3.0: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c" integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA== -pretty-format@^27.0.0, pretty-format@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.2.0.tgz#ee37a94ce2a79765791a8649ae374d468c18ef19" - integrity sha512-KyJdmgBkMscLqo8A7K77omgLx5PWPiXJswtTtFV7XgVZv2+qPk6UivpXXO+5k6ZEbWIbLoKdx1pZ6ldINzbwTA== - dependencies: - "@jest/types" "^27.1.1" - ansi-regex "^5.0.0" - ansi-styles "^5.0.0" - react-is "^17.0.1" - -pretty-format@^27.3.1: +pretty-format@^27.0.0, pretty-format@^27.3.1: version "27.3.1" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.3.1.tgz#7e9486365ccdd4a502061fa761d3ab9ca1b78df5" integrity sha512-DR/c+pvFc52nLimLROYjnXPtolawm+uWDxr4FjuLDLUn+ktWnSN851KoHwHzzqq6rfCOjkzN8FLgDrSub6UDuA== @@ -2769,9 +2706,9 @@ progress@^2.0.0: integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== prompts@^2.0.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.1.tgz#befd3b1195ba052f9fd2fde8a486c4e82ee77f61" - integrity sha512-EQyfIuO2hPDsX1L/blblV+H7I0knhgAd82cVneCwcdND9B8AuCDuRcBH6yIcG4dFzlOUqbazQqwGjx5xmsNLuQ== + version "2.4.2" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" + integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q== dependencies: kleur "^3.0.3" sisteransi "^1.0.5" @@ -2804,7 +2741,7 @@ react-is@^17.0.1: resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== -regexpp@^3.1.0: +regexpp@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== @@ -2814,11 +2751,6 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= -require-from-string@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" - integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== - resolve-cwd@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" @@ -2910,9 +2842,9 @@ shebang-regex@^3.0.0: integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== signal-exit@^3.0.2, signal-exit@^3.0.3: - version "3.0.4" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.4.tgz#366a4684d175b9cab2081e3681fda3747b6c51d7" - integrity sha512-rqYhcAnZ6d/vTPGghdrw7iumdcbXpsk1b8IG/rz+VWV51DM0p7XCtMoJ3qhPLIbp3tvyt3pKRbaaEMZYpHto8Q== + version "3.0.5" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.5.tgz#9e3e8cc0c75a99472b44321033a7702e7738252f" + integrity sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ== sisteransi@^1.0.5: version "1.0.5" @@ -2924,15 +2856,6 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -slice-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" - integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== - dependencies: - ansi-styles "^4.0.0" - astral-regex "^2.0.0" - is-fullwidth-code-point "^3.0.0" - source-map-support@^0.5.6: version "0.5.20" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9" @@ -2977,20 +2900,20 @@ string-length@^4.0.1: strip-ansi "^6.0.0" string-width@^4.1.0, string-width@^4.2.0: - version "4.2.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5" - integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA== + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== dependencies: emoji-regex "^8.0.0" is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.0" + strip-ansi "^6.0.1" -strip-ansi@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" - integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== dependencies: - ansi-regex "^5.0.0" + ansi-regex "^5.0.1" strip-bom@^4.0.0: version "4.0.0" @@ -3041,18 +2964,6 @@ symbol-tree@^3.2.4: resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== -table@^6.0.9: - version "6.7.1" - resolved "https://registry.yarnpkg.com/table/-/table-6.7.1.tgz#ee05592b7143831a8c94f3cee6aae4c1ccef33e2" - integrity sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg== - dependencies: - ajv "^8.0.1" - lodash.clonedeep "^4.5.0" - lodash.truncate "^4.4.2" - slice-ansi "^4.0.0" - string-width "^4.2.0" - strip-ansi "^6.0.0" - terminal-link@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/terminal-link/-/terminal-link-2.1.1.tgz#14a64a27ab3c0df933ea546fba55f2d078edc994" @@ -3080,7 +2991,7 @@ throat@^6.0.1: resolved "https://registry.yarnpkg.com/throat/-/throat-6.0.1.tgz#d514fedad95740c12c2d7fc70ea863eb51ade375" integrity sha512-8hmiGIJMDlwjg7dlJ4yKGLK8EsYqKgPWbG3b4wjJddKNwc7N7Dpn08Df4szr/sZdMVeOstrdYSsqzX6BYbcB+w== -tmpl@1.0.x: +tmpl@1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== @@ -3239,11 +3150,11 @@ w3c-xmlserializer@^2.0.0: xml-name-validator "^3.0.0" walker@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" - integrity sha1-L3+bj9ENZ3JisYqITijRlhjgKPs= + version "1.0.8" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" + integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== dependencies: - makeerror "1.0.x" + makeerror "1.0.12" webidl-conversions@^5.0.0: version "5.0.0" From 35d91c3f02fab0665b534091c06462a9f6903a5b Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 28 Oct 2021 09:34:59 -0400 Subject: [PATCH 350/785] Bump to v2.0.0 --- CHANGELOG.md | 13 ++++++++----- package.json | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index efff5a0b..f6b969ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,12 +6,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [2.0.0] - 2021-10-28 + ### Changed - [#1018](https://github.com/prettier/plugin-ruby/issues/1018) - rindek, kddnewton - Ensure brackets are used when matching an array pattern with a single element. - [#906](https://github.com/prettier/plugin-ruby/issues/906) - Hansenq, kddnewton - Turn off the `Style/MultilineBlockChain` rubocop rule in our shipped configuration because multiple chained method calls with blocks can potentially conflict with rubocop's desired output. -## [2.0.0-rc4] +## [2.0.0-rc4] - 2021-10-18 ### Added @@ -22,14 +24,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#1000](https://github.com/prettier/plugin-ruby/pull/1000) - nbudin, kddnewton - Fix for rescuing single top-level exceptions in `rescue` clauses. -## [2.0.0-rc3] +## [2.0.0-rc3] - 2021-10-01 ### Changed - [#987](https://github.com/prettier/plugin-ruby/pull/9870) - valscion - Ignore stderr when checking for node <-> ruby connection clients, restoring the behavior of v1.x - [#989](https://github.com/prettier/plugin-ruby/issues/989) - hubertjakubiak, kddnewton - Make sure comments after the keyword/lbrace are not moved inside the body of the statements of do and brace blocks. -## [2.0.0-rc2] +## [2.0.0-rc2] - 2021-09-30 ### Added @@ -40,7 +42,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#943](https://github.com/prettier/plugin-ruby/issues/943) - valscion, kddnewton - Trailing call operators that are followed by comments should stay on the first line. -## [2.0.0-rc1] +## [2.0.0-rc1] - 2021-09-30 ### Added @@ -1185,7 +1187,8 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v2.0.0-rc4...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v2.0.0...HEAD +[2.0.0]: https://github.com/prettier/plugin-ruby/compare/v2.0.0-rc4...v2.0.0 [2.0.0-rc4]: https://github.com/prettier/plugin-ruby/compare/v2.0.0-rc3...v2.0.0-rc4 [2.0.0-rc3]: https://github.com/prettier/plugin-ruby/compare/v2.0.0-rc2...v2.0.0-rc3 [2.0.0-rc2]: https://github.com/prettier/plugin-ruby/compare/v2.0.0-rc1...v2.0.0-rc2 diff --git a/package.json b/package.json index 329bd33e..e2a69b38 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "2.0.0-rc4", + "version": "2.0.0", "description": "prettier plugin for the Ruby programming language", "main": "dist/plugin.js", "scripts": { From 2f43a29dfbd51b37396c7623d69b9b87325f3b00 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 25 Oct 2021 13:43:29 -0400 Subject: [PATCH 351/785] Move location information into its own key --- bin/debug | 19 +- bin/sexp | 4 +- src/ruby/nodes/statements.ts | 6 +- src/ruby/nodes/strings.ts | 2 +- src/ruby/parser.rb | 1639 +++++++++++++---------------- src/ruby/parser.ts | 4 +- src/types/ruby.ts | 8 +- src/utils/printEmptyCollection.ts | 2 +- test/rb/metadata_test.rb | 224 ++-- 9 files changed, 865 insertions(+), 1043 deletions(-) diff --git a/bin/debug b/bin/debug index 4f92bf48..1bc9608b 100755 --- a/bin/debug +++ b/bin/debug @@ -5,6 +5,7 @@ require 'bundler/inline' gemfile do source 'https://rubygems.org' gem 'sinatra', require: 'sinatra/base' + gem 'webrick' end require_relative '../src/ruby/parser' @@ -17,14 +18,10 @@ class App < Sinatra::Base end post '/ast' do - builder = Prettier::Parser.new(request.body.read) - response = builder.parse - - if !response || builder.error? - halt 422 - else - JSON.fast_generate(response) - end + response = Prettier::Parser.parse(request.body.read) + response ? JSON.fast_generate(response) : halt(422) + rescue Prettier::Parser::ParserError + halt 422 end start! @@ -122,10 +119,10 @@ const createTree = (parent, node) => { const button = document.createElement("button"); button.onclick = highlight; - button.setAttribute("data-char-start", node.sc); - button.setAttribute("data-char-end", node.ec); + button.setAttribute("data-char-start", node.loc.sc); + button.setAttribute("data-char-end", node.loc.ec); - const label = `${node.type} (${node.sc}-${node.ec})`; + const label = `${node.type} (${node.loc.sc}-${node.loc.ec})`; if (node.type.startsWith("@")) { button.appendChild(document.createTextNode(`${label} = ${node.body}`)); diff --git a/bin/sexp b/bin/sexp index adb1f4bf..c4a071b7 100755 --- a/bin/sexp +++ b/bin/sexp @@ -8,8 +8,8 @@ PP.prepend( def pp_hash(obj) group(1, '{', '}') do text obj[:type] - text "" + text "" group(1) do breakable ' ' diff --git a/src/ruby/nodes/statements.ts b/src/ruby/nodes/statements.ts index a5ec65e5..f47a9048 100644 --- a/src/ruby/nodes/statements.ts +++ b/src/ruby/nodes/statements.ts @@ -139,12 +139,12 @@ export const printStmts: Plugin.Printer = (path, opts, print) => { if (lineNo === null) { parts.push(printed); } else if ( - stmt.sl - lineNo > 1 || + stmt.loc.sl - lineNo > 1 || [stmt.type, stmts[index - 1].type].includes("access_ctrl") ) { parts.push(hardline, hardline, printed); } else if ( - stmt.sl !== lineNo || + stmt.loc.sl !== lineNo || path.getParentNode().type !== "string_embexpr" ) { parts.push(hardline, printed); @@ -152,7 +152,7 @@ export const printStmts: Plugin.Printer = (path, opts, print) => { parts.push("; ", printed); } - lineNo = stmt.el; + lineNo = stmt.loc.el; }); return parts; diff --git a/src/ruby/nodes/strings.ts b/src/ruby/nodes/strings.ts index 950991cb..1b44ace2 100644 --- a/src/ruby/nodes/strings.ts +++ b/src/ruby/nodes/strings.ts @@ -224,7 +224,7 @@ export const printStringEmbExpr: Plugin.Printer = ( // If the contents of this embedded expression were originally on the same // line in the source, then we're going to leave them in place and assume // that's the way the developer wanted this expression represented. - if (node.sl === node.el) { + if (node.loc.sl === node.loc.el) { return ["#{", removeLines(parts), "}"]; } diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 691998e9..4ffee5bd 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -55,6 +55,48 @@ def [](byteindex) end end + class Location + attr_reader :start_line, :start_char, :end_line, :end_char + + def initialize(start_line:, start_char:, end_line:, end_char:) + @start_line = start_line + @start_char = start_char + @end_line = end_line + @end_char = end_char + end + + def to_json(*opts) + { sl: start_line, sc: start_char, el: end_line, ec: end_char }.to_json(*opts) + end + + def self.range(from:, to:) + new( + start_line: from.start_line, + start_char: from.start_char, + end_line: to.end_line, + end_char: to.end_char + ) + end + + def self.token(line:, char:, size:) + new( + start_line: line, + start_char: char, + end_line: line, + end_char: char + size + ) + end + + def self.fixed(line:, char:) + new( + start_line: line, + start_char: char, + end_line: line, + end_char: char + ) + end + end + # This is a small wrapper around the value of a node for those specific events # that need extra handling. (For example: statement, body statement, and # rescue nodes which all need extra information to determine their character @@ -231,7 +273,7 @@ def find_scanner_event(type, body = :any, consume: true) def find_colon2_before(const) index = scanner_events.rindex do |event| - event[:type] == :@op && event[:body] == '::' && event[:sc] < const[:sc] + event[:type] == :@op && event[:body] == '::' && event[:loc].start_char < const[:loc].start_char end scanner_events[index] @@ -271,14 +313,14 @@ def on_BEGIN(stmts) beging = find_scanner_event(:@lbrace) ending = find_scanner_event(:@rbrace) - stmts.bind(find_next_statement_start(beging[:ec]), ending[:sc]) + stmts.bind(find_next_statement_start(beging[:loc].end_char), ending[:loc].start_char) + keyword = find_scanner_event(:@kw, 'BEGIN') - find_scanner_event(:@kw, 'BEGIN').merge!( + { type: :BEGIN, body: [beging, stmts], - el: ending[:el], - ec: ending[:ec] - ) + loc: Location.range(from: keyword[:loc], to: ending[:loc]) + } end # CHAR is a parser event that represents a single codepoint in the script @@ -290,16 +332,10 @@ def on_BEGIN(stmts) # characters with this as well, as in ?\C-a. # def on_CHAR(value) - start_line = lineno - start_char = char_pos - node = { type: :@CHAR, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -319,14 +355,14 @@ def on_END(stmts) beging = find_scanner_event(:@lbrace) ending = find_scanner_event(:@rbrace) - stmts.bind(find_next_statement_start(beging[:ec]), ending[:sc]) + stmts.bind(find_next_statement_start(beging[:loc].end_char), ending[:loc].start_char) + keyword = find_scanner_event(:@kw, 'END') - find_scanner_event(:@kw, 'END').merge!( + { type: :END, body: [beging, stmts], - el: ending[:el], - ec: ending[:ec] - ) + loc: Location.range(from: keyword[:loc], to: ending[:loc]) + } end # __END__ is a scanner event that represents __END__ syntax, which allows @@ -339,16 +375,10 @@ def on_END(stmts) # some other content that isn't executed by the program # def on___end__(value) - start_line = lineno - start_char = char_pos - @__end__ = { type: :@__end__, body: lines[lineno..-1].join("\n"), - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } end @@ -360,16 +390,13 @@ def on___end__(value) def on_alias(left, right) beging = find_scanner_event(:@kw, 'alias') - paren = source[beging[:ec]...left[:sc]].include?('(') + paren = source[beging[:loc].end_char...left[:loc].start_char].include?('(') ending = paren ? find_scanner_event(:@rparen) : right { type: :alias, body: [left, right], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end @@ -394,10 +421,7 @@ def on_aref(collection, index) { type: :aref, body: [collection, index], - sl: collection[:sl], - sc: collection[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: collection[:loc], to: ending[:loc]) } end @@ -410,10 +434,7 @@ def on_aref_field(collection, index) { type: :aref_field, body: [collection, index], - sl: collection[:sl], - sc: collection[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: collection[:loc], to: ending[:loc]) } end @@ -449,15 +470,12 @@ def on_arg_paren(args) # If the arguments exceed the ending of the parentheses, then we know we # have a heredoc in the arguments, and we need to use the bounds of the # arguments to determine how large the arg_paren is. - ending = (args && args[:el] > rparen[:el]) ? args : rparen + ending = (args && args[:loc].end_line > rparen[:loc].end_line) ? args : rparen { type: :arg_paren, body: [args], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end @@ -470,9 +488,15 @@ def on_args_add(args, arg) # If this is the first argument being passed into the list of arguments, # then we're going to use the bounds of the argument to override the # parent node's location since this will be more accurate. - arg.merge(type: :args, body: [arg]) + { type: :args, body: [arg], loc: arg[:loc] } else - args.merge!(body: args[:body] << arg, el: arg[:el], ec: arg[:ec]) + # Otherwise we're going to update the existing list with the argument + # being added as well as the new end bounds. + { + type: args[:type], + body: args[:body] << arg, + loc: Location.range(from: args[:loc], to: arg[:loc]) + } end end @@ -482,12 +506,11 @@ def on_args_add(args, arg) def on_args_add_block(args, block) ending = block || args - args.merge( + { type: :args_add_block, body: [args, block], - el: ending[:el], - ec: ending[:ec] - ) + loc: Location.range(from: args[:loc], to: ending[:loc]) + } end # args_add_star is a parser event that represents adding a splat of values @@ -500,17 +523,20 @@ def on_args_add_star(args, part) { type: :args_add_star, body: [args, part], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end # args_forward is a parser event that represents forwarding all kinds of # arguments onto another method call. def on_args_forward - find_scanner_event(:@op, '...').merge!(type: :args_forward) + event = find_scanner_event(:@op, '...') + + { + type: :args_forward, + body: event[:body], + loc: event[:loc] + } end # args_new is a parser event that represents the beginning of a list of @@ -520,10 +546,7 @@ def on_args_new { type: :args, body: [], - sl: lineno, - sc: char_pos, - el: lineno, - ec: char_pos + loc: Location.fixed(line: lineno, char: char_pos) } end @@ -539,21 +562,17 @@ def on_array(contents) { type: :array, body: [contents], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } else ending = find_scanner_event(:@tstring_end) - contents[:ec] = ending[:ec] + contents[:loc] = Location.range(from: contents[:loc], to: ending[:loc]) - ending.merge!( + { type: :array, body: [contents], - sl: contents[:sl], - sc: contents[:sc] - ) + loc: contents[:loc] + } end end @@ -565,10 +584,7 @@ def on_aryptn(const, preargs, splatarg, postargs) { type: :aryptn, body: [const, preargs, splatarg, postargs], - sl: pieces[0][:sl], - sc: pieces[0][:sc], - el: pieces[-1][:el], - ec: pieces[-1][:ec] + loc: Location.range(from: pieces[0][:loc], to: pieces[-1][:loc]) } end @@ -576,12 +592,11 @@ def on_aryptn(const, preargs, splatarg, postargs) # variable or constant. It accepts as arguments the left side of the # expression before the equals sign and the right side of the expression. def on_assign(left, right) - left.merge( + { type: :assign, body: [left, right], - el: right[:el], - ec: right[:ec] - ) + loc: Location.range(from: left[:loc], to: right[:loc]) + } end # assoc_new is a parser event that contains a key-value pair within a @@ -591,22 +606,20 @@ def on_assoc_new(key, value) { type: :assoc_new, body: [key, value], - sl: key[:sl], - sc: key[:sc], - el: value[:el], - ec: value[:ec] + loc: Location.range(from: key[:loc], to: value[:loc]) } end # assoc_splat is a parser event that represents splatting a value into a # hash (either a hash literal or a bare hash in a method call). def on_assoc_splat(contents) - find_scanner_event(:@op, '**').merge!( + event = find_scanner_event(:@op, '**') + + { type: :assoc_splat, body: [contents], - el: contents[:el], - ec: contents[:ec] - ) + loc: Location.range(from: event[:loc], to: contents[:loc]) + } end # assoclist_from_args is a parser event that contains a list of all of the @@ -617,26 +630,17 @@ def on_assoclist_from_args(assocs) { type: :assoclist_from_args, body: assocs, - sl: assocs[0][:sl], - sc: assocs[0][:sc], - el: assocs[-1][:el], - ec: assocs[-1][:ec] + loc: Location.range(from: assocs[0][:loc], to: assocs[-1][:loc]) } end # backref is a scanner event that represents a global variable referencing a # matched value. It comes in the form of a $ followed by a positive integer. def on_backref(value) - start_line = lineno - start_char = char_pos - node = { type: :@backref, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -647,16 +651,10 @@ def on_backref(value) # usually found being used for an xstring, but could also be found as the name # of a method being defined. def on_backtick(value) - start_line = lineno - start_char = char_pos - node = { type: :@backtick, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -671,10 +669,7 @@ def on_bare_assoc_hash(assoc_news) { type: :bare_assoc_hash, body: assoc_news, - sl: assoc_news[0][:sl], - sc: assoc_news[0][:sc], - el: assoc_news[-1][:el], - ec: assoc_news[-1][:ec] + loc: Location.range(from: assoc_news[0][:loc], to: assoc_news[-1][:loc]) } end @@ -682,21 +677,20 @@ def on_bare_assoc_hash(assoc_news) # It includes a bodystmt event that has all of the consequent clauses. def on_begin(bodystmt) beging = find_scanner_event(:@kw, 'begin') - ec = + end_char = if bodystmt[:body][1..-1].any? - bodystmt[:ec] + bodystmt[:loc].end_char else - find_scanner_event(:@kw, 'end')[:ec] + find_scanner_event(:@kw, 'end')[:loc].end_char end - bodystmt.bind(beging[:ec], ec) + bodystmt.bind(beging[:loc].end_char, end_char) - beging.merge!( + { type: :begin, body: [bodystmt], - el: bodystmt[:el], - ec: bodystmt[:ec] - ) + loc: Location.range(from: beging[:loc], to: bodystmt[:loc]) + } end # binary is a parser event that represents a binary operation between two @@ -711,10 +705,7 @@ def on_binary(left, oper, right) { type: :binary, body: [left, oper, right], - sl: left[:sl], - sc: left[:sc], - el: right[:el], - ec: right[:ec] + loc: Location.range(from: left[:loc], to: right[:loc]) } end @@ -724,7 +715,7 @@ def on_block_var(params, locals) index = scanner_events.rindex do |event| event[:type] == :@op && %w[| ||].include?(event[:body]) && - event[:sc] < params[:sc] + event[:loc].start_char < params[:loc].start_char end beging = scanner_events[index] @@ -733,40 +724,45 @@ def on_block_var(params, locals) { type: :block_var, body: [params, locals], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end # blockarg is a parser event that represents defining a block variable on # a method definition. def on_blockarg(ident) - find_scanner_event(:@op, '&').merge!( + event = find_scanner_event(:@op, '&') + + { type: :blockarg, body: [ident], - el: ident[:el], - ec: ident[:ec] - ) + loc: Location.range(from: event[:loc], to: ident[:loc]) + } end # bodystmt can't actually determine its bounds appropriately because it # doesn't necessarily know where it started. So the parent node needs to # report back down into this one where it goes. class BodyStmt < Node - def bind(sc, ec) - value.merge!(sc: sc, ec: ec) + def bind(start_char, end_char) + value[:loc] = + Location.new( + start_line: value[:loc].start_line, + start_char: start_char, + end_line: value[:loc].end_line, + end_char: end_char + ) + parts = value[:body] # Here we're going to determine the bounds for the stmts consequent = parts[1..-1].compact.first - value[:body][0].bind(sc, consequent ? consequent[:sc] : ec) + value[:body][0].bind(start_char, consequent ? consequent[:loc].start_char : end_char) # Next we're going to determine the rescue clause if there is one if parts[1] consequent = parts[2..-1].compact.first - value[:body][1].bind_end(consequent ? consequent[:sc] : ec) + value[:body][1].bind_end(consequent ? consequent[:loc].start_char : end_char) end end end @@ -778,10 +774,7 @@ def on_bodystmt(stmts, rescued, ensured, elsed) self, type: :bodystmt, body: [stmts, rescued, ensured, elsed], - sl: lineno, - sc: char_pos, - el: lineno, - ec: char_pos + loc: Location.fixed(line: lineno, char: char_pos) ) end @@ -794,18 +787,21 @@ def on_brace_block(block_var, stmts) ending = find_scanner_event(:@rbrace) stmts.bind( - find_next_statement_start((block_var || beging)[:ec]), - ending[:sc] + find_next_statement_start((block_var || beging)[:loc].end_char), + ending[:loc].start_char ) { type: :brace_block, body: [block_var, stmts], beging: beging, - sl: beging[:sl], - sc: beging[:sc], - el: [ending[:el], stmts[:el]].max, - ec: ending[:ec] + loc: + Location.new( + start_line: beging[:loc].start_line, + start_char: beging[:loc].start_char, + end_line: [ending[:loc].end_line, stmts[:loc].end_line].max, + end_char: ending[:loc].end_char + ) } end @@ -815,19 +811,23 @@ def on_brace_block(block_var, stmts) def on_break(args_add_block) beging = find_scanner_event(:@kw, 'break') - # You can hit this if you are passing no arguments to break but it has a - # comment right after it. In that case we can just use the location - # information straight from the keyword. if args_add_block[:type] == :args - return beging.merge!(type: :break, body: [args_add_block]) - end + # You can hit this if you are passing no arguments to break but it has a + # comment right after it. In that case we can just use the location + # information straight from the keyword. - beging.merge!( - type: :break, - body: [args_add_block], - el: args_add_block[:el], - ec: args_add_block[:ec] - ) + { + type: :break, + body: [args_add_block], + loc: beging[:loc] + } + else + { + type: :break, + body: [args_add_block], + loc: Location.range(from: beging[:loc], to: args_add_block[:loc]) + } + end end # call is a parser event representing a method call with no arguments. It @@ -841,24 +841,27 @@ def on_break(args_add_block) # # foo.(1, 2, 3) # - def on_call(receiver, oper, sending) + def on_call(receiver, operator, sending) ending = sending if sending == :call - ending = oper + ending = operator - # Special handling here for Ruby <= 2.5 because the oper argument to this - # method wasn't a parser event here it was just a plain symbol. + # Special handling here for Ruby <= 2.5 because the operator argument to + # this method wasn't a parser event here it was just a plain symbol. ending = receiver if RUBY_MAJOR <= 2 && RUBY_MINOR <= 5 end { type: :call, - body: [receiver, oper, sending], - sl: receiver[:sl], - sc: receiver[:sc], - el: [ending[:el], receiver[:el]].max, - ec: ending[:ec] + body: [receiver, operator, sending], + loc: + Location.new( + start_line: receiver[:loc].start_line, + start_char: receiver[:loc].start_char, + end_line: [ending[:loc].end_line, receiver[:loc].end_line].max, + end_char: ending[:loc].end_char + ) } end @@ -866,19 +869,22 @@ def on_call(receiver, oper, sending) # It accepts as arguments the switch of the case and the consequent # clause. def on_case(switch, consequent) - beging = - if event = find_scanner_event(:@kw, 'case', consume: false) - scanner_events.delete(event).merge!(type: :case) - else - keyword = find_scanner_event(:@kw, 'in', consume: false) - switch.merge(type: :rassign, keyword: keyword) - end + if event = find_scanner_event(:@kw, 'case', consume: false) + scanner_events.delete(event) - beging.merge!( - body: [switch, consequent], - el: consequent[:el], - ec: consequent[:ec] - ) + { + type: :case, + body: [switch, consequent], + loc: Location.range(from: event[:loc], to: consequent[:loc]) + } + else + { + type: :rassign, + body: [switch, consequent], + keyword: find_scanner_event(:@kw, 'in', consume: false), + loc: Location.range(from: switch[:loc], to: consequent[:loc]) + } + end end # class is a parser event that represents defining a class. It accepts as @@ -890,32 +896,23 @@ def on_class(const, superclass, bodystmt) ending = find_scanner_event(:@kw, 'end') bodystmt.bind( - find_next_statement_start((superclass || const)[:ec]), - ending[:sc] + find_next_statement_start((superclass || const)[:loc].end_char), + ending[:loc].start_char ) { type: :class, body: [const, superclass, bodystmt], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end # comma is a scanner event that represents the use of the comma operator. def on_comma(value) - start_line = lineno - start_char = char_pos - node = { type: :@comma, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -929,10 +926,7 @@ def on_command(ident, args) { type: :command, body: [ident, args], - sl: ident[:sl], - sc: ident[:sc], - el: args[:el], - ec: args[:ec] + loc: Location.range(from: ident[:loc], to: args[:loc]) } end @@ -946,10 +940,7 @@ def on_command_call(receiver, oper, ident, args) { type: :command_call, body: [receiver, oper, ident, args], - sl: receiver[:sl], - sc: receiver[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: receiver[:loc], to: ending[:loc]) } end @@ -964,18 +955,13 @@ def on_comment(value) # This will break everything when we attempt to print as JSON, so we need to # force the encoding back into UTF-8 so that it won't break. body = value[1..-1].chomp.force_encoding('UTF-8') - - start_line = lineno - start_char = char_pos + line = lineno @comments << { type: :@comment, value: body, - inline: value.strip != lines[lineno - 1], - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.length - 1 + inline: value.strip != lines[line - 1], + loc: Location.token(line: line, char: char_pos, size: value.size - 1) } end @@ -985,16 +971,10 @@ def on_comment(value) # call to a capitalized method, a symbol that starts with a capital letter, # etc. def on_const(value) - start_line = lineno - start_char = char_pos - node = { type: :@const, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -1011,10 +991,7 @@ def on_const_path_field(left, const) { type: :const_path_field, body: [left, const], - sl: left[:sl], - sc: left[:sc], - el: const[:el], - ec: const[:ec] + loc: Location.range(from: left[:loc], to: const[:loc]) } end @@ -1026,10 +1003,7 @@ def on_const_path_ref(left, const) { type: :const_path_ref, body: [left, const], - sl: left[:sl], - sc: left[:sc], - el: const[:el], - ec: const[:ec] + loc: Location.range(from: left[:loc], to: const[:loc]) } end @@ -1040,21 +1014,19 @@ def on_const_path_ref(left, const) # class Foo; end # def on_const_ref(const) - const.merge(type: :const_ref, body: [const]) + { + type: :const_ref, + body: [const], + loc: const[:loc] + } end # cvar is a scanner event that represents the use of a class variable. def on_cvar(value) - start_line = lineno - start_char = char_pos - node = { type: :@cvar, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -1093,34 +1065,36 @@ def on_def(ident, params, bodystmt) # If we don't have a bodystmt node, then we have a single-line method if bodystmt[:type] != :bodystmt - return( - { - type: :defsl, - body: [ident, params, bodystmt], - sl: beging[:sl], - sc: beging[:sc], - el: bodystmt[:el], - ec: bodystmt[:ec] - } - ) + defsl = { + type: :defsl, + body: [ident, params, bodystmt], + loc: Location.range(from: beging[:loc], to: bodystmt[:loc]) + } + + return defsl end + # If there aren't any params then we need to correct the params node + # location information if params[:type] == :params && !params[:body].any? - location = ident[:ec] - params.merge!(sc: location, ec: location) + location = ident[:loc].end_char + + params[:loc] = + Location.new( + start_line: params[:loc].start_line, + start_char: location, + end_line: params[:loc].end_line, + end_char: location + ) end ending = find_scanner_event(:@kw, 'end') - - bodystmt.bind(find_next_statement_start(params[:ec]), ending[:sc]) + bodystmt.bind(find_next_statement_start(params[:loc].end_char), ending[:loc].start_char) { type: :def, body: [ident, params, bodystmt], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end @@ -1144,23 +1118,29 @@ def on_defs(target, oper, ident, params, bodystmt) # of trouble scanner_events.delete(ident) + # If there aren't any params then we need to correct the params node + # location information if params[:type] == :params && !params[:body].any? - location = ident[:ec] - params.merge!(sc: location, ec: location) + location = ident[:loc].end_char + + params[:loc] = + Location.new( + start_line: params[:loc].start_line, + start_char: location, + end_line: params[:loc].end_line, + end_char: location + ) end beging = find_scanner_event(:@kw, 'def') ending = find_scanner_event(:@kw, 'end') - bodystmt.bind(find_next_statement_start(params[:ec]), ending[:sc]) + bodystmt.bind(find_next_statement_start(params[:loc].end_char), ending[:loc].start_char) { type: :defs, body: [target, oper, ident, params, bodystmt], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end @@ -1171,15 +1151,14 @@ def on_defs(target, oper, ident, params, bodystmt) def on_defined(value) beging = find_scanner_event(:@kw, 'defined?') - paren = source[beging[:ec]...value[:sc]].include?('(') + paren = source[beging[:loc].end_char...value[:loc].start_char].include?('(') ending = paren ? find_scanner_event(:@rparen) : value - beging.merge!( + { type: :defined, body: [value], - el: ending[:el], - ec: ending[:ec] - ) + loc: Location.range(from: beging[:loc], to: ending[:loc]) + } end # do_block is a parser event that represents passing a block to a method @@ -1191,18 +1170,15 @@ def on_do_block(block_var, bodystmt) ending = find_scanner_event(:@kw, 'end') bodystmt.bind( - find_next_statement_start((block_var || beging)[:ec]), - ending[:sc] + find_next_statement_start((block_var || beging)[:loc].end_char), + ending[:loc].start_char ) { type: :do_block, body: [block_var, bodystmt], beging: beging, - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end @@ -1218,10 +1194,7 @@ def on_dot2(left, right) { type: :dot2, body: [left, right], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end @@ -1237,10 +1210,7 @@ def on_dot3(left, right) { type: :dot3, body: [left, right], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end @@ -1268,26 +1238,23 @@ def on_dyna_symbol(string) beging = find_scanner_event(:@symbeg) ending = find_scanner_event(:@tstring_end) - beging.merge( + { type: :dyna_symbol, quote: beging[:body], body: string[:body], - el: ending[:el], - ec: ending[:ec] - ) + loc: Location.range(from: beging[:loc], to: ending[:loc]) + } else # A dynamic symbol as a hash key beging = find_scanner_event(:@tstring_beg) ending = find_scanner_event(:@label_end) - string.merge!( + { type: :dyna_symbol, + body: string[:body], quote: ending[:body][0], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] - ) + loc: Location.range(from: beging[:loc], to: ending[:loc]) + } end end @@ -1308,15 +1275,12 @@ def on_else(stmts) event = scanner_events[index] ending = event[:body] == 'end' ? scanner_events.delete_at(index) : event - stmts.bind(beging[:ec], ending[:sc]) + stmts.bind(beging[:loc].end_char, ending[:loc].start_char) { type: :else, body: [stmts], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end @@ -1328,15 +1292,12 @@ def on_elsif(predicate, stmts, consequent) beging = find_scanner_event(:@kw, 'elsif') ending = consequent || find_scanner_event(:@kw, 'end') - stmts.bind(predicate[:ec], ending[:sc]) + stmts.bind(predicate[:loc].end_char, ending[:loc].start_char) { type: :elsif, body: [predicate, stmts, consequent], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end @@ -1354,7 +1315,11 @@ def on_embdoc(value) # and add to it as we get content. It always starts with this scanner # event, so here we'll initialize the current embdoc. def on_embdoc_beg(value) - @embdoc = { type: :@embdoc, value: value, sl: lineno, sc: char_pos } + @embdoc = { + type: :@embdoc, + value: value, + loc: Location.fixed(line: lineno, char: char_pos) + } end # This is the final scanner event for embdocs. It receives the =end. Here @@ -1362,12 +1327,20 @@ def on_embdoc_beg(value) # piece of the string. We then add it to the list of comments so that # prettier can place it into the final source string. def on_embdoc_end(value) + location = @embdoc[:loc] + @comments << - @embdoc.merge!( + { + type: :@embdoc, value: @embdoc[:value] << value.chomp, - el: lineno, - ec: char_pos + value.length - 1 - ) + loc: + Location.new( + start_line: location.start_line, + start_char: location.start_char, + end_line: lineno, + end_char: char_pos + value.length - 1 + ) + } @embdoc = nil end @@ -1375,16 +1348,10 @@ def on_embdoc_end(value) # embexpr_beg is a scanner event that represents using interpolation inside of # a string, xstring, heredoc, or regexp. Its value is the string literal "#{". def on_embexpr_beg(value) - start_line = lineno - start_char = char_pos - node = { type: :@embexpr_beg, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -1395,16 +1362,10 @@ def on_embexpr_beg(value) # expression in a string, xstring, heredoc, or regexp. Its value is the string # literal "}". def on_embexpr_end(value) - start_line = lineno - start_char = char_pos - node = { type: :@embexpr_end, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -1422,16 +1383,10 @@ def on_embexpr_end(value) # instance variable. That would all get bound up into a string_dvar node in # the final AST. def on_embvar(value) - start_line = lineno - start_char = char_pos - node = { type: :@embvar, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -1451,15 +1406,12 @@ def on_ensure(stmts) end ending = scanner_events[index] - stmts.bind(find_next_statement_start(beging[:ec]), ending[:sc]) + stmts.bind(find_next_statement_start(beging[:loc].end_char), ending[:loc].start_char) { type: :ensure, body: [beging, stmts], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end @@ -1468,13 +1420,15 @@ def on_ensure(stmts) # different number of arguments depending on Ruby version, which is why we # have the anonymous splat there. def on_excessed_comma(*) - find_scanner_event(:@comma).merge!(type: :excessed_comma) + event = find_scanner_event(:@comma) + + { type: :excessed_comma, body: event[:body], loc: event[:loc] } end # An fcall is a parser event that represents the piece of a method call # that comes before any arguments (i.e., just the name of the method). def on_fcall(ident) - ident.merge(type: :fcall, body: [ident]) + { type: :fcall, body: [ident], loc: ident[:loc] } end # A field is a parser event that is always the child of an assignment. It @@ -1487,25 +1441,16 @@ def on_field(left, oper, right) { type: :field, body: [left, oper, right], - sl: left[:sl], - sc: left[:sc], - el: right[:el], - ec: right[:ec] + loc: Location.range(from: left[:loc], to: right[:loc]) } end # float is a scanner event that represents a floating point value literal. def on_float(value) - start_line = lineno - start_char = char_pos - node = { type: :@float, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -1521,10 +1466,7 @@ def on_fndptn(const, presplat, args, postsplat) { type: :fndptn, body: [const, presplat, args, postsplat], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end @@ -1539,34 +1481,25 @@ def on_for(ident, enum, stmts) # Consume the do keyword if it exists so that it doesn't get confused for # some other block do_event = find_scanner_event(:@kw, 'do', consume: false) - if do_event && do_event[:sc] > enum[:ec] && do_event[:ec] < ending[:sc] + if do_event && do_event[:loc].start_char > enum[:loc].end_char && do_event[:loc].end_char < ending[:loc].start_char scanner_events.delete(do_event) end - stmts.bind((do_event || enum)[:ec], ending[:sc]) + stmts.bind((do_event || enum)[:loc].end_char, ending[:loc].start_char) { type: :for, body: [ident, enum, stmts], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end # gvar is a scanner event that represents a global variable literal. def on_gvar(value) - start_line = lineno - start_char = char_pos - node = { type: :@gvar, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -1583,16 +1516,19 @@ def on_hash(assoclist_from_args) if assoclist_from_args # Here we're going to expand out the location information for the assocs # node so that it can grab up any remaining comments inside the hash. - assoclist_from_args.merge!(sc: beging[:ec], ec: ending[:sc]) + assoclist_from_args[:loc] = + Location.new( + start_line: assoclist_from_args[:loc].start_line, + start_char: beging[:loc].end_char, + end_line: assoclist_from_args[:loc].end_line, + end_char: ending[:loc].start_char + ) end { type: :hash, body: [assoclist_from_args], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end @@ -1603,21 +1539,19 @@ def on_hash(assoclist_from_args) # prettier parser, we'll later attempt to print it using that parser and # printer through our embed function. def on_heredoc_beg(beging) - location = { - sl: lineno, - el: lineno, - sc: char_pos, - ec: char_pos + beging.length + 1 - } + location = + Location.token(line: lineno, char: char_pos, size: beging.size + 1) # Here we're going to artificially create an extra node type so that if # there are comments after the declaration of a heredoc, they get printed. - location - .merge( - type: :heredoc, - beging: location.merge(type: :@heredoc_beg, body: beging) - ) - .tap { |node| @heredocs << node } + node = { + type: :heredoc, + beging: { type: :@heredoc_beg, body: beging, loc: location }, + loc: location + } + + @heredocs << node + node end # This is a parser event that occurs when you're using a heredoc with a @@ -1629,7 +1563,17 @@ def on_heredoc_dedent(string, _width) # This is a scanner event that represents the end of the heredoc. def on_heredoc_end(ending) - @heredocs[-1].merge!(ending: ending.chomp, el: lineno, ec: char_pos) + location = @heredocs[-1][:loc] + + @heredocs[-1][:loc] = + Location.new( + start_line: location.start_line, + start_char: location.start_char, + end_line: lineno, + end_char: char_pos + ) + + @heredocs[-1].merge!(ending: ending.chomp) end # hshptn is a parser event that represents matching against a hash pattern @@ -1640,10 +1584,7 @@ def on_hshptn(const, kw, kwrest) { type: :hshptn, body: [const, kw, kwrest], - sl: pieces[0][:sl], - sc: pieces[0][:sc], - el: pieces[-1][:el], - ec: pieces[-1][:ec] + loc: Location.range(from: pieces[0][:loc], to: pieces[-1][:loc]) } end @@ -1652,16 +1593,10 @@ def on_hshptn(const, kw, kwrest) # the AST. Like comments, we need to force the encoding here so JSON doesn't # break. def on_ident(value) - start_line = lineno - start_char = char_pos - node = { type: :@ident, body: value.force_encoding('UTF-8'), - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -1675,15 +1610,12 @@ def on_if(predicate, stmts, consequent) beging = find_scanner_event(:@kw, 'if') ending = consequent || find_scanner_event(:@kw, 'end') - stmts.bind(predicate[:ec], ending[:sc]) + stmts.bind(predicate[:loc].end_char, ending[:loc].start_char) { type: :if, body: [predicate, stmts, consequent], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end @@ -1691,12 +1623,11 @@ def on_if(predicate, stmts, consequent) # arguments the predicate to the ternary, the truthy clause, and the falsy # clause. def on_ifop(predicate, truthy, falsy) - predicate.merge( + { type: :ifop, body: [predicate, truthy, falsy], - el: falsy[:el], - ec: falsy[:ec] - ) + loc: Location.range(from: predicate[:loc], to: falsy[:loc]) + } end # if_mod is a parser event that represents the modifier form of an if @@ -1708,10 +1639,7 @@ def on_if_mod(predicate, statement) { type: :if_mod, body: [predicate, statement], - sl: statement[:sl], - sc: statement[:sc], - el: predicate[:el], - ec: predicate[:ec] + loc: Location.range(from: statement[:loc], to: predicate[:loc]) } end @@ -1749,16 +1677,10 @@ def on_if_mod(predicate, statement) # imaginary is a scanner event that represents an imaginary number literal. # They become instances of the Complex class. def on_imaginary(value) - start_line = lineno - start_char = char_pos - node = { type: :@imaginary, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -1775,28 +1697,21 @@ def on_in(pattern, stmts, consequent) beging = find_scanner_event(:@kw, 'in') ending = consequent || find_scanner_event(:@kw, 'end') - stmts.bind(beging[:ec], ending[:sc]) + stmts.bind(beging[:loc].end_char, ending[:loc].start_char) - beging.merge!( + { type: :in, body: [pattern, stmts, consequent], - el: ending[:el], - ec: ending[:ec] - ) + loc: Location.range(from: beging[:loc], to: ending[:loc]) + } end # int is a scanner event the represents a number literal. def on_int(value) - start_line = lineno - start_char = char_pos - node = { type: :@int, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -1805,16 +1720,10 @@ def on_int(value) # ivar is a scanner event the represents an instance variable literal. def on_ivar(value) - start_line = lineno - start_char = char_pos - node = { type: :@ivar, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -1824,16 +1733,10 @@ def on_ivar(value) # kw is a scanner event the represents the use of a keyword. It can be # anywhere in the AST, so you end up seeing it quite a lot. def on_kw(value) - start_line = lineno - start_char = char_pos - node = { type: :@kw, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -1843,15 +1746,10 @@ def on_kw(value) # kwrest_param is a parser event that represents defining a parameter in a # method definition that accepts all remaining keyword parameters. def on_kwrest_param(ident) - oper = find_scanner_event(:@op, '**') - return oper.merge!(type: :kwrest_param, body: [nil]) unless ident + location = find_scanner_event(:@op, '**')[:loc] + location = Location.range(from: location, to: ident[:loc]) if ident - oper.merge!( - type: :kwrest_param, - body: [ident], - el: ident[:el], - ec: ident[:ec] - ) + { type: :kwrest_param, body: [ident], loc: location } end # label is a scanner event that represents the use of an identifier to @@ -1869,16 +1767,10 @@ def on_kwrest_param(ident) # # in this case "bar:" would be the body of the label. def on_label(value) - start_line = lineno - start_char = char_pos - node = { type: :@label, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -1893,16 +1785,10 @@ def on_label(value) # then the string "\":" would be the value of this label_end. It's useful for # determining the type of quote being used by the label. def on_label_end(value) - start_line = lineno - start_char = char_pos - node = { type: :@label_end, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -1927,30 +1813,21 @@ def on_lambda(params, stmts) closing = find_scanner_event(:@kw, 'end') end - stmts.bind(opening[:ec], closing[:sc]) + stmts.bind(opening[:loc].end_char, closing[:loc].start_char) { type: :lambda, body: [params, stmts], - sl: beging[:sl], - sc: beging[:sc], - el: closing[:el], - ec: closing[:ec] + loc: Location.range(from: beging[:loc], to: closing[:loc]) } end # lbrace is a scanner event representing the use of a left brace, i.e., "{". def on_lbrace(value) - start_line = lineno - start_char = char_pos - node = { type: :@lbrace, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -1960,16 +1837,10 @@ def on_lbrace(value) # lbracket is a scanner event representing the use of a left bracket, i.e., # "[". def on_lbracket(value) - start_line = lineno - start_char = char_pos - node = { type: :@lbracket, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -1979,16 +1850,10 @@ def on_lbracket(value) # lparen is a scanner event representing the use of a left parenthesis, i.e., # "(". def on_lparen(value) - start_line = lineno - start_char = char_pos - node = { type: :@lparen, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -2023,15 +1888,13 @@ def on_lparen(value) # in which case we need to explicitly track the comma and add it onto the # child node. def on_massign(left, right) - left[:comma] = true if source[left[:ec]...right[:sc]].strip.start_with?(',') + comma_range = left[:loc].end_char...right[:loc].start_char + left[:comma] = true if source[comma_range].strip.start_with?(',') { type: :massign, body: [left, right], - sl: left[:sl], - sc: left[:sc], - el: right[:el], - ec: right[:ec] + loc: Location.range(from: left[:loc], to: right[:loc]) } end @@ -2039,22 +1902,18 @@ def on_massign(left, right) # arguments and parentheses. It accepts as arguments the method being called # and the arg_paren event that contains the arguments to the method. def on_method_add_arg(fcall, arg_paren) - # You can hit this if you are passing no arguments to a method that ends in - # a question mark. Because it knows it has to be a method and not a local - # variable. In that case we can just use the location information straight - # from the fcall. - if arg_paren[:type] == :args - return fcall.merge(type: :method_add_arg, body: [fcall, arg_paren]) - end - - { - type: :method_add_arg, - body: [fcall, arg_paren], - sl: fcall[:sl], - sc: fcall[:sc], - el: arg_paren[:el], - ec: arg_paren[:ec] - } + location = + if arg_paren[:type] == :args + # You can hit this if you are passing no arguments to a method that ends + # in a question mark. Because it knows it has to be a method and not a + # local variable. In that case we can just use the location information + # straight from the fcall. + fcall[:loc] + else + Location.range(from: fcall[:loc], to: arg_paren[:loc]) + end + + { type: :method_add_arg, body: [fcall, arg_paren], loc: location } end # method_add_block is a parser event that represents a method call with a @@ -2064,10 +1923,7 @@ def on_method_add_block(method_add_arg, block) { type: :method_add_block, body: [method_add_arg, block], - sl: method_add_arg[:sl], - sc: method_add_arg[:sc], - el: block[:el], - ec: block[:ec] + loc: Location.range(from: method_add_arg[:loc], to: block[:loc]) } end @@ -2078,10 +1934,7 @@ def on_mlhs_new { type: :mlhs, body: [], - sl: lineno, - sc: char_pos, - el: lineno, - ec: char_pos + loc: Location.fixed(line: lineno, char: char_pos) } end @@ -2090,9 +1943,13 @@ def on_mlhs_new # as well as the part that is being added to the list. def on_mlhs_add(mlhs, part) if mlhs[:body].empty? - part.merge(type: :mlhs, body: [part]) + { type: :mlhs, body: [part], loc: part[:loc] } else - mlhs.merge!(body: mlhs[:body] << part, el: part[:el], ec: part[:ec]) + { + type: :mlhs, + body: mlhs[:body] << part, + loc: Location.range(from: mlhs[:loc], to: part[:loc]) + } end end @@ -2102,12 +1959,11 @@ def on_mlhs_add(mlhs, part) # as well another mlhs node that represents all of the variables after the # splat. def on_mlhs_add_post(mlhs_add_star, mlhs) - mlhs_add_star.merge( + { type: :mlhs_add_post, body: [mlhs_add_star, mlhs], - el: mlhs[:el], - ec: mlhs[:ec] - ) + loc: Location.range(from: mlhs_add_star[:loc], to: mlhs[:loc]) + } end # An mlhs_add_star is a parser event that represents a splatted variable @@ -2121,10 +1977,7 @@ def on_mlhs_add_star(mlhs, part) { type: :mlhs_add_star, body: [mlhs, part], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end @@ -2136,17 +1989,13 @@ def on_mlhs_paren(contents) beging = find_scanner_event(:@lparen) ending = find_scanner_event(:@rparen) - if source[beging[:ec]...ending[:sc]].strip.end_with?(',') - contents[:comma] = true - end + comma_range = beging[:loc].end_char...ending[:loc].start_char + contents[:comma] = true if source[comma_range].strip.end_with?(',') { type: :mlhs_paren, body: [contents], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end @@ -2157,15 +2006,12 @@ def on_module(const, bodystmt) beging = find_scanner_event(:@kw, 'module') ending = find_scanner_event(:@kw, 'end') - bodystmt.bind(find_next_statement_start(const[:ec]), ending[:sc]) + bodystmt.bind(find_next_statement_start(const[:loc].end_char), ending[:loc].start_char) { type: :module, body: [const, bodystmt], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end @@ -2177,10 +2023,7 @@ def on_mrhs_new { type: :mrhs, body: [], - sl: lineno, - sc: char_pos, - el: lineno, - ec: char_pos + loc: Location.fixed(line: lineno, char: char_pos) } end @@ -2188,9 +2031,13 @@ def on_mrhs_new # a list on the right hand side of a multiple assignment. def on_mrhs_add(mrhs, part) if mrhs[:body].empty? - part.merge(type: :mrhs, body: [part]) + { type: :mrhs, body: [part], loc: mrhs[:loc] } else - mrhs.merge!(body: mrhs[:body] << part, el: part[:el], ec: part[:ec]) + { + type: mrhs[:type], + body: mrhs[:body] << part, + loc: Location.range(from: mrhs[:loc], to: part[:loc]) + } end end @@ -2204,10 +2051,7 @@ def on_mrhs_add_star(mrhs, part) { type: :mrhs_add_star, body: [mrhs, part], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end @@ -2220,19 +2064,20 @@ def on_mrhs_add_star(mrhs, part) # foo = 1, 2, 3 # def on_mrhs_new_from_args(args) - args.merge(type: :mrhs_new_from_args, body: [args]) + { type: :mrhs_new_from_args, body: [args], loc: args[:loc] } end # next is a parser event that represents using the next keyword. It # accepts as an argument an args or args_add_block event that contains all # of the arguments being passed to the next. def on_next(args_add_block) - find_scanner_event(:@kw, 'next').merge!( + event = find_scanner_event(:@kw, 'next') + + { type: :next, body: [args_add_block], - el: args_add_block[:el], - ec: args_add_block[:ec] - ) + loc: Location.range(from: event[:loc], to: args_add_block[:loc]) + } end # nl is a scanner event representing a newline in the source. As you can @@ -2265,16 +2110,10 @@ def on_next(args_add_block) # # the + sign is an operator. def on_op(value) - start_line = lineno - start_char = char_pos - node = { type: :@op, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -2286,12 +2125,11 @@ def on_op(value) # arguments the left side of the expression before the operator, the # operator itself, and the right side of the expression. def on_opassign(left, oper, right) - left.merge( + { type: :opassign, body: [left, oper, right], - el: right[:el], - ec: right[:ec] - ) + loc: Location.range(from: left[:loc], to: right[:loc]) + } end # operator_ambiguous is a parser event that represents when the parsers sees @@ -2317,17 +2155,12 @@ def on_params(*types) flattened = types.flatten(2).select { |type| type.is_a?(Hash) } location = if flattened.any? - { - sl: flattened[0][:sl], - sc: flattened[0][:sc], - el: flattened[-1][:el], - ec: flattened[-1][:ec] - } + Location.range(from: flattened[0][:loc], to: flattened[-1][:loc]) else - { sl: lineno, sc: char_pos, el: lineno, ec: char_pos } + Location.fixed(line: lineno, char: char_pos) end - location.merge!(type: :params, body: types) + { type: :params, body: types, loc: location } end # A paren is a parser event that represents using parentheses pretty much @@ -2338,20 +2171,21 @@ def on_paren(contents) rparen = find_scanner_event(:@rparen) if contents && contents[:type] == :params - contents.merge!( - sc: find_next_statement_start(lparen[:ec]), - ec: rparen[:sc] - ) + location = contents[:loc] + contents[:loc] = + Location.new( + start_line: location.start_line, + start_char: find_next_statement_start(lparen[:loc].end_char), + end_line: location.end_line, + end_char: rparen[:loc].start_char + ) end { type: :paren, lparen: lparen, body: [contents], - sl: lparen[:sl], - sc: lparen[:sc], - el: rparen[:el], - ec: rparen[:ec] + loc: Location.range(from: lparen[:loc], to: rparen[:loc]) } end @@ -2368,16 +2202,10 @@ def on_parse_error(error, *) # period is a scanner event that represents the use of the period operator. It # is usually found in method calls. def on_period(value) - start_line = lineno - start_char = char_pos - { type: :@period, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } end @@ -2386,12 +2214,18 @@ def on_period(value) # source string. We'll also attach on the __END__ content if there was # some found at the end of the source string. def on_program(stmts) - range = { sl: 1, el: lines.length, sc: 0, ec: source.length } + location = + Location.new( + start_line: 1, + start_char: 0, + end_line: lines.length, + end_char: source.length + ) stmts[:body] << @__end__ if @__end__ stmts.bind(0, source.length) - range.merge(type: :program, body: [stmts], comments: @comments) + { type: :program, body: [stmts], comments: @comments, loc: location } end # qsymbols_beg is a scanner event that represents the beginning of a symbol @@ -2401,16 +2235,10 @@ def on_program(stmts) # # a qsymbols_beg would be triggered with the value of "%i[". def on_qsymbols_beg(value) - start_line = lineno - start_char = char_pos - node = { type: :@qsymbols_beg, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -2421,7 +2249,9 @@ def on_qsymbols_beg(value) # literal array, like %i[one two three]. It can be followed by any number # of qsymbols_add events, which we'll append onto an array body. def on_qsymbols_new - find_scanner_event(:@qsymbols_beg).merge!(type: :qsymbols, body: []) + event = find_scanner_event(:@qsymbols_beg) + + { type: :qsymbols, body: [], loc: event[:loc] } end # qsymbols_add is a parser event that represents an element inside of a @@ -2429,11 +2259,11 @@ def on_qsymbols_new # parent qsymbols node as well as a tstring_content scanner event # representing the bare words. def on_qsymbols_add(qsymbols, tstring_content) - qsymbols.merge!( + { + type: :qsymbols, body: qsymbols[:body] << tstring_content, - el: tstring_content[:el], - ec: tstring_content[:ec] - ) + loc: Location.range(from: qsymbols[:loc], to: tstring_content[:loc]) + } end # qwords_beg is a scanner event that represents the beginning of a word @@ -2443,16 +2273,10 @@ def on_qsymbols_add(qsymbols, tstring_content) # # a qwords_beg would be triggered with the value of "%w[". def on_qwords_beg(value) - start_line = lineno - start_char = char_pos - node = { type: :@qwords_beg, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -2463,7 +2287,9 @@ def on_qwords_beg(value) # literal array, like %w[one two three]. It can be followed by any number # of qwords_add events, which we'll append onto an array body. def on_qwords_new - find_scanner_event(:@qwords_beg).merge!(type: :qwords, body: []) + event = find_scanner_event(:@qwords_beg) + + { type: :qwords, body: [], loc: event[:loc] } end # qsymbols_add is a parser event that represents an element inside of a @@ -2471,25 +2297,19 @@ def on_qwords_new # parent qsymbols node as well as a tstring_content scanner event # representing the bare words. def on_qwords_add(qwords, tstring_content) - qwords.merge!( + { + type: :qwords, body: qwords[:body] << tstring_content, - el: tstring_content[:el], - ec: tstring_content[:ec] - ) + loc: Location.range(from: qwords[:loc], to: tstring_content[:loc]) + } end # rational is a scanner event that represents a rational number literal. def on_rational(value) - start_line = lineno - start_char = char_pos - node = { type: :@rational, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -2499,16 +2319,10 @@ def on_rational(value) # rbrace is a scanner event that represents the use of a right brace, i.e., # "}". def on_rbrace(value) - start_line = lineno - start_char = char_pos - node = { type: :@rbrace, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -2518,16 +2332,10 @@ def on_rbrace(value) # rbracket is a scanner event that represents the use of a right bracket, # i.e., "]". def on_rbracket(value) - start_line = lineno - start_char = char_pos - node = { type: :@rbracket, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -2537,7 +2345,9 @@ def on_rbracket(value) # redo is a parser event that represents the bare redo keyword. It has no # body as it accepts no arguments. def on_redo - find_scanner_event(:@kw, 'redo').merge!(type: :redo) + event = find_scanner_event(:@kw, 'redo') + + { type: :redo, body: event[:body], loc: event[:loc] } end # regexp_add is a parser event that represents a piece of a regular expression @@ -2546,27 +2356,22 @@ def on_redo # string_embexpr parser event representing interpolated content, or a # string_dvar parser event representing an interpolated variable. def on_regexp_add(regexp, piece) - regexp.merge!( + { + type: :regexp, body: regexp[:body] << piece, - el: regexp[:el], - ec: regexp[:ec] - ) + beging: regexp[:beging], + loc: Location.range(from: regexp[:loc], to: piece[:loc]) + } end # regexp_beg is a scanner event that represents the start of a regular # expression. It can take a couple of forms since regexp can either start with # a forward slash or a %r. def on_regexp_beg(value) - start_line = lineno - start_char = char_pos - node = { type: :@regexp_beg, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -2577,16 +2382,10 @@ def on_regexp_beg(value) # expression. It will contain the closing brace or slash, as well as any flags # being passed to the regexp. def on_regexp_end(value) - start_line = lineno - start_char = char_pos - { type: :@regexp_end, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } end @@ -2595,12 +2394,13 @@ def on_regexp_end(value) # pieces that go into the regexp content, as well as the ending used to # close out the regexp which includes any modifiers. def on_regexp_literal(regexp, ending) - regexp.merge!( + { type: :regexp_literal, + body: regexp[:body], + beging: regexp[:beging], ending: ending[:body], - el: ending[:el], - ec: ending[:ec] - ) + loc: Location.range(from: regexp[:loc], to: ending[:loc]) + } end # regexp_new is a parser event that represents the beginning of a regular @@ -2608,7 +2408,8 @@ def on_regexp_literal(regexp, ending) # regexp_add events, which we'll append onto an array body. def on_regexp_new beging = find_scanner_event(:@regexp_beg) - beging.merge!(type: :regexp, body: [], beging: beging[:body]) + + { type: :regexp, body: [], beging: beging[:body], loc: beging[:loc] } end # rescue is a special kind of node where you have a rescue chain but it @@ -2616,17 +2417,24 @@ def on_regexp_new # determine its ending. Therefore it relies on its parent bodystmt node to # report its ending to it. class Rescue < Node - def bind_end(ec) - value.merge!(ec: ec) + def bind_end(end_char) + location = value[:loc] + value[:loc] = + Location.new( + start_line: location.start_line, + start_char: location.start_char, + end_line: location.end_line, + end_char: end_char + ) stmts = value[:body][1] consequent = value[:body][2] if consequent - consequent.bind_end(ec) - stmts.bind_end(consequent[:sc]) + consequent.bind_end(end_char) + stmts.bind_end(consequent[:loc].start_char) else - stmts.bind_end(ec) + stmts.bind_end(end_char) end end end @@ -2638,7 +2446,7 @@ def on_rescue(exceptions, variable, stmts, consequent) exceptions = exceptions[0] if exceptions.is_a?(Array) last_node = variable || exceptions || beging - stmts.bind(find_next_statement_start(last_node[:ec]), char_pos) + stmts.bind(find_next_statement_start(last_node[:loc].end_char), char_pos) # We add an additional inner node here that ripper doesn't provide so that # we have a nice place to attach inline comment. But we only need it if we @@ -2648,21 +2456,29 @@ def on_rescue(exceptions, variable, stmts, consequent) { type: :rescue_ex, body: [exceptions, variable], - sl: beging[:sl], - sc: beging[:ec] + 1, - el: last_node[:el], - ec: last_node[:ec] + loc: + Location.new( + start_line: beging[:loc].start_line, + start_char: beging[:loc].end_char + 1, + end_line: last_node[:loc].end_line, + end_char: last_node[:loc].end_char + ) } end Rescue.new( self, - beging.merge!( + { type: :rescue, body: [rescue_ex, stmts, consequent], - el: lineno, - ec: char_pos - ) + loc: + Location.new( + start_line: beging[:loc].start_line, + start_char: beging[:loc].start_char, + end_line: lineno, + end_char: char_pos + ) + } ) end @@ -2675,10 +2491,7 @@ def on_rescue_mod(statement, rescued) { type: :rescue_mod, body: [statement, rescued], - sl: statement[:sl], - sc: statement[:sc], - el: rescued[:el], - ec: rescued[:ec] + loc: Location.range(from: statement[:loc], to: rescued[:loc]) } end @@ -2687,33 +2500,31 @@ def on_rescue_mod(statement, rescued) # accepts as an argument an optional identifier for the parameter. If it # is omitted, then we're just using the plain operator. def on_rest_param(ident) - oper = find_scanner_event(:@op, '*') - return oper.merge!(type: :rest_param, body: [nil]) unless ident + location = find_scanner_event(:@op, '*')[:loc] + location = Location.range(from: location, to: ident[:loc]) if ident - oper.merge!( - type: :rest_param, - body: [ident], - el: ident[:el], - ec: ident[:ec] - ) + { type: :rest_param, body: [ident], loc: location } end # retry is a parser event that represents the bare retry keyword. It has # no body as it accepts no arguments. def on_retry - find_scanner_event(:@kw, 'retry').merge!(type: :retry) + event = find_scanner_event(:@kw, 'retry') + + { type: :retry, body: event[:body], loc: event[:loc] } end # return is a parser event that represents using the return keyword with # arguments. It accepts as an argument an args_add_block event that # contains all of the arguments being passed. def on_return(args_add_block) - find_scanner_event(:@kw, 'return').merge!( + event = find_scanner_event(:@kw, 'return') + + { type: :return, body: [args_add_block], - el: args_add_block[:el], - ec: args_add_block[:ec] - ) + loc: Location.range(from: event[:loc], to: args_add_block[:loc]) + } end # return0 is a parser event that represents the bare return keyword. It @@ -2721,22 +2532,18 @@ def on_return(args_add_block) # parser event, which is the version where you're returning one or more # values. def on_return0 - find_scanner_event(:@kw, 'return').merge!(type: :return0) + event = find_scanner_event(:@kw, 'return') + + { type: :return0, body: event[:body], loc: event[:loc] } end # rparen is a scanner event that represents the use of a right parenthesis, # i.e., ")". def on_rparen(value) - start_line = lineno - start_char = char_pos - node = { type: :@rparen, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -2757,15 +2564,12 @@ def on_sclass(target, bodystmt) beging = find_scanner_event(:@kw, 'class') ending = find_scanner_event(:@kw, 'end') - bodystmt.bind(find_next_statement_start(target[:ec]), ending[:sc]) + bodystmt.bind(find_next_statement_start(target[:loc].end_char), ending[:loc].start_char) { type: :sclass, body: [target, bodystmt], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end @@ -2802,26 +2606,49 @@ def on_stmts_add(stmts, stmt) # propagate that onto void_stmt nodes inside the stmts in order to make sure # all comments get printed appropriately. class Stmts < Node - def bind(sc, ec) - value.merge!(sc: sc, ec: ec) + def bind(start_char, end_char) + location = value[:loc] + value[:loc] = + Location.new( + start_line: location.start_line, + start_char: start_char, + end_line: location.end_line, + end_char: end_char + ) if value[:body][0][:type] == :void_stmt - value[:body][0].merge!(sc: sc, ec: sc) + location = value[:body][0][:loc] + value[:body][0][:loc] = + Location.new( + start_line: location.start_line, + start_char: start_char, + end_line: location.end_line, + end_char: start_char + ) end - attach_comments(sc, ec) + attach_comments(start_char, end_char) end - def bind_end(ec) - value.merge!(ec: ec) + def bind_end(end_char) + location = value[:loc] + + value[:loc] = + Location.new( + start_line: location.start_line, + start_char: location.start_char, + end_line: location.end_line, + end_char: end_char + ) end def <<(statement) - if value[:body].any? - value.merge!(statement.slice(:el, :ec)) - else - value.merge!(statement.slice(:sl, :el, :sc, :ec)) - end + value[:loc] = + if value[:body].any? + Location.range(from: value[:loc], to: statement[:loc]) + else + statement[:loc] + end value[:body] << statement self @@ -2829,18 +2656,18 @@ def <<(statement) private - def attach_comments(sc, ec) + def attach_comments(start_char, end_char) attachable = parser.comments.select do |comment| comment[:type] == :@comment && !comment[:inline] && - sc <= comment[:sc] && ec >= comment[:ec] && + start_char <= comment[:loc].start_char && end_char >= comment[:loc].end_char && !comment[:value].include?('prettier-ignore') end return if attachable.empty? parser.comments -= attachable - value[:body] = (value[:body] + attachable).sort_by! { |node| node[:sc] } + value[:body] = (value[:body] + attachable).sort_by! { |node| node[:loc].start_char } end end @@ -2852,10 +2679,7 @@ def on_stmts_new self, type: :stmts, body: [], - sl: lineno, - el: lineno, - sc: char_pos, - ec: char_pos + loc: Location.fixed(line: lineno, char: char_pos) ) end @@ -2864,7 +2688,11 @@ def on_stmts_new # It accepts as arguments the parent string node as well as the additional # piece of the string. def on_string_add(string, piece) - string.merge!(body: string[:body] << piece, el: piece[:el], ec: piece[:ec]) + { + type: :string, + body: string[:body] << piece, + loc: Location.range(from: string[:loc], to: piece[:loc]) + } end # string_concat is a parser event that represents concatenating two @@ -2877,10 +2705,7 @@ def on_string_concat(left, right) { type: :string_concat, body: [left, right], - sl: left[:sl], - sc: left[:sc], - el: right[:el], - ec: right[:ec] + loc: Location.range(from: left[:loc], to: right[:loc]) } end @@ -2893,10 +2718,7 @@ def on_string_content { type: :string, body: [], - sl: lineno, - el: lineno, - sc: char_pos, - ec: char_pos + loc: Location.fixed(line: lineno, char: char_pos) } end @@ -2906,12 +2728,13 @@ def on_string_content # interpolating. For example, if you wanted to interpolate the instance # variable @foo into a string, you could do "#@foo". def on_string_dvar(var_ref) - find_scanner_event(:@embvar).merge!( + event = find_scanner_event(:@embvar) + + { type: :string_dvar, body: [var_ref], - el: var_ref[:el], - ec: var_ref[:ec] - ) + loc: Location.range(from: event[:loc], to: var_ref[:loc]) + } end # string_embexpr is a parser event that represents interpolated content. @@ -2922,15 +2745,12 @@ def on_string_embexpr(stmts) beging = find_scanner_event(:@embexpr_beg) ending = find_scanner_event(:@embexpr_end) - stmts.bind(beging[:ec], ending[:sc]) + stmts.bind(beging[:loc].end_char, ending[:loc].start_char) { type: :string_embexpr, body: [stmts], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end @@ -2949,10 +2769,7 @@ def on_string_literal(string) type: :string_literal, body: string[:body], quote: beging[:body], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end end @@ -2962,28 +2779,23 @@ def on_string_literal(string) # by an arg_paren node) or just skip straight to the arguments (with an # args_add_block node). def on_super(contents) - find_scanner_event(:@kw, 'super').merge!( + event = find_scanner_event(:@kw, 'super') + + { type: :super, body: [contents], - el: contents[:el], - ec: contents[:ec] - ) + loc: Location.range(from: event[:loc], to: contents[:loc]) + } end # symbeg is a scanner event that represents the beginning of a symbol literal. # In most cases it will contain just ":" as in the value, but if its a dynamic # symbol being defined it will contain ":'" or ":\"". def on_symbeg(value) - start_line = lineno - start_char = char_pos - node = { type: :@symbeg, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -3002,7 +2814,11 @@ def on_symbol(ident) # from the stack to make sure it doesn't screw things up. scanner_events.pop - ident.merge(type: :symbol, body: [ident]) + { + type: :symbol, + body: [ident], + loc: ident[:loc] + } end # A symbol_literal represents a symbol in the system with no interpolation @@ -3011,13 +2827,30 @@ def on_symbol(ident) # using bare words, as in an alias node like alias foo bar). def on_symbol_literal(contents) if scanner_events[-1] == contents - contents.merge(type: :symbol_literal, body: [contents]) + { type: :symbol_literal, body: [contents], loc: contents[:loc] } else beging = find_scanner_event(:@symbeg) - contents.merge!(type: :symbol_literal, sc: beging[:sc]) + + { + type: :symbol_literal, + body: contents[:body], + loc: Location.range(from: beging[:loc], to: contents[:loc]) + } end end + # symbols_add is a parser event that represents an element inside of a + # symbol literal array that accepts interpolation, like + # %I[one #{two} three]. It accepts as arguments the parent symbols node as + # well as a word_add parser event. + def on_symbols_add(symbols, word_add) + { + type: :symbols, + body: symbols[:body] << word_add, + loc: Location.range(from: symbols[:loc], to: word_add[:loc]) + } + end + # symbols_beg is a scanner event that represents the start of a symbol literal # array with interpolation. For example, in the following snippet: # @@ -3025,16 +2858,10 @@ def on_symbol_literal(contents) # # symbols_beg would be triggered with the value of "%I". def on_symbols_beg(value) - start_line = lineno - start_char = char_pos - node = { type: :@symbols_beg, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -3046,34 +2873,18 @@ def on_symbols_beg(value) # can be followed by any number of symbols_add events, which we'll append # onto an array body. def on_symbols_new - find_scanner_event(:@symbols_beg).merge!(type: :symbols, body: []) - end + event = find_scanner_event(:@symbols_beg) - # symbols_add is a parser event that represents an element inside of a - # symbol literal array that accepts interpolation, like - # %I[one #{two} three]. It accepts as arguments the parent symbols node as - # well as a word_add parser event. - def on_symbols_add(symbols, word_add) - symbols.merge!( - body: symbols[:body] << word_add, - el: word_add[:el], - ec: word_add[:ec] - ) + { type: :symbols, body: [], loc: event[:loc] } end # tlambda is a scanner event that represents the beginning of a lambda # literal. It always has the value of "->". def on_tlambda(value) - start_line = lineno - start_char = char_pos - node = { type: :@tlambda, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -3083,16 +2894,10 @@ def on_tlambda(value) # tlambeg is a scanner event that represents the beginning of the body of a # lambda literal. It always has the value of "{". def on_tlambeg(value) - start_line = lineno - start_char = char_pos - node = { type: :@tlambeg, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -3107,12 +2912,12 @@ def on_tlambeg(value) # def on_top_const_field(const) beging = find_colon2_before(const) - const.merge( + + { type: :top_const_field, body: [const], - sl: beging[:sl], - sc: beging[:sc] - ) + loc: Location.range(from: beging[:loc], to: const[:loc]) + } end # A top_const_ref is a parser event that is a very similar to @@ -3123,28 +2928,22 @@ def on_top_const_field(const) # def on_top_const_ref(const) beging = find_colon2_before(const) - const.merge( + + { type: :top_const_ref, body: [const], - sl: beging[:sl], - sc: beging[:sc] - ) + loc: Location.range(from: beging[:loc], to: const[:loc]) + } end # tstring_beg is a scanner event that represents the beginning of a string # literal. It can represent either of the quotes for its value, or it can have # a %q/%Q with delimiter. def on_tstring_beg(value) - start_line = lineno - start_char = char_pos - node = { type: :@tstring_beg, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -3155,16 +2954,10 @@ def on_tstring_beg(value) # of a string, heredoc, xstring, or regexp. Like comments, we need to force # the encoding here so JSON doesn't break. def on_tstring_content(value) - start_line = lineno - start_char = char_pos - { type: :@tstring_content, body: value.force_encoding('UTF-8'), - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } end @@ -3172,16 +2965,10 @@ def on_tstring_content(value) # It can either contain quotes, or it can have the end delimiter of a %q/%Q # literal. def on_tstring_end(value) - start_line = lineno - start_char = char_pos - node = { type: :@tstring_end, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -3196,17 +2983,16 @@ def on_unary(oper, value) if oper == :not node = find_scanner_event(:@kw, 'not') - paren = source[node[:ec]...value[:sc]].include?('(') + paren = source[node[:loc].end_char...value[:loc].start_char].include?('(') ending = paren ? find_scanner_event(:@rparen) : value - node.merge!( + { type: :unary, oper: oper, body: [value], - el: ending[:el], - ec: ending[:ec], - paren: paren - ) + paren: paren, + loc: Location.range(from: node[:loc], to: ending[:loc]) + } else # Special case instead of using find_scanner_event here. It turns out that # if you have a range that goes from a negative number to a negative @@ -3214,18 +3000,18 @@ def on_unary(oper, value) # stack. So we need to explicitly disallow those operators. index = scanner_events.rindex do |scanner_event| - scanner_event[:type] == :@op && scanner_event[:sc] < value[:sc] && + scanner_event[:type] == :@op && scanner_event[:loc].start_char < value[:loc].start_char && !%w[.. ...].include?(scanner_event[:body]) end beging = scanner_events.delete_at(index) - beging.merge!( + + { type: :unary, oper: oper[0], body: [value], - el: value[:el], - ec: value[:ec] - ) + loc: Location.range(from: beging[:loc], to: value[:loc]) + } end end @@ -3234,14 +3020,13 @@ def on_unary(oper, value) # user is attempting to undefine. We use the keyword to get the beginning # location and the last symbol to get the ending. def on_undef(symbol_literals) - last = symbol_literals.last + event = find_scanner_event(:@kw, 'undef') - find_scanner_event(:@kw, 'undef').merge!( + { type: :undef, body: symbol_literals, - el: last[:el], - ec: last[:ec] - ) + loc: Location.range(from: event[:loc], to: symbol_literals.last[:loc]) + } end # unless is a parser event that represents the first clause in an unless @@ -3252,15 +3037,12 @@ def on_unless(predicate, stmts, consequent) beging = find_scanner_event(:@kw, 'unless') ending = consequent || find_scanner_event(:@kw, 'end') - stmts.bind(predicate[:ec], ending[:sc]) + stmts.bind(predicate[:loc].end_char, ending[:loc].start_char) { type: :unless, body: [predicate, stmts, consequent], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end @@ -3273,10 +3055,7 @@ def on_unless_mod(predicate, statement) { type: :unless_mod, body: [predicate, statement], - sl: statement[:sl], - sc: statement[:sc], - el: predicate[:el], - ec: predicate[:ec] + loc: Location.range(from: statement[:loc], to: predicate[:loc]) } end @@ -3290,19 +3069,16 @@ def on_until(predicate, stmts) # Consume the do keyword if it exists so that it doesn't get confused for # some other block do_event = find_scanner_event(:@kw, 'do', consume: false) - if do_event && do_event[:sc] > predicate[:ec] && do_event[:ec] < ending[:sc] + if do_event && do_event[:loc].start_char > predicate[:loc].end_char && do_event[:loc].end_char < ending[:loc].start_char scanner_events.delete(do_event) end - stmts.bind(predicate[:ec], ending[:sc]) + stmts.bind(predicate[:loc].end_char, ending[:loc].start_char) { type: :until, body: [predicate, stmts], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end @@ -3315,10 +3091,7 @@ def on_until_mod(predicate, statement) { type: :until_mod, body: [predicate, statement], - sl: statement[:sl], - sc: statement[:sc], - el: predicate[:el], - ec: predicate[:ec] + loc: Location.range(from: statement[:loc], to: predicate[:loc]) } end @@ -3329,23 +3102,20 @@ def on_until_mod(predicate, statement) def on_var_alias(left, right) beging = find_scanner_event(:@kw, 'alias') - paren = source[beging[:ec]...left[:sc]].include?('(') + paren = source[beging[:loc].end_char...left[:loc].start_char].include?('(') ending = paren ? find_scanner_event(:@rparen) : right { type: :var_alias, body: [left, right], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end # var_ref is a parser event that represents using either a local variable, # a nil literal, a true or false literal, or a numbered block variable. def on_var_ref(contents) - contents.merge(type: :var_ref, body: [contents]) + { type: :var_ref, body: [contents], loc: contents[:loc] } end # var_field is a parser event that represents a variable that is being @@ -3356,11 +3126,15 @@ def on_var_ref(contents) # def on_var_field(ident) if ident - ident.merge(type: :var_field, body: [ident]) + { type: :var_field, body: [ident], loc: ident[:loc] } else # You can hit this pattern if you're assigning to a splat using pattern # matching syntax in Ruby 2.7+ - { type: :var_field, body: nil } + { + type: :var_field, + body: nil, + loc: Location.fixed(line: lineno, char: char_pos) + } end end @@ -3383,14 +3157,18 @@ def on_vcall(ident) :vcall end - ident.merge(type: type, body: [ident]) + { type: type, body: [ident], loc: ident[:loc] } end # void_stmt is a special kind of parser event that represents an empty lexical # block of code. It often will have comments attached to it, so it requires # some special handling. def on_void_stmt - { type: :void_stmt, sl: lineno, el: lineno, sc: char_pos, ec: char_pos } + { + type: :void_stmt, + body: nil, + loc: Location.fixed(line: lineno, char: char_pos) + } end # when is a parser event that represents another clause in a case chain. @@ -3401,15 +3179,12 @@ def on_when(predicate, stmts, consequent) beging = find_scanner_event(:@kw, 'when') ending = consequent || find_scanner_event(:@kw, 'end') - stmts.bind(predicate[:ec], ending[:sc]) + stmts.bind(predicate[:loc].end_char, ending[:loc].start_char) { type: :when, body: [predicate, stmts, consequent], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end @@ -3423,19 +3198,16 @@ def on_while(predicate, stmts) # Consume the do keyword if it exists so that it doesn't get confused for # some other block do_event = find_scanner_event(:@kw, 'do', consume: false) - if do_event && do_event[:sc] > predicate[:ec] && do_event[:ec] < ending[:sc] + if do_event && do_event[:loc].start_char > predicate[:loc].end_char && do_event[:loc].end_char < ending[:loc].start_char scanner_events.delete(do_event) end - stmts.bind(predicate[:ec], ending[:sc]) + stmts.bind(predicate[:loc].end_char, ending[:loc].start_char) { type: :while, body: [predicate, stmts], - sl: beging[:sl], - sc: beging[:sc], - el: ending[:el], - ec: ending[:ec] + loc: Location.range(from: beging[:loc], to: ending[:loc]) } end @@ -3448,13 +3220,28 @@ def on_while_mod(predicate, statement) { type: :while_mod, body: [predicate, statement], - sl: statement[:sl], - sc: statement[:sc], - el: predicate[:el], - ec: predicate[:ec] + loc: Location.range(from: statement[:loc], to: predicate[:loc]) } end + # word_add is a parser event that represents a piece of a word within a + # special array literal that accepts interpolation. It accepts as + # arguments the parent word node as well as the additional piece of the + # word, which can be either a @tstring_content node for a plain string + # piece or a string_embexpr for an interpolated piece. + def on_word_add(word, piece) + location = + if word[:body].empty? + # Here we're making sure we get the correct bounds by using the + # location information from the first piece. + piece[:loc] + else + Location.range(from: word[:loc], to: piece[:loc]) + end + + { type: :word, body: word[:body] << piece, loc: location } + end + # word_new is a parser event that represents the beginning of a word # within a special array literal (either strings or symbols) that accepts # interpolation. For example, in the following array, there are three @@ -3467,22 +3254,7 @@ def on_while_mod(predicate, statement) # purposes, we're going to report this as a word node and build up an # array body of our parts. def on_word_new - { type: :word, body: [] } - end - - # word_add is a parser event that represents a piece of a word within a - # special array literal that accepts interpolation. It accepts as - # arguments the parent word node as well as the additional piece of the - # word, which can be either a @tstring_content node for a plain string - # piece or a string_embexpr for an interpolated piece. - def on_word_add(word, piece) - if word[:body].empty? - # Here we're making sure we get the correct bounds by using the - # location information from the first piece. - piece.merge(type: :word, body: [piece]) - else - word.merge!(body: word[:body] << piece, el: piece[:el], ec: piece[:ec]) - end + { type: :word, body: [], loc: Location.fixed(line: lineno, char: char_pos) } end # words_beg is a scanner event that represents the start of a word literal @@ -3492,16 +3264,10 @@ def on_word_add(word, piece) # # words_beg would be triggered with the value of "%W". def on_words_beg(value) - start_line = lineno - start_char = char_pos - node = { type: :@words_beg, body: value, - sl: start_line, - el: start_line, - sc: start_char, - ec: start_char + value.size + loc: Location.token(line: lineno, char: char_pos, size: value.size) } scanner_events << node @@ -3527,24 +3293,40 @@ def on_words_beg(value) # value # end + # words_add is a parser event that represents an element inside of a + # string literal array that accepts interpolation, like + # %W[one #{two} three]. It accepts as arguments the parent words node as + # well as a word_add parser event. + def on_words_add(words, word_add) + { + type: :words, + body: words[:body] << word_add, + loc: Location.range(from: words[:loc], to: word_add[:loc]) + } + end + # words_new is a parser event that represents the beginning of a string # literal array that accepts interpolation, like %W[one #{two} three]. It # can be followed by any number of words_add events, which we'll append # onto an array body. def on_words_new - find_scanner_event(:@words_beg).merge!(type: :words, body: []) + event = find_scanner_event(:@words_beg) + + { type: :words, body: [], loc: event[:loc] } end - # words_add is a parser event that represents an element inside of a - # string literal array that accepts interpolation, like - # %W[one #{two} three]. It accepts as arguments the parent words node as - # well as a word_add parser event. - def on_words_add(words, word_add) - words.merge!( - body: words[:body] << word_add, - el: word_add[:el], - ec: word_add[:ec] - ) + # xstring_add is a parser event that represents a piece of a string of + # commands that gets sent out to the terminal, like `ls`. It accepts two + # arguments, the parent xstring node as well as the piece that is being + # added to the string. Because it supports interpolation this is either a + # tstring_content scanner event representing bare string content or a + # string_embexpr representing interpolated content. + def on_xstring_add(xstring, piece) + { + type: :xstring, + body: xstring[:body] << piece, + loc: Location.range(from: xstring[:loc], to: piece[:loc]) + } end # xstring_new is a parser event that represents the beginning of a string @@ -3558,27 +3340,16 @@ def on_words_add(words, word_add) def on_xstring_new heredoc = @heredocs[-1] - if heredoc && heredoc[:beging][3] = '`' - heredoc.merge(type: :xstring, body: []) - elsif RUBY_MAJOR <= 2 && RUBY_MINOR <= 5 && RUBY_PATCH < 7 - { type: :xstring, body: [] } - else - find_scanner_event(:@backtick).merge!(type: :xstring, body: []) - end - end + location = + if heredoc && heredoc[:beging][:body].include?('`') + heredoc[:loc] + elsif RUBY_MAJOR <= 2 && RUBY_MINOR <= 5 && RUBY_PATCH < 7 + Location.fixed(line: lineno, char: char_pos) + else + find_scanner_event(:@backtick)[:loc] + end - # xstring_add is a parser event that represents a piece of a string of - # commands that gets sent out to the terminal, like `ls`. It accepts two - # arguments, the parent xstring node as well as the piece that is being - # added to the string. Because it supports interpolation this is either a - # tstring_content scanner event representing bare string content or a - # string_embexpr representing interpolated content. - def on_xstring_add(xstring, piece) - xstring.merge!( - body: xstring[:body] << piece, - el: piece[:el], - ec: piece[:ec] - ) + { type: :xstring, body: [], loc: location } end # xstring_literal is a parser event that represents a string of commands @@ -3598,11 +3369,22 @@ def on_xstring_add(xstring, piece) def on_xstring_literal(xstring) heredoc = @heredocs[-1] - if heredoc && heredoc[:beging][3] = '`' - heredoc.merge!(body: xstring[:body]) + if heredoc && heredoc[:beging][:body].include?('`') + { + type: :heredoc, + beging: heredoc[:beging], + ending: heredoc[:ending], + body: xstring[:body], + loc: heredoc[:loc] + } else ending = find_scanner_event(:@tstring_end) - xstring.merge!(type: :xstring_literal, el: ending[:el], ec: ending[:ec]) + + { + type: :xstring_literal, + body: xstring[:body], + loc: Location.range(from: xstring[:loc], to: ending[:loc]) + } end end @@ -3610,12 +3392,13 @@ def on_xstring_literal(xstring) # arguments. It accepts as an argument an args_add_block event that # contains all of the arguments being passed. def on_yield(args_add_block) - find_scanner_event(:@kw, 'yield').merge!( + event = find_scanner_event(:@kw, 'yield') + + { type: :yield, body: [args_add_block], - el: args_add_block[:el], - ec: args_add_block[:ec] - ) + loc: Location.range(from: event[:loc], to: args_add_block[:loc]) + } end # yield0 is a parser event that represents the bare yield keyword. It has @@ -3623,7 +3406,9 @@ def on_yield(args_add_block) # parser event, which is the version where you're yielding one or more # values. def on_yield0 - find_scanner_event(:@kw, 'yield').merge!(type: :yield0) + event = find_scanner_event(:@kw, 'yield') + + { type: :yield0, body: event[:body], loc: event[:loc] } end # zsuper is a parser event that represents the bare super keyword. It has @@ -3631,6 +3416,8 @@ def on_yield0 # parser event, which is the version where you're calling super with one # or more values. def on_zsuper - find_scanner_event(:@kw, 'super').merge!(type: :zsuper) + event = find_scanner_event(:@kw, 'super') + + { type: :zsuper, body: event[:body], loc: event[:loc] } end end diff --git a/src/ruby/parser.ts b/src/ruby/parser.ts index dd79c93b..9e6cd183 100644 --- a/src/ruby/parser.ts +++ b/src/ruby/parser.ts @@ -19,13 +19,13 @@ const parser: Plugin.Parser = { // responsible for returning the index of the character within the source // string that is the beginning of the given node. locStart(node) { - return node.sc; + return node.loc.sc; }, // This function is critical for comments and cursor support, and is // responsible for returning the index of the character within the source // string that is the ending of the given node. locEnd(node) { - return node.ec; + return node.loc.ec; } }; diff --git a/src/types/ruby.ts b/src/types/ruby.ts index e545494e..4adb4766 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -6,9 +6,9 @@ type Comments = { comments?: Comment[] }; type Location = { sl: number, el: number, sc: number, ec: number }; // These are utility types used to construct the various node types. -type ScannerEvent = { type: `@${T}`, body: string } & Comments & Location; -type ParserEvent0 = { type: T, body: string } & Comments & Location; -type ParserEvent> = { type: T } & Comments & Location & V; +type ScannerEvent = { type: `@${T}`, body: string, loc: Location } & Comments; +type ParserEvent0 = { type: T, body: string, loc: Location } & Comments; +type ParserEvent> = { type: T, loc: Location } & Comments & V; // This is the main expression type that goes in places where the AST will // accept just about anything. @@ -17,7 +17,7 @@ export type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgParen | Args | // This is a special scanner event that contains a comment. It can be attached // to almost any kind of node, which is why it's pulled out here separately. -type UndecoratedComment = { type: "@comment", value: string, inline: boolean } & Location; +type UndecoratedComment = { type: "@comment", value: string, inline: boolean, loc: Location }; // Prettier will attach various metadata to comment nodes, which we're adding in // to the type here. diff --git a/src/utils/printEmptyCollection.ts b/src/utils/printEmptyCollection.ts index 2c13fb78..7a90defd 100644 --- a/src/utils/printEmptyCollection.ts +++ b/src/utils/printEmptyCollection.ts @@ -5,7 +5,7 @@ const { group, hardline, indent, join, line } = prettier; function containedWithin(node: Ruby.Array | Ruby.Hash) { return function containedWithinNode(comment: Ruby.Comment) { - return comment.sc >= node.sc && comment.ec <= node.ec; + return comment.loc.sc >= node.loc.sc && comment.loc.ec <= node.loc.ec; }; } diff --git a/test/rb/metadata_test.rb b/test/rb/metadata_test.rb index 815839b1..6485f3a9 100644 --- a/test/rb/metadata_test.rb +++ b/test/rb/metadata_test.rb @@ -59,8 +59,8 @@ def test_aref_field assert_node_metadata( :aref_field, parse('foo[bar] = baz').dig(:body, 0), - sc: 0, - ec: 8 + start_char: 0, + end_char: 8 ) end @@ -68,8 +68,8 @@ def test_args assert_node_metadata( :args, parse('foo bar, baz').dig(:body, 1, :body, 0), - sc: 4, - ec: 12 + start_char: 4, + end_char: 12 ) end @@ -77,8 +77,8 @@ def test_args_add_block assert_node_metadata( :args_add_block, parse('foo bar, baz').dig(:body, 1), - sc: 4, - ec: 12 + start_char: 4, + end_char: 12 ) end @@ -86,8 +86,8 @@ def test_args_add_star assert_node_metadata( :args_add_star, parse('foo *bar').dig(:body, 1, :body, 0), - sc: 4, - ec: 8 + start_char: 4, + end_char: 8 ) end @@ -103,8 +103,10 @@ def test_arg_paren assert_node_metadata( :arg_paren, parse(content).dig(:body, 1), - sc: 3, - ec: 20 + start_char: 3, + end_char: 20, + start_line: 1, + end_line: 5 ) end @@ -116,8 +118,8 @@ def test_assoc_new assert_node_metadata( :assoc_new, parse('{ foo: bar, bar: baz }').dig(:body, 0, :body, 0), - sc: 2, - ec: 10 + start_char: 2, + end_char: 10 ) end @@ -125,8 +127,8 @@ def test_assoc_splat assert_node_metadata( :assoc_splat, parse('foo **bar').dig(:body, 1, :body, 0, :body, 0, :body, 0), - sc: 4, - ec: 9 + start_char: 4, + end_char: 9 ) end @@ -134,8 +136,8 @@ def test_assoclist_from_args assert_node_metadata( :assoclist_from_args, parse('{ foo => bar }').dig(:body, 0), - sc: 1, - ec: 13 + start_char: 1, + end_char: 13 ) end @@ -143,8 +145,8 @@ def test_bare_assoc_hash assert_node_metadata( :bare_assoc_hash, parse('foo(bar: baz)').dig(:body, 1, :body, 0, :body, 0, :body, 0), - sc: 4, - ec: 12 + start_char: 4, + end_char: 12 ) end @@ -164,8 +166,8 @@ def test_blockarg assert_node_metadata( :blockarg, parse('def foo(&bar) end').dig(:body, 1, :body, 0, :body, 6), - sc: 8, - ec: 12 + start_char: 8, + end_char: 12 ) end @@ -173,8 +175,8 @@ def test_block_var assert_node_metadata( :block_var, parse('foo { |bar| }').dig(:body, 1, :body, 0), - sc: 6, - ec: 11 + start_char: 6, + end_char: 11 ) end @@ -182,8 +184,8 @@ def test_bodystmt assert_node_metadata( :bodystmt, parse('class Foo; def foo; end; end').dig(:body, 2), - sc: 9, - ec: 25 + start_char: 9, + end_char: 25 ) end @@ -191,8 +193,8 @@ def test_brace_block assert_node_metadata( :brace_block, parse('foo { bar }').dig(:body, 1), - sc: 4, - ec: 11 + start_char: 4, + end_char: 11 ) end @@ -235,8 +237,8 @@ def test_const_ref assert_node_metadata( :const_ref, parse('class Foo; end').dig(:body, 0), - sc: 6, - ec: 9 + start_char: 6, + end_char: 9 ) end @@ -244,8 +246,8 @@ def test_const_path_field assert_node_metadata( :const_path_field, parse('Foo::Bar = baz').dig(:body, 0), - sc: 0, - ec: 8 + start_char: 0, + end_char: 8 ) end @@ -281,8 +283,8 @@ def test_do_block assert_node_metadata( :do_block, parse('foo do; bar; end').dig(:body, 1), - sc: 4, - ec: 16 + start_char: 4, + end_char: 16 ) end @@ -307,7 +309,14 @@ def test_else end SOURCE - assert_node_metadata(:else, parse(content).dig(:body, 2), sc: 13, ec: 27) + assert_node_metadata( + :else, + parse(content).dig(:body, 2), + start_char: 13, + end_char: 27, + start_line: 3, + end_line: 5 + ) end def test_elsif @@ -319,7 +328,14 @@ def test_elsif end SOURCE - assert_node_metadata(:elsif, parse(content).dig(:body, 2), sc: 13, ec: 32) + assert_node_metadata( + :elsif, + parse(content).dig(:body, 2), + start_char: 13, + end_char: 32, + start_line: 3, + end_line: 5 + ) end def test_ensure @@ -334,8 +350,10 @@ def test_ensure assert_node_metadata( :ensure, parse(content).dig(:body, 0, :body, 3), - sc: 12, - ec: 28 + start_char: 12, + end_char: 28, + start_line: 3, + end_line: 5 ) end @@ -344,22 +362,22 @@ def test_excessed_comma assert_node_metadata( :excessed_comma, parse('foo { |bar,| }').dig(:body, 1, :body, 0, :body, 0, :body, 2), - sc: 10, - ec: 11 + start_char: 10, + end_char: 11 ) end end def test_fcall - assert_node_metadata(:fcall, parse('foo(bar)').dig(:body, 0), sc: 0, ec: 3) + assert_node_metadata(:fcall, parse('foo(bar)').dig(:body, 0), start_char: 0, end_char: 3) end def test_field assert_node_metadata( :field, parse('foo.bar = baz').dig(:body, 0), - sc: 0, - ec: 7 + start_char: 0, + end_char: 7 ) end @@ -400,8 +418,8 @@ def test_kwrest_param assert_node_metadata( :kwrest_param, parse('def foo(**bar); end').dig(:body, 1, :body, 0, :body, 5), - sc: 8, - ec: 13 + start_char: 8, + end_char: 13 ) end @@ -429,8 +447,8 @@ def test_mlhs assert_node_metadata( :mlhs, parse('foo, bar, baz = 1, 2, 3').dig(:body, 0), - sc: 0, - ec: 13 + start_char: 0, + end_char: 13 ) end @@ -438,8 +456,8 @@ def test_mlhs_add_post assert_node_metadata( :mlhs_add_post, parse('foo, *bar, baz = 1, 2, 3').dig(:body, 0), - sc: 5, - ec: 14 + start_char: 5, + end_char: 14 ) end @@ -447,8 +465,8 @@ def test_mlhs_add_star assert_node_metadata( :mlhs_add_star, parse('foo, *bar = 1, 2, 3').dig(:body, 0), - sc: 5, - ec: 9 + start_char: 5, + end_char: 9 ) end @@ -456,8 +474,8 @@ def test_mlhs_paren assert_node_metadata( :mlhs_paren, parse('(foo, bar) = baz').dig(:body, 0), - sc: 0, - ec: 10 + start_char: 0, + end_char: 10 ) end @@ -473,8 +491,8 @@ def test_mrhs_add_star assert_node_metadata( :mrhs_add_star, parse('foo, bar = *baz').dig(:body, 1), - sc: 11, - ec: 15 + start_char: 11, + end_char: 15 ) end @@ -482,8 +500,8 @@ def test_mrhs_new_from_args assert_node_metadata( :mrhs_new_from_args, parse('foo, bar, baz = 1, 2, 3').dig(:body, 1), - sc: 16, - ec: 23 + start_char: 16, + end_char: 23 ) end @@ -506,8 +524,10 @@ def foo( assert_node_metadata( :params, parse(content).dig(:body, 1, :body, 0), - sc: 8, - ec: 22 + start_char: 8, + end_char: 22, + start_line: 2, + end_line: 3 ) end @@ -519,8 +539,8 @@ def test_qsymbols assert_node_metadata( :qsymbols, parse('%i[foo bar baz]').dig(:body, 0), - sc: 0, - ec: 15 + start_char: 0, + end_char: 15 ) end @@ -528,8 +548,8 @@ def test_qwords assert_node_metadata( :qwords, parse('%w[foo bar baz]').dig(:body, 0), - sc: 0, - ec: 15 + start_char: 0, + end_char: 15 ) end @@ -546,7 +566,9 @@ def test_regexp_literal :regexp_literal, parse('%r(foo)'), beging: '%r(', - ending: ')' + ending: ')', + start_char: 0, + end_char: 7 ) end @@ -554,8 +576,8 @@ def test_rescue assert_node_metadata( :rescue, parse('begin; foo; rescue => bar; baz; end').dig(:body, 0, :body, 1), - sc: 12, - ec: 35 + start_char: 12, + end_char: 35 ) end @@ -567,8 +589,8 @@ def test_rest_param assert_node_metadata( :rest_param, parse('def foo(*bar); end').dig(:body, 1, :body, 0, :body, 2), - sc: 8, - ec: 12 + start_char: 8, + end_char: 12 ) end @@ -603,8 +625,8 @@ def test_string_dvar assert_node_metadata( :string_dvar, parse('"#$foo"').dig(:body, 0), - sc: 1, - ec: 6 + start_char: 1, + end_char: 6 ) end @@ -612,8 +634,8 @@ def test_string_embexpr assert_node_metadata( :string_embexpr, parse('"foo #{bar} baz"').dig(:body, 1), - sc: 5, - ec: 11 + start_char: 5, + end_char: 11 ) end @@ -633,8 +655,8 @@ def test_symbols assert_node_metadata( :symbols, parse('%I[f#{o}o b#{a}r b#{a}z]').dig(:body, 0), - sc: 0, - ec: 24 + start_char: 0, + end_char: 24 ) end @@ -642,8 +664,8 @@ def test_top_const_field assert_node_metadata( :top_const_field, parse('::Foo = bar').dig(:body, 0), - sc: 0, - ec: 5 + start_char: 0, + end_char: 5 ) end @@ -700,8 +722,8 @@ def test_var_field assert_node_metadata( :var_field, parse('foo = 1').dig(:body, 0), - sc: 0, - ec: 3 + start_char: 0, + end_char: 3 ) end @@ -714,15 +736,15 @@ def test_vcall end def test_void_stmt - assert_node_metadata(:void_stmt, parse('; ;'), sc: 0, ec: 0) + assert_node_metadata(:void_stmt, parse('; ;'), start_char: 0, end_char: 0) end def test_when assert_node_metadata( :when, parse('case foo; when bar; baz; end').dig(:body, 1), - sc: 10, - ec: 28 + start_char: 10, + end_char: 28 ) end @@ -734,8 +756,8 @@ def test_words assert_node_metadata( :words, parse('%W[f#{o}o b#{a}r b#{a}z]').dig(:body, 0), - sc: 0, - ec: 24 + start_char: 0, + end_char: 24 ) end @@ -771,8 +793,8 @@ def foo(...) assert_node_metadata( :args_forward, parse(content).dig(:body, 1, :body, 0, :body, 2), - sc: 8, - ec: 11 + start_char: 8, + end_char: 11 ) end @@ -787,8 +809,10 @@ def test_aryptn assert_node_metadata( :aryptn, parse(content).dig(:body, 1, :body, 0), - sc: 12, - ec: 20 + start_char: 12, + end_char: 20, + start_line: 2, + end_line: 2 ) end @@ -800,7 +824,14 @@ def test_in end SOURCE - assert_node_metadata(:in, parse(content).dig(:body, 1), sc: 9, ec: 25) + assert_node_metadata( + :in, + parse(content).dig(:body, 1), + start_char: 9, + end_char: 25, + start_line: 2, + end_line: 4 + ) end end @@ -810,17 +841,24 @@ def assert_metadata(type, ruby) assert_node_metadata( type, parse(ruby), - sc: 0, - ec: ruby.chomp.size, - sl: 1, - el: [1, ruby.count("\n")].max + start_line: 1, + start_char: 0, + end_line: [1, ruby.count("\n")].max, + end_char: ruby.chomp.size ) end - def assert_node_metadata(type, node, metadata) - assert_equal type, node[:type] + def assert_node_metadata(type, node, start_char:, end_char:, start_line: 1, end_line: 1, **metadata) + assert_equal(type, node[:type]) - metadata.each { |key, value| assert_equal value, node[key] } + assert_equal(start_line, node[:loc].start_line) + assert_equal(start_char, node[:loc].start_char) + assert_equal(end_line, node[:loc].end_line) + assert_equal(end_char, node[:loc].end_char) + + metadata.each do |key, value| + assert_equal(value, node[key]) + end end def parse(ruby) From 21d6075a42671cdc445b8ae8b870080f4d5325f4 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 25 Oct 2021 14:26:15 -0400 Subject: [PATCH 352/785] Convert location information into an array --- bin/debug | 6 +++--- src/ruby/location.ts | 17 +++++++++++++++++ src/ruby/nodes/statements.ts | 7 ++++--- src/ruby/nodes/strings.ts | 3 ++- src/ruby/parser.rb | 2 +- src/ruby/parser.ts | 5 +++-- src/types/ruby.ts | 2 +- src/utils/printEmptyCollection.ts | 3 ++- 8 files changed, 33 insertions(+), 12 deletions(-) create mode 100644 src/ruby/location.ts diff --git a/bin/debug b/bin/debug index 1bc9608b..1da96c2a 100755 --- a/bin/debug +++ b/bin/debug @@ -119,10 +119,10 @@ const createTree = (parent, node) => { const button = document.createElement("button"); button.onclick = highlight; - button.setAttribute("data-char-start", node.loc.sc); - button.setAttribute("data-char-end", node.loc.ec); + button.setAttribute("data-char-start", node.loc[1]); + button.setAttribute("data-char-end", node.loc[3]); - const label = `${node.type} (${node.loc.sc}-${node.loc.ec})`; + const label = `${node.type} (${node.loc[1]}-${node.loc[3]})`; if (node.type.startsWith("@")) { button.appendChild(document.createTextNode(`${label} = ${node.body}`)); diff --git a/src/ruby/location.ts b/src/ruby/location.ts new file mode 100644 index 00000000..a5ae7b69 --- /dev/null +++ b/src/ruby/location.ts @@ -0,0 +1,17 @@ +import type { Location } from "../types/ruby"; + +export function getStartLine(location: Location) { + return location[0]; +} + +export function getStartChar(location: Location) { + return location[1]; +} + +export function getEndLine(location: Location) { + return location[2]; +} + +export function getEndChar(location: Location) { + return location[3]; +} diff --git a/src/ruby/nodes/statements.ts b/src/ruby/nodes/statements.ts index f47a9048..b686b725 100644 --- a/src/ruby/nodes/statements.ts +++ b/src/ruby/nodes/statements.ts @@ -1,6 +1,7 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; import { isEmptyStmts } from "../../utils"; +import { getEndLine, getStartLine } from "../location"; const { breakParent, @@ -139,12 +140,12 @@ export const printStmts: Plugin.Printer = (path, opts, print) => { if (lineNo === null) { parts.push(printed); } else if ( - stmt.loc.sl - lineNo > 1 || + getStartLine(stmt.loc) - lineNo > 1 || [stmt.type, stmts[index - 1].type].includes("access_ctrl") ) { parts.push(hardline, hardline, printed); } else if ( - stmt.loc.sl !== lineNo || + getStartLine(stmt.loc) !== lineNo || path.getParentNode().type !== "string_embexpr" ) { parts.push(hardline, printed); @@ -152,7 +153,7 @@ export const printStmts: Plugin.Printer = (path, opts, print) => { parts.push("; ", printed); } - lineNo = stmt.loc.el; + lineNo = getEndLine(stmt.loc); }); return parts; diff --git a/src/ruby/nodes/strings.ts b/src/ruby/nodes/strings.ts index 1b44ace2..bd7e67da 100644 --- a/src/ruby/nodes/strings.ts +++ b/src/ruby/nodes/strings.ts @@ -1,5 +1,6 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; +import { getEndLine, getStartLine } from "../location"; const { group, hardline, indent, literalline, removeLines, softline, join } = prettier; @@ -224,7 +225,7 @@ export const printStringEmbExpr: Plugin.Printer = ( // If the contents of this embedded expression were originally on the same // line in the source, then we're going to leave them in place and assume // that's the way the developer wanted this expression represented. - if (node.loc.sl === node.loc.el) { + if (getStartLine(node.loc) === getEndLine(node.loc)) { return ["#{", removeLines(parts), "}"]; } diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 4ffee5bd..93cab447 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -66,7 +66,7 @@ def initialize(start_line:, start_char:, end_line:, end_char:) end def to_json(*opts) - { sl: start_line, sc: start_char, el: end_line, ec: end_char }.to_json(*opts) + [start_line, start_char, end_line, end_char].to_json(*opts) end def self.range(from:, to:) diff --git a/src/ruby/parser.ts b/src/ruby/parser.ts index 9e6cd183..2570d540 100644 --- a/src/ruby/parser.ts +++ b/src/ruby/parser.ts @@ -1,5 +1,6 @@ import type { Plugin, Ruby } from "../types"; import parseSync from "../parser/parseSync"; +import { getEndChar, getStartChar } from "./location"; const parser: Plugin.Parser = { // This function is responsible for taking an input string of text and @@ -19,13 +20,13 @@ const parser: Plugin.Parser = { // responsible for returning the index of the character within the source // string that is the beginning of the given node. locStart(node) { - return node.loc.sc; + return getStartChar(node.loc); }, // This function is critical for comments and cursor support, and is // responsible for returning the index of the character within the source // string that is the ending of the given node. locEnd(node) { - return node.loc.ec; + return getEndChar(node.loc); } }; diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 4adb4766..c4f7d01c 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -3,7 +3,7 @@ // These are common additions to the various node types. type Comments = { comments?: Comment[] }; -type Location = { sl: number, el: number, sc: number, ec: number }; +export type Location = [number, number, number, number]; // These are utility types used to construct the various node types. type ScannerEvent = { type: `@${T}`, body: string, loc: Location } & Comments; diff --git a/src/utils/printEmptyCollection.ts b/src/utils/printEmptyCollection.ts index 7a90defd..f8897d0b 100644 --- a/src/utils/printEmptyCollection.ts +++ b/src/utils/printEmptyCollection.ts @@ -1,11 +1,12 @@ import type { Plugin, Ruby, RequiredKeys } from "../types"; import prettier from "../prettier"; +import { getEndChar, getStartChar } from "../ruby/location"; const { group, hardline, indent, join, line } = prettier; function containedWithin(node: Ruby.Array | Ruby.Hash) { return function containedWithinNode(comment: Ruby.Comment) { - return comment.loc.sc >= node.loc.sc && comment.loc.ec <= node.loc.ec; + return getStartChar(comment.loc) >= getStartChar(node.loc) && getEndChar(comment.loc) <= getEndChar(node.loc); }; } From 88504f1f0f73b44c21f058fe2d9cac37f0447a7c Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 25 Oct 2021 15:46:02 -0400 Subject: [PATCH 353/785] Location#to --- src/ruby/parser.rb | 220 ++++++++++++++++++++++----------------------- 1 file changed, 110 insertions(+), 110 deletions(-) diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 93cab447..91cf4d47 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -65,17 +65,17 @@ def initialize(start_line:, start_char:, end_line:, end_char:) @end_char = end_char end - def to_json(*opts) - [start_line, start_char, end_line, end_char].to_json(*opts) + def to(other) + Location.new( + start_line: start_line, + start_char: start_char, + end_line: other.end_line, + end_char: other.end_char + ) end - def self.range(from:, to:) - new( - start_line: from.start_line, - start_char: from.start_char, - end_line: to.end_line, - end_char: to.end_char - ) + def to_json(*opts) + [start_line, start_char, end_line, end_char].to_json(*opts) end def self.token(line:, char:, size:) @@ -319,7 +319,7 @@ def on_BEGIN(stmts) { type: :BEGIN, body: [beging, stmts], - loc: Location.range(from: keyword[:loc], to: ending[:loc]) + loc: keyword[:loc].to(ending[:loc]) } end @@ -361,7 +361,7 @@ def on_END(stmts) { type: :END, body: [beging, stmts], - loc: Location.range(from: keyword[:loc], to: ending[:loc]) + loc: keyword[:loc].to(ending[:loc]) } end @@ -396,7 +396,7 @@ def on_alias(left, right) { type: :alias, body: [left, right], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -421,7 +421,7 @@ def on_aref(collection, index) { type: :aref, body: [collection, index], - loc: Location.range(from: collection[:loc], to: ending[:loc]) + loc: collection[:loc].to(ending[:loc]) } end @@ -434,7 +434,7 @@ def on_aref_field(collection, index) { type: :aref_field, body: [collection, index], - loc: Location.range(from: collection[:loc], to: ending[:loc]) + loc: collection[:loc].to(ending[:loc]) } end @@ -475,7 +475,7 @@ def on_arg_paren(args) { type: :arg_paren, body: [args], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -495,7 +495,7 @@ def on_args_add(args, arg) { type: args[:type], body: args[:body] << arg, - loc: Location.range(from: args[:loc], to: arg[:loc]) + loc: args[:loc].to(arg[:loc]) } end end @@ -509,7 +509,7 @@ def on_args_add_block(args, block) { type: :args_add_block, body: [args, block], - loc: Location.range(from: args[:loc], to: ending[:loc]) + loc: args[:loc].to(ending[:loc]) } end @@ -523,7 +523,7 @@ def on_args_add_star(args, part) { type: :args_add_star, body: [args, part], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -562,11 +562,11 @@ def on_array(contents) { type: :array, body: [contents], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } else ending = find_scanner_event(:@tstring_end) - contents[:loc] = Location.range(from: contents[:loc], to: ending[:loc]) + contents[:loc] = contents[:loc].to(ending[:loc]) { type: :array, @@ -584,7 +584,7 @@ def on_aryptn(const, preargs, splatarg, postargs) { type: :aryptn, body: [const, preargs, splatarg, postargs], - loc: Location.range(from: pieces[0][:loc], to: pieces[-1][:loc]) + loc: pieces[0][:loc].to(pieces[-1][:loc]) } end @@ -595,7 +595,7 @@ def on_assign(left, right) { type: :assign, body: [left, right], - loc: Location.range(from: left[:loc], to: right[:loc]) + loc: left[:loc].to(right[:loc]) } end @@ -606,7 +606,7 @@ def on_assoc_new(key, value) { type: :assoc_new, body: [key, value], - loc: Location.range(from: key[:loc], to: value[:loc]) + loc: key[:loc].to(value[:loc]) } end @@ -618,7 +618,7 @@ def on_assoc_splat(contents) { type: :assoc_splat, body: [contents], - loc: Location.range(from: event[:loc], to: contents[:loc]) + loc: event[:loc].to(contents[:loc]) } end @@ -630,7 +630,7 @@ def on_assoclist_from_args(assocs) { type: :assoclist_from_args, body: assocs, - loc: Location.range(from: assocs[0][:loc], to: assocs[-1][:loc]) + loc: assocs[0][:loc].to(assocs[-1][:loc]) } end @@ -669,7 +669,7 @@ def on_bare_assoc_hash(assoc_news) { type: :bare_assoc_hash, body: assoc_news, - loc: Location.range(from: assoc_news[0][:loc], to: assoc_news[-1][:loc]) + loc: assoc_news[0][:loc].to(assoc_news[-1][:loc]) } end @@ -689,7 +689,7 @@ def on_begin(bodystmt) { type: :begin, body: [bodystmt], - loc: Location.range(from: beging[:loc], to: bodystmt[:loc]) + loc: beging[:loc].to(bodystmt[:loc]) } end @@ -705,7 +705,7 @@ def on_binary(left, oper, right) { type: :binary, body: [left, oper, right], - loc: Location.range(from: left[:loc], to: right[:loc]) + loc: left[:loc].to(right[:loc]) } end @@ -724,7 +724,7 @@ def on_block_var(params, locals) { type: :block_var, body: [params, locals], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -736,7 +736,7 @@ def on_blockarg(ident) { type: :blockarg, body: [ident], - loc: Location.range(from: event[:loc], to: ident[:loc]) + loc: event[:loc].to(ident[:loc]) } end @@ -825,7 +825,7 @@ def on_break(args_add_block) { type: :break, body: [args_add_block], - loc: Location.range(from: beging[:loc], to: args_add_block[:loc]) + loc: beging[:loc].to(args_add_block[:loc]) } end end @@ -875,14 +875,14 @@ def on_case(switch, consequent) { type: :case, body: [switch, consequent], - loc: Location.range(from: event[:loc], to: consequent[:loc]) + loc: event[:loc].to(consequent[:loc]) } else { type: :rassign, body: [switch, consequent], keyword: find_scanner_event(:@kw, 'in', consume: false), - loc: Location.range(from: switch[:loc], to: consequent[:loc]) + loc: switch[:loc].to(consequent[:loc]) } end end @@ -903,7 +903,7 @@ def on_class(const, superclass, bodystmt) { type: :class, body: [const, superclass, bodystmt], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -926,7 +926,7 @@ def on_command(ident, args) { type: :command, body: [ident, args], - loc: Location.range(from: ident[:loc], to: args[:loc]) + loc: ident[:loc].to(args[:loc]) } end @@ -940,7 +940,7 @@ def on_command_call(receiver, oper, ident, args) { type: :command_call, body: [receiver, oper, ident, args], - loc: Location.range(from: receiver[:loc], to: ending[:loc]) + loc: receiver[:loc].to(ending[:loc]) } end @@ -991,7 +991,7 @@ def on_const_path_field(left, const) { type: :const_path_field, body: [left, const], - loc: Location.range(from: left[:loc], to: const[:loc]) + loc: left[:loc].to(const[:loc]) } end @@ -1003,7 +1003,7 @@ def on_const_path_ref(left, const) { type: :const_path_ref, body: [left, const], - loc: Location.range(from: left[:loc], to: const[:loc]) + loc: left[:loc].to(const[:loc]) } end @@ -1068,7 +1068,7 @@ def on_def(ident, params, bodystmt) defsl = { type: :defsl, body: [ident, params, bodystmt], - loc: Location.range(from: beging[:loc], to: bodystmt[:loc]) + loc: beging[:loc].to(bodystmt[:loc]) } return defsl @@ -1094,7 +1094,7 @@ def on_def(ident, params, bodystmt) { type: :def, body: [ident, params, bodystmt], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -1140,7 +1140,7 @@ def on_defs(target, oper, ident, params, bodystmt) { type: :defs, body: [target, oper, ident, params, bodystmt], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -1157,7 +1157,7 @@ def on_defined(value) { type: :defined, body: [value], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -1178,7 +1178,7 @@ def on_do_block(block_var, bodystmt) type: :do_block, body: [block_var, bodystmt], beging: beging, - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -1194,7 +1194,7 @@ def on_dot2(left, right) { type: :dot2, body: [left, right], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -1210,7 +1210,7 @@ def on_dot3(left, right) { type: :dot3, body: [left, right], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -1242,7 +1242,7 @@ def on_dyna_symbol(string) type: :dyna_symbol, quote: beging[:body], body: string[:body], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } else # A dynamic symbol as a hash key @@ -1253,7 +1253,7 @@ def on_dyna_symbol(string) type: :dyna_symbol, body: string[:body], quote: ending[:body][0], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end end @@ -1280,7 +1280,7 @@ def on_else(stmts) { type: :else, body: [stmts], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -1297,7 +1297,7 @@ def on_elsif(predicate, stmts, consequent) { type: :elsif, body: [predicate, stmts, consequent], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -1411,7 +1411,7 @@ def on_ensure(stmts) { type: :ensure, body: [beging, stmts], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -1441,7 +1441,7 @@ def on_field(left, oper, right) { type: :field, body: [left, oper, right], - loc: Location.range(from: left[:loc], to: right[:loc]) + loc: left[:loc].to(right[:loc]) } end @@ -1466,7 +1466,7 @@ def on_fndptn(const, presplat, args, postsplat) { type: :fndptn, body: [const, presplat, args, postsplat], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -1490,7 +1490,7 @@ def on_for(ident, enum, stmts) { type: :for, body: [ident, enum, stmts], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -1528,7 +1528,7 @@ def on_hash(assoclist_from_args) { type: :hash, body: [assoclist_from_args], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -1584,7 +1584,7 @@ def on_hshptn(const, kw, kwrest) { type: :hshptn, body: [const, kw, kwrest], - loc: Location.range(from: pieces[0][:loc], to: pieces[-1][:loc]) + loc: pieces[0][:loc].to(pieces[-1][:loc]) } end @@ -1615,7 +1615,7 @@ def on_if(predicate, stmts, consequent) { type: :if, body: [predicate, stmts, consequent], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -1626,7 +1626,7 @@ def on_ifop(predicate, truthy, falsy) { type: :ifop, body: [predicate, truthy, falsy], - loc: Location.range(from: predicate[:loc], to: falsy[:loc]) + loc: predicate[:loc].to(falsy[:loc]) } end @@ -1639,7 +1639,7 @@ def on_if_mod(predicate, statement) { type: :if_mod, body: [predicate, statement], - loc: Location.range(from: statement[:loc], to: predicate[:loc]) + loc: statement[:loc].to(predicate[:loc]) } end @@ -1702,7 +1702,7 @@ def on_in(pattern, stmts, consequent) { type: :in, body: [pattern, stmts, consequent], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -1747,7 +1747,7 @@ def on_kw(value) # method definition that accepts all remaining keyword parameters. def on_kwrest_param(ident) location = find_scanner_event(:@op, '**')[:loc] - location = Location.range(from: location, to: ident[:loc]) if ident + location = location.to(ident[:loc]) if ident { type: :kwrest_param, body: [ident], loc: location } end @@ -1818,7 +1818,7 @@ def on_lambda(params, stmts) { type: :lambda, body: [params, stmts], - loc: Location.range(from: beging[:loc], to: closing[:loc]) + loc: beging[:loc].to(closing[:loc]) } end @@ -1894,7 +1894,7 @@ def on_massign(left, right) { type: :massign, body: [left, right], - loc: Location.range(from: left[:loc], to: right[:loc]) + loc: left[:loc].to(right[:loc]) } end @@ -1910,7 +1910,7 @@ def on_method_add_arg(fcall, arg_paren) # straight from the fcall. fcall[:loc] else - Location.range(from: fcall[:loc], to: arg_paren[:loc]) + fcall[:loc].to(arg_paren[:loc]) end { type: :method_add_arg, body: [fcall, arg_paren], loc: location } @@ -1923,7 +1923,7 @@ def on_method_add_block(method_add_arg, block) { type: :method_add_block, body: [method_add_arg, block], - loc: Location.range(from: method_add_arg[:loc], to: block[:loc]) + loc: method_add_arg[:loc].to(block[:loc]) } end @@ -1948,7 +1948,7 @@ def on_mlhs_add(mlhs, part) { type: :mlhs, body: mlhs[:body] << part, - loc: Location.range(from: mlhs[:loc], to: part[:loc]) + loc: mlhs[:loc].to(part[:loc]) } end end @@ -1962,7 +1962,7 @@ def on_mlhs_add_post(mlhs_add_star, mlhs) { type: :mlhs_add_post, body: [mlhs_add_star, mlhs], - loc: Location.range(from: mlhs_add_star[:loc], to: mlhs[:loc]) + loc: mlhs_add_star[:loc].to(mlhs[:loc]) } end @@ -1977,7 +1977,7 @@ def on_mlhs_add_star(mlhs, part) { type: :mlhs_add_star, body: [mlhs, part], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -1995,7 +1995,7 @@ def on_mlhs_paren(contents) { type: :mlhs_paren, body: [contents], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -2011,7 +2011,7 @@ def on_module(const, bodystmt) { type: :module, body: [const, bodystmt], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -2036,7 +2036,7 @@ def on_mrhs_add(mrhs, part) { type: mrhs[:type], body: mrhs[:body] << part, - loc: Location.range(from: mrhs[:loc], to: part[:loc]) + loc: mrhs[:loc].to(part[:loc]) } end end @@ -2051,7 +2051,7 @@ def on_mrhs_add_star(mrhs, part) { type: :mrhs_add_star, body: [mrhs, part], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -2076,7 +2076,7 @@ def on_next(args_add_block) { type: :next, body: [args_add_block], - loc: Location.range(from: event[:loc], to: args_add_block[:loc]) + loc: event[:loc].to(args_add_block[:loc]) } end @@ -2128,7 +2128,7 @@ def on_opassign(left, oper, right) { type: :opassign, body: [left, oper, right], - loc: Location.range(from: left[:loc], to: right[:loc]) + loc: left[:loc].to(right[:loc]) } end @@ -2155,7 +2155,7 @@ def on_params(*types) flattened = types.flatten(2).select { |type| type.is_a?(Hash) } location = if flattened.any? - Location.range(from: flattened[0][:loc], to: flattened[-1][:loc]) + flattened[0][:loc].to(flattened[-1][:loc]) else Location.fixed(line: lineno, char: char_pos) end @@ -2185,7 +2185,7 @@ def on_paren(contents) type: :paren, lparen: lparen, body: [contents], - loc: Location.range(from: lparen[:loc], to: rparen[:loc]) + loc: lparen[:loc].to(rparen[:loc]) } end @@ -2262,7 +2262,7 @@ def on_qsymbols_add(qsymbols, tstring_content) { type: :qsymbols, body: qsymbols[:body] << tstring_content, - loc: Location.range(from: qsymbols[:loc], to: tstring_content[:loc]) + loc: qsymbols[:loc].to(tstring_content[:loc]) } end @@ -2300,7 +2300,7 @@ def on_qwords_add(qwords, tstring_content) { type: :qwords, body: qwords[:body] << tstring_content, - loc: Location.range(from: qwords[:loc], to: tstring_content[:loc]) + loc: qwords[:loc].to(tstring_content[:loc]) } end @@ -2360,7 +2360,7 @@ def on_regexp_add(regexp, piece) type: :regexp, body: regexp[:body] << piece, beging: regexp[:beging], - loc: Location.range(from: regexp[:loc], to: piece[:loc]) + loc: regexp[:loc].to(piece[:loc]) } end @@ -2399,7 +2399,7 @@ def on_regexp_literal(regexp, ending) body: regexp[:body], beging: regexp[:beging], ending: ending[:body], - loc: Location.range(from: regexp[:loc], to: ending[:loc]) + loc: regexp[:loc].to(ending[:loc]) } end @@ -2491,7 +2491,7 @@ def on_rescue_mod(statement, rescued) { type: :rescue_mod, body: [statement, rescued], - loc: Location.range(from: statement[:loc], to: rescued[:loc]) + loc: statement[:loc].to(rescued[:loc]) } end @@ -2501,7 +2501,7 @@ def on_rescue_mod(statement, rescued) # is omitted, then we're just using the plain operator. def on_rest_param(ident) location = find_scanner_event(:@op, '*')[:loc] - location = Location.range(from: location, to: ident[:loc]) if ident + location = location.to(ident[:loc]) if ident { type: :rest_param, body: [ident], loc: location } end @@ -2523,7 +2523,7 @@ def on_return(args_add_block) { type: :return, body: [args_add_block], - loc: Location.range(from: event[:loc], to: args_add_block[:loc]) + loc: event[:loc].to(args_add_block[:loc]) } end @@ -2569,7 +2569,7 @@ def on_sclass(target, bodystmt) { type: :sclass, body: [target, bodystmt], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -2645,7 +2645,7 @@ def bind_end(end_char) def <<(statement) value[:loc] = if value[:body].any? - Location.range(from: value[:loc], to: statement[:loc]) + value[:loc].to(statement[:loc]) else statement[:loc] end @@ -2691,7 +2691,7 @@ def on_string_add(string, piece) { type: :string, body: string[:body] << piece, - loc: Location.range(from: string[:loc], to: piece[:loc]) + loc: string[:loc].to(piece[:loc]) } end @@ -2705,7 +2705,7 @@ def on_string_concat(left, right) { type: :string_concat, body: [left, right], - loc: Location.range(from: left[:loc], to: right[:loc]) + loc: left[:loc].to(right[:loc]) } end @@ -2733,7 +2733,7 @@ def on_string_dvar(var_ref) { type: :string_dvar, body: [var_ref], - loc: Location.range(from: event[:loc], to: var_ref[:loc]) + loc: event[:loc].to(var_ref[:loc]) } end @@ -2750,7 +2750,7 @@ def on_string_embexpr(stmts) { type: :string_embexpr, body: [stmts], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -2769,7 +2769,7 @@ def on_string_literal(string) type: :string_literal, body: string[:body], quote: beging[:body], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end end @@ -2784,7 +2784,7 @@ def on_super(contents) { type: :super, body: [contents], - loc: Location.range(from: event[:loc], to: contents[:loc]) + loc: event[:loc].to(contents[:loc]) } end @@ -2834,7 +2834,7 @@ def on_symbol_literal(contents) { type: :symbol_literal, body: contents[:body], - loc: Location.range(from: beging[:loc], to: contents[:loc]) + loc: beging[:loc].to(contents[:loc]) } end end @@ -2847,7 +2847,7 @@ def on_symbols_add(symbols, word_add) { type: :symbols, body: symbols[:body] << word_add, - loc: Location.range(from: symbols[:loc], to: word_add[:loc]) + loc: symbols[:loc].to(word_add[:loc]) } end @@ -2916,7 +2916,7 @@ def on_top_const_field(const) { type: :top_const_field, body: [const], - loc: Location.range(from: beging[:loc], to: const[:loc]) + loc: beging[:loc].to(const[:loc]) } end @@ -2932,7 +2932,7 @@ def on_top_const_ref(const) { type: :top_const_ref, body: [const], - loc: Location.range(from: beging[:loc], to: const[:loc]) + loc: beging[:loc].to(const[:loc]) } end @@ -2991,7 +2991,7 @@ def on_unary(oper, value) oper: oper, body: [value], paren: paren, - loc: Location.range(from: node[:loc], to: ending[:loc]) + loc: node[:loc].to(ending[:loc]) } else # Special case instead of using find_scanner_event here. It turns out that @@ -3010,7 +3010,7 @@ def on_unary(oper, value) type: :unary, oper: oper[0], body: [value], - loc: Location.range(from: beging[:loc], to: value[:loc]) + loc: beging[:loc].to(value[:loc]) } end end @@ -3025,7 +3025,7 @@ def on_undef(symbol_literals) { type: :undef, body: symbol_literals, - loc: Location.range(from: event[:loc], to: symbol_literals.last[:loc]) + loc: event[:loc].to(symbol_literals.last[:loc]) } end @@ -3042,7 +3042,7 @@ def on_unless(predicate, stmts, consequent) { type: :unless, body: [predicate, stmts, consequent], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -3055,7 +3055,7 @@ def on_unless_mod(predicate, statement) { type: :unless_mod, body: [predicate, statement], - loc: Location.range(from: statement[:loc], to: predicate[:loc]) + loc: statement[:loc].to(predicate[:loc]) } end @@ -3078,7 +3078,7 @@ def on_until(predicate, stmts) { type: :until, body: [predicate, stmts], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -3091,7 +3091,7 @@ def on_until_mod(predicate, statement) { type: :until_mod, body: [predicate, statement], - loc: Location.range(from: statement[:loc], to: predicate[:loc]) + loc: statement[:loc].to(predicate[:loc]) } end @@ -3108,7 +3108,7 @@ def on_var_alias(left, right) { type: :var_alias, body: [left, right], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -3184,7 +3184,7 @@ def on_when(predicate, stmts, consequent) { type: :when, body: [predicate, stmts, consequent], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -3207,7 +3207,7 @@ def on_while(predicate, stmts) { type: :while, body: [predicate, stmts], - loc: Location.range(from: beging[:loc], to: ending[:loc]) + loc: beging[:loc].to(ending[:loc]) } end @@ -3220,7 +3220,7 @@ def on_while_mod(predicate, statement) { type: :while_mod, body: [predicate, statement], - loc: Location.range(from: statement[:loc], to: predicate[:loc]) + loc: statement[:loc].to(predicate[:loc]) } end @@ -3236,7 +3236,7 @@ def on_word_add(word, piece) # location information from the first piece. piece[:loc] else - Location.range(from: word[:loc], to: piece[:loc]) + word[:loc].to(piece[:loc]) end { type: :word, body: word[:body] << piece, loc: location } @@ -3301,7 +3301,7 @@ def on_words_add(words, word_add) { type: :words, body: words[:body] << word_add, - loc: Location.range(from: words[:loc], to: word_add[:loc]) + loc: words[:loc].to(word_add[:loc]) } end @@ -3325,7 +3325,7 @@ def on_xstring_add(xstring, piece) { type: :xstring, body: xstring[:body] << piece, - loc: Location.range(from: xstring[:loc], to: piece[:loc]) + loc: xstring[:loc].to(piece[:loc]) } end @@ -3383,7 +3383,7 @@ def on_xstring_literal(xstring) { type: :xstring_literal, body: xstring[:body], - loc: Location.range(from: xstring[:loc], to: ending[:loc]) + loc: xstring[:loc].to(ending[:loc]) } end end @@ -3397,7 +3397,7 @@ def on_yield(args_add_block) { type: :yield, body: [args_add_block], - loc: Location.range(from: event[:loc], to: args_add_block[:loc]) + loc: event[:loc].to(args_add_block[:loc]) } end From aef191a18287b5ec3a891087a3c470aab69109cb Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 28 Oct 2021 12:24:41 -0400 Subject: [PATCH 354/785] Cleanup --- src/ruby/parser.rb | 304 ++++++++++-------------------- src/utils/printEmptyCollection.ts | 5 +- test/rb/metadata_test.rb | 21 ++- 3 files changed, 122 insertions(+), 208 deletions(-) diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 91cf4d47..7d0bcc51 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -88,12 +88,7 @@ def self.token(line:, char:, size:) end def self.fixed(line:, char:) - new( - start_line: line, - start_char: char, - end_line: line, - end_char: char - ) + new(start_line: line, start_char: char, end_line: line, end_char: char) end end @@ -273,7 +268,8 @@ def find_scanner_event(type, body = :any, consume: true) def find_colon2_before(const) index = scanner_events.rindex do |event| - event[:type] == :@op && event[:body] == '::' && event[:loc].start_char < const[:loc].start_char + event[:type] == :@op && event[:body] == '::' && + event[:loc].start_char < const[:loc].start_char end scanner_events[index] @@ -313,14 +309,13 @@ def on_BEGIN(stmts) beging = find_scanner_event(:@lbrace) ending = find_scanner_event(:@rbrace) - stmts.bind(find_next_statement_start(beging[:loc].end_char), ending[:loc].start_char) + stmts.bind( + find_next_statement_start(beging[:loc].end_char), + ending[:loc].start_char + ) keyword = find_scanner_event(:@kw, 'BEGIN') - { - type: :BEGIN, - body: [beging, stmts], - loc: keyword[:loc].to(ending[:loc]) - } + { type: :BEGIN, body: [beging, stmts], loc: keyword[:loc].to(ending[:loc]) } end # CHAR is a parser event that represents a single codepoint in the script @@ -355,14 +350,13 @@ def on_END(stmts) beging = find_scanner_event(:@lbrace) ending = find_scanner_event(:@rbrace) - stmts.bind(find_next_statement_start(beging[:loc].end_char), ending[:loc].start_char) + stmts.bind( + find_next_statement_start(beging[:loc].end_char), + ending[:loc].start_char + ) keyword = find_scanner_event(:@kw, 'END') - { - type: :END, - body: [beging, stmts], - loc: keyword[:loc].to(ending[:loc]) - } + { type: :END, body: [beging, stmts], loc: keyword[:loc].to(ending[:loc]) } end # __END__ is a scanner event that represents __END__ syntax, which allows @@ -393,11 +387,7 @@ def on_alias(left, right) paren = source[beging[:loc].end_char...left[:loc].start_char].include?('(') ending = paren ? find_scanner_event(:@rparen) : right - { - type: :alias, - body: [left, right], - loc: beging[:loc].to(ending[:loc]) - } + { type: :alias, body: [left, right], loc: beging[:loc].to(ending[:loc]) } end # aref is a parser event when you're pulling a value out of a collection at a @@ -470,13 +460,10 @@ def on_arg_paren(args) # If the arguments exceed the ending of the parentheses, then we know we # have a heredoc in the arguments, and we need to use the bounds of the # arguments to determine how large the arg_paren is. - ending = (args && args[:loc].end_line > rparen[:loc].end_line) ? args : rparen + ending = + (args && args[:loc].end_line > rparen[:loc].end_line) ? args : rparen - { - type: :arg_paren, - body: [args], - loc: beging[:loc].to(ending[:loc]) - } + { type: :arg_paren, body: [args], loc: beging[:loc].to(ending[:loc]) } end # args_add is a parser event that represents a single argument inside a list @@ -532,22 +519,14 @@ def on_args_add_star(args, part) def on_args_forward event = find_scanner_event(:@op, '...') - { - type: :args_forward, - body: event[:body], - loc: event[:loc] - } + { type: :args_forward, body: event[:body], loc: event[:loc] } end # args_new is a parser event that represents the beginning of a list of # arguments to any method call or an array. It can be followed by any # number of args_add events, which we'll append onto an array body. def on_args_new - { - type: :args, - body: [], - loc: Location.fixed(line: lineno, char: char_pos) - } + { type: :args, body: [], loc: Location.fixed(line: lineno, char: char_pos) } end # Array nodes can contain a myriad of subnodes because of the special @@ -559,20 +538,12 @@ def on_array(contents) beging = find_scanner_event(:@lbracket) ending = find_scanner_event(:@rbracket) - { - type: :array, - body: [contents], - loc: beging[:loc].to(ending[:loc]) - } + { type: :array, body: [contents], loc: beging[:loc].to(ending[:loc]) } else ending = find_scanner_event(:@tstring_end) contents[:loc] = contents[:loc].to(ending[:loc]) - { - type: :array, - body: [contents], - loc: contents[:loc] - } + { type: :array, body: [contents], loc: contents[:loc] } end end @@ -592,22 +563,14 @@ def on_aryptn(const, preargs, splatarg, postargs) # variable or constant. It accepts as arguments the left side of the # expression before the equals sign and the right side of the expression. def on_assign(left, right) - { - type: :assign, - body: [left, right], - loc: left[:loc].to(right[:loc]) - } + { type: :assign, body: [left, right], loc: left[:loc].to(right[:loc]) } end # assoc_new is a parser event that contains a key-value pair within a # hash. It is a child event of either an assoclist_from_args or a # bare_assoc_hash. def on_assoc_new(key, value) - { - type: :assoc_new, - body: [key, value], - loc: key[:loc].to(value[:loc]) - } + { type: :assoc_new, body: [key, value], loc: key[:loc].to(value[:loc]) } end # assoc_splat is a parser event that represents splatting a value into a @@ -686,11 +649,7 @@ def on_begin(bodystmt) bodystmt.bind(beging[:loc].end_char, end_char) - { - type: :begin, - body: [bodystmt], - loc: beging[:loc].to(bodystmt[:loc]) - } + { type: :begin, body: [bodystmt], loc: beging[:loc].to(bodystmt[:loc]) } end # binary is a parser event that represents a binary operation between two @@ -733,11 +692,7 @@ def on_block_var(params, locals) def on_blockarg(ident) event = find_scanner_event(:@op, '&') - { - type: :blockarg, - body: [ident], - loc: event[:loc].to(ident[:loc]) - } + { type: :blockarg, body: [ident], loc: event[:loc].to(ident[:loc]) } end # bodystmt can't actually determine its bounds appropriately because it @@ -757,12 +712,17 @@ def bind(start_char, end_char) # Here we're going to determine the bounds for the stmts consequent = parts[1..-1].compact.first - value[:body][0].bind(start_char, consequent ? consequent[:loc].start_char : end_char) + value[:body][0].bind( + start_char, + consequent ? consequent[:loc].start_char : end_char + ) # Next we're going to determine the rescue clause if there is one if parts[1] consequent = parts[2..-1].compact.first - value[:body][1].bind_end(consequent ? consequent[:loc].start_char : end_char) + value[:body][1].bind_end( + consequent ? consequent[:loc].start_char : end_char + ) end end end @@ -816,11 +776,7 @@ def on_break(args_add_block) # comment right after it. In that case we can just use the location # information straight from the keyword. - { - type: :break, - body: [args_add_block], - loc: beging[:loc] - } + { type: :break, body: [args_add_block], loc: beging[:loc] } else { type: :break, @@ -923,11 +879,7 @@ def on_comma(value) # no parentheses. It accepts as arguments the name of the method and the # arguments being passed to the method. def on_command(ident, args) - { - type: :command, - body: [ident, args], - loc: ident[:loc].to(args[:loc]) - } + { type: :command, body: [ident, args], loc: ident[:loc].to(args[:loc]) } end # command_call is a parser event representing a method call on an object @@ -1014,11 +966,7 @@ def on_const_path_ref(left, const) # class Foo; end # def on_const_ref(const) - { - type: :const_ref, - body: [const], - loc: const[:loc] - } + { type: :const_ref, body: [const], loc: const[:loc] } end # cvar is a scanner event that represents the use of a class variable. @@ -1089,7 +1037,10 @@ def on_def(ident, params, bodystmt) end ending = find_scanner_event(:@kw, 'end') - bodystmt.bind(find_next_statement_start(params[:loc].end_char), ending[:loc].start_char) + bodystmt.bind( + find_next_statement_start(params[:loc].end_char), + ending[:loc].start_char + ) { type: :def, @@ -1135,7 +1086,10 @@ def on_defs(target, oper, ident, params, bodystmt) beging = find_scanner_event(:@kw, 'def') ending = find_scanner_event(:@kw, 'end') - bodystmt.bind(find_next_statement_start(params[:loc].end_char), ending[:loc].start_char) + bodystmt.bind( + find_next_statement_start(params[:loc].end_char), + ending[:loc].start_char + ) { type: :defs, @@ -1154,11 +1108,7 @@ def on_defined(value) paren = source[beging[:loc].end_char...value[:loc].start_char].include?('(') ending = paren ? find_scanner_event(:@rparen) : value - { - type: :defined, - body: [value], - loc: beging[:loc].to(ending[:loc]) - } + { type: :defined, body: [value], loc: beging[:loc].to(ending[:loc]) } end # do_block is a parser event that represents passing a block to a method @@ -1191,11 +1141,7 @@ def on_dot2(left, right) beging = left || operator ending = right || operator - { - type: :dot2, - body: [left, right], - loc: beging[:loc].to(ending[:loc]) - } + { type: :dot2, body: [left, right], loc: beging[:loc].to(ending[:loc]) } end # dot3 is a parser event that represents using the ... operator between two @@ -1207,11 +1153,7 @@ def on_dot3(left, right) beging = left || operator ending = right || operator - { - type: :dot3, - body: [left, right], - loc: beging[:loc].to(ending[:loc]) - } + { type: :dot3, body: [left, right], loc: beging[:loc].to(ending[:loc]) } end # A dyna_symbol is a parser event that represents a symbol literal that @@ -1277,11 +1219,7 @@ def on_else(stmts) stmts.bind(beging[:loc].end_char, ending[:loc].start_char) - { - type: :else, - body: [stmts], - loc: beging[:loc].to(ending[:loc]) - } + { type: :else, body: [stmts], loc: beging[:loc].to(ending[:loc]) } end # elsif is a parser event that represents another clause in an if chain. @@ -1329,18 +1267,17 @@ def on_embdoc_beg(value) def on_embdoc_end(value) location = @embdoc[:loc] - @comments << - { - type: :@embdoc, - value: @embdoc[:value] << value.chomp, - loc: - Location.new( - start_line: location.start_line, - start_char: location.start_char, - end_line: lineno, - end_char: char_pos + value.length - 1 - ) - } + @comments << { + type: :@embdoc, + value: @embdoc[:value] << value.chomp, + loc: + Location.new( + start_line: location.start_line, + start_char: location.start_char, + end_line: lineno, + end_char: char_pos + value.length - 1 + ) + } @embdoc = nil end @@ -1406,13 +1343,12 @@ def on_ensure(stmts) end ending = scanner_events[index] - stmts.bind(find_next_statement_start(beging[:loc].end_char), ending[:loc].start_char) + stmts.bind( + find_next_statement_start(beging[:loc].end_char), + ending[:loc].start_char + ) - { - type: :ensure, - body: [beging, stmts], - loc: beging[:loc].to(ending[:loc]) - } + { type: :ensure, body: [beging, stmts], loc: beging[:loc].to(ending[:loc]) } end # An excessed_comma is a special kind of parser event that represents a comma @@ -1438,11 +1374,7 @@ def on_fcall(ident) # foo.x = 1 # def on_field(left, oper, right) - { - type: :field, - body: [left, oper, right], - loc: left[:loc].to(right[:loc]) - } + { type: :field, body: [left, oper, right], loc: left[:loc].to(right[:loc]) } end # float is a scanner event that represents a floating point value literal. @@ -1481,7 +1413,8 @@ def on_for(ident, enum, stmts) # Consume the do keyword if it exists so that it doesn't get confused for # some other block do_event = find_scanner_event(:@kw, 'do', consume: false) - if do_event && do_event[:loc].start_char > enum[:loc].end_char && do_event[:loc].end_char < ending[:loc].start_char + if do_event && do_event[:loc].start_char > enum[:loc].end_char && + do_event[:loc].end_char < ending[:loc].start_char scanner_events.delete(do_event) end @@ -1546,7 +1479,11 @@ def on_heredoc_beg(beging) # there are comments after the declaration of a heredoc, they get printed. node = { type: :heredoc, - beging: { type: :@heredoc_beg, body: beging, loc: location }, + beging: { + type: :@heredoc_beg, + body: beging, + loc: location + }, loc: location } @@ -1891,11 +1828,7 @@ def on_massign(left, right) comma_range = left[:loc].end_char...right[:loc].start_char left[:comma] = true if source[comma_range].strip.start_with?(',') - { - type: :massign, - body: [left, right], - loc: left[:loc].to(right[:loc]) - } + { type: :massign, body: [left, right], loc: left[:loc].to(right[:loc]) } end # method_add_arg is a parser event that represents a method call with @@ -1912,7 +1845,7 @@ def on_method_add_arg(fcall, arg_paren) else fcall[:loc].to(arg_paren[:loc]) end - + { type: :method_add_arg, body: [fcall, arg_paren], loc: location } end @@ -1931,11 +1864,7 @@ def on_method_add_block(method_add_arg, block) # side of a multiple assignment. It is followed by any number of mlhs_add # nodes that each represent another variable being assigned. def on_mlhs_new - { - type: :mlhs, - body: [], - loc: Location.fixed(line: lineno, char: char_pos) - } + { type: :mlhs, body: [], loc: Location.fixed(line: lineno, char: char_pos) } end # An mlhs_add is a parser event that represents adding another variable @@ -1945,11 +1874,7 @@ def on_mlhs_add(mlhs, part) if mlhs[:body].empty? { type: :mlhs, body: [part], loc: part[:loc] } else - { - type: :mlhs, - body: mlhs[:body] << part, - loc: mlhs[:loc].to(part[:loc]) - } + { type: :mlhs, body: mlhs[:body] << part, loc: mlhs[:loc].to(part[:loc]) } end end @@ -1992,11 +1917,7 @@ def on_mlhs_paren(contents) comma_range = beging[:loc].end_char...ending[:loc].start_char contents[:comma] = true if source[comma_range].strip.end_with?(',') - { - type: :mlhs_paren, - body: [contents], - loc: beging[:loc].to(ending[:loc]) - } + { type: :mlhs_paren, body: [contents], loc: beging[:loc].to(ending[:loc]) } end # module is a parser event that represents defining a module. It accepts @@ -2006,7 +1927,10 @@ def on_module(const, bodystmt) beging = find_scanner_event(:@kw, 'module') ending = find_scanner_event(:@kw, 'end') - bodystmt.bind(find_next_statement_start(const[:loc].end_char), ending[:loc].start_char) + bodystmt.bind( + find_next_statement_start(const[:loc].end_char), + ending[:loc].start_char + ) { type: :module, @@ -2020,11 +1944,7 @@ def on_module(const, bodystmt) # be followed by any number of mrhs_add nodes that we'll build up into an # array body. def on_mrhs_new - { - type: :mrhs, - body: [], - loc: Location.fixed(line: lineno, char: char_pos) - } + { type: :mrhs, body: [], loc: Location.fixed(line: lineno, char: char_pos) } end # An mrhs_add is a parser event that represents adding another value onto @@ -2564,7 +2484,10 @@ def on_sclass(target, bodystmt) beging = find_scanner_event(:@kw, 'class') ending = find_scanner_event(:@kw, 'end') - bodystmt.bind(find_next_statement_start(target[:loc].end_char), ending[:loc].start_char) + bodystmt.bind( + find_next_statement_start(target[:loc].end_char), + ending[:loc].start_char + ) { type: :sclass, @@ -2644,11 +2567,7 @@ def bind_end(end_char) def <<(statement) value[:loc] = - if value[:body].any? - value[:loc].to(statement[:loc]) - else - statement[:loc] - end + value[:body].any? ? value[:loc].to(statement[:loc]) : statement[:loc] value[:body] << statement self @@ -2660,14 +2579,16 @@ def attach_comments(start_char, end_char) attachable = parser.comments.select do |comment| comment[:type] == :@comment && !comment[:inline] && - start_char <= comment[:loc].start_char && end_char >= comment[:loc].end_char && + start_char <= comment[:loc].start_char && + end_char >= comment[:loc].end_char && !comment[:value].include?('prettier-ignore') end return if attachable.empty? parser.comments -= attachable - value[:body] = (value[:body] + attachable).sort_by! { |node| node[:loc].start_char } + value[:body] = + (value[:body] + attachable).sort_by! { |node| node[:loc].start_char } end end @@ -2730,11 +2651,7 @@ def on_string_content def on_string_dvar(var_ref) event = find_scanner_event(:@embvar) - { - type: :string_dvar, - body: [var_ref], - loc: event[:loc].to(var_ref[:loc]) - } + { type: :string_dvar, body: [var_ref], loc: event[:loc].to(var_ref[:loc]) } end # string_embexpr is a parser event that represents interpolated content. @@ -2747,11 +2664,7 @@ def on_string_embexpr(stmts) stmts.bind(beging[:loc].end_char, ending[:loc].start_char) - { - type: :string_embexpr, - body: [stmts], - loc: beging[:loc].to(ending[:loc]) - } + { type: :string_embexpr, body: [stmts], loc: beging[:loc].to(ending[:loc]) } end # String literals are either going to be a normal string or they're going @@ -2781,11 +2694,7 @@ def on_string_literal(string) def on_super(contents) event = find_scanner_event(:@kw, 'super') - { - type: :super, - body: [contents], - loc: event[:loc].to(contents[:loc]) - } + { type: :super, body: [contents], loc: event[:loc].to(contents[:loc]) } end # symbeg is a scanner event that represents the beginning of a symbol literal. @@ -2814,11 +2723,7 @@ def on_symbol(ident) # from the stack to make sure it doesn't screw things up. scanner_events.pop - { - type: :symbol, - body: [ident], - loc: ident[:loc] - } + { type: :symbol, body: [ident], loc: ident[:loc] } end # A symbol_literal represents a symbol in the system with no interpolation @@ -2913,11 +2818,7 @@ def on_tlambeg(value) def on_top_const_field(const) beging = find_colon2_before(const) - { - type: :top_const_field, - body: [const], - loc: beging[:loc].to(const[:loc]) - } + { type: :top_const_field, body: [const], loc: beging[:loc].to(const[:loc]) } end # A top_const_ref is a parser event that is a very similar to @@ -2929,11 +2830,7 @@ def on_top_const_field(const) def on_top_const_ref(const) beging = find_colon2_before(const) - { - type: :top_const_ref, - body: [const], - loc: beging[:loc].to(const[:loc]) - } + { type: :top_const_ref, body: [const], loc: beging[:loc].to(const[:loc]) } end # tstring_beg is a scanner event that represents the beginning of a string @@ -3000,7 +2897,8 @@ def on_unary(oper, value) # stack. So we need to explicitly disallow those operators. index = scanner_events.rindex do |scanner_event| - scanner_event[:type] == :@op && scanner_event[:loc].start_char < value[:loc].start_char && + scanner_event[:type] == :@op && + scanner_event[:loc].start_char < value[:loc].start_char && !%w[.. ...].include?(scanner_event[:body]) end @@ -3069,7 +2967,8 @@ def on_until(predicate, stmts) # Consume the do keyword if it exists so that it doesn't get confused for # some other block do_event = find_scanner_event(:@kw, 'do', consume: false) - if do_event && do_event[:loc].start_char > predicate[:loc].end_char && do_event[:loc].end_char < ending[:loc].start_char + if do_event && do_event[:loc].start_char > predicate[:loc].end_char && + do_event[:loc].end_char < ending[:loc].start_char scanner_events.delete(do_event) end @@ -3198,7 +3097,8 @@ def on_while(predicate, stmts) # Consume the do keyword if it exists so that it doesn't get confused for # some other block do_event = find_scanner_event(:@kw, 'do', consume: false) - if do_event && do_event[:loc].start_char > predicate[:loc].end_char && do_event[:loc].end_char < ending[:loc].start_char + if do_event && do_event[:loc].start_char > predicate[:loc].end_char && + do_event[:loc].end_char < ending[:loc].start_char scanner_events.delete(do_event) end diff --git a/src/utils/printEmptyCollection.ts b/src/utils/printEmptyCollection.ts index f8897d0b..c3dc4714 100644 --- a/src/utils/printEmptyCollection.ts +++ b/src/utils/printEmptyCollection.ts @@ -6,7 +6,10 @@ const { group, hardline, indent, join, line } = prettier; function containedWithin(node: Ruby.Array | Ruby.Hash) { return function containedWithinNode(comment: Ruby.Comment) { - return getStartChar(comment.loc) >= getStartChar(node.loc) && getEndChar(comment.loc) <= getEndChar(node.loc); + return ( + getStartChar(comment.loc) >= getStartChar(node.loc) && + getEndChar(comment.loc) <= getEndChar(node.loc) + ); }; } diff --git a/test/rb/metadata_test.rb b/test/rb/metadata_test.rb index 6485f3a9..543b6f2e 100644 --- a/test/rb/metadata_test.rb +++ b/test/rb/metadata_test.rb @@ -369,7 +369,12 @@ def test_excessed_comma end def test_fcall - assert_node_metadata(:fcall, parse('foo(bar)').dig(:body, 0), start_char: 0, end_char: 3) + assert_node_metadata( + :fcall, + parse('foo(bar)').dig(:body, 0), + start_char: 0, + end_char: 3 + ) end def test_field @@ -848,7 +853,15 @@ def assert_metadata(type, ruby) ) end - def assert_node_metadata(type, node, start_char:, end_char:, start_line: 1, end_line: 1, **metadata) + def assert_node_metadata( + type, + node, + start_char:, + end_char:, + start_line: 1, + end_line: 1, + **metadata + ) assert_equal(type, node[:type]) assert_equal(start_line, node[:loc].start_line) @@ -856,9 +869,7 @@ def assert_node_metadata(type, node, start_char:, end_char:, start_line: 1, end_ assert_equal(end_line, node[:loc].end_line) assert_equal(end_char, node[:loc].end_char) - metadata.each do |key, value| - assert_equal(value, node[key]) - end + metadata.each { |key, value| assert_equal(value, node[key]) } end def parse(ruby) From 8e33dbfdf965c03c841aa2c26df7efd0baa6f9ea Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 29 Oct 2021 10:37:38 -0400 Subject: [PATCH 355/785] BEGIN, END, alias, var_alias --- src/ruby/nodes/alias.ts | 15 +++++++-------- src/ruby/nodes/hooks.ts | 4 ++-- src/ruby/parser.rb | 26 ++++++++++++++++++++++---- src/ruby/printer.ts | 17 +++++++++++++---- src/types/ruby.ts | 8 ++++---- 5 files changed, 48 insertions(+), 22 deletions(-) diff --git a/src/ruby/nodes/alias.ts b/src/ruby/nodes/alias.ts index 9fd23d34..eca56429 100644 --- a/src/ruby/nodes/alias.ts +++ b/src/ruby/nodes/alias.ts @@ -3,6 +3,8 @@ import prettier from "../../prettier"; const { addTrailingComment, align, group, hardline, line } = prettier; +type AliasArg = Ruby.Backref | Ruby.DynaSymbol | Ruby.GVar | Ruby.SymbolLiteral; + // The `alias` keyword is used to make a method respond to another name as well // as the current one. For example, to get the method `foo` to also respond to // `bar`, you would: @@ -28,15 +30,12 @@ export const printAlias: Plugin.Printer = ( print ) => { const keyword = "alias "; + const node = path.getValue(); // In general, return the printed doc of the argument at the provided index. // Special handling is given for symbol literals that are not bare words, as // we convert those into bare words by just pulling out the ident node. - const printAliasArg = ( - argPath: Plugin.Path< - Ruby.Backref | Ruby.DynaSymbol | Ruby.GVar | Ruby.SymbolLiteral - > - ) => { + const printAliasArg = (argPath: Plugin.Path) => { const argNode = argPath.getValue(); if (argNode.type === "symbol_literal") { @@ -57,13 +56,13 @@ export const printAlias: Plugin.Printer = ( return group([ keyword, - path.call(printAliasArg, "body", 0), + path.call(printAliasArg, "left"), group( align(keyword.length, [ // If the left child has any comments, then we need to explicitly break // this into two lines - path.getValue().body[0].comments ? hardline : line, - path.call(printAliasArg, "body", 1) + node.left.comments ? hardline : line, + path.call(printAliasArg, "right") ]) ) ]); diff --git a/src/ruby/nodes/hooks.ts b/src/ruby/nodes/hooks.ts index 85f05caf..899a9a0d 100644 --- a/src/ruby/nodes/hooks.ts +++ b/src/ruby/nodes/hooks.ts @@ -22,8 +22,8 @@ function printHook(name: string): Plugin.Printer { return group([ name, " ", - path.call(print, "body", 0), - indent([line, path.call(print, "body", 1)]), + path.call(print, "lbrace"), + indent([line, path.call(print, "stmts")]), [line, "}"] ]); }; diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 7d0bcc51..c2707851 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -313,9 +313,15 @@ def on_BEGIN(stmts) find_next_statement_start(beging[:loc].end_char), ending[:loc].start_char ) + keyword = find_scanner_event(:@kw, 'BEGIN') - { type: :BEGIN, body: [beging, stmts], loc: keyword[:loc].to(ending[:loc]) } + { + type: :BEGIN, + lbrace: beging, + stmts: stmts, + loc: keyword[:loc].to(ending[:loc]) + } end # CHAR is a parser event that represents a single codepoint in the script @@ -354,9 +360,15 @@ def on_END(stmts) find_next_statement_start(beging[:loc].end_char), ending[:loc].start_char ) + keyword = find_scanner_event(:@kw, 'END') - { type: :END, body: [beging, stmts], loc: keyword[:loc].to(ending[:loc]) } + { + type: :END, + lbrace: beging, + stmts: stmts, + loc: keyword[:loc].to(ending[:loc]) + } end # __END__ is a scanner event that represents __END__ syntax, which allows @@ -387,7 +399,12 @@ def on_alias(left, right) paren = source[beging[:loc].end_char...left[:loc].start_char].include?('(') ending = paren ? find_scanner_event(:@rparen) : right - { type: :alias, body: [left, right], loc: beging[:loc].to(ending[:loc]) } + { + type: :alias, + left: left, + right: right, + loc: beging[:loc].to(ending[:loc]) + } end # aref is a parser event when you're pulling a value out of a collection at a @@ -3006,7 +3023,8 @@ def on_var_alias(left, right) { type: :var_alias, - body: [left, right], + left: left, + right: right, loc: beging[:loc].to(ending[:loc]) } end diff --git a/src/ruby/printer.ts b/src/ruby/printer.ts index 1635dbe8..4e0e6873 100644 --- a/src/ruby/printer.ts +++ b/src/ruby/printer.ts @@ -27,15 +27,24 @@ const printer: Plugin.PrinterConfig = { // This function tells prettier how to recurse down our AST so that it can // find where it needs to attach the comments. The types on this are a little // abysmal, but we're going to leave it as is to get this out. - getCommentChildNodes(node) { + getCommentChildNodes(node: Ruby.AnyNode) { switch (node.type) { + case "BEGIN": + case "END": + return [node.lbrace, node.stmts]; + case "alias": + case "var_alias": + return [node.left, node.right]; case "heredoc": return [node.beging]; - case "aryptn": - return [node.body[0]] + case "aryptn": { + const parts: (Ruby.AnyNode | null)[] = [node.body[0]]; + + return parts .concat(node.body[1]) .concat(node.body[2]) .concat(node.body[3]); + } case "hshptn": { const pairs = node.body[1]; const values = pairs.reduce( @@ -47,7 +56,7 @@ const printer: Plugin.PrinterConfig = { } case "params": { const [reqs, optls, rest, post, kwargs, kwargRest, block] = node.body; - let parts = reqs || []; + let parts: (Ruby.AnyNode | null)[] = reqs || []; (optls || []).forEach((optl: any) => { parts = parts.concat(optl); diff --git a/src/types/ruby.ts b/src/types/ruby.ts index c4f7d01c..bd9750c4 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -196,14 +196,14 @@ export type VCall = ParserEvent<"vcall", { body: [Identifier] }>; // These are various parser events for statements you would find in a method body. export type Aref = ParserEvent<"aref", { body: [AnyNode, Args | ArgsAddBlock | null] }>; -export type BEGIN = ParserEvent<"BEGIN", { body: [Lbrace, Stmts] }>; +export type BEGIN = ParserEvent<"BEGIN", { lbrace: Lbrace, stmts: Stmts }>; export type Binary = ParserEvent<"binary", { body: [AnyNode, string, AnyNode] }>; export type ConstPathRef = ParserEvent<"const_path_ref", { body: [AnyNode, Const] }>; export type ConstRef = ParserEvent<"const_ref", { body: [Const] }>; export type Defined = ParserEvent<"defined", { body: [AnyNode] }>; export type Dot2 = ParserEvent<"dot2", { body: [AnyNode, null] | [null, AnyNode] | [AnyNode, AnyNode] }>; export type Dot3 = ParserEvent<"dot3", { body: [AnyNode, null] | [null, AnyNode] | [AnyNode, AnyNode] }>; -export type END = ParserEvent<"END", { body: [Lbrace, Stmts] }>; +export type END = ParserEvent<"END", { lbrace: Lbrace, stmts: Stmts }>; export type Paren = ParserEvent<"paren", { body: [AnyNode], lparen: Lparen }>; export type TopConstRef = ParserEvent<"top_const_ref", { body: [Const] }>; export type Unary = ParserEvent<"unary", { body: [AnyNode], oper: string, paren: boolean | undefined }>; @@ -211,11 +211,11 @@ export type VarRef = ParserEvent<"var_ref", { body: [Const | CVar | GVar | Ident // These are various parser events for statements you would find in a class definition body. export type AccessCtrl = ParserEvent<"access_ctrl", { body: [Identifier] }>; -export type Alias = ParserEvent<"alias", { body: [DynaSymbol | SymbolLiteral, DynaSymbol | SymbolLiteral] }>; +export type Alias = ParserEvent<"alias", { left: DynaSymbol | SymbolLiteral, right: DynaSymbol | SymbolLiteral }>; export type Class = ParserEvent<"class", { body: [ConstPathRef | ConstRef | TopConstRef, null | AnyNode, Bodystmt] }>; export type Module = ParserEvent<"module", { body: [ConstPathRef | ConstRef | TopConstRef, Bodystmt] }>; export type Sclass = ParserEvent<"sclass", { body: [AnyNode, Bodystmt] }>; -export type VarAlias = ParserEvent<"var_alias", { body: [GVar, Backref | GVar] }>; +export type VarAlias = ParserEvent<"var_alias", { left: GVar, right: Backref | GVar }>; export type Undef = ParserEvent<"undef", { body: (DynaSymbol | SymbolLiteral)[] }>; // These are various parser events for statement containers, generally pretty high in the tree. From 2e3119f39ca51dd47e6fc27d549deff68a905b79 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 29 Oct 2021 10:41:53 -0400 Subject: [PATCH 356/785] aref, aref_field --- src/ruby/nodes/aref.ts | 12 ++++-------- src/ruby/parser.rb | 6 ++++-- src/ruby/printer.ts | 3 +++ src/types/ruby.ts | 4 ++-- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/ruby/nodes/aref.ts b/src/ruby/nodes/aref.ts index fdc855ca..e5429ffa 100644 --- a/src/ruby/nodes/aref.ts +++ b/src/ruby/nodes/aref.ts @@ -16,10 +16,8 @@ const { group, indent, join, line, softline } = prettier; // foo[] // export const printAref: Plugin.Printer = (path, opts, print) => { - const indexNode = path.getValue().body[1]; - - if (!indexNode) { - return [path.call(print, "body", 0), "[]"]; + if (!path.getValue().index) { + return [path.call(print, "collection"), "[]"]; } return printArefField(path, opts, print); @@ -44,12 +42,10 @@ export const printArefField: Plugin.Printer = ( opts, print ) => { - const [printedArray, printedIndex] = path.map(print, "body"); - return group([ - printedArray, + path.call(print, "collection"), "[", - indent([softline, join([",", line], printedIndex)]), + indent([softline, join([",", line], path.call(print, "index"))]), softline, "]" ]); diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index c2707851..6b4dd1b6 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -427,7 +427,8 @@ def on_aref(collection, index) { type: :aref, - body: [collection, index], + collection: collection, + index: index, loc: collection[:loc].to(ending[:loc]) } end @@ -440,7 +441,8 @@ def on_aref_field(collection, index) { type: :aref_field, - body: [collection, index], + collection: collection, + index: index, loc: collection[:loc].to(ending[:loc]) } end diff --git a/src/ruby/printer.ts b/src/ruby/printer.ts index 4e0e6873..5ef3c94e 100644 --- a/src/ruby/printer.ts +++ b/src/ruby/printer.ts @@ -35,6 +35,9 @@ const printer: Plugin.PrinterConfig = { case "alias": case "var_alias": return [node.left, node.right]; + case "aref": + case "aref_field": + return [node.collection, node.index]; case "heredoc": return [node.beging]; case "aryptn": { diff --git a/src/types/ruby.ts b/src/types/ruby.ts index bd9750c4..93c0e625 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -114,7 +114,7 @@ export type Hash = ParserEvent<"hash", { body: [null | AssoclistFromArgs] }>; // These are various parser events for assignment. type Assignable = ArefField | ConstPathField | Field | TopConstField | VarField; -export type ArefField = ParserEvent<"aref_field", { body: [AnyNode, ArgsAddBlock | null] }>; +export type ArefField = ParserEvent<"aref_field", { collection: AnyNode, index: ArgsAddBlock | null }>; export type Assign = ParserEvent<"assign", { body: [Assignable, AnyNode] }>; export type ConstPathField = ParserEvent<"const_path_field", { body: [ConstPathRef | Paren | TopConstRef | VarRef, Const] }>; export type Field = ParserEvent<"field", { body: [AnyNode, CallOperator, Const | Identifier] }>; @@ -195,7 +195,7 @@ export type MethodAddBlock = ParserEvent<"method_add_block", { body: [AnyNode, B export type VCall = ParserEvent<"vcall", { body: [Identifier] }>; // These are various parser events for statements you would find in a method body. -export type Aref = ParserEvent<"aref", { body: [AnyNode, Args | ArgsAddBlock | null] }>; +export type Aref = ParserEvent<"aref", { collection: AnyNode, index: Args | ArgsAddBlock | null }>; export type BEGIN = ParserEvent<"BEGIN", { lbrace: Lbrace, stmts: Stmts }>; export type Binary = ParserEvent<"binary", { body: [AnyNode, string, AnyNode] }>; export type ConstPathRef = ParserEvent<"const_path_ref", { body: [AnyNode, Const] }>; From ae3fabd3e6d9284e17aab71a70dbe543765e23a4 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 29 Oct 2021 11:07:51 -0400 Subject: [PATCH 357/785] assign, opassign, var_ref, var_field --- src/ruby/nodes/assign.ts | 32 +++++++++++++++-------------- src/ruby/parser.rb | 44 +++++++++++++++++++++++----------------- src/ruby/printer.ts | 8 ++++++++ src/ruby/toProc.ts | 2 +- src/types/ruby.ts | 8 ++++---- 5 files changed, 55 insertions(+), 39 deletions(-) diff --git a/src/ruby/nodes/assign.ts b/src/ruby/nodes/assign.ts index 30918557..cd2a7f9f 100644 --- a/src/ruby/nodes/assign.ts +++ b/src/ruby/nodes/assign.ts @@ -5,8 +5,10 @@ import { skipAssignIndent } from "../../utils"; const { group, indent, join, line } = prettier; export const printAssign: Plugin.Printer = (path, opts, print) => { - const [, valueNode] = path.getValue().body; - const [targetDoc, valueDoc] = path.map(print, "body"); + const valueNode = path.getValue().value; + + const targetDoc = path.call(print, "target"); + const valueDoc = path.call(print, "value"); let rightSideDoc = valueDoc; @@ -27,23 +29,23 @@ export const printOpAssign: Plugin.Printer = ( path, opts, print -) => { - return group([ - path.call(print, "body", 0), +) => ( + group([ + path.call(print, "target"), " ", - path.call(print, "body", 1), - indent([line, path.call(print, "body", 2)]) - ]); -}; + path.call(print, "operator"), + indent([line, path.call(print, "value")]) + ]) +); export const printVarField: Plugin.Printer = ( path, opts, print -) => { - return path.getValue().body ? path.call(print, "body", 0) : ""; -}; +) => ( + path.getValue().value ? path.call(print, "value") : "" +); -export const printVarRef: Plugin.Printer = (path, opts, print) => { - return path.call(print, "body", 0); -}; +export const printVarRef: Plugin.Printer = (path, opts, print) => ( + path.call(print, "value") +); diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 6b4dd1b6..f48e12be 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -581,8 +581,13 @@ def on_aryptn(const, preargs, splatarg, postargs) # assign is a parser event that represents assigning something to a # variable or constant. It accepts as arguments the left side of the # expression before the equals sign and the right side of the expression. - def on_assign(left, right) - { type: :assign, body: [left, right], loc: left[:loc].to(right[:loc]) } + def on_assign(target, value) + { + type: :assign, + target: target, + value: value, + loc: target[:loc].to(value[:loc]) + } end # assoc_new is a parser event that contains a key-value pair within a @@ -2063,11 +2068,13 @@ def on_op(value) # variable or constant using an operator like += or ||=. It accepts as # arguments the left side of the expression before the operator, the # operator itself, and the right side of the expression. - def on_opassign(left, oper, right) + def on_opassign(target, operator, value) { type: :opassign, - body: [left, oper, right], - loc: left[:loc].to(right[:loc]) + target: target, + operator: operator, + value: value, + loc: target[:loc].to(value[:loc]) } end @@ -3033,8 +3040,8 @@ def on_var_alias(left, right) # var_ref is a parser event that represents using either a local variable, # a nil literal, a true or false literal, or a numbered block variable. - def on_var_ref(contents) - { type: :var_ref, body: [contents], loc: contents[:loc] } + def on_var_ref(value) + { type: :var_ref, value: value, loc: value[:loc] } end # var_field is a parser event that represents a variable that is being @@ -3043,18 +3050,17 @@ def on_var_ref(contents) # # foo = 1 # - def on_var_field(ident) - if ident - { type: :var_field, body: [ident], loc: ident[:loc] } - else - # You can hit this pattern if you're assigning to a splat using pattern - # matching syntax in Ruby 2.7+ - { - type: :var_field, - body: nil, - loc: Location.fixed(line: lineno, char: char_pos) - } - end + def on_var_field(value) + location = + if value + value[:loc] + else + # You can hit this pattern if you're assigning to a splat using pattern + # matching syntax in Ruby 2.7+ + Location.fixed(line: lineno, char: char_pos) + end + + { type: :var_field, value: value, loc: location } end # vcall nodes are any plain named thing with Ruby that could be either a diff --git a/src/ruby/printer.ts b/src/ruby/printer.ts index 5ef3c94e..cbc0f4e8 100644 --- a/src/ruby/printer.ts +++ b/src/ruby/printer.ts @@ -38,6 +38,14 @@ const printer: Plugin.PrinterConfig = { case "aref": case "aref_field": return [node.collection, node.index]; + case "assign": + return [node.target, node.value]; + case "opassign": + return [node.target, node.operator, node.value]; + case "var_field": + case "var_ref": + return [node.value]; + case "heredoc": return [node.beging]; case "aryptn": { diff --git a/src/ruby/toProc.ts b/src/ruby/toProc.ts index ddbd189f..0c343de5 100644 --- a/src/ruby/toProc.ts +++ b/src/ruby/toProc.ts @@ -77,7 +77,7 @@ function toProc( if ( varRef.type !== "var_ref" || - varRef.body[0].body !== reqParams[0].body || + varRef.value.body !== reqParams[0].body || !isCall(call) || method === "call" || method.type !== "@ident" diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 93c0e625..a44e34bf 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -115,12 +115,12 @@ export type Hash = ParserEvent<"hash", { body: [null | AssoclistFromArgs] }>; // These are various parser events for assignment. type Assignable = ArefField | ConstPathField | Field | TopConstField | VarField; export type ArefField = ParserEvent<"aref_field", { collection: AnyNode, index: ArgsAddBlock | null }>; -export type Assign = ParserEvent<"assign", { body: [Assignable, AnyNode] }>; +export type Assign = ParserEvent<"assign", { target: Assignable, value: AnyNode }>; export type ConstPathField = ParserEvent<"const_path_field", { body: [ConstPathRef | Paren | TopConstRef | VarRef, Const] }>; export type Field = ParserEvent<"field", { body: [AnyNode, CallOperator, Const | Identifier] }>; -export type Opassign = ParserEvent<"opassign", { body: [Assignable, Op, AnyNode] }>; +export type Opassign = ParserEvent<"opassign", { target: Assignable, operator: Op, value: AnyNode }>; export type TopConstField = ParserEvent<"top_const_field", { body: [Const] }>; -export type VarField = ParserEvent<"var_field", { body: [null | Const | CVar | GVar | Identifier | IVar] }>; +export type VarField = ParserEvent<"var_field", { value: null | Const | CVar | GVar | Identifier | IVar }>; // These are various parser events that have to do with multiple assignment. export type Massign = ParserEvent<"massign", { body: [Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen, AnyNode] }>; @@ -207,7 +207,7 @@ export type END = ParserEvent<"END", { lbrace: Lbrace, stmts: Stmts }>; export type Paren = ParserEvent<"paren", { body: [AnyNode], lparen: Lparen }>; export type TopConstRef = ParserEvent<"top_const_ref", { body: [Const] }>; export type Unary = ParserEvent<"unary", { body: [AnyNode], oper: string, paren: boolean | undefined }>; -export type VarRef = ParserEvent<"var_ref", { body: [Const | CVar | GVar | Identifier | IVar | Keyword] }>; +export type VarRef = ParserEvent<"var_ref", { value: Const | CVar | GVar | Identifier | IVar | Keyword }>; // These are various parser events for statements you would find in a class definition body. export type AccessCtrl = ParserEvent<"access_ctrl", { body: [Identifier] }>; From 4ab079aedceeb9cf694f2ead7213b61dfa8d08c0 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 29 Oct 2021 11:19:16 -0400 Subject: [PATCH 358/785] assoc_new, assoc_splat, assoclist_from_args, bare_assoc_hash, hash --- src/ruby/nodes/hashes.ts | 36 ++++++++++++++++++------------------ src/ruby/nodes/strings.ts | 2 +- src/ruby/parser.rb | 25 +++++++++++++++---------- src/ruby/printer.ts | 13 +++++++++++-- src/ruby/toProc.ts | 2 +- src/types/ruby.ts | 10 +++++----- 6 files changed, 51 insertions(+), 37 deletions(-) diff --git a/src/ruby/nodes/hashes.ts b/src/ruby/nodes/hashes.ts index 20e02219..bf11591f 100644 --- a/src/ruby/nodes/hashes.ts +++ b/src/ruby/nodes/hashes.ts @@ -32,16 +32,16 @@ function isValidHashLabel(symbolLiteral: Ruby.SymbolLiteral) { } function canUseHashLabels(contentsNode: HashContents) { - return contentsNode.body.every((assocNode) => { + return contentsNode.assocs.every((assocNode) => { if (assocNode.type === "assoc_splat") { return true; } - switch (assocNode.body[0].type) { + switch (assocNode.key.type) { case "@label": return true; case "symbol_literal": - return isValidHashLabel(assocNode.body[0]); + return isValidHashLabel(assocNode.key); case "dyna_symbol": return true; default: @@ -88,20 +88,20 @@ export const printAssocNew: Plugin.Printer = ( opts, print ) => { - const [keyNode, valueNode] = path.getValue().body; + const node = path.getValue(); const { keyPrinter } = path.getParentNode() as HashContents; - const parts = [path.call((keyPath) => keyPrinter(keyPath, print), "body", 0)]; - const valueDoc = path.call(print, "body", 1); + const parts = [path.call((keyPath) => keyPrinter(keyPath, print), "key")]; + const valueDoc = path.call(print, "value"); // If we're printing a child hash then we want it to break along with its // parent hash, so we don't group the parts. - if (valueNode.type === "hash") { + if (node.value.type === "hash") { parts.push(" ", valueDoc); return parts; } - if (!skipAssignIndent(valueNode) || keyNode.comments) { + if (!skipAssignIndent(node.value) || node.key.comments) { parts.push(indent([line, valueDoc])); } else { parts.push(" ", valueDoc); @@ -114,9 +114,9 @@ export const printAssocSplat: Plugin.Printer = ( path, opts, print -) => { - return ["**", path.call(print, "body", 0)]; -}; +) => ( + ["**", path.call(print, "value")] +); export const printHashContents: Plugin.Printer = ( path, @@ -132,24 +132,24 @@ export const printHashContents: Plugin.Printer = ( ? printHashKeyLabel : printHashKeyRocket; - return join([",", line], path.map(print, "body")); + return join([",", line], path.map(print, "assocs")); }; export const printHash: Plugin.Printer = (path, opts, print) => { - const hashNode = path.getValue(); + const node = path.getValue(); // Hashes normally have a single assoclist_from_args child node. If it's // missing, then it means we're dealing with an empty hash, so we can just // exit here and print. - if (hashNode.body[0] === null) { + if (node.contents === null) { return printEmptyCollection(path, opts, "{", "}"); } - const hashDoc = [ + const doc = [ "{", indent([ line, - path.call(print, "body", 0), + path.call(print, "contents"), getTrailingComma(opts) ? ifBreak(",", "") : "" ]), line, @@ -159,8 +159,8 @@ export const printHash: Plugin.Printer = (path, opts, print) => { // If we're inside another hash, then we don't want to group our contents // because we want this hash to break along with its parent hash. if (path.getParentNode().type === "assoc_new") { - return hashDoc; + return doc; } - return group(hashDoc); + return group(doc); }; diff --git a/src/ruby/nodes/strings.ts b/src/ruby/nodes/strings.ts index bd7e67da..0a5e9299 100644 --- a/src/ruby/nodes/strings.ts +++ b/src/ruby/nodes/strings.ts @@ -187,7 +187,7 @@ export const printDynaSymbol: Plugin.Printer = ( // If we're inside of an assoc_new node as the key, then it will handle // printing the : on its own since it could change sides. const parentNode = path.getParentNode(); - if (parentNode.type !== "assoc_new" || parentNode.body[0] !== node) { + if (parentNode.type !== "assoc_new" || parentNode.key !== node) { parts.unshift(":"); } diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index f48e12be..bed76947 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -594,18 +594,23 @@ def on_assign(target, value) # hash. It is a child event of either an assoclist_from_args or a # bare_assoc_hash. def on_assoc_new(key, value) - { type: :assoc_new, body: [key, value], loc: key[:loc].to(value[:loc]) } + { + type: :assoc_new, + key: key, + value: value, + loc: key[:loc].to(value[:loc]) + } end # assoc_splat is a parser event that represents splatting a value into a # hash (either a hash literal or a bare hash in a method call). - def on_assoc_splat(contents) - event = find_scanner_event(:@op, '**') + def on_assoc_splat(value) + operator = find_scanner_event(:@op, '**') { type: :assoc_splat, - body: [contents], - loc: event[:loc].to(contents[:loc]) + value: value, + loc: operator[:loc].to(value[:loc]) } end @@ -616,7 +621,7 @@ def on_assoc_splat(contents) def on_assoclist_from_args(assocs) { type: :assoclist_from_args, - body: assocs, + assocs: assocs, loc: assocs[0][:loc].to(assocs[-1][:loc]) } end @@ -652,11 +657,11 @@ def on_backtick(value) # being passed as a method argument (and therefore has omitted braces). It # accepts as an argument an array of assoc events (either assoc_new or # assoc_splat). - def on_bare_assoc_hash(assoc_news) + def on_bare_assoc_hash(assocs) { type: :bare_assoc_hash, - body: assoc_news, - loc: assoc_news[0][:loc].to(assoc_news[-1][:loc]) + assocs: assocs, + loc: assocs[0][:loc].to(assocs[-1][:loc]) } end @@ -1484,7 +1489,7 @@ def on_hash(assoclist_from_args) { type: :hash, - body: [assoclist_from_args], + contents: assoclist_from_args, loc: beging[:loc].to(ending[:loc]) } end diff --git a/src/ruby/printer.ts b/src/ruby/printer.ts index cbc0f4e8..d2c43a22 100644 --- a/src/ruby/printer.ts +++ b/src/ruby/printer.ts @@ -40,11 +40,20 @@ const printer: Plugin.PrinterConfig = { return [node.collection, node.index]; case "assign": return [node.target, node.value]; - case "opassign": - return [node.target, node.operator, node.value]; + case "assoc_new": + return [node.key, node.value]; + case "assoc_splat": case "var_field": case "var_ref": return [node.value]; + case "assoclist_from_args": + case "bare_assoc_hash": + return node.assocs; + case "hash": + return [node.contents]; + case "opassign": + return [node.target, node.operator, node.value]; + case "heredoc": return [node.beging]; diff --git a/src/ruby/toProc.ts b/src/ruby/toProc.ts index 0c343de5..9381f9d3 100644 --- a/src/ruby/toProc.ts +++ b/src/ruby/toProc.ts @@ -98,7 +98,7 @@ function toProc( } if (assocNode && assocNode.type === "assoc_new") { - const [key] = assocNode.body; + const key = assocNode.key; if (key.type === "@label" && ["if:", "unless:"].includes(key.body)) { return null; diff --git a/src/types/ruby.ts b/src/types/ruby.ts index a44e34bf..0f57a1a5 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -106,11 +106,11 @@ export type Words = ParserEvent<"words", { body: Word[] }>; // These are various parser events that have to do with hashes. type HashContent = AssocNew | AssocSplat; -export type AssocNew = ParserEvent<"assoc_new", { body: [AnyNode, AnyNode] }>; -export type AssocSplat = ParserEvent<"assoc_splat", { body: [AnyNode] }>; -export type AssoclistFromArgs = ParserEvent<"assoclist_from_args", { body: HashContent[] }>; -export type BareAssocHash = ParserEvent<"bare_assoc_hash", { body: HashContent[] }>; -export type Hash = ParserEvent<"hash", { body: [null | AssoclistFromArgs] }>; +export type AssocNew = ParserEvent<"assoc_new", { key: AnyNode, value: AnyNode }>; +export type AssocSplat = ParserEvent<"assoc_splat", { value: AnyNode }>; +export type AssoclistFromArgs = ParserEvent<"assoclist_from_args", { assocs: HashContent[] }>; +export type BareAssocHash = ParserEvent<"bare_assoc_hash", { assocs: HashContent[] }>; +export type Hash = ParserEvent<"hash", { contents: null | AssoclistFromArgs }>; // These are various parser events for assignment. type Assignable = ArefField | ConstPathField | Field | TopConstField | VarField; From 5e8a3b2502225f7360ce9fb9a86341a24ec19280 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 29 Oct 2021 11:23:35 -0400 Subject: [PATCH 359/785] begin, program --- src/ruby/nodes/rescue.ts | 2 +- src/ruby/nodes/statements.ts | 4 +--- src/ruby/parser.rb | 4 ++-- src/ruby/printer.ts | 4 ++++ src/types/ruby.ts | 4 ++-- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/ruby/nodes/rescue.ts b/src/ruby/nodes/rescue.ts index 7f3f42a7..847af1ef 100644 --- a/src/ruby/nodes/rescue.ts +++ b/src/ruby/nodes/rescue.ts @@ -7,7 +7,7 @@ const { align, group, hardline, indent, join, line } = prettier; export const printBegin: Plugin.Printer = (path, opts, print) => { return [ "begin", - indent([hardline, path.map(print, "body")]), + indent([hardline, path.call(print, "bodystmt")]), hardline, "end" ]; diff --git a/src/ruby/nodes/statements.ts b/src/ruby/nodes/statements.ts index b686b725..fc829c1f 100644 --- a/src/ruby/nodes/statements.ts +++ b/src/ruby/nodes/statements.ts @@ -94,9 +94,7 @@ export const printProgram: Plugin.Printer = ( path, opts, print -) => { - return [join(hardline, path.map(print, "body")), hardline]; -}; +) => [path.call(print, "stmts"), hardline]; type StmtsVoidWithComments = Ruby.Stmts & { body: [{ type: "void_stmt"; comments: Ruby.Comment[] }]; diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index bed76947..60e5adf5 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -678,7 +678,7 @@ def on_begin(bodystmt) bodystmt.bind(beging[:loc].end_char, end_char) - { type: :begin, body: [bodystmt], loc: beging[:loc].to(bodystmt[:loc]) } + { type: :begin, bodystmt: bodystmt, loc: beging[:loc].to(bodystmt[:loc]) } end # binary is a parser event that represents a binary operation between two @@ -2176,7 +2176,7 @@ def on_program(stmts) stmts[:body] << @__end__ if @__end__ stmts.bind(0, source.length) - { type: :program, body: [stmts], comments: @comments, loc: location } + { type: :program, stmts: stmts, comments: @comments, loc: location } end # qsymbols_beg is a scanner event that represents the beginning of a symbol diff --git a/src/ruby/printer.ts b/src/ruby/printer.ts index d2c43a22..8410c585 100644 --- a/src/ruby/printer.ts +++ b/src/ruby/printer.ts @@ -49,10 +49,14 @@ const printer: Plugin.PrinterConfig = { case "assoclist_from_args": case "bare_assoc_hash": return node.assocs; + case "begin": + return [node.bodystmt]; case "hash": return [node.contents]; case "opassign": return [node.target, node.operator, node.value]; + case "program": + return [node.stmts]; case "heredoc": diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 0f57a1a5..65077e27 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -219,7 +219,7 @@ export type VarAlias = ParserEvent<"var_alias", { left: GVar, right: Backref | G export type Undef = ParserEvent<"undef", { body: (DynaSymbol | SymbolLiteral)[] }>; // These are various parser events for statement containers, generally pretty high in the tree. -export type Begin = ParserEvent<"begin", { body: [Bodystmt] }>; +export type Begin = ParserEvent<"begin", { bodystmt: Bodystmt }>; export type Bodystmt = ParserEvent<"bodystmt", { body: [Stmts, null | Rescue, null | Stmts, null | Ensure] }>; -export type Program = ParserEvent<"program", { body: [Stmts] }>; +export type Program = ParserEvent<"program", { stmts: Stmts }>; export type Stmts = ParserEvent<"stmts", { body: AnyNode[] }>; From 609ecffee874c5dfcc8341e738d0b1722aeac905 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 29 Oct 2021 11:46:29 -0400 Subject: [PATCH 360/785] binary, dot2, dot3 --- src/ruby/nodes/conditionals.ts | 2 +- src/ruby/nodes/operators.ts | 30 ++++----- src/ruby/nodes/return.ts | 2 +- src/ruby/parser.rb | 33 +++++++--- src/ruby/printer.ts | 102 +----------------------------- src/types/ruby.ts | 7 ++- src/utils.ts | 1 + src/utils/containsAssignment.ts | 6 +- src/utils/getChildNodes.ts | 107 ++++++++++++++++++++++++++++++++ 9 files changed, 159 insertions(+), 131 deletions(-) create mode 100644 src/utils/getChildNodes.ts diff --git a/src/ruby/nodes/conditionals.ts b/src/ruby/nodes/conditionals.ts index 9d835622..a6be2654 100644 --- a/src/ruby/nodes/conditionals.ts +++ b/src/ruby/nodes/conditionals.ts @@ -193,7 +193,7 @@ function canTernaryStmts(stmts: Ruby.Stmts) { // If the user is using one of the lower precedence "and" or "or" operators, // then we can't use a ternary expression as it would break the flow control. - if (stmt.type === "binary" && ["and", "or"].includes(stmt.body[1])) { + if (stmt.type === "binary" && ["and", "or"].includes(stmt.operator)) { return false; } diff --git a/src/ruby/nodes/operators.ts b/src/ruby/nodes/operators.ts index 65eb4da0..90e80cf6 100644 --- a/src/ruby/nodes/operators.ts +++ b/src/ruby/nodes/operators.ts @@ -5,27 +5,27 @@ import { noIndent } from "../../utils"; const { group, indent, line, softline } = prettier; export const printBinary: Plugin.Printer = (path, opts, print) => { - const [, operator, rightNode] = path.getValue().body; - const space = operator === "**" ? "" : " "; + const node = path.getValue(); + const space = node.operator === "**" ? "" : " "; - if (noIndent.includes(rightNode.type)) { + if (noIndent.includes(node.right.type)) { return group([ - group(path.call(print, "body", 0)), + group(path.call(print, "left")), space, - operator, + node.operator, space, - group(path.call(print, "body", 2)) + group(path.call(print, "right")) ]); } return group([ - group(path.call(print, "body", 0)), + group(path.call(print, "left")), space, group( indent([ - operator, + node.operator, space === "" ? softline : line, - path.call(print, "body", 2) + path.call(print, "right") ]) ) ]); @@ -34,24 +34,24 @@ export const printBinary: Plugin.Printer = (path, opts, print) => { // dot2 nodes are used with ranges (or flip-flops). They can optionally drop // their left side for beginless ranges or their right side for endless ranges. export const printDot2: Plugin.Printer = (path, opts, print) => { - const [leftNode, rightNode] = path.getValue().body; + const node = path.getValue(); return [ - leftNode ? path.call(print, "body", 0) : "", + node.left ? path.call(print, "left") : "", "..", - rightNode ? path.call(print, "body", 1) : "" + node.right ? path.call(print, "right") : "" ]; }; // dot3 nodes are used with ranges (or flip-flops). They can optionally drop // their left side for beginless ranges or their right side for endless ranges. export const printDot3: Plugin.Printer = (path, opts, print) => { - const [leftNode, rightNode] = path.getValue().body; + const node = path.getValue(); return [ - leftNode ? path.call(print, "body", 0) : "", + node.left ? path.call(print, "left") : "", "...", - rightNode ? path.call(print, "body", 1) : "" + node.right ? path.call(print, "right") : "" ]; }; diff --git a/src/ruby/nodes/return.ts b/src/ruby/nodes/return.ts index ba99eb14..5e062e4a 100644 --- a/src/ruby/nodes/return.ts +++ b/src/ruby/nodes/return.ts @@ -20,7 +20,7 @@ function canSkipParens(args: Ruby.Args | Ruby.ArgsAddStar) { const stmt = stmts.body[0]; // return (a or b) - if (stmt.type === "binary" && ["and", "or"].includes(stmt.body[1])) { + if (stmt.type === "binary" && ["and", "or"].includes(stmt.operator)) { return false; } diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 60e5adf5..4c12fbf2 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -683,16 +683,21 @@ def on_begin(bodystmt) # binary is a parser event that represents a binary operation between two # values. - def on_binary(left, oper, right) - # On most Ruby implementations, oper is a Symbol that represents that - # operation being performed. For instance in the example `1 < 2`, the `oper` - # object would be `:<`. However, on JRuby, it's an `@op` node, so here we're - # going to explicitly convert it into the same normalized form. - oper = scanner_events.delete(oper)[:body] unless oper.is_a?(Symbol) + def on_binary(left, operator, right) + # On most Ruby implementations, operator is a Symbol that represents that + # operation being performed. For instance in the example `1 < 2`, the + # `operator` object would be `:<`. However, on JRuby, it's an `@op` node, + # so here we're going to explicitly convert it into the same normalized + # form. + unless operator.is_a?(Symbol) + operator = scanner_events.delete(operator)[:body] + end { type: :binary, - body: [left, oper, right], + left: left, + operator: operator, + right: right, loc: left[:loc].to(right[:loc]) } end @@ -1170,7 +1175,12 @@ def on_dot2(left, right) beging = left || operator ending = right || operator - { type: :dot2, body: [left, right], loc: beging[:loc].to(ending[:loc]) } + { + type: :dot2, + left: left, + right: right, + loc: beging[:loc].to(ending[:loc]) + } end # dot3 is a parser event that represents using the ... operator between two @@ -1182,7 +1192,12 @@ def on_dot3(left, right) beging = left || operator ending = right || operator - { type: :dot3, body: [left, right], loc: beging[:loc].to(ending[:loc]) } + { + type: :dot3, + left: left, + right: right, + loc: beging[:loc].to(ending[:loc]) + } end # A dyna_symbol is a parser event that represents a symbol literal that diff --git a/src/ruby/printer.ts b/src/ruby/printer.ts index 8410c585..4b0e52d1 100644 --- a/src/ruby/printer.ts +++ b/src/ruby/printer.ts @@ -1,6 +1,7 @@ import type { Plugin, Ruby } from "../types"; import prettier from "../prettier"; +import { getChildNodes } from "../utils"; import embed from "./embed"; import nodes from "./nodes"; @@ -25,106 +26,9 @@ const printer: Plugin.PrinterConfig = { }, embed, // This function tells prettier how to recurse down our AST so that it can - // find where it needs to attach the comments. The types on this are a little - // abysmal, but we're going to leave it as is to get this out. + // find where it needs to attach the comments. getCommentChildNodes(node: Ruby.AnyNode) { - switch (node.type) { - case "BEGIN": - case "END": - return [node.lbrace, node.stmts]; - case "alias": - case "var_alias": - return [node.left, node.right]; - case "aref": - case "aref_field": - return [node.collection, node.index]; - case "assign": - return [node.target, node.value]; - case "assoc_new": - return [node.key, node.value]; - case "assoc_splat": - case "var_field": - case "var_ref": - return [node.value]; - case "assoclist_from_args": - case "bare_assoc_hash": - return node.assocs; - case "begin": - return [node.bodystmt]; - case "hash": - return [node.contents]; - case "opassign": - return [node.target, node.operator, node.value]; - case "program": - return [node.stmts]; - - - case "heredoc": - return [node.beging]; - case "aryptn": { - const parts: (Ruby.AnyNode | null)[] = [node.body[0]]; - - return parts - .concat(node.body[1]) - .concat(node.body[2]) - .concat(node.body[3]); - } - case "hshptn": { - const pairs = node.body[1]; - const values = pairs.reduce( - (left: any, right: any) => left.concat(right), - [] - ); - - return [node.body[0]].concat(values).concat(node.body[2]); - } - case "params": { - const [reqs, optls, rest, post, kwargs, kwargRest, block] = node.body; - let parts: (Ruby.AnyNode | null)[] = reqs || []; - - (optls || []).forEach((optl: any) => { - parts = parts.concat(optl); - }); - - if (rest) { - parts.push(rest); - } - - parts = parts.concat(post || []); - - (kwargs || []).forEach((kwarg: any) => { - if (kwarg[1]) { - parts = parts.concat(kwarg); - } else { - parts.push(kwarg[0]); - } - }); - - if (kwargRest && kwargRest !== "nil") { - parts.push(kwargRest); - } - - if (block) { - parts.push(block); - } - - return parts; - } - case "brace_block": - return [node.body[0], node.body[1], node.beging]; - case "do_block": - return [node.body[0], node.body[1], node.beging]; - case "paren": - return [node.lparen, node.body[0]]; - default: { - if (Array.isArray(node.body)) { - return node.body.filter( - (child: any) => child && typeof child === "object" - ); - } - return []; - } - } + return getChildNodes(node); }, // This is an escape-hatch to ignore nodes in the tree. If you have a comment // that includes this pattern, then the entire node will be ignored and just diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 65077e27..cac650d9 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -195,14 +195,15 @@ export type MethodAddBlock = ParserEvent<"method_add_block", { body: [AnyNode, B export type VCall = ParserEvent<"vcall", { body: [Identifier] }>; // These are various parser events for statements you would find in a method body. +type Dot = { left: AnyNode, right: AnyNode } | { left: null, right: AnyNode } | { left: AnyNode, right: null }; export type Aref = ParserEvent<"aref", { collection: AnyNode, index: Args | ArgsAddBlock | null }>; export type BEGIN = ParserEvent<"BEGIN", { lbrace: Lbrace, stmts: Stmts }>; -export type Binary = ParserEvent<"binary", { body: [AnyNode, string, AnyNode] }>; +export type Binary = ParserEvent<"binary", { left: AnyNode, operator: string, right: AnyNode }>; export type ConstPathRef = ParserEvent<"const_path_ref", { body: [AnyNode, Const] }>; export type ConstRef = ParserEvent<"const_ref", { body: [Const] }>; export type Defined = ParserEvent<"defined", { body: [AnyNode] }>; -export type Dot2 = ParserEvent<"dot2", { body: [AnyNode, null] | [null, AnyNode] | [AnyNode, AnyNode] }>; -export type Dot3 = ParserEvent<"dot3", { body: [AnyNode, null] | [null, AnyNode] | [AnyNode, AnyNode] }>; +export type Dot2 = ParserEvent<"dot2", Dot>; +export type Dot3 = ParserEvent<"dot3", Dot>; export type END = ParserEvent<"END", { lbrace: Lbrace, stmts: Stmts }>; export type Paren = ParserEvent<"paren", { body: [AnyNode], lparen: Lparen }>; export type TopConstRef = ParserEvent<"top_const_ref", { body: [Const] }>; diff --git a/src/utils.ts b/src/utils.ts index 55fec0f2..1bac33bc 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -2,6 +2,7 @@ export { default as containsAssignment } from "./utils/containsAssignment"; export { default as getTrailingComma } from "./utils/getTrailingComma"; export { default as isEmptyBodyStmt } from "./utils/isEmptyBodyStmt"; export { default as isEmptyStmts } from "./utils/isEmptyStmts"; +export { default as getChildNodes } from "./utils/getChildNodes"; export { default as hasAncestor } from "./utils/hasAncestor"; export { default as inlineEnsureParens } from "./utils/inlineEnsureParens"; export { default as literal } from "./utils/literal"; diff --git a/src/utils/containsAssignment.ts b/src/utils/containsAssignment.ts index ee760501..ccc7e350 100644 --- a/src/utils/containsAssignment.ts +++ b/src/utils/containsAssignment.ts @@ -1,8 +1,9 @@ import type { Ruby } from "../types"; +import getChildNodes from "./getChildNodes"; // If the node is a type of assignment or if the node is a paren and nested // inside that paren is a node that is a type of assignment. -function containsAssignment(node: Ruby.AnyNode | Ruby.Stmts) { +function containsAssignment(node: null | Ruby.AnyNode | Ruby.Stmts) { if (!node) { return false; } @@ -11,8 +12,7 @@ function containsAssignment(node: Ruby.AnyNode | Ruby.Stmts) { return true; } - const anyNode = node as any; - return Array.isArray(anyNode.body) && anyNode.body.some(containsAssignment); + return getChildNodes(node).some(containsAssignment); } export default containsAssignment; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts new file mode 100644 index 00000000..2a4ba04f --- /dev/null +++ b/src/utils/getChildNodes.ts @@ -0,0 +1,107 @@ +import type { Ruby } from "../types"; + +function getChildNodes(node: Ruby.AnyNode) { + switch (node.type) { + case "BEGIN": + case "END": + return [node.lbrace, node.stmts]; + case "alias": + case "var_alias": + return [node.left, node.right]; + case "aref": + case "aref_field": + return [node.collection, node.index]; + case "assign": + return [node.target, node.value]; + case "assoc_new": + return [node.key, node.value]; + case "assoc_splat": + case "var_field": + case "var_ref": + return [node.value]; + case "assoclist_from_args": + case "bare_assoc_hash": + return node.assocs; + case "begin": + return [node.bodystmt]; + case "binary": + case "dot2": + case "dot3": + return [node.left, node.right]; + case "hash": + return [node.contents]; + case "opassign": + return [node.target, node.operator, node.value]; + case "program": + return [node.stmts]; + + + case "heredoc": + return [node.beging]; + case "aryptn": { + const parts: (Ruby.AnyNode | null)[] = [node.body[0]]; + + return parts + .concat(node.body[1]) + .concat(node.body[2]) + .concat(node.body[3]); + } + case "hshptn": { + const pairs = node.body[1]; + const values = pairs.reduce( + (left: any, right: any) => left.concat(right), + [] + ); + + return [node.body[0]].concat(values).concat(node.body[2]); + } + case "params": { + const [reqs, optls, rest, post, kwargs, kwargRest, block] = node.body; + let parts: (Ruby.AnyNode | null)[] = reqs || []; + + (optls || []).forEach((optl: any) => { + parts = parts.concat(optl); + }); + + if (rest) { + parts.push(rest); + } + + parts = parts.concat(post || []); + + (kwargs || []).forEach((kwarg: any) => { + if (kwarg[1]) { + parts = parts.concat(kwarg); + } else { + parts.push(kwarg[0]); + } + }); + + if (kwargRest && kwargRest !== "nil") { + parts.push(kwargRest); + } + + if (block) { + parts.push(block); + } + + return parts; + } + case "brace_block": + return [node.body[0], node.body[1], node.beging]; + case "do_block": + return [node.body[0], node.body[1], node.beging]; + case "paren": + return [node.lparen, node.body[0]]; + default: { + if (Array.isArray(node.body)) { + return node.body.filter( + (child: any) => child && typeof child === "object" + ); + } + return []; + } + } +} + +export default getChildNodes; From c2850a458d8563793def7ad50d2902dff7724aa8 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 29 Oct 2021 11:54:38 -0400 Subject: [PATCH 361/785] block_var, blockarg --- src/ruby/nodes/args.ts | 2 +- src/ruby/nodes/blocks.ts | 6 +++--- src/ruby/parser.rb | 9 +++++---- src/ruby/toProc.ts | 2 +- src/types/ruby.ts | 4 ++-- src/utils/getChildNodes.ts | 4 ++++ 6 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/ruby/nodes/args.ts b/src/ruby/nodes/args.ts index 49a70758..dc9022d8 100644 --- a/src/ruby/nodes/args.ts +++ b/src/ruby/nodes/args.ts @@ -201,5 +201,5 @@ export const printBlockArg: Plugin.Printer = ( opts, print ) => { - return ["&", path.call(print, "body", 0)]; + return ["&", path.call(print, "name")]; }; diff --git a/src/ruby/nodes/blocks.ts b/src/ruby/nodes/blocks.ts index 9a3f315c..2f7cfd7b 100644 --- a/src/ruby/nodes/blocks.ts +++ b/src/ruby/nodes/blocks.ts @@ -10,11 +10,11 @@ export const printBlockVar: Plugin.Printer = ( opts, print ) => { - const parts = ["|", removeLines(path.call(print, "body", 0))]; + const parts = ["|", removeLines(path.call(print, "params"))]; // The second part of this node is a list of optional block-local variables - if (path.getValue().body[1]) { - parts.push("; ", join(", ", path.map(print, "body", 1))); + if (path.getValue().locals.length > 0) { + parts.push("; ", join(", ", path.map(print, "locals"))); } parts.push("| "); diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 4c12fbf2..23dcb773 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -716,17 +716,18 @@ def on_block_var(params, locals) { type: :block_var, - body: [params, locals], + params: params, + locals: locals || [], loc: beging[:loc].to(ending[:loc]) } end # blockarg is a parser event that represents defining a block variable on # a method definition. - def on_blockarg(ident) - event = find_scanner_event(:@op, '&') + def on_blockarg(name) + operator = find_scanner_event(:@op, '&') - { type: :blockarg, body: [ident], loc: event[:loc].to(ident[:loc]) } + { type: :blockarg, name: name, loc: operator[:loc].to(name[:loc]) } end # bodystmt can't actually determine its bounds appropriately because it diff --git a/src/ruby/toProc.ts b/src/ruby/toProc.ts index 9381f9d3..16ee9c95 100644 --- a/src/ruby/toProc.ts +++ b/src/ruby/toProc.ts @@ -28,7 +28,7 @@ function toProc( const [variables, blockContents] = node.body; // Ensure that there are variables being passed to this block. - const params = variables && variables.body[0]; + const params = variables && variables.params; if (!params) { return null; } diff --git a/src/types/ruby.ts b/src/types/ruby.ts index cac650d9..1ce1a80c 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -168,7 +168,7 @@ export type Rassign = ParserEvent<"rassign", { body: [AnyNode, AnyNode], keyword // These are various parser events for method declarations. type ParenAroundParams = Omit & { body: [Params] }; -export type Blockarg = ParserEvent<"blockarg", { body: [Identifier] }>; +export type Blockarg = ParserEvent<"blockarg", { name: Identifier }>; export type Def = ParserEvent<"def", { body: [Backtick | Const | Identifier | Keyword | Op, Params | Paren, Bodystmt] }>; export type Defs = ParserEvent<"defs", { body: [AnyNode, Op | Period, Const | Op | Identifier | Keyword, Params | Paren, Bodystmt] }>; export type Defsl = ParserEvent<"defsl", { body: [Identifier, null | ParenAroundParams, AnyNode] }>; @@ -183,7 +183,7 @@ export type ArgParen = ParserEvent<"arg_paren", { body: [Args | ArgsAddBlock | A export type Args = ParserEvent<"args", { body: AnyNode[] }>; export type ArgsAddBlock = ParserEvent<"args_add_block", { body: [Args | ArgsAddStar, false | AnyNode] }>; export type ArgsAddStar = ParserEvent<"args_add_star", { body: [Args | ArgsAddStar, ...AnyNode[]] }>; -export type BlockVar = ParserEvent<"block_var", { body: [Params, false | Identifier[]] }>; +export type BlockVar = ParserEvent<"block_var", { params: Params, locals: Identifier[] }>; export type BraceBlock = ParserEvent<"brace_block", { body: [null | BlockVar, Stmts], beging: Lbrace }>; export type Call = ParserEvent<"call", { body: [AnyNode, CallOperator, Backtick | Op | Identifier | Const | "call"] }>; export type Command = ParserEvent<"command", { body: [Const | Identifier, Args | ArgsAddBlock] }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 2a4ba04f..70429e30 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -28,6 +28,10 @@ function getChildNodes(node: Ruby.AnyNode) { case "dot2": case "dot3": return [node.left, node.right]; + case "block_var": + return [node.params, ...node.locals]; + case "blockarg": + return [node.name]; case "hash": return [node.contents]; case "opassign": From 2f940120f5523ab73318eca6769f67bd393e68e1 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 29 Oct 2021 12:16:10 -0400 Subject: [PATCH 362/785] brace_block and do_block --- src/ruby/nodes/blocks.ts | 40 ++++++++++++++++---------------------- src/ruby/parser.rb | 10 ++++++---- src/ruby/toProc.ts | 24 +++++++++-------------- src/types/ruby.ts | 6 +++--- src/utils/getChildNodes.ts | 10 +++++----- 5 files changed, 40 insertions(+), 50 deletions(-) diff --git a/src/ruby/nodes/blocks.ts b/src/ruby/nodes/blocks.ts index 2f7cfd7b..e5ce0849 100644 --- a/src/ruby/nodes/blocks.ts +++ b/src/ruby/nodes/blocks.ts @@ -27,7 +27,7 @@ export const printBlockVar: Plugin.Printer = ( // braces or not. Ideally we wouldn't do this, we would instead do this // reflection in the child printer, but this keeps the logic to just this file // and contains it, so keeping it here for now. -function printBlockBeging( +function printBlockBegin( path: Plugin.Path, print: Plugin.Print, useBraces: boolean @@ -48,17 +48,15 @@ type Block = Ruby.BraceBlock | Ruby.DoBlock; function printBlock(braces: boolean): Plugin.Printer { return function printBlockWithBraces(path, opts, print) { - const [variables, statements] = path.getValue().body; - const stmts = - statements.type === "stmts" ? statements.body : statements.body[0].body; + const node = path.getValue(); + const stmts: Ruby.AnyNode[] = node.type === "brace_block" ? node.stmts.body : node.bodystmt.body[0].body; let doBlockBody: Plugin.Doc = ""; - if ( - stmts.length !== 1 || - stmts[0].type !== "void_stmt" || - stmts[0].comments - ) { - doBlockBody = indent([softline, path.call(print, "body", 1)]); + if (stmts.length !== 1 || stmts[0].type !== "void_stmt" || stmts[0].comments) { + doBlockBody = indent([ + softline, + path.call(print, node.type === "brace_block" ? "stmts" : "bodystmt") + ]); } // If this block is nested underneath a command or command_call node, then @@ -71,21 +69,17 @@ function printBlock(braces: boolean): Plugin.Printer { const doBlock = [ " ", path.call( - (begingPath) => printBlockBeging(begingPath, print, useBraces), - "beging" + (beginPath) => printBlockBegin(beginPath, print, useBraces), + node.type === "brace_block" ? "lbrace" : "keyword" ), - variables ? [" ", path.call(print, "body", 0)] : "", + node.block_var ? [" ", path.call(print, "block_var")] : "", doBlockBody, [softline, useBraces ? "}" : "end"] ]; // We can hit this next pattern if within the block the only statement is a // comment. - if ( - stmts.length === 1 && - stmts[0].type === "void_stmt" && - stmts[0].comments - ) { + if (stmts.length === 1 && stmts[0].type === "void_stmt" && stmts[0].comments) { return [breakParent, doBlock]; } @@ -101,12 +95,12 @@ function printBlock(braces: boolean): Plugin.Printer { const braceBlock = [ " ", path.call( - (begingPath) => printBlockBeging(begingPath, print, true), - "beging" + (beginPath) => printBlockBegin(beginPath, print, true), + node.type === "brace_block" ? "lbrace" : "keyword" ), - hasBody || variables ? " " : "", - variables ? path.call(print, "body", 0) : "", - path.call(print, "body", 1), + hasBody || node.block_var ? " " : "", + node.block_var ? path.call(print, "block_var") : "", + path.call(print, node.type === "brace_block" ? "stmts" : "bodystmt"), hasBody ? " " : "", "}" ]; diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 23dcb773..401b8db5 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -788,8 +788,9 @@ def on_brace_block(block_var, stmts) { type: :brace_block, - body: [block_var, stmts], - beging: beging, + lbrace: beging, + block_var: block_var, + stmts: stmts, loc: Location.new( start_line: beging[:loc].start_line, @@ -1161,8 +1162,9 @@ def on_do_block(block_var, bodystmt) { type: :do_block, - body: [block_var, bodystmt], - beging: beging, + keyword: beging, + block_var: block_var, + bodystmt: bodystmt, loc: beging[:loc].to(ending[:loc]) } end diff --git a/src/ruby/toProc.ts b/src/ruby/toProc.ts index 16ee9c95..8c3f0499 100644 --- a/src/ruby/toProc.ts +++ b/src/ruby/toProc.ts @@ -25,17 +25,14 @@ function toProc( path: Plugin.Path, node: Ruby.BraceBlock | Ruby.DoBlock ) { - const [variables, blockContents] = node.body; - // Ensure that there are variables being passed to this block. - const params = variables && variables.params; + const params = node.block_var && node.block_var.params; if (!params) { return null; } // Ensure there is one and only one parameter, and that it is required. - const reqParams = params.body[0]; - const otherParams = params.body.slice(1); + const [reqParams, ...otherParams] = params.body; if ( !Array.isArray(reqParams) || reqParams.length !== 1 || @@ -44,30 +41,27 @@ function toProc( return null; } - let statements: Ruby.Stmts; - if (blockContents.type === "bodystmt") { - // We’re in a `do` block - const blockStatements = blockContents.body[0]; - const rescueElseEnsure = blockContents.body.slice(1); + let statements: Ruby.AnyNode[]; + if (node.type === "do_block") { + const [blockStatements, ...rescueElseEnsure] = node.bodystmt.body; // You can’t use the to_proc shortcut if you’re rescuing if (rescueElseEnsure.some(Boolean)) { return null; } - statements = blockStatements; + statements = blockStatements.body; } else { - // We’re in a brace block - statements = blockContents; + statements = node.stmts.body; } // Ensure the block contains only one statement - if (statements.body.length !== 1) { + if (statements.length !== 1) { return null; } // Ensure that statement is a call and that it has no comments attached - const [statement] = statements.body; + const [statement] = statements; if (statement.type !== "call" || statement.comments) { return null; } diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 1ce1a80c..0f5c6631 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -13,7 +13,7 @@ type ParserEvent> = { type: T, loc: Location } & // This is the main expression type that goes in places where the AST will // accept just about anything. // eslint-disable-next-line @typescript-eslint/ban-types -export type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgParen | Args | ArgsAddBlock | ArgsAddStar | ArgsForward | Array | Aryptn | Assign | AssocNew | AssocSplat | AssoclistFromArgs | BEGIN | Backref | Backtick | BareAssocHash | Begin | Binary | BlockVar | Blockarg | Bodystmt | BraceBlock | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | Defsl | DoBlock | Dot2 | Dot3 | DynaSymbol | END | Else | Elsif | EndContent | Ensure | ExcessedComma | Fcall | Field | Float | FndPtn | For | GVar | Hash | Heredoc | HeredocBegin | Hshptn | IVar | Identifier | If | IfModifier | Imaginary | In | Int | Keyword | KeywordRestParam | Label | Lambda | Lbrace | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Op | Opassign | Params | Paren | Period | Program | Qsymbols | Qwords | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueEx | RescueModifier | RestParam | Retry | Return | Return0 | Sclass | Stmts | String | StringConcat | StringDVar | StringEmbExpr | StringLiteral | Super | SymbolLiteral | Symbols | TStringContent | Ternary | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VCall | VarAlias | VarField | VarRef | VoidStmt | When | While | WhileModifier | Word | Words | XStringLiteral | Yield | Yield0 | Zsuper +export type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgParen | Args | ArgsAddBlock | ArgsAddStar | ArgsForward | Array | Aryptn | Assign | AssocNew | AssocSplat | AssoclistFromArgs | BEGIN | Backref | Backtick | BareAssocHash | Begin | Binary | BlockVar | Blockarg | Bodystmt | BraceBlock | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | Defsl | DoBlock | Dot2 | Dot3 | DynaSymbol | END | Else | Elsif | EndContent | Ensure | ExcessedComma | Fcall | Field | Float | FndPtn | For | GVar | Hash | Heredoc | HeredocBegin | Hshptn | IVar | Identifier | If | IfModifier | Imaginary | In | Int | Keyword | KeywordRestParam | Label | Lambda | Lbrace | Lparen | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Op | Opassign | Params | Paren | Period | Program | Qsymbols | Qwords | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueEx | RescueModifier | RestParam | Retry | Return | Return0 | Sclass | Stmts | String | StringConcat | StringDVar | StringEmbExpr | StringLiteral | Super | SymbolLiteral | Symbols | TStringContent | Ternary | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VCall | VarAlias | VarField | VarRef | VoidStmt | When | While | WhileModifier | Word | Words | XStringLiteral | Yield | Yield0 | Zsuper // This is a special scanner event that contains a comment. It can be attached // to almost any kind of node, which is why it's pulled out here separately. @@ -184,11 +184,11 @@ export type Args = ParserEvent<"args", { body: AnyNode[] }>; export type ArgsAddBlock = ParserEvent<"args_add_block", { body: [Args | ArgsAddStar, false | AnyNode] }>; export type ArgsAddStar = ParserEvent<"args_add_star", { body: [Args | ArgsAddStar, ...AnyNode[]] }>; export type BlockVar = ParserEvent<"block_var", { params: Params, locals: Identifier[] }>; -export type BraceBlock = ParserEvent<"brace_block", { body: [null | BlockVar, Stmts], beging: Lbrace }>; +export type BraceBlock = ParserEvent<"brace_block", { lbrace: Lbrace, block_var: null | BlockVar, stmts: Stmts }>; export type Call = ParserEvent<"call", { body: [AnyNode, CallOperator, Backtick | Op | Identifier | Const | "call"] }>; export type Command = ParserEvent<"command", { body: [Const | Identifier, Args | ArgsAddBlock] }>; export type CommandCall = ParserEvent<"command_call", { body: [AnyNode, CallOperator, Op | Identifier | Const, Args | ArgsAddBlock] }>; -export type DoBlock = ParserEvent<"do_block", { body: [null | BlockVar, Bodystmt], beging: Keyword }>; +export type DoBlock = ParserEvent<"do_block", { keyword: Keyword, block_var: null | BlockVar, bodystmt: Bodystmt }>; export type Fcall = ParserEvent<"fcall", { body: [Const | Identifier] }>; export type MethodAddArg = ParserEvent<"method_add_arg", { body: [Call | Fcall, Args | ArgParen | ArgsAddBlock] }>; export type MethodAddBlock = ParserEvent<"method_add_block", { body: [AnyNode, BraceBlock | DoBlock] }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 70429e30..124318c9 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -1,6 +1,6 @@ import type { Ruby } from "../types"; -function getChildNodes(node: Ruby.AnyNode) { +function getChildNodes(node: Ruby.AnyNode): (Ruby.AnyNode | null)[] { switch (node.type) { case "BEGIN": case "END": @@ -32,6 +32,10 @@ function getChildNodes(node: Ruby.AnyNode) { return [node.params, ...node.locals]; case "blockarg": return [node.name]; + case "brace_block": + return [node.lbrace, node.block_var, node.stmts]; + case "do_block": + return [node.keyword, node.block_var, node.bodystmt]; case "hash": return [node.contents]; case "opassign": @@ -91,10 +95,6 @@ function getChildNodes(node: Ruby.AnyNode) { return parts; } - case "brace_block": - return [node.body[0], node.body[1], node.beging]; - case "do_block": - return [node.body[0], node.body[1], node.beging]; case "paren": return [node.lparen, node.body[0]]; default: { From 0d1fa41598d4a2649b1460a6c120088265d19123 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 29 Oct 2021 12:51:54 -0400 Subject: [PATCH 363/785] break, next --- bin/sexp | 5 +- src/ruby/nodes/flow.ts | 95 ++++++++++++++++---------------------- src/ruby/parser.rb | 46 +++++++++--------- src/types/ruby.ts | 4 +- src/utils/getChildNodes.ts | 3 ++ 5 files changed, 72 insertions(+), 81 deletions(-) diff --git a/bin/sexp b/bin/sexp index c4a071b7..5856605a 100755 --- a/bin/sexp +++ b/bin/sexp @@ -11,9 +11,12 @@ PP.prepend( text "" + source = obj.respond_to?(:value) ? obj.value : obj + sliced = source.select { |key, value| !%i[type loc comments].include?(key) && value }.keys + group(1) do breakable ' ' - pp obj[:body] + pp source.values_at(*sliced) end end end diff --git a/src/ruby/nodes/flow.ts b/src/ruby/nodes/flow.ts index d3628e72..0dd0bda3 100644 --- a/src/ruby/nodes/flow.ts +++ b/src/ruby/nodes/flow.ts @@ -4,16 +4,8 @@ import { literal } from "../../utils"; const { join } = prettier; -function nodeDive(node: any, steps: PropertyKey[]) { - let current = node; - - steps.forEach((step) => { - current = current[step]; - }); - - return current; -} - +// If there are parentheses around these nodes, then we can't skip printing them +// without changing the semantic meaning of the statement. const unskippableParens = [ "if_mod", "rescue_mod", @@ -22,56 +14,47 @@ const unskippableParens = [ "while_mod" ]; -function maybeHandleParens( - path: Plugin.Path, - print: Plugin.Print, - keyword: string, - steps: PropertyKey[] -) { - const node = nodeDive(path.getValue(), steps); - if (node.type !== "paren") { - return null; +type FlowControl = Ruby.Break | Ruby.Next; + +function printFlowControl(keyword: string): Plugin.Printer { + return function printFlowControlWithKeyword(path, opts, print) { + const node = path.getValue(); + + // If we don't have any arguments to the keyword, then it's always going to + // come in as an args node, in which case we can just print the keyword. + if (node.args.type === "args") { + return keyword; + } + + // Special handling if we've got parentheses on this call to the keyword. If + // we do and we can skip them, then we will. If we don't, then we'll print + // them right after the keyword with no space. + const paren = node.args.body[0].body[0]; + + if (paren && paren.type === "paren") { + const stmts = (paren.body[0] as Ruby.Stmts).body; + + // Here we're checking if we can skip past the parentheses entirely. + if (stmts.length === 1 && !unskippableParens.includes(stmts[0].type)) { + return [ + `${keyword} `, + (path as any).call(print, "args", "body", 0, "body", 0, "body", 0) + ]; + } + + // Here we know we can't, so just printing out the parentheses as normal. + return [keyword, (path as any).call(print, "args", "body", 0, "body", 0)]; + } + + // If we didn't hit the super special handling, then we're just going to + // print out the arguments to the keyword like normal. + return [`${keyword} `, join(", ", path.call(print, "args"))] } - - const stmts = node.body[0].body; - if (stmts.length === 1 && !unskippableParens.includes(stmts[0].type)) { - return [`${keyword} `, (path as any).call(print, ...steps, "body", 0)]; - } - - return [keyword, (path as any).call(print, ...steps)]; } -export const printBreak: Plugin.Printer = (path, opts, print) => { - const content = path.getValue().body[0]; +export const printBreak = printFlowControl("break"); - if (content.body.length === 0) { - return "break"; - } - - const steps = ["body", 0, "body", 0, "body", 0]; - return ( - maybeHandleParens(path, print, "break", steps) || [ - "break ", - join(", ", path.call(print, "body", 0)) - ] - ); -}; - -export const printNext: Plugin.Printer = (path, opts, print) => { - const args = path.getValue().body[0].body[0]; - - if (!args) { - return "next"; - } - - const steps = ["body", 0, "body", 0, "body", 0]; - return ( - maybeHandleParens(path, print, "next", steps) || [ - "next ", - join(", ", path.call(print, "body", 0)) - ] - ); -}; +export const printNext = printFlowControl("next"); export const printYield: Plugin.Printer = (path, opts, print) => { if (path.getValue().body[0].type === "paren") { diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 401b8db5..43796c9f 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -804,22 +804,19 @@ def on_brace_block(block_var, stmts) # break is a parser event that represents using the break keyword. It # accepts as an argument an args or args_add_block event that contains all # of the arguments being passed to the break. - def on_break(args_add_block) - beging = find_scanner_event(:@kw, 'break') - - if args_add_block[:type] == :args - # You can hit this if you are passing no arguments to break but it has a - # comment right after it. In that case we can just use the location - # information straight from the keyword. + def on_break(args) + keyword = find_scanner_event(:@kw, 'break') + location = + if args[:type] == :args + # You can hit this if you are passing no arguments to break but it has a + # comment right after it. In that case we can just use the location + # information straight from the keyword. + keyword[:loc] + else + keyword[:loc].to(args[:loc]) + end - { type: :break, body: [args_add_block], loc: beging[:loc] } - else - { - type: :break, - body: [args_add_block], - loc: beging[:loc].to(args_add_block[:loc]) - } - end + { type: :break, args: args, loc: location } end # call is a parser event representing a method call with no arguments. It @@ -2037,14 +2034,19 @@ def on_mrhs_new_from_args(args) # next is a parser event that represents using the next keyword. It # accepts as an argument an args or args_add_block event that contains all # of the arguments being passed to the next. - def on_next(args_add_block) - event = find_scanner_event(:@kw, 'next') + def on_next(args) + keyword = find_scanner_event(:@kw, 'next') + location = + if args[:type] == :args + # You can hit this if you are passing no arguments to next but it has a + # comment right after it. In that case we can just use the location + # information straight from the keyword. + keyword[:loc] + else + keyword[:loc].to(args[:loc]) + end - { - type: :next, - body: [args_add_block], - loc: event[:loc].to(args_add_block[:loc]) - } + { type: :next, args: args, loc: location } end # nl is a scanner event representing a newline in the source. As you can diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 0f5c6631..01688a8f 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -154,8 +154,8 @@ export type While = ParserEvent<"while", { body: [AnyNode, Stmts] }>; export type WhileModifier = ParserEvent<"while_mod", { body: [AnyNode, AnyNode] }>; // These are various parser events for control flow keywords. -export type Break = ParserEvent<"break", { body: [Args | ArgsAddBlock] }>; -export type Next = ParserEvent<"next", { body: [Args | ArgsAddBlock] }>; +export type Break = ParserEvent<"break", { args: Args | ArgsAddBlock }>; +export type Next = ParserEvent<"next", { args: Args | ArgsAddBlock }>; export type Return = ParserEvent<"return", { body: [Args | ArgsAddBlock] }>; export type Super = ParserEvent<"super", { body: [Args | ArgParen | ArgsAddBlock] }>; export type Yield = ParserEvent<"yield", { body: [ArgsAddBlock | Paren] }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 124318c9..aea2ff19 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -34,6 +34,9 @@ function getChildNodes(node: Ruby.AnyNode): (Ruby.AnyNode | null)[] { return [node.name]; case "brace_block": return [node.lbrace, node.block_var, node.stmts]; + case "break": + case "next": + return [node.args]; case "do_block": return [node.keyword, node.block_var, node.bodystmt]; case "hash": From 6d17465215d1a0fd4200c87fa5a823325cfae7f4 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 29 Oct 2021 13:03:52 -0400 Subject: [PATCH 364/785] case, rassign --- src/ruby/nodes/case.ts | 6 +++--- src/ruby/nodes/patterns.ts | 18 ++++++++---------- src/ruby/parser.rb | 22 ++++++++++++++-------- src/types/ruby.ts | 4 ++-- src/utils/getChildNodes.ts | 4 ++++ 5 files changed, 31 insertions(+), 23 deletions(-) diff --git a/src/ruby/nodes/case.ts b/src/ruby/nodes/case.ts index d0ad9692..ea90bf06 100644 --- a/src/ruby/nodes/case.ts +++ b/src/ruby/nodes/case.ts @@ -8,11 +8,11 @@ export const printCase: Plugin.Printer = (path, opts, print) => { // You don't need to explicitly have something to test against in a case // statement (without it it effectively becomes an if/elsif chain). - if (path.getValue().body[0]) { - parts.push(" ", path.call(print, "body", 0)); + if (path.getValue().value) { + parts.push(" ", path.call(print, "value")); } - return [...parts, hardline, path.call(print, "body", 1), hardline, "end"]; + return [...parts, hardline, path.call(print, "consequent"), hardline, "end"]; }; export const printWhen: Plugin.Printer = (path, opts, print) => { diff --git a/src/ruby/nodes/patterns.ts b/src/ruby/nodes/patterns.ts index 252ecd7e..33388357 100644 --- a/src/ruby/nodes/patterns.ts +++ b/src/ruby/nodes/patterns.ts @@ -157,13 +157,11 @@ export const printRAssign: Plugin.Printer = ( path, opts, print -) => { - const { keyword } = path.getValue(); - const [leftDoc, rightDoc] = path.map(print, "body"); - - return group([ - leftDoc, - keyword ? " in" : " =>", - group(indent([line, rightDoc])) - ]); -}; +) => ( + group([ + path.call(print, "value"), + " ", + path.call(print, "operator"), + group(indent([line, path.call(print, "pattern")])) + ]) +); diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 43796c9f..856504e3 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -857,21 +857,27 @@ def on_call(receiver, operator, sending) # case is a parser event that represents the beginning of a case chain. # It accepts as arguments the switch of the case and the consequent # clause. - def on_case(switch, consequent) - if event = find_scanner_event(:@kw, 'case', consume: false) - scanner_events.delete(event) + def on_case(value, consequent) + if keyword = find_scanner_event(:@kw, 'case', consume: false) + scanner_events.delete(keyword) { type: :case, - body: [switch, consequent], - loc: event[:loc].to(consequent[:loc]) + value: value, + consequent: consequent, + loc: keyword[:loc].to(consequent[:loc]) } else + operator = + find_scanner_event(:@kw, 'in', consume: false) || + find_scanner_event(:@op, '=>') + { type: :rassign, - body: [switch, consequent], - keyword: find_scanner_event(:@kw, 'in', consume: false), - loc: switch[:loc].to(consequent[:loc]) + value: value, + operator: operator, + pattern: consequent, + loc: value[:loc].to(consequent[:loc]) } end end diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 01688a8f..69e853e3 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -133,7 +133,7 @@ export type MrhsAddStar = ParserEvent<"mrhs_add_star", { body: [Mrhs | MrhsNewFr export type MrhsNewFromArgs = ParserEvent<"mrhs_new_from_args", { body: [Args | ArgsAddStar, AnyNode], oper: string }>; // These are various parser events for control flow constructs. -export type Case = ParserEvent<"case", { body: [AnyNode, In | When] }>; +export type Case = ParserEvent<"case", { value: AnyNode, consequent: In | When }>; export type Else = ParserEvent<"else", { body: [Stmts] }>; export type Elsif = ParserEvent<"elsif", { body: [AnyNode, Stmts, null | Elsif | Else] }>; export type Ensure = ParserEvent<"ensure", { body: [Keyword, Stmts] }>; @@ -164,7 +164,7 @@ export type Yield = ParserEvent<"yield", { body: [ArgsAddBlock | Paren] }>; export type Aryptn = ParserEvent<"aryptn", { body: [null | VarRef, AnyNode[], null | VarField, null | AnyNode[]] }>; export type FndPtn = ParserEvent<"fndptn", { body: [null | AnyNode, VarField, AnyNode[], VarField] }>; export type Hshptn = ParserEvent<"hshptn", { body: [null | AnyNode, [Label, AnyNode][], null | VarField] }>; -export type Rassign = ParserEvent<"rassign", { body: [AnyNode, AnyNode], keyword: boolean }>; +export type Rassign = ParserEvent<"rassign", { value: AnyNode, operator: Op | Keyword, pattern: AnyNode }>; // These are various parser events for method declarations. type ParenAroundParams = Omit & { body: [Params] }; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index aea2ff19..a4bbe26f 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -37,6 +37,8 @@ function getChildNodes(node: Ruby.AnyNode): (Ruby.AnyNode | null)[] { case "break": case "next": return [node.args]; + case "case": + return [node.value, node.consequent]; case "do_block": return [node.keyword, node.block_var, node.bodystmt]; case "hash": @@ -45,6 +47,8 @@ function getChildNodes(node: Ruby.AnyNode): (Ruby.AnyNode | null)[] { return [node.target, node.operator, node.value]; case "program": return [node.stmts]; + case "rassign": + return [node.value, node.operator, node.pattern]; case "heredoc": From eaca1d398fe1c319d319ad05062f17c6045da4da Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 29 Oct 2021 13:14:21 -0400 Subject: [PATCH 365/785] class, module, sclass --- src/ruby/nodes/class.ts | 26 +++++++++++++------------- src/ruby/parser.rb | 18 +++++++++++------- src/types/ruby.ts | 6 +++--- src/utils/getChildNodes.ts | 27 +++++++++++++++++++++------ 4 files changed, 48 insertions(+), 29 deletions(-) diff --git a/src/ruby/nodes/class.ts b/src/ruby/nodes/class.ts index 039a51a8..a03b7502 100644 --- a/src/ruby/nodes/class.ts +++ b/src/ruby/nodes/class.ts @@ -5,52 +5,52 @@ import { isEmptyBodyStmt } from "../../utils"; const { group, hardline, indent } = prettier; export const printClass: Plugin.Printer = (path, opts, print) => { - const [, superclass, bodystmt] = path.getValue().body; + const node = path.getValue(); - const parts = ["class ", path.call(print, "body", 0)]; - if (superclass) { - parts.push(" < ", path.call(print, "body", 1)); + const parts = ["class ", path.call(print, "constant")]; + if (node.superclass) { + parts.push(" < ", path.call(print, "superclass")); } const declaration = group(parts); - if (isEmptyBodyStmt(bodystmt)) { + if (isEmptyBodyStmt(node.bodystmt)) { return group([declaration, hardline, "end"]); } return group([ declaration, - indent([hardline, path.call(print, "body", 2)]), + indent([hardline, path.call(print, "bodystmt")]), [hardline, "end"] ]); }; export const printModule: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); - const declaration = group(["module ", path.call(print, "body", 0)]); + const declaration = group(["module ", path.call(print, "constant")]); - if (isEmptyBodyStmt(node.body[1])) { + if (isEmptyBodyStmt(node.bodystmt)) { return group([declaration, hardline, "end"]); } return group([ declaration, - indent([hardline, path.call(print, "body", 1)]), + indent([hardline, path.call(print, "bodystmt")]), hardline, "end" ]); }; export const printSClass: Plugin.Printer = (path, opts, print) => { - const bodystmt = path.getValue().body[1]; - const declaration = ["class << ", path.call(print, "body", 0)]; + const node = path.getValue(); + const declaration = ["class << ", path.call(print, "target")]; - if (isEmptyBodyStmt(bodystmt)) { + if (isEmptyBodyStmt(node.bodystmt)) { return group([declaration, hardline, "end"]); } return group([ declaration, - indent([hardline, path.call(print, "body", 1)]), + indent([hardline, path.call(print, "bodystmt")]), hardline, "end" ]); diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 856504e3..b594c2eb 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -886,18 +886,20 @@ def on_case(value, consequent) # arguments the name of the class, the optional name of the superclass, # and the bodystmt event that represents the statements evaluated within # the context of the class. - def on_class(const, superclass, bodystmt) + def on_class(constant, superclass, bodystmt) beging = find_scanner_event(:@kw, 'class') ending = find_scanner_event(:@kw, 'end') bodystmt.bind( - find_next_statement_start((superclass || const)[:loc].end_char), + find_next_statement_start((superclass || constant)[:loc].end_char), ending[:loc].start_char ) { type: :class, - body: [const, superclass, bodystmt], + constant: constant, + superclass: superclass, + bodystmt: bodystmt, loc: beging[:loc].to(ending[:loc]) } end @@ -1973,18 +1975,19 @@ def on_mlhs_paren(contents) # module is a parser event that represents defining a module. It accepts # as arguments the name of the module and the bodystmt event that # represents the statements evaluated within the context of the module. - def on_module(const, bodystmt) + def on_module(constant, bodystmt) beging = find_scanner_event(:@kw, 'module') ending = find_scanner_event(:@kw, 'end') bodystmt.bind( - find_next_statement_start(const[:loc].end_char), + find_next_statement_start(constant[:loc].end_char), ending[:loc].start_char ) { type: :module, - body: [const, bodystmt], + constant: constant, + bodystmt: bodystmt, loc: beging[:loc].to(ending[:loc]) } end @@ -2548,7 +2551,8 @@ def on_sclass(target, bodystmt) { type: :sclass, - body: [target, bodystmt], + target: target, + bodystmt: bodystmt, loc: beging[:loc].to(ending[:loc]) } end diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 69e853e3..23e7f0ac 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -213,9 +213,9 @@ export type VarRef = ParserEvent<"var_ref", { value: Const | CVar | GVar | Ident // These are various parser events for statements you would find in a class definition body. export type AccessCtrl = ParserEvent<"access_ctrl", { body: [Identifier] }>; export type Alias = ParserEvent<"alias", { left: DynaSymbol | SymbolLiteral, right: DynaSymbol | SymbolLiteral }>; -export type Class = ParserEvent<"class", { body: [ConstPathRef | ConstRef | TopConstRef, null | AnyNode, Bodystmt] }>; -export type Module = ParserEvent<"module", { body: [ConstPathRef | ConstRef | TopConstRef, Bodystmt] }>; -export type Sclass = ParserEvent<"sclass", { body: [AnyNode, Bodystmt] }>; +export type Class = ParserEvent<"class", { constant: ConstPathRef | ConstRef | TopConstRef, superclass: null | AnyNode, bodystmt: Bodystmt }>; +export type Module = ParserEvent<"module", { constant: ConstPathRef | ConstRef | TopConstRef, bodystmt: Bodystmt }>; +export type Sclass = ParserEvent<"sclass", { target: AnyNode, bodystmt: Bodystmt }>; export type VarAlias = ParserEvent<"var_alias", { left: GVar, right: Backref | GVar }>; export type Undef = ParserEvent<"undef", { body: (DynaSymbol | SymbolLiteral)[] }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index a4bbe26f..0baed9dc 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -3,12 +3,13 @@ import type { Ruby } from "../types"; function getChildNodes(node: Ruby.AnyNode): (Ruby.AnyNode | null)[] { switch (node.type) { case "BEGIN": + return [node.lbrace, node.stmts]; case "END": return [node.lbrace, node.stmts]; case "alias": - case "var_alias": return [node.left, node.right]; case "aref": + return [node.collection, node.index]; case "aref_field": return [node.collection, node.index]; case "assign": @@ -16,17 +17,14 @@ function getChildNodes(node: Ruby.AnyNode): (Ruby.AnyNode | null)[] { case "assoc_new": return [node.key, node.value]; case "assoc_splat": - case "var_field": - case "var_ref": return [node.value]; case "assoclist_from_args": + return node.assocs; case "bare_assoc_hash": return node.assocs; case "begin": return [node.bodystmt]; case "binary": - case "dot2": - case "dot3": return [node.left, node.right]; case "block_var": return [node.params, ...node.locals]; @@ -35,20 +33,37 @@ function getChildNodes(node: Ruby.AnyNode): (Ruby.AnyNode | null)[] { case "brace_block": return [node.lbrace, node.block_var, node.stmts]; case "break": - case "next": return [node.args]; case "case": return [node.value, node.consequent]; + case "class": + return [node.constant, node.superclass, node.bodystmt]; case "do_block": return [node.keyword, node.block_var, node.bodystmt]; + case "dot2": + return [node.left, node.right]; + case "dot3": + return [node.left, node.right]; case "hash": return [node.contents]; + case "module": + return [node.constant, node.bodystmt]; + case "next": + return [node.args]; case "opassign": return [node.target, node.operator, node.value]; case "program": return [node.stmts]; case "rassign": return [node.value, node.operator, node.pattern]; + case "sclass": + return [node.target, node.bodystmt]; + case "var_alias": + return [node.left, node.right]; + case "var_field": + return [node.value]; + case "var_ref": + return [node.value]; case "heredoc": From 2451c92ba6685f753bf465ecd78bb10ce38caff6 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 29 Oct 2021 14:19:56 -0400 Subject: [PATCH 366/785] command, command_call, return --- src/ruby/nodes/commands.ts | 26 ++++++------ src/ruby/nodes/return.ts | 84 ++++++++++++++++++++++---------------- src/ruby/parser.rb | 28 +++++++------ src/types/ruby.ts | 6 +-- src/utils/getChildNodes.ts | 6 +++ src/utils/makeCall.ts | 20 +++++---- 6 files changed, 100 insertions(+), 70 deletions(-) diff --git a/src/ruby/nodes/commands.ts b/src/ruby/nodes/commands.ts index 0710f50d..be61be48 100644 --- a/src/ruby/nodes/commands.ts +++ b/src/ruby/nodes/commands.ts @@ -47,10 +47,10 @@ function docLength(doc: Plugin.Doc): number { function hasDef(node: Ruby.Command) { return ( - node.body[1].type === "args_add_block" && - node.body[1].body[0].type === "args" && - node.body[1].body[0].body[0] && - ["def", "defs"].includes(node.body[1].body[0].body[0].type) + node.args.type === "args_add_block" && + node.args.body[0].type === "args" && + node.args.body[0].body[0] && + ["def", "defs"].includes(node.args.body[0].body[0].type) ); } @@ -68,7 +68,7 @@ function hasDef(node: Ruby.Command) { // In this case the arguments are aligned to the left side as opposed to being // aligned with the `receive` call. function skipArgsAlign(node: Ruby.CommandCall) { - return ["to", "not_to", "to_not"].includes(node.body[2].body); + return ["to", "not_to", "to_not"].includes(node.message.body); } // If there is a ternary argument to a command and it's going to get broken @@ -87,10 +87,10 @@ export const printCommand: Plugin.Printer = ( ) => { const node = path.getValue(); - const command = path.call(print, "body", 0); - const joinedArgs = join([",", line], path.call(print, "body", 1)); + const command = path.call(print, "message"); + const joinedArgs = join([",", line], path.call(print, "args")); - const hasTernary = hasTernaryArg(node.body[1]); + const hasTernary = hasTernaryArg(node.args); let breakArgs; if (hasTernary) { @@ -121,19 +121,19 @@ export const printCommandCall: Plugin.Printer = ( ) => { const node = path.getValue(); const parts = [ - path.call(print, "body", 0), + path.call(print, "receiver"), makeCall(path, opts, print), - path.call(print, "body", 2) + path.call(print, "message") ]; - if (!node.body[3]) { + if (!node.args) { return parts; } - const argDocs = join([",", line], path.call(print, "body", 3)); + const argDocs = join([",", line], path.call(print, "args")); let breakDoc; - if (hasTernaryArg(node.body[3])) { + if (hasTernaryArg(node.args)) { breakDoc = parts.concat("(", indent([softline, argDocs]), softline, ")"); parts.push(" "); } else if (skipArgsAlign(node)) { diff --git a/src/ruby/nodes/return.ts b/src/ruby/nodes/return.ts index 5e062e4a..bf242b7e 100644 --- a/src/ruby/nodes/return.ts +++ b/src/ruby/nodes/return.ts @@ -6,8 +6,8 @@ const { group, ifBreak, indent, line, join, softline } = prettier; // You can't skip the parentheses if you have comments or certain operators with // lower precedence than the return keyword. -function canSkipParens(args: Ruby.Args | Ruby.ArgsAddStar) { - const stmts = (args.body[0] as any).body[0] as Ruby.Stmts; +function canSkipParens(paren: Ruby.Paren) { + const stmts = paren.body[0] as Ruby.Stmts; // return( // # a @@ -33,49 +33,63 @@ function canSkipParens(args: Ruby.Args | Ruby.ArgsAddStar) { } export const printReturn: Plugin.Printer = (path, opts, print) => { - let args = path.getValue().body[0].body[0] as Ruby.Args | Ruby.ArgsAddStar; - let steps = ["body", 0, "body", 0]; - - if (args.body.length === 1) { - // If the body of the return contains parens, then just skip directly to the - // content of the parens so that we can skip printing parens if we don't - // want them. - if (args.body[0] && args.body[0].type === "paren" && canSkipParens(args)) { - args = args.body[0].body[0] as any as Ruby.Args | Ruby.ArgsAddStar; - steps = steps.concat("body", 0, "body", 0); - } + const node = path.getValue(); + let parts: Plugin.Doc | Plugin.Doc[] = ""; + + if (node.args.type === "args_add_block") { + const args = node.args.body[0]; + let steps = ["args", "body", 0]; + + if (args.type === "args" && args.body.length === 1 && args.body[0]) { + // This is the first and only argument being passed to the return keyword. + let arg = args.body[0]; + + // If the body of the return contains parens, then just skip directly to + // the content of the parens so that we can skip printing parens if we + // don't want them. + if (arg.type === "paren") { + // If we can't skip over the parentheses, then we know we can just bail + // out here and print the only argument as normal since it's a paren. + if (!canSkipParens(arg)) { + return ["return", path.call(print, "args")]; + } + + arg = (arg.body[0] as Ruby.Stmts).body[0]; + steps = steps.concat("body", 0, "body", 0); + } - // If we're returning an array literal that isn't a special array, single - // element array, or an empty array, then we want to grab the arguments so - // that we can print them out as if they were normal return arguments. - if ( - args.body[0] && - args.body[0].type === "array" && - args.body[0].body[0] && - args.body[0].body[0].body.length > 1 && - ["args", "args_add_star"].includes(args.body[0].body[0].type) - ) { - steps = steps.concat("body", 0, "body", 0); + // If we're returning an array literal that isn't a special array that has + // at least 2 elements, then we want to grab the arguments so that we can + // print them out as if they were normal return arguments. + if ( + arg.type === "array" && + arg.body[0] && + ["args", "args_add_star"].includes(arg.body[0].type) && + arg.body[0].body.length > 1 + ) { + steps = steps.concat("body", 0, "body", 0); + } } + + // We're doing this weird dance with the steps variable because it's + // possible that you're printing an array nested under some parentheses, in + // which case we still want to descend down that far. For example, + // return([1, 2, 3]) should print as return 1, 2, 3. + parts = (path as any).call(print, ...steps); + } + + // If we didn't hit any of our special cases, then just print out the + // arguments normally here. + if (parts === "") { + parts = path.call(print, "args"); } - // Now that we've established which actual node is the arguments to return, - // we grab it out of the path by diving down the steps that we've set up. - const parts = (path as any).call(print, ...steps) as - | Plugin.Doc - | Plugin.Doc[]; const useBrackets = Array.isArray(parts) && parts.length > 1; // If we got the value straight out of the parens, then `parts` would only // be a singular doc as opposed to an array. const value = Array.isArray(parts) ? join([",", line], parts) : parts; - // We only get here if we have comments somewhere that would prevent us from - // skipping the parentheses. - if (args.body.length === 1 && args.body[0].type === "paren") { - return ["return", value]; - } - return group([ "return", ifBreak(useBrackets ? " [" : "(", " "), diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index b594c2eb..b03c03a0 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -919,20 +919,28 @@ def on_comma(value) # command is a parser event representing a method call with arguments and # no parentheses. It accepts as arguments the name of the method and the # arguments being passed to the method. - def on_command(ident, args) - { type: :command, body: [ident, args], loc: ident[:loc].to(args[:loc]) } + def on_command(message, args) + { + type: :command, + message: message, + args: args, + loc: message[:loc].to(args[:loc]) + } end # command_call is a parser event representing a method call on an object # with arguments and no parentheses. It accepts as arguments the receiver # of the method, the operator being used to send the method, the name of # the method, and the arguments being passed to the method. - def on_command_call(receiver, oper, ident, args) - ending = args || ident + def on_command_call(receiver, operator, message, args) + ending = args || message { type: :command_call, - body: [receiver, oper, ident, args], + receiver: receiver, + operator: operator, + message: message, + args: args, loc: receiver[:loc].to(ending[:loc]) } end @@ -2497,14 +2505,10 @@ def on_retry # return is a parser event that represents using the return keyword with # arguments. It accepts as an argument an args_add_block event that # contains all of the arguments being passed. - def on_return(args_add_block) - event = find_scanner_event(:@kw, 'return') + def on_return(args) + keyword = find_scanner_event(:@kw, 'return') - { - type: :return, - body: [args_add_block], - loc: event[:loc].to(args_add_block[:loc]) - } + { type: :return, args: args, loc: keyword[:loc].to(args[:loc]) } end # return0 is a parser event that represents the bare return keyword. It diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 23e7f0ac..d7a2d3fd 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -156,7 +156,7 @@ export type WhileModifier = ParserEvent<"while_mod", { body: [AnyNode, AnyNode] // These are various parser events for control flow keywords. export type Break = ParserEvent<"break", { args: Args | ArgsAddBlock }>; export type Next = ParserEvent<"next", { args: Args | ArgsAddBlock }>; -export type Return = ParserEvent<"return", { body: [Args | ArgsAddBlock] }>; +export type Return = ParserEvent<"return", { args: Args | ArgsAddBlock }>; export type Super = ParserEvent<"super", { body: [Args | ArgParen | ArgsAddBlock] }>; export type Yield = ParserEvent<"yield", { body: [ArgsAddBlock | Paren] }>; @@ -186,8 +186,8 @@ export type ArgsAddStar = ParserEvent<"args_add_star", { body: [Args | ArgsAddSt export type BlockVar = ParserEvent<"block_var", { params: Params, locals: Identifier[] }>; export type BraceBlock = ParserEvent<"brace_block", { lbrace: Lbrace, block_var: null | BlockVar, stmts: Stmts }>; export type Call = ParserEvent<"call", { body: [AnyNode, CallOperator, Backtick | Op | Identifier | Const | "call"] }>; -export type Command = ParserEvent<"command", { body: [Const | Identifier, Args | ArgsAddBlock] }>; -export type CommandCall = ParserEvent<"command_call", { body: [AnyNode, CallOperator, Op | Identifier | Const, Args | ArgsAddBlock] }>; +export type Command = ParserEvent<"command", { message: Const | Identifier, args: Args | ArgsAddBlock }>; +export type CommandCall = ParserEvent<"command_call", { receiver: AnyNode, operator: CallOperator, message: Op | Identifier | Const, args: Args | ArgsAddBlock }>; export type DoBlock = ParserEvent<"do_block", { keyword: Keyword, block_var: null | BlockVar, bodystmt: Bodystmt }>; export type Fcall = ParserEvent<"fcall", { body: [Const | Identifier] }>; export type MethodAddArg = ParserEvent<"method_add_arg", { body: [Call | Fcall, Args | ArgParen | ArgsAddBlock] }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 0baed9dc..84d24887 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -38,6 +38,10 @@ function getChildNodes(node: Ruby.AnyNode): (Ruby.AnyNode | null)[] { return [node.value, node.consequent]; case "class": return [node.constant, node.superclass, node.bodystmt]; + case "command": + return [node.message, node.args]; + case "command_call": + return [node.receiver, node.message, node.args]; case "do_block": return [node.keyword, node.block_var, node.bodystmt]; case "dot2": @@ -56,6 +60,8 @@ function getChildNodes(node: Ruby.AnyNode): (Ruby.AnyNode | null)[] { return [node.stmts]; case "rassign": return [node.value, node.operator, node.pattern]; + case "return": + return [node.args]; case "sclass": return [node.target, node.bodystmt]; case "var_alias": diff --git a/src/utils/makeCall.ts b/src/utils/makeCall.ts index 27f0297b..b6b6585e 100644 --- a/src/utils/makeCall.ts +++ b/src/utils/makeCall.ts @@ -1,20 +1,26 @@ import type { Plugin, Ruby } from "../types"; -type Callable = { - body: [any, Ruby.CallOperator, ...any[]]; -}; +type Callable = Ruby.Call | Ruby.CommandCall | Ruby.Field; const makeCall: Plugin.Printer = (path, opts, print) => { - const operation = path.getValue().body[1]; + const node = path.getValue(); + const operator = node.type === "command_call" ? node.operator : node.body[1]; // Ignoring the next block for coverage information because it's only relevant // in Ruby 2.5 and below. /* istanbul ignore next */ - if ([".", "&."].includes(operation as any)) { - return operation as Plugin.Doc; + if ([".", "&."].includes(operator as any)) { + return operator as Plugin.Doc; } - return operation === "::" ? "." : path.call(print, "body", 1); + if (operator === "::") { + return "."; + } else if (node.type === "command_call") { + return path.call(print, "operator"); + } else { + const nodePath = path as Plugin.Path; + return nodePath.call(print, "body", 1); + } }; export default makeCall; From fb3ccdd0dfdd0b7588292f6dd1710d3d342bc609 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 29 Oct 2021 14:38:35 -0400 Subject: [PATCH 367/785] const_path_field, const_path_ref, const_ref, top_const_field, top_const_ref --- src/ruby/nodes/constants.ts | 24 ++++++----------------- src/ruby/parser.rb | 38 +++++++++++++++++++++++-------------- src/types/ruby.ts | 10 +++++----- src/utils/getChildNodes.ts | 10 ++++++++++ 4 files changed, 45 insertions(+), 37 deletions(-) diff --git a/src/ruby/nodes/constants.ts b/src/ruby/nodes/constants.ts index d99d3d80..852286f3 100644 --- a/src/ruby/nodes/constants.ts +++ b/src/ruby/nodes/constants.ts @@ -2,21 +2,12 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; import { makeCall } from "../../utils"; -const { group, indent, join, softline } = prettier; +const { group, indent, softline } = prettier; -export const printConstPath: Plugin.Printer< - Ruby.ConstPathField | Ruby.ConstPathRef -> = (path, opts, print) => { - return join("::", path.map(print, "body")); -}; +type ConstPath = Ruby.ConstPathField | Ruby.ConstPathRef; +export const printConstPath: Plugin.Printer = (path, opts, print) => [path.call(print, "parent"), "::", path.call(print, "constant")]; -export const printConstRef: Plugin.Printer = ( - path, - opts, - print -) => { - return path.call(print, "body", 0); -}; +export const printConstRef: Plugin.Printer = (path, opts, print) => path.call(print, "constant"); export const printDefined: Plugin.Printer = ( path, @@ -39,8 +30,5 @@ export const printField: Plugin.Printer = (path, opts, print) => { ]); }; -export const printTopConst: Plugin.Printer< - Ruby.TopConstField | Ruby.TopConstRef -> = (path, opts, print) => { - return ["::", path.call(print, "body", 0)]; -}; +type TopConst = Ruby.TopConstField | Ruby.TopConstRef; +export const printTopConst: Plugin.Printer = (path, opts, print) => ["::", path.call(print, "constant")]; diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index b03c03a0..173293b5 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -988,11 +988,12 @@ def on_const(value) # # foo::X = 1 # - def on_const_path_field(left, const) + def on_const_path_field(parent, constant) { type: :const_path_field, - body: [left, const], - loc: left[:loc].to(const[:loc]) + parent: parent, + constant: constant, + loc: parent[:loc].to(constant[:loc]) } end @@ -1000,11 +1001,12 @@ def on_const_path_field(left, const) # const_path_field except that it is not involved in an assignment. It # looks like the following example: foo::Bar, where left is foo and const is # Bar. - def on_const_path_ref(left, const) + def on_const_path_ref(parent, constant) { type: :const_path_ref, - body: [left, const], - loc: left[:loc].to(const[:loc]) + parent: parent, + constant: constant, + loc: parent[:loc].to(constant[:loc]) } end @@ -1014,8 +1016,8 @@ def on_const_path_ref(left, const) # # class Foo; end # - def on_const_ref(const) - { type: :const_ref, body: [const], loc: const[:loc] } + def on_const_ref(constant) + { type: :const_ref, constant: constant, loc: constant[:loc] } end # cvar is a scanner event that represents the use of a class variable. @@ -2880,10 +2882,14 @@ def on_tlambeg(value) # # ::X = 1 # - def on_top_const_field(const) - beging = find_colon2_before(const) + def on_top_const_field(constant) + operator = find_colon2_before(constant) - { type: :top_const_field, body: [const], loc: beging[:loc].to(const[:loc]) } + { + type: :top_const_field, + constant: constant, + loc: operator[:loc].to(constant[:loc]) + } end # A top_const_ref is a parser event that is a very similar to @@ -2892,10 +2898,14 @@ def on_top_const_field(const) # # ::X # - def on_top_const_ref(const) - beging = find_colon2_before(const) + def on_top_const_ref(constant) + operator = find_colon2_before(constant) - { type: :top_const_ref, body: [const], loc: beging[:loc].to(const[:loc]) } + { + type: :top_const_ref, + constant: constant, + loc: operator[:loc].to(constant[:loc]) + } end # tstring_beg is a scanner event that represents the beginning of a string diff --git a/src/types/ruby.ts b/src/types/ruby.ts index d7a2d3fd..85e1779c 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -116,10 +116,10 @@ export type Hash = ParserEvent<"hash", { contents: null | AssoclistFromArgs }>; type Assignable = ArefField | ConstPathField | Field | TopConstField | VarField; export type ArefField = ParserEvent<"aref_field", { collection: AnyNode, index: ArgsAddBlock | null }>; export type Assign = ParserEvent<"assign", { target: Assignable, value: AnyNode }>; -export type ConstPathField = ParserEvent<"const_path_field", { body: [ConstPathRef | Paren | TopConstRef | VarRef, Const] }>; +export type ConstPathField = ParserEvent<"const_path_field", { parent: ConstPathRef | Paren | TopConstRef | VarRef, constant: Const }>; export type Field = ParserEvent<"field", { body: [AnyNode, CallOperator, Const | Identifier] }>; export type Opassign = ParserEvent<"opassign", { target: Assignable, operator: Op, value: AnyNode }>; -export type TopConstField = ParserEvent<"top_const_field", { body: [Const] }>; +export type TopConstField = ParserEvent<"top_const_field", { constant: Const }>; export type VarField = ParserEvent<"var_field", { value: null | Const | CVar | GVar | Identifier | IVar }>; // These are various parser events that have to do with multiple assignment. @@ -199,14 +199,14 @@ type Dot = { left: AnyNode, right: AnyNode } | { left: null, right: AnyNode } | export type Aref = ParserEvent<"aref", { collection: AnyNode, index: Args | ArgsAddBlock | null }>; export type BEGIN = ParserEvent<"BEGIN", { lbrace: Lbrace, stmts: Stmts }>; export type Binary = ParserEvent<"binary", { left: AnyNode, operator: string, right: AnyNode }>; -export type ConstPathRef = ParserEvent<"const_path_ref", { body: [AnyNode, Const] }>; -export type ConstRef = ParserEvent<"const_ref", { body: [Const] }>; +export type ConstPathRef = ParserEvent<"const_path_ref", { parent: AnyNode, constant: Const }>; +export type ConstRef = ParserEvent<"const_ref", { constant: Const }>; export type Defined = ParserEvent<"defined", { body: [AnyNode] }>; export type Dot2 = ParserEvent<"dot2", Dot>; export type Dot3 = ParserEvent<"dot3", Dot>; export type END = ParserEvent<"END", { lbrace: Lbrace, stmts: Stmts }>; export type Paren = ParserEvent<"paren", { body: [AnyNode], lparen: Lparen }>; -export type TopConstRef = ParserEvent<"top_const_ref", { body: [Const] }>; +export type TopConstRef = ParserEvent<"top_const_ref", { constant: Const }>; export type Unary = ParserEvent<"unary", { body: [AnyNode], oper: string, paren: boolean | undefined }>; export type VarRef = ParserEvent<"var_ref", { value: Const | CVar | GVar | Identifier | IVar | Keyword }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 84d24887..8cc5e3a1 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -42,6 +42,12 @@ function getChildNodes(node: Ruby.AnyNode): (Ruby.AnyNode | null)[] { return [node.message, node.args]; case "command_call": return [node.receiver, node.message, node.args]; + case "const_path_field": + return [node.parent, node.constant]; + case "const_path_ref": + return [node.parent, node.constant]; + case "const_ref": + return [node.constant]; case "do_block": return [node.keyword, node.block_var, node.bodystmt]; case "dot2": @@ -64,6 +70,10 @@ function getChildNodes(node: Ruby.AnyNode): (Ruby.AnyNode | null)[] { return [node.args]; case "sclass": return [node.target, node.bodystmt]; + case "top_const_field": + return [node.constant]; + case "top_const_ref": + return [node.constant]; case "var_alias": return [node.left, node.right]; case "var_field": From b210b4c6c02ddc55f2e5f8bf9e63fb77c7cc0888 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 29 Oct 2021 14:53:02 -0400 Subject: [PATCH 368/785] def, defs, defsl --- src/ruby/nodes/methods.ts | 61 ++++++++++++++------------------------ src/ruby/parser.rb | 36 +++++++++++++--------- src/types/ruby.ts | 8 +++-- src/utils/getChildNodes.ts | 6 ++++ 4 files changed, 55 insertions(+), 56 deletions(-) diff --git a/src/ruby/nodes/methods.ts b/src/ruby/nodes/methods.ts index ce227f85..d2e019fe 100644 --- a/src/ruby/nodes/methods.ts +++ b/src/ruby/nodes/methods.ts @@ -12,45 +12,30 @@ export const printDef: Plugin.Printer = ( const node = path.getValue(); const declaration: Plugin.Doc[] = ["def "]; - let paramsNode: Ruby.Params | Ruby.Paren; - let bodystmtNode: Ruby.Bodystmt; - - let nameDoc: Plugin.Doc; - let paramsDoc: Plugin.Doc; - let bodystmtDoc: Plugin.Doc; - - if (node.type === "def") { - paramsNode = node.body[1]; - bodystmtNode = node.body[2]; - - nameDoc = path.call(print, "body", 0); - paramsDoc = path.call(print, "body", 1); - bodystmtDoc = path.call(print, "body", 2); - } else { - // In this case, we're printing a method that's defined as a singleton, so - // we need to include the target and the operator - declaration.push(path.call(print, "body", 0), path.call(print, "body", 1)); - - paramsNode = node.body[3]; - bodystmtNode = node.body[4]; - - nameDoc = path.call(print, "body", 2); - paramsDoc = path.call(print, "body", 3); - bodystmtDoc = path.call(print, "body", 4); + // In this case, we're printing a method that's defined as a singleton, so + // we need to include the target and the operator before the name. + if (node.type === "defs") { + declaration.push(path.call(print, "target"), path.call(print, "operator")); } // In case there are no parens but there are arguments - const parens = - paramsNode.type === "params" && paramsNode.body.some((type) => type); - declaration.push(nameDoc, parens ? "(" : "", paramsDoc, parens ? ")" : ""); + const useParens = + node.params.type === "params" && node.params.body.some((type) => type); + + declaration.push( + path.call(print, "name"), + useParens ? "(" : "", + path.call(print, "params"), + useParens ? ")" : "" + ); - if (isEmptyBodyStmt(bodystmtNode)) { + if (isEmptyBodyStmt(node.bodystmt)) { return group([...declaration, "; end"]); } return group([ group(declaration), - indent([hardline, bodystmtDoc]), + indent([hardline, path.call(print, "bodystmt")]), hardline, "end" ]); @@ -61,23 +46,21 @@ export const printSingleLineMethod: Plugin.Printer = ( opts, print ) => { - const parensNode = path.getValue().body[1]; + const node = path.getValue(); let paramsDoc: Plugin.Doc = ""; - if (parensNode) { - const paramsNode = parensNode.body[0]; - - if (paramsNode.body.some((type) => type)) { - paramsDoc = path.call(print, "body", 1); - } + // If we have any kind of parameters, we're going to print the whole + // parentheses. If we don't, then we're just going to skip them entirely. + if (node.paren && node.paren.body[0].body.some((type) => type)) { + paramsDoc = path.call(print, "paren"); } return group([ "def ", - path.call(print, "body", 0), + path.call(print, "name"), paramsDoc, " =", - indent(group([line, path.call(print, "body", 2)])) + indent(group([line, path.call(print, "stmt")])) ]); }; diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 173293b5..89ffaa7a 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -1033,7 +1033,7 @@ def on_cvar(value) end # A def is a parser event that represents defining a regular method on the - # current self object. It accepts as arguments the ident (the name of the + # current self object. It accepts as arguments the name (the name of the # method being defined), the params (the parameter declaration for the # method), and a bodystmt node which represents the statements inside the # method. As an example, here are the parts that go into this: @@ -1042,7 +1042,7 @@ def on_cvar(value) # │ │ │ # │ │ └> bodystmt # │ └> params - # └> ident + # └> name # # You can also have single-line methods since Ruby 3.0+, which have slightly # different syntax but still flow through this method. Those look like: @@ -1050,13 +1050,13 @@ def on_cvar(value) # def foo = bar # | | # | └> stmt - # └> ident + # └> name # - def on_def(ident, params, bodystmt) + def on_def(name, params, bodystmt) # Make sure to delete this scanner event in case you're defining something # like def class which would lead to this being a kw and causing all kinds # of trouble - scanner_events.delete(ident) + scanner_events.delete(name) # Find the beginning of the method definition, which works for single-line # and normal method definitions. @@ -1066,7 +1066,9 @@ def on_def(ident, params, bodystmt) if bodystmt[:type] != :bodystmt defsl = { type: :defsl, - body: [ident, params, bodystmt], + name: name, + paren: params, + stmt: bodystmt, loc: beging[:loc].to(bodystmt[:loc]) } @@ -1076,7 +1078,7 @@ def on_def(ident, params, bodystmt) # If there aren't any params then we need to correct the params node # location information if params[:type] == :params && !params[:body].any? - location = ident[:loc].end_char + location = name[:loc].end_char params[:loc] = Location.new( @@ -1095,7 +1097,9 @@ def on_def(ident, params, bodystmt) { type: :def, - body: [ident, params, bodystmt], + name: name, + params: params, + bodystmt: bodystmt, loc: beging[:loc].to(ending[:loc]) } end @@ -1110,20 +1114,20 @@ def on_def(ident, params, bodystmt) # │ │ │ │ │ # │ │ │ │ └> bodystmt # │ │ │ └> params - # │ │ └> ident - # │ └> oper + # │ │ └> name + # │ └> operator # └> target # - def on_defs(target, oper, ident, params, bodystmt) + def on_defs(target, operator, name, params, bodystmt) # Make sure to delete this scanner event in case you're defining something # like def class which would lead to this being a kw and causing all kinds # of trouble - scanner_events.delete(ident) + scanner_events.delete(name) # If there aren't any params then we need to correct the params node # location information if params[:type] == :params && !params[:body].any? - location = ident[:loc].end_char + location = name[:loc].end_char params[:loc] = Location.new( @@ -1144,7 +1148,11 @@ def on_defs(target, oper, ident, params, bodystmt) { type: :defs, - body: [target, oper, ident, params, bodystmt], + target: target, + operator: operator, + name: name, + params: params, + bodystmt: bodystmt, loc: beging[:loc].to(ending[:loc]) } end diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 85e1779c..8e7c74d3 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -167,11 +167,13 @@ export type Hshptn = ParserEvent<"hshptn", { body: [null | AnyNode, [Label, AnyN export type Rassign = ParserEvent<"rassign", { value: AnyNode, operator: Op | Keyword, pattern: AnyNode }>; // These are various parser events for method declarations. +type DefName = Backtick | Const | Identifier | Keyword | Op; type ParenAroundParams = Omit & { body: [Params] }; + export type Blockarg = ParserEvent<"blockarg", { name: Identifier }>; -export type Def = ParserEvent<"def", { body: [Backtick | Const | Identifier | Keyword | Op, Params | Paren, Bodystmt] }>; -export type Defs = ParserEvent<"defs", { body: [AnyNode, Op | Period, Const | Op | Identifier | Keyword, Params | Paren, Bodystmt] }>; -export type Defsl = ParserEvent<"defsl", { body: [Identifier, null | ParenAroundParams, AnyNode] }>; +export type Def = ParserEvent<"def", { name: DefName, params: Params | Paren, bodystmt: Bodystmt }>; +export type Defs = ParserEvent<"defs", { target: AnyNode, operator: Op | Period, name: DefName, params: Params | Paren, bodystmt: Bodystmt }>; +export type Defsl = ParserEvent<"defsl", { name: DefName, paren: null | ParenAroundParams, stmt: AnyNode }>; export type KeywordRestParam = ParserEvent<"kwrest_param", { body: [null | Identifier] }>; export type Lambda = ParserEvent<"lambda", { body: [Params | ParenAroundParams, Bodystmt | Stmts] }>; export type Params = ParserEvent<"params", { body: [Identifier[], null | [Identifier, AnyNode][], null | ArgsForward | ExcessedComma | RestParam, Identifier[], null | [Label, AnyNode][], null | "nil" | KeywordRestParam, null | Blockarg] }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 8cc5e3a1..374ad1c6 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -48,6 +48,12 @@ function getChildNodes(node: Ruby.AnyNode): (Ruby.AnyNode | null)[] { return [node.parent, node.constant]; case "const_ref": return [node.constant]; + case "def": + return [node.name, node.params, node.bodystmt]; + case "defs": + return [node.target, node.operator, node.name, node.params, node.bodystmt]; + case "defsl": + return [node.name, node.paren, node.stmt]; case "do_block": return [node.keyword, node.block_var, node.bodystmt]; case "dot2": From 080ff1166afe75864017aece6dfc50842712f55b Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 29 Oct 2021 15:09:40 -0400 Subject: [PATCH 369/785] defined, dyna_symbol, else --- src/ruby/nodes/conditionals.ts | 11 ++++++----- src/ruby/nodes/constants.ts | 2 +- src/ruby/parser.rb | 4 ++-- src/types/ruby.ts | 4 ++-- src/utils/getChildNodes.ts | 6 ++++++ 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/ruby/nodes/conditionals.ts b/src/ruby/nodes/conditionals.ts index a6be2654..80774dcb 100644 --- a/src/ruby/nodes/conditionals.ts +++ b/src/ruby/nodes/conditionals.ts @@ -216,7 +216,8 @@ function canTernary(path: Plugin.Path) { ) && addition && addition.type === "else" && - [stmts, addition.body[0]].every(canTernaryStmts) + canTernaryStmts(stmts) && + canTernaryStmts(addition.stmts) ); } @@ -232,7 +233,7 @@ function printConditional( ...printTernaryClauses( keyword, path.call(print, "body", 1), - path.call(print, "body", 2, "body", 0) + path.call(print, "body", 2, "stmts") ) ]; @@ -289,14 +290,14 @@ function printConditional( } export const printElse: Plugin.Printer = (path, opts, print) => { - const stmts = path.getValue().body[0]; + const node = path.getValue(); return [ - stmts.body.length === 1 && stmts.body[0].type === "command" + node.stmts.body.length === 1 && node.stmts.body[0].type === "command" ? breakParent : "", "else", - indent([softline, path.call(print, "body", 0)]) + indent([softline, path.call(print, "stmts")]) ]; }; diff --git a/src/ruby/nodes/constants.ts b/src/ruby/nodes/constants.ts index 852286f3..790c954c 100644 --- a/src/ruby/nodes/constants.ts +++ b/src/ruby/nodes/constants.ts @@ -16,7 +16,7 @@ export const printDefined: Plugin.Printer = ( ) => { return group([ "defined?(", - indent([softline, path.call(print, "body", 0)]), + indent([softline, path.call(print, "value")]), softline, ")" ]); diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 89ffaa7a..3b43a1d5 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -1167,7 +1167,7 @@ def on_defined(value) paren = source[beging[:loc].end_char...value[:loc].start_char].include?('(') ending = paren ? find_scanner_event(:@rparen) : value - { type: :defined, body: [value], loc: beging[:loc].to(ending[:loc]) } + { type: :defined, value: value, loc: beging[:loc].to(ending[:loc]) } end # do_block is a parser event that represents passing a block to a method @@ -1289,7 +1289,7 @@ def on_else(stmts) stmts.bind(beging[:loc].end_char, ending[:loc].start_char) - { type: :else, body: [stmts], loc: beging[:loc].to(ending[:loc]) } + { type: :else, stmts: stmts, loc: beging[:loc].to(ending[:loc]) } end # elsif is a parser event that represents another clause in an if chain. diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 8e7c74d3..52435d84 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -134,7 +134,7 @@ export type MrhsNewFromArgs = ParserEvent<"mrhs_new_from_args", { body: [Args | // These are various parser events for control flow constructs. export type Case = ParserEvent<"case", { value: AnyNode, consequent: In | When }>; -export type Else = ParserEvent<"else", { body: [Stmts] }>; +export type Else = ParserEvent<"else", { stmts: Stmts }>; export type Elsif = ParserEvent<"elsif", { body: [AnyNode, Stmts, null | Elsif | Else] }>; export type Ensure = ParserEvent<"ensure", { body: [Keyword, Stmts] }>; export type For = ParserEvent<"for", { body: [Mlhs | MlhsAddStar | VarField, AnyNode, Stmts] }>; @@ -203,7 +203,7 @@ export type BEGIN = ParserEvent<"BEGIN", { lbrace: Lbrace, stmts: Stmts }>; export type Binary = ParserEvent<"binary", { left: AnyNode, operator: string, right: AnyNode }>; export type ConstPathRef = ParserEvent<"const_path_ref", { parent: AnyNode, constant: Const }>; export type ConstRef = ParserEvent<"const_ref", { constant: Const }>; -export type Defined = ParserEvent<"defined", { body: [AnyNode] }>; +export type Defined = ParserEvent<"defined", { value: AnyNode }>; export type Dot2 = ParserEvent<"dot2", Dot>; export type Dot3 = ParserEvent<"dot3", Dot>; export type END = ParserEvent<"END", { lbrace: Lbrace, stmts: Stmts }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 374ad1c6..01da728b 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -50,6 +50,8 @@ function getChildNodes(node: Ruby.AnyNode): (Ruby.AnyNode | null)[] { return [node.constant]; case "def": return [node.name, node.params, node.bodystmt]; + case "defined": + return [node.value]; case "defs": return [node.target, node.operator, node.name, node.params, node.bodystmt]; case "defsl": @@ -60,6 +62,10 @@ function getChildNodes(node: Ruby.AnyNode): (Ruby.AnyNode | null)[] { return [node.left, node.right]; case "dot3": return [node.left, node.right]; + case "dyna_symbol": + return node.body; + case "else": + return [node.stmts]; case "hash": return [node.contents]; case "module": From 173981534b292b8ca77e58677158b270c1146947 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 29 Oct 2021 15:14:11 -0400 Subject: [PATCH 370/785] elsif --- src/ruby/nodes/conditionals.ts | 31 ++++++++++++------------------- src/ruby/parser.rb | 4 +++- src/types/ruby.ts | 2 +- src/utils/getChildNodes.ts | 2 ++ 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/src/ruby/nodes/conditionals.ts b/src/ruby/nodes/conditionals.ts index 80774dcb..0dcb83dd 100644 --- a/src/ruby/nodes/conditionals.ts +++ b/src/ruby/nodes/conditionals.ts @@ -9,6 +9,8 @@ import { const { align, breakParent, hardline, group, ifBreak, indent, softline } = prettier; +type Conditional = Ruby.If | Ruby.Unless; + // If the statements are just a single if/unless, in block or modifier form, or // a ternary function containsSingleConditional(stmts: Ruby.Stmts) { @@ -20,12 +22,7 @@ function containsSingleConditional(stmts: Ruby.Stmts) { ); } -function printWithAddition( - keyword: string, - path: Plugin.Path, - print: Plugin.Print, - breaking: boolean -) { +function printWithAddition(keyword: string, path: Plugin.Path, print: Plugin.Print, breaking: boolean) { return [ `${keyword} `, align(keyword.length + 1, path.call(print, "body", 0)), @@ -105,9 +102,7 @@ export const printTernary: Plugin.Printer = ( function printSingle( keyword: string, modifier = false -): Plugin.Printer< - Ruby.If | Ruby.IfModifier | Ruby.Unless | Ruby.UnlessModifier -> { +): Plugin.Printer { return function printSingleWithKeyword(path, { rubyModifier }, print) { const [, statementsNode] = path.getValue().body; const predicateDoc = path.call(print, "body", 0); @@ -126,7 +121,7 @@ function printSingle( // multiline form. if ( !rubyModifier || - (!modifier && (statementsNode as Ruby.If | Ruby.Unless).body[0].comments) + (!modifier && (statementsNode as Conditional).body[0].comments) ) { return [multilineParts, breakParent]; } @@ -207,7 +202,7 @@ function canTernaryStmts(stmts: Ruby.Stmts) { // is of the "else" type. Both the body of the main node and the body of the // additional node must have only one statement, and that statement list must // pass the `canTernaryStmts` check. -function canTernary(path: Plugin.Path) { +function canTernary(path: Plugin.Path) { const [predicate, stmts, addition] = path.getValue().body; return ( @@ -222,9 +217,7 @@ function canTernary(path: Plugin.Path) { } // A normalized print function for both `if` and `unless` nodes. -function printConditional( - keyword: string -): Plugin.Printer { +function printConditional(keyword: string): Plugin.Printer { return (path, opts, print) => { if (canTernary(path)) { let ternaryParts = [ @@ -302,14 +295,14 @@ export const printElse: Plugin.Printer = (path, opts, print) => { }; export const printElsif: Plugin.Printer = (path, opts, print) => { - const [, , addition] = path.getValue().body; + const node = path.getValue(); const parts = [ - group(["elsif ", align("elsif".length - 1, path.call(print, "body", 0))]), - indent([hardline, path.call(print, "body", 1)]) + group(["elsif ", align("elsif".length - 1, path.call(print, "predicate"))]), + indent([hardline, path.call(print, "stmts")]) ]; - if (addition) { - parts.push(group([hardline, path.call(print, "body", 2)])); + if (node.consequent) { + parts.push(group([hardline, path.call(print, "consequent")])); } return group(parts); diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 3b43a1d5..e8d88672 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -1304,7 +1304,9 @@ def on_elsif(predicate, stmts, consequent) { type: :elsif, - body: [predicate, stmts, consequent], + predicate: predicate, + stmts: stmts, + consequent: consequent, loc: beging[:loc].to(ending[:loc]) } end diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 52435d84..e9b2e3f8 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -135,7 +135,7 @@ export type MrhsNewFromArgs = ParserEvent<"mrhs_new_from_args", { body: [Args | // These are various parser events for control flow constructs. export type Case = ParserEvent<"case", { value: AnyNode, consequent: In | When }>; export type Else = ParserEvent<"else", { stmts: Stmts }>; -export type Elsif = ParserEvent<"elsif", { body: [AnyNode, Stmts, null | Elsif | Else] }>; +export type Elsif = ParserEvent<"elsif", { predicate: AnyNode, stmts: Stmts, consequent: null | Elsif | Else }>; export type Ensure = ParserEvent<"ensure", { body: [Keyword, Stmts] }>; export type For = ParserEvent<"for", { body: [Mlhs | MlhsAddStar | VarField, AnyNode, Stmts] }>; export type If = ParserEvent<"if", { body: [AnyNode, Stmts, null | Elsif | Else] }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 01da728b..e1c3dc66 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -66,6 +66,8 @@ function getChildNodes(node: Ruby.AnyNode): (Ruby.AnyNode | null)[] { return node.body; case "else": return [node.stmts]; + case "elsif": + return [node.predicate, node.stmts, node.consequent]; case "hash": return [node.contents]; case "module": From c6a88c90d74ec73ad5d3f9b8694603bc5c583a9f Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 29 Oct 2021 15:36:24 -0400 Subject: [PATCH 371/785] access_ctrl, ensure, excessed_comma, fcall, vcall --- src/ruby/nodes.ts | 2 ++ src/ruby/nodes/calls.ts | 25 +++++++++++++++---------- src/ruby/nodes/methods.ts | 4 +--- src/ruby/nodes/params.ts | 4 ++++ src/ruby/nodes/rescue.ts | 4 ++-- src/ruby/parser.rb | 29 +++++++++++++++++------------ src/types/ruby.ts | 8 ++++---- src/utils/getChildNodes.ts | 10 ++++++++++ 8 files changed, 55 insertions(+), 31 deletions(-) diff --git a/src/ruby/nodes.ts b/src/ruby/nodes.ts index ac1e00d5..6cd10214 100644 --- a/src/ruby/nodes.ts +++ b/src/ruby/nodes.ts @@ -83,6 +83,7 @@ import { } from "./nodes/operators"; import { printArgsForward, + printExcessedComma, printKeywordRestParam, printParams, printRestParam @@ -177,6 +178,7 @@ const nodes: Partial<{ elsif: printElsif, END: printEND, ensure: printEnsure, + excessed_comma: printExcessedComma, fcall: printCallContainer, fndptn: printFndPtn, field: printField, diff --git a/src/ruby/nodes/calls.ts b/src/ruby/nodes/calls.ts index 51502e01..d8389bdb 100644 --- a/src/ruby/nodes/calls.ts +++ b/src/ruby/nodes/calls.ts @@ -149,7 +149,7 @@ export const printMethodAddArg: Plugin.Printer = ( // like a constant, then we need to match that in order to maintain valid // Ruby. For example, you could do something like Foo(), on which we would // need to keep the parentheses to make it look like a method call. - if (methodNode.type === "fcall" && methodNode.body[0].type === "@const") { + if (methodNode.type === "fcall" && methodNode.value.type === "@const") { return [methodDoc, "()"]; } @@ -200,14 +200,19 @@ export const printMethodAddArg: Plugin.Printer = ( sigBlock = path.getParentNode(3); } - if ( - sigBlock.type === "method_add_block" && - sigBlock.body[1] && - sigBlock.body[0].type === "method_add_arg" && - sigBlock.body[0].body[0].type === "fcall" && - sigBlock.body[0].body[0].body[0].body === "sig" - ) { - threshold = 2; + if (sigBlock.type === "method_add_block") { + // Pulling this out into a separate variable so we can get back some of + // our type safety. + const sigBlockNode = sigBlock as Ruby.MethodAddBlock; + + if ( + sigBlockNode.body[1] && + sigBlockNode.body[0].type === "method_add_arg" && + sigBlockNode.body[0].body[0].type === "fcall" && + sigBlockNode.body[0].body[0].value.body === "sig" + ) { + threshold = 2; + } } } @@ -325,5 +330,5 @@ export const printCallContainer: Plugin.Printer = ( opts, print ) => { - return path.call(print, "body", 0); + return path.call(print, "value"); }; diff --git a/src/ruby/nodes/methods.ts b/src/ruby/nodes/methods.ts index d2e019fe..72a02968 100644 --- a/src/ruby/nodes/methods.ts +++ b/src/ruby/nodes/methods.ts @@ -68,6 +68,4 @@ export const printAccessControl: Plugin.Printer = ( path, opts, print -) => { - return path.call(print, "body", 0); -}; +) => path.call(print, "value"); diff --git a/src/ruby/nodes/params.ts b/src/ruby/nodes/params.ts index 247ee7a7..2167f678 100644 --- a/src/ruby/nodes/params.ts +++ b/src/ruby/nodes/params.ts @@ -116,3 +116,7 @@ export const printParams: Plugin.Printer = (path, opts, print) => { export const printArgsForward = literal("..."); export const printKeywordRestParam = printRestParamSymbol("**"); export const printRestParam = printRestParamSymbol("*"); + +export const printExcessedComma: Plugin.Printer = (path, opts, print) => { + return path.call(print, "body"); +}; diff --git a/src/ruby/nodes/rescue.ts b/src/ruby/nodes/rescue.ts index 847af1ef..e1d606a8 100644 --- a/src/ruby/nodes/rescue.ts +++ b/src/ruby/nodes/rescue.ts @@ -15,8 +15,8 @@ export const printBegin: Plugin.Printer = (path, opts, print) => { export const printEnsure: Plugin.Printer = (path, opts, print) => { return [ - path.call(print, "body", 0), - indent([hardline, path.call(print, "body", 1)]) + path.call(print, "keyword"), + indent([hardline, path.call(print, "stmts")]) ]; }; diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index e8d88672..448a5710 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -1405,7 +1405,7 @@ def on_embvar(value) # ensure is a parser event that represents the use of the ensure keyword # and its subsequent statements. def on_ensure(stmts) - beging = find_scanner_event(:@kw, 'ensure') + keyword = find_scanner_event(:@kw, 'ensure') # Specifically not using find_scanner_event here because we don't want to # consume the :@end event, because that would break def..ensure..end chains. @@ -1416,11 +1416,16 @@ def on_ensure(stmts) ending = scanner_events[index] stmts.bind( - find_next_statement_start(beging[:loc].end_char), + find_next_statement_start(keyword[:loc].end_char), ending[:loc].start_char ) - { type: :ensure, body: [beging, stmts], loc: beging[:loc].to(ending[:loc]) } + { + type: :ensure, + keyword: keyword, + stmts: stmts, + loc: keyword[:loc].to(ending[:loc]) + } end # An excessed_comma is a special kind of parser event that represents a comma @@ -1428,15 +1433,15 @@ def on_ensure(stmts) # different number of arguments depending on Ruby version, which is why we # have the anonymous splat there. def on_excessed_comma(*) - event = find_scanner_event(:@comma) + comma = find_scanner_event(:@comma) - { type: :excessed_comma, body: event[:body], loc: event[:loc] } + { type: :excessed_comma, body: comma[:body], loc: comma[:loc] } end # An fcall is a parser event that represents the piece of a method call # that comes before any arguments (i.e., just the name of the method). - def on_fcall(ident) - { type: :fcall, body: [ident], loc: ident[:loc] } + def on_fcall(value) + { type: :fcall, value: value, loc: value[:loc] } end # A field is a parser event that is always the child of an assignment. It @@ -3123,17 +3128,17 @@ def on_var_field(value) end # vcall nodes are any plain named thing with Ruby that could be either a - # local variable or a method call. They accept as an argument the ident - # scanner event that contains their content. + # local variable or a method call. They accept as an argument the scanner + # event that contains their content. # # Access controls like private, protected, and public are reported as # vcall nodes since they're technically method calls. We want to be able # add new lines around them as necessary, so here we're going to # explicitly track those as a different node type. - def on_vcall(ident) + def on_vcall(value) @controls ||= %w[private protected public].freeze - body = ident[:body] + body = value[:body] type = if @controls.include?(body) && body == lines[lineno - 1].strip :access_ctrl @@ -3141,7 +3146,7 @@ def on_vcall(ident) :vcall end - { type: type, body: [ident], loc: ident[:loc] } + { type: type, value: value, loc: value[:loc] } end # void_stmt is a special kind of parser event that represents an empty lexical diff --git a/src/types/ruby.ts b/src/types/ruby.ts index e9b2e3f8..8bb9fd2a 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -136,7 +136,7 @@ export type MrhsNewFromArgs = ParserEvent<"mrhs_new_from_args", { body: [Args | export type Case = ParserEvent<"case", { value: AnyNode, consequent: In | When }>; export type Else = ParserEvent<"else", { stmts: Stmts }>; export type Elsif = ParserEvent<"elsif", { predicate: AnyNode, stmts: Stmts, consequent: null | Elsif | Else }>; -export type Ensure = ParserEvent<"ensure", { body: [Keyword, Stmts] }>; +export type Ensure = ParserEvent<"ensure", { keyword: Keyword, stmts: Stmts }>; export type For = ParserEvent<"for", { body: [Mlhs | MlhsAddStar | VarField, AnyNode, Stmts] }>; export type If = ParserEvent<"if", { body: [AnyNode, Stmts, null | Elsif | Else] }>; export type IfModifier = ParserEvent<"if_mod", { body: [AnyNode, AnyNode] }>; @@ -191,10 +191,10 @@ export type Call = ParserEvent<"call", { body: [AnyNode, CallOperator, Backtick export type Command = ParserEvent<"command", { message: Const | Identifier, args: Args | ArgsAddBlock }>; export type CommandCall = ParserEvent<"command_call", { receiver: AnyNode, operator: CallOperator, message: Op | Identifier | Const, args: Args | ArgsAddBlock }>; export type DoBlock = ParserEvent<"do_block", { keyword: Keyword, block_var: null | BlockVar, bodystmt: Bodystmt }>; -export type Fcall = ParserEvent<"fcall", { body: [Const | Identifier] }>; +export type Fcall = ParserEvent<"fcall", { value: Const | Identifier }>; export type MethodAddArg = ParserEvent<"method_add_arg", { body: [Call | Fcall, Args | ArgParen | ArgsAddBlock] }>; export type MethodAddBlock = ParserEvent<"method_add_block", { body: [AnyNode, BraceBlock | DoBlock] }>; -export type VCall = ParserEvent<"vcall", { body: [Identifier] }>; +export type VCall = ParserEvent<"vcall", { value: Identifier }>; // These are various parser events for statements you would find in a method body. type Dot = { left: AnyNode, right: AnyNode } | { left: null, right: AnyNode } | { left: AnyNode, right: null }; @@ -213,7 +213,7 @@ export type Unary = ParserEvent<"unary", { body: [AnyNode], oper: string, paren: export type VarRef = ParserEvent<"var_ref", { value: Const | CVar | GVar | Identifier | IVar | Keyword }>; // These are various parser events for statements you would find in a class definition body. -export type AccessCtrl = ParserEvent<"access_ctrl", { body: [Identifier] }>; +export type AccessCtrl = ParserEvent<"access_ctrl", { value: Identifier }>; export type Alias = ParserEvent<"alias", { left: DynaSymbol | SymbolLiteral, right: DynaSymbol | SymbolLiteral }>; export type Class = ParserEvent<"class", { constant: ConstPathRef | ConstRef | TopConstRef, superclass: null | AnyNode, bodystmt: Bodystmt }>; export type Module = ParserEvent<"module", { constant: ConstPathRef | ConstRef | TopConstRef, bodystmt: Bodystmt }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index e1c3dc66..81f19fcd 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -6,6 +6,8 @@ function getChildNodes(node: Ruby.AnyNode): (Ruby.AnyNode | null)[] { return [node.lbrace, node.stmts]; case "END": return [node.lbrace, node.stmts]; + case "access_ctrl": + return [node.value]; case "alias": return [node.left, node.right]; case "aref": @@ -68,6 +70,12 @@ function getChildNodes(node: Ruby.AnyNode): (Ruby.AnyNode | null)[] { return [node.stmts]; case "elsif": return [node.predicate, node.stmts, node.consequent]; + case "ensure": + return [node.keyword, node.stmts]; + case "excessed_comma": + return []; + case "fcall": + return [node.value]; case "hash": return [node.contents]; case "module": @@ -94,6 +102,8 @@ function getChildNodes(node: Ruby.AnyNode): (Ruby.AnyNode | null)[] { return [node.value]; case "var_ref": return [node.value]; + case "vcall": + return [node.value]; case "heredoc": From 3b25e540e520ab1b4607a3a16f07635bde8c4737 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 29 Oct 2021 15:52:11 -0400 Subject: [PATCH 372/785] call, field --- src/ruby/nodes/calls.ts | 22 ++++++++++------------ src/ruby/nodes/constants.ts | 4 ++-- src/ruby/parser.rb | 22 +++++++++++++++------- src/ruby/toProc.ts | 20 +++++++++----------- src/types/ruby.ts | 4 ++-- src/utils/getChildNodes.ts | 27 ++++++++++++++++++++++++++- src/utils/makeCall.ts | 11 ++--------- src/utils/skipAssignIndent.ts | 2 +- 8 files changed, 67 insertions(+), 45 deletions(-) diff --git a/src/ruby/nodes/calls.ts b/src/ruby/nodes/calls.ts index d8389bdb..d70592a5 100644 --- a/src/ruby/nodes/calls.ts +++ b/src/ruby/nodes/calls.ts @@ -25,15 +25,14 @@ type ChainedMethodAddBlock = Ruby.MethodAddBlock & Chain; export const printCall: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); - const [receiverNode, , messageNode] = node.body; - const receiverDoc = path.call(print, "body", 0); + const receiverDoc = path.call(print, "receiver"); const operatorDoc = makeCall(path, opts, print); // You can call lambdas with a special syntax that looks like func.(*args). // In this case, "call" is returned for the 3rd child node. We don't alter // call syntax so if `call` is implicit, we don't print it out. - const messageDoc = messageNode === "call" ? "" : path.call(print, "body", 2); + const messageDoc = node.message === "call" ? "" : path.call(print, "message"); // Create some arrays that are going to represent each side of our call. let leftSideDoc = [receiverDoc]; @@ -49,8 +48,7 @@ export const printCall: Plugin.Printer = (path, opts, print) => { // // In the case we need to group the receiver and the operator together or // we'll end up with a syntax error. - const operatorIsTrailing = - messageNode !== "call" && hasLeadingComments(messageNode); + const operatorIsTrailing = node.message !== "call" && hasLeadingComments(node.message); if (operatorIsTrailing) { leftSideDoc = [receiverDoc, operatorDoc]; @@ -59,14 +57,14 @@ export const printCall: Plugin.Printer = (path, opts, print) => { // For certain left sides of the call nodes, we want to attach directly to // the } or end. - if (noIndent.includes(receiverNode.type)) { + if (noIndent.includes(node.receiver.type)) { return [leftSideDoc, rightSideDoc]; } if ( - receiverNode.type === "call" && - receiverNode.body[2] !== "call" && - receiverNode.body[2].body === "where" && + node.receiver.type === "call" && + node.receiver.message !== "call" && + node.receiver.message.body === "where" && messageDoc === "not" ) { // This is very specialized behavior wherein we group .where.not calls @@ -74,7 +72,7 @@ export const printCall: Plugin.Printer = (path, opts, print) => { // https://github.com/prettier/plugin-ruby/issues/862. } else { // Otherwise, we're going to put a line node into the right side doc. - rightSideDoc.unshift(receiverNode.comments ? hardline : softline); + rightSideDoc.unshift(node.receiver.comments ? hardline : softline); } // Get a reference to the parent node so we can check if we're inside a chain @@ -85,7 +83,7 @@ export const printCall: Plugin.Printer = (path, opts, print) => { if (chained.includes(parentNode.type) && !node.comments) { parentNode.chain = (node.chain || 0) + 1; parentNode.callChain = (node.callChain || 0) + 1; - parentNode.firstReceiverType = node.firstReceiverType || receiverNode.type; + parentNode.firstReceiverType = node.firstReceiverType || node.receiver.type; // Here we're going to determine what doc nodes to send up to the parent // node to represent when we're in the multi-line form. @@ -158,7 +156,7 @@ export const printMethodAddArg: Plugin.Printer = ( // example, if you call something like Foo.new.() (implicitly calling the // #call method on a new instance of the Foo class), then we have to print // out those parentheses, otherwise we'll end up with Foo.new. - if (methodNode.type === "call" && methodNode.body[2] === "call") { + if (methodNode.type === "call" && methodNode.message === "call") { return [methodDoc, "()"]; } diff --git a/src/ruby/nodes/constants.ts b/src/ruby/nodes/constants.ts index 790c954c..f011fc98 100644 --- a/src/ruby/nodes/constants.ts +++ b/src/ruby/nodes/constants.ts @@ -24,9 +24,9 @@ export const printDefined: Plugin.Printer = ( export const printField: Plugin.Printer = (path, opts, print) => { return group([ - path.call(print, "body", 0), + path.call(print, "parent"), makeCall(path, opts, print), - path.call(print, "body", 2) + path.call(print, "name") ]); }; diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 448a5710..28ef72ec 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -825,15 +825,15 @@ def on_break(args) # the receiver (which can be another nested call as well). # # There is one esoteric syntax that comes into play here as well. If the - # sending argument to this method is the symbol :call, then it represents + # message argument to this method is the symbol :call, then it represents # calling a lambda in a very odd looking way, as in: # # foo.(1, 2, 3) # - def on_call(receiver, operator, sending) - ending = sending + def on_call(receiver, operator, message) + ending = message - if sending == :call + if message == :call ending = operator # Special handling here for Ruby <= 2.5 because the operator argument to @@ -843,7 +843,9 @@ def on_call(receiver, operator, sending) { type: :call, - body: [receiver, operator, sending], + receiver: receiver, + operator: operator, + message: message, loc: Location.new( start_line: receiver[:loc].start_line, @@ -1450,8 +1452,14 @@ def on_fcall(value) # # foo.x = 1 # - def on_field(left, oper, right) - { type: :field, body: [left, oper, right], loc: left[:loc].to(right[:loc]) } + def on_field(parent, operator, name) + { + type: :field, + parent: parent, + operator: operator, + name: name, + loc: parent[:loc].to(name[:loc]) + } end # float is a scanner event that represents a floating point value literal. diff --git a/src/ruby/toProc.ts b/src/ruby/toProc.ts index 8c3f0499..ff7f40be 100644 --- a/src/ruby/toProc.ts +++ b/src/ruby/toProc.ts @@ -1,6 +1,6 @@ import type { Plugin, Ruby } from "../types"; -function isCall(node: Ruby.CallOperator) { +function isPeriod(node: Ruby.CallOperator) { // Older versions of Ruby didn't have a @period ripper event, so we need to // explicitly cast to any here. if (node === "::" || (node as any) === ".") { @@ -61,20 +61,18 @@ function toProc( } // Ensure that statement is a call and that it has no comments attached - const [statement] = statements; - if (statement.type !== "call" || statement.comments) { + const [call] = statements; + if (call.type !== "call" || call.comments) { return null; } // Ensure the call is a method of the block argument - const [varRef, call, method] = statement.body; - if ( - varRef.type !== "var_ref" || - varRef.value.body !== reqParams[0].body || - !isCall(call) || - method === "call" || - method.type !== "@ident" + call.receiver.type !== "var_ref" || + call.receiver.value.body !== reqParams[0].body || + !isPeriod(call.operator) || + call.message === "call" || + call.message.type !== "@ident" ) { return null; } @@ -106,7 +104,7 @@ function toProc( } } - return `&:${method.body}`; + return `&:${call.message.body}`; } export default toProc; diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 8bb9fd2a..91cd9059 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -117,7 +117,7 @@ type Assignable = ArefField | ConstPathField | Field | TopConstField | VarField; export type ArefField = ParserEvent<"aref_field", { collection: AnyNode, index: ArgsAddBlock | null }>; export type Assign = ParserEvent<"assign", { target: Assignable, value: AnyNode }>; export type ConstPathField = ParserEvent<"const_path_field", { parent: ConstPathRef | Paren | TopConstRef | VarRef, constant: Const }>; -export type Field = ParserEvent<"field", { body: [AnyNode, CallOperator, Const | Identifier] }>; +export type Field = ParserEvent<"field", { parent: AnyNode, operator: CallOperator, name: Const | Identifier }>; export type Opassign = ParserEvent<"opassign", { target: Assignable, operator: Op, value: AnyNode }>; export type TopConstField = ParserEvent<"top_const_field", { constant: Const }>; export type VarField = ParserEvent<"var_field", { value: null | Const | CVar | GVar | Identifier | IVar }>; @@ -187,7 +187,7 @@ export type ArgsAddBlock = ParserEvent<"args_add_block", { body: [Args | ArgsAdd export type ArgsAddStar = ParserEvent<"args_add_star", { body: [Args | ArgsAddStar, ...AnyNode[]] }>; export type BlockVar = ParserEvent<"block_var", { params: Params, locals: Identifier[] }>; export type BraceBlock = ParserEvent<"brace_block", { lbrace: Lbrace, block_var: null | BlockVar, stmts: Stmts }>; -export type Call = ParserEvent<"call", { body: [AnyNode, CallOperator, Backtick | Op | Identifier | Const | "call"] }>; +export type Call = ParserEvent<"call", { receiver: AnyNode, operator: CallOperator, message: Backtick | Op | Identifier | Const | "call" }>; export type Command = ParserEvent<"command", { message: Const | Identifier, args: Args | ArgsAddBlock }>; export type CommandCall = ParserEvent<"command_call", { receiver: AnyNode, operator: CallOperator, message: Op | Identifier | Const, args: Args | ArgsAddBlock }>; export type DoBlock = ParserEvent<"do_block", { keyword: Keyword, block_var: null | BlockVar, bodystmt: Bodystmt }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 81f19fcd..38ddad02 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -1,6 +1,8 @@ import type { Ruby } from "../types"; -function getChildNodes(node: Ruby.AnyNode): (Ruby.AnyNode | null)[] { +type ChildNode = Ruby.AnyNode | null; + +function getChildNodes(node: Ruby.AnyNode): ChildNode[] { switch (node.type) { case "BEGIN": return [node.lbrace, node.stmts]; @@ -36,6 +38,19 @@ function getChildNodes(node: Ruby.AnyNode): (Ruby.AnyNode | null)[] { return [node.lbrace, node.block_var, node.stmts]; case "break": return [node.args]; + case "call": { + const childNodes: ChildNode[] = [node.receiver]; + + if (node.operator !== "::") { + childNodes.push(node.operator); + } + + if (node.message !== "call") { + childNodes.push(node.message); + } + + return childNodes; + } case "case": return [node.value, node.consequent]; case "class": @@ -76,6 +91,16 @@ function getChildNodes(node: Ruby.AnyNode): (Ruby.AnyNode | null)[] { return []; case "fcall": return [node.value]; + case "field": { + const childNodes: ChildNode[] = [node.parent]; + + if (node.operator !== "::") { + childNodes.push(node.operator); + } + + childNodes.push(node.name); + return childNodes; + } case "hash": return [node.contents]; case "module": diff --git a/src/utils/makeCall.ts b/src/utils/makeCall.ts index b6b6585e..fbed2400 100644 --- a/src/utils/makeCall.ts +++ b/src/utils/makeCall.ts @@ -4,7 +4,7 @@ type Callable = Ruby.Call | Ruby.CommandCall | Ruby.Field; const makeCall: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); - const operator = node.type === "command_call" ? node.operator : node.body[1]; + const operator = node.operator; // Ignoring the next block for coverage information because it's only relevant // in Ruby 2.5 and below. @@ -13,14 +13,7 @@ const makeCall: Plugin.Printer = (path, opts, print) => { return operator as Plugin.Doc; } - if (operator === "::") { - return "."; - } else if (node.type === "command_call") { - return path.call(print, "operator"); - } else { - const nodePath = path as Plugin.Path; - return nodePath.call(print, "body", 1); - } + return operator === "::" ? "." : path.call(print, "operator"); }; export default makeCall; diff --git a/src/utils/skipAssignIndent.ts b/src/utils/skipAssignIndent.ts index e9a3f8b7..e7cd2fa9 100644 --- a/src/utils/skipAssignIndent.ts +++ b/src/utils/skipAssignIndent.ts @@ -12,7 +12,7 @@ const skippable = [ function skipAssignIndent(node: Ruby.AnyNode): boolean { return ( skippable.includes(node.type) || - (node.type === "call" && skipAssignIndent(node.body[0])) + (node.type === "call" && skipAssignIndent(node.receiver)) ); } From cd55d797dc67a43bde17433f9f130656c9c2dfc3 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 29 Oct 2021 16:07:36 -0400 Subject: [PATCH 373/785] aryptn, fndptn, hshptn --- src/ruby/nodes/patterns.ts | 48 +++++++++++++++++++------------------- src/ruby/parser.rb | 26 ++++++++++++++------- src/types/ruby.ts | 6 ++--- src/utils/getChildNodes.ts | 32 ++++++++++++------------- 4 files changed, 59 insertions(+), 53 deletions(-) diff --git a/src/ruby/nodes/patterns.ts b/src/ruby/nodes/patterns.ts index 33388357..2ee7fe4c 100644 --- a/src/ruby/nodes/patterns.ts +++ b/src/ruby/nodes/patterns.ts @@ -20,21 +20,21 @@ const printPatternArg: Plugin.Printer = (path, opts, print) => { }; export const printAryPtn: Plugin.Printer = (path, opts, print) => { - const [constant, preargs, splatarg, postargs] = path.getValue().body; + const node = path.getValue(); let argDocs: Plugin.Doc[] = []; - if (preargs) { + if (node.reqs.length > 0) { argDocs = argDocs.concat( - path.map((argPath) => printPatternArg(argPath, opts, print), "body", 1) + path.map((argPath) => printPatternArg(argPath, opts, print), "reqs") ); } - if (splatarg) { - argDocs.push(["*", path.call(print, "body", 2)]); + if (node.rest) { + argDocs.push(["*", path.call(print, "rest")]); } - if (postargs) { - argDocs = argDocs.concat(path.map(print, "body", 3)); + if (node.posts.length > 0) { + argDocs = argDocs.concat(path.map(print, "posts")); } let argDoc: Plugin.Doc = group(join([",", line], argDocs)); @@ -51,48 +51,48 @@ export const printAryPtn: Plugin.Printer = (path, opts, print) => { // `in key: [first, second]`. if ( argDocs.length === 1 || - constant || + node.constant || patterns.includes(path.getParentNode().type) ) { argDoc = ["[", argDoc, "]"]; } - if (constant) { - return [path.call(print, "body", 0), argDoc]; + if (node.constant) { + return [path.call(print, "constant"), argDoc]; } return argDoc; }; export const printFndPtn: Plugin.Printer = (path, opts, print) => { - const [constant] = path.getValue().body; + const node = path.getValue(); const docs = [ "[", group( join( [",", line], [ - ["*", path.call(print, "body", 1)], - ...path.map(print, "body", 2), - ["*", path.call(print, "body", 3)] + ["*", path.call(print, "left")], + ...path.map(print, "values"), + ["*", path.call(print, "right")] ] ) ), "]" ]; - if (constant) { - return [path.call(print, "body", 0), docs]; + if (node.constant) { + return [path.call(print, "constant"), docs]; } return docs; }; export const printHshPtn: Plugin.Printer = (path, opts, print) => { - const [constant, keyValuePairs, keyValueRest] = path.getValue().body; + const node = path.getValue(); let args: Plugin.Doc | Plugin.Doc[] = []; - if (keyValuePairs.length > 0) { + if (node.keywords.length > 0) { const printPair = (pairPath: Plugin.Path<[Ruby.Label, Ruby.AnyNode]>) => { const parts = [pairPath.call(print, 0)]; @@ -109,23 +109,23 @@ export const printHshPtn: Plugin.Printer = (path, opts, print) => { return parts; }; - args = args.concat(path.map(printPair, "body", 1)); + args = args.concat(path.map(printPair, "keywords")); } - if (keyValueRest) { - args.push(["**", path.call(print, "body", 2)]); + if (node.kwrest) { + args.push(["**", path.call(print, "kwrest")]); } args = group(join([",", line], args)); - if (constant) { + if (node.constant) { args = ["[", args, "]"]; } else if (patterns.includes(path.getParentNode().type)) { args = ["{ ", args, " }"]; } - if (constant) { - return [path.call(print, "body", 0), args]; + if (node.constant) { + return [path.call(print, "constant"), args]; } return args; diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 28ef72ec..03b33651 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -568,12 +568,15 @@ def on_array(contents) # aryptn is a parser event that represents matching against an array pattern # using the Ruby 2.7+ pattern matching syntax. - def on_aryptn(const, preargs, splatarg, postargs) - pieces = [const, *preargs, splatarg, *postargs].compact + def on_aryptn(constant, reqs, rest, posts) + pieces = [constant, *reqs, rest, *posts].compact { type: :aryptn, - body: [const, preargs, splatarg, postargs], + constant: constant, + reqs: reqs || [], + rest: rest, + posts: posts || [], loc: pieces[0][:loc].to(pieces[-1][:loc]) } end @@ -1476,13 +1479,16 @@ def on_float(value) # fndptn is a parser event that represents matching against a pattern where # you find a pattern in an array using the Ruby 3.0+ pattern matching syntax. - def on_fndptn(const, presplat, args, postsplat) - beging = const || find_scanner_event(:@lbracket) + def on_fndptn(constant, left, values, right) + beging = constant || find_scanner_event(:@lbracket) ending = find_scanner_event(:@rbracket) { type: :fndptn, - body: [const, presplat, args, postsplat], + constant: constant, + left: left, + values: values, + right: right, loc: beging[:loc].to(ending[:loc]) } end @@ -1600,12 +1606,14 @@ def on_heredoc_end(ending) # hshptn is a parser event that represents matching against a hash pattern # using the Ruby 2.7+ pattern matching syntax. - def on_hshptn(const, kw, kwrest) - pieces = [const, kw, kwrest].flatten(2).compact + def on_hshptn(constant, keywords, kwrest) + pieces = [constant, keywords, kwrest].flatten(2).compact { type: :hshptn, - body: [const, kw, kwrest], + constant: constant, + keywords: keywords, + kwrest: kwrest, loc: pieces[0][:loc].to(pieces[-1][:loc]) } end diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 91cd9059..73e5e226 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -161,9 +161,9 @@ export type Super = ParserEvent<"super", { body: [Args | ArgParen | ArgsAddBlock export type Yield = ParserEvent<"yield", { body: [ArgsAddBlock | Paren] }>; // These are various parser events for pattern matching. -export type Aryptn = ParserEvent<"aryptn", { body: [null | VarRef, AnyNode[], null | VarField, null | AnyNode[]] }>; -export type FndPtn = ParserEvent<"fndptn", { body: [null | AnyNode, VarField, AnyNode[], VarField] }>; -export type Hshptn = ParserEvent<"hshptn", { body: [null | AnyNode, [Label, AnyNode][], null | VarField] }>; +export type Aryptn = ParserEvent<"aryptn", { constant: null | VarRef, reqs: AnyNode[], rest: null | VarField, posts: AnyNode[] }>; +export type FndPtn = ParserEvent<"fndptn", { constant: null | AnyNode, left: VarField, values: AnyNode[], right: VarField }>; +export type Hshptn = ParserEvent<"hshptn", { constant: null | AnyNode, keywords: [Label, AnyNode][], kwrest: null | VarField }>; export type Rassign = ParserEvent<"rassign", { value: AnyNode, operator: Op | Keyword, pattern: AnyNode }>; // These are various parser events for method declarations. diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 38ddad02..d5d70fda 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -16,6 +16,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.collection, node.index]; case "aref_field": return [node.collection, node.index]; + case "aryptn": + return [node.constant, ...node.reqs, node.rest, ...node.posts]; case "assign": return [node.target, node.value]; case "assoc_new": @@ -101,8 +103,20 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { childNodes.push(node.name); return childNodes; } + case "fndptn": + return [node.constant, node.left, ...node.values, node.right]; case "hash": return [node.contents]; + case "hshptn": { + const childNodes: ChildNode[] = [node.constant]; + + node.keywords.forEach(([key, value]) => { + childNodes.push(key, value); + }); + + childNodes.push(node.kwrest); + return childNodes; + } case "module": return [node.constant, node.bodystmt]; case "next": @@ -131,25 +145,9 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.value]; + case "heredoc": return [node.beging]; - case "aryptn": { - const parts: (Ruby.AnyNode | null)[] = [node.body[0]]; - - return parts - .concat(node.body[1]) - .concat(node.body[2]) - .concat(node.body[3]); - } - case "hshptn": { - const pairs = node.body[1]; - const values = pairs.reduce( - (left: any, right: any) => left.concat(right), - [] - ); - - return [node.body[0]].concat(values).concat(node.body[2]); - } case "params": { const [reqs, optls, rest, post, kwargs, kwargRest, block] = node.body; let parts: (Ruby.AnyNode | null)[] = reqs || []; From 572947e016e26c2f4afa369790dc4a8b009ab894 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 29 Oct 2021 16:25:51 -0400 Subject: [PATCH 374/785] for, until, until_mod, while, while_mod --- src/ruby/nodes.ts | 6 ++-- src/ruby/nodes/loops.ts | 56 +++++++++++++++++++------------------- src/ruby/parser.rb | 22 +++++++++------ src/types/ruby.ts | 10 +++---- src/utils/getChildNodes.ts | 10 +++++++ 5 files changed, 59 insertions(+), 45 deletions(-) diff --git a/src/ruby/nodes.ts b/src/ruby/nodes.ts index 6cd10214..6a64da45 100644 --- a/src/ruby/nodes.ts +++ b/src/ruby/nodes.ts @@ -56,9 +56,7 @@ import { printLambda } from "./nodes/lambdas"; import { printFor, printUntil, - printUntilModifer, printWhile, - printWhileModifier } from "./nodes/loops"; import { printMAssign, @@ -233,14 +231,14 @@ const nodes: Partial<{ unless: printUnless, unless_mod: printUnlessModifier, until: printUntil, - until_mod: printUntilModifer, + until_mod: printUntil, var_alias: printAlias, var_field: printVarField, var_ref: printVarRef, vcall: printCallContainer, when: printWhen, while: printWhile, - while_mod: printWhileModifier, + while_mod: printWhile, word: printWord, xstring_literal: printXStringLiteral, yield: printYield, diff --git a/src/ruby/nodes/loops.ts b/src/ruby/nodes/loops.ts index 7be9f9dc..08e48ff2 100644 --- a/src/ruby/nodes/loops.ts +++ b/src/ruby/nodes/loops.ts @@ -9,30 +9,29 @@ import { const { align, breakParent, group, hardline, ifBreak, indent, join, softline } = prettier; -function printLoop( - keyword: string, - modifier: boolean -): Plugin.Printer< - Ruby.While | Ruby.WhileModifier | Ruby.Until | Ruby.UntilModifier -> { +type Loop = Ruby.While | Ruby.WhileModifier | Ruby.Until | Ruby.UntilModifier; + +function isModifier(node: Loop): node is Ruby.WhileModifier | Ruby.UntilModifier { + return node.type === "while_mod" || node.type === "until_mod"; +} + +function printLoop(keyword: string): Plugin.Printer { return function printLoopWithOptions(path, { rubyModifier }, print) { - const [, stmts] = path.getValue().body; + const node = path.getValue(); // If the only statement inside this while loop is a void statement, then we // can shorten to just displaying the predicate and then a semicolon. - if (isEmptyStmts(stmts)) { + if (!isModifier(node) && isEmptyStmts(node.stmts)) { return group([ - group([keyword, " ", path.call(print, "body", 0)]), + group([keyword, " ", path.call(print, "predicate")]), hardline, "end" ]); } - const inlineLoop = inlineEnsureParens(path, [ - path.call(print, "body", 1), - ` ${keyword} `, - path.call(print, "body", 0) - ]); + const statementDoc = path.call(print, isModifier(node) ? "stmt" : "stmts"); + const predicateDoc = path.call(print, "predicate"); + const inlineLoop = inlineEnsureParens(path, [statementDoc, ` ${keyword} `, predicateDoc]); // If we're in the modifier form and we're modifying a `begin`, then this is // a special case where we need to explicitly use the modifier form because @@ -44,13 +43,13 @@ function printLoop( // // The above is effectively a `do...while` loop (which we don't have in // ruby). - if (modifier && path.getValue().body[1].type === "begin") { + if (isModifier(node) && node.stmt.type === "begin") { return inlineLoop; } const blockLoop = [ - [`${keyword} `, align(keyword.length + 1, path.call(print, "body", 0))], - indent([softline, path.call(print, "body", 1)]), + [`${keyword} `, align(keyword.length + 1, predicateDoc)], + indent([softline, statementDoc]), softline, "end" ]; @@ -59,7 +58,7 @@ function printLoop( // contains an assignment (in which case we can't know for certain that that // assignment doesn't impact the statements inside the loop) then we can't // use the modifier form and we must use the block form. - if (!rubyModifier || containsAssignment(path.getValue().body[0])) { + if (!rubyModifier || containsAssignment(node.predicate)) { return [breakParent, blockLoop]; } @@ -68,22 +67,23 @@ function printLoop( } export const printFor: Plugin.Printer = (path, opts, print) => { - const [varDoc, rangeDoc, stmtsDoc] = path.map(print, "body"); - const varsDoc = - path.getValue().body[0].type === "mlhs" ? join(", ", varDoc) : varDoc; + const node = path.getValue(); + + let iteratorDoc = path.call(print, "iterator"); + if (node.iterator.type === "mlhs") { + iteratorDoc = join(", ", iteratorDoc); + } return group([ "for ", - varsDoc, + iteratorDoc, " in ", - rangeDoc, - indent([hardline, stmtsDoc]), + path.call(print, "enumerable"), + indent([hardline, path.call(print, "stmts")]), hardline, "end" ]); }; -export const printWhile = printLoop("while", false); -export const printWhileModifier = printLoop("while", true); -export const printUntil = printLoop("until", false); -export const printUntilModifer = printLoop("until", true); +export const printWhile = printLoop("while"); +export const printUntil = printLoop("until"); diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 03b33651..36511bdd 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -1497,23 +1497,25 @@ def on_fndptn(constant, left, values, right) # loop. It accepts as arguments an ident which is the iterating variable, # an enumerable for that which is being enumerated, and a stmts event that # represents the statements inside the for loop. - def on_for(ident, enum, stmts) + def on_for(iterator, enumerable, stmts) beging = find_scanner_event(:@kw, 'for') ending = find_scanner_event(:@kw, 'end') # Consume the do keyword if it exists so that it doesn't get confused for # some other block do_event = find_scanner_event(:@kw, 'do', consume: false) - if do_event && do_event[:loc].start_char > enum[:loc].end_char && + if do_event && do_event[:loc].start_char > enumerable[:loc].end_char && do_event[:loc].end_char < ending[:loc].start_char scanner_events.delete(do_event) end - stmts.bind((do_event || enum)[:loc].end_char, ending[:loc].start_char) + stmts.bind((do_event || enumerable)[:loc].end_char, ending[:loc].start_char) { type: :for, - body: [ident, enum, stmts], + iterator: iterator, + enumerable: enumerable, + stmts: stmts, loc: beging[:loc].to(ending[:loc]) } end @@ -3082,7 +3084,8 @@ def on_until(predicate, stmts) { type: :until, - body: [predicate, stmts], + predicate: predicate, + stmts: stmts, loc: beging[:loc].to(ending[:loc]) } end @@ -3095,7 +3098,8 @@ def on_until_mod(predicate, statement) { type: :until_mod, - body: [predicate, statement], + predicate: predicate, + stmt: statement, loc: statement[:loc].to(predicate[:loc]) } end @@ -3212,7 +3216,8 @@ def on_while(predicate, stmts) { type: :while, - body: [predicate, stmts], + predicate: predicate, + stmts: stmts, loc: beging[:loc].to(ending[:loc]) } end @@ -3225,7 +3230,8 @@ def on_while_mod(predicate, statement) { type: :while_mod, - body: [predicate, statement], + predicate: predicate, + stmt: statement, loc: statement[:loc].to(predicate[:loc]) } end diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 73e5e226..6ddc0233 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -137,7 +137,7 @@ export type Case = ParserEvent<"case", { value: AnyNode, consequent: In | When } export type Else = ParserEvent<"else", { stmts: Stmts }>; export type Elsif = ParserEvent<"elsif", { predicate: AnyNode, stmts: Stmts, consequent: null | Elsif | Else }>; export type Ensure = ParserEvent<"ensure", { keyword: Keyword, stmts: Stmts }>; -export type For = ParserEvent<"for", { body: [Mlhs | MlhsAddStar | VarField, AnyNode, Stmts] }>; +export type For = ParserEvent<"for", { iterator: Mlhs | MlhsAddStar | VarField, enumerable: AnyNode, stmts: Stmts }>; export type If = ParserEvent<"if", { body: [AnyNode, Stmts, null | Elsif | Else] }>; export type IfModifier = ParserEvent<"if_mod", { body: [AnyNode, AnyNode] }>; export type In = ParserEvent<"in", { body: [AnyNode, Stmts, null | In | Else] }>; @@ -147,11 +147,11 @@ export type RescueModifier = ParserEvent<"rescue_mod", { body: [AnyNode, AnyNode export type Ternary = ParserEvent<"ifop", { body: [AnyNode, AnyNode, AnyNode] }>; export type Unless = ParserEvent<"unless", { body: [AnyNode, Stmts, null | Elsif | Else] }>; export type UnlessModifier = ParserEvent<"unless_mod", { body: [AnyNode, AnyNode] }>; -export type Until = ParserEvent<"until", { body: [AnyNode, Stmts] }>; -export type UntilModifier = ParserEvent<"until_mod", { body: [AnyNode, AnyNode] }>; +export type Until = ParserEvent<"until", { predicate: AnyNode, stmts: Stmts }>; +export type UntilModifier = ParserEvent<"until_mod", { predicate: AnyNode, stmt: AnyNode }>; export type When = ParserEvent<"when", { body: [Args | ArgsAddStar, Stmts, null | Else | When] }>; -export type While = ParserEvent<"while", { body: [AnyNode, Stmts] }>; -export type WhileModifier = ParserEvent<"while_mod", { body: [AnyNode, AnyNode] }>; +export type While = ParserEvent<"while", { predicate: AnyNode, stmts: Stmts }>; +export type WhileModifier = ParserEvent<"while_mod", { predicate: AnyNode, stmt: AnyNode }>; // These are various parser events for control flow keywords. export type Break = ParserEvent<"break", { args: Args | ArgsAddBlock }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index d5d70fda..89accdaf 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -105,6 +105,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { } case "fndptn": return [node.constant, node.left, ...node.values, node.right]; + case "for": + return [node.iterator, node.enumerable, node.stmts]; case "hash": return [node.contents]; case "hshptn": { @@ -135,6 +137,10 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.constant]; case "top_const_ref": return [node.constant]; + case "until": + return [node.predicate, node.stmts]; + case "until_mod": + return [node.predicate, node.stmt]; case "var_alias": return [node.left, node.right]; case "var_field": @@ -143,6 +149,10 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.value]; case "vcall": return [node.value]; + case "while": + return [node.predicate, node.stmts]; + case "while_mod": + return [node.predicate, node.stmt]; From a16eeae45663ccfefcd6658f3f624e0e0921e27b Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 29 Oct 2021 17:03:53 -0400 Subject: [PATCH 375/785] if, ifop, if_mod, unless, unless_mod --- src/ruby/nodes/case.ts | 2 +- src/ruby/nodes/conditionals.ts | 106 ++++++++++++++++----------------- src/ruby/nodes/loops.ts | 6 +- src/ruby/parser.rb | 32 ++++++---- src/types/ruby.ts | 22 +++---- src/utils/getChildNodes.ts | 22 +++++-- 6 files changed, 103 insertions(+), 87 deletions(-) diff --git a/src/ruby/nodes/case.ts b/src/ruby/nodes/case.ts index ea90bf06..aec0d8cd 100644 --- a/src/ruby/nodes/case.ts +++ b/src/ruby/nodes/case.ts @@ -12,7 +12,7 @@ export const printCase: Plugin.Printer = (path, opts, print) => { parts.push(" ", path.call(print, "value")); } - return [...parts, hardline, path.call(print, "consequent"), hardline, "end"]; + return [...parts, hardline, path.call(print, "cons"), hardline, "end"]; }; export const printWhen: Plugin.Printer = (path, opts, print) => { diff --git a/src/ruby/nodes/conditionals.ts b/src/ruby/nodes/conditionals.ts index 0dcb83dd..e56dcd15 100644 --- a/src/ruby/nodes/conditionals.ts +++ b/src/ruby/nodes/conditionals.ts @@ -25,9 +25,9 @@ function containsSingleConditional(stmts: Ruby.Stmts) { function printWithAddition(keyword: string, path: Plugin.Path, print: Plugin.Print, breaking: boolean) { return [ `${keyword} `, - align(keyword.length + 1, path.call(print, "body", 0)), - indent([softline, path.call(print, "body", 1)]), - [softline, path.call(print, "body", 2)], + align(keyword.length + 1, path.call(print, "pred")), + indent([softline, path.call(print, "stmts")]), + [softline, path.call(print, "cons")], [softline, "end"], breaking ? breakParent : "" ]; @@ -78,35 +78,38 @@ export const printTernary: Plugin.Printer = ( _opts, print ) => { - const [predicate, truthyClause, falsyClause] = path.map(print, "body"); - const ternaryClauses = printTernaryClauses("if", truthyClause, falsyClause); + const predicateDoc = path.call(print, "pred"); + const truthyDoc = path.call(print, "tthy"); + const falsyDoc = path.call(print, "flsy"); return group( ifBreak( [ "if ", - align(3, predicate), - indent([softline, truthyClause]), + align(3, predicateDoc), + indent([softline, truthyDoc]), [softline, "else"], - indent([softline, falsyClause]), + indent([softline, falsyDoc]), [softline, "end"] ], - [predicate, " ? ", ...ternaryClauses] + [predicateDoc, " ? ", ...printTernaryClauses("if", truthyDoc, falsyDoc)] ) ); }; +function isModifier(node: Conditional | Ruby.IfModifier | Ruby.UnlessModifier): node is Ruby.IfModifier | Ruby.UnlessModifier { + return node.type === "if_mod" || node.type === "unless_mod"; +} + // Prints an `if_mod` or `unless_mod` node. Because it was previously in the // modifier form, we're guaranteed to not have an additional node, so we can // just work with the predicate and the body. -function printSingle( - keyword: string, - modifier = false -): Plugin.Printer { +function printSingle(keyword: string): Plugin.Printer { return function printSingleWithKeyword(path, { rubyModifier }, print) { - const [, statementsNode] = path.getValue().body; - const predicateDoc = path.call(print, "body", 0); - const statementsDoc = path.call(print, "body", 1); + const node = path.getValue(); + + const predicateDoc = path.call(print, "pred"); + const statementsDoc = path.call(print, isModifier(node) ? "stmt" : "stmts"); const multilineParts = [ `${keyword} `, @@ -121,24 +124,24 @@ function printSingle( // multiline form. if ( !rubyModifier || - (!modifier && (statementsNode as Conditional).body[0].comments) + (!isModifier(node) && node.stmts.body[0].comments) ) { return [multilineParts, breakParent]; } const inline = inlineEnsureParens(path, [ - path.call(print, "body", 1), + statementsDoc, ` ${keyword} `, - path.call(print, "body", 0) + predicateDoc ]); - // An expression with a conditional modifier (expression if true), the + // With an expression with a conditional modifier (expression if true), the // conditional body is parsed before the predicate expression, meaning that // if the parser encountered a variable declaration, it would initialize // that variable first before evaluating the predicate expression. That // parse order means the difference between a NameError or not. #591 // https://docs.ruby-lang.org/en/2.0.0/syntax/control_expressions_rdoc.html#label-Modifier+if+and+unless - if (modifier && containsAssignment(statementsNode)) { + if (isModifier(node) && containsAssignment(node.stmt)) { return inline; } @@ -203,30 +206,28 @@ function canTernaryStmts(stmts: Ruby.Stmts) { // additional node must have only one statement, and that statement list must // pass the `canTernaryStmts` check. function canTernary(path: Plugin.Path) { - const [predicate, stmts, addition] = path.getValue().body; + const node = path.getValue(); return ( - !["assign", "opassign", "command_call", "command"].includes( - predicate.type - ) && - addition && - addition.type === "else" && - canTernaryStmts(stmts) && - canTernaryStmts(addition.stmts) + !["assign", "opassign", "command_call", "command"].includes(node.pred.type) && + node.cons && + node.cons.type === "else" && + canTernaryStmts(node.stmts) && + canTernaryStmts(node.cons.stmts) ); } // A normalized print function for both `if` and `unless` nodes. function printConditional(keyword: string): Plugin.Printer { - return (path, opts, print) => { + return function printConditionalWithKeyword(path, opts, print) { if (canTernary(path)) { let ternaryParts = [ - path.call(print, "body", 0), + path.call(print, "pred"), " ? ", ...printTernaryClauses( keyword, - path.call(print, "body", 1), - path.call(print, "body", 2, "stmts") + path.call(print, "stmts"), + path.call(print, "cons", "stmts") ) ]; @@ -239,20 +240,20 @@ function printConditional(keyword: string): Plugin.Printer { ); } - const [predicate, statements, addition] = path.getValue().body; + const node = path.getValue(); // If there's an additional clause that wasn't matched earlier, we know we // can't go for the inline option. - if (addition) { + if (node.cons) { return group(printWithAddition(keyword, path, print, true)); } - // If the body of the conditional is empty, then we explicitly have to use the - // block form. - if (isEmptyStmts(statements)) { + // If the body of the conditional is empty, then we explicitly have to use + // the block form. + if (isEmptyStmts(node.stmts)) { return [ `${keyword} `, - align(keyword.length + 1, path.call(print, "body", 0)), + align(keyword.length + 1, path.call(print, "pred")), hardline, "end" ]; @@ -260,19 +261,16 @@ function printConditional(keyword: string): Plugin.Printer { // Two situations in which we need to use the block form: // - // 1. If the predicate of the conditional contains an assignment, then we can't - // know for sure that it doesn't impact the body of the conditional. + // 1. If the predicate of the conditional contains an assignment, then we + // can't know for sure that it doesn't impact the body of the conditional. // - // 2. If the conditional contains just another conditional, then collapsing it - // would result in double modifiers on the same line. - if ( - containsAssignment(predicate) || - containsSingleConditional(statements) - ) { + // 2. If the conditional contains just another conditional, then collapsing + // it would result in double modifiers on the same line. + if (containsAssignment(node.pred) || containsSingleConditional(node.stmts)) { return [ `${keyword} `, - align(keyword.length + 1, path.call(print, "body", 0)), - indent([hardline, path.call(print, "body", 1)]), + align(keyword.length + 1, path.call(print, "pred")), + indent([hardline, path.call(print, "stmts")]), hardline, "end" ]; @@ -297,18 +295,18 @@ export const printElse: Plugin.Printer = (path, opts, print) => { export const printElsif: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); const parts = [ - group(["elsif ", align("elsif".length - 1, path.call(print, "predicate"))]), + group(["elsif ", align("elsif".length - 1, path.call(print, "pred"))]), indent([hardline, path.call(print, "stmts")]) ]; - if (node.consequent) { - parts.push(group([hardline, path.call(print, "consequent")])); + if (node.cons) { + parts.push(group([hardline, path.call(print, "cons")])); } return group(parts); }; export const printIf = printConditional("if"); -export const printIfModifier = printSingle("if", true); +export const printIfModifier = printSingle("if"); export const printUnless = printConditional("unless"); -export const printUnlessModifier = printSingle("unless", true); +export const printUnlessModifier = printSingle("unless"); diff --git a/src/ruby/nodes/loops.ts b/src/ruby/nodes/loops.ts index 08e48ff2..46fe916a 100644 --- a/src/ruby/nodes/loops.ts +++ b/src/ruby/nodes/loops.ts @@ -18,19 +18,19 @@ function isModifier(node: Loop): node is Ruby.WhileModifier | Ruby.UntilModifier function printLoop(keyword: string): Plugin.Printer { return function printLoopWithOptions(path, { rubyModifier }, print) { const node = path.getValue(); + const predicateDoc = path.call(print, "pred"); // If the only statement inside this while loop is a void statement, then we // can shorten to just displaying the predicate and then a semicolon. if (!isModifier(node) && isEmptyStmts(node.stmts)) { return group([ - group([keyword, " ", path.call(print, "predicate")]), + group([keyword, " ", predicateDoc]), hardline, "end" ]); } const statementDoc = path.call(print, isModifier(node) ? "stmt" : "stmts"); - const predicateDoc = path.call(print, "predicate"); const inlineLoop = inlineEnsureParens(path, [statementDoc, ` ${keyword} `, predicateDoc]); // If we're in the modifier form and we're modifying a `begin`, then this is @@ -58,7 +58,7 @@ function printLoop(keyword: string): Plugin.Printer { // contains an assignment (in which case we can't know for certain that that // assignment doesn't impact the statements inside the loop) then we can't // use the modifier form and we must use the block form. - if (!rubyModifier || containsAssignment(node.predicate)) { + if (!rubyModifier || containsAssignment(node.pred)) { return [breakParent, blockLoop]; } diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 36511bdd..868c552a 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -869,7 +869,7 @@ def on_case(value, consequent) { type: :case, value: value, - consequent: consequent, + cons: consequent, loc: keyword[:loc].to(consequent[:loc]) } else @@ -1309,9 +1309,9 @@ def on_elsif(predicate, stmts, consequent) { type: :elsif, - predicate: predicate, + pred: predicate, stmts: stmts, - consequent: consequent, + cons: consequent, loc: beging[:loc].to(ending[:loc]) } end @@ -1646,7 +1646,9 @@ def on_if(predicate, stmts, consequent) { type: :if, - body: [predicate, stmts, consequent], + pred: predicate, + stmts: stmts, + cons: consequent, loc: beging[:loc].to(ending[:loc]) } end @@ -1657,7 +1659,9 @@ def on_if(predicate, stmts, consequent) def on_ifop(predicate, truthy, falsy) { type: :ifop, - body: [predicate, truthy, falsy], + pred: predicate, + tthy: truthy, + flsy: falsy, loc: predicate[:loc].to(falsy[:loc]) } end @@ -1670,7 +1674,8 @@ def on_if_mod(predicate, statement) { type: :if_mod, - body: [predicate, statement], + pred: predicate, + stmt: statement, loc: statement[:loc].to(predicate[:loc]) } end @@ -3047,7 +3052,9 @@ def on_unless(predicate, stmts, consequent) { type: :unless, - body: [predicate, stmts, consequent], + pred: predicate, + stmts: stmts, + cons: consequent, loc: beging[:loc].to(ending[:loc]) } end @@ -3060,7 +3067,8 @@ def on_unless_mod(predicate, statement) { type: :unless_mod, - body: [predicate, statement], + pred: predicate, + stmt: statement, loc: statement[:loc].to(predicate[:loc]) } end @@ -3084,7 +3092,7 @@ def on_until(predicate, stmts) { type: :until, - predicate: predicate, + pred: predicate, stmts: stmts, loc: beging[:loc].to(ending[:loc]) } @@ -3098,7 +3106,7 @@ def on_until_mod(predicate, statement) { type: :until_mod, - predicate: predicate, + pred: predicate, stmt: statement, loc: statement[:loc].to(predicate[:loc]) } @@ -3216,7 +3224,7 @@ def on_while(predicate, stmts) { type: :while, - predicate: predicate, + pred: predicate, stmts: stmts, loc: beging[:loc].to(ending[:loc]) } @@ -3230,7 +3238,7 @@ def on_while_mod(predicate, statement) { type: :while_mod, - predicate: predicate, + pred: predicate, stmt: statement, loc: statement[:loc].to(predicate[:loc]) } diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 6ddc0233..8ae4fb25 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -133,25 +133,25 @@ export type MrhsAddStar = ParserEvent<"mrhs_add_star", { body: [Mrhs | MrhsNewFr export type MrhsNewFromArgs = ParserEvent<"mrhs_new_from_args", { body: [Args | ArgsAddStar, AnyNode], oper: string }>; // These are various parser events for control flow constructs. -export type Case = ParserEvent<"case", { value: AnyNode, consequent: In | When }>; +export type Case = ParserEvent<"case", { value: AnyNode, cons: In | When }>; export type Else = ParserEvent<"else", { stmts: Stmts }>; -export type Elsif = ParserEvent<"elsif", { predicate: AnyNode, stmts: Stmts, consequent: null | Elsif | Else }>; +export type Elsif = ParserEvent<"elsif", { pred: AnyNode, stmts: Stmts, cons: null | Elsif | Else }>; export type Ensure = ParserEvent<"ensure", { keyword: Keyword, stmts: Stmts }>; export type For = ParserEvent<"for", { iterator: Mlhs | MlhsAddStar | VarField, enumerable: AnyNode, stmts: Stmts }>; -export type If = ParserEvent<"if", { body: [AnyNode, Stmts, null | Elsif | Else] }>; -export type IfModifier = ParserEvent<"if_mod", { body: [AnyNode, AnyNode] }>; +export type If = ParserEvent<"if", { pred: AnyNode, stmts: Stmts, cons: null | Elsif | Else }>; +export type IfModifier = ParserEvent<"if_mod", { pred: AnyNode, stmt: AnyNode }>; export type In = ParserEvent<"in", { body: [AnyNode, Stmts, null | In | Else] }>; export type Rescue = ParserEvent<"rescue", { body: [null | RescueEx, Stmts, null | Stmts] }>; export type RescueEx = ParserEvent<"rescue_ex", { body: [AnyNode, null | Field | VarField] }>; export type RescueModifier = ParserEvent<"rescue_mod", { body: [AnyNode, AnyNode] }>; -export type Ternary = ParserEvent<"ifop", { body: [AnyNode, AnyNode, AnyNode] }>; -export type Unless = ParserEvent<"unless", { body: [AnyNode, Stmts, null | Elsif | Else] }>; -export type UnlessModifier = ParserEvent<"unless_mod", { body: [AnyNode, AnyNode] }>; -export type Until = ParserEvent<"until", { predicate: AnyNode, stmts: Stmts }>; -export type UntilModifier = ParserEvent<"until_mod", { predicate: AnyNode, stmt: AnyNode }>; +export type Ternary = ParserEvent<"ifop", { pred: AnyNode, tthy: AnyNode, flsy: AnyNode }>; +export type Unless = ParserEvent<"unless", { pred: AnyNode, stmts: Stmts, cons: null | Elsif | Else }>; +export type UnlessModifier = ParserEvent<"unless_mod", { pred: AnyNode, stmt: AnyNode }>; +export type Until = ParserEvent<"until", { pred: AnyNode, stmts: Stmts }>; +export type UntilModifier = ParserEvent<"until_mod", { pred: AnyNode, stmt: AnyNode }>; export type When = ParserEvent<"when", { body: [Args | ArgsAddStar, Stmts, null | Else | When] }>; -export type While = ParserEvent<"while", { predicate: AnyNode, stmts: Stmts }>; -export type WhileModifier = ParserEvent<"while_mod", { predicate: AnyNode, stmt: AnyNode }>; +export type While = ParserEvent<"while", { pred: AnyNode, stmts: Stmts }>; +export type WhileModifier = ParserEvent<"while_mod", { pred: AnyNode, stmt: AnyNode }>; // These are various parser events for control flow keywords. export type Break = ParserEvent<"break", { args: Args | ArgsAddBlock }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 89accdaf..ed5e09cf 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -54,7 +54,7 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return childNodes; } case "case": - return [node.value, node.consequent]; + return [node.value, node.cons]; case "class": return [node.constant, node.superclass, node.bodystmt]; case "command": @@ -86,7 +86,7 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { case "else": return [node.stmts]; case "elsif": - return [node.predicate, node.stmts, node.consequent]; + return [node.pred, node.stmts, node.cons]; case "ensure": return [node.keyword, node.stmts]; case "excessed_comma": @@ -119,6 +119,12 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { childNodes.push(node.kwrest); return childNodes; } + case "if": + return [node.pred, node.stmts, node.cons]; + case "ifop": + return [node.pred, node.tthy, node.flsy]; + case "if_mod": + return [node.stmt, node.pred]; case "module": return [node.constant, node.bodystmt]; case "next": @@ -137,10 +143,14 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.constant]; case "top_const_ref": return [node.constant]; + case "unless": + return [node.pred, node.stmts, node.cons]; + case "unless_mod": + return [node.stmt, node.pred]; case "until": - return [node.predicate, node.stmts]; + return [node.pred, node.stmts]; case "until_mod": - return [node.predicate, node.stmt]; + return [node.stmt, node.pred]; case "var_alias": return [node.left, node.right]; case "var_field": @@ -150,9 +160,9 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { case "vcall": return [node.value]; case "while": - return [node.predicate, node.stmts]; + return [node.pred, node.stmts]; case "while_mod": - return [node.predicate, node.stmt]; + return [node.stmt, node.pred]; From 99e300880bc83b11e52e446a9dae349259750361 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 29 Oct 2021 17:08:17 -0400 Subject: [PATCH 376/785] kwrest_param, rest_param --- src/ruby/nodes/params.ts | 12 ++++++------ src/ruby/parser.rb | 12 ++++++------ src/types/ruby.ts | 4 ++-- src/utils/getChildNodes.ts | 4 ++++ 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/ruby/nodes/params.ts b/src/ruby/nodes/params.ts index 2167f678..b2f61e9d 100644 --- a/src/ruby/nodes/params.ts +++ b/src/ruby/nodes/params.ts @@ -4,13 +4,13 @@ import { literal } from "../../utils"; const { group, hardline, join, indent, line, lineSuffix, softline } = prettier; -function printRestParamSymbol( - symbol: string -): Plugin.Printer { +type RestParam = Ruby.KeywordRestParam | Ruby.RestParam; + +function printRestParamSymbol(symbol: string): Plugin.Printer { return function printRestParamWithSymbol(path, opts, print) { - return path.getValue().body[0] - ? [symbol, path.call(print, "body", 0)] - : symbol; + const node = path.getValue(); + + return node.name ? [symbol, path.call(print, "name")] : symbol; }; } diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 868c552a..663f5359 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -1782,11 +1782,11 @@ def on_kw(value) # kwrest_param is a parser event that represents defining a parameter in a # method definition that accepts all remaining keyword parameters. - def on_kwrest_param(ident) + def on_kwrest_param(name) location = find_scanner_event(:@op, '**')[:loc] - location = location.to(ident[:loc]) if ident + location = location.to(name[:loc]) if name - { type: :kwrest_param, body: [ident], loc: location } + { type: :kwrest_param, name: name, loc: location } end # label is a scanner event that represents the use of an identifier to @@ -2527,11 +2527,11 @@ def on_rescue_mod(statement, rescued) # method definition that accepts all remaining positional parameters. It # accepts as an argument an optional identifier for the parameter. If it # is omitted, then we're just using the plain operator. - def on_rest_param(ident) + def on_rest_param(name) location = find_scanner_event(:@op, '*')[:loc] - location = location.to(ident[:loc]) if ident + location = location.to(name[:loc]) if name - { type: :rest_param, body: [ident], loc: location } + { type: :rest_param, name: name, loc: location } end # retry is a parser event that represents the bare retry keyword. It has diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 8ae4fb25..05850f20 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -174,10 +174,10 @@ export type Blockarg = ParserEvent<"blockarg", { name: Identifier }>; export type Def = ParserEvent<"def", { name: DefName, params: Params | Paren, bodystmt: Bodystmt }>; export type Defs = ParserEvent<"defs", { target: AnyNode, operator: Op | Period, name: DefName, params: Params | Paren, bodystmt: Bodystmt }>; export type Defsl = ParserEvent<"defsl", { name: DefName, paren: null | ParenAroundParams, stmt: AnyNode }>; -export type KeywordRestParam = ParserEvent<"kwrest_param", { body: [null | Identifier] }>; +export type KeywordRestParam = ParserEvent<"kwrest_param", { name: null | Identifier }>; export type Lambda = ParserEvent<"lambda", { body: [Params | ParenAroundParams, Bodystmt | Stmts] }>; export type Params = ParserEvent<"params", { body: [Identifier[], null | [Identifier, AnyNode][], null | ArgsForward | ExcessedComma | RestParam, Identifier[], null | [Label, AnyNode][], null | "nil" | KeywordRestParam, null | Blockarg] }>; -export type RestParam = ParserEvent<"rest_param", { body: [null | Identifier] }>; +export type RestParam = ParserEvent<"rest_param", { name: null | Identifier }>; // These are various parser events for method calls. export type CallOperator = Op | Period | "::"; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index ed5e09cf..6c15381d 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -125,6 +125,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.pred, node.tthy, node.flsy]; case "if_mod": return [node.stmt, node.pred]; + case "kwrest_param": + return [node.name]; case "module": return [node.constant, node.bodystmt]; case "next": @@ -135,6 +137,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.stmts]; case "rassign": return [node.value, node.operator, node.pattern]; + case "rest_param": + return [node.name]; case "return": return [node.args]; case "sclass": From 2295656d3cd576241af5ac19ddf231aef5a781c2 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 29 Oct 2021 17:12:41 -0400 Subject: [PATCH 377/785] lambda --- src/ruby/nodes/lambdas.ts | 10 ++++++---- src/ruby/parser.rb | 5 +++-- src/types/ruby.ts | 2 +- src/utils/getChildNodes.ts | 2 ++ 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/ruby/nodes/lambdas.ts b/src/ruby/nodes/lambdas.ts index f1f8180b..ad71dde3 100644 --- a/src/ruby/nodes/lambdas.ts +++ b/src/ruby/nodes/lambdas.ts @@ -12,7 +12,7 @@ function printLambdaParams( path: Plugin.Path, print: Plugin.Print ) { - let node = path.getValue().body[0]; + let node = path.getValue().params; // In this case we had something like -> (foo) { bar } which would mean that // we're looking at a paren node, so we'll descend one level deeper to get at @@ -27,7 +27,7 @@ function printLambdaParams( return ""; } - return path.call(print, "body", 0); + return path.call(print, "params"); } // Lambda nodes represent stabby lambda literals, which can come in a couple of @@ -61,6 +61,8 @@ export const printLambda: Plugin.Printer = (path, opts, print) => { const params = printLambdaParams(path, print); const inCommand = hasAncestor(path, ["command", "command_call"]); + const stmtsDoc = path.call(print, "stmts"); + return group( ifBreak( [ @@ -68,11 +70,11 @@ export const printLambda: Plugin.Printer = (path, opts, print) => { params, " ", inCommand ? "{" : "do", - indent([line, path.call(print, "body", 1)]), + indent([line, stmtsDoc]), line, inCommand ? "}" : "end" ], - ["->", params, " { ", path.call(print, "body", 1), " }"] + ["->", params, " { ", stmtsDoc, " }"] ) ); }; diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 663f5359..fd10793f 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -1834,7 +1834,7 @@ def on_label_end(value) # lambda is a parser event that represents using a "stabby" lambda # literal. It accepts as arguments a params event that represents any - # parameters to the lambda and a stmts event that represents the + # parameters to the lambda and a stmts/bodystmt event that represents the # statements inside the lambda. # # It can be wrapped in either {..} or do..end so we look for either of @@ -1854,7 +1854,8 @@ def on_lambda(params, stmts) { type: :lambda, - body: [params, stmts], + params: params, + stmts: stmts, loc: beging[:loc].to(closing[:loc]) } end diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 05850f20..c15aa461 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -175,7 +175,7 @@ export type Def = ParserEvent<"def", { name: DefName, params: Params | Paren, bo export type Defs = ParserEvent<"defs", { target: AnyNode, operator: Op | Period, name: DefName, params: Params | Paren, bodystmt: Bodystmt }>; export type Defsl = ParserEvent<"defsl", { name: DefName, paren: null | ParenAroundParams, stmt: AnyNode }>; export type KeywordRestParam = ParserEvent<"kwrest_param", { name: null | Identifier }>; -export type Lambda = ParserEvent<"lambda", { body: [Params | ParenAroundParams, Bodystmt | Stmts] }>; +export type Lambda = ParserEvent<"lambda", { params: Params | ParenAroundParams, stmts: Bodystmt | Stmts }>; export type Params = ParserEvent<"params", { body: [Identifier[], null | [Identifier, AnyNode][], null | ArgsForward | ExcessedComma | RestParam, Identifier[], null | [Label, AnyNode][], null | "nil" | KeywordRestParam, null | Blockarg] }>; export type RestParam = ParserEvent<"rest_param", { name: null | Identifier }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 6c15381d..17abaee9 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -127,6 +127,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.stmt, node.pred]; case "kwrest_param": return [node.name]; + case "lambda": + return [node.params, node.stmts]; case "module": return [node.constant, node.bodystmt]; case "next": From 7822725fde1d91a07703f64e186f9c933801cc68 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 29 Oct 2021 17:28:04 -0400 Subject: [PATCH 378/785] qsymbols, qwords, symbols, words --- src/ruby/nodes/arrays.ts | 10 +++------- src/ruby/nodes/return.ts | 13 ++++++------- src/ruby/parser.rb | 16 ++++++++-------- src/types/ruby.ts | 8 ++++---- src/utils/getChildNodes.ts | 8 ++++++++ 5 files changed, 29 insertions(+), 26 deletions(-) diff --git a/src/ruby/nodes/arrays.ts b/src/ruby/nodes/arrays.ts index d77f2f77..bf335928 100644 --- a/src/ruby/nodes/arrays.ts +++ b/src/ruby/nodes/arrays.ts @@ -105,7 +105,7 @@ export const printArray: Plugin.Printer = (path, opts, print) => { (arrayPath) => printArrayLiteral( arrayLiteralStarts[args.type], - arrayPath.map(print, "body") + arrayPath.map(print, "elems") ), "body", 0 @@ -119,9 +119,7 @@ export const printArray: Plugin.Printer = (path, opts, print) => { const printString = (stringPath: Plugin.Path) => stringPath.call(print, "body", 0); - const nodePath = path as Plugin.Path<{ - body: [{ body: Ruby.StringLiteral[] }]; - }>; + const nodePath = path as Plugin.Path<{ body: [{ body: Ruby.StringLiteral[] }] }>; const parts = nodePath.map(printString, "body", 0, "body"); return printArrayLiteral("%w", parts); @@ -133,9 +131,7 @@ export const printArray: Plugin.Printer = (path, opts, print) => { const printSymbol = (symbolPath: Plugin.Path) => symbolPath.call(print, "body", 0); - const nodePath = path as Plugin.Path<{ - body: [{ body: Ruby.SymbolLiteral[] }]; - }>; + const nodePath = path as Plugin.Path<{ body: [{ body: Ruby.SymbolLiteral[] }] }>; const parts = nodePath.map(printSymbol, "body", 0, "body"); return printArrayLiteral("%i", parts); diff --git a/src/ruby/nodes/return.ts b/src/ruby/nodes/return.ts index bf242b7e..f9fe34ca 100644 --- a/src/ruby/nodes/return.ts +++ b/src/ruby/nodes/return.ts @@ -61,13 +61,12 @@ export const printReturn: Plugin.Printer = (path, opts, print) => { // If we're returning an array literal that isn't a special array that has // at least 2 elements, then we want to grab the arguments so that we can // print them out as if they were normal return arguments. - if ( - arg.type === "array" && - arg.body[0] && - ["args", "args_add_star"].includes(arg.body[0].type) && - arg.body[0].body.length > 1 - ) { - steps = steps.concat("body", 0, "body", 0); + if (arg.type === "array" && arg.body[0]) { + const contents = arg.body[0]; + + if ((contents.type === "args" || contents.type === "args_add_star") && contents.body.length > 1) { + steps = steps.concat("body", 0, "body", 0); + } } } diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index fd10793f..c845b233 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -2280,7 +2280,7 @@ def on_qsymbols_beg(value) def on_qsymbols_new event = find_scanner_event(:@qsymbols_beg) - { type: :qsymbols, body: [], loc: event[:loc] } + { type: :qsymbols, elems: [], loc: event[:loc] } end # qsymbols_add is a parser event that represents an element inside of a @@ -2290,7 +2290,7 @@ def on_qsymbols_new def on_qsymbols_add(qsymbols, tstring_content) { type: :qsymbols, - body: qsymbols[:body] << tstring_content, + elems: qsymbols[:elems] << tstring_content, loc: qsymbols[:loc].to(tstring_content[:loc]) } end @@ -2318,7 +2318,7 @@ def on_qwords_beg(value) def on_qwords_new event = find_scanner_event(:@qwords_beg) - { type: :qwords, body: [], loc: event[:loc] } + { type: :qwords, elems: [], loc: event[:loc] } end # qsymbols_add is a parser event that represents an element inside of a @@ -2328,7 +2328,7 @@ def on_qwords_new def on_qwords_add(qwords, tstring_content) { type: :qwords, - body: qwords[:body] << tstring_content, + elems: qwords[:elems] << tstring_content, loc: qwords[:loc].to(tstring_content[:loc]) } end @@ -2857,7 +2857,7 @@ def on_symbol_literal(contents) def on_symbols_add(symbols, word_add) { type: :symbols, - body: symbols[:body] << word_add, + elems: symbols[:elems] << word_add, loc: symbols[:loc].to(word_add[:loc]) } end @@ -2886,7 +2886,7 @@ def on_symbols_beg(value) def on_symbols_new event = find_scanner_event(:@symbols_beg) - { type: :symbols, body: [], loc: event[:loc] } + { type: :symbols, elems: [], loc: event[:loc] } end # tlambda is a scanner event that represents the beginning of a lambda @@ -3321,7 +3321,7 @@ def on_words_beg(value) def on_words_add(words, word_add) { type: :words, - body: words[:body] << word_add, + elems: words[:elems] << word_add, loc: words[:loc].to(word_add[:loc]) } end @@ -3333,7 +3333,7 @@ def on_words_add(words, word_add) def on_words_new event = find_scanner_event(:@words_beg) - { type: :words, body: [], loc: event[:loc] } + { type: :words, elems: [], loc: event[:loc] } end # xstring_add is a parser event that represents a piece of a string of diff --git a/src/types/ruby.ts b/src/types/ruby.ts index c15aa461..20a594ad 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -98,11 +98,11 @@ export type XStringLiteral = ParserEvent<"xstring_literal", { body: StringConten // These are various parser events that have to do with arrays. export type Array = ParserEvent<"array", { body: [null | Args | ArgsAddStar | Qsymbols | Qwords | Symbols | Words] }>; -export type Qsymbols = ParserEvent<"qsymbols", { body: TStringContent[] }>; -export type Qwords = ParserEvent<"qwords", { body: TStringContent[] }>; -export type Symbols = ParserEvent<"symbols", { body: Word[] }>; +export type Qsymbols = ParserEvent<"qsymbols", { elems: TStringContent[] }>; +export type Qwords = ParserEvent<"qwords", { elems: TStringContent[] }>; +export type Symbols = ParserEvent<"symbols", { elems: Word[] }>; export type Word = ParserEvent<"word", { body: StringContent[] }>; -export type Words = ParserEvent<"words", { body: Word[] }>; +export type Words = ParserEvent<"words", { elems: Word[] }>; // These are various parser events that have to do with hashes. type HashContent = AssocNew | AssocSplat; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 17abaee9..d8fbd233 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -137,6 +137,10 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.target, node.operator, node.value]; case "program": return [node.stmts]; + case "qsymbols": + return []; + case "qwords": + return []; case "rassign": return [node.value, node.operator, node.pattern]; case "rest_param": @@ -145,6 +149,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.args]; case "sclass": return [node.target, node.bodystmt]; + case "symbols": + return []; case "top_const_field": return [node.constant]; case "top_const_ref": @@ -169,6 +175,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.pred, node.stmts]; case "while_mod": return [node.stmt, node.pred]; + case "words": + return []; From fcaaf80168cf56d7f973599638b88f768e953efb Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 29 Oct 2021 17:33:24 -0400 Subject: [PATCH 379/785] in, when --- src/ruby/nodes/case.ts | 10 +++++----- src/ruby/nodes/patterns.ts | 9 ++++----- src/ruby/parser.rb | 12 ++++++++---- src/types/ruby.ts | 4 ++-- src/utils/getChildNodes.ts | 4 ++++ 5 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/ruby/nodes/case.ts b/src/ruby/nodes/case.ts index aec0d8cd..38195675 100644 --- a/src/ruby/nodes/case.ts +++ b/src/ruby/nodes/case.ts @@ -16,12 +16,12 @@ export const printCase: Plugin.Printer = (path, opts, print) => { }; export const printWhen: Plugin.Printer = (path, opts, print) => { - const [, , addition] = path.getValue().body; + const node = path.getValue(); // The `fill` builder command expects an array of docs alternating with // line breaks. This is so it can loop through and determine where to break. const preds = fill( - (path.call(print, "body", 0) as Plugin.Doc[]).reduce( + (path.call(print, "args") as Plugin.Doc[]).reduce( (accum: Plugin.Doc[], pred, index) => { if (index === 0) { return [pred]; @@ -40,7 +40,7 @@ export const printWhen: Plugin.Printer = (path, opts, print) => { ) ); - const stmts = path.call(print, "body", 1) as Plugin.Doc[]; + const stmts = path.call(print, "stmts") as Plugin.Doc[]; const parts: Plugin.Doc[] = [["when ", align("when ".length, preds)]]; // It's possible in a when to just have empty void statements, in which case @@ -51,8 +51,8 @@ export const printWhen: Plugin.Printer = (path, opts, print) => { // This is the next clause on the case statement, either another `when` or // an `else` clause. - if (addition) { - parts.push(hardline, path.call(print, "body", 2)); + if (node.cons) { + parts.push(hardline, path.call(print, "cons")); } return group(parts); diff --git a/src/ruby/nodes/patterns.ts b/src/ruby/nodes/patterns.ts index 2ee7fe4c..0857112c 100644 --- a/src/ruby/nodes/patterns.ts +++ b/src/ruby/nodes/patterns.ts @@ -139,15 +139,14 @@ export const printIn: Plugin.Printer = (path, opts, print) => { keyword.length, path.call( (valuePath) => printPatternArg(valuePath, opts, print), - "body", - 0 + "pttn" ) ), - indent([hardline, path.call(print, "body", 1)]) + indent([hardline, path.call(print, "stmts")]) ]; - if (path.getValue().body[2]) { - parts.push(hardline, path.call(print, "body", 2)); + if (path.getValue().cons) { + parts.push(hardline, path.call(print, "cons")); } return group(parts); diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index c845b233..bc376c18 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -1738,7 +1738,9 @@ def on_in(pattern, stmts, consequent) { type: :in, - body: [pattern, stmts, consequent], + pttn: pattern, + stmts: stmts, + cons: consequent, loc: beging[:loc].to(ending[:loc]) } end @@ -3193,15 +3195,17 @@ def on_void_stmt # It accepts as arguments the predicate of the when, the statements that # are contained within the else if clause, and the optional consequent # clause. - def on_when(predicate, stmts, consequent) + def on_when(args, stmts, consequent) beging = find_scanner_event(:@kw, 'when') ending = consequent || find_scanner_event(:@kw, 'end') - stmts.bind(predicate[:loc].end_char, ending[:loc].start_char) + stmts.bind(args[:loc].end_char, ending[:loc].start_char) { type: :when, - body: [predicate, stmts, consequent], + args: args, + stmts: stmts, + cons: consequent, loc: beging[:loc].to(ending[:loc]) } end diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 20a594ad..c3a79d1d 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -140,7 +140,7 @@ export type Ensure = ParserEvent<"ensure", { keyword: Keyword, stmts: Stmts }>; export type For = ParserEvent<"for", { iterator: Mlhs | MlhsAddStar | VarField, enumerable: AnyNode, stmts: Stmts }>; export type If = ParserEvent<"if", { pred: AnyNode, stmts: Stmts, cons: null | Elsif | Else }>; export type IfModifier = ParserEvent<"if_mod", { pred: AnyNode, stmt: AnyNode }>; -export type In = ParserEvent<"in", { body: [AnyNode, Stmts, null | In | Else] }>; +export type In = ParserEvent<"in", { pttn: AnyNode, stmts: Stmts, cons: null | In | Else }>; export type Rescue = ParserEvent<"rescue", { body: [null | RescueEx, Stmts, null | Stmts] }>; export type RescueEx = ParserEvent<"rescue_ex", { body: [AnyNode, null | Field | VarField] }>; export type RescueModifier = ParserEvent<"rescue_mod", { body: [AnyNode, AnyNode] }>; @@ -149,7 +149,7 @@ export type Unless = ParserEvent<"unless", { pred: AnyNode, stmts: Stmts, cons: export type UnlessModifier = ParserEvent<"unless_mod", { pred: AnyNode, stmt: AnyNode }>; export type Until = ParserEvent<"until", { pred: AnyNode, stmts: Stmts }>; export type UntilModifier = ParserEvent<"until_mod", { pred: AnyNode, stmt: AnyNode }>; -export type When = ParserEvent<"when", { body: [Args | ArgsAddStar, Stmts, null | Else | When] }>; +export type When = ParserEvent<"when", { args: Args | ArgsAddStar, stmts: Stmts, cons: null | Else | When }>; export type While = ParserEvent<"while", { pred: AnyNode, stmts: Stmts }>; export type WhileModifier = ParserEvent<"while_mod", { pred: AnyNode, stmt: AnyNode }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index d8fbd233..19e71ae6 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -125,6 +125,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.pred, node.tthy, node.flsy]; case "if_mod": return [node.stmt, node.pred]; + case "in": + return [node.pttn, node.stmts, node.cons]; case "kwrest_param": return [node.name]; case "lambda": @@ -171,6 +173,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.value]; case "vcall": return [node.value]; + case "when": + return [node.args, node.stmts, node.cons]; case "while": return [node.pred, node.stmts]; case "while_mod": From 0fb8dae9267b28f57adbc883373b97785d68ba4b Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 29 Oct 2021 17:47:39 -0400 Subject: [PATCH 380/785] args_forward, redo, retry, return0, yield0, zsuper --- src/ruby/parser.rb | 24 ++++++++++++------------ src/utils/getChildNodes.ts | 12 ++++++++++++ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index bc376c18..cb7bee8d 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -536,9 +536,9 @@ def on_args_add_star(args, part) # args_forward is a parser event that represents forwarding all kinds of # arguments onto another method call. def on_args_forward - event = find_scanner_event(:@op, '...') + keyword = find_scanner_event(:@op, '...') - { type: :args_forward, body: event[:body], loc: event[:loc] } + { type: :args_forward, body: keyword[:body], loc: keyword[:loc] } end # args_new is a parser event that represents the beginning of a list of @@ -2376,9 +2376,9 @@ def on_rbracket(value) # redo is a parser event that represents the bare redo keyword. It has no # body as it accepts no arguments. def on_redo - event = find_scanner_event(:@kw, 'redo') + keyword = find_scanner_event(:@kw, 'redo') - { type: :redo, body: event[:body], loc: event[:loc] } + { type: :redo, body: keyword[:body], loc: keyword[:loc] } end # regexp_add is a parser event that represents a piece of a regular expression @@ -2540,9 +2540,9 @@ def on_rest_param(name) # retry is a parser event that represents the bare retry keyword. It has # no body as it accepts no arguments. def on_retry - event = find_scanner_event(:@kw, 'retry') + keyword = find_scanner_event(:@kw, 'retry') - { type: :retry, body: event[:body], loc: event[:loc] } + { type: :retry, body: keyword[:body], loc: keyword[:loc] } end # return is a parser event that represents using the return keyword with @@ -2559,9 +2559,9 @@ def on_return(args) # parser event, which is the version where you're returning one or more # values. def on_return0 - event = find_scanner_event(:@kw, 'return') + keyword = find_scanner_event(:@kw, 'return') - { type: :return0, body: event[:body], loc: event[:loc] } + { type: :return0, body: keyword[:body], loc: keyword[:loc] } end # rparen is a scanner event that represents the use of a right parenthesis, @@ -3431,9 +3431,9 @@ def on_yield(args_add_block) # parser event, which is the version where you're yielding one or more # values. def on_yield0 - event = find_scanner_event(:@kw, 'yield') + keyword = find_scanner_event(:@kw, 'yield') - { type: :yield0, body: event[:body], loc: event[:loc] } + { type: :yield0, body: keyword[:body], loc: keyword[:loc] } end # zsuper is a parser event that represents the bare super keyword. It has @@ -3441,8 +3441,8 @@ def on_yield0 # parser event, which is the version where you're calling super with one # or more values. def on_zsuper - event = find_scanner_event(:@kw, 'super') + keyword = find_scanner_event(:@kw, 'super') - { type: :zsuper, body: event[:body], loc: event[:loc] } + { type: :zsuper, body: keyword[:body], loc: keyword[:loc] } end end diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 19e71ae6..b339549d 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -16,6 +16,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.collection, node.index]; case "aref_field": return [node.collection, node.index]; + case "args_forward": + return []; case "aryptn": return [node.constant, ...node.reqs, node.rest, ...node.posts]; case "assign": @@ -145,10 +147,16 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return []; case "rassign": return [node.value, node.operator, node.pattern]; + case "redo": + return []; case "rest_param": return [node.name]; + case "retry": + return []; case "return": return [node.args]; + case "return0": + return []; case "sclass": return [node.target, node.bodystmt]; case "symbols": @@ -181,6 +189,10 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.stmt, node.pred]; case "words": return []; + case "yield0": + return []; + case "zsuper": + return []; From 3579b2fe112c3c0c1c1b05ada277104ccb60b074 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Nov 2021 12:07:13 +0000 Subject: [PATCH 381/785] Bump @typescript-eslint/eslint-plugin from 5.2.0 to 5.3.0 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.2.0 to 5.3.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.3.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 58 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 46 insertions(+), 12 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2b340bb4..ecc5f51b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -693,12 +693,12 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.2.0.tgz#2bdb247cc2e2afce7efbce09afb9a6f0a8a08434" - integrity sha512-qQwg7sqYkBF4CIQSyRQyqsYvP+g/J0To9ZPVNJpfxfekl5RmdvQnFFTVVwpRtaUDFNvjfe/34TgY/dpc3MgNTw== + version "5.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.3.0.tgz#a55ae72d28ffeb6badd817fe4566c9cced1f5e29" + integrity sha512-ARUEJHJrq85aaiCqez7SANeahDsJTD3AEua34EoQN9pHS6S5Bq9emcIaGGySt/4X2zSi+vF5hAH52sEen7IO7g== dependencies: - "@typescript-eslint/experimental-utils" "5.2.0" - "@typescript-eslint/scope-manager" "5.2.0" + "@typescript-eslint/experimental-utils" "5.3.0" + "@typescript-eslint/scope-manager" "5.3.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -706,15 +706,15 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/experimental-utils@5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.2.0.tgz#e3b2cb9cd0aff9b50f68d9a414c299fd26b067e6" - integrity sha512-fWyT3Agf7n7HuZZRpvUYdFYbPk3iDCq6fgu3ulia4c7yxmPnwVBovdSOX7RL+k8u6hLbrXcdAehlWUVpGh6IEw== +"@typescript-eslint/experimental-utils@5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.3.0.tgz#ee56b4957547ed2b0fc7451205e41502e664f546" + integrity sha512-NFVxYTjKj69qB0FM+piah1x3G/63WB8vCBMnlnEHUsiLzXSTWb9FmFn36FD9Zb4APKBLY3xRArOGSMQkuzTF1w== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.2.0" - "@typescript-eslint/types" "5.2.0" - "@typescript-eslint/typescript-estree" "5.2.0" + "@typescript-eslint/scope-manager" "5.3.0" + "@typescript-eslint/types" "5.3.0" + "@typescript-eslint/typescript-estree" "5.3.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -736,11 +736,24 @@ "@typescript-eslint/types" "5.2.0" "@typescript-eslint/visitor-keys" "5.2.0" +"@typescript-eslint/scope-manager@5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.3.0.tgz#97d0ccc7c9158e89e202d5e24ce6ba49052d432e" + integrity sha512-22Uic9oRlTsPppy5Tcwfj+QET5RWEnZ5414Prby465XxQrQFZ6nnm5KnXgnsAJefG4hEgMnaxTB3kNEyjdjj6A== + dependencies: + "@typescript-eslint/types" "5.3.0" + "@typescript-eslint/visitor-keys" "5.3.0" + "@typescript-eslint/types@5.2.0": version "5.2.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.2.0.tgz#7ad32d15abddb0ee968a330f0ea182ea544ef7cf" integrity sha512-cTk6x08qqosps6sPyP2j7NxyFPlCNsJwSDasqPNjEQ8JMD5xxj2NHxcLin5AJQ8pAVwpQ8BMI3bTxR0zxmK9qQ== +"@typescript-eslint/types@5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.3.0.tgz#af29fd53867c2df0028c57c36a655bd7e9e05416" + integrity sha512-fce5pG41/w8O6ahQEhXmMV+xuh4+GayzqEogN24EK+vECA3I6pUwKuLi5QbXO721EMitpQne5VKXofPonYlAQg== + "@typescript-eslint/typescript-estree@5.2.0": version "5.2.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.2.0.tgz#c22e0ff6f8a4a3f78504a80ebd686fe2870a68ae" @@ -754,6 +767,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.3.0.tgz#4f68ddd46dc2983182402d2ab21fb44ad94988cf" + integrity sha512-FJ0nqcaUOpn/6Z4Jwbtf+o0valjBLkqc3MWkMvrhA2TvzFXtcclIM8F4MBEmYa2kgcI8EZeSAzwoSrIC8JYkug== + dependencies: + "@typescript-eslint/types" "5.3.0" + "@typescript-eslint/visitor-keys" "5.3.0" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/visitor-keys@5.2.0": version "5.2.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.2.0.tgz#03522d35df98474f08e0357171a7d1b259a88f55" @@ -762,6 +788,14 @@ "@typescript-eslint/types" "5.2.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.3.0.tgz#a6258790f3b7b2547f70ed8d4a1e0c3499994523" + integrity sha512-oVIAfIQuq0x2TFDNLVavUn548WL+7hdhxYn+9j3YdJJXB7mH9dAmZNJsPDa7Jc+B9WGqoiex7GUDbyMxV0a/aw== + dependencies: + "@typescript-eslint/types" "5.3.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 960165783379428b63166d312b8f7c9bcfe5652c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Nov 2021 12:07:30 +0000 Subject: [PATCH 382/785] Bump @typescript-eslint/parser from 5.2.0 to 5.3.0 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.2.0 to 5.3.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.3.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2b340bb4..e979fa70 100644 --- a/yarn.lock +++ b/yarn.lock @@ -719,13 +719,13 @@ eslint-utils "^3.0.0" "@typescript-eslint/parser@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.2.0.tgz#dc081aa89de16b5676b10215519af3aa7b58fb72" - integrity sha512-Uyy4TjJBlh3NuA8/4yIQptyJb95Qz5PX//6p8n7zG0QnN4o3NF9Je3JHbVU7fxf5ncSXTmnvMtd/LDQWDk0YqA== + version "5.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.3.0.tgz#7879f15e26d370ed3f653fb7dd06479531ed3ab9" + integrity sha512-rKu/yAReip7ovx8UwOAszJVO5MgBquo8WjIQcp1gx4pYQCwYzag+I5nVNHO4MqyMkAo0gWt2gWUi+36gWAVKcw== dependencies: - "@typescript-eslint/scope-manager" "5.2.0" - "@typescript-eslint/types" "5.2.0" - "@typescript-eslint/typescript-estree" "5.2.0" + "@typescript-eslint/scope-manager" "5.3.0" + "@typescript-eslint/types" "5.3.0" + "@typescript-eslint/typescript-estree" "5.3.0" debug "^4.3.2" "@typescript-eslint/scope-manager@5.2.0": @@ -736,11 +736,24 @@ "@typescript-eslint/types" "5.2.0" "@typescript-eslint/visitor-keys" "5.2.0" +"@typescript-eslint/scope-manager@5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.3.0.tgz#97d0ccc7c9158e89e202d5e24ce6ba49052d432e" + integrity sha512-22Uic9oRlTsPppy5Tcwfj+QET5RWEnZ5414Prby465XxQrQFZ6nnm5KnXgnsAJefG4hEgMnaxTB3kNEyjdjj6A== + dependencies: + "@typescript-eslint/types" "5.3.0" + "@typescript-eslint/visitor-keys" "5.3.0" + "@typescript-eslint/types@5.2.0": version "5.2.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.2.0.tgz#7ad32d15abddb0ee968a330f0ea182ea544ef7cf" integrity sha512-cTk6x08qqosps6sPyP2j7NxyFPlCNsJwSDasqPNjEQ8JMD5xxj2NHxcLin5AJQ8pAVwpQ8BMI3bTxR0zxmK9qQ== +"@typescript-eslint/types@5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.3.0.tgz#af29fd53867c2df0028c57c36a655bd7e9e05416" + integrity sha512-fce5pG41/w8O6ahQEhXmMV+xuh4+GayzqEogN24EK+vECA3I6pUwKuLi5QbXO721EMitpQne5VKXofPonYlAQg== + "@typescript-eslint/typescript-estree@5.2.0": version "5.2.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.2.0.tgz#c22e0ff6f8a4a3f78504a80ebd686fe2870a68ae" @@ -754,6 +767,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.3.0.tgz#4f68ddd46dc2983182402d2ab21fb44ad94988cf" + integrity sha512-FJ0nqcaUOpn/6Z4Jwbtf+o0valjBLkqc3MWkMvrhA2TvzFXtcclIM8F4MBEmYa2kgcI8EZeSAzwoSrIC8JYkug== + dependencies: + "@typescript-eslint/types" "5.3.0" + "@typescript-eslint/visitor-keys" "5.3.0" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/visitor-keys@5.2.0": version "5.2.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.2.0.tgz#03522d35df98474f08e0357171a7d1b259a88f55" @@ -762,6 +788,14 @@ "@typescript-eslint/types" "5.2.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.3.0.tgz#a6258790f3b7b2547f70ed8d4a1e0c3499994523" + integrity sha512-oVIAfIQuq0x2TFDNLVavUn548WL+7hdhxYn+9j3YdJJXB7mH9dAmZNJsPDa7Jc+B9WGqoiex7GUDbyMxV0a/aw== + dependencies: + "@typescript-eslint/types" "5.3.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 3ec0899d0bb77a4d9d2b2438fc53e170dd2b4237 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 2 Nov 2021 11:10:02 -0400 Subject: [PATCH 383/785] string_dvar --- src/ruby/embed.ts | 8 +++++++- src/ruby/nodes/strings.ts | 4 +--- src/ruby/parser.rb | 4 ++-- src/types/ruby.ts | 2 +- src/utils/getChildNodes.ts | 2 ++ 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/ruby/embed.ts b/src/ruby/embed.ts index 2df3d380..5cf7862a 100644 --- a/src/ruby/embed.ts +++ b/src/ruby/embed.ts @@ -72,6 +72,12 @@ function stripCommonLeadingWhitespace(content: string) { return lines.map((line) => line.slice(minimum)).join("\n"); } +// A type assertion so that TypeScript knows we're working with an array of +// exclusively plain string content. +function isTStringContentArray(body: Ruby.StringContent[]): body is Ruby.TStringContent[] { + return body.every((part) => part.type === "@tstring_content"); +} + const embed: Plugin.Embed = (path, print, textToDoc) => { const node = path.getValue(); @@ -84,7 +90,7 @@ const embed: Plugin.Embed = (path, print, textToDoc) => { const { beging, body, ending } = node; const isSquiggly = beging.body[2] === "~"; - if (body.some((part) => part.type !== "@tstring_content")) { + if (!isTStringContentArray(body)) { return null; } diff --git a/src/ruby/nodes/strings.ts b/src/ruby/nodes/strings.ts index 0a5e9299..fab63dc9 100644 --- a/src/ruby/nodes/strings.ts +++ b/src/ruby/nodes/strings.ts @@ -210,9 +210,7 @@ export const printStringDVar: Plugin.Printer = ( path, opts, print -) => { - return ["#{", path.call(print, "body", 0), "}"]; -}; +) => ["#{", path.call(print, "var"), "}"]; export const printStringEmbExpr: Plugin.Printer = ( path, diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index cb7bee8d..a578996f 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -2756,10 +2756,10 @@ def on_string_content # class variable, or global variable and omit the braces when # interpolating. For example, if you wanted to interpolate the instance # variable @foo into a string, you could do "#@foo". - def on_string_dvar(var_ref) + def on_string_dvar(variable) event = find_scanner_event(:@embvar) - { type: :string_dvar, body: [var_ref], loc: event[:loc].to(var_ref[:loc]) } + { type: :string_dvar, var: variable, loc: event[:loc].to(variable[:loc]) } end # string_embexpr is a parser event that represents interpolated content. diff --git a/src/types/ruby.ts b/src/types/ruby.ts index c3a79d1d..8341cb37 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -90,7 +90,7 @@ export type Heredoc = ParserEvent<"heredoc", { beging: HeredocBegin, ending: str export type RegexpLiteral = ParserEvent<"regexp_literal", { body: StringContent[], beging: string, ending: string }>; export type String = ParserEvent<"string", { body: [TStringContent] }>; export type StringConcat = ParserEvent<"string_concat", { body: [StringConcat | StringLiteral, StringLiteral] }>; -export type StringDVar = ParserEvent<"string_dvar", { body: [Backref | VarRef] }>; +export type StringDVar = ParserEvent<"string_dvar", { var: Backref | VarRef }>; export type StringEmbExpr = ParserEvent<"string_embexpr", { body: [Stmts] }>; export type StringLiteral = ParserEvent<"string_literal", { body: StringContent[], quote: string }>; export type SymbolLiteral = ParserEvent<"symbol_literal", { body: [Backtick | Const | CVar | GVar | Identifier | IVar | Keyword | Op] }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index b339549d..f3051597 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -159,6 +159,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return []; case "sclass": return [node.target, node.bodystmt]; + case "string_dvar": + return [node.var]; case "symbols": return []; case "top_const_field": From e2ae7263660608f14b2dd160f212e207043d378a Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 2 Nov 2021 11:14:18 -0400 Subject: [PATCH 384/785] word --- src/ruby/nodes/arrays.ts | 2 +- src/ruby/parser.rb | 24 ++++++++++++++---------- src/types/ruby.ts | 2 +- src/utils/getChildNodes.ts | 2 ++ 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/ruby/nodes/arrays.ts b/src/ruby/nodes/arrays.ts index bf335928..e86ee831 100644 --- a/src/ruby/nodes/arrays.ts +++ b/src/ruby/nodes/arrays.ts @@ -59,7 +59,7 @@ function isSymbolArray(args: Ruby.Args | Ruby.ArgsAddStar) { // interpolation. The body is an array of either plain strings or interpolated // expressions. export const printWord: Plugin.Printer = (path, opts, print) => { - return path.map(print, "body"); + return path.map(print, "parts"); }; // Prints out a special array literal. Accepts the parts of the array literal as diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index a578996f..17bc70c9 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -3249,22 +3249,22 @@ def on_while_mod(predicate, statement) } end - # word_add is a parser event that represents a piece of a word within a + # word_add is a parser event that represents a part of a word within a # special array literal that accepts interpolation. It accepts as - # arguments the parent word node as well as the additional piece of the + # arguments the parent word node as well as the additional part of the # word, which can be either a @tstring_content node for a plain string - # piece or a string_embexpr for an interpolated piece. - def on_word_add(word, piece) + # part or a string_embexpr for an interpolated piece. + def on_word_add(word, part) location = - if word[:body].empty? + if word[:parts].empty? # Here we're making sure we get the correct bounds by using the - # location information from the first piece. - piece[:loc] + # location information from the first part. + part[:loc] else - word[:loc].to(piece[:loc]) + word[:loc].to(part[:loc]) end - { type: :word, body: word[:body] << piece, loc: location } + { type: :word, parts: word[:parts] << part, loc: location } end # word_new is a parser event that represents the beginning of a word @@ -3279,7 +3279,11 @@ def on_word_add(word, piece) # purposes, we're going to report this as a word node and build up an # array body of our parts. def on_word_new - { type: :word, body: [], loc: Location.fixed(line: lineno, char: char_pos) } + { + type: :word, + parts: [], + loc: Location.fixed(line: lineno, char: char_pos) + } end # words_beg is a scanner event that represents the start of a word literal diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 8341cb37..bcc52e86 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -101,7 +101,7 @@ export type Array = ParserEvent<"array", { body: [null | Args | ArgsAddStar | Qs export type Qsymbols = ParserEvent<"qsymbols", { elems: TStringContent[] }>; export type Qwords = ParserEvent<"qwords", { elems: TStringContent[] }>; export type Symbols = ParserEvent<"symbols", { elems: Word[] }>; -export type Word = ParserEvent<"word", { body: StringContent[] }>; +export type Word = ParserEvent<"word", { parts: StringContent[] }>; export type Words = ParserEvent<"words", { elems: Word[] }>; // These are various parser events that have to do with hashes. diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index f3051597..fb1dbb08 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -189,6 +189,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.pred, node.stmts]; case "while_mod": return [node.stmt, node.pred]; + case "word": + return []; case "words": return []; case "yield0": From e517e84760c7edfce6f68897b8f423e4ec14cb3b Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 2 Nov 2021 11:44:56 -0400 Subject: [PATCH 385/785] undef --- src/ruby/nodes/undef.ts | 2 +- src/ruby/parser.rb | 2 +- src/types/ruby.ts | 2 +- src/utils/getChildNodes.ts | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ruby/nodes/undef.ts b/src/ruby/nodes/undef.ts index 17cf8aa2..66c50bc1 100644 --- a/src/ruby/nodes/undef.ts +++ b/src/ruby/nodes/undef.ts @@ -26,7 +26,7 @@ export const printUndef: Plugin.Printer = (path, opts, print) => { const keyword = "undef "; const argNodes = path.map( (symbolPath) => printUndefSymbol(symbolPath, opts, print), - "body" + "syms" ); return group([keyword, align(keyword.length, join([",", line], argNodes))]); diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 17bc70c9..5cb34b9c 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -3038,7 +3038,7 @@ def on_undef(symbol_literals) { type: :undef, - body: symbol_literals, + syms: symbol_literals, loc: event[:loc].to(symbol_literals.last[:loc]) } end diff --git a/src/types/ruby.ts b/src/types/ruby.ts index bcc52e86..5c7810ff 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -219,7 +219,7 @@ export type Class = ParserEvent<"class", { constant: ConstPathRef | ConstRef | T export type Module = ParserEvent<"module", { constant: ConstPathRef | ConstRef | TopConstRef, bodystmt: Bodystmt }>; export type Sclass = ParserEvent<"sclass", { target: AnyNode, bodystmt: Bodystmt }>; export type VarAlias = ParserEvent<"var_alias", { left: GVar, right: Backref | GVar }>; -export type Undef = ParserEvent<"undef", { body: (DynaSymbol | SymbolLiteral)[] }>; +export type Undef = ParserEvent<"undef", { syms: (DynaSymbol | SymbolLiteral)[] }>; // These are various parser events for statement containers, generally pretty high in the tree. export type Begin = ParserEvent<"begin", { bodystmt: Bodystmt }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index fb1dbb08..49f1b72e 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -167,6 +167,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.constant]; case "top_const_ref": return [node.constant]; + case "undef": + return node.syms; case "unless": return [node.pred, node.stmts, node.cons]; case "unless_mod": From 3499e37eea400534a0c4ef4c4f6f1f33212423ab Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 2 Nov 2021 11:49:15 -0400 Subject: [PATCH 386/785] xstring --- src/ruby/nodes/strings.ts | 2 +- src/ruby/parser.rb | 16 ++++++++-------- src/types/ruby.ts | 2 +- src/utils/getChildNodes.ts | 4 +++- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/ruby/nodes/strings.ts b/src/ruby/nodes/strings.ts index fab63dc9..bf5e0ee3 100644 --- a/src/ruby/nodes/strings.ts +++ b/src/ruby/nodes/strings.ts @@ -287,5 +287,5 @@ export const printXStringLiteral: Plugin.Printer = ( opts, print ) => { - return ["`", ...path.map(print, "body"), "`"]; + return ["`", ...path.map(print, "parts"), "`"]; }; diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 5cb34b9c..87347b8e 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -3344,17 +3344,17 @@ def on_words_new { type: :words, elems: [], loc: event[:loc] } end - # xstring_add is a parser event that represents a piece of a string of + # xstring_add is a parser event that represents a part of a string of # commands that gets sent out to the terminal, like `ls`. It accepts two - # arguments, the parent xstring node as well as the piece that is being + # arguments, the parent xstring node as well as the part that is being # added to the string. Because it supports interpolation this is either a # tstring_content scanner event representing bare string content or a # string_embexpr representing interpolated content. - def on_xstring_add(xstring, piece) + def on_xstring_add(xstring, part) { type: :xstring, - body: xstring[:body] << piece, - loc: xstring[:loc].to(piece[:loc]) + parts: xstring[:parts] << part, + loc: xstring[:loc].to(part[:loc]) } end @@ -3378,7 +3378,7 @@ def on_xstring_new find_scanner_event(:@backtick)[:loc] end - { type: :xstring, body: [], loc: location } + { type: :xstring, parts: [], loc: location } end # xstring_literal is a parser event that represents a string of commands @@ -3403,7 +3403,7 @@ def on_xstring_literal(xstring) type: :heredoc, beging: heredoc[:beging], ending: heredoc[:ending], - body: xstring[:body], + body: xstring[:parts], loc: heredoc[:loc] } else @@ -3411,7 +3411,7 @@ def on_xstring_literal(xstring) { type: :xstring_literal, - body: xstring[:body], + parts: xstring[:parts], loc: xstring[:loc].to(ending[:loc]) } end diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 5c7810ff..d5f6d921 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -94,7 +94,7 @@ export type StringDVar = ParserEvent<"string_dvar", { var: Backref | VarRef }>; export type StringEmbExpr = ParserEvent<"string_embexpr", { body: [Stmts] }>; export type StringLiteral = ParserEvent<"string_literal", { body: StringContent[], quote: string }>; export type SymbolLiteral = ParserEvent<"symbol_literal", { body: [Backtick | Const | CVar | GVar | Identifier | IVar | Keyword | Op] }>; -export type XStringLiteral = ParserEvent<"xstring_literal", { body: StringContent[] }>; +export type XStringLiteral = ParserEvent<"xstring_literal", { parts: StringContent[] }>; // These are various parser events that have to do with arrays. export type Array = ParserEvent<"array", { body: [null | Args | ArgsAddStar | Qsymbols | Qwords | Symbols | Words] }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 49f1b72e..cfe54606 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -192,9 +192,11 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { case "while_mod": return [node.stmt, node.pred]; case "word": - return []; + return node.parts; case "words": return []; + case "xstring_literal": + return node.parts; case "yield0": return []; case "zsuper": From 1f518e717563e8ef683fced103f46fb6bf7ad246 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 2 Nov 2021 11:53:37 -0400 Subject: [PATCH 387/785] regexp --- src/ruby/nodes/regexp.ts | 14 +++++++------- src/ruby/parser.rb | 12 ++++++------ src/types/ruby.ts | 2 +- src/utils/getChildNodes.ts | 2 ++ 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/ruby/nodes/regexp.ts b/src/ruby/nodes/regexp.ts index 4570aee7..db7d9725 100644 --- a/src/ruby/nodes/regexp.ts +++ b/src/ruby/nodes/regexp.ts @@ -2,8 +2,8 @@ import type { Plugin, Ruby } from "../../types"; import { hasAncestor } from "../../utils"; function hasContent(node: Ruby.RegexpLiteral, pattern: RegExp) { - return node.body.some( - (child) => child.type === "@tstring_content" && pattern.test(child.body) + return node.parts.some( + (part) => part.type === "@tstring_content" && pattern.test(part.body) ); } @@ -13,12 +13,12 @@ function hasContent(node: Ruby.RegexpLiteral, pattern: RegExp) { // operator, e.g. foo / bar/ or foo /=bar/ function forwardSlashIsAmbiguous(path: Plugin.Path) { const node = path.getValue(); - const firstChildNode = node.body[0]; + const firstPart = node.parts[0]; return ( - firstChildNode && - firstChildNode.type === "@tstring_content" && - [" ", "="].includes(firstChildNode.body[0]) && + firstPart && + firstPart.type === "@tstring_content" && + [" ", "="].includes(firstPart.body[0]) && hasAncestor(path, ["command", "command_call"]) ); } @@ -36,7 +36,7 @@ export const printRegexpLiteral: Plugin.Printer = ( print ) => { const node = path.getValue(); - const docs = path.map(print, "body"); + const docs = path.map(print, "parts"); // We should use braces if using a forward slash would be ambiguous in the // current context or if there's a forward slash in the content of the regexp. diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 87347b8e..c59ef4a3 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -2381,17 +2381,17 @@ def on_redo { type: :redo, body: keyword[:body], loc: keyword[:loc] } end - # regexp_add is a parser event that represents a piece of a regular expression + # regexp_add is a parser event that represents a part of a regular expression # body. It accepts as arguments the parent regexp node as well as a # tstring_content scanner event representing string content, a # string_embexpr parser event representing interpolated content, or a # string_dvar parser event representing an interpolated variable. - def on_regexp_add(regexp, piece) + def on_regexp_add(regexp, part) { type: :regexp, - body: regexp[:body] << piece, + parts: regexp[:parts] << part, beging: regexp[:beging], - loc: regexp[:loc].to(piece[:loc]) + loc: regexp[:loc].to(part[:loc]) } end @@ -2427,7 +2427,7 @@ def on_regexp_end(value) def on_regexp_literal(regexp, ending) { type: :regexp_literal, - body: regexp[:body], + parts: regexp[:parts], beging: regexp[:beging], ending: ending[:body], loc: regexp[:loc].to(ending[:loc]) @@ -2440,7 +2440,7 @@ def on_regexp_literal(regexp, ending) def on_regexp_new beging = find_scanner_event(:@regexp_beg) - { type: :regexp, body: [], beging: beging[:body], loc: beging[:loc] } + { type: :regexp, parts: [], beging: beging[:body], loc: beging[:loc] } end # rescue is a special kind of node where you have a rescue chain but it diff --git a/src/types/ruby.ts b/src/types/ruby.ts index d5f6d921..ff632984 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -87,7 +87,7 @@ export type Zsuper = ParserEvent0<"zsuper">; export type StringContent = StringDVar | StringEmbExpr | TStringContent; export type DynaSymbol = ParserEvent<"dyna_symbol", { body: StringContent[], quote: string }>; export type Heredoc = ParserEvent<"heredoc", { beging: HeredocBegin, ending: string, body: StringContent[] }>; -export type RegexpLiteral = ParserEvent<"regexp_literal", { body: StringContent[], beging: string, ending: string }>; +export type RegexpLiteral = ParserEvent<"regexp_literal", { parts: StringContent[], beging: string, ending: string }>; export type String = ParserEvent<"string", { body: [TStringContent] }>; export type StringConcat = ParserEvent<"string_concat", { body: [StringConcat | StringLiteral, StringLiteral] }>; export type StringDVar = ParserEvent<"string_dvar", { var: Backref | VarRef }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index cfe54606..318dc950 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -149,6 +149,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.value, node.operator, node.pattern]; case "redo": return []; + case "regexp_literal": + return node.parts; case "rest_param": return [node.name]; case "retry": From 35125f54e23987f171e028d2fe4f9e820dcfe674 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 2 Nov 2021 11:58:43 -0400 Subject: [PATCH 388/785] yield --- src/ruby/nodes/flow.ts | 9 ++++++--- src/ruby/parser.rb | 8 ++------ src/types/ruby.ts | 2 +- src/utils/getChildNodes.ts | 2 ++ 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/ruby/nodes/flow.ts b/src/ruby/nodes/flow.ts index 0dd0bda3..af450825 100644 --- a/src/ruby/nodes/flow.ts +++ b/src/ruby/nodes/flow.ts @@ -57,11 +57,14 @@ export const printBreak = printFlowControl("break"); export const printNext = printFlowControl("next"); export const printYield: Plugin.Printer = (path, opts, print) => { - if (path.getValue().body[0].type === "paren") { - return ["yield", path.call(print, "body", 0)]; + const node = path.getValue(); + const argsDoc = path.call(print, "args"); + + if (node.args.type === "paren") { + return ["yield", argsDoc]; } - return ["yield ", join(", ", path.call(print, "body", 0))]; + return ["yield ", join(", ", argsDoc)]; }; export const printYield0 = literal("yield"); diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index c59ef4a3..12f7415e 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -3420,14 +3420,10 @@ def on_xstring_literal(xstring) # yield is a parser event that represents using the yield keyword with # arguments. It accepts as an argument an args_add_block event that # contains all of the arguments being passed. - def on_yield(args_add_block) + def on_yield(args) event = find_scanner_event(:@kw, 'yield') - { - type: :yield, - body: [args_add_block], - loc: event[:loc].to(args_add_block[:loc]) - } + { type: :yield, args: args, loc: event[:loc].to(args[:loc]) } end # yield0 is a parser event that represents the bare yield keyword. It has diff --git a/src/types/ruby.ts b/src/types/ruby.ts index ff632984..1c247ca1 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -158,7 +158,7 @@ export type Break = ParserEvent<"break", { args: Args | ArgsAddBlock }>; export type Next = ParserEvent<"next", { args: Args | ArgsAddBlock }>; export type Return = ParserEvent<"return", { args: Args | ArgsAddBlock }>; export type Super = ParserEvent<"super", { body: [Args | ArgParen | ArgsAddBlock] }>; -export type Yield = ParserEvent<"yield", { body: [ArgsAddBlock | Paren] }>; +export type Yield = ParserEvent<"yield", { args: ArgsAddBlock | Paren }>; // These are various parser events for pattern matching. export type Aryptn = ParserEvent<"aryptn", { constant: null | VarRef, reqs: AnyNode[], rest: null | VarField, posts: AnyNode[] }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 318dc950..ab494965 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -199,6 +199,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return []; case "xstring_literal": return node.parts; + case "yield": + return [node.args]; case "yield0": return []; case "zsuper": From 47822c00745d9f86220b93ddc82099b8ec17b3e2 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 2 Nov 2021 12:22:53 -0400 Subject: [PATCH 389/785] string_concat --- src/ruby/nodes/strings.ts | 4 +--- src/ruby/parser.rb | 3 ++- src/types/ruby.ts | 5 ++--- src/utils/getChildNodes.ts | 2 ++ 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ruby/nodes/strings.ts b/src/ruby/nodes/strings.ts index bf5e0ee3..2f8e9c68 100644 --- a/src/ruby/nodes/strings.ts +++ b/src/ruby/nodes/strings.ts @@ -199,9 +199,7 @@ export const printStringConcat: Plugin.Printer = ( opts, print ) => { - const [leftDoc, rightDoc] = path.map(print, "body"); - - return group([leftDoc, " \\", indent([hardline, rightDoc])]); + return group([path.call(print, "left"), " \\", indent([hardline, path.call(print, "right")])]); }; // Prints out an interpolated variable in the string by converting it into an diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 12f7415e..4e4f4af7 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -2733,7 +2733,8 @@ def on_string_add(string, piece) def on_string_concat(left, right) { type: :string_concat, - body: [left, right], + left: left, + right: right, loc: left[:loc].to(right[:loc]) } end diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 1c247ca1..603bb57c 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -13,7 +13,7 @@ type ParserEvent> = { type: T, loc: Location } & // This is the main expression type that goes in places where the AST will // accept just about anything. // eslint-disable-next-line @typescript-eslint/ban-types -export type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgParen | Args | ArgsAddBlock | ArgsAddStar | ArgsForward | Array | Aryptn | Assign | AssocNew | AssocSplat | AssoclistFromArgs | BEGIN | Backref | Backtick | BareAssocHash | Begin | Binary | BlockVar | Blockarg | Bodystmt | BraceBlock | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | Defsl | DoBlock | Dot2 | Dot3 | DynaSymbol | END | Else | Elsif | EndContent | Ensure | ExcessedComma | Fcall | Field | Float | FndPtn | For | GVar | Hash | Heredoc | HeredocBegin | Hshptn | IVar | Identifier | If | IfModifier | Imaginary | In | Int | Keyword | KeywordRestParam | Label | Lambda | Lbrace | Lparen | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Op | Opassign | Params | Paren | Period | Program | Qsymbols | Qwords | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueEx | RescueModifier | RestParam | Retry | Return | Return0 | Sclass | Stmts | String | StringConcat | StringDVar | StringEmbExpr | StringLiteral | Super | SymbolLiteral | Symbols | TStringContent | Ternary | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VCall | VarAlias | VarField | VarRef | VoidStmt | When | While | WhileModifier | Word | Words | XStringLiteral | Yield | Yield0 | Zsuper +export type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgParen | Args | ArgsAddBlock | ArgsAddStar | ArgsForward | Array | Aryptn | Assign | AssocNew | AssocSplat | AssoclistFromArgs | BEGIN | Backref | Backtick | BareAssocHash | Begin | Binary | BlockVar | Blockarg | Bodystmt | BraceBlock | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | Defsl | DoBlock | Dot2 | Dot3 | DynaSymbol | END | Else | Elsif | EndContent | Ensure | ExcessedComma | Fcall | Field | Float | FndPtn | For | GVar | Hash | Heredoc | HeredocBegin | Hshptn | IVar | Identifier | If | IfModifier | Imaginary | In | Int | Keyword | KeywordRestParam | Label | Lambda | Lbrace | Lparen | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Op | Opassign | Params | Paren | Period | Program | Qsymbols | Qwords | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueEx | RescueModifier | RestParam | Retry | Return | Return0 | Sclass | Stmts | StringConcat | StringDVar | StringEmbExpr | StringLiteral | Super | SymbolLiteral | Symbols | TStringContent | Ternary | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VCall | VarAlias | VarField | VarRef | VoidStmt | When | While | WhileModifier | Word | Words | XStringLiteral | Yield | Yield0 | Zsuper // This is a special scanner event that contains a comment. It can be attached // to almost any kind of node, which is why it's pulled out here separately. @@ -88,8 +88,7 @@ export type StringContent = StringDVar | StringEmbExpr | TStringContent; export type DynaSymbol = ParserEvent<"dyna_symbol", { body: StringContent[], quote: string }>; export type Heredoc = ParserEvent<"heredoc", { beging: HeredocBegin, ending: string, body: StringContent[] }>; export type RegexpLiteral = ParserEvent<"regexp_literal", { parts: StringContent[], beging: string, ending: string }>; -export type String = ParserEvent<"string", { body: [TStringContent] }>; -export type StringConcat = ParserEvent<"string_concat", { body: [StringConcat | StringLiteral, StringLiteral] }>; +export type StringConcat = ParserEvent<"string_concat", { left: StringConcat | StringLiteral, right: StringLiteral }>; export type StringDVar = ParserEvent<"string_dvar", { var: Backref | VarRef }>; export type StringEmbExpr = ParserEvent<"string_embexpr", { body: [Stmts] }>; export type StringLiteral = ParserEvent<"string_literal", { body: StringContent[], quote: string }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index ab494965..77c3e41d 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -161,6 +161,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return []; case "sclass": return [node.target, node.bodystmt]; + case "string_concat": + return [node.left, node.right]; case "string_dvar": return [node.var]; case "symbols": From cb74fab483cecb01107ea62c18debcdc1e96453d Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 2 Nov 2021 12:25:22 -0400 Subject: [PATCH 390/785] arg_paren --- src/ruby/nodes/args.ts | 6 +++--- src/ruby/nodes/super.ts | 2 +- src/ruby/parser.rb | 2 +- src/types/ruby.ts | 2 +- src/utils/getChildNodes.ts | 2 ++ 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/ruby/nodes/args.ts b/src/ruby/nodes/args.ts index dc9022d8..140c906f 100644 --- a/src/ruby/nodes/args.ts +++ b/src/ruby/nodes/args.ts @@ -29,7 +29,7 @@ export const printArgParen: Plugin.Printer = ( opts, print ) => { - const argsNode = path.getValue().body[0]; + const argsNode = path.getValue().args; if (argsNode === null) { return ""; @@ -41,7 +41,7 @@ export const printArgParen: Plugin.Printer = ( if (argsNode.type === "args_forward") { return group([ "(", - indent([softline, path.call(print, "body", 0)]), + indent([softline, path.call(print, "args")]), softline, ")" ]); @@ -53,7 +53,7 @@ export const printArgParen: Plugin.Printer = ( "(", indent([ softline, - join([",", line], path.call(print, "body", 0)), + join([",", line], path.call(print, "args")), getTrailingComma(opts) ? getArgParenTrailingComma(argsNode) : "" ]), softline, diff --git a/src/ruby/nodes/super.ts b/src/ruby/nodes/super.ts index db349c51..4ca87bc8 100644 --- a/src/ruby/nodes/super.ts +++ b/src/ruby/nodes/super.ts @@ -11,7 +11,7 @@ export const printSuper: Plugin.Printer = (path, opts, print) => { // In case there are explicitly no arguments but they are using parens, // we assume they are attempting to override the initializer and pass no // arguments up. - if (args.body[0] === null) { + if (args.args === null) { return "super()"; } diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 4e4f4af7..3d17908c 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -482,7 +482,7 @@ def on_arg_paren(args) ending = (args && args[:loc].end_line > rparen[:loc].end_line) ? args : rparen - { type: :arg_paren, body: [args], loc: beging[:loc].to(ending[:loc]) } + { type: :arg_paren, args: args, loc: beging[:loc].to(ending[:loc]) } end # args_add is a parser event that represents a single argument inside a list diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 603bb57c..6e336b85 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -180,7 +180,7 @@ export type RestParam = ParserEvent<"rest_param", { name: null | Identifier }>; // These are various parser events for method calls. export type CallOperator = Op | Period | "::"; -export type ArgParen = ParserEvent<"arg_paren", { body: [Args | ArgsAddBlock | ArgsForward | null] }>; +export type ArgParen = ParserEvent<"arg_paren", { args: Args | ArgsAddBlock | ArgsForward | null }>; export type Args = ParserEvent<"args", { body: AnyNode[] }>; export type ArgsAddBlock = ParserEvent<"args_add_block", { body: [Args | ArgsAddStar, false | AnyNode] }>; export type ArgsAddStar = ParserEvent<"args_add_star", { body: [Args | ArgsAddStar, ...AnyNode[]] }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 77c3e41d..6aa40bed 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -16,6 +16,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.collection, node.index]; case "aref_field": return [node.collection, node.index]; + case "arg_paren": + return [node.args]; case "args_forward": return []; case "aryptn": From 1e469357210de5c079cdad2ed7eb5f9ce9731b59 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 2 Nov 2021 12:28:11 -0400 Subject: [PATCH 391/785] rescue_mod --- src/ruby/nodes/rescue.ts | 6 ++---- src/ruby/parser.rb | 7 ++++--- src/types/ruby.ts | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/ruby/nodes/rescue.ts b/src/ruby/nodes/rescue.ts index e1d606a8..97e86697 100644 --- a/src/ruby/nodes/rescue.ts +++ b/src/ruby/nodes/rescue.ts @@ -83,14 +83,12 @@ export const printRescueMod: Plugin.Printer = ( opts, print ) => { - const [statementDoc, valueDoc] = path.map(print, "body"); - return [ "begin", - indent([hardline, statementDoc]), + indent([hardline, path.call(print, "stmt")]), hardline, "rescue StandardError", - indent([hardline, valueDoc]), + indent([hardline, path.call(print, "val")]), hardline, "end" ]; diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 3d17908c..d7bf9813 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -2516,13 +2516,14 @@ def on_rescue(exceptions, variable, stmts, consequent) # rescue_mod represents the modifier form of a rescue clause. It accepts as # arguments the statement that may raise an error and the value that should # be used if it does. - def on_rescue_mod(statement, rescued) + def on_rescue_mod(statement, value) find_scanner_event(:@kw, 'rescue') { type: :rescue_mod, - body: [statement, rescued], - loc: statement[:loc].to(rescued[:loc]) + stmt: statement, + val: value, + loc: statement[:loc].to(value[:loc]) } end diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 6e336b85..9c93229b 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -142,7 +142,7 @@ export type IfModifier = ParserEvent<"if_mod", { pred: AnyNode, stmt: AnyNode }> export type In = ParserEvent<"in", { pttn: AnyNode, stmts: Stmts, cons: null | In | Else }>; export type Rescue = ParserEvent<"rescue", { body: [null | RescueEx, Stmts, null | Stmts] }>; export type RescueEx = ParserEvent<"rescue_ex", { body: [AnyNode, null | Field | VarField] }>; -export type RescueModifier = ParserEvent<"rescue_mod", { body: [AnyNode, AnyNode] }>; +export type RescueModifier = ParserEvent<"rescue_mod", { stmt: AnyNode, val: AnyNode }>; export type Ternary = ParserEvent<"ifop", { pred: AnyNode, tthy: AnyNode, flsy: AnyNode }>; export type Unless = ParserEvent<"unless", { pred: AnyNode, stmts: Stmts, cons: null | Elsif | Else }>; export type UnlessModifier = ParserEvent<"unless_mod", { pred: AnyNode, stmt: AnyNode }>; From c9101be8d88def88afe87953c024821525605f7b Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 2 Nov 2021 12:31:01 -0400 Subject: [PATCH 392/785] string_embexpr --- src/ruby/nodes/strings.ts | 6 +++--- src/ruby/parser.rb | 2 +- src/types/ruby.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ruby/nodes/strings.ts b/src/ruby/nodes/strings.ts index 2f8e9c68..aeb73c15 100644 --- a/src/ruby/nodes/strings.ts +++ b/src/ruby/nodes/strings.ts @@ -216,16 +216,16 @@ export const printStringEmbExpr: Plugin.Printer = ( print ) => { const node = path.getValue(); - const parts = path.call(print, "body", 0); + const doc = path.call(print, "stmts"); // If the contents of this embedded expression were originally on the same // line in the source, then we're going to leave them in place and assume // that's the way the developer wanted this expression represented. if (getStartLine(node.loc) === getEndLine(node.loc)) { - return ["#{", removeLines(parts), "}"]; + return ["#{", removeLines(doc), "}"]; } - return group(["#{", indent([softline, parts]), [softline, "}"]]); + return group(["#{", indent([softline, doc]), [softline, "}"]]); }; // Prints out a literal string. This function does its best to respect the diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index d7bf9813..8e127faa 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -2774,7 +2774,7 @@ def on_string_embexpr(stmts) stmts.bind(beging[:loc].end_char, ending[:loc].start_char) - { type: :string_embexpr, body: [stmts], loc: beging[:loc].to(ending[:loc]) } + { type: :string_embexpr, stmts: stmts, loc: beging[:loc].to(ending[:loc]) } end # String literals are either going to be a normal string or they're going diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 9c93229b..39e2ca57 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -90,7 +90,7 @@ export type Heredoc = ParserEvent<"heredoc", { beging: HeredocBegin, ending: str export type RegexpLiteral = ParserEvent<"regexp_literal", { parts: StringContent[], beging: string, ending: string }>; export type StringConcat = ParserEvent<"string_concat", { left: StringConcat | StringLiteral, right: StringLiteral }>; export type StringDVar = ParserEvent<"string_dvar", { var: Backref | VarRef }>; -export type StringEmbExpr = ParserEvent<"string_embexpr", { body: [Stmts] }>; +export type StringEmbExpr = ParserEvent<"string_embexpr", { stmts: Stmts }>; export type StringLiteral = ParserEvent<"string_literal", { body: StringContent[], quote: string }>; export type SymbolLiteral = ParserEvent<"symbol_literal", { body: [Backtick | Const | CVar | GVar | Identifier | IVar | Keyword | Op] }>; export type XStringLiteral = ParserEvent<"xstring_literal", { parts: StringContent[] }>; From 851d2b16d1309d2080fcc1fe423a68163a3a700e Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 2 Nov 2021 12:43:18 -0400 Subject: [PATCH 393/785] void_stmt --- src/ruby/parser.rb | 3 +- src/types/ruby.ts | 4 +-- src/utils/getChildNodes.ts | 63 +++++++++++++++++++++++++++++++++++++- 3 files changed, 65 insertions(+), 5 deletions(-) diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 8e127faa..18e8c405 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -514,7 +514,7 @@ def on_args_add_block(args, block) { type: :args_add_block, - body: [args, block], + body: [args, block || nil], loc: args[:loc].to(ending[:loc]) } end @@ -3188,7 +3188,6 @@ def on_vcall(value) def on_void_stmt { type: :void_stmt, - body: nil, loc: Location.fixed(line: lineno, char: char_pos) } end diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 39e2ca57..a44e5b8c 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -69,7 +69,7 @@ export type ExcessedComma = ParserEvent0<"excessed_comma">; export type Redo = ParserEvent0<"redo">; export type Retry = ParserEvent0<"retry">; export type Return0 = ParserEvent0<"return0">; -export type VoidStmt = ParserEvent<"void_stmt">; +export type VoidStmt = { type: "void_stmt", loc: Location } & Comments; export type Yield0 = ParserEvent0<"yield0">; export type Zsuper = ParserEvent0<"zsuper">; @@ -182,7 +182,7 @@ export type RestParam = ParserEvent<"rest_param", { name: null | Identifier }>; export type CallOperator = Op | Period | "::"; export type ArgParen = ParserEvent<"arg_paren", { args: Args | ArgsAddBlock | ArgsForward | null }>; export type Args = ParserEvent<"args", { body: AnyNode[] }>; -export type ArgsAddBlock = ParserEvent<"args_add_block", { body: [Args | ArgsAddStar, false | AnyNode] }>; +export type ArgsAddBlock = ParserEvent<"args_add_block", { body: [Args | ArgsAddStar, null | AnyNode] }>; export type ArgsAddStar = ParserEvent<"args_add_star", { body: [Args | ArgsAddStar, ...AnyNode[]] }>; export type BlockVar = ParserEvent<"block_var", { params: Params, locals: Identifier[] }>; export type BraceBlock = ParserEvent<"brace_block", { lbrace: Lbrace, block_var: null | BlockVar, stmts: Stmts }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 6aa40bed..0cfa99a8 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -2,8 +2,35 @@ import type { Ruby } from "../types"; type ChildNode = Ruby.AnyNode | null; +function throwBadNode(node: never): never; +function throwBadNode(node: Ruby.AnyNode) { + throw new Error(`Unknown node ${node.type}`); +} + function getChildNodes(node: Ruby.AnyNode): ChildNode[] { switch (node.type) { + case "@CHAR": + case "@__end__": + case "@backref": + case "@backtick": + case "@const": + case "@cvar": + case "@float": + case "@gvar": + case "@heredoc_beg": + case "@ident": + case "@imaginary": + case "@int": + case "@ivar": + case "@kw": + case "@label": + case "@lbrace": + case "@lparen": + case "@op": + case "@period": + case "@rational": + case "@tstring_content": + return []; case "BEGIN": return [node.lbrace, node.stmts]; case "END": @@ -153,6 +180,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return []; case "regexp_literal": return node.parts; + case "rescue_mod": + return [node.stmt, node.val]; case "rest_param": return [node.name]; case "retry": @@ -167,6 +196,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.left, node.right]; case "string_dvar": return [node.var]; + case "string_embexpr": + return [node.stmts]; case "symbols": return []; case "top_const_field": @@ -191,6 +222,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.value]; case "vcall": return [node.value]; + case "void_stmt": + return []; case "when": return [node.args, node.stmts, node.cons]; case "while": @@ -248,7 +281,31 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { } case "paren": return [node.lparen, node.body[0]]; - default: { + + + + case "args": + case "args_add_block": + case "args_add_star": + case "array": + case "bodystmt": + case "massign": + case "method_add_arg": + case "method_add_block": + case "mlhs": + case "mlhs_add_post": + case "mlhs_add_star": + case "mlhs_paren": + case "mrhs": + case "mrhs_add_star": + case "mrhs_new_from_args": + case "stmts": + case "string_literal": + case "super": + case "symbol_literal": + case "rescue": + case "rescue_ex": + case "unary": { if (Array.isArray(node.body)) { return node.body.filter( (child: any) => child && typeof child === "object" @@ -256,6 +313,10 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { } return []; } + + + default: + throwBadNode(node); } } From cbc33a144c217c31ee03e341dcbad7bcfbc2159c Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 2 Nov 2021 12:46:41 -0400 Subject: [PATCH 394/785] super --- src/ruby/nodes/super.ts | 13 ++++--------- src/ruby/parser.rb | 6 +++--- src/types/ruby.ts | 2 +- src/utils/getChildNodes.ts | 3 ++- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/ruby/nodes/super.ts b/src/ruby/nodes/super.ts index 4ca87bc8..f5618dd2 100644 --- a/src/ruby/nodes/super.ts +++ b/src/ruby/nodes/super.ts @@ -5,25 +5,20 @@ import { literal } from "../../utils"; const { align, group, join, line } = prettier; export const printSuper: Plugin.Printer = (path, opts, print) => { - const args = path.getValue().body[0]; + const { args } = path.getValue(); if (args.type === "arg_paren") { // In case there are explicitly no arguments but they are using parens, - // we assume they are attempting to override the initializer and pass no + // we assume they are attempting to override a parent method and pass no // arguments up. - if (args.args === null) { - return "super()"; - } - - return ["super", path.call(print, "body", 0)]; + return args.args === null ? "super()" : ["super", path.call(print, "args")]; } const keyword = "super "; - const argsDocs = path.call(print, "body", 0); return group([ keyword, - align(keyword.length, group(join([",", line], argsDocs))) + align(keyword.length, group(join([",", line], path.call(print, "args")))) ]); }; diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 18e8c405..a0cbd81a 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -2801,10 +2801,10 @@ def on_string_literal(string) # any number of arguments. It can optionally use parentheses (represented # by an arg_paren node) or just skip straight to the arguments (with an # args_add_block node). - def on_super(contents) - event = find_scanner_event(:@kw, 'super') + def on_super(args) + keyword = find_scanner_event(:@kw, 'super') - { type: :super, body: [contents], loc: event[:loc].to(contents[:loc]) } + { type: :super, args: args, loc: keyword[:loc].to(args[:loc]) } end # symbeg is a scanner event that represents the beginning of a symbol literal. diff --git a/src/types/ruby.ts b/src/types/ruby.ts index a44e5b8c..fcb00519 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -156,7 +156,7 @@ export type WhileModifier = ParserEvent<"while_mod", { pred: AnyNode, stmt: AnyN export type Break = ParserEvent<"break", { args: Args | ArgsAddBlock }>; export type Next = ParserEvent<"next", { args: Args | ArgsAddBlock }>; export type Return = ParserEvent<"return", { args: Args | ArgsAddBlock }>; -export type Super = ParserEvent<"super", { body: [Args | ArgParen | ArgsAddBlock] }>; +export type Super = ParserEvent<"super", { args: Args | ArgParen | ArgsAddBlock }>; export type Yield = ParserEvent<"yield", { args: ArgsAddBlock | Paren }>; // These are various parser events for pattern matching. diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 0cfa99a8..c1a4d949 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -198,6 +198,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.var]; case "string_embexpr": return [node.stmts]; + case "super": + return [node.args]; case "symbols": return []; case "top_const_field": @@ -301,7 +303,6 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { case "mrhs_new_from_args": case "stmts": case "string_literal": - case "super": case "symbol_literal": case "rescue": case "rescue_ex": From 988b5463906df7c18a9f271205d8e7d6c32c402b Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 2 Nov 2021 19:11:26 -0400 Subject: [PATCH 395/785] unary --- src/ruby/nodes/operators.ts | 10 +++++----- src/ruby/nodes/return.ts | 2 +- src/ruby/parser.rb | 12 ++++++------ src/types/ruby.ts | 2 +- src/utils/getChildNodes.ts | 5 +++-- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/ruby/nodes/operators.ts b/src/ruby/nodes/operators.ts index 90e80cf6..f55ce594 100644 --- a/src/ruby/nodes/operators.ts +++ b/src/ruby/nodes/operators.ts @@ -57,17 +57,17 @@ export const printDot3: Plugin.Printer = (path, opts, print) => { export const printUnary: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); - const contentsDoc = path.call(print, "body", 0); + const valueDoc = path.call(print, "val"); - if (node.oper === "not") { + if (node.op === "not") { // Here we defer to the original source, as it's kind of difficult to // determine if we can actually remove the parentheses being used. if (node.paren) { - return ["not", "(", contentsDoc, ")"]; + return ["not", "(", valueDoc, ")"]; } else { - return ["not", " ", contentsDoc]; + return ["not", " ", valueDoc]; } } - return [node.oper, contentsDoc]; + return [node.op, valueDoc]; }; diff --git a/src/ruby/nodes/return.ts b/src/ruby/nodes/return.ts index f9fe34ca..e5bc2ee5 100644 --- a/src/ruby/nodes/return.ts +++ b/src/ruby/nodes/return.ts @@ -25,7 +25,7 @@ function canSkipParens(paren: Ruby.Paren) { } // return (not a) - if (stmt.type === "unary" && stmt.oper === "not") { + if (stmt.type === "unary" && stmt.op === "not") { return false; } diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index a0cbd81a..104e82bf 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -2994,8 +2994,8 @@ def on_tstring_end(value) # in !, ~, or not. We have somewhat special handling of the not operator # since if it has parentheses they don't get reported as a paren node for # some reason. - def on_unary(oper, value) - if oper == :not + def on_unary(operator, value) + if operator == :not node = find_scanner_event(:@kw, 'not') paren = source[node[:loc].end_char...value[:loc].start_char].include?('(') @@ -3003,8 +3003,8 @@ def on_unary(oper, value) { type: :unary, - oper: oper, - body: [value], + op: operator, + val: value, paren: paren, loc: node[:loc].to(ending[:loc]) } @@ -3024,8 +3024,8 @@ def on_unary(oper, value) { type: :unary, - oper: oper[0], - body: [value], + op: operator[0], + val: value, loc: beging[:loc].to(value[:loc]) } end diff --git a/src/types/ruby.ts b/src/types/ruby.ts index fcb00519..ebb9429a 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -208,7 +208,7 @@ export type Dot3 = ParserEvent<"dot3", Dot>; export type END = ParserEvent<"END", { lbrace: Lbrace, stmts: Stmts }>; export type Paren = ParserEvent<"paren", { body: [AnyNode], lparen: Lparen }>; export type TopConstRef = ParserEvent<"top_const_ref", { constant: Const }>; -export type Unary = ParserEvent<"unary", { body: [AnyNode], oper: string, paren: boolean | undefined }>; +export type Unary = ParserEvent<"unary", { val: AnyNode, op: string, paren: boolean | undefined }>; export type VarRef = ParserEvent<"var_ref", { value: Const | CVar | GVar | Identifier | IVar | Keyword }>; // These are various parser events for statements you would find in a class definition body. diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index c1a4d949..01f3df5b 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -206,6 +206,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.constant]; case "top_const_ref": return [node.constant]; + case "unary": + return [node.val]; case "undef": return node.syms; case "unless": @@ -305,8 +307,7 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { case "string_literal": case "symbol_literal": case "rescue": - case "rescue_ex": - case "unary": { + case "rescue_ex": { if (Array.isArray(node.body)) { return node.body.filter( (child: any) => child && typeof child === "object" From a7b5af60bdacb267f97b1fd6ef372a519698b0ea Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 3 Nov 2021 10:16:43 -0400 Subject: [PATCH 396/785] massign --- src/ruby/nodes/massign.ts | 21 +++++++++------------ src/ruby/parser.rb | 13 +++++++++---- src/types/ruby.ts | 2 +- src/utils/getChildNodes.ts | 3 ++- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/ruby/nodes/massign.ts b/src/ruby/nodes/massign.ts index 65779a65..21d00d0d 100644 --- a/src/ruby/nodes/massign.ts +++ b/src/ruby/nodes/massign.ts @@ -8,22 +8,19 @@ export const printMAssign: Plugin.Printer = ( opts, print ) => { - let right = path.call(print, "body", 1); - - if ( - ["mrhs_add_star", "mrhs_new_from_args"].includes( - path.getValue().body[1].type - ) - ) { - right = group(join([",", line], right)); + const node = path.getValue(); + let valueDoc = path.call(print, "val"); + + if (["mrhs_add_star", "mrhs_new_from_args"].includes(node.val.type)) { + valueDoc = group(join([",", line], valueDoc)); } - const parts: Plugin.Doc[] = [join([",", line], path.call(print, "body", 0))]; - if ((path.getValue().body[0] as any).comma) { - parts.push(","); + const targetDoc: Plugin.Doc[] = [join([",", line], path.call(print, "tgt"))]; + if ((node.tgt as any).comma) { + targetDoc.push(","); } - return group([group(parts), " =", indent([line, right])]); + return group([group(targetDoc), " =", indent([line, valueDoc])]); }; export const printMLHS: Plugin.Printer = (path, opts, print) => { diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 104e82bf..b104b66b 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -1927,11 +1927,16 @@ def on_lparen(value) # In this case a would receive only the first value of the foo enumerable, # in which case we need to explicitly track the comma and add it onto the # child node. - def on_massign(left, right) - comma_range = left[:loc].end_char...right[:loc].start_char - left[:comma] = true if source[comma_range].strip.start_with?(',') + def on_massign(target, value) + comma_range = target[:loc].end_char...value[:loc].start_char + target[:comma] = true if source[comma_range].strip.start_with?(',') - { type: :massign, body: [left, right], loc: left[:loc].to(right[:loc]) } + { + type: :massign, + tgt: target, + val: value, + loc: target[:loc].to(value[:loc]) + } end # method_add_arg is a parser event that represents a method call with diff --git a/src/types/ruby.ts b/src/types/ruby.ts index ebb9429a..0149e8d0 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -122,7 +122,7 @@ export type TopConstField = ParserEvent<"top_const_field", { constant: Const }>; export type VarField = ParserEvent<"var_field", { value: null | Const | CVar | GVar | Identifier | IVar }>; // These are various parser events that have to do with multiple assignment. -export type Massign = ParserEvent<"massign", { body: [Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen, AnyNode] }>; +export type Massign = ParserEvent<"massign", { tgt: Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen, val: AnyNode }>; export type Mlhs = ParserEvent<"mlhs", { body: (ArefField | Field | Identifier | MlhsParen | VarField)[], comma: undefined | true }>; export type MlhsAddPost = ParserEvent<"mlhs_add_post", { body: [MlhsAddStar, Mlhs] }>; export type MlhsAddStar = ParserEvent<"mlhs_add_star", { body: [Mlhs, null | ArefField | Field | Identifier | VarField] }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 01f3df5b..fdc9435a 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -162,6 +162,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.name]; case "lambda": return [node.params, node.stmts]; + case "massign": + return [node.tgt, node.val]; case "module": return [node.constant, node.bodystmt]; case "next": @@ -293,7 +295,6 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { case "args_add_star": case "array": case "bodystmt": - case "massign": case "method_add_arg": case "method_add_block": case "mlhs": From 67e282ce8d4ac05e7fddc829cd6f9d83dd4ca2c6 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 3 Nov 2021 10:29:41 -0400 Subject: [PATCH 397/785] mlhs, mlhs_add_post, mlhs_add_star, mlhs_paren --- src/ruby/nodes/massign.ts | 20 +++++++++++--------- src/ruby/parser.rb | 16 +++++++++------- src/types/ruby.ts | 8 ++++---- src/utils/getChildNodes.ts | 12 ++++++++---- 4 files changed, 32 insertions(+), 24 deletions(-) diff --git a/src/ruby/nodes/massign.ts b/src/ruby/nodes/massign.ts index 21d00d0d..1238cd1a 100644 --- a/src/ruby/nodes/massign.ts +++ b/src/ruby/nodes/massign.ts @@ -24,7 +24,7 @@ export const printMAssign: Plugin.Printer = ( }; export const printMLHS: Plugin.Printer = (path, opts, print) => { - return path.map(print, "body"); + return path.map(print, "parts"); }; export const printMLHSAddPost: Plugin.Printer = ( @@ -33,8 +33,8 @@ export const printMLHSAddPost: Plugin.Printer = ( print ) => { return [ - ...(path.call(print, "body", 0) as Plugin.Doc[]), - ...(path.call(print, "body", 1) as Plugin.Doc[]) + ...(path.call(print, "star") as Plugin.Doc[]), + ...(path.call(print, "mlhs") as Plugin.Doc[]) ]; }; @@ -43,13 +43,14 @@ export const printMLHSAddStar: Plugin.Printer = ( opts, print ) => { + const node = path.getValue(); const parts: Plugin.Doc[] = ["*"]; - if (path.getValue().body[1]) { - parts.push(path.call(print, "body", 1)); + if (node.star) { + parts.push(path.call(print, "star")); } - return [...(path.call(print, "body", 0) as Plugin.Doc[]), parts]; + return [...(path.call(print, "mlhs") as Plugin.Doc[]), parts]; }; export const printMLHSParen: Plugin.Printer = ( @@ -61,15 +62,16 @@ export const printMLHSParen: Plugin.Printer = ( // If we're nested in brackets as part of the left hand side of an // assignment, i.e., (a, b, c) = 1, 2, 3 // ignore the current node and just go straight to the content - return path.call(print, "body", 0); + return path.call(print, "cnts"); } + const node = path.getValue(); const parts: Plugin.Doc[] = [ softline, - join([",", line], path.call(print, "body", 0)) + join([",", line], path.call(print, "cnts")) ]; - if ((path.getValue().body[0] as any).comma) { + if ((node.cnts as any).comma) { parts.push(","); } diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index b104b66b..07cb5e5a 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -1972,17 +1972,17 @@ def on_method_add_block(method_add_arg, block) # side of a multiple assignment. It is followed by any number of mlhs_add # nodes that each represent another variable being assigned. def on_mlhs_new - { type: :mlhs, body: [], loc: Location.fixed(line: lineno, char: char_pos) } + { type: :mlhs, parts: [], loc: Location.fixed(line: lineno, char: char_pos) } end # An mlhs_add is a parser event that represents adding another variable # onto a list of assignments. It accepts as arguments the parent mlhs node # as well as the part that is being added to the list. def on_mlhs_add(mlhs, part) - if mlhs[:body].empty? - { type: :mlhs, body: [part], loc: part[:loc] } + if mlhs[:parts].empty? + { type: :mlhs, parts: [part], loc: part[:loc] } else - { type: :mlhs, body: mlhs[:body] << part, loc: mlhs[:loc].to(part[:loc]) } + { type: :mlhs, parts: mlhs[:parts] << part, loc: mlhs[:loc].to(part[:loc]) } end end @@ -1994,7 +1994,8 @@ def on_mlhs_add(mlhs, part) def on_mlhs_add_post(mlhs_add_star, mlhs) { type: :mlhs_add_post, - body: [mlhs_add_star, mlhs], + star: mlhs_add_star, + mlhs: mlhs, loc: mlhs_add_star[:loc].to(mlhs[:loc]) } end @@ -2009,7 +2010,8 @@ def on_mlhs_add_star(mlhs, part) { type: :mlhs_add_star, - body: [mlhs, part], + mlhs: mlhs, + star: part, loc: beging[:loc].to(ending[:loc]) } end @@ -2025,7 +2027,7 @@ def on_mlhs_paren(contents) comma_range = beging[:loc].end_char...ending[:loc].start_char contents[:comma] = true if source[comma_range].strip.end_with?(',') - { type: :mlhs_paren, body: [contents], loc: beging[:loc].to(ending[:loc]) } + { type: :mlhs_paren, cnts: contents, loc: beging[:loc].to(ending[:loc]) } end # module is a parser event that represents defining a module. It accepts diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 0149e8d0..c58f08e7 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -123,10 +123,10 @@ export type VarField = ParserEvent<"var_field", { value: null | Const | CVar | G // These are various parser events that have to do with multiple assignment. export type Massign = ParserEvent<"massign", { tgt: Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen, val: AnyNode }>; -export type Mlhs = ParserEvent<"mlhs", { body: (ArefField | Field | Identifier | MlhsParen | VarField)[], comma: undefined | true }>; -export type MlhsAddPost = ParserEvent<"mlhs_add_post", { body: [MlhsAddStar, Mlhs] }>; -export type MlhsAddStar = ParserEvent<"mlhs_add_star", { body: [Mlhs, null | ArefField | Field | Identifier | VarField] }>; -export type MlhsParen = ParserEvent<"mlhs_paren", { body: [Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen] }>; +export type Mlhs = ParserEvent<"mlhs", { parts: (ArefField | Field | Identifier | MlhsParen | VarField)[], comma: undefined | true }>; +export type MlhsAddPost = ParserEvent<"mlhs_add_post", { star: MlhsAddStar, mlhs: Mlhs }>; +export type MlhsAddStar = ParserEvent<"mlhs_add_star", { mlhs: Mlhs, star: null | ArefField | Field | Identifier | VarField }>; +export type MlhsParen = ParserEvent<"mlhs_paren", { cnts: Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen }>; export type Mrhs = ParserEvent<"mrhs", { body: [] }>; export type MrhsAddStar = ParserEvent<"mrhs_add_star", { body: [Mrhs | MrhsNewFromArgs, AnyNode] }>; export type MrhsNewFromArgs = ParserEvent<"mrhs_new_from_args", { body: [Args | ArgsAddStar, AnyNode], oper: string }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index fdc9435a..f671d898 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -164,6 +164,14 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.params, node.stmts]; case "massign": return [node.tgt, node.val]; + case "mlhs": + return node.parts; + case "mlhs_add_post": + return [node.star, node.mlhs]; + case "mlhs_add_star": + return [node.mlhs, node.star]; + case "mlhs_paren": + return [node.cnts]; case "module": return [node.constant, node.bodystmt]; case "next": @@ -297,10 +305,6 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { case "bodystmt": case "method_add_arg": case "method_add_block": - case "mlhs": - case "mlhs_add_post": - case "mlhs_add_star": - case "mlhs_paren": case "mrhs": case "mrhs_add_star": case "mrhs_new_from_args": From ad035a7573193f99b29dd0304aa44ca6e7e83b98 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 3 Nov 2021 10:45:30 -0400 Subject: [PATCH 398/785] array --- src/ruby/nodes/arrays.ts | 25 ++++++++++++------------- src/ruby/nodes/hashes.ts | 4 ++-- src/ruby/nodes/return.ts | 10 +++++----- src/ruby/parser.rb | 6 +++--- src/types/ruby.ts | 4 ++-- src/utils/getChildNodes.ts | 5 +++-- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/ruby/nodes/arrays.ts b/src/ruby/nodes/arrays.ts index e86ee831..28f2a415 100644 --- a/src/ruby/nodes/arrays.ts +++ b/src/ruby/nodes/arrays.ts @@ -88,11 +88,11 @@ const arrayLiteralStarts = { // will have one child that contains all of the elements of the array. export const printArray: Plugin.Printer = (path, opts, print) => { const array = path.getValue(); - const args = array.body[0]; + const contents = array.cnts; // If there is no inner arguments node, then we're dealing with an empty // array, so we can go ahead and return. - if (args === null) { + if (contents === null) { return printEmptyCollection(path, opts, "[", "]"); } @@ -100,39 +100,38 @@ export const printArray: Plugin.Printer = (path, opts, print) => { // array literal. In that case we're going to print out the body (which will // return to us an array with the first one being the start of the array) and // send that over to the printArrayLiteral function. - if (args.type !== "args" && args.type !== "args_add_star") { + if (contents.type !== "args" && contents.type !== "args_add_star") { return path.call( (arrayPath) => printArrayLiteral( - arrayLiteralStarts[args.type], + arrayLiteralStarts[contents.type], arrayPath.map(print, "elems") ), - "body", - 0 + "cnts" ); } if (opts.rubyArrayLiteral) { // If we have an array that contains only simple string literals with no // spaces or interpolation, then we're going to print a %w array. - if (isStringArray(args)) { + if (isStringArray(contents)) { const printString = (stringPath: Plugin.Path) => stringPath.call(print, "body", 0); - const nodePath = path as Plugin.Path<{ body: [{ body: Ruby.StringLiteral[] }] }>; - const parts = nodePath.map(printString, "body", 0, "body"); + const nodePath = path as Plugin.Path<{ cnts: { body: Ruby.StringLiteral[] } }>; + const parts = nodePath.map(printString, "cnts", "body"); return printArrayLiteral("%w", parts); } // If we have an array that contains only simple symbol literals with no // interpolation, then we're going to print a %i array. - if (isSymbolArray(args)) { + if (isSymbolArray(contents)) { const printSymbol = (symbolPath: Plugin.Path) => symbolPath.call(print, "body", 0); - const nodePath = path as Plugin.Path<{ body: [{ body: Ruby.SymbolLiteral[] }] }>; - const parts = nodePath.map(printSymbol, "body", 0, "body"); + const nodePath = path as Plugin.Path<{ cnts: { body: Ruby.SymbolLiteral[] } }>; + const parts = nodePath.map(printSymbol, "cnts", "body"); return printArrayLiteral("%i", parts); } @@ -144,7 +143,7 @@ export const printArray: Plugin.Printer = (path, opts, print) => { "[", indent([ softline, - join([",", line], path.call(print, "body", 0)), + join([",", line], path.call(print, "cnts")), getTrailingComma(opts) ? ifBreak(",", "") : "" ]), softline, diff --git a/src/ruby/nodes/hashes.ts b/src/ruby/nodes/hashes.ts index bf11591f..f3b0e4b6 100644 --- a/src/ruby/nodes/hashes.ts +++ b/src/ruby/nodes/hashes.ts @@ -141,7 +141,7 @@ export const printHash: Plugin.Printer = (path, opts, print) => { // Hashes normally have a single assoclist_from_args child node. If it's // missing, then it means we're dealing with an empty hash, so we can just // exit here and print. - if (node.contents === null) { + if (node.cnts === null) { return printEmptyCollection(path, opts, "{", "}"); } @@ -149,7 +149,7 @@ export const printHash: Plugin.Printer = (path, opts, print) => { "{", indent([ line, - path.call(print, "contents"), + path.call(print, "cnts"), getTrailingComma(opts) ? ifBreak(",", "") : "" ]), line, diff --git a/src/ruby/nodes/return.ts b/src/ruby/nodes/return.ts index e5bc2ee5..f78aff1b 100644 --- a/src/ruby/nodes/return.ts +++ b/src/ruby/nodes/return.ts @@ -38,7 +38,7 @@ export const printReturn: Plugin.Printer = (path, opts, print) => { if (node.args.type === "args_add_block") { const args = node.args.body[0]; - let steps = ["args", "body", 0]; + const steps = ["args", "body", 0]; if (args.type === "args" && args.body.length === 1 && args.body[0]) { // This is the first and only argument being passed to the return keyword. @@ -55,17 +55,17 @@ export const printReturn: Plugin.Printer = (path, opts, print) => { } arg = (arg.body[0] as Ruby.Stmts).body[0]; - steps = steps.concat("body", 0, "body", 0); + steps.push("body", 0, "body", 0); } // If we're returning an array literal that isn't a special array that has // at least 2 elements, then we want to grab the arguments so that we can // print them out as if they were normal return arguments. - if (arg.type === "array" && arg.body[0]) { - const contents = arg.body[0]; + if (arg.type === "array" && arg.cnts) { + const contents = arg.cnts; if ((contents.type === "args" || contents.type === "args_add_star") && contents.body.length > 1) { - steps = steps.concat("body", 0, "body", 0); + steps.push("body", 0, "cnts"); } } } diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 07cb5e5a..71dfa31a 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -557,12 +557,12 @@ def on_array(contents) beging = find_scanner_event(:@lbracket) ending = find_scanner_event(:@rbracket) - { type: :array, body: [contents], loc: beging[:loc].to(ending[:loc]) } + { type: :array, cnts: contents, loc: beging[:loc].to(ending[:loc]) } else ending = find_scanner_event(:@tstring_end) contents[:loc] = contents[:loc].to(ending[:loc]) - { type: :array, body: [contents], loc: contents[:loc] } + { type: :array, cnts: contents, loc: contents[:loc] } end end @@ -1553,7 +1553,7 @@ def on_hash(assoclist_from_args) { type: :hash, - contents: assoclist_from_args, + cnts: assoclist_from_args, loc: beging[:loc].to(ending[:loc]) } end diff --git a/src/types/ruby.ts b/src/types/ruby.ts index c58f08e7..8ec37aad 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -96,7 +96,7 @@ export type SymbolLiteral = ParserEvent<"symbol_literal", { body: [Backtick | Co export type XStringLiteral = ParserEvent<"xstring_literal", { parts: StringContent[] }>; // These are various parser events that have to do with arrays. -export type Array = ParserEvent<"array", { body: [null | Args | ArgsAddStar | Qsymbols | Qwords | Symbols | Words] }>; +export type Array = ParserEvent<"array", { cnts: null | Args | ArgsAddStar | Qsymbols | Qwords | Symbols | Words }>; export type Qsymbols = ParserEvent<"qsymbols", { elems: TStringContent[] }>; export type Qwords = ParserEvent<"qwords", { elems: TStringContent[] }>; export type Symbols = ParserEvent<"symbols", { elems: Word[] }>; @@ -109,7 +109,7 @@ export type AssocNew = ParserEvent<"assoc_new", { key: AnyNode, value: AnyNode } export type AssocSplat = ParserEvent<"assoc_splat", { value: AnyNode }>; export type AssoclistFromArgs = ParserEvent<"assoclist_from_args", { assocs: HashContent[] }>; export type BareAssocHash = ParserEvent<"bare_assoc_hash", { assocs: HashContent[] }>; -export type Hash = ParserEvent<"hash", { contents: null | AssoclistFromArgs }>; +export type Hash = ParserEvent<"hash", { cnts: null | AssoclistFromArgs }>; // These are various parser events for assignment. type Assignable = ArefField | ConstPathField | Field | TopConstField | VarField; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index f671d898..6777cabd 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -47,6 +47,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.args]; case "args_forward": return []; + case "array": + return [node.cnts]; case "aryptn": return [node.constant, ...node.reqs, node.rest, ...node.posts]; case "assign": @@ -139,7 +141,7 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { case "for": return [node.iterator, node.enumerable, node.stmts]; case "hash": - return [node.contents]; + return [node.cnts]; case "hshptn": { const childNodes: ChildNode[] = [node.constant]; @@ -301,7 +303,6 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { case "args": case "args_add_block": case "args_add_star": - case "array": case "bodystmt": case "method_add_arg": case "method_add_block": From c847cee83bf971abf1cc4e13d69dc0a921f20773 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 3 Nov 2021 10:53:51 -0400 Subject: [PATCH 399/785] paren --- src/ruby/nodes/flow.ts | 4 ++-- src/ruby/nodes/lambdas.ts | 2 +- src/ruby/nodes/methods.ts | 2 +- src/ruby/nodes/return.ts | 9 +++++---- src/ruby/nodes/statements.ts | 4 ++-- src/ruby/parser.rb | 2 +- src/types/ruby.ts | 4 ++-- src/utils/getChildNodes.ts | 4 ++-- 8 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/ruby/nodes/flow.ts b/src/ruby/nodes/flow.ts index af450825..2f1d41b5 100644 --- a/src/ruby/nodes/flow.ts +++ b/src/ruby/nodes/flow.ts @@ -32,13 +32,13 @@ function printFlowControl(keyword: string): Plugin.Printer { const paren = node.args.body[0].body[0]; if (paren && paren.type === "paren") { - const stmts = (paren.body[0] as Ruby.Stmts).body; + const stmts = (paren.cnts as Ruby.Stmts).body; // Here we're checking if we can skip past the parentheses entirely. if (stmts.length === 1 && !unskippableParens.includes(stmts[0].type)) { return [ `${keyword} `, - (path as any).call(print, "args", "body", 0, "body", 0, "body", 0) + (path as any).call(print, "args", "body", 0, "body", 0, "cnts") ]; } diff --git a/src/ruby/nodes/lambdas.ts b/src/ruby/nodes/lambdas.ts index ad71dde3..16c0c028 100644 --- a/src/ruby/nodes/lambdas.ts +++ b/src/ruby/nodes/lambdas.ts @@ -18,7 +18,7 @@ function printLambdaParams( // we're looking at a paren node, so we'll descend one level deeper to get at // the actual params node. if (node.type !== "params") { - node = node.body[0]; + node = node.cnts; } // If we don't have any params at all, then we're just going to bail out and diff --git a/src/ruby/nodes/methods.ts b/src/ruby/nodes/methods.ts index 72a02968..553037e3 100644 --- a/src/ruby/nodes/methods.ts +++ b/src/ruby/nodes/methods.ts @@ -51,7 +51,7 @@ export const printSingleLineMethod: Plugin.Printer = ( // If we have any kind of parameters, we're going to print the whole // parentheses. If we don't, then we're just going to skip them entirely. - if (node.paren && node.paren.body[0].body.some((type) => type)) { + if (node.paren && node.paren.cnts.body.some((type) => type)) { paramsDoc = path.call(print, "paren"); } diff --git a/src/ruby/nodes/return.ts b/src/ruby/nodes/return.ts index f78aff1b..8ea2a2c5 100644 --- a/src/ruby/nodes/return.ts +++ b/src/ruby/nodes/return.ts @@ -7,7 +7,7 @@ const { group, ifBreak, indent, line, join, softline } = prettier; // You can't skip the parentheses if you have comments or certain operators with // lower precedence than the return keyword. function canSkipParens(paren: Ruby.Paren) { - const stmts = paren.body[0] as Ruby.Stmts; + const stmts = paren.cnts as Ruby.Stmts; // return( // # a @@ -43,6 +43,7 @@ export const printReturn: Plugin.Printer = (path, opts, print) => { if (args.type === "args" && args.body.length === 1 && args.body[0]) { // This is the first and only argument being passed to the return keyword. let arg = args.body[0]; + steps.push("body", 0); // If the body of the return contains parens, then just skip directly to // the content of the parens so that we can skip printing parens if we @@ -54,8 +55,8 @@ export const printReturn: Plugin.Printer = (path, opts, print) => { return ["return", path.call(print, "args")]; } - arg = (arg.body[0] as Ruby.Stmts).body[0]; - steps.push("body", 0, "body", 0); + arg = (arg.cnts as Ruby.Stmts).body[0]; + steps.push("cnts", "body", 0); } // If we're returning an array literal that isn't a special array that has @@ -65,7 +66,7 @@ export const printReturn: Plugin.Printer = (path, opts, print) => { const contents = arg.cnts; if ((contents.type === "args" || contents.type === "args_add_star") && contents.body.length > 1) { - steps.push("body", 0, "cnts"); + steps.push("cnts"); } } } diff --git a/src/ruby/nodes/statements.ts b/src/ruby/nodes/statements.ts index fc829c1f..594b9328 100644 --- a/src/ruby/nodes/statements.ts +++ b/src/ruby/nodes/statements.ts @@ -53,13 +53,13 @@ export const printBodyStmt: Plugin.Printer = ( const argNodeTypes = ["args", "args_add_star", "args_add_block"]; export const printParen: Plugin.Printer = (path, opts, print) => { - const contentNode = path.getValue().body[0]; + const contentNode = path.getValue().cnts; if (!contentNode) { return [path.call(print, "lparen"), ")"]; } - let contentDoc = path.call(print, "body", 0); + let contentDoc = path.call(print, "cnts"); // If the content is params, we're going to let it handle its own parentheses // so that it breaks nicely. diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 71dfa31a..ab13891a 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -2222,7 +2222,7 @@ def on_paren(contents) { type: :paren, lparen: lparen, - body: [contents], + cnts: contents, loc: lparen[:loc].to(rparen[:loc]) } end diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 8ec37aad..d4da618c 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -167,7 +167,7 @@ export type Rassign = ParserEvent<"rassign", { value: AnyNode, operator: Op | Ke // These are various parser events for method declarations. type DefName = Backtick | Const | Identifier | Keyword | Op; -type ParenAroundParams = Omit & { body: [Params] }; +type ParenAroundParams = Omit & { cnts: Params }; export type Blockarg = ParserEvent<"blockarg", { name: Identifier }>; export type Def = ParserEvent<"def", { name: DefName, params: Params | Paren, bodystmt: Bodystmt }>; @@ -206,7 +206,7 @@ export type Defined = ParserEvent<"defined", { value: AnyNode }>; export type Dot2 = ParserEvent<"dot2", Dot>; export type Dot3 = ParserEvent<"dot3", Dot>; export type END = ParserEvent<"END", { lbrace: Lbrace, stmts: Stmts }>; -export type Paren = ParserEvent<"paren", { body: [AnyNode], lparen: Lparen }>; +export type Paren = ParserEvent<"paren", { lparen: Lparen, cnts: AnyNode }>; export type TopConstRef = ParserEvent<"top_const_ref", { constant: Const }>; export type Unary = ParserEvent<"unary", { val: AnyNode, op: string, paren: boolean | undefined }>; export type VarRef = ParserEvent<"var_ref", { value: Const | CVar | GVar | Identifier | IVar | Keyword }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 6777cabd..a1f2a6ca 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -180,6 +180,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.args]; case "opassign": return [node.target, node.operator, node.value]; + case "paren": + return [node.lparen, node.cnts]; case "program": return [node.stmts]; case "qsymbols": @@ -295,8 +297,6 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return parts; } - case "paren": - return [node.lparen, node.body[0]]; From 3bb408314940303245abcd2bbec439db4a90287b Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 3 Nov 2021 11:03:18 -0400 Subject: [PATCH 400/785] rescue --- src/ruby/nodes/rescue.ts | 27 ++++++++++++++------------- src/ruby/parser.rb | 13 ++++++++----- src/types/ruby.ts | 4 ++-- src/utils/getChildNodes.ts | 8 +++++--- 4 files changed, 29 insertions(+), 23 deletions(-) diff --git a/src/ruby/nodes/rescue.ts b/src/ruby/nodes/rescue.ts index 97e86697..b64317a9 100644 --- a/src/ruby/nodes/rescue.ts +++ b/src/ruby/nodes/rescue.ts @@ -21,10 +21,11 @@ export const printEnsure: Plugin.Printer = (path, opts, print) => { }; export const printRescue: Plugin.Printer = (path, opts, print) => { + const node = path.getValue(); const parts: Plugin.Doc[] = ["rescue"]; - if (path.getValue().body[0]) { - parts.push(align("rescue ".length, path.call(print, "body", 0))); + if (node.extn) { + parts.push(align("rescue ".length, path.call(print, "extn"))); } else { // If you don't specify an error to rescue in a `begin/rescue` block, then // implicitly you're rescuing from `StandardError`. In this case, we're @@ -32,16 +33,16 @@ export const printRescue: Plugin.Printer = (path, opts, print) => { parts.push(" StandardError"); } - const bodystmt = path.call(print, "body", 1) as Plugin.Doc[]; + const stmtsDoc = path.call(print, "stmts") as Plugin.Doc[]; - if (bodystmt.length > 0) { - parts.push(indent([hardline, bodystmt])); + if (stmtsDoc.length > 0) { + parts.push(indent([hardline, stmtsDoc])); } // This is the next clause on the `begin` statement, either another // `rescue`, and `ensure`, or an `else` clause. - if (path.getValue().body[2]) { - parts.push([hardline, path.call(print, "body", 2)]); + if (node.cons) { + parts.push([hardline, path.call(print, "cons")]); } return group(parts); @@ -54,25 +55,25 @@ export const printRescueEx: Plugin.Printer = ( opts, print ) => { - const [exception, variable] = path.getValue().body; + const node = path.getValue(); const parts: Plugin.Doc[] = []; - if (exception) { + if (node.extns) { // If there's just one exception being rescued, then it's just going to be a // single doc node. - let exceptionDoc = path.call(print, "body", 0); + let exceptionDoc = path.call(print, "extns"); // If there are multiple exceptions being rescued, then we're going to have // multiple doc nodes returned as an array that we need to join together. - if (["mrhs_add_star", "mrhs_new_from_args"].includes(exception.type)) { + if (["mrhs_add_star", "mrhs_new_from_args"].includes(node.extns.type)) { exceptionDoc = group(join([",", line], exceptionDoc)); } parts.push(" ", exceptionDoc); } - if (variable) { - parts.push(" => ", path.call(print, "body", 1)); + if (node.var) { + parts.push(" => ", path.call(print, "var")); } return group(parts); diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index ab13891a..92a2afcf 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -2465,8 +2465,8 @@ def bind_end(end_char) end_char: end_char ) - stmts = value[:body][1] - consequent = value[:body][2] + stmts = value[:stmts] + consequent = value[:cons] if consequent consequent.bind_end(end_char) @@ -2487,13 +2487,14 @@ def on_rescue(exceptions, variable, stmts, consequent) stmts.bind(find_next_statement_start(last_node[:loc].end_char), char_pos) # We add an additional inner node here that ripper doesn't provide so that - # we have a nice place to attach inline comment. But we only need it if we + # we have a nice place to attach inline comments. But we only need it if we # have an exception or a variable that we're rescuing. rescue_ex = if exceptions || variable { type: :rescue_ex, - body: [exceptions, variable], + extns: exceptions, + var: variable, loc: Location.new( start_line: beging[:loc].start_line, @@ -2508,7 +2509,9 @@ def on_rescue(exceptions, variable, stmts, consequent) self, { type: :rescue, - body: [rescue_ex, stmts, consequent], + extn: rescue_ex, + stmts: stmts, + cons: consequent, loc: Location.new( start_line: beging[:loc].start_line, diff --git a/src/types/ruby.ts b/src/types/ruby.ts index d4da618c..dec954b5 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -140,8 +140,8 @@ export type For = ParserEvent<"for", { iterator: Mlhs | MlhsAddStar | VarField, export type If = ParserEvent<"if", { pred: AnyNode, stmts: Stmts, cons: null | Elsif | Else }>; export type IfModifier = ParserEvent<"if_mod", { pred: AnyNode, stmt: AnyNode }>; export type In = ParserEvent<"in", { pttn: AnyNode, stmts: Stmts, cons: null | In | Else }>; -export type Rescue = ParserEvent<"rescue", { body: [null | RescueEx, Stmts, null | Stmts] }>; -export type RescueEx = ParserEvent<"rescue_ex", { body: [AnyNode, null | Field | VarField] }>; +export type Rescue = ParserEvent<"rescue", { extn: null | RescueEx, stmts: Stmts, cons: null | Rescue }>; +export type RescueEx = ParserEvent<"rescue_ex", { extns: AnyNode, var: null | Field | VarField }>; export type RescueModifier = ParserEvent<"rescue_mod", { stmt: AnyNode, val: AnyNode }>; export type Ternary = ParserEvent<"ifop", { pred: AnyNode, tthy: AnyNode, flsy: AnyNode }>; export type Unless = ParserEvent<"unless", { pred: AnyNode, stmts: Stmts, cons: null | Elsif | Else }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index a1f2a6ca..51908d2d 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -194,6 +194,10 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return []; case "regexp_literal": return node.parts; + case "rescue": + return [node.extn, node.stmts, node.cons]; + case "rescue_ex": + return [node.extns, node.var]; case "rescue_mod": return [node.stmt, node.val]; case "rest_param": @@ -311,9 +315,7 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { case "mrhs_new_from_args": case "stmts": case "string_literal": - case "symbol_literal": - case "rescue": - case "rescue_ex": { + case "symbol_literal": { if (Array.isArray(node.body)) { return node.body.filter( (child: any) => child && typeof child === "object" From 69304e57acf6019248fd00622c58b268ae655a4e Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 3 Nov 2021 11:39:14 -0400 Subject: [PATCH 401/785] string_literal, symbol_literal --- src/ruby/embed.ts | 6 +++--- src/ruby/nodes/alias.ts | 4 ++-- src/ruby/nodes/arrays.ts | 8 +++---- src/ruby/nodes/hashes.ts | 8 +++---- src/ruby/nodes/heredocs.ts | 15 ++++++------- src/ruby/nodes/strings.ts | 16 +++++++------- src/ruby/nodes/undef.ts | 43 +++++++++++++++++++------------------- src/ruby/parser.rb | 32 ++++++++++++++-------------- src/ruby/toProc.ts | 11 +++++----- src/types/ruby.ts | 8 +++---- src/utils/getChildNodes.ts | 17 ++++++++------- 11 files changed, 86 insertions(+), 82 deletions(-) diff --git a/src/ruby/embed.ts b/src/ruby/embed.ts index 5cf7862a..33abc932 100644 --- a/src/ruby/embed.ts +++ b/src/ruby/embed.ts @@ -87,10 +87,10 @@ const embed: Plugin.Embed = (path, print, textToDoc) => { } // First, ensure that we don't have any interpolation - const { beging, body, ending } = node; + const { beging, parts, ending } = node; const isSquiggly = beging.body[2] === "~"; - if (!isTStringContentArray(body)) { + if (!isTStringContentArray(parts)) { return null; } @@ -102,7 +102,7 @@ const embed: Plugin.Embed = (path, print, textToDoc) => { } // Get the content as if it were a source string. - let content = body.map((part) => part.body).join(""); + let content = parts.map((part) => part.body).join(""); // If we're using a squiggly heredoc, then we're going to manually strip off // the leading whitespace of each line up to the minimum leading whitespace so diff --git a/src/ruby/nodes/alias.ts b/src/ruby/nodes/alias.ts index eca56429..ee7786cf 100644 --- a/src/ruby/nodes/alias.ts +++ b/src/ruby/nodes/alias.ts @@ -44,11 +44,11 @@ export const printAlias: Plugin.Printer = ( // otherwise we could accidentally skip printing them. if (argNode.comments) { argNode.comments.forEach((comment) => { - addTrailingComment(argNode.body[0], comment); + addTrailingComment(argNode.val, comment); }); } - return argPath.call(print, "body", 0); + return argPath.call(print, "val"); } return print(argPath); diff --git a/src/ruby/nodes/arrays.ts b/src/ruby/nodes/arrays.ts index 28f2a415..03b8db7c 100644 --- a/src/ruby/nodes/arrays.ts +++ b/src/ruby/nodes/arrays.ts @@ -22,11 +22,11 @@ function isStringArray(args: Ruby.Args | Ruby.ArgsAddStar) { // If the string has multiple parts (meaning plain string content but also // interpolated content) then we know it's not a simple string. - if (arg.body.length !== 1) { + if (arg.parts.length !== 1) { return false; } - const part = arg.body[0]; + const part = arg.parts[0]; // If the only part of this string is not @tstring_content then it's // interpolated, so again we can return false. @@ -116,7 +116,7 @@ export const printArray: Plugin.Printer = (path, opts, print) => { // spaces or interpolation, then we're going to print a %w array. if (isStringArray(contents)) { const printString = (stringPath: Plugin.Path) => - stringPath.call(print, "body", 0); + stringPath.call(print, "parts", 0); const nodePath = path as Plugin.Path<{ cnts: { body: Ruby.StringLiteral[] } }>; const parts = nodePath.map(printString, "cnts", "body"); @@ -128,7 +128,7 @@ export const printArray: Plugin.Printer = (path, opts, print) => { // interpolation, then we're going to print a %i array. if (isSymbolArray(contents)) { const printSymbol = (symbolPath: Plugin.Path) => - symbolPath.call(print, "body", 0); + symbolPath.call(print, "val"); const nodePath = path as Plugin.Path<{ cnts: { body: Ruby.SymbolLiteral[] } }>; const parts = nodePath.map(printSymbol, "cnts", "body"); diff --git a/src/ruby/nodes/hashes.ts b/src/ruby/nodes/hashes.ts index f3b0e4b6..0b681177 100644 --- a/src/ruby/nodes/hashes.ts +++ b/src/ruby/nodes/hashes.ts @@ -27,7 +27,7 @@ type HashContents = (Ruby.AssoclistFromArgs | Ruby.BareAssocHash) & { // This function represents that check, as it determines if it can convert the // symbol node into a hash label. function isValidHashLabel(symbolLiteral: Ruby.SymbolLiteral) { - const label = symbolLiteral.body[0].body; + const label = symbolLiteral.val.body; return label.match(/^[_A-Za-z]/) && !label.endsWith("="); } @@ -56,10 +56,8 @@ const printHashKeyLabel: KeyPrinter = (path, print) => { switch (node.type) { case "@label": return print(path); - case "symbol_literal": { - const nodePath = path as Plugin.Path; - return [nodePath.call(print, "body", 0), ":"]; - } + case "symbol_literal": + return [(path as Plugin.Path).call(print, "val"), ":"]; case "dyna_symbol": return [print(path), ":"]; default: diff --git a/src/ruby/nodes/heredocs.ts b/src/ruby/nodes/heredocs.ts index 390b42a7..c12097a6 100644 --- a/src/ruby/nodes/heredocs.ts +++ b/src/ruby/nodes/heredocs.ts @@ -9,17 +9,18 @@ export const printHeredoc: Plugin.Printer = ( opts, print ) => { - const { body, ending } = path.getValue(); + const node = path.getValue(); + + // Print out each part of the heredoc to its own doc node. + const parts = path.map((partPath) => { + const part = partPath.getValue(); - const parts = body.map((part, index) => { if (part.type !== "@tstring_content") { - // In this case, the part of the string is an embedded expression - return path.call(print, "body", index); + return print(partPath); } - // In this case, the part of the string is just regular string content return join(literallineWithoutBreakParent, part.body.split(/\r?\n/)); - }); + }, "parts"); // We use a literalline break because matching indentation is required // for the heredoc contents and ending. If the line suffix contains a @@ -28,6 +29,6 @@ export const printHeredoc: Plugin.Printer = ( // possible, so we use a literalline without the break-parent. return group([ path.call(print, "beging"), - lineSuffix(group([literallineWithoutBreakParent, ...parts, ending])) + lineSuffix(group([literallineWithoutBreakParent, ...parts, node.ending])) ]); }; diff --git a/src/ruby/nodes/strings.ts b/src/ruby/nodes/strings.ts index aeb73c15..a05d8175 100644 --- a/src/ruby/nodes/strings.ts +++ b/src/ruby/nodes/strings.ts @@ -11,7 +11,7 @@ const { group, hardline, indent, literalline, removeLines, softline, join } = // would activate the escape sequence, and if they chose double quotes, then // single quotes would deactivate it.) function isQuoteLocked(node: Ruby.DynaSymbol | Ruby.StringLiteral) { - return node.body.some( + return node.parts.some( (part) => part.type === "@tstring_content" && (part.body.includes("#{") || part.body.includes("\\")) @@ -21,7 +21,7 @@ function isQuoteLocked(node: Ruby.DynaSymbol | Ruby.StringLiteral) { // A string is considered to be able to use single quotes if it contains only // plain string content and that content does not contain a single quote. function isSingleQuotable(node: Ruby.DynaSymbol | Ruby.StringLiteral) { - return node.body.every( + return node.parts.every( (part) => part.type === "@tstring_content" && !part.body.includes("'") ); } @@ -102,7 +102,7 @@ const printPercentSDynaSymbol: Plugin.Printer = ( // Here we are printing plain string content. parts.push(join(literalline, childNode.body.split("\n"))); } - }, "body"); + }, "parts"); // Push on the closing character, which is the opposite of the third // character from the opening. @@ -126,7 +126,7 @@ function shouldPrintPercentSDynaSymbol(node: Ruby.DynaSymbol) { // get weird, so just bail out and stick to the original bounds in the source. const closing = quotePairs[node.quote[2] as Quote]; - return node.body.some( + return node.parts.some( (child) => child.type === "@tstring_content" && (child.body.includes("\n") || @@ -180,7 +180,7 @@ export const printDynaSymbol: Plugin.Printer = ( join(literalline, normalizeQuotes(child.body, quote).split("\n")) ); } - }, "body"); + }, "parts"); parts.push(quote); @@ -241,7 +241,7 @@ export const printStringLiteral: Plugin.Printer = ( // If the string is empty, it will not have any parts, so just print out the // quotes corresponding to the config - if (node.body.length === 0) { + if (node.parts.length === 0) { return rubySingleQuote ? "''" : '""'; } @@ -263,7 +263,7 @@ export const printStringLiteral: Plugin.Printer = ( // In this case, the part of the string is just regular string content return join(literalline, normalizeQuotes(part.body, quote).split("\n")); - }, "body"); + }, "parts"); return [quote, ...parts, getClosingQuote(quote)]; }; @@ -275,7 +275,7 @@ export const printSymbolLiteral: Plugin.Printer = ( opts, print ) => { - return [":", path.call(print, "body", 0)]; + return [":", path.call(print, "val")]; }; // Prints out an xstring literal. Its child is an array of string parts, diff --git a/src/ruby/nodes/undef.ts b/src/ruby/nodes/undef.ts index 66c50bc1..440cbfe1 100644 --- a/src/ruby/nodes/undef.ts +++ b/src/ruby/nodes/undef.ts @@ -3,31 +3,32 @@ import prettier from "../../prettier"; const { addTrailingComment, align, group, join, line } = prettier; -const printUndefSymbol: Plugin.Printer = ( - path, - opts, - print -) => { - const node = path.getValue(); +export const printUndef: Plugin.Printer = (path, opts, print) => { + const symsDocs = path.map( + (symbolPath) => { + const symbolNode = symbolPath.getValue(); - // Since we're going to descend into the symbol literal to grab out the ident - // node, then we need to make sure we copy over any comments as well, - // otherwise we could accidentally skip printing them. - if (node.comments) { - node.comments.forEach((comment) => { - addTrailingComment(node.body[0], comment); - }); - } + // If we're not printing a symbol literal then it's a dyna symbol, so + // we're just going to print that node on its own. + if (symbolNode.type !== "symbol_literal") { + return print(symbolPath); + } - return path.call(print, "body", 0); -}; + // We need to make sure we copy over any comments before we do the + // printing so they get printed as well. + if (symbolNode.comments) { + symbolNode.comments.forEach((comment) => { + addTrailingComment(symbolNode.val, comment); + }); + } -export const printUndef: Plugin.Printer = (path, opts, print) => { - const keyword = "undef "; - const argNodes = path.map( - (symbolPath) => printUndefSymbol(symbolPath, opts, print), + // If we're printing a symbol literal, then we want to descend into it and + // just print the underlying contents so that it prints as a bare word. + return symbolPath.call(print, "val"); + }, "syms" ); - return group([keyword, align(keyword.length, join([",", line], argNodes))]); + const keyword = "undef "; + return group([keyword, align(keyword.length, join([",", line], symsDocs))]); }; diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 92a2afcf..b9c7de7b 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -1258,7 +1258,7 @@ def on_dyna_symbol(string) { type: :dyna_symbol, quote: beging[:body], - body: string[:body], + parts: string[:parts], loc: beging[:loc].to(ending[:loc]) } else @@ -1268,7 +1268,7 @@ def on_dyna_symbol(string) { type: :dyna_symbol, - body: string[:body], + parts: string[:parts], quote: ending[:body][0], loc: beging[:loc].to(ending[:loc]) } @@ -1588,7 +1588,7 @@ def on_heredoc_beg(beging) # tilde. These are considered `heredoc_dedent` nodes, whereas the hyphen # heredocs show up as string literals. def on_heredoc_dedent(string, _width) - @heredocs[-1].merge!(body: string[:body]) + @heredocs[-1].merge!(parts: string[:parts]) end # This is a scanner event that represents the end of the heredoc. @@ -2723,15 +2723,15 @@ def on_stmts_new ) end - # string_add is a parser event that represents a piece of a string. It + # string_add is a parser event that represents a part of a string. It # could be plain @tstring_content, string_embexpr, or string_dvar nodes. # It accepts as arguments the parent string node as well as the additional - # piece of the string. - def on_string_add(string, piece) + # part of the string. + def on_string_add(string, part) { type: :string, - body: string[:body] << piece, - loc: string[:loc].to(piece[:loc]) + parts: string[:parts] << part, + loc: string[:loc].to(part[:loc]) } end @@ -2758,7 +2758,7 @@ def on_string_concat(left, right) def on_string_content { type: :string, - body: [], + parts: [], loc: Location.fixed(line: lineno, char: char_pos) } end @@ -2793,14 +2793,14 @@ def on_string_literal(string) heredoc = @heredocs[-1] if heredoc && heredoc[:ending] - @heredocs.pop.merge!(body: string[:body]) + @heredocs.pop.merge!(parts: string[:parts]) else beging = find_scanner_event(:@tstring_beg) ending = find_scanner_event(:@tstring_end) { type: :string_literal, - body: string[:body], + parts: string[:parts], quote: beging[:body], loc: beging[:loc].to(ending[:loc]) } @@ -2833,7 +2833,7 @@ def on_symbeg(value) # A symbol is a parser event that immediately descends from a symbol # literal and contains an ident representing the contents of the symbol. - def on_symbol(ident) + def on_symbol(value) # When ripper is lexing source text, it turns symbols into keywords if their # contents match, which will mess up the location information of all of our # other nodes. So for example instead of { type: :@ident, body: "class" } @@ -2843,7 +2843,7 @@ def on_symbol(ident) # from the stack to make sure it doesn't screw things up. scanner_events.pop - { type: :symbol, body: [ident], loc: ident[:loc] } + { type: :symbol, val: value, loc: value[:loc] } end # A symbol_literal represents a symbol in the system with no interpolation @@ -2852,13 +2852,13 @@ def on_symbol(ident) # using bare words, as in an alias node like alias foo bar). def on_symbol_literal(contents) if scanner_events[-1] == contents - { type: :symbol_literal, body: [contents], loc: contents[:loc] } + { type: :symbol_literal, val: contents, loc: contents[:loc] } else beging = find_scanner_event(:@symbeg) { type: :symbol_literal, - body: contents[:body], + val: contents[:val], loc: beging[:loc].to(contents[:loc]) } end @@ -3414,7 +3414,7 @@ def on_xstring_literal(xstring) type: :heredoc, beging: heredoc[:beging], ending: heredoc[:ending], - body: xstring[:parts], + parts: xstring[:parts], loc: heredoc[:loc] } else diff --git a/src/ruby/toProc.ts b/src/ruby/toProc.ts index ff7f40be..1ee653ee 100644 --- a/src/ruby/toProc.ts +++ b/src/ruby/toProc.ts @@ -81,15 +81,16 @@ function toProc( // corresponds to `:if` or `:unless` to avoid problems with callbacks with // Rails. For more context, see: // https://github.com/prettier/plugin-ruby/issues/449 - let assocNode = null; + let parentNode = null; if (path.getValue().type === "method_add_block") { - assocNode = path.getParentNode(); + parentNode = path.getParentNode(); } else { - assocNode = path.getParentNode(2); + parentNode = path.getParentNode(2); } - if (assocNode && assocNode.type === "assoc_new") { + if (parentNode && parentNode.type === "assoc_new") { + const assocNode = parentNode as Ruby.AssocNew; const key = assocNode.key; if (key.type === "@label" && ["if:", "unless:"].includes(key.body)) { @@ -98,7 +99,7 @@ function toProc( if ( key.type === "symbol_literal" && - ["if", "unless"].includes(key.body[0].body) + ["if", "unless"].includes(key.val.body) ) { return null; } diff --git a/src/types/ruby.ts b/src/types/ruby.ts index dec954b5..418c2793 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -85,14 +85,14 @@ export type Zsuper = ParserEvent0<"zsuper">; // These are various parser events that have to do with string or string-like // nodes. export type StringContent = StringDVar | StringEmbExpr | TStringContent; -export type DynaSymbol = ParserEvent<"dyna_symbol", { body: StringContent[], quote: string }>; -export type Heredoc = ParserEvent<"heredoc", { beging: HeredocBegin, ending: string, body: StringContent[] }>; +export type DynaSymbol = ParserEvent<"dyna_symbol", { parts: StringContent[], quote: string }>; +export type Heredoc = ParserEvent<"heredoc", { beging: HeredocBegin, ending: string, parts: StringContent[] }>; export type RegexpLiteral = ParserEvent<"regexp_literal", { parts: StringContent[], beging: string, ending: string }>; export type StringConcat = ParserEvent<"string_concat", { left: StringConcat | StringLiteral, right: StringLiteral }>; export type StringDVar = ParserEvent<"string_dvar", { var: Backref | VarRef }>; export type StringEmbExpr = ParserEvent<"string_embexpr", { stmts: Stmts }>; -export type StringLiteral = ParserEvent<"string_literal", { body: StringContent[], quote: string }>; -export type SymbolLiteral = ParserEvent<"symbol_literal", { body: [Backtick | Const | CVar | GVar | Identifier | IVar | Keyword | Op] }>; +export type StringLiteral = ParserEvent<"string_literal", { parts: StringContent[], quote: string }>; +export type SymbolLiteral = ParserEvent<"symbol_literal", { val: Backtick | Const | CVar | GVar | Identifier | IVar | Keyword | Op }>; export type XStringLiteral = ParserEvent<"xstring_literal", { parts: StringContent[] }>; // These are various parser events that have to do with arrays. diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 51908d2d..241b7609 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -115,7 +115,7 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { case "dot3": return [node.left, node.right]; case "dyna_symbol": - return node.body; + return node.parts; case "else": return [node.stmts]; case "elsif": @@ -142,6 +142,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.iterator, node.enumerable, node.stmts]; case "hash": return [node.cnts]; + case "heredoc": + return [node.beging, ...node.parts]; case "hshptn": { const childNodes: ChildNode[] = [node.constant]; @@ -210,14 +212,20 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return []; case "sclass": return [node.target, node.bodystmt]; + case "stmts": + return node.body; case "string_concat": return [node.left, node.right]; case "string_dvar": return [node.var]; case "string_embexpr": return [node.stmts]; + case "string_literal": + return node.parts; case "super": return [node.args]; + case "symbol_literal": + return [node.val]; case "symbols": return []; case "top_const_field": @@ -267,8 +275,6 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { - case "heredoc": - return [node.beging]; case "params": { const [reqs, optls, rest, post, kwargs, kwargRest, block] = node.body; let parts: (Ruby.AnyNode | null)[] = reqs || []; @@ -312,10 +318,7 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { case "method_add_block": case "mrhs": case "mrhs_add_star": - case "mrhs_new_from_args": - case "stmts": - case "string_literal": - case "symbol_literal": { + case "mrhs_new_from_args": { if (Array.isArray(node.body)) { return node.body.filter( (child: any) => child && typeof child === "object" From 0f24846e1463a298dfde7499bc3773b9ea72755f Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 3 Nov 2021 12:56:04 -0400 Subject: [PATCH 402/785] params --- src/ruby/nodes/lambdas.ts | 4 +-- src/ruby/nodes/methods.ts | 9 +++--- src/ruby/nodes/params.ts | 45 ++++++++++++++------------- src/ruby/parser.rb | 46 +++++++++++++++++++++++----- src/ruby/toProc.ts | 13 +++++--- src/types/ruby.ts | 2 +- src/utils.ts | 1 + src/utils/getChildNodes.ts | 63 +++++++++++++++++--------------------- src/utils/isEmptyParams.ts | 7 +++++ 9 files changed, 113 insertions(+), 77 deletions(-) create mode 100644 src/utils/isEmptyParams.ts diff --git a/src/ruby/nodes/lambdas.ts b/src/ruby/nodes/lambdas.ts index 16c0c028..5b65b5bd 100644 --- a/src/ruby/nodes/lambdas.ts +++ b/src/ruby/nodes/lambdas.ts @@ -1,6 +1,6 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; -import { hasAncestor } from "../../utils"; +import { hasAncestor, isEmptyParams } from "../../utils"; const { group, ifBreak, indent, line } = prettier; @@ -23,7 +23,7 @@ function printLambdaParams( // If we don't have any params at all, then we're just going to bail out and // print nothing. This is to avoid printing an empty set of parentheses. - if (node.body.every((type) => !type)) { + if (isEmptyParams(node)) { return ""; } diff --git a/src/ruby/nodes/methods.ts b/src/ruby/nodes/methods.ts index 553037e3..9241a80a 100644 --- a/src/ruby/nodes/methods.ts +++ b/src/ruby/nodes/methods.ts @@ -1,6 +1,6 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; -import { isEmptyBodyStmt } from "../../utils"; +import { isEmptyBodyStmt, isEmptyParams } from "../../utils"; const { group, hardline, indent, line } = prettier; @@ -18,9 +18,8 @@ export const printDef: Plugin.Printer = ( declaration.push(path.call(print, "target"), path.call(print, "operator")); } - // In case there are no parens but there are arguments - const useParens = - node.params.type === "params" && node.params.body.some((type) => type); + // In case there are no parens but there are parameters + const useParens = node.params.type === "params" && !isEmptyParams(node.params); declaration.push( path.call(print, "name"), @@ -51,7 +50,7 @@ export const printSingleLineMethod: Plugin.Printer = ( // If we have any kind of parameters, we're going to print the whole // parentheses. If we don't, then we're just going to skip them entirely. - if (node.paren && node.paren.cnts.body.some((type) => type)) { + if (node.paren && !isEmptyParams(node.paren.cnts)) { paramsDoc = path.call(print, "paren"); } diff --git a/src/ruby/nodes/params.ts b/src/ruby/nodes/params.ts index b2f61e9d..84a41d44 100644 --- a/src/ruby/nodes/params.ts +++ b/src/ruby/nodes/params.ts @@ -15,11 +15,10 @@ function printRestParamSymbol(symbol: string): Plugin.Printer { } export const printParams: Plugin.Printer = (path, opts, print) => { - const [reqs, optls, rest, post, kwargs, kwargRest, block] = - path.getValue().body; + const node = path.getValue(); let parts: Plugin.Doc[] = []; - if (reqs) { + if (node.reqs) { path.each( (reqPath) => { // For some very strange reason, if you have a comment attached to a @@ -28,46 +27,48 @@ export const printParams: Plugin.Printer = (path, opts, print) => { parts.push(print(reqPath)); } }, - "body", - 0 + "reqs" ); } - if (optls) { + if (node.opts) { parts = parts.concat( - path.map((optlPath) => join(" = ", optlPath.map(print)), "body", 1) + path.map((optlPath) => join(" = ", optlPath.map(print)), "opts") ); } - if (rest && rest.type !== "excessed_comma") { - parts.push(path.call(print, "body", 2)); + if (node.rest && node.rest.type !== "excessed_comma") { + parts.push(path.call(print, "rest")); } - if (post) { - parts = parts.concat(path.map(print, "body", 3)); + if (node.posts) { + parts = parts.concat(path.map(print, "posts")); } - if (kwargs) { + if (node.keywords) { parts = parts.concat( path.map( (kwargPath) => { - if (!kwargPath.getValue()[1]) { - return kwargPath.call(print, 0); + const kwarg = kwargPath.getValue(); + const keyDoc = kwargPath.call(print, 0); + + if (kwarg[1]) { + return group([keyDoc, " ", kwargPath.call(print, 1)]); } - return group(join(" ", kwargPath.map(print))); + + return keyDoc; }, - "body", - 4 + "keywords" ) ); } - if (kwargRest) { - parts.push(kwargRest === "nil" ? "**nil" : path.call(print, "body", 5)); + if (node.kwrest) { + parts.push(node.kwrest === "nil" ? "**nil" : path.call(print, "kwrest")); } - if (block) { - parts.push(path.call(print, "body", 6)); + if (node.block) { + parts.push(path.call(print, "block")); } const contents: Plugin.Doc[] = [join([",", line], parts)]; @@ -81,7 +82,7 @@ export const printParams: Plugin.Printer = (path, opts, print) => { // In ruby 2.5, the excessed comma is indicated by having a 0 in the rest // param position. In ruby 2.6+ it's indicated by having an "excessed_comma" // node in the rest position. Seems odd, but it's true. - if ((rest as any) === 0 || (rest && rest.type === "excessed_comma")) { + if ((node.rest as any) === 0 || (node.rest && node.rest.type === "excessed_comma")) { contents.push(","); } diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index b9c7de7b..e1865c1c 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -225,6 +225,19 @@ def char_pos @line_counts[lineno - 1][column] end + # Params nodes are the most complicated in the tree. Occasionally you want to + # know if they are "empty", which means not having any parameters declared. + # This logic accesses every kind of parameter and determines if it's missing. + def empty_params?(params) + params[:reqs].empty? && + params[:opts].empty? && + !params[:rest] && + params[:posts].empty? && + params[:keywords].empty? && + !params[:kwrest] && + !params[:block] + end + # As we build up a list of scanner events, we'll periodically need to go # backwards and find the ones that we've already hit in order to determine the # location information for nodes that use them. For example, if you have a @@ -1082,7 +1095,7 @@ def on_def(name, params, bodystmt) # If there aren't any params then we need to correct the params node # location information - if params[:type] == :params && !params[:body].any? + if params[:type] == :params && empty_params?(params) location = name[:loc].end_char params[:loc] = @@ -1131,7 +1144,7 @@ def on_defs(target, operator, name, params, bodystmt) # If there aren't any params then we need to correct the params node # location information - if params[:type] == :params && !params[:body].any? + if params[:type] == :params && empty_params?(params) location = name[:loc].end_char params[:loc] = @@ -2189,16 +2202,35 @@ def on_opassign(target, operator, value) # array of arrays where the position in the top-level array indicates the # type of param and the subarray is the list of parameters of that type. # We therefore have to flatten them down to get to the location. - def on_params(*types) - flattened = types.flatten(2).select { |type| type.is_a?(Hash) } + def on_params(reqs, opts, rest, posts, keywords, kwrest, block) + params = [ + *reqs, + *opts&.flatten(1), + rest, + *posts, + *keywords&.flat_map { |(key, value)| [key, value || nil] }, + (kwrest if kwrest != :nil), + block + ].compact + location = - if flattened.any? - flattened[0][:loc].to(flattened[-1][:loc]) + if params.any? + params[0][:loc].to(params[-1][:loc]) else Location.fixed(line: lineno, char: char_pos) end - { type: :params, body: types, loc: location } + { + type: :params, + reqs: reqs || [], + opts: opts || [], + rest: rest, + posts: posts || [], + keywords: keywords || [], + kwrest: kwrest, + block: block, + loc: location + } end # A paren is a parser event that represents using parentheses pretty much diff --git a/src/ruby/toProc.ts b/src/ruby/toProc.ts index 1ee653ee..f4c335b9 100644 --- a/src/ruby/toProc.ts +++ b/src/ruby/toProc.ts @@ -32,11 +32,14 @@ function toProc( } // Ensure there is one and only one parameter, and that it is required. - const [reqParams, ...otherParams] = params.body; if ( - !Array.isArray(reqParams) || - reqParams.length !== 1 || - otherParams.some(Boolean) + params.reqs.length !== 1 || + params.opts.length !== 0 || + params.rest || + params.posts.length !== 0 || + params.keywords.length !== 0 || + params.kwrest || + params.block ) { return null; } @@ -69,7 +72,7 @@ function toProc( // Ensure the call is a method of the block argument if ( call.receiver.type !== "var_ref" || - call.receiver.value.body !== reqParams[0].body || + call.receiver.value.body !== params.reqs[0].body || !isPeriod(call.operator) || call.message === "call" || call.message.type !== "@ident" diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 418c2793..f18af751 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -175,7 +175,7 @@ export type Defs = ParserEvent<"defs", { target: AnyNode, operator: Op | Period, export type Defsl = ParserEvent<"defsl", { name: DefName, paren: null | ParenAroundParams, stmt: AnyNode }>; export type KeywordRestParam = ParserEvent<"kwrest_param", { name: null | Identifier }>; export type Lambda = ParserEvent<"lambda", { params: Params | ParenAroundParams, stmts: Bodystmt | Stmts }>; -export type Params = ParserEvent<"params", { body: [Identifier[], null | [Identifier, AnyNode][], null | ArgsForward | ExcessedComma | RestParam, Identifier[], null | [Label, AnyNode][], null | "nil" | KeywordRestParam, null | Blockarg] }>; +export type Params = ParserEvent<"params", { reqs: Identifier[], opts: [Identifier, AnyNode][], rest: null | ArgsForward | ExcessedComma | RestParam, posts: Identifier[], keywords: [Label, AnyNode][], kwrest: null | "nil" | KeywordRestParam, block: null | Blockarg }>; export type RestParam = ParserEvent<"rest_param", { name: null | Identifier }>; // These are various parser events for method calls. diff --git a/src/utils.ts b/src/utils.ts index 1bac33bc..cd3e7f37 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,6 +1,7 @@ export { default as containsAssignment } from "./utils/containsAssignment"; export { default as getTrailingComma } from "./utils/getTrailingComma"; export { default as isEmptyBodyStmt } from "./utils/isEmptyBodyStmt"; +export { default as isEmptyParams } from "./utils/isEmptyParams"; export { default as isEmptyStmts } from "./utils/isEmptyStmts"; export { default as getChildNodes } from "./utils/getChildNodes"; export { default as hasAncestor } from "./utils/hasAncestor"; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 241b7609..2e657a23 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -182,6 +182,34 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.args]; case "opassign": return [node.target, node.operator, node.value]; + case "params": { + let childNodes: ChildNode[] = [...node.reqs]; + + node.opts.forEach(([key, value]) => { + childNodes.push(key, value); + }); + + childNodes.push(node.rest); + childNodes = childNodes.concat(node.posts); + + node.keywords.forEach(([key, value]) => { + childNodes.push(key); + + if (value) { + childNodes.push(value); + } + }); + + if (node.kwrest && node.kwrest !== "nil") { + childNodes.push(node.kwrest); + } + + if (node.block) { + childNodes.push(node.block); + } + + return childNodes; + } case "paren": return [node.lparen, node.cnts]; case "program": @@ -275,41 +303,6 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { - case "params": { - const [reqs, optls, rest, post, kwargs, kwargRest, block] = node.body; - let parts: (Ruby.AnyNode | null)[] = reqs || []; - - (optls || []).forEach((optl: any) => { - parts = parts.concat(optl); - }); - - if (rest) { - parts.push(rest); - } - - parts = parts.concat(post || []); - - (kwargs || []).forEach((kwarg: any) => { - if (kwarg[1]) { - parts = parts.concat(kwarg); - } else { - parts.push(kwarg[0]); - } - }); - - if (kwargRest && kwargRest !== "nil") { - parts.push(kwargRest); - } - - if (block) { - parts.push(block); - } - - return parts; - } - - - case "args": case "args_add_block": case "args_add_star": diff --git a/src/utils/isEmptyParams.ts b/src/utils/isEmptyParams.ts new file mode 100644 index 00000000..78d967f5 --- /dev/null +++ b/src/utils/isEmptyParams.ts @@ -0,0 +1,7 @@ +import type { Ruby } from "../types"; + +function isEmptyParams(node: Ruby.Params) { + return node.reqs.length === 0 && node.opts.length === 0 && !node.rest && node.posts.length === 0 && node.keywords.length === 0 && !node.kwrest && !node.block; +} + +export default isEmptyParams; From 868473b2c32ab51a39ae25d3402cfc32f94a22b3 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 3 Nov 2021 13:45:27 -0400 Subject: [PATCH 403/785] bodystmt --- src/ruby/nodes/blocks.ts | 2 +- src/ruby/nodes/statements.ts | 22 +++++++++++----------- src/ruby/parser.rb | 19 +++++++++++-------- src/ruby/toProc.ts | 16 ++++++---------- src/types/ruby.ts | 2 +- src/utils/getChildNodes.ts | 3 ++- src/utils/isEmptyBodyStmt.ts | 2 +- 7 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/ruby/nodes/blocks.ts b/src/ruby/nodes/blocks.ts index e5ce0849..91530be0 100644 --- a/src/ruby/nodes/blocks.ts +++ b/src/ruby/nodes/blocks.ts @@ -49,7 +49,7 @@ type Block = Ruby.BraceBlock | Ruby.DoBlock; function printBlock(braces: boolean): Plugin.Printer { return function printBlockWithBraces(path, opts, print) { const node = path.getValue(); - const stmts: Ruby.AnyNode[] = node.type === "brace_block" ? node.stmts.body : node.bodystmt.body[0].body; + const stmts: Ruby.AnyNode[] = node.type === "brace_block" ? node.stmts.body : node.bodystmt.stmts.body; let doBlockBody: Plugin.Doc = ""; if (stmts.length !== 1 || stmts[0].type !== "void_stmt" || stmts[0].comments) { diff --git a/src/ruby/nodes/statements.ts b/src/ruby/nodes/statements.ts index 594b9328..48c48d4d 100644 --- a/src/ruby/nodes/statements.ts +++ b/src/ruby/nodes/statements.ts @@ -21,30 +21,30 @@ export const printBodyStmt: Plugin.Printer = ( opts, print ) => { - const [stmts, rescue, elseClause, ensure] = path.getValue().body; + const node = path.getValue(); const parts = []; - if (!isEmptyStmts(stmts)) { - parts.push(path.call(print, "body", 0)); + if (!isEmptyStmts(node.stmts)) { + parts.push(path.call(print, "stmts")); } - if (rescue) { - parts.push(dedent([hardline, path.call(print, "body", 1)])); + if (node.rsc) { + parts.push(dedent([hardline, path.call(print, "rsc")])); } - if (elseClause) { + if (node.els) { // Before Ruby 2.6, this piece of bodystmt was an explicit "else" node /* istanbul ignore next */ const stmts = - (elseClause as any).type === "else" - ? path.call(print, "body", 2, "body", 0) - : path.call(print, "body", 2); + (node.els as any).type === "else" + ? (path as any).call(print, "els", "body", 0) + : path.call(print, "els"); parts.push([dedent([hardline, "else"]), hardline, stmts]); } - if (ensure) { - parts.push(dedent([hardline, path.call(print, "body", 3)])); + if (node.ens) { + parts.push(dedent([hardline, path.call(print, "ens")])); } return group(parts); diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index e1865c1c..00f6822a 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -686,7 +686,7 @@ def on_bare_assoc_hash(assocs) def on_begin(bodystmt) beging = find_scanner_event(:@kw, 'begin') end_char = - if bodystmt[:body][1..-1].any? + if bodystmt[:rsc] || bodystmt[:ens] || bodystmt[:els] bodystmt[:loc].end_char else find_scanner_event(:@kw, 'end')[:loc].end_char @@ -759,19 +759,19 @@ def bind(start_char, end_char) end_char: end_char ) - parts = value[:body] + parts = [value[:rsc], value[:ens], value[:els]] # Here we're going to determine the bounds for the stmts consequent = parts[1..-1].compact.first - value[:body][0].bind( + value[:stmts].bind( start_char, consequent ? consequent[:loc].start_char : end_char ) # Next we're going to determine the rescue clause if there is one - if parts[1] - consequent = parts[2..-1].compact.first - value[:body][1].bind_end( + if value[:rsc] + consequent = parts.drop(1).compact.first + value[:rsc].bind_end( consequent ? consequent[:loc].start_char : end_char ) end @@ -780,11 +780,14 @@ def bind(start_char, end_char) # bodystmt is a parser event that represents all of the possible combinations # of clauses within the body of a method or block. - def on_bodystmt(stmts, rescued, ensured, elsed) + def on_bodystmt(stmts, rescued, elsed, ensured) BodyStmt.new( self, type: :bodystmt, - body: [stmts, rescued, ensured, elsed], + stmts: stmts, + rsc: rescued, + els: elsed, + ens: ensured, loc: Location.fixed(line: lineno, char: char_pos) ) end diff --git a/src/ruby/toProc.ts b/src/ruby/toProc.ts index f4c335b9..1d7f7732 100644 --- a/src/ruby/toProc.ts +++ b/src/ruby/toProc.ts @@ -44,18 +44,14 @@ function toProc( return null; } + // Get the list of statements from the block let statements: Ruby.AnyNode[]; - if (node.type === "do_block") { - const [blockStatements, ...rescueElseEnsure] = node.bodystmt.body; - - // You can’t use the to_proc shortcut if you’re rescuing - if (rescueElseEnsure.some(Boolean)) { - return null; - } - - statements = blockStatements.body; - } else { + if (node.type !== "do_block") { statements = node.stmts.body; + } else if (node.bodystmt.rsc || node.bodystmt.ens || node.bodystmt.els) { + return null; + } else { + statements = node.bodystmt.stmts.body; } // Ensure the block contains only one statement diff --git a/src/types/ruby.ts b/src/types/ruby.ts index f18af751..02e854fe 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -222,6 +222,6 @@ export type Undef = ParserEvent<"undef", { syms: (DynaSymbol | SymbolLiteral)[] // These are various parser events for statement containers, generally pretty high in the tree. export type Begin = ParserEvent<"begin", { bodystmt: Bodystmt }>; -export type Bodystmt = ParserEvent<"bodystmt", { body: [Stmts, null | Rescue, null | Stmts, null | Ensure] }>; +export type Bodystmt = ParserEvent<"bodystmt", { stmts: Stmts, rsc: null | Rescue, els: null | Stmts, ens: null | Ensure }>; export type Program = ParserEvent<"program", { stmts: Stmts }>; export type Stmts = ParserEvent<"stmts", { body: AnyNode[] }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 2e657a23..3cff662c 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -69,6 +69,8 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.params, ...node.locals]; case "blockarg": return [node.name]; + case "bodystmt": + return [node.stmts, node.rsc, node.els, node.ens]; case "brace_block": return [node.lbrace, node.block_var, node.stmts]; case "break": @@ -306,7 +308,6 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { case "args": case "args_add_block": case "args_add_star": - case "bodystmt": case "method_add_arg": case "method_add_block": case "mrhs": diff --git a/src/utils/isEmptyBodyStmt.ts b/src/utils/isEmptyBodyStmt.ts index ad7743c0..842718e9 100644 --- a/src/utils/isEmptyBodyStmt.ts +++ b/src/utils/isEmptyBodyStmt.ts @@ -2,7 +2,7 @@ import type { Ruby } from "../types"; import isEmptyStmts from "./isEmptyStmts"; function isEmptyBodyStmt(node: Ruby.Bodystmt) { - return isEmptyStmts(node.body[0]) && !node.body.slice(1).some(Boolean); + return isEmptyStmts(node.stmts) && !node.rsc && !node.ens && !node.els; } export default isEmptyBodyStmt; From 8b92ada5b602a80c3703cd9c54534feb4e328d91 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 3 Nov 2021 14:04:13 -0400 Subject: [PATCH 404/785] method_add_arg, method_add_block --- src/ruby/nodes/args.ts | 4 ++-- src/ruby/nodes/blocks.ts | 2 +- src/ruby/nodes/calls.ts | 35 ++++++++++++++++------------------- src/ruby/parser.rb | 17 +++++++++-------- src/ruby/toProc.ts | 14 +++++++++----- src/types/ruby.ts | 4 ++-- src/utils/getChildNodes.ts | 6 ++++-- 7 files changed, 43 insertions(+), 39 deletions(-) diff --git a/src/ruby/nodes/args.ts b/src/ruby/nodes/args.ts index 140c906f..4a4823d4 100644 --- a/src/ruby/nodes/args.ts +++ b/src/ruby/nodes/args.ts @@ -78,11 +78,11 @@ export const printArgs: Plugin.Printer = ( // associated with it. If it does, we're going to attempt to transform it // into the to_proc shorthand and add it to the list of arguments. [1, 2, 3].find((parent) => { - const parentNode = path.getParentNode(parent); + const parentNode = path.getParentNode(parent) as Ruby.AnyNode; blockNode = parentNode && parentNode.type === "method_add_block" && - parentNode.body[1]; + parentNode.block; return blockNode; }); diff --git a/src/ruby/nodes/blocks.ts b/src/ruby/nodes/blocks.ts index 91530be0..4c0b81e3 100644 --- a/src/ruby/nodes/blocks.ts +++ b/src/ruby/nodes/blocks.ts @@ -83,7 +83,7 @@ function printBlock(braces: boolean): Plugin.Printer { return [breakParent, doBlock]; } - const blockReceiver = path.getParentNode().body[0]; + const blockReceiver = (path.getParentNode() as Ruby.MethodAddBlock).call; // If the parent node is a command node, then there are no parentheses // around the arguments to that command, so we need to break the block diff --git a/src/ruby/nodes/calls.ts b/src/ruby/nodes/calls.ts index d70592a5..9a14589e 100644 --- a/src/ruby/nodes/calls.ts +++ b/src/ruby/nodes/calls.ts @@ -133,11 +133,8 @@ export const printMethodAddArg: Plugin.Printer = ( ) => { const node = path.getValue(); - const [methodNode, argNode] = node.body; - const [methodDoc, argsDoc] = path.map(print, "body") as [ - Plugin.Doc, - Plugin.Doc[] - ]; + const methodDoc = path.call(print, "call"); + const argsDoc = path.call(print, "args") as Plugin.Doc[]; // You can end up here if you have a method with a ? ending, presumably // because the parser knows that it cannot be a local variable. You can also @@ -147,7 +144,7 @@ export const printMethodAddArg: Plugin.Printer = ( // like a constant, then we need to match that in order to maintain valid // Ruby. For example, you could do something like Foo(), on which we would // need to keep the parentheses to make it look like a method call. - if (methodNode.type === "fcall" && methodNode.value.type === "@const") { + if (node.call.type === "fcall" && node.call.value.type === "@const") { return [methodDoc, "()"]; } @@ -156,7 +153,7 @@ export const printMethodAddArg: Plugin.Printer = ( // example, if you call something like Foo.new.() (implicitly calling the // #call method on a new instance of the Foo class), then we have to print // out those parentheses, otherwise we'll end up with Foo.new. - if (methodNode.type === "call" && methodNode.message === "call") { + if (node.call.type === "call" && node.call.message === "call") { return [methodDoc, "()"]; } @@ -165,7 +162,7 @@ export const printMethodAddArg: Plugin.Printer = ( // This case will ONLY be hit if we can successfully turn the block into a // to_proc call. In that case, we just explicitly add the parens around it. - if (argNode.type === "args" && argsDoc.length > 0) { + if (node.args.type === "args" && argsDoc.length > 0) { return [methodDoc, "(", ...argsDoc, ")"]; } @@ -204,10 +201,10 @@ export const printMethodAddArg: Plugin.Printer = ( const sigBlockNode = sigBlock as Ruby.MethodAddBlock; if ( - sigBlockNode.body[1] && - sigBlockNode.body[0].type === "method_add_arg" && - sigBlockNode.body[0].body[0].type === "fcall" && - sigBlockNode.body[0].body[0].value.body === "sig" + sigBlockNode.block && + sigBlockNode.call.type === "method_add_arg" && + sigBlockNode.call.call.type === "fcall" && + sigBlockNode.call.call.value.body === "sig" ) { threshold = 2; } @@ -244,7 +241,7 @@ export const printMethodAddArg: Plugin.Printer = ( // If there are already parentheses, then we can just use the doc that's // already printed. - if (argNode.type == "arg_paren") { + if (node.args.type == "arg_paren") { return [methodDoc, argsDoc]; } @@ -258,17 +255,17 @@ export const printMethodAddBlock: Plugin.Printer = ( ) => { const node = path.getValue(); - const [callNode, blockNode] = node.body; - const [callDoc, blockDoc] = path.map(print, "body"); + const callDoc = path.call(print, "call"); + const blockDoc = path.call(print, "block"); // Don't bother trying to do any kind of fancy toProc transform if the option // is disabled. if (opts.rubyToProc) { - const proc = toProc(path, blockNode); + const proc = toProc(path, node.block); - if (proc && callNode.type === "call") { + if (proc && node.call.type === "call") { return group([ - path.call(print, "body", 0), + path.call(print, "call"), "(", indent([softline, proc]), [softline, ")"] @@ -276,7 +273,7 @@ export const printMethodAddBlock: Plugin.Printer = ( } if (proc) { - return path.call(print, "body", 0); + return path.call(print, "call"); } } diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 00f6822a..9a06b921 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -1958,29 +1958,30 @@ def on_massign(target, value) # method_add_arg is a parser event that represents a method call with # arguments and parentheses. It accepts as arguments the method being called # and the arg_paren event that contains the arguments to the method. - def on_method_add_arg(fcall, arg_paren) + def on_method_add_arg(call, args) location = - if arg_paren[:type] == :args + if args[:type] == :args # You can hit this if you are passing no arguments to a method that ends # in a question mark. Because it knows it has to be a method and not a # local variable. In that case we can just use the location information # straight from the fcall. - fcall[:loc] + call[:loc] else - fcall[:loc].to(arg_paren[:loc]) + call[:loc].to(args[:loc]) end - { type: :method_add_arg, body: [fcall, arg_paren], loc: location } + { type: :method_add_arg, call: call, args: args, loc: location } end # method_add_block is a parser event that represents a method call with a # block argument. It accepts as arguments the method being called and the # block event. - def on_method_add_block(method_add_arg, block) + def on_method_add_block(call, block) { type: :method_add_block, - body: [method_add_arg, block], - loc: method_add_arg[:loc].to(block[:loc]) + call: call, + block: block, + loc: call[:loc].to(block[:loc]) } end diff --git a/src/ruby/toProc.ts b/src/ruby/toProc.ts index 1d7f7732..27e62cad 100644 --- a/src/ruby/toProc.ts +++ b/src/ruby/toProc.ts @@ -46,12 +46,16 @@ function toProc( // Get the list of statements from the block let statements: Ruby.AnyNode[]; - if (node.type !== "do_block") { - statements = node.stmts.body; - } else if (node.bodystmt.rsc || node.bodystmt.ens || node.bodystmt.els) { - return null; - } else { + + if (node.type === "do_block") { + // If you have any other clauses on the bodystmt, then we can't transform. + if (node.bodystmt.rsc || node.bodystmt.els || node.bodystmt.ens) { + return null; + } + statements = node.bodystmt.stmts.body; + } else { + statements = node.stmts.body; } // Ensure the block contains only one statement diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 02e854fe..d8604488 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -191,8 +191,8 @@ export type Command = ParserEvent<"command", { message: Const | Identifier, args export type CommandCall = ParserEvent<"command_call", { receiver: AnyNode, operator: CallOperator, message: Op | Identifier | Const, args: Args | ArgsAddBlock }>; export type DoBlock = ParserEvent<"do_block", { keyword: Keyword, block_var: null | BlockVar, bodystmt: Bodystmt }>; export type Fcall = ParserEvent<"fcall", { value: Const | Identifier }>; -export type MethodAddArg = ParserEvent<"method_add_arg", { body: [Call | Fcall, Args | ArgParen | ArgsAddBlock] }>; -export type MethodAddBlock = ParserEvent<"method_add_block", { body: [AnyNode, BraceBlock | DoBlock] }>; +export type MethodAddArg = ParserEvent<"method_add_arg", { call: Call | Fcall, args: Args | ArgParen | ArgsAddBlock }>; +export type MethodAddBlock = ParserEvent<"method_add_block", { call: AnyNode, block: BraceBlock | DoBlock }>; export type VCall = ParserEvent<"vcall", { value: Identifier }>; // These are various parser events for statements you would find in a method body. diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 3cff662c..5dc4cb70 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -170,6 +170,10 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.params, node.stmts]; case "massign": return [node.tgt, node.val]; + case "method_add_arg": + return [node.call, node.args]; + case "method_add_block": + return [node.call, node.block]; case "mlhs": return node.parts; case "mlhs_add_post": @@ -308,8 +312,6 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { case "args": case "args_add_block": case "args_add_star": - case "method_add_arg": - case "method_add_block": case "mrhs": case "mrhs_add_star": case "mrhs_new_from_args": { From c7035182a4afbc6933bc91dc75b020c659ff172e Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 3 Nov 2021 15:19:08 -0400 Subject: [PATCH 405/785] args, args_add_block, args_add_star, mrhs, mrhs_add_star, mrhs_new_from_args --- src/ruby/nodes/args.ts | 79 ++++++++++++++++++++------------------ src/ruby/nodes/arrays.ts | 18 +++++---- src/ruby/nodes/assign.ts | 2 +- src/ruby/nodes/commands.ts | 19 +++++---- src/ruby/nodes/flow.ts | 6 +-- src/ruby/nodes/massign.ts | 19 ++++----- src/ruby/nodes/rescue.ts | 2 +- src/ruby/nodes/return.ts | 21 +++++++--- src/ruby/parser.rb | 45 ++++++++++++++-------- src/types/ruby.ts | 12 +++--- src/utils/getChildNodes.ts | 30 ++++++--------- 11 files changed, 137 insertions(+), 116 deletions(-) diff --git a/src/ruby/nodes/args.ts b/src/ruby/nodes/args.ts index 4a4823d4..c131fb3a 100644 --- a/src/ruby/nodes/args.ts +++ b/src/ruby/nodes/args.ts @@ -8,16 +8,30 @@ const { group, ifBreak, indent, join, line, softline } = prettier; const noTrailingComma = ["command", "command_call"]; +function getArgs(node: Ruby.Args | Ruby.ArgsAddBlock | Ruby.ArgsAddStar): Ruby.AnyNode[] { + switch (node.type) { + case "args": + return node.parts; + case "args_add_block": { + const args = getArgs(node.args); + return node.block ? [...args, node.block] : args; + } + case "args_add_star": + return [...getArgs(node.args), node.star]; + } +} + function getArgParenTrailingComma(node: Ruby.Args | Ruby.ArgsAddBlock) { // If we have a block, then we don't want to add a trailing comma. - if (node.type === "args_add_block" && node.body[1]) { + if (node.type === "args_add_block" && node.block) { return ""; } // If we only have one argument and that first argument necessitates that we // skip putting a comma (because it would interfere with parsing the argument) // then we don't want to add a trailing comma. - if (node.body.length === 1 && noTrailingComma.includes(node.body[0].type)) { + const args = getArgs(node); + if (args.length === 1 && noTrailingComma.includes(args[0].type)) { return ""; } @@ -66,7 +80,18 @@ export const printArgs: Plugin.Printer = ( { rubyToProc }, print ) => { - const args = path.map(print, "body"); + let args: Plugin.Doc[] = []; + + // Loop through each part of this node and print out the docs for it. If it's + // an args_add_star, then we're going to flatten it into the main array so + // that we can get ome nice joining later. + path.each((partPath) => { + if (partPath.getValue().type === "args_add_star") { + args = args.concat(print(partPath)); + } else { + args.push(print(partPath)); + } + }, "parts"); // Don't bother trying to do any kind of fancy toProc transform if the // option is disabled. @@ -110,14 +135,12 @@ export const printArgsAddBlock: Plugin.Printer = ( print ) => { const node = path.getValue(); - const blockNode = node.body[1]; - - const parts = path.call(print, "body", 0) as Plugin.Doc[]; + const parts = path.call(print, "args") as Plugin.Doc[]; - if (blockNode) { - let blockDoc = path.call(print, "body", 1) as any; + if (node.block) { + let blockDoc = path.call(print, "block") as any; - if (!(blockNode.comments || []).some(({ leading }) => leading)) { + if (!(node.block.comments || []).some(({ leading }) => leading)) { // If we don't have any leading comments, we can just prepend the // operator. blockDoc = ["&", blockDoc]; @@ -149,34 +172,13 @@ export const printArgsAddStar: Plugin.Printer = ( opts, print ) => { - let docs: Plugin.Doc[] = []; - - path.each((argPath, argIndex) => { - const doc = print(argPath) as Plugin.Doc[]; - - // If it's the first child, then it's an array of args, so we're going to - // concat that onto the existing docs if there are any. - if (argIndex === 0) { - if (doc.length > 0) { - docs = docs.concat(doc); - } - return; - } - - // If it's after the splat, then it's an individual arg, so we're just going - // to push it onto the array. - if (argIndex !== 1) { - docs.push(doc); - return; - } + const node = path.getValue(); + let doc = path.call(print, "star"); + if (!(node.star.comments || []).some(({ leading }) => leading)) { // If we don't have any leading comments, we can just prepend the operator. - const argsNode = argPath.getValue() as Ruby.AnyNode; - if (!(argsNode.comments || []).some(({ leading }) => leading)) { - docs.push(["*", doc]); - return; - } - + doc = ["*", doc]; + } else { // If we have an array like: // // [ @@ -190,10 +192,11 @@ export const printArgsAddStar: Plugin.Printer = ( // In prettier >= 2.3.0, the comments are printed as an array before the // content. I don't love this kind of reflection, but it's the simplest way // at the moment to get this right. - docs.push((doc[0] as Plugin.Doc[]).concat(["*", doc[1]], doc.slice(2))); - }, "body"); + const docs = doc as [Plugin.Doc[], ...Plugin.Doc[]]; + doc = docs[0].concat(["*", docs[1]], docs.slice(2)); + } - return docs; + return [...path.call(print, "args") as Plugin.Doc[], doc]; }; export const printBlockArg: Plugin.Printer = ( diff --git a/src/ruby/nodes/arrays.ts b/src/ruby/nodes/arrays.ts index 03b8db7c..df2bf23d 100644 --- a/src/ruby/nodes/arrays.ts +++ b/src/ruby/nodes/arrays.ts @@ -12,8 +12,9 @@ const { group, ifBreak, indent, join, line, softline } = prettier; // function isStringArray(args: Ruby.Args | Ruby.ArgsAddStar) { return ( - args.body.length > 1 && - args.body.every((arg) => { + args.type === "args" && + args.parts.length > 1 && + args.parts.every((arg) => { // We want to verify that every node inside of this array is a string // literal. We also want to make sure none of them have comments attached. if (arg.type !== "string_literal" || arg.comments) { @@ -50,8 +51,9 @@ function isStringArray(args: Ruby.Args | Ruby.ArgsAddStar) { // function isSymbolArray(args: Ruby.Args | Ruby.ArgsAddStar) { return ( - args.body.length > 1 && - args.body.every((arg) => arg.type === "symbol_literal" && !arg.comments) + args.type === "args" && + args.parts.length > 1 && + args.parts.every((arg) => arg.type === "symbol_literal" && !arg.comments) ); } @@ -118,8 +120,8 @@ export const printArray: Plugin.Printer = (path, opts, print) => { const printString = (stringPath: Plugin.Path) => stringPath.call(print, "parts", 0); - const nodePath = path as Plugin.Path<{ cnts: { body: Ruby.StringLiteral[] } }>; - const parts = nodePath.map(printString, "cnts", "body"); + const nodePath = path as Plugin.Path<{ cnts: { parts: Ruby.StringLiteral[] } }>; + const parts = nodePath.map(printString, "cnts", "parts"); return printArrayLiteral("%w", parts); } @@ -130,8 +132,8 @@ export const printArray: Plugin.Printer = (path, opts, print) => { const printSymbol = (symbolPath: Plugin.Path) => symbolPath.call(print, "val"); - const nodePath = path as Plugin.Path<{ cnts: { body: Ruby.SymbolLiteral[] } }>; - const parts = nodePath.map(printSymbol, "cnts", "body"); + const nodePath = path as Plugin.Path<{ cnts: { parts: Ruby.SymbolLiteral[] } }>; + const parts = nodePath.map(printSymbol, "cnts", "parts"); return printArrayLiteral("%i", parts); } diff --git a/src/ruby/nodes/assign.ts b/src/ruby/nodes/assign.ts index cd2a7f9f..4ac168f9 100644 --- a/src/ruby/nodes/assign.ts +++ b/src/ruby/nodes/assign.ts @@ -14,7 +14,7 @@ export const printAssign: Plugin.Printer = (path, opts, print) => { // If the right side of this assignment is a multiple assignment, then we need // to join it together with commas. - if (["mrhs_add_star", "mrhs_new_from_args"].includes(valueNode.type)) { + if (["mrhs", "mrhs_add_star", "mrhs_new_from_args"].includes(valueNode.type)) { rightSideDoc = group(join([",", line], valueDoc)); } diff --git a/src/ruby/nodes/commands.ts b/src/ruby/nodes/commands.ts index be61be48..4f89ab22 100644 --- a/src/ruby/nodes/commands.ts +++ b/src/ruby/nodes/commands.ts @@ -48,9 +48,9 @@ function docLength(doc: Plugin.Doc): number { function hasDef(node: Ruby.Command) { return ( node.args.type === "args_add_block" && - node.args.body[0].type === "args" && - node.args.body[0].body[0] && - ["def", "defs"].includes(node.args.body[0].body[0].type) + node.args.args.type === "args" && + node.args.args.parts[0] && + ["def", "defs"].includes(node.args.args.parts[0].type) ); } @@ -74,10 +74,15 @@ function skipArgsAlign(node: Ruby.CommandCall) { // If there is a ternary argument to a command and it's going to get broken // into multiple lines, then we're going to have to use parentheses around the // command in order to make sure operator precedence doesn't get messed up. -function hasTernaryArg(node: Ruby.Args | Ruby.ArgsAddBlock) { - return (node.body[0] as any).body.some( - (child: Ruby.AnyNode) => child.type === "ifop" - ); +function hasTernaryArg(node: Ruby.Args | Ruby.ArgsAddBlock | Ruby.ArgsAddStar): boolean { + switch (node.type) { + case "args": + return node.parts.some((child) => child.type === "ifop"); + case "args_add_block": + return hasTernaryArg(node.args) || node.block?.type === "ifop"; + case "args_add_star": + return hasTernaryArg(node.args) || node.star.type === "ifop"; + } } export const printCommand: Plugin.Printer = ( diff --git a/src/ruby/nodes/flow.ts b/src/ruby/nodes/flow.ts index 2f1d41b5..7b590c59 100644 --- a/src/ruby/nodes/flow.ts +++ b/src/ruby/nodes/flow.ts @@ -29,7 +29,7 @@ function printFlowControl(keyword: string): Plugin.Printer { // Special handling if we've got parentheses on this call to the keyword. If // we do and we can skip them, then we will. If we don't, then we'll print // them right after the keyword with no space. - const paren = node.args.body[0].body[0]; + const paren = node.args.args.type === "args" && node.args.args.parts[0]; if (paren && paren.type === "paren") { const stmts = (paren.cnts as Ruby.Stmts).body; @@ -38,12 +38,12 @@ function printFlowControl(keyword: string): Plugin.Printer { if (stmts.length === 1 && !unskippableParens.includes(stmts[0].type)) { return [ `${keyword} `, - (path as any).call(print, "args", "body", 0, "body", 0, "cnts") + (path as any).call(print, "args", "args", "parts", 0, "cnts") ]; } // Here we know we can't, so just printing out the parentheses as normal. - return [keyword, (path as any).call(print, "args", "body", 0, "body", 0)]; + return [keyword, (path as any).call(print, "args", "args", "parts", 0)]; } // If we didn't hit the super special handling, then we're just going to diff --git a/src/ruby/nodes/massign.ts b/src/ruby/nodes/massign.ts index 1238cd1a..c14a2a4f 100644 --- a/src/ruby/nodes/massign.ts +++ b/src/ruby/nodes/massign.ts @@ -11,7 +11,7 @@ export const printMAssign: Plugin.Printer = ( const node = path.getValue(); let valueDoc = path.call(print, "val"); - if (["mrhs_add_star", "mrhs_new_from_args"].includes(node.val.type)) { + if (["mrhs", "mrhs_add_star", "mrhs_new_from_args"].includes(node.val.type)) { valueDoc = group(join([",", line], valueDoc)); } @@ -79,7 +79,7 @@ export const printMLHSParen: Plugin.Printer = ( }; export const printMRHS: Plugin.Printer = (path, opts, print) => { - return path.map(print, "body"); + return path.map(print, "parts"); }; export const printMRHSAddStar: Plugin.Printer = ( @@ -87,9 +87,10 @@ export const printMRHSAddStar: Plugin.Printer = ( opts, print ) => { - const [leftDoc, rightDoc] = path.map(print, "body"); - - return [...(leftDoc as Plugin.Doc[]), ["*", rightDoc]]; + return [ + ...(path.call(print, "mrhs") as Plugin.Doc[]), + ["*", path.call(print, "star")] + ]; }; export const printMRHSNewFromArgs: Plugin.Printer = ( @@ -97,11 +98,5 @@ export const printMRHSNewFromArgs: Plugin.Printer = ( opts, print ) => { - const parts = path.call(print, "body", 0) as Plugin.Doc[]; - - if (path.getValue().body[1]) { - parts.push(path.call(print, "body", 1)); - } - - return parts; + return path.call(print, "args"); }; diff --git a/src/ruby/nodes/rescue.ts b/src/ruby/nodes/rescue.ts index b64317a9..c5c0ef7c 100644 --- a/src/ruby/nodes/rescue.ts +++ b/src/ruby/nodes/rescue.ts @@ -65,7 +65,7 @@ export const printRescueEx: Plugin.Printer = ( // If there are multiple exceptions being rescued, then we're going to have // multiple doc nodes returned as an array that we need to join together. - if (["mrhs_add_star", "mrhs_new_from_args"].includes(node.extns.type)) { + if (["mrhs", "mrhs_add_star", "mrhs_new_from_args"].includes(node.extns.type)) { exceptionDoc = group(join([",", line], exceptionDoc)); } diff --git a/src/ruby/nodes/return.ts b/src/ruby/nodes/return.ts index 8ea2a2c5..6e7fc8b4 100644 --- a/src/ruby/nodes/return.ts +++ b/src/ruby/nodes/return.ts @@ -37,13 +37,13 @@ export const printReturn: Plugin.Printer = (path, opts, print) => { let parts: Plugin.Doc | Plugin.Doc[] = ""; if (node.args.type === "args_add_block") { - const args = node.args.body[0]; - const steps = ["args", "body", 0]; + const args = node.args.args; + const steps: PropertyKey[] = ["args", "args"]; - if (args.type === "args" && args.body.length === 1 && args.body[0]) { + if (args.type === "args" && args.parts.length === 1 && args.parts[0]) { // This is the first and only argument being passed to the return keyword. - let arg = args.body[0]; - steps.push("body", 0); + let arg = args.parts[0]; + steps.push("parts", 0); // If the body of the return contains parens, then just skip directly to // the content of the parens so that we can skip printing parens if we @@ -65,8 +65,17 @@ export const printReturn: Plugin.Printer = (path, opts, print) => { if (arg.type === "array" && arg.cnts) { const contents = arg.cnts; - if ((contents.type === "args" || contents.type === "args_add_star") && contents.body.length > 1) { + if (contents.type === "args" && contents.parts.length > 1) { + // If we have just regular arguments and we have more than 1. steps.push("cnts"); + } else if (contents.type === "args_add_star") { + if (contents.args.type === "args_add_star") { + // If we have two splats. + steps.push("cnts"); + } else if (contents.args.parts.length > 0) { + // If we have a splat and at least one pre argument. + steps.push("cnts"); + } } } } diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 9a06b921..2b34f61e 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -503,17 +503,21 @@ def on_arg_paren(args) # parent args node as well as an arg which can be anything that could be # passed as an argument. def on_args_add(args, arg) - if args[:body].empty? + if args[:type] == :args_add_star + # If we're adding an argument after a splatted argument, then it's going + # to come in through this path. + { type: :args, parts: [args, arg], loc: args[:loc].to(arg[:loc]) } + elsif args[:parts].empty? # If this is the first argument being passed into the list of arguments, # then we're going to use the bounds of the argument to override the # parent node's location since this will be more accurate. - { type: :args, body: [arg], loc: arg[:loc] } + { type: :args, parts: [arg], loc: arg[:loc] } else # Otherwise we're going to update the existing list with the argument # being added as well as the new end bounds. { type: args[:type], - body: args[:body] << arg, + parts: args[:parts] << arg, loc: args[:loc].to(arg[:loc]) } end @@ -527,7 +531,8 @@ def on_args_add_block(args, block) { type: :args_add_block, - body: [args, block || nil], + args: args, + block: block || nil, loc: args[:loc].to(ending[:loc]) } end @@ -535,13 +540,14 @@ def on_args_add_block(args, block) # args_add_star is a parser event that represents adding a splat of values # to a list of arguments. If accepts as arguments the parent args node as # well as the part that is being splatted. - def on_args_add_star(args, part) + def on_args_add_star(args, star) beging = find_scanner_event(:@op, '*') - ending = part || beging + ending = star || beging { type: :args_add_star, - body: [args, part], + args: args, + star: star, loc: beging[:loc].to(ending[:loc]) } end @@ -558,7 +564,7 @@ def on_args_forward # arguments to any method call or an array. It can be followed by any # number of args_add events, which we'll append onto an array body. def on_args_new - { type: :args, body: [], loc: Location.fixed(line: lineno, char: char_pos) } + { type: :args, parts: [], loc: Location.fixed(line: lineno, char: char_pos) } end # Array nodes can contain a myriad of subnodes because of the special @@ -2072,18 +2078,24 @@ def on_module(constant, bodystmt) # be followed by any number of mrhs_add nodes that we'll build up into an # array body. def on_mrhs_new - { type: :mrhs, body: [], loc: Location.fixed(line: lineno, char: char_pos) } + { type: :mrhs, parts: [], loc: Location.fixed(line: lineno, char: char_pos) } end # An mrhs_add is a parser event that represents adding another value onto # a list on the right hand side of a multiple assignment. def on_mrhs_add(mrhs, part) - if mrhs[:body].empty? - { type: :mrhs, body: [part], loc: mrhs[:loc] } + if mrhs[:type] == :mrhs_new_from_args + { + type: :mrhs, + parts: [*mrhs[:args][:parts], part], + loc: mrhs[:loc].to(part[:loc]) + } + elsif mrhs[:parts].empty? + { type: :mrhs, parts: [part], loc: mrhs[:loc] } else { type: mrhs[:type], - body: mrhs[:body] << part, + parts: mrhs[:parts] << part, loc: mrhs[:loc].to(part[:loc]) } end @@ -2092,13 +2104,14 @@ def on_mrhs_add(mrhs, part) # An mrhs_add_star is a parser event that represents using the splat # operator to expand out a value on the right hand side of a multiple # assignment. - def on_mrhs_add_star(mrhs, part) + def on_mrhs_add_star(mrhs, star) beging = find_scanner_event(:@op, '*') - ending = part || beging + ending = star || beging { type: :mrhs_add_star, - body: [mrhs, part], + mrhs: mrhs, + star: star, loc: beging[:loc].to(ending[:loc]) } end @@ -2112,7 +2125,7 @@ def on_mrhs_add_star(mrhs, part) # foo = 1, 2, 3 # def on_mrhs_new_from_args(args) - { type: :mrhs_new_from_args, body: [args], loc: args[:loc] } + { type: :mrhs_new_from_args, args: args, loc: args[:loc] } end # next is a parser event that represents using the next keyword. It diff --git a/src/types/ruby.ts b/src/types/ruby.ts index d8604488..23399437 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -127,9 +127,9 @@ export type Mlhs = ParserEvent<"mlhs", { parts: (ArefField | Field | Identifier export type MlhsAddPost = ParserEvent<"mlhs_add_post", { star: MlhsAddStar, mlhs: Mlhs }>; export type MlhsAddStar = ParserEvent<"mlhs_add_star", { mlhs: Mlhs, star: null | ArefField | Field | Identifier | VarField }>; export type MlhsParen = ParserEvent<"mlhs_paren", { cnts: Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen }>; -export type Mrhs = ParserEvent<"mrhs", { body: [] }>; -export type MrhsAddStar = ParserEvent<"mrhs_add_star", { body: [Mrhs | MrhsNewFromArgs, AnyNode] }>; -export type MrhsNewFromArgs = ParserEvent<"mrhs_new_from_args", { body: [Args | ArgsAddStar, AnyNode], oper: string }>; +export type Mrhs = ParserEvent<"mrhs", { parts: AnyNode[] }>; +export type MrhsAddStar = ParserEvent<"mrhs_add_star", { mrhs: Mrhs | MrhsNewFromArgs, star: AnyNode }>; +export type MrhsNewFromArgs = ParserEvent<"mrhs_new_from_args", { args: Args | ArgsAddStar }>; // These are various parser events for control flow constructs. export type Case = ParserEvent<"case", { value: AnyNode, cons: In | When }>; @@ -181,9 +181,9 @@ export type RestParam = ParserEvent<"rest_param", { name: null | Identifier }>; // These are various parser events for method calls. export type CallOperator = Op | Period | "::"; export type ArgParen = ParserEvent<"arg_paren", { args: Args | ArgsAddBlock | ArgsForward | null }>; -export type Args = ParserEvent<"args", { body: AnyNode[] }>; -export type ArgsAddBlock = ParserEvent<"args_add_block", { body: [Args | ArgsAddStar, null | AnyNode] }>; -export type ArgsAddStar = ParserEvent<"args_add_star", { body: [Args | ArgsAddStar, ...AnyNode[]] }>; +export type Args = ParserEvent<"args", { parts: AnyNode[] }>; +export type ArgsAddBlock = ParserEvent<"args_add_block", { args: Args | ArgsAddStar, block: null | AnyNode }>; +export type ArgsAddStar = ParserEvent<"args_add_star", { args: Args | ArgsAddStar, star: AnyNode }>; export type BlockVar = ParserEvent<"block_var", { params: Params, locals: Identifier[] }>; export type BraceBlock = ParserEvent<"brace_block", { lbrace: Lbrace, block_var: null | BlockVar, stmts: Stmts }>; export type Call = ParserEvent<"call", { receiver: AnyNode, operator: CallOperator, message: Backtick | Op | Identifier | Const | "call" }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 5dc4cb70..3150205f 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -45,6 +45,12 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.collection, node.index]; case "arg_paren": return [node.args]; + case "args": + return node.parts; + case "args_add_block": + return [node.args, node.block]; + case "args_add_star": + return [node.args, node.star]; case "args_forward": return []; case "array": @@ -184,6 +190,12 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return [node.cnts]; case "module": return [node.constant, node.bodystmt]; + case "mrhs": + return node.parts; + case "mrhs_add_star": + return [node.mrhs, node.star]; + case "mrhs_new_from_args": + return [node.args]; case "next": return [node.args]; case "opassign": @@ -306,24 +318,6 @@ function getChildNodes(node: Ruby.AnyNode): ChildNode[] { return []; case "zsuper": return []; - - - - case "args": - case "args_add_block": - case "args_add_star": - case "mrhs": - case "mrhs_add_star": - case "mrhs_new_from_args": { - if (Array.isArray(node.body)) { - return node.body.filter( - (child: any) => child && typeof child === "object" - ); - } - return []; - } - - default: throwBadNode(node); } From ccbcef1cd879c8f0eb70eb0c9bd843b82cfd35c5 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 3 Nov 2021 18:24:21 -0400 Subject: [PATCH 406/785] Type fixes --- src/ruby/nodes.ts | 55 +++++++++++++++++++++++++++++++++++--- src/ruby/nodes/arrays.ts | 35 +++++++++++------------- src/ruby/printer.ts | 10 +++---- src/types/ruby.ts | 2 +- src/utils/getChildNodes.ts | 7 ++--- 5 files changed, 74 insertions(+), 35 deletions(-) diff --git a/src/ruby/nodes.ts b/src/ruby/nodes.ts index 6a64da45..3a4d9014 100644 --- a/src/ruby/nodes.ts +++ b/src/ruby/nodes.ts @@ -9,7 +9,7 @@ import { printArgsAddStar, printBlockArg } from "./nodes/args"; -import { printArray, printWord } from "./nodes/arrays"; +import { printArray, printQsymbols, printQwords, printSymbols, printWord, printWords } from "./nodes/arrays"; import { printAssign, printOpAssign, @@ -125,13 +125,55 @@ import { import { printSuper, printZSuper } from "./nodes/super"; import { printUndef } from "./nodes/undef"; -const nodes: Partial<{ - [_T in Ruby.AnyNode["type"] | "@comment"]: Plugin.Printer; -}> = { +type Token = ( + | Ruby.EndContent + | Ruby.Backref + | Ruby.Backtick + | Ruby.Const + | Ruby.CVar + | Ruby.Float + | Ruby.GVar + | Ruby.HeredocBegin + | Ruby.Identifier + | Ruby.Imaginary + | Ruby.Int + | Ruby.IVar + | Ruby.Keyword + | Ruby.Label + | Ruby.Lbrace + | Ruby.Lparen + | Ruby.Op + | Ruby.Period + | Ruby.Rational + | Ruby.TStringContent +); + +const printToken: Plugin.Printer = (path) => path.getValue().body; +const printVoidStmt: Plugin.Printer = () => ""; + +const nodes: Record> = { "@__end__": printEndContent, "@CHAR": printChar, "@comment": printComment, + "@backref": printToken, + "@backtick": printToken, + "@const": printToken, + "@cvar": printToken, + "@float": printToken, + "@gvar": printToken, + "@heredoc_beg": printToken, + "@ident": printToken, + "@imaginary": printToken, "@int": printInt, + "@ivar": printToken, + "@kw": printToken, + "@label": printToken, + "@lbrace": printToken, + "@lparen": printToken, + "@op": printToken, + "@period": printToken, + "@rational": printToken, + "@tstring_content": printToken, access_ctrl: printAccessControl, alias: printAlias, aref: printAref, @@ -206,6 +248,8 @@ const nodes: Partial<{ params: printParams, paren: printParen, program: printProgram, + qwords: printQwords, + qsymbols: printQsymbols, rassign: printRAssign, redo: printRedo, regexp_literal: printRegexpLiteral, @@ -223,6 +267,7 @@ const nodes: Partial<{ string_embexpr: printStringEmbExpr, string_literal: printStringLiteral, super: printSuper, + symbols: printSymbols, symbol_literal: printSymbolLiteral, top_const_field: printTopConst, top_const_ref: printTopConst, @@ -236,10 +281,12 @@ const nodes: Partial<{ var_field: printVarField, var_ref: printVarRef, vcall: printCallContainer, + void_stmt: printVoidStmt, when: printWhen, while: printWhile, while_mod: printWhile, word: printWord, + words: printWords, xstring_literal: printXStringLiteral, yield: printYield, yield0: printYield0, diff --git a/src/ruby/nodes/arrays.ts b/src/ruby/nodes/arrays.ts index df2bf23d..92416ec4 100644 --- a/src/ruby/nodes/arrays.ts +++ b/src/ruby/nodes/arrays.ts @@ -67,7 +67,7 @@ export const printWord: Plugin.Printer = (path, opts, print) => { // Prints out a special array literal. Accepts the parts of the array literal as // an argument, where the first element of the parts array is a string that // contains the special start. -function printArrayLiteral(start: string, parts: Plugin.Doc[]) { +function printArrayLiteralParts(start: string, parts: Plugin.Doc[]) { return group([ start, "[", @@ -77,12 +77,16 @@ function printArrayLiteral(start: string, parts: Plugin.Doc[]) { ]); } -const arrayLiteralStarts = { - qsymbols: "%i", - qwords: "%w", - symbols: "%I", - words: "%W" -}; +function printArrayLiteral(start: string): Plugin.Printer { + return function printArrayLiteralWithStart(path, opts, print) { + return printArrayLiteralParts(start, (path as any).map(print, "elems")); + } +} + +export const printQsymbols = printArrayLiteral("%i"); +export const printQwords = printArrayLiteral("%w"); +export const printSymbols = printArrayLiteral("%I"); +export const printWords = printArrayLiteral("%W"); // An array node is any literal array in Ruby. This includes all of the special // array literals as well as regular arrays. If it is a special array literal @@ -99,18 +103,9 @@ export const printArray: Plugin.Printer = (path, opts, print) => { } // If we don't have a regular args node at this point then we have a special - // array literal. In that case we're going to print out the body (which will - // return to us an array with the first one being the start of the array) and - // send that over to the printArrayLiteral function. + // array literal. In that case we're going to print out just the contents. if (contents.type !== "args" && contents.type !== "args_add_star") { - return path.call( - (arrayPath) => - printArrayLiteral( - arrayLiteralStarts[contents.type], - arrayPath.map(print, "elems") - ), - "cnts" - ); + return path.call(print, "cnts"); } if (opts.rubyArrayLiteral) { @@ -123,7 +118,7 @@ export const printArray: Plugin.Printer = (path, opts, print) => { const nodePath = path as Plugin.Path<{ cnts: { parts: Ruby.StringLiteral[] } }>; const parts = nodePath.map(printString, "cnts", "parts"); - return printArrayLiteral("%w", parts); + return printArrayLiteralParts("%w", parts); } // If we have an array that contains only simple symbol literals with no @@ -135,7 +130,7 @@ export const printArray: Plugin.Printer = (path, opts, print) => { const nodePath = path as Plugin.Path<{ cnts: { parts: Ruby.SymbolLiteral[] } }>; const parts = nodePath.map(printSymbol, "cnts", "parts"); - return printArrayLiteral("%i", parts); + return printArrayLiteralParts("%i", parts); } } diff --git a/src/ruby/printer.ts b/src/ruby/printer.ts index 4b0e52d1..a94247c8 100644 --- a/src/ruby/printer.ts +++ b/src/ruby/printer.ts @@ -63,15 +63,11 @@ const printer: Plugin.PrinterConfig = { const node = path.getValue(); const printer = nodes[node.type]; - if (printer) { - return printer(path, opts, print); + if (!printer) { + throw new Error(`Unsupported node type: ${node.type}`); } - if (node.type[0] === "@") { - return (node as any).body; - } - - throw new Error(`Unsupported node encountered: ${node.type}`); + return printer(path, opts, print); }, // This is the generic print function for any comment in the AST. It handles // both regular comments that begin with a # and embdoc comments, which are diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 23399437..377507b2 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -13,7 +13,7 @@ type ParserEvent> = { type: T, loc: Location } & // This is the main expression type that goes in places where the AST will // accept just about anything. // eslint-disable-next-line @typescript-eslint/ban-types -export type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgParen | Args | ArgsAddBlock | ArgsAddStar | ArgsForward | Array | Aryptn | Assign | AssocNew | AssocSplat | AssoclistFromArgs | BEGIN | Backref | Backtick | BareAssocHash | Begin | Binary | BlockVar | Blockarg | Bodystmt | BraceBlock | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | Defsl | DoBlock | Dot2 | Dot3 | DynaSymbol | END | Else | Elsif | EndContent | Ensure | ExcessedComma | Fcall | Field | Float | FndPtn | For | GVar | Hash | Heredoc | HeredocBegin | Hshptn | IVar | Identifier | If | IfModifier | Imaginary | In | Int | Keyword | KeywordRestParam | Label | Lambda | Lbrace | Lparen | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Op | Opassign | Params | Paren | Period | Program | Qsymbols | Qwords | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueEx | RescueModifier | RestParam | Retry | Return | Return0 | Sclass | Stmts | StringConcat | StringDVar | StringEmbExpr | StringLiteral | Super | SymbolLiteral | Symbols | TStringContent | Ternary | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VCall | VarAlias | VarField | VarRef | VoidStmt | When | While | WhileModifier | Word | Words | XStringLiteral | Yield | Yield0 | Zsuper +export type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgParen | Args | ArgsAddBlock | ArgsAddStar | ArgsForward | Array | Aryptn | Assign | AssocNew | AssocSplat | AssoclistFromArgs | BEGIN | Backref | Backtick | BareAssocHash | Begin | Binary | BlockVar | Blockarg | Bodystmt | BraceBlock | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | Defsl | DoBlock | Dot2 | Dot3 | DynaSymbol | END | Else | Elsif | EndContent | Ensure | ExcessedComma | Fcall | Field | Float | FndPtn | For | GVar | Hash | Heredoc | HeredocBegin | Hshptn | IVar | Identifier | If | IfModifier | Imaginary | In | Int | Keyword | KeywordRestParam | Label | Lambda | Lbrace | Lparen | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Op | Opassign | Params | Paren | Period | Program | Qwords | Qsymbols | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueEx | RescueModifier | RestParam | Retry | Return | Return0 | Sclass | Stmts | StringConcat | StringDVar | StringEmbExpr | StringLiteral | Super | Symbols | SymbolLiteral | TStringContent | Ternary | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VCall | VarAlias | VarField | VarRef | VoidStmt | When | While | WhileModifier | Word | Words | XStringLiteral | Yield | Yield0 | Zsuper // This is a special scanner event that contains a comment. It can be attached // to almost any kind of node, which is why it's pulled out here separately. diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 3150205f..83bf4a8b 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -1,13 +1,14 @@ import type { Ruby } from "../types"; -type ChildNode = Ruby.AnyNode | null; +type AnyNode = Ruby.AnyNode | Ruby.VoidStmt; +type ChildNode = AnyNode | null; function throwBadNode(node: never): never; -function throwBadNode(node: Ruby.AnyNode) { +function throwBadNode(node: AnyNode) { throw new Error(`Unknown node ${node.type}`); } -function getChildNodes(node: Ruby.AnyNode): ChildNode[] { +function getChildNodes(node: AnyNode): ChildNode[] { switch (node.type) { case "@CHAR": case "@__end__": From 540f3288b1a79ea846d35692305f0d547ee3f8b6 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 3 Nov 2021 18:28:25 -0400 Subject: [PATCH 407/785] prettier format --- bin/sexp | 5 +++- src/ruby/embed.ts | 4 ++- src/ruby/nodes.ts | 20 +++++++------ src/ruby/nodes/args.ts | 6 ++-- src/ruby/nodes/arrays.ts | 10 +++++-- src/ruby/nodes/assign.ts | 18 ++++++------ src/ruby/nodes/blocks.ts | 15 ++++++++-- src/ruby/nodes/calls.ts | 3 +- src/ruby/nodes/commands.ts | 4 ++- src/ruby/nodes/conditionals.ts | 29 +++++++++++++------ src/ruby/nodes/constants.ts | 17 ++++++++++-- src/ruby/nodes/flow.ts | 4 +-- src/ruby/nodes/hashes.ts | 4 +-- src/ruby/nodes/loops.ts | 16 ++++++----- src/ruby/nodes/methods.ts | 3 +- src/ruby/nodes/params.ts | 51 +++++++++++++++++----------------- src/ruby/nodes/patterns.ts | 14 ++-------- src/ruby/nodes/rescue.ts | 4 ++- src/ruby/nodes/strings.ts | 6 +++- src/ruby/nodes/undef.ts | 39 ++++++++++++-------------- src/ruby/parser.rb | 50 ++++++++++++++++----------------- src/utils/getChildNodes.ts | 10 +++++-- src/utils/isEmptyParams.ts | 10 ++++++- 23 files changed, 199 insertions(+), 143 deletions(-) diff --git a/bin/sexp b/bin/sexp index 5856605a..d364b535 100755 --- a/bin/sexp +++ b/bin/sexp @@ -12,7 +12,10 @@ PP.prepend( text "C#{obj[:loc].start_char}-#{obj[:loc].end_char}>" source = obj.respond_to?(:value) ? obj.value : obj - sliced = source.select { |key, value| !%i[type loc comments].include?(key) && value }.keys + sliced = + source.select do |key, value| + !%i[type loc comments].include?(key) && value + end.keys group(1) do breakable ' ' diff --git a/src/ruby/embed.ts b/src/ruby/embed.ts index 33abc932..1115744a 100644 --- a/src/ruby/embed.ts +++ b/src/ruby/embed.ts @@ -74,7 +74,9 @@ function stripCommonLeadingWhitespace(content: string) { // A type assertion so that TypeScript knows we're working with an array of // exclusively plain string content. -function isTStringContentArray(body: Ruby.StringContent[]): body is Ruby.TStringContent[] { +function isTStringContentArray( + body: Ruby.StringContent[] +): body is Ruby.TStringContent[] { return body.every((part) => part.type === "@tstring_content"); } diff --git a/src/ruby/nodes.ts b/src/ruby/nodes.ts index 3a4d9014..e2c9ada5 100644 --- a/src/ruby/nodes.ts +++ b/src/ruby/nodes.ts @@ -9,7 +9,14 @@ import { printArgsAddStar, printBlockArg } from "./nodes/args"; -import { printArray, printQsymbols, printQwords, printSymbols, printWord, printWords } from "./nodes/arrays"; +import { + printArray, + printQsymbols, + printQwords, + printSymbols, + printWord, + printWords +} from "./nodes/arrays"; import { printAssign, printOpAssign, @@ -53,11 +60,7 @@ import { printHeredoc } from "./nodes/heredocs"; import { printBEGIN, printEND } from "./nodes/hooks"; import { printInt } from "./nodes/ints"; import { printLambda } from "./nodes/lambdas"; -import { - printFor, - printUntil, - printWhile, -} from "./nodes/loops"; +import { printFor, printUntil, printWhile } from "./nodes/loops"; import { printMAssign, printMLHS, @@ -125,7 +128,7 @@ import { import { printSuper, printZSuper } from "./nodes/super"; import { printUndef } from "./nodes/undef"; -type Token = ( +type Token = | Ruby.EndContent | Ruby.Backref | Ruby.Backtick @@ -145,8 +148,7 @@ type Token = ( | Ruby.Op | Ruby.Period | Ruby.Rational - | Ruby.TStringContent -); + | Ruby.TStringContent; const printToken: Plugin.Printer = (path) => path.getValue().body; const printVoidStmt: Plugin.Printer = () => ""; diff --git a/src/ruby/nodes/args.ts b/src/ruby/nodes/args.ts index c131fb3a..bfd73d78 100644 --- a/src/ruby/nodes/args.ts +++ b/src/ruby/nodes/args.ts @@ -8,7 +8,9 @@ const { group, ifBreak, indent, join, line, softline } = prettier; const noTrailingComma = ["command", "command_call"]; -function getArgs(node: Ruby.Args | Ruby.ArgsAddBlock | Ruby.ArgsAddStar): Ruby.AnyNode[] { +function getArgs( + node: Ruby.Args | Ruby.ArgsAddBlock | Ruby.ArgsAddStar +): Ruby.AnyNode[] { switch (node.type) { case "args": return node.parts; @@ -196,7 +198,7 @@ export const printArgsAddStar: Plugin.Printer = ( doc = docs[0].concat(["*", docs[1]], docs.slice(2)); } - return [...path.call(print, "args") as Plugin.Doc[], doc]; + return [...(path.call(print, "args") as Plugin.Doc[]), doc]; }; export const printBlockArg: Plugin.Printer = ( diff --git a/src/ruby/nodes/arrays.ts b/src/ruby/nodes/arrays.ts index 92416ec4..cd0a4a28 100644 --- a/src/ruby/nodes/arrays.ts +++ b/src/ruby/nodes/arrays.ts @@ -80,7 +80,7 @@ function printArrayLiteralParts(start: string, parts: Plugin.Doc[]) { function printArrayLiteral(start: string): Plugin.Printer { return function printArrayLiteralWithStart(path, opts, print) { return printArrayLiteralParts(start, (path as any).map(print, "elems")); - } + }; } export const printQsymbols = printArrayLiteral("%i"); @@ -115,7 +115,9 @@ export const printArray: Plugin.Printer = (path, opts, print) => { const printString = (stringPath: Plugin.Path) => stringPath.call(print, "parts", 0); - const nodePath = path as Plugin.Path<{ cnts: { parts: Ruby.StringLiteral[] } }>; + const nodePath = path as Plugin.Path<{ + cnts: { parts: Ruby.StringLiteral[] }; + }>; const parts = nodePath.map(printString, "cnts", "parts"); return printArrayLiteralParts("%w", parts); @@ -127,7 +129,9 @@ export const printArray: Plugin.Printer = (path, opts, print) => { const printSymbol = (symbolPath: Plugin.Path) => symbolPath.call(print, "val"); - const nodePath = path as Plugin.Path<{ cnts: { parts: Ruby.SymbolLiteral[] } }>; + const nodePath = path as Plugin.Path<{ + cnts: { parts: Ruby.SymbolLiteral[] }; + }>; const parts = nodePath.map(printSymbol, "cnts", "parts"); return printArrayLiteralParts("%i", parts); diff --git a/src/ruby/nodes/assign.ts b/src/ruby/nodes/assign.ts index 4ac168f9..791cc0b6 100644 --- a/src/ruby/nodes/assign.ts +++ b/src/ruby/nodes/assign.ts @@ -14,7 +14,9 @@ export const printAssign: Plugin.Printer = (path, opts, print) => { // If the right side of this assignment is a multiple assignment, then we need // to join it together with commas. - if (["mrhs", "mrhs_add_star", "mrhs_new_from_args"].includes(valueNode.type)) { + if ( + ["mrhs", "mrhs_add_star", "mrhs_new_from_args"].includes(valueNode.type) + ) { rightSideDoc = group(join([",", line], valueDoc)); } @@ -29,23 +31,19 @@ export const printOpAssign: Plugin.Printer = ( path, opts, print -) => ( +) => group([ path.call(print, "target"), " ", path.call(print, "operator"), indent([line, path.call(print, "value")]) - ]) -); + ]); export const printVarField: Plugin.Printer = ( path, opts, print -) => ( - path.getValue().value ? path.call(print, "value") : "" -); +) => (path.getValue().value ? path.call(print, "value") : ""); -export const printVarRef: Plugin.Printer = (path, opts, print) => ( - path.call(print, "value") -); +export const printVarRef: Plugin.Printer = (path, opts, print) => + path.call(print, "value"); diff --git a/src/ruby/nodes/blocks.ts b/src/ruby/nodes/blocks.ts index 4c0b81e3..305c3bf0 100644 --- a/src/ruby/nodes/blocks.ts +++ b/src/ruby/nodes/blocks.ts @@ -49,10 +49,15 @@ type Block = Ruby.BraceBlock | Ruby.DoBlock; function printBlock(braces: boolean): Plugin.Printer { return function printBlockWithBraces(path, opts, print) { const node = path.getValue(); - const stmts: Ruby.AnyNode[] = node.type === "brace_block" ? node.stmts.body : node.bodystmt.stmts.body; + const stmts: Ruby.AnyNode[] = + node.type === "brace_block" ? node.stmts.body : node.bodystmt.stmts.body; let doBlockBody: Plugin.Doc = ""; - if (stmts.length !== 1 || stmts[0].type !== "void_stmt" || stmts[0].comments) { + if ( + stmts.length !== 1 || + stmts[0].type !== "void_stmt" || + stmts[0].comments + ) { doBlockBody = indent([ softline, path.call(print, node.type === "brace_block" ? "stmts" : "bodystmt") @@ -79,7 +84,11 @@ function printBlock(braces: boolean): Plugin.Printer { // We can hit this next pattern if within the block the only statement is a // comment. - if (stmts.length === 1 && stmts[0].type === "void_stmt" && stmts[0].comments) { + if ( + stmts.length === 1 && + stmts[0].type === "void_stmt" && + stmts[0].comments + ) { return [breakParent, doBlock]; } diff --git a/src/ruby/nodes/calls.ts b/src/ruby/nodes/calls.ts index 9a14589e..d31d059b 100644 --- a/src/ruby/nodes/calls.ts +++ b/src/ruby/nodes/calls.ts @@ -48,7 +48,8 @@ export const printCall: Plugin.Printer = (path, opts, print) => { // // In the case we need to group the receiver and the operator together or // we'll end up with a syntax error. - const operatorIsTrailing = node.message !== "call" && hasLeadingComments(node.message); + const operatorIsTrailing = + node.message !== "call" && hasLeadingComments(node.message); if (operatorIsTrailing) { leftSideDoc = [receiverDoc, operatorDoc]; diff --git a/src/ruby/nodes/commands.ts b/src/ruby/nodes/commands.ts index 4f89ab22..bd77d7e8 100644 --- a/src/ruby/nodes/commands.ts +++ b/src/ruby/nodes/commands.ts @@ -74,7 +74,9 @@ function skipArgsAlign(node: Ruby.CommandCall) { // If there is a ternary argument to a command and it's going to get broken // into multiple lines, then we're going to have to use parentheses around the // command in order to make sure operator precedence doesn't get messed up. -function hasTernaryArg(node: Ruby.Args | Ruby.ArgsAddBlock | Ruby.ArgsAddStar): boolean { +function hasTernaryArg( + node: Ruby.Args | Ruby.ArgsAddBlock | Ruby.ArgsAddStar +): boolean { switch (node.type) { case "args": return node.parts.some((child) => child.type === "ifop"); diff --git a/src/ruby/nodes/conditionals.ts b/src/ruby/nodes/conditionals.ts index e56dcd15..ec0e8a8d 100644 --- a/src/ruby/nodes/conditionals.ts +++ b/src/ruby/nodes/conditionals.ts @@ -22,7 +22,12 @@ function containsSingleConditional(stmts: Ruby.Stmts) { ); } -function printWithAddition(keyword: string, path: Plugin.Path, print: Plugin.Print, breaking: boolean) { +function printWithAddition( + keyword: string, + path: Plugin.Path, + print: Plugin.Print, + breaking: boolean +) { return [ `${keyword} `, align(keyword.length + 1, path.call(print, "pred")), @@ -97,14 +102,18 @@ export const printTernary: Plugin.Printer = ( ); }; -function isModifier(node: Conditional | Ruby.IfModifier | Ruby.UnlessModifier): node is Ruby.IfModifier | Ruby.UnlessModifier { +function isModifier( + node: Conditional | Ruby.IfModifier | Ruby.UnlessModifier +): node is Ruby.IfModifier | Ruby.UnlessModifier { return node.type === "if_mod" || node.type === "unless_mod"; } // Prints an `if_mod` or `unless_mod` node. Because it was previously in the // modifier form, we're guaranteed to not have an additional node, so we can // just work with the predicate and the body. -function printSingle(keyword: string): Plugin.Printer { +function printSingle( + keyword: string +): Plugin.Printer { return function printSingleWithKeyword(path, { rubyModifier }, print) { const node = path.getValue(); @@ -122,10 +131,7 @@ function printSingle(keyword: string): Plugin.Printer) { const node = path.getValue(); return ( - !["assign", "opassign", "command_call", "command"].includes(node.pred.type) && + !["assign", "opassign", "command_call", "command"].includes( + node.pred.type + ) && node.cons && node.cons.type === "else" && canTernaryStmts(node.stmts) && @@ -266,7 +274,10 @@ function printConditional(keyword: string): Plugin.Printer { // // 2. If the conditional contains just another conditional, then collapsing // it would result in double modifiers on the same line. - if (containsAssignment(node.pred) || containsSingleConditional(node.stmts)) { + if ( + containsAssignment(node.pred) || + containsSingleConditional(node.stmts) + ) { return [ `${keyword} `, align(keyword.length + 1, path.call(print, "pred")), diff --git a/src/ruby/nodes/constants.ts b/src/ruby/nodes/constants.ts index f011fc98..bc1f46c4 100644 --- a/src/ruby/nodes/constants.ts +++ b/src/ruby/nodes/constants.ts @@ -5,9 +5,17 @@ import { makeCall } from "../../utils"; const { group, indent, softline } = prettier; type ConstPath = Ruby.ConstPathField | Ruby.ConstPathRef; -export const printConstPath: Plugin.Printer = (path, opts, print) => [path.call(print, "parent"), "::", path.call(print, "constant")]; +export const printConstPath: Plugin.Printer = ( + path, + opts, + print +) => [path.call(print, "parent"), "::", path.call(print, "constant")]; -export const printConstRef: Plugin.Printer = (path, opts, print) => path.call(print, "constant"); +export const printConstRef: Plugin.Printer = ( + path, + opts, + print +) => path.call(print, "constant"); export const printDefined: Plugin.Printer = ( path, @@ -31,4 +39,7 @@ export const printField: Plugin.Printer = (path, opts, print) => { }; type TopConst = Ruby.TopConstField | Ruby.TopConstRef; -export const printTopConst: Plugin.Printer = (path, opts, print) => ["::", path.call(print, "constant")]; +export const printTopConst: Plugin.Printer = (path, opts, print) => [ + "::", + path.call(print, "constant") +]; diff --git a/src/ruby/nodes/flow.ts b/src/ruby/nodes/flow.ts index 7b590c59..bed60cce 100644 --- a/src/ruby/nodes/flow.ts +++ b/src/ruby/nodes/flow.ts @@ -48,8 +48,8 @@ function printFlowControl(keyword: string): Plugin.Printer { // If we didn't hit the super special handling, then we're just going to // print out the arguments to the keyword like normal. - return [`${keyword} `, join(", ", path.call(print, "args"))] - } + return [`${keyword} `, join(", ", path.call(print, "args"))]; + }; } export const printBreak = printFlowControl("break"); diff --git a/src/ruby/nodes/hashes.ts b/src/ruby/nodes/hashes.ts index 0b681177..fbfa085a 100644 --- a/src/ruby/nodes/hashes.ts +++ b/src/ruby/nodes/hashes.ts @@ -112,9 +112,7 @@ export const printAssocSplat: Plugin.Printer = ( path, opts, print -) => ( - ["**", path.call(print, "value")] -); +) => ["**", path.call(print, "value")]; export const printHashContents: Plugin.Printer = ( path, diff --git a/src/ruby/nodes/loops.ts b/src/ruby/nodes/loops.ts index 46fe916a..06c3f3e5 100644 --- a/src/ruby/nodes/loops.ts +++ b/src/ruby/nodes/loops.ts @@ -11,7 +11,9 @@ const { align, breakParent, group, hardline, ifBreak, indent, join, softline } = type Loop = Ruby.While | Ruby.WhileModifier | Ruby.Until | Ruby.UntilModifier; -function isModifier(node: Loop): node is Ruby.WhileModifier | Ruby.UntilModifier { +function isModifier( + node: Loop +): node is Ruby.WhileModifier | Ruby.UntilModifier { return node.type === "while_mod" || node.type === "until_mod"; } @@ -23,15 +25,15 @@ function printLoop(keyword: string): Plugin.Printer { // If the only statement inside this while loop is a void statement, then we // can shorten to just displaying the predicate and then a semicolon. if (!isModifier(node) && isEmptyStmts(node.stmts)) { - return group([ - group([keyword, " ", predicateDoc]), - hardline, - "end" - ]); + return group([group([keyword, " ", predicateDoc]), hardline, "end"]); } const statementDoc = path.call(print, isModifier(node) ? "stmt" : "stmts"); - const inlineLoop = inlineEnsureParens(path, [statementDoc, ` ${keyword} `, predicateDoc]); + const inlineLoop = inlineEnsureParens(path, [ + statementDoc, + ` ${keyword} `, + predicateDoc + ]); // If we're in the modifier form and we're modifying a `begin`, then this is // a special case where we need to explicitly use the modifier form because diff --git a/src/ruby/nodes/methods.ts b/src/ruby/nodes/methods.ts index 9241a80a..7ec4676a 100644 --- a/src/ruby/nodes/methods.ts +++ b/src/ruby/nodes/methods.ts @@ -19,7 +19,8 @@ export const printDef: Plugin.Printer = ( } // In case there are no parens but there are parameters - const useParens = node.params.type === "params" && !isEmptyParams(node.params); + const useParens = + node.params.type === "params" && !isEmptyParams(node.params); declaration.push( path.call(print, "name"), diff --git a/src/ruby/nodes/params.ts b/src/ruby/nodes/params.ts index 84a41d44..b6cb20c0 100644 --- a/src/ruby/nodes/params.ts +++ b/src/ruby/nodes/params.ts @@ -19,16 +19,13 @@ export const printParams: Plugin.Printer = (path, opts, print) => { let parts: Plugin.Doc[] = []; if (node.reqs) { - path.each( - (reqPath) => { - // For some very strange reason, if you have a comment attached to a - // rest_param, it shows up here in the list of required params. - if ((reqPath.getValue().type as any) !== "rest_param") { - parts.push(print(reqPath)); - } - }, - "reqs" - ); + path.each((reqPath) => { + // For some very strange reason, if you have a comment attached to a + // rest_param, it shows up here in the list of required params. + if ((reqPath.getValue().type as any) !== "rest_param") { + parts.push(print(reqPath)); + } + }, "reqs"); } if (node.opts) { @@ -47,19 +44,16 @@ export const printParams: Plugin.Printer = (path, opts, print) => { if (node.keywords) { parts = parts.concat( - path.map( - (kwargPath) => { - const kwarg = kwargPath.getValue(); - const keyDoc = kwargPath.call(print, 0); - - if (kwarg[1]) { - return group([keyDoc, " ", kwargPath.call(print, 1)]); - } - - return keyDoc; - }, - "keywords" - ) + path.map((kwargPath) => { + const kwarg = kwargPath.getValue(); + const keyDoc = kwargPath.call(print, 0); + + if (kwarg[1]) { + return group([keyDoc, " ", kwargPath.call(print, 1)]); + } + + return keyDoc; + }, "keywords") ); } @@ -82,7 +76,10 @@ export const printParams: Plugin.Printer = (path, opts, print) => { // In ruby 2.5, the excessed comma is indicated by having a 0 in the rest // param position. In ruby 2.6+ it's indicated by having an "excessed_comma" // node in the rest position. Seems odd, but it's true. - if ((node.rest as any) === 0 || (node.rest && node.rest.type === "excessed_comma")) { + if ( + (node.rest as any) === 0 || + (node.rest && node.rest.type === "excessed_comma") + ) { contents.push(","); } @@ -118,6 +115,10 @@ export const printArgsForward = literal("..."); export const printKeywordRestParam = printRestParamSymbol("**"); export const printRestParam = printRestParamSymbol("*"); -export const printExcessedComma: Plugin.Printer = (path, opts, print) => { +export const printExcessedComma: Plugin.Printer = ( + path, + opts, + print +) => { return path.call(print, "body"); }; diff --git a/src/ruby/nodes/patterns.ts b/src/ruby/nodes/patterns.ts index 0857112c..6a7286a4 100644 --- a/src/ruby/nodes/patterns.ts +++ b/src/ruby/nodes/patterns.ts @@ -137,10 +137,7 @@ export const printIn: Plugin.Printer = (path, opts, print) => { keyword, align( keyword.length, - path.call( - (valuePath) => printPatternArg(valuePath, opts, print), - "pttn" - ) + path.call((valuePath) => printPatternArg(valuePath, opts, print), "pttn") ), indent([hardline, path.call(print, "stmts")]) ]; @@ -152,15 +149,10 @@ export const printIn: Plugin.Printer = (path, opts, print) => { return group(parts); }; -export const printRAssign: Plugin.Printer = ( - path, - opts, - print -) => ( +export const printRAssign: Plugin.Printer = (path, opts, print) => group([ path.call(print, "value"), " ", path.call(print, "operator"), group(indent([line, path.call(print, "pattern")])) - ]) -); + ]); diff --git a/src/ruby/nodes/rescue.ts b/src/ruby/nodes/rescue.ts index c5c0ef7c..cca3bc10 100644 --- a/src/ruby/nodes/rescue.ts +++ b/src/ruby/nodes/rescue.ts @@ -65,7 +65,9 @@ export const printRescueEx: Plugin.Printer = ( // If there are multiple exceptions being rescued, then we're going to have // multiple doc nodes returned as an array that we need to join together. - if (["mrhs", "mrhs_add_star", "mrhs_new_from_args"].includes(node.extns.type)) { + if ( + ["mrhs", "mrhs_add_star", "mrhs_new_from_args"].includes(node.extns.type) + ) { exceptionDoc = group(join([",", line], exceptionDoc)); } diff --git a/src/ruby/nodes/strings.ts b/src/ruby/nodes/strings.ts index a05d8175..2f9a48c1 100644 --- a/src/ruby/nodes/strings.ts +++ b/src/ruby/nodes/strings.ts @@ -199,7 +199,11 @@ export const printStringConcat: Plugin.Printer = ( opts, print ) => { - return group([path.call(print, "left"), " \\", indent([hardline, path.call(print, "right")])]); + return group([ + path.call(print, "left"), + " \\", + indent([hardline, path.call(print, "right")]) + ]); }; // Prints out an interpolated variable in the string by converting it into an diff --git a/src/ruby/nodes/undef.ts b/src/ruby/nodes/undef.ts index 440cbfe1..d4354acb 100644 --- a/src/ruby/nodes/undef.ts +++ b/src/ruby/nodes/undef.ts @@ -4,30 +4,27 @@ import prettier from "../../prettier"; const { addTrailingComment, align, group, join, line } = prettier; export const printUndef: Plugin.Printer = (path, opts, print) => { - const symsDocs = path.map( - (symbolPath) => { - const symbolNode = symbolPath.getValue(); + const symsDocs = path.map((symbolPath) => { + const symbolNode = symbolPath.getValue(); - // If we're not printing a symbol literal then it's a dyna symbol, so - // we're just going to print that node on its own. - if (symbolNode.type !== "symbol_literal") { - return print(symbolPath); - } + // If we're not printing a symbol literal then it's a dyna symbol, so + // we're just going to print that node on its own. + if (symbolNode.type !== "symbol_literal") { + return print(symbolPath); + } - // We need to make sure we copy over any comments before we do the - // printing so they get printed as well. - if (symbolNode.comments) { - symbolNode.comments.forEach((comment) => { - addTrailingComment(symbolNode.val, comment); - }); - } + // We need to make sure we copy over any comments before we do the + // printing so they get printed as well. + if (symbolNode.comments) { + symbolNode.comments.forEach((comment) => { + addTrailingComment(symbolNode.val, comment); + }); + } - // If we're printing a symbol literal, then we want to descend into it and - // just print the underlying contents so that it prints as a bare word. - return symbolPath.call(print, "val"); - }, - "syms" - ); + // If we're printing a symbol literal, then we want to descend into it and + // just print the underlying contents so that it prints as a bare word. + return symbolPath.call(print, "val"); + }, "syms"); const keyword = "undef "; return group([keyword, align(keyword.length, join([",", line], symsDocs))]); diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 2b34f61e..148f5f6d 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -229,12 +229,8 @@ def char_pos # know if they are "empty", which means not having any parameters declared. # This logic accesses every kind of parameter and determines if it's missing. def empty_params?(params) - params[:reqs].empty? && - params[:opts].empty? && - !params[:rest] && - params[:posts].empty? && - params[:keywords].empty? && - !params[:kwrest] && + params[:reqs].empty? && params[:opts].empty? && !params[:rest] && + params[:posts].empty? && params[:keywords].empty? && !params[:kwrest] && !params[:block] end @@ -564,7 +560,11 @@ def on_args_forward # arguments to any method call or an array. It can be followed by any # number of args_add events, which we'll append onto an array body. def on_args_new - { type: :args, parts: [], loc: Location.fixed(line: lineno, char: char_pos) } + { + type: :args, + parts: [], + loc: Location.fixed(line: lineno, char: char_pos) + } end # Array nodes can contain a myriad of subnodes because of the special @@ -616,12 +616,7 @@ def on_assign(target, value) # hash. It is a child event of either an assoclist_from_args or a # bare_assoc_hash. def on_assoc_new(key, value) - { - type: :assoc_new, - key: key, - value: value, - loc: key[:loc].to(value[:loc]) - } + { type: :assoc_new, key: key, value: value, loc: key[:loc].to(value[:loc]) } end # assoc_splat is a parser event that represents splatting a value into a @@ -629,11 +624,7 @@ def on_assoc_new(key, value) def on_assoc_splat(value) operator = find_scanner_event(:@op, '**') - { - type: :assoc_splat, - value: value, - loc: operator[:loc].to(value[:loc]) - } + { type: :assoc_splat, value: value, loc: operator[:loc].to(value[:loc]) } end # assoclist_from_args is a parser event that contains a list of all of the @@ -1995,7 +1986,11 @@ def on_method_add_block(call, block) # side of a multiple assignment. It is followed by any number of mlhs_add # nodes that each represent another variable being assigned. def on_mlhs_new - { type: :mlhs, parts: [], loc: Location.fixed(line: lineno, char: char_pos) } + { + type: :mlhs, + parts: [], + loc: Location.fixed(line: lineno, char: char_pos) + } end # An mlhs_add is a parser event that represents adding another variable @@ -2005,7 +2000,11 @@ def on_mlhs_add(mlhs, part) if mlhs[:parts].empty? { type: :mlhs, parts: [part], loc: part[:loc] } else - { type: :mlhs, parts: mlhs[:parts] << part, loc: mlhs[:loc].to(part[:loc]) } + { + type: :mlhs, + parts: mlhs[:parts] << part, + loc: mlhs[:loc].to(part[:loc]) + } end end @@ -2078,7 +2077,11 @@ def on_module(constant, bodystmt) # be followed by any number of mrhs_add nodes that we'll build up into an # array body. def on_mrhs_new - { type: :mrhs, parts: [], loc: Location.fixed(line: lineno, char: char_pos) } + { + type: :mrhs, + parts: [], + loc: Location.fixed(line: lineno, char: char_pos) + } end # An mrhs_add is a parser event that represents adding another value onto @@ -3245,10 +3248,7 @@ def on_vcall(value) # block of code. It often will have comments attached to it, so it requires # some special handling. def on_void_stmt - { - type: :void_stmt, - loc: Location.fixed(line: lineno, char: char_pos) - } + { type: :void_stmt, loc: Location.fixed(line: lineno, char: char_pos) } end # when is a parser event that represents another clause in a case chain. diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 83bf4a8b..39ee3e33 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -114,7 +114,13 @@ function getChildNodes(node: AnyNode): ChildNode[] { case "defined": return [node.value]; case "defs": - return [node.target, node.operator, node.name, node.params, node.bodystmt]; + return [ + node.target, + node.operator, + node.name, + node.params, + node.bodystmt + ]; case "defsl": return [node.name, node.paren, node.stmt]; case "do_block": @@ -268,7 +274,7 @@ function getChildNodes(node: AnyNode): ChildNode[] { case "string_embexpr": return [node.stmts]; case "string_literal": - return node.parts; + return node.parts; case "super": return [node.args]; case "symbol_literal": diff --git a/src/utils/isEmptyParams.ts b/src/utils/isEmptyParams.ts index 78d967f5..c4a25e68 100644 --- a/src/utils/isEmptyParams.ts +++ b/src/utils/isEmptyParams.ts @@ -1,7 +1,15 @@ import type { Ruby } from "../types"; function isEmptyParams(node: Ruby.Params) { - return node.reqs.length === 0 && node.opts.length === 0 && !node.rest && node.posts.length === 0 && node.keywords.length === 0 && !node.kwrest && !node.block; + return ( + node.reqs.length === 0 && + node.opts.length === 0 && + !node.rest && + node.posts.length === 0 && + node.keywords.length === 0 && + !node.kwrest && + !node.block + ); } export default isEmptyParams; From 7d67cb7717b5a6754a90cef5438ad0cd35133672 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 4 Nov 2021 10:21:00 -0400 Subject: [PATCH 408/785] Fix up metadata test --- test/rb/metadata_test.rb | 97 ++++++++++++++++++---------------------- 1 file changed, 44 insertions(+), 53 deletions(-) diff --git a/test/rb/metadata_test.rb b/test/rb/metadata_test.rb index 543b6f2e..c37795e1 100644 --- a/test/rb/metadata_test.rb +++ b/test/rb/metadata_test.rb @@ -58,7 +58,7 @@ def test_aref def test_aref_field assert_node_metadata( :aref_field, - parse('foo[bar] = baz').dig(:body, 0), + parse('foo[bar] = baz')[:target], start_char: 0, end_char: 8 ) @@ -67,7 +67,7 @@ def test_aref_field def test_args assert_node_metadata( :args, - parse('foo bar, baz').dig(:body, 1, :body, 0), + parse('foo bar, baz').dig(:args, :args), start_char: 4, end_char: 12 ) @@ -76,7 +76,7 @@ def test_args def test_args_add_block assert_node_metadata( :args_add_block, - parse('foo bar, baz').dig(:body, 1), + parse('foo bar, baz')[:args], start_char: 4, end_char: 12 ) @@ -85,7 +85,7 @@ def test_args_add_block def test_args_add_star assert_node_metadata( :args_add_star, - parse('foo *bar').dig(:body, 1, :body, 0), + parse('foo *bar').dig(:args, :args), start_char: 4, end_char: 8 ) @@ -102,7 +102,7 @@ def test_arg_paren assert_node_metadata( :arg_paren, - parse(content).dig(:body, 1), + parse(content)[:args], start_char: 3, end_char: 20, start_line: 1, @@ -117,7 +117,7 @@ def test_assign def test_assoc_new assert_node_metadata( :assoc_new, - parse('{ foo: bar, bar: baz }').dig(:body, 0, :body, 0), + parse('{ foo: bar, bar: baz }').dig(:cnts, :assocs, 0), start_char: 2, end_char: 10 ) @@ -126,7 +126,7 @@ def test_assoc_new def test_assoc_splat assert_node_metadata( :assoc_splat, - parse('foo **bar').dig(:body, 1, :body, 0, :body, 0, :body, 0), + parse('foo **bar').dig(:args, :args, :parts, 0, :assocs, 0), start_char: 4, end_char: 9 ) @@ -135,7 +135,7 @@ def test_assoc_splat def test_assoclist_from_args assert_node_metadata( :assoclist_from_args, - parse('{ foo => bar }').dig(:body, 0), + parse('{ foo => bar }')[:cnts], start_char: 1, end_char: 13 ) @@ -144,7 +144,7 @@ def test_assoclist_from_args def test_bare_assoc_hash assert_node_metadata( :bare_assoc_hash, - parse('foo(bar: baz)').dig(:body, 1, :body, 0, :body, 0, :body, 0), + parse('foo(bar: baz)').dig(:args, :args, :args, :parts, 0), start_char: 4, end_char: 12 ) @@ -165,7 +165,7 @@ def test_binary def test_blockarg assert_node_metadata( :blockarg, - parse('def foo(&bar) end').dig(:body, 1, :body, 0, :body, 6), + parse('def foo(&bar) end').dig(:params, :cnts, :block), start_char: 8, end_char: 12 ) @@ -174,7 +174,7 @@ def test_blockarg def test_block_var assert_node_metadata( :block_var, - parse('foo { |bar| }').dig(:body, 1, :body, 0), + parse('foo { |bar| }').dig(:block, :block_var), start_char: 6, end_char: 11 ) @@ -183,7 +183,7 @@ def test_block_var def test_bodystmt assert_node_metadata( :bodystmt, - parse('class Foo; def foo; end; end').dig(:body, 2), + parse('class Foo; def foo; end; end')[:bodystmt], start_char: 9, end_char: 25 ) @@ -192,7 +192,7 @@ def test_bodystmt def test_brace_block assert_node_metadata( :brace_block, - parse('foo { bar }').dig(:body, 1), + parse('foo { bar }')[:block], start_char: 4, end_char: 11 ) @@ -236,7 +236,7 @@ def test_command_call def test_const_ref assert_node_metadata( :const_ref, - parse('class Foo; end').dig(:body, 0), + parse('class Foo; end')[:constant], start_char: 6, end_char: 9 ) @@ -245,7 +245,7 @@ def test_const_ref def test_const_path_field assert_node_metadata( :const_path_field, - parse('Foo::Bar = baz').dig(:body, 0), + parse('Foo::Bar = baz')[:target], start_char: 0, end_char: 8 ) @@ -282,7 +282,7 @@ def Object.bar; end def test_do_block assert_node_metadata( :do_block, - parse('foo do; bar; end').dig(:body, 1), + parse('foo do; bar; end')[:block], start_char: 4, end_char: 16 ) @@ -311,7 +311,7 @@ def test_else assert_node_metadata( :else, - parse(content).dig(:body, 2), + parse(content)[:cons], start_char: 13, end_char: 27, start_line: 3, @@ -330,7 +330,7 @@ def test_elsif assert_node_metadata( :elsif, - parse(content).dig(:body, 2), + parse(content)[:cons], start_char: 13, end_char: 32, start_line: 3, @@ -349,7 +349,7 @@ def test_ensure assert_node_metadata( :ensure, - parse(content).dig(:body, 0, :body, 3), + parse(content).dig(:bodystmt, :ens), start_char: 12, end_char: 28, start_line: 3, @@ -361,7 +361,7 @@ def test_ensure def test_excessed_comma assert_node_metadata( :excessed_comma, - parse('foo { |bar,| }').dig(:body, 1, :body, 0, :body, 0, :body, 2), + parse('foo { |bar,| }').dig(:block, :block_var, :params, :rest), start_char: 10, end_char: 11 ) @@ -371,7 +371,7 @@ def test_excessed_comma def test_fcall assert_node_metadata( :fcall, - parse('foo(bar)').dig(:body, 0), + parse('foo(bar)')[:call], start_char: 0, end_char: 3 ) @@ -380,7 +380,7 @@ def test_fcall def test_field assert_node_metadata( :field, - parse('foo.bar = baz').dig(:body, 0), + parse('foo.bar = baz')[:target], start_char: 0, end_char: 7 ) @@ -422,7 +422,7 @@ def test_if_mod def test_kwrest_param assert_node_metadata( :kwrest_param, - parse('def foo(**bar); end').dig(:body, 1, :body, 0, :body, 5), + parse('def foo(**bar); end').dig(:params, :cnts, :kwrest), start_char: 8, end_char: 13 ) @@ -451,7 +451,7 @@ def test_method_add_block def test_mlhs assert_node_metadata( :mlhs, - parse('foo, bar, baz = 1, 2, 3').dig(:body, 0), + parse('foo, bar, baz = 1, 2, 3')[:tgt], start_char: 0, end_char: 13 ) @@ -460,7 +460,7 @@ def test_mlhs def test_mlhs_add_post assert_node_metadata( :mlhs_add_post, - parse('foo, *bar, baz = 1, 2, 3').dig(:body, 0), + parse('foo, *bar, baz = 1, 2, 3')[:tgt], start_char: 5, end_char: 14 ) @@ -469,7 +469,7 @@ def test_mlhs_add_post def test_mlhs_add_star assert_node_metadata( :mlhs_add_star, - parse('foo, *bar = 1, 2, 3').dig(:body, 0), + parse('foo, *bar = 1, 2, 3')[:tgt], start_char: 5, end_char: 9 ) @@ -478,7 +478,7 @@ def test_mlhs_add_star def test_mlhs_paren assert_node_metadata( :mlhs_paren, - parse('(foo, bar) = baz').dig(:body, 0), + parse('(foo, bar) = baz')[:tgt], start_char: 0, end_char: 10 ) @@ -495,21 +495,12 @@ module Bar; end def test_mrhs_add_star assert_node_metadata( :mrhs_add_star, - parse('foo, bar = *baz').dig(:body, 1), + parse('foo, bar = *baz')[:val], start_char: 11, end_char: 15 ) end - def test_mrhs_new_from_args - assert_node_metadata( - :mrhs_new_from_args, - parse('foo, bar, baz = 1, 2, 3').dig(:body, 1), - start_char: 16, - end_char: 23 - ) - end - def test_next assert_metadata :next, 'next foo' end @@ -528,7 +519,7 @@ def foo( assert_node_metadata( :params, - parse(content).dig(:body, 1, :body, 0), + parse(content).dig(:params, :cnts), start_char: 8, end_char: 22, start_line: 2, @@ -543,7 +534,7 @@ def test_paren def test_qsymbols assert_node_metadata( :qsymbols, - parse('%i[foo bar baz]').dig(:body, 0), + parse('%i[foo bar baz]')[:cnts], start_char: 0, end_char: 15 ) @@ -552,7 +543,7 @@ def test_qsymbols def test_qwords assert_node_metadata( :qwords, - parse('%w[foo bar baz]').dig(:body, 0), + parse('%w[foo bar baz]')[:cnts], start_char: 0, end_char: 15 ) @@ -580,7 +571,7 @@ def test_regexp_literal def test_rescue assert_node_metadata( :rescue, - parse('begin; foo; rescue => bar; baz; end').dig(:body, 0, :body, 1), + parse('begin; foo; rescue => bar; baz; end').dig(:bodystmt, :rsc), start_char: 12, end_char: 35 ) @@ -593,7 +584,7 @@ def test_rescue_mod def test_rest_param assert_node_metadata( :rest_param, - parse('def foo(*bar); end').dig(:body, 1, :body, 0, :body, 2), + parse('def foo(*bar); end').dig(:params, :cnts, :rest), start_char: 8, end_char: 12 ) @@ -629,7 +620,7 @@ def test_string_concat def test_string_dvar assert_node_metadata( :string_dvar, - parse('"#$foo"').dig(:body, 0), + parse('"#$foo"').dig(:parts, 0), start_char: 1, end_char: 6 ) @@ -638,7 +629,7 @@ def test_string_dvar def test_string_embexpr assert_node_metadata( :string_embexpr, - parse('"foo #{bar} baz"').dig(:body, 1), + parse('"foo #{bar} baz"').dig(:parts, 1), start_char: 5, end_char: 11 ) @@ -659,7 +650,7 @@ def test_symbol_literal def test_symbols assert_node_metadata( :symbols, - parse('%I[f#{o}o b#{a}r b#{a}z]').dig(:body, 0), + parse('%I[f#{o}o b#{a}r b#{a}z]')[:cnts], start_char: 0, end_char: 24 ) @@ -668,7 +659,7 @@ def test_symbols def test_top_const_field assert_node_metadata( :top_const_field, - parse('::Foo = bar').dig(:body, 0), + parse('::Foo = bar')[:target], start_char: 0, end_char: 5 ) @@ -726,7 +717,7 @@ def test_var_alias def test_var_field assert_node_metadata( :var_field, - parse('foo = 1').dig(:body, 0), + parse('foo = 1')[:target], start_char: 0, end_char: 3 ) @@ -747,7 +738,7 @@ def test_void_stmt def test_when assert_node_metadata( :when, - parse('case foo; when bar; baz; end').dig(:body, 1), + parse('case foo; when bar; baz; end')[:cons], start_char: 10, end_char: 28 ) @@ -760,7 +751,7 @@ def test_while_mod def test_words assert_node_metadata( :words, - parse('%W[f#{o}o b#{a}r b#{a}z]').dig(:body, 0), + parse('%W[f#{o}o b#{a}r b#{a}z]')[:cnts], start_char: 0, end_char: 24 ) @@ -797,7 +788,7 @@ def foo(...) assert_node_metadata( :args_forward, - parse(content).dig(:body, 1, :body, 0, :body, 2), + parse(content).dig(:params, :cnts, :rest), start_char: 8, end_char: 11 ) @@ -813,7 +804,7 @@ def test_aryptn assert_node_metadata( :aryptn, - parse(content).dig(:body, 1, :body, 0), + parse(content).dig(:cons, :pttn), start_char: 12, end_char: 20, start_line: 2, @@ -831,7 +822,7 @@ def test_in assert_node_metadata( :in, - parse(content).dig(:body, 1), + parse(content)[:cons], start_char: 9, end_char: 25, start_line: 2, @@ -873,6 +864,6 @@ def assert_node_metadata( end def parse(ruby) - Prettier::Parser.parse(ruby).dig(:body, 0, :body, 0) + Prettier::Parser.parse(ruby).dig(:stmts, :body, 0) end end From 00445a25f09319a2519c39c83c437a72b413cffe Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 4 Nov 2021 10:29:51 -0400 Subject: [PATCH 409/785] Fixes --- src/ruby/nodes/calls.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ruby/nodes/calls.ts b/src/ruby/nodes/calls.ts index d31d059b..dfec29fe 100644 --- a/src/ruby/nodes/calls.ts +++ b/src/ruby/nodes/calls.ts @@ -243,7 +243,7 @@ export const printMethodAddArg: Plugin.Printer = ( // If there are already parentheses, then we can just use the doc that's // already printed. if (node.args.type == "arg_paren") { - return [methodDoc, argsDoc]; + return group([methodDoc, argsDoc]); } return [methodDoc, " ", join(", ", argsDoc), " "]; From c5dc76cf2d1e601a7bc281c2c22198c563666971 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 4 Nov 2021 10:46:03 -0400 Subject: [PATCH 410/785] body -> value --- src/ruby/embed.ts | 6 +- src/ruby/nodes.ts | 2 +- src/ruby/nodes/arrays.ts | 2 +- src/ruby/nodes/calls.ts | 4 +- src/ruby/nodes/commands.ts | 2 +- src/ruby/nodes/flow.ts | 4 +- src/ruby/nodes/hashes.ts | 2 +- src/ruby/nodes/heredocs.ts | 2 +- src/ruby/nodes/ints.ts | 10 +-- src/ruby/nodes/params.ts | 6 +- src/ruby/nodes/regexp.ts | 4 +- src/ruby/nodes/rescue.ts | 8 +- src/ruby/nodes/return.ts | 4 +- src/ruby/nodes/statements.ts | 4 +- src/ruby/nodes/strings.ts | 26 +++---- src/ruby/nodes/super.ts | 4 +- src/ruby/parser.rb | 138 +++++++++++++++++------------------ src/ruby/toProc.ts | 8 +- src/types/ruby.ts | 4 +- src/utils.ts | 1 - src/utils/literal.ts | 9 --- 21 files changed, 121 insertions(+), 129 deletions(-) delete mode 100644 src/utils/literal.ts diff --git a/src/ruby/embed.ts b/src/ruby/embed.ts index 1115744a..3ca3c6cd 100644 --- a/src/ruby/embed.ts +++ b/src/ruby/embed.ts @@ -90,7 +90,7 @@ const embed: Plugin.Embed = (path, print, textToDoc) => { // First, ensure that we don't have any interpolation const { beging, parts, ending } = node; - const isSquiggly = beging.body[2] === "~"; + const isSquiggly = beging.value[2] === "~"; if (!isTStringContentArray(parts)) { return null; @@ -98,13 +98,13 @@ const embed: Plugin.Embed = (path, print, textToDoc) => { // Next, find the parser associated with this heredoc (if there is one). For // example, if you use <<~CSS, we'd hook it up to the css parser. - const parser = parsers[beging.body.slice(3).toLowerCase()]; + const parser = parsers[beging.value.slice(3).toLowerCase()]; if (!parser) { return null; } // Get the content as if it were a source string. - let content = parts.map((part) => part.body).join(""); + let content = parts.map((part) => part.value).join(""); // If we're using a squiggly heredoc, then we're going to manually strip off // the leading whitespace of each line up to the minimum leading whitespace so diff --git a/src/ruby/nodes.ts b/src/ruby/nodes.ts index e2c9ada5..e92ce386 100644 --- a/src/ruby/nodes.ts +++ b/src/ruby/nodes.ts @@ -150,7 +150,7 @@ type Token = | Ruby.Rational | Ruby.TStringContent; -const printToken: Plugin.Printer = (path) => path.getValue().body; +const printToken: Plugin.Printer = (path) => path.getValue().value; const printVoidStmt: Plugin.Printer = () => ""; const nodes: Record> = { diff --git a/src/ruby/nodes/arrays.ts b/src/ruby/nodes/arrays.ts index cd0a4a28..a0c31039 100644 --- a/src/ruby/nodes/arrays.ts +++ b/src/ruby/nodes/arrays.ts @@ -38,7 +38,7 @@ function isStringArray(args: Ruby.Args | Ruby.ArgsAddStar) { // Finally, verify that the string doesn't contain a space, an escape // character, or brackets so that we know it can be put into a string // literal array. - return !/[\s\\[\]]/.test(part.body); + return !/[\s\\[\]]/.test(part.value); }) ); } diff --git a/src/ruby/nodes/calls.ts b/src/ruby/nodes/calls.ts index dfec29fe..974badd0 100644 --- a/src/ruby/nodes/calls.ts +++ b/src/ruby/nodes/calls.ts @@ -65,7 +65,7 @@ export const printCall: Plugin.Printer = (path, opts, print) => { if ( node.receiver.type === "call" && node.receiver.message !== "call" && - node.receiver.message.body === "where" && + node.receiver.message.value === "where" && messageDoc === "not" ) { // This is very specialized behavior wherein we group .where.not calls @@ -205,7 +205,7 @@ export const printMethodAddArg: Plugin.Printer = ( sigBlockNode.block && sigBlockNode.call.type === "method_add_arg" && sigBlockNode.call.call.type === "fcall" && - sigBlockNode.call.call.value.body === "sig" + sigBlockNode.call.call.value.value === "sig" ) { threshold = 2; } diff --git a/src/ruby/nodes/commands.ts b/src/ruby/nodes/commands.ts index bd77d7e8..b42a5a09 100644 --- a/src/ruby/nodes/commands.ts +++ b/src/ruby/nodes/commands.ts @@ -68,7 +68,7 @@ function hasDef(node: Ruby.Command) { // In this case the arguments are aligned to the left side as opposed to being // aligned with the `receive` call. function skipArgsAlign(node: Ruby.CommandCall) { - return ["to", "not_to", "to_not"].includes(node.message.body); + return ["to", "not_to", "to_not"].includes(node.message.value); } // If there is a ternary argument to a command and it's going to get broken diff --git a/src/ruby/nodes/flow.ts b/src/ruby/nodes/flow.ts index bed60cce..c6bd76e3 100644 --- a/src/ruby/nodes/flow.ts +++ b/src/ruby/nodes/flow.ts @@ -1,6 +1,5 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; -import { literal } from "../../utils"; const { join } = prettier; @@ -67,4 +66,5 @@ export const printYield: Plugin.Printer = (path, opts, print) => { return ["yield ", join(", ", argsDoc)]; }; -export const printYield0 = literal("yield"); +export const printYield0: Plugin.Printer = (path) => + path.getValue().value; diff --git a/src/ruby/nodes/hashes.ts b/src/ruby/nodes/hashes.ts index fbfa085a..10ce8ff2 100644 --- a/src/ruby/nodes/hashes.ts +++ b/src/ruby/nodes/hashes.ts @@ -27,7 +27,7 @@ type HashContents = (Ruby.AssoclistFromArgs | Ruby.BareAssocHash) & { // This function represents that check, as it determines if it can convert the // symbol node into a hash label. function isValidHashLabel(symbolLiteral: Ruby.SymbolLiteral) { - const label = symbolLiteral.val.body; + const label = symbolLiteral.val.value; return label.match(/^[_A-Za-z]/) && !label.endsWith("="); } diff --git a/src/ruby/nodes/heredocs.ts b/src/ruby/nodes/heredocs.ts index c12097a6..89dbdf31 100644 --- a/src/ruby/nodes/heredocs.ts +++ b/src/ruby/nodes/heredocs.ts @@ -19,7 +19,7 @@ export const printHeredoc: Plugin.Printer = ( return print(partPath); } - return join(literallineWithoutBreakParent, part.body.split(/\r?\n/)); + return join(literallineWithoutBreakParent, part.value.split(/\r?\n/)); }, "parts"); // We use a literalline break because matching indentation is required diff --git a/src/ruby/nodes/ints.ts b/src/ruby/nodes/ints.ts index 45437f82..55b3c73a 100644 --- a/src/ruby/nodes/ints.ts +++ b/src/ruby/nodes/ints.ts @@ -5,23 +5,23 @@ import type { Plugin, Ruby } from "../../types"; // // Binary (2) - 0b0110 // Octal (8) - 0o34 or 034 -// Decimal (10) - a normal number like 159 +// Decimal (10) - 159 or 0d159 // Hexidecimal (16) - 0xac5 // // If it's a decimal number, it can be optional separated by any number of // arbitrarily places underscores. This can be useful for dollars and cents // (34_99), dates (2020_11_30), and normal 3 digit separation (1_222_333). export const printInt: Plugin.Printer = (path) => { - const { body } = path.getValue(); + const { value } = path.getValue(); // If the number is a base 10 number, is sufficiently large, and is not // already formatted with underscores, then add them in in between the // numbers every three characters starting from the right. - if (!body.startsWith("0") && body.length >= 5 && !body.includes("_")) { + if (!value.startsWith("0") && value.length >= 5 && !value.includes("_")) { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const segments = ` ${body}`.slice((body.length + 2) % 3).match(/.{3}/g)!; + const segments = ` ${value}`.slice((value.length + 2) % 3).match(/.{3}/g)!; return segments.join("_").trim(); } - return body; + return value; }; diff --git a/src/ruby/nodes/params.ts b/src/ruby/nodes/params.ts index b6cb20c0..8871ff08 100644 --- a/src/ruby/nodes/params.ts +++ b/src/ruby/nodes/params.ts @@ -1,6 +1,5 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; -import { literal } from "../../utils"; const { group, hardline, join, indent, line, lineSuffix, softline } = prettier; @@ -111,7 +110,8 @@ export const printParams: Plugin.Printer = (path, opts, print) => { return group(contents); }; -export const printArgsForward = literal("..."); +export const printArgsForward: Plugin.Printer = (path) => + path.getValue().value; export const printKeywordRestParam = printRestParamSymbol("**"); export const printRestParam = printRestParamSymbol("*"); @@ -120,5 +120,5 @@ export const printExcessedComma: Plugin.Printer = ( opts, print ) => { - return path.call(print, "body"); + return path.call(print, "value"); }; diff --git a/src/ruby/nodes/regexp.ts b/src/ruby/nodes/regexp.ts index db7d9725..308053a3 100644 --- a/src/ruby/nodes/regexp.ts +++ b/src/ruby/nodes/regexp.ts @@ -3,7 +3,7 @@ import { hasAncestor } from "../../utils"; function hasContent(node: Ruby.RegexpLiteral, pattern: RegExp) { return node.parts.some( - (part) => part.type === "@tstring_content" && pattern.test(part.body) + (part) => part.type === "@tstring_content" && pattern.test(part.value) ); } @@ -18,7 +18,7 @@ function forwardSlashIsAmbiguous(path: Plugin.Path) { return ( firstPart && firstPart.type === "@tstring_content" && - [" ", "="].includes(firstPart.body[0]) && + [" ", "="].includes(firstPart.value[0]) && hasAncestor(path, ["command", "command_call"]) ); } diff --git a/src/ruby/nodes/rescue.ts b/src/ruby/nodes/rescue.ts index cca3bc10..9f00b3f9 100644 --- a/src/ruby/nodes/rescue.ts +++ b/src/ruby/nodes/rescue.ts @@ -1,6 +1,5 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; -import { literal } from "../../utils"; const { align, group, hardline, indent, join, line } = prettier; @@ -97,5 +96,8 @@ export const printRescueMod: Plugin.Printer = ( ]; }; -export const printRedo = literal("redo"); -export const printRetry = literal("retry"); +export const printRedo: Plugin.Printer = (path) => + path.getValue().value; + +export const printRetry: Plugin.Printer = (path) => + path.getValue().value; diff --git a/src/ruby/nodes/return.ts b/src/ruby/nodes/return.ts index 6e7fc8b4..d1ad0c94 100644 --- a/src/ruby/nodes/return.ts +++ b/src/ruby/nodes/return.ts @@ -1,6 +1,5 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; -import { literal } from "../../utils"; const { group, ifBreak, indent, line, join, softline } = prettier; @@ -108,4 +107,5 @@ export const printReturn: Plugin.Printer = (path, opts, print) => { ]); }; -export const printReturn0 = literal("return"); +export const printReturn0: Plugin.Printer = (path) => + path.getValue().value; diff --git a/src/ruby/nodes/statements.ts b/src/ruby/nodes/statements.ts index 48c48d4d..934a989b 100644 --- a/src/ruby/nodes/statements.ts +++ b/src/ruby/nodes/statements.ts @@ -82,8 +82,8 @@ export const printParen: Plugin.Printer = (path, opts, print) => { }; export const printEndContent: Plugin.Printer = (path) => { - const { body } = path.getValue(); - return [trim, "__END__", literalline, body]; + const node = path.getValue(); + return [trim, "__END__", literalline, node.value]; }; export const printComment: Plugin.Printer = (path, opts) => { diff --git a/src/ruby/nodes/strings.ts b/src/ruby/nodes/strings.ts index 2f9a48c1..ad049dd7 100644 --- a/src/ruby/nodes/strings.ts +++ b/src/ruby/nodes/strings.ts @@ -14,7 +14,7 @@ function isQuoteLocked(node: Ruby.DynaSymbol | Ruby.StringLiteral) { return node.parts.some( (part) => part.type === "@tstring_content" && - (part.body.includes("#{") || part.body.includes("\\")) + (part.value.includes("#{") || part.value.includes("\\")) ); } @@ -22,7 +22,7 @@ function isQuoteLocked(node: Ruby.DynaSymbol | Ruby.StringLiteral) { // plain string content and that content does not contain a single quote. function isSingleQuotable(node: Ruby.DynaSymbol | Ruby.StringLiteral) { return node.parts.every( - (part) => part.type === "@tstring_content" && !part.body.includes("'") + (part) => part.type === "@tstring_content" && !part.value.includes("'") ); } @@ -71,14 +71,14 @@ function getClosingQuote(quote: string) { // are strings of length 1. If they're any longer than we'll try to apply the // correct quotes. export const printChar: Plugin.Printer = (path, opts) => { - const { body } = path.getValue(); + const { value } = path.getValue(); - if (body.length !== 2) { - return body; + if (value.length !== 2) { + return value; } const quote = opts.rubySingleQuote ? "'" : '"'; - return [quote, body.slice(1), quote]; + return [quote, value.slice(1), quote]; }; const printPercentSDynaSymbol: Plugin.Printer = ( @@ -100,7 +100,7 @@ const printPercentSDynaSymbol: Plugin.Printer = ( parts.push(print(childPath)); } else { // Here we are printing plain string content. - parts.push(join(literalline, childNode.body.split("\n"))); + parts.push(join(literalline, childNode.value.split("\n"))); } }, "parts"); @@ -129,10 +129,10 @@ function shouldPrintPercentSDynaSymbol(node: Ruby.DynaSymbol) { return node.parts.some( (child) => child.type === "@tstring_content" && - (child.body.includes("\n") || - child.body.includes(closing) || - child.body.includes("'") || - child.body.includes('"')) + (child.value.includes("\n") || + child.value.includes(closing) || + child.value.includes("'") || + child.value.includes('"')) ); } @@ -177,7 +177,7 @@ export const printDynaSymbol: Plugin.Printer = ( parts.push(print(childPath)); } else { parts.push( - join(literalline, normalizeQuotes(child.body, quote).split("\n")) + join(literalline, normalizeQuotes(child.value, quote).split("\n")) ); } }, "parts"); @@ -266,7 +266,7 @@ export const printStringLiteral: Plugin.Printer = ( } // In this case, the part of the string is just regular string content - return join(literalline, normalizeQuotes(part.body, quote).split("\n")); + return join(literalline, normalizeQuotes(part.value, quote).split("\n")); }, "parts"); return [quote, ...parts, getClosingQuote(quote)]; diff --git a/src/ruby/nodes/super.ts b/src/ruby/nodes/super.ts index f5618dd2..159145bb 100644 --- a/src/ruby/nodes/super.ts +++ b/src/ruby/nodes/super.ts @@ -1,6 +1,5 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; -import { literal } from "../../utils"; const { align, group, join, line } = prettier; @@ -23,4 +22,5 @@ export const printSuper: Plugin.Printer = (path, opts, print) => { }; // Version of super without any parens or args. -export const printZSuper = literal("super"); +export const printZSuper: Plugin.Printer = (path) => + path.getValue().value; diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 148f5f6d..751afbd3 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -246,11 +246,11 @@ def empty_params?(params) # would happen to be the innermost keyword). Then the outer one would only be # able to grab the first one. In this way all of the scanner events act as # their own stack. - def find_scanner_event(type, body = :any, consume: true) + def find_scanner_event(type, value = :any, consume: true) index = scanner_events.rindex do |scanner_event| scanner_event[:type] == type && - (body == :any || (scanner_event[:body] == body)) + (value == :any || (scanner_event[:value] == value)) end if consume @@ -260,7 +260,7 @@ def find_scanner_event(type, body = :any, consume: true) # could also be caused by accidentally attempting to consume a scanner # event twice by two different parser event handlers. unless index - message = "Cannot find expected #{body == :any ? type : body}" + message = "Cannot find expected #{value == :any ? type : value}" raise ParserError.new(message, lineno, column) end @@ -277,7 +277,7 @@ def find_scanner_event(type, body = :any, consume: true) def find_colon2_before(const) index = scanner_events.rindex do |event| - event[:type] == :@op && event[:body] == '::' && + event[:type] == :@op && event[:value] == '::' && event[:loc].start_char < const[:loc].start_char end @@ -344,7 +344,7 @@ def on_BEGIN(stmts) def on_CHAR(value) node = { type: :@CHAR, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -392,7 +392,7 @@ def on_END(stmts) def on___end__(value) @__end__ = { type: :@__end__, - body: lines[lineno..-1].join("\n"), + value: lines[lineno..-1].join("\n"), loc: Location.token(line: lineno, char: char_pos, size: value.size) } end @@ -553,7 +553,7 @@ def on_args_add_star(args, star) def on_args_forward keyword = find_scanner_event(:@op, '...') - { type: :args_forward, body: keyword[:body], loc: keyword[:loc] } + { type: :args_forward, value: keyword[:value], loc: keyword[:loc] } end # args_new is a parser event that represents the beginning of a list of @@ -644,7 +644,7 @@ def on_assoclist_from_args(assocs) def on_backref(value) node = { type: :@backref, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -658,7 +658,7 @@ def on_backref(value) def on_backtick(value) node = { type: :@backtick, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -703,7 +703,7 @@ def on_binary(left, operator, right) # so here we're going to explicitly convert it into the same normalized # form. unless operator.is_a?(Symbol) - operator = scanner_events.delete(operator)[:body] + operator = scanner_events.delete(operator)[:value] end { @@ -720,7 +720,7 @@ def on_binary(left, operator, right) def on_block_var(params, locals) index = scanner_events.rindex do |event| - event[:type] == :@op && %w[| ||].include?(event[:body]) && + event[:type] == :@op && %w[| ||].include?(event[:value]) && event[:loc].start_char < params[:loc].start_char end @@ -926,7 +926,7 @@ def on_class(constant, superclass, bodystmt) def on_comma(value) node = { type: :@comma, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -992,7 +992,7 @@ def on_comment(value) def on_const(value) node = { type: :@const, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -1042,7 +1042,7 @@ def on_const_ref(constant) def on_cvar(value) node = { type: :@cvar, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -1270,7 +1270,7 @@ def on_dyna_symbol(string) { type: :dyna_symbol, - quote: beging[:body], + quote: beging[:value], parts: string[:parts], loc: beging[:loc].to(ending[:loc]) } @@ -1282,7 +1282,7 @@ def on_dyna_symbol(string) { type: :dyna_symbol, parts: string[:parts], - quote: ending[:body][0], + quote: ending[:value][0], loc: beging[:loc].to(ending[:loc]) } end @@ -1299,11 +1299,11 @@ def on_else(stmts) # we'll leave that to the ensure to handle). index = scanner_events.rindex do |event| - event[:type] == :@kw && %w[end ensure].include?(event[:body]) + event[:type] == :@kw && %w[end ensure].include?(event[:value]) end event = scanner_events[index] - ending = event[:body] == 'end' ? scanner_events.delete_at(index) : event + ending = event[:value] == 'end' ? scanner_events.delete_at(index) : event stmts.bind(beging[:loc].end_char, ending[:loc].start_char) @@ -1377,7 +1377,7 @@ def on_embdoc_end(value) def on_embexpr_beg(value) node = { type: :@embexpr_beg, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -1391,7 +1391,7 @@ def on_embexpr_beg(value) def on_embexpr_end(value) node = { type: :@embexpr_end, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -1412,7 +1412,7 @@ def on_embexpr_end(value) def on_embvar(value) node = { type: :@embvar, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -1429,7 +1429,7 @@ def on_ensure(stmts) # consume the :@end event, because that would break def..ensure..end chains. index = scanner_events.rindex do |scanner_event| - scanner_event[:type] == :@kw && scanner_event[:body] == 'end' + scanner_event[:type] == :@kw && scanner_event[:value] == 'end' end ending = scanner_events[index] @@ -1453,7 +1453,7 @@ def on_ensure(stmts) def on_excessed_comma(*) comma = find_scanner_event(:@comma) - { type: :excessed_comma, body: comma[:body], loc: comma[:loc] } + { type: :excessed_comma, value: comma[:value], loc: comma[:loc] } end # An fcall is a parser event that represents the piece of a method call @@ -1482,7 +1482,7 @@ def on_field(parent, operator, name) def on_float(value) node = { type: :@float, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -1537,7 +1537,7 @@ def on_for(iterator, enumerable, stmts) def on_gvar(value) node = { type: :@gvar, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -1587,7 +1587,7 @@ def on_heredoc_beg(beging) type: :heredoc, beging: { type: :@heredoc_beg, - body: beging, + value: beging, loc: location }, loc: location @@ -1640,7 +1640,7 @@ def on_hshptn(constant, keywords, kwrest) def on_ident(value) node = { type: :@ident, - body: value.force_encoding('UTF-8'), + value: value.force_encoding('UTF-8'), loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -1729,7 +1729,7 @@ def on_if_mod(predicate, statement) def on_imaginary(value) node = { type: :@imaginary, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -1762,7 +1762,7 @@ def on_in(pattern, stmts, consequent) def on_int(value) node = { type: :@int, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -1774,7 +1774,7 @@ def on_int(value) def on_ivar(value) node = { type: :@ivar, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -1787,7 +1787,7 @@ def on_ivar(value) def on_kw(value) node = { type: :@kw, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -1821,7 +1821,7 @@ def on_kwrest_param(name) def on_label(value) node = { type: :@label, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -1839,7 +1839,7 @@ def on_label(value) def on_label_end(value) node = { type: :@label_end, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -1879,7 +1879,7 @@ def on_lambda(params, stmts) def on_lbrace(value) node = { type: :@lbrace, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -1892,7 +1892,7 @@ def on_lbrace(value) def on_lbracket(value) node = { type: :@lbracket, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -1905,7 +1905,7 @@ def on_lbracket(value) def on_lparen(value) node = { type: :@lparen, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -2181,7 +2181,7 @@ def on_next(args) def on_op(value) node = { type: :@op, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -2294,7 +2294,7 @@ def on_parse_error(error, *) def on_period(value) { type: :@period, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } end @@ -2327,7 +2327,7 @@ def on_program(stmts) def on_qsymbols_beg(value) node = { type: :@qsymbols_beg, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -2365,7 +2365,7 @@ def on_qsymbols_add(qsymbols, tstring_content) def on_qwords_beg(value) node = { type: :@qwords_beg, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -2398,7 +2398,7 @@ def on_qwords_add(qwords, tstring_content) def on_rational(value) node = { type: :@rational, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -2411,7 +2411,7 @@ def on_rational(value) def on_rbrace(value) node = { type: :@rbrace, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -2424,7 +2424,7 @@ def on_rbrace(value) def on_rbracket(value) node = { type: :@rbracket, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -2437,7 +2437,7 @@ def on_rbracket(value) def on_redo keyword = find_scanner_event(:@kw, 'redo') - { type: :redo, body: keyword[:body], loc: keyword[:loc] } + { type: :redo, value: keyword[:value], loc: keyword[:loc] } end # regexp_add is a parser event that represents a part of a regular expression @@ -2460,7 +2460,7 @@ def on_regexp_add(regexp, part) def on_regexp_beg(value) node = { type: :@regexp_beg, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -2474,7 +2474,7 @@ def on_regexp_beg(value) def on_regexp_end(value) { type: :@regexp_end, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } end @@ -2488,7 +2488,7 @@ def on_regexp_literal(regexp, ending) type: :regexp_literal, parts: regexp[:parts], beging: regexp[:beging], - ending: ending[:body], + ending: ending[:value], loc: regexp[:loc].to(ending[:loc]) } end @@ -2499,7 +2499,7 @@ def on_regexp_literal(regexp, ending) def on_regexp_new beging = find_scanner_event(:@regexp_beg) - { type: :regexp, parts: [], beging: beging[:body], loc: beging[:loc] } + { type: :regexp, parts: [], beging: beging[:value], loc: beging[:loc] } end # rescue is a special kind of node where you have a rescue chain but it @@ -2605,7 +2605,7 @@ def on_rest_param(name) def on_retry keyword = find_scanner_event(:@kw, 'retry') - { type: :retry, body: keyword[:body], loc: keyword[:loc] } + { type: :retry, value: keyword[:value], loc: keyword[:loc] } end # return is a parser event that represents using the return keyword with @@ -2624,7 +2624,7 @@ def on_return(args) def on_return0 keyword = find_scanner_event(:@kw, 'return') - { type: :return0, body: keyword[:body], loc: keyword[:loc] } + { type: :return0, value: keyword[:value], loc: keyword[:loc] } end # rparen is a scanner event that represents the use of a right parenthesis, @@ -2632,7 +2632,7 @@ def on_return0 def on_rparen(value) node = { type: :@rparen, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -2853,7 +2853,7 @@ def on_string_literal(string) { type: :string_literal, parts: string[:parts], - quote: beging[:body], + quote: beging[:value], loc: beging[:loc].to(ending[:loc]) } end @@ -2875,7 +2875,7 @@ def on_super(args) def on_symbeg(value) node = { type: :@symbeg, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -2888,8 +2888,8 @@ def on_symbeg(value) def on_symbol(value) # When ripper is lexing source text, it turns symbols into keywords if their # contents match, which will mess up the location information of all of our - # other nodes. So for example instead of { type: :@ident, body: "class" } - # you would instead get { type: :@kw, body: "class" }. + # other nodes. So for example instead of { type: :@ident, value: "class" } + # you would instead get { type: :@kw, value: "class" }. # # In order to take care of this, we explicitly delete this scanner event # from the stack to make sure it doesn't screw things up. @@ -2937,7 +2937,7 @@ def on_symbols_add(symbols, word_add) def on_symbols_beg(value) node = { type: :@symbols_beg, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -2960,7 +2960,7 @@ def on_symbols_new def on_tlambda(value) node = { type: :@tlambda, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -2973,7 +2973,7 @@ def on_tlambda(value) def on_tlambeg(value) node = { type: :@tlambeg, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -3019,7 +3019,7 @@ def on_top_const_ref(constant) def on_tstring_beg(value) node = { type: :@tstring_beg, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -3033,7 +3033,7 @@ def on_tstring_beg(value) def on_tstring_content(value) { type: :@tstring_content, - body: value.force_encoding('UTF-8'), + value: value.force_encoding('UTF-8'), loc: Location.token(line: lineno, char: char_pos, size: value.size) } end @@ -3044,7 +3044,7 @@ def on_tstring_content(value) def on_tstring_end(value) node = { type: :@tstring_end, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -3079,7 +3079,7 @@ def on_unary(operator, value) scanner_events.rindex do |scanner_event| scanner_event[:type] == :@op && scanner_event[:loc].start_char < value[:loc].start_char && - !%w[.. ...].include?(scanner_event[:body]) + !%w[.. ...].include?(scanner_event[:value]) end beging = scanner_events.delete_at(index) @@ -3233,9 +3233,9 @@ def on_var_field(value) def on_vcall(value) @controls ||= %w[private protected public].freeze - body = value[:body] + name = value[:value] type = - if @controls.include?(body) && body == lines[lineno - 1].strip + if @controls.include?(name) && name == lines[lineno - 1].strip :access_ctrl else :vcall @@ -3355,7 +3355,7 @@ def on_word_new def on_words_beg(value) node = { type: :@words_beg, - body: value, + value: value, loc: Location.token(line: lineno, char: char_pos, size: value.size) } @@ -3430,7 +3430,7 @@ def on_xstring_new heredoc = @heredocs[-1] location = - if heredoc && heredoc[:beging][:body].include?('`') + if heredoc && heredoc[:beging][:value].include?('`') heredoc[:loc] elsif RUBY_MAJOR <= 2 && RUBY_MINOR <= 5 && RUBY_PATCH < 7 Location.fixed(line: lineno, char: char_pos) @@ -3458,7 +3458,7 @@ def on_xstring_new def on_xstring_literal(xstring) heredoc = @heredocs[-1] - if heredoc && heredoc[:beging][:body].include?('`') + if heredoc && heredoc[:beging][:value].include?('`') { type: :heredoc, beging: heredoc[:beging], @@ -3493,7 +3493,7 @@ def on_yield(args) def on_yield0 keyword = find_scanner_event(:@kw, 'yield') - { type: :yield0, body: keyword[:body], loc: keyword[:loc] } + { type: :yield0, value: keyword[:value], loc: keyword[:loc] } end # zsuper is a parser event that represents the bare super keyword. It has @@ -3503,6 +3503,6 @@ def on_yield0 def on_zsuper keyword = find_scanner_event(:@kw, 'super') - { type: :zsuper, body: keyword[:body], loc: keyword[:loc] } + { type: :zsuper, value: keyword[:value], loc: keyword[:loc] } end end diff --git a/src/ruby/toProc.ts b/src/ruby/toProc.ts index 27e62cad..b1881d0c 100644 --- a/src/ruby/toProc.ts +++ b/src/ruby/toProc.ts @@ -72,7 +72,7 @@ function toProc( // Ensure the call is a method of the block argument if ( call.receiver.type !== "var_ref" || - call.receiver.value.body !== params.reqs[0].body || + call.receiver.value.value !== params.reqs[0].value || !isPeriod(call.operator) || call.message === "call" || call.message.type !== "@ident" @@ -96,19 +96,19 @@ function toProc( const assocNode = parentNode as Ruby.AssocNew; const key = assocNode.key; - if (key.type === "@label" && ["if:", "unless:"].includes(key.body)) { + if (key.type === "@label" && ["if:", "unless:"].includes(key.value)) { return null; } if ( key.type === "symbol_literal" && - ["if", "unless"].includes(key.val.body) + ["if", "unless"].includes(key.val.value) ) { return null; } } - return `&:${call.message.body}`; + return `&:${call.message.value}`; } export default toProc; diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 377507b2..d9c5c976 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -6,8 +6,8 @@ type Comments = { comments?: Comment[] }; export type Location = [number, number, number, number]; // These are utility types used to construct the various node types. -type ScannerEvent = { type: `@${T}`, body: string, loc: Location } & Comments; -type ParserEvent0 = { type: T, body: string, loc: Location } & Comments; +type ScannerEvent = { type: `@${T}`, value: string, loc: Location } & Comments; +type ParserEvent0 = { type: T, value: string, loc: Location } & Comments; type ParserEvent> = { type: T, loc: Location } & Comments & V; // This is the main expression type that goes in places where the AST will diff --git a/src/utils.ts b/src/utils.ts index cd3e7f37..0d397944 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -6,7 +6,6 @@ export { default as isEmptyStmts } from "./utils/isEmptyStmts"; export { default as getChildNodes } from "./utils/getChildNodes"; export { default as hasAncestor } from "./utils/hasAncestor"; export { default as inlineEnsureParens } from "./utils/inlineEnsureParens"; -export { default as literal } from "./utils/literal"; export { default as literallineWithoutBreakParent } from "./utils/literallineWithoutBreakParent"; export { default as makeCall } from "./utils/makeCall"; export { default as noIndent } from "./utils/noIndent"; diff --git a/src/utils/literal.ts b/src/utils/literal.ts deleted file mode 100644 index 845cf4cb..00000000 --- a/src/utils/literal.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Plugin } from "../types"; - -function literal(value: string): Plugin.Printer> { - return function printLiteral() { - return value; - }; -} - -export default literal; From 4c887c5909c40ea9ab3377d0614caa532b8e0d03 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Nov 2021 12:01:32 +0000 Subject: [PATCH 411/785] Bump eslint from 8.1.0 to 8.2.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.1.0 to 8.2.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.1.0...v8.2.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 54 ++++++++++-------------------------------------------- 1 file changed, 10 insertions(+), 44 deletions(-) diff --git a/yarn.lock b/yarn.lock index d61a61ac..dbbc29bb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -314,10 +314,10 @@ dependencies: "@cspotcode/source-map-consumer" "0.8.0" -"@eslint/eslintrc@^1.0.3": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.0.3.tgz#41f08c597025605f672251dcc4e8be66b5ed7366" - integrity sha512-DHI1wDPoKCBPoLZA3qDR91+3te/wDSc1YhKg3jR8NxKKRJq2hwHwcWv31cSwSYvIBrmbENoYMWcenW8uproQqg== +"@eslint/eslintrc@^1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.0.4.tgz#dfe0ff7ba270848d10c5add0715e04964c034b31" + integrity sha512-h8Vx6MdxwWI2WM8/zREHMoqdgLNXEL4QX3MWSVMdyNJGvXVOs+6lp+m2hc3FnuMHDc4poxFNI20vCk0OmI4G0Q== dependencies: ajv "^6.12.4" debug "^4.3.2" @@ -325,7 +325,7 @@ globals "^13.9.0" ignore "^4.0.6" import-fresh "^3.2.1" - js-yaml "^3.13.1" + js-yaml "^4.1.0" minimatch "^3.0.4" strip-json-comments "^3.1.1" @@ -728,14 +728,6 @@ "@typescript-eslint/typescript-estree" "5.3.0" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.2.0.tgz#7ce8e4ab2baaa0ad5282913ea8e13ce03ec6a12a" - integrity sha512-RW+wowZqPzQw8MUFltfKYZfKXqA2qgyi6oi/31J1zfXJRpOn6tCaZtd9b5u9ubnDG2n/EMvQLeZrsLNPpaUiFQ== - dependencies: - "@typescript-eslint/types" "5.2.0" - "@typescript-eslint/visitor-keys" "5.2.0" - "@typescript-eslint/scope-manager@5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.3.0.tgz#97d0ccc7c9158e89e202d5e24ce6ba49052d432e" @@ -744,29 +736,11 @@ "@typescript-eslint/types" "5.3.0" "@typescript-eslint/visitor-keys" "5.3.0" -"@typescript-eslint/types@5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.2.0.tgz#7ad32d15abddb0ee968a330f0ea182ea544ef7cf" - integrity sha512-cTk6x08qqosps6sPyP2j7NxyFPlCNsJwSDasqPNjEQ8JMD5xxj2NHxcLin5AJQ8pAVwpQ8BMI3bTxR0zxmK9qQ== - "@typescript-eslint/types@5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.3.0.tgz#af29fd53867c2df0028c57c36a655bd7e9e05416" integrity sha512-fce5pG41/w8O6ahQEhXmMV+xuh4+GayzqEogN24EK+vECA3I6pUwKuLi5QbXO721EMitpQne5VKXofPonYlAQg== -"@typescript-eslint/typescript-estree@5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.2.0.tgz#c22e0ff6f8a4a3f78504a80ebd686fe2870a68ae" - integrity sha512-RsdXq2XmVgKbm9nLsE3mjNUM7BTr/K4DYR9WfFVMUuozHWtH5gMpiNZmtrMG8GR385EOSQ3kC9HiEMJWimxd/g== - dependencies: - "@typescript-eslint/types" "5.2.0" - "@typescript-eslint/visitor-keys" "5.2.0" - debug "^4.3.2" - globby "^11.0.4" - is-glob "^4.0.3" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.3.0.tgz#4f68ddd46dc2983182402d2ab21fb44ad94988cf" @@ -780,14 +754,6 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.2.0.tgz#03522d35df98474f08e0357171a7d1b259a88f55" - integrity sha512-Nk7HizaXWWCUBfLA/rPNKMzXzWS8Wg9qHMuGtT+v2/YpPij4nVXrVJc24N/r5WrrmqK31jCrZxeHqIgqRzs0Xg== - dependencies: - "@typescript-eslint/types" "5.2.0" - eslint-visitor-keys "^3.0.0" - "@typescript-eslint/visitor-keys@5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.3.0.tgz#a6258790f3b7b2547f70ed8d4a1e0c3499994523" @@ -1378,11 +1344,11 @@ eslint-visitor-keys@^3.0.0: integrity sha512-mJOZa35trBTb3IyRmo8xmKBZlxf+N7OnUl4+ZhJHs/r+0770Wh/LEACE2pqMGMe27G/4y8P2bYGk4J70IC5k1Q== eslint@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.1.0.tgz#00f1f7dbf4134f26588e6c9f2efe970760f64664" - integrity sha512-JZvNneArGSUsluHWJ8g8MMs3CfIEzwaLx9KyH4tZ2i+R2/rPWzL8c0zg3rHdwYVpN/1sB9gqnjHwz9HoeJpGHw== + version "8.2.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.2.0.tgz#44d3fb506d0f866a506d97a0fc0e90ee6d06a815" + integrity sha512-erw7XmM+CLxTOickrimJ1SiF55jiNlVSp2qqm0NuBWPtHYQCegD5ZMaW0c3i5ytPqL+SSLaCxdvQXFPLJn+ABw== dependencies: - "@eslint/eslintrc" "^1.0.3" + "@eslint/eslintrc" "^1.0.4" "@humanwhocodes/config-array" "^0.6.0" ajv "^6.10.0" chalk "^4.0.0" @@ -1416,7 +1382,7 @@ eslint@^8.1.0: progress "^2.0.0" regexpp "^3.2.0" semver "^7.2.1" - strip-ansi "^6.0.0" + strip-ansi "^6.0.1" strip-json-comments "^3.1.0" text-table "^0.2.0" v8-compile-cache "^2.0.3" From 6452a401dd0111420e8ad9b095330e8866d7f94f Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 8 Nov 2021 13:55:27 -0500 Subject: [PATCH 412/785] Fix for #1035 --- CHANGELOG.md | 4 ++++ src/ruby/nodes/return.ts | 8 ++++++++ test/js/ruby/nodes/return.test.ts | 11 +++++++++++ 3 files changed, 23 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6b969ee..35035df4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Changed + +- [#1035](https://github.com/prettier/plugin-ruby/issues/1035) - qcn, kddnewton - Ensure we don't try to print `return` incorrectly when multiple statements are contained within parentheses. + ## [2.0.0] - 2021-10-28 ### Changed diff --git a/src/ruby/nodes/return.ts b/src/ruby/nodes/return.ts index ba99eb14..5ee97380 100644 --- a/src/ruby/nodes/return.ts +++ b/src/ruby/nodes/return.ts @@ -9,6 +9,14 @@ const { group, ifBreak, indent, line, join, softline } = prettier; function canSkipParens(args: Ruby.Args | Ruby.ArgsAddStar) { const stmts = (args.body[0] as any).body[0] as Ruby.Stmts; + // return( + // foo + // bar + // ) + if (stmts.body.length !== 1) { + return false; + } + // return( // # a // b diff --git a/test/js/ruby/nodes/return.test.ts b/test/js/ruby/nodes/return.test.ts index 754188c6..1a20f7b2 100644 --- a/test/js/ruby/nodes/return.test.ts +++ b/test/js/ruby/nodes/return.test.ts @@ -81,4 +81,15 @@ describe("return", () => { expect(content).toMatchFormat(); }); + + test("returning multiple statements", () => { + const content = ruby(` + return( + foo + bar + ) + `); + + expect(content).toMatchFormat(); + }); }); From 8f31a3f036fa3eb245bbab864a3f8ea3fb05649e Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 8 Nov 2021 14:17:51 -0500 Subject: [PATCH 413/785] Fix for #1028 --- CHANGELOG.md | 4 ++++ src/ruby/nodes/commands.ts | 26 ++++++++++++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6b969ee..ee66fc1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Changed + +- [#1028](https://github.com/prettier/plugin-ruby/issues/1028) - levymetal, kddnewton - Fix up some nested formatting with very complicated RSpec assertions. + ## [2.0.0] - 2021-10-28 ### Changed diff --git a/src/ruby/nodes/commands.ts b/src/ruby/nodes/commands.ts index 0710f50d..63eeb84f 100644 --- a/src/ruby/nodes/commands.ts +++ b/src/ruby/nodes/commands.ts @@ -9,11 +9,21 @@ function throwBadDoc(doc: Plugin.Doc) { throw new Error(`Unknown doc ${doc}`); } +function reduceDocLength(sum: number, doc: Plugin.Doc) { + // If we've hit a line, then we're going to start the counting back at 0 since + // it will be starting from the beginning of a line. + if (typeof doc === "object" && !Array.isArray(doc) && doc.type === "line") { + return 0; + } + + return sum + docBreakLength(doc); +} + // Loop through the already created doc nodes and determine the overall length // so that we can properly align the command arguments. -function docLength(doc: Plugin.Doc): number { +function docBreakLength(doc: Plugin.Doc): number { if (Array.isArray(doc)) { - return doc.reduce((sum, child) => sum + docLength(child), 0); + return doc.reduce(reduceDocLength, 0); } if (typeof doc === "string") { @@ -23,16 +33,16 @@ function docLength(doc: Plugin.Doc): number { switch (doc.type) { case "concat": case "fill": - return doc.parts.reduce((sum, child) => sum + docLength(child), 0); + return doc.parts.reduce(reduceDocLength, 0); case "align": case "group": case "indent": case "line-suffix": - return docLength(doc.contents); + return docBreakLength(doc.contents); case "if-break": - return docLength(doc.flatContents); + return docBreakLength(doc.breakContents); case "line": - return doc.soft ? 0 : 1; + return 0; case "break-parent": case "cursor": case "indent-if-break": @@ -98,7 +108,7 @@ export const printCommand: Plugin.Printer = ( } else if (hasDef(node)) { breakArgs = joinedArgs; } else { - breakArgs = align(docLength(command) + 1, joinedArgs); + breakArgs = align(docBreakLength(command) + 1, joinedArgs); } return group( @@ -141,7 +151,7 @@ export const printCommandCall: Plugin.Printer = ( breakDoc = parts.concat(argDocs); } else { parts.push(" "); - breakDoc = parts.concat(align(docLength(parts), argDocs)); + breakDoc = parts.concat(align(docBreakLength(parts), argDocs)); } const joinedDoc = parts.concat(argDocs); From a04a02a6b20a76ed3bec0e5984aa0de4dc53a4a7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Nov 2021 12:01:51 +0000 Subject: [PATCH 414/785] Bump @typescript-eslint/eslint-plugin from 5.3.0 to 5.3.1 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.3.0 to 5.3.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.3.1/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 58 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 46 insertions(+), 12 deletions(-) diff --git a/yarn.lock b/yarn.lock index dbbc29bb..2bed0b69 100644 --- a/yarn.lock +++ b/yarn.lock @@ -693,12 +693,12 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.2.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.3.0.tgz#a55ae72d28ffeb6badd817fe4566c9cced1f5e29" - integrity sha512-ARUEJHJrq85aaiCqez7SANeahDsJTD3AEua34EoQN9pHS6S5Bq9emcIaGGySt/4X2zSi+vF5hAH52sEen7IO7g== + version "5.3.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.3.1.tgz#d8ff412f10f54f6364e7fd7c1e70eb6767f434c3" + integrity sha512-cFImaoIr5Ojj358xI/SDhjog57OK2NqlpxwdcgyxDA3bJlZcJq5CPzUXtpD7CxI2Hm6ATU7w5fQnnkVnmwpHqw== dependencies: - "@typescript-eslint/experimental-utils" "5.3.0" - "@typescript-eslint/scope-manager" "5.3.0" + "@typescript-eslint/experimental-utils" "5.3.1" + "@typescript-eslint/scope-manager" "5.3.1" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -706,15 +706,15 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/experimental-utils@5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.3.0.tgz#ee56b4957547ed2b0fc7451205e41502e664f546" - integrity sha512-NFVxYTjKj69qB0FM+piah1x3G/63WB8vCBMnlnEHUsiLzXSTWb9FmFn36FD9Zb4APKBLY3xRArOGSMQkuzTF1w== +"@typescript-eslint/experimental-utils@5.3.1": + version "5.3.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.3.1.tgz#bbd8f9b67b4d5fdcb9d2f90297d8fcda22561e05" + integrity sha512-RgFn5asjZ5daUhbK5Sp0peq0SSMytqcrkNfU4pnDma2D8P3ElZ6JbYjY8IMSFfZAJ0f3x3tnO3vXHweYg0g59w== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.3.0" - "@typescript-eslint/types" "5.3.0" - "@typescript-eslint/typescript-estree" "5.3.0" + "@typescript-eslint/scope-manager" "5.3.1" + "@typescript-eslint/types" "5.3.1" + "@typescript-eslint/typescript-estree" "5.3.1" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -736,11 +736,24 @@ "@typescript-eslint/types" "5.3.0" "@typescript-eslint/visitor-keys" "5.3.0" +"@typescript-eslint/scope-manager@5.3.1": + version "5.3.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.3.1.tgz#3cfbfbcf5488fb2a9a6fbbe97963ee1e8d419269" + integrity sha512-XksFVBgAq0Y9H40BDbuPOTUIp7dn4u8oOuhcgGq7EoDP50eqcafkMVGrypyVGvDYHzjhdUCUwuwVUK4JhkMAMg== + dependencies: + "@typescript-eslint/types" "5.3.1" + "@typescript-eslint/visitor-keys" "5.3.1" + "@typescript-eslint/types@5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.3.0.tgz#af29fd53867c2df0028c57c36a655bd7e9e05416" integrity sha512-fce5pG41/w8O6ahQEhXmMV+xuh4+GayzqEogN24EK+vECA3I6pUwKuLi5QbXO721EMitpQne5VKXofPonYlAQg== +"@typescript-eslint/types@5.3.1": + version "5.3.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.3.1.tgz#afaa715b69ebfcfde3af8b0403bf27527912f9b7" + integrity sha512-bG7HeBLolxKHtdHG54Uac750eXuQQPpdJfCYuw4ZI3bZ7+GgKClMWM8jExBtp7NSP4m8PmLRM8+lhzkYnSmSxQ== + "@typescript-eslint/typescript-estree@5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.3.0.tgz#4f68ddd46dc2983182402d2ab21fb44ad94988cf" @@ -754,6 +767,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.3.1": + version "5.3.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.3.1.tgz#50cc4bfb93dc31bc75e08ae52e29fcb786d606ec" + integrity sha512-PwFbh/PKDVo/Wct6N3w+E4rLZxUDgsoII/GrWM2A62ETOzJd4M6s0Mu7w4CWsZraTbaC5UQI+dLeyOIFF1PquQ== + dependencies: + "@typescript-eslint/types" "5.3.1" + "@typescript-eslint/visitor-keys" "5.3.1" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/visitor-keys@5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.3.0.tgz#a6258790f3b7b2547f70ed8d4a1e0c3499994523" @@ -762,6 +788,14 @@ "@typescript-eslint/types" "5.3.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.3.1": + version "5.3.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.3.1.tgz#c2860ff22939352db4f3806f34b21d8ad00588ba" + integrity sha512-3cHUzUuVTuNHx0Gjjt5pEHa87+lzyqOiHXy/Gz+SJOCW1mpw9xQHIIEwnKn+Thph1mgWyZ90nboOcSuZr/jTTQ== + dependencies: + "@typescript-eslint/types" "5.3.1" + 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 ebf9ca4cde1ac684c4f93475590ed9d3f8c07286 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Nov 2021 12:02:05 +0000 Subject: [PATCH 415/785] Bump @typescript-eslint/parser from 5.3.0 to 5.3.1 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.3.0 to 5.3.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.3.1/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index dbbc29bb..7aae9a97 100644 --- a/yarn.lock +++ b/yarn.lock @@ -719,13 +719,13 @@ eslint-utils "^3.0.0" "@typescript-eslint/parser@^5.2.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.3.0.tgz#7879f15e26d370ed3f653fb7dd06479531ed3ab9" - integrity sha512-rKu/yAReip7ovx8UwOAszJVO5MgBquo8WjIQcp1gx4pYQCwYzag+I5nVNHO4MqyMkAo0gWt2gWUi+36gWAVKcw== + version "5.3.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.3.1.tgz#8ff1977c3d3200c217b3e4628d43ef92f89e5261" + integrity sha512-TD+ONlx5c+Qhk21x9gsJAMRohWAUMavSOmJgv3JGy9dgPhuBd5Wok0lmMClZDyJNLLZK1JRKiATzCKZNUmoyfw== dependencies: - "@typescript-eslint/scope-manager" "5.3.0" - "@typescript-eslint/types" "5.3.0" - "@typescript-eslint/typescript-estree" "5.3.0" + "@typescript-eslint/scope-manager" "5.3.1" + "@typescript-eslint/types" "5.3.1" + "@typescript-eslint/typescript-estree" "5.3.1" debug "^4.3.2" "@typescript-eslint/scope-manager@5.3.0": @@ -736,11 +736,24 @@ "@typescript-eslint/types" "5.3.0" "@typescript-eslint/visitor-keys" "5.3.0" +"@typescript-eslint/scope-manager@5.3.1": + version "5.3.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.3.1.tgz#3cfbfbcf5488fb2a9a6fbbe97963ee1e8d419269" + integrity sha512-XksFVBgAq0Y9H40BDbuPOTUIp7dn4u8oOuhcgGq7EoDP50eqcafkMVGrypyVGvDYHzjhdUCUwuwVUK4JhkMAMg== + dependencies: + "@typescript-eslint/types" "5.3.1" + "@typescript-eslint/visitor-keys" "5.3.1" + "@typescript-eslint/types@5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.3.0.tgz#af29fd53867c2df0028c57c36a655bd7e9e05416" integrity sha512-fce5pG41/w8O6ahQEhXmMV+xuh4+GayzqEogN24EK+vECA3I6pUwKuLi5QbXO721EMitpQne5VKXofPonYlAQg== +"@typescript-eslint/types@5.3.1": + version "5.3.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.3.1.tgz#afaa715b69ebfcfde3af8b0403bf27527912f9b7" + integrity sha512-bG7HeBLolxKHtdHG54Uac750eXuQQPpdJfCYuw4ZI3bZ7+GgKClMWM8jExBtp7NSP4m8PmLRM8+lhzkYnSmSxQ== + "@typescript-eslint/typescript-estree@5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.3.0.tgz#4f68ddd46dc2983182402d2ab21fb44ad94988cf" @@ -754,6 +767,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.3.1": + version "5.3.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.3.1.tgz#50cc4bfb93dc31bc75e08ae52e29fcb786d606ec" + integrity sha512-PwFbh/PKDVo/Wct6N3w+E4rLZxUDgsoII/GrWM2A62ETOzJd4M6s0Mu7w4CWsZraTbaC5UQI+dLeyOIFF1PquQ== + dependencies: + "@typescript-eslint/types" "5.3.1" + "@typescript-eslint/visitor-keys" "5.3.1" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/visitor-keys@5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.3.0.tgz#a6258790f3b7b2547f70ed8d4a1e0c3499994523" @@ -762,6 +788,14 @@ "@typescript-eslint/types" "5.3.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.3.1": + version "5.3.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.3.1.tgz#c2860ff22939352db4f3806f34b21d8ad00588ba" + integrity sha512-3cHUzUuVTuNHx0Gjjt5pEHa87+lzyqOiHXy/Gz+SJOCW1mpw9xQHIIEwnKn+Thph1mgWyZ90nboOcSuZr/jTTQ== + dependencies: + "@typescript-eslint/types" "5.3.1" + 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 b30dcd26c5ea30c37157c627b749471796956584 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Nov 2021 12:02:14 +0000 Subject: [PATCH 416/785] Bump @types/node from 16.11.6 to 16.11.7 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.6 to 16.11.7. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index dbbc29bb..6c5ad9ef 100644 --- a/yarn.lock +++ b/yarn.lock @@ -666,9 +666,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^16.9.1": - version "16.11.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.6.tgz#6bef7a2a0ad684cf6e90fcfe31cecabd9ce0a3ae" - integrity sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w== + version "16.11.7" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.7.tgz#36820945061326978c42a01e56b61cd223dfdc42" + integrity sha512-QB5D2sqfSjCmTuWcBWyJ+/44bcjO7VbjSbOE0ucoVbAsSNQc4Lt6QkgkVXkTDwkL4z/beecZNDvVX15D4P8Jbw== "@types/prettier@^2.1.5", "@types/prettier@^2.3.2": version "2.4.1" From e3a4959d504ac3953f7fcd623ad4ff2614467784 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 4 Nov 2021 14:57:28 -0400 Subject: [PATCH 417/785] Refactor into classes --- bin/sexp | 26 +- src/ruby/parser.rb | 11346 ++++++++++++++++++++++++++++--------- test/rb/metadata_test.rb | 329 +- test/rb/parser_test.rb | 7 +- 4 files changed, 8880 insertions(+), 2828 deletions(-) diff --git a/bin/sexp b/bin/sexp index d364b535..d2cd01b8 100755 --- a/bin/sexp +++ b/bin/sexp @@ -1,30 +1,6 @@ #!/usr/bin/env ruby require_relative '../src/ruby/parser' -require 'pp' - -PP.prepend( - Module.new do - def pp_hash(obj) - group(1, '{', '}') do - text obj[:type] - text "" - - source = obj.respond_to?(:value) ? obj.value : obj - sliced = - source.select do |key, value| - !%i[type loc comments].include?(key) && value - end.keys - - group(1) do - breakable ' ' - pp source.values_at(*sliced) - end - end - end - end -) source = if !ARGV[0] @@ -41,7 +17,7 @@ puts '=== SOURCE === ' puts source puts "\n=== COMMENTS ===" -puts parsed[:comments] +pp parsed.comments puts "\n=== S-EXPS ===" pp parsed diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 751afbd3..ef76854f 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -55,6 +55,7 @@ def [](byteindex) end end + # Represents the location of a node in the tree from the source code. class Location attr_reader :start_line, :start_char, :end_line, :end_char @@ -92,35 +93,6 @@ def self.fixed(line:, char:) end end - # This is a small wrapper around the value of a node for those specific events - # that need extra handling. (For example: statement, body statement, and - # rescue nodes which all need extra information to determine their character - # boundaries.) - class Node - attr_reader :parser, :value - - def initialize(parser, value) - @parser = parser - @value = value - end - - def [](key) - value[key] - end - - def dig(*keys) - value.dig(*keys) - end - - def to_json(*opts) - value.to_json(*opts) - end - - def pretty_print(q) - q.pp_hash(self) - end - end - # A special parser error so that we can get nice syntax displays on the error # message when prettier prints out the results. class ParserError < StandardError @@ -216,6 +188,12 @@ def self.parse(source) private + # ---------------------------------------- + # :section: Helper methods + # The following methods are used by the ripper event handlers to either + # determine their bounds or query other nodes. + # ---------------------------------------- + # This represents the current place in the source string that we've gotten to # so far. We have a memoized line_counts object that we can use to get the # number of characters that we've had to go through to get to the beginning of @@ -225,15 +203,6 @@ def char_pos @line_counts[lineno - 1][column] end - # Params nodes are the most complicated in the tree. Occasionally you want to - # know if they are "empty", which means not having any parameters declared. - # This logic accesses every kind of parameter and determines if it's missing. - def empty_params?(params) - params[:reqs].empty? && params[:opts].empty? && !params[:rest] && - params[:posts].empty? && params[:keywords].empty? && !params[:kwrest] && - !params[:block] - end - # As we build up a list of scanner events, we'll periodically need to go # backwards and find the ones that we've already hit in order to determine the # location information for nodes that use them. For example, if you have a @@ -248,9 +217,8 @@ def empty_params?(params) # their own stack. def find_scanner_event(type, value = :any, consume: true) index = - scanner_events.rindex do |scanner_event| - scanner_event[:type] == type && - (value == :any || (scanner_event[:value] == value)) + scanner_events.rindex do |node| + node.is_a?(type) && (value == :any || (node.value == value)) end if consume @@ -276,9 +244,9 @@ def find_scanner_event(type, value = :any, consume: true) # instance ::X::Y::Z. def find_colon2_before(const) index = - scanner_events.rindex do |event| - event[:type] == :@op && event[:value] == '::' && - event[:loc].start_char < const[:loc].start_char + scanner_events.rindex do |node| + node.is_a?(Op) && node.value == '::' && + node.location.start_char < const.location.start_char end scanner_events[index] @@ -305,3204 +273,9304 @@ def find_next_statement_start(position) position end - # BEGIN is a parser event that represents the use of the BEGIN keyword, which - # hooks into the lifecycle of the interpreter. Whatever is inside the "block" - # will get executed when the program starts. The syntax looks like the - # following: + # ---------------------------------------- + # :section: Ripper event handlers + # The following methods all handle a dispatched ripper event. + # ---------------------------------------- + + # BEGINBlock represents the use of the +BEGIN+ keyword, which hooks into the + # lifecycle of the interpreter. Whatever is inside the block will get executed + # when the program starts. # # BEGIN { - # # execute stuff here # } # - def on_BEGIN(stmts) - beging = find_scanner_event(:@lbrace) - ending = find_scanner_event(:@rbrace) + # Interestingly, the BEGIN keyword doesn't allow the do and end keywords for + # the block. Only braces are permitted. + class BEGINBlock + # [LBrace] the left brace that is seen after the keyword + attr_reader :lbrace + + # [Statements] the expressions to be executed + attr_reader :statements + + # [Location] the location of this node + attr_reader :location + + def initialize(lbrace:, statements:, location:) + @lbrace = lbrace + @statements = statements + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('BEGIN') + q.breakable + q.pp(statements) + end + end + + def to_json(*opts) + { + type: :BEGIN, + lbrace: lbrace, + stmts: statements, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_BEGIN: (Statements statements) -> BEGINBlock + def on_BEGIN(statements) + lbrace = find_scanner_event(LBrace) + rbrace = find_scanner_event(RBrace) - stmts.bind( - find_next_statement_start(beging[:loc].end_char), - ending[:loc].start_char + statements.bind( + find_next_statement_start(lbrace.location.end_char), + rbrace.location.start_char ) - keyword = find_scanner_event(:@kw, 'BEGIN') + keyword = find_scanner_event(Kw, 'BEGIN') - { - type: :BEGIN, - lbrace: beging, - stmts: stmts, - loc: keyword[:loc].to(ending[:loc]) - } + BEGINBlock.new( + lbrace: lbrace, + statements: statements, + location: keyword.location.to(rbrace.location) + ) end - # CHAR is a parser event that represents a single codepoint in the script - # encoding. For example: + # CHAR irepresents a single codepoint in the script encoding. # # ?a # - # is a representation of the string literal "a". You can use control - # characters with this as well, as in ?\C-a. - # + # In the example above, the CHAR node represents the string literal "a". You + # can use control characters with this as well, as in ?\C-a. + class CHAR + # [String] the value of the character literal + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('CHAR') + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@CHAR, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_CHAR: (String value) -> CHAR def on_CHAR(value) - node = { - type: :@CHAR, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + node = + CHAR.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) scanner_events << node node end - # END is a parser event that represents the use of the END keyword, which - # hooks into the lifecycle of the interpreter. Whatever is inside the "block" - # will get executed when the program ends. The syntax looks like the - # following: + # ENDBlock represents the use of the +END+ keyword, which hooks into the + # lifecycle of the interpreter. Whatever is inside the block will get executed + # when the program ends. # # END { - # # execute stuff here # } # - def on_END(stmts) - beging = find_scanner_event(:@lbrace) - ending = find_scanner_event(:@rbrace) + # Interestingly, the END keyword doesn't allow the do and end keywords for the + # block. Only braces are permitted. + class ENDBlock + # [LBrace] the left brace that is seen after the keyword + attr_reader :lbrace + + # [Statements] the expressions to be executed + attr_reader :statements + + # [Location] the location of this node + attr_reader :location + + def initialize(lbrace:, statements:, location:) + @lbrace = lbrace + @statements = statements + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('END') + q.breakable + q.pp(statements) + end + end + + def to_json(*opts) + { type: :END, lbrace: lbrace, stmts: statements, loc: location }.to_json( + *opts + ) + end + end - stmts.bind( - find_next_statement_start(beging[:loc].end_char), - ending[:loc].start_char + # :call-seq: + # on_END: (Statements statements) -> ENDBlock + def on_END(statements) + lbrace = find_scanner_event(LBrace) + rbrace = find_scanner_event(RBrace) + + statements.bind( + find_next_statement_start(lbrace.location.end_char), + rbrace.location.start_char ) - keyword = find_scanner_event(:@kw, 'END') + keyword = find_scanner_event(Kw, 'END') - { - type: :END, - lbrace: beging, - stmts: stmts, - loc: keyword[:loc].to(ending[:loc]) - } + ENDBlock.new( + lbrace: lbrace, + statements: statements, + location: keyword.location.to(rbrace.location) + ) end - # __END__ is a scanner event that represents __END__ syntax, which allows - # individual scripts to keep content after the main ruby code that can be read - # through the DATA constant. It looks like: + # EndContent represents the use of __END__ syntax, which allows individual + # scripts to keep content after the main ruby code that can be read through + # the DATA constant. # # puts DATA.read # # __END__ - # some other content that isn't executed by the program + # some other content that is not executed by the program # + class EndContent + # [String] the content after the script + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('__end__') + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@__end__, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on___end__: (String value) -> EndContent def on___end__(value) - @__end__ = { - type: :@__end__, - value: lines[lineno..-1].join("\n"), - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + @__end__ = + EndContent.new( + value: lines[lineno..-1].join("\n"), + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) end - # alias is a parser event that represents the use of the alias keyword with - # regular arguments. This can be either symbol literals or bare words. You can - # optionally use parentheses with this keyword, so we either track the - # location information based on those or the final argument to the alias - # method. - def on_alias(left, right) - beging = find_scanner_event(:@kw, 'alias') + # Alias represents the use of the +alias+ keyword with regular arguments (not + # global variables). The +alias+ keyword is used to make a method respond to + # another name as well as the current one. + # + # alias aliased_name name + # + # For the example above, in the current context you can now call aliased_name + # and it will execute the name method. When you're aliasing two methods, you + # can either provide bare words (like the example above) or you can provide + # symbols (note that this includes dynamic symbols like + # :"left-#{middle}-right"). + class Alias + # [DynaSymbol | SymbolLiteral] the new name of the method + attr_reader :left + + # [DynaSymbol | SymbolLiteral] the old name of the method + attr_reader :right + + # [Location] the location of this node + attr_reader :location + + def initialize(left:, right:, location:) + @left = left + @right = right + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('alias') + q.breakable + q.pp(left) + q.breakable + q.pp(right) + end + end + + def to_json(*opts) + { type: :alias, left: left, right: right, loc: location }.to_json(*opts) + end + end - paren = source[beging[:loc].end_char...left[:loc].start_char].include?('(') - ending = paren ? find_scanner_event(:@rparen) : right + # :call-seq: + # on_alias: ( + # (DynaSymbol | SymbolLiteral) left, + # (DynaSymbol | SymbolLiteral) right + # ) -> Alias + def on_alias(left, right) + keyword = find_scanner_event(Kw, 'alias') - { - type: :alias, + Alias.new( left: left, right: right, - loc: beging[:loc].to(ending[:loc]) - } + location: keyword.location.to(right.location) + ) end - # aref is a parser event when you're pulling a value out of a collection at a + # ARef represents when you're pulling a value out of a collection at a # specific index. Put another way, it's any time you're calling the method - # #[]. As an example: + # #[]. # - # foo[index] + # collection[index] # - # The nodes usually contains two children, the collection and the index. - # In some cases, you don't necessarily have the second child node, because - # you can call procs with a pretty esoteric syntax. In the following - # example, you wouldn't have a second child, and "foo" would be the first - # child: + # The nodes usually contains two children, the collection and the index. In + # some cases, you don't necessarily have the second child node, because you + # can call procs with a pretty esoteric syntax. In the following example, you + # wouldn't have a second child node: # - # foo[] + # collection[] # + class ARef + # [untyped] the value being indexed + attr_reader :collection + + # [nil | Args | ArgsAddBlock] the value being passed within the brackets + attr_reader :index + + # [Location] the location of this node + attr_reader :location + + def initialize(collection:, index:, location:) + @collection = collection + @index = index + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('aref') + q.breakable + q.pp(collection) + q.breakable + q.pp(index) + end + end + + def to_json(*opts) + { + type: :aref, + collection: collection, + index: index, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_aref: (untyped collection, (nil | Args | ArgsAddBlock) index) -> ARef def on_aref(collection, index) - find_scanner_event(:@lbracket) - ending = find_scanner_event(:@rbracket) + find_scanner_event(LBracket) + rbracket = find_scanner_event(RBracket) - { - type: :aref, + ARef.new( collection: collection, index: index, - loc: collection[:loc].to(ending[:loc]) - } + location: collection.location.to(rbracket.location) + ) + end + + # ARefField represents assigning values into collections at specific indices. + # Put another way, it's any time you're calling the method #[]=. The + # ARefField node itself is just the left side of the assignment, and they're + # always wrapped in assign nodes. + # + # collection[index] = value + # + class ARefField + # [untyped] the value being indexed + attr_reader :collection + + # [nil | ArgsAddBlock] the value being passed within the brackets + attr_reader :index + + # [Location] the location of this node + attr_reader :location + + def initialize(collection:, index:, location:) + @collection = collection + @index = index + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('aref_field') + q.breakable + q.pp(collection) + q.breakable + q.pp(index) + end + end + + def to_json(*opts) + { + type: :aref_field, + collection: collection, + index: index, + loc: location + }.to_json(*opts) + end end - # aref_field is a parser event that is very similar to aref except that it - # is being used inside of an assignment. + # :call-seq: + # on_aref_field: ( + # untyped collection, + # (nil | ArgsAddBlock) index + # ) -> ARefField def on_aref_field(collection, index) - find_scanner_event(:@lbracket) - ending = find_scanner_event(:@rbracket) + find_scanner_event(LBracket) + rbracket = find_scanner_event(RBracket) - { - type: :aref_field, + ARefField.new( collection: collection, index: index, - loc: collection[:loc].to(ending[:loc]) - } + location: collection.location.to(rbracket.location) + ) end - # arg_ambiguous is a parser event that represents when the parser sees an - # argument as ambiguous. For example, in the following snippet: - # - # foo // - # - # the question becomes if the forward slash is being used as a division - # operation or if it's the start of a regular expression. We don't need to - # track this event in the AST that we're generating, so we're not going to - # define an explicit handler for it. - # - # def on_arg_ambiguous(value) - # value - # end + # def on_arg_ambiguous(value) + # value + # end - # arg_paren is a parser event that represents wrapping arguments to a method - # inside a set of parentheses. For example, in the follow snippet: + # ArgParen represents wrapping arguments to a method inside a set of + # parentheses. # - # foo(bar) + # method(argument) # - # there would be an arg_paren node around the args_add_block node that - # represents the set of arguments being sent to the foo method. The args child - # node can be nil if no arguments were passed, as in: + # In the example above, there would be an ArgParen node around the + # ArgsAddBlock node that represents the set of arguments being sent to the + # method method. The argument child node can be +nil+ if no arguments were + # passed, as in: # - # foo() + # method() # - def on_arg_paren(args) - beging = find_scanner_event(:@lparen) - rparen = find_scanner_event(:@rparen) + class ArgParen + # [nil | Args | ArgsAddBlock | ArgsForward] the arguments inside the + # parentheses + attr_reader :arguments + + # [Location] the location of this node + attr_reader :location + + def initialize(arguments:, location:) + @arguments = arguments + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('arg_paren') + q.breakable + q.pp(arguments) + end + end + + def to_json(*opts) + { type: :arg_paren, args: arguments, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_arg_paren: ( + # (nil | Args | ArgsAddBlock | ArgsForward) arguments + # ) -> ArgParen + def on_arg_paren(arguments) + lparen = find_scanner_event(LParen) + rparen = find_scanner_event(RParen) # If the arguments exceed the ending of the parentheses, then we know we # have a heredoc in the arguments, and we need to use the bounds of the # arguments to determine how large the arg_paren is. ending = - (args && args[:loc].end_line > rparen[:loc].end_line) ? args : rparen + if arguments && arguments.location.end_line > rparen.location.end_line + arguments + else + rparen + end - { type: :arg_paren, args: args, loc: beging[:loc].to(ending[:loc]) } + ArgParen.new( + arguments: arguments, + location: lparen.location.to(ending.location) + ) + end + + # Args represents a list of arguments being passed to a method call or array + # literal. + # + # method(first, second, third) + # + class Args + # Array[untyped] the arguments that this node wraps + attr_reader :parts + + # [Location] the location of this node + attr_reader :location + + def initialize(parts:, location:) + @parts = parts + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('args') + q.breakable + q.group(2, '(', ')') { q.seplist(parts) { |part| q.pp(part) } } + end + end + + def to_json(*opts) + { type: :args, parts: parts, loc: location }.to_json(*opts) + end end - # args_add is a parser event that represents a single argument inside a list - # of arguments to any method call or an array. It accepts as arguments the - # parent args node as well as an arg which can be anything that could be - # passed as an argument. - def on_args_add(args, arg) - if args[:type] == :args_add_star + # :call-seq: + # on_args_add: ((Args | ArgsAddStar) arguments, untyped argument) -> Args + def on_args_add(arguments, argument) + if arguments.is_a?(ArgsAddStar) # If we're adding an argument after a splatted argument, then it's going # to come in through this path. - { type: :args, parts: [args, arg], loc: args[:loc].to(arg[:loc]) } - elsif args[:parts].empty? + Args.new( + parts: [arguments, argument], + location: arguments.location.to(argument.location) + ) + elsif arguments.parts.empty? # If this is the first argument being passed into the list of arguments, # then we're going to use the bounds of the argument to override the # parent node's location since this will be more accurate. - { type: :args, parts: [arg], loc: arg[:loc] } + Args.new(parts: [argument], location: argument.location) else # Otherwise we're going to update the existing list with the argument # being added as well as the new end bounds. - { - type: args[:type], - parts: args[:parts] << arg, - loc: args[:loc].to(arg[:loc]) - } + Args.new( + parts: arguments.parts << argument, + location: arguments.location.to(argument.location) + ) end end - # args_add_block is a parser event that represents a list of arguments and - # potentially a block argument. If no block is passed, then the second - # argument will be the literal false. - def on_args_add_block(args, block) - ending = block || args + # ArgsAddBlock represents a list of arguments and potentially a block + # argument. ArgsAddBlock is commonly seen being passed to any method where you + # use parentheses (wrapped in an ArgParen node). It’s also used to pass + # arguments to the various control-flow keywords like +return+. + # + # method(argument, &block) + # + class ArgsAddBlock + # [Args | ArgsAddStar] the arguments before the optional block + attr_reader :arguments - { - type: :args_add_block, - args: args, - block: block || nil, - loc: args[:loc].to(ending[:loc]) - } - end + # [nil | untyped] the optional block argument + attr_reader :block - # args_add_star is a parser event that represents adding a splat of values - # to a list of arguments. If accepts as arguments the parent args node as - # well as the part that is being splatted. - def on_args_add_star(args, star) - beging = find_scanner_event(:@op, '*') - ending = star || beging + # [Location] the location of this node + attr_reader :location - { - type: :args_add_star, - args: args, - star: star, - loc: beging[:loc].to(ending[:loc]) - } - end + def initialize(arguments:, block:, location:) + @arguments = arguments + @block = block + @location = location + end - # args_forward is a parser event that represents forwarding all kinds of - # arguments onto another method call. - def on_args_forward - keyword = find_scanner_event(:@op, '...') + def pretty_print(q) + q.group(2, '(', ')') do + q.text('args_add_block') + q.breakable + q.pp(arguments) + q.breakable + q.pp(block) + end + end - { type: :args_forward, value: keyword[:value], loc: keyword[:loc] } + def to_json(*opts) + { + type: :args_add_block, + args: arguments, + block: block, + loc: location + }.to_json(*opts) + end end - # args_new is a parser event that represents the beginning of a list of - # arguments to any method call or an array. It can be followed by any - # number of args_add events, which we'll append onto an array body. - def on_args_new - { - type: :args, - parts: [], - loc: Location.fixed(line: lineno, char: char_pos) - } + # :call-seq: + # on_args_add_block: ( + # (Args | ArgsAddStar) arguments, + # (false | untyped) block + # ) -> ArgsAddBlock + def on_args_add_block(arguments, block) + ending = block || arguments + + ArgsAddBlock.new( + arguments: arguments, + block: block || nil, + location: arguments.location.to(ending.location) + ) end - # Array nodes can contain a myriad of subnodes because of the special - # array literal syntax like %w and %i. As a result, we may be looking for - # an left bracket, or we may be just looking at the children to get the - # bounds. - def on_array(contents) - if !contents || %i[args args_add_star].include?(contents[:type]) - beging = find_scanner_event(:@lbracket) - ending = find_scanner_event(:@rbracket) + # ArgsAddStar represents adding a splat of values to a list of arguments. + # + # method(prefix, *arguments, suffix) + # + class ArgsAddStar + # [Args | ArgsAddStar] the arguments before the starred argument + attr_reader :arguments - { type: :array, cnts: contents, loc: beging[:loc].to(ending[:loc]) } - else - ending = find_scanner_event(:@tstring_end) - contents[:loc] = contents[:loc].to(ending[:loc]) + # [untyped] the expression being starred + attr_reader :star + + # [Location] the location of this node + attr_reader :location - { type: :array, cnts: contents, loc: contents[:loc] } + def initialize(arguments:, star:, location:) + @arguments = arguments + @star = star + @location = location end - end - # aryptn is a parser event that represents matching against an array pattern - # using the Ruby 2.7+ pattern matching syntax. - def on_aryptn(constant, reqs, rest, posts) - pieces = [constant, *reqs, rest, *posts].compact + def pretty_print(q) + q.group(2, '(', ')') do + q.text('args_add_star') + q.breakable + q.pp(arguments) + q.breakable + q.pp(star) + end + end - { - type: :aryptn, - constant: constant, - reqs: reqs || [], - rest: rest, - posts: posts || [], - loc: pieces[0][:loc].to(pieces[-1][:loc]) - } + def to_json(*opts) + { + type: :args_add_star, + args: arguments, + star: star, + loc: location + }.to_json(*opts) + end end - # assign is a parser event that represents assigning something to a - # variable or constant. It accepts as arguments the left side of the - # expression before the equals sign and the right side of the expression. - def on_assign(target, value) - { - type: :assign, - target: target, - value: value, - loc: target[:loc].to(value[:loc]) - } - end + # :call-seq: + # on_args_add_star: ( + # (Args | ArgsAddStar) arguments, + # untyped star + # ) -> ArgsAddStar + def on_args_add_star(arguments, star) + beginning = find_scanner_event(Op, '*') + ending = star || beginning - # assoc_new is a parser event that contains a key-value pair within a - # hash. It is a child event of either an assoclist_from_args or a - # bare_assoc_hash. - def on_assoc_new(key, value) - { type: :assoc_new, key: key, value: value, loc: key[:loc].to(value[:loc]) } + ArgsAddStar.new( + arguments: arguments, + star: star, + location: beginning.location.to(ending.location) + ) end - # assoc_splat is a parser event that represents splatting a value into a - # hash (either a hash literal or a bare hash in a method call). - def on_assoc_splat(value) - operator = find_scanner_event(:@op, '**') + # ArgsForward represents forwarding all kinds of arguments onto another method + # call. + # + # def request(method, path, **headers, &block); end + # + # def get(...) + # request(:GET, ...) + # end + # + # def post(...) + # request(:POST, ...) + # end + # + # In the example above, both the get and post methods are forwarding all of + # their arguments (positional, keyword, and block) on to the request method. + # The ArgsForward node appears in both the caller (the request method calls) + # and the callee (the get and post definitions). + class ArgsForward + # [String] the value of the operator + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end - { type: :assoc_splat, value: value, loc: operator[:loc].to(value[:loc]) } - end + def pretty_print(q) + q.group(2, '(', ')') do + q.text('args_forward') + q.breakable + q.pp(value) + end + end - # assoclist_from_args is a parser event that contains a list of all of the - # associations inside of a hash literal. Its parent node is always a hash. - # It accepts as an argument an array of assoc events (either assoc_new or - # assoc_splat). - def on_assoclist_from_args(assocs) - { - type: :assoclist_from_args, - assocs: assocs, - loc: assocs[0][:loc].to(assocs[-1][:loc]) - } + def to_json(*opts) + { type: :args_forward, value: value, loc: location }.to_json(*opts) + end end - # backref is a scanner event that represents a global variable referencing a - # matched value. It comes in the form of a $ followed by a positive integer. - def on_backref(value) - node = { - type: :@backref, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + # :call-seq: + # on_args_forward: () -> ArgsForward + def on_args_forward + op = find_scanner_event(Op, '...') - scanner_events << node - node + ArgsForward.new(value: op.value, location: op.location) end - # backtick is a scanner event that represents the use of the ` operator. It's - # usually found being used for an xstring, but could also be found as the name - # of a method being defined. - def on_backtick(value) - node = { - type: :@backtick, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } - - scanner_events << node - node + # :call-seq: + # on_args_new: () -> Args + def on_args_new + Args.new(parts: [], location: Location.fixed(line: lineno, char: char_pos)) end - # bare_assoc_hash is a parser event that represents a hash of contents - # being passed as a method argument (and therefore has omitted braces). It - # accepts as an argument an array of assoc events (either assoc_new or - # assoc_splat). - def on_bare_assoc_hash(assocs) - { - type: :bare_assoc_hash, - assocs: assocs, - loc: assocs[0][:loc].to(assocs[-1][:loc]) - } - end + # ArrayLiteral represents any form of an array literal, and contains myriad + # child nodes because of the special array literal syntax like %w and %i. + # + # [] + # [one, two, three] + # [*one_two_three] + # %i[one two three] + # %w[one two three] + # %I[one two three] + # %W[one two three] + # + # Every line in the example above produces an ArrayLiteral node. In order, the + # child contents node of this ArrayLiteral node would be nil, Args, + # ArgsAddStar, QSymbols, QWords, Symbols, and Words. + class ArrayLiteral + # [nil | Args | ArgsAddStar | Qsymbols | Qwords | Symbols | Words] the + # contents of the array + attr_reader :contents + + # [Location] the location of this node + attr_reader :location + + def initialize(contents:, location:) + @contents = contents + @location = location + end - # begin is a parser event that represents the beginning of a begin..end chain. - # It includes a bodystmt event that has all of the consequent clauses. - def on_begin(bodystmt) - beging = find_scanner_event(:@kw, 'begin') - end_char = - if bodystmt[:rsc] || bodystmt[:ens] || bodystmt[:els] - bodystmt[:loc].end_char - else - find_scanner_event(:@kw, 'end')[:loc].end_char + def pretty_print(q) + q.group(2, '(', ')') do + q.text('array') + q.breakable + q.pp(contents) end + end + + def to_json(*opts) + { type: :array, cnts: contents, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_array: ( + # (nil | Args | ArgsAddStar | Qsymbols | Qwords | Symbols | Words) + # contents + # ) -> ArrayLiteral + def on_array(contents) + if !contents || contents.is_a?(Args) || contents.is_a?(ArgsAddStar) + lbracket = find_scanner_event(LBracket) + rbracket = find_scanner_event(RBracket) - bodystmt.bind(beging[:loc].end_char, end_char) + ArrayLiteral.new( + contents: contents, + location: lbracket.location.to(rbracket.location) + ) + else + tstring_end = find_scanner_event(TStringEnd) + contents = + contents.class.new( + elements: contents.elements, + location: contents.location.to(tstring_end.location) + ) - { type: :begin, bodystmt: bodystmt, loc: beging[:loc].to(bodystmt[:loc]) } + ArrayLiteral.new(contents: contents, location: contents.location) + end end - # binary is a parser event that represents a binary operation between two - # values. - def on_binary(left, operator, right) - # On most Ruby implementations, operator is a Symbol that represents that - # operation being performed. For instance in the example `1 < 2`, the - # `operator` object would be `:<`. However, on JRuby, it's an `@op` node, - # so here we're going to explicitly convert it into the same normalized - # form. - unless operator.is_a?(Symbol) - operator = scanner_events.delete(operator)[:value] + # AryPtn represents matching against an array pattern using the Ruby 2.7+ + # pattern matching syntax. It’s one of the more complicated nodes, because + # the four parameters that it accepts can almost all be nil. + # + # case [1, 2, 3] + # in [Integer, Integer] + # "matched" + # in Container[Integer, Integer] + # "matched" + # in [Integer, *, Integer] + # "matched" + # end + # + # An AryPtn node is created with four parameters: an optional constant + # wrapper, an array of positional matches, an optional splat with identifier, + # and an optional array of positional matches that occur after the splat. + # All of the in clauses above would create an AryPtn node. + class AryPtn + # [nil | VarRef] the optional constant wrapper + attr_reader :constant + + # [Array[untyped]] the regular positional arguments that this array pattern + # is matching against + attr_reader :requireds + + # [nil | VarField] the optional starred identifier that grabs up a list of + # positional arguments + attr_reader :rest + + # [Array[untyped]] the list of positional arguments occurring after the + # optional star if there is one + attr_reader :posts + + # [Location] the location of this node + attr_reader :location + + def initialize(constant:, requireds:, rest:, posts:, location:) + @constant = constant + @requireds = requireds + @rest = rest + @posts = posts + @location = location end - { - type: :binary, - left: left, - operator: operator, - right: right, - loc: left[:loc].to(right[:loc]) - } - end + def pretty_print(q) + q.group(2, '(', ')') do + q.text('aryptn') - # block_var is a parser event that represents the parameters being passed to - # block. Effectively they're everything contained within the pipes. - def on_block_var(params, locals) - index = - scanner_events.rindex do |event| - event[:type] == :@op && %w[| ||].include?(event[:value]) && - event[:loc].start_char < params[:loc].start_char - end + if constant + q.breakable + q.pp(constant) + end - beging = scanner_events[index] - ending = scanner_events[-1] + if requireds.any? + q.breakable + q.group(2, '(', ')') do + q.seplist(requireds) { |required| q.pp(required) } + end + end - { - type: :block_var, - params: params, - locals: locals || [], - loc: beging[:loc].to(ending[:loc]) - } + if rest + q.breakable + q.pp(rest) + end + + if posts.any? + q.breakable + q.group(2, '(', ')') { q.seplist(posts) { |post| q.pp(post) } } + end + end + end + + def to_json(*opts) + { + type: :aryptn, + constant: constant, + reqs: requireds, + rest: rest, + posts: posts, + loc: location + }.to_json(*opts) + end end - # blockarg is a parser event that represents defining a block variable on - # a method definition. - def on_blockarg(name) - operator = find_scanner_event(:@op, '&') + # :call-seq: + # on_aryptn: ( + # (nil | VarRef) constant, + # (nil | Array[untyped]) requireds, + # (nil | VarField) rest, + # (nil | Array[untyped]) posts + # ) -> AryPtn + def on_aryptn(constant, requireds, rest, posts) + parts = [constant, *requireds, rest, *posts].compact - { type: :blockarg, name: name, loc: operator[:loc].to(name[:loc]) } + AryPtn.new( + constant: constant, + requireds: requireds || [], + rest: rest, + posts: posts || [], + location: parts[0].location.to(parts[-1].location) + ) end - # bodystmt can't actually determine its bounds appropriately because it - # doesn't necessarily know where it started. So the parent node needs to - # report back down into this one where it goes. - class BodyStmt < Node - def bind(start_char, end_char) - value[:loc] = - Location.new( - start_line: value[:loc].start_line, - start_char: start_char, - end_line: value[:loc].end_line, - end_char: end_char - ) + # Assign represents assigning something to a variable or constant. Generally, + # the left side of the assignment is going to be any node that ends with the + # name "Field". + # + # variable = value + # + class Assign + # [ArefField | ConstPathField | Field | TopConstField | VarField] the target + # to assign the result of the expression to + attr_reader :target - parts = [value[:rsc], value[:ens], value[:els]] + # [untyped] the expression to be assigned + attr_reader :value - # Here we're going to determine the bounds for the stmts - consequent = parts[1..-1].compact.first - value[:stmts].bind( - start_char, - consequent ? consequent[:loc].start_char : end_char - ) + # [Location] the location of this node + attr_reader :location - # Next we're going to determine the rescue clause if there is one - if value[:rsc] - consequent = parts.drop(1).compact.first - value[:rsc].bind_end( - consequent ? consequent[:loc].start_char : end_char - ) + def initialize(target:, value:, location:) + @target = target + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('assign') + q.breakable + q.pp(target) + q.breakable + q.pp(value) end end + + def to_json(*opts) + { type: :assign, target: target, value: value, loc: location }.to_json( + *opts + ) + end end - # bodystmt is a parser event that represents all of the possible combinations - # of clauses within the body of a method or block. - def on_bodystmt(stmts, rescued, elsed, ensured) - BodyStmt.new( - self, - type: :bodystmt, - stmts: stmts, - rsc: rescued, - els: elsed, - ens: ensured, - loc: Location.fixed(line: lineno, char: char_pos) + # :call-seq: + # on_assign: ( + # (ArefField | ConstPathField | Field | TopConstField | VarField) target, + # untyped value + # ) -> Assign + def on_assign(target, value) + Assign.new( + target: target, + value: value, + location: target.location.to(value.location) ) end - # brace_block is a parser event that represents passing a block to a - # method call using the {..} operators. It accepts as arguments an - # optional block_var event that represents any parameters to the block as - # well as a stmts event that represents the statements inside the block. - def on_brace_block(block_var, stmts) - beging = find_scanner_event(:@lbrace) - ending = find_scanner_event(:@rbrace) + # AssocNew represents a key-value pair within a hash. It is a child node of + # either an AssocListFromArgs or a BareAssocHash. + # + # { key1: value1, key2: value2 } + # + # In the above example, the would be two AssocNew nodes. + class AssocNew + # [untyped] the key of this pair + attr_reader :key - stmts.bind( - find_next_statement_start((block_var || beging)[:loc].end_char), - ending[:loc].start_char - ) + # [untyped] the value of this pair + attr_reader :value - { - type: :brace_block, - lbrace: beging, - block_var: block_var, - stmts: stmts, - loc: - Location.new( - start_line: beging[:loc].start_line, - start_char: beging[:loc].start_char, - end_line: [ending[:loc].end_line, stmts[:loc].end_line].max, - end_char: ending[:loc].end_char - ) - } - end + # [Location] the location of this node + attr_reader :location - # break is a parser event that represents using the break keyword. It - # accepts as an argument an args or args_add_block event that contains all - # of the arguments being passed to the break. - def on_break(args) - keyword = find_scanner_event(:@kw, 'break') - location = - if args[:type] == :args - # You can hit this if you are passing no arguments to break but it has a - # comment right after it. In that case we can just use the location - # information straight from the keyword. - keyword[:loc] - else - keyword[:loc].to(args[:loc]) + def initialize(key:, value:, location:) + @key = key + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('assoc_new') + q.breakable + q.pp(key) + q.breakable + q.pp(value) end + end + + def to_json(*opts) + { type: :assoc_new, key: key, value: value, loc: location }.to_json(*opts) + end + end - { type: :break, args: args, loc: location } + # :call-seq: + # on_assoc_new: (untyped key, untyped value) -> AssocNew + def on_assoc_new(key, value) + AssocNew.new( + key: key, + value: value, + location: key.location.to(value.location) + ) end - # call is a parser event representing a method call with no arguments. It - # accepts as arguments the receiver of the method, the operator being used - # to send the method (., ::, or &.), and the value that is being sent to - # the receiver (which can be another nested call as well). - # - # There is one esoteric syntax that comes into play here as well. If the - # message argument to this method is the symbol :call, then it represents - # calling a lambda in a very odd looking way, as in: + # AssocSplat represents double-splatting a value into a hash (either a hash + # literal or a bare hash in a method call). # - # foo.(1, 2, 3) + # { **pairs } # - def on_call(receiver, operator, message) - ending = message + class AssocSplat + # [untyped] the expression that is being splatted + attr_reader :value - if message == :call - ending = operator + # [Location] the location of this node + attr_reader :location - # Special handling here for Ruby <= 2.5 because the operator argument to - # this method wasn't a parser event here it was just a plain symbol. - ending = receiver if RUBY_MAJOR <= 2 && RUBY_MINOR <= 5 + def initialize(value:, location:) + @value = value + @location = location end - { - type: :call, - receiver: receiver, - operator: operator, - message: message, - loc: - Location.new( - start_line: receiver[:loc].start_line, - start_char: receiver[:loc].start_char, - end_line: [ending[:loc].end_line, receiver[:loc].end_line].max, - end_char: ending[:loc].end_char - ) - } - end + def pretty_print(q) + q.group(2, '(', ')') do + q.text('assoc_splat') + q.breakable + q.pp(value) + end + end - # case is a parser event that represents the beginning of a case chain. - # It accepts as arguments the switch of the case and the consequent - # clause. - def on_case(value, consequent) - if keyword = find_scanner_event(:@kw, 'case', consume: false) - scanner_events.delete(keyword) + def to_json(*opts) + { type: :assoc_splat, value: value, loc: location }.to_json(*opts) + end + end - { - type: :case, - value: value, - cons: consequent, - loc: keyword[:loc].to(consequent[:loc]) - } - else - operator = - find_scanner_event(:@kw, 'in', consume: false) || - find_scanner_event(:@op, '=>') + # :call-seq: + # on_assoc_splat: (untyped value) -> AssocSplat + def on_assoc_splat(value) + operator = find_scanner_event(Op, '**') - { - type: :rassign, - value: value, - operator: operator, - pattern: consequent, - loc: value[:loc].to(consequent[:loc]) - } - end + AssocSplat.new(value: value, location: operator.location.to(value.location)) end - # class is a parser event that represents defining a class. It accepts as - # arguments the name of the class, the optional name of the superclass, - # and the bodystmt event that represents the statements evaluated within - # the context of the class. - def on_class(constant, superclass, bodystmt) - beging = find_scanner_event(:@kw, 'class') - ending = find_scanner_event(:@kw, 'end') + # AssocListFromArgs represents the key-value pairs of a hash literal. Its + # parent node is always a hash. + # + # { key1: value1, key2: value2 } + # + class AssocListFromArgs + # [Array[AssocNew | AssocSplat]] + attr_reader :assocs - bodystmt.bind( - find_next_statement_start((superclass || constant)[:loc].end_char), - ending[:loc].start_char - ) + # [Location] the location of this node + attr_reader :location - { - type: :class, - constant: constant, - superclass: superclass, - bodystmt: bodystmt, - loc: beging[:loc].to(ending[:loc]) - } - end + def initialize(assocs:, location:) + @assocs = assocs + @location = location + end - # comma is a scanner event that represents the use of the comma operator. - def on_comma(value) - node = { - type: :@comma, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + def pretty_print(q) + q.group(2, '(', ')') do + q.text('assoclist_from_args') + q.breakable + q.group(2, '(', ')') { q.seplist(assocs) { |assoc| q.pp(assoc) } } + end + end - scanner_events << node - node + def to_json(*opts) + { type: :assoclist_from_args, assocs: assocs, loc: location }.to_json( + *opts + ) + end end - # command is a parser event representing a method call with arguments and - # no parentheses. It accepts as arguments the name of the method and the - # arguments being passed to the method. - def on_command(message, args) - { - type: :command, - message: message, - args: args, - loc: message[:loc].to(args[:loc]) - } + # :call-seq: + # on_assoclist_from_args: ( + # Array[AssocNew | AssocSplat] assocs + # ) -> AssocListFromArgs + def on_assoclist_from_args(assocs) + AssocListFromArgs.new( + assocs: assocs, + location: assocs[0].location.to(assocs[-1].location) + ) end - # command_call is a parser event representing a method call on an object - # with arguments and no parentheses. It accepts as arguments the receiver - # of the method, the operator being used to send the method, the name of - # the method, and the arguments being passed to the method. - def on_command_call(receiver, operator, message, args) - ending = args || message + # Backref represents a global variable referencing a matched value. It comes + # in the form of a $ followed by a positive integer. + # + # $1 + # + class Backref + # [String] the name of the global backreference variable + attr_reader :value - { - type: :command_call, - receiver: receiver, - operator: operator, - message: message, - args: args, - loc: receiver[:loc].to(ending[:loc]) - } - end + # [Location] the location of this node + attr_reader :location - # We keep track of each comment as it comes in and then eventually add - # them to the top of the generated AST so that prettier can start adding - # them back into the final representation. Comments come in including - # their starting pound sign and the newline at the end, so we also chop - # those off. - def on_comment(value) - # If there is an encoding magic comment at the top of the file, ripper - # will actually change into that encoding for the storage of the string. - # This will break everything when we attempt to print as JSON, so we need to - # force the encoding back into UTF-8 so that it won't break. - body = value[1..-1].chomp.force_encoding('UTF-8') - line = lineno + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('backref') + q.breakable + q.pp(value) + end + end - @comments << { - type: :@comment, - value: body, - inline: value.strip != lines[line - 1], - loc: Location.token(line: line, char: char_pos, size: value.size - 1) - } + def to_json(*opts) + { type: :@backref, value: value, loc: location }.to_json(*opts) + end end - # const is a scanner event that represents a literal value that _looks like_ - # a constant. This could actually be a reference to a constant. It could also - # be something that looks like a constant in another context, as in a method - # call to a capitalized method, a symbol that starts with a capital letter, - # etc. - def on_const(value) - node = { - type: :@const, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + # :call-seq: + # on_backref: (String value) -> Backref + def on_backref(value) + node = + Backref.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) scanner_events << node node end - # A const_path_field is a parser event that is always the child of some - # kind of assignment. It represents when you're assigning to a constant - # that is being referenced as a child of another variable. For example: - # - # foo::X = 1 - # - def on_const_path_field(parent, constant) - { - type: :const_path_field, - parent: parent, - constant: constant, - loc: parent[:loc].to(constant[:loc]) - } - end + # Backtick represents the use of the ` operator. It's usually found being used + # for an XStringLiteral, but could also be found as the name of a method being + # defined. + class Backtick + # [String] the backtick in the string + attr_reader :value - # A const_path_ref is a parser event that is a very similar to - # const_path_field except that it is not involved in an assignment. It - # looks like the following example: foo::Bar, where left is foo and const is - # Bar. - def on_const_path_ref(parent, constant) - { - type: :const_path_ref, - parent: parent, - constant: constant, - loc: parent[:loc].to(constant[:loc]) - } - end + # [Location] the location of this node + attr_reader :location - # A const_ref is a parser event that represents the name of the constant - # being used in a class or module declaration. In the following example it - # is the @const scanner event that has the contents of Foo. - # - # class Foo; end - # - def on_const_ref(constant) - { type: :const_ref, constant: constant, loc: constant[:loc] } + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('backtick') + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@backtick, value: value, loc: location }.to_json(*opts) + end end - # cvar is a scanner event that represents the use of a class variable. - def on_cvar(value) - node = { - type: :@cvar, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + # :call-seq: + # on_backtick: (String value) -> Backtick + def on_backtick(value) + node = + Backtick.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) scanner_events << node node end - # A def is a parser event that represents defining a regular method on the - # current self object. It accepts as arguments the name (the name of the - # method being defined), the params (the parameter declaration for the - # method), and a bodystmt node which represents the statements inside the - # method. As an example, here are the parts that go into this: + # BareAssocHash represents a hash of contents being passed as a method + # argument (and therefore has omitted braces). It's very similar to an + # AssocListFromArgs node. # - # def foo(bar) do baz end - # │ │ │ - # │ │ └> bodystmt - # │ └> params - # └> name + # method(key1: value1, key2: value2) # - # You can also have single-line methods since Ruby 3.0+, which have slightly - # different syntax but still flow through this method. Those look like: - # - # def foo = bar - # | | - # | └> stmt - # └> name - # - def on_def(name, params, bodystmt) - # Make sure to delete this scanner event in case you're defining something - # like def class which would lead to this being a kw and causing all kinds - # of trouble - scanner_events.delete(name) - - # Find the beginning of the method definition, which works for single-line - # and normal method definitions. - beging = find_scanner_event(:@kw, 'def') + class BareAssocHash + # [Array[AssocNew | AssocSplat]] + attr_reader :assocs - # If we don't have a bodystmt node, then we have a single-line method - if bodystmt[:type] != :bodystmt - defsl = { - type: :defsl, - name: name, - paren: params, - stmt: bodystmt, - loc: beging[:loc].to(bodystmt[:loc]) - } + # [Location] the location of this node + attr_reader :location - return defsl + def initialize(assocs:, location:) + @assocs = assocs + @location = location end - # If there aren't any params then we need to correct the params node - # location information - if params[:type] == :params && empty_params?(params) - location = name[:loc].end_char + def pretty_print(q) + q.group(2, '(', ')') do + q.text('bare_assoc_hash') + q.breakable + q.group(2, '(', ')') { q.seplist(assocs) { |assoc| q.pp(assoc) } } + end + end - params[:loc] = - Location.new( - start_line: params[:loc].start_line, - start_char: location, - end_line: params[:loc].end_line, - end_char: location - ) + def to_json(*opts) + { type: :bare_assoc_hash, assocs: assocs, loc: location }.to_json(*opts) end + end - ending = find_scanner_event(:@kw, 'end') - bodystmt.bind( - find_next_statement_start(params[:loc].end_char), - ending[:loc].start_char + # :call-seq: + # on_bare_assoc_hash: (Array[AssocNew | AssocSplat] assocs) -> BareAssocHash + def on_bare_assoc_hash(assocs) + BareAssocHash.new( + assocs: assocs, + location: assocs[0].location.to(assocs[-1].location) ) - - { - type: :def, - name: name, - params: params, - bodystmt: bodystmt, - loc: beging[:loc].to(ending[:loc]) - } end - # A defs is a parser event that represents defining a singleton method on - # an object. It accepts the same arguments as the def event, as well as - # the target and operator that on which this method is being defined. As - # an example, here are the parts that go into this: + # Begin represents a begin..end chain. # - # def foo.bar(baz) do baz end - # │ │ │ │ │ - # │ │ │ │ │ - # │ │ │ │ └> bodystmt - # │ │ │ └> params - # │ │ └> name - # │ └> operator - # └> target + # begin + # value + # end # - def on_defs(target, operator, name, params, bodystmt) - # Make sure to delete this scanner event in case you're defining something - # like def class which would lead to this being a kw and causing all kinds - # of trouble - scanner_events.delete(name) + class Begin + # [BodyStmt] the bodystmt that contains the contents of this begin block + attr_reader :bodystmt - # If there aren't any params then we need to correct the params node - # location information - if params[:type] == :params && empty_params?(params) - location = name[:loc].end_char + # [Location] the location of this node + attr_reader :location - params[:loc] = - Location.new( - start_line: params[:loc].start_line, - start_char: location, - end_line: params[:loc].end_line, - end_char: location - ) + def initialize(bodystmt:, location:) + @bodystmt = bodystmt + @location = location end - beging = find_scanner_event(:@kw, 'def') - ending = find_scanner_event(:@kw, 'end') - - bodystmt.bind( - find_next_statement_start(params[:loc].end_char), - ending[:loc].start_char - ) + def pretty_print(q) + q.group(2, '(', ')') do + q.text('begin') + q.breakable + q.pp(bodystmt) + end + end - { - type: :defs, - target: target, - operator: operator, - name: name, - params: params, - bodystmt: bodystmt, - loc: beging[:loc].to(ending[:loc]) - } + def to_json(*opts) + { type: :begin, bodystmt: bodystmt, loc: location }.to_json(*opts) + end end - # A defined node represents the rather unique defined? operator. It can be - # used with and without parentheses. If they're present, we use them to - # determine our bounds, otherwise we use the value that's being passed to - # the operator. - def on_defined(value) - beging = find_scanner_event(:@kw, 'defined?') + # :call-seq: + # on_begin: (BodyStmt bodystmt) -> Begin + def on_begin(bodystmt) + keyword = find_scanner_event(Kw, 'begin') + end_char = + if bodystmt.rescue_clause || bodystmt.ensure_clause || + bodystmt.else_clause + bodystmt.location.end_char + else + find_scanner_event(Kw, 'end').location.end_char + end - paren = source[beging[:loc].end_char...value[:loc].start_char].include?('(') - ending = paren ? find_scanner_event(:@rparen) : value + bodystmt.bind(keyword.location.end_char, end_char) - { type: :defined, value: value, loc: beging[:loc].to(ending[:loc]) } + Begin.new( + bodystmt: bodystmt, + location: keyword.location.to(bodystmt.location) + ) end - # do_block is a parser event that represents passing a block to a method - # call using the do..end keywords. It accepts as arguments an optional - # block_var event that represents any parameters to the block as well as - # a bodystmt event that represents the statements inside the block. - def on_do_block(block_var, bodystmt) - beging = find_scanner_event(:@kw, 'do') - ending = find_scanner_event(:@kw, 'end') - - bodystmt.bind( - find_next_statement_start((block_var || beging)[:loc].end_char), - ending[:loc].start_char - ) + # Binary represents any expression that involves two sub-expressions with an + # operator in between. This can be something that looks like a mathematical + # operation: + # + # 1 + 1 + # + # but can also be something like pushing a value onto an array: + # + # array << value + # + class Binary + # [untyped] the left-hand side of the expression + attr_reader :left - { - type: :do_block, - keyword: beging, - block_var: block_var, - bodystmt: bodystmt, - loc: beging[:loc].to(ending[:loc]) - } - end + # [String] the operator used between the two expressions + attr_reader :operator - # dot2 is a parser event that represents using the .. operator between two - # expressions. Usually this is to create a range object but sometimes it's to - # use the flip-flop operator. - def on_dot2(left, right) - operator = find_scanner_event(:@op, '..') + # [untyped] the right-hand side of the expression + attr_reader :right - beging = left || operator - ending = right || operator + # [Location] the location of this node + attr_reader :location - { - type: :dot2, - left: left, - right: right, - loc: beging[:loc].to(ending[:loc]) - } - end + def initialize(left:, operator:, right:, location:) + @left = left + @operator = operator + @right = right + @location = location + end - # dot3 is a parser event that represents using the ... operator between two - # expressions. Usually this is to create a range object but sometimes it's to - # use the flip-flop operator. - def on_dot3(left, right) - operator = find_scanner_event(:@op, '...') + def pretty_print(q) + q.group(2, '(', ')') do + q.text('binary') + q.breakable + q.pp(left) + q.breakable + q.text(operator) + q.breakable + q.pp(right) + end + end - beging = left || operator - ending = right || operator + def to_json(*opts) + { + type: :binary, + left: left, + operator: operator, + right: right, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_binary: (untyped left, (Op | Symbol) operator, untyped right) -> Binary + def on_binary(left, operator, right) + # On most Ruby implementations, operator is a Symbol that represents that + # operation being performed. For instance in the example `1 < 2`, the + # `operator` object would be `:<`. However, on JRuby, it's an `@op` node, + # so here we're going to explicitly convert it into the same normalized + # form. + unless operator.is_a?(Symbol) + operator = scanner_events.delete(operator).value + end - { - type: :dot3, + Binary.new( left: left, + operator: operator, right: right, - loc: beging[:loc].to(ending[:loc]) - } + location: left.location.to(right.location) + ) end - # A dyna_symbol is a parser event that represents a symbol literal that - # uses quotes to interpolate its value. For example, if you had a variable - # foo and you wanted a symbol that contained its value, you would write: - # - # :"#{foo}" + # BlockVar represents the parameters being declared for a block. Effectively + # this node is everything contained within the pipes. This includes all of the + # various parameter types, as well as block-local variable declarations. # - # As such, they accept as one argument a string node, which is the same - # node that gets accepted into a string_literal (since we're basically - # talking about a string literal with a : character at the beginning). - # - # They can also come in another flavor which is a dynamic symbol as a hash - # key. This is kind of an interesting syntax which results in us having to - # look for a @label_end scanner event instead to get our bearings. That - # kind of code would look like: - # - # { "#{foo}": bar } + # method do |positional, optional = value, keyword:, █ local| + # end # - # which would be the same symbol as above. - def on_dyna_symbol(string) - if find_scanner_event(:@symbeg, consume: false) - # A normal dynamic symbol - beging = find_scanner_event(:@symbeg) - ending = find_scanner_event(:@tstring_end) + class BlockVar + # [Params] the parameters being declared with the block + attr_reader :params - { - type: :dyna_symbol, - quote: beging[:value], - parts: string[:parts], - loc: beging[:loc].to(ending[:loc]) - } - else - # A dynamic symbol as a hash key - beging = find_scanner_event(:@tstring_beg) - ending = find_scanner_event(:@label_end) + # [Array[Ident]] the list of block-local variable declarations + attr_reader :locals + + # [Location] the location of this node + attr_reader :location + + def initialize(params:, locals:, location:) + @params = params + @locals = locals + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('block_var') + q.breakable + q.pp(params) + + if locals.any? + q.breakable + q.group(2, '(', ')') { q.seplist(locals) { |local| q.pp(local) } } + end + end + end + def to_json(*opts) { - type: :dyna_symbol, - parts: string[:parts], - quote: ending[:value][0], - loc: beging[:loc].to(ending[:loc]) - } + type: :block_var, + params: params, + locals: locals, + loc: location + }.to_json(*opts) end end - # else is a parser event that represents the end of a if, unless, or begin - # chain. It accepts as an argument the statements that are contained - # within the else clause. - def on_else(stmts) - beging = find_scanner_event(:@kw, 'else') - - # else can either end with an end keyword (in which case we'll want to - # consume that event) or it can end with an ensure keyword (in which case - # we'll leave that to the ensure to handle). + # :call-seq: + # on_block_var: (Params params, (nil | Array[Ident]) locals) -> BlockVar + def on_block_var(params, locals) index = - scanner_events.rindex do |event| - event[:type] == :@kw && %w[end ensure].include?(event[:value]) + scanner_events.rindex do |node| + node.is_a?(Op) && %w[| ||].include?(node.value) && + node.location.start_char < params.location.start_char end - event = scanner_events[index] - ending = event[:value] == 'end' ? scanner_events.delete_at(index) : event - - stmts.bind(beging[:loc].end_char, ending[:loc].start_char) + beginning = scanner_events[index] + ending = scanner_events[-1] - { type: :else, stmts: stmts, loc: beging[:loc].to(ending[:loc]) } + BlockVar.new( + params: params, + locals: locals || [], + location: beginning.location.to(ending.location) + ) end - # elsif is a parser event that represents another clause in an if chain. - # It accepts as arguments the predicate of the else if, the statements - # that are contained within the else if clause, and the optional - # consequent clause. - def on_elsif(predicate, stmts, consequent) - beging = find_scanner_event(:@kw, 'elsif') - ending = consequent || find_scanner_event(:@kw, 'end') + # BlockArg represents declaring a block parameter on a method definition. + # + # def method(&block); end + # + class BlockArg + # [Ident] the name of the block argument + attr_reader :name + + # [Location] the location of this node + attr_reader :location - stmts.bind(predicate[:loc].end_char, ending[:loc].start_char) + def initialize(name:, location:) + @name = name + @location = location + end - { - type: :elsif, - pred: predicate, - stmts: stmts, - cons: consequent, - loc: beging[:loc].to(ending[:loc]) - } - end + def pretty_print(q) + q.group(2, '(', ')') do + q.text('blockarg') + q.breakable + q.pp(name) + end + end - # This is a scanner event that gets hit when we're inside an embdoc and - # receive a new line of content. Here we are guaranteed to already have - # initialized the @embdoc variable so we can just append the new line onto - # the existing content. - def on_embdoc(value) - @embdoc[:value] << value + def to_json(*opts) + { type: :blockarg, name: name, loc: location }.to_json(*opts) + end end - # embdocs are long comments that are surrounded by =begin..=end. They - # cannot be nested, so we don't need to worry about keeping a stack around - # like we do with heredocs. Instead we can just track the current embdoc - # and add to it as we get content. It always starts with this scanner - # event, so here we'll initialize the current embdoc. - def on_embdoc_beg(value) - @embdoc = { - type: :@embdoc, - value: value, - loc: Location.fixed(line: lineno, char: char_pos) - } - end + # :call-seq: + # on_blockarg: (Ident name) -> BlockArg + def on_blockarg(name) + operator = find_scanner_event(Op, '&') - # This is the final scanner event for embdocs. It receives the =end. Here - # we can finalize the embdoc with its location information and the final - # piece of the string. We then add it to the list of comments so that - # prettier can place it into the final source string. - def on_embdoc_end(value) - location = @embdoc[:loc] + BlockArg.new(name: name, location: operator.location.to(name.location)) + end - @comments << { - type: :@embdoc, - value: @embdoc[:value] << value.chomp, - loc: - Location.new( - start_line: location.start_line, - start_char: location.start_char, - end_line: lineno, - end_char: char_pos + value.length - 1 - ) - } + # bodystmt can't actually determine its bounds appropriately because it + # doesn't necessarily know where it started. So the parent node needs to + # report back down into this one where it goes. + class BodyStmt + # [Statements] the list of statements inside the begin clause + attr_reader :statements - @embdoc = nil - end + # [nil | Rescue] the optional rescue chain attached to the begin clause + attr_reader :rescue_clause - # embexpr_beg is a scanner event that represents using interpolation inside of - # a string, xstring, heredoc, or regexp. Its value is the string literal "#{". - def on_embexpr_beg(value) - node = { - type: :@embexpr_beg, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + # [nil | Statements] the optional set of statements inside the else clause + attr_reader :else_clause - scanner_events << node - node - end + # [nil | Ensure] the optional ensure clause + attr_reader :ensure_clause - # embexpr_end is a scanner event that represents the end of an interpolated - # expression in a string, xstring, heredoc, or regexp. Its value is the string - # literal "}". - def on_embexpr_end(value) - node = { - type: :@embexpr_end, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + # [Location] the location of this node + attr_reader :location - scanner_events << node - node - end + def initialize( + statements:, + rescue_clause:, + else_clause:, + ensure_clause:, + location: + ) + @statements = statements + @rescue_clause = rescue_clause + @else_clause = else_clause + @ensure_clause = ensure_clause + @location = location + end - # embvar is a scanner event that represents the use of shorthand interpolation - # for an instance, class, or global variable into a string, xstring, heredoc, - # or regexp. Its value is the string literal "#". For example, in the - # following snippet: - # - # "#@foo" - # - # the embvar would be triggered by the "#", then an ivar event for the @foo - # instance variable. That would all get bound up into a string_dvar node in - # the final AST. - def on_embvar(value) - node = { - type: :@embvar, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + def bind(start_char, end_char) + @location = + Location.new( + start_line: location.start_line, + start_char: start_char, + end_line: location.end_line, + end_char: end_char + ) - scanner_events << node - node - end + parts = [rescue_clause, else_clause, ensure_clause] - # ensure is a parser event that represents the use of the ensure keyword - # and its subsequent statements. - def on_ensure(stmts) - keyword = find_scanner_event(:@kw, 'ensure') + # Here we're going to determine the bounds for the statements + consequent = parts.compact.first + statements.bind( + start_char, + consequent ? consequent.location.start_char : end_char + ) - # Specifically not using find_scanner_event here because we don't want to - # consume the :@end event, because that would break def..ensure..end chains. - index = - scanner_events.rindex do |scanner_event| - scanner_event[:type] == :@kw && scanner_event[:value] == 'end' + # Next we're going to determine the rescue clause if there is one + if rescue_clause + consequent = parts.drop(1).compact.first + rescue_clause.bind_end( + consequent ? consequent.location.start_char : end_char + ) end + end - ending = scanner_events[index] - stmts.bind( - find_next_statement_start(keyword[:loc].end_char), - ending[:loc].start_char - ) + def pretty_print(q) + q.group(2, '(', ')') do + q.text('bodystmt') + q.breakable + q.pp(statements) + + if rescue_clause + q.breakable + q.pp(rescue_clause) + end - { - type: :ensure, - keyword: keyword, - stmts: stmts, - loc: keyword[:loc].to(ending[:loc]) - } - end + if else_clause + q.breakable + q.pp(else_clause) + end - # An excessed_comma is a special kind of parser event that represents a comma - # at the end of a list of parameters. It's a very strange node. It accepts a - # different number of arguments depending on Ruby version, which is why we - # have the anonymous splat there. - def on_excessed_comma(*) - comma = find_scanner_event(:@comma) + if ensure_clause + q.breakable + q.pp(ensure_clause) + end + end + end - { type: :excessed_comma, value: comma[:value], loc: comma[:loc] } + def to_json(*opts) + { + type: :bodystmt, + stmts: statements, + rsc: rescue_clause, + els: else_clause, + ens: ensure_clause, + loc: location + }.to_json(*opts) + end end - # An fcall is a parser event that represents the piece of a method call - # that comes before any arguments (i.e., just the name of the method). - def on_fcall(value) - { type: :fcall, value: value, loc: value[:loc] } + # :call-seq: + # on_bodystmt: ( + # Statements statements, + # (nil | Rescue) rescue_clause, + # (nil | Statements) else_clause, + # (nil | Ensure) ensure_clause + # ) -> BodyStmt + def on_bodystmt(statements, rescue_clause, else_clause, ensure_clause) + BodyStmt.new( + statements: statements, + rescue_clause: rescue_clause, + else_clause: else_clause, + ensure_clause: ensure_clause, + location: Location.fixed(line: lineno, char: char_pos) + ) end - # A field is a parser event that is always the child of an assignment. It - # accepts as arguments the left side of operation, the operator (. or ::), - # and the right side of the operation. For example: + # BraceBlock represents passing a block to a method call using the { } + # operators. # - # foo.x = 1 + # method { |variable| variable + 1 } # - def on_field(parent, operator, name) - { - type: :field, - parent: parent, - operator: operator, - name: name, - loc: parent[:loc].to(name[:loc]) - } - end - - # float is a scanner event that represents a floating point value literal. - def on_float(value) - node = { - type: :@float, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } - - scanner_events << node - node - end + class BraceBlock + # [LBrace] the left brace that opens this block + attr_reader :lbrace - # fndptn is a parser event that represents matching against a pattern where - # you find a pattern in an array using the Ruby 3.0+ pattern matching syntax. - def on_fndptn(constant, left, values, right) - beging = constant || find_scanner_event(:@lbracket) - ending = find_scanner_event(:@rbracket) + # [nil | BlockVar] the optional set of parameters to the block + attr_reader :block_var - { - type: :fndptn, - constant: constant, - left: left, - values: values, - right: right, - loc: beging[:loc].to(ending[:loc]) - } - end + # [Statements] the list of expressions to evaluate within the block + attr_reader :statements - # for is a parser event that represents using the somewhat esoteric for - # loop. It accepts as arguments an ident which is the iterating variable, - # an enumerable for that which is being enumerated, and a stmts event that - # represents the statements inside the for loop. - def on_for(iterator, enumerable, stmts) - beging = find_scanner_event(:@kw, 'for') - ending = find_scanner_event(:@kw, 'end') + # [Location] the location of this node + attr_reader :location - # Consume the do keyword if it exists so that it doesn't get confused for - # some other block - do_event = find_scanner_event(:@kw, 'do', consume: false) - if do_event && do_event[:loc].start_char > enumerable[:loc].end_char && - do_event[:loc].end_char < ending[:loc].start_char - scanner_events.delete(do_event) + def initialize(lbrace:, block_var:, statements:, location:) + @lbrace = lbrace + @block_var = block_var + @statements = statements + @location = location end - stmts.bind((do_event || enumerable)[:loc].end_char, ending[:loc].start_char) - - { - type: :for, - iterator: iterator, - enumerable: enumerable, - stmts: stmts, - loc: beging[:loc].to(ending[:loc]) - } - end - - # gvar is a scanner event that represents a global variable literal. - def on_gvar(value) - node = { - type: :@gvar, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } - - scanner_events << node - node - end + def pretty_print(q) + q.group(2, '(', ')') do + q.text('brace_block') - # hash is a parser event that represents a hash literal. It accepts as an - # argument an optional assoclist_from_args event which contains the - # contents of the hash. - def on_hash(assoclist_from_args) - beging = find_scanner_event(:@lbrace) - ending = find_scanner_event(:@rbrace) + if block_var + q.breakable + q.pp(block_var) + end - if assoclist_from_args - # Here we're going to expand out the location information for the assocs - # node so that it can grab up any remaining comments inside the hash. - assoclist_from_args[:loc] = - Location.new( - start_line: assoclist_from_args[:loc].start_line, - start_char: beging[:loc].end_char, - end_line: assoclist_from_args[:loc].end_line, - end_char: ending[:loc].start_char - ) + q.breakable + q.pp(statements) + end end - { - type: :hash, - cnts: assoclist_from_args, - loc: beging[:loc].to(ending[:loc]) - } - end - - # This is a scanner event that represents the beginning of the heredoc. It - # includes the declaration (which we call beging here, which is just short - # for beginning). The declaration looks something like <<-HERE or <<~HERE. - # If the downcased version of the declaration actually matches an existing - # prettier parser, we'll later attempt to print it using that parser and - # printer through our embed function. - def on_heredoc_beg(beging) - location = - Location.token(line: lineno, char: char_pos, size: beging.size + 1) - - # Here we're going to artificially create an extra node type so that if - # there are comments after the declaration of a heredoc, they get printed. - node = { - type: :heredoc, - beging: { - type: :@heredoc_beg, - value: beging, + def to_json(*opts) + { + type: :brace_block, + lbrace: lbrace, + block_var: block_var, + stmts: statements, loc: location - }, - loc: location - } - - @heredocs << node - node + }.to_json(*opts) + end end - # This is a parser event that occurs when you're using a heredoc with a - # tilde. These are considered `heredoc_dedent` nodes, whereas the hyphen - # heredocs show up as string literals. - def on_heredoc_dedent(string, _width) - @heredocs[-1].merge!(parts: string[:parts]) - end + # :call-seq: + # on_brace_block: ( + # (nil | BlockVar) block_var, + # Statements statements + # ) -> BraceBlock + def on_brace_block(block_var, statements) + lbrace = find_scanner_event(LBrace) + rbrace = find_scanner_event(RBrace) - # This is a scanner event that represents the end of the heredoc. - def on_heredoc_end(ending) - location = @heredocs[-1][:loc] + statements.bind( + find_next_statement_start((block_var || lbrace).location.end_char), + rbrace.location.start_char + ) - @heredocs[-1][:loc] = + location = Location.new( - start_line: location.start_line, - start_char: location.start_char, - end_line: lineno, - end_char: char_pos + start_line: lbrace.location.start_line, + start_char: lbrace.location.start_char, + end_line: [rbrace.location.end_line, statements.location.end_line].max, + end_char: rbrace.location.end_char ) - @heredocs[-1].merge!(ending: ending.chomp) - end - - # hshptn is a parser event that represents matching against a hash pattern - # using the Ruby 2.7+ pattern matching syntax. - def on_hshptn(constant, keywords, kwrest) - pieces = [constant, keywords, kwrest].flatten(2).compact - - { - type: :hshptn, - constant: constant, - keywords: keywords, - kwrest: kwrest, - loc: pieces[0][:loc].to(pieces[-1][:loc]) - } + BraceBlock.new( + lbrace: lbrace, + block_var: block_var, + statements: statements, + location: location + ) end - # ident is a scanner event that represents an identifier anywhere in code. It - # can actually represent a whole bunch of stuff, depending on where it is in - # the AST. Like comments, we need to force the encoding here so JSON doesn't - # break. - def on_ident(value) - node = { - type: :@ident, - value: value.force_encoding('UTF-8'), - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + # Break represents using the +break+ keyword. + # + # break + # + # It can also optionally accept arguments, as in: + # + # break 1 + # + class Break + # [Args | ArgsAddBlock] the arguments being sent to the keyword + attr_reader :arguments - scanner_events << node - node - end + # [Location] the location of this node + attr_reader :location - # if is a parser event that represents the first clause in an if chain. - # It accepts as arguments the predicate of the if, the statements that are - # contained within the if clause, and the optional consequent clause. - def on_if(predicate, stmts, consequent) - beging = find_scanner_event(:@kw, 'if') - ending = consequent || find_scanner_event(:@kw, 'end') + def initialize(arguments:, location:) + @arguments = arguments + @location = location + end - stmts.bind(predicate[:loc].end_char, ending[:loc].start_char) + def pretty_print(q) + q.group(2, '(', ')') do + q.text('break') + q.breakable + q.pp(arguments) + end + end - { - type: :if, - pred: predicate, - stmts: stmts, - cons: consequent, - loc: beging[:loc].to(ending[:loc]) - } + def to_json(*opts) + { type: :break, args: arguments, loc: location }.to_json(*opts) + end end - # ifop is a parser event that represents a ternary operator. It accepts as - # arguments the predicate to the ternary, the truthy clause, and the falsy - # clause. - def on_ifop(predicate, truthy, falsy) - { - type: :ifop, - pred: predicate, - tthy: truthy, - flsy: falsy, - loc: predicate[:loc].to(falsy[:loc]) - } - end - - # if_mod is a parser event that represents the modifier form of an if - # statement. It accepts as arguments the predicate of the if and the - # statement that are contained within the if clause. - def on_if_mod(predicate, statement) - find_scanner_event(:@kw, 'if') + # :call-seq: + # on_break: ((Args | ArgsAddBlock) arguments) -> Break + def on_break(arguments) + keyword = find_scanner_event(Kw, 'break') - { - type: :if_mod, - pred: predicate, - stmt: statement, - loc: statement[:loc].to(predicate[:loc]) - } - end + location = keyword.location + location = location.to(arguments.location) unless arguments.is_a?(Args) - # ignored_nl is a special kind of scanner event that passes nil as the value. - # You can trigger the ignored_nl event with the following snippet: - # - # foo.bar - # .baz - # - # We don't need to track this event in the AST that we're generating, so we're - # not going to define an explicit handler for it. - # - # def on_ignored_nl(value) - # value - # end + Break.new(arguments: arguments, location: location) + end - # ignored_sp is a scanner event that represents the space before the content - # of each line of a squiggly heredoc that will be removed from the string - # before it gets transformed into a string literal. For example, in the - # following snippet: - # - # <<~HERE - # foo - # bar - # HERE + # Call represents a method call. This node doesn't contain the arguments being + # passed (if arguments are passed, this node will get nested under a + # MethodAddArg node). # - # You would have two ignored_sp events, the first with two spaces and the - # second with four. We don't need to track this event in the AST that we're - # generating, so we're not going to define an explicit handler for it. + # receiver.message # - # def on_ignored_sp(value) - # value - # end + class Call + # [untyped] the receiver of the method call + attr_reader :receiver - # imaginary is a scanner event that represents an imaginary number literal. - # They become instances of the Complex class. - def on_imaginary(value) - node = { - type: :@imaginary, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + # [:"::" | Op | Period] the operator being used to send the message + attr_reader :operator - scanner_events << node - node - end + # [:call | Backtick | Const | Ident | Op] the message being sent + attr_reader :message - # in is a parser event that represents using the in keyword within the - # Ruby 2.7+ pattern matching syntax. Alternatively in Ruby 3+ it is also used - # to handle rightward assignment for pattern matching. - def on_in(pattern, stmts, consequent) - # Here we have a rightward assignment - return pattern unless stmts + # [Location] the location of this node + attr_reader :location - beging = find_scanner_event(:@kw, 'in') - ending = consequent || find_scanner_event(:@kw, 'end') + def initialize(receiver:, operator:, message:, location:) + @receiver = receiver + @operator = operator + @message = message + @location = location + end - stmts.bind(beging[:loc].end_char, ending[:loc].start_char) + def pretty_print(q) + q.group(2, '(', ')') do + q.text('call') + q.breakable + q.pp(receiver) + q.breakable + q.pp(operator) + q.breakable + q.pp(message) + end + end - { - type: :in, - pttn: pattern, - stmts: stmts, - cons: consequent, - loc: beging[:loc].to(ending[:loc]) - } + def to_json(*opts) + { + type: :call, + receiver: receiver, + operator: operator, + message: message, + loc: location + }.to_json(*opts) + end end - # int is a scanner event the represents a number literal. - def on_int(value) - node = { - type: :@int, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + # :call-seq: + # on_call: ( + # untyped receiver, + # (:"::" | Op | Period) operator, + # (:call | Backtick | Const | Ident | Op) message + # ) -> Call + def on_call(receiver, operator, message) + ending = message - scanner_events << node - node - end + if message == :call + ending = operator - # ivar is a scanner event the represents an instance variable literal. - def on_ivar(value) - node = { - type: :@ivar, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + # Special handling here for Ruby <= 2.5 because the operator argument to + # this method wasn't a parser event here it was just a plain symbol. + ending = receiver if RUBY_MAJOR <= 2 && RUBY_MINOR <= 5 + end - scanner_events << node - node + Call.new( + receiver: receiver, + operator: operator, + message: message, + location: + Location.new( + start_line: receiver.location.start_line, + start_char: receiver.location.start_char, + end_line: [ending.location.end_line, receiver.location.end_line].max, + end_char: ending.location.end_char + ) + ) end - # kw is a scanner event the represents the use of a keyword. It can be - # anywhere in the AST, so you end up seeing it quite a lot. - def on_kw(value) - node = { - type: :@kw, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + # Case represents the beginning of a case chain. + # + # case value + # when 1 + # "one" + # when 2 + # "two" + # else + # "number" + # end + # + class Case + # [nil | untyped] optional value being switched on + attr_reader :value - scanner_events << node - node - end + # [In | When] the next clause in the chain + attr_reader :consequent - # kwrest_param is a parser event that represents defining a parameter in a - # method definition that accepts all remaining keyword parameters. - def on_kwrest_param(name) - location = find_scanner_event(:@op, '**')[:loc] - location = location.to(name[:loc]) if name + # [Location] the location of this node + attr_reader :location - { type: :kwrest_param, name: name, loc: location } - end + def initialize(value:, consequent:, location:) + @value = value + @consequent = consequent + @location = location + end - # label is a scanner event that represents the use of an identifier to - # associate with an object. You can find it in a hash key, as in: - # - # { foo: bar } - # - # in this case "foo:" would be the body of the label. You can also find it in - # pattern matching, as in: - # - # case foo - # in bar: - # bar - # end - # - # in this case "bar:" would be the body of the label. - def on_label(value) - node = { - type: :@label, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + def pretty_print(q) + q.group(2, '(', ')') do + q.text('case') - scanner_events << node - node + if value + q.breakable + q.pp(value) + end + + q.breakable + q.pp(consequent) + end + end + + def to_json(*opts) + { type: :case, value: value, cons: consequent, loc: location }.to_json( + *opts + ) + end end - # label_end is a scanner event that represents the end of a dynamic symbol. If - # for example you had the following hash: + # RAssign represents a single-line pattern match. # - # { "foo": bar } + # value in pattern + # value => pattern # - # then the string "\":" would be the value of this label_end. It's useful for - # determining the type of quote being used by the label. - def on_label_end(value) - node = { - type: :@label_end, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + class RAssign + # [untyped] the left-hand expression + attr_reader :value - scanner_events << node - node - end + # [Kw | Op] the operator being used to match against the pattern, which is + # either => or in + attr_reader :operator - # lambda is a parser event that represents using a "stabby" lambda - # literal. It accepts as arguments a params event that represents any - # parameters to the lambda and a stmts/bodystmt event that represents the - # statements inside the lambda. - # - # It can be wrapped in either {..} or do..end so we look for either of - # those combinations to get our bounds. - def on_lambda(params, stmts) - beging = find_scanner_event(:@tlambda) + # [untyped] the pattern on the right-hand side of the expression + attr_reader :pattern - if event = find_scanner_event(:@tlambeg, consume: false) - opening = scanner_events.delete(event) - closing = find_scanner_event(:@rbrace) - else - opening = find_scanner_event(:@kw, 'do') - closing = find_scanner_event(:@kw, 'end') - end + # [Location] the location of this node + attr_reader :location - stmts.bind(opening[:loc].end_char, closing[:loc].start_char) + def initialize(value:, operator:, pattern:, location:) + @value = value + @operator = operator + @pattern = pattern + @location = location + end - { - type: :lambda, - params: params, - stmts: stmts, - loc: beging[:loc].to(closing[:loc]) - } - end + def pretty_print(q) + q.group(2, '(', ')') do + q.text('rassign') - # lbrace is a scanner event representing the use of a left brace, i.e., "{". - def on_lbrace(value) - node = { - type: :@lbrace, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + q.breakable + q.pp(value) - scanner_events << node - node - end + q.breakable + q.pp(operator) - # lbracket is a scanner event representing the use of a left bracket, i.e., - # "[". - def on_lbracket(value) - node = { - type: :@lbracket, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + q.breakable + q.pp(pattern) + end + end - scanner_events << node - node + def to_json(*opts) + { + type: :rassign, + value: value, + operator: operator, + pattern: pattern, + loc: location + }.to_json(*opts) + end end - # lparen is a scanner event representing the use of a left parenthesis, i.e., - # "(". - def on_lparen(value) - node = { - type: :@lparen, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + # :call-seq: + # on_case: (untyped value, untyped consequent) -> Case | RAssign + def on_case(value, consequent) + if keyword = find_scanner_event(Kw, 'case', consume: false) + scanner_events.delete(keyword) - scanner_events << node - node + Case.new( + value: value, + consequent: consequent, + location: keyword.location.to(consequent.location) + ) + else + operator = + find_scanner_event(Kw, 'in', consume: false) || + find_scanner_event(Op, '=>') + + RAssign.new( + value: value, + operator: operator, + pattern: consequent, + location: value.location.to(consequent.location) + ) + end end - # magic_comment is a scanner event that represents the use of a pragma at the - # beginning of the file. Usually it will inside something like - # frozen_string_literal (the key) with a value of true (the value). Both - # children come is a string literals. We're going to leave these alone as they - # come in all kinds of shapes and sizes. + # Class represents defining a class using the +class+ keyword. # - # def on_magic_comment(key, value) - # @magic_comment = { value: " #{key}: #{value}" } + # class Container # end - - # massign is a parser event that is a parent node of any kind of multiple - # assignment. This includes splitting out variables on the left like: # - # a, b, c = foo + # Classes can have path names as their class name in case it's being nested + # under a namespace, as in: # - # as well as splitting out variables on the right, as in: + # class Namespace::Container + # end # - # foo = a, b, c + # Classes can also be defined as a top-level path, in the case that it's + # already in a namespace but you want to define it at the top-level instead, + # as in: # - # Both sides support splats, as well as variables following them. There's - # also slightly odd behavior that you can achieve with the following: + # module OtherNamespace + # class ::Namespace::Container + # end + # end # - # a, = foo + # All of these declarations can also have an optional superclass reference, as + # in: # - # In this case a would receive only the first value of the foo enumerable, - # in which case we need to explicitly track the comma and add it onto the - # child node. - def on_massign(target, value) - comma_range = target[:loc].end_char...value[:loc].start_char - target[:comma] = true if source[comma_range].strip.start_with?(',') - - { - type: :massign, - tgt: target, - val: value, - loc: target[:loc].to(value[:loc]) - } - end - - # method_add_arg is a parser event that represents a method call with - # arguments and parentheses. It accepts as arguments the method being called - # and the arg_paren event that contains the arguments to the method. - def on_method_add_arg(call, args) - location = - if args[:type] == :args - # You can hit this if you are passing no arguments to a method that ends - # in a question mark. Because it knows it has to be a method and not a - # local variable. In that case we can just use the location information - # straight from the fcall. - call[:loc] - else - call[:loc].to(args[:loc]) - end + # class Child < Parent + # end + # + # That superclass can actually be any Ruby expression, it doesn't necessarily + # need to be a constant, as in: + # + # class Child < method + # end + # + class ClassDeclaration + # [ConstPathRef | ConstRef | TopConstRef] the name of the class being + # defined + attr_reader :constant - { type: :method_add_arg, call: call, args: args, loc: location } - end + # [nil | untyped] the optional superclass declaration + attr_reader :superclass - # method_add_block is a parser event that represents a method call with a - # block argument. It accepts as arguments the method being called and the - # block event. - def on_method_add_block(call, block) - { - type: :method_add_block, - call: call, - block: block, - loc: call[:loc].to(block[:loc]) - } - end + # [BodyStmt] the expressions to execute within the context of the class + attr_reader :bodystmt - # An mlhs_new is a parser event that represents the beginning of the left - # side of a multiple assignment. It is followed by any number of mlhs_add - # nodes that each represent another variable being assigned. - def on_mlhs_new - { - type: :mlhs, - parts: [], - loc: Location.fixed(line: lineno, char: char_pos) - } - end + # [Location] the location of this node + attr_reader :location - # An mlhs_add is a parser event that represents adding another variable - # onto a list of assignments. It accepts as arguments the parent mlhs node - # as well as the part that is being added to the list. - def on_mlhs_add(mlhs, part) - if mlhs[:parts].empty? - { type: :mlhs, parts: [part], loc: part[:loc] } - else - { - type: :mlhs, - parts: mlhs[:parts] << part, - loc: mlhs[:loc].to(part[:loc]) - } - end - end - - # An mlhs_add_post is a parser event that represents adding another set of - # variables onto a list of assignments after a splat variable. It accepts - # as arguments the previous mlhs_add_star node that represented the splat - # as well another mlhs node that represents all of the variables after the - # splat. - def on_mlhs_add_post(mlhs_add_star, mlhs) - { - type: :mlhs_add_post, - star: mlhs_add_star, - mlhs: mlhs, - loc: mlhs_add_star[:loc].to(mlhs[:loc]) - } - end + def initialize(constant:, superclass:, bodystmt:, location:) + @constant = constant + @superclass = superclass + @bodystmt = bodystmt + @location = location + end - # An mlhs_add_star is a parser event that represents a splatted variable - # inside of a multiple assignment on the left hand side. It accepts as - # arguments the parent mlhs node as well as the part that represents the - # splatted variable. - def on_mlhs_add_star(mlhs, part) - beging = find_scanner_event(:@op, '*') - ending = part || beging + def pretty_print(q) + q.group(2, '(', ')') do + q.text('class') - { - type: :mlhs_add_star, - mlhs: mlhs, - star: part, - loc: beging[:loc].to(ending[:loc]) - } - end + q.breakable + q.pp(constant) - # An mlhs_paren is a parser event that represents parentheses being used - # to deconstruct values in a multiple assignment on the left hand side. It - # accepts as arguments the contents of the inside of the parentheses, - # which is another mlhs node. - def on_mlhs_paren(contents) - beging = find_scanner_event(:@lparen) - ending = find_scanner_event(:@rparen) + if superclass + q.breakable + q.pp(superclass) + end - comma_range = beging[:loc].end_char...ending[:loc].start_char - contents[:comma] = true if source[comma_range].strip.end_with?(',') + q.breakable + q.pp(bodystmt) + end + end - { type: :mlhs_paren, cnts: contents, loc: beging[:loc].to(ending[:loc]) } + def to_json(*opts) + { + type: :class, + constant: constant, + superclass: superclass, + bodystmt: bodystmt, + loc: location + }.to_json(*opts) + end end - # module is a parser event that represents defining a module. It accepts - # as arguments the name of the module and the bodystmt event that - # represents the statements evaluated within the context of the module. - def on_module(constant, bodystmt) - beging = find_scanner_event(:@kw, 'module') - ending = find_scanner_event(:@kw, 'end') + # :call-seq: + # on_class: ( + # (ConstPathRef | ConstRef | TopConstRef) constant, + # untyped superclass, + # BodyStmt bodystmt + # ) -> ClassDeclaration + def on_class(constant, superclass, bodystmt) + beginning = find_scanner_event(Kw, 'class') + ending = find_scanner_event(Kw, 'end') bodystmt.bind( - find_next_statement_start(constant[:loc].end_char), - ending[:loc].start_char + find_next_statement_start((superclass || constant).location.end_char), + ending.location.start_char ) - { - type: :module, + ClassDeclaration.new( constant: constant, + superclass: superclass, bodystmt: bodystmt, - loc: beging[:loc].to(ending[:loc]) - } + location: beginning.location.to(ending.location) + ) end - # An mrhs_new is a parser event that represents the beginning of a list of - # values that are being assigned within a multiple assignment node. It can - # be followed by any number of mrhs_add nodes that we'll build up into an - # array body. - def on_mrhs_new - { - type: :mrhs, - parts: [], - loc: Location.fixed(line: lineno, char: char_pos) - } - end + # Comma represents the use of the , operator. + class Comma + # [String] the comma in the string + attr_reader :value - # An mrhs_add is a parser event that represents adding another value onto - # a list on the right hand side of a multiple assignment. - def on_mrhs_add(mrhs, part) - if mrhs[:type] == :mrhs_new_from_args - { - type: :mrhs, - parts: [*mrhs[:args][:parts], part], - loc: mrhs[:loc].to(part[:loc]) - } - elsif mrhs[:parts].empty? - { type: :mrhs, parts: [part], loc: mrhs[:loc] } - else - { - type: mrhs[:type], - parts: mrhs[:parts] << part, - loc: mrhs[:loc].to(part[:loc]) - } + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('comma') + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@comma, value: value, loc: location }.to_json(*opts) end end - # An mrhs_add_star is a parser event that represents using the splat - # operator to expand out a value on the right hand side of a multiple - # assignment. - def on_mrhs_add_star(mrhs, star) - beging = find_scanner_event(:@op, '*') - ending = star || beging + # :call-seq: + # on_comma: (String value) -> Comma + def on_comma(value) + node = + Comma.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) - { - type: :mrhs_add_star, - mrhs: mrhs, - star: star, - loc: beging[:loc].to(ending[:loc]) - } + scanner_events << node + node end - # An mrhs_new_from_args is a parser event that represents the shorthand - # of a multiple assignment that allows you to assign values using just - # commas as opposed to assigning from an array. For example, in the - # following segment the right hand side of the assignment would trigger - # this event: + # Command represents a method call with arguments and no parentheses. Note + # that Command nodes only happen when there is no explicit receiver for this + # method. # - # foo = 1, 2, 3 + # method argument # - def on_mrhs_new_from_args(args) - { type: :mrhs_new_from_args, args: args, loc: args[:loc] } - end + class Command + # [Const | Ident] the message being sent to the implicit receiver + attr_reader :message - # next is a parser event that represents using the next keyword. It - # accepts as an argument an args or args_add_block event that contains all - # of the arguments being passed to the next. - def on_next(args) - keyword = find_scanner_event(:@kw, 'next') - location = - if args[:type] == :args - # You can hit this if you are passing no arguments to next but it has a - # comment right after it. In that case we can just use the location - # information straight from the keyword. - keyword[:loc] - else - keyword[:loc].to(args[:loc]) - end + # [Args | ArgsAddBlock] the arguments being sent with the message + attr_reader :arguments - { type: :next, args: args, loc: location } - end + # [Location] the location of this node + attr_reader :location - # nl is a scanner event representing a newline in the source. As you can - # imagine, it will typically get triggered quite a few times. We don't need to - # track this event in the AST that we're generating, so we're not going to - # define an explicit handler for it. - # - # def on_nl(value) - # value - # end + def initialize(message:, arguments:, location:) + @message = message + @arguments = arguments + @location = location + end - # nokw_param is a parser event that represents the use of the special 2.7+ - # syntax to indicate a method should take no additional keyword arguments. For - # example in the following snippet: - # - # def foo(**nil) end - # - # this is saying that foo should not accept any keyword arguments. Its value - # is always nil. We don't need to track this event in the AST that we're - # generating, so we're not going to define an explicit handler for it. - # - # def on_nokw_param(value) - # value - # end + def pretty_print(q) + q.group(2, '(', ')') do + q.text('command') - # op is a scanner event representing an operator literal in the source. For - # example, in the following snippet: - # - # 1 + 2 - # - # the + sign is an operator. - def on_op(value) - node = { - type: :@op, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + q.breakable + q.pp(message) - scanner_events << node - node + q.breakable + q.pp(arguments) + end + end + + def to_json(*opts) + { + type: :command, + message: message, + args: arguments, + loc: location + }.to_json(*opts) + end end - # opassign is a parser event that represents assigning something to a - # variable or constant using an operator like += or ||=. It accepts as - # arguments the left side of the expression before the operator, the - # operator itself, and the right side of the expression. - def on_opassign(target, operator, value) - { - type: :opassign, - target: target, - operator: operator, - value: value, - loc: target[:loc].to(value[:loc]) - } + # :call-seq: + # on_command: ( + # (Const | Ident) message, + # (Args | ArgsAddBlock) arguments + # ) -> Command + def on_command(message, arguments) + Command.new( + message: message, + arguments: arguments, + location: message.location.to(arguments.location) + ) end - # operator_ambiguous is a parser event that represents when the parsers sees - # an operator as ambiguous. For example, in the following snippet: - # - # foo %[] + # CommandCall represents a method call on an object with arguments and no + # parentheses. # - # the question becomes if the percent sign is being used as a method call or - # if it's the start of a string literal. We don't need to track this event in - # the AST that we're generating, so we're not going to define an explicit - # handler for it. + # object.method argument # - # def on_operator_ambiguous(value) - # value - # end + class CommandCall + # [untyped] the receiver of the message + attr_reader :receiver - # params is a parser event that represents defining parameters on a - # method. They have a somewhat interesting structure in that they are an - # array of arrays where the position in the top-level array indicates the - # type of param and the subarray is the list of parameters of that type. - # We therefore have to flatten them down to get to the location. - def on_params(reqs, opts, rest, posts, keywords, kwrest, block) - params = [ - *reqs, - *opts&.flatten(1), - rest, - *posts, - *keywords&.flat_map { |(key, value)| [key, value || nil] }, - (kwrest if kwrest != :nil), - block - ].compact + # [:"::" | Op | Period] the operator used to send the message + attr_reader :operator - location = - if params.any? - params[0][:loc].to(params[-1][:loc]) - else - Location.fixed(line: lineno, char: char_pos) - end + # [Const | Ident | Op] the message being send + attr_reader :message - { - type: :params, - reqs: reqs || [], - opts: opts || [], - rest: rest, - posts: posts || [], - keywords: keywords || [], - kwrest: kwrest, - block: block, - loc: location - } - end + # [Args | ArgsAddBlock] the arguments going along with the message + attr_reader :arguments - # A paren is a parser event that represents using parentheses pretty much - # anywhere in a Ruby program. It accepts as arguments the contents, which - # can be either params or statements. - def on_paren(contents) - lparen = find_scanner_event(:@lparen) - rparen = find_scanner_event(:@rparen) + # [Location] the location of this node + attr_reader :location - if contents && contents[:type] == :params - location = contents[:loc] - contents[:loc] = - Location.new( - start_line: location.start_line, - start_char: find_next_statement_start(lparen[:loc].end_char), - end_line: location.end_line, - end_char: rparen[:loc].start_char - ) + def initialize(receiver:, operator:, message:, arguments:, location:) + @receiver = receiver + @operator = operator + @message = message + @arguments = arguments + @location = location end - { - type: :paren, - lparen: lparen, - cnts: contents, - loc: lparen[:loc].to(rparen[:loc]) - } - end + def pretty_print(q) + q.group(2, '(', ')') do + q.text('case') - # If we encounter a parse error, just immediately bail out so that our runner - # can catch it. - def on_parse_error(error, *) - raise ParserError.new(error, lineno, column) - end - alias on_alias_error on_parse_error - alias on_assign_error on_parse_error - alias on_class_name_error on_parse_error - alias on_param_error on_parse_error + q.breakable + q.pp(receiver) - # period is a scanner event that represents the use of the period operator. It - # is usually found in method calls. - def on_period(value) - { - type: :@period, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } - end + q.breakable + q.pp(operator) - # The program node is the very top of the AST. Here we'll attach all of - # the comments that we've gathered up over the course of parsing the - # source string. We'll also attach on the __END__ content if there was - # some found at the end of the source string. - def on_program(stmts) - location = - Location.new( - start_line: 1, - start_char: 0, - end_line: lines.length, - end_char: source.length - ) + q.breakable + q.pp(message) - stmts[:body] << @__end__ if @__end__ - stmts.bind(0, source.length) + q.breakable + q.pp(arguments) + end + end - { type: :program, stmts: stmts, comments: @comments, loc: location } + def to_json(*opts) + { + type: :command_call, + receiver: receiver, + operator: operator, + message: message, + args: arguments, + loc: location + }.to_json(*opts) + end end - # qsymbols_beg is a scanner event that represents the beginning of a symbol - # literal array. For example in the following snippet: - # - # %i[foo bar baz] - # - # a qsymbols_beg would be triggered with the value of "%i[". - def on_qsymbols_beg(value) - node = { - type: :@qsymbols_beg, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + # :call-seq: + # on_command_call: ( + # untyped receiver, + # (:"::" | Op | Period) operator, + # (Const | Ident | Op) message, + # (Args | ArgsAddBlock) arguments + # ) -> CommandCall + def on_command_call(receiver, operator, message, arguments) + ending = arguments || message - scanner_events << node - node + CommandCall.new( + receiver: receiver, + operator: operator, + message: message, + arguments: arguments, + location: receiver.location.to(ending.location) + ) end - # qsymbols_new is a parser event that represents the beginning of a symbol - # literal array, like %i[one two three]. It can be followed by any number - # of qsymbols_add events, which we'll append onto an array body. - def on_qsymbols_new - event = find_scanner_event(:@qsymbols_beg) + # Comment represents a comment in the source. + # + # # comment + # + class Comment + # [String] the contents of the comment + attr_reader :value - { type: :qsymbols, elems: [], loc: event[:loc] } - end + # [boolean] whether or not there is code on the same line as this comment. + # If there is, then inline will be true. + attr_reader :inline - # qsymbols_add is a parser event that represents an element inside of a - # symbol literal array like %i[one two three]. It accepts as arguments the - # parent qsymbols node as well as a tstring_content scanner event - # representing the bare words. - def on_qsymbols_add(qsymbols, tstring_content) - { - type: :qsymbols, - elems: qsymbols[:elems] << tstring_content, - loc: qsymbols[:loc].to(tstring_content[:loc]) - } + # [Location] the location of this node + attr_reader :location + + def initialize(value:, inline:, location:) + @value = value + @inline = inline + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('comment') + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { + type: :@comment, + value: value.force_encoding('UTF-8'), + inline: inline, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_comment: (String value) -> Comment + def on_comment(value) + line = lineno + comment = + Comment.new( + value: value[1..-1].chomp, + inline: value.strip != lines[line - 1], + location: + Location.token(line: line, char: char_pos, size: value.size - 1) + ) + + @comments << comment + comment + end + + # Const represents a literal value that _looks_ like a constant. This could + # actually be a reference to a constant: + # + # Constant + # + # It could also be something that looks like a constant in another context, as + # in a method call to a capitalized method: + # + # object.Constant + # + # or a symbol that starts with a capital letter: + # + # :Constant + # + class Const + # [String] the name of the constant + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('const') + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@const, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_const: (String value) -> Const + def on_const(value) + node = + Const.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # ConstPathField represents the child node of some kind of assignment. It + # represents when you're assigning to a constant that is being referenced as + # a child of another variable. + # + # object::Const = value + # + class ConstPathField + # [untyped] the source of the constant + attr_reader :parent + + # [Const] the constant itself + attr_reader :constant + + # [Location] the location of this node + attr_reader :location + + def initialize(parent:, constant:, location:) + @parent = parent + @constant = constant + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('const_path_field') + + q.breakable + q.pp(parent) + + q.breakable + q.pp(constant) + end + end + + def to_json(*opts) + { + type: :const_path_field, + parent: parent, + constant: constant, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_const_path_field: (untyped parent, Const constant) -> ConstPathField + def on_const_path_field(parent, constant) + ConstPathField.new( + parent: parent, + constant: constant, + location: parent.location.to(constant.location) + ) + end + + # ConstPathRef represents referencing a constant by a path. + # + # object::Const + # + class ConstPathRef + # [untyped] the source of the constant + attr_reader :parent + + # [Const] the constant itself + attr_reader :constant + + # [Location] the location of this node + attr_reader :location + + def initialize(parent:, constant:, location:) + @parent = parent + @constant = constant + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('const_path_ref') + + q.breakable + q.pp(parent) + + q.breakable + q.pp(constant) + end + end + + def to_json(*opts) + { + type: :const_path_ref, + parent: parent, + constant: constant, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_const_path_ref: (untyped parent, Const constant) -> ConstPathRef + def on_const_path_ref(parent, constant) + ConstPathRef.new( + parent: parent, + constant: constant, + location: parent.location.to(constant.location) + ) + end + + # ConstRef represents the name of the constant being used in a class or module + # declaration. + # + # class Container + # end + # + class ConstRef + # [Const] the constant itself + attr_reader :constant + + # [Location] the location of this node + attr_reader :location + + def initialize(constant:, location:) + @constant = constant + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('const_ref') + + q.breakable + q.pp(constant) + end + end + + def to_json(*opts) + { type: :const_ref, constant: constant, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_const_ref: (Const constant) -> ConstRef + def on_const_ref(constant) + ConstRef.new(constant: constant, location: constant.location) + end + + # CVar represents the use of a class variable. + # + # @@variable + # + class CVar + # [String] the name of the class variable + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('cvar') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@cvar, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_cvar: (String value) -> CVar + def on_cvar(value) + node = + CVar.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # Def represents defining a regular method on the current self object. + # + # def method(param) do result end + # + class Def + # [Backtick | Const | Ident | Keyword | Op] the name of the method + attr_reader :name + + # [Params | Paren] the parameter declaration for the method + attr_reader :params + + # [BodyStmt] the expressions to be executed by the method + attr_reader :bodystmt + + # [Location] the location of this node + attr_reader :location + + def initialize(name:, params:, bodystmt:, location:) + @name = name + @params = params + @bodystmt = bodystmt + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('def') + + q.breakable + q.pp(name) + + q.breakable + q.pp(params) + + q.breakable + q.pp(bodystmt) + end + end + + def to_json(*opts) + { + type: :def, + name: name, + params: params, + bodystmt: bodystmt, + loc: location + }.to_json(*opts) + end + end + + # DefEndless represents defining a single-line method since Ruby 3.0+. + # + # def method = result + # + class DefEndless + # [Backtick | Const | Ident | Keyword | Op] the name of the method + attr_reader :name + + # [Paren] the parameter declaration for the method + attr_reader :paren + + # [untyped] the expression to be executed by the method + attr_reader :statement + + # [Location] the location of this node + attr_reader :location + + def initialize(name:, paren:, statement:, location:) + @name = name + @paren = paren + @statement = statement + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('defsl') + + q.breakable + q.pp(name) + + q.breakable + q.pp(paren) + + q.breakable + q.pp(statement) + end + end + + def to_json(*opts) + { + type: :defsl, + name: name, + paren: paren, + stmt: statement, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_def: ( + # (Backtick | Const | Ident | Keyword | Op) name, + # (Params | Paren) params, + # untyped bodystmt + # ) -> Def | DefEndless + def on_def(name, params, bodystmt) + # Make sure to delete this scanner event in case you're defining something + # like def class which would lead to this being a kw and causing all kinds + # of trouble + scanner_events.delete(name) + + # Find the beginning of the method definition, which works for single-line + # and normal method definitions. + beginning = find_scanner_event(Kw, 'def') + + # If we don't have a bodystmt node, then we have a single-line method + unless bodystmt.is_a?(BodyStmt) + node = + DefEndless.new( + name: name, + paren: params, + statement: bodystmt, + location: beginning.location.to(bodystmt.location) + ) + + return node + end + + # If there aren't any params then we need to correct the params node + # location information + if params.is_a?(Params) && params.empty? + end_char = name.location.end_char + location = + Location.new( + start_line: params.location.start_line, + start_char: end_char, + end_line: params.location.end_line, + end_char: end_char + ) + + params = Params.new(location: location) + end + + ending = find_scanner_event(Kw, 'end') + bodystmt.bind( + find_next_statement_start(params.location.end_char), + ending.location.start_char + ) + + Def.new( + name: name, + params: params, + bodystmt: bodystmt, + location: beginning.location.to(ending.location) + ) + end + + # Defined represents the use of the +defined?+ operator. It can be used with + # and without parentheses. + # + # defined?(variable) + # + class Defined + # [untyped] the value being sent to the keyword + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('defined') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :defined, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_defined: (untyped value) -> Defined + def on_defined(value) + beginning = find_scanner_event(Kw, 'defined?') + ending = value + + range = beginning.location.end_char...value.location.start_char + if source[range].include?('(') + find_scanner_event(LParen) + ending = find_scanner_event(RParen) + end + + Defined.new(value: value, location: beginning.location.to(ending.location)) + end + + # Defs represents defining a singleton method on an object. + # + # def object.method(param) do result end + # + class Defs + # [untyped] the target where the method is being defined + attr_reader :target + + # [Op | Period] the operator being used to declare the method + attr_reader :operator + + # [Backtick | Const | Ident | Keyword | Op] the name of the method + attr_reader :name + + # [Params | Paren] the parameter declaration for the method + attr_reader :params + + # [BodyStmt] the expressions to be executed by the method + attr_reader :bodystmt + + # [Location] the location of this node + attr_reader :location + + def initialize(target:, operator:, name:, params:, bodystmt:, location:) + @target = target + @operator = operator + @name = name + @params = params + @bodystmt = bodystmt + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('defs') + + q.breakable + q.pp(target) + + q.breakable + q.pp(operator) + + q.breakable + q.pp(name) + + q.breakable + q.pp(params) + + q.breakable + q.pp(bodystmt) + end + end + + def to_json(*opts) + { + type: :defs, + target: target, + operator: operator, + name: name, + params: params, + bodystmt: bodystmt, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_defs: ( + # untyped target, + # (Op | Period) operator, + # (Backtick | Const | Ident | Keyword | Op) name, + # (Params | Paren) params, + # BodyStmt bodystmt + # ) -> Defs + def on_defs(target, operator, name, params, bodystmt) + # Make sure to delete this scanner event in case you're defining something + # like def class which would lead to this being a kw and causing all kinds + # of trouble + scanner_events.delete(name) + + # If there aren't any params then we need to correct the params node + # location information + if params.is_a?(Params) && params.empty? + end_char = name.location.end_char + location = + Location.new( + start_line: params.location.start_line, + start_char: end_char, + end_line: params.location.end_line, + end_char: end_char + ) + + params = Params.new(location: location) + end + + beginning = find_scanner_event(Kw, 'def') + ending = find_scanner_event(Kw, 'end') + + bodystmt.bind( + find_next_statement_start(params.location.end_char), + ending.location.start_char + ) + + Defs.new( + target: target, + operator: operator, + name: name, + params: params, + bodystmt: bodystmt, + location: beginning.location.to(ending.location) + ) + end + + # DoBlock represents passing a block to a method call using the +do+ and +end+ + # keywords. + # + # method do |value| + # end + # + class DoBlock + # [Kw] the do keyword that opens this block + attr_reader :keyword + + # [nil | BlockVar] the optional variable declaration within this block + attr_reader :block_var + + # [BodyStmt] the expressions to be executed within this block + attr_reader :bodystmt + + # [Location] the location of this node + attr_reader :location + + def initialize(keyword:, block_var:, bodystmt:, location:) + @keyword = keyword + @block_var = block_var + @bodystmt = bodystmt + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('do_block') + + if block_var + q.breakable + q.pp(block_var) + end + + q.breakable + q.pp(bodystmt) + end + end + + def to_json(*opts) + { + type: :do_block, + keyword: keyword, + block_var: block_var, + bodystmt: bodystmt, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_do_block: (BlockVar block_var, BodyStmt bodystmt) -> DoBlock + def on_do_block(block_var, bodystmt) + beginning = find_scanner_event(Kw, 'do') + ending = find_scanner_event(Kw, 'end') + + bodystmt.bind( + find_next_statement_start((block_var || beginning).location.end_char), + ending.location.start_char + ) + + DoBlock.new( + keyword: beginning, + block_var: block_var, + bodystmt: bodystmt, + location: beginning.location.to(ending.location) + ) + end + + # Dot2 represents using the .. operator between two expressions. Usually this + # is to create a range object. + # + # 1..2 + # + # Sometimes this operator is used to create a flip-flop. + # + # if value == 5 .. value == 10 + # end + # + # One of the sides of the expression may be nil, but not both. + class Dot2 + # [nil | untyped] the left side of the expression + attr_reader :left + + # [nil | untyped] the right side of the expression + attr_reader :right + + # [Location] the location of this node + attr_reader :location + + def initialize(left:, right:, location:) + @left = left + @right = right + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('dot2') + + if left + q.breakable + q.pp(left) + end + + if right + q.breakable + q.pp(right) + end + end + end + + def to_json(*opts) + { type: :dot2, left: left, right: right, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_dot2: ((nil | untyped) left, (nil | untyped) right) -> Dot2 + def on_dot2(left, right) + operator = find_scanner_event(Op, '..') + + beginning = left || operator + ending = right || operator + + Dot2.new( + left: left, + right: right, + location: beginning.location.to(ending.location) + ) + end + + # Dot3 represents using the ... operator between two expressions. Usually this + # is to create a range object. It's effectively the same event as the Dot2 + # node but with this operator you're asking Ruby to omit the final value. + # + # 1...2 + # + # Like Dot2 it can also be used to create a flip-flop. + # + # if value == 5 ... value == 10 + # end + # + # One of the sides of the expression may be nil, but not both. + class Dot3 + # [nil | untyped] the left side of the expression + attr_reader :left + + # [nil | untyped] the right side of the expression + attr_reader :right + + # [Location] the location of this node + attr_reader :location + + def initialize(left:, right:, location:) + @left = left + @right = right + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('dot3') + + if left + q.breakable + q.pp(left) + end + + if right + q.breakable + q.pp(right) + end + end + end + + def to_json(*opts) + { type: :dot3, left: left, right: right, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_dot3: ((nil | untyped) left, (nil | untyped) right) -> Dot3 + def on_dot3(left, right) + operator = find_scanner_event(Op, '...') + + beginning = left || operator + ending = right || operator + + Dot3.new( + left: left, + right: right, + location: beginning.location.to(ending.location) + ) + end + + # DynaSymbol represents a symbol literal that uses quotes to dynamically + # define its value. + # + # :"#{variable}" + # + # They can also be used as a special kind of dynamic hash key, as in: + # + # { "#{key}": value } + # + class DynaSymbol + # [Array[StringDVar | StringEmbExpr | TStringContent]] the parts of the + # dynamic symbol + attr_reader :parts + + # [String] the quote used to delimit the dynamic symbol + attr_reader :quote + + # [Location] the location of this node + attr_reader :location + + def initialize(parts:, quote:, location:) + @parts = parts + @quote = quote + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('dyna_symbol') + + q.breakable + q.group(2, '(', ')') { q.seplist(parts) { |part| q.pp(part) } } + end + end + + def to_json(*opts) + { type: :dyna_symbol, parts: parts, quote: quote, loc: location }.to_json( + *opts + ) + end + end + + # :call-seq: + # on_dyna_symbol: (StringContent string_content) -> DynaSymbol + def on_dyna_symbol(string_content) + if find_scanner_event(SymBeg, consume: false) + # A normal dynamic symbol + symbeg = find_scanner_event(SymBeg) + tstring_end = find_scanner_event(TStringEnd) + + DynaSymbol.new( + quote: symbeg.value, + parts: string_content.parts, + location: symbeg.location.to(tstring_end.location) + ) + else + # A dynamic symbol as a hash key + tstring_beg = find_scanner_event(TStringBeg) + label_end = find_scanner_event(LabelEnd) + + DynaSymbol.new( + parts: string_content.parts, + quote: label_end.value[0], + location: tstring_beg.location.to(label_end.location) + ) + end + end + + # Else represents the end of an +if+, +unless+, or +case+ chain. + # + # if variable + # else + # end + # + class Else + # [Statements] the expressions to be executed + attr_reader :statements + + # [Location] the location of this node + attr_reader :location + + def initialize(statements:, location:) + @statements = statements + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('else') + + q.breakable + q.pp(statements) + end + end + + def to_json(*opts) + { type: :else, stmts: statements, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_else: (Statements statements) -> Else + def on_else(statements) + beginning = find_scanner_event(Kw, 'else') + + # else can either end with an end keyword (in which case we'll want to + # consume that event) or it can end with an ensure keyword (in which case + # we'll leave that to the ensure to handle). + index = + scanner_events.rindex do |node| + node.is_a?(Kw) && %w[end ensure].include?(node.value) + end + + node = scanner_events[index] + ending = node.value == 'end' ? scanner_events.delete_at(index) : node + + statements.bind(beginning.location.end_char, ending.location.start_char) + + Else.new( + statements: statements, + location: beginning.location.to(ending.location) + ) + end + + # Elsif represents another clause in an +if+ or +unless+ chain. + # + # if variable + # elsif other_variable + # end + # + class Elsif + # [untyped] the expression to be checked + attr_reader :predicate + + # [Statements] the expressions to be executed + attr_reader :statements + + # [nil | Elsif | Else] the next clause in the chain + attr_reader :consequent + + # [Location] the location of this node + attr_reader :location + + def initialize(predicate:, statements:, consequent:, location:) + @predicate = predicate + @statements = statements + @consequent = consequent + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('elsif') + + q.breakable + q.pp(predicate) + + q.breakable + q.pp(statements) + + if consequent + q.breakable + q.pp(consequent) + end + end + end + + def to_json(*opts) + { + type: :elsif, + pred: predicate, + stmts: statements, + cons: consequent, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_elsif: ( + # untyped predicate, + # Statements statements, + # (nil | Elsif | Else) consequent + # ) -> Elsif + def on_elsif(predicate, statements, consequent) + beginning = find_scanner_event(Kw, 'elsif') + ending = consequent || find_scanner_event(Kw, 'end') + + statements.bind(predicate.location.end_char, ending.location.start_char) + + Elsif.new( + predicate: predicate, + statements: statements, + consequent: consequent, + location: beginning.location.to(ending.location) + ) + end + + # EmbDoc represents a multi-line comment. + # + # =begin + # first line + # second line + # =end + # + class EmbDoc + # [String] the contents of the comment + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('embdoc') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@embdoc, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_embdoc: (String value) -> EmbDoc + def on_embdoc(value) + @embdoc.value << value + @embdoc + end + + # :call-seq: + # on_embdoc_beg: (String value) -> EmbDoc + def on_embdoc_beg(value) + @embdoc = + EmbDoc.new( + value: value, + location: Location.fixed(line: lineno, char: char_pos) + ) + end + + # :call-seq: + # on_embdoc_end: (String value) -> EmbDoc + def on_embdoc_end(value) + location = @embdoc.location + embdoc = + EmbDoc.new( + value: @embdoc.value << value.chomp, + location: + Location.new( + start_line: location.start_line, + start_char: location.start_char, + end_line: lineno, + end_char: char_pos + value.length - 1 + ) + ) + + @comments << embdoc + @embdoc = nil + + embdoc + end + + # EmbExprBeg represents the beginning token for using interpolation inside of + # a parent node that accepts string content (like a string or regular + # expression). + # + # "Hello, #{person}!" + # + class EmbExprBeg + # [String] the #{ used in the string + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('embexpr_beg') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@embexpr_beg, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_embexpr_beg: (String value) -> EmbExprBeg + def on_embexpr_beg(value) + node = + EmbExprBeg.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # EmbExprEnd represents the ending token for using interpolation inside of a + # parent node that accepts string content (like a string or regular + # expression). + # + # "Hello, #{person}!" + # + class EmbExprEnd + # [String] the } used in the string + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('embexpr_end') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@embexpr_end, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_embexpr_end: (String value) -> EmbExprEnd + def on_embexpr_end(value) + node = + EmbExprEnd.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # EmbVar represents the use of shorthand interpolation for an instance, class, + # or global variable into a parent node that accepts string content (like a + # string or regular expression). + # + # "#@variable" + # + # In the example above, an EmbVar node represents the # because it forces + # @variable to be interpolated. + class EmbVar + # [String] the # used in the string + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('embvar') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@embvar, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_embvar: (String value) -> EmbVar + def on_embvar(value) + node = + EmbVar.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # Ensure represents the use of the +ensure+ keyword and its subsequent + # statements. + # + # begin + # ensure + # end + # + class Ensure + # [Kw] the ensure keyword that began this node + attr_reader :keyword + + # [Statements] the expressions to be executed + attr_reader :statements + + # [Location] the location of this node + attr_reader :location + + def initialize(keyword:, statements:, location:) + @keyword = keyword + @statements = statements + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('ensure') + + q.breakable + q.pp(statements) + end + end + + def to_json(*opts) + { + type: :ensure, + keyword: keyword, + stmts: statements, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_ensure: (Statements statements) -> Ensure + def on_ensure(statements) + keyword = find_scanner_event(Kw, 'ensure') + + # We don't want to consume the :@kw event, because that would break + # def..ensure..end chains. + ending = find_scanner_event(Kw, 'end', consume: false) + statements.bind( + find_next_statement_start(keyword.location.end_char), + ending.location.start_char + ) + + Ensure.new( + keyword: keyword, + statements: statements, + location: keyword.location.to(ending.location) + ) + end + + # ExcessedComma represents a trailing comma in a list of block parameters. It + # changes the block parameters such that they will destructure. + # + # [[1, 2, 3], [2, 3, 4]].each do |first, second,| + # end + # + # In the above example, an ExcessedComma node would appear in the third + # position of the Params node that is used to declare that block. The third + # position typically represents a rest-type parameter, but in this case is + # used to indicate that a trailing comma was used. + class ExcessedComma + # [String] the comma + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('excessed_comma') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :excessed_comma, value: value, loc: location }.to_json(*opts) + end + end + + # The handler for this event accepts no parameters (though in previous + # versions of Ruby it accepted a string literal with a value of ","). + # + # :call-seq: + # on_excessed_comma: () -> ExcessedComma + def on_excessed_comma(*) + comma = find_scanner_event(Comma) + + ExcessedComma.new(value: comma.value, location: comma.location) + end + + # FCall represents the piece of a method call that comes before any arguments + # (i.e., just the name of the method). It is used in places where the parser + # is sure that it is a method call and not potentially a local variable. + # + # method(argument) + # + # In the above example, it's referring to the +method+ segment. + class FCall + # [Const | Ident] the name of the method + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('fcall') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :fcall, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_fcall: ((Const | Ident) value) -> FCall + def on_fcall(value) + FCall.new(value: value, location: value.location) + end + + # Field is always the child of an assignment. It represents assigning to a + # “field” on an object. + # + # object.variable = value + # + class Field + # [untyped] the parent object that owns the field being assigned + attr_reader :parent + + # [:"::" | Op | Period] the operator being used for the assignment + attr_reader :operator + + # [Const | Ident] the name of the field being assigned + attr_reader :name + + # [Location] the location of this node + attr_reader :location + + def initialize(parent:, operator:, name:, location:) + @parent = parent + @operator = operator + @name = name + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('field') + + q.breakable + q.pp(parent) + + q.breakable + q.pp(operator) + + q.breakable + q.pp(name) + end + end + + def to_json(*opts) + { + type: :field, + parent: parent, + operator: operator, + name: name, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_field: ( + # untyped parent, + # (:"::" | Op | Period) operator + # (Const | Ident) name + # ) -> Field + def on_field(parent, operator, name) + Field.new( + parent: parent, + operator: operator, + name: name, + location: parent.location.to(name.location) + ) + end + + # FloatLiteral represents a floating point number literal. + # + # 1.0 + # + class FloatLiteral + # [String] the value of the floating point number literal + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('float') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@float, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_float: (String value) -> FloatLiteral + def on_float(value) + node = + FloatLiteral.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # FndPtn represents matching against a pattern where you find a pattern in an + # array using the Ruby 3.0+ pattern matching syntax. + # + # case value + # in [*, 7, *] + # end + # + class FndPtn + # [nil | untyped] the optional constant wrapper + attr_reader :constant + + # [VarField] the splat on the left-hand side + attr_reader :left + + # [Array[untyped]] the list of positional expressions in the pattern that + # are being matched + attr_reader :values + + # [VarField] the splat on the right-hand side + attr_reader :right + + # [Location] the location of this node + attr_reader :location + + def initialize(constant:, left:, values:, right:, location:) + @constant = constant + @left = left + @values = values + @right = right + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('fndptn') + + if constant + q.breakable + q.pp(constant) + end + + q.breakable + q.pp(left) + + q.breakable + q.group(2, '(', ')') { q.seplist(values) { |value| q.pp(value) } } + + q.breakable + q.pp(right) + end + end + + def to_json(*opts) + { + type: :fndptn, + constant: constant, + left: left, + values: values, + right: right, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_fndptn: ( + # (nil | untyped) constant, + # VarField left, + # Array[untyped] values, + # VarField right + # ) -> FndPtn + def on_fndptn(constant, left, values, right) + beginning = constant || find_scanner_event(LBracket) + ending = find_scanner_event(RBracket) + + FndPtn.new( + constant: constant, + left: left, + values: values, + right: right, + location: beginning.location.to(ending.location) + ) + end + + # For represents using a +for+ loop. + # + # for value in list do + # end + # + class For + # [MLHS | MLHSAddStar | VarField] the variable declaration being used to + # pull values out of the object being enumerated + attr_reader :iterator + + # [untyped] the object being enumerated in the loop + attr_reader :enumerable + + # [Statements] the statements to be executed + attr_reader :statements + + # [Location] the location of this node + attr_reader :location + + def initialize(iterator:, enumerable:, statements:, location:) + @iterator = iterator + @enumerable = enumerable + @statements = statements + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('for') + + q.breakable + q.pp(iterator) + + q.breakable + q.pp(enumerable) + + q.breakable + q.pp(statements) + end + end + + def to_json(*opts) + { + type: :for, + iterator: iterator, + enumerable: enumerable, + stmts: statements, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_for: ( + # (MLHS | MLHSAddStar | VarField) iterator, + # untyped enumerable, + # Statements statements + # ) -> For + def on_for(iterator, enumerable, statements) + beginning = find_scanner_event(Kw, 'for') + ending = find_scanner_event(Kw, 'end') + + # Consume the do keyword if it exists so that it doesn't get confused for + # some other block + keyword = find_scanner_event(Kw, 'do', consume: false) + if keyword && keyword.location.start_char > enumerable.location.end_char && + keyword.location.end_char < ending.location.start_char + scanner_events.delete(keyword) + end + + statements.bind( + (keyword || enumerable).location.end_char, + ending.location.start_char + ) + + For.new( + iterator: iterator, + enumerable: enumerable, + statements: statements, + location: beginning.location.to(ending.location) + ) + end + + # GVar represents a global variable literal. + # + # $variable + # + class GVar + # [String] the name of the global variable + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('gvar') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@gvar, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_gvar: (String value) -> GVar + def on_gvar(value) + node = + GVar.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # HashLiteral represents a hash literal. + # + # { key => value } + # + class HashLiteral + # [nil | AssocListFromArgs] the contents of the hash + attr_reader :contents + + # [Location] the location of this node + attr_reader :location + + def initialize(contents:, location:) + @contents = contents + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('hash') + + q.breakable + q.pp(contents) + end + end + + def to_json(*opts) + { type: :hash, cnts: contents, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_hash: ((nil | AssocListFromArgs) contents) -> HashLiteral + def on_hash(contents) + lbrace = find_scanner_event(LBrace) + rbrace = find_scanner_event(RBrace) + + if contents + # Here we're going to expand out the location information for the contents + # node so that it can grab up any remaining comments inside the hash. + location = + Location.new( + start_line: contents.location.start_line, + start_char: lbrace.location.end_char, + end_line: contents.location.end_line, + end_char: rbrace.location.start_char + ) + + contents = contents.class.new(assocs: contents.assocs, location: location) + end + + HashLiteral.new( + contents: contents, + location: lbrace.location.to(rbrace.location) + ) + end + + # Heredoc represents a heredoc string literal. + # + # <<~DOC + # contents + # DOC + # + class Heredoc + # [HeredocBeg] the opening of the heredoc + attr_reader :beginning + + # [String] the ending of the heredoc + attr_reader :ending + + # [Array[StringEmbExpr | StringDVar | TStringContent]] the parts of the + # heredoc string literal + attr_reader :parts + + # [Location] the location of this node + attr_reader :location + + def initialize(beginning:, ending: nil, parts: [], location:) + @beginning = beginning + @ending = ending + @parts = parts + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('heredoc') + + q.breakable + q.group(2, '(', ')') { q.seplist(parts) { |part| q.pp(part) } } + end + end + + def to_json(*opts) + { + type: :heredoc, + beging: beginning, + ending: ending, + parts: parts, + loc: location + }.to_json(*opts) + end + end + + # HeredocBeg represents the beginning declaration of a heredoc. + # + # <<~DOC + # contents + # DOC + # + # In the example above the HeredocBeg node represents <<~DOC. + class HeredocBeg + # [String] the opening declaration of the heredoc + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('heredoc_beg') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@heredoc_beg, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_heredoc_beg: (String value) -> HeredocBeg + def on_heredoc_beg(value) + location = + Location.token(line: lineno, char: char_pos, size: value.size + 1) + + # Here we're going to artificially create an extra node type so that if + # there are comments after the declaration of a heredoc, they get printed. + beginning = HeredocBeg.new(value: value, location: location) + @heredocs << Heredoc.new(beginning: beginning, location: location) + + beginning + end + + # :call-seq: + # on_heredoc_dedent: (StringContent string, Integer width) -> Heredoc + def on_heredoc_dedent(string, width) + heredoc = @heredocs[-1] + + @heredocs[-1] = + Heredoc.new( + beginning: heredoc.beginning, + ending: heredoc.ending, + parts: string.parts, + location: heredoc.location + ) + end + + # :call-seq: + # on_heredoc_end: (String value) -> Heredoc + def on_heredoc_end(value) + heredoc = @heredocs[-1] + + @heredocs[-1] = + Heredoc.new( + beginning: heredoc.beginning, + ending: value.chomp, + parts: heredoc.parts, + location: + Location.new( + start_line: heredoc.location.start_line, + start_char: heredoc.location.start_char, + end_line: lineno, + end_char: char_pos + ) + ) + end + + # HshPtn represents matching against a hash pattern using the Ruby 2.7+ + # pattern matching syntax. + # + # case value + # in { key: } + # end + # + class HshPtn + # [nil | untyped] the optional constant wrapper + attr_reader :constant + + # [Array[[Label, untyped]]] the set of tuples representing the keywords that + # should be matched against in the pattern + attr_reader :keywords + + # [nil | VarField] an optional parameter to gather up all remaining keywords + attr_reader :keyword_rest + + # [Location] the location of this node + attr_reader :location + + def initialize(constant:, keywords:, keyword_rest:, location:) + @constant = constant + @keywords = keywords + @keyword_rest = keyword_rest + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('hshptn') + + if constant + q.breakable + q.pp(constant) + end + + if keywords.any? + q.breakable + q.group(2, '(', ')') do + q.seplist(keywords) { |keyword| q.pp(keyword) } + end + end + + if keyword_rest + q.breakable + q.pp(keyword_rest) + end + end + end + + def to_json(*opts) + { + type: :hshptn, + constant: constant, + keywords: keywords, + kwrest: keyword_rest, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_hshptn: ( + # (nil | untyped) constant, + # Array[[Label, untyped]] keywords, + # (nil | VarField) keyword_rest + # ) -> HshPtn + def on_hshptn(constant, keywords, keyword_rest) + parts = [constant, keywords, keyword_rest].flatten(2).compact + + HshPtn.new( + constant: constant, + keywords: keywords, + keyword_rest: keyword_rest, + location: parts[0].location.to(parts[-1].location) + ) + end + + # Ident represents an identifier anywhere in code. It can represent a very + # large number of things, depending on where it is in the syntax tree. + # + # value + # + class Ident + # [String] the value of the identifier + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('ident') + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { + type: :@ident, + value: value.force_encoding('UTF-8'), + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_ident: (String value) -> Ident + def on_ident(value) + node = + Ident.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # If represents the first clause in an +if+ chain. + # + # if predicate + # end + # + class If + # [untyped] the expression to be checked + attr_reader :predicate + + # [Statements] the expressions to be executed + attr_reader :statements + + # [nil, Elsif, Else] the next clause in the chain + attr_reader :consequent + + # [Location] the location of this node + attr_reader :location + + def initialize(predicate:, statements:, consequent:, location:) + @predicate = predicate + @statements = statements + @consequent = consequent + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('if') + + q.breakable + q.pp(predicate) + + q.breakable + q.pp(statements) + + if consequent + q.breakable + q.pp(consequent) + end + end + end + + def to_json(*opts) + { + type: :if, + pred: predicate, + stmts: statements, + cons: consequent, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_if: ( + # untyped predicate, + # Statements statements, + # (nil | Elsif | Else) consequent + # ) -> If + def on_if(predicate, statements, consequent) + beginning = find_scanner_event(Kw, 'if') + ending = consequent || find_scanner_event(Kw, 'end') + + statements.bind(predicate.location.end_char, ending.location.start_char) + + If.new( + predicate: predicate, + statements: statements, + consequent: consequent, + location: beginning.location.to(ending.location) + ) + end + + # IfOp represents a ternary clause. + # + # predicate ? truthy : falsy + # + class IfOp + # [untyped] the expression to be checked + attr_reader :predicate + + # [untyped] the expression to be executed if the predicate is truthy + attr_reader :truthy + + # [untyped] the expression to be executed if the predicate is falsy + attr_reader :falsy + + # [Location] the location of this node + attr_reader :location + + def initialize(predicate:, truthy:, falsy:, location:) + @predicate = predicate + @truthy = truthy + @falsy = falsy + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('ifop') + + q.breakable + q.pp(predicate) + + q.breakable + q.pp(truthy) + + q.breakable + q.pp(falsy) + end + end + + def to_json(*opts) + { + type: :ifop, + pred: predicate, + tthy: truthy, + flsy: falsy, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_ifop: (untyped predicate, untyped truthy, untyped falsy) -> IfOp + def on_ifop(predicate, truthy, falsy) + IfOp.new( + predicate: predicate, + truthy: truthy, + falsy: falsy, + location: predicate.location.to(falsy.location) + ) + end + + # IfMod represents the modifier form of an +if+ statement. + # + # expression if predicate + # + class IfMod + # [untyped] the expression to be executed + attr_reader :statement + + # [untyped] the expression to be checked + attr_reader :predicate + + # [Location] the location of this node + attr_reader :location + + def initialize(statement:, predicate:, location:) + @statement = statement + @predicate = predicate + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('if_mod') + + q.breakable + q.pp(statement) + + q.breakable + q.pp(predicate) + end + end + + def to_json(*opts) + { + type: :if_mod, + stmt: statement, + pred: predicate, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_if_mod: (untyped predicate, untyped statement) -> IfMod + def on_if_mod(predicate, statement) + find_scanner_event(Kw, 'if') + + IfMod.new( + statement: statement, + predicate: predicate, + location: statement.location.to(predicate.location) + ) + end + + # def on_ignored_nl(value) + # value + # end + + # def on_ignored_sp(value) + # value + # end + + # Imaginary represents an imaginary number literal. + # + # 1i + # + class Imaginary + # [String] the value of the imaginary number literal + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('imaginary') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@imaginary, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_imaginary: (String value) -> Imaginary + def on_imaginary(value) + node = + Imaginary.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # In represents using the +in+ keyword within the Ruby 2.7+ pattern matching + # syntax. + # + # case value + # in pattern + # end + # + class In + # [untyped] the pattern to check against + attr_reader :pattern + + # [Statements] the expressions to execute if the pattern matched + attr_reader :statements + + # [nil | In | Else] the next clause in the chain + attr_reader :consequent + + # [Location] the location of this node + attr_reader :location + + def initialize(pattern:, statements:, consequent:, location:) + @pattern = pattern + @statements = statements + @consequent = consequent + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('in') + + q.breakable + q.pp(pattern) + + q.breakable + q.pp(statements) + + if consequent + q.breakable + q.pp(consequent) + end + end + end + + def to_json(*opts) + { + type: :in, + pttn: pattern, + stmts: statements, + cons: consequent, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_in: (RAssign pattern, nil statements, nil consequent) -> RAssign + # | ( + # untyped pattern, + # Statements statements, + # (nil | In | Else) consequent + # ) -> In + def on_in(pattern, statements, consequent) + # Here we have a rightward assignment + return pattern unless statements + + beginning = find_scanner_event(Kw, 'in') + ending = consequent || find_scanner_event(Kw, 'end') + + statements.bind(beginning.location.end_char, ending.location.start_char) + + In.new( + pattern: pattern, + statements: statements, + consequent: consequent, + location: beginning.location.to(ending.location) + ) + end + + # Int represents an integer number literal. + # + # 1 + # + class Int + # [String] the value of the integer + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('int') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@int, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_int: (String value) -> Int + def on_int(value) + node = + Int.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # IVar represents an instance variable literal. + # + # @variable + # + class IVar + # [String] the name of the instance variable + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('ivar') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@ivar, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_ivar: (String value) -> IVar + def on_ivar(value) + node = + IVar.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # Kw represents the use of a keyword. It can be almost anywhere in the syntax + # tree, so you end up seeing it quite a lot. + # + # if value + # end + # + # In the above example, there would be two Kw nodes: one for the if and one + # for the end. Note that anything that matches the list of keywords in Ruby + # will use a Kw, so if you use a keyword in a symbol literal for instance: + # + # :if + # + # then the contents of the symbol node will contain a Kw node. + class Kw + # [String] the value of the keyword + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('kw') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@kw, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_kw: (String value) -> Kw + def on_kw(value) + node = + Kw.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # KwRestParam represents defining a parameter in a method definition that + # accepts all remaining keyword parameters. + # + # def method(**kwargs) end + # + class KwRestParam + # [nil | Ident] the name of the parameter + attr_reader :name + + # [Location] the location of this node + attr_reader :location + + def initialize(name:, location:) + @name = name + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('kwrest_param') + + q.breakable + q.pp(name) + end + end + + def to_json(*opts) + { type: :kwrest_param, name: name, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_kwrest_param: ((nil | Ident) name) -> KwRestParam + def on_kwrest_param(name) + location = find_scanner_event(Op, '**').location + location = location.to(name.location) if name + + KwRestParam.new(name: name, location: location) + end + + # Label represents the use of an identifier to associate with an object. You + # can find it in a hash key, as in: + # + # { key: value } + # + # In this case "key:" would be the body of the label. You can also find it in + # pattern matching, as in: + # + # case value + # in key: + # end + # + # In this case "key:" would be the body of the label. + class Label + # [String] the value of the label + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('label') + + q.breakable + q.text(':') + q.text(value[0...-1]) + end + end + + def to_json(*opts) + { type: :@label, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_label: (String value) -> Label + def on_label(value) + node = + Label.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # LabelEnd represents the end of a dynamic symbol. + # + # { "key": value } + # + # In the example above, LabelEnd represents the "\":" token at the end of the + # hash key. This node is important for determining the type of quote being + # used by the label. + class LabelEnd + # [String] the end of the label + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('label_end') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@label_end, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_label_end: (String value) -> LabelEnd + def on_label_end(value) + node = + LabelEnd.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # Lambda represents using a lambda literal (not the lambda method call). + # + # ->(value) { value * 2 } + # + class Lambda + # [Params | Paren] the parameter declaration for this lambda + attr_reader :params + + # [BodyStmt | Statements] the expressions to be executed in this lambda + attr_reader :statements + + # [Location] the location of this node + attr_reader :location + + def initialize(params:, statements:, location:) + @params = params + @statements = statements + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('lambda') + + q.breakable + q.pp(params) + + q.breakable + q.pp(statements) + end + end + + def to_json(*opts) + { + type: :lambda, + params: params, + stmts: statements, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_lambda: ( + # (Params | Paren) params, + # (BodyStmt | Statements) statements + # ) -> Lambda + def on_lambda(params, statements) + beginning = find_scanner_event(TLambda) + + if node = find_scanner_event(TLamBeg, consume: false) + opening = scanner_events.delete(node) + closing = find_scanner_event(RBrace) + else + opening = find_scanner_event(Kw, 'do') + closing = find_scanner_event(Kw, 'end') + end + + statements.bind(opening.location.end_char, closing.location.start_char) + + Lambda.new( + params: params, + statements: statements, + location: beginning.location.to(closing.location) + ) + end + + # LBrace represents the use of a left brace, i.e., {. + class LBrace + # [String] the left brace + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('lbrace') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@lbrace, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_lbrace: (String value) -> LBrace + def on_lbrace(value) + node = + LBrace.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # LBracket represents the use of a left bracket, i.e., [. + class LBracket + # [String] the left bracket + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('lbracket') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@lbracket, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_lbracket: (String value) -> LBracket + def on_lbracket(value) + node = + LBracket.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # LParen represents the use of a left parenthesis, i.e., (. + class LParen + # [String] the left parenthesis + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('lparen') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@lparen, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_lparen: (String value) -> LParen + def on_lparen(value) + node = + LParen.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # def on_magic_comment(key, value) + # [key, value] + # end + + # MAssign is a parent node of any kind of multiple assignment. This includes + # splitting out variables on the left like: + # + # first, second, third = value + # + # as well as splitting out variables on the right, as in: + # + # value = first, second, third + # + # Both sides support splats, as well as variables following them. There's also + # destructuring behavior that you can achieve with the following: + # + # first, = value + # + class MAssign + # [Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen] the target of the multiple + # assignment + attr_reader :target + + # [untyped] the value being assigned + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(target:, value:, location:) + @target = target + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('massign') + + q.breakable + q.pp(target) + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :massign, tgt: target, val: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_massign: ( + # (Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen) target, + # untyped value + # ) -> MAssign + def on_massign(target, value) + comma_range = target.location.end_char...value.location.start_char + target.comma = true if source[comma_range].strip.start_with?(',') + + MAssign.new( + target: target, + value: value, + location: target.location.to(value.location) + ) + end + + # MethodAddArg represents a method call with arguments and parentheses. + # + # method(argument) + # + # MethodAddArg can also represent with a method on an object, as in: + # + # object.method(argument) + # + # Finally, MethodAddArg can represent calling a method with no receiver that + # ends in a ?. In this case, the parser knows it's a method call and not a + # local variable, so it uses a MethodAddArg node as opposed to a VCall node, + # as in: + # + # method? + # + class MethodAddArg + # [Call | FCall] the method call + attr_reader :call + + # [ArgParen | Args | ArgsAddBlock] the arguments to the method call + attr_reader :arguments + + # [Location] the location of this node + attr_reader :location + + def initialize(call:, arguments:, location:) + @call = call + @arguments = arguments + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('method_add_arg') + + q.breakable + q.pp(call) + + q.breakable + q.pp(arguments) + end + end + + def to_json(*opts) + { + type: :method_add_arg, + call: call, + args: arguments, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_method_add_arg: ( + # (Call | FCall) call, + # (ArgParen | Args | ArgsAddBlock) arguments + # ) -> MethodAddArg + def on_method_add_arg(call, arguments) + location = call.location + + location = location.to(arguments.location) unless arguments.is_a?(Args) + + MethodAddArg.new(call: call, arguments: arguments, location: location) + end + + # MethodAddBlock represents a method call with a block argument. + # + # method {} + # + class MethodAddBlock + # [Call | Command | CommandCall | FCall | MethodAddArg] the method call + attr_reader :call + + # [BraceBlock | DoBlock] the block being sent with the method call + attr_reader :block + + # [Location] the location of this node + attr_reader :location + + def initialize(call:, block:, location:) + @call = call + @block = block + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('method_add_block') + + q.breakable + q.pp(call) + + q.breakable + q.pp(block) + end + end + + def to_json(*opts) + { + type: :method_add_block, + call: call, + block: block, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_method_add_block: ( + # (Call | Command | CommandCall | FCall | MethodAddArg) call, + # (BraceBlock | DoBlock) block + # ) -> MethodAddBlock + def on_method_add_block(call, block) + MethodAddBlock.new( + call: call, + block: block, + location: call.location.to(block.location) + ) + end + + # MLHS represents a list of values being destructured on the left-hand side + # of a multiple assignment. + # + # first, second, third = value + # + class MLHS + # Array[ArefField | Field | Identifier | MlhsParen | VarField] the parts of + # the left-hand side of a multiple assignment + attr_reader :parts + + # [boolean] whether or not there is a trailing comma at the end of this + # list, which impacts destructuring. It's an attr_accessor so that while + # the syntax tree is being built it can be set by its parent node + attr_accessor :comma + + # [Location] the location of this node + attr_reader :location + + def initialize(parts:, comma: false, location:) + @parts = parts + @comma = comma + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('mlhs') + + q.breakable + q.group(2, '(', ')') { q.seplist(parts) { |part| q.pp(part) } } + end + end + + def to_json(*opts) + { type: :mlhs, parts: parts, comma: comma, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_mlhs_add: ( + # MLHS mlhs, + # (ArefField | Field | Identifier | MlhsParen | VarField) part + # ) -> MLHS + def on_mlhs_add(mlhs, part) + if mlhs.parts.empty? + MLHS.new(parts: [part], location: part.location) + else + MLHS.new( + parts: mlhs.parts << part, + location: mlhs.location.to(part.location) + ) + end + end + + # MLHSAddPost represents adding another set of variables onto a list of + # assignments after a splat variable within a multiple assignment. + # + # left, *middle, right = values + # + class MLHSAddPost + # [MlhsAddStar] the value being starred + attr_reader :star + + # [Mlhs] the values after the star + attr_reader :mlhs + + # [Location] the location of this node + attr_reader :location + + def initialize(star:, mlhs:, location:) + @star = star + @mlhs = mlhs + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('mlhs_add_post') + + q.breakable + q.pp(star) + + q.breakable + q.pp(mlhs) + end + end + + def to_json(*opts) + { type: :mlhs_add_post, star: star, mlhs: mlhs, loc: location }.to_json( + *opts + ) + end + end + + # :call-seq: + # on_mlhs_add_post: (MLHSAddStar star, MLHS mlhs) -> MLHSAddPost + def on_mlhs_add_post(star, mlhs) + MLHSAddPost.new( + star: star, + mlhs: mlhs, + location: star.location.to(mlhs.location) + ) + end + + # MLHSAddStar represents a splatted variable inside of a multiple assignment + # on the left hand side. + # + # first, *rest = values + # + class MLHSAddStar + # [MLHS] the values before the starred expression + attr_reader :mlhs + + # [nil | ArefField | Field | Identifier | VarField] the expression being + # splatted + attr_reader :star + + # [Location] the location of this node + attr_reader :location + + def initialize(mlhs:, star:, location:) + @mlhs = mlhs + @star = star + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('mlhs_add_star') + + q.breakable + q.pp(mlhs) + + q.breakable + q.pp(star) + end + end + + def to_json(*opts) + { type: :mlhs_add_star, mlhs: mlhs, star: star, loc: location }.to_json( + *opts + ) + end + end + + # :call-seq: + # on_mlhs_add_star: ( + # MLHS mlhs, + # (nil | ArefField | Field | Identifier | VarField) part + # ) -> MLHSAddStar + def on_mlhs_add_star(mlhs, part) + beginning = find_scanner_event(Op, '*') + ending = part || beginning + + MLHSAddStar.new( + mlhs: mlhs, + star: part, + location: beginning.location.to(ending.location) + ) + end + + # :call-seq: + # on_mlhs_new: () -> MLHS + def on_mlhs_new + MLHS.new(parts: [], location: Location.fixed(line: lineno, char: char_pos)) + end + + # MLHSParen represents parentheses being used to destruct values in a multiple + # assignment on the left hand side. + # + # (left, right) = value + # + class MLHSParen + # [Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen] the contents inside of the + # parentheses + attr_reader :contents + + # [Location] the location of this node + attr_reader :location + + def initialize(contents:, location:) + @contents = contents + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('mlhs_paren') + + q.breakable + q.pp(contents) + end + end + + def to_json(*opts) + { type: :mlhs_paren, cnts: contents, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_mlhs_paren: ( + # (Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen) contents + # ) -> MLHSParen + def on_mlhs_paren(contents) + lparen = find_scanner_event(LParen) + rparen = find_scanner_event(RParen) + + comma_range = lparen.location.end_char...rparen.location.start_char + contents.comma = true if source[comma_range].strip.end_with?(',') + + MLHSParen.new( + contents: contents, + location: lparen.location.to(rparen.location) + ) + end + + # ModuleDeclaration represents defining a module using the +module+ keyword. + # + # module Namespace + # end + # + class ModuleDeclaration + # [ConstPathRef | ConstRef | TopConstRef] the name of the module + attr_reader :constant + + # [BodyStmt] the expressions to be executed in the context of the module + attr_reader :bodystmt + + # [Location] the location of this node + attr_reader :location + + def initialize(constant:, bodystmt:, location:) + @constant = constant + @bodystmt = bodystmt + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('module') + + q.breakable + q.pp(constant) + + q.breakable + q.pp(bodystmt) + end + end + + def to_json(*opts) + { + type: :module, + constant: constant, + bodystmt: bodystmt, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_module: ( + # (ConstPathRef | ConstRef | TopConstRef) constant, + # BodyStmt bodystmt + # ) -> ModuleDeclaration + def on_module(constant, bodystmt) + beginning = find_scanner_event(Kw, 'module') + ending = find_scanner_event(Kw, 'end') + + bodystmt.bind( + find_next_statement_start(constant.location.end_char), + ending.location.start_char + ) + + ModuleDeclaration.new( + constant: constant, + bodystmt: bodystmt, + location: beginning.location.to(ending.location) + ) + end + + # MRHS represents the values that are being assigned on the right-hand side of + # a multiple assignment. + # + # values = first, second, third + # + class MRHS + # Array[untyped] the parts that are being assigned + attr_reader :parts + + # [Location] the location of this node + attr_reader :location + + def initialize(parts:, location:) + @parts = parts + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('mrhs') + + q.breakable + q.group(2, '(', ')') { q.seplist(parts) { |part| q.pp(part) } } + end + end + + def to_json(*opts) + { type: :mrhs, parts: parts, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_mrhs_new: () -> MRHS + def on_mrhs_new + MRHS.new(parts: [], location: Location.fixed(line: lineno, char: char_pos)) + end + + # :call-seq: + # on_mrhs_add: (MRHS mrhs, untyped part) -> MRHS + def on_mrhs_add(mrhs, part) + if mrhs.is_a?(MRHSNewFromArgs) + MRHS.new( + parts: [*mrhs.arguments.parts, part], + location: mrhs.location.to(part.location) + ) + elsif mrhs.parts.empty? + MRHS.new(parts: [part], location: mrhs.location) + else + MRHS.new(parts: mrhs.parts << part, loc: mrhs.location.to(part.location)) + end + end + + # MRHSAddStar represents using the splat operator to expand out a value on the + # right hand side of a multiple assignment. + # + # values = first, *rest + # + class MRHSAddStar + # [MRHS | MRHSNewFromArgs] the values before the splatted expression + attr_reader :mrhs + + # [untyped] the splatted expression + attr_reader :star + + # [Location] the location of this node + attr_reader :location + + def initialize(mrhs:, star:, location:) + @mrhs = mrhs + @star = star + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('mrhs_add_star') + + q.breakable + q.pp(mrhs) + + q.breakable + q.pp(star) + end + end + + def to_json(*opts) + { type: :mrhs_add_star, mrhs: mrhs, star: star, loc: location }.to_json( + *opts + ) + end + end + + # :call-seq: + # on_mrhs_add_star: ( + # (MRHS | MRHSNewFromArgs) mrhs, + # untyped star + # ) -> MRHSAddStar + def on_mrhs_add_star(mrhs, star) + beginning = find_scanner_event(Op, '*') + ending = star || beginning + + MRHSAddStar.new( + mrhs: mrhs, + star: star, + location: beginning.location.to(ending.location) + ) + end + + # MRHSNewFromArgs represents the shorthand of a multiple assignment that + # allows you to assign values using just commas as opposed to assigning from + # an array. + # + # values = first, second, third + # + class MRHSNewFromArgs + # [Args | ArgsAddStar] the arguments being used in the assignment + attr_reader :arguments + + # [Location] the location of this node + attr_reader :location + + def initialize(arguments:, location:) + @arguments = arguments + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('mrhs_new_from_args') + + q.breakable + q.pp(arguments) + end + end + + def to_json(*opts) + { type: :mrhs_new_from_args, args: arguments, loc: location }.to_json( + *opts + ) + end + end + + # :call-seq: + # on_mrhs_new_from_args: ((Args | ArgsAddStar) arguments) -> MRHSNewFromArgs + def on_mrhs_new_from_args(arguments) + MRHSNewFromArgs.new(arguments: arguments, location: arguments.location) + end + + # Next represents using the +next+ keyword. + # + # next + # + # The +next+ keyword can also optionally be called with an argument: + # + # next value + # + # +next+ can even be called with multiple arguments, but only if parentheses + # are omitted, as in: + # + # next first, second, third + # + # If a single value is being given, parentheses can be used, as in: + # + # next(value) + # + class Next + # [Args | ArgsAddBlock] the arguments passed to the next keyword + attr_reader :arguments + + # [Location] the location of this node + attr_reader :location + + def initialize(arguments:, location:) + @arguments = arguments + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('next') + + q.breakable + q.pp(arguments) + end + end + + def to_json(*opts) + { type: :next, args: arguments, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_next: ((Args | ArgsAddBlock) arguments) -> Next + def on_next(arguments) + keyword = find_scanner_event(Kw, 'next') + + location = keyword.location + location = location.to(arguments.location) unless arguments.is_a?(Args) + + Next.new(arguments: arguments, location: location) + end + + # def on_nl(value) + # value + # end + + # def on_nokw_param(value) + # value + # end + + # Op represents an operator literal in the source. + # + # 1 + 2 + # + # In the example above, the Op node represents the + operator. + class Op + # [String] the operator + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('op') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@op, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_op: (String value) -> Op + def on_op(value) + node = + Op.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # OpAssign represents assigning a value to a variable or constant using an + # operator like += or ||=. + # + # variable += value + # + class OpAssign + # [ArefField | ConstPathField | Field | TopConstField | VarField] the target + # to assign the result of the expression to + attr_reader :target + + # [Op] the operator being used for the assignment + attr_reader :operator + + # [untyped] the expression to be assigned + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(target:, operator:, value:, location:) + @target = target + @operator = operator + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('opassign') + + q.breakable + q.pp(target) + + q.breakable + q.pp(operator) + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { + type: :opassign, + target: target, + operator: operator, + value: value, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_opassign: ( + # (ArefField | ConstPathField | Field | TopConstField | VarField) target, + # Op operator, + # untyped value + # ) -> OpAssign + def on_opassign(target, operator, value) + OpAssign.new( + target: target, + operator: operator, + value: value, + location: target.location.to(value.location) + ) + end + + # def on_operator_ambiguous(value) + # value + # end + + # Params represents defining parameters on a method or lambda. + # + # def method(param) end + # + class Params + # [Array[Ident]] any required parameters + attr_reader :requireds + + # [Array[[Ident, untyped]]] any optional parameters and their default values + attr_reader :optionals + + # [nil | ArgsForward | ExcessedComma | RestParam] the optional rest + # parameter + attr_reader :rest + + # Array[Ident] any positional parameters that exist after a rest parameter + attr_reader :posts + + # Array[[Ident, nil | untyped]] any keyword parameters and their optional + # default values + attr_reader :keywords + + # [nil | :nil | KwRestParam] the optional keyword rest parameter + attr_reader :keyword_rest + + # [nil | BlockArg] the optional block parameter + attr_reader :block + + # [Location] the location of this node + attr_reader :location + + def initialize( + requireds: [], + optionals: [], + rest: nil, + posts: [], + keywords: [], + keyword_rest: nil, + block: nil, + location: + ) + @requireds = requireds + @optionals = optionals + @rest = rest + @posts = posts + @keywords = keywords + @keyword_rest = keyword_rest + @block = block + @location = location + end + + # Params nodes are the most complicated in the tree. Occasionally you want + # to know if they are "empty", which means not having any parameters + # declared. This logic accesses every kind of parameter and determines if + # it's missing. + def empty? + requireds.empty? && optionals.empty? && !rest && posts.empty? && + keywords.empty? && !keyword_rest && !block + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('params') + + if requireds.any? + q.breakable + q.group(2, '(', ')') { q.seplist(requireds) { |name| q.pp(name) } } + end + + if optionals.any? + q.breakable + q.group(2, '(', ')') do + q.seplist(optionals) do |(name, default)| + q.pp(name) + q.text('=') + q.group(2) do + q.breakable('') + q.pp(default) + end + end + end + end + + if rest + q.breakable + q.pp(rest) + end + + if posts.any? + q.breakable + q.group(2, '(', ')') { q.seplist(posts) { |value| q.pp(value) } } + end + + if keywords.any? + q.breakable + q.group(2, '(', ')') do + q.seplist(keywords) do |(name, default)| + q.pp(name) + + if default + q.text('=') + q.group(2) do + q.breakable('') + q.pp(default) + end + end + end + end + end + + if keyword_rest + q.breakable + q.pp(keyword_rest) + end + + if block + q.breakable + q.pp(block) + end + end + end + + def to_json(*opts) + { + type: :params, + reqs: requireds, + opts: optionals, + rest: rest, + posts: posts, + keywords: keywords, + kwrest: keyword_rest, + block: block, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_params: ( + # (nil | Array[Ident]) requireds, + # (nil | Array[[Ident, untyped]]) optionals, + # (nil | ArgsForward | ExcessedComma | RestParam) rest, + # (nil | Array[Ident]) posts, + # (nil | Array[[Ident, nil | untyped]]) keywords, + # (nil | :nil | KwRestParam) keyword_rest, + # (nil | BlockArg) block + # ) -> Params + def on_params( + requireds, + optionals, + rest, + posts, + keywords, + keyword_rest, + block + ) + parts = [ + *requireds, + *optionals&.flatten(1), + rest, + *posts, + *keywords&.flat_map { |(key, value)| [key, value || nil] }, + (keyword_rest if keyword_rest != :nil), + block + ].compact + + location = + if parts.any? + parts[0].location.to(parts[-1].location) + else + Location.fixed(line: lineno, char: char_pos) + end + + Params.new( + requireds: requireds || [], + optionals: optionals || [], + rest: rest, + posts: posts || [], + keywords: keywords || [], + keyword_rest: keyword_rest, + block: block, + location: location + ) + end + + # Paren represents using balanced parentheses in a couple places in a Ruby + # program. In general parentheses can be used anywhere a Ruby expression can + # be used. + # + # (1 + 2) + # + class Paren + # [LParen] the left parenthesis that opened this statement + attr_reader :lparen + + # [untyped] the expression inside the parentheses + attr_reader :contents + + # [Location] the location of this node + attr_reader :location + + def initialize(lparen:, contents:, location:) + @lparen = lparen + @contents = contents + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('paren') + + q.breakable + q.pp(contents) + end + end + + def to_json(*opts) + { type: :paren, lparen: lparen, cnts: contents, loc: location }.to_json( + *opts + ) + end + end + + # :call-seq: + # on_paren: (untyped contents) -> Paren + def on_paren(contents) + lparen = find_scanner_event(LParen) + rparen = find_scanner_event(RParen) + + if contents && contents.is_a?(Params) + location = contents.location + location = + Location.new( + start_line: location.start_line, + start_char: find_next_statement_start(lparen.location.end_char), + end_line: location.end_line, + end_char: rparen.location.start_char + ) + + contents = + Params.new( + requireds: contents.requireds, + optionals: contents.optionals, + rest: contents.rest, + posts: contents.posts, + keywords: contents.keywords, + keyword_rest: contents.keyword_rest, + block: contents.block, + location: location + ) + end + + Paren.new( + lparen: lparen, + contents: contents, + location: lparen.location.to(rparen.location) + ) + end + + # If we encounter a parse error, just immediately bail out so that our runner + # can catch it. + def on_parse_error(error, *) + raise ParserError.new(error, lineno, column) + end + alias on_alias_error on_parse_error + alias on_assign_error on_parse_error + alias on_class_name_error on_parse_error + alias on_param_error on_parse_error + + # Period represents the use of the +.+ operator. It is usually found in method + # calls. + class Period + # [String] the period + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('period') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@period, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_period: (String value) -> Period + def on_period(value) + Period.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + end + + # Program represents the overall syntax tree. + class Program + # [Statements] the top-level expressions of the program + attr_reader :statements + + # [Array[Comment | EmbDoc]] the comments inside the program + attr_reader :comments + + # [Location] the location of this node + attr_reader :location + + def initialize(statements:, comments:, location:) + @statements = statements + @comments = comments + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('program') + + q.breakable + q.pp(statements) + end + end + + def to_json(*opts) + { + type: :program, + stmts: statements, + comments: comments, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_program: (Statements statements) -> Program + def on_program(statements) + location = + Location.new( + start_line: 1, + start_char: 0, + end_line: lines.length, + end_char: source.length + ) + + statements.body << @__end__ if @__end__ + statements.bind(0, source.length) + + Program.new(statements: statements, comments: @comments, location: location) + end + + # QSymbols represents a symbol literal array without interpolation. + # + # %i[one two three] + # + class QSymbols + # [Array[TStringContent]] the elements of the array + attr_reader :elements + + # [Location] the location of this node + attr_reader :location + + def initialize(elements:, location:) + @elements = elements + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('qsymbols') + + q.breakable + q.group(2, '(', ')') { q.seplist(elements) { |element| q.pp(element) } } + end + end + + def to_json(*opts) + { type: :qsymbols, elems: elements, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_qsymbols_add: (QSymbols qsymbols, TStringContent element) -> QSymbols + def on_qsymbols_add(qsymbols, element) + QSymbols.new( + elements: qsymbols.elements << element, + location: qsymbols.location.to(element.location) + ) + end + + # QSymbolsBeg represents the beginning of a symbol literal array. + # + # %i[one two three] + # + # In the snippet above, QSymbolsBeg represents the "%i[" token. Note that + # these kinds of arrays can start with a lot of different delimiter types + # (e.g., %i| or %i<). + class QSymbolsBeg + # [String] the beginning of the array literal + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('qsymbols_beg') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@qsymbols_beg, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_qsymbols_beg: (String value) -> QSymbolsBeg + def on_qsymbols_beg(value) + node = + QSymbolsBeg.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # :call-seq: + # on_qsymbols_new: () -> QSymbols + def on_qsymbols_new + qsymbols_beg = find_scanner_event(QSymbolsBeg) + + QSymbols.new(elements: [], location: qsymbols_beg.location) + end + + # QWords represents a string literal array without interpolation. + # + # %w[one two three] + # + class QWords + # [Array[TStringContent]] the elements of the array + attr_reader :elements + + # [Location] the location of this node + attr_reader :location + + def initialize(elements:, location:) + @elements = elements + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('qwords') + + q.breakable + q.group(2, '(', ')') { q.seplist(elements) { |element| q.pp(element) } } + end + end + + def to_json(*opts) + { type: :qwords, elems: elements, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_qwords_add: (QWords qwords, TStringContent element) -> QWords + def on_qwords_add(qwords, element) + QWords.new( + elements: qwords.elements << element, + location: qwords.location.to(element.location) + ) + end + + # QWordsBeg represents the beginning of a string literal array. + # + # %w[one two three] + # + # In the snippet above, QWordsBeg represents the "%w[" token. Note that these + # kinds of arrays can start with a lot of different delimiter types (e.g., + # %w| or %w<). + class QWordsBeg + # [String] the beginning of the array literal + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('qwords_beg') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@qwords_beg, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_qwords_beg: (String value) -> QWordsBeg + def on_qwords_beg(value) + node = + QWordsBeg.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # :call-seq: + # on_qwords_new: () -> QWords + def on_qwords_new + qwords_beg = find_scanner_event(QWordsBeg) + + QWords.new(elements: [], location: qwords_beg.location) + end + + # Rational represents the use of a rational number literal. + # + # 1r + # + class Rational + # [String] the rational number literal + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('rational') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@rational, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_rational: (String value) -> Rational + def on_rational(value) + node = + Rational.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # RBrace represents the use of a right brace, i.e., +++. + class RBrace + # [String] the right brace + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('rbrace') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@rbrace, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_rbrace: (String value) -> RBrace + def on_rbrace(value) + node = + RBrace.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # RBracket represents the use of a right bracket, i.e., +]+. + class RBracket + # [String] the right bracket + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('rbracket') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@rbracket, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_rbracket: (String value) -> RBracket + def on_rbracket(value) + node = + RBracket.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # Redo represents the use of the +redo+ keyword. + # + # redo + # + class Redo + # [String] the value of the keyword + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('redo') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :redo, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_redo: () -> Redo + def on_redo + keyword = find_scanner_event(Kw, 'redo') + + Redo.new(value: keyword.value, location: keyword.location) + end + + # RegexpContent represents the body of a regular expression. + # + # /.+ #{pattern} .+/ + # + # In the example above, a RegexpContent node represents everything contained + # within the forward slashes. + class RegexpContent + # [String] the opening of the regular expression + attr_reader :beginning + + # [Array[StringDVar | StringEmbExpr | TStringContent]] the parts of the + # regular expression + attr_reader :parts + + # [Location] the location of this node + attr_reader :location + + def initialize(beginning:, parts:, location:) + @beginning = beginning + @parts = parts + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('regexp') + + q.breakable + q.group(2, '(', ')') { q.seplist(parts) { |part| q.pp(part) } } + end + end + + def to_json(*opts) + { type: :regexp, beging: beginning, parts: parts, loc: location }.to_json( + *opts + ) + end + end + + # :call-seq: + # on_regexp_add: ( + # RegexpContent regexp_content, + # (StringDVar | StringEmbExpr | TStringContent) part + # ) -> RegexpContent + def on_regexp_add(regexp_content, part) + RegexpContent.new( + beginning: regexp_content.beginning, + parts: regexp_content.parts << part, + location: regexp_content.location.to(part.location) + ) + end + + # RegexpBeg represents the start of a regular expression literal. + # + # /.+/ + # + # In the example above, RegexpBeg represents the first / token. Regular + # expression literals can also be declared using the %r syntax, as in: + # + # %r{.+} + # + class RegexpBeg + # [String] the beginning of the regular expression + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('regexp_beg') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@regexp_beg, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_regexp_beg: (String value) -> RegexpBeg + def on_regexp_beg(value) + node = + RegexpBeg.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # RegexpEnd represents the end of a regular expression literal. + # + # /.+/m + # + # In the example above, the RegexpEnd event represents the /m at the end of + # the regular expression literal. You can also declare regular expression + # literals using %r, as in: + # + # %r{.+}m + # + class RegexpEnd + # [String] the end of the regular expression + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('regexp_end') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@regexp_end, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_regexp_end: (String value) -> RegexpEnd + def on_regexp_end(value) + RegexpEnd.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + end + + # RegexpLiteral represents a regular expression literal. + # + # /.+/ + # + class RegexpLiteral + # [String] the beginning of the regular expression literal + attr_reader :beginning + + # [String] the ending of the regular expression literal + attr_reader :ending + + # [Array[StringEmbExpr | StringDVar | TStringContent]] the parts of the + # regular expression literal + attr_reader :parts + + # [Locatione] the location of this node + attr_reader :location + + def initialize(beginning:, ending:, parts:, location:) + @beginning = beginning + @ending = ending + @parts = parts + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('regexp_literal') + + q.breakable + q.group(2, '(', ')') { q.seplist(parts) { |part| q.pp(part) } } + end + end + + def to_json(*opts) + { + type: :regexp_literal, + beging: beginning, + ending: ending, + parts: parts, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_regexp_literal: ( + # RegexpContent regexp_content, + # RegexpEnd ending + # ) -> RegexpLiteral + def on_regexp_literal(regexp_content, ending) + RegexpLiteral.new( + beginning: regexp_content.beginning, + ending: ending.value, + parts: regexp_content.parts, + location: regexp_content.location.to(ending.location) + ) + end + + # :call-seq: + # on_regexp_new: () -> RegexpContent + def on_regexp_new + regexp_beg = find_scanner_event(RegexpBeg) + + RegexpContent.new( + beginning: regexp_beg.value, + parts: [], + location: regexp_beg.location + ) + end + + # RescueEx represents the list of exceptions being rescued in a rescue clause. + # + # begin + # rescue Exception => exception + # end + # + class RescueEx + # [untyped] the list of exceptions being rescued + attr_reader :exceptions + + # [nil | Field | VarField] the expression being used to capture the raised + # exception + attr_reader :variable + + # [Location] the location of this node + attr_reader :location + + def initialize(exceptions:, variable:, location:) + @exceptions = exceptions + @variable = variable + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('rescue_ex') + + q.breakable + q.pp(exceptions) + + q.breakable + q.pp(variable) + end + end + + def to_json(*opts) + { + type: :rescue_ex, + extns: exceptions, + var: variable, + loc: location + }.to_json(*opts) + end + end + + # Rescue represents the use of the rescue keyword inside of a BodyStmt node. + # + # begin + # rescue + # end + # + class Rescue + # [RescueEx] the exceptions being rescued + attr_reader :exception + + # [Statements] the expressions to evaluate when an error is rescued + attr_reader :statements + + # [nil | Rescue] the optional next clause in the chain + attr_reader :consequent + + # [Location] the location of this node + attr_reader :location + + def initialize(exception:, statements:, consequent:, location:) + @exception = exception + @statements = statements + @consequent = consequent + @location = location + end + + def bind_end(end_char) + @location = + Location.new( + start_line: location.start_line, + start_char: location.start_char, + end_line: location.end_line, + end_char: end_char + ) + + if consequent + consequent.bind_end(end_char) + statements.bind_end(consequent.location.start_char) + else + statements.bind_end(end_char) + end + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('rescue') + + if exception + q.breakable + q.pp(exception) + end + + q.breakable + q.pp(statements) + + if consequent + q.breakable + q.pp(consequent) + end + end + end + + def to_json(*opts) + { + type: :rescue, + extn: exception, + stmts: statements, + cons: consequent, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_rescue: ( + # (nil | [untyped] | MRHS | MRHSAddStar) exceptions, + # (nil | Field | VarField) variable, + # Statements statements, + # (nil | Rescue) consequent + # ) -> Rescue + def on_rescue(exceptions, variable, statements, consequent) + keyword = find_scanner_event(Kw, 'rescue') + exceptions = exceptions[0] if exceptions.is_a?(Array) + + last_node = variable || exceptions || keyword + statements.bind( + find_next_statement_start(last_node.location.end_char), + char_pos + ) + + # We add an additional inner node here that ripper doesn't provide so that + # we have a nice place to attach inline comments. But we only need it if we + # have an exception or a variable that we're rescuing. + rescue_ex = + if exceptions || variable + RescueEx.new( + exceptions: exceptions, + variable: variable, + location: + Location.new( + start_line: keyword.location.start_line, + start_char: keyword.location.end_char + 1, + end_line: last_node.location.end_line, + end_char: last_node.location.end_char + ) + ) + end + + Rescue.new( + exception: rescue_ex, + statements: statements, + consequent: consequent, + location: + Location.new( + start_line: keyword.location.start_line, + start_char: keyword.location.start_char, + end_line: lineno, + end_char: char_pos + ) + ) + end + + # RescueMod represents the use of the modifier form of a +rescue+ clause. + # + # expression rescue value + # + class RescueMod + # [untyped] the expression to execute + attr_reader :statement + + # [untyped] the value to use if the executed expression raises an error + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(statement:, value:, location:) + @statement = statement + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('rescue_mod') + + q.breakable + q.pp(statement) + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :rescue_mod, stmt: statement, val: value, loc: location }.to_json( + *opts + ) + end + end + + # :call-seq: + # on_rescue_mod: (untyped statement, untyped value) -> RescueMod + def on_rescue_mod(statement, value) + find_scanner_event(Kw, 'rescue') + + RescueMod.new( + statement: statement, + value: value, + location: statement.location.to(value.location) + ) + end + + # RestParam represents defining a parameter in a method definition that + # accepts all remaining positional parameters. + # + # def method(*rest) end + # + class RestParam + # [nil | Ident] the name of the parameter + attr_reader :name + + # [Location] the location of this node + attr_reader :location + + def initialize(name:, location:) + @name = name + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('rest_param') + + q.breakable + q.pp(name) + end + end + + def to_json(*opts) + { type: :rest_param, name: name, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_rest_param: ((nil | Ident) name) -> RestParam + def on_rest_param(name) + location = find_scanner_event(Op, '*').location + location = location.to(name.location) if name + + RestParam.new(name: name, location: location) + end + + # Retry represents the use of the +retry+ keyword. + # + # retry + # + class Retry + # [String] the value of the keyword + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('retry') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :retry, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_retry: () -> Retry + def on_retry + keyword = find_scanner_event(Kw, 'retry') + + Retry.new(value: keyword.value, location: keyword.location) + end + + # Return represents using the +return+ keyword with arguments. + # + # return value + # + class Return + # [Args | ArgsAddBlock] the arguments being passed to the keyword + attr_reader :arguments + + # [Location] the location of this node + attr_reader :location + + def initialize(arguments:, location:) + @arguments = arguments + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('return') + + q.breakable + q.pp(arguments) + end + end + + def to_json(*opts) + { type: :return, args: arguments, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_return: ((Args | ArgsAddBlock) arguments) -> Return + def on_return(arguments) + keyword = find_scanner_event(Kw, 'return') + + Return.new( + arguments: arguments, + location: keyword.location.to(arguments.location) + ) + end + + # Return0 represents the bare +return+ keyword with no arguments. + # + # return + # + class Return0 + # [String] the value of the keyword + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('return0') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :return0, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_return0: () -> Return0 + def on_return0 + keyword = find_scanner_event(Kw, 'return') + + Return0.new(value: keyword.value, location: keyword.location) + end + + # RParen represents the use of a right parenthesis, i.e., +)+. + class RParen + # [String] the parenthesis + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('rparen') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@rparen, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_rparen: (String value) -> RParen + def on_rparen(value) + node = + RParen.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # SClass represents a block of statements that should be evaluated within the + # context of the singleton class of an object. It's frequently used to define + # singleton methods. + # + # class << self + # end + # + class SClass + # [untyped] the target of the singleton class to enter + attr_reader :target + + # [BodyStmt] the expressions to be executed + attr_reader :bodystmt + + # [Location] the location of this node + attr_reader :location + + def initialize(target:, bodystmt:, location:) + @target = target + @bodystmt = bodystmt + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('sclass') + + q.breakable + q.pp(target) + + q.breakable + q.pp(bodystmt) + end + end + + def to_json(*opts) + { + type: :sclass, + target: target, + bodystmt: bodystmt, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_sclass: (untyped target, BodyStmt bodystmt) -> SClass + def on_sclass(target, bodystmt) + beginning = find_scanner_event(Kw, 'class') + ending = find_scanner_event(Kw, 'end') + + bodystmt.bind( + find_next_statement_start(target.location.end_char), + ending.location.start_char + ) + + SClass.new( + target: target, + bodystmt: bodystmt, + location: beginning.location.to(ending.location) + ) + end + + # def on_semicolon(value) + # value + # end + + # def on_sp(value) + # value + # end + + # stmts_add is a parser event that represents a single statement inside a + # list of statements within any lexical block. It accepts as arguments the + # parent stmts node as well as an stmt which can be any expression in + # Ruby. + def on_stmts_add(statements, statement) + statements << statement + end + + # Everything that has a block of code inside of it has a list of statements. + # Normally we would just track those as a node that has an array body, but we + # have some special handling in order to handle empty statement lists. They + # need to have the right location information, so all of the parent node of + # stmts nodes will report back down the location information. We then + # propagate that onto void_stmt nodes inside the stmts in order to make sure + # all comments get printed appropriately. + class Statements + # [Prettier::Parser] the parser that created this node + attr_reader :parser + + # [Array[untyped]] the list of expressions contained within this node + attr_reader :body + + # [Location] the location of this node + attr_reader :location + + def initialize(parser:, body:, location:) + @parser = parser + @body = body + @location = location + end + + def bind(start_char, end_char) + @location = + Location.new( + start_line: location.start_line, + start_char: start_char, + end_line: location.end_line, + end_char: end_char + ) + + if body[0].is_a?(VoidStmt) + location = body[0].location + location = + Location.new( + start_line: location.start_line, + start_char: start_char, + end_line: location.end_line, + end_char: start_char + ) + + body[0] = VoidStmt.new(location: location) + end + + attach_comments(start_char, end_char) + end + + def bind_end(end_char) + @location = + Location.new( + start_line: location.start_line, + start_char: location.start_char, + end_line: location.end_line, + end_char: end_char + ) + end + + def <<(statement) + @location = + body.any? ? location.to(statement.location) : statement.location + + body << statement + self + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('statements') + + q.breakable + q.seplist(body) { |statement| q.pp(statement) } + end + end + + def to_json(*opts) + { type: :stmts, body: body, loc: location }.to_json(*opts) + end + + private + + def attach_comments(start_char, end_char) + attachable = + parser.comments.select do |comment| + comment.is_a?(Comment) && !comment.inline && + start_char <= comment.location.start_char && + end_char >= comment.location.end_char && + !comment.value.include?('prettier-ignore') + end + + return if attachable.empty? + + parser.comments -= attachable + @body = (body + attachable).sort_by! { |node| node.location.start_char } + end + end + + # :call-seq: + # on_stmts_new: () -> Statements + def on_stmts_new + Statements.new( + parser: self, + body: [], + location: Location.fixed(line: lineno, char: char_pos) + ) + end + + # StringContent represents the contents of a string-like value. + # + # "string" + # + class StringContent + # [Array[StringEmbExpr | StringDVar | TStringContent]] the parts of the + # string + attr_reader :parts + + # [Location] the location of this node + attr_reader :location + + def initialize(parts:, location:) + @parts = parts + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('string') + + q.breakable + q.group(2, '(', ')') { q.seplist(parts) { |part| q.pp(part) } } + end + end + + def to_json(*opts) + { type: :string, parts: parts, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_string_add: ( + # String string, + # (StringEmbExpr | StringDVar | TStringContent) part + # ) -> StringContent + def on_string_add(string, part) + location = + string.parts.any? ? string.location.to(part.location) : part.location + + StringContent.new(parts: string.parts << part, location: location) + end + + # StringConcat represents concatenating two strings together using a backward + # slash. + # + # "first" \ + # "second" + # + class StringConcat + # [StringConcat | StringLiteral] the left side of the concatenation + attr_reader :left + + # [StringLiteral] the right side of the concatenation + attr_reader :right + + # [Location] the location of this node + attr_reader :location + + def initialize(left:, right:, location:) + @left = left + @right = right + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('string_concat') + + q.breakable + q.pp(left) + + q.breakable + q.pp(right) + end + end + + def to_json(*opts) + { type: :string_concat, left: left, right: right, loc: location }.to_json( + *opts + ) + end + end + + # :call-seq: + # on_string_concat: ( + # (StringConcat | StringLiteral) left, + # StringLiteral right + # ) -> StringConcat + def on_string_concat(left, right) + StringConcat.new( + left: left, + right: right, + location: left.location.to(right.location) + ) + end + + # :call-seq: + # on_string_content: () -> StringContent + def on_string_content + StringContent.new( + parts: [], + location: Location.fixed(line: lineno, char: char_pos) + ) + end + + # StringDVar represents shorthand interpolation of a variable into a string. + # It allows you to take an instance variable, class variable, or global + # variable and omit the braces when interpolating. + # + # "#@variable" + # + class StringDVar + # [Backref | VarRef] the variable being interpolated + attr_reader :variable + + # [Location] the location of this node + attr_reader :location + + def initialize(variable:, location:) + @variable = variable + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('string_dvar') + + q.breakable + q.pp(variable) + end + end + + def to_json(*opts) + { type: :string_dvar, var: variable, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_string_dvar: ((Backref | VarRef) variable) -> StringDVar + def on_string_dvar(variable) + embvar = find_scanner_event(EmbVar) + + StringDVar.new( + variable: variable, + location: embvar.location.to(variable.location) + ) + end + + # StringEmbExpr represents interpolated content. It can be contained within a + # couple of different parent nodes, including regular expressions, strings, + # and dynamic symbols. + # + # "string #{expression}" + # + class StringEmbExpr + # [Statements] the expressions to be interpolated + attr_reader :statements + + # [Location] the location of this node + attr_reader :location + + def initialize(statements:, location:) + @statements = statements + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('string_embexpr') + + q.breakable + q.pp(statements) + end + end + + def to_json(*opts) + { type: :string_embexpr, stmts: statements, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_string_embexpr: (Statements statements) -> StringEmbExpr + def on_string_embexpr(statements) + embexpr_beg = find_scanner_event(EmbExprBeg) + embexpr_end = find_scanner_event(EmbExprEnd) + + statements.bind( + embexpr_beg.location.end_char, + embexpr_end.location.start_char + ) + + StringEmbExpr.new( + statements: statements, + location: embexpr_beg.location.to(embexpr_end.location) + ) + end + + # StringLiteral represents a string literal. + # + # "string" + # + class StringLiteral + # [Array[StringEmbExpr | StringDVar | TStringContent]] the parts of the + # string literal + attr_reader :parts + + # [String] which quote was used by the string literal + attr_reader :quote + + # [Location] the location of this node + attr_reader :location + + def initialize(parts:, quote:, location:) + @parts = parts + @quote = quote + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('string_literal') + + q.breakable + q.group(2, '(', ')') { q.seplist(parts) { |part| q.pp(part) } } + end + end + + def to_json(*opts) + { + type: :string_literal, + parts: parts, + quote: quote, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_string_literal: (String string) -> Heredoc | StringLiteral + def on_string_literal(string) + heredoc = @heredocs[-1] + + if heredoc && heredoc.ending + heredoc = @heredocs.pop + + Heredoc.new( + beginning: heredoc.beginning, + ending: heredoc.ending, + parts: string.parts, + location: heredoc.location + ) + else + tstring_beg = find_scanner_event(TStringBeg) + tstring_end = find_scanner_event(TStringEnd) + + StringLiteral.new( + parts: string.parts, + quote: tstring_beg.value, + location: tstring_beg.location.to(tstring_end.location) + ) + end + end + + # Super represents using the +super+ keyword with arguments. It can optionally + # use parentheses. + # + # super(value) + # + class Super + # [ArgParen | Args | ArgsAddBlock] the arguments to the keyword + attr_reader :arguments + + # [Location] the location of this node + attr_reader :location + + def initialize(arguments:, location:) + @arguments = arguments + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('super') + + q.breakable + q.pp(arguments) + end + end + + def to_json(*opts) + { type: :super, args: arguments, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_super: ((ArgParen | Args | ArgsAddBlock) arguments) -> Super + def on_super(arguments) + keyword = find_scanner_event(Kw, 'super') + + Super.new( + arguments: arguments, + location: keyword.location.to(arguments.location) + ) + end + + # SymBeg represents the beginning of a symbol literal. + # + # :symbol + # + # SymBeg is also used for dynamic symbols, as in: + # + # :"symbol" + # + # Finally, SymBeg is also used for symbols using the %s syntax, as in: + # + # %s[symbol] + # + # The value of this node is a string. In most cases (as in the first example + # above) it will contain just ":". In the case of dynamic symbols it will + # contain ":'" or ":\"". In the case of %s symbols, it will contain the start + # of the symbol including the %s and the delimiter. + class SymBeg + # [String] the beginning of the symbol + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('symbeg') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@symbeg, value: value, loc: location }.to_json(*opts) + end + end + + # symbeg is a scanner event that represents the beginning of a symbol literal. + # In most cases it will contain just ":" as in the value, but if its a dynamic + # symbol being defined it will contain ":'" or ":\"". + def on_symbeg(value) + node = + SymBeg.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # SymbolContent represents symbol contents and is always the child of a + # SymbolLiteral node. + # + # :symbol + # + class SymbolContent + # [Backtick | Const | CVar | GVar | Ident | IVar | Kw | Op] the value of the + # symbol + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('symbol') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :symbol, val: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_symbol: ( + # (Backtick | Const | CVar | GVar | Ident | IVar | Kw | Op) value + # ) -> SymbolContent + def on_symbol(value) + scanner_events.pop + + SymbolContent.new(value: value, location: value.location) + end + + # SymbolLiteral represents a symbol in the system with no interpolation + # (as opposed to a DynaSymbol which has interpolation). + # + # :symbol + # + class SymbolLiteral + # [Backtick | Const | CVar | GVar | Ident | IVar | Kw | Op] the value of the + # symbol + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('symbol_literal') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :symbol_literal, val: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_symbol_literal: ( + # ( + # Backtick | Const | CVar | GVar | Ident | + # IVar | Kw | Op | SymbolContent + # ) value + # ) -> SymbolLiteral + def on_symbol_literal(value) + if scanner_events[-1] == value + SymbolLiteral.new(value: scanner_events.pop, location: value.location) + else + symbeg = find_scanner_event(SymBeg) + + SymbolLiteral.new( + value: value.value, + location: symbeg.location.to(value.location) + ) + end + end + + # Symbols represents a symbol array literal with interpolation. + # + # %I[one two three] + # + class Symbols + # [Array[Word]] the words in the symbol array literal + attr_reader :elements + + # [Location] the location of this node + attr_reader :location + + def initialize(elements:, location:) + @elements = elements + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('symbols') + + q.breakable + q.group(2, '(', ')') { q.seplist(elements) { |element| q.pp(element) } } + end + end + + def to_json(*opts) + { type: :symbols, elems: elements, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_symbols_add: (Symbols symbols, Word word) -> Symbols + def on_symbols_add(symbols, word) + Symbols.new( + elements: symbols.elements << word, + location: symbols.location.to(word.location) + ) + end + + # SymbolsBeg represents the start of a symbol array literal with + # interpolation. + # + # %I[one two three] + # + # In the snippet above, SymbolsBeg represents the "%I[" token. Note that these + # kinds of arrays can start with a lot of different delimiter types + # (e.g., %I| or %I<). + class SymbolsBeg + # [String] the beginning of the symbol literal array + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('symbols_beg') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@symbols_beg, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_symbols_beg: (String value) -> SymbolsBeg + def on_symbols_beg(value) + node = + SymbolsBeg.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # :call-seq: + # on_symbols_new: () -> Symbols + def on_symbols_new + symbols_beg = find_scanner_event(SymbolsBeg) + + Symbols.new(elements: [], location: symbols_beg.location) + end + + # TLambda represents the beginning of a lambda literal. + # + # -> { value } + # + # In the example above the TLambda represents the +->+ operator. + class TLambda + # [String] the beginning of the lambda literal + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('tlambda') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@tlambda, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_tlambda: (String value) -> TLambda + def on_tlambda(value) + node = + TLambda.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # TLamBeg represents the beginning of the body of a lambda literal using + # braces. + # + # -> { value } + # + # In the example above the TLamBeg represents the +{+ operator. + class TLamBeg + # [String] the beginning of the body of the lambda literal + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('tlambeg') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@tlambeg, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_tlambeg: (String value) -> TLamBeg + def on_tlambeg(value) + node = + TLamBeg.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # TopConstField is always the child node of some kind of assignment. It + # represents when you're assigning to a constant that is being referenced at + # the top level. + # + # ::Constant = value + # + class TopConstField + # [Const] the constant being assigned + attr_reader :constant + + # [Location] the location of this node + attr_reader :location + + def initialize(constant:, location:) + @constant = constant + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('top_const_field') + + q.breakable + q.pp(constant) + end + end + + def to_json(*opts) + { type: :top_const_field, constant: constant, loc: location }.to_json( + *opts + ) + end + end + + # :call-seq: + # on_top_const_field: (Const constant) -> TopConstRef + def on_top_const_field(constant) + operator = find_colon2_before(constant) + + TopConstField.new( + constant: constant, + location: operator.location.to(constant.location) + ) + end + + # TopConstRef is very similar to TopConstField except that it is not involved + # in an assignment. + # + # ::Constant + # + class TopConstRef + # [Const] the constant being referenced + attr_reader :constant + + # [Location] the location of this node + attr_reader :location + + def initialize(constant:, location:) + @constant = constant + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('top_const_ref') + + q.breakable + q.pp(constant) + end + end + + def to_json(*opts) + { type: :top_const_ref, constant: constant, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_top_const_ref: (Const constant) -> TopConstRef + def on_top_const_ref(constant) + operator = find_colon2_before(constant) + + TopConstRef.new( + constant: constant, + location: operator.location.to(constant.location) + ) + end + + # TStringBeg represents the beginning of a string literal. + # + # "string" + # + # In the example above, TStringBeg represents the first set of quotes. Strings + # can also use single quotes. They can also be declared using the +%q+ and + # +%Q+ syntax, as in: + # + # %q{string} + # + class TStringBeg + # [String] the beginning of the string + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('tstring_beg') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@tstring_beg, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_tstring_beg: (String value) -> TStringBeg + def on_tstring_beg(value) + node = + TStringBeg.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # TStringContent represents plain characters inside of an entity that accepts + # string content like a string, heredoc, command string, or regular + # expression. + # + # "string" + # + # In the example above, TStringContent represents the +string+ token contained + # within the string. + class TStringContent + # [String] the content of the string + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('tstring_content') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { + type: :@tstring_content, + value: value.force_encoding('UTF-8'), + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_tstring_content: (String value) -> TStringContent + def on_tstring_content(value) + TStringContent.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + end + + # TStringEnd represents the end of a string literal. + # + # "string" + # + # In the example above, TStringEnd represents the second set of quotes. + # Strings can also use single quotes. They can also be declared using the +%q+ + # and +%Q+ syntax, as in: + # + # %q{string} + # + class TStringEnd + # [String] the end of the string + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('tstring_end') + + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :@tstring_end, value: value, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_tstring_end: (String value) -> TStringEnd + def on_tstring_end(value) + node = + TStringEnd.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) + + scanner_events << node + node + end + + # Not represents the unary +not+ method being called on an expression. + # + # not value + # + class Not + # [untyped] the statement on which to operate + attr_reader :statement + + # [boolean] whether or not parentheses were used + attr_reader :parentheses + + # [Location] the location of this node + attr_reader :location + + def initialize(statement:, parentheses:, location:) + @statement = statement + @parentheses = parentheses + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('not') + + q.breakable + q.pp(statement) + end + end + + def to_json(*opts) + { + type: :unary, + op: :not, + val: statement, + paren: parentheses, + loc: location + }.to_json(*opts) + end + end + + # Unary represents a unary method being called on an expression, as in +!+ or + # +~+. + # + # !value + # + class Unary + # [String] the operator being used + attr_reader :operator + + # [untyped] the statement on which to operate + attr_reader :statement + + # [Location] the location of this node + attr_reader :location + + def initialize(operator:, statement:, location:) + @operator = operator + @statement = statement + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('unary') + + q.breakable + q.pp(operator) + + q.breakable + q.pp(statement) + end + end + + def to_json(*opts) + { type: :unary, op: operator, val: statement, loc: location }.to_json( + *opts + ) + end + end + + # :call-seq: + # on_unary: (:not operator, untyped statement) -> Not + # | (Symbol operator, untyped statement) -> Unary + def on_unary(operator, statement) + if operator == :not + # We have somewhat special handling of the not operator since if it has + # parentheses they don't get reported as a paren node for some reason. + + beginning = find_scanner_event(Kw, 'not') + ending = statement + + range = beginning.location.end_char...statement.location.start_char + paren = source[range].include?('(') + + if paren + find_scanner_event(LParen) + ending = find_scanner_event(RParen) + end + + Not.new( + statement: statement, + parentheses: paren, + location: beginning.location.to(ending.location) + ) + else + # Special case instead of using find_scanner_event here. It turns out that + # if you have a range that goes from a negative number to a negative + # number then you can end up with a .. or a ... that's higher in the + # stack. So we need to explicitly disallow those operators. + index = + scanner_events.rindex do |node| + node.is_a?(Op) && + node.location.start_char < statement.location.start_char && + !%w[.. ...].include?(node.value) + end + + beginning = scanner_events.delete_at(index) + + Unary.new( + operator: operator[0], # :+@ -> "+" + statement: statement, + location: beginning.location.to(statement.location) + ) + end + end + + # Undef represents the use of the +undef+ keyword. + # + # undef method + # + class Undef + # [Array[DynaSymbol | SymbolLiteral]] the symbols to undefine + attr_reader :symbols + + # [Location] the location of this node + attr_reader :location + + def initialize(symbols:, location:) + @symbols = symbols + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('undef') + + q.breakable + q.group(2, '(', ')') { q.seplist(symbols) { |symbol| q.pp(symbol) } } + end + end + + def to_json(*opts) + { type: :undef, syms: symbols, loc: location }.to_json(*opts) + end + end + + # :call-seq: + # on_undef: (Array[DynaSymbol | SymbolLiteral] symbols) -> Undef + def on_undef(symbols) + keyword = find_scanner_event(Kw, 'undef') + + Undef.new( + symbols: symbols, + location: keyword.location.to(symbols.last.location) + ) + end + + # Unless represents the first clause in an +unless+ chain. + # + # unless predicate + # end + # + class Unless + # [untyped] the expression to be checked + attr_reader :predicate + + # [Statements] the expressions to be executed + attr_reader :statements + + # [nil, Elsif, Else] the next clause in the chain + attr_reader :consequent + + # [Location] the location of this node + attr_reader :location + + def initialize(predicate:, statements:, consequent:, location:) + @predicate = predicate + @statements = statements + @consequent = consequent + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('unless') + + q.breakable + q.pp(predicate) + + q.breakable + q.pp(statements) + + if consequent + q.breakable + q.pp(consequent) + end + end + end + + def to_json(*opts) + { + type: :unless, + pred: predicate, + stmts: statements, + cons: consequent, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_unless: ( + # untyped predicate, + # Statements statements, + # ((nil | Elsif | Else) consequent) + # ) -> Unless + def on_unless(predicate, statements, consequent) + beginning = find_scanner_event(Kw, 'unless') + ending = consequent || find_scanner_event(Kw, 'end') + + statements.bind(predicate.location.end_char, ending.location.start_char) + + Unless.new( + predicate: predicate, + statements: statements, + consequent: consequent, + location: beginning.location.to(ending.location) + ) + end + + # UnlessMod represents the modifier form of an +unless+ statement. + # + # expression unless predicate + # + class UnlessMod + # [untyped] the expression to be executed + attr_reader :statement + + # [untyped] the expression to be checked + attr_reader :predicate + + # [Location] the location of this node + attr_reader :location + + def initialize(statement:, predicate:, location:) + @statement = statement + @predicate = predicate + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('unless_mod') + + q.breakable + q.pp(statement) + + q.breakable + q.pp(predicate) + end + end + + def to_json(*opts) + { + type: :unless_mod, + stmt: statement, + pred: predicate, + loc: location + }.to_json(*opts) + end + end + + # :call-seq: + # on_unless_mod: (untyped predicate, untyped statement) -> UnlessMod + def on_unless_mod(predicate, statement) + find_scanner_event(Kw, 'unless') + + UnlessMod.new( + statement: statement, + predicate: predicate, + location: statement.location.to(predicate.location) + ) end - # qwords_beg is a scanner event that represents the beginning of a word - # literal array. For example in the following snippet: + # Until represents an +until+ loop. # - # %w[foo bar baz] + # until predicate + # end # - # a qwords_beg would be triggered with the value of "%w[". - def on_qwords_beg(value) - node = { - type: :@qwords_beg, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + class Until + # [untyped] the expression to be checked + attr_reader :predicate - scanner_events << node - node - end + # [Statements] the expressions to be executed + attr_reader :statements - # qwords_new is a parser event that represents the beginning of a string - # literal array, like %w[one two three]. It can be followed by any number - # of qwords_add events, which we'll append onto an array body. - def on_qwords_new - event = find_scanner_event(:@qwords_beg) + # [Location] the location of this node + attr_reader :location - { type: :qwords, elems: [], loc: event[:loc] } - end + def initialize(predicate:, statements:, location:) + @predicate = predicate + @statements = statements + @location = location + end - # qsymbols_add is a parser event that represents an element inside of a - # symbol literal array like %i[one two three]. It accepts as arguments the - # parent qsymbols node as well as a tstring_content scanner event - # representing the bare words. - def on_qwords_add(qwords, tstring_content) - { - type: :qwords, - elems: qwords[:elems] << tstring_content, - loc: qwords[:loc].to(tstring_content[:loc]) - } - end + def pretty_print(q) + q.group(2, '(', ')') do + q.text('until') - # rational is a scanner event that represents a rational number literal. - def on_rational(value) - node = { - type: :@rational, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + q.breakable + q.pp(predicate) - scanner_events << node - node + q.breakable + q.pp(statements) + end + end + + def to_json(*opts) + { + type: :until, + pred: predicate, + stmts: statements, + loc: location + }.to_json(*opts) + end end - # rbrace is a scanner event that represents the use of a right brace, i.e., - # "}". - def on_rbrace(value) - node = { - type: :@rbrace, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + # :call-seq: + # on_until: (untyped predicate, Statements statements) -> Until + def on_until(predicate, statements) + beginning = find_scanner_event(Kw, 'until') + ending = find_scanner_event(Kw, 'end') - scanner_events << node - node - end + # Consume the do keyword if it exists so that it doesn't get confused for + # some other block + keyword = find_scanner_event(Kw, 'do', consume: false) + if keyword && keyword.location.start_char > predicate.location.end_char && + keyword.location.end_char < ending.location.start_char + scanner_events.delete(keyword) + end - # rbracket is a scanner event that represents the use of a right bracket, - # i.e., "]". - def on_rbracket(value) - node = { - type: :@rbracket, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + # Update the Statements location information + statements.bind(predicate.location.end_char, ending.location.start_char) - scanner_events << node - node + Until.new( + predicate: predicate, + statements: statements, + location: beginning.location.to(ending.location) + ) end - # redo is a parser event that represents the bare redo keyword. It has no - # body as it accepts no arguments. - def on_redo - keyword = find_scanner_event(:@kw, 'redo') + # UntilMod represents the modifier form of a +until+ loop. + # + # expression until predicate + # + class UntilMod + # [untyped] the expression to be executed + attr_reader :statement - { type: :redo, value: keyword[:value], loc: keyword[:loc] } - end + # [untyped] the expression to be checked + attr_reader :predicate - # regexp_add is a parser event that represents a part of a regular expression - # body. It accepts as arguments the parent regexp node as well as a - # tstring_content scanner event representing string content, a - # string_embexpr parser event representing interpolated content, or a - # string_dvar parser event representing an interpolated variable. - def on_regexp_add(regexp, part) - { - type: :regexp, - parts: regexp[:parts] << part, - beging: regexp[:beging], - loc: regexp[:loc].to(part[:loc]) - } - end + # [Location] the location of this node + attr_reader :location - # regexp_beg is a scanner event that represents the start of a regular - # expression. It can take a couple of forms since regexp can either start with - # a forward slash or a %r. - def on_regexp_beg(value) - node = { - type: :@regexp_beg, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + def initialize(statement:, predicate:, location:) + @statement = statement + @predicate = predicate + @location = location + end - scanner_events << node - node + def pretty_print(q) + q.group(2, '(', ')') do + q.text('until_mod') + + q.breakable + q.pp(statement) + + q.breakable + q.pp(predicate) + end + end + + def to_json(*opts) + { + type: :until_mod, + stmt: statement, + pred: predicate, + loc: location + }.to_json(*opts) + end end - # regexp_end is a scanner event that represents the end of a regular - # expression. It will contain the closing brace or slash, as well as any flags - # being passed to the regexp. - def on_regexp_end(value) - { - type: :@regexp_end, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } - end - - # regexp_literal is a parser event that represents a regular expression. - # It accepts as arguments a regexp node which is a built-up array of - # pieces that go into the regexp content, as well as the ending used to - # close out the regexp which includes any modifiers. - def on_regexp_literal(regexp, ending) - { - type: :regexp_literal, - parts: regexp[:parts], - beging: regexp[:beging], - ending: ending[:value], - loc: regexp[:loc].to(ending[:loc]) - } - end - - # regexp_new is a parser event that represents the beginning of a regular - # expression literal, like /foo/. It can be followed by any number of - # regexp_add events, which we'll append onto an array body. - def on_regexp_new - beging = find_scanner_event(:@regexp_beg) + # :call-seq: + # on_until_mod: (untyped predicate, untyped statement) -> UntilMod + def on_until_mod(predicate, statement) + find_scanner_event(Kw, 'until') - { type: :regexp, parts: [], beging: beging[:value], loc: beging[:loc] } + UntilMod.new( + statement: statement, + predicate: predicate, + location: statement.location.to(predicate.location) + ) end - # rescue is a special kind of node where you have a rescue chain but it - # doesn't really have all of the information that it needs in order to - # determine its ending. Therefore it relies on its parent bodystmt node to - # report its ending to it. - class Rescue < Node - def bind_end(end_char) - location = value[:loc] - value[:loc] = - Location.new( - start_line: location.start_line, - start_char: location.start_char, - end_line: location.end_line, - end_char: end_char - ) + # VarAlias represents when you're using the +alias+ keyword with global + # variable arguments. + # + # alias $new $old + # + class VarAlias + # [GVar] the new alias of the variable + attr_reader :left - stmts = value[:stmts] - consequent = value[:cons] + # [Backref | GVar] the current name of the variable to be aliased + attr_reader :right - if consequent - consequent.bind_end(end_char) - stmts.bind_end(consequent[:loc].start_char) - else - stmts.bind_end(end_char) - end + # [Location] the location of this node + attr_reader :location + + def initialize(left:, right:, location:) + @left = left + @right = right + @location = location end - end - # rescue is a parser event that represents the use of the rescue keyword - # inside of a bodystmt. - def on_rescue(exceptions, variable, stmts, consequent) - beging = find_scanner_event(:@kw, 'rescue') - exceptions = exceptions[0] if exceptions.is_a?(Array) + def pretty_print(q) + q.group(2, '(', ')') do + q.text('var_alias') - last_node = variable || exceptions || beging - stmts.bind(find_next_statement_start(last_node[:loc].end_char), char_pos) + q.breakable + q.pp(left) - # We add an additional inner node here that ripper doesn't provide so that - # we have a nice place to attach inline comments. But we only need it if we - # have an exception or a variable that we're rescuing. - rescue_ex = - if exceptions || variable - { - type: :rescue_ex, - extns: exceptions, - var: variable, - loc: - Location.new( - start_line: beging[:loc].start_line, - start_char: beging[:loc].end_char + 1, - end_line: last_node[:loc].end_line, - end_char: last_node[:loc].end_char - ) - } + q.breakable + q.pp(right) end + end - Rescue.new( - self, - { - type: :rescue, - extn: rescue_ex, - stmts: stmts, - cons: consequent, - loc: - Location.new( - start_line: beging[:loc].start_line, - start_char: beging[:loc].start_char, - end_line: lineno, - end_char: char_pos - ) - } - ) - end - - # rescue_mod represents the modifier form of a rescue clause. It accepts as - # arguments the statement that may raise an error and the value that should - # be used if it does. - def on_rescue_mod(statement, value) - find_scanner_event(:@kw, 'rescue') - - { - type: :rescue_mod, - stmt: statement, - val: value, - loc: statement[:loc].to(value[:loc]) - } + def to_json(*opts) + { type: :var_alias, left: left, right: right, loc: location }.to_json( + *opts + ) + end end - # rest_param is a parser event that represents defining a parameter in a - # method definition that accepts all remaining positional parameters. It - # accepts as an argument an optional identifier for the parameter. If it - # is omitted, then we're just using the plain operator. - def on_rest_param(name) - location = find_scanner_event(:@op, '*')[:loc] - location = location.to(name[:loc]) if name + # :call-seq: + # on_var_alias: (GVar left, (Backref | GVar) right) -> VarAlias + def on_var_alias(left, right) + keyword = find_scanner_event(Kw, 'alias') - { type: :rest_param, name: name, loc: location } + VarAlias.new( + left: left, + right: right, + location: keyword.location.to(right.location) + ) end - # retry is a parser event that represents the bare retry keyword. It has - # no body as it accepts no arguments. - def on_retry - keyword = find_scanner_event(:@kw, 'retry') + # VarField represents a variable that is being assigned a value. As such, it + # is always a child of an assignment type node. + # + # variable = value + # + # In the example above, the VarField node represents the +variable+ token. + class VarField + # [nil | Const | CVar | GVar | Ident | IVar] the target of this node + attr_reader :value - { type: :retry, value: keyword[:value], loc: keyword[:loc] } - end + # [Location] the location of this node + attr_reader :location - # return is a parser event that represents using the return keyword with - # arguments. It accepts as an argument an args_add_block event that - # contains all of the arguments being passed. - def on_return(args) - keyword = find_scanner_event(:@kw, 'return') + def initialize(value:, location:) + @value = value + @location = location + end - { type: :return, args: args, loc: keyword[:loc].to(args[:loc]) } - end + def pretty_print(q) + q.group(2, '(', ')') do + q.text('var_field') - # return0 is a parser event that represents the bare return keyword. It - # has no body as it accepts no arguments. This is as opposed to the return - # parser event, which is the version where you're returning one or more - # values. - def on_return0 - keyword = find_scanner_event(:@kw, 'return') + q.breakable + q.pp(value) + end + end - { type: :return0, value: keyword[:value], loc: keyword[:loc] } + def to_json(*opts) + { type: :var_field, value: value, loc: location }.to_json(*opts) + end end - # rparen is a scanner event that represents the use of a right parenthesis, - # i.e., ")". - def on_rparen(value) - node = { - type: :@rparen, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + # :call-seq: + # on_var_field: ( + # (nil | Const | CVar | GVar | Ident | IVar) value + # ) -> VarField + def on_var_field(value) + location = + if value + value.location + else + # You can hit this pattern if you're assigning to a splat using pattern + # matching syntax in Ruby 2.7+ + Location.fixed(line: lineno, char: char_pos) + end - scanner_events << node - node + VarField.new(value: value, location: location) end - # sclass is a parser event that represents a block of statements that - # should be evaluated within the context of the singleton class of an - # object. It's frequently used to define singleton methods. It looks like - # the following example: + # VarRef represents a variable reference. # - # class << self do foo end - # │ │ - # │ └> bodystmt - # └> target + # variable # - def on_sclass(target, bodystmt) - beging = find_scanner_event(:@kw, 'class') - ending = find_scanner_event(:@kw, 'end') + # This can be a plain local variable like the example above. It can also be a + # constant, a class variable, a global variable, an instance variable, a + # keyword (like +self+, +nil+, +true+, or +false+), or a numbered block + # variable. + class VarRef + # [Const | CVar | GVar | Ident | IVar | Kw] the value of this node + attr_reader :value + + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location + end - bodystmt.bind( - find_next_statement_start(target[:loc].end_char), - ending[:loc].start_char - ) + def pretty_print(q) + q.group(2, '(', ')') do + q.text('var_ref') - { - type: :sclass, - target: target, - bodystmt: bodystmt, - loc: beging[:loc].to(ending[:loc]) - } + q.breakable + q.pp(value) + end + end + + def to_json(*opts) + { type: :var_ref, value: value, loc: location }.to_json(*opts) + end end - # semicolon is a scanner event that represents the use of a semicolon in the - # source. We don't need to track this event in the AST that we're generating, - # so we're not going to define an explicit handler for it. - # - # def on_semicolon(value) - # value - # end + # :call-seq: + # on_var_ref: ((Const | CVar | GVar | Ident | IVar | Kw) value) -> VarRef + def on_var_ref(value) + VarRef.new(value: value, location: value.location) + end - # sp is a scanner event that represents the use of a space in the source. As - # you can imagine, this event gets triggered quite often. We don't need to - # track this event in the AST that we're generating, so we're not going to - # define an explicit handler for it. + # AccessCtrl represents a call to a method visibility control, i.e., +public+, + # +protected+, or +private+. # - # def on_sp(value) - # value - # end + # private + # + class AccessCtrl + # [Ident] the value of this expression + attr_reader :value - # stmts_add is a parser event that represents a single statement inside a - # list of statements within any lexical block. It accepts as arguments the - # parent stmts node as well as an stmt which can be any expression in - # Ruby. - def on_stmts_add(stmts, stmt) - stmts << stmt - end + # [Location] the location of this node + attr_reader :location - # Everything that has a block of code inside of it has a list of statements. - # Normally we would just track those as a node that has an array body, but we - # have some special handling in order to handle empty statement lists. They - # need to have the right location information, so all of the parent node of - # stmts nodes will report back down the location information. We then - # propagate that onto void_stmt nodes inside the stmts in order to make sure - # all comments get printed appropriately. - class Stmts < Node - def bind(start_char, end_char) - location = value[:loc] - value[:loc] = - Location.new( - start_line: location.start_line, - start_char: start_char, - end_line: location.end_line, - end_char: end_char - ) + def initialize(value:, location:) + @value = value + @location = location + end - if value[:body][0][:type] == :void_stmt - location = value[:body][0][:loc] - value[:body][0][:loc] = - Location.new( - start_line: location.start_line, - start_char: start_char, - end_line: location.end_line, - end_char: start_char - ) + def pretty_print(q) + q.group(2, '(', ')') do + q.text('access_ctrl') + + q.breakable + q.pp(value) end + end - attach_comments(start_char, end_char) + def to_json(*opts) + { type: :access_ctrl, value: value, loc: location }.to_json(*opts) end + end - def bind_end(end_char) - location = value[:loc] + # VCall represent any plain named object with Ruby that could be either a + # local variable or a method call. + # + # variable + # + class VCall + # [Ident] the value of this expression + attr_reader :value - value[:loc] = - Location.new( - start_line: location.start_line, - start_char: location.start_char, - end_line: location.end_line, - end_char: end_char - ) + # [Location] the location of this node + attr_reader :location + + def initialize(value:, location:) + @value = value + @location = location end - def <<(statement) - value[:loc] = - value[:body].any? ? value[:loc].to(statement[:loc]) : statement[:loc] + def pretty_print(q) + q.group(2, '(', ')') do + q.text('vcall') - value[:body] << statement - self + q.breakable + q.pp(value) + end end - private - - def attach_comments(start_char, end_char) - attachable = - parser.comments.select do |comment| - comment[:type] == :@comment && !comment[:inline] && - start_char <= comment[:loc].start_char && - end_char >= comment[:loc].end_char && - !comment[:value].include?('prettier-ignore') - end + def to_json(*opts) + { type: :vcall, value: value, loc: location }.to_json(*opts) + end + end - return if attachable.empty? + # :call-seq: + # on_vcall: (Ident ident) -> AccessCtrl | VCall + def on_vcall(ident) + @controls ||= %w[private protected public].freeze - parser.comments -= attachable - value[:body] = - (value[:body] + attachable).sort_by! { |node| node[:loc].start_char } + if @controls.include?(ident.value) && ident.value == lines[lineno - 1].strip + # Access controls like private, protected, and public are reported as + # vcall nodes since they're technically method calls. We want to be able + # add new lines around them as necessary, so here we're going to + # explicitly track those as a different node type. + AccessCtrl.new(value: ident, location: ident.location) + else + VCall.new(value: ident, location: ident.location) end end - # stmts_new is a parser event that represents the beginning of a list of - # statements within any lexical block. It can be followed by any number of - # stmts_add events, which we'll append onto an array body. - def on_stmts_new - Stmts.new( - self, - type: :stmts, - body: [], - loc: Location.fixed(line: lineno, char: char_pos) - ) + # VoidStmt represents an empty lexical block of code. + # + # ;; + # + class VoidStmt + # [Location] the location of this node + attr_reader :location + + def initialize(location:) + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') { q.text('void_stmt') } + end + + def to_json(*opts) + { type: :void_stmt, loc: location }.to_json(*opts) + end end - # string_add is a parser event that represents a part of a string. It - # could be plain @tstring_content, string_embexpr, or string_dvar nodes. - # It accepts as arguments the parent string node as well as the additional - # part of the string. - def on_string_add(string, part) - { - type: :string, - parts: string[:parts] << part, - loc: string[:loc].to(part[:loc]) - } + # :call-seq: + # on_void_stmt: () -> VoidStmt + def on_void_stmt + VoidStmt.new(location: Location.fixed(line: lineno, char: char_pos)) end - # string_concat is a parser event that represents concatenating two - # strings together using a backward slash, as in the following example: + # When represents a +when+ clause in a +case+ chain. # - # 'foo' \ - # 'bar' + # case value + # when predicate + # end # - def on_string_concat(left, right) - { - type: :string_concat, - left: left, - right: right, - loc: left[:loc].to(right[:loc]) - } - end + class When + # [untyped] the arguments to the when clause + attr_reader :arguments - # string_content is a parser event that represents the beginning of the - # contents of a string, which will either be embedded inside of a - # string_literal or a dyna_symbol node. It will have an array body so that - # we can build up a list of @tstring_content, string_embexpr, and - # string_dvar nodes. - def on_string_content - { - type: :string, - parts: [], - loc: Location.fixed(line: lineno, char: char_pos) - } + # [Statements] the expressions to be executed + attr_reader :statements + + # [nil | Else | When] the next clause in the chain + attr_reader :consequent + + # [Location] the location of this node + attr_reader :location + + def initialize(arguments:, statements:, consequent:, location:) + @arguments = arguments + @statements = statements + @consequent = consequent + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('when') + + q.breakable + q.pp(arguments) + + q.breakable + q.pp(statements) + + if consequent + q.breakable + q.pp(consequent) + end + end + end + + def to_json(*opts) + { + type: :when, + args: arguments, + stmts: statements, + cons: consequent, + loc: location + }.to_json(*opts) + end end - # string_dvar is a parser event that represents a very special kind of - # interpolation into string. It allows you to take an instance variable, - # class variable, or global variable and omit the braces when - # interpolating. For example, if you wanted to interpolate the instance - # variable @foo into a string, you could do "#@foo". - def on_string_dvar(variable) - event = find_scanner_event(:@embvar) + # :call-seq: + # on_when: ( + # untyped arguments, + # Statements statements, + # (nil | Else | When) consequent + # ) -> When + def on_when(arguments, statements, consequent) + beginning = find_scanner_event(Kw, 'when') + ending = consequent || find_scanner_event(Kw, 'end') - { type: :string_dvar, var: variable, loc: event[:loc].to(variable[:loc]) } + statements.bind(arguments.location.end_char, ending.location.start_char) + + When.new( + arguments: arguments, + statements: statements, + consequent: consequent, + location: beginning.location.to(ending.location) + ) end - # string_embexpr is a parser event that represents interpolated content. - # It can go a bunch of different parent nodes, including regexp, strings, - # xstrings, heredocs, dyna_symbols, etc. Basically it's anywhere you see - # the #{} construct. - def on_string_embexpr(stmts) - beging = find_scanner_event(:@embexpr_beg) - ending = find_scanner_event(:@embexpr_end) + # While represents a +while+ loop. + # + # while predicate + # end + # + class While + # [untyped] the expression to be checked + attr_reader :predicate - stmts.bind(beging[:loc].end_char, ending[:loc].start_char) + # [Statements] the expressions to be executed + attr_reader :statements - { type: :string_embexpr, stmts: stmts, loc: beging[:loc].to(ending[:loc]) } - end + # [Location] the location of this node + attr_reader :location - # String literals are either going to be a normal string or they're going - # to be a heredoc if we've just closed a heredoc. - def on_string_literal(string) - heredoc = @heredocs[-1] + def initialize(predicate:, statements:, location:) + @predicate = predicate + @statements = statements + @location = location + end - if heredoc && heredoc[:ending] - @heredocs.pop.merge!(parts: string[:parts]) - else - beging = find_scanner_event(:@tstring_beg) - ending = find_scanner_event(:@tstring_end) + def pretty_print(q) + q.group(2, '(', ')') do + q.text('while') + + q.breakable + q.pp(predicate) + + q.breakable + q.pp(statements) + end + end + def to_json(*opts) { - type: :string_literal, - parts: string[:parts], - quote: beging[:value], - loc: beging[:loc].to(ending[:loc]) - } + type: :while, + pred: predicate, + stmts: statements, + loc: location + }.to_json(*opts) end end - # A super is a parser event that represents using the super keyword with - # any number of arguments. It can optionally use parentheses (represented - # by an arg_paren node) or just skip straight to the arguments (with an - # args_add_block node). - def on_super(args) - keyword = find_scanner_event(:@kw, 'super') + # :call-seq: + # on_while: (untyped predicate, Statements statements) -> While + def on_while(predicate, statements) + beginning = find_scanner_event(Kw, 'while') + ending = find_scanner_event(Kw, 'end') - { type: :super, args: args, loc: keyword[:loc].to(args[:loc]) } - end + # Consume the do keyword if it exists so that it doesn't get confused for + # some other block + keyword = find_scanner_event(Kw, 'do', consume: false) + if keyword && keyword.location.start_char > predicate.location.end_char && + keyword.location.end_char < ending.location.start_char + scanner_events.delete(keyword) + end - # symbeg is a scanner event that represents the beginning of a symbol literal. - # In most cases it will contain just ":" as in the value, but if its a dynamic - # symbol being defined it will contain ":'" or ":\"". - def on_symbeg(value) - node = { - type: :@symbeg, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + # Update the Statements location information + statements.bind(predicate.location.end_char, ending.location.start_char) - scanner_events << node - node + While.new( + predicate: predicate, + statements: statements, + location: beginning.location.to(ending.location) + ) end - # A symbol is a parser event that immediately descends from a symbol - # literal and contains an ident representing the contents of the symbol. - def on_symbol(value) - # When ripper is lexing source text, it turns symbols into keywords if their - # contents match, which will mess up the location information of all of our - # other nodes. So for example instead of { type: :@ident, value: "class" } - # you would instead get { type: :@kw, value: "class" }. - # - # In order to take care of this, we explicitly delete this scanner event - # from the stack to make sure it doesn't screw things up. - scanner_events.pop + # WhileMod represents the modifier form of a +while+ loop. + # + # expression while predicate + # + class WhileMod + # [untyped] the expression to be executed + attr_reader :statement - { type: :symbol, val: value, loc: value[:loc] } - end + # [untyped] the expression to be checked + attr_reader :predicate - # A symbol_literal represents a symbol in the system with no interpolation - # (as opposed to a dyna_symbol). As its only argument it accepts either a - # symbol node (for most cases) or an ident node (in the case that we're - # using bare words, as in an alias node like alias foo bar). - def on_symbol_literal(contents) - if scanner_events[-1] == contents - { type: :symbol_literal, val: contents, loc: contents[:loc] } - else - beging = find_scanner_event(:@symbeg) + # [Location] the location of this node + attr_reader :location + + def initialize(statement:, predicate:, location:) + @statement = statement + @predicate = predicate + @location = location + end + + def pretty_print(q) + q.group(2, '(', ')') do + q.text('while_mod') + + q.breakable + q.pp(statement) + q.breakable + q.pp(predicate) + end + end + + def to_json(*opts) { - type: :symbol_literal, - val: contents[:val], - loc: beging[:loc].to(contents[:loc]) - } + type: :while_mod, + stmt: statement, + pred: predicate, + loc: location + }.to_json(*opts) end end - # symbols_add is a parser event that represents an element inside of a - # symbol literal array that accepts interpolation, like - # %I[one #{two} three]. It accepts as arguments the parent symbols node as - # well as a word_add parser event. - def on_symbols_add(symbols, word_add) - { - type: :symbols, - elems: symbols[:elems] << word_add, - loc: symbols[:loc].to(word_add[:loc]) - } + # :call-seq: + # on_while_mod: (untyped predicate, untyped statement) -> WhileMod + def on_while_mod(predicate, statement) + find_scanner_event(Kw, 'while') + + WhileMod.new( + statement: statement, + predicate: predicate, + location: statement.location.to(predicate.location) + ) end - # symbols_beg is a scanner event that represents the start of a symbol literal - # array with interpolation. For example, in the following snippet: + # Word represents an element within a special array literal that accepts + # interpolation. # - # %I[foo bar baz] + # %w[a#{b}c xyz] # - # symbols_beg would be triggered with the value of "%I". - def on_symbols_beg(value) - node = { - type: :@symbols_beg, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + # In the example above, there would be two Word nodes within a parent Words + # node. + class Word + # [Array[StringEmbExpr | StringDVar | TStringContent]] the parts of the word + attr_reader :parts + + # [Location] the location of this node + attr_reader :location + + def initialize(parts:, location:) + @parts = parts + @location = location + end - scanner_events << node - node - end + def pretty_print(q) + q.group(2, '(', ')') do + q.text('word') - # symbols_new is a parser event that represents the beginning of a symbol - # literal array that accepts interpolation, like %I[one #{two} three]. It - # can be followed by any number of symbols_add events, which we'll append - # onto an array body. - def on_symbols_new - event = find_scanner_event(:@symbols_beg) + q.breakable + q.group(2, '(', ')') { q.seplist(parts) { |part| q.pp(part) } } + end + end - { type: :symbols, elems: [], loc: event[:loc] } + def to_json(*opts) + { type: :word, parts: parts, loc: location }.to_json(*opts) + end end - # tlambda is a scanner event that represents the beginning of a lambda - # literal. It always has the value of "->". - def on_tlambda(value) - node = { - type: :@tlambda, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + # :call-seq: + # on_word_add: ( + # Word word, + # (StringEmbExpr | StringDVar | TStringContent) part + # ) -> Word + def on_word_add(word, part) + location = + word.parts.empty? ? part.location : word.location.to(part.location) - scanner_events << node - node + Word.new(parts: word.parts << part, location: location) end - # tlambeg is a scanner event that represents the beginning of the body of a - # lambda literal. It always has the value of "{". - def on_tlambeg(value) - node = { - type: :@tlambeg, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } - - scanner_events << node - node + # :call-seq: + # on_word_new: () -> Word + def on_word_new + Word.new(parts: [], location: Location.fixed(line: lineno, char: char_pos)) end - # A top_const_field is a parser event that is always the child of some - # kind of assignment. It represents when you're assigning to a constant - # that is being referenced at the top level. For example: + # Words represents a string literal array with interpolation. # - # ::X = 1 + # %W[one two three] # - def on_top_const_field(constant) - operator = find_colon2_before(constant) + class Words + # [Array[Word]] the elements of this array + attr_reader :elements - { - type: :top_const_field, - constant: constant, - loc: operator[:loc].to(constant[:loc]) - } - end + # [Location] the location of this node + attr_reader :location - # A top_const_ref is a parser event that is a very similar to - # top_const_field except that it is not involved in an assignment. It - # looks like the following example: - # - # ::X - # - def on_top_const_ref(constant) - operator = find_colon2_before(constant) + def initialize(elements:, location:) + @elements = elements + @location = location + end - { - type: :top_const_ref, - constant: constant, - loc: operator[:loc].to(constant[:loc]) - } - end + def pretty_print(q) + q.group(2, '(', ')') do + q.text('words') - # tstring_beg is a scanner event that represents the beginning of a string - # literal. It can represent either of the quotes for its value, or it can have - # a %q/%Q with delimiter. - def on_tstring_beg(value) - node = { - type: :@tstring_beg, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + q.breakable + q.group(2, '(', ')') { q.seplist(elements) { |element| q.pp(element) } } + end + end - scanner_events << node - node + def to_json(*opts) + { type: :words, elems: elements, loc: location }.to_json(*opts) + end end - # tstring_content is a scanner event that represents plain characters inside - # of a string, heredoc, xstring, or regexp. Like comments, we need to force - # the encoding here so JSON doesn't break. - def on_tstring_content(value) - { - type: :@tstring_content, - value: value.force_encoding('UTF-8'), - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + # :call-seq: + # on_words_add: (Words words, Word word) -> Words + def on_words_add(words, word) + Words.new( + elements: words.elements << word, + location: words.location.to(word.location) + ) end - # tstring_end is a scanner event that represents the end of a string literal. - # It can either contain quotes, or it can have the end delimiter of a %q/%Q - # literal. - def on_tstring_end(value) - node = { - type: :@tstring_end, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } - - scanner_events << node - node - end + # WordsBeg represents the beginning of a string literal array with + # interpolation. + # + # %W[one two three] + # + # In the snippet above, a WordsBeg would be created with the value of "%W[". + # Note that these kinds of arrays can start with a lot of different delimiter + # types (e.g., %W| or %W<). + class WordsBeg + # [String] the start of the word literal array + attr_reader :value - # A unary node represents a unary method being called on an expression, as - # in !, ~, or not. We have somewhat special handling of the not operator - # since if it has parentheses they don't get reported as a paren node for - # some reason. - def on_unary(operator, value) - if operator == :not - node = find_scanner_event(:@kw, 'not') + # [Location] the location of this node + attr_reader :location - paren = source[node[:loc].end_char...value[:loc].start_char].include?('(') - ending = paren ? find_scanner_event(:@rparen) : value + def initialize(value:, location:) + @value = value + @location = location + end - { - type: :unary, - op: operator, - val: value, - paren: paren, - loc: node[:loc].to(ending[:loc]) - } - else - # Special case instead of using find_scanner_event here. It turns out that - # if you have a range that goes from a negative number to a negative - # number then you can end up with a .. or a ... that's higher in the - # stack. So we need to explicitly disallow those operators. - index = - scanner_events.rindex do |scanner_event| - scanner_event[:type] == :@op && - scanner_event[:loc].start_char < value[:loc].start_char && - !%w[.. ...].include?(scanner_event[:value]) - end + def pretty_print(q) + q.group(2, '(', ')') do + q.text('words_beg') - beging = scanner_events.delete_at(index) + q.breakable + q.pp(value) + end + end - { - type: :unary, - op: operator[0], - val: value, - loc: beging[:loc].to(value[:loc]) - } + def to_json(*opts) + { type: :@words_beg, value: value, loc: location }.to_json(*opts) end end - # undef nodes represent using the keyword undef. It accepts as an argument - # an array of symbol_literal nodes that represent each message that the - # user is attempting to undefine. We use the keyword to get the beginning - # location and the last symbol to get the ending. - def on_undef(symbol_literals) - event = find_scanner_event(:@kw, 'undef') + # :call-seq: + # on_words_beg: (String value) -> WordsBeg + def on_words_beg(value) + node = + WordsBeg.new( + value: value, + location: Location.token(line: lineno, char: char_pos, size: value.size) + ) - { - type: :undef, - syms: symbol_literals, - loc: event[:loc].to(symbol_literals.last[:loc]) - } + scanner_events << node + node end - # unless is a parser event that represents the first clause in an unless - # chain. It accepts as arguments the predicate of the unless, the - # statements that are contained within the unless clause, and the optional - # consequent clause. - def on_unless(predicate, stmts, consequent) - beging = find_scanner_event(:@kw, 'unless') - ending = consequent || find_scanner_event(:@kw, 'end') - - stmts.bind(predicate[:loc].end_char, ending[:loc].start_char) + # :call-seq: + # on_words_new: () -> Words + def on_words_new + words_beg = find_scanner_event(WordsBeg) - { - type: :unless, - pred: predicate, - stmts: stmts, - cons: consequent, - loc: beging[:loc].to(ending[:loc]) - } + Words.new(elements: [], location: words_beg.location) end - # unless_mod is a parser event that represents the modifier form of an - # unless statement. It accepts as arguments the predicate of the unless - # and the statement that are contained within the unless clause. - def on_unless_mod(predicate, statement) - find_scanner_event(:@kw, 'unless') + # def on_words_sep(value) + # value + # end - { - type: :unless_mod, - pred: predicate, - stmt: statement, - loc: statement[:loc].to(predicate[:loc]) - } - end + # XString represents the contents of an XStringLiteral. + # + # `ls` + # + class XString + # [Array[StringEmbExpr | StringDVar | TStringContent]] the parts of the + # xstring + attr_reader :parts - # until is a parser event that represents an until loop. It accepts as - # arguments the predicate to the until and the statements that are - # contained within the until clause. - def on_until(predicate, stmts) - beging = find_scanner_event(:@kw, 'until') - ending = find_scanner_event(:@kw, 'end') + # [Location] the location of this node + attr_reader :location - # Consume the do keyword if it exists so that it doesn't get confused for - # some other block - do_event = find_scanner_event(:@kw, 'do', consume: false) - if do_event && do_event[:loc].start_char > predicate[:loc].end_char && - do_event[:loc].end_char < ending[:loc].start_char - scanner_events.delete(do_event) + def initialize(parts:, location:) + @parts = parts + @location = location end - stmts.bind(predicate[:loc].end_char, ending[:loc].start_char) - - { - type: :until, - pred: predicate, - stmts: stmts, - loc: beging[:loc].to(ending[:loc]) - } - end + def pretty_print(q) + q.group(2, '(', ')') do + q.text('xstring') - # until_mod is a parser event that represents the modifier form of an - # until loop. It accepts as arguments the predicate to the until and the - # statement that is contained within the until loop. - def on_until_mod(predicate, statement) - find_scanner_event(:@kw, 'until') + q.breakable + q.group(2, '(', ')') { q.seplist(parts) { |part| q.pp(part) } } + end + end - { - type: :until_mod, - pred: predicate, - stmt: statement, - loc: statement[:loc].to(predicate[:loc]) - } + def to_json(*opts) + { type: :xstring, parts: parts, loc: location }.to_json(*opts) + end end - # var_alias is a parser event that represents when you're using the alias - # keyword with global variable arguments. You can optionally use - # parentheses with this keyword, so we either track the location - # information based on those or the final argument to the alias method. - def on_var_alias(left, right) - beging = find_scanner_event(:@kw, 'alias') - - paren = source[beging[:loc].end_char...left[:loc].start_char].include?('(') - ending = paren ? find_scanner_event(:@rparen) : right - - { - type: :var_alias, - left: left, - right: right, - loc: beging[:loc].to(ending[:loc]) - } + # :call-seq: + # on_xstring_add: ( + # XString xstring, + # (StringEmbExpr | StringDVar | TStringContent) part + # ) -> XString + def on_xstring_add(xstring, part) + XString.new( + parts: xstring.parts << part, + location: xstring.location.to(part.location) + ) end - # var_ref is a parser event that represents using either a local variable, - # a nil literal, a true or false literal, or a numbered block variable. - def on_var_ref(value) - { type: :var_ref, value: value, loc: value[:loc] } - end + # :call-seq: + # on_xstring_new: () -> XString + def on_xstring_new + heredoc = @heredocs[-1] - # var_field is a parser event that represents a variable that is being - # assigned a value. As such, it is always a child of an assignment type - # node. For example, in the following example foo is a var_field: - # - # foo = 1 - # - def on_var_field(value) location = - if value - value[:loc] - else - # You can hit this pattern if you're assigning to a splat using pattern - # matching syntax in Ruby 2.7+ + if heredoc && heredoc.beginning.value.include?('`') + heredoc.location + elsif RUBY_MAJOR <= 2 && RUBY_MINOR <= 5 && RUBY_PATCH < 7 Location.fixed(line: lineno, char: char_pos) + else + find_scanner_event(Backtick).location end - { type: :var_field, value: value, loc: location } + XString.new(parts: [], location: location) end - # vcall nodes are any plain named thing with Ruby that could be either a - # local variable or a method call. They accept as an argument the scanner - # event that contains their content. + # XStringLiteral represents a string that gets executed. # - # Access controls like private, protected, and public are reported as - # vcall nodes since they're technically method calls. We want to be able - # add new lines around them as necessary, so here we're going to - # explicitly track those as a different node type. - def on_vcall(value) - @controls ||= %w[private protected public].freeze - - name = value[:value] - type = - if @controls.include?(name) && name == lines[lineno - 1].strip - :access_ctrl - else - :vcall - end + # `ls` + # + class XStringLiteral + # [Array[StringEmbExpr | StringDVar | TStringContent]] the parts of the + # xstring + attr_reader :parts - { type: type, value: value, loc: value[:loc] } - end + # [Location] the location of this node + attr_reader :location - # void_stmt is a special kind of parser event that represents an empty lexical - # block of code. It often will have comments attached to it, so it requires - # some special handling. - def on_void_stmt - { type: :void_stmt, loc: Location.fixed(line: lineno, char: char_pos) } - end + def initialize(parts:, location:) + @parts = parts + @location = location + end - # when is a parser event that represents another clause in a case chain. - # It accepts as arguments the predicate of the when, the statements that - # are contained within the else if clause, and the optional consequent - # clause. - def on_when(args, stmts, consequent) - beging = find_scanner_event(:@kw, 'when') - ending = consequent || find_scanner_event(:@kw, 'end') + def pretty_print(q) + q.group(2, '(', ')') do + q.text('xstring_literal') - stmts.bind(args[:loc].end_char, ending[:loc].start_char) + q.breakable + q.group(2, '(', ')') { q.seplist(parts) { |part| q.pp(part) } } + end + end - { - type: :when, - args: args, - stmts: stmts, - cons: consequent, - loc: beging[:loc].to(ending[:loc]) - } + def to_json(*opts) + { type: :xstring_literal, parts: parts, loc: location }.to_json(*opts) + end end - # while is a parser event that represents a while loop. It accepts as - # arguments the predicate to the while and the statements that are - # contained within the while clause. - def on_while(predicate, stmts) - beging = find_scanner_event(:@kw, 'while') - ending = find_scanner_event(:@kw, 'end') + # :call-seq: + # on_xstring_literal: (XString xstring) -> Heredoc | XStringLiteral + def on_xstring_literal(xstring) + heredoc = @heredocs[-1] - # Consume the do keyword if it exists so that it doesn't get confused for - # some other block - do_event = find_scanner_event(:@kw, 'do', consume: false) - if do_event && do_event[:loc].start_char > predicate[:loc].end_char && - do_event[:loc].end_char < ending[:loc].start_char - scanner_events.delete(do_event) + if heredoc && heredoc.beginning.value.include?('`') + Heredoc.new( + beginning: heredoc.beginning, + ending: heredoc.ending, + parts: xstring.parts, + location: heredoc.location + ) + else + ending = find_scanner_event(TStringEnd) + + XStringLiteral.new( + parts: xstring.parts, + location: xstring.location.to(ending.location) + ) end + end - stmts.bind(predicate[:loc].end_char, ending[:loc].start_char) + # Yield represents using the +yield+ keyword with arguments. + # + # yield value + # + class Yield + # [ArgsAddBlock | Paren] the arguments passed to the yield + attr_reader :arguments - { - type: :while, - pred: predicate, - stmts: stmts, - loc: beging[:loc].to(ending[:loc]) - } - end + # [Location] the location of this node + attr_reader :location - # while_mod is a parser event that represents the modifier form of an - # while loop. It accepts as arguments the predicate to the while and the - # statement that is contained within the while loop. - def on_while_mod(predicate, statement) - find_scanner_event(:@kw, 'while') + def initialize(arguments:, location:) + @arguments = arguments + @location = location + end - { - type: :while_mod, - pred: predicate, - stmt: statement, - loc: statement[:loc].to(predicate[:loc]) - } - end + def pretty_print(q) + q.group(2, '(', ')') do + q.text('yield') - # word_add is a parser event that represents a part of a word within a - # special array literal that accepts interpolation. It accepts as - # arguments the parent word node as well as the additional part of the - # word, which can be either a @tstring_content node for a plain string - # part or a string_embexpr for an interpolated piece. - def on_word_add(word, part) - location = - if word[:parts].empty? - # Here we're making sure we get the correct bounds by using the - # location information from the first part. - part[:loc] - else - word[:loc].to(part[:loc]) + q.breakable + q.pp(arguments) end + end - { type: :word, parts: word[:parts] << part, loc: location } + def to_json(*opts) + { type: :yield, args: arguments, loc: location }.to_json(*opts) + end end - # word_new is a parser event that represents the beginning of a word - # within a special array literal (either strings or symbols) that accepts - # interpolation. For example, in the following array, there are three - # word nodes: - # - # %W[one a#{two}a three] - # - # Each word inside that array is represented as its own node, which is in - # terms of the parser a tree of word_new and word_add nodes. For our - # purposes, we're going to report this as a word node and build up an - # array body of our parts. - def on_word_new - { - type: :word, - parts: [], - loc: Location.fixed(line: lineno, char: char_pos) - } + # :call-seq: + # on_yield: ((ArgsAddBlock | Paren) arguments) -> Yield + def on_yield(arguments) + keyword = find_scanner_event(Kw, 'yield') + + Yield.new( + arguments: arguments, + location: keyword.location.to(arguments.location) + ) end - # words_beg is a scanner event that represents the start of a word literal - # array with interpolation. For example, in the following snippet: + # Yield0 represents the bare +yield+ keyword with no arguments. # - # %W[foo bar baz] + # yield # - # words_beg would be triggered with the value of "%W". - def on_words_beg(value) - node = { - type: :@words_beg, - value: value, - loc: Location.token(line: lineno, char: char_pos, size: value.size) - } + class Yield0 + # [String] the value of the keyword + attr_reader :value - scanner_events << node - node - end + # [Location] the location of this node + attr_reader :location - # words_sep is a scanner event that represents the separate between two words - # inside of a word literal array. It contains any amount of whitespace - # characters that are used to delimit the words. For example, - # - # %w[ - # foo - # bar - # baz - # ] - # - # in the snippet above there would be two words_sep events triggered, one - # between foo and bar and one between bar and baz. We don't need to track this - # event in the AST that we're generating, so we're not going to define an - # explicit handler for it. - # - # def on_words_sep(value) - # value - # end + def initialize(value:, location:) + @value = value + @location = location + end - # words_add is a parser event that represents an element inside of a - # string literal array that accepts interpolation, like - # %W[one #{two} three]. It accepts as arguments the parent words node as - # well as a word_add parser event. - def on_words_add(words, word_add) - { - type: :words, - elems: words[:elems] << word_add, - loc: words[:loc].to(word_add[:loc]) - } - end - - # words_new is a parser event that represents the beginning of a string - # literal array that accepts interpolation, like %W[one #{two} three]. It - # can be followed by any number of words_add events, which we'll append - # onto an array body. - def on_words_new - event = find_scanner_event(:@words_beg) + def pretty_print(q) + q.group(2, '(', ')') do + q.text('yield0') - { type: :words, elems: [], loc: event[:loc] } - end + q.breakable + q.pp(value) + end + end - # xstring_add is a parser event that represents a part of a string of - # commands that gets sent out to the terminal, like `ls`. It accepts two - # arguments, the parent xstring node as well as the part that is being - # added to the string. Because it supports interpolation this is either a - # tstring_content scanner event representing bare string content or a - # string_embexpr representing interpolated content. - def on_xstring_add(xstring, part) - { - type: :xstring, - parts: xstring[:parts] << part, - loc: xstring[:loc].to(part[:loc]) - } + def to_json(*opts) + { type: :yield0, value: value, loc: location }.to_json(*opts) + end end - # xstring_new is a parser event that represents the beginning of a string - # of commands that gets sent out to the terminal, like `ls`. It can - # optionally include interpolation much like a regular string, so we're - # going to build up an array body. - # - # If the xstring actually starts with a heredoc declaration, then we're - # going to let heredocs continue to do their thing and instead just use - # its location information. - def on_xstring_new - heredoc = @heredocs[-1] - - location = - if heredoc && heredoc[:beging][:value].include?('`') - heredoc[:loc] - elsif RUBY_MAJOR <= 2 && RUBY_MINOR <= 5 && RUBY_PATCH < 7 - Location.fixed(line: lineno, char: char_pos) - else - find_scanner_event(:@backtick)[:loc] - end + # :call-seq: + # on_yield0: () -> Yield0 + def on_yield0 + keyword = find_scanner_event(Kw, 'yield') - { type: :xstring, parts: [], loc: location } + Yield0.new(value: keyword.value, location: keyword.location) end - # xstring_literal is a parser event that represents a string of commands - # that gets sent to the terminal, like `ls`. It accepts as its only - # argument an xstring node that is a built up array representation of all - # of the parts of the string (including the plain string content and the - # interpolated content). - # - # They can also use heredocs to present themselves, as in the example: + # ZSuper represents the bare +super+ keyword with no arguments. # - # <<-`SHELL` - # ls - # SHELL + # super # - # In this case we need to change the node type to be a heredoc instead of - # an xstring_literal in order to get the right formatting. - def on_xstring_literal(xstring) - heredoc = @heredocs[-1] + class ZSuper + # [String] the value of the keyword + attr_reader :value - if heredoc && heredoc[:beging][:value].include?('`') - { - type: :heredoc, - beging: heredoc[:beging], - ending: heredoc[:ending], - parts: xstring[:parts], - loc: heredoc[:loc] - } - else - ending = find_scanner_event(:@tstring_end) + # [Location] the location of the node + attr_reader :location - { - type: :xstring_literal, - parts: xstring[:parts], - loc: xstring[:loc].to(ending[:loc]) - } + def initialize(value:, location:) + @value = value + @location = location end - end - # yield is a parser event that represents using the yield keyword with - # arguments. It accepts as an argument an args_add_block event that - # contains all of the arguments being passed. - def on_yield(args) - event = find_scanner_event(:@kw, 'yield') - - { type: :yield, args: args, loc: event[:loc].to(args[:loc]) } - end + def pretty_print(q) + q.group(2, '(', ')') do + q.text('zsuper') - # yield0 is a parser event that represents the bare yield keyword. It has - # no body as it accepts no arguments. This is as opposed to the yield - # parser event, which is the version where you're yielding one or more - # values. - def on_yield0 - keyword = find_scanner_event(:@kw, 'yield') + q.breakable + q.pp(value) + end + end - { type: :yield0, value: keyword[:value], loc: keyword[:loc] } + def to_json(*opts) + { type: :zsuper, value: value, loc: location }.to_json(*opts) + end end - # zsuper is a parser event that represents the bare super keyword. It has - # no body as it accepts no arguments. This is as opposed to the super - # parser event, which is the version where you're calling super with one - # or more values. + # :call-seq: + # on_zsuper: () -> ZSuper def on_zsuper - keyword = find_scanner_event(:@kw, 'super') + keyword = find_scanner_event(Kw, 'super') - { type: :zsuper, value: keyword[:value], loc: keyword[:loc] } + ZSuper.new(value: keyword.value, location: keyword.location) end end diff --git a/test/rb/metadata_test.rb b/test/rb/metadata_test.rb index c37795e1..2f83fae6 100644 --- a/test/rb/metadata_test.rb +++ b/test/rb/metadata_test.rb @@ -4,25 +4,25 @@ class MetadataTest < Minitest::Test def test_BEGIN - assert_metadata :BEGIN, <<~SOURCE + assert_metadata Prettier::Parser::BEGINBlock, <<~SOURCE BEGIN { } SOURCE end def test_END - assert_metadata :END, <<~SOURCE + assert_metadata Prettier::Parser::ENDBlock, <<~SOURCE END { } SOURCE end def test_alias - assert_metadata :alias, 'alias foo bar' + assert_metadata Prettier::Parser::Alias, 'alias foo bar' end def test_array_args - assert_metadata :array, <<~SOURCE + assert_metadata Prettier::Parser::ArrayLiteral, <<~SOURCE [ foo, bar, @@ -32,7 +32,7 @@ def test_array_args end def test_array_args_add_star - assert_metadata :array, <<~SOURCE + assert_metadata Prettier::Parser::ArrayLiteral, <<~SOURCE [ foo, *bar, @@ -42,7 +42,7 @@ def test_array_args_add_star end def test_array_qwords - assert_metadata :array, <<~SOURCE + assert_metadata Prettier::Parser::ArrayLiteral, <<~SOURCE %w[ foo bar @@ -52,13 +52,13 @@ def test_array_qwords end def test_aref - assert_metadata :aref, 'foo[bar]' + assert_metadata Prettier::Parser::ARef, 'foo[bar]' end def test_aref_field assert_node_metadata( - :aref_field, - parse('foo[bar] = baz')[:target], + Prettier::Parser::ARefField, + parse('foo[bar] = baz').target, start_char: 0, end_char: 8 ) @@ -66,8 +66,8 @@ def test_aref_field def test_args assert_node_metadata( - :args, - parse('foo bar, baz').dig(:args, :args), + Prettier::Parser::Args, + parse('foo bar, baz').arguments.arguments, start_char: 4, end_char: 12 ) @@ -75,8 +75,8 @@ def test_args def test_args_add_block assert_node_metadata( - :args_add_block, - parse('foo bar, baz')[:args], + Prettier::Parser::ArgsAddBlock, + parse('foo bar, baz').arguments, start_char: 4, end_char: 12 ) @@ -84,8 +84,8 @@ def test_args_add_block def test_args_add_star assert_node_metadata( - :args_add_star, - parse('foo *bar').dig(:args, :args), + Prettier::Parser::ArgsAddStar, + parse('foo *bar').arguments.arguments, start_char: 4, end_char: 8 ) @@ -101,8 +101,8 @@ def test_arg_paren SOURCE assert_node_metadata( - :arg_paren, - parse(content)[:args], + Prettier::Parser::ArgParen, + parse(content).arguments, start_char: 3, end_char: 20, start_line: 1, @@ -111,13 +111,13 @@ def test_arg_paren end def test_assign - assert_metadata :assign, 'foo = bar' + assert_metadata Prettier::Parser::Assign, 'foo = bar' end def test_assoc_new assert_node_metadata( - :assoc_new, - parse('{ foo: bar, bar: baz }').dig(:cnts, :assocs, 0), + Prettier::Parser::AssocNew, + parse('{ foo: bar, bar: baz }').contents.assocs.first, start_char: 2, end_char: 10 ) @@ -125,8 +125,8 @@ def test_assoc_new def test_assoc_splat assert_node_metadata( - :assoc_splat, - parse('foo **bar').dig(:args, :args, :parts, 0, :assocs, 0), + Prettier::Parser::AssocSplat, + parse('foo **bar').arguments.arguments.parts.first.assocs.first, start_char: 4, end_char: 9 ) @@ -134,8 +134,8 @@ def test_assoc_splat def test_assoclist_from_args assert_node_metadata( - :assoclist_from_args, - parse('{ foo => bar }')[:cnts], + Prettier::Parser::AssocListFromArgs, + parse('{ foo => bar }').contents, start_char: 1, end_char: 13 ) @@ -143,15 +143,15 @@ def test_assoclist_from_args def test_bare_assoc_hash assert_node_metadata( - :bare_assoc_hash, - parse('foo(bar: baz)').dig(:args, :args, :args, :parts, 0), + Prettier::Parser::BareAssocHash, + parse('foo(bar: baz)').arguments.arguments.arguments.parts.first, start_char: 4, end_char: 12 ) end def test_begin - assert_metadata :begin, <<~SOURCE + assert_metadata Prettier::Parser::Begin, <<~SOURCE begin begin; end end @@ -159,13 +159,13 @@ def test_begin end def test_binary - assert_metadata :binary, 'foo + bar' + assert_metadata Prettier::Parser::Binary, 'foo + bar' end def test_blockarg assert_node_metadata( - :blockarg, - parse('def foo(&bar) end').dig(:params, :cnts, :block), + Prettier::Parser::BlockArg, + parse('def foo(&bar) end').params.contents.block, start_char: 8, end_char: 12 ) @@ -173,8 +173,8 @@ def test_blockarg def test_block_var assert_node_metadata( - :block_var, - parse('foo { |bar| }').dig(:block, :block_var), + Prettier::Parser::BlockVar, + parse('foo { |bar| }').block.block_var, start_char: 6, end_char: 11 ) @@ -182,8 +182,8 @@ def test_block_var def test_bodystmt assert_node_metadata( - :bodystmt, - parse('class Foo; def foo; end; end')[:bodystmt], + Prettier::Parser::BodyStmt, + parse('class Foo; def foo; end; end').bodystmt, start_char: 9, end_char: 25 ) @@ -191,23 +191,23 @@ def test_bodystmt def test_brace_block assert_node_metadata( - :brace_block, - parse('foo { bar }')[:block], + Prettier::Parser::BraceBlock, + parse('foo { bar }').block, start_char: 4, end_char: 11 ) end def test_break - assert_metadata :break, 'break foo' + assert_metadata Prettier::Parser::Break, 'break foo' end def test_call - assert_metadata :call, 'foo.bar' + assert_metadata Prettier::Parser::Call, 'foo.bar' end def test_case - assert_metadata :case, <<~SOURCE + assert_metadata Prettier::Parser::Case, <<~SOURCE case foo when bar case baz @@ -218,7 +218,7 @@ def test_case end def test_class - assert_metadata :class, <<~SOURCE + assert_metadata Prettier::Parser::ClassDeclaration, <<~SOURCE class Foo class Bar; end end @@ -226,17 +226,17 @@ class Bar; end end def test_command - assert_metadata :command, 'foo bar' + assert_metadata Prettier::Parser::Command, 'foo bar' end def test_command_call - assert_metadata :command_call, 'foo.bar baz' + assert_metadata Prettier::Parser::CommandCall, 'foo.bar baz' end def test_const_ref assert_node_metadata( - :const_ref, - parse('class Foo; end')[:constant], + Prettier::Parser::ConstRef, + parse('class Foo; end').constant, start_char: 6, end_char: 9 ) @@ -244,19 +244,19 @@ def test_const_ref def test_const_path_field assert_node_metadata( - :const_path_field, - parse('Foo::Bar = baz')[:target], + Prettier::Parser::ConstPathField, + parse('Foo::Bar = baz').target, start_char: 0, end_char: 8 ) end def test_const_path_ref - assert_metadata :const_path_ref, 'Foo::Bar' + assert_metadata Prettier::Parser::ConstPathRef, 'Foo::Bar' end def test_def - assert_metadata :def, <<~SOURCE + assert_metadata Prettier::Parser::Def, <<~SOURCE def foo def bar; end end @@ -264,7 +264,7 @@ def bar; end end def test_defined - assert_metadata :defined, <<~SOURCE + assert_metadata Prettier::Parser::Defined, <<~SOURCE defined?( Foo ) @@ -272,7 +272,7 @@ def test_defined end def test_defs - assert_metadata :defs, <<~SOURCE + assert_metadata Prettier::Parser::Defs, <<~SOURCE def Object.foo def Object.bar; end end @@ -281,23 +281,23 @@ def Object.bar; end def test_do_block assert_node_metadata( - :do_block, - parse('foo do; bar; end')[:block], + Prettier::Parser::DoBlock, + parse('foo do; bar; end').block, start_char: 4, end_char: 16 ) end def test_dot2 - assert_metadata :dot2, 'foo..bar' + assert_metadata Prettier::Parser::Dot2, 'foo..bar' end def test_dot3 - assert_metadata :dot3, 'foo...bar' + assert_metadata Prettier::Parser::Dot3, 'foo...bar' end def test_dyna_symbol - assert_metadata :dyna_symbol, ':"foo #{bar} baz"' + assert_metadata Prettier::Parser::DynaSymbol, ':"foo #{bar} baz"' end def test_else @@ -310,8 +310,8 @@ def test_else SOURCE assert_node_metadata( - :else, - parse(content)[:cons], + Prettier::Parser::Else, + parse(content).consequent, start_char: 13, end_char: 27, start_line: 3, @@ -329,8 +329,8 @@ def test_elsif SOURCE assert_node_metadata( - :elsif, - parse(content)[:cons], + Prettier::Parser::Elsif, + parse(content).consequent, start_char: 13, end_char: 32, start_line: 3, @@ -348,8 +348,8 @@ def test_ensure SOURCE assert_node_metadata( - :ensure, - parse(content).dig(:bodystmt, :ens), + Prettier::Parser::Ensure, + parse(content).bodystmt.ensure_clause, start_char: 12, end_char: 28, start_line: 3, @@ -360,8 +360,8 @@ def test_ensure if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.6') def test_excessed_comma assert_node_metadata( - :excessed_comma, - parse('foo { |bar,| }').dig(:block, :block_var, :params, :rest), + Prettier::Parser::ExcessedComma, + parse('foo { |bar,| }').block.block_var.params.rest, start_char: 10, end_char: 11 ) @@ -370,8 +370,8 @@ def test_excessed_comma def test_fcall assert_node_metadata( - :fcall, - parse('foo(bar)')[:call], + Prettier::Parser::FCall, + parse('foo(bar)').call, start_char: 0, end_char: 3 ) @@ -379,15 +379,15 @@ def test_fcall def test_field assert_node_metadata( - :field, - parse('foo.bar = baz')[:target], + Prettier::Parser::Field, + parse('foo.bar = baz').target, start_char: 0, end_char: 7 ) end def test_for - assert_metadata :for, <<~SOURCE + assert_metadata Prettier::Parser::For, <<~SOURCE for foo in bar do for baz in qux do end @@ -396,7 +396,7 @@ def test_for end def test_hash - assert_metadata :hash, <<~SOURCE + assert_metadata Prettier::Parser::HashLiteral, <<~SOURCE { foo: 'bar' } @@ -404,7 +404,7 @@ def test_hash end def test_if - assert_metadata :if, <<~SOURCE + assert_metadata Prettier::Parser::If, <<~SOURCE if foo if bar; end end @@ -412,24 +412,24 @@ def test_if end def test_ifop - assert_metadata :ifop, 'foo ? bar : baz' + assert_metadata Prettier::Parser::IfOp, 'foo ? bar : baz' end def test_if_mod - assert_metadata :if_mod, 'foo if bar' + assert_metadata Prettier::Parser::IfMod, 'foo if bar' end def test_kwrest_param assert_node_metadata( - :kwrest_param, - parse('def foo(**bar); end').dig(:params, :cnts, :kwrest), + Prettier::Parser::KwRestParam, + parse('def foo(**bar); end').params.contents.keyword_rest, start_char: 8, end_char: 13 ) end def test_lambda - assert_metadata :lambda, <<~SOURCE + assert_metadata Prettier::Parser::Lambda, <<~SOURCE -> (foo, bar) { foo + bar } @@ -437,21 +437,21 @@ def test_lambda end def test_massign - assert_metadata :massign, 'foo, bar, baz = 1, 2, 3' + assert_metadata Prettier::Parser::MAssign, 'foo, bar, baz = 1, 2, 3' end def test_method_add_arg - assert_metadata :method_add_arg, 'foo(bar)' + assert_metadata Prettier::Parser::MethodAddArg, 'foo(bar)' end def test_method_add_block - assert_metadata :method_add_block, 'foo { bar }' + assert_metadata Prettier::Parser::MethodAddBlock, 'foo { bar }' end def test_mlhs assert_node_metadata( - :mlhs, - parse('foo, bar, baz = 1, 2, 3')[:tgt], + Prettier::Parser::MLHS, + parse('foo, bar, baz = 1, 2, 3').target, start_char: 0, end_char: 13 ) @@ -459,8 +459,8 @@ def test_mlhs def test_mlhs_add_post assert_node_metadata( - :mlhs_add_post, - parse('foo, *bar, baz = 1, 2, 3')[:tgt], + Prettier::Parser::MLHSAddPost, + parse('foo, *bar, baz = 1, 2, 3').target, start_char: 5, end_char: 14 ) @@ -468,8 +468,8 @@ def test_mlhs_add_post def test_mlhs_add_star assert_node_metadata( - :mlhs_add_star, - parse('foo, *bar = 1, 2, 3')[:tgt], + Prettier::Parser::MLHSAddStar, + parse('foo, *bar = 1, 2, 3').target, start_char: 5, end_char: 9 ) @@ -477,15 +477,15 @@ def test_mlhs_add_star def test_mlhs_paren assert_node_metadata( - :mlhs_paren, - parse('(foo, bar) = baz')[:tgt], + Prettier::Parser::MLHSParen, + parse('(foo, bar) = baz').target, start_char: 0, end_char: 10 ) end def test_module - assert_metadata :module, <<~SOURCE + assert_metadata Prettier::Parser::ModuleDeclaration, <<~SOURCE module Foo module Bar; end end @@ -494,19 +494,19 @@ module Bar; end def test_mrhs_add_star assert_node_metadata( - :mrhs_add_star, - parse('foo, bar = *baz')[:val], + Prettier::Parser::MRHSAddStar, + parse('foo, bar = *baz').value, start_char: 11, end_char: 15 ) end def test_next - assert_metadata :next, 'next foo' + assert_metadata Prettier::Parser::Next, 'next foo' end def test_opassign - assert_metadata :opassign, 'foo ||= bar' + assert_metadata Prettier::Parser::OpAssign, 'foo ||= bar' end def test_params @@ -518,8 +518,8 @@ def foo( SOURCE assert_node_metadata( - :params, - parse(content).dig(:params, :cnts), + Prettier::Parser::Params, + parse(content).params.contents, start_char: 8, end_char: 22, start_line: 2, @@ -528,13 +528,13 @@ def foo( end def test_paren - assert_metadata :paren, '()' + assert_metadata Prettier::Parser::Paren, '()' end def test_qsymbols assert_node_metadata( - :qsymbols, - parse('%i[foo bar baz]')[:cnts], + Prettier::Parser::QSymbols, + parse('%i[foo bar baz]').contents, start_char: 0, end_char: 15 ) @@ -542,26 +542,26 @@ def test_qsymbols def test_qwords assert_node_metadata( - :qwords, - parse('%w[foo bar baz]')[:cnts], + Prettier::Parser::QWords, + parse('%w[foo bar baz]').contents, start_char: 0, end_char: 15 ) end def test_redo - assert_metadata :redo, 'redo' + assert_metadata Prettier::Parser::Redo, 'redo' end def test_regexp_literal - assert_metadata :regexp_literal, '/foo/' - assert_metadata :regexp_literal, '%r{foo}' - assert_metadata :regexp_literal, '%r(foo)' + assert_metadata Prettier::Parser::RegexpLiteral, '/foo/' + assert_metadata Prettier::Parser::RegexpLiteral, '%r{foo}' + assert_metadata Prettier::Parser::RegexpLiteral, '%r(foo)' assert_node_metadata( - :regexp_literal, + Prettier::Parser::RegexpLiteral, parse('%r(foo)'), - beging: '%r(', + beginning: '%r(', ending: ')', start_char: 0, end_char: 7 @@ -570,40 +570,40 @@ def test_regexp_literal def test_rescue assert_node_metadata( - :rescue, - parse('begin; foo; rescue => bar; baz; end').dig(:bodystmt, :rsc), + Prettier::Parser::Rescue, + parse('begin; foo; rescue => bar; baz; end').bodystmt.rescue_clause, start_char: 12, end_char: 35 ) end def test_rescue_mod - assert_metadata :rescue_mod, 'foo rescue bar' + assert_metadata Prettier::Parser::RescueMod, 'foo rescue bar' end def test_rest_param assert_node_metadata( - :rest_param, - parse('def foo(*bar); end').dig(:params, :cnts, :rest), + Prettier::Parser::RestParam, + parse('def foo(*bar); end').params.contents.rest, start_char: 8, end_char: 12 ) end def test_retry - assert_metadata :retry, 'retry' + assert_metadata Prettier::Parser::Retry, 'retry' end def test_return - assert_metadata :return, 'return foo' + assert_metadata Prettier::Parser::Return, 'return foo' end def test_return0 - assert_metadata :return0, 'return' + assert_metadata Prettier::Parser::Return0, 'return' end def test_sclass - assert_metadata :sclass, <<~SOURCE + assert_metadata Prettier::Parser::SClass, <<~SOURCE class << Foo class << Bar; end end @@ -611,7 +611,7 @@ class << Bar; end end def test_string_concat - assert_metadata :string_concat, <<~SOURCE + assert_metadata Prettier::Parser::StringConcat, <<~SOURCE 'foo' \ 'bar' SOURCE @@ -619,8 +619,8 @@ def test_string_concat def test_string_dvar assert_node_metadata( - :string_dvar, - parse('"#$foo"').dig(:parts, 0), + Prettier::Parser::StringDVar, + parse('"#$foo"').parts.first, start_char: 1, end_char: 6 ) @@ -628,29 +628,29 @@ def test_string_dvar def test_string_embexpr assert_node_metadata( - :string_embexpr, - parse('"foo #{bar} baz"').dig(:parts, 1), + Prettier::Parser::StringEmbExpr, + parse('"foo #{bar} baz"').parts[1], start_char: 5, end_char: 11 ) end def test_string_literal - assert_metadata :string_literal, '"foo"' + assert_metadata Prettier::Parser::StringLiteral, '"foo"' end def test_super - assert_metadata :super, 'super foo' + assert_metadata Prettier::Parser::Super, 'super foo' end def test_symbol_literal - assert_metadata :symbol_literal, ':foo' + assert_metadata Prettier::Parser::SymbolLiteral, ':foo' end def test_symbols assert_node_metadata( - :symbols, - parse('%I[f#{o}o b#{a}r b#{a}z]')[:cnts], + Prettier::Parser::Symbols, + parse('%I[f#{o}o b#{a}r b#{a}z]').contents, start_char: 0, end_char: 24 ) @@ -658,28 +658,28 @@ def test_symbols def test_top_const_field assert_node_metadata( - :top_const_field, - parse('::Foo = bar')[:target], + Prettier::Parser::TopConstField, + parse('::Foo = bar').target, start_char: 0, end_char: 5 ) end def test_top_const_ref - assert_metadata :top_const_ref, '::Foo' + assert_metadata Prettier::Parser::TopConstRef, '::Foo' end def test_unary - assert_metadata :unary, '-foo' - assert_metadata :unary, 'not foo' + assert_metadata Prettier::Parser::Unary, '-foo' + assert_metadata Prettier::Parser::Not, 'not foo' end def test_undef - assert_metadata :undef, 'undef foo, bar' + assert_metadata Prettier::Parser::Undef, 'undef foo, bar' end def test_unless - assert_metadata :unless, <<~SOURCE + assert_metadata Prettier::Parser::Unless, <<~SOURCE unless foo unless bar; end end @@ -687,11 +687,11 @@ def test_unless end def test_unless_mod - assert_metadata :unless_mod, 'foo unless bar' + assert_metadata Prettier::Parser::UnlessMod, 'foo unless bar' end def test_until - assert_metadata :until, <<~SOURCE + assert_metadata Prettier::Parser::Until, <<~SOURCE until foo until bar; end end @@ -699,11 +699,11 @@ def test_until end def test_until_mod - assert_metadata :until_mod, 'foo until bar' + assert_metadata Prettier::Parser::UntilMod, 'foo until bar' end def test_while - assert_metadata :while, <<~SOURCE + assert_metadata Prettier::Parser::While, <<~SOURCE while foo while bar; end end @@ -711,54 +711,59 @@ def test_while end def test_var_alias - assert_metadata :var_alias, 'alias $foo $bar' + assert_metadata Prettier::Parser::VarAlias, 'alias $foo $bar' end def test_var_field assert_node_metadata( - :var_field, - parse('foo = 1')[:target], + Prettier::Parser::VarField, + parse('foo = 1').target, start_char: 0, end_char: 3 ) end def test_var_ref - assert_metadata :var_ref, 'true' + assert_metadata Prettier::Parser::VarRef, 'true' end def test_vcall - assert_metadata :vcall, 'foo' + assert_metadata Prettier::Parser::VCall, 'foo' end def test_void_stmt - assert_node_metadata(:void_stmt, parse('; ;'), start_char: 0, end_char: 0) + assert_node_metadata( + Prettier::Parser::VoidStmt, + parse('; ;'), + start_char: 0, + end_char: 0 + ) end def test_when assert_node_metadata( - :when, - parse('case foo; when bar; baz; end')[:cons], + Prettier::Parser::When, + parse('case foo; when bar; baz; end').consequent, start_char: 10, end_char: 28 ) end def test_while_mod - assert_metadata :while_mod, 'foo while bar' + assert_metadata Prettier::Parser::WhileMod, 'foo while bar' end def test_words assert_node_metadata( - :words, - parse('%W[f#{o}o b#{a}r b#{a}z]')[:cnts], + Prettier::Parser::Words, + parse('%W[f#{o}o b#{a}r b#{a}z]').contents, start_char: 0, end_char: 24 ) end def test_xstring - assert_metadata :xstring_literal, <<~SOURCE + assert_metadata Prettier::Parser::XStringLiteral, <<~SOURCE ` foo bar @@ -767,15 +772,15 @@ def test_xstring end def test_yield - assert_metadata :yield, 'yield foo' + assert_metadata Prettier::Parser::Yield, 'yield foo' end def test_yield0 - assert_metadata :yield0, 'yield' + assert_metadata Prettier::Parser::Yield0, 'yield' end def test_zsuper - assert_metadata :zsuper, 'super' + assert_metadata Prettier::Parser::ZSuper, 'super' end if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7') @@ -787,8 +792,8 @@ def foo(...) SOURCE assert_node_metadata( - :args_forward, - parse(content).dig(:params, :cnts, :rest), + Prettier::Parser::ArgsForward, + parse(content).params.contents.rest, start_char: 8, end_char: 11 ) @@ -803,8 +808,8 @@ def test_aryptn SOURCE assert_node_metadata( - :aryptn, - parse(content).dig(:cons, :pttn), + Prettier::Parser::AryPtn, + parse(content).consequent.pattern, start_char: 12, end_char: 20, start_line: 2, @@ -821,8 +826,8 @@ def test_in SOURCE assert_node_metadata( - :in, - parse(content)[:cons], + Prettier::Parser::In, + parse(content).consequent, start_char: 9, end_char: 25, start_line: 2, @@ -853,17 +858,17 @@ def assert_node_metadata( end_line: 1, **metadata ) - assert_equal(type, node[:type]) + assert_kind_of(type, node) - assert_equal(start_line, node[:loc].start_line) - assert_equal(start_char, node[:loc].start_char) - assert_equal(end_line, node[:loc].end_line) - assert_equal(end_char, node[:loc].end_char) + assert_equal(start_line, node.location.start_line) + assert_equal(start_char, node.location.start_char) + assert_equal(end_line, node.location.end_line) + assert_equal(end_char, node.location.end_char) - metadata.each { |key, value| assert_equal(value, node[key]) } + metadata.each { |key, value| assert_equal(value, node.public_send(key)) } end def parse(ruby) - Prettier::Parser.parse(ruby).dig(:stmts, :body, 0) + Prettier::Parser.parse(ruby).statements.body.first end end diff --git a/test/rb/parser_test.rb b/test/rb/parser_test.rb index f2a5dae7..2d612357 100644 --- a/test/rb/parser_test.rb +++ b/test/rb/parser_test.rb @@ -4,13 +4,16 @@ class ParserTest < Minitest::Test def test_events + filepath = File.expand_path('../../src/ruby/parser.rb', __dir__) + pattern = /(?:alias|def) on_([^(\s]+)/ + # This is a list of all of the parser events that Ripper will emit - all_events = Ripper::PARSER_EVENTS + all_events = Ripper::EVENTS # This is a list of all of the parser events for which we have an explicitly # defined event handler in our parser. handled_events = - Prettier::Parser.private_instance_methods.grep(/\Aon_(.+)/) { $1.to_sym } + File.read(filepath).scan(pattern).map { |event,| event.to_sym } # Assert here that there are no missing events. assert_empty(all_events - handled_events) From 216ed5c2e6838bde5ef2daaa59ff3afcca0babec Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 15 Nov 2021 17:09:50 -0500 Subject: [PATCH 418/785] Consistency in naming --- src/ruby/nodes/alias.ts | 4 +-- src/ruby/nodes/arrays.ts | 2 +- src/ruby/nodes/assign.ts | 2 +- src/ruby/nodes/conditionals.ts | 2 +- src/ruby/nodes/hashes.ts | 4 +-- src/ruby/nodes/loops.ts | 10 +++--- src/ruby/nodes/massign.ts | 8 ++--- src/ruby/nodes/methods.ts | 2 +- src/ruby/nodes/operators.ts | 8 ++--- src/ruby/nodes/patterns.ts | 4 +-- src/ruby/nodes/rescue.ts | 2 +- src/ruby/nodes/return.ts | 2 +- src/ruby/nodes/strings.ts | 2 +- src/ruby/nodes/undef.ts | 4 +-- src/ruby/parser.rb | 60 +++++++++++++++++----------------- src/ruby/toProc.ts | 4 +-- src/types/ruby.ts | 26 +++++++-------- src/utils/getChildNodes.ts | 26 +++++++-------- src/utils/makeCall.ts | 4 +-- 19 files changed, 88 insertions(+), 88 deletions(-) diff --git a/src/ruby/nodes/alias.ts b/src/ruby/nodes/alias.ts index ee7786cf..3ea96cfc 100644 --- a/src/ruby/nodes/alias.ts +++ b/src/ruby/nodes/alias.ts @@ -44,11 +44,11 @@ export const printAlias: Plugin.Printer = ( // otherwise we could accidentally skip printing them. if (argNode.comments) { argNode.comments.forEach((comment) => { - addTrailingComment(argNode.val, comment); + addTrailingComment(argNode.value, comment); }); } - return argPath.call(print, "val"); + return argPath.call(print, "value"); } return print(argPath); diff --git a/src/ruby/nodes/arrays.ts b/src/ruby/nodes/arrays.ts index a0c31039..24e530c7 100644 --- a/src/ruby/nodes/arrays.ts +++ b/src/ruby/nodes/arrays.ts @@ -127,7 +127,7 @@ export const printArray: Plugin.Printer = (path, opts, print) => { // interpolation, then we're going to print a %i array. if (isSymbolArray(contents)) { const printSymbol = (symbolPath: Plugin.Path) => - symbolPath.call(print, "val"); + symbolPath.call(print, "value"); const nodePath = path as Plugin.Path<{ cnts: { parts: Ruby.SymbolLiteral[] }; diff --git a/src/ruby/nodes/assign.ts b/src/ruby/nodes/assign.ts index 791cc0b6..4988da39 100644 --- a/src/ruby/nodes/assign.ts +++ b/src/ruby/nodes/assign.ts @@ -35,7 +35,7 @@ export const printOpAssign: Plugin.Printer = ( group([ path.call(print, "target"), " ", - path.call(print, "operator"), + path.call(print, "op"), indent([line, path.call(print, "value")]) ]); diff --git a/src/ruby/nodes/conditionals.ts b/src/ruby/nodes/conditionals.ts index ec0e8a8d..c1ec24f2 100644 --- a/src/ruby/nodes/conditionals.ts +++ b/src/ruby/nodes/conditionals.ts @@ -197,7 +197,7 @@ function canTernaryStmts(stmts: Ruby.Stmts) { // If the user is using one of the lower precedence "and" or "or" operators, // then we can't use a ternary expression as it would break the flow control. - if (stmt.type === "binary" && ["and", "or"].includes(stmt.operator)) { + if (stmt.type === "binary" && ["and", "or"].includes(stmt.op)) { return false; } diff --git a/src/ruby/nodes/hashes.ts b/src/ruby/nodes/hashes.ts index 10ce8ff2..05237d6f 100644 --- a/src/ruby/nodes/hashes.ts +++ b/src/ruby/nodes/hashes.ts @@ -27,7 +27,7 @@ type HashContents = (Ruby.AssoclistFromArgs | Ruby.BareAssocHash) & { // This function represents that check, as it determines if it can convert the // symbol node into a hash label. function isValidHashLabel(symbolLiteral: Ruby.SymbolLiteral) { - const label = symbolLiteral.val.value; + const label = symbolLiteral.value.value; return label.match(/^[_A-Za-z]/) && !label.endsWith("="); } @@ -57,7 +57,7 @@ const printHashKeyLabel: KeyPrinter = (path, print) => { case "@label": return print(path); case "symbol_literal": - return [(path as Plugin.Path).call(print, "val"), ":"]; + return [(path as Plugin.Path).call(print, "value"), ":"]; case "dyna_symbol": return [print(path), ":"]; default: diff --git a/src/ruby/nodes/loops.ts b/src/ruby/nodes/loops.ts index 06c3f3e5..9f6336c9 100644 --- a/src/ruby/nodes/loops.ts +++ b/src/ruby/nodes/loops.ts @@ -71,16 +71,16 @@ function printLoop(keyword: string): Plugin.Printer { export const printFor: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); - let iteratorDoc = path.call(print, "iterator"); - if (node.iterator.type === "mlhs") { - iteratorDoc = join(", ", iteratorDoc); + let indexDoc = path.call(print, "index"); + if (node.index.type === "mlhs") { + indexDoc = join(", ", indexDoc); } return group([ "for ", - iteratorDoc, + indexDoc, " in ", - path.call(print, "enumerable"), + path.call(print, "collection"), indent([hardline, path.call(print, "stmts")]), hardline, "end" diff --git a/src/ruby/nodes/massign.ts b/src/ruby/nodes/massign.ts index c14a2a4f..0912a5a6 100644 --- a/src/ruby/nodes/massign.ts +++ b/src/ruby/nodes/massign.ts @@ -9,14 +9,14 @@ export const printMAssign: Plugin.Printer = ( print ) => { const node = path.getValue(); - let valueDoc = path.call(print, "val"); + let valueDoc = path.call(print, "value"); - if (["mrhs", "mrhs_add_star", "mrhs_new_from_args"].includes(node.val.type)) { + if (["mrhs", "mrhs_add_star", "mrhs_new_from_args"].includes(node.value.type)) { valueDoc = group(join([",", line], valueDoc)); } - const targetDoc: Plugin.Doc[] = [join([",", line], path.call(print, "tgt"))]; - if ((node.tgt as any).comma) { + const targetDoc: Plugin.Doc[] = [join([",", line], path.call(print, "target"))]; + if (node.target.type === "mlhs" && node.target.comma) { targetDoc.push(","); } diff --git a/src/ruby/nodes/methods.ts b/src/ruby/nodes/methods.ts index 7ec4676a..cd9acc8d 100644 --- a/src/ruby/nodes/methods.ts +++ b/src/ruby/nodes/methods.ts @@ -15,7 +15,7 @@ export const printDef: Plugin.Printer = ( // In this case, we're printing a method that's defined as a singleton, so // we need to include the target and the operator before the name. if (node.type === "defs") { - declaration.push(path.call(print, "target"), path.call(print, "operator")); + declaration.push(path.call(print, "target"), path.call(print, "op")); } // In case there are no parens but there are parameters diff --git a/src/ruby/nodes/operators.ts b/src/ruby/nodes/operators.ts index f55ce594..02228793 100644 --- a/src/ruby/nodes/operators.ts +++ b/src/ruby/nodes/operators.ts @@ -6,13 +6,13 @@ const { group, indent, line, softline } = prettier; export const printBinary: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); - const space = node.operator === "**" ? "" : " "; + const space = node.op === "**" ? "" : " "; if (noIndent.includes(node.right.type)) { return group([ group(path.call(print, "left")), space, - node.operator, + node.op, space, group(path.call(print, "right")) ]); @@ -23,7 +23,7 @@ export const printBinary: Plugin.Printer = (path, opts, print) => { space, group( indent([ - node.operator, + node.op, space === "" ? softline : line, path.call(print, "right") ]) @@ -57,7 +57,7 @@ export const printDot3: Plugin.Printer = (path, opts, print) => { export const printUnary: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); - const valueDoc = path.call(print, "val"); + const valueDoc = path.call(print, "value"); if (node.op === "not") { // Here we defer to the original source, as it's kind of difficult to diff --git a/src/ruby/nodes/patterns.ts b/src/ruby/nodes/patterns.ts index 6a7286a4..52567be5 100644 --- a/src/ruby/nodes/patterns.ts +++ b/src/ruby/nodes/patterns.ts @@ -137,7 +137,7 @@ export const printIn: Plugin.Printer = (path, opts, print) => { keyword, align( keyword.length, - path.call((valuePath) => printPatternArg(valuePath, opts, print), "pttn") + path.call((valuePath) => printPatternArg(valuePath, opts, print), "pattern") ), indent([hardline, path.call(print, "stmts")]) ]; @@ -153,6 +153,6 @@ export const printRAssign: Plugin.Printer = (path, opts, print) => group([ path.call(print, "value"), " ", - path.call(print, "operator"), + path.call(print, "op"), group(indent([line, path.call(print, "pattern")])) ]); diff --git a/src/ruby/nodes/rescue.ts b/src/ruby/nodes/rescue.ts index 9f00b3f9..87dd785b 100644 --- a/src/ruby/nodes/rescue.ts +++ b/src/ruby/nodes/rescue.ts @@ -90,7 +90,7 @@ export const printRescueMod: Plugin.Printer = ( indent([hardline, path.call(print, "stmt")]), hardline, "rescue StandardError", - indent([hardline, path.call(print, "val")]), + indent([hardline, path.call(print, "value")]), hardline, "end" ]; diff --git a/src/ruby/nodes/return.ts b/src/ruby/nodes/return.ts index d1ad0c94..80f3e72f 100644 --- a/src/ruby/nodes/return.ts +++ b/src/ruby/nodes/return.ts @@ -19,7 +19,7 @@ function canSkipParens(paren: Ruby.Paren) { const stmt = stmts.body[0]; // return (a or b) - if (stmt.type === "binary" && ["and", "or"].includes(stmt.operator)) { + if (stmt.type === "binary" && ["and", "or"].includes(stmt.op)) { return false; } diff --git a/src/ruby/nodes/strings.ts b/src/ruby/nodes/strings.ts index ad049dd7..6e79fe23 100644 --- a/src/ruby/nodes/strings.ts +++ b/src/ruby/nodes/strings.ts @@ -279,7 +279,7 @@ export const printSymbolLiteral: Plugin.Printer = ( opts, print ) => { - return [":", path.call(print, "val")]; + return [":", path.call(print, "value")]; }; // Prints out an xstring literal. Its child is an array of string parts, diff --git a/src/ruby/nodes/undef.ts b/src/ruby/nodes/undef.ts index d4354acb..79fdc9e5 100644 --- a/src/ruby/nodes/undef.ts +++ b/src/ruby/nodes/undef.ts @@ -17,13 +17,13 @@ export const printUndef: Plugin.Printer = (path, opts, print) => { // printing so they get printed as well. if (symbolNode.comments) { symbolNode.comments.forEach((comment) => { - addTrailingComment(symbolNode.val, comment); + addTrailingComment(symbolNode.value, comment); }); } // If we're printing a symbol literal, then we want to descend into it and // just print the underlying contents so that it prints as a bare word. - return symbolPath.call(print, "val"); + return symbolPath.call(print, "value"); }, "syms"); const keyword = "undef "; diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index ef76854f..4127b886 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -1529,7 +1529,7 @@ def to_json(*opts) { type: :binary, left: left, - operator: operator, + op: operator, right: right, loc: location }.to_json(*opts) @@ -1936,7 +1936,7 @@ def to_json(*opts) { type: :call, receiver: receiver, - operator: operator, + op: operator, message: message, loc: location }.to_json(*opts) @@ -2067,7 +2067,7 @@ def to_json(*opts) { type: :rassign, value: value, - operator: operator, + op: operator, pattern: pattern, loc: location }.to_json(*opts) @@ -2350,7 +2350,7 @@ def to_json(*opts) { type: :command_call, receiver: receiver, - operator: operator, + op: operator, message: message, args: arguments, loc: location @@ -2932,7 +2932,7 @@ def to_json(*opts) { type: :defs, target: target, - operator: operator, + op: operator, name: name, params: params, bodystmt: bodystmt, @@ -3784,7 +3784,7 @@ def to_json(*opts) { type: :field, parent: parent, - operator: operator, + op: operator, name: name, loc: location }.to_json(*opts) @@ -3941,10 +3941,10 @@ def on_fndptn(constant, left, values, right) class For # [MLHS | MLHSAddStar | VarField] the variable declaration being used to # pull values out of the object being enumerated - attr_reader :iterator + attr_reader :index # [untyped] the object being enumerated in the loop - attr_reader :enumerable + attr_reader :collection # [Statements] the statements to be executed attr_reader :statements @@ -3952,9 +3952,9 @@ class For # [Location] the location of this node attr_reader :location - def initialize(iterator:, enumerable:, statements:, location:) - @iterator = iterator - @enumerable = enumerable + def initialize(index:, collection:, statements:, location:) + @index = index + @collection = collection @statements = statements @location = location end @@ -3964,10 +3964,10 @@ def pretty_print(q) q.text('for') q.breakable - q.pp(iterator) + q.pp(index) q.breakable - q.pp(enumerable) + q.pp(collection) q.breakable q.pp(statements) @@ -3977,8 +3977,8 @@ def pretty_print(q) def to_json(*opts) { type: :for, - iterator: iterator, - enumerable: enumerable, + index: index, + collection: collection, stmts: statements, loc: location }.to_json(*opts) @@ -3987,30 +3987,30 @@ def to_json(*opts) # :call-seq: # on_for: ( - # (MLHS | MLHSAddStar | VarField) iterator, - # untyped enumerable, + # (MLHS | MLHSAddStar | VarField) value, + # untyped collection, # Statements statements # ) -> For - def on_for(iterator, enumerable, statements) + def on_for(index, collection, statements) beginning = find_scanner_event(Kw, 'for') ending = find_scanner_event(Kw, 'end') # Consume the do keyword if it exists so that it doesn't get confused for # some other block keyword = find_scanner_event(Kw, 'do', consume: false) - if keyword && keyword.location.start_char > enumerable.location.end_char && + if keyword && keyword.location.start_char > collection.location.end_char && keyword.location.end_char < ending.location.start_char scanner_events.delete(keyword) end statements.bind( - (keyword || enumerable).location.end_char, + (keyword || collection).location.end_char, ending.location.start_char ) For.new( - iterator: iterator, - enumerable: enumerable, + index: index, + collection: collection, statements: statements, location: beginning.location.to(ending.location) ) @@ -4655,7 +4655,7 @@ def pretty_print(q) def to_json(*opts) { type: :in, - pttn: pattern, + pattern: pattern, stmts: statements, cons: consequent, loc: location @@ -5199,7 +5199,7 @@ def pretty_print(q) end def to_json(*opts) - { type: :massign, tgt: target, val: value, loc: location }.to_json(*opts) + { type: :massign, target: target, value: value, loc: location }.to_json(*opts) end end @@ -5919,7 +5919,7 @@ def to_json(*opts) { type: :opassign, target: target, - operator: operator, + op: operator, value: value, loc: location }.to_json(*opts) @@ -7067,7 +7067,7 @@ def pretty_print(q) end def to_json(*opts) - { type: :rescue_mod, stmt: statement, val: value, loc: location }.to_json( + { type: :rescue_mod, stmt: statement, value: value, loc: location }.to_json( *opts ) end @@ -7858,7 +7858,7 @@ def pretty_print(q) end def to_json(*opts) - { type: :symbol, val: value, loc: location }.to_json(*opts) + { type: :symbol, value: value, loc: location }.to_json(*opts) end end @@ -7900,7 +7900,7 @@ def pretty_print(q) end def to_json(*opts) - { type: :symbol_literal, val: value, loc: location }.to_json(*opts) + { type: :symbol_literal, value: value, loc: location }.to_json(*opts) end end @@ -8372,7 +8372,7 @@ def to_json(*opts) { type: :unary, op: :not, - val: statement, + value: statement, paren: parentheses, loc: location }.to_json(*opts) @@ -8413,7 +8413,7 @@ def pretty_print(q) end def to_json(*opts) - { type: :unary, op: operator, val: statement, loc: location }.to_json( + { type: :unary, op: operator, value: statement, loc: location }.to_json( *opts ) end diff --git a/src/ruby/toProc.ts b/src/ruby/toProc.ts index b1881d0c..96ea5a2d 100644 --- a/src/ruby/toProc.ts +++ b/src/ruby/toProc.ts @@ -73,7 +73,7 @@ function toProc( if ( call.receiver.type !== "var_ref" || call.receiver.value.value !== params.reqs[0].value || - !isPeriod(call.operator) || + !isPeriod(call.op) || call.message === "call" || call.message.type !== "@ident" ) { @@ -102,7 +102,7 @@ function toProc( if ( key.type === "symbol_literal" && - ["if", "unless"].includes(key.val.value) + ["if", "unless"].includes(key.value.value) ) { return null; } diff --git a/src/types/ruby.ts b/src/types/ruby.ts index d9c5c976..801dc330 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -92,7 +92,7 @@ export type StringConcat = ParserEvent<"string_concat", { left: StringConcat | S export type StringDVar = ParserEvent<"string_dvar", { var: Backref | VarRef }>; export type StringEmbExpr = ParserEvent<"string_embexpr", { stmts: Stmts }>; export type StringLiteral = ParserEvent<"string_literal", { parts: StringContent[], quote: string }>; -export type SymbolLiteral = ParserEvent<"symbol_literal", { val: Backtick | Const | CVar | GVar | Identifier | IVar | Keyword | Op }>; +export type SymbolLiteral = ParserEvent<"symbol_literal", { value: Backtick | Const | CVar | GVar | Identifier | IVar | Keyword | Op }>; export type XStringLiteral = ParserEvent<"xstring_literal", { parts: StringContent[] }>; // These are various parser events that have to do with arrays. @@ -116,13 +116,13 @@ type Assignable = ArefField | ConstPathField | Field | TopConstField | VarField; export type ArefField = ParserEvent<"aref_field", { collection: AnyNode, index: ArgsAddBlock | null }>; export type Assign = ParserEvent<"assign", { target: Assignable, value: AnyNode }>; export type ConstPathField = ParserEvent<"const_path_field", { parent: ConstPathRef | Paren | TopConstRef | VarRef, constant: Const }>; -export type Field = ParserEvent<"field", { parent: AnyNode, operator: CallOperator, name: Const | Identifier }>; -export type Opassign = ParserEvent<"opassign", { target: Assignable, operator: Op, value: AnyNode }>; +export type Field = ParserEvent<"field", { parent: AnyNode, op: CallOperator, name: Const | Identifier }>; +export type Opassign = ParserEvent<"opassign", { target: Assignable, op: Op, value: AnyNode }>; export type TopConstField = ParserEvent<"top_const_field", { constant: Const }>; export type VarField = ParserEvent<"var_field", { value: null | Const | CVar | GVar | Identifier | IVar }>; // These are various parser events that have to do with multiple assignment. -export type Massign = ParserEvent<"massign", { tgt: Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen, val: AnyNode }>; +export type Massign = ParserEvent<"massign", { target: Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen, value: AnyNode }>; export type Mlhs = ParserEvent<"mlhs", { parts: (ArefField | Field | Identifier | MlhsParen | VarField)[], comma: undefined | true }>; export type MlhsAddPost = ParserEvent<"mlhs_add_post", { star: MlhsAddStar, mlhs: Mlhs }>; export type MlhsAddStar = ParserEvent<"mlhs_add_star", { mlhs: Mlhs, star: null | ArefField | Field | Identifier | VarField }>; @@ -136,13 +136,13 @@ export type Case = ParserEvent<"case", { value: AnyNode, cons: In | When }>; export type Else = ParserEvent<"else", { stmts: Stmts }>; export type Elsif = ParserEvent<"elsif", { pred: AnyNode, stmts: Stmts, cons: null | Elsif | Else }>; export type Ensure = ParserEvent<"ensure", { keyword: Keyword, stmts: Stmts }>; -export type For = ParserEvent<"for", { iterator: Mlhs | MlhsAddStar | VarField, enumerable: AnyNode, stmts: Stmts }>; +export type For = ParserEvent<"for", { index: Mlhs | MlhsAddStar | VarField, collection: AnyNode, stmts: Stmts }>; export type If = ParserEvent<"if", { pred: AnyNode, stmts: Stmts, cons: null | Elsif | Else }>; export type IfModifier = ParserEvent<"if_mod", { pred: AnyNode, stmt: AnyNode }>; -export type In = ParserEvent<"in", { pttn: AnyNode, stmts: Stmts, cons: null | In | Else }>; +export type In = ParserEvent<"in", { pattern: AnyNode, stmts: Stmts, cons: null | In | Else }>; export type Rescue = ParserEvent<"rescue", { extn: null | RescueEx, stmts: Stmts, cons: null | Rescue }>; export type RescueEx = ParserEvent<"rescue_ex", { extns: AnyNode, var: null | Field | VarField }>; -export type RescueModifier = ParserEvent<"rescue_mod", { stmt: AnyNode, val: AnyNode }>; +export type RescueModifier = ParserEvent<"rescue_mod", { stmt: AnyNode, value: AnyNode }>; export type Ternary = ParserEvent<"ifop", { pred: AnyNode, tthy: AnyNode, flsy: AnyNode }>; export type Unless = ParserEvent<"unless", { pred: AnyNode, stmts: Stmts, cons: null | Elsif | Else }>; export type UnlessModifier = ParserEvent<"unless_mod", { pred: AnyNode, stmt: AnyNode }>; @@ -163,7 +163,7 @@ export type Yield = ParserEvent<"yield", { args: ArgsAddBlock | Paren }>; export type Aryptn = ParserEvent<"aryptn", { constant: null | VarRef, reqs: AnyNode[], rest: null | VarField, posts: AnyNode[] }>; export type FndPtn = ParserEvent<"fndptn", { constant: null | AnyNode, left: VarField, values: AnyNode[], right: VarField }>; export type Hshptn = ParserEvent<"hshptn", { constant: null | AnyNode, keywords: [Label, AnyNode][], kwrest: null | VarField }>; -export type Rassign = ParserEvent<"rassign", { value: AnyNode, operator: Op | Keyword, pattern: AnyNode }>; +export type Rassign = ParserEvent<"rassign", { value: AnyNode, op: Op | Keyword, pattern: AnyNode }>; // These are various parser events for method declarations. type DefName = Backtick | Const | Identifier | Keyword | Op; @@ -171,7 +171,7 @@ type ParenAroundParams = Omit & { cnts: Params }; export type Blockarg = ParserEvent<"blockarg", { name: Identifier }>; export type Def = ParserEvent<"def", { name: DefName, params: Params | Paren, bodystmt: Bodystmt }>; -export type Defs = ParserEvent<"defs", { target: AnyNode, operator: Op | Period, name: DefName, params: Params | Paren, bodystmt: Bodystmt }>; +export type Defs = ParserEvent<"defs", { target: AnyNode, op: Op | Period, name: DefName, params: Params | Paren, bodystmt: Bodystmt }>; export type Defsl = ParserEvent<"defsl", { name: DefName, paren: null | ParenAroundParams, stmt: AnyNode }>; export type KeywordRestParam = ParserEvent<"kwrest_param", { name: null | Identifier }>; export type Lambda = ParserEvent<"lambda", { params: Params | ParenAroundParams, stmts: Bodystmt | Stmts }>; @@ -186,9 +186,9 @@ export type ArgsAddBlock = ParserEvent<"args_add_block", { args: Args | ArgsAddS export type ArgsAddStar = ParserEvent<"args_add_star", { args: Args | ArgsAddStar, star: AnyNode }>; export type BlockVar = ParserEvent<"block_var", { params: Params, locals: Identifier[] }>; export type BraceBlock = ParserEvent<"brace_block", { lbrace: Lbrace, block_var: null | BlockVar, stmts: Stmts }>; -export type Call = ParserEvent<"call", { receiver: AnyNode, operator: CallOperator, message: Backtick | Op | Identifier | Const | "call" }>; +export type Call = ParserEvent<"call", { receiver: AnyNode, op: CallOperator, message: Backtick | Op | Identifier | Const | "call" }>; export type Command = ParserEvent<"command", { message: Const | Identifier, args: Args | ArgsAddBlock }>; -export type CommandCall = ParserEvent<"command_call", { receiver: AnyNode, operator: CallOperator, message: Op | Identifier | Const, args: Args | ArgsAddBlock }>; +export type CommandCall = ParserEvent<"command_call", { receiver: AnyNode, op: CallOperator, message: Op | Identifier | Const, args: Args | ArgsAddBlock }>; export type DoBlock = ParserEvent<"do_block", { keyword: Keyword, block_var: null | BlockVar, bodystmt: Bodystmt }>; export type Fcall = ParserEvent<"fcall", { value: Const | Identifier }>; export type MethodAddArg = ParserEvent<"method_add_arg", { call: Call | Fcall, args: Args | ArgParen | ArgsAddBlock }>; @@ -199,7 +199,7 @@ export type VCall = ParserEvent<"vcall", { value: Identifier }>; type Dot = { left: AnyNode, right: AnyNode } | { left: null, right: AnyNode } | { left: AnyNode, right: null }; export type Aref = ParserEvent<"aref", { collection: AnyNode, index: Args | ArgsAddBlock | null }>; export type BEGIN = ParserEvent<"BEGIN", { lbrace: Lbrace, stmts: Stmts }>; -export type Binary = ParserEvent<"binary", { left: AnyNode, operator: string, right: AnyNode }>; +export type Binary = ParserEvent<"binary", { left: AnyNode, op: string, right: AnyNode }>; export type ConstPathRef = ParserEvent<"const_path_ref", { parent: AnyNode, constant: Const }>; export type ConstRef = ParserEvent<"const_ref", { constant: Const }>; export type Defined = ParserEvent<"defined", { value: AnyNode }>; @@ -208,7 +208,7 @@ export type Dot3 = ParserEvent<"dot3", Dot>; export type END = ParserEvent<"END", { lbrace: Lbrace, stmts: Stmts }>; export type Paren = ParserEvent<"paren", { lparen: Lparen, cnts: AnyNode }>; export type TopConstRef = ParserEvent<"top_const_ref", { constant: Const }>; -export type Unary = ParserEvent<"unary", { val: AnyNode, op: string, paren: boolean | undefined }>; +export type Unary = ParserEvent<"unary", { value: AnyNode, op: string, paren: boolean | undefined }>; export type VarRef = ParserEvent<"var_ref", { value: Const | CVar | GVar | Identifier | IVar | Keyword }>; // These are various parser events for statements you would find in a class definition body. diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 39ee3e33..1e83d264 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -85,8 +85,8 @@ function getChildNodes(node: AnyNode): ChildNode[] { case "call": { const childNodes: ChildNode[] = [node.receiver]; - if (node.operator !== "::") { - childNodes.push(node.operator); + if (node.op !== "::") { + childNodes.push(node.op); } if (node.message !== "call") { @@ -116,7 +116,7 @@ function getChildNodes(node: AnyNode): ChildNode[] { case "defs": return [ node.target, - node.operator, + node.op, node.name, node.params, node.bodystmt @@ -144,8 +144,8 @@ function getChildNodes(node: AnyNode): ChildNode[] { case "field": { const childNodes: ChildNode[] = [node.parent]; - if (node.operator !== "::") { - childNodes.push(node.operator); + if (node.op !== "::") { + childNodes.push(node.op); } childNodes.push(node.name); @@ -154,7 +154,7 @@ function getChildNodes(node: AnyNode): ChildNode[] { case "fndptn": return [node.constant, node.left, ...node.values, node.right]; case "for": - return [node.iterator, node.enumerable, node.stmts]; + return [node.index, node.collection, node.stmts]; case "hash": return [node.cnts]; case "heredoc": @@ -176,13 +176,13 @@ function getChildNodes(node: AnyNode): ChildNode[] { case "if_mod": return [node.stmt, node.pred]; case "in": - return [node.pttn, node.stmts, node.cons]; + return [node.pattern, node.stmts, node.cons]; case "kwrest_param": return [node.name]; case "lambda": return [node.params, node.stmts]; case "massign": - return [node.tgt, node.val]; + return [node.target, node.value]; case "method_add_arg": return [node.call, node.args]; case "method_add_block": @@ -206,7 +206,7 @@ function getChildNodes(node: AnyNode): ChildNode[] { case "next": return [node.args]; case "opassign": - return [node.target, node.operator, node.value]; + return [node.target, node.op, node.value]; case "params": { let childNodes: ChildNode[] = [...node.reqs]; @@ -244,7 +244,7 @@ function getChildNodes(node: AnyNode): ChildNode[] { case "qwords": return []; case "rassign": - return [node.value, node.operator, node.pattern]; + return [node.value, node.op, node.pattern]; case "redo": return []; case "regexp_literal": @@ -254,7 +254,7 @@ function getChildNodes(node: AnyNode): ChildNode[] { case "rescue_ex": return [node.extns, node.var]; case "rescue_mod": - return [node.stmt, node.val]; + return [node.stmt, node.value]; case "rest_param": return [node.name]; case "retry": @@ -278,7 +278,7 @@ function getChildNodes(node: AnyNode): ChildNode[] { case "super": return [node.args]; case "symbol_literal": - return [node.val]; + return [node.value]; case "symbols": return []; case "top_const_field": @@ -286,7 +286,7 @@ function getChildNodes(node: AnyNode): ChildNode[] { case "top_const_ref": return [node.constant]; case "unary": - return [node.val]; + return [node.value]; case "undef": return node.syms; case "unless": diff --git a/src/utils/makeCall.ts b/src/utils/makeCall.ts index fbed2400..f9338d70 100644 --- a/src/utils/makeCall.ts +++ b/src/utils/makeCall.ts @@ -4,7 +4,7 @@ type Callable = Ruby.Call | Ruby.CommandCall | Ruby.Field; const makeCall: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); - const operator = node.operator; + const operator = node.op; // Ignoring the next block for coverage information because it's only relevant // in Ruby 2.5 and below. @@ -13,7 +13,7 @@ const makeCall: Plugin.Printer = (path, opts, print) => { return operator as Plugin.Doc; } - return operator === "::" ? "." : path.call(print, "operator"); + return operator === "::" ? "." : path.call(print, "op"); }; export default makeCall; From f568b651df3dedca9657788ce3339b2f3896be53 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 16 Nov 2021 16:43:41 -0500 Subject: [PATCH 419/785] scanner_events -> tokens --- bin/sexp | 2 +- src/parser/server.rb | 4 +- src/ruby/parser.rb | 478 ++++++++++++++++++--------------------- test/rb/metadata_test.rb | 224 +++++++++--------- 4 files changed, 339 insertions(+), 369 deletions(-) diff --git a/bin/sexp b/bin/sexp index d2cd01b8..90c1e78a 100755 --- a/bin/sexp +++ b/bin/sexp @@ -11,7 +11,7 @@ source = ARGV[0].gsub('\\n', "\n") end -parsed = Prettier::Parser.new(source).parse +parsed = Ripper::ParseTree.parse(source) puts '=== SOURCE === ' puts source diff --git a/src/parser/server.rb b/src/parser/server.rb index 8835437d..bfb13343 100644 --- a/src/parser/server.rb +++ b/src/parser/server.rb @@ -72,7 +72,7 @@ when 'ping' 'pong' when 'ruby' - Prettier::Parser.parse(source) + Ripper::ParseTree.parse(source) when 'rbs' Prettier::RBSParser.parse(source) when 'haml' @@ -84,7 +84,7 @@ else socket.write('{ "error": true }') end - rescue Prettier::Parser::ParserError => error + rescue Ripper::ParseTree::ParseError => error loc = { start: { line: error.lineno, column: error.column } } socket.write(JSON.fast_generate(error: error.message, loc: loc)) rescue StandardError => error diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 4127b886..7bebf9dc 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -1,27 +1,8 @@ # frozen_string_literal: true -# We implement our own version checking here instead of using Gem::Version so -# that we can use the --disable-gems flag. -RUBY_MAJOR, RUBY_MINOR, RUBY_PATCH, * = RUBY_VERSION.split('.').map(&:to_i) - -if (RUBY_MAJOR < 2) || ((RUBY_MAJOR == 2) && (RUBY_MINOR < 5)) - warn( - "Ruby version #{RUBY_VERSION} not supported. " \ - 'Please upgrade to 2.5.0 or above.' - ) - - exit 1 -end - -require 'json' unless defined?(JSON) require 'ripper' -# Ensure the module is already defined. This is mostly so that we don't have to -# indent the Parser definition one more time. -module Prettier -end - -class Prettier::Parser < Ripper +class Ripper::ParseTree < Ripper # Represents a line in the source. If this class is being used, it means that # every character in the string is 1 byte in length, so we can just return the # start of the line + the index. @@ -95,7 +76,7 @@ def self.fixed(line:, char:) # A special parser error so that we can get nice syntax displays on the error # message when prettier prints out the results. - class ParserError < StandardError + class ParseError < StandardError attr_reader :lineno, :column def initialize(error, lineno, column) @@ -105,7 +86,7 @@ def initialize(error, lineno, column) end end - attr_reader :source, :lines, :scanner_events + attr_reader :source, :lines, :tokens # This is an attr_accessor so Stmts objects can grab comments out of this # array and attach them to themselves. @@ -147,19 +128,19 @@ def initialize(source, *args) # Heredocs can actually be nested together if you're using interpolation, so # this is a stack of heredoc nodes that are currently being created. When we - # get to the scanner event that finishes off a heredoc node, we pop the top + # get to the token that finishes off a heredoc node, we pop the top # one off. If there are others surrounding it, then the body events will now # be added to the correct nodes. @heredocs = [] - # This is a running list of scanner events that have fired. It's useful + # This is a running list of tokens that have fired. It's useful # mostly for maintaining location information. For example, if you're inside # the handle of a def event, then in order to determine where the AST node - # started, you need to look backward in the scanner events to find a def + # started, you need to look backward in the tokens to find a def # keyword. Most of the time, when a parser event consumes one of these # events, it will be deleted from the list. So ideally, this list stays # pretty short over the course of parsing a source string. - @scanner_events = [] + @tokens = [] # Here we're going to build up a list of SingleByteString or MultiByteString # objects. They're each going to represent a string in the source. They are @@ -188,11 +169,11 @@ def self.parse(source) private - # ---------------------------------------- + # ---------------------------------------------------------------------------- # :section: Helper methods # The following methods are used by the ripper event handlers to either # determine their bounds or query other nodes. - # ---------------------------------------- + # ---------------------------------------------------------------------------- # This represents the current place in the source string that we've gotten to # so far. We have a memoized line_counts object that we can use to get the @@ -203,53 +184,52 @@ def char_pos @line_counts[lineno - 1][column] end - # As we build up a list of scanner events, we'll periodically need to go - # backwards and find the ones that we've already hit in order to determine the - # location information for nodes that use them. For example, if you have a - # module node then you'll look backward for a @module scanner event to - # determine your start location. + # As we build up a list of tokens, we'll periodically need to go backwards and + # find the ones that we've already hit in order to determine the location + # information for nodes that use them. For example, if you have a module node + # then you'll look backward for a kw token to determine your start location. # - # This works with nesting since we're deleting scanner events from the list - # once they've been used up. For example if you had nested module declarations - # then the innermost declaration would grab the last @module event (which - # would happen to be the innermost keyword). Then the outer one would only be - # able to grab the first one. In this way all of the scanner events act as + # This works with nesting since we're deleting tokens from the list once + # they've been used up. For example if you had nested module declarations then + # the innermost declaration would grab the last kw node that matches "module" + # (which would happen to be the innermost keyword). Then the outer one would + # only be able to grab the first one. In this way all of the tokens act as # their own stack. - def find_scanner_event(type, value = :any, consume: true) + def find_token(type, value = :any, consume: true) index = - scanner_events.rindex do |node| - node.is_a?(type) && (value == :any || (node.value == value)) + tokens.rindex do |token| + token.is_a?(type) && (value == :any || (token.value == value)) end if consume - # If we're expecting to be able to find a scanner event and consume it, + # If we're expecting to be able to find a token and consume it, # but can't actually find it, then we need to raise an error. This is # _usually_ caused by a syntax error in the source that we're printing. It - # could also be caused by accidentally attempting to consume a scanner - # event twice by two different parser event handlers. + # could also be caused by accidentally attempting to consume a token twice + # by two different parser event handlers. unless index message = "Cannot find expected #{value == :any ? type : value}" - raise ParserError.new(message, lineno, column) + raise ParseError.new(message, lineno, column) end - scanner_events.delete_at(index) + tokens.delete_at(index) elsif index - scanner_events[index] + tokens[index] end end # A helper function to find a :: operator. We do special handling instead of - # using find_scanner_event here because we don't pop off all of the :: + # using find_token here because we don't pop off all of the :: # operators so you could end up getting the wrong information if you have for # instance ::X::Y::Z. def find_colon2_before(const) index = - scanner_events.rindex do |node| - node.is_a?(Op) && node.value == '::' && - node.location.start_char < const.location.start_char + tokens.rindex do |token| + token.is_a?(Op) && token.value == '::' && + token.location.start_char < const.location.start_char end - scanner_events[index] + tokens[index] end # Finds the next position in the source string that begins a statement. This @@ -273,10 +253,10 @@ def find_next_statement_start(position) position end - # ---------------------------------------- + # ---------------------------------------------------------------------------- # :section: Ripper event handlers # The following methods all handle a dispatched ripper event. - # ---------------------------------------- + # ---------------------------------------------------------------------------- # BEGINBlock represents the use of the +BEGIN+ keyword, which hooks into the # lifecycle of the interpreter. Whatever is inside the block will get executed @@ -324,15 +304,15 @@ def to_json(*opts) # :call-seq: # on_BEGIN: (Statements statements) -> BEGINBlock def on_BEGIN(statements) - lbrace = find_scanner_event(LBrace) - rbrace = find_scanner_event(RBrace) + lbrace = find_token(LBrace) + rbrace = find_token(RBrace) statements.bind( find_next_statement_start(lbrace.location.end_char), rbrace.location.start_char ) - keyword = find_scanner_event(Kw, 'BEGIN') + keyword = find_token(Kw, 'BEGIN') BEGINBlock.new( lbrace: lbrace, @@ -381,7 +361,7 @@ def on_CHAR(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -428,15 +408,15 @@ def to_json(*opts) # :call-seq: # on_END: (Statements statements) -> ENDBlock def on_END(statements) - lbrace = find_scanner_event(LBrace) - rbrace = find_scanner_event(RBrace) + lbrace = find_token(LBrace) + rbrace = find_token(RBrace) statements.bind( find_next_statement_start(lbrace.location.end_char), rbrace.location.start_char ) - keyword = find_scanner_event(Kw, 'END') + keyword = find_token(Kw, 'END') ENDBlock.new( lbrace: lbrace, @@ -537,7 +517,7 @@ def to_json(*opts) # (DynaSymbol | SymbolLiteral) right # ) -> Alias def on_alias(left, right) - keyword = find_scanner_event(Kw, 'alias') + keyword = find_token(Kw, 'alias') Alias.new( left: left, @@ -598,8 +578,8 @@ def to_json(*opts) # :call-seq: # on_aref: (untyped collection, (nil | Args | ArgsAddBlock) index) -> ARef def on_aref(collection, index) - find_scanner_event(LBracket) - rbracket = find_scanner_event(RBracket) + find_token(LBracket) + rbracket = find_token(RBracket) ARef.new( collection: collection, @@ -657,8 +637,8 @@ def to_json(*opts) # (nil | ArgsAddBlock) index # ) -> ARefField def on_aref_field(collection, index) - find_scanner_event(LBracket) - rbracket = find_scanner_event(RBracket) + find_token(LBracket) + rbracket = find_token(RBracket) ARefField.new( collection: collection, @@ -714,8 +694,8 @@ def to_json(*opts) # (nil | Args | ArgsAddBlock | ArgsForward) arguments # ) -> ArgParen def on_arg_paren(arguments) - lparen = find_scanner_event(LParen) - rparen = find_scanner_event(RParen) + lparen = find_token(LParen) + rparen = find_token(RParen) # If the arguments exceed the ending of the parentheses, then we know we # have a heredoc in the arguments, and we need to use the bounds of the @@ -892,7 +872,7 @@ def to_json(*opts) # untyped star # ) -> ArgsAddStar def on_args_add_star(arguments, star) - beginning = find_scanner_event(Op, '*') + beginning = find_token(Op, '*') ending = star || beginning ArgsAddStar.new( @@ -947,7 +927,7 @@ def to_json(*opts) # :call-seq: # on_args_forward: () -> ArgsForward def on_args_forward - op = find_scanner_event(Op, '...') + op = find_token(Op, '...') ArgsForward.new(value: op.value, location: op.location) end @@ -1005,15 +985,15 @@ def to_json(*opts) # ) -> ArrayLiteral def on_array(contents) if !contents || contents.is_a?(Args) || contents.is_a?(ArgsAddStar) - lbracket = find_scanner_event(LBracket) - rbracket = find_scanner_event(RBracket) + lbracket = find_token(LBracket) + rbracket = find_token(RBracket) ArrayLiteral.new( contents: contents, location: lbracket.location.to(rbracket.location) ) else - tstring_end = find_scanner_event(TStringEnd) + tstring_end = find_token(TStringEnd) contents = contents.class.new( elements: contents.elements, @@ -1260,7 +1240,7 @@ def to_json(*opts) # :call-seq: # on_assoc_splat: (untyped value) -> AssocSplat def on_assoc_splat(value) - operator = find_scanner_event(Op, '**') + operator = find_token(Op, '**') AssocSplat.new(value: value, location: operator.location.to(value.location)) end @@ -1347,7 +1327,7 @@ def on_backref(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -1388,7 +1368,7 @@ def on_backtick(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -1466,13 +1446,13 @@ def to_json(*opts) # :call-seq: # on_begin: (BodyStmt bodystmt) -> Begin def on_begin(bodystmt) - keyword = find_scanner_event(Kw, 'begin') + keyword = find_token(Kw, 'begin') end_char = if bodystmt.rescue_clause || bodystmt.ensure_clause || bodystmt.else_clause bodystmt.location.end_char else - find_scanner_event(Kw, 'end').location.end_char + find_token(Kw, 'end').location.end_char end bodystmt.bind(keyword.location.end_char, end_char) @@ -1545,7 +1525,7 @@ def on_binary(left, operator, right) # so here we're going to explicitly convert it into the same normalized # form. unless operator.is_a?(Symbol) - operator = scanner_events.delete(operator).value + operator = tokens.delete(operator).value end Binary.new( @@ -1606,13 +1586,13 @@ def to_json(*opts) # on_block_var: (Params params, (nil | Array[Ident]) locals) -> BlockVar def on_block_var(params, locals) index = - scanner_events.rindex do |node| + tokens.rindex do |node| node.is_a?(Op) && %w[| ||].include?(node.value) && node.location.start_char < params.location.start_char end - beginning = scanner_events[index] - ending = scanner_events[-1] + beginning = tokens[index] + ending = tokens[-1] BlockVar.new( params: params, @@ -1653,7 +1633,7 @@ def to_json(*opts) # :call-seq: # on_blockarg: (Ident name) -> BlockArg def on_blockarg(name) - operator = find_scanner_event(Op, '&') + operator = find_token(Op, '&') BlockArg.new(name: name, location: operator.location.to(name.location)) end @@ -1826,8 +1806,8 @@ def to_json(*opts) # Statements statements # ) -> BraceBlock def on_brace_block(block_var, statements) - lbrace = find_scanner_event(LBrace) - rbrace = find_scanner_event(RBrace) + lbrace = find_token(LBrace) + rbrace = find_token(RBrace) statements.bind( find_next_statement_start((block_var || lbrace).location.end_char), @@ -1886,7 +1866,7 @@ def to_json(*opts) # :call-seq: # on_break: ((Args | ArgsAddBlock) arguments) -> Break def on_break(arguments) - keyword = find_scanner_event(Kw, 'break') + keyword = find_token(Kw, 'break') location = keyword.location location = location.to(arguments.location) unless arguments.is_a?(Args) @@ -1951,14 +1931,7 @@ def to_json(*opts) # ) -> Call def on_call(receiver, operator, message) ending = message - - if message == :call - ending = operator - - # Special handling here for Ruby <= 2.5 because the operator argument to - # this method wasn't a parser event here it was just a plain symbol. - ending = receiver if RUBY_MAJOR <= 2 && RUBY_MINOR <= 5 - end + ending = operator if message == :call Call.new( receiver: receiver, @@ -2077,8 +2050,8 @@ def to_json(*opts) # :call-seq: # on_case: (untyped value, untyped consequent) -> Case | RAssign def on_case(value, consequent) - if keyword = find_scanner_event(Kw, 'case', consume: false) - scanner_events.delete(keyword) + if keyword = find_token(Kw, 'case', consume: false) + tokens.delete(keyword) Case.new( value: value, @@ -2087,8 +2060,8 @@ def on_case(value, consequent) ) else operator = - find_scanner_event(Kw, 'in', consume: false) || - find_scanner_event(Op, '=>') + find_token(Kw, 'in', consume: false) || + find_token(Op, '=>') RAssign.new( value: value, @@ -2187,8 +2160,8 @@ def to_json(*opts) # BodyStmt bodystmt # ) -> ClassDeclaration def on_class(constant, superclass, bodystmt) - beginning = find_scanner_event(Kw, 'class') - ending = find_scanner_event(Kw, 'end') + beginning = find_token(Kw, 'class') + ending = find_token(Kw, 'end') bodystmt.bind( find_next_statement_start((superclass || constant).location.end_char), @@ -2238,7 +2211,7 @@ def on_comma(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -2480,7 +2453,7 @@ def on_const(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -2667,7 +2640,7 @@ def on_cvar(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -2778,14 +2751,13 @@ def to_json(*opts) # untyped bodystmt # ) -> Def | DefEndless def on_def(name, params, bodystmt) - # Make sure to delete this scanner event in case you're defining something - # like def class which would lead to this being a kw and causing all kinds - # of trouble - scanner_events.delete(name) + # Make sure to delete this token in case you're defining something like def + # class which would lead to this being a kw and causing all kinds of trouble + tokens.delete(name) # Find the beginning of the method definition, which works for single-line # and normal method definitions. - beginning = find_scanner_event(Kw, 'def') + beginning = find_token(Kw, 'def') # If we don't have a bodystmt node, then we have a single-line method unless bodystmt.is_a?(BodyStmt) @@ -2815,7 +2787,7 @@ def on_def(name, params, bodystmt) params = Params.new(location: location) end - ending = find_scanner_event(Kw, 'end') + ending = find_token(Kw, 'end') bodystmt.bind( find_next_statement_start(params.location.end_char), ending.location.start_char @@ -2863,13 +2835,13 @@ def to_json(*opts) # :call-seq: # on_defined: (untyped value) -> Defined def on_defined(value) - beginning = find_scanner_event(Kw, 'defined?') + beginning = find_token(Kw, 'defined?') ending = value range = beginning.location.end_char...value.location.start_char if source[range].include?('(') - find_scanner_event(LParen) - ending = find_scanner_event(RParen) + find_token(LParen) + ending = find_token(RParen) end Defined.new(value: value, location: beginning.location.to(ending.location)) @@ -2950,10 +2922,10 @@ def to_json(*opts) # BodyStmt bodystmt # ) -> Defs def on_defs(target, operator, name, params, bodystmt) - # Make sure to delete this scanner event in case you're defining something + # Make sure to delete this token in case you're defining something # like def class which would lead to this being a kw and causing all kinds # of trouble - scanner_events.delete(name) + tokens.delete(name) # If there aren't any params then we need to correct the params node # location information @@ -2970,8 +2942,8 @@ def on_defs(target, operator, name, params, bodystmt) params = Params.new(location: location) end - beginning = find_scanner_event(Kw, 'def') - ending = find_scanner_event(Kw, 'end') + beginning = find_token(Kw, 'def') + ending = find_token(Kw, 'end') bodystmt.bind( find_next_statement_start(params.location.end_char), @@ -3042,8 +3014,8 @@ def to_json(*opts) # :call-seq: # on_do_block: (BlockVar block_var, BodyStmt bodystmt) -> DoBlock def on_do_block(block_var, bodystmt) - beginning = find_scanner_event(Kw, 'do') - ending = find_scanner_event(Kw, 'end') + beginning = find_token(Kw, 'do') + ending = find_token(Kw, 'end') bodystmt.bind( find_next_statement_start((block_var || beginning).location.end_char), @@ -3109,7 +3081,7 @@ def to_json(*opts) # :call-seq: # on_dot2: ((nil | untyped) left, (nil | untyped) right) -> Dot2 def on_dot2(left, right) - operator = find_scanner_event(Op, '..') + operator = find_token(Op, '..') beginning = left || operator ending = right || operator @@ -3173,7 +3145,7 @@ def to_json(*opts) # :call-seq: # on_dot3: ((nil | untyped) left, (nil | untyped) right) -> Dot3 def on_dot3(left, right) - operator = find_scanner_event(Op, '...') + operator = find_token(Op, '...') beginning = left || operator ending = right || operator @@ -3230,10 +3202,10 @@ def to_json(*opts) # :call-seq: # on_dyna_symbol: (StringContent string_content) -> DynaSymbol def on_dyna_symbol(string_content) - if find_scanner_event(SymBeg, consume: false) + if find_token(SymBeg, consume: false) # A normal dynamic symbol - symbeg = find_scanner_event(SymBeg) - tstring_end = find_scanner_event(TStringEnd) + symbeg = find_token(SymBeg) + tstring_end = find_token(TStringEnd) DynaSymbol.new( quote: symbeg.value, @@ -3242,8 +3214,8 @@ def on_dyna_symbol(string_content) ) else # A dynamic symbol as a hash key - tstring_beg = find_scanner_event(TStringBeg) - label_end = find_scanner_event(LabelEnd) + tstring_beg = find_token(TStringBeg) + label_end = find_token(LabelEnd) DynaSymbol.new( parts: string_content.parts, @@ -3288,18 +3260,18 @@ def to_json(*opts) # :call-seq: # on_else: (Statements statements) -> Else def on_else(statements) - beginning = find_scanner_event(Kw, 'else') + beginning = find_token(Kw, 'else') # else can either end with an end keyword (in which case we'll want to # consume that event) or it can end with an ensure keyword (in which case # we'll leave that to the ensure to handle). index = - scanner_events.rindex do |node| - node.is_a?(Kw) && %w[end ensure].include?(node.value) + tokens.rindex do |token| + token.is_a?(Kw) && %w[end ensure].include?(token.value) end - node = scanner_events[index] - ending = node.value == 'end' ? scanner_events.delete_at(index) : node + node = tokens[index] + ending = node.value == 'end' ? tokens.delete_at(index) : node statements.bind(beginning.location.end_char, ending.location.start_char) @@ -3370,8 +3342,8 @@ def to_json(*opts) # (nil | Elsif | Else) consequent # ) -> Elsif def on_elsif(predicate, statements, consequent) - beginning = find_scanner_event(Kw, 'elsif') - ending = consequent || find_scanner_event(Kw, 'end') + beginning = find_token(Kw, 'elsif') + ending = consequent || find_token(Kw, 'end') statements.bind(predicate.location.end_char, ending.location.start_char) @@ -3496,7 +3468,7 @@ def on_embexpr_beg(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -3541,7 +3513,7 @@ def on_embexpr_end(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -3588,7 +3560,7 @@ def on_embvar(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -3637,11 +3609,11 @@ def to_json(*opts) # :call-seq: # on_ensure: (Statements statements) -> Ensure def on_ensure(statements) - keyword = find_scanner_event(Kw, 'ensure') + keyword = find_token(Kw, 'ensure') # We don't want to consume the :@kw event, because that would break # def..ensure..end chains. - ending = find_scanner_event(Kw, 'end', consume: false) + ending = find_token(Kw, 'end', consume: false) statements.bind( find_next_statement_start(keyword.location.end_char), ending.location.start_char @@ -3696,7 +3668,7 @@ def to_json(*opts) # :call-seq: # on_excessed_comma: () -> ExcessedComma def on_excessed_comma(*) - comma = find_scanner_event(Comma) + comma = find_token(Comma) ExcessedComma.new(value: comma.value, location: comma.location) end @@ -3845,7 +3817,7 @@ def on_float(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -3921,8 +3893,8 @@ def to_json(*opts) # VarField right # ) -> FndPtn def on_fndptn(constant, left, values, right) - beginning = constant || find_scanner_event(LBracket) - ending = find_scanner_event(RBracket) + beginning = constant || find_token(LBracket) + ending = find_token(RBracket) FndPtn.new( constant: constant, @@ -3992,15 +3964,15 @@ def to_json(*opts) # Statements statements # ) -> For def on_for(index, collection, statements) - beginning = find_scanner_event(Kw, 'for') - ending = find_scanner_event(Kw, 'end') + beginning = find_token(Kw, 'for') + ending = find_token(Kw, 'end') # Consume the do keyword if it exists so that it doesn't get confused for # some other block - keyword = find_scanner_event(Kw, 'do', consume: false) + keyword = find_token(Kw, 'do', consume: false) if keyword && keyword.location.start_char > collection.location.end_char && keyword.location.end_char < ending.location.start_char - scanner_events.delete(keyword) + tokens.delete(keyword) end statements.bind( @@ -4055,7 +4027,7 @@ def on_gvar(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -4092,8 +4064,8 @@ def to_json(*opts) # :call-seq: # on_hash: ((nil | AssocListFromArgs) contents) -> HashLiteral def on_hash(contents) - lbrace = find_scanner_event(LBrace) - rbrace = find_scanner_event(RBrace) + lbrace = find_token(LBrace) + rbrace = find_token(RBrace) if contents # Here we're going to expand out the location information for the contents @@ -4365,7 +4337,7 @@ def on_ident(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -4429,8 +4401,8 @@ def to_json(*opts) # (nil | Elsif | Else) consequent # ) -> If def on_if(predicate, statements, consequent) - beginning = find_scanner_event(Kw, 'if') - ending = consequent || find_scanner_event(Kw, 'end') + beginning = find_token(Kw, 'if') + ending = consequent || find_token(Kw, 'end') statements.bind(predicate.location.end_char, ending.location.start_char) @@ -4548,7 +4520,7 @@ def to_json(*opts) # :call-seq: # on_if_mod: (untyped predicate, untyped statement) -> IfMod def on_if_mod(predicate, statement) - find_scanner_event(Kw, 'if') + find_token(Kw, 'if') IfMod.new( statement: statement, @@ -4604,7 +4576,7 @@ def on_imaginary(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -4674,8 +4646,8 @@ def on_in(pattern, statements, consequent) # Here we have a rightward assignment return pattern unless statements - beginning = find_scanner_event(Kw, 'in') - ending = consequent || find_scanner_event(Kw, 'end') + beginning = find_token(Kw, 'in') + ending = consequent || find_token(Kw, 'end') statements.bind(beginning.location.end_char, ending.location.start_char) @@ -4726,7 +4698,7 @@ def on_int(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -4769,7 +4741,7 @@ def on_ivar(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -4821,7 +4793,7 @@ def on_kw(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -4859,7 +4831,7 @@ def to_json(*opts) # :call-seq: # on_kwrest_param: ((nil | Ident) name) -> KwRestParam def on_kwrest_param(name) - location = find_scanner_event(Op, '**').location + location = find_token(Op, '**').location location = location.to(name.location) if name KwRestParam.new(name: name, location: location) @@ -4914,7 +4886,7 @@ def on_label(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -4960,7 +4932,7 @@ def on_label_end(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -5012,14 +4984,14 @@ def to_json(*opts) # (BodyStmt | Statements) statements # ) -> Lambda def on_lambda(params, statements) - beginning = find_scanner_event(TLambda) + beginning = find_token(TLambda) - if node = find_scanner_event(TLamBeg, consume: false) - opening = scanner_events.delete(node) - closing = find_scanner_event(RBrace) + if token = find_token(TLamBeg, consume: false) + opening = tokens.delete(token) + closing = find_token(RBrace) else - opening = find_scanner_event(Kw, 'do') - closing = find_scanner_event(Kw, 'end') + opening = find_token(Kw, 'do') + closing = find_token(Kw, 'end') end statements.bind(opening.location.end_char, closing.location.start_char) @@ -5067,7 +5039,7 @@ def on_lbrace(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -5107,7 +5079,7 @@ def on_lbracket(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -5147,7 +5119,7 @@ def on_lparen(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -5491,7 +5463,7 @@ def to_json(*opts) # (nil | ArefField | Field | Identifier | VarField) part # ) -> MLHSAddStar def on_mlhs_add_star(mlhs, part) - beginning = find_scanner_event(Op, '*') + beginning = find_token(Op, '*') ending = part || beginning MLHSAddStar.new( @@ -5544,8 +5516,8 @@ def to_json(*opts) # (Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen) contents # ) -> MLHSParen def on_mlhs_paren(contents) - lparen = find_scanner_event(LParen) - rparen = find_scanner_event(RParen) + lparen = find_token(LParen) + rparen = find_token(RParen) comma_range = lparen.location.end_char...rparen.location.start_char contents.comma = true if source[comma_range].strip.end_with?(',') @@ -5605,8 +5577,8 @@ def to_json(*opts) # BodyStmt bodystmt # ) -> ModuleDeclaration def on_module(constant, bodystmt) - beginning = find_scanner_event(Kw, 'module') - ending = find_scanner_event(Kw, 'end') + beginning = find_token(Kw, 'module') + ending = find_token(Kw, 'end') bodystmt.bind( find_next_statement_start(constant.location.end_char), @@ -5718,7 +5690,7 @@ def to_json(*opts) # untyped star # ) -> MRHSAddStar def on_mrhs_add_star(mrhs, star) - beginning = find_scanner_event(Op, '*') + beginning = find_token(Op, '*') ending = star || beginning MRHSAddStar.new( @@ -5814,7 +5786,7 @@ def to_json(*opts) # :call-seq: # on_next: ((Args | ArgsAddBlock) arguments) -> Next def on_next(arguments) - keyword = find_scanner_event(Kw, 'next') + keyword = find_token(Kw, 'next') location = keyword.location location = location.to(arguments.location) unless arguments.is_a?(Args) @@ -5870,7 +5842,7 @@ def on_op(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -6171,8 +6143,8 @@ def to_json(*opts) # :call-seq: # on_paren: (untyped contents) -> Paren def on_paren(contents) - lparen = find_scanner_event(LParen) - rparen = find_scanner_event(RParen) + lparen = find_token(LParen) + rparen = find_token(RParen) if contents && contents.is_a?(Params) location = contents.location @@ -6207,7 +6179,7 @@ def on_paren(contents) # If we encounter a parse error, just immediately bail out so that our runner # can catch it. def on_parse_error(error, *) - raise ParserError.new(error, lineno, column) + raise ParseError.new(error, lineno, column) end alias on_alias_error on_parse_error alias on_assign_error on_parse_error @@ -6385,14 +6357,14 @@ def on_qsymbols_beg(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end # :call-seq: # on_qsymbols_new: () -> QSymbols def on_qsymbols_new - qsymbols_beg = find_scanner_event(QSymbolsBeg) + qsymbols_beg = find_token(QSymbolsBeg) QSymbols.new(elements: [], location: qsymbols_beg.location) end @@ -6478,14 +6450,14 @@ def on_qwords_beg(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end # :call-seq: # on_qwords_new: () -> QWords def on_qwords_new - qwords_beg = find_scanner_event(QWordsBeg) + qwords_beg = find_token(QWordsBeg) QWords.new(elements: [], location: qwords_beg.location) end @@ -6529,7 +6501,7 @@ def on_rational(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -6569,7 +6541,7 @@ def on_rbrace(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -6609,7 +6581,7 @@ def on_rbracket(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -6646,7 +6618,7 @@ def to_json(*opts) # :call-seq: # on_redo: () -> Redo def on_redo - keyword = find_scanner_event(Kw, 'redo') + keyword = find_token(Kw, 'redo') Redo.new(value: keyword.value, location: keyword.location) end @@ -6747,7 +6719,7 @@ def on_regexp_beg(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -6858,7 +6830,7 @@ def on_regexp_literal(regexp_content, ending) # :call-seq: # on_regexp_new: () -> RegexpContent def on_regexp_new - regexp_beg = find_scanner_event(RegexpBeg) + regexp_beg = find_token(RegexpBeg) RegexpContent.new( beginning: regexp_beg.value, @@ -6993,7 +6965,7 @@ def to_json(*opts) # (nil | Rescue) consequent # ) -> Rescue def on_rescue(exceptions, variable, statements, consequent) - keyword = find_scanner_event(Kw, 'rescue') + keyword = find_token(Kw, 'rescue') exceptions = exceptions[0] if exceptions.is_a?(Array) last_node = variable || exceptions || keyword @@ -7076,7 +7048,7 @@ def to_json(*opts) # :call-seq: # on_rescue_mod: (untyped statement, untyped value) -> RescueMod def on_rescue_mod(statement, value) - find_scanner_event(Kw, 'rescue') + find_token(Kw, 'rescue') RescueMod.new( statement: statement, @@ -7119,7 +7091,7 @@ def to_json(*opts) # :call-seq: # on_rest_param: ((nil | Ident) name) -> RestParam def on_rest_param(name) - location = find_scanner_event(Op, '*').location + location = find_token(Op, '*').location location = location.to(name.location) if name RestParam.new(name: name, location: location) @@ -7158,7 +7130,7 @@ def to_json(*opts) # :call-seq: # on_retry: () -> Retry def on_retry - keyword = find_scanner_event(Kw, 'retry') + keyword = find_token(Kw, 'retry') Retry.new(value: keyword.value, location: keyword.location) end @@ -7196,7 +7168,7 @@ def to_json(*opts) # :call-seq: # on_return: ((Args | ArgsAddBlock) arguments) -> Return def on_return(arguments) - keyword = find_scanner_event(Kw, 'return') + keyword = find_token(Kw, 'return') Return.new( arguments: arguments, @@ -7237,7 +7209,7 @@ def to_json(*opts) # :call-seq: # on_return0: () -> Return0 def on_return0 - keyword = find_scanner_event(Kw, 'return') + keyword = find_token(Kw, 'return') Return0.new(value: keyword.value, location: keyword.location) end @@ -7278,7 +7250,7 @@ def on_rparen(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -7330,8 +7302,8 @@ def to_json(*opts) # :call-seq: # on_sclass: (untyped target, BodyStmt bodystmt) -> SClass def on_sclass(target, bodystmt) - beginning = find_scanner_event(Kw, 'class') - ending = find_scanner_event(Kw, 'end') + beginning = find_token(Kw, 'class') + ending = find_token(Kw, 'end') bodystmt.bind( find_next_statement_start(target.location.end_char), @@ -7369,7 +7341,7 @@ def on_stmts_add(statements, statement) # propagate that onto void_stmt nodes inside the stmts in order to make sure # all comments get printed appropriately. class Statements - # [Prettier::Parser] the parser that created this node + # [Ripper::ParseTree] the parser that created this node attr_reader :parser # [Array[untyped]] the list of expressions contained within this node @@ -7609,7 +7581,7 @@ def to_json(*opts) # :call-seq: # on_string_dvar: ((Backref | VarRef) variable) -> StringDVar def on_string_dvar(variable) - embvar = find_scanner_event(EmbVar) + embvar = find_token(EmbVar) StringDVar.new( variable: variable, @@ -7652,8 +7624,8 @@ def to_json(*opts) # :call-seq: # on_string_embexpr: (Statements statements) -> StringEmbExpr def on_string_embexpr(statements) - embexpr_beg = find_scanner_event(EmbExprBeg) - embexpr_end = find_scanner_event(EmbExprEnd) + embexpr_beg = find_token(EmbExprBeg) + embexpr_end = find_token(EmbExprEnd) statements.bind( embexpr_beg.location.end_char, @@ -7721,8 +7693,8 @@ def on_string_literal(string) location: heredoc.location ) else - tstring_beg = find_scanner_event(TStringBeg) - tstring_end = find_scanner_event(TStringEnd) + tstring_beg = find_token(TStringBeg) + tstring_end = find_token(TStringEnd) StringLiteral.new( parts: string.parts, @@ -7766,7 +7738,7 @@ def to_json(*opts) # :call-seq: # on_super: ((ArgParen | Args | ArgsAddBlock) arguments) -> Super def on_super(arguments) - keyword = find_scanner_event(Kw, 'super') + keyword = find_token(Kw, 'super') Super.new( arguments: arguments, @@ -7816,7 +7788,7 @@ def to_json(*opts) end end - # symbeg is a scanner event that represents the beginning of a symbol literal. + # symbeg is a token that represents the beginning of a symbol literal. # In most cases it will contain just ":" as in the value, but if its a dynamic # symbol being defined it will contain ":'" or ":\"". def on_symbeg(value) @@ -7826,7 +7798,7 @@ def on_symbeg(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -7867,7 +7839,7 @@ def to_json(*opts) # (Backtick | Const | CVar | GVar | Ident | IVar | Kw | Op) value # ) -> SymbolContent def on_symbol(value) - scanner_events.pop + tokens.pop SymbolContent.new(value: value, location: value.location) end @@ -7912,10 +7884,10 @@ def to_json(*opts) # ) value # ) -> SymbolLiteral def on_symbol_literal(value) - if scanner_events[-1] == value - SymbolLiteral.new(value: scanner_events.pop, location: value.location) + if tokens[-1] == value + SymbolLiteral.new(value: tokens.pop, location: value.location) else - symbeg = find_scanner_event(SymBeg) + symbeg = find_token(SymBeg) SymbolLiteral.new( value: value.value, @@ -8006,14 +7978,14 @@ def on_symbols_beg(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end # :call-seq: # on_symbols_new: () -> Symbols def on_symbols_new - symbols_beg = find_scanner_event(SymbolsBeg) + symbols_beg = find_token(SymbolsBeg) Symbols.new(elements: [], location: symbols_beg.location) end @@ -8058,7 +8030,7 @@ def on_tlambda(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -8103,7 +8075,7 @@ def on_tlambeg(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -8239,7 +8211,7 @@ def on_tstring_beg(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -8335,7 +8307,7 @@ def on_tstring_end(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end @@ -8427,15 +8399,15 @@ def on_unary(operator, statement) # We have somewhat special handling of the not operator since if it has # parentheses they don't get reported as a paren node for some reason. - beginning = find_scanner_event(Kw, 'not') + beginning = find_token(Kw, 'not') ending = statement range = beginning.location.end_char...statement.location.start_char paren = source[range].include?('(') if paren - find_scanner_event(LParen) - ending = find_scanner_event(RParen) + find_token(LParen) + ending = find_token(RParen) end Not.new( @@ -8444,18 +8416,18 @@ def on_unary(operator, statement) location: beginning.location.to(ending.location) ) else - # Special case instead of using find_scanner_event here. It turns out that + # Special case instead of using find_token here. It turns out that # if you have a range that goes from a negative number to a negative # number then you can end up with a .. or a ... that's higher in the # stack. So we need to explicitly disallow those operators. index = - scanner_events.rindex do |node| - node.is_a?(Op) && - node.location.start_char < statement.location.start_char && - !%w[.. ...].include?(node.value) + tokens.rindex do |token| + token.is_a?(Op) && + token.location.start_char < statement.location.start_char && + !%w[.. ...].include?(token.value) end - beginning = scanner_events.delete_at(index) + beginning = tokens.delete_at(index) Unary.new( operator: operator[0], # :+@ -> "+" @@ -8498,7 +8470,7 @@ def to_json(*opts) # :call-seq: # on_undef: (Array[DynaSymbol | SymbolLiteral] symbols) -> Undef def on_undef(symbols) - keyword = find_scanner_event(Kw, 'undef') + keyword = find_token(Kw, 'undef') Undef.new( symbols: symbols, @@ -8566,8 +8538,8 @@ def to_json(*opts) # ((nil | Elsif | Else) consequent) # ) -> Unless def on_unless(predicate, statements, consequent) - beginning = find_scanner_event(Kw, 'unless') - ending = consequent || find_scanner_event(Kw, 'end') + beginning = find_token(Kw, 'unless') + ending = consequent || find_token(Kw, 'end') statements.bind(predicate.location.end_char, ending.location.start_char) @@ -8624,7 +8596,7 @@ def to_json(*opts) # :call-seq: # on_unless_mod: (untyped predicate, untyped statement) -> UnlessMod def on_unless_mod(predicate, statement) - find_scanner_event(Kw, 'unless') + find_token(Kw, 'unless') UnlessMod.new( statement: statement, @@ -8679,15 +8651,15 @@ def to_json(*opts) # :call-seq: # on_until: (untyped predicate, Statements statements) -> Until def on_until(predicate, statements) - beginning = find_scanner_event(Kw, 'until') - ending = find_scanner_event(Kw, 'end') + beginning = find_token(Kw, 'until') + ending = find_token(Kw, 'end') # Consume the do keyword if it exists so that it doesn't get confused for # some other block - keyword = find_scanner_event(Kw, 'do', consume: false) + keyword = find_token(Kw, 'do', consume: false) if keyword && keyword.location.start_char > predicate.location.end_char && keyword.location.end_char < ending.location.start_char - scanner_events.delete(keyword) + tokens.delete(keyword) end # Update the Statements location information @@ -8745,7 +8717,7 @@ def to_json(*opts) # :call-seq: # on_until_mod: (untyped predicate, untyped statement) -> UntilMod def on_until_mod(predicate, statement) - find_scanner_event(Kw, 'until') + find_token(Kw, 'until') UntilMod.new( statement: statement, @@ -8797,7 +8769,7 @@ def to_json(*opts) # :call-seq: # on_var_alias: (GVar left, (Backref | GVar) right) -> VarAlias def on_var_alias(left, right) - keyword = find_scanner_event(Kw, 'alias') + keyword = find_token(Kw, 'alias') VarAlias.new( left: left, @@ -9061,8 +9033,8 @@ def to_json(*opts) # (nil | Else | When) consequent # ) -> When def on_when(arguments, statements, consequent) - beginning = find_scanner_event(Kw, 'when') - ending = consequent || find_scanner_event(Kw, 'end') + beginning = find_token(Kw, 'when') + ending = consequent || find_token(Kw, 'end') statements.bind(arguments.location.end_char, ending.location.start_char) @@ -9120,15 +9092,15 @@ def to_json(*opts) # :call-seq: # on_while: (untyped predicate, Statements statements) -> While def on_while(predicate, statements) - beginning = find_scanner_event(Kw, 'while') - ending = find_scanner_event(Kw, 'end') + beginning = find_token(Kw, 'while') + ending = find_token(Kw, 'end') # Consume the do keyword if it exists so that it doesn't get confused for # some other block - keyword = find_scanner_event(Kw, 'do', consume: false) + keyword = find_token(Kw, 'do', consume: false) if keyword && keyword.location.start_char > predicate.location.end_char && keyword.location.end_char < ending.location.start_char - scanner_events.delete(keyword) + tokens.delete(keyword) end # Update the Statements location information @@ -9186,7 +9158,7 @@ def to_json(*opts) # :call-seq: # on_while_mod: (untyped predicate, untyped statement) -> WhileMod def on_while_mod(predicate, statement) - find_scanner_event(Kw, 'while') + find_token(Kw, 'while') WhileMod.new( statement: statement, @@ -9328,14 +9300,14 @@ def on_words_beg(value) location: Location.token(line: lineno, char: char_pos, size: value.size) ) - scanner_events << node + tokens << node node end # :call-seq: # on_words_new: () -> Words def on_words_new - words_beg = find_scanner_event(WordsBeg) + words_beg = find_token(WordsBeg) Words.new(elements: [], location: words_beg.location) end @@ -9395,10 +9367,8 @@ def on_xstring_new location = if heredoc && heredoc.beginning.value.include?('`') heredoc.location - elsif RUBY_MAJOR <= 2 && RUBY_MINOR <= 5 && RUBY_PATCH < 7 - Location.fixed(line: lineno, char: char_pos) else - find_scanner_event(Backtick).location + find_token(Backtick).location end XString.new(parts: [], location: location) @@ -9448,7 +9418,7 @@ def on_xstring_literal(xstring) location: heredoc.location ) else - ending = find_scanner_event(TStringEnd) + ending = find_token(TStringEnd) XStringLiteral.new( parts: xstring.parts, @@ -9490,7 +9460,7 @@ def to_json(*opts) # :call-seq: # on_yield: ((ArgsAddBlock | Paren) arguments) -> Yield def on_yield(arguments) - keyword = find_scanner_event(Kw, 'yield') + keyword = find_token(Kw, 'yield') Yield.new( arguments: arguments, @@ -9531,7 +9501,7 @@ def to_json(*opts) # :call-seq: # on_yield0: () -> Yield0 def on_yield0 - keyword = find_scanner_event(Kw, 'yield') + keyword = find_token(Kw, 'yield') Yield0.new(value: keyword.value, location: keyword.location) end @@ -9569,7 +9539,7 @@ def to_json(*opts) # :call-seq: # on_zsuper: () -> ZSuper def on_zsuper - keyword = find_scanner_event(Kw, 'super') + keyword = find_token(Kw, 'super') ZSuper.new(value: keyword.value, location: keyword.location) end diff --git a/test/rb/metadata_test.rb b/test/rb/metadata_test.rb index 2f83fae6..6560380c 100644 --- a/test/rb/metadata_test.rb +++ b/test/rb/metadata_test.rb @@ -4,25 +4,25 @@ class MetadataTest < Minitest::Test def test_BEGIN - assert_metadata Prettier::Parser::BEGINBlock, <<~SOURCE + assert_metadata Ripper::ParseTree::BEGINBlock, <<~SOURCE BEGIN { } SOURCE end def test_END - assert_metadata Prettier::Parser::ENDBlock, <<~SOURCE + assert_metadata Ripper::ParseTree::ENDBlock, <<~SOURCE END { } SOURCE end def test_alias - assert_metadata Prettier::Parser::Alias, 'alias foo bar' + assert_metadata Ripper::ParseTree::Alias, 'alias foo bar' end def test_array_args - assert_metadata Prettier::Parser::ArrayLiteral, <<~SOURCE + assert_metadata Ripper::ParseTree::ArrayLiteral, <<~SOURCE [ foo, bar, @@ -32,7 +32,7 @@ def test_array_args end def test_array_args_add_star - assert_metadata Prettier::Parser::ArrayLiteral, <<~SOURCE + assert_metadata Ripper::ParseTree::ArrayLiteral, <<~SOURCE [ foo, *bar, @@ -42,7 +42,7 @@ def test_array_args_add_star end def test_array_qwords - assert_metadata Prettier::Parser::ArrayLiteral, <<~SOURCE + assert_metadata Ripper::ParseTree::ArrayLiteral, <<~SOURCE %w[ foo bar @@ -52,12 +52,12 @@ def test_array_qwords end def test_aref - assert_metadata Prettier::Parser::ARef, 'foo[bar]' + assert_metadata Ripper::ParseTree::ARef, 'foo[bar]' end def test_aref_field assert_node_metadata( - Prettier::Parser::ARefField, + Ripper::ParseTree::ARefField, parse('foo[bar] = baz').target, start_char: 0, end_char: 8 @@ -66,7 +66,7 @@ def test_aref_field def test_args assert_node_metadata( - Prettier::Parser::Args, + Ripper::ParseTree::Args, parse('foo bar, baz').arguments.arguments, start_char: 4, end_char: 12 @@ -75,7 +75,7 @@ def test_args def test_args_add_block assert_node_metadata( - Prettier::Parser::ArgsAddBlock, + Ripper::ParseTree::ArgsAddBlock, parse('foo bar, baz').arguments, start_char: 4, end_char: 12 @@ -84,7 +84,7 @@ def test_args_add_block def test_args_add_star assert_node_metadata( - Prettier::Parser::ArgsAddStar, + Ripper::ParseTree::ArgsAddStar, parse('foo *bar').arguments.arguments, start_char: 4, end_char: 8 @@ -101,7 +101,7 @@ def test_arg_paren SOURCE assert_node_metadata( - Prettier::Parser::ArgParen, + Ripper::ParseTree::ArgParen, parse(content).arguments, start_char: 3, end_char: 20, @@ -111,12 +111,12 @@ def test_arg_paren end def test_assign - assert_metadata Prettier::Parser::Assign, 'foo = bar' + assert_metadata Ripper::ParseTree::Assign, 'foo = bar' end def test_assoc_new assert_node_metadata( - Prettier::Parser::AssocNew, + Ripper::ParseTree::AssocNew, parse('{ foo: bar, bar: baz }').contents.assocs.first, start_char: 2, end_char: 10 @@ -125,7 +125,7 @@ def test_assoc_new def test_assoc_splat assert_node_metadata( - Prettier::Parser::AssocSplat, + Ripper::ParseTree::AssocSplat, parse('foo **bar').arguments.arguments.parts.first.assocs.first, start_char: 4, end_char: 9 @@ -134,7 +134,7 @@ def test_assoc_splat def test_assoclist_from_args assert_node_metadata( - Prettier::Parser::AssocListFromArgs, + Ripper::ParseTree::AssocListFromArgs, parse('{ foo => bar }').contents, start_char: 1, end_char: 13 @@ -143,7 +143,7 @@ def test_assoclist_from_args def test_bare_assoc_hash assert_node_metadata( - Prettier::Parser::BareAssocHash, + Ripper::ParseTree::BareAssocHash, parse('foo(bar: baz)').arguments.arguments.arguments.parts.first, start_char: 4, end_char: 12 @@ -151,7 +151,7 @@ def test_bare_assoc_hash end def test_begin - assert_metadata Prettier::Parser::Begin, <<~SOURCE + assert_metadata Ripper::ParseTree::Begin, <<~SOURCE begin begin; end end @@ -159,12 +159,12 @@ def test_begin end def test_binary - assert_metadata Prettier::Parser::Binary, 'foo + bar' + assert_metadata Ripper::ParseTree::Binary, 'foo + bar' end def test_blockarg assert_node_metadata( - Prettier::Parser::BlockArg, + Ripper::ParseTree::BlockArg, parse('def foo(&bar) end').params.contents.block, start_char: 8, end_char: 12 @@ -173,7 +173,7 @@ def test_blockarg def test_block_var assert_node_metadata( - Prettier::Parser::BlockVar, + Ripper::ParseTree::BlockVar, parse('foo { |bar| }').block.block_var, start_char: 6, end_char: 11 @@ -182,7 +182,7 @@ def test_block_var def test_bodystmt assert_node_metadata( - Prettier::Parser::BodyStmt, + Ripper::ParseTree::BodyStmt, parse('class Foo; def foo; end; end').bodystmt, start_char: 9, end_char: 25 @@ -191,7 +191,7 @@ def test_bodystmt def test_brace_block assert_node_metadata( - Prettier::Parser::BraceBlock, + Ripper::ParseTree::BraceBlock, parse('foo { bar }').block, start_char: 4, end_char: 11 @@ -199,15 +199,15 @@ def test_brace_block end def test_break - assert_metadata Prettier::Parser::Break, 'break foo' + assert_metadata Ripper::ParseTree::Break, 'break foo' end def test_call - assert_metadata Prettier::Parser::Call, 'foo.bar' + assert_metadata Ripper::ParseTree::Call, 'foo.bar' end def test_case - assert_metadata Prettier::Parser::Case, <<~SOURCE + assert_metadata Ripper::ParseTree::Case, <<~SOURCE case foo when bar case baz @@ -218,7 +218,7 @@ def test_case end def test_class - assert_metadata Prettier::Parser::ClassDeclaration, <<~SOURCE + assert_metadata Ripper::ParseTree::ClassDeclaration, <<~SOURCE class Foo class Bar; end end @@ -226,16 +226,16 @@ class Bar; end end def test_command - assert_metadata Prettier::Parser::Command, 'foo bar' + assert_metadata Ripper::ParseTree::Command, 'foo bar' end def test_command_call - assert_metadata Prettier::Parser::CommandCall, 'foo.bar baz' + assert_metadata Ripper::ParseTree::CommandCall, 'foo.bar baz' end def test_const_ref assert_node_metadata( - Prettier::Parser::ConstRef, + Ripper::ParseTree::ConstRef, parse('class Foo; end').constant, start_char: 6, end_char: 9 @@ -244,7 +244,7 @@ def test_const_ref def test_const_path_field assert_node_metadata( - Prettier::Parser::ConstPathField, + Ripper::ParseTree::ConstPathField, parse('Foo::Bar = baz').target, start_char: 0, end_char: 8 @@ -252,11 +252,11 @@ def test_const_path_field end def test_const_path_ref - assert_metadata Prettier::Parser::ConstPathRef, 'Foo::Bar' + assert_metadata Ripper::ParseTree::ConstPathRef, 'Foo::Bar' end def test_def - assert_metadata Prettier::Parser::Def, <<~SOURCE + assert_metadata Ripper::ParseTree::Def, <<~SOURCE def foo def bar; end end @@ -264,7 +264,7 @@ def bar; end end def test_defined - assert_metadata Prettier::Parser::Defined, <<~SOURCE + assert_metadata Ripper::ParseTree::Defined, <<~SOURCE defined?( Foo ) @@ -272,7 +272,7 @@ def test_defined end def test_defs - assert_metadata Prettier::Parser::Defs, <<~SOURCE + assert_metadata Ripper::ParseTree::Defs, <<~SOURCE def Object.foo def Object.bar; end end @@ -281,7 +281,7 @@ def Object.bar; end def test_do_block assert_node_metadata( - Prettier::Parser::DoBlock, + Ripper::ParseTree::DoBlock, parse('foo do; bar; end').block, start_char: 4, end_char: 16 @@ -289,15 +289,15 @@ def test_do_block end def test_dot2 - assert_metadata Prettier::Parser::Dot2, 'foo..bar' + assert_metadata Ripper::ParseTree::Dot2, 'foo..bar' end def test_dot3 - assert_metadata Prettier::Parser::Dot3, 'foo...bar' + assert_metadata Ripper::ParseTree::Dot3, 'foo...bar' end def test_dyna_symbol - assert_metadata Prettier::Parser::DynaSymbol, ':"foo #{bar} baz"' + assert_metadata Ripper::ParseTree::DynaSymbol, ':"foo #{bar} baz"' end def test_else @@ -310,7 +310,7 @@ def test_else SOURCE assert_node_metadata( - Prettier::Parser::Else, + Ripper::ParseTree::Else, parse(content).consequent, start_char: 13, end_char: 27, @@ -329,7 +329,7 @@ def test_elsif SOURCE assert_node_metadata( - Prettier::Parser::Elsif, + Ripper::ParseTree::Elsif, parse(content).consequent, start_char: 13, end_char: 32, @@ -348,7 +348,7 @@ def test_ensure SOURCE assert_node_metadata( - Prettier::Parser::Ensure, + Ripper::ParseTree::Ensure, parse(content).bodystmt.ensure_clause, start_char: 12, end_char: 28, @@ -360,7 +360,7 @@ def test_ensure if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.6') def test_excessed_comma assert_node_metadata( - Prettier::Parser::ExcessedComma, + Ripper::ParseTree::ExcessedComma, parse('foo { |bar,| }').block.block_var.params.rest, start_char: 10, end_char: 11 @@ -370,7 +370,7 @@ def test_excessed_comma def test_fcall assert_node_metadata( - Prettier::Parser::FCall, + Ripper::ParseTree::FCall, parse('foo(bar)').call, start_char: 0, end_char: 3 @@ -379,7 +379,7 @@ def test_fcall def test_field assert_node_metadata( - Prettier::Parser::Field, + Ripper::ParseTree::Field, parse('foo.bar = baz').target, start_char: 0, end_char: 7 @@ -387,7 +387,7 @@ def test_field end def test_for - assert_metadata Prettier::Parser::For, <<~SOURCE + assert_metadata Ripper::ParseTree::For, <<~SOURCE for foo in bar do for baz in qux do end @@ -396,7 +396,7 @@ def test_for end def test_hash - assert_metadata Prettier::Parser::HashLiteral, <<~SOURCE + assert_metadata Ripper::ParseTree::HashLiteral, <<~SOURCE { foo: 'bar' } @@ -404,7 +404,7 @@ def test_hash end def test_if - assert_metadata Prettier::Parser::If, <<~SOURCE + assert_metadata Ripper::ParseTree::If, <<~SOURCE if foo if bar; end end @@ -412,16 +412,16 @@ def test_if end def test_ifop - assert_metadata Prettier::Parser::IfOp, 'foo ? bar : baz' + assert_metadata Ripper::ParseTree::IfOp, 'foo ? bar : baz' end def test_if_mod - assert_metadata Prettier::Parser::IfMod, 'foo if bar' + assert_metadata Ripper::ParseTree::IfMod, 'foo if bar' end def test_kwrest_param assert_node_metadata( - Prettier::Parser::KwRestParam, + Ripper::ParseTree::KwRestParam, parse('def foo(**bar); end').params.contents.keyword_rest, start_char: 8, end_char: 13 @@ -429,7 +429,7 @@ def test_kwrest_param end def test_lambda - assert_metadata Prettier::Parser::Lambda, <<~SOURCE + assert_metadata Ripper::ParseTree::Lambda, <<~SOURCE -> (foo, bar) { foo + bar } @@ -437,20 +437,20 @@ def test_lambda end def test_massign - assert_metadata Prettier::Parser::MAssign, 'foo, bar, baz = 1, 2, 3' + assert_metadata Ripper::ParseTree::MAssign, 'foo, bar, baz = 1, 2, 3' end def test_method_add_arg - assert_metadata Prettier::Parser::MethodAddArg, 'foo(bar)' + assert_metadata Ripper::ParseTree::MethodAddArg, 'foo(bar)' end def test_method_add_block - assert_metadata Prettier::Parser::MethodAddBlock, 'foo { bar }' + assert_metadata Ripper::ParseTree::MethodAddBlock, 'foo { bar }' end def test_mlhs assert_node_metadata( - Prettier::Parser::MLHS, + Ripper::ParseTree::MLHS, parse('foo, bar, baz = 1, 2, 3').target, start_char: 0, end_char: 13 @@ -459,7 +459,7 @@ def test_mlhs def test_mlhs_add_post assert_node_metadata( - Prettier::Parser::MLHSAddPost, + Ripper::ParseTree::MLHSAddPost, parse('foo, *bar, baz = 1, 2, 3').target, start_char: 5, end_char: 14 @@ -468,7 +468,7 @@ def test_mlhs_add_post def test_mlhs_add_star assert_node_metadata( - Prettier::Parser::MLHSAddStar, + Ripper::ParseTree::MLHSAddStar, parse('foo, *bar = 1, 2, 3').target, start_char: 5, end_char: 9 @@ -477,7 +477,7 @@ def test_mlhs_add_star def test_mlhs_paren assert_node_metadata( - Prettier::Parser::MLHSParen, + Ripper::ParseTree::MLHSParen, parse('(foo, bar) = baz').target, start_char: 0, end_char: 10 @@ -485,7 +485,7 @@ def test_mlhs_paren end def test_module - assert_metadata Prettier::Parser::ModuleDeclaration, <<~SOURCE + assert_metadata Ripper::ParseTree::ModuleDeclaration, <<~SOURCE module Foo module Bar; end end @@ -494,7 +494,7 @@ module Bar; end def test_mrhs_add_star assert_node_metadata( - Prettier::Parser::MRHSAddStar, + Ripper::ParseTree::MRHSAddStar, parse('foo, bar = *baz').value, start_char: 11, end_char: 15 @@ -502,11 +502,11 @@ def test_mrhs_add_star end def test_next - assert_metadata Prettier::Parser::Next, 'next foo' + assert_metadata Ripper::ParseTree::Next, 'next foo' end def test_opassign - assert_metadata Prettier::Parser::OpAssign, 'foo ||= bar' + assert_metadata Ripper::ParseTree::OpAssign, 'foo ||= bar' end def test_params @@ -518,7 +518,7 @@ def foo( SOURCE assert_node_metadata( - Prettier::Parser::Params, + Ripper::ParseTree::Params, parse(content).params.contents, start_char: 8, end_char: 22, @@ -528,12 +528,12 @@ def foo( end def test_paren - assert_metadata Prettier::Parser::Paren, '()' + assert_metadata Ripper::ParseTree::Paren, '()' end def test_qsymbols assert_node_metadata( - Prettier::Parser::QSymbols, + Ripper::ParseTree::QSymbols, parse('%i[foo bar baz]').contents, start_char: 0, end_char: 15 @@ -542,7 +542,7 @@ def test_qsymbols def test_qwords assert_node_metadata( - Prettier::Parser::QWords, + Ripper::ParseTree::QWords, parse('%w[foo bar baz]').contents, start_char: 0, end_char: 15 @@ -550,16 +550,16 @@ def test_qwords end def test_redo - assert_metadata Prettier::Parser::Redo, 'redo' + assert_metadata Ripper::ParseTree::Redo, 'redo' end def test_regexp_literal - assert_metadata Prettier::Parser::RegexpLiteral, '/foo/' - assert_metadata Prettier::Parser::RegexpLiteral, '%r{foo}' - assert_metadata Prettier::Parser::RegexpLiteral, '%r(foo)' + assert_metadata Ripper::ParseTree::RegexpLiteral, '/foo/' + assert_metadata Ripper::ParseTree::RegexpLiteral, '%r{foo}' + assert_metadata Ripper::ParseTree::RegexpLiteral, '%r(foo)' assert_node_metadata( - Prettier::Parser::RegexpLiteral, + Ripper::ParseTree::RegexpLiteral, parse('%r(foo)'), beginning: '%r(', ending: ')', @@ -570,7 +570,7 @@ def test_regexp_literal def test_rescue assert_node_metadata( - Prettier::Parser::Rescue, + Ripper::ParseTree::Rescue, parse('begin; foo; rescue => bar; baz; end').bodystmt.rescue_clause, start_char: 12, end_char: 35 @@ -578,12 +578,12 @@ def test_rescue end def test_rescue_mod - assert_metadata Prettier::Parser::RescueMod, 'foo rescue bar' + assert_metadata Ripper::ParseTree::RescueMod, 'foo rescue bar' end def test_rest_param assert_node_metadata( - Prettier::Parser::RestParam, + Ripper::ParseTree::RestParam, parse('def foo(*bar); end').params.contents.rest, start_char: 8, end_char: 12 @@ -591,19 +591,19 @@ def test_rest_param end def test_retry - assert_metadata Prettier::Parser::Retry, 'retry' + assert_metadata Ripper::ParseTree::Retry, 'retry' end def test_return - assert_metadata Prettier::Parser::Return, 'return foo' + assert_metadata Ripper::ParseTree::Return, 'return foo' end def test_return0 - assert_metadata Prettier::Parser::Return0, 'return' + assert_metadata Ripper::ParseTree::Return0, 'return' end def test_sclass - assert_metadata Prettier::Parser::SClass, <<~SOURCE + assert_metadata Ripper::ParseTree::SClass, <<~SOURCE class << Foo class << Bar; end end @@ -611,7 +611,7 @@ class << Bar; end end def test_string_concat - assert_metadata Prettier::Parser::StringConcat, <<~SOURCE + assert_metadata Ripper::ParseTree::StringConcat, <<~SOURCE 'foo' \ 'bar' SOURCE @@ -619,7 +619,7 @@ def test_string_concat def test_string_dvar assert_node_metadata( - Prettier::Parser::StringDVar, + Ripper::ParseTree::StringDVar, parse('"#$foo"').parts.first, start_char: 1, end_char: 6 @@ -628,7 +628,7 @@ def test_string_dvar def test_string_embexpr assert_node_metadata( - Prettier::Parser::StringEmbExpr, + Ripper::ParseTree::StringEmbExpr, parse('"foo #{bar} baz"').parts[1], start_char: 5, end_char: 11 @@ -636,20 +636,20 @@ def test_string_embexpr end def test_string_literal - assert_metadata Prettier::Parser::StringLiteral, '"foo"' + assert_metadata Ripper::ParseTree::StringLiteral, '"foo"' end def test_super - assert_metadata Prettier::Parser::Super, 'super foo' + assert_metadata Ripper::ParseTree::Super, 'super foo' end def test_symbol_literal - assert_metadata Prettier::Parser::SymbolLiteral, ':foo' + assert_metadata Ripper::ParseTree::SymbolLiteral, ':foo' end def test_symbols assert_node_metadata( - Prettier::Parser::Symbols, + Ripper::ParseTree::Symbols, parse('%I[f#{o}o b#{a}r b#{a}z]').contents, start_char: 0, end_char: 24 @@ -658,7 +658,7 @@ def test_symbols def test_top_const_field assert_node_metadata( - Prettier::Parser::TopConstField, + Ripper::ParseTree::TopConstField, parse('::Foo = bar').target, start_char: 0, end_char: 5 @@ -666,20 +666,20 @@ def test_top_const_field end def test_top_const_ref - assert_metadata Prettier::Parser::TopConstRef, '::Foo' + assert_metadata Ripper::ParseTree::TopConstRef, '::Foo' end def test_unary - assert_metadata Prettier::Parser::Unary, '-foo' - assert_metadata Prettier::Parser::Not, 'not foo' + assert_metadata Ripper::ParseTree::Unary, '-foo' + assert_metadata Ripper::ParseTree::Not, 'not foo' end def test_undef - assert_metadata Prettier::Parser::Undef, 'undef foo, bar' + assert_metadata Ripper::ParseTree::Undef, 'undef foo, bar' end def test_unless - assert_metadata Prettier::Parser::Unless, <<~SOURCE + assert_metadata Ripper::ParseTree::Unless, <<~SOURCE unless foo unless bar; end end @@ -687,11 +687,11 @@ def test_unless end def test_unless_mod - assert_metadata Prettier::Parser::UnlessMod, 'foo unless bar' + assert_metadata Ripper::ParseTree::UnlessMod, 'foo unless bar' end def test_until - assert_metadata Prettier::Parser::Until, <<~SOURCE + assert_metadata Ripper::ParseTree::Until, <<~SOURCE until foo until bar; end end @@ -699,11 +699,11 @@ def test_until end def test_until_mod - assert_metadata Prettier::Parser::UntilMod, 'foo until bar' + assert_metadata Ripper::ParseTree::UntilMod, 'foo until bar' end def test_while - assert_metadata Prettier::Parser::While, <<~SOURCE + assert_metadata Ripper::ParseTree::While, <<~SOURCE while foo while bar; end end @@ -711,12 +711,12 @@ def test_while end def test_var_alias - assert_metadata Prettier::Parser::VarAlias, 'alias $foo $bar' + assert_metadata Ripper::ParseTree::VarAlias, 'alias $foo $bar' end def test_var_field assert_node_metadata( - Prettier::Parser::VarField, + Ripper::ParseTree::VarField, parse('foo = 1').target, start_char: 0, end_char: 3 @@ -724,16 +724,16 @@ def test_var_field end def test_var_ref - assert_metadata Prettier::Parser::VarRef, 'true' + assert_metadata Ripper::ParseTree::VarRef, 'true' end def test_vcall - assert_metadata Prettier::Parser::VCall, 'foo' + assert_metadata Ripper::ParseTree::VCall, 'foo' end def test_void_stmt assert_node_metadata( - Prettier::Parser::VoidStmt, + Ripper::ParseTree::VoidStmt, parse('; ;'), start_char: 0, end_char: 0 @@ -742,7 +742,7 @@ def test_void_stmt def test_when assert_node_metadata( - Prettier::Parser::When, + Ripper::ParseTree::When, parse('case foo; when bar; baz; end').consequent, start_char: 10, end_char: 28 @@ -750,12 +750,12 @@ def test_when end def test_while_mod - assert_metadata Prettier::Parser::WhileMod, 'foo while bar' + assert_metadata Ripper::ParseTree::WhileMod, 'foo while bar' end def test_words assert_node_metadata( - Prettier::Parser::Words, + Ripper::ParseTree::Words, parse('%W[f#{o}o b#{a}r b#{a}z]').contents, start_char: 0, end_char: 24 @@ -763,7 +763,7 @@ def test_words end def test_xstring - assert_metadata Prettier::Parser::XStringLiteral, <<~SOURCE + assert_metadata Ripper::ParseTree::XStringLiteral, <<~SOURCE ` foo bar @@ -772,15 +772,15 @@ def test_xstring end def test_yield - assert_metadata Prettier::Parser::Yield, 'yield foo' + assert_metadata Ripper::ParseTree::Yield, 'yield foo' end def test_yield0 - assert_metadata Prettier::Parser::Yield0, 'yield' + assert_metadata Ripper::ParseTree::Yield0, 'yield' end def test_zsuper - assert_metadata Prettier::Parser::ZSuper, 'super' + assert_metadata Ripper::ParseTree::ZSuper, 'super' end if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7') @@ -792,7 +792,7 @@ def foo(...) SOURCE assert_node_metadata( - Prettier::Parser::ArgsForward, + Ripper::ParseTree::ArgsForward, parse(content).params.contents.rest, start_char: 8, end_char: 11 @@ -808,7 +808,7 @@ def test_aryptn SOURCE assert_node_metadata( - Prettier::Parser::AryPtn, + Ripper::ParseTree::AryPtn, parse(content).consequent.pattern, start_char: 12, end_char: 20, @@ -826,7 +826,7 @@ def test_in SOURCE assert_node_metadata( - Prettier::Parser::In, + Ripper::ParseTree::In, parse(content).consequent, start_char: 9, end_char: 25, @@ -869,6 +869,6 @@ def assert_node_metadata( end def parse(ruby) - Prettier::Parser.parse(ruby).statements.body.first + Ripper::ParseTree.parse(ruby).statements.body.first end end From ad9fde6e78503a6a19be187640b15dd7c6593c85 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 16 Nov 2021 17:04:20 -0500 Subject: [PATCH 420/785] Update to latest syntax_tree --- bin/debug | 6 +- src/parser/server.rb | 4 +- src/ruby/embed.ts | 2 +- src/ruby/nodes.ts | 79 +++--- src/ruby/nodes/arrays.ts | 2 +- src/ruby/nodes/calls.ts | 2 +- src/ruby/nodes/conditionals.ts | 4 +- src/ruby/nodes/flow.ts | 2 +- src/ruby/nodes/hashes.ts | 6 +- src/ruby/nodes/heredocs.ts | 2 +- src/ruby/nodes/methods.ts | 2 +- src/ruby/nodes/operators.ts | 18 +- src/ruby/nodes/regexp.ts | 4 +- src/ruby/nodes/return.ts | 6 +- src/ruby/nodes/statements.ts | 4 +- src/ruby/nodes/strings.ts | 12 +- src/ruby/parser.rb | 416 +++++--------------------------- src/ruby/printer.ts | 4 +- src/ruby/toProc.ts | 6 +- src/types/ruby.ts | 51 ++-- src/utils/containsAssignment.ts | 2 +- src/utils/getChildNodes.ts | 50 ++-- src/utils/isEmptyStmts.ts | 4 +- 23 files changed, 195 insertions(+), 493 deletions(-) diff --git a/bin/debug b/bin/debug index 1da96c2a..2f80a61d 100755 --- a/bin/debug +++ b/bin/debug @@ -124,11 +124,7 @@ const createTree = (parent, node) => { const label = `${node.type} (${node.loc[1]}-${node.loc[3]})`; - if (node.type.startsWith("@")) { - button.appendChild(document.createTextNode(`${label} = ${node.body}`)); - li.appendChild(button); - parent.appendChild(li); - } else if (Array.isArray(node.body)) { + if (Array.isArray(node.body)) { const ul = document.createElement("ul"); node.body.forEach(child => { createTree(ul, child); diff --git a/src/parser/server.rb b/src/parser/server.rb index bfb13343..473671dc 100644 --- a/src/parser/server.rb +++ b/src/parser/server.rb @@ -72,7 +72,7 @@ when 'ping' 'pong' when 'ruby' - Ripper::ParseTree.parse(source) + SyntaxTree.parse(source) when 'rbs' Prettier::RBSParser.parse(source) when 'haml' @@ -84,7 +84,7 @@ else socket.write('{ "error": true }') end - rescue Ripper::ParseTree::ParseError => error + rescue SyntaxTree::ParseError => error loc = { start: { line: error.lineno, column: error.column } } socket.write(JSON.fast_generate(error: error.message, loc: loc)) rescue StandardError => error diff --git a/src/ruby/embed.ts b/src/ruby/embed.ts index 3ca3c6cd..b7fb494b 100644 --- a/src/ruby/embed.ts +++ b/src/ruby/embed.ts @@ -77,7 +77,7 @@ function stripCommonLeadingWhitespace(content: string) { function isTStringContentArray( body: Ruby.StringContent[] ): body is Ruby.TStringContent[] { - return body.every((part) => part.type === "@tstring_content"); + return body.every((part) => part.type === "tstring_content"); } const embed: Plugin.Embed = (path, print, textToDoc) => { diff --git a/src/ruby/nodes.ts b/src/ruby/nodes.ts index e92ce386..cf163fc4 100644 --- a/src/ruby/nodes.ts +++ b/src/ruby/nodes.ts @@ -74,12 +74,13 @@ import { import { printAccessControl, printDef, - printSingleLineMethod + printDefEndless } from "./nodes/methods"; import { printBinary, printDot2, printDot3, + printNot, printUnary } from "./nodes/operators"; import { @@ -113,7 +114,7 @@ import { printEndContent, printParen, printProgram, - printStmts + printStatements } from "./nodes/statements"; import { printChar, @@ -153,29 +154,11 @@ type Token = const printToken: Plugin.Printer = (path) => path.getValue().value; const printVoidStmt: Plugin.Printer = () => ""; -const nodes: Record> = { - "@__end__": printEndContent, - "@CHAR": printChar, - "@comment": printComment, - "@backref": printToken, - "@backtick": printToken, - "@const": printToken, - "@cvar": printToken, - "@float": printToken, - "@gvar": printToken, - "@heredoc_beg": printToken, - "@ident": printToken, - "@imaginary": printToken, - "@int": printInt, - "@ivar": printToken, - "@kw": printToken, - "@label": printToken, - "@lbrace": printToken, - "@lparen": printToken, - "@op": printToken, - "@period": printToken, - "@rational": printToken, - "@tstring_content": printToken, +const nodes: Record> = { + BEGIN: printBEGIN, + CHAR: printChar, + END: printEND, + __end__: printEndContent, access_ctrl: printAccessControl, alias: printAlias, aref: printAref, @@ -191,12 +174,13 @@ const nodes: Record> = { assoc_new: printAssocNew, assoc_splat: printAssocSplat, assoclist_from_args: printHashContents, + backref: printToken, + backtick: printToken, bare_assoc_hash: printHashContents, - BEGIN: printBEGIN, begin: printBegin, binary: printBinary, - blockarg: printBlockArg, block_var: printBlockVar, + blockarg: printBlockArg, bodystmt: printBodyStmt, brace_block: printBraceBlock, break: printBreak, @@ -205,35 +189,49 @@ const nodes: Record> = { class: printClass, command: printCommand, command_call: printCommandCall, + comment: printComment, + const: printToken, const_path_field: printConstPath, const_path_ref: printConstPath, const_ref: printConstRef, + cvar: printToken, def: printDef, - defs: printDef, - defsl: printSingleLineMethod, + def_endless: printDefEndless, defined: printDefined, + defs: printDef, do_block: printDoBlock, dot2: printDot2, dot3: printDot3, dyna_symbol: printDynaSymbol, else: printElse, elsif: printElsif, - END: printEND, + embdoc: printComment, ensure: printEnsure, excessed_comma: printExcessedComma, fcall: printCallContainer, - fndptn: printFndPtn, field: printField, + float: printToken, + fndptn: printFndPtn, for: printFor, + gvar: printToken, hash: printHash, heredoc: printHeredoc, + heredoc_beg: printToken, hshptn: printHshPtn, + ident: printToken, if: printIf, - ifop: printTernary, if_mod: printIfModifier, + ifop: printTernary, + imaginary: printToken, in: printIn, + int: printInt, + ivar: printToken, + kw: printToken, kwrest_param: printKeywordRestParam, + label: printToken, lambda: printLambda, + lbrace: printToken, + lparen: printToken, massign: printMAssign, method_add_arg: printMethodAddArg, method_add_block: printMethodAddBlock, @@ -241,18 +239,22 @@ const nodes: Record> = { mlhs_add_post: printMLHSAddPost, mlhs_add_star: printMLHSAddStar, mlhs_paren: printMLHSParen, + module: printModule, mrhs: printMRHS, mrhs_add_star: printMRHSAddStar, mrhs_new_from_args: printMRHSNewFromArgs, - module: printModule, next: printNext, + not: printNot, + op: printToken, opassign: printOpAssign, params: printParams, paren: printParen, + period: printToken, program: printProgram, - qwords: printQwords, qsymbols: printQsymbols, + qwords: printQwords, rassign: printRAssign, + rational: printToken, redo: printRedo, regexp_literal: printRegexpLiteral, rescue: printRescue, @@ -260,19 +262,20 @@ const nodes: Record> = { rescue_mod: printRescueMod, rest_param: printRestParam, retry: printRetry, - return: printReturn, return0: printReturn0, + return: printReturn, sclass: printSClass, - stmts: printStmts, + statements: printStatements, string_concat: printStringConcat, string_dvar: printStringDVar, string_embexpr: printStringEmbExpr, string_literal: printStringLiteral, super: printSuper, - symbols: printSymbols, symbol_literal: printSymbolLiteral, + symbols: printSymbols, top_const_field: printTopConst, top_const_ref: printTopConst, + tstring_content: printToken, unary: printUnary, undef: printUndef, unless: printUnless, @@ -290,8 +293,8 @@ const nodes: Record> = { word: printWord, words: printWords, xstring_literal: printXStringLiteral, - yield: printYield, yield0: printYield0, + yield: printYield, zsuper: printZSuper }; diff --git a/src/ruby/nodes/arrays.ts b/src/ruby/nodes/arrays.ts index 24e530c7..1e40a6bb 100644 --- a/src/ruby/nodes/arrays.ts +++ b/src/ruby/nodes/arrays.ts @@ -31,7 +31,7 @@ function isStringArray(args: Ruby.Args | Ruby.ArgsAddStar) { // If the only part of this string is not @tstring_content then it's // interpolated, so again we can return false. - if (part.type !== "@tstring_content") { + if (part.type !== "tstring_content") { return false; } diff --git a/src/ruby/nodes/calls.ts b/src/ruby/nodes/calls.ts index 974badd0..cd6af2be 100644 --- a/src/ruby/nodes/calls.ts +++ b/src/ruby/nodes/calls.ts @@ -145,7 +145,7 @@ export const printMethodAddArg: Plugin.Printer = ( // like a constant, then we need to match that in order to maintain valid // Ruby. For example, you could do something like Foo(), on which we would // need to keep the parentheses to make it look like a method call. - if (node.call.type === "fcall" && node.call.value.type === "@const") { + if (node.call.type === "fcall" && node.call.value.type === "const") { return [methodDoc, "()"]; } diff --git a/src/ruby/nodes/conditionals.ts b/src/ruby/nodes/conditionals.ts index c1ec24f2..ea18e9da 100644 --- a/src/ruby/nodes/conditionals.ts +++ b/src/ruby/nodes/conditionals.ts @@ -13,7 +13,7 @@ type Conditional = Ruby.If | Ruby.Unless; // If the statements are just a single if/unless, in block or modifier form, or // a ternary -function containsSingleConditional(stmts: Ruby.Stmts) { +function containsSingleConditional(stmts: Ruby.Statements) { return ( stmts.body.length === 1 && ["if", "if_mod", "ifop", "unless", "unless_mod"].includes( @@ -188,7 +188,7 @@ const noTernary = [ // Certain expressions cannot be reduced to a ternary without adding parens // around them. In this case we say they cannot be ternaried and default instead // to breaking them into multiple lines. -function canTernaryStmts(stmts: Ruby.Stmts) { +function canTernaryStmts(stmts: Ruby.Statements) { if (stmts.body.length !== 1) { return false; } diff --git a/src/ruby/nodes/flow.ts b/src/ruby/nodes/flow.ts index c6bd76e3..aba8043f 100644 --- a/src/ruby/nodes/flow.ts +++ b/src/ruby/nodes/flow.ts @@ -31,7 +31,7 @@ function printFlowControl(keyword: string): Plugin.Printer { const paren = node.args.args.type === "args" && node.args.args.parts[0]; if (paren && paren.type === "paren") { - const stmts = (paren.cnts as Ruby.Stmts).body; + const stmts = (paren.cnts as Ruby.Statements).body; // Here we're checking if we can skip past the parentheses entirely. if (stmts.length === 1 && !unskippableParens.includes(stmts[0].type)) { diff --git a/src/ruby/nodes/hashes.ts b/src/ruby/nodes/hashes.ts index 05237d6f..1a0d4bf3 100644 --- a/src/ruby/nodes/hashes.ts +++ b/src/ruby/nodes/hashes.ts @@ -38,7 +38,7 @@ function canUseHashLabels(contentsNode: HashContents) { } switch (assocNode.key.type) { - case "@label": + case "label": return true; case "symbol_literal": return isValidHashLabel(assocNode.key); @@ -54,7 +54,7 @@ const printHashKeyLabel: KeyPrinter = (path, print) => { const node = path.getValue(); switch (node.type) { - case "@label": + case "label": return print(path); case "symbol_literal": return [(path as Plugin.Path).call(print, "value"), ":"]; @@ -71,7 +71,7 @@ const printHashKeyRocket: KeyPrinter = (path, print) => { const node = path.getValue(); let doc = print(path); - if (node.type === "@label") { + if (node.type === "label") { const sDoc = doc as string; // since we know this is a label doc = [":", sDoc.slice(0, sDoc.length - 1)]; } else if (node.type === "dyna_symbol") { diff --git a/src/ruby/nodes/heredocs.ts b/src/ruby/nodes/heredocs.ts index 89dbdf31..ba62f1a5 100644 --- a/src/ruby/nodes/heredocs.ts +++ b/src/ruby/nodes/heredocs.ts @@ -15,7 +15,7 @@ export const printHeredoc: Plugin.Printer = ( const parts = path.map((partPath) => { const part = partPath.getValue(); - if (part.type !== "@tstring_content") { + if (part.type !== "tstring_content") { return print(partPath); } diff --git a/src/ruby/nodes/methods.ts b/src/ruby/nodes/methods.ts index cd9acc8d..68195c97 100644 --- a/src/ruby/nodes/methods.ts +++ b/src/ruby/nodes/methods.ts @@ -41,7 +41,7 @@ export const printDef: Plugin.Printer = ( ]); }; -export const printSingleLineMethod: Plugin.Printer = ( +export const printDefEndless: Plugin.Printer = ( path, opts, print diff --git a/src/ruby/nodes/operators.ts b/src/ruby/nodes/operators.ts index 02228793..f60a3fb6 100644 --- a/src/ruby/nodes/operators.ts +++ b/src/ruby/nodes/operators.ts @@ -57,17 +57,17 @@ export const printDot3: Plugin.Printer = (path, opts, print) => { export const printUnary: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); + + return [node.op, path.call(print, "value")]; +}; + +export const printNot: Plugin.Printer = (path, opts, print) => { + const node = path.getValue(); const valueDoc = path.call(print, "value"); - if (node.op === "not") { - // Here we defer to the original source, as it's kind of difficult to - // determine if we can actually remove the parentheses being used. - if (node.paren) { - return ["not", "(", valueDoc, ")"]; - } else { - return ["not", " ", valueDoc]; - } + if (node.paren) { + return ["not", "(", valueDoc, ")"]; } - return [node.op, valueDoc]; + return ["not", " ", valueDoc]; }; diff --git a/src/ruby/nodes/regexp.ts b/src/ruby/nodes/regexp.ts index 308053a3..7f9d3602 100644 --- a/src/ruby/nodes/regexp.ts +++ b/src/ruby/nodes/regexp.ts @@ -3,7 +3,7 @@ import { hasAncestor } from "../../utils"; function hasContent(node: Ruby.RegexpLiteral, pattern: RegExp) { return node.parts.some( - (part) => part.type === "@tstring_content" && pattern.test(part.value) + (part) => part.type === "tstring_content" && pattern.test(part.value) ); } @@ -17,7 +17,7 @@ function forwardSlashIsAmbiguous(path: Plugin.Path) { return ( firstPart && - firstPart.type === "@tstring_content" && + firstPart.type === "tstring_content" && [" ", "="].includes(firstPart.value[0]) && hasAncestor(path, ["command", "command_call"]) ); diff --git a/src/ruby/nodes/return.ts b/src/ruby/nodes/return.ts index 80f3e72f..e095789e 100644 --- a/src/ruby/nodes/return.ts +++ b/src/ruby/nodes/return.ts @@ -6,7 +6,7 @@ const { group, ifBreak, indent, line, join, softline } = prettier; // You can't skip the parentheses if you have comments or certain operators with // lower precedence than the return keyword. function canSkipParens(paren: Ruby.Paren) { - const stmts = paren.cnts as Ruby.Stmts; + const stmts = paren.cnts as Ruby.Statements; // return( // # a @@ -24,7 +24,7 @@ function canSkipParens(paren: Ruby.Paren) { } // return (not a) - if (stmt.type === "unary" && stmt.op === "not") { + if (stmt.type === "not") { return false; } @@ -54,7 +54,7 @@ export const printReturn: Plugin.Printer = (path, opts, print) => { return ["return", path.call(print, "args")]; } - arg = (arg.cnts as Ruby.Stmts).body[0]; + arg = (arg.cnts as Ruby.Statements).body[0]; steps.push("cnts", "body", 0); } diff --git a/src/ruby/nodes/statements.ts b/src/ruby/nodes/statements.ts index 934a989b..45b358af 100644 --- a/src/ruby/nodes/statements.ts +++ b/src/ruby/nodes/statements.ts @@ -96,11 +96,11 @@ export const printProgram: Plugin.Printer = ( print ) => [path.call(print, "stmts"), hardline]; -type StmtsVoidWithComments = Ruby.Stmts & { +type StmtsVoidWithComments = Ruby.Statements & { body: [{ type: "void_stmt"; comments: Ruby.Comment[] }]; }; -export const printStmts: Plugin.Printer = (path, opts, print) => { +export const printStatements: Plugin.Printer = (path, opts, print) => { const stmts = path.getValue().body; // This is a special case where we have only comments inside a statement diff --git a/src/ruby/nodes/strings.ts b/src/ruby/nodes/strings.ts index 6e79fe23..b227eeba 100644 --- a/src/ruby/nodes/strings.ts +++ b/src/ruby/nodes/strings.ts @@ -13,7 +13,7 @@ const { group, hardline, indent, literalline, removeLines, softline, join } = function isQuoteLocked(node: Ruby.DynaSymbol | Ruby.StringLiteral) { return node.parts.some( (part) => - part.type === "@tstring_content" && + part.type === "tstring_content" && (part.value.includes("#{") || part.value.includes("\\")) ); } @@ -22,7 +22,7 @@ function isQuoteLocked(node: Ruby.DynaSymbol | Ruby.StringLiteral) { // plain string content and that content does not contain a single quote. function isSingleQuotable(node: Ruby.DynaSymbol | Ruby.StringLiteral) { return node.parts.every( - (part) => part.type === "@tstring_content" && !part.value.includes("'") + (part) => part.type === "tstring_content" && !part.value.includes("'") ); } @@ -95,7 +95,7 @@ const printPercentSDynaSymbol: Plugin.Printer = ( path.each((childPath) => { const childNode = childPath.getValue(); - if (childNode.type !== "@tstring_content") { + if (childNode.type !== "tstring_content") { // Here we are printing an embedded variable or expression. parts.push(print(childPath)); } else { @@ -128,7 +128,7 @@ function shouldPrintPercentSDynaSymbol(node: Ruby.DynaSymbol) { return node.parts.some( (child) => - child.type === "@tstring_content" && + child.type === "tstring_content" && (child.value.includes("\n") || child.value.includes(closing) || child.value.includes("'") || @@ -173,7 +173,7 @@ export const printDynaSymbol: Plugin.Printer = ( path.each((childPath) => { const child = childPath.getValue() as Ruby.StringContent; - if (child.type !== "@tstring_content") { + if (child.type !== "tstring_content") { parts.push(print(childPath)); } else { parts.push( @@ -261,7 +261,7 @@ export const printStringLiteral: Plugin.Printer = ( const part = partPath.getValue(); // In this case, the part of the string is an embedded expression - if (part.type !== "@tstring_content") { + if (part.type !== "tstring_content") { return print(partPath); } diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 7bebf9dc..16217531 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -2,7 +2,7 @@ require 'ripper' -class Ripper::ParseTree < Ripper +class SyntaxTree < Ripper # Represents a line in the source. If this class is being used, it means that # every character in the string is 1 byte in length, so we can just return the # start of the line + the index. @@ -47,6 +47,14 @@ def initialize(start_line:, start_char:, end_line:, end_char:) @end_char = end_char end + def ==(other) + other.is_a?(Location) && + start_line == other.start_line && + start_char == other.start_char && + end_line == other.end_line && + end_char == other.end_char + end + def to(other) Location.new( start_line: start_line, @@ -92,8 +100,8 @@ def initialize(error, lineno, column) # array and attach them to themselves. attr_accessor :comments - def initialize(source, *args) - super(source, *args) + def initialize(source, *) + super # We keep the source around so that we can refer back to it when we're # generating the AST. Sometimes it's easier to just reference the source @@ -161,10 +169,9 @@ def initialize(source, *args) end def self.parse(source) - builder = new(source) - - response = builder.parse - response unless builder.error? + parser = new(source) + response = parser.parse + response unless parser.error? end private @@ -348,7 +355,7 @@ def pretty_print(q) end def to_json(*opts) - { type: :@CHAR, value: value, loc: location }.to_json(*opts) + { type: :CHAR, value: value, loc: location }.to_json(*opts) end end @@ -455,7 +462,7 @@ def pretty_print(q) end def to_json(*opts) - { type: :@__end__, value: value, loc: location }.to_json(*opts) + { type: :__end__, value: value, loc: location }.to_json(*opts) end end @@ -1314,7 +1321,7 @@ def pretty_print(q) end def to_json(*opts) - { type: :@backref, value: value, loc: location }.to_json(*opts) + { type: :backref, value: value, loc: location }.to_json(*opts) end end @@ -1355,7 +1362,7 @@ def pretty_print(q) end def to_json(*opts) - { type: :@backtick, value: value, loc: location }.to_json(*opts) + { type: :backtick, value: value, loc: location }.to_json(*opts) end end @@ -2188,18 +2195,6 @@ def initialize(value:, location:) @value = value @location = location end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('comma') - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :@comma, value: value, loc: location }.to_json(*opts) - end end # :call-seq: @@ -2303,7 +2298,7 @@ def initialize(receiver:, operator:, message:, arguments:, location:) def pretty_print(q) q.group(2, '(', ')') do - q.text('case') + q.text('command_call') q.breakable q.pp(receiver) @@ -2361,6 +2356,7 @@ class Comment # [boolean] whether or not there is code on the same line as this comment. # If there is, then inline will be true. attr_reader :inline + alias inline? inline # [Location] the location of this node attr_reader :location @@ -2381,7 +2377,7 @@ def pretty_print(q) def to_json(*opts) { - type: :@comment, + type: :comment, value: value.force_encoding('UTF-8'), inline: inline, loc: location @@ -2440,7 +2436,7 @@ def pretty_print(q) end def to_json(*opts) - { type: :@const, value: value, loc: location }.to_json(*opts) + { type: :const, value: value, loc: location }.to_json(*opts) end end @@ -2627,7 +2623,7 @@ def pretty_print(q) end def to_json(*opts) - { type: :@cvar, value: value, loc: location }.to_json(*opts) + { type: :cvar, value: value, loc: location }.to_json(*opts) end end @@ -2646,7 +2642,7 @@ def on_cvar(value) # Def represents defining a regular method on the current self object. # - # def method(param) do result end + # def method(param) result end # class Def # [Backtick | Const | Ident | Keyword | Op] the name of the method @@ -2720,7 +2716,7 @@ def initialize(name:, paren:, statement:, location:) def pretty_print(q) q.group(2, '(', ')') do - q.text('defsl') + q.text('def_endless') q.breakable q.pp(name) @@ -2735,7 +2731,7 @@ def pretty_print(q) def to_json(*opts) { - type: :defsl, + type: :def_endless, name: name, paren: paren, stmt: statement, @@ -2849,7 +2845,7 @@ def on_defined(value) # Defs represents defining a singleton method on an object. # - # def object.method(param) do result end + # def object.method(param) result end # class Defs # [untyped] the target where the method is being defined @@ -3374,6 +3370,10 @@ def initialize(value:, location:) @location = location end + def inline? + false + end + def pretty_print(q) q.group(2, '(', ')') do q.text('embdoc') @@ -3384,7 +3384,7 @@ def pretty_print(q) end def to_json(*opts) - { type: :@embdoc, value: value, loc: location }.to_json(*opts) + { type: :embdoc, value: value, loc: location }.to_json(*opts) end end @@ -3444,19 +3444,6 @@ def initialize(value:, location:) @value = value @location = location end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('embexpr_beg') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :@embexpr_beg, value: value, loc: location }.to_json(*opts) - end end # :call-seq: @@ -3489,19 +3476,6 @@ def initialize(value:, location:) @value = value @location = location end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('embexpr_end') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :@embexpr_end, value: value, loc: location }.to_json(*opts) - end end # :call-seq: @@ -3536,19 +3510,6 @@ def initialize(value:, location:) @value = value @location = location end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('embvar') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :@embvar, value: value, loc: location }.to_json(*opts) - end end # :call-seq: @@ -3804,7 +3765,7 @@ def pretty_print(q) end def to_json(*opts) - { type: :@float, value: value, loc: location }.to_json(*opts) + { type: :float, value: value, loc: location }.to_json(*opts) end end @@ -4014,7 +3975,7 @@ def pretty_print(q) end def to_json(*opts) - { type: :@gvar, value: value, loc: location }.to_json(*opts) + { type: :gvar, value: value, loc: location }.to_json(*opts) end end @@ -4163,7 +4124,7 @@ def pretty_print(q) end def to_json(*opts) - { type: :@heredoc_beg, value: value, loc: location }.to_json(*opts) + { type: :heredoc_beg, value: value, loc: location }.to_json(*opts) end end @@ -4321,7 +4282,7 @@ def pretty_print(q) def to_json(*opts) { - type: :@ident, + type: :ident, value: value.force_encoding('UTF-8'), loc: location }.to_json(*opts) @@ -4563,7 +4524,7 @@ def pretty_print(q) end def to_json(*opts) - { type: :@imaginary, value: value, loc: location }.to_json(*opts) + { type: :imaginary, value: value, loc: location }.to_json(*opts) end end @@ -4685,7 +4646,7 @@ def pretty_print(q) end def to_json(*opts) - { type: :@int, value: value, loc: location }.to_json(*opts) + { type: :int, value: value, loc: location }.to_json(*opts) end end @@ -4728,7 +4689,7 @@ def pretty_print(q) end def to_json(*opts) - { type: :@ivar, value: value, loc: location }.to_json(*opts) + { type: :ivar, value: value, loc: location }.to_json(*opts) end end @@ -4780,7 +4741,7 @@ def pretty_print(q) end def to_json(*opts) - { type: :@kw, value: value, loc: location }.to_json(*opts) + { type: :kw, value: value, loc: location }.to_json(*opts) end end @@ -4873,7 +4834,7 @@ def pretty_print(q) end def to_json(*opts) - { type: :@label, value: value, loc: location }.to_json(*opts) + { type: :label, value: value, loc: location }.to_json(*opts) end end @@ -4908,19 +4869,6 @@ def initialize(value:, location:) @value = value @location = location end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('label_end') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :@label_end, value: value, loc: location }.to_json(*opts) - end end # :call-seq: @@ -5026,7 +4974,7 @@ def pretty_print(q) end def to_json(*opts) - { type: :@lbrace, value: value, loc: location }.to_json(*opts) + { type: :lbrace, value: value, loc: location }.to_json(*opts) end end @@ -5055,19 +5003,6 @@ def initialize(value:, location:) @value = value @location = location end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('lbracket') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :@lbracket, value: value, loc: location }.to_json(*opts) - end end # :call-seq: @@ -5106,7 +5041,7 @@ def pretty_print(q) end def to_json(*opts) - { type: :@lparen, value: value, loc: location }.to_json(*opts) + { type: :lparen, value: value, loc: location }.to_json(*opts) end end @@ -5829,7 +5764,7 @@ def pretty_print(q) end def to_json(*opts) - { type: :@op, value: value, loc: location }.to_json(*opts) + { type: :op, value: value, loc: location }.to_json(*opts) end end @@ -6210,7 +6145,7 @@ def pretty_print(q) end def to_json(*opts) - { type: :@period, value: value, loc: location }.to_json(*opts) + { type: :period, value: value, loc: location }.to_json(*opts) end end @@ -6333,19 +6268,6 @@ def initialize(value:, location:) @value = value @location = location end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('qsymbols_beg') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :@qsymbols_beg, value: value, loc: location }.to_json(*opts) - end end # :call-seq: @@ -6426,19 +6348,6 @@ def initialize(value:, location:) @value = value @location = location end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('qwords_beg') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :@qwords_beg, value: value, loc: location }.to_json(*opts) - end end # :call-seq: @@ -6462,11 +6371,11 @@ def on_qwords_new QWords.new(elements: [], location: qwords_beg.location) end - # Rational represents the use of a rational number literal. + # RationalLiteral represents the use of a rational number literal. # # 1r # - class Rational + class RationalLiteral # [String] the rational number literal attr_reader :value @@ -6488,15 +6397,15 @@ def pretty_print(q) end def to_json(*opts) - { type: :@rational, value: value, loc: location }.to_json(*opts) + { type: :rational, value: value, loc: location }.to_json(*opts) end end # :call-seq: - # on_rational: (String value) -> Rational + # on_rational: (String value) -> RationalLiteral def on_rational(value) node = - Rational.new( + RationalLiteral.new( value: value, location: Location.token(line: lineno, char: char_pos, size: value.size) ) @@ -6517,19 +6426,6 @@ def initialize(value:, location:) @value = value @location = location end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('rbrace') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :@rbrace, value: value, loc: location }.to_json(*opts) - end end # :call-seq: @@ -6557,19 +6453,6 @@ def initialize(value:, location:) @value = value @location = location end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('rbracket') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :@rbracket, value: value, loc: location }.to_json(*opts) - end end # :call-seq: @@ -6645,21 +6528,6 @@ def initialize(beginning:, parts:, location:) @parts = parts @location = location end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('regexp') - - q.breakable - q.group(2, '(', ')') { q.seplist(parts) { |part| q.pp(part) } } - end - end - - def to_json(*opts) - { type: :regexp, beging: beginning, parts: parts, loc: location }.to_json( - *opts - ) - end end # :call-seq: @@ -6695,19 +6563,6 @@ def initialize(value:, location:) @value = value @location = location end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('regexp_beg') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :@regexp_beg, value: value, loc: location }.to_json(*opts) - end end # :call-seq: @@ -6744,19 +6599,6 @@ def initialize(value:, location:) @value = value @location = location end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('regexp_end') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :@regexp_end, value: value, loc: location }.to_json(*opts) - end end # :call-seq: @@ -7226,19 +7068,6 @@ def initialize(value:, location:) @value = value @location = location end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('rparen') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :@rparen, value: value, loc: location }.to_json(*opts) - end end # :call-seq: @@ -7341,7 +7170,7 @@ def on_stmts_add(statements, statement) # propagate that onto void_stmt nodes inside the stmts in order to make sure # all comments get printed appropriately. class Statements - # [Ripper::ParseTree] the parser that created this node + # [SyntaxTree] the parser that created this node attr_reader :parser # [Array[untyped]] the list of expressions contained within this node @@ -7409,7 +7238,7 @@ def pretty_print(q) end def to_json(*opts) - { type: :stmts, body: body, loc: location }.to_json(*opts) + { type: :statements, body: body, loc: location }.to_json(*opts) end private @@ -7417,7 +7246,7 @@ def to_json(*opts) def attach_comments(start_char, end_char) attachable = parser.comments.select do |comment| - comment.is_a?(Comment) && !comment.inline && + !comment.inline? && start_char <= comment.location.start_char && end_char >= comment.location.end_char && !comment.value.include?('prettier-ignore') @@ -7456,19 +7285,6 @@ def initialize(parts:, location:) @parts = parts @location = location end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('string') - - q.breakable - q.group(2, '(', ')') { q.seplist(parts) { |part| q.pp(part) } } - end - end - - def to_json(*opts) - { type: :string, parts: parts, loc: location }.to_json(*opts) - end end # :call-seq: @@ -7773,19 +7589,6 @@ def initialize(value:, location:) @value = value @location = location end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('symbeg') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :@symbeg, value: value, loc: location }.to_json(*opts) - end end # symbeg is a token that represents the beginning of a symbol literal. @@ -7819,19 +7622,6 @@ def initialize(value:, location:) @value = value @location = location end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('symbol') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :symbol, value: value, loc: location }.to_json(*opts) - end end # :call-seq: @@ -7954,19 +7744,6 @@ def initialize(value:, location:) @value = value @location = location end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('symbols_beg') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :@symbols_beg, value: value, loc: location }.to_json(*opts) - end end # :call-seq: @@ -8006,19 +7783,6 @@ def initialize(value:, location:) @value = value @location = location end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('tlambda') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :@tlambda, value: value, loc: location }.to_json(*opts) - end end # :call-seq: @@ -8051,19 +7815,6 @@ def initialize(value:, location:) @value = value @location = location end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('tlambeg') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :@tlambeg, value: value, loc: location }.to_json(*opts) - end end # :call-seq: @@ -8187,19 +7938,6 @@ def initialize(value:, location:) @value = value @location = location end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('tstring_beg') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :@tstring_beg, value: value, loc: location }.to_json(*opts) - end end # :call-seq: @@ -8246,7 +7984,7 @@ def pretty_print(q) def to_json(*opts) { - type: :@tstring_content, + type: :tstring_content, value: value.force_encoding('UTF-8'), loc: location }.to_json(*opts) @@ -8283,19 +8021,6 @@ def initialize(value:, location:) @value = value @location = location end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('tstring_end') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :@tstring_end, value: value, loc: location }.to_json(*opts) - end end # :call-seq: @@ -8342,8 +8067,7 @@ def pretty_print(q) def to_json(*opts) { - type: :unary, - op: :not, + type: :not, value: statement, paren: parentheses, loc: location @@ -8829,7 +8553,7 @@ def on_var_field(value) # VarRef represents a variable reference. # - # variable + # true # # This can be a plain local variable like the example above. It can also be a # constant, a class variable, a global variable, an instance variable, a @@ -9170,7 +8894,7 @@ def on_while_mod(predicate, statement) # Word represents an element within a special array literal that accepts # interpolation. # - # %w[a#{b}c xyz] + # %W[a#{b}c xyz] # # In the example above, there would be two Word nodes within a parent Words # node. @@ -9276,19 +9000,6 @@ def initialize(value:, location:) @value = value @location = location end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('words_beg') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :@words_beg, value: value, loc: location }.to_json(*opts) - end end # :call-seq: @@ -9332,19 +9043,6 @@ def initialize(parts:, location:) @parts = parts @location = location end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('xstring') - - q.breakable - q.group(2, '(', ')') { q.seplist(parts) { |part| q.pp(part) } } - end - end - - def to_json(*opts) - { type: :xstring, parts: parts, loc: location }.to_json(*opts) - end end # :call-seq: diff --git a/src/ruby/printer.ts b/src/ruby/printer.ts index a94247c8..5597db35 100644 --- a/src/ruby/printer.ts +++ b/src/ruby/printer.ts @@ -48,7 +48,7 @@ const printer: Plugin.PrinterConfig = { // *feels* like a block comment equivalent in JavaScript so I'm going to leave // it in place for now. isBlockComment(comment) { - return comment.type === "@embdoc"; + return comment.type === "embdoc"; }, // This function handles adding the format pragma to a source string. This is // an optional workflow for incremental adoption. @@ -75,7 +75,7 @@ const printer: Plugin.PrinterConfig = { printComment(path) { const comment = (path as any as Plugin.Path).getValue(); - if (comment.type === "@comment") { + if (comment.type === "comment") { return `#${comment.value}`; } diff --git a/src/ruby/toProc.ts b/src/ruby/toProc.ts index 96ea5a2d..aba4c4c9 100644 --- a/src/ruby/toProc.ts +++ b/src/ruby/toProc.ts @@ -7,7 +7,7 @@ function isPeriod(node: Ruby.CallOperator) { return true; } - return node.type === "@period"; + return node.type === "period"; } // If you have a simple block that only calls a method on the single required @@ -75,7 +75,7 @@ function toProc( call.receiver.value.value !== params.reqs[0].value || !isPeriod(call.op) || call.message === "call" || - call.message.type !== "@ident" + call.message.type !== "ident" ) { return null; } @@ -96,7 +96,7 @@ function toProc( const assocNode = parentNode as Ruby.AssocNew; const key = assocNode.key; - if (key.type === "@label" && ["if:", "unless:"].includes(key.value)) { + if (key.type === "label" && ["if:", "unless:"].includes(key.value)) { return null; } diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 801dc330..69084bce 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -6,23 +6,25 @@ type Comments = { comments?: Comment[] }; export type Location = [number, number, number, number]; // These are utility types used to construct the various node types. -type ScannerEvent = { type: `@${T}`, value: string, loc: Location } & Comments; +type ScannerEvent = { type: T, value: string, loc: Location } & Comments; type ParserEvent0 = { type: T, value: string, loc: Location } & Comments; type ParserEvent> = { type: T, loc: Location } & Comments & V; // This is the main expression type that goes in places where the AST will // accept just about anything. // eslint-disable-next-line @typescript-eslint/ban-types -export type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgParen | Args | ArgsAddBlock | ArgsAddStar | ArgsForward | Array | Aryptn | Assign | AssocNew | AssocSplat | AssoclistFromArgs | BEGIN | Backref | Backtick | BareAssocHash | Begin | Binary | BlockVar | Blockarg | Bodystmt | BraceBlock | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | Defsl | DoBlock | Dot2 | Dot3 | DynaSymbol | END | Else | Elsif | EndContent | Ensure | ExcessedComma | Fcall | Field | Float | FndPtn | For | GVar | Hash | Heredoc | HeredocBegin | Hshptn | IVar | Identifier | If | IfModifier | Imaginary | In | Int | Keyword | KeywordRestParam | Label | Lambda | Lbrace | Lparen | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Op | Opassign | Params | Paren | Period | Program | Qwords | Qsymbols | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueEx | RescueModifier | RestParam | Retry | Return | Return0 | Sclass | Stmts | StringConcat | StringDVar | StringEmbExpr | StringLiteral | Super | Symbols | SymbolLiteral | TStringContent | Ternary | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VCall | VarAlias | VarField | VarRef | VoidStmt | When | While | WhileModifier | Word | Words | XStringLiteral | Yield | Yield0 | Zsuper +export type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgParen | Args | ArgsAddBlock | ArgsAddStar | ArgsForward | Array | Aryptn | Assign | AssocNew | AssocSplat | AssoclistFromArgs | BEGIN | Backref | Backtick | BareAssocHash | Begin | Binary | BlockVar | Blockarg | Bodystmt | BraceBlock | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | DefEndless | DoBlock | Dot2 | Dot3 | DynaSymbol | END | Else | Elsif | EndContent | Ensure | ExcessedComma | Fcall | Field | Float | FndPtn | For | GVar | Hash | Heredoc | HeredocBegin | Hshptn | IVar | Identifier | If | IfModifier | Imaginary | In | Int | Keyword | KeywordRestParam | Label | Lambda | Lbrace | Lparen | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Not | Op | Opassign | Params | Paren | Period | Program | Qwords | Qsymbols | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueEx | RescueModifier | RestParam | Retry | Return | Return0 | Sclass | Statements | StringConcat | StringDVar | StringEmbExpr | StringLiteral | Super | Symbols | SymbolLiteral | TStringContent | Ternary | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VCall | VarAlias | VarField | VarRef | VoidStmt | When | While | WhileModifier | Word | Words | XStringLiteral | Yield | Yield0 | Zsuper // This is a special scanner event that contains a comment. It can be attached // to almost any kind of node, which is why it's pulled out here separately. -type UndecoratedComment = { type: "@comment", value: string, inline: boolean, loc: Location }; +type UndecoratedComment = { type: "comment", value: string, inline: boolean, loc: Location }; +type UndecoratedEmbDoc = { type: "embdoc", value: string, loc: Location }; // Prettier will attach various metadata to comment nodes, which we're adding in // to the type here. type CommentDecorations = { leading: boolean, printed: boolean }; export type Comment = UndecoratedComment & CommentDecorations; +export type EmbDoc = UndecoratedEmbDoc & CommentDecorations; // These are the scanner events that contain only a single string. They're // always leaves in the tree. Ignored ones that can't show up in the tree but @@ -90,7 +92,7 @@ export type Heredoc = ParserEvent<"heredoc", { beging: HeredocBegin, ending: str export type RegexpLiteral = ParserEvent<"regexp_literal", { parts: StringContent[], beging: string, ending: string }>; export type StringConcat = ParserEvent<"string_concat", { left: StringConcat | StringLiteral, right: StringLiteral }>; export type StringDVar = ParserEvent<"string_dvar", { var: Backref | VarRef }>; -export type StringEmbExpr = ParserEvent<"string_embexpr", { stmts: Stmts }>; +export type StringEmbExpr = ParserEvent<"string_embexpr", { stmts: Statements }>; export type StringLiteral = ParserEvent<"string_literal", { parts: StringContent[], quote: string }>; export type SymbolLiteral = ParserEvent<"symbol_literal", { value: Backtick | Const | CVar | GVar | Identifier | IVar | Keyword | Op }>; export type XStringLiteral = ParserEvent<"xstring_literal", { parts: StringContent[] }>; @@ -133,23 +135,23 @@ export type MrhsNewFromArgs = ParserEvent<"mrhs_new_from_args", { args: Args | A // These are various parser events for control flow constructs. export type Case = ParserEvent<"case", { value: AnyNode, cons: In | When }>; -export type Else = ParserEvent<"else", { stmts: Stmts }>; -export type Elsif = ParserEvent<"elsif", { pred: AnyNode, stmts: Stmts, cons: null | Elsif | Else }>; -export type Ensure = ParserEvent<"ensure", { keyword: Keyword, stmts: Stmts }>; -export type For = ParserEvent<"for", { index: Mlhs | MlhsAddStar | VarField, collection: AnyNode, stmts: Stmts }>; -export type If = ParserEvent<"if", { pred: AnyNode, stmts: Stmts, cons: null | Elsif | Else }>; +export type Else = ParserEvent<"else", { stmts: Statements }>; +export type Elsif = ParserEvent<"elsif", { pred: AnyNode, stmts: Statements, cons: null | Elsif | Else }>; +export type Ensure = ParserEvent<"ensure", { keyword: Keyword, stmts: Statements }>; +export type For = ParserEvent<"for", { index: Mlhs | MlhsAddStar | VarField, collection: AnyNode, stmts: Statements }>; +export type If = ParserEvent<"if", { pred: AnyNode, stmts: Statements, cons: null | Elsif | Else }>; export type IfModifier = ParserEvent<"if_mod", { pred: AnyNode, stmt: AnyNode }>; -export type In = ParserEvent<"in", { pattern: AnyNode, stmts: Stmts, cons: null | In | Else }>; -export type Rescue = ParserEvent<"rescue", { extn: null | RescueEx, stmts: Stmts, cons: null | Rescue }>; +export type In = ParserEvent<"in", { pattern: AnyNode, stmts: Statements, cons: null | In | Else }>; +export type Rescue = ParserEvent<"rescue", { extn: null | RescueEx, stmts: Statements, cons: null | Rescue }>; export type RescueEx = ParserEvent<"rescue_ex", { extns: AnyNode, var: null | Field | VarField }>; export type RescueModifier = ParserEvent<"rescue_mod", { stmt: AnyNode, value: AnyNode }>; export type Ternary = ParserEvent<"ifop", { pred: AnyNode, tthy: AnyNode, flsy: AnyNode }>; -export type Unless = ParserEvent<"unless", { pred: AnyNode, stmts: Stmts, cons: null | Elsif | Else }>; +export type Unless = ParserEvent<"unless", { pred: AnyNode, stmts: Statements, cons: null | Elsif | Else }>; export type UnlessModifier = ParserEvent<"unless_mod", { pred: AnyNode, stmt: AnyNode }>; -export type Until = ParserEvent<"until", { pred: AnyNode, stmts: Stmts }>; +export type Until = ParserEvent<"until", { pred: AnyNode, stmts: Statements }>; export type UntilModifier = ParserEvent<"until_mod", { pred: AnyNode, stmt: AnyNode }>; -export type When = ParserEvent<"when", { args: Args | ArgsAddStar, stmts: Stmts, cons: null | Else | When }>; -export type While = ParserEvent<"while", { pred: AnyNode, stmts: Stmts }>; +export type When = ParserEvent<"when", { args: Args | ArgsAddStar, stmts: Statements, cons: null | Else | When }>; +export type While = ParserEvent<"while", { pred: AnyNode, stmts: Statements }>; export type WhileModifier = ParserEvent<"while_mod", { pred: AnyNode, stmt: AnyNode }>; // These are various parser events for control flow keywords. @@ -172,9 +174,9 @@ type ParenAroundParams = Omit & { cnts: Params }; export type Blockarg = ParserEvent<"blockarg", { name: Identifier }>; export type Def = ParserEvent<"def", { name: DefName, params: Params | Paren, bodystmt: Bodystmt }>; export type Defs = ParserEvent<"defs", { target: AnyNode, op: Op | Period, name: DefName, params: Params | Paren, bodystmt: Bodystmt }>; -export type Defsl = ParserEvent<"defsl", { name: DefName, paren: null | ParenAroundParams, stmt: AnyNode }>; +export type DefEndless = ParserEvent<"def_endless", { name: DefName, paren: null | ParenAroundParams, stmt: AnyNode }>; export type KeywordRestParam = ParserEvent<"kwrest_param", { name: null | Identifier }>; -export type Lambda = ParserEvent<"lambda", { params: Params | ParenAroundParams, stmts: Bodystmt | Stmts }>; +export type Lambda = ParserEvent<"lambda", { params: Params | ParenAroundParams, stmts: Bodystmt | Statements }>; export type Params = ParserEvent<"params", { reqs: Identifier[], opts: [Identifier, AnyNode][], rest: null | ArgsForward | ExcessedComma | RestParam, posts: Identifier[], keywords: [Label, AnyNode][], kwrest: null | "nil" | KeywordRestParam, block: null | Blockarg }>; export type RestParam = ParserEvent<"rest_param", { name: null | Identifier }>; @@ -185,7 +187,7 @@ export type Args = ParserEvent<"args", { parts: AnyNode[] }>; export type ArgsAddBlock = ParserEvent<"args_add_block", { args: Args | ArgsAddStar, block: null | AnyNode }>; export type ArgsAddStar = ParserEvent<"args_add_star", { args: Args | ArgsAddStar, star: AnyNode }>; export type BlockVar = ParserEvent<"block_var", { params: Params, locals: Identifier[] }>; -export type BraceBlock = ParserEvent<"brace_block", { lbrace: Lbrace, block_var: null | BlockVar, stmts: Stmts }>; +export type BraceBlock = ParserEvent<"brace_block", { lbrace: Lbrace, block_var: null | BlockVar, stmts: Statements }>; export type Call = ParserEvent<"call", { receiver: AnyNode, op: CallOperator, message: Backtick | Op | Identifier | Const | "call" }>; export type Command = ParserEvent<"command", { message: Const | Identifier, args: Args | ArgsAddBlock }>; export type CommandCall = ParserEvent<"command_call", { receiver: AnyNode, op: CallOperator, message: Op | Identifier | Const, args: Args | ArgsAddBlock }>; @@ -198,17 +200,18 @@ export type VCall = ParserEvent<"vcall", { value: Identifier }>; // These are various parser events for statements you would find in a method body. type Dot = { left: AnyNode, right: AnyNode } | { left: null, right: AnyNode } | { left: AnyNode, right: null }; export type Aref = ParserEvent<"aref", { collection: AnyNode, index: Args | ArgsAddBlock | null }>; -export type BEGIN = ParserEvent<"BEGIN", { lbrace: Lbrace, stmts: Stmts }>; +export type BEGIN = ParserEvent<"BEGIN", { lbrace: Lbrace, stmts: Statements }>; export type Binary = ParserEvent<"binary", { left: AnyNode, op: string, right: AnyNode }>; export type ConstPathRef = ParserEvent<"const_path_ref", { parent: AnyNode, constant: Const }>; export type ConstRef = ParserEvent<"const_ref", { constant: Const }>; export type Defined = ParserEvent<"defined", { value: AnyNode }>; export type Dot2 = ParserEvent<"dot2", Dot>; export type Dot3 = ParserEvent<"dot3", Dot>; -export type END = ParserEvent<"END", { lbrace: Lbrace, stmts: Stmts }>; +export type END = ParserEvent<"END", { lbrace: Lbrace, stmts: Statements }>; +export type Not = ParserEvent<"not", { value: AnyNode, paren: boolean }>; export type Paren = ParserEvent<"paren", { lparen: Lparen, cnts: AnyNode }>; export type TopConstRef = ParserEvent<"top_const_ref", { constant: Const }>; -export type Unary = ParserEvent<"unary", { value: AnyNode, op: string, paren: boolean | undefined }>; +export type Unary = ParserEvent<"unary", { value: AnyNode, op: string }>; export type VarRef = ParserEvent<"var_ref", { value: Const | CVar | GVar | Identifier | IVar | Keyword }>; // These are various parser events for statements you would find in a class definition body. @@ -222,6 +225,6 @@ export type Undef = ParserEvent<"undef", { syms: (DynaSymbol | SymbolLiteral)[] // These are various parser events for statement containers, generally pretty high in the tree. export type Begin = ParserEvent<"begin", { bodystmt: Bodystmt }>; -export type Bodystmt = ParserEvent<"bodystmt", { stmts: Stmts, rsc: null | Rescue, els: null | Stmts, ens: null | Ensure }>; -export type Program = ParserEvent<"program", { stmts: Stmts }>; -export type Stmts = ParserEvent<"stmts", { body: AnyNode[] }>; +export type Bodystmt = ParserEvent<"bodystmt", { stmts: Statements, rsc: null | Rescue, els: null | Statements, ens: null | Ensure }>; +export type Program = ParserEvent<"program", { stmts: Statements }>; +export type Statements = ParserEvent<"statements", { body: AnyNode[] }>; diff --git a/src/utils/containsAssignment.ts b/src/utils/containsAssignment.ts index ccc7e350..cb9e9cfe 100644 --- a/src/utils/containsAssignment.ts +++ b/src/utils/containsAssignment.ts @@ -3,7 +3,7 @@ import getChildNodes from "./getChildNodes"; // If the node is a type of assignment or if the node is a paren and nested // inside that paren is a node that is a type of assignment. -function containsAssignment(node: null | Ruby.AnyNode | Ruby.Stmts) { +function containsAssignment(node: null | Ruby.AnyNode | Ruby.Statements) { if (!node) { return false; } diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 1e83d264..eaafa027 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -10,27 +10,27 @@ function throwBadNode(node: AnyNode) { function getChildNodes(node: AnyNode): ChildNode[] { switch (node.type) { - case "@CHAR": - case "@__end__": - case "@backref": - case "@backtick": - case "@const": - case "@cvar": - case "@float": - case "@gvar": - case "@heredoc_beg": - case "@ident": - case "@imaginary": - case "@int": - case "@ivar": - case "@kw": - case "@label": - case "@lbrace": - case "@lparen": - case "@op": - case "@period": - case "@rational": - case "@tstring_content": + case "CHAR": + case "__end__": + case "backref": + case "backtick": + case "const": + case "cvar": + case "float": + case "gvar": + case "heredoc_beg": + case "ident": + case "imaginary": + case "int": + case "ivar": + case "kw": + case "label": + case "lbrace": + case "lparen": + case "op": + case "period": + case "rational": + case "tstring_content": return []; case "BEGIN": return [node.lbrace, node.stmts]; @@ -111,6 +111,8 @@ function getChildNodes(node: AnyNode): ChildNode[] { return [node.constant]; case "def": return [node.name, node.params, node.bodystmt]; + case "def_endless": + return [node.name, node.paren, node.stmt]; case "defined": return [node.value]; case "defs": @@ -121,8 +123,6 @@ function getChildNodes(node: AnyNode): ChildNode[] { node.params, node.bodystmt ]; - case "defsl": - return [node.name, node.paren, node.stmt]; case "do_block": return [node.keyword, node.block_var, node.bodystmt]; case "dot2": @@ -205,6 +205,8 @@ function getChildNodes(node: AnyNode): ChildNode[] { return [node.args]; case "next": return [node.args]; + case "not": + return [node.value]; case "opassign": return [node.target, node.op, node.value]; case "params": { @@ -265,7 +267,7 @@ function getChildNodes(node: AnyNode): ChildNode[] { return []; case "sclass": return [node.target, node.bodystmt]; - case "stmts": + case "statements": return node.body; case "string_concat": return [node.left, node.right]; diff --git a/src/utils/isEmptyStmts.ts b/src/utils/isEmptyStmts.ts index cd95e7b4..b80a7265 100644 --- a/src/utils/isEmptyStmts.ts +++ b/src/utils/isEmptyStmts.ts @@ -1,9 +1,9 @@ import type { Ruby } from "../types"; -function isEmptyStmts(node: Ruby.AnyNode | Ruby.Stmts) { +function isEmptyStmts(node: Ruby.AnyNode | Ruby.Statements) { return ( node && - node.type === "stmts" && + node.type === "statements" && node.body.length === 1 && node.body[0].type === "void_stmt" && !node.body[0].comments From 49703b1400941415a161eadb94c6ea3f6802512b Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 16 Nov 2021 18:09:43 -0500 Subject: [PATCH 421/785] Run through prettier --- src/ruby/nodes.ts | 11 ++- src/ruby/nodes/massign.ts | 8 ++- src/ruby/nodes/patterns.ts | 5 +- src/ruby/nodes/statements.ts | 6 +- src/ruby/parser.rb | 126 ++++++++++++++++++----------------- src/utils/getChildNodes.ts | 8 +-- 6 files changed, 85 insertions(+), 79 deletions(-) diff --git a/src/ruby/nodes.ts b/src/ruby/nodes.ts index cf163fc4..5ac252bf 100644 --- a/src/ruby/nodes.ts +++ b/src/ruby/nodes.ts @@ -71,11 +71,7 @@ import { printMRHSAddStar, printMRHSNewFromArgs } from "./nodes/massign"; -import { - printAccessControl, - printDef, - printDefEndless -} from "./nodes/methods"; +import { printAccessControl, printDef, printDefEndless } from "./nodes/methods"; import { printBinary, printDot2, @@ -154,7 +150,10 @@ type Token = const printToken: Plugin.Printer = (path) => path.getValue().value; const printVoidStmt: Plugin.Printer = () => ""; -const nodes: Record> = { +const nodes: Record< + Ruby.AnyNode["type"] | "comment" | "embdoc", + Plugin.Printer +> = { BEGIN: printBEGIN, CHAR: printChar, END: printEND, diff --git a/src/ruby/nodes/massign.ts b/src/ruby/nodes/massign.ts index 0912a5a6..1f1d4a4c 100644 --- a/src/ruby/nodes/massign.ts +++ b/src/ruby/nodes/massign.ts @@ -11,11 +11,15 @@ export const printMAssign: Plugin.Printer = ( const node = path.getValue(); let valueDoc = path.call(print, "value"); - if (["mrhs", "mrhs_add_star", "mrhs_new_from_args"].includes(node.value.type)) { + if ( + ["mrhs", "mrhs_add_star", "mrhs_new_from_args"].includes(node.value.type) + ) { valueDoc = group(join([",", line], valueDoc)); } - const targetDoc: Plugin.Doc[] = [join([",", line], path.call(print, "target"))]; + const targetDoc: Plugin.Doc[] = [ + join([",", line], path.call(print, "target")) + ]; if (node.target.type === "mlhs" && node.target.comma) { targetDoc.push(","); } diff --git a/src/ruby/nodes/patterns.ts b/src/ruby/nodes/patterns.ts index 52567be5..3280113f 100644 --- a/src/ruby/nodes/patterns.ts +++ b/src/ruby/nodes/patterns.ts @@ -137,7 +137,10 @@ export const printIn: Plugin.Printer = (path, opts, print) => { keyword, align( keyword.length, - path.call((valuePath) => printPatternArg(valuePath, opts, print), "pattern") + path.call( + (valuePath) => printPatternArg(valuePath, opts, print), + "pattern" + ) ), indent([hardline, path.call(print, "stmts")]) ]; diff --git a/src/ruby/nodes/statements.ts b/src/ruby/nodes/statements.ts index 45b358af..986b6528 100644 --- a/src/ruby/nodes/statements.ts +++ b/src/ruby/nodes/statements.ts @@ -100,7 +100,11 @@ type StmtsVoidWithComments = Ruby.Statements & { body: [{ type: "void_stmt"; comments: Ruby.Comment[] }]; }; -export const printStatements: Plugin.Printer = (path, opts, print) => { +export const printStatements: Plugin.Printer = ( + path, + opts, + print +) => { const stmts = path.getValue().body; // This is a special case where we have only comments inside a statement diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 16217531..8608df75 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'ripper' +# require_relative 'syntax_tree/version' class SyntaxTree < Ripper # Represents a line in the source. If this class is being used, it means that @@ -48,10 +49,8 @@ def initialize(start_line:, start_char:, end_line:, end_char:) end def ==(other) - other.is_a?(Location) && - start_line == other.start_line && - start_char == other.start_char && - end_line == other.end_line && + other.is_a?(Location) && start_line == other.start_line && + start_char == other.start_char && end_line == other.end_line && end_char == other.end_char end @@ -726,7 +725,7 @@ def on_arg_paren(arguments) # method(first, second, third) # class Args - # Array[untyped] the arguments that this node wraps + # [Array[ untyped ]] the arguments that this node wraps attr_reader :parts # [Location] the location of this node @@ -960,7 +959,7 @@ def on_args_new # child contents node of this ArrayLiteral node would be nil, Args, # ArgsAddStar, QSymbols, QWords, Symbols, and Words. class ArrayLiteral - # [nil | Args | ArgsAddStar | Qsymbols | Qwords | Symbols | Words] the + # [nil | Args | ArgsAddStar | QSymbols | QWords | Symbols | Words] the # contents of the array attr_reader :contents @@ -987,7 +986,7 @@ def to_json(*opts) # :call-seq: # on_array: ( - # (nil | Args | ArgsAddStar | Qsymbols | Qwords | Symbols | Words) + # (nil | Args | ArgsAddStar | QSymbols | QWords | Symbols | Words) # contents # ) -> ArrayLiteral def on_array(contents) @@ -1032,15 +1031,15 @@ class AryPtn # [nil | VarRef] the optional constant wrapper attr_reader :constant - # [Array[untyped]] the regular positional arguments that this array pattern - # is matching against + # [Array[ untyped ]] the regular positional arguments that this array + # pattern is matching against attr_reader :requireds # [nil | VarField] the optional starred identifier that grabs up a list of # positional arguments attr_reader :rest - # [Array[untyped]] the list of positional arguments occurring after the + # [Array[ untyped ]] the list of positional arguments occurring after the # optional star if there is one attr_reader :posts @@ -1121,7 +1120,7 @@ def on_aryptn(constant, requireds, rest, posts) # variable = value # class Assign - # [ArefField | ConstPathField | Field | TopConstField | VarField] the target + # [ARefField | ConstPathField | Field | TopConstField | VarField] the target # to assign the result of the expression to attr_reader :target @@ -1156,7 +1155,7 @@ def to_json(*opts) # :call-seq: # on_assign: ( - # (ArefField | ConstPathField | Field | TopConstField | VarField) target, + # (ARefField | ConstPathField | Field | TopConstField | VarField) target, # untyped value # ) -> Assign def on_assign(target, value) @@ -1258,7 +1257,7 @@ def on_assoc_splat(value) # { key1: value1, key2: value2 } # class AssocListFromArgs - # [Array[AssocNew | AssocSplat]] + # [Array[ AssocNew | AssocSplat ]] attr_reader :assocs # [Location] the location of this node @@ -1386,7 +1385,7 @@ def on_backtick(value) # method(key1: value1, key2: value2) # class BareAssocHash - # [Array[AssocNew | AssocSplat]] + # [Array[ AssocNew | AssocSplat ]] attr_reader :assocs # [Location] the location of this node @@ -1531,9 +1530,7 @@ def on_binary(left, operator, right) # `operator` object would be `:<`. However, on JRuby, it's an `@op` node, # so here we're going to explicitly convert it into the same normalized # form. - unless operator.is_a?(Symbol) - operator = tokens.delete(operator).value - end + operator = tokens.delete(operator).value unless operator.is_a?(Symbol) Binary.new( left: left, @@ -1554,7 +1551,7 @@ class BlockVar # [Params] the parameters being declared with the block attr_reader :params - # [Array[Ident]] the list of block-local variable declarations + # [Array[ Ident ]] the list of block-local variable declarations attr_reader :locals # [Location] the location of this node @@ -2066,9 +2063,7 @@ def on_case(value, consequent) location: keyword.location.to(consequent.location) ) else - operator = - find_token(Kw, 'in', consume: false) || - find_token(Op, '=>') + operator = find_token(Kw, 'in', consume: false) || find_token(Op, '=>') RAssign.new( value: value, @@ -2645,7 +2640,7 @@ def on_cvar(value) # def method(param) result end # class Def - # [Backtick | Const | Ident | Keyword | Op] the name of the method + # [Backtick | Const | Ident | Kw | Op] the name of the method attr_reader :name # [Params | Paren] the parameter declaration for the method @@ -2695,7 +2690,7 @@ def to_json(*opts) # def method = result # class DefEndless - # [Backtick | Const | Ident | Keyword | Op] the name of the method + # [Backtick | Const | Ident | Kw | Op] the name of the method attr_reader :name # [Paren] the parameter declaration for the method @@ -2742,7 +2737,7 @@ def to_json(*opts) # :call-seq: # on_def: ( - # (Backtick | Const | Ident | Keyword | Op) name, + # (Backtick | Const | Ident | Kw | Op) name, # (Params | Paren) params, # untyped bodystmt # ) -> Def | DefEndless @@ -2854,7 +2849,7 @@ class Defs # [Op | Period] the operator being used to declare the method attr_reader :operator - # [Backtick | Const | Ident | Keyword | Op] the name of the method + # [Backtick | Const | Ident | Kw | Op] the name of the method attr_reader :name # [Params | Paren] the parameter declaration for the method @@ -2913,7 +2908,7 @@ def to_json(*opts) # on_defs: ( # untyped target, # (Op | Period) operator, - # (Backtick | Const | Ident | Keyword | Op) name, + # (Backtick | Const | Ident | Kw | Op) name, # (Params | Paren) params, # BodyStmt bodystmt # ) -> Defs @@ -3163,7 +3158,7 @@ def on_dot3(left, right) # { "#{key}": value } # class DynaSymbol - # [Array[StringDVar | StringEmbExpr | TStringContent]] the parts of the + # [Array[ StringDVar | StringEmbExpr | TStringContent ]] the parts of the # dynamic symbol attr_reader :parts @@ -3796,7 +3791,7 @@ class FndPtn # [VarField] the splat on the left-hand side attr_reader :left - # [Array[untyped]] the list of positional expressions in the pattern that + # [Array[ untyped ]] the list of positional expressions in the pattern that # are being matched attr_reader :values @@ -4061,7 +4056,7 @@ class Heredoc # [String] the ending of the heredoc attr_reader :ending - # [Array[StringEmbExpr | StringDVar | TStringContent]] the parts of the + # [Array[ StringEmbExpr | StringDVar | TStringContent ]] the parts of the # heredoc string literal attr_reader :parts @@ -4187,8 +4182,8 @@ class HshPtn # [nil | untyped] the optional constant wrapper attr_reader :constant - # [Array[[Label, untyped]]] the set of tuples representing the keywords that - # should be matched against in the pattern + # [Array[ [Label, untyped] ]] the set of tuples representing the keywords + # that should be matched against in the pattern attr_reader :keywords # [nil | VarField] an optional parameter to gather up all remaining keywords @@ -5106,7 +5101,9 @@ def pretty_print(q) end def to_json(*opts) - { type: :massign, target: target, value: value, loc: location }.to_json(*opts) + { type: :massign, target: target, value: value, loc: location }.to_json( + *opts + ) end end @@ -5253,7 +5250,7 @@ def on_method_add_block(call, block) # first, second, third = value # class MLHS - # Array[ArefField | Field | Identifier | MlhsParen | VarField] the parts of + # Array[ARefField | Field | Ident | MlhsParen | VarField] the parts of # the left-hand side of a multiple assignment attr_reader :parts @@ -5288,7 +5285,7 @@ def to_json(*opts) # :call-seq: # on_mlhs_add: ( # MLHS mlhs, - # (ArefField | Field | Identifier | MlhsParen | VarField) part + # (ARefField | Field | Ident | MlhsParen | VarField) part # ) -> MLHS def on_mlhs_add(mlhs, part) if mlhs.parts.empty? @@ -5360,7 +5357,7 @@ class MLHSAddStar # [MLHS] the values before the starred expression attr_reader :mlhs - # [nil | ArefField | Field | Identifier | VarField] the expression being + # [nil | ARefField | Field | Ident | VarField] the expression being # splatted attr_reader :star @@ -5395,7 +5392,7 @@ def to_json(*opts) # :call-seq: # on_mlhs_add_star: ( # MLHS mlhs, - # (nil | ArefField | Field | Identifier | VarField) part + # (nil | ARefField | Field | Ident | VarField) part # ) -> MLHSAddStar def on_mlhs_add_star(mlhs, part) beginning = find_token(Op, '*') @@ -5787,7 +5784,7 @@ def on_op(value) # variable += value # class OpAssign - # [ArefField | ConstPathField | Field | TopConstField | VarField] the target + # [ARefField | ConstPathField | Field | TopConstField | VarField] the target # to assign the result of the expression to attr_reader :target @@ -5835,7 +5832,7 @@ def to_json(*opts) # :call-seq: # on_opassign: ( - # (ArefField | ConstPathField | Field | TopConstField | VarField) target, + # (ARefField | ConstPathField | Field | TopConstField | VarField) target, # Op operator, # untyped value # ) -> OpAssign @@ -5857,21 +5854,23 @@ def on_opassign(target, operator, value) # def method(param) end # class Params - # [Array[Ident]] any required parameters + # [Array[ Ident ]] any required parameters attr_reader :requireds - # [Array[[Ident, untyped]]] any optional parameters and their default values + # [Array[ [ Ident, untyped ] ]] any optional parameters and their default + # values attr_reader :optionals # [nil | ArgsForward | ExcessedComma | RestParam] the optional rest # parameter attr_reader :rest - # Array[Ident] any positional parameters that exist after a rest parameter + # [Array[ Ident ]] any positional parameters that exist after a rest + # parameter attr_reader :posts - # Array[[Ident, nil | untyped]] any keyword parameters and their optional - # default values + # [Array[ [ Ident, nil | untyped ] ]] any keyword parameters and their + # optional default values attr_reader :keywords # [nil | :nil | KwRestParam] the optional keyword rest parameter @@ -6163,7 +6162,7 @@ class Program # [Statements] the top-level expressions of the program attr_reader :statements - # [Array[Comment | EmbDoc]] the comments inside the program + # [Array[ Comment | EmbDoc ]] the comments inside the program attr_reader :comments # [Location] the location of this node @@ -6216,7 +6215,7 @@ def on_program(statements) # %i[one two three] # class QSymbols - # [Array[TStringContent]] the elements of the array + # [Array[ TStringContent ]] the elements of the array attr_reader :elements # [Location] the location of this node @@ -6296,7 +6295,7 @@ def on_qsymbols_new # %w[one two three] # class QWords - # [Array[TStringContent]] the elements of the array + # [Array[ TStringContent ]] the elements of the array attr_reader :elements # [Location] the location of this node @@ -6516,7 +6515,7 @@ class RegexpContent # [String] the opening of the regular expression attr_reader :beginning - # [Array[StringDVar | StringEmbExpr | TStringContent]] the parts of the + # [Array[ StringDVar | StringEmbExpr | TStringContent ]] the parts of the # regular expression attr_reader :parts @@ -6621,7 +6620,7 @@ class RegexpLiteral # [String] the ending of the regular expression literal attr_reader :ending - # [Array[StringEmbExpr | StringDVar | TStringContent]] the parts of the + # [Array[ StringEmbExpr | StringDVar | TStringContent ]] the parts of the # regular expression literal attr_reader :parts @@ -6881,9 +6880,12 @@ def pretty_print(q) end def to_json(*opts) - { type: :rescue_mod, stmt: statement, value: value, loc: location }.to_json( - *opts - ) + { + type: :rescue_mod, + stmt: statement, + value: value, + loc: location + }.to_json(*opts) end end @@ -7173,7 +7175,7 @@ class Statements # [SyntaxTree] the parser that created this node attr_reader :parser - # [Array[untyped]] the list of expressions contained within this node + # [Array[ untyped ]] the list of expressions contained within this node attr_reader :body # [Location] the location of this node @@ -7246,8 +7248,7 @@ def to_json(*opts) def attach_comments(start_char, end_char) attachable = parser.comments.select do |comment| - !comment.inline? && - start_char <= comment.location.start_char && + !comment.inline? && start_char <= comment.location.start_char && end_char >= comment.location.end_char && !comment.value.include?('prettier-ignore') end @@ -7274,7 +7275,7 @@ def on_stmts_new # "string" # class StringContent - # [Array[StringEmbExpr | StringDVar | TStringContent]] the parts of the + # [Array[ StringEmbExpr | StringDVar | TStringContent ]] the parts of the # string attr_reader :parts @@ -7459,7 +7460,7 @@ def on_string_embexpr(statements) # "string" # class StringLiteral - # [Array[StringEmbExpr | StringDVar | TStringContent]] the parts of the + # [Array[ StringEmbExpr | StringDVar | TStringContent ]] the parts of the # string literal attr_reader :parts @@ -7691,7 +7692,7 @@ def on_symbol_literal(value) # %I[one two three] # class Symbols - # [Array[Word]] the words in the symbol array literal + # [Array[ Word ]] the words in the symbol array literal attr_reader :elements # [Location] the location of this node @@ -8166,7 +8167,7 @@ def on_unary(operator, statement) # undef method # class Undef - # [Array[DynaSymbol | SymbolLiteral]] the symbols to undefine + # [Array[ DynaSymbol | SymbolLiteral ]] the symbols to undefine attr_reader :symbols # [Location] the location of this node @@ -8899,7 +8900,8 @@ def on_while_mod(predicate, statement) # In the example above, there would be two Word nodes within a parent Words # node. class Word - # [Array[StringEmbExpr | StringDVar | TStringContent]] the parts of the word + # [Array[ StringEmbExpr | StringDVar | TStringContent ]] the parts of the + # word attr_reader :parts # [Location] the location of this node @@ -8947,7 +8949,7 @@ def on_word_new # %W[one two three] # class Words - # [Array[Word]] the elements of this array + # [Array[ Word ]] the elements of this array attr_reader :elements # [Location] the location of this node @@ -9032,7 +9034,7 @@ def on_words_new # `ls` # class XString - # [Array[StringEmbExpr | StringDVar | TStringContent]] the parts of the + # [Array[ StringEmbExpr | StringDVar | TStringContent ]] the parts of the # xstring attr_reader :parts @@ -9077,7 +9079,7 @@ def on_xstring_new # `ls` # class XStringLiteral - # [Array[StringEmbExpr | StringDVar | TStringContent]] the parts of the + # [Array[ StringEmbExpr | StringDVar | TStringContent ]] the parts of the # xstring attr_reader :parts diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index eaafa027..b0e21b94 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -116,13 +116,7 @@ function getChildNodes(node: AnyNode): ChildNode[] { case "defined": return [node.value]; case "defs": - return [ - node.target, - node.op, - node.name, - node.params, - node.bodystmt - ]; + return [node.target, node.op, node.name, node.params, node.bodystmt]; case "do_block": return [node.keyword, node.block_var, node.bodystmt]; case "dot2": From b973d3ac7a1490adb962aa55c9d5feb0c8aecc45 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 16 Nov 2021 19:41:28 -0500 Subject: [PATCH 422/785] Replace args_add_star with star --- bin/sexp | 2 +- src/ruby/nodes.ts | 6 +- src/ruby/nodes/args.ts | 55 +------- src/ruby/nodes/arrays.ts | 8 +- src/ruby/nodes/commands.ts | 6 +- src/ruby/nodes/return.ts | 8 -- src/ruby/nodes/statements.ts | 2 +- src/ruby/parser.rb | 90 ++++++------- src/ruby/printer.ts | 1 - src/types/ruby.ts | 12 +- src/utils/getChildNodes.ts | 4 +- test/rb/metadata_test.rb | 239 ++++++++++++++++------------------- 12 files changed, 172 insertions(+), 261 deletions(-) diff --git a/bin/sexp b/bin/sexp index 90c1e78a..348ec402 100755 --- a/bin/sexp +++ b/bin/sexp @@ -11,7 +11,7 @@ source = ARGV[0].gsub('\\n', "\n") end -parsed = Ripper::ParseTree.parse(source) +parsed = SyntaxTree.parse(source) puts '=== SOURCE === ' puts source diff --git a/src/ruby/nodes.ts b/src/ruby/nodes.ts index 5ac252bf..fe53b842 100644 --- a/src/ruby/nodes.ts +++ b/src/ruby/nodes.ts @@ -6,8 +6,8 @@ import { printArgParen, printArgs, printArgsAddBlock, - printArgsAddStar, - printBlockArg + printBlockArg, + printStar } from "./nodes/args"; import { printArray, @@ -165,7 +165,6 @@ const nodes: Record< arg_paren: printArgParen, args: printArgs, args_add_block: printArgsAddBlock, - args_add_star: printArgsAddStar, args_forward: printArgsForward, array: printArray, aryptn: printAryPtn, @@ -264,6 +263,7 @@ const nodes: Record< return0: printReturn0, return: printReturn, sclass: printSClass, + star: printStar, statements: printStatements, string_concat: printStringConcat, string_dvar: printStringDVar, diff --git a/src/ruby/nodes/args.ts b/src/ruby/nodes/args.ts index bfd73d78..72128eff 100644 --- a/src/ruby/nodes/args.ts +++ b/src/ruby/nodes/args.ts @@ -8,9 +8,7 @@ const { group, ifBreak, indent, join, line, softline } = prettier; const noTrailingComma = ["command", "command_call"]; -function getArgs( - node: Ruby.Args | Ruby.ArgsAddBlock | Ruby.ArgsAddStar -): Ruby.AnyNode[] { +function getArgs(node: Ruby.Args | Ruby.ArgsAddBlock): Ruby.AnyNode[] { switch (node.type) { case "args": return node.parts; @@ -18,8 +16,6 @@ function getArgs( const args = getArgs(node.args); return node.block ? [...args, node.block] : args; } - case "args_add_star": - return [...getArgs(node.args), node.star]; } } @@ -82,18 +78,7 @@ export const printArgs: Plugin.Printer = ( { rubyToProc }, print ) => { - let args: Plugin.Doc[] = []; - - // Loop through each part of this node and print out the docs for it. If it's - // an args_add_star, then we're going to flatten it into the main array so - // that we can get ome nice joining later. - path.each((partPath) => { - if (partPath.getValue().type === "args_add_star") { - args = args.concat(print(partPath)); - } else { - args.push(print(partPath)); - } - }, "parts"); + const args = path.map(print, "parts"); // Don't bother trying to do any kind of fancy toProc transform if the // option is disabled. @@ -169,38 +154,6 @@ export const printArgsAddBlock: Plugin.Printer = ( return parts; }; -export const printArgsAddStar: Plugin.Printer = ( - path, - opts, - print -) => { - const node = path.getValue(); - let doc = path.call(print, "star"); - - if (!(node.star.comments || []).some(({ leading }) => leading)) { - // If we don't have any leading comments, we can just prepend the operator. - doc = ["*", doc]; - } else { - // If we have an array like: - // - // [ - // # comment - // *values - // ] - // - // then we need to make sure we don't accidentally prepend the operator - // before the comment(s). - // - // In prettier >= 2.3.0, the comments are printed as an array before the - // content. I don't love this kind of reflection, but it's the simplest way - // at the moment to get this right. - const docs = doc as [Plugin.Doc[], ...Plugin.Doc[]]; - doc = docs[0].concat(["*", docs[1]], docs.slice(2)); - } - - return [...(path.call(print, "args") as Plugin.Doc[]), doc]; -}; - export const printBlockArg: Plugin.Printer = ( path, opts, @@ -208,3 +161,7 @@ export const printBlockArg: Plugin.Printer = ( ) => { return ["&", path.call(print, "name")]; }; + +export const printStar: Plugin.Printer = (path, opts, print) => { + return ["*", path.call(print, "value")]; +}; diff --git a/src/ruby/nodes/arrays.ts b/src/ruby/nodes/arrays.ts index 1e40a6bb..f3793f4e 100644 --- a/src/ruby/nodes/arrays.ts +++ b/src/ruby/nodes/arrays.ts @@ -10,9 +10,8 @@ const { group, ifBreak, indent, join, line, softline } = prettier; // // ['a', 'b', 'c'] // -function isStringArray(args: Ruby.Args | Ruby.ArgsAddStar) { +function isStringArray(args: Ruby.Args) { return ( - args.type === "args" && args.parts.length > 1 && args.parts.every((arg) => { // We want to verify that every node inside of this array is a string @@ -49,9 +48,8 @@ function isStringArray(args: Ruby.Args | Ruby.ArgsAddStar) { // // [:a, :b, :c] // -function isSymbolArray(args: Ruby.Args | Ruby.ArgsAddStar) { +function isSymbolArray(args: Ruby.Args) { return ( - args.type === "args" && args.parts.length > 1 && args.parts.every((arg) => arg.type === "symbol_literal" && !arg.comments) ); @@ -104,7 +102,7 @@ export const printArray: Plugin.Printer = (path, opts, print) => { // If we don't have a regular args node at this point then we have a special // array literal. In that case we're going to print out just the contents. - if (contents.type !== "args" && contents.type !== "args_add_star") { + if (contents.type !== "args") { return path.call(print, "cnts"); } diff --git a/src/ruby/nodes/commands.ts b/src/ruby/nodes/commands.ts index b42a5a09..56610a46 100644 --- a/src/ruby/nodes/commands.ts +++ b/src/ruby/nodes/commands.ts @@ -74,16 +74,12 @@ function skipArgsAlign(node: Ruby.CommandCall) { // If there is a ternary argument to a command and it's going to get broken // into multiple lines, then we're going to have to use parentheses around the // command in order to make sure operator precedence doesn't get messed up. -function hasTernaryArg( - node: Ruby.Args | Ruby.ArgsAddBlock | Ruby.ArgsAddStar -): boolean { +function hasTernaryArg(node: Ruby.Args | Ruby.ArgsAddBlock): boolean { switch (node.type) { case "args": return node.parts.some((child) => child.type === "ifop"); case "args_add_block": return hasTernaryArg(node.args) || node.block?.type === "ifop"; - case "args_add_star": - return hasTernaryArg(node.args) || node.star.type === "ifop"; } } diff --git a/src/ruby/nodes/return.ts b/src/ruby/nodes/return.ts index e095789e..d04e6d8f 100644 --- a/src/ruby/nodes/return.ts +++ b/src/ruby/nodes/return.ts @@ -67,14 +67,6 @@ export const printReturn: Plugin.Printer = (path, opts, print) => { if (contents.type === "args" && contents.parts.length > 1) { // If we have just regular arguments and we have more than 1. steps.push("cnts"); - } else if (contents.type === "args_add_star") { - if (contents.args.type === "args_add_star") { - // If we have two splats. - steps.push("cnts"); - } else if (contents.args.parts.length > 0) { - // If we have a splat and at least one pre argument. - steps.push("cnts"); - } } } } diff --git a/src/ruby/nodes/statements.ts b/src/ruby/nodes/statements.ts index 986b6528..f67dda7b 100644 --- a/src/ruby/nodes/statements.ts +++ b/src/ruby/nodes/statements.ts @@ -50,7 +50,7 @@ export const printBodyStmt: Plugin.Printer = ( return group(parts); }; -const argNodeTypes = ["args", "args_add_star", "args_add_block"]; +const argNodeTypes = ["args", "args_add_block"]; export const printParen: Plugin.Printer = (path, opts, print) => { const contentNode = path.getValue().cnts; diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 8608df75..12d8d369 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -750,16 +750,9 @@ def to_json(*opts) end # :call-seq: - # on_args_add: ((Args | ArgsAddStar) arguments, untyped argument) -> Args + # on_args_add: (Args arguments, untyped argument) -> Args def on_args_add(arguments, argument) - if arguments.is_a?(ArgsAddStar) - # If we're adding an argument after a splatted argument, then it's going - # to come in through this path. - Args.new( - parts: [arguments, argument], - location: arguments.location.to(argument.location) - ) - elsif arguments.parts.empty? + if arguments.parts.empty? # If this is the first argument being passed into the list of arguments, # then we're going to use the bounds of the argument to override the # parent node's location since this will be more accurate. @@ -782,7 +775,7 @@ def on_args_add(arguments, argument) # method(argument, &block) # class ArgsAddBlock - # [Args | ArgsAddStar] the arguments before the optional block + # [Args] the arguments before the optional block attr_reader :arguments # [nil | untyped] the optional block argument @@ -819,7 +812,7 @@ def to_json(*opts) # :call-seq: # on_args_add_block: ( - # (Args | ArgsAddStar) arguments, + # Args arguments, # (false | untyped) block # ) -> ArgsAddBlock def on_args_add_block(arguments, block) @@ -832,60 +825,56 @@ def on_args_add_block(arguments, block) ) end - # ArgsAddStar represents adding a splat of values to a list of arguments. + # Star represents using a splat operator on an expression. # - # method(prefix, *arguments, suffix) + # method(*arguments) # - class ArgsAddStar - # [Args | ArgsAddStar] the arguments before the starred argument - attr_reader :arguments - - # [untyped] the expression being starred - attr_reader :star + class Star + # [untyped] the expression being splatted + attr_reader :value # [Location] the location of this node attr_reader :location - def initialize(arguments:, star:, location:) - @arguments = arguments - @star = star + def initialize(value:, location:) + @value = value @location = location end def pretty_print(q) q.group(2, '(', ')') do - q.text('args_add_star') - q.breakable - q.pp(arguments) + q.text('star') + q.breakable - q.pp(star) + q.pp(value) end end def to_json(*opts) - { - type: :args_add_star, - args: arguments, - star: star, - loc: location - }.to_json(*opts) + { type: :star, value: value, loc: location }.to_json(*opts) end end # :call-seq: - # on_args_add_star: ( - # (Args | ArgsAddStar) arguments, - # untyped star - # ) -> ArgsAddStar - def on_args_add_star(arguments, star) + # on_args_add_star: (Args arguments, untyped star) -> Args + def on_args_add_star(arguments, argument) beginning = find_token(Op, '*') - ending = star || beginning + ending = argument || beginning - ArgsAddStar.new( - arguments: arguments, - star: star, - location: beginning.location.to(ending.location) - ) + location = + if arguments.parts.empty? + ending.location + else + arguments.location.to(ending.location) + end + + star = + Star.new( + value: argument, + location: beginning.location.to(ending.location) + ) + + Args.new(parts: arguments.parts << star, location: location) end # ArgsForward represents forwarding all kinds of arguments onto another method @@ -956,10 +945,10 @@ def on_args_new # %W[one two three] # # Every line in the example above produces an ArrayLiteral node. In order, the - # child contents node of this ArrayLiteral node would be nil, Args, - # ArgsAddStar, QSymbols, QWords, Symbols, and Words. + # child contents node of this ArrayLiteral node would be nil, Args, QSymbols, + # QWords, Symbols, and Words. class ArrayLiteral - # [nil | Args | ArgsAddStar | QSymbols | QWords | Symbols | Words] the + # [nil | Args | QSymbols | QWords | Symbols | Words] the # contents of the array attr_reader :contents @@ -986,11 +975,10 @@ def to_json(*opts) # :call-seq: # on_array: ( - # (nil | Args | ArgsAddStar | QSymbols | QWords | Symbols | Words) - # contents + # (nil | Args | QSymbols | QWords | Symbols | Words) contents # ) -> ArrayLiteral def on_array(contents) - if !contents || contents.is_a?(Args) || contents.is_a?(ArgsAddStar) + if !contents || contents.is_a?(Args) lbracket = find_token(LBracket) rbracket = find_token(RBracket) @@ -5639,7 +5627,7 @@ def on_mrhs_add_star(mrhs, star) # values = first, second, third # class MRHSNewFromArgs - # [Args | ArgsAddStar] the arguments being used in the assignment + # [Args] the arguments being used in the assignment attr_reader :arguments # [Location] the location of this node @@ -5667,7 +5655,7 @@ def to_json(*opts) end # :call-seq: - # on_mrhs_new_from_args: ((Args | ArgsAddStar) arguments) -> MRHSNewFromArgs + # on_mrhs_new_from_args: (Args arguments) -> MRHSNewFromArgs def on_mrhs_new_from_args(arguments) MRHSNewFromArgs.new(arguments: arguments, location: arguments.location) end diff --git a/src/ruby/printer.ts b/src/ruby/printer.ts index 5597db35..1ccf615b 100644 --- a/src/ruby/printer.ts +++ b/src/ruby/printer.ts @@ -10,7 +10,6 @@ const { trim } = prettier; const noComments = [ "args", "args_add_block", - "args_add_star", "mlhs", "mlhs_add_post", "mlhs_add_star", diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 69084bce..3cd5bd6e 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -13,7 +13,7 @@ type ParserEvent> = { type: T, loc: Location } & // This is the main expression type that goes in places where the AST will // accept just about anything. // eslint-disable-next-line @typescript-eslint/ban-types -export type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgParen | Args | ArgsAddBlock | ArgsAddStar | ArgsForward | Array | Aryptn | Assign | AssocNew | AssocSplat | AssoclistFromArgs | BEGIN | Backref | Backtick | BareAssocHash | Begin | Binary | BlockVar | Blockarg | Bodystmt | BraceBlock | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | DefEndless | DoBlock | Dot2 | Dot3 | DynaSymbol | END | Else | Elsif | EndContent | Ensure | ExcessedComma | Fcall | Field | Float | FndPtn | For | GVar | Hash | Heredoc | HeredocBegin | Hshptn | IVar | Identifier | If | IfModifier | Imaginary | In | Int | Keyword | KeywordRestParam | Label | Lambda | Lbrace | Lparen | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Not | Op | Opassign | Params | Paren | Period | Program | Qwords | Qsymbols | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueEx | RescueModifier | RestParam | Retry | Return | Return0 | Sclass | Statements | StringConcat | StringDVar | StringEmbExpr | StringLiteral | Super | Symbols | SymbolLiteral | TStringContent | Ternary | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VCall | VarAlias | VarField | VarRef | VoidStmt | When | While | WhileModifier | Word | Words | XStringLiteral | Yield | Yield0 | Zsuper +export type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgParen | Args | ArgsAddBlock | ArgsForward | Array | Aryptn | Assign | AssocNew | AssocSplat | AssoclistFromArgs | BEGIN | Backref | Backtick | BareAssocHash | Begin | Binary | BlockVar | Blockarg | Bodystmt | BraceBlock | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | DefEndless | DoBlock | Dot2 | Dot3 | DynaSymbol | END | Else | Elsif | EndContent | Ensure | ExcessedComma | Fcall | Field | Float | FndPtn | For | GVar | Hash | Heredoc | HeredocBegin | Hshptn | IVar | Identifier | If | IfModifier | Imaginary | In | Int | Keyword | KeywordRestParam | Label | Lambda | Lbrace | Lparen | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Not | Op | Opassign | Params | Paren | Period | Program | Qwords | Qsymbols | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueEx | RescueModifier | RestParam | Retry | Return | Return0 | Sclass | Star | Statements | StringConcat | StringDVar | StringEmbExpr | StringLiteral | Super | Symbols | SymbolLiteral | TStringContent | Ternary | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VCall | VarAlias | VarField | VarRef | VoidStmt | When | While | WhileModifier | Word | Words | XStringLiteral | Yield | Yield0 | Zsuper // This is a special scanner event that contains a comment. It can be attached // to almost any kind of node, which is why it's pulled out here separately. @@ -98,7 +98,7 @@ export type SymbolLiteral = ParserEvent<"symbol_literal", { value: Backtick | Co export type XStringLiteral = ParserEvent<"xstring_literal", { parts: StringContent[] }>; // These are various parser events that have to do with arrays. -export type Array = ParserEvent<"array", { cnts: null | Args | ArgsAddStar | Qsymbols | Qwords | Symbols | Words }>; +export type Array = ParserEvent<"array", { cnts: null | Args | Qsymbols | Qwords | Symbols | Words }>; export type Qsymbols = ParserEvent<"qsymbols", { elems: TStringContent[] }>; export type Qwords = ParserEvent<"qwords", { elems: TStringContent[] }>; export type Symbols = ParserEvent<"symbols", { elems: Word[] }>; @@ -131,7 +131,7 @@ export type MlhsAddStar = ParserEvent<"mlhs_add_star", { mlhs: Mlhs, star: null export type MlhsParen = ParserEvent<"mlhs_paren", { cnts: Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen }>; export type Mrhs = ParserEvent<"mrhs", { parts: AnyNode[] }>; export type MrhsAddStar = ParserEvent<"mrhs_add_star", { mrhs: Mrhs | MrhsNewFromArgs, star: AnyNode }>; -export type MrhsNewFromArgs = ParserEvent<"mrhs_new_from_args", { args: Args | ArgsAddStar }>; +export type MrhsNewFromArgs = ParserEvent<"mrhs_new_from_args", { args: Args }>; // These are various parser events for control flow constructs. export type Case = ParserEvent<"case", { value: AnyNode, cons: In | When }>; @@ -150,7 +150,7 @@ export type Unless = ParserEvent<"unless", { pred: AnyNode, stmts: Statements, c export type UnlessModifier = ParserEvent<"unless_mod", { pred: AnyNode, stmt: AnyNode }>; export type Until = ParserEvent<"until", { pred: AnyNode, stmts: Statements }>; export type UntilModifier = ParserEvent<"until_mod", { pred: AnyNode, stmt: AnyNode }>; -export type When = ParserEvent<"when", { args: Args | ArgsAddStar, stmts: Statements, cons: null | Else | When }>; +export type When = ParserEvent<"when", { args: Args, stmts: Statements, cons: null | Else | When }>; export type While = ParserEvent<"while", { pred: AnyNode, stmts: Statements }>; export type WhileModifier = ParserEvent<"while_mod", { pred: AnyNode, stmt: AnyNode }>; @@ -184,8 +184,8 @@ export type RestParam = ParserEvent<"rest_param", { name: null | Identifier }>; export type CallOperator = Op | Period | "::"; export type ArgParen = ParserEvent<"arg_paren", { args: Args | ArgsAddBlock | ArgsForward | null }>; export type Args = ParserEvent<"args", { parts: AnyNode[] }>; -export type ArgsAddBlock = ParserEvent<"args_add_block", { args: Args | ArgsAddStar, block: null | AnyNode }>; -export type ArgsAddStar = ParserEvent<"args_add_star", { args: Args | ArgsAddStar, star: AnyNode }>; +export type ArgsAddBlock = ParserEvent<"args_add_block", { args: Args, block: null | AnyNode }>; +export type Star = ParserEvent<"star", { value: AnyNode }>; export type BlockVar = ParserEvent<"block_var", { params: Params, locals: Identifier[] }>; export type BraceBlock = ParserEvent<"brace_block", { lbrace: Lbrace, block_var: null | BlockVar, stmts: Statements }>; export type Call = ParserEvent<"call", { receiver: AnyNode, op: CallOperator, message: Backtick | Op | Identifier | Const | "call" }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index b0e21b94..77ba6b1b 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -50,8 +50,6 @@ function getChildNodes(node: AnyNode): ChildNode[] { return node.parts; case "args_add_block": return [node.args, node.block]; - case "args_add_star": - return [node.args, node.star]; case "args_forward": return []; case "array": @@ -261,6 +259,8 @@ function getChildNodes(node: AnyNode): ChildNode[] { return []; case "sclass": return [node.target, node.bodystmt]; + case "star": + return [node.value]; case "statements": return node.body; case "string_concat": diff --git a/test/rb/metadata_test.rb b/test/rb/metadata_test.rb index 6560380c..3d04f55d 100644 --- a/test/rb/metadata_test.rb +++ b/test/rb/metadata_test.rb @@ -4,25 +4,25 @@ class MetadataTest < Minitest::Test def test_BEGIN - assert_metadata Ripper::ParseTree::BEGINBlock, <<~SOURCE + assert_metadata SyntaxTree::BEGINBlock, <<~SOURCE BEGIN { } SOURCE end def test_END - assert_metadata Ripper::ParseTree::ENDBlock, <<~SOURCE + assert_metadata SyntaxTree::ENDBlock, <<~SOURCE END { } SOURCE end def test_alias - assert_metadata Ripper::ParseTree::Alias, 'alias foo bar' + assert_metadata SyntaxTree::Alias, 'alias foo bar' end def test_array_args - assert_metadata Ripper::ParseTree::ArrayLiteral, <<~SOURCE + assert_metadata SyntaxTree::ArrayLiteral, <<~SOURCE [ foo, bar, @@ -31,18 +31,8 @@ def test_array_args SOURCE end - def test_array_args_add_star - assert_metadata Ripper::ParseTree::ArrayLiteral, <<~SOURCE - [ - foo, - *bar, - baz - ] - SOURCE - end - def test_array_qwords - assert_metadata Ripper::ParseTree::ArrayLiteral, <<~SOURCE + assert_metadata SyntaxTree::ArrayLiteral, <<~SOURCE %w[ foo bar @@ -52,12 +42,12 @@ def test_array_qwords end def test_aref - assert_metadata Ripper::ParseTree::ARef, 'foo[bar]' + assert_metadata SyntaxTree::ARef, 'foo[bar]' end def test_aref_field assert_node_metadata( - Ripper::ParseTree::ARefField, + SyntaxTree::ARefField, parse('foo[bar] = baz').target, start_char: 0, end_char: 8 @@ -66,7 +56,7 @@ def test_aref_field def test_args assert_node_metadata( - Ripper::ParseTree::Args, + SyntaxTree::Args, parse('foo bar, baz').arguments.arguments, start_char: 4, end_char: 12 @@ -75,22 +65,13 @@ def test_args def test_args_add_block assert_node_metadata( - Ripper::ParseTree::ArgsAddBlock, + SyntaxTree::ArgsAddBlock, parse('foo bar, baz').arguments, start_char: 4, end_char: 12 ) end - def test_args_add_star - assert_node_metadata( - Ripper::ParseTree::ArgsAddStar, - parse('foo *bar').arguments.arguments, - start_char: 4, - end_char: 8 - ) - end - def test_arg_paren content = <<~SOURCE foo( @@ -101,7 +82,7 @@ def test_arg_paren SOURCE assert_node_metadata( - Ripper::ParseTree::ArgParen, + SyntaxTree::ArgParen, parse(content).arguments, start_char: 3, end_char: 20, @@ -111,12 +92,12 @@ def test_arg_paren end def test_assign - assert_metadata Ripper::ParseTree::Assign, 'foo = bar' + assert_metadata SyntaxTree::Assign, 'foo = bar' end def test_assoc_new assert_node_metadata( - Ripper::ParseTree::AssocNew, + SyntaxTree::AssocNew, parse('{ foo: bar, bar: baz }').contents.assocs.first, start_char: 2, end_char: 10 @@ -125,7 +106,7 @@ def test_assoc_new def test_assoc_splat assert_node_metadata( - Ripper::ParseTree::AssocSplat, + SyntaxTree::AssocSplat, parse('foo **bar').arguments.arguments.parts.first.assocs.first, start_char: 4, end_char: 9 @@ -134,7 +115,7 @@ def test_assoc_splat def test_assoclist_from_args assert_node_metadata( - Ripper::ParseTree::AssocListFromArgs, + SyntaxTree::AssocListFromArgs, parse('{ foo => bar }').contents, start_char: 1, end_char: 13 @@ -143,7 +124,7 @@ def test_assoclist_from_args def test_bare_assoc_hash assert_node_metadata( - Ripper::ParseTree::BareAssocHash, + SyntaxTree::BareAssocHash, parse('foo(bar: baz)').arguments.arguments.arguments.parts.first, start_char: 4, end_char: 12 @@ -151,7 +132,7 @@ def test_bare_assoc_hash end def test_begin - assert_metadata Ripper::ParseTree::Begin, <<~SOURCE + assert_metadata SyntaxTree::Begin, <<~SOURCE begin begin; end end @@ -159,12 +140,12 @@ def test_begin end def test_binary - assert_metadata Ripper::ParseTree::Binary, 'foo + bar' + assert_metadata SyntaxTree::Binary, 'foo + bar' end def test_blockarg assert_node_metadata( - Ripper::ParseTree::BlockArg, + SyntaxTree::BlockArg, parse('def foo(&bar) end').params.contents.block, start_char: 8, end_char: 12 @@ -173,7 +154,7 @@ def test_blockarg def test_block_var assert_node_metadata( - Ripper::ParseTree::BlockVar, + SyntaxTree::BlockVar, parse('foo { |bar| }').block.block_var, start_char: 6, end_char: 11 @@ -182,7 +163,7 @@ def test_block_var def test_bodystmt assert_node_metadata( - Ripper::ParseTree::BodyStmt, + SyntaxTree::BodyStmt, parse('class Foo; def foo; end; end').bodystmt, start_char: 9, end_char: 25 @@ -191,7 +172,7 @@ def test_bodystmt def test_brace_block assert_node_metadata( - Ripper::ParseTree::BraceBlock, + SyntaxTree::BraceBlock, parse('foo { bar }').block, start_char: 4, end_char: 11 @@ -199,15 +180,15 @@ def test_brace_block end def test_break - assert_metadata Ripper::ParseTree::Break, 'break foo' + assert_metadata SyntaxTree::Break, 'break foo' end def test_call - assert_metadata Ripper::ParseTree::Call, 'foo.bar' + assert_metadata SyntaxTree::Call, 'foo.bar' end def test_case - assert_metadata Ripper::ParseTree::Case, <<~SOURCE + assert_metadata SyntaxTree::Case, <<~SOURCE case foo when bar case baz @@ -218,7 +199,7 @@ def test_case end def test_class - assert_metadata Ripper::ParseTree::ClassDeclaration, <<~SOURCE + assert_metadata SyntaxTree::ClassDeclaration, <<~SOURCE class Foo class Bar; end end @@ -226,16 +207,16 @@ class Bar; end end def test_command - assert_metadata Ripper::ParseTree::Command, 'foo bar' + assert_metadata SyntaxTree::Command, 'foo bar' end def test_command_call - assert_metadata Ripper::ParseTree::CommandCall, 'foo.bar baz' + assert_metadata SyntaxTree::CommandCall, 'foo.bar baz' end def test_const_ref assert_node_metadata( - Ripper::ParseTree::ConstRef, + SyntaxTree::ConstRef, parse('class Foo; end').constant, start_char: 6, end_char: 9 @@ -244,7 +225,7 @@ def test_const_ref def test_const_path_field assert_node_metadata( - Ripper::ParseTree::ConstPathField, + SyntaxTree::ConstPathField, parse('Foo::Bar = baz').target, start_char: 0, end_char: 8 @@ -252,11 +233,11 @@ def test_const_path_field end def test_const_path_ref - assert_metadata Ripper::ParseTree::ConstPathRef, 'Foo::Bar' + assert_metadata SyntaxTree::ConstPathRef, 'Foo::Bar' end def test_def - assert_metadata Ripper::ParseTree::Def, <<~SOURCE + assert_metadata SyntaxTree::Def, <<~SOURCE def foo def bar; end end @@ -264,7 +245,7 @@ def bar; end end def test_defined - assert_metadata Ripper::ParseTree::Defined, <<~SOURCE + assert_metadata SyntaxTree::Defined, <<~SOURCE defined?( Foo ) @@ -272,7 +253,7 @@ def test_defined end def test_defs - assert_metadata Ripper::ParseTree::Defs, <<~SOURCE + assert_metadata SyntaxTree::Defs, <<~SOURCE def Object.foo def Object.bar; end end @@ -281,7 +262,7 @@ def Object.bar; end def test_do_block assert_node_metadata( - Ripper::ParseTree::DoBlock, + SyntaxTree::DoBlock, parse('foo do; bar; end').block, start_char: 4, end_char: 16 @@ -289,15 +270,15 @@ def test_do_block end def test_dot2 - assert_metadata Ripper::ParseTree::Dot2, 'foo..bar' + assert_metadata SyntaxTree::Dot2, 'foo..bar' end def test_dot3 - assert_metadata Ripper::ParseTree::Dot3, 'foo...bar' + assert_metadata SyntaxTree::Dot3, 'foo...bar' end def test_dyna_symbol - assert_metadata Ripper::ParseTree::DynaSymbol, ':"foo #{bar} baz"' + assert_metadata SyntaxTree::DynaSymbol, ':"foo #{bar} baz"' end def test_else @@ -310,7 +291,7 @@ def test_else SOURCE assert_node_metadata( - Ripper::ParseTree::Else, + SyntaxTree::Else, parse(content).consequent, start_char: 13, end_char: 27, @@ -329,7 +310,7 @@ def test_elsif SOURCE assert_node_metadata( - Ripper::ParseTree::Elsif, + SyntaxTree::Elsif, parse(content).consequent, start_char: 13, end_char: 32, @@ -348,7 +329,7 @@ def test_ensure SOURCE assert_node_metadata( - Ripper::ParseTree::Ensure, + SyntaxTree::Ensure, parse(content).bodystmt.ensure_clause, start_char: 12, end_char: 28, @@ -360,7 +341,7 @@ def test_ensure if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.6') def test_excessed_comma assert_node_metadata( - Ripper::ParseTree::ExcessedComma, + SyntaxTree::ExcessedComma, parse('foo { |bar,| }').block.block_var.params.rest, start_char: 10, end_char: 11 @@ -370,7 +351,7 @@ def test_excessed_comma def test_fcall assert_node_metadata( - Ripper::ParseTree::FCall, + SyntaxTree::FCall, parse('foo(bar)').call, start_char: 0, end_char: 3 @@ -379,7 +360,7 @@ def test_fcall def test_field assert_node_metadata( - Ripper::ParseTree::Field, + SyntaxTree::Field, parse('foo.bar = baz').target, start_char: 0, end_char: 7 @@ -387,7 +368,7 @@ def test_field end def test_for - assert_metadata Ripper::ParseTree::For, <<~SOURCE + assert_metadata SyntaxTree::For, <<~SOURCE for foo in bar do for baz in qux do end @@ -396,7 +377,7 @@ def test_for end def test_hash - assert_metadata Ripper::ParseTree::HashLiteral, <<~SOURCE + assert_metadata SyntaxTree::HashLiteral, <<~SOURCE { foo: 'bar' } @@ -404,7 +385,7 @@ def test_hash end def test_if - assert_metadata Ripper::ParseTree::If, <<~SOURCE + assert_metadata SyntaxTree::If, <<~SOURCE if foo if bar; end end @@ -412,16 +393,16 @@ def test_if end def test_ifop - assert_metadata Ripper::ParseTree::IfOp, 'foo ? bar : baz' + assert_metadata SyntaxTree::IfOp, 'foo ? bar : baz' end def test_if_mod - assert_metadata Ripper::ParseTree::IfMod, 'foo if bar' + assert_metadata SyntaxTree::IfMod, 'foo if bar' end def test_kwrest_param assert_node_metadata( - Ripper::ParseTree::KwRestParam, + SyntaxTree::KwRestParam, parse('def foo(**bar); end').params.contents.keyword_rest, start_char: 8, end_char: 13 @@ -429,7 +410,7 @@ def test_kwrest_param end def test_lambda - assert_metadata Ripper::ParseTree::Lambda, <<~SOURCE + assert_metadata SyntaxTree::Lambda, <<~SOURCE -> (foo, bar) { foo + bar } @@ -437,20 +418,20 @@ def test_lambda end def test_massign - assert_metadata Ripper::ParseTree::MAssign, 'foo, bar, baz = 1, 2, 3' + assert_metadata SyntaxTree::MAssign, 'foo, bar, baz = 1, 2, 3' end def test_method_add_arg - assert_metadata Ripper::ParseTree::MethodAddArg, 'foo(bar)' + assert_metadata SyntaxTree::MethodAddArg, 'foo(bar)' end def test_method_add_block - assert_metadata Ripper::ParseTree::MethodAddBlock, 'foo { bar }' + assert_metadata SyntaxTree::MethodAddBlock, 'foo { bar }' end def test_mlhs assert_node_metadata( - Ripper::ParseTree::MLHS, + SyntaxTree::MLHS, parse('foo, bar, baz = 1, 2, 3').target, start_char: 0, end_char: 13 @@ -459,7 +440,7 @@ def test_mlhs def test_mlhs_add_post assert_node_metadata( - Ripper::ParseTree::MLHSAddPost, + SyntaxTree::MLHSAddPost, parse('foo, *bar, baz = 1, 2, 3').target, start_char: 5, end_char: 14 @@ -468,7 +449,7 @@ def test_mlhs_add_post def test_mlhs_add_star assert_node_metadata( - Ripper::ParseTree::MLHSAddStar, + SyntaxTree::MLHSAddStar, parse('foo, *bar = 1, 2, 3').target, start_char: 5, end_char: 9 @@ -477,7 +458,7 @@ def test_mlhs_add_star def test_mlhs_paren assert_node_metadata( - Ripper::ParseTree::MLHSParen, + SyntaxTree::MLHSParen, parse('(foo, bar) = baz').target, start_char: 0, end_char: 10 @@ -485,7 +466,7 @@ def test_mlhs_paren end def test_module - assert_metadata Ripper::ParseTree::ModuleDeclaration, <<~SOURCE + assert_metadata SyntaxTree::ModuleDeclaration, <<~SOURCE module Foo module Bar; end end @@ -494,7 +475,7 @@ module Bar; end def test_mrhs_add_star assert_node_metadata( - Ripper::ParseTree::MRHSAddStar, + SyntaxTree::MRHSAddStar, parse('foo, bar = *baz').value, start_char: 11, end_char: 15 @@ -502,11 +483,11 @@ def test_mrhs_add_star end def test_next - assert_metadata Ripper::ParseTree::Next, 'next foo' + assert_metadata SyntaxTree::Next, 'next foo' end def test_opassign - assert_metadata Ripper::ParseTree::OpAssign, 'foo ||= bar' + assert_metadata SyntaxTree::OpAssign, 'foo ||= bar' end def test_params @@ -518,7 +499,7 @@ def foo( SOURCE assert_node_metadata( - Ripper::ParseTree::Params, + SyntaxTree::Params, parse(content).params.contents, start_char: 8, end_char: 22, @@ -528,12 +509,12 @@ def foo( end def test_paren - assert_metadata Ripper::ParseTree::Paren, '()' + assert_metadata SyntaxTree::Paren, '()' end def test_qsymbols assert_node_metadata( - Ripper::ParseTree::QSymbols, + SyntaxTree::QSymbols, parse('%i[foo bar baz]').contents, start_char: 0, end_char: 15 @@ -542,7 +523,7 @@ def test_qsymbols def test_qwords assert_node_metadata( - Ripper::ParseTree::QWords, + SyntaxTree::QWords, parse('%w[foo bar baz]').contents, start_char: 0, end_char: 15 @@ -550,16 +531,16 @@ def test_qwords end def test_redo - assert_metadata Ripper::ParseTree::Redo, 'redo' + assert_metadata SyntaxTree::Redo, 'redo' end def test_regexp_literal - assert_metadata Ripper::ParseTree::RegexpLiteral, '/foo/' - assert_metadata Ripper::ParseTree::RegexpLiteral, '%r{foo}' - assert_metadata Ripper::ParseTree::RegexpLiteral, '%r(foo)' + assert_metadata SyntaxTree::RegexpLiteral, '/foo/' + assert_metadata SyntaxTree::RegexpLiteral, '%r{foo}' + assert_metadata SyntaxTree::RegexpLiteral, '%r(foo)' assert_node_metadata( - Ripper::ParseTree::RegexpLiteral, + SyntaxTree::RegexpLiteral, parse('%r(foo)'), beginning: '%r(', ending: ')', @@ -570,7 +551,7 @@ def test_regexp_literal def test_rescue assert_node_metadata( - Ripper::ParseTree::Rescue, + SyntaxTree::Rescue, parse('begin; foo; rescue => bar; baz; end').bodystmt.rescue_clause, start_char: 12, end_char: 35 @@ -578,12 +559,12 @@ def test_rescue end def test_rescue_mod - assert_metadata Ripper::ParseTree::RescueMod, 'foo rescue bar' + assert_metadata SyntaxTree::RescueMod, 'foo rescue bar' end def test_rest_param assert_node_metadata( - Ripper::ParseTree::RestParam, + SyntaxTree::RestParam, parse('def foo(*bar); end').params.contents.rest, start_char: 8, end_char: 12 @@ -591,19 +572,19 @@ def test_rest_param end def test_retry - assert_metadata Ripper::ParseTree::Retry, 'retry' + assert_metadata SyntaxTree::Retry, 'retry' end def test_return - assert_metadata Ripper::ParseTree::Return, 'return foo' + assert_metadata SyntaxTree::Return, 'return foo' end def test_return0 - assert_metadata Ripper::ParseTree::Return0, 'return' + assert_metadata SyntaxTree::Return0, 'return' end def test_sclass - assert_metadata Ripper::ParseTree::SClass, <<~SOURCE + assert_metadata SyntaxTree::SClass, <<~SOURCE class << Foo class << Bar; end end @@ -611,7 +592,7 @@ class << Bar; end end def test_string_concat - assert_metadata Ripper::ParseTree::StringConcat, <<~SOURCE + assert_metadata SyntaxTree::StringConcat, <<~SOURCE 'foo' \ 'bar' SOURCE @@ -619,7 +600,7 @@ def test_string_concat def test_string_dvar assert_node_metadata( - Ripper::ParseTree::StringDVar, + SyntaxTree::StringDVar, parse('"#$foo"').parts.first, start_char: 1, end_char: 6 @@ -628,7 +609,7 @@ def test_string_dvar def test_string_embexpr assert_node_metadata( - Ripper::ParseTree::StringEmbExpr, + SyntaxTree::StringEmbExpr, parse('"foo #{bar} baz"').parts[1], start_char: 5, end_char: 11 @@ -636,20 +617,20 @@ def test_string_embexpr end def test_string_literal - assert_metadata Ripper::ParseTree::StringLiteral, '"foo"' + assert_metadata SyntaxTree::StringLiteral, '"foo"' end def test_super - assert_metadata Ripper::ParseTree::Super, 'super foo' + assert_metadata SyntaxTree::Super, 'super foo' end def test_symbol_literal - assert_metadata Ripper::ParseTree::SymbolLiteral, ':foo' + assert_metadata SyntaxTree::SymbolLiteral, ':foo' end def test_symbols assert_node_metadata( - Ripper::ParseTree::Symbols, + SyntaxTree::Symbols, parse('%I[f#{o}o b#{a}r b#{a}z]').contents, start_char: 0, end_char: 24 @@ -658,7 +639,7 @@ def test_symbols def test_top_const_field assert_node_metadata( - Ripper::ParseTree::TopConstField, + SyntaxTree::TopConstField, parse('::Foo = bar').target, start_char: 0, end_char: 5 @@ -666,20 +647,20 @@ def test_top_const_field end def test_top_const_ref - assert_metadata Ripper::ParseTree::TopConstRef, '::Foo' + assert_metadata SyntaxTree::TopConstRef, '::Foo' end def test_unary - assert_metadata Ripper::ParseTree::Unary, '-foo' - assert_metadata Ripper::ParseTree::Not, 'not foo' + assert_metadata SyntaxTree::Unary, '-foo' + assert_metadata SyntaxTree::Not, 'not foo' end def test_undef - assert_metadata Ripper::ParseTree::Undef, 'undef foo, bar' + assert_metadata SyntaxTree::Undef, 'undef foo, bar' end def test_unless - assert_metadata Ripper::ParseTree::Unless, <<~SOURCE + assert_metadata SyntaxTree::Unless, <<~SOURCE unless foo unless bar; end end @@ -687,11 +668,11 @@ def test_unless end def test_unless_mod - assert_metadata Ripper::ParseTree::UnlessMod, 'foo unless bar' + assert_metadata SyntaxTree::UnlessMod, 'foo unless bar' end def test_until - assert_metadata Ripper::ParseTree::Until, <<~SOURCE + assert_metadata SyntaxTree::Until, <<~SOURCE until foo until bar; end end @@ -699,11 +680,11 @@ def test_until end def test_until_mod - assert_metadata Ripper::ParseTree::UntilMod, 'foo until bar' + assert_metadata SyntaxTree::UntilMod, 'foo until bar' end def test_while - assert_metadata Ripper::ParseTree::While, <<~SOURCE + assert_metadata SyntaxTree::While, <<~SOURCE while foo while bar; end end @@ -711,12 +692,12 @@ def test_while end def test_var_alias - assert_metadata Ripper::ParseTree::VarAlias, 'alias $foo $bar' + assert_metadata SyntaxTree::VarAlias, 'alias $foo $bar' end def test_var_field assert_node_metadata( - Ripper::ParseTree::VarField, + SyntaxTree::VarField, parse('foo = 1').target, start_char: 0, end_char: 3 @@ -724,16 +705,16 @@ def test_var_field end def test_var_ref - assert_metadata Ripper::ParseTree::VarRef, 'true' + assert_metadata SyntaxTree::VarRef, 'true' end def test_vcall - assert_metadata Ripper::ParseTree::VCall, 'foo' + assert_metadata SyntaxTree::VCall, 'foo' end def test_void_stmt assert_node_metadata( - Ripper::ParseTree::VoidStmt, + SyntaxTree::VoidStmt, parse('; ;'), start_char: 0, end_char: 0 @@ -742,7 +723,7 @@ def test_void_stmt def test_when assert_node_metadata( - Ripper::ParseTree::When, + SyntaxTree::When, parse('case foo; when bar; baz; end').consequent, start_char: 10, end_char: 28 @@ -750,12 +731,12 @@ def test_when end def test_while_mod - assert_metadata Ripper::ParseTree::WhileMod, 'foo while bar' + assert_metadata SyntaxTree::WhileMod, 'foo while bar' end def test_words assert_node_metadata( - Ripper::ParseTree::Words, + SyntaxTree::Words, parse('%W[f#{o}o b#{a}r b#{a}z]').contents, start_char: 0, end_char: 24 @@ -763,7 +744,7 @@ def test_words end def test_xstring - assert_metadata Ripper::ParseTree::XStringLiteral, <<~SOURCE + assert_metadata SyntaxTree::XStringLiteral, <<~SOURCE ` foo bar @@ -772,15 +753,15 @@ def test_xstring end def test_yield - assert_metadata Ripper::ParseTree::Yield, 'yield foo' + assert_metadata SyntaxTree::Yield, 'yield foo' end def test_yield0 - assert_metadata Ripper::ParseTree::Yield0, 'yield' + assert_metadata SyntaxTree::Yield0, 'yield' end def test_zsuper - assert_metadata Ripper::ParseTree::ZSuper, 'super' + assert_metadata SyntaxTree::ZSuper, 'super' end if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7') @@ -792,7 +773,7 @@ def foo(...) SOURCE assert_node_metadata( - Ripper::ParseTree::ArgsForward, + SyntaxTree::ArgsForward, parse(content).params.contents.rest, start_char: 8, end_char: 11 @@ -808,7 +789,7 @@ def test_aryptn SOURCE assert_node_metadata( - Ripper::ParseTree::AryPtn, + SyntaxTree::AryPtn, parse(content).consequent.pattern, start_char: 12, end_char: 20, @@ -826,7 +807,7 @@ def test_in SOURCE assert_node_metadata( - Ripper::ParseTree::In, + SyntaxTree::In, parse(content).consequent, start_char: 9, end_char: 25, @@ -869,6 +850,6 @@ def assert_node_metadata( end def parse(ruby) - Ripper::ParseTree.parse(ruby).statements.body.first + SyntaxTree.parse(ruby).statements.body.first end end From e2f49569f63990f4318a169fac2bfd21cf26e788 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 16 Nov 2021 20:00:27 -0500 Subject: [PATCH 423/785] star -> arg_star --- src/ruby/nodes.ts | 6 +++--- src/ruby/nodes/args.ts | 6 +++++- src/ruby/parser.rb | 12 ++++++------ src/types/ruby.ts | 4 ++-- src/utils/getChildNodes.ts | 4 ++-- 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/ruby/nodes.ts b/src/ruby/nodes.ts index fe53b842..32285c5e 100644 --- a/src/ruby/nodes.ts +++ b/src/ruby/nodes.ts @@ -6,8 +6,8 @@ import { printArgParen, printArgs, printArgsAddBlock, - printBlockArg, - printStar + printArgStar, + printBlockArg } from "./nodes/args"; import { printArray, @@ -166,6 +166,7 @@ const nodes: Record< args: printArgs, args_add_block: printArgsAddBlock, args_forward: printArgsForward, + arg_star: printArgStar, array: printArray, aryptn: printAryPtn, assign: printAssign, @@ -263,7 +264,6 @@ const nodes: Record< return0: printReturn0, return: printReturn, sclass: printSClass, - star: printStar, statements: printStatements, string_concat: printStringConcat, string_dvar: printStringDVar, diff --git a/src/ruby/nodes/args.ts b/src/ruby/nodes/args.ts index 72128eff..a8c34350 100644 --- a/src/ruby/nodes/args.ts +++ b/src/ruby/nodes/args.ts @@ -162,6 +162,10 @@ export const printBlockArg: Plugin.Printer = ( return ["&", path.call(print, "name")]; }; -export const printStar: Plugin.Printer = (path, opts, print) => { +export const printArgStar: Plugin.Printer = ( + path, + opts, + print +) => { return ["*", path.call(print, "value")]; }; diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 12d8d369..f6bcbb77 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -829,7 +829,7 @@ def on_args_add_block(arguments, block) # # method(*arguments) # - class Star + class ArgStar # [untyped] the expression being splatted attr_reader :value @@ -843,7 +843,7 @@ def initialize(value:, location:) def pretty_print(q) q.group(2, '(', ')') do - q.text('star') + q.text('arg_star') q.breakable q.pp(value) @@ -851,7 +851,7 @@ def pretty_print(q) end def to_json(*opts) - { type: :star, value: value, loc: location }.to_json(*opts) + { type: :arg_star, value: value, loc: location }.to_json(*opts) end end @@ -868,13 +868,13 @@ def on_args_add_star(arguments, argument) arguments.location.to(ending.location) end - star = - Star.new( + arg_star = + ArgStar.new( value: argument, location: beginning.location.to(ending.location) ) - Args.new(parts: arguments.parts << star, location: location) + Args.new(parts: arguments.parts << arg_star, location: location) end # ArgsForward represents forwarding all kinds of arguments onto another method diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 3cd5bd6e..4ce47e70 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -13,7 +13,7 @@ type ParserEvent> = { type: T, loc: Location } & // This is the main expression type that goes in places where the AST will // accept just about anything. // eslint-disable-next-line @typescript-eslint/ban-types -export type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgParen | Args | ArgsAddBlock | ArgsForward | Array | Aryptn | Assign | AssocNew | AssocSplat | AssoclistFromArgs | BEGIN | Backref | Backtick | BareAssocHash | Begin | Binary | BlockVar | Blockarg | Bodystmt | BraceBlock | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | DefEndless | DoBlock | Dot2 | Dot3 | DynaSymbol | END | Else | Elsif | EndContent | Ensure | ExcessedComma | Fcall | Field | Float | FndPtn | For | GVar | Hash | Heredoc | HeredocBegin | Hshptn | IVar | Identifier | If | IfModifier | Imaginary | In | Int | Keyword | KeywordRestParam | Label | Lambda | Lbrace | Lparen | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Not | Op | Opassign | Params | Paren | Period | Program | Qwords | Qsymbols | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueEx | RescueModifier | RestParam | Retry | Return | Return0 | Sclass | Star | Statements | StringConcat | StringDVar | StringEmbExpr | StringLiteral | Super | Symbols | SymbolLiteral | TStringContent | Ternary | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VCall | VarAlias | VarField | VarRef | VoidStmt | When | While | WhileModifier | Word | Words | XStringLiteral | Yield | Yield0 | Zsuper +export type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgParen | Args | ArgsAddBlock | ArgsForward | ArgStar | Array | Aryptn | Assign | AssocNew | AssocSplat | AssoclistFromArgs | BEGIN | Backref | Backtick | BareAssocHash | Begin | Binary | BlockVar | Blockarg | Bodystmt | BraceBlock | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | DefEndless | DoBlock | Dot2 | Dot3 | DynaSymbol | END | Else | Elsif | EndContent | Ensure | ExcessedComma | Fcall | Field | Float | FndPtn | For | GVar | Hash | Heredoc | HeredocBegin | Hshptn | IVar | Identifier | If | IfModifier | Imaginary | In | Int | Keyword | KeywordRestParam | Label | Lambda | Lbrace | Lparen | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Not | Op | Opassign | Params | Paren | Period | Program | Qwords | Qsymbols | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueEx | RescueModifier | RestParam | Retry | Return | Return0 | Sclass | Statements | StringConcat | StringDVar | StringEmbExpr | StringLiteral | Super | Symbols | SymbolLiteral | TStringContent | Ternary | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VCall | VarAlias | VarField | VarRef | VoidStmt | When | While | WhileModifier | Word | Words | XStringLiteral | Yield | Yield0 | Zsuper // This is a special scanner event that contains a comment. It can be attached // to almost any kind of node, which is why it's pulled out here separately. @@ -185,7 +185,7 @@ export type CallOperator = Op | Period | "::"; export type ArgParen = ParserEvent<"arg_paren", { args: Args | ArgsAddBlock | ArgsForward | null }>; export type Args = ParserEvent<"args", { parts: AnyNode[] }>; export type ArgsAddBlock = ParserEvent<"args_add_block", { args: Args, block: null | AnyNode }>; -export type Star = ParserEvent<"star", { value: AnyNode }>; +export type ArgStar = ParserEvent<"arg_star", { value: AnyNode }>; export type BlockVar = ParserEvent<"block_var", { params: Params, locals: Identifier[] }>; export type BraceBlock = ParserEvent<"brace_block", { lbrace: Lbrace, block_var: null | BlockVar, stmts: Statements }>; export type Call = ParserEvent<"call", { receiver: AnyNode, op: CallOperator, message: Backtick | Op | Identifier | Const | "call" }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 77ba6b1b..f77b9d0c 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -52,6 +52,8 @@ function getChildNodes(node: AnyNode): ChildNode[] { return [node.args, node.block]; case "args_forward": return []; + case "arg_star": + return [node.value]; case "array": return [node.cnts]; case "aryptn": @@ -259,8 +261,6 @@ function getChildNodes(node: AnyNode): ChildNode[] { return []; case "sclass": return [node.target, node.bodystmt]; - case "star": - return [node.value]; case "statements": return node.body; case "string_concat": From 5b5b0082242fd03662787b0607b450e149078189 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 16 Nov 2021 20:32:20 -0500 Subject: [PATCH 424/785] assoc -> assoc_new --- src/ruby/nodes.ts | 4 ++-- src/ruby/nodes/hashes.ts | 9 +++------ src/ruby/nodes/strings.ts | 2 +- src/ruby/parser.rb | 12 ++++++------ src/ruby/toProc.ts | 4 ++-- src/types/ruby.ts | 6 +++--- src/utils/getChildNodes.ts | 2 +- src/utils/inlineEnsureParens.ts | 2 +- test/js/ruby/nodes/conditionals.test.ts | 2 +- test/js/ruby/nodes/loops.test.ts | 2 +- test/rb/metadata_test.rb | 4 ++-- 11 files changed, 23 insertions(+), 26 deletions(-) diff --git a/src/ruby/nodes.ts b/src/ruby/nodes.ts index 32285c5e..86ca755b 100644 --- a/src/ruby/nodes.ts +++ b/src/ruby/nodes.ts @@ -51,7 +51,7 @@ import { } from "./nodes/constants"; import { printBreak, printNext, printYield, printYield0 } from "./nodes/flow"; import { - printAssocNew, + printAssoc, printAssocSplat, printHash, printHashContents @@ -170,7 +170,7 @@ const nodes: Record< array: printArray, aryptn: printAryPtn, assign: printAssign, - assoc_new: printAssocNew, + assoc: printAssoc, assoc_splat: printAssocSplat, assoclist_from_args: printHashContents, backref: printToken, diff --git a/src/ruby/nodes/hashes.ts b/src/ruby/nodes/hashes.ts index 1a0d4bf3..9762269c 100644 --- a/src/ruby/nodes/hashes.ts +++ b/src/ruby/nodes/hashes.ts @@ -12,6 +12,7 @@ type KeyPrinter = ( path: Plugin.Path, print: Plugin.Print ) => Plugin.Doc; + type HashContents = (Ruby.AssoclistFromArgs | Ruby.BareAssocHash) & { keyPrinter: KeyPrinter; }; @@ -81,11 +82,7 @@ const printHashKeyRocket: KeyPrinter = (path, print) => { return [doc, " =>"]; }; -export const printAssocNew: Plugin.Printer = ( - path, - opts, - print -) => { +export const printAssoc: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); const { keyPrinter } = path.getParentNode() as HashContents; @@ -154,7 +151,7 @@ export const printHash: Plugin.Printer = (path, opts, print) => { // If we're inside another hash, then we don't want to group our contents // because we want this hash to break along with its parent hash. - if (path.getParentNode().type === "assoc_new") { + if (path.getParentNode().type === "assoc") { return doc; } diff --git a/src/ruby/nodes/strings.ts b/src/ruby/nodes/strings.ts index b227eeba..95f6c23f 100644 --- a/src/ruby/nodes/strings.ts +++ b/src/ruby/nodes/strings.ts @@ -187,7 +187,7 @@ export const printDynaSymbol: Plugin.Printer = ( // If we're inside of an assoc_new node as the key, then it will handle // printing the : on its own since it could change sides. const parentNode = path.getParentNode(); - if (parentNode.type !== "assoc_new" || parentNode.key !== node) { + if (parentNode.type !== "assoc" || parentNode.key !== node) { parts.unshift(":"); } diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index f6bcbb77..4f2ba755 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -1154,13 +1154,13 @@ def on_assign(target, value) ) end - # AssocNew represents a key-value pair within a hash. It is a child node of + # Assoc represents a key-value pair within a hash. It is a child node of # either an AssocListFromArgs or a BareAssocHash. # # { key1: value1, key2: value2 } # # In the above example, the would be two AssocNew nodes. - class AssocNew + class Assoc # [untyped] the key of this pair attr_reader :key @@ -1178,7 +1178,7 @@ def initialize(key:, value:, location:) def pretty_print(q) q.group(2, '(', ')') do - q.text('assoc_new') + q.text('assoc') q.breakable q.pp(key) q.breakable @@ -1187,14 +1187,14 @@ def pretty_print(q) end def to_json(*opts) - { type: :assoc_new, key: key, value: value, loc: location }.to_json(*opts) + { type: :assoc, key: key, value: value, loc: location }.to_json(*opts) end end # :call-seq: - # on_assoc_new: (untyped key, untyped value) -> AssocNew + # on_assoc_new: (untyped key, untyped value) -> Assoc def on_assoc_new(key, value) - AssocNew.new( + Assoc.new( key: key, value: value, location: key.location.to(value.location) diff --git a/src/ruby/toProc.ts b/src/ruby/toProc.ts index aba4c4c9..5ad82131 100644 --- a/src/ruby/toProc.ts +++ b/src/ruby/toProc.ts @@ -92,8 +92,8 @@ function toProc( parentNode = path.getParentNode(2); } - if (parentNode && parentNode.type === "assoc_new") { - const assocNode = parentNode as Ruby.AssocNew; + if (parentNode && parentNode.type === "assoc") { + const assocNode = parentNode as Ruby.Assoc; const key = assocNode.key; if (key.type === "label" && ["if:", "unless:"].includes(key.value)) { diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 4ce47e70..a11652f2 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -13,7 +13,7 @@ type ParserEvent> = { type: T, loc: Location } & // This is the main expression type that goes in places where the AST will // accept just about anything. // eslint-disable-next-line @typescript-eslint/ban-types -export type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgParen | Args | ArgsAddBlock | ArgsForward | ArgStar | Array | Aryptn | Assign | AssocNew | AssocSplat | AssoclistFromArgs | BEGIN | Backref | Backtick | BareAssocHash | Begin | Binary | BlockVar | Blockarg | Bodystmt | BraceBlock | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | DefEndless | DoBlock | Dot2 | Dot3 | DynaSymbol | END | Else | Elsif | EndContent | Ensure | ExcessedComma | Fcall | Field | Float | FndPtn | For | GVar | Hash | Heredoc | HeredocBegin | Hshptn | IVar | Identifier | If | IfModifier | Imaginary | In | Int | Keyword | KeywordRestParam | Label | Lambda | Lbrace | Lparen | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Not | Op | Opassign | Params | Paren | Period | Program | Qwords | Qsymbols | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueEx | RescueModifier | RestParam | Retry | Return | Return0 | Sclass | Statements | StringConcat | StringDVar | StringEmbExpr | StringLiteral | Super | Symbols | SymbolLiteral | TStringContent | Ternary | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VCall | VarAlias | VarField | VarRef | VoidStmt | When | While | WhileModifier | Word | Words | XStringLiteral | Yield | Yield0 | Zsuper +export type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgParen | Args | ArgsAddBlock | ArgsForward | ArgStar | Array | Aryptn | Assign | Assoc | AssocSplat | AssoclistFromArgs | BEGIN | Backref | Backtick | BareAssocHash | Begin | Binary | BlockVar | Blockarg | Bodystmt | BraceBlock | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | DefEndless | DoBlock | Dot2 | Dot3 | DynaSymbol | END | Else | Elsif | EndContent | Ensure | ExcessedComma | Fcall | Field | Float | FndPtn | For | GVar | Hash | Heredoc | HeredocBegin | Hshptn | IVar | Identifier | If | IfModifier | Imaginary | In | Int | Keyword | KeywordRestParam | Label | Lambda | Lbrace | Lparen | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Not | Op | Opassign | Params | Paren | Period | Program | Qwords | Qsymbols | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueEx | RescueModifier | RestParam | Retry | Return | Return0 | Sclass | Statements | StringConcat | StringDVar | StringEmbExpr | StringLiteral | Super | Symbols | SymbolLiteral | TStringContent | Ternary | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VCall | VarAlias | VarField | VarRef | VoidStmt | When | While | WhileModifier | Word | Words | XStringLiteral | Yield | Yield0 | Zsuper // This is a special scanner event that contains a comment. It can be attached // to almost any kind of node, which is why it's pulled out here separately. @@ -106,8 +106,8 @@ export type Word = ParserEvent<"word", { parts: StringContent[] }>; export type Words = ParserEvent<"words", { elems: Word[] }>; // These are various parser events that have to do with hashes. -type HashContent = AssocNew | AssocSplat; -export type AssocNew = ParserEvent<"assoc_new", { key: AnyNode, value: AnyNode }>; +type HashContent = Assoc | AssocSplat; +export type Assoc = ParserEvent<"assoc", { key: AnyNode, value: AnyNode }>; export type AssocSplat = ParserEvent<"assoc_splat", { value: AnyNode }>; export type AssoclistFromArgs = ParserEvent<"assoclist_from_args", { assocs: HashContent[] }>; export type BareAssocHash = ParserEvent<"bare_assoc_hash", { assocs: HashContent[] }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index f77b9d0c..57a95681 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -60,7 +60,7 @@ function getChildNodes(node: AnyNode): ChildNode[] { return [node.constant, ...node.reqs, node.rest, ...node.posts]; case "assign": return [node.target, node.value]; - case "assoc_new": + case "assoc": return [node.key, node.value]; case "assoc_splat": return [node.value]; diff --git a/src/utils/inlineEnsureParens.ts b/src/utils/inlineEnsureParens.ts index d5cb1557..4f5938f2 100644 --- a/src/utils/inlineEnsureParens.ts +++ b/src/utils/inlineEnsureParens.ts @@ -3,7 +3,7 @@ import type { Plugin, Ruby } from "../types"; const needsParens = [ "args", "assign", - "assoc_new", + "assoc", "binary", "call", "massign", diff --git a/test/js/ruby/nodes/conditionals.test.ts b/test/js/ruby/nodes/conditionals.test.ts index cbd3c15b..1ca139b8 100644 --- a/test/js/ruby/nodes/conditionals.test.ts +++ b/test/js/ruby/nodes/conditionals.test.ts @@ -740,7 +740,7 @@ describe("conditionals", () => { ); }); - test("assoc_new", () => { + test("assoc", () => { expect(`{ foo: ${keyword} bar? then baz end }`).toChangeFormat( `{ foo: (baz ${keyword} bar?) }` ); diff --git a/test/js/ruby/nodes/loops.test.ts b/test/js/ruby/nodes/loops.test.ts index 69056d03..6512fda7 100644 --- a/test/js/ruby/nodes/loops.test.ts +++ b/test/js/ruby/nodes/loops.test.ts @@ -166,7 +166,7 @@ describe.each(["while", "until"])("%s", (keyword) => { ); }); - test("assoc_new", () => { + test("assoc", () => { expect(`{ foo: ${keyword} bar? do baz end }`).toChangeFormat( `{ foo: (baz ${keyword} bar?) }` ); diff --git a/test/rb/metadata_test.rb b/test/rb/metadata_test.rb index 3d04f55d..240fb6ec 100644 --- a/test/rb/metadata_test.rb +++ b/test/rb/metadata_test.rb @@ -95,9 +95,9 @@ def test_assign assert_metadata SyntaxTree::Assign, 'foo = bar' end - def test_assoc_new + def test_assoc assert_node_metadata( - SyntaxTree::AssocNew, + SyntaxTree::Assoc, parse('{ foo: bar, bar: baz }').contents.assocs.first, start_char: 2, end_char: 10 From ee89cffdb2acd4cdb28f5e9d410c73f7649a3c08 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 16 Nov 2021 21:00:39 -0500 Subject: [PATCH 425/785] MLHSAddStar -> MLHS + ArgStar --- src/ruby/nodes.ts | 2 - src/ruby/nodes/args.ts | 3 +- src/ruby/nodes/massign.ts | 15 ------- src/ruby/parser.rb | 81 ++++++++++---------------------------- src/ruby/printer.ts | 1 - src/types/ruby.ts | 11 +++--- src/utils/getChildNodes.ts | 2 - test/rb/metadata_test.rb | 6 +-- 8 files changed, 30 insertions(+), 91 deletions(-) diff --git a/src/ruby/nodes.ts b/src/ruby/nodes.ts index 86ca755b..445a6d7a 100644 --- a/src/ruby/nodes.ts +++ b/src/ruby/nodes.ts @@ -65,7 +65,6 @@ import { printMAssign, printMLHS, printMLHSAddPost, - printMLHSAddStar, printMLHSParen, printMRHS, printMRHSAddStar, @@ -236,7 +235,6 @@ const nodes: Record< method_add_block: printMethodAddBlock, mlhs: printMLHS, mlhs_add_post: printMLHSAddPost, - mlhs_add_star: printMLHSAddStar, mlhs_paren: printMLHSParen, module: printModule, mrhs: printMRHS, diff --git a/src/ruby/nodes/args.ts b/src/ruby/nodes/args.ts index a8c34350..6e1d142f 100644 --- a/src/ruby/nodes/args.ts +++ b/src/ruby/nodes/args.ts @@ -167,5 +167,6 @@ export const printArgStar: Plugin.Printer = ( opts, print ) => { - return ["*", path.call(print, "value")]; + const node = path.getValue(); + return node.value ? ["*", path.call(print, "value")] : "*"; }; diff --git a/src/ruby/nodes/massign.ts b/src/ruby/nodes/massign.ts index 1f1d4a4c..95f57e21 100644 --- a/src/ruby/nodes/massign.ts +++ b/src/ruby/nodes/massign.ts @@ -42,21 +42,6 @@ export const printMLHSAddPost: Plugin.Printer = ( ]; }; -export const printMLHSAddStar: Plugin.Printer = ( - path, - opts, - print -) => { - const node = path.getValue(); - const parts: Plugin.Doc[] = ["*"]; - - if (node.star) { - parts.push(path.call(print, "star")); - } - - return [...(path.call(print, "mlhs") as Plugin.Doc[]), parts]; -}; - export const printMLHSParen: Plugin.Printer = ( path, opts, diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 4f2ba755..48ebe92e 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -830,7 +830,7 @@ def on_args_add_block(arguments, block) # method(*arguments) # class ArgStar - # [untyped] the expression being splatted + # [nil | untyped] the expression being splatted attr_reader :value # [Location] the location of this node @@ -3855,7 +3855,7 @@ def on_fndptn(constant, left, values, right) # end # class For - # [MLHS | MLHSAddStar | VarField] the variable declaration being used to + # [MLHS | VarField] the variable declaration being used to # pull values out of the object being enumerated attr_reader :index @@ -3903,7 +3903,7 @@ def to_json(*opts) # :call-seq: # on_for: ( - # (MLHS | MLHSAddStar | VarField) value, + # (MLHS | VarField) value, # untyped collection, # Statements statements # ) -> For @@ -5238,8 +5238,8 @@ def on_method_add_block(call, block) # first, second, third = value # class MLHS - # Array[ARefField | Field | Ident | MlhsParen | VarField] the parts of - # the left-hand side of a multiple assignment + # Array[ARefField | ArgStar | Field | Ident | MlhsParen | VarField] the + # parts of the left-hand side of a multiple assignment attr_reader :parts # [boolean] whether or not there is a trailing comma at the end of this @@ -5276,14 +5276,14 @@ def to_json(*opts) # (ARefField | Field | Ident | MlhsParen | VarField) part # ) -> MLHS def on_mlhs_add(mlhs, part) - if mlhs.parts.empty? - MLHS.new(parts: [part], location: part.location) - else - MLHS.new( - parts: mlhs.parts << part, - location: mlhs.location.to(part.location) - ) - end + location = + if mlhs.parts.empty? + part.location + else + mlhs.location.to(part.location) + end + + MLHS.new(parts: mlhs.parts << part, location: location) end # MLHSAddPost represents adding another set of variables onto a list of @@ -5327,7 +5327,7 @@ def to_json(*opts) end # :call-seq: - # on_mlhs_add_post: (MLHSAddStar star, MLHS mlhs) -> MLHSAddPost + # on_mlhs_add_post: (MLHS star, MLHS mlhs) -> MLHSAddPost def on_mlhs_add_post(star, mlhs) MLHSAddPost.new( star: star, @@ -5336,61 +5336,20 @@ def on_mlhs_add_post(star, mlhs) ) end - # MLHSAddStar represents a splatted variable inside of a multiple assignment - # on the left hand side. - # - # first, *rest = values - # - class MLHSAddStar - # [MLHS] the values before the starred expression - attr_reader :mlhs - - # [nil | ARefField | Field | Ident | VarField] the expression being - # splatted - attr_reader :star - - # [Location] the location of this node - attr_reader :location - - def initialize(mlhs:, star:, location:) - @mlhs = mlhs - @star = star - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('mlhs_add_star') - - q.breakable - q.pp(mlhs) - - q.breakable - q.pp(star) - end - end - - def to_json(*opts) - { type: :mlhs_add_star, mlhs: mlhs, star: star, loc: location }.to_json( - *opts - ) - end - end - # :call-seq: # on_mlhs_add_star: ( # MLHS mlhs, # (nil | ARefField | Field | Ident | VarField) part - # ) -> MLHSAddStar + # ) -> MLHS def on_mlhs_add_star(mlhs, part) beginning = find_token(Op, '*') ending = part || beginning - MLHSAddStar.new( - mlhs: mlhs, - star: part, - location: beginning.location.to(ending.location) - ) + location = beginning.location.to(ending.location) + arg_star = ArgStar.new(value: part, location: location) + + location = mlhs.location.to(location) unless mlhs.parts.empty? + MLHS.new(parts: mlhs.parts << arg_star, location: location) end # :call-seq: diff --git a/src/ruby/printer.ts b/src/ruby/printer.ts index 1ccf615b..714bfaf9 100644 --- a/src/ruby/printer.ts +++ b/src/ruby/printer.ts @@ -12,7 +12,6 @@ const noComments = [ "args_add_block", "mlhs", "mlhs_add_post", - "mlhs_add_star", "mlhs_paren" ]; diff --git a/src/types/ruby.ts b/src/types/ruby.ts index a11652f2..bc0dc6ac 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -13,7 +13,7 @@ type ParserEvent> = { type: T, loc: Location } & // This is the main expression type that goes in places where the AST will // accept just about anything. // eslint-disable-next-line @typescript-eslint/ban-types -export type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgParen | Args | ArgsAddBlock | ArgsForward | ArgStar | Array | Aryptn | Assign | Assoc | AssocSplat | AssoclistFromArgs | BEGIN | Backref | Backtick | BareAssocHash | Begin | Binary | BlockVar | Blockarg | Bodystmt | BraceBlock | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | DefEndless | DoBlock | Dot2 | Dot3 | DynaSymbol | END | Else | Elsif | EndContent | Ensure | ExcessedComma | Fcall | Field | Float | FndPtn | For | GVar | Hash | Heredoc | HeredocBegin | Hshptn | IVar | Identifier | If | IfModifier | Imaginary | In | Int | Keyword | KeywordRestParam | Label | Lambda | Lbrace | Lparen | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Not | Op | Opassign | Params | Paren | Period | Program | Qwords | Qsymbols | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueEx | RescueModifier | RestParam | Retry | Return | Return0 | Sclass | Statements | StringConcat | StringDVar | StringEmbExpr | StringLiteral | Super | Symbols | SymbolLiteral | TStringContent | Ternary | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VCall | VarAlias | VarField | VarRef | VoidStmt | When | While | WhileModifier | Word | Words | XStringLiteral | Yield | Yield0 | Zsuper +export type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgParen | Args | ArgsAddBlock | ArgsForward | ArgStar | Array | Aryptn | Assign | Assoc | AssocSplat | AssoclistFromArgs | BEGIN | Backref | Backtick | BareAssocHash | Begin | Binary | BlockVar | Blockarg | Bodystmt | BraceBlock | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | DefEndless | DoBlock | Dot2 | Dot3 | DynaSymbol | END | Else | Elsif | EndContent | Ensure | ExcessedComma | Fcall | Field | Float | FndPtn | For | GVar | Hash | Heredoc | HeredocBegin | Hshptn | IVar | Identifier | If | IfModifier | Imaginary | In | Int | Keyword | KeywordRestParam | Label | Lambda | Lbrace | Lparen | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsAddPost | MlhsParen | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Not | Op | Opassign | Params | Paren | Period | Program | Qwords | Qsymbols | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueEx | RescueModifier | RestParam | Retry | Return | Return0 | Sclass | Statements | StringConcat | StringDVar | StringEmbExpr | StringLiteral | Super | Symbols | SymbolLiteral | TStringContent | Ternary | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VCall | VarAlias | VarField | VarRef | VoidStmt | When | While | WhileModifier | Word | Words | XStringLiteral | Yield | Yield0 | Zsuper // This is a special scanner event that contains a comment. It can be attached // to almost any kind of node, which is why it's pulled out here separately. @@ -124,11 +124,10 @@ export type TopConstField = ParserEvent<"top_const_field", { constant: Const }>; export type VarField = ParserEvent<"var_field", { value: null | Const | CVar | GVar | Identifier | IVar }>; // These are various parser events that have to do with multiple assignment. -export type Massign = ParserEvent<"massign", { target: Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen, value: AnyNode }>; +export type Massign = ParserEvent<"massign", { target: Mlhs | MlhsAddPost | MlhsParen, value: AnyNode }>; export type Mlhs = ParserEvent<"mlhs", { parts: (ArefField | Field | Identifier | MlhsParen | VarField)[], comma: undefined | true }>; -export type MlhsAddPost = ParserEvent<"mlhs_add_post", { star: MlhsAddStar, mlhs: Mlhs }>; -export type MlhsAddStar = ParserEvent<"mlhs_add_star", { mlhs: Mlhs, star: null | ArefField | Field | Identifier | VarField }>; -export type MlhsParen = ParserEvent<"mlhs_paren", { cnts: Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen }>; +export type MlhsAddPost = ParserEvent<"mlhs_add_post", { star: Mlhs, mlhs: Mlhs }>; +export type MlhsParen = ParserEvent<"mlhs_paren", { cnts: Mlhs | MlhsAddPost | MlhsParen }>; export type Mrhs = ParserEvent<"mrhs", { parts: AnyNode[] }>; export type MrhsAddStar = ParserEvent<"mrhs_add_star", { mrhs: Mrhs | MrhsNewFromArgs, star: AnyNode }>; export type MrhsNewFromArgs = ParserEvent<"mrhs_new_from_args", { args: Args }>; @@ -138,7 +137,7 @@ export type Case = ParserEvent<"case", { value: AnyNode, cons: In | When }>; export type Else = ParserEvent<"else", { stmts: Statements }>; export type Elsif = ParserEvent<"elsif", { pred: AnyNode, stmts: Statements, cons: null | Elsif | Else }>; export type Ensure = ParserEvent<"ensure", { keyword: Keyword, stmts: Statements }>; -export type For = ParserEvent<"for", { index: Mlhs | MlhsAddStar | VarField, collection: AnyNode, stmts: Statements }>; +export type For = ParserEvent<"for", { index: Mlhs | VarField, collection: AnyNode, stmts: Statements }>; export type If = ParserEvent<"if", { pred: AnyNode, stmts: Statements, cons: null | Elsif | Else }>; export type IfModifier = ParserEvent<"if_mod", { pred: AnyNode, stmt: AnyNode }>; export type In = ParserEvent<"in", { pattern: AnyNode, stmts: Statements, cons: null | In | Else }>; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 57a95681..ffc52b6f 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -185,8 +185,6 @@ function getChildNodes(node: AnyNode): ChildNode[] { return node.parts; case "mlhs_add_post": return [node.star, node.mlhs]; - case "mlhs_add_star": - return [node.mlhs, node.star]; case "mlhs_paren": return [node.cnts]; case "module": diff --git a/test/rb/metadata_test.rb b/test/rb/metadata_test.rb index 240fb6ec..cbed7301 100644 --- a/test/rb/metadata_test.rb +++ b/test/rb/metadata_test.rb @@ -442,16 +442,16 @@ def test_mlhs_add_post assert_node_metadata( SyntaxTree::MLHSAddPost, parse('foo, *bar, baz = 1, 2, 3').target, - start_char: 5, + start_char: 0, end_char: 14 ) end def test_mlhs_add_star assert_node_metadata( - SyntaxTree::MLHSAddStar, + SyntaxTree::MLHS, parse('foo, *bar = 1, 2, 3').target, - start_char: 5, + start_char: 0, end_char: 9 ) end From 46629686ed3d81b737b7441d481bbb3d826f217b Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 16 Nov 2021 21:05:53 -0500 Subject: [PATCH 426/785] MLHSAddPost -> MLHS + MLHS --- src/ruby/nodes.ts | 2 -- src/ruby/nodes/massign.ts | 11 ------- src/ruby/parser.rb | 66 ++++++--------------------------------- src/types/ruby.ts | 7 ++--- test/rb/metadata_test.rb | 2 +- 5 files changed, 13 insertions(+), 75 deletions(-) diff --git a/src/ruby/nodes.ts b/src/ruby/nodes.ts index 445a6d7a..805ae81a 100644 --- a/src/ruby/nodes.ts +++ b/src/ruby/nodes.ts @@ -64,7 +64,6 @@ import { printFor, printUntil, printWhile } from "./nodes/loops"; import { printMAssign, printMLHS, - printMLHSAddPost, printMLHSParen, printMRHS, printMRHSAddStar, @@ -234,7 +233,6 @@ const nodes: Record< method_add_arg: printMethodAddArg, method_add_block: printMethodAddBlock, mlhs: printMLHS, - mlhs_add_post: printMLHSAddPost, mlhs_paren: printMLHSParen, module: printModule, mrhs: printMRHS, diff --git a/src/ruby/nodes/massign.ts b/src/ruby/nodes/massign.ts index 95f57e21..6b7b2298 100644 --- a/src/ruby/nodes/massign.ts +++ b/src/ruby/nodes/massign.ts @@ -31,17 +31,6 @@ export const printMLHS: Plugin.Printer = (path, opts, print) => { return path.map(print, "parts"); }; -export const printMLHSAddPost: Plugin.Printer = ( - path, - opts, - print -) => { - return [ - ...(path.call(print, "star") as Plugin.Doc[]), - ...(path.call(print, "mlhs") as Plugin.Doc[]) - ]; -}; - export const printMLHSParen: Plugin.Printer = ( path, opts, diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 48ebe92e..e94839aa 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -5060,8 +5060,7 @@ def on_lparen(value) # first, = value # class MAssign - # [Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen] the target of the multiple - # assignment + # [Mlhs | MlhsParen] the target of the multiple assignment attr_reader :target # [untyped] the value being assigned @@ -5096,10 +5095,7 @@ def to_json(*opts) end # :call-seq: - # on_massign: ( - # (Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen) target, - # untyped value - # ) -> MAssign + # on_massign: ((Mlhs | MlhsParen) target, untyped value) -> MAssign def on_massign(target, value) comma_range = target.location.end_char...value.location.start_char target.comma = true if source[comma_range].strip.start_with?(',') @@ -5286,53 +5282,12 @@ def on_mlhs_add(mlhs, part) MLHS.new(parts: mlhs.parts << part, location: location) end - # MLHSAddPost represents adding another set of variables onto a list of - # assignments after a splat variable within a multiple assignment. - # - # left, *middle, right = values - # - class MLHSAddPost - # [MlhsAddStar] the value being starred - attr_reader :star - - # [Mlhs] the values after the star - attr_reader :mlhs - - # [Location] the location of this node - attr_reader :location - - def initialize(star:, mlhs:, location:) - @star = star - @mlhs = mlhs - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('mlhs_add_post') - - q.breakable - q.pp(star) - - q.breakable - q.pp(mlhs) - end - end - - def to_json(*opts) - { type: :mlhs_add_post, star: star, mlhs: mlhs, loc: location }.to_json( - *opts - ) - end - end - # :call-seq: - # on_mlhs_add_post: (MLHS star, MLHS mlhs) -> MLHSAddPost - def on_mlhs_add_post(star, mlhs) - MLHSAddPost.new( - star: star, - mlhs: mlhs, - location: star.location.to(mlhs.location) + # on_mlhs_add_post: (MLHS left, MLHS right) -> MLHS + def on_mlhs_add_post(left, right) + MLHS.new( + parts: left.parts + right.parts, + location: left.location.to(right.location) ) end @@ -5364,8 +5319,7 @@ def on_mlhs_new # (left, right) = value # class MLHSParen - # [Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen] the contents inside of the - # parentheses + # [Mlhs | MlhsParen] the contents inside of the parentheses attr_reader :contents # [Location] the location of this node @@ -5391,9 +5345,7 @@ def to_json(*opts) end # :call-seq: - # on_mlhs_paren: ( - # (Mlhs | MlhsAddPost | MlhsAddStar | MlhsParen) contents - # ) -> MLHSParen + # on_mlhs_paren: ((Mlhs | MlhsParen) contents) -> MLHSParen def on_mlhs_paren(contents) lparen = find_token(LParen) rparen = find_token(RParen) diff --git a/src/types/ruby.ts b/src/types/ruby.ts index bc0dc6ac..93788135 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -13,7 +13,7 @@ type ParserEvent> = { type: T, loc: Location } & // This is the main expression type that goes in places where the AST will // accept just about anything. // eslint-disable-next-line @typescript-eslint/ban-types -export type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgParen | Args | ArgsAddBlock | ArgsForward | ArgStar | Array | Aryptn | Assign | Assoc | AssocSplat | AssoclistFromArgs | BEGIN | Backref | Backtick | BareAssocHash | Begin | Binary | BlockVar | Blockarg | Bodystmt | BraceBlock | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | DefEndless | DoBlock | Dot2 | Dot3 | DynaSymbol | END | Else | Elsif | EndContent | Ensure | ExcessedComma | Fcall | Field | Float | FndPtn | For | GVar | Hash | Heredoc | HeredocBegin | Hshptn | IVar | Identifier | If | IfModifier | Imaginary | In | Int | Keyword | KeywordRestParam | Label | Lambda | Lbrace | Lparen | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsAddPost | MlhsParen | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Not | Op | Opassign | Params | Paren | Period | Program | Qwords | Qsymbols | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueEx | RescueModifier | RestParam | Retry | Return | Return0 | Sclass | Statements | StringConcat | StringDVar | StringEmbExpr | StringLiteral | Super | Symbols | SymbolLiteral | TStringContent | Ternary | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VCall | VarAlias | VarField | VarRef | VoidStmt | When | While | WhileModifier | Word | Words | XStringLiteral | Yield | Yield0 | Zsuper +export type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgParen | Args | ArgsAddBlock | ArgsForward | ArgStar | Array | Aryptn | Assign | Assoc | AssocSplat | AssoclistFromArgs | BEGIN | Backref | Backtick | BareAssocHash | Begin | Binary | BlockVar | Blockarg | Bodystmt | BraceBlock | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | DefEndless | DoBlock | Dot2 | Dot3 | DynaSymbol | END | Else | Elsif | EndContent | Ensure | ExcessedComma | Fcall | Field | Float | FndPtn | For | GVar | Hash | Heredoc | HeredocBegin | Hshptn | IVar | Identifier | If | IfModifier | Imaginary | In | Int | Keyword | KeywordRestParam | Label | Lambda | Lbrace | Lparen | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsParen | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Not | Op | Opassign | Params | Paren | Period | Program | Qwords | Qsymbols | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueEx | RescueModifier | RestParam | Retry | Return | Return0 | Sclass | Statements | StringConcat | StringDVar | StringEmbExpr | StringLiteral | Super | Symbols | SymbolLiteral | TStringContent | Ternary | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VCall | VarAlias | VarField | VarRef | VoidStmt | When | While | WhileModifier | Word | Words | XStringLiteral | Yield | Yield0 | Zsuper // This is a special scanner event that contains a comment. It can be attached // to almost any kind of node, which is why it's pulled out here separately. @@ -124,10 +124,9 @@ export type TopConstField = ParserEvent<"top_const_field", { constant: Const }>; export type VarField = ParserEvent<"var_field", { value: null | Const | CVar | GVar | Identifier | IVar }>; // These are various parser events that have to do with multiple assignment. -export type Massign = ParserEvent<"massign", { target: Mlhs | MlhsAddPost | MlhsParen, value: AnyNode }>; +export type Massign = ParserEvent<"massign", { target: Mlhs | MlhsParen, value: AnyNode }>; export type Mlhs = ParserEvent<"mlhs", { parts: (ArefField | Field | Identifier | MlhsParen | VarField)[], comma: undefined | true }>; -export type MlhsAddPost = ParserEvent<"mlhs_add_post", { star: Mlhs, mlhs: Mlhs }>; -export type MlhsParen = ParserEvent<"mlhs_paren", { cnts: Mlhs | MlhsAddPost | MlhsParen }>; +export type MlhsParen = ParserEvent<"mlhs_paren", { cnts: Mlhs | MlhsParen }>; export type Mrhs = ParserEvent<"mrhs", { parts: AnyNode[] }>; export type MrhsAddStar = ParserEvent<"mrhs_add_star", { mrhs: Mrhs | MrhsNewFromArgs, star: AnyNode }>; export type MrhsNewFromArgs = ParserEvent<"mrhs_new_from_args", { args: Args }>; diff --git a/test/rb/metadata_test.rb b/test/rb/metadata_test.rb index cbed7301..8b54ac6c 100644 --- a/test/rb/metadata_test.rb +++ b/test/rb/metadata_test.rb @@ -440,7 +440,7 @@ def test_mlhs def test_mlhs_add_post assert_node_metadata( - SyntaxTree::MLHSAddPost, + SyntaxTree::MLHS, parse('foo, *bar, baz = 1, 2, 3').target, start_char: 0, end_char: 14 From 1629200ab4005c4ce5570287ba52dcc31978cd2d Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 16 Nov 2021 21:18:45 -0500 Subject: [PATCH 427/785] Split out array contents --- src/ruby/nodes/arrays.ts | 6 ------ src/ruby/parser.rb | 15 ++++++--------- src/types/ruby.ts | 2 +- test/rb/metadata_test.rb | 38 ++++---------------------------------- 4 files changed, 11 insertions(+), 50 deletions(-) diff --git a/src/ruby/nodes/arrays.ts b/src/ruby/nodes/arrays.ts index f3793f4e..06ef07cf 100644 --- a/src/ruby/nodes/arrays.ts +++ b/src/ruby/nodes/arrays.ts @@ -100,12 +100,6 @@ export const printArray: Plugin.Printer = (path, opts, print) => { return printEmptyCollection(path, opts, "[", "]"); } - // If we don't have a regular args node at this point then we have a special - // array literal. In that case we're going to print out just the contents. - if (contents.type !== "args") { - return path.call(print, "cnts"); - } - if (opts.rubyArrayLiteral) { // If we have an array that contains only simple string literals with no // spaces or interpolation, then we're going to print a %w array. diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index e94839aa..8ebd69de 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -974,9 +974,8 @@ def to_json(*opts) end # :call-seq: - # on_array: ( - # (nil | Args | QSymbols | QWords | Symbols | Words) contents - # ) -> ArrayLiteral + # on_array: ((nil | Args) contents) -> + # ArrayLiteral | QSymbols | QWords | Symbols | Words def on_array(contents) if !contents || contents.is_a?(Args) lbracket = find_token(LBracket) @@ -988,13 +987,11 @@ def on_array(contents) ) else tstring_end = find_token(TStringEnd) - contents = - contents.class.new( - elements: contents.elements, - location: contents.location.to(tstring_end.location) - ) - ArrayLiteral.new(contents: contents, location: contents.location) + contents.class.new( + elements: contents.elements, + location: contents.location.to(tstring_end.location) + ) end end diff --git a/src/types/ruby.ts b/src/types/ruby.ts index 93788135..56c3a4c5 100644 --- a/src/types/ruby.ts +++ b/src/types/ruby.ts @@ -98,7 +98,7 @@ export type SymbolLiteral = ParserEvent<"symbol_literal", { value: Backtick | Co export type XStringLiteral = ParserEvent<"xstring_literal", { parts: StringContent[] }>; // These are various parser events that have to do with arrays. -export type Array = ParserEvent<"array", { cnts: null | Args | Qsymbols | Qwords | Symbols | Words }>; +export type Array = ParserEvent<"array", { cnts: null | Args }>; export type Qsymbols = ParserEvent<"qsymbols", { elems: TStringContent[] }>; export type Qwords = ParserEvent<"qwords", { elems: TStringContent[] }>; export type Symbols = ParserEvent<"symbols", { elems: Word[] }>; diff --git a/test/rb/metadata_test.rb b/test/rb/metadata_test.rb index 8b54ac6c..a9ae45b6 100644 --- a/test/rb/metadata_test.rb +++ b/test/rb/metadata_test.rb @@ -31,16 +31,6 @@ def test_array_args SOURCE end - def test_array_qwords - assert_metadata SyntaxTree::ArrayLiteral, <<~SOURCE - %w[ - foo - bar - baz - ] - SOURCE - end - def test_aref assert_metadata SyntaxTree::ARef, 'foo[bar]' end @@ -513,21 +503,11 @@ def test_paren end def test_qsymbols - assert_node_metadata( - SyntaxTree::QSymbols, - parse('%i[foo bar baz]').contents, - start_char: 0, - end_char: 15 - ) + assert_metadata SyntaxTree::QSymbols, '%i[foo bar baz]' end def test_qwords - assert_node_metadata( - SyntaxTree::QWords, - parse('%w[foo bar baz]').contents, - start_char: 0, - end_char: 15 - ) + assert_metadata SyntaxTree::QWords, '%w[foo bar baz]' end def test_redo @@ -629,12 +609,7 @@ def test_symbol_literal end def test_symbols - assert_node_metadata( - SyntaxTree::Symbols, - parse('%I[f#{o}o b#{a}r b#{a}z]').contents, - start_char: 0, - end_char: 24 - ) + assert_metadata SyntaxTree::Symbols, '%I[f#{o}o b#{a}r b#{a}z]' end def test_top_const_field @@ -735,12 +710,7 @@ def test_while_mod end def test_words - assert_node_metadata( - SyntaxTree::Words, - parse('%W[f#{o}o b#{a}r b#{a}z]').contents, - start_char: 0, - end_char: 24 - ) + assert_metadata SyntaxTree::Words, '%W[f#{o}o b#{a}r b#{a}z]' end def test_xstring From 504d62a38e26ebe77c4e990160cc27687262e832 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 18 Nov 2021 10:11:48 -0500 Subject: [PATCH 428/785] Fix up RBS --- bin/print.ts | 5 +++-- src/parser/server.rb | 3 +++ src/rbs/parser.rb | 20 ++++++++++++++++++-- src/rbs/printer.ts | 2 +- src/ruby/printer.ts | 1 - src/utils/getChildNodes.ts | 2 -- test/js/rbs/rbs.test.ts | 14 ++++++-------- 7 files changed, 31 insertions(+), 16 deletions(-) diff --git a/bin/print.ts b/bin/print.ts index 05188d8a..2f5b3934 100755 --- a/bin/print.ts +++ b/bin/print.ts @@ -27,7 +27,8 @@ if (fs.existsSync(process.argv[contentIdx])) { const { formatted } = prettier.formatWithCursor(content, { parser, plugins: [plugin as any as string], // hacky, but it works - cursorOffset: 1 -}); + cursorOffset: 1, + rubySingleQuote: false +} as any); console.log(formatted); diff --git a/src/parser/server.rb b/src/parser/server.rb index 473671dc..f493f61b 100644 --- a/src/parser/server.rb +++ b/src/parser/server.rb @@ -6,6 +6,9 @@ require 'fileutils' require 'open3' +# Ensure the parent module is defined before requiring the parsers. +module Prettier; end + require_relative '../ruby/parser' require_relative '../rbs/parser' require_relative '../haml/parser' diff --git a/src/rbs/parser.rb b/src/rbs/parser.rb index d44ca0e1..39e15075 100644 --- a/src/rbs/parser.rb +++ b/src/rbs/parser.rb @@ -19,6 +19,17 @@ def self.parse(text) return end +# This was removed at some point, so we need to support both versions. +RBS::KEYWORD_RAW = + if RBS::Parser.const_defined?(:KEYWORDS_RE) + RBS::Parser::KEYWORDS_RE + else + RBS::Parser::KEYWORDS.keys.join('|') + end + +# This enforces that the full matched string is a keyword. +RBS::KEYWORD_FULL = /\A#{RBS::KEYWORD_RAW}\z/ + # Monkey-patch this so that we can get the character positions. class RBS::Location def to_json(*args) @@ -40,7 +51,12 @@ def to_json(*args) # Monkey-patch this so that we get whether or not it needs to be escaped. class RBS::Types::Function::Param def to_json(*a) - escaped = name && /\A#{RBS::Parser::KEYWORDS_RE}\z/.match?(name) + escaped = name && RBS::KEYWORD_FULL.match?(name) + + # More modern versions of RBS just include the ` in the name so there's no + # need to escape it further. + escaped = false if name.to_s.start_with?('`') + { type: type, name: name, escaped: escaped }.to_json(*a) end end @@ -71,7 +87,7 @@ def to_json(*a) # Explicitly not using Enumerable#to_h here to support Ruby 2.5 fields.each do |key, type| if key.is_a?(Symbol) && key.match?(/\A[A-Za-z_][A-Za-z_]*\z/) && - !key.match?(RBS::Parser::KEYWORDS_RE) + !key.match?(RBS::KEYWORD_RAW) fields_extra[key] = { type: type, joiner: :label } else fields_extra[key.inspect] = { type: type, joiner: :rocket } diff --git a/src/rbs/printer.ts b/src/rbs/printer.ts index f9277261..09448263 100644 --- a/src/rbs/printer.ts +++ b/src/rbs/printer.ts @@ -265,7 +265,7 @@ const printer: Plugin.PrinterConfig = { // Determine if we're allowed to change the quote based on whether or not // there is an escape sequence in the source string. - const quote = node.literal.includes("\\") + const quote = value.match(new RegExp(`\\\\[^${originalQuote}]`)) ? originalQuote : preferredQuote; diff --git a/src/ruby/printer.ts b/src/ruby/printer.ts index 714bfaf9..c1d55b36 100644 --- a/src/ruby/printer.ts +++ b/src/ruby/printer.ts @@ -11,7 +11,6 @@ const noComments = [ "args", "args_add_block", "mlhs", - "mlhs_add_post", "mlhs_paren" ]; diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index ffc52b6f..33824a39 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -183,8 +183,6 @@ function getChildNodes(node: AnyNode): ChildNode[] { return [node.call, node.block]; case "mlhs": return node.parts; - case "mlhs_add_post": - return [node.star, node.mlhs]; case "mlhs_paren": return [node.cnts]; case "module": diff --git a/test/js/rbs/rbs.test.ts b/test/js/rbs/rbs.test.ts index 00f4cf46..7e7f4fc4 100644 --- a/test/js/rbs/rbs.test.ts +++ b/test/js/rbs/rbs.test.ts @@ -193,7 +193,11 @@ describe("rbs", () => { }); test("keeps string the same when there is an escape sequence", () => { - expect(rbs(`T: "super \\" duper"`)).toMatchFormat(); + expect(rbs(`T: "super \\a duper"`)).toMatchFormat(); + }); + + test("unescapes double quotes when using single quotes", () => { + expect(rbs(`T: "super \\" duper"`)).toChangeFormat(`T: 'super " duper'`); }); test("unescapes single quotes when using double quotes", () => { @@ -237,13 +241,7 @@ describe("rbs", () => { }); }); - describe("plain", () => { - testCases("plain", (source) => `T: ${source}`); - - test("any gets transformed into untyped", () => { - expect(rbs("T: any")).toChangeFormat("T: untyped"); - }); - }); + describeCases("plain", (source) => `T: ${source}`); describe("proc", () => { testCases("proc", (source) => `T: ${source}`); From 30020db83f0b2cb47278738e88f0af9e28552226 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 18 Nov 2021 10:31:20 -0500 Subject: [PATCH 429/785] Reformat --- src/parser/server.rb | 3 ++- src/ruby/parser.rb | 12 ++---------- src/ruby/printer.ts | 7 +------ src/utils/getChildNodes.ts | 2 +- 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/parser/server.rb b/src/parser/server.rb index f493f61b..39c06f7c 100644 --- a/src/parser/server.rb +++ b/src/parser/server.rb @@ -7,7 +7,8 @@ require 'open3' # Ensure the parent module is defined before requiring the parsers. -module Prettier; end +module Prettier +end require_relative '../ruby/parser' require_relative '../rbs/parser' diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index 8ebd69de..fd951e6e 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -1191,11 +1191,7 @@ def to_json(*opts) # :call-seq: # on_assoc_new: (untyped key, untyped value) -> Assoc def on_assoc_new(key, value) - Assoc.new( - key: key, - value: value, - location: key.location.to(value.location) - ) + Assoc.new(key: key, value: value, location: key.location.to(value.location)) end # AssocSplat represents double-splatting a value into a hash (either a hash @@ -5270,11 +5266,7 @@ def to_json(*opts) # ) -> MLHS def on_mlhs_add(mlhs, part) location = - if mlhs.parts.empty? - part.location - else - mlhs.location.to(part.location) - end + mlhs.parts.empty? ? part.location : mlhs.location.to(part.location) MLHS.new(parts: mlhs.parts << part, location: location) end diff --git a/src/ruby/printer.ts b/src/ruby/printer.ts index c1d55b36..f2adeead 100644 --- a/src/ruby/printer.ts +++ b/src/ruby/printer.ts @@ -7,12 +7,7 @@ import nodes from "./nodes"; const { trim } = prettier; -const noComments = [ - "args", - "args_add_block", - "mlhs", - "mlhs_paren" -]; +const noComments = ["args", "args_add_block", "mlhs", "mlhs_paren"]; const printer: Plugin.PrinterConfig = { // Certain nodes are used more for organizational purposed than for actually diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 33824a39..486762d0 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -53,7 +53,7 @@ function getChildNodes(node: AnyNode): ChildNode[] { case "args_forward": return []; case "arg_star": - return [node.value]; + return [node.value]; case "array": return [node.cnts]; case "aryptn": From f9193fb51cb2582dc8da00df94dc9f305c02cac8 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 18 Nov 2021 10:36:01 -0500 Subject: [PATCH 430/785] Drop 2.5 --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 89ecd090..f9fb05b4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,6 @@ jobs: - ubuntu-latest - windows-latest ruby: - - "2.5" - "2.6" - "2.7" - "3.0" From 7db74d4cc255a262af934eb5e3a93d5a98e177a1 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 18 Nov 2021 10:45:20 -0500 Subject: [PATCH 431/785] Bump deps --- package.json | 10 +- yarn.lock | 506 ++++++++++++++++++++++++--------------------------- 2 files changed, 241 insertions(+), 275 deletions(-) diff --git a/package.json b/package.json index e2a69b38..f7099851 100644 --- a/package.json +++ b/package.json @@ -25,17 +25,17 @@ "devDependencies": { "@types/jest": "^27.0.1", "@types/node": "^16.9.1", - "@types/prettier": "^2.3.2", - "@typescript-eslint/eslint-plugin": "^5.2.0", - "@typescript-eslint/parser": "^5.2.0", + "@types/prettier": "^2.4.2", + "@typescript-eslint/eslint-plugin": "^5.4.0", + "@typescript-eslint/parser": "^5.4.0", "eslint": "^8.1.0", "eslint-config-prettier": "^8.0.0", "husky": "^7.0.0", "jest": "^27.0.1", - "pretty-quick": "^3.1.0", + "pretty-quick": "^3.1.2", "ts-jest": "^27.0.5", "ts-node": "^10.2.1", - "typescript": "^4.4.3" + "typescript": "^4.5.2" }, "eslintConfig": { "extends": [ diff --git a/yarn.lock b/yarn.lock index cc880702..b84401cb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,32 +2,32 @@ # yarn lockfile v1 -"@babel/code-frame@^7.12.13", "@babel/code-frame@^7.14.5", "@babel/code-frame@^7.15.8": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.15.8.tgz#45990c47adadb00c03677baa89221f7cc23d2503" - integrity sha512-2IAnmn8zbvC/jKYhq5Ki9I+DwjlrtMPUCH/CpHvqI4dNnlwHwsxoIhlc8WcYY5LSYknXQtAlFYuHfqAFCvQ4Wg== +"@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.0.tgz#0dfc80309beec8411e65e706461c408b0bb9b431" + integrity sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA== dependencies: - "@babel/highlight" "^7.14.5" + "@babel/highlight" "^7.16.0" -"@babel/compat-data@^7.15.0": - version "7.15.0" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.15.0.tgz#2dbaf8b85334796cafbb0f5793a90a2fc010b176" - integrity sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA== +"@babel/compat-data@^7.16.0": + version "7.16.4" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.16.4.tgz#081d6bbc336ec5c2435c6346b2ae1fb98b5ac68e" + integrity sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q== "@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.2", "@babel/core@^7.7.5": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.15.8.tgz#195b9f2bffe995d2c6c159e72fe525b4114e8c10" - integrity sha512-3UG9dsxvYBMYwRv+gS41WKHno4K60/9GPy1CJaH6xy3Elq8CTtvtjT5R5jmNhXfCYLX2mTw+7/aq5ak/gOE0og== - dependencies: - "@babel/code-frame" "^7.15.8" - "@babel/generator" "^7.15.8" - "@babel/helper-compilation-targets" "^7.15.4" - "@babel/helper-module-transforms" "^7.15.8" - "@babel/helpers" "^7.15.4" - "@babel/parser" "^7.15.8" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.6" + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.16.0.tgz#c4ff44046f5fe310525cc9eb4ef5147f0c5374d4" + integrity sha512-mYZEvshBRHGsIAiyH5PzCFTCfbWfoYbO/jcSdXQSUQu1/pW0xDZAUP7KEc32heqWTAfAHhV9j1vH8Sav7l+JNQ== + dependencies: + "@babel/code-frame" "^7.16.0" + "@babel/generator" "^7.16.0" + "@babel/helper-compilation-targets" "^7.16.0" + "@babel/helper-module-transforms" "^7.16.0" + "@babel/helpers" "^7.16.0" + "@babel/parser" "^7.16.0" + "@babel/template" "^7.16.0" + "@babel/traverse" "^7.16.0" + "@babel/types" "^7.16.0" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" @@ -35,113 +35,113 @@ semver "^6.3.0" source-map "^0.5.0" -"@babel/generator@^7.15.4", "@babel/generator@^7.15.8", "@babel/generator@^7.7.2": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.15.8.tgz#fa56be6b596952ceb231048cf84ee499a19c0cd1" - integrity sha512-ECmAKstXbp1cvpTTZciZCgfOt6iN64lR0d+euv3UZisU5awfRawOvg07Utn/qBGuH4bRIEZKrA/4LzZyXhZr8g== +"@babel/generator@^7.16.0", "@babel/generator@^7.7.2": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.16.0.tgz#d40f3d1d5075e62d3500bccb67f3daa8a95265b2" + integrity sha512-RR8hUCfRQn9j9RPKEVXo9LiwoxLPYn6hNZlvUOR8tSnaxlD0p0+la00ZP9/SnRt6HchKr+X0fO2r8vrETiJGew== dependencies: - "@babel/types" "^7.15.6" + "@babel/types" "^7.16.0" jsesc "^2.5.1" source-map "^0.5.0" -"@babel/helper-compilation-targets@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.4.tgz#cf6d94f30fbefc139123e27dd6b02f65aeedb7b9" - integrity sha512-rMWPCirulnPSe4d+gwdWXLfAXTTBj8M3guAf5xFQJ0nvFY7tfNAFnWdqaHegHlgDZOCT4qvhF3BYlSJag8yhqQ== +"@babel/helper-compilation-targets@^7.16.0": + version "7.16.3" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.3.tgz#5b480cd13f68363df6ec4dc8ac8e2da11363cbf0" + integrity sha512-vKsoSQAyBmxS35JUOOt+07cLc6Nk/2ljLIHwmq2/NM6hdioUaqEXq/S+nXvbvXbZkNDlWOymPanJGOc4CBjSJA== dependencies: - "@babel/compat-data" "^7.15.0" + "@babel/compat-data" "^7.16.0" "@babel/helper-validator-option" "^7.14.5" - browserslist "^4.16.6" + browserslist "^4.17.5" semver "^6.3.0" -"@babel/helper-function-name@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.15.4.tgz#845744dafc4381a4a5fb6afa6c3d36f98a787ebc" - integrity sha512-Z91cOMM4DseLIGOnog+Z8OI6YseR9bua+HpvLAQ2XayUGU+neTtX+97caALaLdyu53I/fjhbeCnWnRH1O3jFOw== +"@babel/helper-function-name@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.16.0.tgz#b7dd0797d00bbfee4f07e9c4ea5b0e30c8bb1481" + integrity sha512-BZh4mEk1xi2h4HFjWUXRQX5AEx4rvaZxHgax9gcjdLWdkjsY7MKt5p0otjsg5noXw+pB+clMCjw+aEVYADMjog== dependencies: - "@babel/helper-get-function-arity" "^7.15.4" - "@babel/template" "^7.15.4" - "@babel/types" "^7.15.4" + "@babel/helper-get-function-arity" "^7.16.0" + "@babel/template" "^7.16.0" + "@babel/types" "^7.16.0" -"@babel/helper-get-function-arity@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.15.4.tgz#098818934a137fce78b536a3e015864be1e2879b" - integrity sha512-1/AlxSF92CmGZzHnC515hm4SirTxtpDnLEJ0UyEMgTMZN+6bxXKg04dKhiRx5Enel+SUA1G1t5Ed/yQia0efrA== +"@babel/helper-get-function-arity@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.0.tgz#0088c7486b29a9cb5d948b1a1de46db66e089cfa" + integrity sha512-ASCquNcywC1NkYh/z7Cgp3w31YW8aojjYIlNg4VeJiHkqyP4AzIvr4qx7pYDb4/s8YcsZWqqOSxgkvjUz1kpDQ== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" -"@babel/helper-hoist-variables@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.15.4.tgz#09993a3259c0e918f99d104261dfdfc033f178df" - integrity sha512-VTy085egb3jUGVK9ycIxQiPbquesq0HUQ+tPO0uv5mPEBZipk+5FkRKiWq5apuyTE9FUrjENB0rCf8y+n+UuhA== +"@babel/helper-hoist-variables@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.0.tgz#4c9023c2f1def7e28ff46fc1dbcd36a39beaa81a" + integrity sha512-1AZlpazjUR0EQZQv3sgRNfM9mEVWPK3M6vlalczA+EECcPz3XPh6VplbErL5UoMpChhSck5wAJHthlj1bYpcmg== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" -"@babel/helper-member-expression-to-functions@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.4.tgz#bfd34dc9bba9824a4658b0317ec2fd571a51e6ef" - integrity sha512-cokOMkxC/BTyNP1AlY25HuBWM32iCEsLPI4BHDpJCHHm1FU2E7dKWWIXJgQgSFiu4lp8q3bL1BIKwqkSUviqtA== +"@babel/helper-member-expression-to-functions@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.0.tgz#29287040efd197c77636ef75188e81da8bccd5a4" + integrity sha512-bsjlBFPuWT6IWhl28EdrQ+gTvSvj5tqVP5Xeftp07SEuz5pLnsXZuDkDD3Rfcxy0IsHmbZ+7B2/9SHzxO0T+sQ== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" -"@babel/helper-module-imports@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.15.4.tgz#e18007d230632dea19b47853b984476e7b4e103f" - integrity sha512-jeAHZbzUwdW/xHgHQ3QmWR4Jg6j15q4w/gCfwZvtqOxoo5DKtLHk8Bsf4c5RZRC7NmLEs+ohkdq8jFefuvIxAA== +"@babel/helper-module-imports@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz#90538e60b672ecf1b448f5f4f5433d37e79a3ec3" + integrity sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" -"@babel/helper-module-transforms@^7.15.8": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.15.8.tgz#d8c0e75a87a52e374a8f25f855174786a09498b2" - integrity sha512-DfAfA6PfpG8t4S6npwzLvTUpp0sS7JrcuaMiy1Y5645laRJIp/LiLGIBbQKaXSInK8tiGNI7FL7L8UvB8gdUZg== +"@babel/helper-module-transforms@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.16.0.tgz#1c82a8dd4cb34577502ebd2909699b194c3e9bb5" + integrity sha512-My4cr9ATcaBbmaEa8M0dZNA74cfI6gitvUAskgDtAFmAqyFKDSHQo5YstxPbN+lzHl2D9l/YOEFqb2mtUh4gfA== dependencies: - "@babel/helper-module-imports" "^7.15.4" - "@babel/helper-replace-supers" "^7.15.4" - "@babel/helper-simple-access" "^7.15.4" - "@babel/helper-split-export-declaration" "^7.15.4" + "@babel/helper-module-imports" "^7.16.0" + "@babel/helper-replace-supers" "^7.16.0" + "@babel/helper-simple-access" "^7.16.0" + "@babel/helper-split-export-declaration" "^7.16.0" "@babel/helper-validator-identifier" "^7.15.7" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.6" + "@babel/template" "^7.16.0" + "@babel/traverse" "^7.16.0" + "@babel/types" "^7.16.0" -"@babel/helper-optimise-call-expression@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.15.4.tgz#f310a5121a3b9cc52d9ab19122bd729822dee171" - integrity sha512-E/z9rfbAOt1vDW1DR7k4SzhzotVV5+qMciWV6LaG1g4jeFrkDlJedjtV4h0i4Q/ITnUu+Pk08M7fczsB9GXBDw== +"@babel/helper-optimise-call-expression@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.0.tgz#cecdb145d70c54096b1564f8e9f10cd7d193b338" + integrity sha512-SuI467Gi2V8fkofm2JPnZzB/SUuXoJA5zXe/xzyPP2M04686RzFKFHPK6HDVN6JvWBIEW8tt9hPR7fXdn2Lgpw== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.8.0": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz#5ac822ce97eec46741ab70a517971e443a70c5a9" integrity sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ== -"@babel/helper-replace-supers@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.15.4.tgz#52a8ab26ba918c7f6dee28628b07071ac7b7347a" - integrity sha512-/ztT6khaXF37MS47fufrKvIsiQkx1LBRvSJNzRqmbyeZnTwU9qBxXYLaaT/6KaxfKhjs2Wy8kG8ZdsFUuWBjzw== +"@babel/helper-replace-supers@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.16.0.tgz#73055e8d3cf9bcba8ddb55cad93fedc860f68f17" + integrity sha512-TQxuQfSCdoha7cpRNJvfaYxxxzmbxXw/+6cS7V02eeDYyhxderSoMVALvwupA54/pZcOTtVeJ0xccp1nGWladA== dependencies: - "@babel/helper-member-expression-to-functions" "^7.15.4" - "@babel/helper-optimise-call-expression" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" + "@babel/helper-member-expression-to-functions" "^7.16.0" + "@babel/helper-optimise-call-expression" "^7.16.0" + "@babel/traverse" "^7.16.0" + "@babel/types" "^7.16.0" -"@babel/helper-simple-access@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.15.4.tgz#ac368905abf1de8e9781434b635d8f8674bcc13b" - integrity sha512-UzazrDoIVOZZcTeHHEPYrr1MvTR/K+wgLg6MY6e1CJyaRhbibftF6fR2KU2sFRtI/nERUZR9fBd6aKgBlIBaPg== +"@babel/helper-simple-access@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.16.0.tgz#21d6a27620e383e37534cf6c10bba019a6f90517" + integrity sha512-o1rjBT/gppAqKsYfUdfHq5Rk03lMQrkPHG1OWzHWpLgVXRH4HnMM9Et9CVdIqwkCQlobnGHEJMsgWP/jE1zUiw== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" -"@babel/helper-split-export-declaration@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz#aecab92dcdbef6a10aa3b62ab204b085f776e257" - integrity sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw== +"@babel/helper-split-export-declaration@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.0.tgz#29672f43663e936df370aaeb22beddb3baec7438" + integrity sha512-0YMMRpuDFNGTHNRiiqJX19GjNXA4H0E8jZ2ibccfSxaCogbm3am5WN/2nQNj0YnQwGWM1J06GOcQ2qnh3+0paw== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" -"@babel/helper-validator-identifier@^7.14.5", "@babel/helper-validator-identifier@^7.14.9", "@babel/helper-validator-identifier@^7.15.7": +"@babel/helper-validator-identifier@^7.15.7": version "7.15.7" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz#220df993bfe904a4a6b02ab4f3385a5ebf6e2389" integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w== @@ -151,28 +151,28 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow== -"@babel/helpers@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.15.4.tgz#5f40f02050a3027121a3cf48d497c05c555eaf43" - integrity sha512-V45u6dqEJ3w2rlryYYXf6i9rQ5YMNu4FLS6ngs8ikblhu2VdR1AqAd6aJjBzmf2Qzh6KOLqKHxEN9+TFbAkAVQ== +"@babel/helpers@^7.16.0": + version "7.16.3" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.16.3.tgz#27fc64f40b996e7074dc73128c3e5c3e7f55c43c" + integrity sha512-Xn8IhDlBPhvYTvgewPKawhADichOsbkZuzN7qz2BusOM0brChsyXMDJvldWaYMMUNiCQdQzNEioXTp3sC8Nt8w== dependencies: - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" + "@babel/template" "^7.16.0" + "@babel/traverse" "^7.16.3" + "@babel/types" "^7.16.0" -"@babel/highlight@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9" - integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg== +"@babel/highlight@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.0.tgz#6ceb32b2ca4b8f5f361fb7fd821e3fddf4a1725a" + integrity sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g== dependencies: - "@babel/helper-validator-identifier" "^7.14.5" + "@babel/helper-validator-identifier" "^7.15.7" chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.15.4", "@babel/parser@^7.15.8", "@babel/parser@^7.7.2": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.8.tgz#7bacdcbe71bdc3ff936d510c15dcea7cf0b99016" - integrity sha512-BRYa3wcQnjS/nqI8Ac94pYYpJfojHVvVXJ97+IDCImX4Jc8W8Xv1+47enbruk+q1etOpsQNwnfFcNGw+gtPGxA== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.0", "@babel/parser@^7.16.3", "@babel/parser@^7.7.2": + version "7.16.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.4.tgz#d5f92f57cf2c74ffe9b37981c0e72fee7311372e" + integrity sha512-6V0qdPUaiVHH3RtZeLIsc+6pDhbYzHR8ogA8w+f+Wc77DuXto19g2QUwveINoS34Uw+W8/hQDGJCx+i4n7xcng== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -259,42 +259,42 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-typescript@^7.7.2": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.14.5.tgz#b82c6ce471b165b5ce420cf92914d6fb46225716" - integrity sha512-u6OXzDaIXjEstBRRoBCQ/uKQKlbuaeE5in0RvWdA4pN6AhqxTIwUsnHPU1CFZA/amYObMsuWhYfRl3Ch90HD0Q== + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.0.tgz#2feeb13d9334cc582ea9111d3506f773174179bb" + integrity sha512-Xv6mEXqVdaqCBfJFyeab0fH2DnUoMsDmhamxsSi4j8nLd4Vtw213WMJr55xxqipC/YVWyPY3K0blJncPYji+dQ== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/template@^7.15.4", "@babel/template@^7.3.3": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.15.4.tgz#51898d35dcf3faa670c4ee6afcfd517ee139f194" - integrity sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/parser" "^7.15.4" - "@babel/types" "^7.15.4" - -"@babel/traverse@^7.1.0", "@babel/traverse@^7.15.4", "@babel/traverse@^7.7.2": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.15.4.tgz#ff8510367a144bfbff552d9e18e28f3e2889c22d" - integrity sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/generator" "^7.15.4" - "@babel/helper-function-name" "^7.15.4" - "@babel/helper-hoist-variables" "^7.15.4" - "@babel/helper-split-export-declaration" "^7.15.4" - "@babel/parser" "^7.15.4" - "@babel/types" "^7.15.4" +"@babel/template@^7.16.0", "@babel/template@^7.3.3": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.0.tgz#d16a35ebf4cd74e202083356fab21dd89363ddd6" + integrity sha512-MnZdpFD/ZdYhXwiunMqqgyZyucaYsbL0IrjoGjaVhGilz+x8YB++kRfygSOIj1yOtWKPlx7NBp+9I1RQSgsd5A== + dependencies: + "@babel/code-frame" "^7.16.0" + "@babel/parser" "^7.16.0" + "@babel/types" "^7.16.0" + +"@babel/traverse@^7.1.0", "@babel/traverse@^7.16.0", "@babel/traverse@^7.16.3", "@babel/traverse@^7.7.2": + version "7.16.3" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.3.tgz#f63e8a938cc1b780f66d9ed3c54f532ca2d14787" + integrity sha512-eolumr1vVMjqevCpwVO99yN/LoGL0EyHiLO5I043aYQvwOJ9eR5UsZSClHVCzfhBduMAsSzgA/6AyqPjNayJag== + dependencies: + "@babel/code-frame" "^7.16.0" + "@babel/generator" "^7.16.0" + "@babel/helper-function-name" "^7.16.0" + "@babel/helper-hoist-variables" "^7.16.0" + "@babel/helper-split-export-declaration" "^7.16.0" + "@babel/parser" "^7.16.3" + "@babel/types" "^7.16.0" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.15.4", "@babel/types@^7.15.6", "@babel/types@^7.3.0", "@babel/types@^7.3.3": - version "7.15.6" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.15.6.tgz#99abdc48218b2881c058dd0a7ab05b99c9be758f" - integrity sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig== +"@babel/types@^7.0.0", "@babel/types@^7.16.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.16.0.tgz#db3b313804f96aadd0b776c4823e127ad67289ba" + integrity sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg== dependencies: - "@babel/helper-validator-identifier" "^7.14.9" + "@babel/helper-validator-identifier" "^7.15.7" to-fast-properties "^2.0.0" "@bcoe/v8-coverage@^0.2.3": @@ -339,9 +339,9 @@ minimatch "^3.0.4" "@humanwhocodes/object-schema@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz#87de7af9c231826fdd68ac7258f77c429e0e5fcf" - integrity sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w== + version "1.2.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" + integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" @@ -557,9 +557,9 @@ type-detect "4.0.8" "@sinonjs/fake-timers@^8.0.1": - version "8.0.1" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-8.0.1.tgz#1c1c9a91419f804e59ae8df316a07dd1c3a76b94" - integrity sha512-AU7kwFxreVd6OAXcAFlKSmZquiRUU0FvYm44k1Y1QbK7Co4m0aqfGMhjykIeQp/H6rcl+nFmj0zfdUcGVs9Dew== + version "8.1.0" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-8.1.0.tgz#3fdc2b6cb58935b21bfb8d1625eb1300484316e7" + integrity sha512-OAPJUAtgeINhh/TAlUID4QTs53Njm7xzddaVlEs/SXwgtiD1tW22zAB/W1wdqfrpmikgaWQ9Fw6Ws+hsiRm5Vg== dependencies: "@sinonjs/commons" "^1.7.0" @@ -670,10 +670,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.7.tgz#36820945061326978c42a01e56b61cd223dfdc42" integrity sha512-QB5D2sqfSjCmTuWcBWyJ+/44bcjO7VbjSbOE0ucoVbAsSNQc4Lt6QkgkVXkTDwkL4z/beecZNDvVX15D4P8Jbw== -"@types/prettier@^2.1.5", "@types/prettier@^2.3.2": - version "2.4.1" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.1.tgz#e1303048d5389563e130f5bdd89d37a99acb75eb" - integrity sha512-Fo79ojj3vdEZOHg3wR9ksAMRz4P3S5fDB5e/YWZiFnyFQI1WY2Vftu9XoXVVtJfxB7Bpce/QTqWSSntkz2Znrw== +"@types/prettier@^2.1.5", "@types/prettier@^2.4.2": + version "2.4.2" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.2.tgz#4c62fae93eb479660c3bd93f9d24d561597a8281" + integrity sha512-ekoj4qOQYp7CvjX8ZDBgN86w3MqQhLE1hczEJbEIjgFEumDy+na/4AJAbLXfgEWFNB2pKadM5rPFtuSGMWK7xA== "@types/stack-utils@^2.0.0": version "2.0.1" @@ -692,13 +692,13 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^5.2.0": - version "5.3.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.3.1.tgz#d8ff412f10f54f6364e7fd7c1e70eb6767f434c3" - integrity sha512-cFImaoIr5Ojj358xI/SDhjog57OK2NqlpxwdcgyxDA3bJlZcJq5CPzUXtpD7CxI2Hm6ATU7w5fQnnkVnmwpHqw== +"@typescript-eslint/eslint-plugin@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.4.0.tgz#05e711a2e7b68342661fde61bccbd1531c19521a" + integrity sha512-9/yPSBlwzsetCsGEn9j24D8vGQgJkOTr4oMLas/w886ZtzKIs1iyoqFrwsX2fqYEeUwsdBpC21gcjRGo57u0eg== dependencies: - "@typescript-eslint/experimental-utils" "5.3.1" - "@typescript-eslint/scope-manager" "5.3.1" + "@typescript-eslint/experimental-utils" "5.4.0" + "@typescript-eslint/scope-manager" "5.4.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -706,94 +706,60 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/experimental-utils@5.3.1": - version "5.3.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.3.1.tgz#bbd8f9b67b4d5fdcb9d2f90297d8fcda22561e05" - integrity sha512-RgFn5asjZ5daUhbK5Sp0peq0SSMytqcrkNfU4pnDma2D8P3ElZ6JbYjY8IMSFfZAJ0f3x3tnO3vXHweYg0g59w== +"@typescript-eslint/experimental-utils@5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.4.0.tgz#238a7418d2da3b24874ba35385eb21cc61d2a65e" + integrity sha512-Nz2JDIQUdmIGd6p33A+naQmwfkU5KVTLb/5lTk+tLVTDacZKoGQisj8UCxk7onJcrgjIvr8xWqkYI+DbI3TfXg== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.3.1" - "@typescript-eslint/types" "5.3.1" - "@typescript-eslint/typescript-estree" "5.3.1" + "@typescript-eslint/scope-manager" "5.4.0" + "@typescript-eslint/types" "5.4.0" + "@typescript-eslint/typescript-estree" "5.4.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/parser@^5.2.0": - version "5.3.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.3.1.tgz#8ff1977c3d3200c217b3e4628d43ef92f89e5261" - integrity sha512-TD+ONlx5c+Qhk21x9gsJAMRohWAUMavSOmJgv3JGy9dgPhuBd5Wok0lmMClZDyJNLLZK1JRKiATzCKZNUmoyfw== +"@typescript-eslint/parser@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.4.0.tgz#3aa83ce349d66e39b84151f6d5464928044ca9e3" + integrity sha512-JoB41EmxiYpaEsRwpZEYAJ9XQURPFer8hpkIW9GiaspVLX8oqbqNM8P4EP8HOZg96yaALiLEVWllA2E8vwsIKw== dependencies: - "@typescript-eslint/scope-manager" "5.3.1" - "@typescript-eslint/types" "5.3.1" - "@typescript-eslint/typescript-estree" "5.3.1" + "@typescript-eslint/scope-manager" "5.4.0" + "@typescript-eslint/types" "5.4.0" + "@typescript-eslint/typescript-estree" "5.4.0" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.3.0.tgz#97d0ccc7c9158e89e202d5e24ce6ba49052d432e" - integrity sha512-22Uic9oRlTsPppy5Tcwfj+QET5RWEnZ5414Prby465XxQrQFZ6nnm5KnXgnsAJefG4hEgMnaxTB3kNEyjdjj6A== +"@typescript-eslint/scope-manager@5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.4.0.tgz#aaab08415f4a9cf32b870c7750ae8ba4607126a1" + integrity sha512-pRxFjYwoi8R+n+sibjgF9iUiAELU9ihPBtHzocyW8v8D8G8KeQvXTsW7+CBYIyTYsmhtNk50QPGLE3vrvhM5KA== dependencies: - "@typescript-eslint/types" "5.3.0" - "@typescript-eslint/visitor-keys" "5.3.0" - -"@typescript-eslint/scope-manager@5.3.1": - version "5.3.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.3.1.tgz#3cfbfbcf5488fb2a9a6fbbe97963ee1e8d419269" - integrity sha512-XksFVBgAq0Y9H40BDbuPOTUIp7dn4u8oOuhcgGq7EoDP50eqcafkMVGrypyVGvDYHzjhdUCUwuwVUK4JhkMAMg== - dependencies: - "@typescript-eslint/types" "5.3.1" - "@typescript-eslint/visitor-keys" "5.3.1" - -"@typescript-eslint/types@5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.3.0.tgz#af29fd53867c2df0028c57c36a655bd7e9e05416" - integrity sha512-fce5pG41/w8O6ahQEhXmMV+xuh4+GayzqEogN24EK+vECA3I6pUwKuLi5QbXO721EMitpQne5VKXofPonYlAQg== - -"@typescript-eslint/types@5.3.1": - version "5.3.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.3.1.tgz#afaa715b69ebfcfde3af8b0403bf27527912f9b7" - integrity sha512-bG7HeBLolxKHtdHG54Uac750eXuQQPpdJfCYuw4ZI3bZ7+GgKClMWM8jExBtp7NSP4m8PmLRM8+lhzkYnSmSxQ== + "@typescript-eslint/types" "5.4.0" + "@typescript-eslint/visitor-keys" "5.4.0" -"@typescript-eslint/typescript-estree@5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.3.0.tgz#4f68ddd46dc2983182402d2ab21fb44ad94988cf" - integrity sha512-FJ0nqcaUOpn/6Z4Jwbtf+o0valjBLkqc3MWkMvrhA2TvzFXtcclIM8F4MBEmYa2kgcI8EZeSAzwoSrIC8JYkug== - dependencies: - "@typescript-eslint/types" "5.3.0" - "@typescript-eslint/visitor-keys" "5.3.0" - debug "^4.3.2" - globby "^11.0.4" - is-glob "^4.0.3" - semver "^7.3.5" - tsutils "^3.21.0" +"@typescript-eslint/types@5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.4.0.tgz#b1c130f4b381b77bec19696c6e3366f9781ce8f2" + integrity sha512-GjXNpmn+n1LvnttarX+sPD6+S7giO+9LxDIGlRl4wK3a7qMWALOHYuVSZpPTfEIklYjaWuMtfKdeByx0AcaThA== -"@typescript-eslint/typescript-estree@5.3.1": - version "5.3.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.3.1.tgz#50cc4bfb93dc31bc75e08ae52e29fcb786d606ec" - integrity sha512-PwFbh/PKDVo/Wct6N3w+E4rLZxUDgsoII/GrWM2A62ETOzJd4M6s0Mu7w4CWsZraTbaC5UQI+dLeyOIFF1PquQ== +"@typescript-eslint/typescript-estree@5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.4.0.tgz#fe524fb308973c68ebeb7428f3b64499a6ba5fc0" + integrity sha512-nhlNoBdhKuwiLMx6GrybPT3SFILm5Gij2YBdPEPFlYNFAXUJWX6QRgvi/lwVoadaQEFsizohs6aFRMqsXI2ewA== dependencies: - "@typescript-eslint/types" "5.3.1" - "@typescript-eslint/visitor-keys" "5.3.1" + "@typescript-eslint/types" "5.4.0" + "@typescript-eslint/visitor-keys" "5.4.0" debug "^4.3.2" globby "^11.0.4" is-glob "^4.0.3" semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.3.0.tgz#a6258790f3b7b2547f70ed8d4a1e0c3499994523" - integrity sha512-oVIAfIQuq0x2TFDNLVavUn548WL+7hdhxYn+9j3YdJJXB7mH9dAmZNJsPDa7Jc+B9WGqoiex7GUDbyMxV0a/aw== +"@typescript-eslint/visitor-keys@5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.4.0.tgz#09bc28efd3621f292fe88c86eef3bf4893364c8c" + integrity sha512-PVbax7MeE7tdLfW5SA0fs8NGVVr+buMPrcj+CWYWPXsZCH8qZ1THufDzbXm1xrZ2b2PA1iENJ0sRq5fuUtvsJg== dependencies: - "@typescript-eslint/types" "5.3.0" - eslint-visitor-keys "^3.0.0" - -"@typescript-eslint/visitor-keys@5.3.1": - version "5.3.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.3.1.tgz#c2860ff22939352db4f3806f34b21d8ad00588ba" - integrity sha512-3cHUzUuVTuNHx0Gjjt5pEHa87+lzyqOiHXy/Gz+SJOCW1mpw9xQHIIEwnKn+Thph1mgWyZ90nboOcSuZr/jTTQ== - dependencies: - "@typescript-eslint/types" "5.3.1" + "@typescript-eslint/types" "5.4.0" eslint-visitor-keys "^3.0.0" abab@^2.0.3, abab@^2.0.5: @@ -830,9 +796,9 @@ acorn@^7.1.1: integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== acorn@^8.2.4, acorn@^8.4.1, acorn@^8.5.0: - version "8.5.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.5.0.tgz#4512ccb99b3698c752591e9bb4472e38ad43cee2" - integrity sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q== + version "8.6.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.6.0.tgz#e3692ba0eb1a0c83eaa4f37f5fa7368dd7142895" + integrity sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw== agent-base@6: version "6.0.2" @@ -1018,13 +984,13 @@ browser-process-hrtime@^1.0.0: resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== -browserslist@^4.16.6: - version "4.17.5" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.5.tgz#c827bbe172a4c22b123f5e337533ceebadfdd559" - integrity sha512-I3ekeB92mmpctWBoLXe0d5wPS2cBuRvvW0JyyJHMrk9/HmP2ZjrTboNAZ8iuGqaEIlKguljbQY32OkOJIRrgoA== +browserslist@^4.17.5: + version "4.18.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.18.1.tgz#60d3920f25b6860eb917c6c7b185576f4d8b017f" + integrity sha512-8ScCzdpPwR2wQh8IT82CA2VgDwjHyqMovPBZSNH54+tm4Jk2pCuv90gmAdH6J84OCRWi0b4gMe6O6XPXuJnjgQ== dependencies: - caniuse-lite "^1.0.30001271" - electron-to-chromium "^1.3.878" + caniuse-lite "^1.0.30001280" + electron-to-chromium "^1.3.896" escalade "^3.1.1" node-releases "^2.0.1" picocolors "^1.0.0" @@ -1059,14 +1025,14 @@ camelcase@^5.3.1: integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== camelcase@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" - integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== + version "6.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.1.tgz#250fd350cfd555d0d2160b1d51510eaf8326e86e" + integrity sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA== -caniuse-lite@^1.0.30001271: - version "1.0.30001272" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001272.tgz#8e9790ff995e9eb6e1f4c45cd07ddaa87cddbb14" - integrity sha512-DV1j9Oot5dydyH1v28g25KoVm7l8MTxazwuiH3utWiAS6iL/9Nh//TGwqFEeqqN8nnWYQ8HHhUq+o4QPt9kvYw== +caniuse-lite@^1.0.30001280: + version "1.0.30001282" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001282.tgz#38c781ee0a90ccfe1fe7fefd00e43f5ffdcb96fd" + integrity sha512-YhF/hG6nqBEllymSIjLtR2iWDDnChvhnVJqp+vloyt2tEHFG1yBR+ac2B/rOw0qOK0m0lEXU2dv4E/sMk5P9Kg== chalk@^2.0.0: version "2.4.2" @@ -1278,10 +1244,10 @@ domexception@^2.0.1: dependencies: webidl-conversions "^5.0.0" -electron-to-chromium@^1.3.878: - version "1.3.883" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.883.tgz#cc409921469b3aa6ab6efd65cc2a4375128bb703" - integrity sha512-goyjNx4wB9j911PBteb+AXNbErug7rJVkmDXWdw5SCVn2JlARBwsqucPkvp1h5mXWxHUbBRK3bwXTrqSxSiAIQ== +electron-to-chromium@^1.3.896: + version "1.3.901" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.901.tgz#ce2c3157d61bce9f42f1e83225c17358ae9f4918" + integrity sha512-ToJdV2vzwT2jeAsw8zIggTFllJ4Kxvwghk39AhJEHHlIxor10wsFI3wo69p8nFc0s/ATWBqugPv/k3nW4Y9Mww== emittery@^0.8.1: version "0.8.1" @@ -1373,9 +1339,9 @@ eslint-visitor-keys@^2.0.0: integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== eslint-visitor-keys@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.0.0.tgz#e32e99c6cdc2eb063f204eda5db67bfe58bb4186" - integrity sha512-mJOZa35trBTb3IyRmo8xmKBZlxf+N7OnUl4+ZhJHs/r+0770Wh/LEACE2pqMGMe27G/4y8P2bYGk4J70IC5k1Q== + version "3.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz#eee4acea891814cda67a7d8812d9647dd0179af2" + integrity sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA== eslint@^8.1.0: version "8.2.0" @@ -1582,9 +1548,9 @@ flat-cache@^3.0.4: rimraf "^3.0.2" flatted@^3.1.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.2.tgz#64bfed5cb68fe3ca78b3eb214ad97b63bedce561" - integrity sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA== + version "3.2.4" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.4.tgz#28d9969ea90661b5134259f312ab6aa7929ac5e2" + integrity sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw== form-data@^3.0.0: version "3.0.1" @@ -1771,9 +1737,9 @@ ignore@^4.0.6: integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== ignore@^5.1.4, ignore@^5.1.8: - version "5.1.8" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" - integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== + version "5.1.9" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.9.tgz#9ec1a5cbe8e1446ec60d4420060d43aa6e7382fb" + integrity sha512-2zeMQpbKz5dhZ9IwL0gbxSW5w0NK/MSAMtNuhgIHEPmaU3vPdKPL0UdvUCXs5SS4JAwsBxysK5sFMW8ocFiVjQ== import-fresh@^3.0.0, import-fresh@^3.2.1: version "3.3.0" @@ -2492,17 +2458,17 @@ micromatch@^4.0.4: braces "^3.0.1" picomatch "^2.2.3" -mime-db@1.50.0: - version "1.50.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.50.0.tgz#abd4ac94e98d3c0e185016c67ab45d5fde40c11f" - integrity sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A== +mime-db@1.51.0: + version "1.51.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c" + integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g== mime-types@^2.1.12: - version "2.1.33" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.33.tgz#1fa12a904472fafd068e48d9e8401f74d3f70edb" - integrity sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g== + version "2.1.34" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24" + integrity sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A== dependencies: - mime-db "1.50.0" + mime-db "1.51.0" mimic-fn@^2.1.0: version "2.1.0" @@ -2722,10 +2688,10 @@ pretty-format@^27.0.0, pretty-format@^27.3.1: ansi-styles "^5.0.0" react-is "^17.0.1" -pretty-quick@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/pretty-quick/-/pretty-quick-3.1.1.tgz#93ca4e2dd38cc4e970e3f54a0ead317a25454688" - integrity sha512-ZYLGiMoV2jcaas3vTJrLvKAYsxDoXQBUn8OSTxkl67Fyov9lyXivJTl0+2WVh+y6EovGcw7Lm5ThYpH+Sh3XxQ== +pretty-quick@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/pretty-quick/-/pretty-quick-3.1.2.tgz#89d8741af7122cbd7f34182df746c5a7ea360b5c" + integrity sha512-T+fpTJrDjTzewql4p3lKrRA7z3MrNyjBK1MKeaBm5PpKwATgVm885TpY7TgY8KFt5Q1Qn3QDseRQcyX9AKTKkA== dependencies: chalk "^3.0.0" execa "^4.0.0" @@ -3138,10 +3104,10 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typescript@^4.4.3: - version "4.4.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.4.tgz#2cd01a1a1f160704d3101fd5a58ff0f9fcb8030c" - integrity sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA== +typescript@^4.5.2: + version "4.5.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.2.tgz#8ac1fba9f52256fdb06fb89e4122fa6a346c2998" + integrity sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw== universalify@^0.1.2: version "0.1.2" From 6dc46507a08972d96cda14b08362ad11f42ec8b2 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 18 Nov 2021 10:46:33 -0500 Subject: [PATCH 432/785] Update CHANGELOG --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 013d7454..700b4876 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#1028](https://github.com/prettier/plugin-ruby/issues/1028) - levymetal, kddnewton - Fix up some nested formatting with very complicated RSpec assertions. - [#1035](https://github.com/prettier/plugin-ruby/issues/1035) - qcn, kddnewton - Ensure we don't try to print `return` incorrectly when multiple statements are contained within parentheses. +- [#1048](https://github.com/prettier/plugin-ruby/pull/1048) - kddnewton - Completely refactor the Ruby parser to use classes instead of hashes. Also remove a lot of the `body` keys are replace them with actual names. + +### Removed + +- [#1048](https://github.com/prettier/plugin-ruby/pull/1048) - kddnewton - Drop support for Ruby 2.5. ## [2.0.0] - 2021-10-28 From 22577f0d7f9c78179c7e757e2ca434ebb796f415 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 18 Nov 2021 10:59:49 -0500 Subject: [PATCH 433/785] Fixes #1042 --- CHANGELOG.md | 1 + src/ruby/nodes/blocks.ts | 2 +- test/js/ruby/nodes/blocks.test.ts | 11 +++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 700b4876..8b92a3eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#1028](https://github.com/prettier/plugin-ruby/issues/1028) - levymetal, kddnewton - Fix up some nested formatting with very complicated RSpec assertions. - [#1035](https://github.com/prettier/plugin-ruby/issues/1035) - qcn, kddnewton - Ensure we don't try to print `return` incorrectly when multiple statements are contained within parentheses. - [#1048](https://github.com/prettier/plugin-ruby/pull/1048) - kddnewton - Completely refactor the Ruby parser to use classes instead of hashes. Also remove a lot of the `body` keys are replace them with actual names. +- [#1042](https://github.com/prettier/plugin-ruby/issues/1042) - JoshuaKGoldberg, kddnewton - Ensure blocks are printed correctly when there are trailing comments on the `do` keyword. ### Removed diff --git a/src/ruby/nodes/blocks.ts b/src/ruby/nodes/blocks.ts index 305c3bf0..3324709c 100644 --- a/src/ruby/nodes/blocks.ts +++ b/src/ruby/nodes/blocks.ts @@ -33,7 +33,7 @@ function printBlockBegin( useBraces: boolean ) { let docs = print(path); - const doc = useBraces ? "{" : "do"; + const doc = useBraces && !path.getValue().comments ? "{" : "do"; if (Array.isArray(docs)) { docs[1] = doc; diff --git a/test/js/ruby/nodes/blocks.test.ts b/test/js/ruby/nodes/blocks.test.ts index 443464c0..de1173fd 100644 --- a/test/js/ruby/nodes/blocks.test.ts +++ b/test/js/ruby/nodes/blocks.test.ts @@ -191,4 +191,15 @@ describe("blocks", () => { expect(content).toMatchFormat(); }); + + // https://github.com/prettier/plugin-ruby/issues/1042 + test("comments on the do block without a command", () => { + const content = ruby(` + let!(:some_variable) do # comment text + nil + end + `); + + expect(content).toMatchFormat(); + }); }); From 540dd2719ddf079f531ad03aa192dde71996360c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Nov 2021 12:01:54 +0000 Subject: [PATCH 434/785] Bump @types/node from 16.11.7 to 16.11.9 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.7 to 16.11.9. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index b84401cb..bc590d99 100644 --- a/yarn.lock +++ b/yarn.lock @@ -666,9 +666,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^16.9.1": - version "16.11.7" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.7.tgz#36820945061326978c42a01e56b61cd223dfdc42" - integrity sha512-QB5D2sqfSjCmTuWcBWyJ+/44bcjO7VbjSbOE0ucoVbAsSNQc4Lt6QkgkVXkTDwkL4z/beecZNDvVX15D4P8Jbw== + version "16.11.9" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.9.tgz#879be3ad7af29f4c1a5c433421bf99fab7047185" + integrity sha512-MKmdASMf3LtPzwLyRrFjtFFZ48cMf8jmX5VRYrDQiJa8Ybu5VAmkqBWqKU8fdCwD8ysw4mQ9nrEHvzg6gunR7A== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.2" From 262fe53fe4de95fe246792f0feb349358533f860 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Nov 2021 12:02:02 +0000 Subject: [PATCH 435/785] Bump @types/jest from 27.0.2 to 27.0.3 Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 27.0.2 to 27.0.3. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index b84401cb..42cefb21 100644 --- a/yarn.lock +++ b/yarn.lock @@ -648,9 +648,9 @@ "@types/istanbul-lib-report" "*" "@types/jest@^27.0.1": - version "27.0.2" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.0.2.tgz#ac383c4d4aaddd29bbf2b916d8d105c304a5fcd7" - integrity sha512-4dRxkS/AFX0c5XW6IPMNOydLn2tEhNhJV7DnYK+0bjoJZ+QTmfucBlihX7aoEsh/ocYtkLC73UbnBXBXIxsULA== + version "27.0.3" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.0.3.tgz#0cf9dfe9009e467f70a342f0f94ead19842a783a" + integrity sha512-cmmwv9t7gBYt7hNKH5Spu7Kuu/DotGa+Ff+JGRKZ4db5eh8PnKS4LuebJ3YLUoyOyIHraTGyULn23YtEAm0VSg== dependencies: jest-diff "^27.0.0" pretty-format "^27.0.0" From b00c895bbbd6c7b965c10d31ef7ef9aa2d07fb37 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Nov 2021 12:01:44 +0000 Subject: [PATCH 436/785] Bump eslint from 8.2.0 to 8.3.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.2.0 to 8.3.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.2.0...v8.3.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/yarn.lock b/yarn.lock index fcff6222..ce5f7230 100644 --- a/yarn.lock +++ b/yarn.lock @@ -795,7 +795,7 @@ acorn@^7.1.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.2.4, acorn@^8.4.1, acorn@^8.5.0: +acorn@^8.2.4, acorn@^8.4.1, acorn@^8.6.0: version "8.6.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.6.0.tgz#e3692ba0eb1a0c83eaa4f37f5fa7368dd7142895" integrity sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw== @@ -1318,10 +1318,10 @@ eslint-scope@^5.1.1: esrecurse "^4.3.0" estraverse "^4.1.1" -eslint-scope@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-6.0.0.tgz#9cf45b13c5ac8f3d4c50f46a5121f61b3e318978" - integrity sha512-uRDL9MWmQCkaFus8RF5K9/L/2fn+80yoW3jkD53l4shjCh26fCtvJGasxjUqP5OT87SYTxCVA3BwTUzuELx9kA== +eslint-scope@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.0.tgz#c1f6ea30ac583031f203d65c73e723b01298f153" + integrity sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg== dependencies: esrecurse "^4.3.0" estraverse "^5.2.0" @@ -1338,15 +1338,15 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint-visitor-keys@^3.0.0: +eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz#eee4acea891814cda67a7d8812d9647dd0179af2" integrity sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA== eslint@^8.1.0: - version "8.2.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.2.0.tgz#44d3fb506d0f866a506d97a0fc0e90ee6d06a815" - integrity sha512-erw7XmM+CLxTOickrimJ1SiF55jiNlVSp2qqm0NuBWPtHYQCegD5ZMaW0c3i5ytPqL+SSLaCxdvQXFPLJn+ABw== + version "8.3.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.3.0.tgz#a3c2409507403c1c7f6c42926111d6cbefbc3e85" + integrity sha512-aIay56Ph6RxOTC7xyr59Kt3ewX185SaGnAr8eWukoPLeriCrvGjvAubxuvaXOfsxhtwV5g0uBOsyhAom4qJdww== dependencies: "@eslint/eslintrc" "^1.0.4" "@humanwhocodes/config-array" "^0.6.0" @@ -1357,10 +1357,10 @@ eslint@^8.1.0: doctrine "^3.0.0" enquirer "^2.3.5" escape-string-regexp "^4.0.0" - eslint-scope "^6.0.0" + eslint-scope "^7.1.0" eslint-utils "^3.0.0" - eslint-visitor-keys "^3.0.0" - espree "^9.0.0" + eslint-visitor-keys "^3.1.0" + espree "^9.1.0" esquery "^1.4.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -1387,14 +1387,14 @@ eslint@^8.1.0: text-table "^0.2.0" v8-compile-cache "^2.0.3" -espree@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.0.0.tgz#e90a2965698228502e771c7a58489b1a9d107090" - integrity sha512-r5EQJcYZ2oaGbeR0jR0fFVijGOcwai07/690YRXLINuhmVeRY4UKSAsQPe/0BNuDgwP7Ophoc1PRsr2E3tkbdQ== +espree@^9.0.0, espree@^9.1.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.1.0.tgz#ba9d3c9b34eeae205724124e31de4543d59fbf74" + integrity sha512-ZgYLvCS1wxOczBYGcQT9DDWgicXwJ4dbocr9uYN+/eresBAUuBu+O4WzB21ufQ/JqQT8gyp7hJ3z8SHii32mTQ== dependencies: - acorn "^8.5.0" + acorn "^8.6.0" acorn-jsx "^5.3.1" - eslint-visitor-keys "^3.0.0" + eslint-visitor-keys "^3.1.0" esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" From e8799c3ad3469ec7ebbd5f6b38cea5733353eae8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Nov 2021 12:02:00 +0000 Subject: [PATCH 437/785] Bump @types/node from 16.11.9 to 16.11.10 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.9 to 16.11.10. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index ce5f7230..735926f8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -666,9 +666,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^16.9.1": - version "16.11.9" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.9.tgz#879be3ad7af29f4c1a5c433421bf99fab7047185" - integrity sha512-MKmdASMf3LtPzwLyRrFjtFFZ48cMf8jmX5VRYrDQiJa8Ybu5VAmkqBWqKU8fdCwD8ysw4mQ9nrEHvzg6gunR7A== + version "16.11.10" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.10.tgz#2e3ad0a680d96367103d3e670d41c2fed3da61ae" + integrity sha512-3aRnHa1KlOEEhJ6+CvyHKK5vE9BcLGjtUpwvqYLRvYNQKMfabu3BwfJaA/SLW8dxe28LsNDjtHwePTuzn3gmOA== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.2" From 11f1ce2e3cf0a9285002d3e09a318af21e84d79e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Nov 2021 12:01:38 +0000 Subject: [PATCH 438/785] Bump prettier from 2.4.1 to 2.5.0 Bumps [prettier](https://github.com/prettier/prettier) from 2.4.1 to 2.5.0. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.4.1...2.5.0) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 735926f8..541d4a86 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2674,9 +2674,9 @@ prelude-ls@~1.1.2: integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= prettier@>=2.3.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c" - integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA== + version "2.5.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.0.tgz#a6370e2d4594e093270419d9cc47f7670488f893" + integrity sha512-FM/zAKgWTxj40rH03VxzIPdXmj39SwSjwG0heUcNFwI+EMZJnY93yAiKXM3dObIKAM5TA88werc8T/EwhB45eg== pretty-format@^27.0.0, pretty-format@^27.3.1: version "27.3.1" From d1f0a836cb5517908b0f7aca50e36db05bc76425 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Nov 2021 12:01:40 +0000 Subject: [PATCH 439/785] Bump @typescript-eslint/eslint-plugin from 5.4.0 to 5.5.0 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.4.0 to 5.5.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.5.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 58 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 46 insertions(+), 12 deletions(-) diff --git a/yarn.lock b/yarn.lock index 541d4a86..c2cd2b40 100644 --- a/yarn.lock +++ b/yarn.lock @@ -693,12 +693,12 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.4.0.tgz#05e711a2e7b68342661fde61bccbd1531c19521a" - integrity sha512-9/yPSBlwzsetCsGEn9j24D8vGQgJkOTr4oMLas/w886ZtzKIs1iyoqFrwsX2fqYEeUwsdBpC21gcjRGo57u0eg== + version "5.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.5.0.tgz#12d5f47f127af089b985f3a205c0e34a812f8fce" + integrity sha512-4bV6fulqbuaO9UMXU0Ia0o6z6if+kmMRW8rMRyfqXj/eGrZZRGedS4n0adeGNnjr8LKAM495hrQ7Tea52UWmQA== dependencies: - "@typescript-eslint/experimental-utils" "5.4.0" - "@typescript-eslint/scope-manager" "5.4.0" + "@typescript-eslint/experimental-utils" "5.5.0" + "@typescript-eslint/scope-manager" "5.5.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -706,15 +706,15 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/experimental-utils@5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.4.0.tgz#238a7418d2da3b24874ba35385eb21cc61d2a65e" - integrity sha512-Nz2JDIQUdmIGd6p33A+naQmwfkU5KVTLb/5lTk+tLVTDacZKoGQisj8UCxk7onJcrgjIvr8xWqkYI+DbI3TfXg== +"@typescript-eslint/experimental-utils@5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.5.0.tgz#3fe2514dc2f3cd95562206e4058435ea51df609e" + integrity sha512-kjWeeVU+4lQ1SLYErRKV5yDXbWDPkpbzTUUlfAUifPYvpX0qZlrcCZ96/6oWxt3QxtK5WVhXz+KsnwW9cIW+3A== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.4.0" - "@typescript-eslint/types" "5.4.0" - "@typescript-eslint/typescript-estree" "5.4.0" + "@typescript-eslint/scope-manager" "5.5.0" + "@typescript-eslint/types" "5.5.0" + "@typescript-eslint/typescript-estree" "5.5.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -736,11 +736,24 @@ "@typescript-eslint/types" "5.4.0" "@typescript-eslint/visitor-keys" "5.4.0" +"@typescript-eslint/scope-manager@5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.5.0.tgz#2b9f3672fa6cddcb4160e7e8b49ef1fd00f83c09" + integrity sha512-0/r656RmRLo7CbN4Mdd+xZyPJ/fPCKhYdU6mnZx+8msAD8nJSP8EyCFkzbd6vNVZzZvWlMYrSNekqGrCBqFQhg== + dependencies: + "@typescript-eslint/types" "5.5.0" + "@typescript-eslint/visitor-keys" "5.5.0" + "@typescript-eslint/types@5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.4.0.tgz#b1c130f4b381b77bec19696c6e3366f9781ce8f2" integrity sha512-GjXNpmn+n1LvnttarX+sPD6+S7giO+9LxDIGlRl4wK3a7qMWALOHYuVSZpPTfEIklYjaWuMtfKdeByx0AcaThA== +"@typescript-eslint/types@5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.5.0.tgz#fee61ae510e84ed950a53937a2b443e078107003" + integrity sha512-OaYTqkW3GnuHxqsxxJ6KypIKd5Uw7bFiQJZRyNi1jbMJnK3Hc/DR4KwB6KJj6PBRkJJoaNwzMNv9vtTk87JhOg== + "@typescript-eslint/typescript-estree@5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.4.0.tgz#fe524fb308973c68ebeb7428f3b64499a6ba5fc0" @@ -754,6 +767,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.5.0.tgz#12f422698c1636bd0206086bbec9844c54625ebc" + integrity sha512-pVn8btYUiYrjonhMAO0yG8lm7RApzy2L4RC7Td/mC/qFkyf6vRbGyZozoA94+w6D2Y2GRqpMoCWcwx/EUOzyoQ== + dependencies: + "@typescript-eslint/types" "5.5.0" + "@typescript-eslint/visitor-keys" "5.5.0" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/visitor-keys@5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.4.0.tgz#09bc28efd3621f292fe88c86eef3bf4893364c8c" @@ -762,6 +788,14 @@ "@typescript-eslint/types" "5.4.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.5.0.tgz#4787586897b61f26068a3db5c50b3f5d254f9083" + integrity sha512-4GzJ1kRtsWzHhdM40tv0ZKHNSbkDhF0Woi/TDwVJX6UICwJItvP7ZTXbjTkCdrors7ww0sYe0t+cIKDAJwZ7Kw== + dependencies: + "@typescript-eslint/types" "5.5.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 31cb57e76fd07d6a5b257337f1681ebb68ad3cf6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Nov 2021 12:01:48 +0000 Subject: [PATCH 440/785] Bump @types/node from 16.11.10 to 16.11.11 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.10 to 16.11.11. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 541d4a86..07aca08f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -666,9 +666,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^16.9.1": - version "16.11.10" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.10.tgz#2e3ad0a680d96367103d3e670d41c2fed3da61ae" - integrity sha512-3aRnHa1KlOEEhJ6+CvyHKK5vE9BcLGjtUpwvqYLRvYNQKMfabu3BwfJaA/SLW8dxe28LsNDjtHwePTuzn3gmOA== + version "16.11.11" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.11.tgz#6ea7342dfb379ea1210835bada87b3c512120234" + integrity sha512-KB0sixD67CeecHC33MYn+eYARkqTheIRNuu97y2XMjR7Wu3XibO1vaY6VBV6O/a89SPI81cEUIYT87UqUWlZNw== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.2" From 87005462e3df1b1d54bb173065d08970d3cfb293 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Nov 2021 12:02:02 +0000 Subject: [PATCH 441/785] Bump jest from 27.3.1 to 27.4.2 Bumps [jest](https://github.com/facebook/jest) from 27.3.1 to 27.4.2. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v27.3.1...v27.4.2) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 762 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 418 insertions(+), 344 deletions(-) diff --git a/yarn.lock b/yarn.lock index 541d4a86..87f8ec34 100644 --- a/yarn.lock +++ b/yarn.lock @@ -359,93 +359,93 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^27.3.1": - version "27.3.1" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.3.1.tgz#e8ea3a475d3f8162f23d69efbfaa9cbe486bee93" - integrity sha512-RkFNWmv0iui+qsOr/29q9dyfKTTT5DCuP31kUwg7rmOKPT/ozLeGLKJKVIiOfbiKyleUZKIrHwhmiZWVe8IMdw== +"@jest/console@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.4.2.tgz#7a95612d38c007ddb528ee446fe5e5e785e685ce" + integrity sha512-xknHThRsPB/To1FUbi6pCe43y58qFC03zfb6R7fDb/FfC7k2R3i1l+izRBJf8DI46KhYGRaF14Eo9A3qbBoixg== dependencies: - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^27.3.1" - jest-util "^27.3.1" + jest-message-util "^27.4.2" + jest-util "^27.4.2" slash "^3.0.0" -"@jest/core@^27.3.1": - version "27.3.1" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.3.1.tgz#04992ef1b58b17c459afb87ab56d81e63d386925" - integrity sha512-DMNE90RR5QKx0EA+wqe3/TNEwiRpOkhshKNxtLxd4rt3IZpCt+RSL+FoJsGeblRZmqdK4upHA/mKKGPPRAifhg== +"@jest/core@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.4.2.tgz#24f91e4fa4ec983eb811ad518af109eac719d65a" + integrity sha512-0mPM61tDbu8yc9CMKH9bvV+g+17VUpdWQtU1x6P1gk4AKj8iywWi8zBmEIl7pTGjUtYA92CNc/LlBfKCioBOow== dependencies: - "@jest/console" "^27.3.1" - "@jest/reporters" "^27.3.1" - "@jest/test-result" "^27.3.1" - "@jest/transform" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/console" "^27.4.2" + "@jest/reporters" "^27.4.2" + "@jest/test-result" "^27.4.2" + "@jest/transform" "^27.4.2" + "@jest/types" "^27.4.2" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" - jest-changed-files "^27.3.0" - jest-config "^27.3.1" - jest-haste-map "^27.3.1" - jest-message-util "^27.3.1" - jest-regex-util "^27.0.6" - jest-resolve "^27.3.1" - jest-resolve-dependencies "^27.3.1" - jest-runner "^27.3.1" - jest-runtime "^27.3.1" - jest-snapshot "^27.3.1" - jest-util "^27.3.1" - jest-validate "^27.3.1" - jest-watcher "^27.3.1" + jest-changed-files "^27.4.2" + jest-config "^27.4.2" + jest-haste-map "^27.4.2" + jest-message-util "^27.4.2" + jest-regex-util "^27.4.0" + jest-resolve "^27.4.2" + jest-resolve-dependencies "^27.4.2" + jest-runner "^27.4.2" + jest-runtime "^27.4.2" + jest-snapshot "^27.4.2" + jest-util "^27.4.2" + jest-validate "^27.4.2" + jest-watcher "^27.4.2" micromatch "^4.0.4" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.3.1": - version "27.3.1" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.3.1.tgz#2182defbce8d385fd51c5e7c7050f510bd4c86b1" - integrity sha512-BCKCj4mOVLme6Tanoyc9k0ultp3pnmuyHw73UHRPeeZxirsU/7E3HC4le/VDb/SMzE1JcPnto+XBKFOcoiJzVw== +"@jest/environment@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.4.2.tgz#03efabce528dbb09bffd3ec7e39bb0f3f7475cc2" + integrity sha512-uSljKxh/rGlHlmhyeG4ZoVK9hOec+EPBkwTHkHKQ2EqDu5K+MaG9uJZ8o1CbRsSdZqSuhXvJCYhBWsORPPg6qw== dependencies: - "@jest/fake-timers" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/fake-timers" "^27.4.2" + "@jest/types" "^27.4.2" "@types/node" "*" - jest-mock "^27.3.0" + jest-mock "^27.4.2" -"@jest/fake-timers@^27.3.1": - version "27.3.1" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.3.1.tgz#1fad860ee9b13034762cdb94266e95609dfce641" - integrity sha512-M3ZFgwwlqJtWZ+QkBG5NmC23A9w+A6ZxNsO5nJxJsKYt4yguBd3i8TpjQz5NfCX91nEve1KqD9RA2Q+Q1uWqoA== +"@jest/fake-timers@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.4.2.tgz#d217f86c3ba2027bf29e0b731fd0cb761a72d093" + integrity sha512-f/Xpzn5YQk5adtqBgvw1V6bF8Nx3hY0OIRRpCvWcfPl0EAjdqWPdhH3t/3XpiWZqtjIEHDyMKP9ajpva1l4Zmg== dependencies: - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" "@sinonjs/fake-timers" "^8.0.1" "@types/node" "*" - jest-message-util "^27.3.1" - jest-mock "^27.3.0" - jest-util "^27.3.1" + jest-message-util "^27.4.2" + jest-mock "^27.4.2" + jest-util "^27.4.2" -"@jest/globals@^27.3.1": - version "27.3.1" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.3.1.tgz#ce1dfb03d379237a9da6c1b99ecfaca1922a5f9e" - integrity sha512-Q651FWiWQAIFiN+zS51xqhdZ8g9b88nGCobC87argAxA7nMfNQq0Q0i9zTfQYgLa6qFXk2cGANEqfK051CZ8Pg== +"@jest/globals@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.4.2.tgz#56a402c5ebf22eba1d34e900772147f5126ea2d8" + integrity sha512-KkfaHEttlGpXYAQTZHgrESiEPx2q/DKAFLGLFda1uGVrqc17snd3YVPhOxlXOHIzVPs+lQ/SDB2EIvxyGzb3Ew== dependencies: - "@jest/environment" "^27.3.1" - "@jest/types" "^27.2.5" - expect "^27.3.1" + "@jest/environment" "^27.4.2" + "@jest/types" "^27.4.2" + expect "^27.4.2" -"@jest/reporters@^27.3.1": - version "27.3.1" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.3.1.tgz#28b5c1f5789481e23788048fa822ed15486430b9" - integrity sha512-m2YxPmL9Qn1emFVgZGEiMwDntDxRRQ2D58tiDQlwYTg5GvbFOKseYCcHtn0WsI8CG4vzPglo3nqbOiT8ySBT/w== +"@jest/reporters@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.4.2.tgz#d3860c5d3f668fa1326ab2bf5989f774e5c03f04" + integrity sha512-sp4aqmdBJtjKetEakzDPcZggPcVIF6w9QLkYBbaWDV6e/SIsHnF1S4KtIH91eEc2fp7ep6V/e1xvdfEoho1d2w== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.3.1" - "@jest/test-result" "^27.3.1" - "@jest/transform" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/console" "^27.4.2" + "@jest/test-result" "^27.4.2" + "@jest/transform" "^27.4.2" + "@jest/types" "^27.4.2" "@types/node" "*" chalk "^4.0.0" collect-v8-coverage "^1.0.0" @@ -457,60 +457,60 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^27.3.1" - jest-resolve "^27.3.1" - jest-util "^27.3.1" - jest-worker "^27.3.1" + jest-haste-map "^27.4.2" + jest-resolve "^27.4.2" + jest-util "^27.4.2" + jest-worker "^27.4.2" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" terminal-link "^2.0.0" v8-to-istanbul "^8.1.0" -"@jest/source-map@^27.0.6": - version "27.0.6" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.0.6.tgz#be9e9b93565d49b0548b86e232092491fb60551f" - integrity sha512-Fek4mi5KQrqmlY07T23JRi0e7Z9bXTOOD86V/uS0EIW4PClvPDqZOyFlLpNJheS6QI0FNX1CgmPjtJ4EA/2M+g== +"@jest/source-map@^27.4.0": + version "27.4.0" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.4.0.tgz#2f0385d0d884fb3e2554e8f71f8fa957af9a74b6" + integrity sha512-Ntjx9jzP26Bvhbm93z/AKcPRj/9wrkI88/gK60glXDx1q+IeI0rf7Lw2c89Ch6ofonB0On/iRDreQuQ6te9pgQ== dependencies: callsites "^3.0.0" graceful-fs "^4.2.4" source-map "^0.6.0" -"@jest/test-result@^27.3.1": - version "27.3.1" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.3.1.tgz#89adee8b771877c69b3b8d59f52f29dccc300194" - integrity sha512-mLn6Thm+w2yl0opM8J/QnPTqrfS4FoXsXF2WIWJb2O/GBSyResL71BRuMYbYRsGt7ELwS5JGcEcGb52BNrumgg== +"@jest/test-result@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.4.2.tgz#05fd4a5466ec502f3eae0b39dff2b93ea4d5d9ec" + integrity sha512-kr+bCrra9jfTgxHXHa2UwoQjxvQk3Am6QbpAiJ5x/50LW8llOYrxILkqY0lZRW/hu8FXesnudbql263+EW9iNA== dependencies: - "@jest/console" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/console" "^27.4.2" + "@jest/types" "^27.4.2" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.3.1": - version "27.3.1" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.3.1.tgz#4b3bde2dbb05ee74afdae608cf0768e3354683b1" - integrity sha512-siySLo07IMEdSjA4fqEnxfIX8lB/lWYsBPwNFtkOvsFQvmBrL3yj3k3uFNZv/JDyApTakRpxbKLJ3CT8UGVCrA== +"@jest/test-sequencer@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.4.2.tgz#94bb7e5412d59ae2a8a4b8f9925bb16b6dc82b4c" + integrity sha512-HmHp5mlh9f9GyNej5yCS1JZIFfUGnP9+jEOH5zoq5EmsuZeYD+dGULqyvGDPtuzzbyAFJ6R4+z4SS0VvnFwwGQ== dependencies: - "@jest/test-result" "^27.3.1" + "@jest/test-result" "^27.4.2" graceful-fs "^4.2.4" - jest-haste-map "^27.3.1" - jest-runtime "^27.3.1" + jest-haste-map "^27.4.2" + jest-runtime "^27.4.2" -"@jest/transform@^27.3.1": - version "27.3.1" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.3.1.tgz#ff80eafbeabe811e9025e4b6f452126718455220" - integrity sha512-3fSvQ02kuvjOI1C1ssqMVBKJpZf6nwoCiSu00zAKh5nrp3SptNtZy/8s5deayHnqxhjD9CWDJ+yqQwuQ0ZafXQ== +"@jest/transform@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.4.2.tgz#459885e96de2e21fc68b8b371e90aa653966dd0d" + integrity sha512-RTKcPZllfcmLfnlxBya7aypofhdz05+E6QITe55Ex0rxyerkgjmmpMlvVn11V0cP719Ps6WcDYCnDzxnnJUwKg== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" babel-plugin-istanbul "^6.0.0" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.3.1" - jest-regex-util "^27.0.6" - jest-util "^27.3.1" + jest-haste-map "^27.4.2" + jest-regex-util "^27.4.0" + jest-util "^27.4.2" micromatch "^4.0.4" pirates "^4.0.1" slash "^3.0.0" @@ -528,6 +528,17 @@ "@types/yargs" "^16.0.0" chalk "^4.0.0" +"@jest/types@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.4.2.tgz#96536ebd34da6392c2b7c7737d693885b5dd44a5" + integrity sha512-j35yw0PMTPpZsUoOBiuHzr1zTYoad1cVIE0ajEjcrJONxxrko/IRGKkXx3os0Nsi4Hu3+5VmDbVfq5WhG/pWAg== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^16.0.0" + chalk "^4.0.0" + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -655,6 +666,15 @@ jest-diff "^27.0.0" pretty-format "^27.0.0" +"@types/jsdom@^16.2.4": + version "16.2.13" + resolved "https://registry.yarnpkg.com/@types/jsdom/-/jsdom-16.2.13.tgz#126c8b7441b159d6234610a48de77b6066f1823f" + integrity sha512-8JQCjdeAidptSsOcRWk2iTm9wCcwn9l+kRG6k5bzUacrnm1ezV4forq0kWjUih/tumAeoG+OspOvQEbbRucBTw== + dependencies: + "@types/node" "*" + "@types/parse5" "*" + "@types/tough-cookie" "*" + "@types/json-schema@^7.0.9": version "7.0.9" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" @@ -670,6 +690,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.10.tgz#2e3ad0a680d96367103d3e670d41c2fed3da61ae" integrity sha512-3aRnHa1KlOEEhJ6+CvyHKK5vE9BcLGjtUpwvqYLRvYNQKMfabu3BwfJaA/SLW8dxe28LsNDjtHwePTuzn3gmOA== +"@types/parse5@*": + version "6.0.3" + resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-6.0.3.tgz#705bb349e789efa06f43f128cef51240753424cb" + integrity sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g== + "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.2" resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.2.tgz#4c62fae93eb479660c3bd93f9d24d561597a8281" @@ -680,6 +705,11 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== +"@types/tough-cookie@*": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.1.tgz#8f80dd965ad81f3e1bc26d6f5c727e132721ff40" + integrity sha512-Y0K95ThC3esLEYD6ZuqNek29lNX2EM1qxV8y2FTLUB0ff5wWrk7az+mLrnNFUnaXcgKye22+sFBRXOgpPILZNg== + "@types/yargs-parser@*": version "20.2.1" resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.1.tgz#3b9ce2489919d9e4fea439b76916abc34b2df129" @@ -898,16 +928,16 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= -babel-jest@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.3.1.tgz#0636a3404c68e07001e434ac4956d82da8a80022" - integrity sha512-SjIF8hh/ir0peae2D6S6ZKRhUy7q/DnpH7k/V6fT4Bgs/LXXUztOpX4G2tCgq8mLo5HA9mN6NmlFMeYtKmIsTQ== +babel-jest@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.4.2.tgz#6edf80971045cfd44f3f10b6eda6007d95f62742" + integrity sha512-MADrjb3KBO2eyZCAc6QaJg6RT5u+6oEdDyHO5HEalnpwQ6LrhTsQF2Kj1Wnz2t6UPXIXPk18dSXXOT0wF5yTxA== dependencies: - "@jest/transform" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/transform" "^27.4.2" + "@jest/types" "^27.4.2" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.0.0" - babel-preset-jest "^27.2.0" + babel-preset-jest "^27.4.0" chalk "^4.0.0" graceful-fs "^4.2.4" slash "^3.0.0" @@ -923,10 +953,10 @@ babel-plugin-istanbul@^6.0.0: istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.2.0.tgz#79f37d43f7e5c4fdc4b2ca3e10cc6cf545626277" - integrity sha512-TOux9khNKdi64mW+0OIhcmbAn75tTlzKhxmiNXevQaPbrBYK7YKjP1jl6NHTJ6XR5UgUrJbCnWlKVnJn29dfjw== +babel-plugin-jest-hoist@^27.4.0: + version "27.4.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.4.0.tgz#d7831fc0f93573788d80dee7e682482da4c730d6" + integrity sha512-Jcu7qS4OX5kTWBc45Hz7BMmgXuJqRnhatqpUhnzGC3OBYpOmf2tv6jFNwZpwM7wU7MUuv2r9IPS/ZlYOuburVw== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -951,12 +981,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^27.2.0: - version "27.2.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.2.0.tgz#556bbbf340608fed5670ab0ea0c8ef2449fba885" - integrity sha512-z7MgQ3peBwN5L5aCqBKnF6iqdlvZvFUQynEhu0J+X9nHLU72jO3iY331lcYrg+AssJ8q7xsv5/3AICzVmJ/wvg== +babel-preset-jest@^27.4.0: + version "27.4.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.4.0.tgz#70d0e676a282ccb200fbabd7f415db5fdf393bca" + integrity sha512-NK4jGYpnBvNxcGo7/ZpZJr51jCGT+3bwwpVIDY2oNfTxJJldRtB4VAcYdgp1loDE50ODuTu+yBjpMAswv5tlpg== dependencies: - babel-plugin-jest-hoist "^27.2.0" + babel-plugin-jest-hoist "^27.4.0" babel-preset-current-node-syntax "^1.0.0" balanced-match@^1.0.0: @@ -1218,6 +1248,11 @@ diff-sequences@^27.0.6: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.0.6.tgz#3305cb2e55a033924054695cc66019fd7f8e5723" integrity sha512-ag6wfpBFyNXZ0p8pcuIDS//D8H062ZQJ3fzYxjpmeKjnz8W4pekL3AI8VohmyZmsWW2PWaHgjsmqR6L13101VQ== +diff-sequences@^27.4.0: + version "27.4.0" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.4.0.tgz#d783920ad8d06ec718a060d00196dfef25b132a5" + integrity sha512-YqiQzkrsmHMH5uuh8OdQFU9/ZpADnwzml8z0O5HvRNda+5UZsaX/xN+AAxfR2hWq1Y7HZnAzO9J5lJXOuDz2Ww== + diff@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" @@ -1465,17 +1500,17 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.3.1.tgz#d0f170b1f5c8a2009bab0beffd4bb94f043e38e7" - integrity sha512-MrNXV2sL9iDRebWPGOGFdPQRl2eDQNu/uhxIMShjjx74T6kC6jFIkmQ6OqXDtevjGUkyB2IT56RzDBqXf/QPCg== +expect@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.4.2.tgz#4429b0f7e307771d176de9bdf23229b101db6ef6" + integrity sha512-BjAXIDC6ZOW+WBFNg96J22D27Nq5ohn+oGcuP2rtOtcjuxNoV9McpQ60PcQWhdFOSBIQdR72e+4HdnbZTFSTyg== dependencies: - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" ansi-styles "^5.0.0" - jest-get-type "^27.3.1" - jest-matcher-utils "^27.3.1" - jest-message-util "^27.3.1" - jest-regex-util "^27.0.6" + jest-get-type "^27.4.0" + jest-matcher-utils "^27.4.2" + jest-message-util "^27.4.2" + jest-regex-util "^27.4.0" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1881,86 +1916,87 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.3.0.tgz#22a02cc2b34583fc66e443171dc271c0529d263c" - integrity sha512-9DJs9garMHv4RhylUMZgbdCJ3+jHSkpL9aaVKp13xtXAD80qLTLrqcDZL1PHA9dYA0bCI86Nv2BhkLpLhrBcPg== +jest-changed-files@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.4.2.tgz#da2547ea47c6e6a5f6ed336151bd2075736eb4a5" + integrity sha512-/9x8MjekuzUQoPjDHbBiXbNEBauhrPU2ct7m8TfCg69ywt1y/N+yYwGh3gCpnqUS3klYWDU/lSNgv+JhoD2k1A== dependencies: - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.3.1.tgz#1679e74387cbbf0c6a8b42de963250a6469e0797" - integrity sha512-v1dsM9II6gvXokgqq6Yh2jHCpfg7ZqV4jWY66u7npz24JnhP3NHxI0sKT7+ZMQ7IrOWHYAaeEllOySbDbWsiXw== +jest-circus@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.4.2.tgz#466f482207ca9f323b78416c28f4d1fa7588159a" + integrity sha512-2ePUSru1BGMyzxsMvRfu+tNb+PW60rUyMLJBfw1Nrh5zC8RoTPfF+zbE0JToU31a6ZVe4nnrNKWYRzlghAbL0A== dependencies: - "@jest/environment" "^27.3.1" - "@jest/test-result" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/environment" "^27.4.2" + "@jest/test-result" "^27.4.2" + "@jest/types" "^27.4.2" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" - expect "^27.3.1" + expect "^27.4.2" is-generator-fn "^2.0.0" - jest-each "^27.3.1" - jest-matcher-utils "^27.3.1" - jest-message-util "^27.3.1" - jest-runtime "^27.3.1" - jest-snapshot "^27.3.1" - jest-util "^27.3.1" - pretty-format "^27.3.1" + jest-each "^27.4.2" + jest-matcher-utils "^27.4.2" + jest-message-util "^27.4.2" + jest-runtime "^27.4.2" + jest-snapshot "^27.4.2" + jest-util "^27.4.2" + pretty-format "^27.4.2" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.3.1.tgz#b576f9d146ba6643ce0a162d782b40152b6b1d16" - integrity sha512-WHnCqpfK+6EvT62me6WVs8NhtbjAS4/6vZJnk7/2+oOr50cwAzG4Wxt6RXX0hu6m1169ZGMlhYYUNeKBXCph/Q== +jest-cli@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.4.2.tgz#9187777a2d01bf87fb4216ea98f94dc43ea32aff" + integrity sha512-Ex2WhCj4s0XFntTKTnyLgV/CZKgQaZBYrKz02XOZ4nUjFD+26Fji/M1SgHm+2IWEIsQqoipNRx9RJH56p8d7MQ== dependencies: - "@jest/core" "^27.3.1" - "@jest/test-result" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/core" "^27.4.2" + "@jest/test-result" "^27.4.2" + "@jest/types" "^27.4.2" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.3.1" - jest-util "^27.3.1" - jest-validate "^27.3.1" + jest-config "^27.4.2" + jest-util "^27.4.2" + jest-validate "^27.4.2" prompts "^2.0.1" yargs "^16.2.0" -jest-config@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.3.1.tgz#cb3b7f6aaa8c0a7daad4f2b9573899ca7e09bbad" - integrity sha512-KY8xOIbIACZ/vdYCKSopL44I0xboxC751IX+DXL2+Wx6DKNycyEfV3rryC3BPm5Uq/BBqDoMrKuqLEUNJmMKKg== +jest-config@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.4.2.tgz#1440d99101659608c7995e85e29cfde13aa73f63" + integrity sha512-2vKqelsfHPnIzrPTpE9hImqxZLp5l9Vszpci19RdVB2i5OwoM+OkPExZMQb8aGrpEGXoKtlzvdqCL1GObiz8JQ== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.3.1" - "@jest/types" "^27.2.5" - babel-jest "^27.3.1" + "@jest/test-sequencer" "^27.4.2" + "@jest/types" "^27.4.2" + babel-jest "^27.4.2" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" - jest-circus "^27.3.1" - jest-environment-jsdom "^27.3.1" - jest-environment-node "^27.3.1" - jest-get-type "^27.3.1" - jest-jasmine2 "^27.3.1" - jest-regex-util "^27.0.6" - jest-resolve "^27.3.1" - jest-runner "^27.3.1" - jest-util "^27.3.1" - jest-validate "^27.3.1" + jest-circus "^27.4.2" + jest-environment-jsdom "^27.4.2" + jest-environment-node "^27.4.2" + jest-get-type "^27.4.0" + jest-jasmine2 "^27.4.2" + jest-regex-util "^27.4.0" + jest-resolve "^27.4.2" + jest-runner "^27.4.2" + jest-util "^27.4.2" + jest-validate "^27.4.2" micromatch "^4.0.4" - pretty-format "^27.3.1" + pretty-format "^27.4.2" + slash "^3.0.0" -jest-diff@^27.0.0, jest-diff@^27.3.1: +jest-diff@^27.0.0: version "27.3.1" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.3.1.tgz#d2775fea15411f5f5aeda2a5e02c2f36440f6d55" integrity sha512-PCeuAH4AWUo2O5+ksW4pL9v5xJAcIKPUPfIhZBcG1RKv/0+dvaWTQK1Nrau8d67dp65fOqbeMdoil+6PedyEPQ== @@ -1970,137 +2006,153 @@ jest-diff@^27.0.0, jest-diff@^27.3.1: jest-get-type "^27.3.1" pretty-format "^27.3.1" -jest-docblock@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.0.6.tgz#cc78266acf7fe693ca462cbbda0ea4e639e4e5f3" - integrity sha512-Fid6dPcjwepTFraz0YxIMCi7dejjJ/KL9FBjPYhBp4Sv1Y9PdhImlKZqYU555BlN4TQKaTc+F2Av1z+anVyGkA== +jest-diff@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.4.2.tgz#786b2a5211d854f848e2dcc1e324448e9481f36f" + integrity sha512-ujc9ToyUZDh9KcqvQDkk/gkbf6zSaeEg9AiBxtttXW59H/AcqEYp1ciXAtJp+jXWva5nAf/ePtSsgWwE5mqp4Q== dependencies: - detect-newline "^3.0.0" + chalk "^4.0.0" + diff-sequences "^27.4.0" + jest-get-type "^27.4.0" + pretty-format "^27.4.2" -jest-each@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.3.1.tgz#14c56bb4f18dd18dc6bdd853919b5f16a17761ff" - integrity sha512-E4SwfzKJWYcvOYCjOxhZcxwL+AY0uFMvdCOwvzgutJiaiodFjkxQQDxHm8FQBeTqDnSmKsQWn7ldMRzTn2zJaQ== +jest-docblock@^27.4.0: + version "27.4.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.4.0.tgz#06c78035ca93cbbb84faf8fce64deae79a59f69f" + integrity sha512-7TBazUdCKGV7svZ+gh7C8esAnweJoG+SvcF6Cjqj4l17zA2q1cMwx2JObSioubk317H+cjcHgP+7fTs60paulg== dependencies: - "@jest/types" "^27.2.5" - chalk "^4.0.0" - jest-get-type "^27.3.1" - jest-util "^27.3.1" - pretty-format "^27.3.1" + detect-newline "^3.0.0" -jest-environment-jsdom@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.3.1.tgz#63ac36d68f7a9303494df783494856222b57f73e" - integrity sha512-3MOy8qMzIkQlfb3W1TfrD7uZHj+xx8Olix5vMENkj5djPmRqndMaXtpnaZkxmxM+Qc3lo+yVzJjzuXbCcZjAlg== +jest-each@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.4.2.tgz#19364c82a692d0d26557642098d1f4619c9ee7d3" + integrity sha512-53V2MNyW28CTruB3lXaHNk6PkiIFuzdOC9gR3C6j8YE/ACfrPnz+slB0s17AgU1TtxNzLuHyvNlLJ+8QYw9nBg== dependencies: - "@jest/environment" "^27.3.1" - "@jest/fake-timers" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" + chalk "^4.0.0" + jest-get-type "^27.4.0" + jest-util "^27.4.2" + pretty-format "^27.4.2" + +jest-environment-jsdom@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.4.2.tgz#176c8b3529bec1561bb07b48f2b9a5a656927908" + integrity sha512-L0dV4oq4+Ll7hZ8QCGvSELn8uOr938/QKOg6o70kMHiZOpWOjAqSf7fMVAtGhG/BVSvk1GTzhGJNOWsxtH5KbQ== + dependencies: + "@jest/environment" "^27.4.2" + "@jest/fake-timers" "^27.4.2" + "@jest/types" "^27.4.2" + "@types/jsdom" "^16.2.4" "@types/node" "*" - jest-mock "^27.3.0" - jest-util "^27.3.1" + jest-mock "^27.4.2" + jest-util "^27.4.2" jsdom "^16.6.0" -jest-environment-node@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.3.1.tgz#af7d0eed04edafb740311b303f3fe7c8c27014bb" - integrity sha512-T89F/FgkE8waqrTSA7/ydMkcc52uYPgZZ6q8OaZgyiZkJb5QNNCF6oPZjH9IfPFfcc9uBWh1574N0kY0pSvTXw== +jest-environment-node@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.4.2.tgz#bf5586a0924a8d21c13838121ac0941638c7d15e" + integrity sha512-nzTZ5nJ+FabuZPH2YVci7SZIHpvtNRHPt8+vipLkCnAgXGjVzHm7XJWdnNqXbAkExIgiKeVEkVMNZOZE/LeiIg== dependencies: - "@jest/environment" "^27.3.1" - "@jest/fake-timers" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/environment" "^27.4.2" + "@jest/fake-timers" "^27.4.2" + "@jest/types" "^27.4.2" "@types/node" "*" - jest-mock "^27.3.0" - jest-util "^27.3.1" + jest-mock "^27.4.2" + jest-util "^27.4.2" jest-get-type@^27.3.1: version "27.3.1" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.3.1.tgz#a8a2b0a12b50169773099eee60a0e6dd11423eff" integrity sha512-+Ilqi8hgHSAdhlQ3s12CAVNd8H96ZkQBfYoXmArzZnOfAtVAJEiPDBirjByEblvG/4LPJmkL+nBqPO3A1YJAEg== -jest-haste-map@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.3.1.tgz#7656fbd64bf48bda904e759fc9d93e2c807353ee" - integrity sha512-lYfNZIzwPccDJZIyk9Iz5iQMM/MH56NIIcGj7AFU1YyA4ewWFBl8z+YPJuSCRML/ee2cCt2y3W4K3VXPT6Nhzg== +jest-get-type@^27.4.0: + version "27.4.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.4.0.tgz#7503d2663fffa431638337b3998d39c5e928e9b5" + integrity sha512-tk9o+ld5TWq41DkK14L4wox4s2D9MtTpKaAVzXfr5CUKm5ZK2ExcaFE0qls2W71zE/6R2TxxrK9w2r6svAFDBQ== + +jest-haste-map@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.4.2.tgz#7fc7d5e568cca704284f4850885b74a0b8b87587" + integrity sha512-foiyAEePORUN2eeJnOtcM1y8qW0ShEd9kTjWVL4sVaMcuCJM6gtHegvYPBRT0mpI/bs4ueThM90+Eoj2ncoNsA== dependencies: - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" "@types/graceful-fs" "^4.1.2" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.4" - jest-regex-util "^27.0.6" - jest-serializer "^27.0.6" - jest-util "^27.3.1" - jest-worker "^27.3.1" + jest-regex-util "^27.4.0" + jest-serializer "^27.4.0" + jest-util "^27.4.2" + jest-worker "^27.4.2" micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.3.1.tgz#df6d3d07c7dafc344feb43a0072a6f09458d32b0" - integrity sha512-WK11ZUetDQaC09w4/j7o4FZDUIp+4iYWH/Lik34Pv7ukL+DuXFGdnmmi7dT58J2ZYKFB5r13GyE0z3NPeyJmsg== +jest-jasmine2@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.4.2.tgz#c956c88b9c05ca22afdc779deebc2890cb891797" + integrity sha512-VO/fyAJSH9u0THjbteFiL8qc93ufU+yW+bdieDc8tzTCWwlWzO53UHS5nFK1qmE8izb5Smkn+XHlVt6/l06MKQ== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^27.3.1" - "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/environment" "^27.4.2" + "@jest/source-map" "^27.4.0" + "@jest/test-result" "^27.4.2" + "@jest/types" "^27.4.2" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^27.3.1" + expect "^27.4.2" is-generator-fn "^2.0.0" - jest-each "^27.3.1" - jest-matcher-utils "^27.3.1" - jest-message-util "^27.3.1" - jest-runtime "^27.3.1" - jest-snapshot "^27.3.1" - jest-util "^27.3.1" - pretty-format "^27.3.1" + jest-each "^27.4.2" + jest-matcher-utils "^27.4.2" + jest-message-util "^27.4.2" + jest-runtime "^27.4.2" + jest-snapshot "^27.4.2" + jest-util "^27.4.2" + pretty-format "^27.4.2" throat "^6.0.1" -jest-leak-detector@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.3.1.tgz#7fb632c2992ef707a1e73286e1e704f9cc1772b2" - integrity sha512-78QstU9tXbaHzwlRlKmTpjP9k4Pvre5l0r8Spo4SbFFVy/4Abg9I6ZjHwjg2QyKEAMg020XcjP+UgLZIY50yEg== +jest-leak-detector@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.4.2.tgz#7fc3120893a7a911c553f3f2bdff9faa4454abbb" + integrity sha512-ml0KvFYZllzPBJWDei3mDzUhyp/M4ubKebX++fPaudpe8OsxUE+m+P6ciVLboQsrzOCWDjE20/eXew9QMx/VGw== dependencies: - jest-get-type "^27.3.1" - pretty-format "^27.3.1" + jest-get-type "^27.4.0" + pretty-format "^27.4.2" -jest-matcher-utils@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.3.1.tgz#257ad61e54a6d4044e080d85dbdc4a08811e9c1c" - integrity sha512-hX8N7zXS4k+8bC1Aj0OWpGb7D3gIXxYvPNK1inP5xvE4ztbz3rc4AkI6jGVaerepBnfWB17FL5lWFJT3s7qo8w== +jest-matcher-utils@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.4.2.tgz#d17c5038607978a255e0a9a5c32c24e984b6c60b" + integrity sha512-jyP28er3RRtMv+fmYC/PKG8wvAmfGcSNproVTW2Y0P/OY7/hWUOmsPfxN1jOhM+0u2xU984u2yEagGivz9OBGQ== dependencies: chalk "^4.0.0" - jest-diff "^27.3.1" - jest-get-type "^27.3.1" - pretty-format "^27.3.1" + jest-diff "^27.4.2" + jest-get-type "^27.4.0" + pretty-format "^27.4.2" -jest-message-util@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.3.1.tgz#f7c25688ad3410ab10bcb862bcfe3152345c6436" - integrity sha512-bh3JEmxsTZ/9rTm0jQrPElbY2+y48Rw2t47uMfByNyUVR+OfPh4anuyKsGqsNkXk/TI4JbLRZx+7p7Hdt6q1yg== +jest-message-util@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.4.2.tgz#07f3f1bf207d69cf798ce830cc57f1a849f99388" + integrity sha512-OMRqRNd9E0DkBLZpFtZkAGYOXl6ZpoMtQJWTAREJKDOFa0M6ptB7L67tp+cszMBkvSgKOhNtQp2Vbcz3ZZKo/w== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.4" micromatch "^4.0.4" - pretty-format "^27.3.1" + pretty-format "^27.4.2" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^27.3.0: - version "27.3.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.3.0.tgz#ddf0ec3cc3e68c8ccd489bef4d1f525571a1b867" - integrity sha512-ziZiLk0elZOQjD08bLkegBzv5hCABu/c8Ytx45nJKkysQwGaonvmTxwjLqEA4qGdasq9o2I8/HtdGMNnVsMTGw== +jest-mock@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.4.2.tgz#184ff197a25491bfe4570c286daa5d62eb760b88" + integrity sha512-PDDPuyhoukk20JrQKeofK12hqtSka7mWH0QQuxSNgrdiPsrnYYLS6wbzu/HDlxZRzji5ylLRULeuI/vmZZDrYA== dependencies: - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -2108,76 +2160,76 @@ jest-pnp-resolver@^1.2.2: resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== -jest-regex-util@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.6.tgz#02e112082935ae949ce5d13b2675db3d8c87d9c5" - integrity sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ== +jest-regex-util@^27.4.0: + version "27.4.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.4.0.tgz#e4c45b52653128843d07ad94aec34393ea14fbca" + integrity sha512-WeCpMpNnqJYMQoOjm1nTtsgbR4XHAk1u00qDoNBQoykM280+/TmgA5Qh5giC1ecy6a5d4hbSsHzpBtu5yvlbEg== -jest-resolve-dependencies@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.3.1.tgz#85b99bdbdfa46e2c81c6228fc4c91076f624f6e2" - integrity sha512-X7iLzY8pCiYOnvYo2YrK3P9oSE8/3N2f4pUZMJ8IUcZnT81vlSonya1KTO9ZfKGuC+svE6FHK/XOb8SsoRUV1A== +jest-resolve-dependencies@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.4.2.tgz#2f4f363cca26f75a22aefd496f9c7ae65b3de37f" + integrity sha512-hb++cTpqvOWfU49MCP/JQkxmnrhKoAVqXWFjgYXswRSVGk8Q6bDTSvhbCeYXDtXaymY0y7WrrSIlKogClcKJuw== dependencies: - "@jest/types" "^27.2.5" - jest-regex-util "^27.0.6" - jest-snapshot "^27.3.1" + "@jest/types" "^27.4.2" + jest-regex-util "^27.4.0" + jest-snapshot "^27.4.2" -jest-resolve@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.3.1.tgz#0e5542172a1aa0270be6f66a65888647bdd74a3e" - integrity sha512-Dfzt25CFSPo3Y3GCbxynRBZzxq9AdyNN+x/v2IqYx6KVT5Z6me2Z/PsSGFSv3cOSUZqJ9pHxilao/I/m9FouLw== +jest-resolve@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.4.2.tgz#d3e4cbee7acb4a4f8c8bfc270767bec34d2aefaf" + integrity sha512-d/zqPjxCzMqHlOdRTg8cTpO9jY+1/T74KazT8Ws/LwmwxV5sRMWOkiLjmzUCDj/5IqA5XHNK4Hkmlq9Kdpb9Sg== dependencies: - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" chalk "^4.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.3.1" + jest-haste-map "^27.4.2" jest-pnp-resolver "^1.2.2" - jest-util "^27.3.1" - jest-validate "^27.3.1" + jest-util "^27.4.2" + jest-validate "^27.4.2" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.3.1.tgz#1d594dcbf3bd8600a7e839e790384559eaf96e3e" - integrity sha512-r4W6kBn6sPr3TBwQNmqE94mPlYVn7fLBseeJfo4E2uCTmAyDFm2O5DYAQAFP7Q3YfiA/bMwg8TVsciP7k0xOww== +jest-runner@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.4.2.tgz#924a64440c639c47b1155a41f8b3728471a101a6" + integrity sha512-YsgbYKk8V7J5BQPINXhdzNLoqIwUWrJkV9h6/ccsn6fbmC3n3ax1K5cDWzAU9qXyaQhetwFqPpHmAHIACscRKQ== dependencies: - "@jest/console" "^27.3.1" - "@jest/environment" "^27.3.1" - "@jest/test-result" "^27.3.1" - "@jest/transform" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/console" "^27.4.2" + "@jest/environment" "^27.4.2" + "@jest/test-result" "^27.4.2" + "@jest/transform" "^27.4.2" + "@jest/types" "^27.4.2" "@types/node" "*" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" - jest-docblock "^27.0.6" - jest-environment-jsdom "^27.3.1" - jest-environment-node "^27.3.1" - jest-haste-map "^27.3.1" - jest-leak-detector "^27.3.1" - jest-message-util "^27.3.1" - jest-resolve "^27.3.1" - jest-runtime "^27.3.1" - jest-util "^27.3.1" - jest-worker "^27.3.1" + jest-docblock "^27.4.0" + jest-environment-jsdom "^27.4.2" + jest-environment-node "^27.4.2" + jest-haste-map "^27.4.2" + jest-leak-detector "^27.4.2" + jest-message-util "^27.4.2" + jest-resolve "^27.4.2" + jest-runtime "^27.4.2" + jest-util "^27.4.2" + jest-worker "^27.4.2" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.3.1.tgz#80fa32eb85fe5af575865ddf379874777ee993d7" - integrity sha512-qtO6VxPbS8umqhEDpjA4pqTkKQ1Hy4ZSi9mDVeE9Za7LKBo2LdW2jmT+Iod3XFaJqINikZQsn2wEi0j9wPRbLg== - dependencies: - "@jest/console" "^27.3.1" - "@jest/environment" "^27.3.1" - "@jest/globals" "^27.3.1" - "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.3.1" - "@jest/transform" "^27.3.1" - "@jest/types" "^27.2.5" +jest-runtime@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.4.2.tgz#d72da8a0e97366c16ad515a2c437191a72600d38" + integrity sha512-eqPgcBaUNaw6j8T5M+dnfAEh6MIrh2YmtskCr9sl50QYpD22Sg+QqHw3J3nmaLzVMbBtOMHFFxLF0Qx8MsZVFQ== + dependencies: + "@jest/console" "^27.4.2" + "@jest/environment" "^27.4.2" + "@jest/globals" "^27.4.2" + "@jest/source-map" "^27.4.0" + "@jest/test-result" "^27.4.2" + "@jest/transform" "^27.4.2" + "@jest/types" "^27.4.2" "@types/yargs" "^16.0.0" chalk "^4.0.0" cjs-module-lexer "^1.0.0" @@ -2186,30 +2238,30 @@ jest-runtime@^27.3.1: exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-haste-map "^27.3.1" - jest-message-util "^27.3.1" - jest-mock "^27.3.0" - jest-regex-util "^27.0.6" - jest-resolve "^27.3.1" - jest-snapshot "^27.3.1" - jest-util "^27.3.1" - jest-validate "^27.3.1" + jest-haste-map "^27.4.2" + jest-message-util "^27.4.2" + jest-mock "^27.4.2" + jest-regex-util "^27.4.0" + jest-resolve "^27.4.2" + jest-snapshot "^27.4.2" + jest-util "^27.4.2" + jest-validate "^27.4.2" slash "^3.0.0" strip-bom "^4.0.0" yargs "^16.2.0" -jest-serializer@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.0.6.tgz#93a6c74e0132b81a2d54623251c46c498bb5bec1" - integrity sha512-PtGdVK9EGC7dsaziskfqaAPib6wTViY3G8E5wz9tLVPhHyiDNTZn/xjZ4khAw+09QkoOVpn7vF5nPSN6dtBexA== +jest-serializer@^27.4.0: + version "27.4.0" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.4.0.tgz#34866586e1cae2388b7d12ffa2c7819edef5958a" + integrity sha512-RDhpcn5f1JYTX2pvJAGDcnsNTnsV9bjYPU8xcV+xPwOXnUPOQwf4ZEuiU6G9H1UztH+OapMgu/ckEVwO87PwnQ== dependencies: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.3.1.tgz#1da5c0712a252d70917d46c037054f5918c49ee4" - integrity sha512-APZyBvSgQgOT0XumwfFu7X3G5elj6TGhCBLbBdn3R1IzYustPGPE38F51dBWMQ8hRXa9je0vAdeVDtqHLvB6lg== +jest-snapshot@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.4.2.tgz#bd1ea04a8fab402e5ab18b788809fa597ddff532" + integrity sha512-DI7lJlNIu6WSQ+esqhnJzEzU70+dV+cNjoF1c+j5FagWEd3KtOyZvVliAH0RWNQ6KSnAAnKSU0qxJ8UXOOhuUQ== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" @@ -2217,26 +2269,26 @@ jest-snapshot@^27.3.1: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/transform" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/transform" "^27.4.2" + "@jest/types" "^27.4.2" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.3.1" + expect "^27.4.2" graceful-fs "^4.2.4" - jest-diff "^27.3.1" - jest-get-type "^27.3.1" - jest-haste-map "^27.3.1" - jest-matcher-utils "^27.3.1" - jest-message-util "^27.3.1" - jest-resolve "^27.3.1" - jest-util "^27.3.1" + jest-diff "^27.4.2" + jest-get-type "^27.4.0" + jest-haste-map "^27.4.2" + jest-matcher-utils "^27.4.2" + jest-message-util "^27.4.2" + jest-resolve "^27.4.2" + jest-util "^27.4.2" natural-compare "^1.4.0" - pretty-format "^27.3.1" + pretty-format "^27.4.2" semver "^7.3.2" -jest-util@^27.0.0, jest-util@^27.3.1: +jest-util@^27.0.0: version "27.3.1" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.3.1.tgz#a58cdc7b6c8a560caac9ed6bdfc4e4ff23f80429" integrity sha512-8fg+ifEH3GDryLQf/eKZck1DEs2YuVPBCMOaHQxVVLmQwl/CDhWzrvChTX4efLZxGrw+AA0mSXv78cyytBt/uw== @@ -2248,48 +2300,60 @@ jest-util@^27.0.0, jest-util@^27.3.1: graceful-fs "^4.2.4" picomatch "^2.2.3" -jest-validate@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.3.1.tgz#3a395d61a19cd13ae9054af8cdaf299116ef8a24" - integrity sha512-3H0XCHDFLA9uDII67Bwi1Vy7AqwA5HqEEjyy934lgVhtJ3eisw6ShOF1MDmRPspyikef5MyExvIm0/TuLzZ86Q== +jest-util@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.4.2.tgz#ed95b05b1adfd761e2cda47e0144c6a58e05a621" + integrity sha512-YuxxpXU6nlMan9qyLuxHaMMOzXAl5aGZWCSzben5DhLHemYQxCc4YK+4L3ZrCutT8GPQ+ui9k5D8rUJoDioMnA== dependencies: - "@jest/types" "^27.2.5" + "@jest/types" "^27.4.2" + "@types/node" "*" + chalk "^4.0.0" + ci-info "^3.2.0" + graceful-fs "^4.2.4" + picomatch "^2.2.3" + +jest-validate@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.4.2.tgz#eecfcc1b1c9429aa007da08a2bae4e32a81bbbc3" + integrity sha512-hWYsSUej+Fs8ZhOm5vhWzwSLmVaPAxRy+Mr+z5MzeaHm9AxUpXdoVMEW4R86y5gOobVfBsMFLk4Rb+QkiEpx1A== + dependencies: + "@jest/types" "^27.4.2" camelcase "^6.2.0" chalk "^4.0.0" - jest-get-type "^27.3.1" + jest-get-type "^27.4.0" leven "^3.1.0" - pretty-format "^27.3.1" + pretty-format "^27.4.2" -jest-watcher@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.3.1.tgz#ba5e0bc6aa843612b54ddb7f009d1cbff7e05f3e" - integrity sha512-9/xbV6chABsGHWh9yPaAGYVVKurWoP3ZMCv6h+O1v9/+pkOroigs6WzZ0e9gLP/njokUwM7yQhr01LKJVMkaZA== +jest-watcher@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.4.2.tgz#c9037edfd80354c9fe90de4b6f8b6e2b8e736744" + integrity sha512-NJvMVyyBeXfDezhWzUOCOYZrUmkSCiatpjpm+nFUid74OZEHk6aMLrZAukIiFDwdbqp6mTM6Ui1w4oc+8EobQg== dependencies: - "@jest/test-result" "^27.3.1" - "@jest/types" "^27.2.5" + "@jest/test-result" "^27.4.2" + "@jest/types" "^27.4.2" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^27.3.1" + jest-util "^27.4.2" string-length "^4.0.1" -jest-worker@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.3.1.tgz#0def7feae5b8042be38479799aeb7b5facac24b2" - integrity sha512-ks3WCzsiZaOPJl/oMsDjaf0TRiSv7ctNgs0FqRr2nARsovz6AWWy4oLElwcquGSz692DzgZQrCLScPNs5YlC4g== +jest-worker@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.4.2.tgz#0fb123d50955af1a450267787f340a1bf7e12bc4" + integrity sha512-0QMy/zPovLfUPyHuOuuU4E+kGACXXE84nRnq6lBVI9GJg5DCBiA97SATi+ZP8CpiJwEQy1oCPjRBf8AnLjN+Ag== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^27.0.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.3.1.tgz#b5bab64e8f56b6f7e275ba1836898b0d9f1e5c8a" - integrity sha512-U2AX0AgQGd5EzMsiZpYt8HyZ+nSVIh5ujQ9CPp9EQZJMjXIiSZpJNweZl0swatKRoqHWgGKM3zaSwm4Zaz87ng== + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.4.2.tgz#4fb1211ad0b9955ef09a11b96684180a90638985" + integrity sha512-TAReynFYCfHNcrL+8Z74WPGafLFLF++bGkrpcsk6cO5G9S2VuJGhu2c44YFForMgF0GlYmtbpmeznkvZpNgTxg== dependencies: - "@jest/core" "^27.3.1" + "@jest/core" "^27.4.2" import-local "^3.0.2" - jest-cli "^27.3.1" + jest-cli "^27.4.2" js-tokens@^4.0.0: version "4.0.0" @@ -2688,6 +2752,16 @@ pretty-format@^27.0.0, pretty-format@^27.3.1: ansi-styles "^5.0.0" react-is "^17.0.1" +pretty-format@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.4.2.tgz#e4ce92ad66c3888423d332b40477c87d1dac1fb8" + integrity sha512-p0wNtJ9oLuvgOQDEIZ9zQjZffK7KtyR6Si0jnXULIDwrlNF8Cuir3AZP0hHv0jmKuNN/edOnbMjnzd4uTcmWiw== + dependencies: + "@jest/types" "^27.4.2" + ansi-regex "^5.0.1" + ansi-styles "^5.0.0" + react-is "^17.0.1" + pretty-quick@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/pretty-quick/-/pretty-quick-3.1.2.tgz#89d8741af7122cbd7f34182df746c5a7ea360b5c" From 5eb5cc53faa348fb90d477b79b0bfdf7a4fb0828 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Nov 2021 12:02:11 +0000 Subject: [PATCH 442/785] Bump @typescript-eslint/parser from 5.4.0 to 5.5.0 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.4.0 to 5.5.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.5.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index 541d4a86..2dca8efb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -719,13 +719,13 @@ eslint-utils "^3.0.0" "@typescript-eslint/parser@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.4.0.tgz#3aa83ce349d66e39b84151f6d5464928044ca9e3" - integrity sha512-JoB41EmxiYpaEsRwpZEYAJ9XQURPFer8hpkIW9GiaspVLX8oqbqNM8P4EP8HOZg96yaALiLEVWllA2E8vwsIKw== + version "5.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.5.0.tgz#a38070e225330b771074daa659118238793f7fcd" + integrity sha512-JsXBU+kgQOAgzUn2jPrLA+Rd0Y1dswOlX3hp8MuRO1hQDs6xgHtbCXEiAu7bz5hyVURxbXcA2draasMbNqrhmg== dependencies: - "@typescript-eslint/scope-manager" "5.4.0" - "@typescript-eslint/types" "5.4.0" - "@typescript-eslint/typescript-estree" "5.4.0" + "@typescript-eslint/scope-manager" "5.5.0" + "@typescript-eslint/types" "5.5.0" + "@typescript-eslint/typescript-estree" "5.5.0" debug "^4.3.2" "@typescript-eslint/scope-manager@5.4.0": @@ -736,11 +736,24 @@ "@typescript-eslint/types" "5.4.0" "@typescript-eslint/visitor-keys" "5.4.0" +"@typescript-eslint/scope-manager@5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.5.0.tgz#2b9f3672fa6cddcb4160e7e8b49ef1fd00f83c09" + integrity sha512-0/r656RmRLo7CbN4Mdd+xZyPJ/fPCKhYdU6mnZx+8msAD8nJSP8EyCFkzbd6vNVZzZvWlMYrSNekqGrCBqFQhg== + dependencies: + "@typescript-eslint/types" "5.5.0" + "@typescript-eslint/visitor-keys" "5.5.0" + "@typescript-eslint/types@5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.4.0.tgz#b1c130f4b381b77bec19696c6e3366f9781ce8f2" integrity sha512-GjXNpmn+n1LvnttarX+sPD6+S7giO+9LxDIGlRl4wK3a7qMWALOHYuVSZpPTfEIklYjaWuMtfKdeByx0AcaThA== +"@typescript-eslint/types@5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.5.0.tgz#fee61ae510e84ed950a53937a2b443e078107003" + integrity sha512-OaYTqkW3GnuHxqsxxJ6KypIKd5Uw7bFiQJZRyNi1jbMJnK3Hc/DR4KwB6KJj6PBRkJJoaNwzMNv9vtTk87JhOg== + "@typescript-eslint/typescript-estree@5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.4.0.tgz#fe524fb308973c68ebeb7428f3b64499a6ba5fc0" @@ -754,6 +767,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.5.0.tgz#12f422698c1636bd0206086bbec9844c54625ebc" + integrity sha512-pVn8btYUiYrjonhMAO0yG8lm7RApzy2L4RC7Td/mC/qFkyf6vRbGyZozoA94+w6D2Y2GRqpMoCWcwx/EUOzyoQ== + dependencies: + "@typescript-eslint/types" "5.5.0" + "@typescript-eslint/visitor-keys" "5.5.0" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/visitor-keys@5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.4.0.tgz#09bc28efd3621f292fe88c86eef3bf4893364c8c" @@ -762,6 +788,14 @@ "@typescript-eslint/types" "5.4.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.5.0.tgz#4787586897b61f26068a3db5c50b3f5d254f9083" + integrity sha512-4GzJ1kRtsWzHhdM40tv0ZKHNSbkDhF0Woi/TDwVJX6UICwJItvP7ZTXbjTkCdrors7ww0sYe0t+cIKDAJwZ7Kw== + dependencies: + "@typescript-eslint/types" "5.5.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 8e96c8e5924a4561d0914188683ede3e83cc5941 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Dec 2021 12:01:18 +0000 Subject: [PATCH 443/785] Bump jest from 27.4.2 to 27.4.3 Bumps [jest](https://github.com/facebook/jest) from 27.4.2 to 27.4.3. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v27.4.2...v27.4.3) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 118 +++++++++++++++--------------------------------------- 1 file changed, 32 insertions(+), 86 deletions(-) diff --git a/yarn.lock b/yarn.lock index baa6478a..2d6d7757 100644 --- a/yarn.lock +++ b/yarn.lock @@ -371,10 +371,10 @@ jest-util "^27.4.2" slash "^3.0.0" -"@jest/core@^27.4.2": - version "27.4.2" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.4.2.tgz#24f91e4fa4ec983eb811ad518af109eac719d65a" - integrity sha512-0mPM61tDbu8yc9CMKH9bvV+g+17VUpdWQtU1x6P1gk4AKj8iywWi8zBmEIl7pTGjUtYA92CNc/LlBfKCioBOow== +"@jest/core@^27.4.3": + version "27.4.3" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.4.3.tgz#9b9b34f4e6429a633085f476402aa2e3ce707877" + integrity sha512-V9ms3zSxUHxh1E/ZLAiXF7SLejsdFnjWTFizWotMOWvjho0lW5kSjZymhQSodNW0T0ZMQRiha7f8+NcFVm3hJQ== dependencies: "@jest/console" "^27.4.2" "@jest/reporters" "^27.4.2" @@ -388,13 +388,13 @@ exit "^0.1.2" graceful-fs "^4.2.4" jest-changed-files "^27.4.2" - jest-config "^27.4.2" + jest-config "^27.4.3" jest-haste-map "^27.4.2" jest-message-util "^27.4.2" jest-regex-util "^27.4.0" jest-resolve "^27.4.2" jest-resolve-dependencies "^27.4.2" - jest-runner "^27.4.2" + jest-runner "^27.4.3" jest-runtime "^27.4.2" jest-snapshot "^27.4.2" jest-util "^27.4.2" @@ -666,15 +666,6 @@ jest-diff "^27.0.0" pretty-format "^27.0.0" -"@types/jsdom@^16.2.4": - version "16.2.13" - resolved "https://registry.yarnpkg.com/@types/jsdom/-/jsdom-16.2.13.tgz#126c8b7441b159d6234610a48de77b6066f1823f" - integrity sha512-8JQCjdeAidptSsOcRWk2iTm9wCcwn9l+kRG6k5bzUacrnm1ezV4forq0kWjUih/tumAeoG+OspOvQEbbRucBTw== - dependencies: - "@types/node" "*" - "@types/parse5" "*" - "@types/tough-cookie" "*" - "@types/json-schema@^7.0.9": version "7.0.9" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" @@ -690,11 +681,6 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.11.tgz#6ea7342dfb379ea1210835bada87b3c512120234" integrity sha512-KB0sixD67CeecHC33MYn+eYARkqTheIRNuu97y2XMjR7Wu3XibO1vaY6VBV6O/a89SPI81cEUIYT87UqUWlZNw== -"@types/parse5@*": - version "6.0.3" - resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-6.0.3.tgz#705bb349e789efa06f43f128cef51240753424cb" - integrity sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g== - "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.2" resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.2.tgz#4c62fae93eb479660c3bd93f9d24d561597a8281" @@ -705,11 +691,6 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== -"@types/tough-cookie@*": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.1.tgz#8f80dd965ad81f3e1bc26d6f5c727e132721ff40" - integrity sha512-Y0K95ThC3esLEYD6ZuqNek29lNX2EM1qxV8y2FTLUB0ff5wWrk7az+mLrnNFUnaXcgKye22+sFBRXOgpPILZNg== - "@types/yargs-parser@*": version "20.2.1" resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.1.tgz#3b9ce2489919d9e4fea439b76916abc34b2df129" @@ -758,14 +739,6 @@ "@typescript-eslint/typescript-estree" "5.5.0" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.4.0.tgz#aaab08415f4a9cf32b870c7750ae8ba4607126a1" - integrity sha512-pRxFjYwoi8R+n+sibjgF9iUiAELU9ihPBtHzocyW8v8D8G8KeQvXTsW7+CBYIyTYsmhtNk50QPGLE3vrvhM5KA== - dependencies: - "@typescript-eslint/types" "5.4.0" - "@typescript-eslint/visitor-keys" "5.4.0" - "@typescript-eslint/scope-manager@5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.5.0.tgz#2b9f3672fa6cddcb4160e7e8b49ef1fd00f83c09" @@ -774,29 +747,11 @@ "@typescript-eslint/types" "5.5.0" "@typescript-eslint/visitor-keys" "5.5.0" -"@typescript-eslint/types@5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.4.0.tgz#b1c130f4b381b77bec19696c6e3366f9781ce8f2" - integrity sha512-GjXNpmn+n1LvnttarX+sPD6+S7giO+9LxDIGlRl4wK3a7qMWALOHYuVSZpPTfEIklYjaWuMtfKdeByx0AcaThA== - "@typescript-eslint/types@5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.5.0.tgz#fee61ae510e84ed950a53937a2b443e078107003" integrity sha512-OaYTqkW3GnuHxqsxxJ6KypIKd5Uw7bFiQJZRyNi1jbMJnK3Hc/DR4KwB6KJj6PBRkJJoaNwzMNv9vtTk87JhOg== -"@typescript-eslint/typescript-estree@5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.4.0.tgz#fe524fb308973c68ebeb7428f3b64499a6ba5fc0" - integrity sha512-nhlNoBdhKuwiLMx6GrybPT3SFILm5Gij2YBdPEPFlYNFAXUJWX6QRgvi/lwVoadaQEFsizohs6aFRMqsXI2ewA== - dependencies: - "@typescript-eslint/types" "5.4.0" - "@typescript-eslint/visitor-keys" "5.4.0" - debug "^4.3.2" - globby "^11.0.4" - is-glob "^4.0.3" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.5.0.tgz#12f422698c1636bd0206086bbec9844c54625ebc" @@ -810,14 +765,6 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.4.0.tgz#09bc28efd3621f292fe88c86eef3bf4893364c8c" - integrity sha512-PVbax7MeE7tdLfW5SA0fs8NGVVr+buMPrcj+CWYWPXsZCH8qZ1THufDzbXm1xrZ2b2PA1iENJ0sRq5fuUtvsJg== - dependencies: - "@typescript-eslint/types" "5.4.0" - eslint-visitor-keys "^3.0.0" - "@typescript-eslint/visitor-keys@5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.5.0.tgz#4787586897b61f26068a3db5c50b3f5d254f9083" @@ -1984,28 +1931,28 @@ jest-circus@^27.4.2: stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.4.2.tgz#9187777a2d01bf87fb4216ea98f94dc43ea32aff" - integrity sha512-Ex2WhCj4s0XFntTKTnyLgV/CZKgQaZBYrKz02XOZ4nUjFD+26Fji/M1SgHm+2IWEIsQqoipNRx9RJH56p8d7MQ== +jest-cli@^27.4.3: + version "27.4.3" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.4.3.tgz#89acba683b9f91c7a5e342e2ea13aa5414836a0d" + integrity sha512-zZSJBXNC/i8UnJPwcKWsqnhGgIF3uoTYP7th32Zej7KNQJdxzOMj+wCfy2Ox3kU7nXErJ36DtYyXDhfiqaiDRw== dependencies: - "@jest/core" "^27.4.2" + "@jest/core" "^27.4.3" "@jest/test-result" "^27.4.2" "@jest/types" "^27.4.2" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.4.2" + jest-config "^27.4.3" jest-util "^27.4.2" jest-validate "^27.4.2" prompts "^2.0.1" yargs "^16.2.0" -jest-config@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.4.2.tgz#1440d99101659608c7995e85e29cfde13aa73f63" - integrity sha512-2vKqelsfHPnIzrPTpE9hImqxZLp5l9Vszpci19RdVB2i5OwoM+OkPExZMQb8aGrpEGXoKtlzvdqCL1GObiz8JQ== +jest-config@^27.4.3: + version "27.4.3" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.4.3.tgz#7820e08f7526fa3f725423e2f0fa7888ee0ef9c9" + integrity sha512-DQ10HTSqYtC2pO7s9j2jw+li4xUnm2wLYWH2o7K1ftB8NyvToHsXoLlXxtsGh3AW9gUQR6KY/4B7G+T/NswJBw== dependencies: "@babel/core" "^7.1.0" "@jest/test-sequencer" "^27.4.2" @@ -2017,13 +1964,13 @@ jest-config@^27.4.2: glob "^7.1.1" graceful-fs "^4.2.4" jest-circus "^27.4.2" - jest-environment-jsdom "^27.4.2" + jest-environment-jsdom "^27.4.3" jest-environment-node "^27.4.2" jest-get-type "^27.4.0" jest-jasmine2 "^27.4.2" jest-regex-util "^27.4.0" jest-resolve "^27.4.2" - jest-runner "^27.4.2" + jest-runner "^27.4.3" jest-util "^27.4.2" jest-validate "^27.4.2" micromatch "^4.0.4" @@ -2068,15 +2015,14 @@ jest-each@^27.4.2: jest-util "^27.4.2" pretty-format "^27.4.2" -jest-environment-jsdom@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.4.2.tgz#176c8b3529bec1561bb07b48f2b9a5a656927908" - integrity sha512-L0dV4oq4+Ll7hZ8QCGvSELn8uOr938/QKOg6o70kMHiZOpWOjAqSf7fMVAtGhG/BVSvk1GTzhGJNOWsxtH5KbQ== +jest-environment-jsdom@^27.4.3: + version "27.4.3" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.4.3.tgz#74198285f6284888ca9c7486c4e5e67add75aa53" + integrity sha512-x1AUVz3G14LpEJs7KIFUaTINT2n0unOUmvdAby3s/sldUpJJetOJifHo1O/EUQC5fNBowggwJbVulko18y6OWw== dependencies: "@jest/environment" "^27.4.2" "@jest/fake-timers" "^27.4.2" "@jest/types" "^27.4.2" - "@types/jsdom" "^16.2.4" "@types/node" "*" jest-mock "^27.4.2" jest-util "^27.4.2" @@ -2224,10 +2170,10 @@ jest-resolve@^27.4.2: resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.4.2.tgz#924a64440c639c47b1155a41f8b3728471a101a6" - integrity sha512-YsgbYKk8V7J5BQPINXhdzNLoqIwUWrJkV9h6/ccsn6fbmC3n3ax1K5cDWzAU9qXyaQhetwFqPpHmAHIACscRKQ== +jest-runner@^27.4.3: + version "27.4.3" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.4.3.tgz#9f05d4733829787778e8a143ade913834d0828dc" + integrity sha512-JgR6Om/j22Fd6ZUUIGTWNcCtuZVYbNrecb4k89W4UyFJoRtHpo2zMKWkmFFFJoqwWGrfrcPLnVBIgkJiTV3cyA== dependencies: "@jest/console" "^27.4.2" "@jest/environment" "^27.4.2" @@ -2240,7 +2186,7 @@ jest-runner@^27.4.2: exit "^0.1.2" graceful-fs "^4.2.4" jest-docblock "^27.4.0" - jest-environment-jsdom "^27.4.2" + jest-environment-jsdom "^27.4.3" jest-environment-node "^27.4.2" jest-haste-map "^27.4.2" jest-leak-detector "^27.4.2" @@ -2381,13 +2327,13 @@ jest-worker@^27.4.2: supports-color "^8.0.0" jest@^27.0.1: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.4.2.tgz#4fb1211ad0b9955ef09a11b96684180a90638985" - integrity sha512-TAReynFYCfHNcrL+8Z74WPGafLFLF++bGkrpcsk6cO5G9S2VuJGhu2c44YFForMgF0GlYmtbpmeznkvZpNgTxg== + version "27.4.3" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.4.3.tgz#cf7d1876a84c70efece2e01e4f9dfc2e464d9cbb" + integrity sha512-jwsfVABBzuN3Atm+6h6vIEpTs9+VApODLt4dk2qv1WMOpb1weI1IIZfuwpMiWZ62qvWj78MvdvMHIYdUfqrFaA== dependencies: - "@jest/core" "^27.4.2" + "@jest/core" "^27.4.3" import-local "^3.0.2" - jest-cli "^27.4.2" + jest-cli "^27.4.3" js-tokens@^4.0.0: version "4.0.0" From 18de3745989f8681c22fdf2ffb5597c18914a545 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Dec 2021 12:01:56 +0000 Subject: [PATCH 444/785] Bump ts-jest from 27.0.7 to 27.1.0 Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 27.0.7 to 27.1.0. - [Release notes](https://github.com/kulshekhar/ts-jest/releases) - [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/kulshekhar/ts-jest/compare/v27.0.7...v27.1.0) --- updated-dependencies: - dependency-name: ts-jest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 129 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 113 insertions(+), 16 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2d6d7757..f59c3b83 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1289,6 +1289,114 @@ enquirer@^2.3.5: dependencies: ansi-colors "^4.1.1" +esbuild-android-arm64@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.14.2.tgz#256b7cf2f9d382a2a92a4ff4e13187587c9b7c6a" + integrity sha512-hEixaKMN3XXCkoe+0WcexO4CcBVU5DCSUT+7P8JZiWZCbAjSkc9b6Yz2X5DSfQmRCtI/cQRU6TfMYrMQ5NBfdw== + +esbuild-darwin-64@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.14.2.tgz#891a59ce6bc3aded0265f982469b3eb9571b92f8" + integrity sha512-Uq8t0cbJQkxkQdbUfOl2wZqZ/AtLZjvJulR1HHnc96UgyzG9YlCLSDMiqjM+NANEy7/zzvwKJsy3iNC9wwqLJA== + +esbuild-darwin-arm64@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.2.tgz#ab834fffa9c612b2901ca1e77e4695d4d8aa63a2" + integrity sha512-619MSa17sr7YCIrUj88KzQu2ESA4jKYtIYfLU/smX6qNgxQt3Y/gzM4s6sgJ4fPQzirvmXgcHv1ZNQAs/Xh48A== + +esbuild-freebsd-64@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.2.tgz#f7fc87a83f02de27d5a48472571efa1a432ae86d" + integrity sha512-aP6FE/ZsChZpUV6F3HE3x1Pz0paoYXycJ7oLt06g0G9dhJKknPawXCqQg/WMyD+ldCEZfo7F1kavenPdIT/SGQ== + +esbuild-freebsd-arm64@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.2.tgz#bc8758420431106751f3180293cac0b5bc4ce2ee" + integrity sha512-LSm98WTb1QIhyS83+Po0KTpZNdd2XpVpI9ua5rLWqKWbKeNRFwOsjeiuwBaRNc+O32s9oC2ZMefETxHBV6VNkQ== + +esbuild-linux-32@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.14.2.tgz#0cc2dcd816d6d66e255bc7aeac139b1d04246812" + integrity sha512-8VxnNEyeUbiGflTKcuVc5JEPTqXfsx2O6ABwUbfS1Hp26lYPRPC7pKQK5Dxa0MBejGc50jy7YZae3EGQUQ8EkQ== + +esbuild-linux-64@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.14.2.tgz#c790f739aa75b15c153609ea3457153fbe4db93d" + integrity sha512-4bzMS2dNxOJoFIiHId4w+tqQzdnsch71JJV1qZnbnErSFWcR9lRgpSqWnTTFtv6XM+MvltRzSXC5wQ7AEBY6Hg== + +esbuild-linux-arm64@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.2.tgz#96858a1f89ad30274dec780d0e3dd8b5691c6b0c" + integrity sha512-RlIVp0RwJrdtasDF1vTFueLYZ8WuFzxoQ1OoRFZOTyJHCGCNgh7xJIC34gd7B7+RT0CzLBB4LcM5n0LS+hIoww== + +esbuild-linux-arm@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.14.2.tgz#03e193225afa9b1215d2ec6efe8edf0c03eeed6f" + integrity sha512-PaylahvMHhH8YMfJPMKEqi64qA0Su+d4FNfHKvlKes/2dUe4QxgbwXT9oLVgy8iJdcFMrO7By4R8fS8S0p8aVQ== + +esbuild-linux-mips64le@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.2.tgz#972f218d2cb5125237376d40ad60a6e5356a782c" + integrity sha512-Fdwrq2roFnO5oetIiUQQueZ3+5soCxBSJswg3MvYaXDomj47BN6oAWMZgLrFh1oVrtWrxSDLCJBenYdbm2s+qQ== + +esbuild-linux-ppc64le@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.2.tgz#20b71622ac09142b0e523f633af0829def7fed6b" + integrity sha512-vxptskw8JfCDD9QqpRO0XnsM1osuWeRjPaXX1TwdveLogYsbdFtcuiuK/4FxGiNMUr1ojtnCS2rMPbY8puc5NA== + +esbuild-netbsd-64@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.2.tgz#dbd6a25117902ef67aa11d8779dd9c6bca7fbe82" + integrity sha512-I8+LzYK5iSNpspS9eCV9sW67Rj8FgMHimGri4mKiGAmN0pNfx+hFX146rYtzGtewuxKtTsPywWteHx+hPRLDsw== + +esbuild-openbsd-64@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.2.tgz#3c5f199eed459b2f88865548394c0b77383d9ca4" + integrity sha512-120HgMe9elidWUvM2E6mMf0csrGwx8sYDqUIJugyMy1oHm+/nT08bTAVXuwYG/rkMIqsEO9AlMxuYnwR6En/3Q== + +esbuild-sunos-64@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.14.2.tgz#900a681db6b76c6a7f60fc28d2bfe5b11698641c" + integrity sha512-Q3xcf9Uyfra9UuCFxoLixVvdigo0daZaKJ97TL2KNA4bxRUPK18wwGUk3AxvgDQZpRmg82w9PnkaNYo7a+24ow== + +esbuild-windows-32@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.14.2.tgz#61e0ba5bd95b277a55d2b997ac4c04dfe2559220" + integrity sha512-TW7O49tPsrq+N1sW8mb3m24j/iDGa4xzAZH4wHWwoIzgtZAYPKC0hpIhufRRG/LA30bdMChO9pjJZ5mtcybtBQ== + +esbuild-windows-64@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.14.2.tgz#6ab59ef721ff75c682a1c8ae0570dabb637abddb" + integrity sha512-Rym6ViMNmi1E2QuQMWy0AFAfdY0wGwZD73BnzlsQBX5hZBuy/L+Speh7ucUZ16gwsrMM9v86icZUDrSN/lNBKg== + +esbuild-windows-arm64@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.2.tgz#aca2a4f83d2f0d1592ad4be832ed0045fc888cda" + integrity sha512-ZrLbhr0vX5Em/P1faMnHucjVVWPS+m3tktAtz93WkMZLmbRJevhiW1y4CbulBd2z0MEdXZ6emDa1zFHq5O5bSA== + +esbuild@~0.14.0: + version "0.14.2" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.14.2.tgz#9c1e1a652549cc33e44885eea42ea2cc6267edc2" + integrity sha512-l076A6o/PIgcyM24s0dWmDI/b8RQf41uWoJu9I0M71CtW/YSw5T5NUeXxs5lo2tFQD+O4CW4nBHJXx3OY5NpXg== + optionalDependencies: + esbuild-android-arm64 "0.14.2" + esbuild-darwin-64 "0.14.2" + esbuild-darwin-arm64 "0.14.2" + esbuild-freebsd-64 "0.14.2" + esbuild-freebsd-arm64 "0.14.2" + esbuild-linux-32 "0.14.2" + esbuild-linux-64 "0.14.2" + esbuild-linux-arm "0.14.2" + esbuild-linux-arm64 "0.14.2" + esbuild-linux-mips64le "0.14.2" + esbuild-linux-ppc64le "0.14.2" + esbuild-netbsd-64 "0.14.2" + esbuild-openbsd-64 "0.14.2" + esbuild-sunos-64 "0.14.2" + esbuild-windows-32 "0.14.2" + esbuild-windows-64 "0.14.2" + esbuild-windows-arm64 "0.14.2" + escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -2268,19 +2376,7 @@ jest-snapshot@^27.4.2: pretty-format "^27.4.2" semver "^7.3.2" -jest-util@^27.0.0: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.3.1.tgz#a58cdc7b6c8a560caac9ed6bdfc4e4ff23f80429" - integrity sha512-8fg+ifEH3GDryLQf/eKZck1DEs2YuVPBCMOaHQxVVLmQwl/CDhWzrvChTX4efLZxGrw+AA0mSXv78cyytBt/uw== - dependencies: - "@jest/types" "^27.2.5" - "@types/node" "*" - chalk "^4.0.0" - ci-info "^3.2.0" - graceful-fs "^4.2.4" - picomatch "^2.2.3" - -jest-util@^27.4.2: +jest-util@^27.0.0, jest-util@^27.4.2: version "27.4.2" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.4.2.tgz#ed95b05b1adfd761e2cda47e0144c6a58e05a621" integrity sha512-YuxxpXU6nlMan9qyLuxHaMMOzXAl5aGZWCSzben5DhLHemYQxCc4YK+4L3ZrCutT8GPQ+ui9k5D8rUJoDioMnA== @@ -3079,11 +3175,12 @@ tr46@^2.1.0: punycode "^2.1.1" ts-jest@^27.0.5: - version "27.0.7" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.0.7.tgz#fb7c8c8cb5526ab371bc1b23d06e745652cca2d0" - integrity sha512-O41shibMqzdafpuP+CkrOL7ykbmLh+FqQrXEmV9CydQ5JBk0Sj0uAEF5TNNe94fZWKm3yYvWa/IbyV4Yg1zK2Q== + version "27.1.0" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.1.0.tgz#8423cd48a47b4d66700a55702858fa5f9a415df0" + integrity sha512-ZouWlP03JMtzfNHg0ZeDrxAESYGmVhWyHtIl2/01kBbXaMbTr4Vhv6/GeMxUed6GFg/4ycMo+yU6Eo9gI16xTQ== dependencies: bs-logger "0.x" + esbuild "~0.14.0" fast-json-stable-stringify "2.x" jest-util "^27.0.0" json5 "2.x" From df24dec923f37951468496b5a0fcff96d005a585 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Dec 2021 12:02:06 +0000 Subject: [PATCH 445/785] Bump eslint from 8.3.0 to 8.4.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.3.0 to 8.4.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.3.0...v8.4.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2d6d7757..d2fc04bd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -314,14 +314,14 @@ dependencies: "@cspotcode/source-map-consumer" "0.8.0" -"@eslint/eslintrc@^1.0.4": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.0.4.tgz#dfe0ff7ba270848d10c5add0715e04964c034b31" - integrity sha512-h8Vx6MdxwWI2WM8/zREHMoqdgLNXEL4QX3MWSVMdyNJGvXVOs+6lp+m2hc3FnuMHDc4poxFNI20vCk0OmI4G0Q== +"@eslint/eslintrc@^1.0.5": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.0.5.tgz#33f1b838dbf1f923bfa517e008362b78ddbbf318" + integrity sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ== dependencies: ajv "^6.12.4" debug "^4.3.2" - espree "^9.0.0" + espree "^9.2.0" globals "^13.9.0" ignore "^4.0.6" import-fresh "^3.2.1" @@ -329,16 +329,16 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@humanwhocodes/config-array@^0.6.0": - version "0.6.0" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.6.0.tgz#b5621fdb3b32309d2d16575456cbc277fa8f021a" - integrity sha512-JQlEKbcgEUjBFhLIF4iqM7u/9lwgHRBcpHrmUNCALK0Q3amXN6lxdoXLnF0sm11E9VqTmBALR87IlUg1bZ8A9A== +"@humanwhocodes/config-array@^0.9.2": + version "0.9.2" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.2.tgz#68be55c737023009dfc5fe245d51181bb6476914" + integrity sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA== dependencies: - "@humanwhocodes/object-schema" "^1.2.0" + "@humanwhocodes/object-schema" "^1.2.1" debug "^4.1.1" minimatch "^3.0.4" -"@humanwhocodes/object-schema@^1.2.0": +"@humanwhocodes/object-schema@^1.2.1": version "1.2.1" resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== @@ -1360,12 +1360,12 @@ eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.1.0: integrity sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA== eslint@^8.1.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.3.0.tgz#a3c2409507403c1c7f6c42926111d6cbefbc3e85" - integrity sha512-aIay56Ph6RxOTC7xyr59Kt3ewX185SaGnAr8eWukoPLeriCrvGjvAubxuvaXOfsxhtwV5g0uBOsyhAom4qJdww== + version "8.4.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.4.0.tgz#2fa01b271cafc28addc2719e551acff5e89f5230" + integrity sha512-kv0XQcAQJL/VD9THQKhTQZVqkJKA+tIj/v2ZKNaIHRAADcJWFb+B/BAewUYuF6UVg1s2xC5qXVoDk0G8sKGeTA== dependencies: - "@eslint/eslintrc" "^1.0.4" - "@humanwhocodes/config-array" "^0.6.0" + "@eslint/eslintrc" "^1.0.5" + "@humanwhocodes/config-array" "^0.9.2" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" @@ -1376,7 +1376,7 @@ eslint@^8.1.0: eslint-scope "^7.1.0" eslint-utils "^3.0.0" eslint-visitor-keys "^3.1.0" - espree "^9.1.0" + espree "^9.2.0" esquery "^1.4.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -1403,10 +1403,10 @@ eslint@^8.1.0: text-table "^0.2.0" v8-compile-cache "^2.0.3" -espree@^9.0.0, espree@^9.1.0: - version "9.1.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.1.0.tgz#ba9d3c9b34eeae205724124e31de4543d59fbf74" - integrity sha512-ZgYLvCS1wxOczBYGcQT9DDWgicXwJ4dbocr9uYN+/eresBAUuBu+O4WzB21ufQ/JqQT8gyp7hJ3z8SHii32mTQ== +espree@^9.2.0: + version "9.2.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.2.0.tgz#c50814e01611c2d0f8bd4daa83c369eabba80dbc" + integrity sha512-oP3utRkynpZWF/F2x/HZJ+AGtnIclaR7z1pYPxy7NYM2fSO6LgK/Rkny8anRSPK/VwEA1eqm2squui0T7ZMOBg== dependencies: acorn "^8.6.0" acorn-jsx "^5.3.1" From 5a3aa723f6b3898093a9f320270a06ffa43288ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Dec 2021 12:02:13 +0000 Subject: [PATCH 446/785] Bump prettier from 2.5.0 to 2.5.1 Bumps [prettier](https://github.com/prettier/prettier) from 2.5.0 to 2.5.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.5.0...2.5.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2d6d7757..27f9c5d4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2718,9 +2718,9 @@ prelude-ls@~1.1.2: integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= prettier@>=2.3.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.0.tgz#a6370e2d4594e093270419d9cc47f7670488f893" - integrity sha512-FM/zAKgWTxj40rH03VxzIPdXmj39SwSjwG0heUcNFwI+EMZJnY93yAiKXM3dObIKAM5TA88werc8T/EwhB45eg== + version "2.5.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.1.tgz#fff75fa9d519c54cf0fce328c1017d94546bc56a" + integrity sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg== pretty-format@^27.0.0, pretty-format@^27.3.1: version "27.3.1" From b3236a942f95607e785af771fccf428efd3c5364 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Dec 2021 12:01:35 +0000 Subject: [PATCH 447/785] Bump eslint from 8.4.0 to 8.4.1 Bumps [eslint](https://github.com/eslint/eslint) from 8.4.0 to 8.4.1. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.4.0...v8.4.1) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index f91a023f..7591e216 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1468,9 +1468,9 @@ eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.1.0: integrity sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA== eslint@^8.1.0: - version "8.4.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.4.0.tgz#2fa01b271cafc28addc2719e551acff5e89f5230" - integrity sha512-kv0XQcAQJL/VD9THQKhTQZVqkJKA+tIj/v2ZKNaIHRAADcJWFb+B/BAewUYuF6UVg1s2xC5qXVoDk0G8sKGeTA== + version "8.4.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.4.1.tgz#d6531bbf3e598dffd7c0c7d35ec52a0b30fdfa2d" + integrity sha512-TxU/p7LB1KxQ6+7aztTnO7K0i+h0tDi81YRY9VzB6Id71kNz+fFYnf5HD5UOQmxkzcoa0TlVZf9dpMtUv0GpWg== dependencies: "@eslint/eslintrc" "^1.0.5" "@humanwhocodes/config-array" "^0.9.2" From 104d73b555dde5c10c5a52da94f31f045ffc811f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Dec 2021 12:01:44 +0000 Subject: [PATCH 448/785] Bump @types/node from 16.11.11 to 16.11.12 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.11 to 16.11.12. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index f91a023f..a64c95aa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -677,9 +677,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^16.9.1": - version "16.11.11" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.11.tgz#6ea7342dfb379ea1210835bada87b3c512120234" - integrity sha512-KB0sixD67CeecHC33MYn+eYARkqTheIRNuu97y2XMjR7Wu3XibO1vaY6VBV6O/a89SPI81cEUIYT87UqUWlZNw== + version "16.11.12" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.12.tgz#ac7fb693ac587ee182c3780c26eb65546a1a3c10" + integrity sha512-+2Iggwg7PxoO5Kyhvsq9VarmPbIelXP070HMImEpbtGCoyWNINQj4wzjbQCXzdHTRXnqufutJb5KAURZANNBAw== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.2" From 506709f4cc6c17c9d0999f63189f0e87b97597de Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Dec 2021 12:01:59 +0000 Subject: [PATCH 449/785] Bump @typescript-eslint/eslint-plugin from 5.5.0 to 5.6.0 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.5.0 to 5.6.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.6.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 58 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 46 insertions(+), 12 deletions(-) diff --git a/yarn.lock b/yarn.lock index f91a023f..f31f0115 100644 --- a/yarn.lock +++ b/yarn.lock @@ -704,12 +704,12 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.4.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.5.0.tgz#12d5f47f127af089b985f3a205c0e34a812f8fce" - integrity sha512-4bV6fulqbuaO9UMXU0Ia0o6z6if+kmMRW8rMRyfqXj/eGrZZRGedS4n0adeGNnjr8LKAM495hrQ7Tea52UWmQA== + version "5.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.6.0.tgz#efd8668b3d6627c46ce722c2afe813928fe120a0" + integrity sha512-MIbeMy5qfLqtgs1hWd088k1hOuRsN9JrHUPwVVKCD99EOUqScd7SrwoZl4Gso05EAP9w1kvLWUVGJOVpRPkDPA== dependencies: - "@typescript-eslint/experimental-utils" "5.5.0" - "@typescript-eslint/scope-manager" "5.5.0" + "@typescript-eslint/experimental-utils" "5.6.0" + "@typescript-eslint/scope-manager" "5.6.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -717,15 +717,15 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/experimental-utils@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.5.0.tgz#3fe2514dc2f3cd95562206e4058435ea51df609e" - integrity sha512-kjWeeVU+4lQ1SLYErRKV5yDXbWDPkpbzTUUlfAUifPYvpX0qZlrcCZ96/6oWxt3QxtK5WVhXz+KsnwW9cIW+3A== +"@typescript-eslint/experimental-utils@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.6.0.tgz#f3a5960f2004abdcac7bb81412bafc1560841c23" + integrity sha512-VDoRf3Qj7+W3sS/ZBXZh3LBzp0snDLEgvp6qj0vOAIiAPM07bd5ojQ3CTzF/QFl5AKh7Bh1ycgj6lFBJHUt/DA== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.5.0" - "@typescript-eslint/types" "5.5.0" - "@typescript-eslint/typescript-estree" "5.5.0" + "@typescript-eslint/scope-manager" "5.6.0" + "@typescript-eslint/types" "5.6.0" + "@typescript-eslint/typescript-estree" "5.6.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -747,11 +747,24 @@ "@typescript-eslint/types" "5.5.0" "@typescript-eslint/visitor-keys" "5.5.0" +"@typescript-eslint/scope-manager@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.6.0.tgz#9dd7f007dc8f3a34cdff6f79f5eaab27ae05157e" + integrity sha512-1U1G77Hw2jsGWVsO2w6eVCbOg0HZ5WxL/cozVSTfqnL/eB9muhb8THsP0G3w+BB5xAHv9KptwdfYFAUfzcIh4A== + dependencies: + "@typescript-eslint/types" "5.6.0" + "@typescript-eslint/visitor-keys" "5.6.0" + "@typescript-eslint/types@5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.5.0.tgz#fee61ae510e84ed950a53937a2b443e078107003" integrity sha512-OaYTqkW3GnuHxqsxxJ6KypIKd5Uw7bFiQJZRyNi1jbMJnK3Hc/DR4KwB6KJj6PBRkJJoaNwzMNv9vtTk87JhOg== +"@typescript-eslint/types@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.6.0.tgz#745cb1b59daadcc1f32f7be95f0f68accf38afdd" + integrity sha512-OIZffked7mXv4mXzWU5MgAEbCf9ecNJBKi+Si6/I9PpTaj+cf2x58h2oHW5/P/yTnPkKaayfjhLvx+crnl5ubA== + "@typescript-eslint/typescript-estree@5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.5.0.tgz#12f422698c1636bd0206086bbec9844c54625ebc" @@ -765,6 +778,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.6.0.tgz#dfbb19c9307fdd81bd9c650c67e8397821d7faf0" + integrity sha512-92vK5tQaE81rK7fOmuWMrSQtK1IMonESR+RJR2Tlc7w4o0MeEdjgidY/uO2Gobh7z4Q1hhS94Cr7r021fMVEeA== + dependencies: + "@typescript-eslint/types" "5.6.0" + "@typescript-eslint/visitor-keys" "5.6.0" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/visitor-keys@5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.5.0.tgz#4787586897b61f26068a3db5c50b3f5d254f9083" @@ -773,6 +799,14 @@ "@typescript-eslint/types" "5.5.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.6.0.tgz#3e36509e103fe9713d8f035ac977235fd63cb6e6" + integrity sha512-1p7hDp5cpRFUyE3+lvA74egs+RWSgumrBpzBCDzfTFv0aQ7lIeay80yU0hIxgAhwQ6PcasW35kaOCyDOv6O/Ng== + dependencies: + "@typescript-eslint/types" "5.6.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 ac4e2e3933dd3c651ad6992ff190aa31ea2ac33a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Dec 2021 12:02:10 +0000 Subject: [PATCH 450/785] Bump @typescript-eslint/parser from 5.5.0 to 5.6.0 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.5.0 to 5.6.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.6.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index f91a023f..23f8f429 100644 --- a/yarn.lock +++ b/yarn.lock @@ -730,13 +730,13 @@ eslint-utils "^3.0.0" "@typescript-eslint/parser@^5.4.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.5.0.tgz#a38070e225330b771074daa659118238793f7fcd" - integrity sha512-JsXBU+kgQOAgzUn2jPrLA+Rd0Y1dswOlX3hp8MuRO1hQDs6xgHtbCXEiAu7bz5hyVURxbXcA2draasMbNqrhmg== + version "5.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.6.0.tgz#11677324659641400d653253c03dcfbed468d199" + integrity sha512-YVK49NgdUPQ8SpCZaOpiq1kLkYRPMv9U5gcMrywzI8brtwZjr/tG3sZpuHyODt76W/A0SufNjYt9ZOgrC4tLIQ== dependencies: - "@typescript-eslint/scope-manager" "5.5.0" - "@typescript-eslint/types" "5.5.0" - "@typescript-eslint/typescript-estree" "5.5.0" + "@typescript-eslint/scope-manager" "5.6.0" + "@typescript-eslint/types" "5.6.0" + "@typescript-eslint/typescript-estree" "5.6.0" debug "^4.3.2" "@typescript-eslint/scope-manager@5.5.0": @@ -747,11 +747,24 @@ "@typescript-eslint/types" "5.5.0" "@typescript-eslint/visitor-keys" "5.5.0" +"@typescript-eslint/scope-manager@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.6.0.tgz#9dd7f007dc8f3a34cdff6f79f5eaab27ae05157e" + integrity sha512-1U1G77Hw2jsGWVsO2w6eVCbOg0HZ5WxL/cozVSTfqnL/eB9muhb8THsP0G3w+BB5xAHv9KptwdfYFAUfzcIh4A== + dependencies: + "@typescript-eslint/types" "5.6.0" + "@typescript-eslint/visitor-keys" "5.6.0" + "@typescript-eslint/types@5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.5.0.tgz#fee61ae510e84ed950a53937a2b443e078107003" integrity sha512-OaYTqkW3GnuHxqsxxJ6KypIKd5Uw7bFiQJZRyNi1jbMJnK3Hc/DR4KwB6KJj6PBRkJJoaNwzMNv9vtTk87JhOg== +"@typescript-eslint/types@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.6.0.tgz#745cb1b59daadcc1f32f7be95f0f68accf38afdd" + integrity sha512-OIZffked7mXv4mXzWU5MgAEbCf9ecNJBKi+Si6/I9PpTaj+cf2x58h2oHW5/P/yTnPkKaayfjhLvx+crnl5ubA== + "@typescript-eslint/typescript-estree@5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.5.0.tgz#12f422698c1636bd0206086bbec9844c54625ebc" @@ -765,6 +778,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.6.0.tgz#dfbb19c9307fdd81bd9c650c67e8397821d7faf0" + integrity sha512-92vK5tQaE81rK7fOmuWMrSQtK1IMonESR+RJR2Tlc7w4o0MeEdjgidY/uO2Gobh7z4Q1hhS94Cr7r021fMVEeA== + dependencies: + "@typescript-eslint/types" "5.6.0" + "@typescript-eslint/visitor-keys" "5.6.0" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/visitor-keys@5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.5.0.tgz#4787586897b61f26068a3db5c50b3f5d254f9083" @@ -773,6 +799,14 @@ "@typescript-eslint/types" "5.5.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.6.0.tgz#3e36509e103fe9713d8f035ac977235fd63cb6e6" + integrity sha512-1p7hDp5cpRFUyE3+lvA74egs+RWSgumrBpzBCDzfTFv0aQ7lIeay80yU0hIxgAhwQ6PcasW35kaOCyDOv6O/Ng== + dependencies: + "@typescript-eslint/types" "5.6.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 f4dad5d3dda6e3348023faeeb5947547c0dff348 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Dec 2021 12:01:38 +0000 Subject: [PATCH 451/785] Bump ts-jest from 27.1.0 to 27.1.1 Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 27.1.0 to 27.1.1. - [Release notes](https://github.com/kulshekhar/ts-jest/releases) - [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/kulshekhar/ts-jest/compare/v27.1.0...v27.1.1) --- updated-dependencies: - dependency-name: ts-jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 149 ++---------------------------------------------------- 1 file changed, 3 insertions(+), 146 deletions(-) diff --git a/yarn.lock b/yarn.lock index d40070cb..2e6ca2a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -739,14 +739,6 @@ "@typescript-eslint/typescript-estree" "5.6.0" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.5.0.tgz#2b9f3672fa6cddcb4160e7e8b49ef1fd00f83c09" - integrity sha512-0/r656RmRLo7CbN4Mdd+xZyPJ/fPCKhYdU6mnZx+8msAD8nJSP8EyCFkzbd6vNVZzZvWlMYrSNekqGrCBqFQhg== - dependencies: - "@typescript-eslint/types" "5.5.0" - "@typescript-eslint/visitor-keys" "5.5.0" - "@typescript-eslint/scope-manager@5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.6.0.tgz#9dd7f007dc8f3a34cdff6f79f5eaab27ae05157e" @@ -755,29 +747,11 @@ "@typescript-eslint/types" "5.6.0" "@typescript-eslint/visitor-keys" "5.6.0" -"@typescript-eslint/types@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.5.0.tgz#fee61ae510e84ed950a53937a2b443e078107003" - integrity sha512-OaYTqkW3GnuHxqsxxJ6KypIKd5Uw7bFiQJZRyNi1jbMJnK3Hc/DR4KwB6KJj6PBRkJJoaNwzMNv9vtTk87JhOg== - "@typescript-eslint/types@5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.6.0.tgz#745cb1b59daadcc1f32f7be95f0f68accf38afdd" integrity sha512-OIZffked7mXv4mXzWU5MgAEbCf9ecNJBKi+Si6/I9PpTaj+cf2x58h2oHW5/P/yTnPkKaayfjhLvx+crnl5ubA== -"@typescript-eslint/typescript-estree@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.5.0.tgz#12f422698c1636bd0206086bbec9844c54625ebc" - integrity sha512-pVn8btYUiYrjonhMAO0yG8lm7RApzy2L4RC7Td/mC/qFkyf6vRbGyZozoA94+w6D2Y2GRqpMoCWcwx/EUOzyoQ== - dependencies: - "@typescript-eslint/types" "5.5.0" - "@typescript-eslint/visitor-keys" "5.5.0" - debug "^4.3.2" - globby "^11.0.4" - is-glob "^4.0.3" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.6.0.tgz#dfbb19c9307fdd81bd9c650c67e8397821d7faf0" @@ -791,14 +765,6 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.5.0.tgz#4787586897b61f26068a3db5c50b3f5d254f9083" - integrity sha512-4GzJ1kRtsWzHhdM40tv0ZKHNSbkDhF0Woi/TDwVJX6UICwJItvP7ZTXbjTkCdrors7ww0sYe0t+cIKDAJwZ7Kw== - dependencies: - "@typescript-eslint/types" "5.5.0" - eslint-visitor-keys "^3.0.0" - "@typescript-eslint/visitor-keys@5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.6.0.tgz#3e36509e103fe9713d8f035ac977235fd63cb6e6" @@ -1323,114 +1289,6 @@ enquirer@^2.3.5: dependencies: ansi-colors "^4.1.1" -esbuild-android-arm64@0.14.2: - version "0.14.2" - resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.14.2.tgz#256b7cf2f9d382a2a92a4ff4e13187587c9b7c6a" - integrity sha512-hEixaKMN3XXCkoe+0WcexO4CcBVU5DCSUT+7P8JZiWZCbAjSkc9b6Yz2X5DSfQmRCtI/cQRU6TfMYrMQ5NBfdw== - -esbuild-darwin-64@0.14.2: - version "0.14.2" - resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.14.2.tgz#891a59ce6bc3aded0265f982469b3eb9571b92f8" - integrity sha512-Uq8t0cbJQkxkQdbUfOl2wZqZ/AtLZjvJulR1HHnc96UgyzG9YlCLSDMiqjM+NANEy7/zzvwKJsy3iNC9wwqLJA== - -esbuild-darwin-arm64@0.14.2: - version "0.14.2" - resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.2.tgz#ab834fffa9c612b2901ca1e77e4695d4d8aa63a2" - integrity sha512-619MSa17sr7YCIrUj88KzQu2ESA4jKYtIYfLU/smX6qNgxQt3Y/gzM4s6sgJ4fPQzirvmXgcHv1ZNQAs/Xh48A== - -esbuild-freebsd-64@0.14.2: - version "0.14.2" - resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.2.tgz#f7fc87a83f02de27d5a48472571efa1a432ae86d" - integrity sha512-aP6FE/ZsChZpUV6F3HE3x1Pz0paoYXycJ7oLt06g0G9dhJKknPawXCqQg/WMyD+ldCEZfo7F1kavenPdIT/SGQ== - -esbuild-freebsd-arm64@0.14.2: - version "0.14.2" - resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.2.tgz#bc8758420431106751f3180293cac0b5bc4ce2ee" - integrity sha512-LSm98WTb1QIhyS83+Po0KTpZNdd2XpVpI9ua5rLWqKWbKeNRFwOsjeiuwBaRNc+O32s9oC2ZMefETxHBV6VNkQ== - -esbuild-linux-32@0.14.2: - version "0.14.2" - resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.14.2.tgz#0cc2dcd816d6d66e255bc7aeac139b1d04246812" - integrity sha512-8VxnNEyeUbiGflTKcuVc5JEPTqXfsx2O6ABwUbfS1Hp26lYPRPC7pKQK5Dxa0MBejGc50jy7YZae3EGQUQ8EkQ== - -esbuild-linux-64@0.14.2: - version "0.14.2" - resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.14.2.tgz#c790f739aa75b15c153609ea3457153fbe4db93d" - integrity sha512-4bzMS2dNxOJoFIiHId4w+tqQzdnsch71JJV1qZnbnErSFWcR9lRgpSqWnTTFtv6XM+MvltRzSXC5wQ7AEBY6Hg== - -esbuild-linux-arm64@0.14.2: - version "0.14.2" - resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.2.tgz#96858a1f89ad30274dec780d0e3dd8b5691c6b0c" - integrity sha512-RlIVp0RwJrdtasDF1vTFueLYZ8WuFzxoQ1OoRFZOTyJHCGCNgh7xJIC34gd7B7+RT0CzLBB4LcM5n0LS+hIoww== - -esbuild-linux-arm@0.14.2: - version "0.14.2" - resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.14.2.tgz#03e193225afa9b1215d2ec6efe8edf0c03eeed6f" - integrity sha512-PaylahvMHhH8YMfJPMKEqi64qA0Su+d4FNfHKvlKes/2dUe4QxgbwXT9oLVgy8iJdcFMrO7By4R8fS8S0p8aVQ== - -esbuild-linux-mips64le@0.14.2: - version "0.14.2" - resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.2.tgz#972f218d2cb5125237376d40ad60a6e5356a782c" - integrity sha512-Fdwrq2roFnO5oetIiUQQueZ3+5soCxBSJswg3MvYaXDomj47BN6oAWMZgLrFh1oVrtWrxSDLCJBenYdbm2s+qQ== - -esbuild-linux-ppc64le@0.14.2: - version "0.14.2" - resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.2.tgz#20b71622ac09142b0e523f633af0829def7fed6b" - integrity sha512-vxptskw8JfCDD9QqpRO0XnsM1osuWeRjPaXX1TwdveLogYsbdFtcuiuK/4FxGiNMUr1ojtnCS2rMPbY8puc5NA== - -esbuild-netbsd-64@0.14.2: - version "0.14.2" - resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.2.tgz#dbd6a25117902ef67aa11d8779dd9c6bca7fbe82" - integrity sha512-I8+LzYK5iSNpspS9eCV9sW67Rj8FgMHimGri4mKiGAmN0pNfx+hFX146rYtzGtewuxKtTsPywWteHx+hPRLDsw== - -esbuild-openbsd-64@0.14.2: - version "0.14.2" - resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.2.tgz#3c5f199eed459b2f88865548394c0b77383d9ca4" - integrity sha512-120HgMe9elidWUvM2E6mMf0csrGwx8sYDqUIJugyMy1oHm+/nT08bTAVXuwYG/rkMIqsEO9AlMxuYnwR6En/3Q== - -esbuild-sunos-64@0.14.2: - version "0.14.2" - resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.14.2.tgz#900a681db6b76c6a7f60fc28d2bfe5b11698641c" - integrity sha512-Q3xcf9Uyfra9UuCFxoLixVvdigo0daZaKJ97TL2KNA4bxRUPK18wwGUk3AxvgDQZpRmg82w9PnkaNYo7a+24ow== - -esbuild-windows-32@0.14.2: - version "0.14.2" - resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.14.2.tgz#61e0ba5bd95b277a55d2b997ac4c04dfe2559220" - integrity sha512-TW7O49tPsrq+N1sW8mb3m24j/iDGa4xzAZH4wHWwoIzgtZAYPKC0hpIhufRRG/LA30bdMChO9pjJZ5mtcybtBQ== - -esbuild-windows-64@0.14.2: - version "0.14.2" - resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.14.2.tgz#6ab59ef721ff75c682a1c8ae0570dabb637abddb" - integrity sha512-Rym6ViMNmi1E2QuQMWy0AFAfdY0wGwZD73BnzlsQBX5hZBuy/L+Speh7ucUZ16gwsrMM9v86icZUDrSN/lNBKg== - -esbuild-windows-arm64@0.14.2: - version "0.14.2" - resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.2.tgz#aca2a4f83d2f0d1592ad4be832ed0045fc888cda" - integrity sha512-ZrLbhr0vX5Em/P1faMnHucjVVWPS+m3tktAtz93WkMZLmbRJevhiW1y4CbulBd2z0MEdXZ6emDa1zFHq5O5bSA== - -esbuild@~0.14.0: - version "0.14.2" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.14.2.tgz#9c1e1a652549cc33e44885eea42ea2cc6267edc2" - integrity sha512-l076A6o/PIgcyM24s0dWmDI/b8RQf41uWoJu9I0M71CtW/YSw5T5NUeXxs5lo2tFQD+O4CW4nBHJXx3OY5NpXg== - optionalDependencies: - esbuild-android-arm64 "0.14.2" - esbuild-darwin-64 "0.14.2" - esbuild-darwin-arm64 "0.14.2" - esbuild-freebsd-64 "0.14.2" - esbuild-freebsd-arm64 "0.14.2" - esbuild-linux-32 "0.14.2" - esbuild-linux-64 "0.14.2" - esbuild-linux-arm "0.14.2" - esbuild-linux-arm64 "0.14.2" - esbuild-linux-mips64le "0.14.2" - esbuild-linux-ppc64le "0.14.2" - esbuild-netbsd-64 "0.14.2" - esbuild-openbsd-64 "0.14.2" - esbuild-sunos-64 "0.14.2" - esbuild-windows-32 "0.14.2" - esbuild-windows-64 "0.14.2" - esbuild-windows-arm64 "0.14.2" - escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -3209,12 +3067,11 @@ tr46@^2.1.0: punycode "^2.1.1" ts-jest@^27.0.5: - version "27.1.0" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.1.0.tgz#8423cd48a47b4d66700a55702858fa5f9a415df0" - integrity sha512-ZouWlP03JMtzfNHg0ZeDrxAESYGmVhWyHtIl2/01kBbXaMbTr4Vhv6/GeMxUed6GFg/4ycMo+yU6Eo9gI16xTQ== + version "27.1.1" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.1.1.tgz#5a54aca96db1dac37c681f3029dd10f3a8c36192" + integrity sha512-Ds0VkB+cB+8g2JUmP/GKWndeZcCKrbe6jzolGrVWdqVUFByY/2KDHqxJ7yBSon7hDB1TA4PXxjfZ+JjzJisvgA== dependencies: bs-logger "0.x" - esbuild "~0.14.0" fast-json-stable-stringify "2.x" jest-util "^27.0.0" json5 "2.x" From 96bf208676b881b6d6aa0c907486453de63b0767 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Dec 2021 12:01:37 +0000 Subject: [PATCH 452/785] Bump jest from 27.4.3 to 27.4.4 Bumps [jest](https://github.com/facebook/jest) from 27.4.3 to 27.4.4. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v27.4.3...v27.4.4) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 282 +++++++++++++++++++++++++++--------------------------- 1 file changed, 141 insertions(+), 141 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2e6ca2a3..e5e99447 100644 --- a/yarn.lock +++ b/yarn.lock @@ -371,15 +371,15 @@ jest-util "^27.4.2" slash "^3.0.0" -"@jest/core@^27.4.3": - version "27.4.3" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.4.3.tgz#9b9b34f4e6429a633085f476402aa2e3ce707877" - integrity sha512-V9ms3zSxUHxh1E/ZLAiXF7SLejsdFnjWTFizWotMOWvjho0lW5kSjZymhQSodNW0T0ZMQRiha7f8+NcFVm3hJQ== +"@jest/core@^27.4.4": + version "27.4.4" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.4.4.tgz#f2ba293235ca23fb48b4b923ccfe67c17e791a92" + integrity sha512-xBNPVqYAdAiAMXnb4ugx9Cdmr0S52lBsLbQMR/sGBRO0810VSPKiuSDtuup6qdkK1e9vxbv3KK3IAP1QFAp8mw== dependencies: "@jest/console" "^27.4.2" - "@jest/reporters" "^27.4.2" + "@jest/reporters" "^27.4.4" "@jest/test-result" "^27.4.2" - "@jest/transform" "^27.4.2" + "@jest/transform" "^27.4.4" "@jest/types" "^27.4.2" "@types/node" "*" ansi-escapes "^4.2.1" @@ -388,15 +388,15 @@ exit "^0.1.2" graceful-fs "^4.2.4" jest-changed-files "^27.4.2" - jest-config "^27.4.3" - jest-haste-map "^27.4.2" + jest-config "^27.4.4" + jest-haste-map "^27.4.4" jest-message-util "^27.4.2" jest-regex-util "^27.4.0" - jest-resolve "^27.4.2" - jest-resolve-dependencies "^27.4.2" - jest-runner "^27.4.3" - jest-runtime "^27.4.2" - jest-snapshot "^27.4.2" + jest-resolve "^27.4.4" + jest-resolve-dependencies "^27.4.4" + jest-runner "^27.4.4" + jest-runtime "^27.4.4" + jest-snapshot "^27.4.4" jest-util "^27.4.2" jest-validate "^27.4.2" jest-watcher "^27.4.2" @@ -405,10 +405,10 @@ slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.4.2": - version "27.4.2" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.4.2.tgz#03efabce528dbb09bffd3ec7e39bb0f3f7475cc2" - integrity sha512-uSljKxh/rGlHlmhyeG4ZoVK9hOec+EPBkwTHkHKQ2EqDu5K+MaG9uJZ8o1CbRsSdZqSuhXvJCYhBWsORPPg6qw== +"@jest/environment@^27.4.4": + version "27.4.4" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.4.4.tgz#66ebebc79673d84aad29d2bb70a8c51e6c29bb4d" + integrity sha512-q+niMx7cJgt/t/b6dzLOh4W8Ef/8VyKG7hxASK39jakijJzbFBGpptx3RXz13FFV7OishQ9lTbv+dQ5K3EhfDQ== dependencies: "@jest/fake-timers" "^27.4.2" "@jest/types" "^27.4.2" @@ -427,24 +427,24 @@ jest-mock "^27.4.2" jest-util "^27.4.2" -"@jest/globals@^27.4.2": - version "27.4.2" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.4.2.tgz#56a402c5ebf22eba1d34e900772147f5126ea2d8" - integrity sha512-KkfaHEttlGpXYAQTZHgrESiEPx2q/DKAFLGLFda1uGVrqc17snd3YVPhOxlXOHIzVPs+lQ/SDB2EIvxyGzb3Ew== +"@jest/globals@^27.4.4": + version "27.4.4" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.4.4.tgz#fe501a80c23ea2dab585c42be2a519bb5e38530d" + integrity sha512-bqpqQhW30BOreXM8bA8t8JbOQzsq/WnPTnBl+It3UxAD9J8yxEAaBEylHx1dtBapAr/UBk8GidXbzmqnee8tYQ== dependencies: - "@jest/environment" "^27.4.2" + "@jest/environment" "^27.4.4" "@jest/types" "^27.4.2" expect "^27.4.2" -"@jest/reporters@^27.4.2": - version "27.4.2" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.4.2.tgz#d3860c5d3f668fa1326ab2bf5989f774e5c03f04" - integrity sha512-sp4aqmdBJtjKetEakzDPcZggPcVIF6w9QLkYBbaWDV6e/SIsHnF1S4KtIH91eEc2fp7ep6V/e1xvdfEoho1d2w== +"@jest/reporters@^27.4.4": + version "27.4.4" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.4.4.tgz#9e809829f602cd6e68bd058d1ea528f4b7482365" + integrity sha512-ssyJSw9B9Awb1QaxDhIPSs4de1b7SE2kv7tqFehQL13xpn5HUkMYZK/ufTOXiCAnXFOZS+XDl1GaQ/LmJAzI1A== dependencies: "@bcoe/v8-coverage" "^0.2.3" "@jest/console" "^27.4.2" "@jest/test-result" "^27.4.2" - "@jest/transform" "^27.4.2" + "@jest/transform" "^27.4.4" "@jest/types" "^27.4.2" "@types/node" "*" chalk "^4.0.0" @@ -457,10 +457,10 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^27.4.2" - jest-resolve "^27.4.2" + jest-haste-map "^27.4.4" + jest-resolve "^27.4.4" jest-util "^27.4.2" - jest-worker "^27.4.2" + jest-worker "^27.4.4" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" @@ -486,20 +486,20 @@ "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.4.2": - version "27.4.2" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.4.2.tgz#94bb7e5412d59ae2a8a4b8f9925bb16b6dc82b4c" - integrity sha512-HmHp5mlh9f9GyNej5yCS1JZIFfUGnP9+jEOH5zoq5EmsuZeYD+dGULqyvGDPtuzzbyAFJ6R4+z4SS0VvnFwwGQ== +"@jest/test-sequencer@^27.4.4": + version "27.4.4" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.4.4.tgz#60be14369b2702e42d6042e71b8ab3fc69f5ce68" + integrity sha512-mCh+d4JTGTtX7vr13d7q2GHJy33nAobEwtEJ8X3u7R8+0ImVO2eAsQzsLfX8lyvdYHBxYABhqbYuaUNo42/pQw== dependencies: "@jest/test-result" "^27.4.2" graceful-fs "^4.2.4" - jest-haste-map "^27.4.2" - jest-runtime "^27.4.2" + jest-haste-map "^27.4.4" + jest-runtime "^27.4.4" -"@jest/transform@^27.4.2": - version "27.4.2" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.4.2.tgz#459885e96de2e21fc68b8b371e90aa653966dd0d" - integrity sha512-RTKcPZllfcmLfnlxBya7aypofhdz05+E6QITe55Ex0rxyerkgjmmpMlvVn11V0cP719Ps6WcDYCnDzxnnJUwKg== +"@jest/transform@^27.4.4": + version "27.4.4" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.4.4.tgz#347e39402730879ba88c6ea6982db0d88640aa78" + integrity sha512-7U/nDSrGsGzL7+X8ScNFV71w8u8knJQWSa9C2xsrrKLMOgb+rWuCG4VAyWke/53BU96GnT+Ka81xCAHA5gk6zA== dependencies: "@babel/core" "^7.1.0" "@jest/types" "^27.4.2" @@ -508,7 +508,7 @@ convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.4.2" + jest-haste-map "^27.4.4" jest-regex-util "^27.4.0" jest-util "^27.4.2" micromatch "^4.0.4" @@ -909,12 +909,12 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= -babel-jest@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.4.2.tgz#6edf80971045cfd44f3f10b6eda6007d95f62742" - integrity sha512-MADrjb3KBO2eyZCAc6QaJg6RT5u+6oEdDyHO5HEalnpwQ6LrhTsQF2Kj1Wnz2t6UPXIXPk18dSXXOT0wF5yTxA== +babel-jest@^27.4.4: + version "27.4.4" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.4.4.tgz#a012441f8a155df909839543a09510ab3477aa11" + integrity sha512-+6RVutZxOQgJkt4svgTHPFtOQlVe9dUg3wrimIAM38pY6hL/nsL8glfFSUjD9jNVjaVjzkCzj6loFFecrjr9Qw== dependencies: - "@jest/transform" "^27.4.2" + "@jest/transform" "^27.4.4" "@jest/types" "^27.4.2" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.0.0" @@ -1906,12 +1906,12 @@ jest-changed-files@^27.4.2: execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.4.2.tgz#466f482207ca9f323b78416c28f4d1fa7588159a" - integrity sha512-2ePUSru1BGMyzxsMvRfu+tNb+PW60rUyMLJBfw1Nrh5zC8RoTPfF+zbE0JToU31a6ZVe4nnrNKWYRzlghAbL0A== +jest-circus@^27.4.4: + version "27.4.4" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.4.4.tgz#8bf89aa604b914ecc10e3d895aae283b529f965d" + integrity sha512-4DWhvQerDq5X4GaqhEUoZiBhuNdKDGr0geW0iJwarbDljAmGaGOErKQG+z2PBr0vgN05z7tsGSY51mdWr8E4xg== dependencies: - "@jest/environment" "^27.4.2" + "@jest/environment" "^27.4.4" "@jest/test-result" "^27.4.2" "@jest/types" "^27.4.2" "@types/node" "*" @@ -1923,54 +1923,54 @@ jest-circus@^27.4.2: jest-each "^27.4.2" jest-matcher-utils "^27.4.2" jest-message-util "^27.4.2" - jest-runtime "^27.4.2" - jest-snapshot "^27.4.2" + jest-runtime "^27.4.4" + jest-snapshot "^27.4.4" jest-util "^27.4.2" pretty-format "^27.4.2" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.4.3: - version "27.4.3" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.4.3.tgz#89acba683b9f91c7a5e342e2ea13aa5414836a0d" - integrity sha512-zZSJBXNC/i8UnJPwcKWsqnhGgIF3uoTYP7th32Zej7KNQJdxzOMj+wCfy2Ox3kU7nXErJ36DtYyXDhfiqaiDRw== +jest-cli@^27.4.4: + version "27.4.4" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.4.4.tgz#7115ff01f605c2c848314141b1ac144099ddeed5" + integrity sha512-+MfsHnZPUOBigCBURuQFRpgYoPCgmIFkICkqt4SrramZCUp/UAuWcst4pMZb84O3VU8JyKJmnpGG4qH8ClQloA== dependencies: - "@jest/core" "^27.4.3" + "@jest/core" "^27.4.4" "@jest/test-result" "^27.4.2" "@jest/types" "^27.4.2" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.4.3" + jest-config "^27.4.4" jest-util "^27.4.2" jest-validate "^27.4.2" prompts "^2.0.1" yargs "^16.2.0" -jest-config@^27.4.3: - version "27.4.3" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.4.3.tgz#7820e08f7526fa3f725423e2f0fa7888ee0ef9c9" - integrity sha512-DQ10HTSqYtC2pO7s9j2jw+li4xUnm2wLYWH2o7K1ftB8NyvToHsXoLlXxtsGh3AW9gUQR6KY/4B7G+T/NswJBw== +jest-config@^27.4.4: + version "27.4.4" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.4.4.tgz#0e3615392361baae0e29dbf64c296d5563d7e28b" + integrity sha512-6lxg0ugO6KS2zKEbpdDwBzu1IT0Xg4/VhxXMuBu+z/5FvBjLCEMTaWQm3bCaGCZUR9j9FK4DzUIxyhIgn6kVEg== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.4.2" + "@jest/test-sequencer" "^27.4.4" "@jest/types" "^27.4.2" - babel-jest "^27.4.2" + babel-jest "^27.4.4" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" - jest-circus "^27.4.2" - jest-environment-jsdom "^27.4.3" - jest-environment-node "^27.4.2" + jest-circus "^27.4.4" + jest-environment-jsdom "^27.4.4" + jest-environment-node "^27.4.4" jest-get-type "^27.4.0" - jest-jasmine2 "^27.4.2" + jest-jasmine2 "^27.4.4" jest-regex-util "^27.4.0" - jest-resolve "^27.4.2" - jest-runner "^27.4.3" + jest-resolve "^27.4.4" + jest-runner "^27.4.4" jest-util "^27.4.2" jest-validate "^27.4.2" micromatch "^4.0.4" @@ -2015,12 +2015,12 @@ jest-each@^27.4.2: jest-util "^27.4.2" pretty-format "^27.4.2" -jest-environment-jsdom@^27.4.3: - version "27.4.3" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.4.3.tgz#74198285f6284888ca9c7486c4e5e67add75aa53" - integrity sha512-x1AUVz3G14LpEJs7KIFUaTINT2n0unOUmvdAby3s/sldUpJJetOJifHo1O/EUQC5fNBowggwJbVulko18y6OWw== +jest-environment-jsdom@^27.4.4: + version "27.4.4" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.4.4.tgz#94f738e99514d7a880e8ed8e03e3a321d43b49db" + integrity sha512-cYR3ndNfHBqQgFvS1RL7dNqSvD//K56j/q1s2ygNHcfTCAp12zfIromO1w3COmXrxS8hWAh7+CmZmGCIoqGcGA== dependencies: - "@jest/environment" "^27.4.2" + "@jest/environment" "^27.4.4" "@jest/fake-timers" "^27.4.2" "@jest/types" "^27.4.2" "@types/node" "*" @@ -2028,12 +2028,12 @@ jest-environment-jsdom@^27.4.3: jest-util "^27.4.2" jsdom "^16.6.0" -jest-environment-node@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.4.2.tgz#bf5586a0924a8d21c13838121ac0941638c7d15e" - integrity sha512-nzTZ5nJ+FabuZPH2YVci7SZIHpvtNRHPt8+vipLkCnAgXGjVzHm7XJWdnNqXbAkExIgiKeVEkVMNZOZE/LeiIg== +jest-environment-node@^27.4.4: + version "27.4.4" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.4.4.tgz#42fe5e3b224cb69b99811ebf6f5eaa5a59618514" + integrity sha512-D+v3lbJ2GjQTQR23TK0kY3vFVmSeea05giInI41HHOaJnAwOnmUHTZgUaZL+VxUB43pIzoa7PMwWtCVlIUoVoA== dependencies: - "@jest/environment" "^27.4.2" + "@jest/environment" "^27.4.4" "@jest/fake-timers" "^27.4.2" "@jest/types" "^27.4.2" "@types/node" "*" @@ -2050,10 +2050,10 @@ jest-get-type@^27.4.0: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.4.0.tgz#7503d2663fffa431638337b3998d39c5e928e9b5" integrity sha512-tk9o+ld5TWq41DkK14L4wox4s2D9MtTpKaAVzXfr5CUKm5ZK2ExcaFE0qls2W71zE/6R2TxxrK9w2r6svAFDBQ== -jest-haste-map@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.4.2.tgz#7fc7d5e568cca704284f4850885b74a0b8b87587" - integrity sha512-foiyAEePORUN2eeJnOtcM1y8qW0ShEd9kTjWVL4sVaMcuCJM6gtHegvYPBRT0mpI/bs4ueThM90+Eoj2ncoNsA== +jest-haste-map@^27.4.4: + version "27.4.4" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.4.4.tgz#ec6013845368a155372e25e42e2b77e6ecc5019f" + integrity sha512-kvspmHmgPIZoDaqUsvsJFTaspuxhATvdO6wsFNGNSi8kfdiOCEEvECNbht8xG+eE5Ol88JyJmp2D7RF4dYo85Q== dependencies: "@jest/types" "^27.4.2" "@types/graceful-fs" "^4.1.2" @@ -2064,19 +2064,19 @@ jest-haste-map@^27.4.2: jest-regex-util "^27.4.0" jest-serializer "^27.4.0" jest-util "^27.4.2" - jest-worker "^27.4.2" + jest-worker "^27.4.4" micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.4.2.tgz#c956c88b9c05ca22afdc779deebc2890cb891797" - integrity sha512-VO/fyAJSH9u0THjbteFiL8qc93ufU+yW+bdieDc8tzTCWwlWzO53UHS5nFK1qmE8izb5Smkn+XHlVt6/l06MKQ== +jest-jasmine2@^27.4.4: + version "27.4.4" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.4.4.tgz#1fcdc64de932913366e7d5f2960c375e1145176e" + integrity sha512-ygk2tUgtLeN3ouj4KEYw9p81GLI1EKrnvourPULN5gdgB482PH5op9gqaRG0IenbJhBbbRwiSvh5NoBoQZSqdA== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^27.4.2" + "@jest/environment" "^27.4.4" "@jest/source-map" "^27.4.0" "@jest/test-result" "^27.4.2" "@jest/types" "^27.4.2" @@ -2088,8 +2088,8 @@ jest-jasmine2@^27.4.2: jest-each "^27.4.2" jest-matcher-utils "^27.4.2" jest-message-util "^27.4.2" - jest-runtime "^27.4.2" - jest-snapshot "^27.4.2" + jest-runtime "^27.4.4" + jest-snapshot "^27.4.4" jest-util "^27.4.2" pretty-format "^27.4.2" throat "^6.0.1" @@ -2145,24 +2145,24 @@ jest-regex-util@^27.4.0: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.4.0.tgz#e4c45b52653128843d07ad94aec34393ea14fbca" integrity sha512-WeCpMpNnqJYMQoOjm1nTtsgbR4XHAk1u00qDoNBQoykM280+/TmgA5Qh5giC1ecy6a5d4hbSsHzpBtu5yvlbEg== -jest-resolve-dependencies@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.4.2.tgz#2f4f363cca26f75a22aefd496f9c7ae65b3de37f" - integrity sha512-hb++cTpqvOWfU49MCP/JQkxmnrhKoAVqXWFjgYXswRSVGk8Q6bDTSvhbCeYXDtXaymY0y7WrrSIlKogClcKJuw== +jest-resolve-dependencies@^27.4.4: + version "27.4.4" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.4.4.tgz#dae11e067a6d6a9553f1386a0ea1efe5be0e2332" + integrity sha512-iAnpCXh81sd9nbyqySvm5/aV9X6JZKE0dQyFXTC8tptXcdrgS0vjPFy+mEgzPHxXw+tq4TQupuTa0n8OXwRIxw== dependencies: "@jest/types" "^27.4.2" jest-regex-util "^27.4.0" - jest-snapshot "^27.4.2" + jest-snapshot "^27.4.4" -jest-resolve@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.4.2.tgz#d3e4cbee7acb4a4f8c8bfc270767bec34d2aefaf" - integrity sha512-d/zqPjxCzMqHlOdRTg8cTpO9jY+1/T74KazT8Ws/LwmwxV5sRMWOkiLjmzUCDj/5IqA5XHNK4Hkmlq9Kdpb9Sg== +jest-resolve@^27.4.4: + version "27.4.4" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.4.4.tgz#5b690662f54f38f7cfaffc0adcdb341ff7724408" + integrity sha512-Yh5jK3PBmDbm01Rc8pT0XqpBlTPEGwWp7cN61ijJuwony/tR2Taof3TLy6yfNiuRS8ucUOPO7NBYm3ei38kkcg== dependencies: "@jest/types" "^27.4.2" chalk "^4.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.4.2" + jest-haste-map "^27.4.4" jest-pnp-resolver "^1.2.2" jest-util "^27.4.2" jest-validate "^27.4.2" @@ -2170,15 +2170,15 @@ jest-resolve@^27.4.2: resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^27.4.3: - version "27.4.3" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.4.3.tgz#9f05d4733829787778e8a143ade913834d0828dc" - integrity sha512-JgR6Om/j22Fd6ZUUIGTWNcCtuZVYbNrecb4k89W4UyFJoRtHpo2zMKWkmFFFJoqwWGrfrcPLnVBIgkJiTV3cyA== +jest-runner@^27.4.4: + version "27.4.4" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.4.4.tgz#0b40cdcbac293ebc4c19c2d7805d17ab1072f1fd" + integrity sha512-AXv/8Q0Xf1puWnDf52m7oLrK7sXcv6re0V/kItwTSVHJbX7Oebm07oGFQqGmq0R0mhO1zpmB3OpqRuaCN2elPA== dependencies: "@jest/console" "^27.4.2" - "@jest/environment" "^27.4.2" + "@jest/environment" "^27.4.4" "@jest/test-result" "^27.4.2" - "@jest/transform" "^27.4.2" + "@jest/transform" "^27.4.4" "@jest/types" "^27.4.2" "@types/node" "*" chalk "^4.0.0" @@ -2186,29 +2186,29 @@ jest-runner@^27.4.3: exit "^0.1.2" graceful-fs "^4.2.4" jest-docblock "^27.4.0" - jest-environment-jsdom "^27.4.3" - jest-environment-node "^27.4.2" - jest-haste-map "^27.4.2" + jest-environment-jsdom "^27.4.4" + jest-environment-node "^27.4.4" + jest-haste-map "^27.4.4" jest-leak-detector "^27.4.2" jest-message-util "^27.4.2" - jest-resolve "^27.4.2" - jest-runtime "^27.4.2" + jest-resolve "^27.4.4" + jest-runtime "^27.4.4" jest-util "^27.4.2" - jest-worker "^27.4.2" + jest-worker "^27.4.4" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.4.2.tgz#d72da8a0e97366c16ad515a2c437191a72600d38" - integrity sha512-eqPgcBaUNaw6j8T5M+dnfAEh6MIrh2YmtskCr9sl50QYpD22Sg+QqHw3J3nmaLzVMbBtOMHFFxLF0Qx8MsZVFQ== +jest-runtime@^27.4.4: + version "27.4.4" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.4.4.tgz#0d486735e8a1c8bbcdbb9285b3155ed94c5e3670" + integrity sha512-tZGay6P6vXJq8t4jVFAUzYHx+lzIHXjz+rj1XBk6mAR1Lwtf5kz0Uun7qNuU+oqpZu4+hhuxpUfXb6j30bEPqA== dependencies: "@jest/console" "^27.4.2" - "@jest/environment" "^27.4.2" - "@jest/globals" "^27.4.2" + "@jest/environment" "^27.4.4" + "@jest/globals" "^27.4.4" "@jest/source-map" "^27.4.0" "@jest/test-result" "^27.4.2" - "@jest/transform" "^27.4.2" + "@jest/transform" "^27.4.4" "@jest/types" "^27.4.2" "@types/yargs" "^16.0.0" chalk "^4.0.0" @@ -2218,12 +2218,12 @@ jest-runtime@^27.4.2: exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-haste-map "^27.4.2" + jest-haste-map "^27.4.4" jest-message-util "^27.4.2" jest-mock "^27.4.2" jest-regex-util "^27.4.0" - jest-resolve "^27.4.2" - jest-snapshot "^27.4.2" + jest-resolve "^27.4.4" + jest-snapshot "^27.4.4" jest-util "^27.4.2" jest-validate "^27.4.2" slash "^3.0.0" @@ -2238,10 +2238,10 @@ jest-serializer@^27.4.0: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.4.2.tgz#bd1ea04a8fab402e5ab18b788809fa597ddff532" - integrity sha512-DI7lJlNIu6WSQ+esqhnJzEzU70+dV+cNjoF1c+j5FagWEd3KtOyZvVliAH0RWNQ6KSnAAnKSU0qxJ8UXOOhuUQ== +jest-snapshot@^27.4.4: + version "27.4.4" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.4.4.tgz#fc0a2cd22f742fe66621c5359c9cd64f88260c6b" + integrity sha512-yy+rpCvYMOjTl7IMuaMI9OP9WT229zi8BhdNHm6e6mttAOIzvIiCxFoZ6yRxaV3HDPPgMryi+ReX2b8+IQJdPA== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" @@ -2249,7 +2249,7 @@ jest-snapshot@^27.4.2: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/transform" "^27.4.2" + "@jest/transform" "^27.4.4" "@jest/types" "^27.4.2" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.1.5" @@ -2259,10 +2259,10 @@ jest-snapshot@^27.4.2: graceful-fs "^4.2.4" jest-diff "^27.4.2" jest-get-type "^27.4.0" - jest-haste-map "^27.4.2" + jest-haste-map "^27.4.4" jest-matcher-utils "^27.4.2" jest-message-util "^27.4.2" - jest-resolve "^27.4.2" + jest-resolve "^27.4.4" jest-util "^27.4.2" natural-compare "^1.4.0" pretty-format "^27.4.2" @@ -2305,23 +2305,23 @@ jest-watcher@^27.4.2: jest-util "^27.4.2" string-length "^4.0.1" -jest-worker@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.4.2.tgz#0fb123d50955af1a450267787f340a1bf7e12bc4" - integrity sha512-0QMy/zPovLfUPyHuOuuU4E+kGACXXE84nRnq6lBVI9GJg5DCBiA97SATi+ZP8CpiJwEQy1oCPjRBf8AnLjN+Ag== +jest-worker@^27.4.4: + version "27.4.4" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.4.4.tgz#9390a97c013a54d07f5c2ad2b5f6109f30c4966d" + integrity sha512-jfwxYJvfua1b1XkyuyPh01ATmgg4e5fPM/muLmhy9Qc6dmiwacQB0MLHaU6IjEsv/+nAixHGxTn8WllA27Pn0w== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^27.0.1: - version "27.4.3" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.4.3.tgz#cf7d1876a84c70efece2e01e4f9dfc2e464d9cbb" - integrity sha512-jwsfVABBzuN3Atm+6h6vIEpTs9+VApODLt4dk2qv1WMOpb1weI1IIZfuwpMiWZ62qvWj78MvdvMHIYdUfqrFaA== + version "27.4.4" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.4.4.tgz#9b1aa1db25d0b13477a49d18e22ba7cdff97105b" + integrity sha512-AXwEIFa58Uf1Jno3/KSo5HZZ0/2Xwqvfrz0/3bmTwImkFlbOvz5vARAW9nTrxRLkojjkitaZ1KNKAtw3JRFAaA== dependencies: - "@jest/core" "^27.4.3" + "@jest/core" "^27.4.4" import-local "^3.0.2" - jest-cli "^27.4.3" + jest-cli "^27.4.4" js-tokens@^4.0.0: version "4.0.0" From 8a7c6d9ecd676c53aac1fb989e09bf1dc0a8de43 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Dec 2021 12:12:57 +0000 Subject: [PATCH 453/785] Bump typescript from 4.5.2 to 4.5.3 Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.5.2 to 4.5.3. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/commits) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index e5e99447..da053c8a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3147,9 +3147,9 @@ typedarray-to-buffer@^3.1.5: is-typedarray "^1.0.0" typescript@^4.5.2: - version "4.5.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.2.tgz#8ac1fba9f52256fdb06fb89e4122fa6a346c2998" - integrity sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw== + version "4.5.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.3.tgz#afaa858e68c7103317d89eb90c5d8906268d353c" + integrity sha512-eVYaEHALSt+s9LbvgEv4Ef+Tdq7hBiIZgii12xXJnukryt3pMgJf6aKhoCZ3FWQsu6sydEnkg11fYXLzhLBjeQ== universalify@^0.1.2: version "0.1.2" From 61500ded08a04a0f364dd3159d82a1ccccaacef7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Dec 2021 12:53:47 +0000 Subject: [PATCH 454/785] Bump @typescript-eslint/parser from 5.6.0 to 5.7.0 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.6.0 to 5.7.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.7.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index da053c8a..c675e82f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -730,13 +730,13 @@ eslint-utils "^3.0.0" "@typescript-eslint/parser@^5.4.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.6.0.tgz#11677324659641400d653253c03dcfbed468d199" - integrity sha512-YVK49NgdUPQ8SpCZaOpiq1kLkYRPMv9U5gcMrywzI8brtwZjr/tG3sZpuHyODt76W/A0SufNjYt9ZOgrC4tLIQ== + version "5.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.7.0.tgz#4dca6de463d86f02d252e681136a67888ea3b181" + integrity sha512-m/gWCCcS4jXw6vkrPQ1BjZ1vomP01PArgzvauBqzsoZ3urLbsRChexB8/YV8z9HwE3qlJM35FxfKZ1nfP/4x8g== dependencies: - "@typescript-eslint/scope-manager" "5.6.0" - "@typescript-eslint/types" "5.6.0" - "@typescript-eslint/typescript-estree" "5.6.0" + "@typescript-eslint/scope-manager" "5.7.0" + "@typescript-eslint/types" "5.7.0" + "@typescript-eslint/typescript-estree" "5.7.0" debug "^4.3.2" "@typescript-eslint/scope-manager@5.6.0": @@ -747,11 +747,24 @@ "@typescript-eslint/types" "5.6.0" "@typescript-eslint/visitor-keys" "5.6.0" +"@typescript-eslint/scope-manager@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.7.0.tgz#70adf960e5a58994ad50438ba60d98ecadd79452" + integrity sha512-7mxR520DGq5F7sSSgM0HSSMJ+TFUymOeFRMfUfGFAVBv8BR+Jv1vHgAouYUvWRZeszVBJlLcc9fDdktxb5kmxA== + dependencies: + "@typescript-eslint/types" "5.7.0" + "@typescript-eslint/visitor-keys" "5.7.0" + "@typescript-eslint/types@5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.6.0.tgz#745cb1b59daadcc1f32f7be95f0f68accf38afdd" integrity sha512-OIZffked7mXv4mXzWU5MgAEbCf9ecNJBKi+Si6/I9PpTaj+cf2x58h2oHW5/P/yTnPkKaayfjhLvx+crnl5ubA== +"@typescript-eslint/types@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.7.0.tgz#2d4cae0105ba7d08bffa69698197a762483ebcbe" + integrity sha512-5AeYIF5p2kAneIpnLFve8g50VyAjq7udM7ApZZ9JYjdPjkz0LvODfuSHIDUVnIuUoxafoWzpFyU7Sqbxgi79mA== + "@typescript-eslint/typescript-estree@5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.6.0.tgz#dfbb19c9307fdd81bd9c650c67e8397821d7faf0" @@ -765,6 +778,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.7.0.tgz#968fad899050ccce4f08a40cd5fabc0798525006" + integrity sha512-aO1Ql+izMrTnPj5aFFlEJkpD4jRqC4Gwhygu2oHK2wfVQpmOPbyDSveJ+r/NQo+PWV43M6uEAeLVbTi09dFLhg== + dependencies: + "@typescript-eslint/types" "5.7.0" + "@typescript-eslint/visitor-keys" "5.7.0" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/visitor-keys@5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.6.0.tgz#3e36509e103fe9713d8f035ac977235fd63cb6e6" @@ -773,6 +799,14 @@ "@typescript-eslint/types" "5.6.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.7.0.tgz#e05164239eb7cb8aa9fa06c516ede480ce260178" + integrity sha512-hdohahZ4lTFcglZSJ3DGdzxQHBSxsLVqHzkiOmKi7xVAWC4y2c1bIMKmPJSrA4aOEoRUPOKQ87Y/taC7yVHpFg== + dependencies: + "@typescript-eslint/types" "5.7.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 eb9024848ce683b2c4e713db8856eea173060e78 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Dec 2021 12:54:05 +0000 Subject: [PATCH 455/785] Bump jest from 27.4.4 to 27.4.5 Bumps [jest](https://github.com/facebook/jest) from 27.4.4 to 27.4.5. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v27.4.4...v27.4.5) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 226 +++++++++++++++++++++++++++--------------------------- 1 file changed, 113 insertions(+), 113 deletions(-) diff --git a/yarn.lock b/yarn.lock index da053c8a..75cfab31 100644 --- a/yarn.lock +++ b/yarn.lock @@ -371,15 +371,15 @@ jest-util "^27.4.2" slash "^3.0.0" -"@jest/core@^27.4.4": - version "27.4.4" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.4.4.tgz#f2ba293235ca23fb48b4b923ccfe67c17e791a92" - integrity sha512-xBNPVqYAdAiAMXnb4ugx9Cdmr0S52lBsLbQMR/sGBRO0810VSPKiuSDtuup6qdkK1e9vxbv3KK3IAP1QFAp8mw== +"@jest/core@^27.4.5": + version "27.4.5" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.4.5.tgz#cae2dc34259782f4866c6606c3b480cce920ed4c" + integrity sha512-3tm/Pevmi8bDsgvo73nX8p/WPng6KWlCyScW10FPEoN1HU4pwI83tJ3TsFvi1FfzsjwUlMNEPowgb/rPau/LTQ== dependencies: "@jest/console" "^27.4.2" - "@jest/reporters" "^27.4.4" + "@jest/reporters" "^27.4.5" "@jest/test-result" "^27.4.2" - "@jest/transform" "^27.4.4" + "@jest/transform" "^27.4.5" "@jest/types" "^27.4.2" "@types/node" "*" ansi-escapes "^4.2.1" @@ -388,15 +388,15 @@ exit "^0.1.2" graceful-fs "^4.2.4" jest-changed-files "^27.4.2" - jest-config "^27.4.4" - jest-haste-map "^27.4.4" + jest-config "^27.4.5" + jest-haste-map "^27.4.5" jest-message-util "^27.4.2" jest-regex-util "^27.4.0" - jest-resolve "^27.4.4" - jest-resolve-dependencies "^27.4.4" - jest-runner "^27.4.4" - jest-runtime "^27.4.4" - jest-snapshot "^27.4.4" + jest-resolve "^27.4.5" + jest-resolve-dependencies "^27.4.5" + jest-runner "^27.4.5" + jest-runtime "^27.4.5" + jest-snapshot "^27.4.5" jest-util "^27.4.2" jest-validate "^27.4.2" jest-watcher "^27.4.2" @@ -436,15 +436,15 @@ "@jest/types" "^27.4.2" expect "^27.4.2" -"@jest/reporters@^27.4.4": - version "27.4.4" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.4.4.tgz#9e809829f602cd6e68bd058d1ea528f4b7482365" - integrity sha512-ssyJSw9B9Awb1QaxDhIPSs4de1b7SE2kv7tqFehQL13xpn5HUkMYZK/ufTOXiCAnXFOZS+XDl1GaQ/LmJAzI1A== +"@jest/reporters@^27.4.5": + version "27.4.5" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.4.5.tgz#e229acca48d18ea39e805540c1c322b075ae63ad" + integrity sha512-3orsG4vi8zXuBqEoy2LbnC1kuvkg1KQUgqNxmxpQgIOQEPeV0onvZu+qDQnEoX8qTQErtqn/xzcnbpeTuOLSiA== dependencies: "@bcoe/v8-coverage" "^0.2.3" "@jest/console" "^27.4.2" "@jest/test-result" "^27.4.2" - "@jest/transform" "^27.4.4" + "@jest/transform" "^27.4.5" "@jest/types" "^27.4.2" "@types/node" "*" chalk "^4.0.0" @@ -457,10 +457,10 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^27.4.4" - jest-resolve "^27.4.4" + jest-haste-map "^27.4.5" + jest-resolve "^27.4.5" jest-util "^27.4.2" - jest-worker "^27.4.4" + jest-worker "^27.4.5" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" @@ -486,20 +486,20 @@ "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.4.4": - version "27.4.4" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.4.4.tgz#60be14369b2702e42d6042e71b8ab3fc69f5ce68" - integrity sha512-mCh+d4JTGTtX7vr13d7q2GHJy33nAobEwtEJ8X3u7R8+0ImVO2eAsQzsLfX8lyvdYHBxYABhqbYuaUNo42/pQw== +"@jest/test-sequencer@^27.4.5": + version "27.4.5" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.4.5.tgz#1d7e026844d343b60d2ca7fd82c579a17b445d7d" + integrity sha512-n5woIn/1v+FT+9hniymHPARA9upYUmfi5Pw9ewVwXCDlK4F5/Gkees9v8vdjGdAIJ2MPHLHodiajLpZZanWzEQ== dependencies: "@jest/test-result" "^27.4.2" graceful-fs "^4.2.4" - jest-haste-map "^27.4.4" - jest-runtime "^27.4.4" + jest-haste-map "^27.4.5" + jest-runtime "^27.4.5" -"@jest/transform@^27.4.4": - version "27.4.4" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.4.4.tgz#347e39402730879ba88c6ea6982db0d88640aa78" - integrity sha512-7U/nDSrGsGzL7+X8ScNFV71w8u8knJQWSa9C2xsrrKLMOgb+rWuCG4VAyWke/53BU96GnT+Ka81xCAHA5gk6zA== +"@jest/transform@^27.4.5": + version "27.4.5" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.4.5.tgz#3dfe2e3680cd4aa27356172bf25617ab5b94f195" + integrity sha512-PuMet2UlZtlGzwc6L+aZmR3I7CEBpqadO03pU40l2RNY2fFJ191b9/ITB44LNOhVtsyykx0OZvj0PCyuLm7Eew== dependencies: "@babel/core" "^7.1.0" "@jest/types" "^27.4.2" @@ -508,7 +508,7 @@ convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.4.4" + jest-haste-map "^27.4.5" jest-regex-util "^27.4.0" jest-util "^27.4.2" micromatch "^4.0.4" @@ -909,12 +909,12 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= -babel-jest@^27.4.4: - version "27.4.4" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.4.4.tgz#a012441f8a155df909839543a09510ab3477aa11" - integrity sha512-+6RVutZxOQgJkt4svgTHPFtOQlVe9dUg3wrimIAM38pY6hL/nsL8glfFSUjD9jNVjaVjzkCzj6loFFecrjr9Qw== +babel-jest@^27.4.5: + version "27.4.5" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.4.5.tgz#d38bd0be8ea71d8b97853a5fc9f76deeb095c709" + integrity sha512-3uuUTjXbgtODmSv/DXO9nZfD52IyC2OYTFaXGRzL0kpykzroaquCrD5+lZNafTvZlnNqZHt5pb0M08qVBZnsnA== dependencies: - "@jest/transform" "^27.4.4" + "@jest/transform" "^27.4.5" "@jest/types" "^27.4.2" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.0.0" @@ -1906,10 +1906,10 @@ jest-changed-files@^27.4.2: execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.4.4: - version "27.4.4" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.4.4.tgz#8bf89aa604b914ecc10e3d895aae283b529f965d" - integrity sha512-4DWhvQerDq5X4GaqhEUoZiBhuNdKDGr0geW0iJwarbDljAmGaGOErKQG+z2PBr0vgN05z7tsGSY51mdWr8E4xg== +jest-circus@^27.4.5: + version "27.4.5" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.4.5.tgz#70bfb78e0200cab9b84747bf274debacaa538467" + integrity sha512-eTNWa9wsvBwPykhMMShheafbwyakcdHZaEYh5iRrQ0PFJxkDP/e3U/FvzGuKWu2WpwUA3C3hPlfpuzvOdTVqnw== dependencies: "@jest/environment" "^27.4.4" "@jest/test-result" "^27.4.2" @@ -1923,54 +1923,54 @@ jest-circus@^27.4.4: jest-each "^27.4.2" jest-matcher-utils "^27.4.2" jest-message-util "^27.4.2" - jest-runtime "^27.4.4" - jest-snapshot "^27.4.4" + jest-runtime "^27.4.5" + jest-snapshot "^27.4.5" jest-util "^27.4.2" pretty-format "^27.4.2" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.4.4: - version "27.4.4" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.4.4.tgz#7115ff01f605c2c848314141b1ac144099ddeed5" - integrity sha512-+MfsHnZPUOBigCBURuQFRpgYoPCgmIFkICkqt4SrramZCUp/UAuWcst4pMZb84O3VU8JyKJmnpGG4qH8ClQloA== +jest-cli@^27.4.5: + version "27.4.5" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.4.5.tgz#8708f54c28d13681f3255ec9026a2b15b03d41e8" + integrity sha512-hrky3DSgE0u7sQxaCL7bdebEPHx5QzYmrGuUjaPLmPE8jx5adtvGuOlRspvMoVLTTDOHRnZDoRLYJuA+VCI7Hg== dependencies: - "@jest/core" "^27.4.4" + "@jest/core" "^27.4.5" "@jest/test-result" "^27.4.2" "@jest/types" "^27.4.2" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.4.4" + jest-config "^27.4.5" jest-util "^27.4.2" jest-validate "^27.4.2" prompts "^2.0.1" yargs "^16.2.0" -jest-config@^27.4.4: - version "27.4.4" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.4.4.tgz#0e3615392361baae0e29dbf64c296d5563d7e28b" - integrity sha512-6lxg0ugO6KS2zKEbpdDwBzu1IT0Xg4/VhxXMuBu+z/5FvBjLCEMTaWQm3bCaGCZUR9j9FK4DzUIxyhIgn6kVEg== +jest-config@^27.4.5: + version "27.4.5" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.4.5.tgz#77ed7f2ba7bcfd7d740ade711d0d13512e08a59e" + integrity sha512-t+STVJtPt+fpqQ8GBw850NtSQbnDOw/UzdPfzDaHQ48/AylQlW7LHj3dH+ndxhC1UxJ0Q3qkq7IH+nM1skwTwA== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.4.4" + "@jest/test-sequencer" "^27.4.5" "@jest/types" "^27.4.2" - babel-jest "^27.4.4" + babel-jest "^27.4.5" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" - jest-circus "^27.4.4" + jest-circus "^27.4.5" jest-environment-jsdom "^27.4.4" jest-environment-node "^27.4.4" jest-get-type "^27.4.0" - jest-jasmine2 "^27.4.4" + jest-jasmine2 "^27.4.5" jest-regex-util "^27.4.0" - jest-resolve "^27.4.4" - jest-runner "^27.4.4" + jest-resolve "^27.4.5" + jest-runner "^27.4.5" jest-util "^27.4.2" jest-validate "^27.4.2" micromatch "^4.0.4" @@ -2050,10 +2050,10 @@ jest-get-type@^27.4.0: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.4.0.tgz#7503d2663fffa431638337b3998d39c5e928e9b5" integrity sha512-tk9o+ld5TWq41DkK14L4wox4s2D9MtTpKaAVzXfr5CUKm5ZK2ExcaFE0qls2W71zE/6R2TxxrK9w2r6svAFDBQ== -jest-haste-map@^27.4.4: - version "27.4.4" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.4.4.tgz#ec6013845368a155372e25e42e2b77e6ecc5019f" - integrity sha512-kvspmHmgPIZoDaqUsvsJFTaspuxhATvdO6wsFNGNSi8kfdiOCEEvECNbht8xG+eE5Ol88JyJmp2D7RF4dYo85Q== +jest-haste-map@^27.4.5: + version "27.4.5" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.4.5.tgz#c2921224a59223f91e03ec15703905978ef0cc1a" + integrity sha512-oJm1b5qhhPs78K24EDGifWS0dELYxnoBiDhatT/FThgB9yxqUm5F6li3Pv+Q+apMBmmPNzOBnZ7ZxWMB1Leq1Q== dependencies: "@jest/types" "^27.4.2" "@types/graceful-fs" "^4.1.2" @@ -2064,16 +2064,16 @@ jest-haste-map@^27.4.4: jest-regex-util "^27.4.0" jest-serializer "^27.4.0" jest-util "^27.4.2" - jest-worker "^27.4.4" + jest-worker "^27.4.5" micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.4.4: - version "27.4.4" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.4.4.tgz#1fcdc64de932913366e7d5f2960c375e1145176e" - integrity sha512-ygk2tUgtLeN3ouj4KEYw9p81GLI1EKrnvourPULN5gdgB482PH5op9gqaRG0IenbJhBbbRwiSvh5NoBoQZSqdA== +jest-jasmine2@^27.4.5: + version "27.4.5" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.4.5.tgz#ff79d11561679ff6c89715b0cd6b1e8c0dfbc6dc" + integrity sha512-oUnvwhJDj2LhOiUB1kdnJjkx8C5PwgUZQb9urF77mELH9DGR4e2GqpWQKBOYXWs5+uTN9BGDqRz3Aeg5Wts7aw== dependencies: "@babel/traverse" "^7.1.0" "@jest/environment" "^27.4.4" @@ -2088,8 +2088,8 @@ jest-jasmine2@^27.4.4: jest-each "^27.4.2" jest-matcher-utils "^27.4.2" jest-message-util "^27.4.2" - jest-runtime "^27.4.4" - jest-snapshot "^27.4.4" + jest-runtime "^27.4.5" + jest-snapshot "^27.4.5" jest-util "^27.4.2" pretty-format "^27.4.2" throat "^6.0.1" @@ -2145,24 +2145,24 @@ jest-regex-util@^27.4.0: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.4.0.tgz#e4c45b52653128843d07ad94aec34393ea14fbca" integrity sha512-WeCpMpNnqJYMQoOjm1nTtsgbR4XHAk1u00qDoNBQoykM280+/TmgA5Qh5giC1ecy6a5d4hbSsHzpBtu5yvlbEg== -jest-resolve-dependencies@^27.4.4: - version "27.4.4" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.4.4.tgz#dae11e067a6d6a9553f1386a0ea1efe5be0e2332" - integrity sha512-iAnpCXh81sd9nbyqySvm5/aV9X6JZKE0dQyFXTC8tptXcdrgS0vjPFy+mEgzPHxXw+tq4TQupuTa0n8OXwRIxw== +jest-resolve-dependencies@^27.4.5: + version "27.4.5" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.4.5.tgz#9398af854bdb12d6a9e5a8a536ee401f889a3ecf" + integrity sha512-elEVvkvRK51y037NshtEkEnukMBWvlPzZHiL847OrIljJ8yIsujD2GXRPqDXC4rEVKbcdsy7W0FxoZb4WmEs7w== dependencies: "@jest/types" "^27.4.2" jest-regex-util "^27.4.0" - jest-snapshot "^27.4.4" + jest-snapshot "^27.4.5" -jest-resolve@^27.4.4: - version "27.4.4" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.4.4.tgz#5b690662f54f38f7cfaffc0adcdb341ff7724408" - integrity sha512-Yh5jK3PBmDbm01Rc8pT0XqpBlTPEGwWp7cN61ijJuwony/tR2Taof3TLy6yfNiuRS8ucUOPO7NBYm3ei38kkcg== +jest-resolve@^27.4.5: + version "27.4.5" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.4.5.tgz#8dc44f5065fb8d58944c20f932cb7b9fe9760cca" + integrity sha512-xU3z1BuOz/hUhVUL+918KqUgK+skqOuUsAi7A+iwoUldK6/+PW+utK8l8cxIWT9AW7IAhGNXjSAh1UYmjULZZw== dependencies: "@jest/types" "^27.4.2" chalk "^4.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.4.4" + jest-haste-map "^27.4.5" jest-pnp-resolver "^1.2.2" jest-util "^27.4.2" jest-validate "^27.4.2" @@ -2170,15 +2170,15 @@ jest-resolve@^27.4.4: resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^27.4.4: - version "27.4.4" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.4.4.tgz#0b40cdcbac293ebc4c19c2d7805d17ab1072f1fd" - integrity sha512-AXv/8Q0Xf1puWnDf52m7oLrK7sXcv6re0V/kItwTSVHJbX7Oebm07oGFQqGmq0R0mhO1zpmB3OpqRuaCN2elPA== +jest-runner@^27.4.5: + version "27.4.5" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.4.5.tgz#daba2ba71c8f34137dc7ac45616add35370a681e" + integrity sha512-/irauncTfmY1WkTaRQGRWcyQLzK1g98GYG/8QvIPviHgO1Fqz1JYeEIsSfF+9mc/UTA6S+IIHFgKyvUrtiBIZg== dependencies: "@jest/console" "^27.4.2" "@jest/environment" "^27.4.4" "@jest/test-result" "^27.4.2" - "@jest/transform" "^27.4.4" + "@jest/transform" "^27.4.5" "@jest/types" "^27.4.2" "@types/node" "*" chalk "^4.0.0" @@ -2188,27 +2188,27 @@ jest-runner@^27.4.4: jest-docblock "^27.4.0" jest-environment-jsdom "^27.4.4" jest-environment-node "^27.4.4" - jest-haste-map "^27.4.4" + jest-haste-map "^27.4.5" jest-leak-detector "^27.4.2" jest-message-util "^27.4.2" - jest-resolve "^27.4.4" - jest-runtime "^27.4.4" + jest-resolve "^27.4.5" + jest-runtime "^27.4.5" jest-util "^27.4.2" - jest-worker "^27.4.4" + jest-worker "^27.4.5" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.4.4: - version "27.4.4" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.4.4.tgz#0d486735e8a1c8bbcdbb9285b3155ed94c5e3670" - integrity sha512-tZGay6P6vXJq8t4jVFAUzYHx+lzIHXjz+rj1XBk6mAR1Lwtf5kz0Uun7qNuU+oqpZu4+hhuxpUfXb6j30bEPqA== +jest-runtime@^27.4.5: + version "27.4.5" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.4.5.tgz#97703ad2a1799d4f50ab59049bd21a9ceaed2813" + integrity sha512-CIYqwuJQXHQtPd/idgrx4zgJ6iCb6uBjQq1RSAGQrw2S8XifDmoM1Ot8NRd80ooAm+ZNdHVwsktIMGlA1F1FAQ== dependencies: "@jest/console" "^27.4.2" "@jest/environment" "^27.4.4" "@jest/globals" "^27.4.4" "@jest/source-map" "^27.4.0" "@jest/test-result" "^27.4.2" - "@jest/transform" "^27.4.4" + "@jest/transform" "^27.4.5" "@jest/types" "^27.4.2" "@types/yargs" "^16.0.0" chalk "^4.0.0" @@ -2218,12 +2218,12 @@ jest-runtime@^27.4.4: exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-haste-map "^27.4.4" + jest-haste-map "^27.4.5" jest-message-util "^27.4.2" jest-mock "^27.4.2" jest-regex-util "^27.4.0" - jest-resolve "^27.4.4" - jest-snapshot "^27.4.4" + jest-resolve "^27.4.5" + jest-snapshot "^27.4.5" jest-util "^27.4.2" jest-validate "^27.4.2" slash "^3.0.0" @@ -2238,10 +2238,10 @@ jest-serializer@^27.4.0: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^27.4.4: - version "27.4.4" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.4.4.tgz#fc0a2cd22f742fe66621c5359c9cd64f88260c6b" - integrity sha512-yy+rpCvYMOjTl7IMuaMI9OP9WT229zi8BhdNHm6e6mttAOIzvIiCxFoZ6yRxaV3HDPPgMryi+ReX2b8+IQJdPA== +jest-snapshot@^27.4.5: + version "27.4.5" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.4.5.tgz#2ea909b20aac0fe62504bc161331f730b8a7ecc7" + integrity sha512-eCi/iM1YJFrJWiT9de4+RpWWWBqsHiYxFG9V9o/n0WXs6GpW4lUt4FAHAgFPTLPqCUVzrMQmSmTZSgQzwqR7IQ== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" @@ -2249,7 +2249,7 @@ jest-snapshot@^27.4.4: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/transform" "^27.4.4" + "@jest/transform" "^27.4.5" "@jest/types" "^27.4.2" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.1.5" @@ -2259,10 +2259,10 @@ jest-snapshot@^27.4.4: graceful-fs "^4.2.4" jest-diff "^27.4.2" jest-get-type "^27.4.0" - jest-haste-map "^27.4.4" + jest-haste-map "^27.4.5" jest-matcher-utils "^27.4.2" jest-message-util "^27.4.2" - jest-resolve "^27.4.4" + jest-resolve "^27.4.5" jest-util "^27.4.2" natural-compare "^1.4.0" pretty-format "^27.4.2" @@ -2305,23 +2305,23 @@ jest-watcher@^27.4.2: jest-util "^27.4.2" string-length "^4.0.1" -jest-worker@^27.4.4: - version "27.4.4" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.4.4.tgz#9390a97c013a54d07f5c2ad2b5f6109f30c4966d" - integrity sha512-jfwxYJvfua1b1XkyuyPh01ATmgg4e5fPM/muLmhy9Qc6dmiwacQB0MLHaU6IjEsv/+nAixHGxTn8WllA27Pn0w== +jest-worker@^27.4.5: + version "27.4.5" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.4.5.tgz#d696e3e46ae0f24cff3fa7195ffba22889262242" + integrity sha512-f2s8kEdy15cv9r7q4KkzGXvlY0JTcmCbMHZBfSQDwW77REr45IDWwd0lksDFeVHH2jJ5pqb90T77XscrjeGzzg== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^27.0.1: - version "27.4.4" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.4.4.tgz#9b1aa1db25d0b13477a49d18e22ba7cdff97105b" - integrity sha512-AXwEIFa58Uf1Jno3/KSo5HZZ0/2Xwqvfrz0/3bmTwImkFlbOvz5vARAW9nTrxRLkojjkitaZ1KNKAtw3JRFAaA== + version "27.4.5" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.4.5.tgz#66e45acba44137fac26be9d3cc5bb031e136dc0f" + integrity sha512-uT5MiVN3Jppt314kidCk47MYIRilJjA/l2mxwiuzzxGUeJIvA8/pDaJOAX5KWvjAo7SCydcW0/4WEtgbLMiJkg== dependencies: - "@jest/core" "^27.4.4" + "@jest/core" "^27.4.5" import-local "^3.0.2" - jest-cli "^27.4.4" + jest-cli "^27.4.5" js-tokens@^4.0.0: version "4.0.0" From 6f5b61c5dea1dcac066db07b9690366d83abfb99 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Dec 2021 12:54:23 +0000 Subject: [PATCH 456/785] Bump @typescript-eslint/eslint-plugin from 5.6.0 to 5.7.0 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.6.0 to 5.7.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.7.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 58 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 46 insertions(+), 12 deletions(-) diff --git a/yarn.lock b/yarn.lock index da053c8a..046e548b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -704,12 +704,12 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.4.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.6.0.tgz#efd8668b3d6627c46ce722c2afe813928fe120a0" - integrity sha512-MIbeMy5qfLqtgs1hWd088k1hOuRsN9JrHUPwVVKCD99EOUqScd7SrwoZl4Gso05EAP9w1kvLWUVGJOVpRPkDPA== + version "5.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.7.0.tgz#12d54709f8ea1da99a01d8a992cd0474ad0f0aa9" + integrity sha512-8RTGBpNn5a9M628wBPrCbJ+v3YTEOE2qeZb7TDkGKTDXSj36KGRg92SpFFaR/0S3rSXQxM0Og/kV9EyadsYSBg== dependencies: - "@typescript-eslint/experimental-utils" "5.6.0" - "@typescript-eslint/scope-manager" "5.6.0" + "@typescript-eslint/experimental-utils" "5.7.0" + "@typescript-eslint/scope-manager" "5.7.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -717,15 +717,15 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/experimental-utils@5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.6.0.tgz#f3a5960f2004abdcac7bb81412bafc1560841c23" - integrity sha512-VDoRf3Qj7+W3sS/ZBXZh3LBzp0snDLEgvp6qj0vOAIiAPM07bd5ojQ3CTzF/QFl5AKh7Bh1ycgj6lFBJHUt/DA== +"@typescript-eslint/experimental-utils@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.7.0.tgz#2b1633e6613c3238036156f70c32634843ad034f" + integrity sha512-u57eZ5FbEpzN5kSjmVrSesovWslH2ZyNPnaXQMXWgH57d5+EVHEt76W75vVuI9qKZ5BMDKNfRN+pxcPEjQjb2A== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.6.0" - "@typescript-eslint/types" "5.6.0" - "@typescript-eslint/typescript-estree" "5.6.0" + "@typescript-eslint/scope-manager" "5.7.0" + "@typescript-eslint/types" "5.7.0" + "@typescript-eslint/typescript-estree" "5.7.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -747,11 +747,24 @@ "@typescript-eslint/types" "5.6.0" "@typescript-eslint/visitor-keys" "5.6.0" +"@typescript-eslint/scope-manager@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.7.0.tgz#70adf960e5a58994ad50438ba60d98ecadd79452" + integrity sha512-7mxR520DGq5F7sSSgM0HSSMJ+TFUymOeFRMfUfGFAVBv8BR+Jv1vHgAouYUvWRZeszVBJlLcc9fDdktxb5kmxA== + dependencies: + "@typescript-eslint/types" "5.7.0" + "@typescript-eslint/visitor-keys" "5.7.0" + "@typescript-eslint/types@5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.6.0.tgz#745cb1b59daadcc1f32f7be95f0f68accf38afdd" integrity sha512-OIZffked7mXv4mXzWU5MgAEbCf9ecNJBKi+Si6/I9PpTaj+cf2x58h2oHW5/P/yTnPkKaayfjhLvx+crnl5ubA== +"@typescript-eslint/types@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.7.0.tgz#2d4cae0105ba7d08bffa69698197a762483ebcbe" + integrity sha512-5AeYIF5p2kAneIpnLFve8g50VyAjq7udM7ApZZ9JYjdPjkz0LvODfuSHIDUVnIuUoxafoWzpFyU7Sqbxgi79mA== + "@typescript-eslint/typescript-estree@5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.6.0.tgz#dfbb19c9307fdd81bd9c650c67e8397821d7faf0" @@ -765,6 +778,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.7.0.tgz#968fad899050ccce4f08a40cd5fabc0798525006" + integrity sha512-aO1Ql+izMrTnPj5aFFlEJkpD4jRqC4Gwhygu2oHK2wfVQpmOPbyDSveJ+r/NQo+PWV43M6uEAeLVbTi09dFLhg== + dependencies: + "@typescript-eslint/types" "5.7.0" + "@typescript-eslint/visitor-keys" "5.7.0" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/visitor-keys@5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.6.0.tgz#3e36509e103fe9713d8f035ac977235fd63cb6e6" @@ -773,6 +799,14 @@ "@typescript-eslint/types" "5.6.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.7.0.tgz#e05164239eb7cb8aa9fa06c516ede480ce260178" + integrity sha512-hdohahZ4lTFcglZSJ3DGdzxQHBSxsLVqHzkiOmKi7xVAWC4y2c1bIMKmPJSrA4aOEoRUPOKQ87Y/taC7yVHpFg== + dependencies: + "@typescript-eslint/types" "5.7.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 9eadce16e41e9d1f82e5495d2bea260823782bbc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Dec 2021 12:54:35 +0000 Subject: [PATCH 457/785] Bump typescript from 4.5.3 to 4.5.4 Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.5.3 to 4.5.4. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v4.5.3...v4.5.4) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index da053c8a..e851be98 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3147,9 +3147,9 @@ typedarray-to-buffer@^3.1.5: is-typedarray "^1.0.0" typescript@^4.5.2: - version "4.5.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.3.tgz#afaa858e68c7103317d89eb90c5d8906268d353c" - integrity sha512-eVYaEHALSt+s9LbvgEv4Ef+Tdq7hBiIZgii12xXJnukryt3pMgJf6aKhoCZ3FWQsu6sydEnkg11fYXLzhLBjeQ== + version "4.5.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.4.tgz#a17d3a0263bf5c8723b9c52f43c5084edf13c2e8" + integrity sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg== universalify@^0.1.2: version "0.1.2" From 33aea322469c41c0f3f02de21c98104572c78261 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Dec 2021 12:01:40 +0000 Subject: [PATCH 458/785] Bump @types/node from 16.11.12 to 16.11.13 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.12 to 16.11.13. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 40 +++------------------------------------- 1 file changed, 3 insertions(+), 37 deletions(-) diff --git a/yarn.lock b/yarn.lock index 800fc375..d819d2aa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -677,9 +677,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^16.9.1": - version "16.11.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.12.tgz#ac7fb693ac587ee182c3780c26eb65546a1a3c10" - integrity sha512-+2Iggwg7PxoO5Kyhvsq9VarmPbIelXP070HMImEpbtGCoyWNINQj4wzjbQCXzdHTRXnqufutJb5KAURZANNBAw== + version "16.11.13" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.13.tgz#6b71641b81a98c6a538d89892440c06f147edddc" + integrity sha512-eUXZzHLHoZqj1frtUetNkUetYoJ6X55UmrVnFD4DMhVeAmwLjniZhtBmsRiemQh4uq4G3vUra/Ws/hs9vEvL3Q== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.2" @@ -739,14 +739,6 @@ "@typescript-eslint/typescript-estree" "5.7.0" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.6.0.tgz#9dd7f007dc8f3a34cdff6f79f5eaab27ae05157e" - integrity sha512-1U1G77Hw2jsGWVsO2w6eVCbOg0HZ5WxL/cozVSTfqnL/eB9muhb8THsP0G3w+BB5xAHv9KptwdfYFAUfzcIh4A== - dependencies: - "@typescript-eslint/types" "5.6.0" - "@typescript-eslint/visitor-keys" "5.6.0" - "@typescript-eslint/scope-manager@5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.7.0.tgz#70adf960e5a58994ad50438ba60d98ecadd79452" @@ -755,29 +747,11 @@ "@typescript-eslint/types" "5.7.0" "@typescript-eslint/visitor-keys" "5.7.0" -"@typescript-eslint/types@5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.6.0.tgz#745cb1b59daadcc1f32f7be95f0f68accf38afdd" - integrity sha512-OIZffked7mXv4mXzWU5MgAEbCf9ecNJBKi+Si6/I9PpTaj+cf2x58h2oHW5/P/yTnPkKaayfjhLvx+crnl5ubA== - "@typescript-eslint/types@5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.7.0.tgz#2d4cae0105ba7d08bffa69698197a762483ebcbe" integrity sha512-5AeYIF5p2kAneIpnLFve8g50VyAjq7udM7ApZZ9JYjdPjkz0LvODfuSHIDUVnIuUoxafoWzpFyU7Sqbxgi79mA== -"@typescript-eslint/typescript-estree@5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.6.0.tgz#dfbb19c9307fdd81bd9c650c67e8397821d7faf0" - integrity sha512-92vK5tQaE81rK7fOmuWMrSQtK1IMonESR+RJR2Tlc7w4o0MeEdjgidY/uO2Gobh7z4Q1hhS94Cr7r021fMVEeA== - dependencies: - "@typescript-eslint/types" "5.6.0" - "@typescript-eslint/visitor-keys" "5.6.0" - debug "^4.3.2" - globby "^11.0.4" - is-glob "^4.0.3" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.7.0.tgz#968fad899050ccce4f08a40cd5fabc0798525006" @@ -791,14 +765,6 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.6.0.tgz#3e36509e103fe9713d8f035ac977235fd63cb6e6" - integrity sha512-1p7hDp5cpRFUyE3+lvA74egs+RWSgumrBpzBCDzfTFv0aQ7lIeay80yU0hIxgAhwQ6PcasW35kaOCyDOv6O/Ng== - dependencies: - "@typescript-eslint/types" "5.6.0" - eslint-visitor-keys "^3.0.0" - "@typescript-eslint/visitor-keys@5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.7.0.tgz#e05164239eb7cb8aa9fa06c516ede480ce260178" From 4720fe7d5c508681bbb370ceba3bdaf8e90d8fce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Dec 2021 12:01:37 +0000 Subject: [PATCH 459/785] Bump @types/node from 16.11.13 to 17.0.0 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.13 to 17.0.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f7099851..6d87ad18 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ }, "devDependencies": { "@types/jest": "^27.0.1", - "@types/node": "^16.9.1", + "@types/node": "^17.0.0", "@types/prettier": "^2.4.2", "@typescript-eslint/eslint-plugin": "^5.4.0", "@typescript-eslint/parser": "^5.4.0", diff --git a/yarn.lock b/yarn.lock index d819d2aa..e0694322 100644 --- a/yarn.lock +++ b/yarn.lock @@ -676,10 +676,10 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== -"@types/node@*", "@types/node@^16.9.1": - version "16.11.13" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.13.tgz#6b71641b81a98c6a538d89892440c06f147edddc" - integrity sha512-eUXZzHLHoZqj1frtUetNkUetYoJ6X55UmrVnFD4DMhVeAmwLjniZhtBmsRiemQh4uq4G3vUra/Ws/hs9vEvL3Q== +"@types/node@*", "@types/node@^17.0.0": + version "17.0.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.0.tgz#62797cee3b8b497f6547503b2312254d4fe3c2bb" + integrity sha512-eMhwJXc931Ihh4tkU+Y7GiLzT/y/DBNpNtr4yU9O2w3SYBsr9NaOPhQlLKRmoWtI54uNwuo0IOUFQjVOTZYRvw== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.2" From 9e309aebd8be8aa46d569124c5629dd3ea2e9ef3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Dec 2021 12:01:44 +0000 Subject: [PATCH 460/785] Bump ts-jest from 27.1.1 to 27.1.2 Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 27.1.1 to 27.1.2. - [Release notes](https://github.com/kulshekhar/ts-jest/releases) - [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/kulshekhar/ts-jest/compare/v27.1.1...v27.1.2) --- updated-dependencies: - dependency-name: ts-jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index e0694322..2abeebe8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3067,9 +3067,9 @@ tr46@^2.1.0: punycode "^2.1.1" ts-jest@^27.0.5: - version "27.1.1" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.1.1.tgz#5a54aca96db1dac37c681f3029dd10f3a8c36192" - integrity sha512-Ds0VkB+cB+8g2JUmP/GKWndeZcCKrbe6jzolGrVWdqVUFByY/2KDHqxJ7yBSon7hDB1TA4PXxjfZ+JjzJisvgA== + version "27.1.2" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.1.2.tgz#5991d6eb3fd8e1a8d4b8f6de3ec0a3cc567f3151" + integrity sha512-eSOiJOWq6Hhs6Khzk5wKC5sgWIXgXqOCiIl1+3lfnearu58Hj4QpE5tUhQcA3xtZrELbcvAGCsd6HB8OsaVaTA== dependencies: bs-logger "0.x" fast-json-stable-stringify "2.x" From 1a45e13216fecb6b8b7123f65e23cc26ebcd357e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Dec 2021 12:04:43 +0000 Subject: [PATCH 461/785] Bump @types/node from 17.0.0 to 17.0.1 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.0 to 17.0.1. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2abeebe8..9afa6298 100644 --- a/yarn.lock +++ b/yarn.lock @@ -677,9 +677,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^17.0.0": - version "17.0.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.0.tgz#62797cee3b8b497f6547503b2312254d4fe3c2bb" - integrity sha512-eMhwJXc931Ihh4tkU+Y7GiLzT/y/DBNpNtr4yU9O2w3SYBsr9NaOPhQlLKRmoWtI54uNwuo0IOUFQjVOTZYRvw== + version "17.0.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.1.tgz#88d501e84b6185f6489ecee4ba9e8fcec7f29bb2" + integrity sha512-NXKvBVUzIbs6ylBwmOwHFkZS2EXCcjnqr8ZCRNaXBkHAf+3mn/rPcJxwrzuc6movh8fxQAsUUfYklJ/EG+hZqQ== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.2" From de03ca6f9bda1b99cc9e5f2b340a773c34023e40 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Dec 2021 12:05:05 +0000 Subject: [PATCH 462/785] Bump eslint from 8.4.1 to 8.5.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.4.1 to 8.5.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.4.1...v8.5.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2abeebe8..d17d507b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1360,9 +1360,9 @@ eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.1.0: integrity sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA== eslint@^8.1.0: - version "8.4.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.4.1.tgz#d6531bbf3e598dffd7c0c7d35ec52a0b30fdfa2d" - integrity sha512-TxU/p7LB1KxQ6+7aztTnO7K0i+h0tDi81YRY9VzB6Id71kNz+fFYnf5HD5UOQmxkzcoa0TlVZf9dpMtUv0GpWg== + version "8.5.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.5.0.tgz#ddd2c1afd8f412036f87ae2a063d2aa296d3175f" + integrity sha512-tVGSkgNbOfiHyVte8bCM8OmX+xG9PzVG/B4UCF60zx7j61WIVY/AqJECDgpLD4DbbESD0e174gOg3ZlrX15GDg== dependencies: "@eslint/eslintrc" "^1.0.5" "@humanwhocodes/config-array" "^0.9.2" From 879249701b79c7f4260d486d8ea7cdd3f7883e37 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Dec 2021 12:01:16 +0000 Subject: [PATCH 463/785] Bump @typescript-eslint/parser from 5.7.0 to 5.8.0 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.7.0 to 5.8.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.8.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7fbb4001..a9459799 100644 --- a/yarn.lock +++ b/yarn.lock @@ -730,13 +730,13 @@ eslint-utils "^3.0.0" "@typescript-eslint/parser@^5.4.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.7.0.tgz#4dca6de463d86f02d252e681136a67888ea3b181" - integrity sha512-m/gWCCcS4jXw6vkrPQ1BjZ1vomP01PArgzvauBqzsoZ3urLbsRChexB8/YV8z9HwE3qlJM35FxfKZ1nfP/4x8g== + version "5.8.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.8.0.tgz#b39970b21c1d7bc4a6018507fb29b380328d2587" + integrity sha512-Gleacp/ZhRtJRYs5/T8KQR3pAQjQI89Dn/k+OzyCKOsLiZH2/Vh60cFBTnFsHNI6WAD+lNUo/xGZ4NeA5u0Ipw== dependencies: - "@typescript-eslint/scope-manager" "5.7.0" - "@typescript-eslint/types" "5.7.0" - "@typescript-eslint/typescript-estree" "5.7.0" + "@typescript-eslint/scope-manager" "5.8.0" + "@typescript-eslint/types" "5.8.0" + "@typescript-eslint/typescript-estree" "5.8.0" debug "^4.3.2" "@typescript-eslint/scope-manager@5.7.0": @@ -747,11 +747,24 @@ "@typescript-eslint/types" "5.7.0" "@typescript-eslint/visitor-keys" "5.7.0" +"@typescript-eslint/scope-manager@5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.8.0.tgz#2371095b4fa4c7be6a80b380f4e1b49c715e16f4" + integrity sha512-x82CYJsLOjPCDuFFEbS6e7K1QEWj7u5Wk1alw8A+gnJiYwNnDJk0ib6PCegbaPMjrfBvFKa7SxE3EOnnIQz2Gg== + dependencies: + "@typescript-eslint/types" "5.8.0" + "@typescript-eslint/visitor-keys" "5.8.0" + "@typescript-eslint/types@5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.7.0.tgz#2d4cae0105ba7d08bffa69698197a762483ebcbe" integrity sha512-5AeYIF5p2kAneIpnLFve8g50VyAjq7udM7ApZZ9JYjdPjkz0LvODfuSHIDUVnIuUoxafoWzpFyU7Sqbxgi79mA== +"@typescript-eslint/types@5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.8.0.tgz#e7fa74ec35d9dbe3560d039d3d8734986c3971e0" + integrity sha512-LdCYOqeqZWqCMOmwFnum6YfW9F3nKuxJiR84CdIRN5nfHJ7gyvGpXWqL/AaW0k3Po0+wm93ARAsOdzlZDPCcXg== + "@typescript-eslint/typescript-estree@5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.7.0.tgz#968fad899050ccce4f08a40cd5fabc0798525006" @@ -765,6 +778,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.8.0.tgz#900469ba9d5a37f4482b014ecce4a5dbb86cb4dd" + integrity sha512-srfeZ3URdEcUsSLbkOFqS7WoxOqn8JNil2NSLO9O+I2/Uyc85+UlfpEvQHIpj5dVts7KKOZnftoJD/Fdv0L7nQ== + dependencies: + "@typescript-eslint/types" "5.8.0" + "@typescript-eslint/visitor-keys" "5.8.0" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/visitor-keys@5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.7.0.tgz#e05164239eb7cb8aa9fa06c516ede480ce260178" @@ -773,6 +799,14 @@ "@typescript-eslint/types" "5.7.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.8.0.tgz#22d4ed96fe2451135299239feedb9fe1dcec780c" + integrity sha512-+HDIGOEMnqbxdAHegxvnOqESUH6RWFRR2b8qxP1W9CZnnYh4Usz6MBL+2KMAgPk/P0o9c1HqnYtwzVH6GTIqug== + dependencies: + "@typescript-eslint/types" "5.8.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 fe368e059405725c10832aec485e767f97cd6144 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Dec 2021 12:01:33 +0000 Subject: [PATCH 464/785] Bump @typescript-eslint/eslint-plugin from 5.7.0 to 5.8.0 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.7.0 to 5.8.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.8.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 58 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 46 insertions(+), 12 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7fbb4001..74792bba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -704,12 +704,12 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.4.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.7.0.tgz#12d54709f8ea1da99a01d8a992cd0474ad0f0aa9" - integrity sha512-8RTGBpNn5a9M628wBPrCbJ+v3YTEOE2qeZb7TDkGKTDXSj36KGRg92SpFFaR/0S3rSXQxM0Og/kV9EyadsYSBg== + version "5.8.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.8.0.tgz#52cd9305ceef98a5333f9492d519e6c6c7fe7d43" + integrity sha512-spu1UW7QuBn0nJ6+psnfCc3iVoQAifjKORgBngKOmC8U/1tbe2YJMzYQqDGYB4JCss7L8+RM2kKLb1B1Aw9BNA== dependencies: - "@typescript-eslint/experimental-utils" "5.7.0" - "@typescript-eslint/scope-manager" "5.7.0" + "@typescript-eslint/experimental-utils" "5.8.0" + "@typescript-eslint/scope-manager" "5.8.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -717,15 +717,15 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/experimental-utils@5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.7.0.tgz#2b1633e6613c3238036156f70c32634843ad034f" - integrity sha512-u57eZ5FbEpzN5kSjmVrSesovWslH2ZyNPnaXQMXWgH57d5+EVHEt76W75vVuI9qKZ5BMDKNfRN+pxcPEjQjb2A== +"@typescript-eslint/experimental-utils@5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.8.0.tgz#0916ffe98d34b3c95e3652efa0cace61a7b25728" + integrity sha512-KN5FvNH71bhZ8fKtL+lhW7bjm7cxs1nt+hrDZWIqb6ViCffQcWyLunGrgvISgkRojIDcXIsH+xlFfI4RCDA0xA== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.7.0" - "@typescript-eslint/types" "5.7.0" - "@typescript-eslint/typescript-estree" "5.7.0" + "@typescript-eslint/scope-manager" "5.8.0" + "@typescript-eslint/types" "5.8.0" + "@typescript-eslint/typescript-estree" "5.8.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -747,11 +747,24 @@ "@typescript-eslint/types" "5.7.0" "@typescript-eslint/visitor-keys" "5.7.0" +"@typescript-eslint/scope-manager@5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.8.0.tgz#2371095b4fa4c7be6a80b380f4e1b49c715e16f4" + integrity sha512-x82CYJsLOjPCDuFFEbS6e7K1QEWj7u5Wk1alw8A+gnJiYwNnDJk0ib6PCegbaPMjrfBvFKa7SxE3EOnnIQz2Gg== + dependencies: + "@typescript-eslint/types" "5.8.0" + "@typescript-eslint/visitor-keys" "5.8.0" + "@typescript-eslint/types@5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.7.0.tgz#2d4cae0105ba7d08bffa69698197a762483ebcbe" integrity sha512-5AeYIF5p2kAneIpnLFve8g50VyAjq7udM7ApZZ9JYjdPjkz0LvODfuSHIDUVnIuUoxafoWzpFyU7Sqbxgi79mA== +"@typescript-eslint/types@5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.8.0.tgz#e7fa74ec35d9dbe3560d039d3d8734986c3971e0" + integrity sha512-LdCYOqeqZWqCMOmwFnum6YfW9F3nKuxJiR84CdIRN5nfHJ7gyvGpXWqL/AaW0k3Po0+wm93ARAsOdzlZDPCcXg== + "@typescript-eslint/typescript-estree@5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.7.0.tgz#968fad899050ccce4f08a40cd5fabc0798525006" @@ -765,6 +778,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.8.0.tgz#900469ba9d5a37f4482b014ecce4a5dbb86cb4dd" + integrity sha512-srfeZ3URdEcUsSLbkOFqS7WoxOqn8JNil2NSLO9O+I2/Uyc85+UlfpEvQHIpj5dVts7KKOZnftoJD/Fdv0L7nQ== + dependencies: + "@typescript-eslint/types" "5.8.0" + "@typescript-eslint/visitor-keys" "5.8.0" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/visitor-keys@5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.7.0.tgz#e05164239eb7cb8aa9fa06c516ede480ce260178" @@ -773,6 +799,14 @@ "@typescript-eslint/types" "5.7.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.8.0.tgz#22d4ed96fe2451135299239feedb9fe1dcec780c" + integrity sha512-+HDIGOEMnqbxdAHegxvnOqESUH6RWFRR2b8qxP1W9CZnnYh4Usz6MBL+2KMAgPk/P0o9c1HqnYtwzVH6GTIqug== + dependencies: + "@typescript-eslint/types" "5.8.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 71173f1b515a0fa643b0abb9fd3d67d6ed2e3de8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Dec 2021 12:01:44 +0000 Subject: [PATCH 465/785] Bump @types/node from 17.0.1 to 17.0.2 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.1 to 17.0.2. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7fbb4001..4e8e4fd3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -677,9 +677,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^17.0.0": - version "17.0.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.1.tgz#88d501e84b6185f6489ecee4ba9e8fcec7f29bb2" - integrity sha512-NXKvBVUzIbs6ylBwmOwHFkZS2EXCcjnqr8ZCRNaXBkHAf+3mn/rPcJxwrzuc6movh8fxQAsUUfYklJ/EG+hZqQ== + version "17.0.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.2.tgz#a4c07d47ff737e8ee7e586fe636ff0e1ddff070a" + integrity sha512-JepeIUPFDARgIs0zD/SKPgFsJEAF0X5/qO80llx59gOxFTboS9Amv3S+QfB7lqBId5sFXJ99BN0J6zFRvL9dDA== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.2" From ded9395bbf9758d7f74449f0f14fb86fd677eab3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Dec 2021 12:01:36 +0000 Subject: [PATCH 466/785] Bump pretty-quick from 3.1.2 to 3.1.3 Bumps [pretty-quick](https://github.com/azz/pretty-quick) from 3.1.2 to 3.1.3. - [Release notes](https://github.com/azz/pretty-quick/releases) - [Commits](https://github.com/azz/pretty-quick/compare/v3.1.2...v3.1.3) --- updated-dependencies: - dependency-name: pretty-quick dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 40 +++------------------------------------- 1 file changed, 3 insertions(+), 37 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7c52d52f..5361c729 100644 --- a/yarn.lock +++ b/yarn.lock @@ -739,14 +739,6 @@ "@typescript-eslint/typescript-estree" "5.8.0" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.7.0.tgz#70adf960e5a58994ad50438ba60d98ecadd79452" - integrity sha512-7mxR520DGq5F7sSSgM0HSSMJ+TFUymOeFRMfUfGFAVBv8BR+Jv1vHgAouYUvWRZeszVBJlLcc9fDdktxb5kmxA== - dependencies: - "@typescript-eslint/types" "5.7.0" - "@typescript-eslint/visitor-keys" "5.7.0" - "@typescript-eslint/scope-manager@5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.8.0.tgz#2371095b4fa4c7be6a80b380f4e1b49c715e16f4" @@ -755,29 +747,11 @@ "@typescript-eslint/types" "5.8.0" "@typescript-eslint/visitor-keys" "5.8.0" -"@typescript-eslint/types@5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.7.0.tgz#2d4cae0105ba7d08bffa69698197a762483ebcbe" - integrity sha512-5AeYIF5p2kAneIpnLFve8g50VyAjq7udM7ApZZ9JYjdPjkz0LvODfuSHIDUVnIuUoxafoWzpFyU7Sqbxgi79mA== - "@typescript-eslint/types@5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.8.0.tgz#e7fa74ec35d9dbe3560d039d3d8734986c3971e0" integrity sha512-LdCYOqeqZWqCMOmwFnum6YfW9F3nKuxJiR84CdIRN5nfHJ7gyvGpXWqL/AaW0k3Po0+wm93ARAsOdzlZDPCcXg== -"@typescript-eslint/typescript-estree@5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.7.0.tgz#968fad899050ccce4f08a40cd5fabc0798525006" - integrity sha512-aO1Ql+izMrTnPj5aFFlEJkpD4jRqC4Gwhygu2oHK2wfVQpmOPbyDSveJ+r/NQo+PWV43M6uEAeLVbTi09dFLhg== - dependencies: - "@typescript-eslint/types" "5.7.0" - "@typescript-eslint/visitor-keys" "5.7.0" - debug "^4.3.2" - globby "^11.0.4" - is-glob "^4.0.3" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.8.0.tgz#900469ba9d5a37f4482b014ecce4a5dbb86cb4dd" @@ -791,14 +765,6 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.7.0.tgz#e05164239eb7cb8aa9fa06c516ede480ce260178" - integrity sha512-hdohahZ4lTFcglZSJ3DGdzxQHBSxsLVqHzkiOmKi7xVAWC4y2c1bIMKmPJSrA4aOEoRUPOKQ87Y/taC7yVHpFg== - dependencies: - "@typescript-eslint/types" "5.7.0" - eslint-visitor-keys "^3.0.0" - "@typescript-eslint/visitor-keys@5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.8.0.tgz#22d4ed96fe2451135299239feedb9fe1dcec780c" @@ -2765,9 +2731,9 @@ pretty-format@^27.4.2: react-is "^17.0.1" pretty-quick@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/pretty-quick/-/pretty-quick-3.1.2.tgz#89d8741af7122cbd7f34182df746c5a7ea360b5c" - integrity sha512-T+fpTJrDjTzewql4p3lKrRA7z3MrNyjBK1MKeaBm5PpKwATgVm885TpY7TgY8KFt5Q1Qn3QDseRQcyX9AKTKkA== + version "3.1.3" + resolved "https://registry.yarnpkg.com/pretty-quick/-/pretty-quick-3.1.3.tgz#15281108c0ddf446675157ca40240099157b638e" + integrity sha512-kOCi2FJabvuh1as9enxYmrnBC6tVMoVOenMaBqRfsvBHB0cbpYHjdQEpSglpASDFEXVwplpcGR4CLEaisYAFcA== dependencies: chalk "^3.0.0" execa "^4.0.0" From 9882779e4c806c66f58d5569f7120e2c54c8462a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 23 Dec 2021 12:01:37 +0000 Subject: [PATCH 467/785] Bump @types/node from 17.0.2 to 17.0.4 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.2 to 17.0.4. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5361c729..255bb83b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -677,9 +677,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^17.0.0": - version "17.0.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.2.tgz#a4c07d47ff737e8ee7e586fe636ff0e1ddff070a" - integrity sha512-JepeIUPFDARgIs0zD/SKPgFsJEAF0X5/qO80llx59gOxFTboS9Amv3S+QfB7lqBId5sFXJ99BN0J6zFRvL9dDA== + version "17.0.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.4.tgz#fec0ce0526abb6062fd206d72a642811b887a111" + integrity sha512-6xwbrW4JJiJLgF+zNypN5wr2ykM9/jHcL7rQ8fZe2vuftggjzZeRSM4OwRc6Xk8qWjwJ99qVHo/JgOGmomWRog== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.2" From ffddae2e5e13b0ef946d92a97684c98917534415 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Dec 2021 12:01:43 +0000 Subject: [PATCH 468/785] Bump @typescript-eslint/parser from 5.8.0 to 5.8.1 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.8.0 to 5.8.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.8.1/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index 255bb83b..278d68ec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -730,13 +730,13 @@ eslint-utils "^3.0.0" "@typescript-eslint/parser@^5.4.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.8.0.tgz#b39970b21c1d7bc4a6018507fb29b380328d2587" - integrity sha512-Gleacp/ZhRtJRYs5/T8KQR3pAQjQI89Dn/k+OzyCKOsLiZH2/Vh60cFBTnFsHNI6WAD+lNUo/xGZ4NeA5u0Ipw== + version "5.8.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.8.1.tgz#380f5f1e596b540059998aa3fc80d78f0f9b0d0a" + integrity sha512-K1giKHAjHuyB421SoXMXFHHVI4NdNY603uKw92++D3qyxSeYvC10CBJ/GE5Thpo4WTUvu1mmJI2/FFkz38F2Gw== dependencies: - "@typescript-eslint/scope-manager" "5.8.0" - "@typescript-eslint/types" "5.8.0" - "@typescript-eslint/typescript-estree" "5.8.0" + "@typescript-eslint/scope-manager" "5.8.1" + "@typescript-eslint/types" "5.8.1" + "@typescript-eslint/typescript-estree" "5.8.1" debug "^4.3.2" "@typescript-eslint/scope-manager@5.8.0": @@ -747,11 +747,24 @@ "@typescript-eslint/types" "5.8.0" "@typescript-eslint/visitor-keys" "5.8.0" +"@typescript-eslint/scope-manager@5.8.1": + version "5.8.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.8.1.tgz#7fc0604f7ade8833e4d42cebaa1e2debf8b932e4" + integrity sha512-DGxJkNyYruFH3NIZc3PwrzwOQAg7vvgsHsHCILOLvUpupgkwDZdNq/cXU3BjF4LNrCsVg0qxEyWasys5AiJ85Q== + dependencies: + "@typescript-eslint/types" "5.8.1" + "@typescript-eslint/visitor-keys" "5.8.1" + "@typescript-eslint/types@5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.8.0.tgz#e7fa74ec35d9dbe3560d039d3d8734986c3971e0" integrity sha512-LdCYOqeqZWqCMOmwFnum6YfW9F3nKuxJiR84CdIRN5nfHJ7gyvGpXWqL/AaW0k3Po0+wm93ARAsOdzlZDPCcXg== +"@typescript-eslint/types@5.8.1": + version "5.8.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.8.1.tgz#04c6b49ebc8c99238238a6b8b43f2fc613983b5a" + integrity sha512-L/FlWCCgnjKOLefdok90/pqInkomLnAcF9UAzNr+DSqMC3IffzumHTQTrINXhP1gVp9zlHiYYjvozVZDPleLcA== + "@typescript-eslint/typescript-estree@5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.8.0.tgz#900469ba9d5a37f4482b014ecce4a5dbb86cb4dd" @@ -765,6 +778,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.8.1": + version "5.8.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.8.1.tgz#a592855be688e7b729a1e9411d7d74ec992ed6ef" + integrity sha512-26lQ8l8tTbG7ri7xEcCFT9ijU5Fk+sx/KRRyyzCv7MQ+rZZlqiDPtMKWLC8P7o+dtCnby4c+OlxuX1tp8WfafQ== + dependencies: + "@typescript-eslint/types" "5.8.1" + "@typescript-eslint/visitor-keys" "5.8.1" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/visitor-keys@5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.8.0.tgz#22d4ed96fe2451135299239feedb9fe1dcec780c" @@ -773,6 +799,14 @@ "@typescript-eslint/types" "5.8.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.8.1": + version "5.8.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.8.1.tgz#58a2c566265d5511224bc316149890451c1bbab0" + integrity sha512-SWgiWIwocK6NralrJarPZlWdr0hZnj5GXHIgfdm8hNkyKvpeQuFyLP6YjSIe9kf3YBIfU6OHSZLYkQ+smZwtNg== + dependencies: + "@typescript-eslint/types" "5.8.1" + 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 df5c6fb99952c75ca56f39bb28e129f6a6ccc0e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Dec 2021 12:01:58 +0000 Subject: [PATCH 469/785] Bump @typescript-eslint/eslint-plugin from 5.8.0 to 5.8.1 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.8.0 to 5.8.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.8.1/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 58 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 46 insertions(+), 12 deletions(-) diff --git a/yarn.lock b/yarn.lock index 255bb83b..e1d61296 100644 --- a/yarn.lock +++ b/yarn.lock @@ -704,12 +704,12 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.4.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.8.0.tgz#52cd9305ceef98a5333f9492d519e6c6c7fe7d43" - integrity sha512-spu1UW7QuBn0nJ6+psnfCc3iVoQAifjKORgBngKOmC8U/1tbe2YJMzYQqDGYB4JCss7L8+RM2kKLb1B1Aw9BNA== + version "5.8.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.8.1.tgz#97dfaa39f38e99f86801fdf34f9f1bed66704258" + integrity sha512-wTZ5oEKrKj/8/366qTM366zqhIKAp6NCMweoRONtfuC07OAU9nVI2GZZdqQ1qD30WAAtcPdkH+npDwtRFdp4Rw== dependencies: - "@typescript-eslint/experimental-utils" "5.8.0" - "@typescript-eslint/scope-manager" "5.8.0" + "@typescript-eslint/experimental-utils" "5.8.1" + "@typescript-eslint/scope-manager" "5.8.1" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -717,15 +717,15 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/experimental-utils@5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.8.0.tgz#0916ffe98d34b3c95e3652efa0cace61a7b25728" - integrity sha512-KN5FvNH71bhZ8fKtL+lhW7bjm7cxs1nt+hrDZWIqb6ViCffQcWyLunGrgvISgkRojIDcXIsH+xlFfI4RCDA0xA== +"@typescript-eslint/experimental-utils@5.8.1": + version "5.8.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.8.1.tgz#01861eb2f0749f07d02db342b794145a66ed346f" + integrity sha512-fbodVnjIDU4JpeXWRDsG5IfIjYBxEvs8EBO8W1+YVdtrc2B9ppfof5sZhVEDOtgTfFHnYQJDI8+qdqLYO4ceww== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.8.0" - "@typescript-eslint/types" "5.8.0" - "@typescript-eslint/typescript-estree" "5.8.0" + "@typescript-eslint/scope-manager" "5.8.1" + "@typescript-eslint/types" "5.8.1" + "@typescript-eslint/typescript-estree" "5.8.1" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -747,11 +747,24 @@ "@typescript-eslint/types" "5.8.0" "@typescript-eslint/visitor-keys" "5.8.0" +"@typescript-eslint/scope-manager@5.8.1": + version "5.8.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.8.1.tgz#7fc0604f7ade8833e4d42cebaa1e2debf8b932e4" + integrity sha512-DGxJkNyYruFH3NIZc3PwrzwOQAg7vvgsHsHCILOLvUpupgkwDZdNq/cXU3BjF4LNrCsVg0qxEyWasys5AiJ85Q== + dependencies: + "@typescript-eslint/types" "5.8.1" + "@typescript-eslint/visitor-keys" "5.8.1" + "@typescript-eslint/types@5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.8.0.tgz#e7fa74ec35d9dbe3560d039d3d8734986c3971e0" integrity sha512-LdCYOqeqZWqCMOmwFnum6YfW9F3nKuxJiR84CdIRN5nfHJ7gyvGpXWqL/AaW0k3Po0+wm93ARAsOdzlZDPCcXg== +"@typescript-eslint/types@5.8.1": + version "5.8.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.8.1.tgz#04c6b49ebc8c99238238a6b8b43f2fc613983b5a" + integrity sha512-L/FlWCCgnjKOLefdok90/pqInkomLnAcF9UAzNr+DSqMC3IffzumHTQTrINXhP1gVp9zlHiYYjvozVZDPleLcA== + "@typescript-eslint/typescript-estree@5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.8.0.tgz#900469ba9d5a37f4482b014ecce4a5dbb86cb4dd" @@ -765,6 +778,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.8.1": + version "5.8.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.8.1.tgz#a592855be688e7b729a1e9411d7d74ec992ed6ef" + integrity sha512-26lQ8l8tTbG7ri7xEcCFT9ijU5Fk+sx/KRRyyzCv7MQ+rZZlqiDPtMKWLC8P7o+dtCnby4c+OlxuX1tp8WfafQ== + dependencies: + "@typescript-eslint/types" "5.8.1" + "@typescript-eslint/visitor-keys" "5.8.1" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/visitor-keys@5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.8.0.tgz#22d4ed96fe2451135299239feedb9fe1dcec780c" @@ -773,6 +799,14 @@ "@typescript-eslint/types" "5.8.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.8.1": + version "5.8.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.8.1.tgz#58a2c566265d5511224bc316149890451c1bbab0" + integrity sha512-SWgiWIwocK6NralrJarPZlWdr0hZnj5GXHIgfdm8hNkyKvpeQuFyLP6YjSIe9kf3YBIfU6OHSZLYkQ+smZwtNg== + dependencies: + "@typescript-eslint/types" "5.8.1" + 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 c93e2e9d11f58023139c7372a774d956de015e23 Mon Sep 17 00:00:00 2001 From: Nicolas Goutay Date: Tue, 28 Dec 2021 21:48:31 +0000 Subject: [PATCH 470/785] Support HAML attributes starting with @ --- src/haml/parser.rb | 6 ++++++ test/js/haml/tag.test.ts | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/haml/parser.rb b/src/haml/parser.rb index cd8d9796..84d84e3c 100644 --- a/src/haml/parser.rb +++ b/src/haml/parser.rb @@ -44,6 +44,12 @@ def parse_value(string, level = 0) if hash # Explicitly not using Enumerable#to_h here to support Ruby 2.5 hash.each_with_object({}) do |(key, value), response| + # For attributes that starts with @, wrap the attribute in quotes + # For other attributes, remove the quotes + # AlpineJS uses @-attributes + # {'type': 'submit'} => {type: 'submit'} + # {'@click': 'open'} => {'@click': 'open'} + key = "\'#{key}\'" if key.start_with?('@') response[key] = parse_value(value, level + 1) end else diff --git a/test/js/haml/tag.test.ts b/test/js/haml/tag.test.ts index 6d050a89..5ec61d8f 100644 --- a/test/js/haml/tag.test.ts +++ b/test/js/haml/tag.test.ts @@ -103,6 +103,10 @@ describe("tag", () => { expect(content).toChangeFormat(expected); }); + + test("attributes prefixed with @", () => { + expect(haml("%span{'@click': 'open = true'}")).toMatchFormat(); + }); }); test("object reference", () => { From 2bec1e6105bdb2a3ce2b3d882b59498fe8c02d05 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Dec 2021 12:01:49 +0000 Subject: [PATCH 471/785] Bump @types/jest from 27.0.3 to 27.4.0 Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 27.0.3 to 27.4.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 85 ++++--------------------------------------------------- 1 file changed, 5 insertions(+), 80 deletions(-) diff --git a/yarn.lock b/yarn.lock index ee875bcc..6370f2d0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -517,17 +517,6 @@ source-map "^0.6.1" write-file-atomic "^3.0.0" -"@jest/types@^27.2.5": - version "27.2.5" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.2.5.tgz#420765c052605e75686982d24b061b4cbba22132" - integrity sha512-nmuM4VuDtCZcY+eTpw+0nvstwReMsjPoj7ZR80/BbixulhLaiX+fbv8oeLW8WZlJMcsGQsTmMKT/iTZu1Uy/lQ== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^16.0.0" - chalk "^4.0.0" - "@jest/types@^27.4.2": version "27.4.2" resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.4.2.tgz#96536ebd34da6392c2b7c7737d693885b5dd44a5" @@ -659,9 +648,9 @@ "@types/istanbul-lib-report" "*" "@types/jest@^27.0.1": - version "27.0.3" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.0.3.tgz#0cf9dfe9009e467f70a342f0f94ead19842a783a" - integrity sha512-cmmwv9t7gBYt7hNKH5Spu7Kuu/DotGa+Ff+JGRKZ4db5eh8PnKS4LuebJ3YLUoyOyIHraTGyULn23YtEAm0VSg== + version "27.4.0" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.4.0.tgz#037ab8b872067cae842a320841693080f9cb84ed" + integrity sha512-gHl8XuC1RZ8H2j5sHv/JqsaxXkDDM9iDOgu0Wp8sjs4u/snb2PVehyWXJPr+ORA0RPpgw231mnutWI1+0hgjIQ== dependencies: jest-diff "^27.0.0" pretty-format "^27.0.0" @@ -739,14 +728,6 @@ "@typescript-eslint/typescript-estree" "5.8.1" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.8.0.tgz#2371095b4fa4c7be6a80b380f4e1b49c715e16f4" - integrity sha512-x82CYJsLOjPCDuFFEbS6e7K1QEWj7u5Wk1alw8A+gnJiYwNnDJk0ib6PCegbaPMjrfBvFKa7SxE3EOnnIQz2Gg== - dependencies: - "@typescript-eslint/types" "5.8.0" - "@typescript-eslint/visitor-keys" "5.8.0" - "@typescript-eslint/scope-manager@5.8.1": version "5.8.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.8.1.tgz#7fc0604f7ade8833e4d42cebaa1e2debf8b932e4" @@ -755,29 +736,11 @@ "@typescript-eslint/types" "5.8.1" "@typescript-eslint/visitor-keys" "5.8.1" -"@typescript-eslint/types@5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.8.0.tgz#e7fa74ec35d9dbe3560d039d3d8734986c3971e0" - integrity sha512-LdCYOqeqZWqCMOmwFnum6YfW9F3nKuxJiR84CdIRN5nfHJ7gyvGpXWqL/AaW0k3Po0+wm93ARAsOdzlZDPCcXg== - "@typescript-eslint/types@5.8.1": version "5.8.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.8.1.tgz#04c6b49ebc8c99238238a6b8b43f2fc613983b5a" integrity sha512-L/FlWCCgnjKOLefdok90/pqInkomLnAcF9UAzNr+DSqMC3IffzumHTQTrINXhP1gVp9zlHiYYjvozVZDPleLcA== -"@typescript-eslint/typescript-estree@5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.8.0.tgz#900469ba9d5a37f4482b014ecce4a5dbb86cb4dd" - integrity sha512-srfeZ3URdEcUsSLbkOFqS7WoxOqn8JNil2NSLO9O+I2/Uyc85+UlfpEvQHIpj5dVts7KKOZnftoJD/Fdv0L7nQ== - dependencies: - "@typescript-eslint/types" "5.8.0" - "@typescript-eslint/visitor-keys" "5.8.0" - debug "^4.3.2" - globby "^11.0.4" - is-glob "^4.0.3" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.8.1": version "5.8.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.8.1.tgz#a592855be688e7b729a1e9411d7d74ec992ed6ef" @@ -791,14 +754,6 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.8.0.tgz#22d4ed96fe2451135299239feedb9fe1dcec780c" - integrity sha512-+HDIGOEMnqbxdAHegxvnOqESUH6RWFRR2b8qxP1W9CZnnYh4Usz6MBL+2KMAgPk/P0o9c1HqnYtwzVH6GTIqug== - dependencies: - "@typescript-eslint/types" "5.8.0" - eslint-visitor-keys "^3.0.0" - "@typescript-eslint/visitor-keys@5.8.1": version "5.8.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.8.1.tgz#58a2c566265d5511224bc316149890451c1bbab0" @@ -1258,11 +1213,6 @@ detect-newline@^3.0.0: resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== -diff-sequences@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.0.6.tgz#3305cb2e55a033924054695cc66019fd7f8e5723" - integrity sha512-ag6wfpBFyNXZ0p8pcuIDS//D8H062ZQJ3fzYxjpmeKjnz8W4pekL3AI8VohmyZmsWW2PWaHgjsmqR6L13101VQ== - diff-sequences@^27.4.0: version "27.4.0" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.4.0.tgz#d783920ad8d06ec718a060d00196dfef25b132a5" @@ -2011,17 +1961,7 @@ jest-config@^27.4.5: pretty-format "^27.4.2" slash "^3.0.0" -jest-diff@^27.0.0: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.3.1.tgz#d2775fea15411f5f5aeda2a5e02c2f36440f6d55" - integrity sha512-PCeuAH4AWUo2O5+ksW4pL9v5xJAcIKPUPfIhZBcG1RKv/0+dvaWTQK1Nrau8d67dp65fOqbeMdoil+6PedyEPQ== - dependencies: - chalk "^4.0.0" - diff-sequences "^27.0.6" - jest-get-type "^27.3.1" - pretty-format "^27.3.1" - -jest-diff@^27.4.2: +jest-diff@^27.0.0, jest-diff@^27.4.2: version "27.4.2" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.4.2.tgz#786b2a5211d854f848e2dcc1e324448e9481f36f" integrity sha512-ujc9ToyUZDh9KcqvQDkk/gkbf6zSaeEg9AiBxtttXW59H/AcqEYp1ciXAtJp+jXWva5nAf/ePtSsgWwE5mqp4Q== @@ -2074,11 +2014,6 @@ jest-environment-node@^27.4.4: jest-mock "^27.4.2" jest-util "^27.4.2" -jest-get-type@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.3.1.tgz#a8a2b0a12b50169773099eee60a0e6dd11423eff" - integrity sha512-+Ilqi8hgHSAdhlQ3s12CAVNd8H96ZkQBfYoXmArzZnOfAtVAJEiPDBirjByEblvG/4LPJmkL+nBqPO3A1YJAEg== - jest-get-type@^27.4.0: version "27.4.0" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.4.0.tgz#7503d2663fffa431638337b3998d39c5e928e9b5" @@ -2744,17 +2679,7 @@ prettier@>=2.3.0: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.1.tgz#fff75fa9d519c54cf0fce328c1017d94546bc56a" integrity sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg== -pretty-format@^27.0.0, pretty-format@^27.3.1: - version "27.3.1" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.3.1.tgz#7e9486365ccdd4a502061fa761d3ab9ca1b78df5" - integrity sha512-DR/c+pvFc52nLimLROYjnXPtolawm+uWDxr4FjuLDLUn+ktWnSN851KoHwHzzqq6rfCOjkzN8FLgDrSub6UDuA== - dependencies: - "@jest/types" "^27.2.5" - ansi-regex "^5.0.1" - ansi-styles "^5.0.0" - react-is "^17.0.1" - -pretty-format@^27.4.2: +pretty-format@^27.0.0, pretty-format@^27.4.2: version "27.4.2" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.4.2.tgz#e4ce92ad66c3888423d332b40477c87d1dac1fb8" integrity sha512-p0wNtJ9oLuvgOQDEIZ9zQjZffK7KtyR6Si0jnXULIDwrlNF8Cuir3AZP0hHv0jmKuNN/edOnbMjnzd4uTcmWiw== From 8711405ea2d17d4e5b29fdbd7c467f9726e61533 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Dec 2021 12:11:11 +0000 Subject: [PATCH 472/785] Bump @types/node from 17.0.4 to 17.0.5 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.4 to 17.0.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 6370f2d0..1773d3a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -666,9 +666,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^17.0.0": - version "17.0.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.4.tgz#fec0ce0526abb6062fd206d72a642811b887a111" - integrity sha512-6xwbrW4JJiJLgF+zNypN5wr2ykM9/jHcL7rQ8fZe2vuftggjzZeRSM4OwRc6Xk8qWjwJ99qVHo/JgOGmomWRog== + version "17.0.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.5.tgz#57ca67ec4e57ad9e4ef5a6bab48a15387a1c83e0" + integrity sha512-w3mrvNXLeDYV1GKTZorGJQivK6XLCoGwpnyJFbJVK/aTBQUxOCaa/GlFAAN3OTDFcb7h5tiFG+YXCO2By+riZw== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.2" From 307f36135a77ca55c1ddb885d4fe82f0f53bd383 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jan 2022 12:01:48 +0000 Subject: [PATCH 473/785] Bump @types/node from 17.0.5 to 17.0.7 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.5 to 17.0.7. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 1773d3a3..b2ce3ee8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -666,9 +666,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^17.0.0": - version "17.0.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.5.tgz#57ca67ec4e57ad9e4ef5a6bab48a15387a1c83e0" - integrity sha512-w3mrvNXLeDYV1GKTZorGJQivK6XLCoGwpnyJFbJVK/aTBQUxOCaa/GlFAAN3OTDFcb7h5tiFG+YXCO2By+riZw== + version "17.0.7" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.7.tgz#4a53d8332bb65a45470a2f9e2611f1ced637a5cb" + integrity sha512-1QUk+WAUD4t8iR+Oj+UgI8oJa6yyxaB8a8pHaC8uqM6RrS1qbL7bf3Pwl5rHv0psm2CuDErgho6v5N+G+5fwtQ== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.2" From 838c4ce9f3fb5dc95a9d734f23e1afde531214ea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jan 2022 12:02:03 +0000 Subject: [PATCH 474/785] Bump eslint from 8.5.0 to 8.6.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.5.0 to 8.6.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.5.0...v8.6.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/yarn.lock b/yarn.lock index 1773d3a3..303f0c8f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -795,11 +795,16 @@ acorn@^7.1.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.2.4, acorn@^8.4.1, acorn@^8.6.0: +acorn@^8.2.4, acorn@^8.4.1: version "8.6.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.6.0.tgz#e3692ba0eb1a0c83eaa4f37f5fa7368dd7142895" integrity sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw== +acorn@^8.7.0: + version "8.7.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf" + integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ== + agent-base@6: version "6.0.2" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" @@ -1344,9 +1349,9 @@ eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.1.0: integrity sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA== eslint@^8.1.0: - version "8.5.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.5.0.tgz#ddd2c1afd8f412036f87ae2a063d2aa296d3175f" - integrity sha512-tVGSkgNbOfiHyVte8bCM8OmX+xG9PzVG/B4UCF60zx7j61WIVY/AqJECDgpLD4DbbESD0e174gOg3ZlrX15GDg== + version "8.6.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.6.0.tgz#4318c6a31c5584838c1a2e940c478190f58d558e" + integrity sha512-UvxdOJ7mXFlw7iuHZA4jmzPaUqIw54mZrv+XPYKNbKdLR0et4rf60lIZUU9kiNtnzzMzGWxMV+tQ7uG7JG8DPw== dependencies: "@eslint/eslintrc" "^1.0.5" "@humanwhocodes/config-array" "^0.9.2" @@ -1360,7 +1365,7 @@ eslint@^8.1.0: eslint-scope "^7.1.0" eslint-utils "^3.0.0" eslint-visitor-keys "^3.1.0" - espree "^9.2.0" + espree "^9.3.0" esquery "^1.4.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -1387,12 +1392,12 @@ eslint@^8.1.0: text-table "^0.2.0" v8-compile-cache "^2.0.3" -espree@^9.2.0: - version "9.2.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.2.0.tgz#c50814e01611c2d0f8bd4daa83c369eabba80dbc" - integrity sha512-oP3utRkynpZWF/F2x/HZJ+AGtnIclaR7z1pYPxy7NYM2fSO6LgK/Rkny8anRSPK/VwEA1eqm2squui0T7ZMOBg== +espree@^9.2.0, espree@^9.3.0: + version "9.3.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.0.tgz#c1240d79183b72aaee6ccfa5a90bc9111df085a8" + integrity sha512-d/5nCsb0JcqsSEeQzFZ8DH1RmxPcglRWh24EFTlUEmCKoehXGdpsx0RkHDubqUI8LSAIKMQp4r9SzQ3n+sm4HQ== dependencies: - acorn "^8.6.0" + acorn "^8.7.0" acorn-jsx "^5.3.1" eslint-visitor-keys "^3.1.0" From 99d5eaac477b0c4439ff9db3087b62833f7559b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Jan 2022 12:01:27 +0000 Subject: [PATCH 475/785] Bump @typescript-eslint/parser from 5.8.1 to 5.9.0 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.8.1 to 5.9.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.9.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index 8072a743..ca6c7c6b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -719,13 +719,13 @@ eslint-utils "^3.0.0" "@typescript-eslint/parser@^5.4.0": - version "5.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.8.1.tgz#380f5f1e596b540059998aa3fc80d78f0f9b0d0a" - integrity sha512-K1giKHAjHuyB421SoXMXFHHVI4NdNY603uKw92++D3qyxSeYvC10CBJ/GE5Thpo4WTUvu1mmJI2/FFkz38F2Gw== + version "5.9.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.9.0.tgz#fdbb08767a4caa6ca6ccfed5f9ffe9387f0c7d97" + integrity sha512-/6pOPz8yAxEt4PLzgbFRDpZmHnXCeZgPDrh/1DaVKOjvn/UPMlWhbx/gA96xRi2JxY1kBl2AmwVbyROUqys5xQ== dependencies: - "@typescript-eslint/scope-manager" "5.8.1" - "@typescript-eslint/types" "5.8.1" - "@typescript-eslint/typescript-estree" "5.8.1" + "@typescript-eslint/scope-manager" "5.9.0" + "@typescript-eslint/types" "5.9.0" + "@typescript-eslint/typescript-estree" "5.9.0" debug "^4.3.2" "@typescript-eslint/scope-manager@5.8.1": @@ -736,11 +736,24 @@ "@typescript-eslint/types" "5.8.1" "@typescript-eslint/visitor-keys" "5.8.1" +"@typescript-eslint/scope-manager@5.9.0": + version "5.9.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.9.0.tgz#02dfef920290c1dcd7b1999455a3eaae7a1a3117" + integrity sha512-DKtdIL49Qxk2a8icF6whRk7uThuVz4A6TCXfjdJSwOsf+9ree7vgQWcx0KOyCdk0i9ETX666p4aMhrRhxhUkyg== + dependencies: + "@typescript-eslint/types" "5.9.0" + "@typescript-eslint/visitor-keys" "5.9.0" + "@typescript-eslint/types@5.8.1": version "5.8.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.8.1.tgz#04c6b49ebc8c99238238a6b8b43f2fc613983b5a" integrity sha512-L/FlWCCgnjKOLefdok90/pqInkomLnAcF9UAzNr+DSqMC3IffzumHTQTrINXhP1gVp9zlHiYYjvozVZDPleLcA== +"@typescript-eslint/types@5.9.0": + version "5.9.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.9.0.tgz#e5619803e39d24a03b3369506df196355736e1a3" + integrity sha512-mWp6/b56Umo1rwyGCk8fPIzb9Migo8YOniBGPAQDNC6C52SeyNGN4gsVwQTAR+RS2L5xyajON4hOLwAGwPtUwg== + "@typescript-eslint/typescript-estree@5.8.1": version "5.8.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.8.1.tgz#a592855be688e7b729a1e9411d7d74ec992ed6ef" @@ -754,6 +767,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.9.0": + version "5.9.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.9.0.tgz#0e5c6f03f982931abbfbc3c1b9df5fbf92a3490f" + integrity sha512-kxo3xL2mB7XmiVZcECbaDwYCt3qFXz99tBSuVJR4L/sR7CJ+UNAPrYILILktGj1ppfZ/jNt/cWYbziJUlHl1Pw== + dependencies: + "@typescript-eslint/types" "5.9.0" + "@typescript-eslint/visitor-keys" "5.9.0" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/visitor-keys@5.8.1": version "5.8.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.8.1.tgz#58a2c566265d5511224bc316149890451c1bbab0" @@ -762,6 +788,14 @@ "@typescript-eslint/types" "5.8.1" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.9.0": + version "5.9.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.9.0.tgz#7585677732365e9d27f1878150fab3922784a1a6" + integrity sha512-6zq0mb7LV0ThExKlecvpfepiB+XEtFv/bzx7/jKSgyXTFD7qjmSu1FoiS0x3OZaiS+UIXpH2vd9O89f02RCtgw== + dependencies: + "@typescript-eslint/types" "5.9.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 ebe8a67d49d1e3dfe9c1798f89e97650e32207b5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Jan 2022 12:09:29 +0000 Subject: [PATCH 476/785] Bump @typescript-eslint/eslint-plugin from 5.8.1 to 5.9.0 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.8.1 to 5.9.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.9.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 66 ++++++++++++++++++------------------------------------- 1 file changed, 21 insertions(+), 45 deletions(-) diff --git a/yarn.lock b/yarn.lock index ca6c7c6b..47af7440 100644 --- a/yarn.lock +++ b/yarn.lock @@ -693,12 +693,13 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.4.0": - version "5.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.8.1.tgz#97dfaa39f38e99f86801fdf34f9f1bed66704258" - integrity sha512-wTZ5oEKrKj/8/366qTM366zqhIKAp6NCMweoRONtfuC07OAU9nVI2GZZdqQ1qD30WAAtcPdkH+npDwtRFdp4Rw== + version "5.9.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.9.0.tgz#382182d5cb062f52aac54434cfc47c28898c8006" + integrity sha512-qT4lr2jysDQBQOPsCCvpPUZHjbABoTJW8V9ZzIYKHMfppJtpdtzszDYsldwhFxlhvrp7aCHeXD1Lb9M1zhwWwQ== dependencies: - "@typescript-eslint/experimental-utils" "5.8.1" - "@typescript-eslint/scope-manager" "5.8.1" + "@typescript-eslint/experimental-utils" "5.9.0" + "@typescript-eslint/scope-manager" "5.9.0" + "@typescript-eslint/type-utils" "5.9.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -706,15 +707,15 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/experimental-utils@5.8.1": - version "5.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.8.1.tgz#01861eb2f0749f07d02db342b794145a66ed346f" - integrity sha512-fbodVnjIDU4JpeXWRDsG5IfIjYBxEvs8EBO8W1+YVdtrc2B9ppfof5sZhVEDOtgTfFHnYQJDI8+qdqLYO4ceww== +"@typescript-eslint/experimental-utils@5.9.0": + version "5.9.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.9.0.tgz#652762d37d6565ef07af285021b8347b6c79a827" + integrity sha512-ZnLVjBrf26dn7ElyaSKa6uDhqwvAi4jBBmHK1VxuFGPRAxhdi18ubQYSGA7SRiFiES3q9JiBOBHEBStOFkwD2g== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.8.1" - "@typescript-eslint/types" "5.8.1" - "@typescript-eslint/typescript-estree" "5.8.1" + "@typescript-eslint/scope-manager" "5.9.0" + "@typescript-eslint/types" "5.9.0" + "@typescript-eslint/typescript-estree" "5.9.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -728,14 +729,6 @@ "@typescript-eslint/typescript-estree" "5.9.0" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.8.1": - version "5.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.8.1.tgz#7fc0604f7ade8833e4d42cebaa1e2debf8b932e4" - integrity sha512-DGxJkNyYruFH3NIZc3PwrzwOQAg7vvgsHsHCILOLvUpupgkwDZdNq/cXU3BjF4LNrCsVg0qxEyWasys5AiJ85Q== - dependencies: - "@typescript-eslint/types" "5.8.1" - "@typescript-eslint/visitor-keys" "5.8.1" - "@typescript-eslint/scope-manager@5.9.0": version "5.9.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.9.0.tgz#02dfef920290c1dcd7b1999455a3eaae7a1a3117" @@ -744,29 +737,20 @@ "@typescript-eslint/types" "5.9.0" "@typescript-eslint/visitor-keys" "5.9.0" -"@typescript-eslint/types@5.8.1": - version "5.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.8.1.tgz#04c6b49ebc8c99238238a6b8b43f2fc613983b5a" - integrity sha512-L/FlWCCgnjKOLefdok90/pqInkomLnAcF9UAzNr+DSqMC3IffzumHTQTrINXhP1gVp9zlHiYYjvozVZDPleLcA== +"@typescript-eslint/type-utils@5.9.0": + version "5.9.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.9.0.tgz#fd5963ead04bc9b7af9c3a8e534d8d39f1ce5f93" + integrity sha512-uVCb9dJXpBrK1071ri5aEW7ZHdDHAiqEjYznF3HSSvAJXyrkxGOw2Ejibz/q6BXdT8lea8CMI0CzKNFTNI6TEQ== + dependencies: + "@typescript-eslint/experimental-utils" "5.9.0" + debug "^4.3.2" + tsutils "^3.21.0" "@typescript-eslint/types@5.9.0": version "5.9.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.9.0.tgz#e5619803e39d24a03b3369506df196355736e1a3" integrity sha512-mWp6/b56Umo1rwyGCk8fPIzb9Migo8YOniBGPAQDNC6C52SeyNGN4gsVwQTAR+RS2L5xyajON4hOLwAGwPtUwg== -"@typescript-eslint/typescript-estree@5.8.1": - version "5.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.8.1.tgz#a592855be688e7b729a1e9411d7d74ec992ed6ef" - integrity sha512-26lQ8l8tTbG7ri7xEcCFT9ijU5Fk+sx/KRRyyzCv7MQ+rZZlqiDPtMKWLC8P7o+dtCnby4c+OlxuX1tp8WfafQ== - dependencies: - "@typescript-eslint/types" "5.8.1" - "@typescript-eslint/visitor-keys" "5.8.1" - debug "^4.3.2" - globby "^11.0.4" - is-glob "^4.0.3" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.9.0": version "5.9.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.9.0.tgz#0e5c6f03f982931abbfbc3c1b9df5fbf92a3490f" @@ -780,14 +764,6 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@5.8.1": - version "5.8.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.8.1.tgz#58a2c566265d5511224bc316149890451c1bbab0" - integrity sha512-SWgiWIwocK6NralrJarPZlWdr0hZnj5GXHIgfdm8hNkyKvpeQuFyLP6YjSIe9kf3YBIfU6OHSZLYkQ+smZwtNg== - dependencies: - "@typescript-eslint/types" "5.8.1" - eslint-visitor-keys "^3.0.0" - "@typescript-eslint/visitor-keys@5.9.0": version "5.9.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.9.0.tgz#7585677732365e9d27f1878150fab3922784a1a6" From 74cd38488b9b0967109438a482c05fdce3bdf77d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Jan 2022 12:01:42 +0000 Subject: [PATCH 477/785] Bump @types/node from 17.0.7 to 17.0.8 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.7 to 17.0.8. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 47af7440..0a3d2441 100644 --- a/yarn.lock +++ b/yarn.lock @@ -666,9 +666,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^17.0.0": - version "17.0.7" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.7.tgz#4a53d8332bb65a45470a2f9e2611f1ced637a5cb" - integrity sha512-1QUk+WAUD4t8iR+Oj+UgI8oJa6yyxaB8a8pHaC8uqM6RrS1qbL7bf3Pwl5rHv0psm2CuDErgho6v5N+G+5fwtQ== + version "17.0.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.8.tgz#50d680c8a8a78fe30abe6906453b21ad8ab0ad7b" + integrity sha512-YofkM6fGv4gDJq78g4j0mMuGMkZVxZDgtU0JRdx6FgiJDG+0fY0GKVolOV8WqVmEhLCXkQRjwDdKyPxJp/uucg== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.2" From 6d31ae86ff996414a245ccfa5ecebf5c5611bd14 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Jan 2022 12:02:03 +0000 Subject: [PATCH 478/785] Bump jest from 27.4.5 to 27.4.6 Bumps [jest](https://github.com/facebook/jest) from 27.4.5 to 27.4.6. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v27.4.5...v27.4.6) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 568 +++++++++++++++++++++++++++--------------------------- 1 file changed, 280 insertions(+), 288 deletions(-) diff --git a/yarn.lock b/yarn.lock index 47af7440..09fd6bdb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14,7 +14,7 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.16.4.tgz#081d6bbc336ec5c2435c6346b2ae1fb98b5ac68e" integrity sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q== -"@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.2", "@babel/core@^7.7.5": +"@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.2": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.16.0.tgz#c4ff44046f5fe310525cc9eb4ef5147f0c5374d4" integrity sha512-mYZEvshBRHGsIAiyH5PzCFTCfbWfoYbO/jcSdXQSUQu1/pW0xDZAUP7KEc32heqWTAfAHhV9j1vH8Sav7l+JNQ== @@ -169,7 +169,7 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.0", "@babel/parser@^7.16.3", "@babel/parser@^7.7.2": +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.0", "@babel/parser@^7.16.3": version "7.16.4" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.4.tgz#d5f92f57cf2c74ffe9b37981c0e72fee7311372e" integrity sha512-6V0qdPUaiVHH3RtZeLIsc+6pDhbYzHR8ogA8w+f+Wc77DuXto19g2QUwveINoS34Uw+W8/hQDGJCx+i4n7xcng== @@ -274,7 +274,7 @@ "@babel/parser" "^7.16.0" "@babel/types" "^7.16.0" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.16.0", "@babel/traverse@^7.16.3", "@babel/traverse@^7.7.2": +"@babel/traverse@^7.16.0", "@babel/traverse@^7.16.3", "@babel/traverse@^7.7.2": version "7.16.3" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.3.tgz#f63e8a938cc1b780f66d9ed3c54f532ca2d14787" integrity sha512-eolumr1vVMjqevCpwVO99yN/LoGL0EyHiLO5I043aYQvwOJ9eR5UsZSClHVCzfhBduMAsSzgA/6AyqPjNayJag== @@ -359,27 +359,27 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^27.4.2": - version "27.4.2" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.4.2.tgz#7a95612d38c007ddb528ee446fe5e5e785e685ce" - integrity sha512-xknHThRsPB/To1FUbi6pCe43y58qFC03zfb6R7fDb/FfC7k2R3i1l+izRBJf8DI46KhYGRaF14Eo9A3qbBoixg== +"@jest/console@^27.4.6": + version "27.4.6" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.4.6.tgz#0742e6787f682b22bdad56f9db2a8a77f6a86107" + integrity sha512-jauXyacQD33n47A44KrlOVeiXHEXDqapSdfb9kTekOchH/Pd18kBIO1+xxJQRLuG+LUuljFCwTG92ra4NW7SpA== dependencies: "@jest/types" "^27.4.2" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^27.4.2" + jest-message-util "^27.4.6" jest-util "^27.4.2" slash "^3.0.0" -"@jest/core@^27.4.5": - version "27.4.5" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.4.5.tgz#cae2dc34259782f4866c6606c3b480cce920ed4c" - integrity sha512-3tm/Pevmi8bDsgvo73nX8p/WPng6KWlCyScW10FPEoN1HU4pwI83tJ3TsFvi1FfzsjwUlMNEPowgb/rPau/LTQ== +"@jest/core@^27.4.6": + version "27.4.6" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.4.6.tgz#5cc4e714602324dc1561029224fd593e70ab4c7d" + integrity sha512-2XvkAguDxaSAg6+Rznq7VZeIs3eV4owk3dud0zL4FH0d8mX7whkAUnO9rb0keMGStazfekR1ec9Yf9BFt4m02Q== dependencies: - "@jest/console" "^27.4.2" - "@jest/reporters" "^27.4.5" - "@jest/test-result" "^27.4.2" - "@jest/transform" "^27.4.5" + "@jest/console" "^27.4.6" + "@jest/reporters" "^27.4.6" + "@jest/test-result" "^27.4.6" + "@jest/transform" "^27.4.6" "@jest/types" "^27.4.2" "@types/node" "*" ansi-escapes "^4.2.1" @@ -388,63 +388,63 @@ exit "^0.1.2" graceful-fs "^4.2.4" jest-changed-files "^27.4.2" - jest-config "^27.4.5" - jest-haste-map "^27.4.5" - jest-message-util "^27.4.2" + jest-config "^27.4.6" + jest-haste-map "^27.4.6" + jest-message-util "^27.4.6" jest-regex-util "^27.4.0" - jest-resolve "^27.4.5" - jest-resolve-dependencies "^27.4.5" - jest-runner "^27.4.5" - jest-runtime "^27.4.5" - jest-snapshot "^27.4.5" + jest-resolve "^27.4.6" + jest-resolve-dependencies "^27.4.6" + jest-runner "^27.4.6" + jest-runtime "^27.4.6" + jest-snapshot "^27.4.6" jest-util "^27.4.2" - jest-validate "^27.4.2" - jest-watcher "^27.4.2" + jest-validate "^27.4.6" + jest-watcher "^27.4.6" micromatch "^4.0.4" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.4.4": - version "27.4.4" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.4.4.tgz#66ebebc79673d84aad29d2bb70a8c51e6c29bb4d" - integrity sha512-q+niMx7cJgt/t/b6dzLOh4W8Ef/8VyKG7hxASK39jakijJzbFBGpptx3RXz13FFV7OishQ9lTbv+dQ5K3EhfDQ== +"@jest/environment@^27.4.6": + version "27.4.6" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.4.6.tgz#1e92885d64f48c8454df35ed9779fbcf31c56d8b" + integrity sha512-E6t+RXPfATEEGVidr84WngLNWZ8ffCPky8RqqRK6u1Bn0LK92INe0MDttyPl/JOzaq92BmDzOeuqk09TvM22Sg== dependencies: - "@jest/fake-timers" "^27.4.2" + "@jest/fake-timers" "^27.4.6" "@jest/types" "^27.4.2" "@types/node" "*" - jest-mock "^27.4.2" + jest-mock "^27.4.6" -"@jest/fake-timers@^27.4.2": - version "27.4.2" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.4.2.tgz#d217f86c3ba2027bf29e0b731fd0cb761a72d093" - integrity sha512-f/Xpzn5YQk5adtqBgvw1V6bF8Nx3hY0OIRRpCvWcfPl0EAjdqWPdhH3t/3XpiWZqtjIEHDyMKP9ajpva1l4Zmg== +"@jest/fake-timers@^27.4.6": + version "27.4.6" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.4.6.tgz#e026ae1671316dbd04a56945be2fa251204324e8" + integrity sha512-mfaethuYF8scV8ntPpiVGIHQgS0XIALbpY2jt2l7wb/bvq4Q5pDLk4EP4D7SAvYT1QrPOPVZAtbdGAOOyIgs7A== dependencies: "@jest/types" "^27.4.2" "@sinonjs/fake-timers" "^8.0.1" "@types/node" "*" - jest-message-util "^27.4.2" - jest-mock "^27.4.2" + jest-message-util "^27.4.6" + jest-mock "^27.4.6" jest-util "^27.4.2" -"@jest/globals@^27.4.4": - version "27.4.4" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.4.4.tgz#fe501a80c23ea2dab585c42be2a519bb5e38530d" - integrity sha512-bqpqQhW30BOreXM8bA8t8JbOQzsq/WnPTnBl+It3UxAD9J8yxEAaBEylHx1dtBapAr/UBk8GidXbzmqnee8tYQ== +"@jest/globals@^27.4.6": + version "27.4.6" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.4.6.tgz#3f09bed64b0fd7f5f996920258bd4be8f52f060a" + integrity sha512-kAiwMGZ7UxrgPzu8Yv9uvWmXXxsy0GciNejlHvfPIfWkSxChzv6bgTS3YqBkGuHcis+ouMFI2696n2t+XYIeFw== dependencies: - "@jest/environment" "^27.4.4" + "@jest/environment" "^27.4.6" "@jest/types" "^27.4.2" - expect "^27.4.2" + expect "^27.4.6" -"@jest/reporters@^27.4.5": - version "27.4.5" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.4.5.tgz#e229acca48d18ea39e805540c1c322b075ae63ad" - integrity sha512-3orsG4vi8zXuBqEoy2LbnC1kuvkg1KQUgqNxmxpQgIOQEPeV0onvZu+qDQnEoX8qTQErtqn/xzcnbpeTuOLSiA== +"@jest/reporters@^27.4.6": + version "27.4.6" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.4.6.tgz#b53dec3a93baf9b00826abf95b932de919d6d8dd" + integrity sha512-+Zo9gV81R14+PSq4wzee4GC2mhAN9i9a7qgJWL90Gpx7fHYkWpTBvwWNZUXvJByYR9tAVBdc8VxDWqfJyIUrIQ== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.4.2" - "@jest/test-result" "^27.4.2" - "@jest/transform" "^27.4.5" + "@jest/console" "^27.4.6" + "@jest/test-result" "^27.4.6" + "@jest/transform" "^27.4.6" "@jest/types" "^27.4.2" "@types/node" "*" chalk "^4.0.0" @@ -453,14 +453,14 @@ glob "^7.1.2" graceful-fs "^4.2.4" istanbul-lib-coverage "^3.0.0" - istanbul-lib-instrument "^4.0.3" + istanbul-lib-instrument "^5.1.0" istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" - istanbul-reports "^3.0.2" - jest-haste-map "^27.4.5" - jest-resolve "^27.4.5" + istanbul-reports "^3.1.3" + jest-haste-map "^27.4.6" + jest-resolve "^27.4.6" jest-util "^27.4.2" - jest-worker "^27.4.5" + jest-worker "^27.4.6" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" @@ -476,43 +476,43 @@ graceful-fs "^4.2.4" source-map "^0.6.0" -"@jest/test-result@^27.4.2": - version "27.4.2" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.4.2.tgz#05fd4a5466ec502f3eae0b39dff2b93ea4d5d9ec" - integrity sha512-kr+bCrra9jfTgxHXHa2UwoQjxvQk3Am6QbpAiJ5x/50LW8llOYrxILkqY0lZRW/hu8FXesnudbql263+EW9iNA== +"@jest/test-result@^27.4.6": + version "27.4.6" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.4.6.tgz#b3df94c3d899c040f602cea296979844f61bdf69" + integrity sha512-fi9IGj3fkOrlMmhQqa/t9xum8jaJOOAi/lZlm6JXSc55rJMXKHxNDN1oCP39B0/DhNOa2OMupF9BcKZnNtXMOQ== dependencies: - "@jest/console" "^27.4.2" + "@jest/console" "^27.4.6" "@jest/types" "^27.4.2" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.4.5": - version "27.4.5" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.4.5.tgz#1d7e026844d343b60d2ca7fd82c579a17b445d7d" - integrity sha512-n5woIn/1v+FT+9hniymHPARA9upYUmfi5Pw9ewVwXCDlK4F5/Gkees9v8vdjGdAIJ2MPHLHodiajLpZZanWzEQ== +"@jest/test-sequencer@^27.4.6": + version "27.4.6" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.4.6.tgz#447339b8a3d7b5436f50934df30854e442a9d904" + integrity sha512-3GL+nsf6E1PsyNsJuvPyIz+DwFuCtBdtvPpm/LMXVkBJbdFvQYCDpccYT56qq5BGniXWlE81n2qk1sdXfZebnw== dependencies: - "@jest/test-result" "^27.4.2" + "@jest/test-result" "^27.4.6" graceful-fs "^4.2.4" - jest-haste-map "^27.4.5" - jest-runtime "^27.4.5" + jest-haste-map "^27.4.6" + jest-runtime "^27.4.6" -"@jest/transform@^27.4.5": - version "27.4.5" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.4.5.tgz#3dfe2e3680cd4aa27356172bf25617ab5b94f195" - integrity sha512-PuMet2UlZtlGzwc6L+aZmR3I7CEBpqadO03pU40l2RNY2fFJ191b9/ITB44LNOhVtsyykx0OZvj0PCyuLm7Eew== +"@jest/transform@^27.4.6": + version "27.4.6" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.4.6.tgz#153621940b1ed500305eacdb31105d415dc30231" + integrity sha512-9MsufmJC8t5JTpWEQJ0OcOOAXaH5ioaIX6uHVBLBMoCZPfKKQF+EqP8kACAvCZ0Y1h2Zr3uOccg8re+Dr5jxyw== dependencies: "@babel/core" "^7.1.0" "@jest/types" "^27.4.2" - babel-plugin-istanbul "^6.0.0" + babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.4.5" + jest-haste-map "^27.4.6" jest-regex-util "^27.4.0" jest-util "^27.4.2" micromatch "^4.0.4" - pirates "^4.0.1" + pirates "^4.0.4" slash "^3.0.0" source-map "^0.6.1" write-file-atomic "^3.0.0" @@ -913,21 +913,21 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= -babel-jest@^27.4.5: - version "27.4.5" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.4.5.tgz#d38bd0be8ea71d8b97853a5fc9f76deeb095c709" - integrity sha512-3uuUTjXbgtODmSv/DXO9nZfD52IyC2OYTFaXGRzL0kpykzroaquCrD5+lZNafTvZlnNqZHt5pb0M08qVBZnsnA== +babel-jest@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.4.6.tgz#4d024e69e241cdf4f396e453a07100f44f7ce314" + integrity sha512-qZL0JT0HS1L+lOuH+xC2DVASR3nunZi/ozGhpgauJHgmI7f8rudxf6hUjEHympdQ/J64CdKmPkgfJ+A3U6QCrg== dependencies: - "@jest/transform" "^27.4.5" + "@jest/transform" "^27.4.6" "@jest/types" "^27.4.2" "@types/babel__core" "^7.1.14" - babel-plugin-istanbul "^6.0.0" + babel-plugin-istanbul "^6.1.1" babel-preset-jest "^27.4.0" chalk "^4.0.0" graceful-fs "^4.2.4" slash "^3.0.0" -babel-plugin-istanbul@^6.0.0: +babel-plugin-istanbul@^6.1.1: version "6.1.1" resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== @@ -1480,17 +1480,15 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.4.2.tgz#4429b0f7e307771d176de9bdf23229b101db6ef6" - integrity sha512-BjAXIDC6ZOW+WBFNg96J22D27Nq5ohn+oGcuP2rtOtcjuxNoV9McpQ60PcQWhdFOSBIQdR72e+4HdnbZTFSTyg== +expect@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.4.6.tgz#f335e128b0335b6ceb4fcab67ece7cbd14c942e6" + integrity sha512-1M/0kAALIaj5LaG66sFJTbRsWTADnylly82cu4bspI0nl+pgP4E6Bh/aqdHlTUjul06K7xQnnrAoqfxVU0+/ag== dependencies: "@jest/types" "^27.4.2" - ansi-styles "^5.0.0" jest-get-type "^27.4.0" - jest-matcher-utils "^27.4.2" - jest-message-util "^27.4.2" - jest-regex-util "^27.4.0" + jest-matcher-utils "^27.4.6" + jest-message-util "^27.4.6" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1849,17 +1847,7 @@ istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== -istanbul-lib-instrument@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz#873c6fff897450118222774696a3f28902d77c1d" - integrity sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ== - dependencies: - "@babel/core" "^7.7.5" - "@istanbuljs/schema" "^0.1.2" - istanbul-lib-coverage "^3.0.0" - semver "^6.3.0" - -istanbul-lib-instrument@^5.0.4: +istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.1.0.tgz#7b49198b657b27a730b8e9cb601f1e1bff24c59a" integrity sha512-czwUz525rkOFDJxfKK6mYfIs9zBKILyrZQxjz3ABhjQXhbhFsSbo1HW/BFcsDnfJYJWA6thRR5/TUY2qs5W99Q== @@ -1888,10 +1876,10 @@ istanbul-lib-source-maps@^4.0.0: istanbul-lib-coverage "^3.0.0" source-map "^0.6.1" -istanbul-reports@^3.0.2: - version "3.0.5" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.0.5.tgz#a2580107e71279ea6d661ddede929ffc6d693384" - integrity sha512-5+19PlhnGabNWB7kOFnuxT8H3T/iIyQzIbQMxXsURmmvKg86P2sbkrGOT77VnHw0Qr0gc2XzRaRfMZYYbSQCJQ== +istanbul-reports@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.3.tgz#4bcae3103b94518117930d51283690960b50d3c2" + integrity sha512-x9LtDVtfm/t1GFiLl3NffC7hz+I1ragvgX1P/Lg1NlIagifZDKUkuuaAxH/qpwj2IuEfD8G2Bs/UKp+sZ/pKkg== dependencies: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" @@ -1905,78 +1893,77 @@ jest-changed-files@^27.4.2: execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.4.5: - version "27.4.5" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.4.5.tgz#70bfb78e0200cab9b84747bf274debacaa538467" - integrity sha512-eTNWa9wsvBwPykhMMShheafbwyakcdHZaEYh5iRrQ0PFJxkDP/e3U/FvzGuKWu2WpwUA3C3hPlfpuzvOdTVqnw== +jest-circus@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.4.6.tgz#d3af34c0eb742a967b1919fbb351430727bcea6c" + integrity sha512-UA7AI5HZrW4wRM72Ro80uRR2Fg+7nR0GESbSI/2M+ambbzVuA63mn5T1p3Z/wlhntzGpIG1xx78GP2YIkf6PhQ== dependencies: - "@jest/environment" "^27.4.4" - "@jest/test-result" "^27.4.2" + "@jest/environment" "^27.4.6" + "@jest/test-result" "^27.4.6" "@jest/types" "^27.4.2" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" - expect "^27.4.2" + expect "^27.4.6" is-generator-fn "^2.0.0" - jest-each "^27.4.2" - jest-matcher-utils "^27.4.2" - jest-message-util "^27.4.2" - jest-runtime "^27.4.5" - jest-snapshot "^27.4.5" + jest-each "^27.4.6" + jest-matcher-utils "^27.4.6" + jest-message-util "^27.4.6" + jest-runtime "^27.4.6" + jest-snapshot "^27.4.6" jest-util "^27.4.2" - pretty-format "^27.4.2" + pretty-format "^27.4.6" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.4.5: - version "27.4.5" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.4.5.tgz#8708f54c28d13681f3255ec9026a2b15b03d41e8" - integrity sha512-hrky3DSgE0u7sQxaCL7bdebEPHx5QzYmrGuUjaPLmPE8jx5adtvGuOlRspvMoVLTTDOHRnZDoRLYJuA+VCI7Hg== +jest-cli@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.4.6.tgz#b81e053a753111bddf0782c1a1a86b9b910f5b86" + integrity sha512-SFfUC7jMHPGwsNSYBnJMNtjoSDrb34T+SEH5psDeGNVuTVov5Zi1RQpfJYwzpK2ex3OmnsNsiqLe3/SCc8S01Q== dependencies: - "@jest/core" "^27.4.5" - "@jest/test-result" "^27.4.2" + "@jest/core" "^27.4.6" + "@jest/test-result" "^27.4.6" "@jest/types" "^27.4.2" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.4.5" + jest-config "^27.4.6" jest-util "^27.4.2" - jest-validate "^27.4.2" + jest-validate "^27.4.6" prompts "^2.0.1" yargs "^16.2.0" -jest-config@^27.4.5: - version "27.4.5" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.4.5.tgz#77ed7f2ba7bcfd7d740ade711d0d13512e08a59e" - integrity sha512-t+STVJtPt+fpqQ8GBw850NtSQbnDOw/UzdPfzDaHQ48/AylQlW7LHj3dH+ndxhC1UxJ0Q3qkq7IH+nM1skwTwA== +jest-config@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.4.6.tgz#0970f6c92702ca7878120cea638791d00a3996ee" + integrity sha512-3SGoFbaanQVg7MK5w/z8LnCMF6aZc2I7EQxS4s8fTfZpVYnWNDN34llcaViToIB62DFMhwHWTPX9X2O+4aDL1g== dependencies: - "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.4.5" + "@jest/test-sequencer" "^27.4.6" "@jest/types" "^27.4.2" - babel-jest "^27.4.5" + babel-jest "^27.4.6" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" - jest-circus "^27.4.5" - jest-environment-jsdom "^27.4.4" - jest-environment-node "^27.4.4" + jest-circus "^27.4.6" + jest-environment-jsdom "^27.4.6" + jest-environment-node "^27.4.6" jest-get-type "^27.4.0" - jest-jasmine2 "^27.4.5" + jest-jasmine2 "^27.4.6" jest-regex-util "^27.4.0" - jest-resolve "^27.4.5" - jest-runner "^27.4.5" + jest-resolve "^27.4.6" + jest-runner "^27.4.6" jest-util "^27.4.2" - jest-validate "^27.4.2" + jest-validate "^27.4.6" micromatch "^4.0.4" - pretty-format "^27.4.2" + pretty-format "^27.4.6" slash "^3.0.0" -jest-diff@^27.0.0, jest-diff@^27.4.2: +jest-diff@^27.0.0: version "27.4.2" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.4.2.tgz#786b2a5211d854f848e2dcc1e324448e9481f36f" integrity sha512-ujc9ToyUZDh9KcqvQDkk/gkbf6zSaeEg9AiBxtttXW59H/AcqEYp1ciXAtJp+jXWva5nAf/ePtSsgWwE5mqp4Q== @@ -1986,6 +1973,16 @@ jest-diff@^27.0.0, jest-diff@^27.4.2: jest-get-type "^27.4.0" pretty-format "^27.4.2" +jest-diff@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.4.6.tgz#93815774d2012a2cbb6cf23f84d48c7a2618f98d" + integrity sha512-zjaB0sh0Lb13VyPsd92V7HkqF6yKRH9vm33rwBt7rPYrpQvS1nCvlIy2pICbKta+ZjWngYLNn4cCK4nyZkjS/w== + dependencies: + chalk "^4.0.0" + diff-sequences "^27.4.0" + jest-get-type "^27.4.0" + pretty-format "^27.4.6" + jest-docblock@^27.4.0: version "27.4.0" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.4.0.tgz#06c78035ca93cbbb84faf8fce64deae79a59f69f" @@ -1993,40 +1990,40 @@ jest-docblock@^27.4.0: dependencies: detect-newline "^3.0.0" -jest-each@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.4.2.tgz#19364c82a692d0d26557642098d1f4619c9ee7d3" - integrity sha512-53V2MNyW28CTruB3lXaHNk6PkiIFuzdOC9gR3C6j8YE/ACfrPnz+slB0s17AgU1TtxNzLuHyvNlLJ+8QYw9nBg== +jest-each@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.4.6.tgz#e7e8561be61d8cc6dbf04296688747ab186c40ff" + integrity sha512-n6QDq8y2Hsmn22tRkgAk+z6MCX7MeVlAzxmZDshfS2jLcaBlyhpF3tZSJLR+kXmh23GEvS0ojMR8i6ZeRvpQcA== dependencies: "@jest/types" "^27.4.2" chalk "^4.0.0" jest-get-type "^27.4.0" jest-util "^27.4.2" - pretty-format "^27.4.2" + pretty-format "^27.4.6" -jest-environment-jsdom@^27.4.4: - version "27.4.4" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.4.4.tgz#94f738e99514d7a880e8ed8e03e3a321d43b49db" - integrity sha512-cYR3ndNfHBqQgFvS1RL7dNqSvD//K56j/q1s2ygNHcfTCAp12zfIromO1w3COmXrxS8hWAh7+CmZmGCIoqGcGA== +jest-environment-jsdom@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.4.6.tgz#c23a394eb445b33621dfae9c09e4c8021dea7b36" + integrity sha512-o3dx5p/kHPbUlRvSNjypEcEtgs6LmvESMzgRFQE6c+Prwl2JLA4RZ7qAnxc5VM8kutsGRTB15jXeeSbJsKN9iA== dependencies: - "@jest/environment" "^27.4.4" - "@jest/fake-timers" "^27.4.2" + "@jest/environment" "^27.4.6" + "@jest/fake-timers" "^27.4.6" "@jest/types" "^27.4.2" "@types/node" "*" - jest-mock "^27.4.2" + jest-mock "^27.4.6" jest-util "^27.4.2" jsdom "^16.6.0" -jest-environment-node@^27.4.4: - version "27.4.4" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.4.4.tgz#42fe5e3b224cb69b99811ebf6f5eaa5a59618514" - integrity sha512-D+v3lbJ2GjQTQR23TK0kY3vFVmSeea05giInI41HHOaJnAwOnmUHTZgUaZL+VxUB43pIzoa7PMwWtCVlIUoVoA== +jest-environment-node@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.4.6.tgz#ee8cd4ef458a0ef09d087c8cd52ca5856df90242" + integrity sha512-yfHlZ9m+kzTKZV0hVfhVu6GuDxKAYeFHrfulmy7Jxwsq4V7+ZK7f+c0XP/tbVDMQW7E4neG2u147hFkuVz0MlQ== dependencies: - "@jest/environment" "^27.4.4" - "@jest/fake-timers" "^27.4.2" + "@jest/environment" "^27.4.6" + "@jest/fake-timers" "^27.4.6" "@jest/types" "^27.4.2" "@types/node" "*" - jest-mock "^27.4.2" + jest-mock "^27.4.6" jest-util "^27.4.2" jest-get-type@^27.4.0: @@ -2034,10 +2031,10 @@ jest-get-type@^27.4.0: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.4.0.tgz#7503d2663fffa431638337b3998d39c5e928e9b5" integrity sha512-tk9o+ld5TWq41DkK14L4wox4s2D9MtTpKaAVzXfr5CUKm5ZK2ExcaFE0qls2W71zE/6R2TxxrK9w2r6svAFDBQ== -jest-haste-map@^27.4.5: - version "27.4.5" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.4.5.tgz#c2921224a59223f91e03ec15703905978ef0cc1a" - integrity sha512-oJm1b5qhhPs78K24EDGifWS0dELYxnoBiDhatT/FThgB9yxqUm5F6li3Pv+Q+apMBmmPNzOBnZ7ZxWMB1Leq1Q== +jest-haste-map@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.4.6.tgz#c60b5233a34ca0520f325b7e2cc0a0140ad0862a" + integrity sha512-0tNpgxg7BKurZeFkIOvGCkbmOHbLFf4LUQOxrQSMjvrQaQe3l6E8x6jYC1NuWkGo5WDdbr8FEzUxV2+LWNawKQ== dependencies: "@jest/types" "^27.4.2" "@types/graceful-fs" "^4.1.2" @@ -2048,58 +2045,57 @@ jest-haste-map@^27.4.5: jest-regex-util "^27.4.0" jest-serializer "^27.4.0" jest-util "^27.4.2" - jest-worker "^27.4.5" + jest-worker "^27.4.6" micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.4.5: - version "27.4.5" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.4.5.tgz#ff79d11561679ff6c89715b0cd6b1e8c0dfbc6dc" - integrity sha512-oUnvwhJDj2LhOiUB1kdnJjkx8C5PwgUZQb9urF77mELH9DGR4e2GqpWQKBOYXWs5+uTN9BGDqRz3Aeg5Wts7aw== +jest-jasmine2@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.4.6.tgz#109e8bc036cb455950ae28a018f983f2abe50127" + integrity sha512-uAGNXF644I/whzhsf7/qf74gqy9OuhvJ0XYp8SDecX2ooGeaPnmJMjXjKt0mqh1Rl5dtRGxJgNrHlBQIBfS5Nw== dependencies: - "@babel/traverse" "^7.1.0" - "@jest/environment" "^27.4.4" + "@jest/environment" "^27.4.6" "@jest/source-map" "^27.4.0" - "@jest/test-result" "^27.4.2" + "@jest/test-result" "^27.4.6" "@jest/types" "^27.4.2" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^27.4.2" + expect "^27.4.6" is-generator-fn "^2.0.0" - jest-each "^27.4.2" - jest-matcher-utils "^27.4.2" - jest-message-util "^27.4.2" - jest-runtime "^27.4.5" - jest-snapshot "^27.4.5" + jest-each "^27.4.6" + jest-matcher-utils "^27.4.6" + jest-message-util "^27.4.6" + jest-runtime "^27.4.6" + jest-snapshot "^27.4.6" jest-util "^27.4.2" - pretty-format "^27.4.2" + pretty-format "^27.4.6" throat "^6.0.1" -jest-leak-detector@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.4.2.tgz#7fc3120893a7a911c553f3f2bdff9faa4454abbb" - integrity sha512-ml0KvFYZllzPBJWDei3mDzUhyp/M4ubKebX++fPaudpe8OsxUE+m+P6ciVLboQsrzOCWDjE20/eXew9QMx/VGw== +jest-leak-detector@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.4.6.tgz#ed9bc3ce514b4c582637088d9faf58a33bd59bf4" + integrity sha512-kkaGixDf9R7CjHm2pOzfTxZTQQQ2gHTIWKY/JZSiYTc90bZp8kSZnUMS3uLAfwTZwc0tcMRoEX74e14LG1WapA== dependencies: jest-get-type "^27.4.0" - pretty-format "^27.4.2" + pretty-format "^27.4.6" -jest-matcher-utils@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.4.2.tgz#d17c5038607978a255e0a9a5c32c24e984b6c60b" - integrity sha512-jyP28er3RRtMv+fmYC/PKG8wvAmfGcSNproVTW2Y0P/OY7/hWUOmsPfxN1jOhM+0u2xU984u2yEagGivz9OBGQ== +jest-matcher-utils@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.4.6.tgz#53ca7f7b58170638590e946f5363b988775509b8" + integrity sha512-XD4PKT3Wn1LQnRAq7ZsTI0VRuEc9OrCPFiO1XL7bftTGmfNF0DcEwMHRgqiu7NGf8ZoZDREpGrCniDkjt79WbA== dependencies: chalk "^4.0.0" - jest-diff "^27.4.2" + jest-diff "^27.4.6" jest-get-type "^27.4.0" - pretty-format "^27.4.2" + pretty-format "^27.4.6" -jest-message-util@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.4.2.tgz#07f3f1bf207d69cf798ce830cc57f1a849f99388" - integrity sha512-OMRqRNd9E0DkBLZpFtZkAGYOXl6ZpoMtQJWTAREJKDOFa0M6ptB7L67tp+cszMBkvSgKOhNtQp2Vbcz3ZZKo/w== +jest-message-util@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.4.6.tgz#9fdde41a33820ded3127465e1a5896061524da31" + integrity sha512-0p5szriFU0U74czRSFjH6RyS7UYIAkn/ntwMuOwTGWrQIOh5NzXXrq72LOqIkJKKvFbPq+byZKuBz78fjBERBA== dependencies: "@babel/code-frame" "^7.12.13" "@jest/types" "^27.4.2" @@ -2107,14 +2103,14 @@ jest-message-util@^27.4.2: chalk "^4.0.0" graceful-fs "^4.2.4" micromatch "^4.0.4" - pretty-format "^27.4.2" + pretty-format "^27.4.6" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.4.2.tgz#184ff197a25491bfe4570c286daa5d62eb760b88" - integrity sha512-PDDPuyhoukk20JrQKeofK12hqtSka7mWH0QQuxSNgrdiPsrnYYLS6wbzu/HDlxZRzji5ylLRULeuI/vmZZDrYA== +jest-mock@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.4.6.tgz#77d1ba87fbd33ccb8ef1f061697e7341b7635195" + integrity sha512-kvojdYRkst8iVSZ1EJ+vc1RRD9llueBjKzXzeCytH3dMM7zvPV/ULcfI2nr0v0VUgm3Bjt3hBCQvOeaBz+ZTHw== dependencies: "@jest/types" "^27.4.2" "@types/node" "*" @@ -2129,40 +2125,40 @@ jest-regex-util@^27.4.0: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.4.0.tgz#e4c45b52653128843d07ad94aec34393ea14fbca" integrity sha512-WeCpMpNnqJYMQoOjm1nTtsgbR4XHAk1u00qDoNBQoykM280+/TmgA5Qh5giC1ecy6a5d4hbSsHzpBtu5yvlbEg== -jest-resolve-dependencies@^27.4.5: - version "27.4.5" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.4.5.tgz#9398af854bdb12d6a9e5a8a536ee401f889a3ecf" - integrity sha512-elEVvkvRK51y037NshtEkEnukMBWvlPzZHiL847OrIljJ8yIsujD2GXRPqDXC4rEVKbcdsy7W0FxoZb4WmEs7w== +jest-resolve-dependencies@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.4.6.tgz#fc50ee56a67d2c2183063f6a500cc4042b5e2327" + integrity sha512-W85uJZcFXEVZ7+MZqIPCscdjuctruNGXUZ3OHSXOfXR9ITgbUKeHj+uGcies+0SsvI5GtUfTw4dY7u9qjTvQOw== dependencies: "@jest/types" "^27.4.2" jest-regex-util "^27.4.0" - jest-snapshot "^27.4.5" + jest-snapshot "^27.4.6" -jest-resolve@^27.4.5: - version "27.4.5" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.4.5.tgz#8dc44f5065fb8d58944c20f932cb7b9fe9760cca" - integrity sha512-xU3z1BuOz/hUhVUL+918KqUgK+skqOuUsAi7A+iwoUldK6/+PW+utK8l8cxIWT9AW7IAhGNXjSAh1UYmjULZZw== +jest-resolve@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.4.6.tgz#2ec3110655e86d5bfcfa992e404e22f96b0b5977" + integrity sha512-SFfITVApqtirbITKFAO7jOVN45UgFzcRdQanOFzjnbd+CACDoyeX7206JyU92l4cRr73+Qy/TlW51+4vHGt+zw== dependencies: "@jest/types" "^27.4.2" chalk "^4.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.4.5" + jest-haste-map "^27.4.6" jest-pnp-resolver "^1.2.2" jest-util "^27.4.2" - jest-validate "^27.4.2" + jest-validate "^27.4.6" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^27.4.5: - version "27.4.5" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.4.5.tgz#daba2ba71c8f34137dc7ac45616add35370a681e" - integrity sha512-/irauncTfmY1WkTaRQGRWcyQLzK1g98GYG/8QvIPviHgO1Fqz1JYeEIsSfF+9mc/UTA6S+IIHFgKyvUrtiBIZg== +jest-runner@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.4.6.tgz#1d390d276ec417e9b4d0d081783584cbc3e24773" + integrity sha512-IDeFt2SG4DzqalYBZRgbbPmpwV3X0DcntjezPBERvnhwKGWTW7C5pbbA5lVkmvgteeNfdd/23gwqv3aiilpYPg== dependencies: - "@jest/console" "^27.4.2" - "@jest/environment" "^27.4.4" - "@jest/test-result" "^27.4.2" - "@jest/transform" "^27.4.5" + "@jest/console" "^27.4.6" + "@jest/environment" "^27.4.6" + "@jest/test-result" "^27.4.6" + "@jest/transform" "^27.4.6" "@jest/types" "^27.4.2" "@types/node" "*" chalk "^4.0.0" @@ -2170,49 +2166,45 @@ jest-runner@^27.4.5: exit "^0.1.2" graceful-fs "^4.2.4" jest-docblock "^27.4.0" - jest-environment-jsdom "^27.4.4" - jest-environment-node "^27.4.4" - jest-haste-map "^27.4.5" - jest-leak-detector "^27.4.2" - jest-message-util "^27.4.2" - jest-resolve "^27.4.5" - jest-runtime "^27.4.5" + jest-environment-jsdom "^27.4.6" + jest-environment-node "^27.4.6" + jest-haste-map "^27.4.6" + jest-leak-detector "^27.4.6" + jest-message-util "^27.4.6" + jest-resolve "^27.4.6" + jest-runtime "^27.4.6" jest-util "^27.4.2" - jest-worker "^27.4.5" + jest-worker "^27.4.6" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.4.5: - version "27.4.5" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.4.5.tgz#97703ad2a1799d4f50ab59049bd21a9ceaed2813" - integrity sha512-CIYqwuJQXHQtPd/idgrx4zgJ6iCb6uBjQq1RSAGQrw2S8XifDmoM1Ot8NRd80ooAm+ZNdHVwsktIMGlA1F1FAQ== +jest-runtime@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.4.6.tgz#83ae923818e3ea04463b22f3597f017bb5a1cffa" + integrity sha512-eXYeoR/MbIpVDrjqy5d6cGCFOYBFFDeKaNWqTp0h6E74dK0zLHzASQXJpl5a2/40euBmKnprNLJ0Kh0LCndnWQ== dependencies: - "@jest/console" "^27.4.2" - "@jest/environment" "^27.4.4" - "@jest/globals" "^27.4.4" + "@jest/environment" "^27.4.6" + "@jest/fake-timers" "^27.4.6" + "@jest/globals" "^27.4.6" "@jest/source-map" "^27.4.0" - "@jest/test-result" "^27.4.2" - "@jest/transform" "^27.4.5" + "@jest/test-result" "^27.4.6" + "@jest/transform" "^27.4.6" "@jest/types" "^27.4.2" - "@types/yargs" "^16.0.0" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" execa "^5.0.0" - exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-haste-map "^27.4.5" - jest-message-util "^27.4.2" - jest-mock "^27.4.2" + jest-haste-map "^27.4.6" + jest-message-util "^27.4.6" + jest-mock "^27.4.6" jest-regex-util "^27.4.0" - jest-resolve "^27.4.5" - jest-snapshot "^27.4.5" + jest-resolve "^27.4.6" + jest-snapshot "^27.4.6" jest-util "^27.4.2" - jest-validate "^27.4.2" slash "^3.0.0" strip-bom "^4.0.0" - yargs "^16.2.0" jest-serializer@^27.4.0: version "27.4.0" @@ -2222,34 +2214,32 @@ jest-serializer@^27.4.0: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^27.4.5: - version "27.4.5" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.4.5.tgz#2ea909b20aac0fe62504bc161331f730b8a7ecc7" - integrity sha512-eCi/iM1YJFrJWiT9de4+RpWWWBqsHiYxFG9V9o/n0WXs6GpW4lUt4FAHAgFPTLPqCUVzrMQmSmTZSgQzwqR7IQ== +jest-snapshot@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.4.6.tgz#e2a3b4fff8bdce3033f2373b2e525d8b6871f616" + integrity sha512-fafUCDLQfzuNP9IRcEqaFAMzEe7u5BF7mude51wyWv7VRex60WznZIC7DfKTgSIlJa8aFzYmXclmN328aqSDmQ== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" - "@babel/parser" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/transform" "^27.4.5" + "@jest/transform" "^27.4.6" "@jest/types" "^27.4.2" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.4.2" + expect "^27.4.6" graceful-fs "^4.2.4" - jest-diff "^27.4.2" + jest-diff "^27.4.6" jest-get-type "^27.4.0" - jest-haste-map "^27.4.5" - jest-matcher-utils "^27.4.2" - jest-message-util "^27.4.2" - jest-resolve "^27.4.5" + jest-haste-map "^27.4.6" + jest-matcher-utils "^27.4.6" + jest-message-util "^27.4.6" jest-util "^27.4.2" natural-compare "^1.4.0" - pretty-format "^27.4.2" + pretty-format "^27.4.6" semver "^7.3.2" jest-util@^27.0.0, jest-util@^27.4.2: @@ -2264,24 +2254,24 @@ jest-util@^27.0.0, jest-util@^27.4.2: graceful-fs "^4.2.4" picomatch "^2.2.3" -jest-validate@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.4.2.tgz#eecfcc1b1c9429aa007da08a2bae4e32a81bbbc3" - integrity sha512-hWYsSUej+Fs8ZhOm5vhWzwSLmVaPAxRy+Mr+z5MzeaHm9AxUpXdoVMEW4R86y5gOobVfBsMFLk4Rb+QkiEpx1A== +jest-validate@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.4.6.tgz#efc000acc4697b6cf4fa68c7f3f324c92d0c4f1f" + integrity sha512-872mEmCPVlBqbA5dToC57vA3yJaMRfIdpCoD3cyHWJOMx+SJwLNw0I71EkWs41oza/Er9Zno9XuTkRYCPDUJXQ== dependencies: "@jest/types" "^27.4.2" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^27.4.0" leven "^3.1.0" - pretty-format "^27.4.2" + pretty-format "^27.4.6" -jest-watcher@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.4.2.tgz#c9037edfd80354c9fe90de4b6f8b6e2b8e736744" - integrity sha512-NJvMVyyBeXfDezhWzUOCOYZrUmkSCiatpjpm+nFUid74OZEHk6aMLrZAukIiFDwdbqp6mTM6Ui1w4oc+8EobQg== +jest-watcher@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.4.6.tgz#673679ebeffdd3f94338c24f399b85efc932272d" + integrity sha512-yKQ20OMBiCDigbD0quhQKLkBO+ObGN79MO4nT7YaCuQ5SM+dkBNWE8cZX0FjU6czwMvWw6StWbe+Wv4jJPJ+fw== dependencies: - "@jest/test-result" "^27.4.2" + "@jest/test-result" "^27.4.6" "@jest/types" "^27.4.2" "@types/node" "*" ansi-escapes "^4.2.1" @@ -2289,23 +2279,23 @@ jest-watcher@^27.4.2: jest-util "^27.4.2" string-length "^4.0.1" -jest-worker@^27.4.5: - version "27.4.5" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.4.5.tgz#d696e3e46ae0f24cff3fa7195ffba22889262242" - integrity sha512-f2s8kEdy15cv9r7q4KkzGXvlY0JTcmCbMHZBfSQDwW77REr45IDWwd0lksDFeVHH2jJ5pqb90T77XscrjeGzzg== +jest-worker@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.4.6.tgz#5d2d93db419566cb680752ca0792780e71b3273e" + integrity sha512-gHWJF/6Xi5CTG5QCvROr6GcmpIqNYpDJyc8A1h/DyXqH1tD6SnRCM0d3U5msV31D2LB/U+E0M+W4oyvKV44oNw== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^27.0.1: - version "27.4.5" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.4.5.tgz#66e45acba44137fac26be9d3cc5bb031e136dc0f" - integrity sha512-uT5MiVN3Jppt314kidCk47MYIRilJjA/l2mxwiuzzxGUeJIvA8/pDaJOAX5KWvjAo7SCydcW0/4WEtgbLMiJkg== + version "27.4.6" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.4.6.tgz#5557fad2ab1d2b709e86d2332ea2552dc021a4d9" + integrity sha512-BRbYo0MeujnnJIo206WRsfsr3gIMraR+LO9vZJsdG2/298aKYQJbS3wHG0KN3Z7SWIcf6JaSMM4E8X6cIdG9AA== dependencies: - "@jest/core" "^27.4.5" + "@jest/core" "^27.4.6" import-local "^3.0.2" - jest-cli "^27.4.5" + jest-cli "^27.4.6" js-tokens@^4.0.0: version "4.0.0" @@ -2534,11 +2524,6 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= -node-modules-regexp@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" - integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= - node-releases@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.1.tgz#3d1d395f204f1f2f29a54358b9fb678765ad2fc5" @@ -2665,12 +2650,10 @@ picomatch@^2.0.4, picomatch@^2.2.3: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== -pirates@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87" - integrity sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA== - dependencies: - node-modules-regexp "^1.0.0" +pirates@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.4.tgz#07df81e61028e402735cdd49db701e4885b4e6e6" + integrity sha512-ZIrVPH+A52Dw84R0L3/VS9Op04PuQ2SEoJL6bkshmiTic/HldyW9Tf7oH5mhJZBK7NmDx27vSMrYEXPXclpDKw== pkg-dir@^4.2.0: version "4.2.0" @@ -2704,6 +2687,15 @@ pretty-format@^27.0.0, pretty-format@^27.4.2: ansi-styles "^5.0.0" react-is "^17.0.1" +pretty-format@^27.4.6: + version "27.4.6" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.4.6.tgz#1b784d2f53c68db31797b2348fa39b49e31846b7" + integrity sha512-NblstegA1y/RJW2VyML+3LlpFjzx62cUrtBIKIWDXEDkjNeleA7Od7nrzcs/VLQvAeV4CgSYhrN39DRN88Qi/g== + dependencies: + ansi-regex "^5.0.1" + ansi-styles "^5.0.0" + react-is "^17.0.1" + pretty-quick@^3.1.2: version "3.1.3" resolved "https://registry.yarnpkg.com/pretty-quick/-/pretty-quick-3.1.3.tgz#15281108c0ddf446675157ca40240099157b638e" From 3d1c44528a0c17c985c237bc0b68b03f1704f20c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Jan 2022 12:01:48 +0000 Subject: [PATCH 479/785] Bump jest from 27.4.6 to 27.4.7 Bumps [jest](https://github.com/facebook/jest) from 27.4.6 to 27.4.7. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v27.4.6...v27.4.7) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 221 ++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 200 insertions(+), 21 deletions(-) diff --git a/yarn.lock b/yarn.lock index 74a590c5..414885f9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9,7 +9,14 @@ dependencies: "@babel/highlight" "^7.16.0" -"@babel/compat-data@^7.16.0": +"@babel/code-frame@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" + integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg== + dependencies: + "@babel/highlight" "^7.16.7" + +"@babel/compat-data@^7.16.0", "@babel/compat-data@^7.16.4": version "7.16.4" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.16.4.tgz#081d6bbc336ec5c2435c6346b2ae1fb98b5ac68e" integrity sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q== @@ -35,6 +42,27 @@ semver "^6.3.0" source-map "^0.5.0" +"@babel/core@^7.8.0": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.16.7.tgz#db990f931f6d40cb9b87a0dc7d2adc749f1dcbcf" + integrity sha512-aeLaqcqThRNZYmbMqtulsetOQZ/5gbR/dWruUCJcpas4Qoyy+QeagfDsPdMrqwsPRDNxJvBlRiZxxX7THO7qtA== + dependencies: + "@babel/code-frame" "^7.16.7" + "@babel/generator" "^7.16.7" + "@babel/helper-compilation-targets" "^7.16.7" + "@babel/helper-module-transforms" "^7.16.7" + "@babel/helpers" "^7.16.7" + "@babel/parser" "^7.16.7" + "@babel/template" "^7.16.7" + "@babel/traverse" "^7.16.7" + "@babel/types" "^7.16.7" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.1.2" + semver "^6.3.0" + source-map "^0.5.0" + "@babel/generator@^7.16.0", "@babel/generator@^7.7.2": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.16.0.tgz#d40f3d1d5075e62d3500bccb67f3daa8a95265b2" @@ -44,6 +72,15 @@ jsesc "^2.5.1" source-map "^0.5.0" +"@babel/generator@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.16.7.tgz#b42bf46a3079fa65e1544135f32e7958f048adbb" + integrity sha512-/ST3Sg8MLGY5HVYmrjOgL60ENux/HfO/CsUh7y4MalThufhE/Ff/6EibFDHi4jiDCaWfJKoqbE6oTh21c5hrRg== + dependencies: + "@babel/types" "^7.16.7" + jsesc "^2.5.1" + source-map "^0.5.0" + "@babel/helper-compilation-targets@^7.16.0": version "7.16.3" resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.3.tgz#5b480cd13f68363df6ec4dc8ac8e2da11363cbf0" @@ -54,6 +91,23 @@ browserslist "^4.17.5" semver "^6.3.0" +"@babel/helper-compilation-targets@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz#06e66c5f299601e6c7da350049315e83209d551b" + integrity sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA== + dependencies: + "@babel/compat-data" "^7.16.4" + "@babel/helper-validator-option" "^7.16.7" + browserslist "^4.17.5" + semver "^6.3.0" + +"@babel/helper-environment-visitor@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz#ff484094a839bde9d89cd63cba017d7aae80ecd7" + integrity sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag== + dependencies: + "@babel/types" "^7.16.7" + "@babel/helper-function-name@^7.16.0": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.16.0.tgz#b7dd0797d00bbfee4f07e9c4ea5b0e30c8bb1481" @@ -63,6 +117,15 @@ "@babel/template" "^7.16.0" "@babel/types" "^7.16.0" +"@babel/helper-function-name@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz#f1ec51551fb1c8956bc8dd95f38523b6cf375f8f" + integrity sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA== + dependencies: + "@babel/helper-get-function-arity" "^7.16.7" + "@babel/template" "^7.16.7" + "@babel/types" "^7.16.7" + "@babel/helper-get-function-arity@^7.16.0": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.0.tgz#0088c7486b29a9cb5d948b1a1de46db66e089cfa" @@ -70,6 +133,13 @@ dependencies: "@babel/types" "^7.16.0" +"@babel/helper-get-function-arity@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz#ea08ac753117a669f1508ba06ebcc49156387419" + integrity sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw== + dependencies: + "@babel/types" "^7.16.7" + "@babel/helper-hoist-variables@^7.16.0": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.0.tgz#4c9023c2f1def7e28ff46fc1dbcd36a39beaa81a" @@ -77,6 +147,13 @@ dependencies: "@babel/types" "^7.16.0" +"@babel/helper-hoist-variables@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz#86bcb19a77a509c7b77d0e22323ef588fa58c246" + integrity sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg== + dependencies: + "@babel/types" "^7.16.7" + "@babel/helper-member-expression-to-functions@^7.16.0": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.0.tgz#29287040efd197c77636ef75188e81da8bccd5a4" @@ -91,6 +168,13 @@ dependencies: "@babel/types" "^7.16.0" +"@babel/helper-module-imports@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz#25612a8091a999704461c8a222d0efec5d091437" + integrity sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg== + dependencies: + "@babel/types" "^7.16.7" + "@babel/helper-module-transforms@^7.16.0": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.16.0.tgz#1c82a8dd4cb34577502ebd2909699b194c3e9bb5" @@ -105,6 +189,20 @@ "@babel/traverse" "^7.16.0" "@babel/types" "^7.16.0" +"@babel/helper-module-transforms@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz#7665faeb721a01ca5327ddc6bba15a5cb34b6a41" + integrity sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng== + dependencies: + "@babel/helper-environment-visitor" "^7.16.7" + "@babel/helper-module-imports" "^7.16.7" + "@babel/helper-simple-access" "^7.16.7" + "@babel/helper-split-export-declaration" "^7.16.7" + "@babel/helper-validator-identifier" "^7.16.7" + "@babel/template" "^7.16.7" + "@babel/traverse" "^7.16.7" + "@babel/types" "^7.16.7" + "@babel/helper-optimise-call-expression@^7.16.0": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.0.tgz#cecdb145d70c54096b1564f8e9f10cd7d193b338" @@ -134,6 +232,13 @@ dependencies: "@babel/types" "^7.16.0" +"@babel/helper-simple-access@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz#d656654b9ea08dbb9659b69d61063ccd343ff0f7" + integrity sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g== + dependencies: + "@babel/types" "^7.16.7" + "@babel/helper-split-export-declaration@^7.16.0": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.0.tgz#29672f43663e936df370aaeb22beddb3baec7438" @@ -141,16 +246,33 @@ dependencies: "@babel/types" "^7.16.0" +"@babel/helper-split-export-declaration@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz#0b648c0c42da9d3920d85ad585f2778620b8726b" + integrity sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw== + dependencies: + "@babel/types" "^7.16.7" + "@babel/helper-validator-identifier@^7.15.7": version "7.15.7" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz#220df993bfe904a4a6b02ab4f3385a5ebf6e2389" integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w== +"@babel/helper-validator-identifier@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz#e8c602438c4a8195751243da9031d1607d247cad" + integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw== + "@babel/helper-validator-option@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow== +"@babel/helper-validator-option@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz#b203ce62ce5fe153899b617c08957de860de4d23" + integrity sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ== + "@babel/helpers@^7.16.0": version "7.16.3" resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.16.3.tgz#27fc64f40b996e7074dc73128c3e5c3e7f55c43c" @@ -160,6 +282,15 @@ "@babel/traverse" "^7.16.3" "@babel/types" "^7.16.0" +"@babel/helpers@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.16.7.tgz#7e3504d708d50344112767c3542fc5e357fffefc" + integrity sha512-9ZDoqtfY7AuEOt3cxchfii6C7GDyyMBffktR5B2jvWv8u2+efwvpnVKXMWzNehqy68tKgAfSwfdw/lWpthS2bw== + dependencies: + "@babel/template" "^7.16.7" + "@babel/traverse" "^7.16.7" + "@babel/types" "^7.16.7" + "@babel/highlight@^7.16.0": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.0.tgz#6ceb32b2ca4b8f5f361fb7fd821e3fddf4a1725a" @@ -169,11 +300,25 @@ chalk "^2.0.0" js-tokens "^4.0.0" +"@babel/highlight@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.7.tgz#81a01d7d675046f0d96f82450d9d9578bdfd6b0b" + integrity sha512-aKpPMfLvGO3Q97V0qhw/V2SWNWlwfJknuwAunU7wZLSfrM4xTBvg7E5opUVi1kJTBKihE38CPg4nBiqX83PWYw== + dependencies: + "@babel/helper-validator-identifier" "^7.16.7" + chalk "^2.0.0" + js-tokens "^4.0.0" + "@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.0", "@babel/parser@^7.16.3": version "7.16.4" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.4.tgz#d5f92f57cf2c74ffe9b37981c0e72fee7311372e" integrity sha512-6V0qdPUaiVHH3RtZeLIsc+6pDhbYzHR8ogA8w+f+Wc77DuXto19g2QUwveINoS34Uw+W8/hQDGJCx+i4n7xcng== +"@babel/parser@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.7.tgz#d372dda9c89fcec340a82630a9f533f2fe15877e" + integrity sha512-sR4eaSrnM7BV7QPzGfEX5paG/6wrZM3I0HDzfIAK06ESvo9oy3xBuVBxE3MbQaKNhvg8g/ixjMWo2CGpzpHsDA== + "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" @@ -274,6 +419,15 @@ "@babel/parser" "^7.16.0" "@babel/types" "^7.16.0" +"@babel/template@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.7.tgz#8d126c8701fde4d66b264b3eba3d96f07666d155" + integrity sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w== + dependencies: + "@babel/code-frame" "^7.16.7" + "@babel/parser" "^7.16.7" + "@babel/types" "^7.16.7" + "@babel/traverse@^7.16.0", "@babel/traverse@^7.16.3", "@babel/traverse@^7.7.2": version "7.16.3" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.3.tgz#f63e8a938cc1b780f66d9ed3c54f532ca2d14787" @@ -289,6 +443,22 @@ debug "^4.1.0" globals "^11.1.0" +"@babel/traverse@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.7.tgz#dac01236a72c2560073658dd1a285fe4e0865d76" + integrity sha512-8KWJPIb8c2VvY8AJrydh6+fVRo2ODx1wYBU2398xJVq0JomuLBZmVQzLPBblJgHIGYG4znCpUZUZ0Pt2vdmVYQ== + dependencies: + "@babel/code-frame" "^7.16.7" + "@babel/generator" "^7.16.7" + "@babel/helper-environment-visitor" "^7.16.7" + "@babel/helper-function-name" "^7.16.7" + "@babel/helper-hoist-variables" "^7.16.7" + "@babel/helper-split-export-declaration" "^7.16.7" + "@babel/parser" "^7.16.7" + "@babel/types" "^7.16.7" + debug "^4.1.0" + globals "^11.1.0" + "@babel/types@^7.0.0", "@babel/types@^7.16.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.16.0.tgz#db3b313804f96aadd0b776c4823e127ad67289ba" @@ -297,6 +467,14 @@ "@babel/helper-validator-identifier" "^7.15.7" to-fast-properties "^2.0.0" +"@babel/types@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.16.7.tgz#4ed19d51f840ed4bd5645be6ce40775fecf03159" + integrity sha512-E8HuV7FO9qLpx6OtoGfUQ2cjIYnbFwvZWYBS+87EwtdMvmUPJSwykpovFB+8insbpF0uJcpr8KMUi64XZntZcg== + dependencies: + "@babel/helper-validator-identifier" "^7.16.7" + to-fast-properties "^2.0.0" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -371,10 +549,10 @@ jest-util "^27.4.2" slash "^3.0.0" -"@jest/core@^27.4.6": - version "27.4.6" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.4.6.tgz#5cc4e714602324dc1561029224fd593e70ab4c7d" - integrity sha512-2XvkAguDxaSAg6+Rznq7VZeIs3eV4owk3dud0zL4FH0d8mX7whkAUnO9rb0keMGStazfekR1ec9Yf9BFt4m02Q== +"@jest/core@^27.4.7": + version "27.4.7" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.4.7.tgz#84eabdf42a25f1fa138272ed229bcf0a1b5e6913" + integrity sha512-n181PurSJkVMS+kClIFSX/LLvw9ExSb+4IMtD6YnfxZVerw9ANYtW0bPrm0MJu2pfe9SY9FJ9FtQ+MdZkrZwjg== dependencies: "@jest/console" "^27.4.6" "@jest/reporters" "^27.4.6" @@ -388,7 +566,7 @@ exit "^0.1.2" graceful-fs "^4.2.4" jest-changed-files "^27.4.2" - jest-config "^27.4.6" + jest-config "^27.4.7" jest-haste-map "^27.4.6" jest-message-util "^27.4.6" jest-regex-util "^27.4.0" @@ -1918,29 +2096,30 @@ jest-circus@^27.4.6: stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.4.6: - version "27.4.6" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.4.6.tgz#b81e053a753111bddf0782c1a1a86b9b910f5b86" - integrity sha512-SFfUC7jMHPGwsNSYBnJMNtjoSDrb34T+SEH5psDeGNVuTVov5Zi1RQpfJYwzpK2ex3OmnsNsiqLe3/SCc8S01Q== +jest-cli@^27.4.7: + version "27.4.7" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.4.7.tgz#d00e759e55d77b3bcfea0715f527c394ca314e5a" + integrity sha512-zREYhvjjqe1KsGV15mdnxjThKNDgza1fhDT+iUsXWLCq3sxe9w5xnvyctcYVT5PcdLSjv7Y5dCwTS3FCF1tiuw== dependencies: - "@jest/core" "^27.4.6" + "@jest/core" "^27.4.7" "@jest/test-result" "^27.4.6" "@jest/types" "^27.4.2" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.4.6" + jest-config "^27.4.7" jest-util "^27.4.2" jest-validate "^27.4.6" prompts "^2.0.1" yargs "^16.2.0" -jest-config@^27.4.6: - version "27.4.6" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.4.6.tgz#0970f6c92702ca7878120cea638791d00a3996ee" - integrity sha512-3SGoFbaanQVg7MK5w/z8LnCMF6aZc2I7EQxS4s8fTfZpVYnWNDN34llcaViToIB62DFMhwHWTPX9X2O+4aDL1g== +jest-config@^27.4.7: + version "27.4.7" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.4.7.tgz#4f084b2acbd172c8b43aa4cdffe75d89378d3972" + integrity sha512-xz/o/KJJEedHMrIY9v2ParIoYSrSVY6IVeE4z5Z3i101GoA5XgfbJz+1C8EYPsv7u7f39dS8F9v46BHDhn0vlw== dependencies: + "@babel/core" "^7.8.0" "@jest/test-sequencer" "^27.4.6" "@jest/types" "^27.4.2" babel-jest "^27.4.6" @@ -2289,13 +2468,13 @@ jest-worker@^27.4.6: supports-color "^8.0.0" jest@^27.0.1: - version "27.4.6" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.4.6.tgz#5557fad2ab1d2b709e86d2332ea2552dc021a4d9" - integrity sha512-BRbYo0MeujnnJIo206WRsfsr3gIMraR+LO9vZJsdG2/298aKYQJbS3wHG0KN3Z7SWIcf6JaSMM4E8X6cIdG9AA== + version "27.4.7" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.4.7.tgz#87f74b9026a1592f2da05b4d258e57505f28eca4" + integrity sha512-8heYvsx7nV/m8m24Vk26Y87g73Ba6ueUd0MWed/NXMhSZIm62U/llVbS0PJe1SHunbyXjJ/BqG1z9bFjGUIvTg== dependencies: - "@jest/core" "^27.4.6" + "@jest/core" "^27.4.7" import-local "^3.0.2" - jest-cli "^27.4.6" + jest-cli "^27.4.7" js-tokens@^4.0.0: version "4.0.0" From 5697985ff5e62a78236d44c64763d93488f3cd45 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Jan 2022 12:01:53 +0000 Subject: [PATCH 480/785] Bump @typescript-eslint/eslint-plugin from 5.9.0 to 5.9.1 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.9.0 to 5.9.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.9.1/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 70 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 52 insertions(+), 18 deletions(-) diff --git a/yarn.lock b/yarn.lock index 414885f9..e559f0c3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -871,13 +871,13 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.4.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.9.0.tgz#382182d5cb062f52aac54434cfc47c28898c8006" - integrity sha512-qT4lr2jysDQBQOPsCCvpPUZHjbABoTJW8V9ZzIYKHMfppJtpdtzszDYsldwhFxlhvrp7aCHeXD1Lb9M1zhwWwQ== + version "5.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.9.1.tgz#e5a86d7e1f9dc0b3df1e6d94feaf20dd838d066c" + integrity sha512-Xv9tkFlyD4MQGpJgTo6wqDqGvHIRmRgah/2Sjz1PUnJTawjHWIwBivUE9x0QtU2WVii9baYgavo/bHjrZJkqTw== dependencies: - "@typescript-eslint/experimental-utils" "5.9.0" - "@typescript-eslint/scope-manager" "5.9.0" - "@typescript-eslint/type-utils" "5.9.0" + "@typescript-eslint/experimental-utils" "5.9.1" + "@typescript-eslint/scope-manager" "5.9.1" + "@typescript-eslint/type-utils" "5.9.1" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -885,15 +885,15 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/experimental-utils@5.9.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.9.0.tgz#652762d37d6565ef07af285021b8347b6c79a827" - integrity sha512-ZnLVjBrf26dn7ElyaSKa6uDhqwvAi4jBBmHK1VxuFGPRAxhdi18ubQYSGA7SRiFiES3q9JiBOBHEBStOFkwD2g== +"@typescript-eslint/experimental-utils@5.9.1": + version "5.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.9.1.tgz#8c407c4dd5ffe522329df6e4c9c2b52206d5f7f1" + integrity sha512-cb1Njyss0mLL9kLXgS/eEY53SZQ9sT519wpX3i+U457l2UXRDuo87hgKfgRazmu9/tQb0x2sr3Y0yrU+Zz0y+w== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.9.0" - "@typescript-eslint/types" "5.9.0" - "@typescript-eslint/typescript-estree" "5.9.0" + "@typescript-eslint/scope-manager" "5.9.1" + "@typescript-eslint/types" "5.9.1" + "@typescript-eslint/typescript-estree" "5.9.1" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -915,12 +915,20 @@ "@typescript-eslint/types" "5.9.0" "@typescript-eslint/visitor-keys" "5.9.0" -"@typescript-eslint/type-utils@5.9.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.9.0.tgz#fd5963ead04bc9b7af9c3a8e534d8d39f1ce5f93" - integrity sha512-uVCb9dJXpBrK1071ri5aEW7ZHdDHAiqEjYznF3HSSvAJXyrkxGOw2Ejibz/q6BXdT8lea8CMI0CzKNFTNI6TEQ== +"@typescript-eslint/scope-manager@5.9.1": + version "5.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.9.1.tgz#6c27be89f1a9409f284d95dfa08ee3400166fe69" + integrity sha512-8BwvWkho3B/UOtzRyW07ffJXPaLSUKFBjpq8aqsRvu6HdEuzCY57+ffT7QoV4QXJXWSU1+7g3wE4AlgImmQ9pQ== dependencies: - "@typescript-eslint/experimental-utils" "5.9.0" + "@typescript-eslint/types" "5.9.1" + "@typescript-eslint/visitor-keys" "5.9.1" + +"@typescript-eslint/type-utils@5.9.1": + version "5.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.9.1.tgz#c6832ffe655b9b1fec642d36db1a262d721193de" + integrity sha512-tRSpdBnPRssjlUh35rE9ug5HrUvaB9ntREy7gPXXKwmIx61TNN7+l5YKgi1hMKxo5NvqZCfYhA5FvyuJG6X6vg== + dependencies: + "@typescript-eslint/experimental-utils" "5.9.1" debug "^4.3.2" tsutils "^3.21.0" @@ -929,6 +937,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.9.0.tgz#e5619803e39d24a03b3369506df196355736e1a3" integrity sha512-mWp6/b56Umo1rwyGCk8fPIzb9Migo8YOniBGPAQDNC6C52SeyNGN4gsVwQTAR+RS2L5xyajON4hOLwAGwPtUwg== +"@typescript-eslint/types@5.9.1": + version "5.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.9.1.tgz#1bef8f238a2fb32ebc6ff6d75020d9f47a1593c6" + integrity sha512-SsWegWudWpkZCwwYcKoDwuAjoZXnM1y2EbEerTHho19Hmm+bQ56QG4L4jrtCu0bI5STaRTvRTZmjprWlTw/5NQ== + "@typescript-eslint/typescript-estree@5.9.0": version "5.9.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.9.0.tgz#0e5c6f03f982931abbfbc3c1b9df5fbf92a3490f" @@ -942,6 +955,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.9.1": + version "5.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.9.1.tgz#d5b996f49476495070d2b8dd354861cf33c005d6" + integrity sha512-gL1sP6A/KG0HwrahVXI9fZyeVTxEYV//6PmcOn1tD0rw8VhUWYeZeuWHwwhnewnvEMcHjhnJLOBhA9rK4vmb8A== + dependencies: + "@typescript-eslint/types" "5.9.1" + "@typescript-eslint/visitor-keys" "5.9.1" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/visitor-keys@5.9.0": version "5.9.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.9.0.tgz#7585677732365e9d27f1878150fab3922784a1a6" @@ -950,6 +976,14 @@ "@typescript-eslint/types" "5.9.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.9.1": + version "5.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.9.1.tgz#f52206f38128dd4f675cf28070a41596eee985b7" + integrity sha512-Xh37pNz9e9ryW4TVdwiFzmr4hloty8cFj8GTWMXh3Z8swGwyQWeCcNgF0hm6t09iZd6eiZmIf4zHedQVP6TVtg== + dependencies: + "@typescript-eslint/types" "5.9.1" + 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 7f893ed001cc8f48b7b03bf06f13957aaa4ebbd9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Jan 2022 12:16:27 +0000 Subject: [PATCH 481/785] Bump @typescript-eslint/parser from 5.9.0 to 5.9.1 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.9.0 to 5.9.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.9.1/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 46 ++++++---------------------------------------- 1 file changed, 6 insertions(+), 40 deletions(-) diff --git a/yarn.lock b/yarn.lock index e559f0c3..52cbac67 100644 --- a/yarn.lock +++ b/yarn.lock @@ -898,23 +898,15 @@ eslint-utils "^3.0.0" "@typescript-eslint/parser@^5.4.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.9.0.tgz#fdbb08767a4caa6ca6ccfed5f9ffe9387f0c7d97" - integrity sha512-/6pOPz8yAxEt4PLzgbFRDpZmHnXCeZgPDrh/1DaVKOjvn/UPMlWhbx/gA96xRi2JxY1kBl2AmwVbyROUqys5xQ== + version "5.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.9.1.tgz#b114011010a87e17b3265ca715e16c76a9834cef" + integrity sha512-PLYO0AmwD6s6n0ZQB5kqPgfvh73p0+VqopQQLuNfi7Lm0EpfKyDalchpVwkE+81k5HeiRrTV/9w1aNHzjD7C4g== dependencies: - "@typescript-eslint/scope-manager" "5.9.0" - "@typescript-eslint/types" "5.9.0" - "@typescript-eslint/typescript-estree" "5.9.0" + "@typescript-eslint/scope-manager" "5.9.1" + "@typescript-eslint/types" "5.9.1" + "@typescript-eslint/typescript-estree" "5.9.1" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.9.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.9.0.tgz#02dfef920290c1dcd7b1999455a3eaae7a1a3117" - integrity sha512-DKtdIL49Qxk2a8icF6whRk7uThuVz4A6TCXfjdJSwOsf+9ree7vgQWcx0KOyCdk0i9ETX666p4aMhrRhxhUkyg== - dependencies: - "@typescript-eslint/types" "5.9.0" - "@typescript-eslint/visitor-keys" "5.9.0" - "@typescript-eslint/scope-manager@5.9.1": version "5.9.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.9.1.tgz#6c27be89f1a9409f284d95dfa08ee3400166fe69" @@ -932,29 +924,11 @@ debug "^4.3.2" tsutils "^3.21.0" -"@typescript-eslint/types@5.9.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.9.0.tgz#e5619803e39d24a03b3369506df196355736e1a3" - integrity sha512-mWp6/b56Umo1rwyGCk8fPIzb9Migo8YOniBGPAQDNC6C52SeyNGN4gsVwQTAR+RS2L5xyajON4hOLwAGwPtUwg== - "@typescript-eslint/types@5.9.1": version "5.9.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.9.1.tgz#1bef8f238a2fb32ebc6ff6d75020d9f47a1593c6" integrity sha512-SsWegWudWpkZCwwYcKoDwuAjoZXnM1y2EbEerTHho19Hmm+bQ56QG4L4jrtCu0bI5STaRTvRTZmjprWlTw/5NQ== -"@typescript-eslint/typescript-estree@5.9.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.9.0.tgz#0e5c6f03f982931abbfbc3c1b9df5fbf92a3490f" - integrity sha512-kxo3xL2mB7XmiVZcECbaDwYCt3qFXz99tBSuVJR4L/sR7CJ+UNAPrYILILktGj1ppfZ/jNt/cWYbziJUlHl1Pw== - dependencies: - "@typescript-eslint/types" "5.9.0" - "@typescript-eslint/visitor-keys" "5.9.0" - debug "^4.3.2" - globby "^11.0.4" - is-glob "^4.0.3" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.9.1": version "5.9.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.9.1.tgz#d5b996f49476495070d2b8dd354861cf33c005d6" @@ -968,14 +942,6 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@5.9.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.9.0.tgz#7585677732365e9d27f1878150fab3922784a1a6" - integrity sha512-6zq0mb7LV0ThExKlecvpfepiB+XEtFv/bzx7/jKSgyXTFD7qjmSu1FoiS0x3OZaiS+UIXpH2vd9O89f02RCtgw== - dependencies: - "@typescript-eslint/types" "5.9.0" - eslint-visitor-keys "^3.0.0" - "@typescript-eslint/visitor-keys@5.9.1": version "5.9.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.9.1.tgz#f52206f38128dd4f675cf28070a41596eee985b7" From 005977a5afc2ccb1e1249a6e5bfaad71cf0826a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Jan 2022 12:01:45 +0000 Subject: [PATCH 482/785] Bump @types/prettier from 2.4.2 to 2.4.3 Bumps [@types/prettier](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/prettier) from 2.4.2 to 2.4.3. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/prettier) --- updated-dependencies: - dependency-name: "@types/prettier" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 52cbac67..33ec5b44 100644 --- a/yarn.lock +++ b/yarn.lock @@ -849,9 +849,9 @@ integrity sha512-YofkM6fGv4gDJq78g4j0mMuGMkZVxZDgtU0JRdx6FgiJDG+0fY0GKVolOV8WqVmEhLCXkQRjwDdKyPxJp/uucg== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": - version "2.4.2" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.2.tgz#4c62fae93eb479660c3bd93f9d24d561597a8281" - integrity sha512-ekoj4qOQYp7CvjX8ZDBgN86w3MqQhLE1hczEJbEIjgFEumDy+na/4AJAbLXfgEWFNB2pKadM5rPFtuSGMWK7xA== + version "2.4.3" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.3.tgz#a3c65525b91fca7da00ab1a3ac2b5a2a4afbffbf" + integrity sha512-QzSuZMBuG5u8HqYz01qtMdg/Jfctlnvj1z/lYnIDXs/golxw0fxtRAHd9KrzjR7Yxz1qVeI00o0kiO3PmVdJ9w== "@types/stack-utils@^2.0.0": version "2.0.1" From 39979180cec9f9662e92f1c70216fc97b82074e7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jan 2022 12:01:36 +0000 Subject: [PATCH 483/785] Bump @types/node from 17.0.8 to 17.0.9 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.8 to 17.0.9. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 33ec5b44..c156e223 100644 --- a/yarn.lock +++ b/yarn.lock @@ -844,9 +844,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^17.0.0": - version "17.0.8" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.8.tgz#50d680c8a8a78fe30abe6906453b21ad8ab0ad7b" - integrity sha512-YofkM6fGv4gDJq78g4j0mMuGMkZVxZDgtU0JRdx6FgiJDG+0fY0GKVolOV8WqVmEhLCXkQRjwDdKyPxJp/uucg== + version "17.0.9" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.9.tgz#0b7f161afb5b1cc12518d29b2cdc7175d5490628" + integrity sha512-5dNBXu/FOER+EXnyah7rn8xlNrfMOQb/qXnw4NQgLkCygKBKhdmF/CA5oXVOKZLBEahw8s2WP9LxIcN/oDDRgQ== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.3" From 5637d74ffbe18cf09a3cc3f013d03f08762c1502 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jan 2022 12:01:43 +0000 Subject: [PATCH 484/785] Bump ts-jest from 27.1.2 to 27.1.3 Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 27.1.2 to 27.1.3. - [Release notes](https://github.com/kulshekhar/ts-jest/releases) - [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/kulshekhar/ts-jest/compare/v27.1.2...v27.1.3) --- updated-dependencies: - dependency-name: ts-jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 33ec5b44..b1450fa0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3212,9 +3212,9 @@ tr46@^2.1.0: punycode "^2.1.1" ts-jest@^27.0.5: - version "27.1.2" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.1.2.tgz#5991d6eb3fd8e1a8d4b8f6de3ec0a3cc567f3151" - integrity sha512-eSOiJOWq6Hhs6Khzk5wKC5sgWIXgXqOCiIl1+3lfnearu58Hj4QpE5tUhQcA3xtZrELbcvAGCsd6HB8OsaVaTA== + version "27.1.3" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.1.3.tgz#1f723e7e74027c4da92c0ffbd73287e8af2b2957" + integrity sha512-6Nlura7s6uM9BVUAoqLH7JHyMXjz8gluryjpPXxr3IxZdAXnU6FhjvVLHFtfd1vsE1p8zD1OJfskkc0jhTSnkA== dependencies: bs-logger "0.x" fast-json-stable-stringify "2.x" From ae991bbf004e1479cca292629f07d255084ec760 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jan 2022 12:01:53 +0000 Subject: [PATCH 485/785] Bump eslint from 8.6.0 to 8.7.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.6.0 to 8.7.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.6.0...v8.7.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 48 ++++++++++++++---------------------------------- 1 file changed, 14 insertions(+), 34 deletions(-) diff --git a/yarn.lock b/yarn.lock index 33ec5b44..82ae1fb4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1010,11 +1010,6 @@ ajv@^6.10.0, ajv@^6.12.4: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ansi-colors@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" - integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== - ansi-escapes@^4.2.1: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" @@ -1459,13 +1454,6 @@ end-of-stream@^1.1.0: dependencies: once "^1.4.0" -enquirer@^2.3.5: - version "2.3.6" - resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" - integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== - dependencies: - ansi-colors "^4.1.1" - escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -1531,15 +1519,15 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz#eee4acea891814cda67a7d8812d9647dd0179af2" - integrity sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA== +eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.1.0, eslint-visitor-keys@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.2.0.tgz#6fbb166a6798ee5991358bc2daa1ba76cc1254a1" + integrity sha512-IOzT0X126zn7ALX0dwFiUQEdsfzrm4+ISsQS8nukaJXwEyYKRSnEIIDULYg1mCtGp7UUXgfGl7BIolXREQK+XQ== eslint@^8.1.0: - version "8.6.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.6.0.tgz#4318c6a31c5584838c1a2e940c478190f58d558e" - integrity sha512-UvxdOJ7mXFlw7iuHZA4jmzPaUqIw54mZrv+XPYKNbKdLR0et4rf60lIZUU9kiNtnzzMzGWxMV+tQ7uG7JG8DPw== + version "8.7.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.7.0.tgz#22e036842ee5b7cf87b03fe237731675b4d3633c" + integrity sha512-ifHYzkBGrzS2iDU7KjhCAVMGCvF6M3Xfs8X8b37cgrUlDt6bWRTpRh6T/gtSXv1HJ/BUGgmjvNvOEGu85Iif7w== dependencies: "@eslint/eslintrc" "^1.0.5" "@humanwhocodes/config-array" "^0.9.2" @@ -1548,11 +1536,10 @@ eslint@^8.1.0: cross-spawn "^7.0.2" debug "^4.3.2" doctrine "^3.0.0" - enquirer "^2.3.5" escape-string-regexp "^4.0.0" eslint-scope "^7.1.0" eslint-utils "^3.0.0" - eslint-visitor-keys "^3.1.0" + eslint-visitor-keys "^3.2.0" espree "^9.3.0" esquery "^1.4.0" esutils "^2.0.2" @@ -1561,7 +1548,7 @@ eslint@^8.1.0: functional-red-black-tree "^1.0.1" glob-parent "^6.0.1" globals "^13.6.0" - ignore "^4.0.6" + ignore "^5.2.0" import-fresh "^3.0.0" imurmurhash "^0.1.4" is-glob "^4.0.0" @@ -1572,9 +1559,7 @@ eslint@^8.1.0: minimatch "^3.0.4" natural-compare "^1.4.0" optionator "^0.9.1" - progress "^2.0.0" regexpp "^3.2.0" - semver "^7.2.1" strip-ansi "^6.0.1" strip-json-comments "^3.1.0" text-table "^0.2.0" @@ -1927,10 +1912,10 @@ ignore@^4.0.6: resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== -ignore@^5.1.4, ignore@^5.1.8: - version "5.1.9" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.9.tgz#9ec1a5cbe8e1446ec60d4420060d43aa6e7382fb" - integrity sha512-2zeMQpbKz5dhZ9IwL0gbxSW5w0NK/MSAMtNuhgIHEPmaU3vPdKPL0UdvUCXs5SS4JAwsBxysK5sFMW8ocFiVjQ== +ignore@^5.1.4, ignore@^5.1.8, ignore@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" + integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== import-fresh@^3.0.0, import-fresh@^3.2.1: version "3.3.0" @@ -2887,11 +2872,6 @@ pretty-quick@^3.1.2: mri "^1.1.5" multimatch "^4.0.0" -progress@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== - prompts@^2.0.1: version "2.4.2" resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" @@ -3004,7 +2984,7 @@ saxes@^5.0.1: dependencies: xmlchars "^2.2.0" -semver@7.x, semver@^7.2.1, semver@^7.3.2, semver@^7.3.5: +semver@7.x, semver@^7.3.2, semver@^7.3.5: version "7.3.5" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== From 019efbc7fa3a1837994e446a434a980ba1880dde Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Jan 2022 12:01:37 +0000 Subject: [PATCH 486/785] Bump @typescript-eslint/eslint-plugin from 5.9.1 to 5.10.0 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.9.1 to 5.10.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.10.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 80 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 57 insertions(+), 23 deletions(-) diff --git a/yarn.lock b/yarn.lock index d00c3ae0..4ac086d8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -871,13 +871,13 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.4.0": - version "5.9.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.9.1.tgz#e5a86d7e1f9dc0b3df1e6d94feaf20dd838d066c" - integrity sha512-Xv9tkFlyD4MQGpJgTo6wqDqGvHIRmRgah/2Sjz1PUnJTawjHWIwBivUE9x0QtU2WVii9baYgavo/bHjrZJkqTw== + version "5.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.10.0.tgz#e90afea96dff8620892ad216b0e4ccdf8ee32d3a" + integrity sha512-XXVKnMsq2fuu9K2KsIxPUGqb6xAImz8MEChClbXmE3VbveFtBUU5bzM6IPVWqzyADIgdkS2Ws/6Xo7W2TeZWjQ== dependencies: - "@typescript-eslint/experimental-utils" "5.9.1" - "@typescript-eslint/scope-manager" "5.9.1" - "@typescript-eslint/type-utils" "5.9.1" + "@typescript-eslint/scope-manager" "5.10.0" + "@typescript-eslint/type-utils" "5.10.0" + "@typescript-eslint/utils" "5.10.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -885,18 +885,6 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/experimental-utils@5.9.1": - version "5.9.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.9.1.tgz#8c407c4dd5ffe522329df6e4c9c2b52206d5f7f1" - integrity sha512-cb1Njyss0mLL9kLXgS/eEY53SZQ9sT519wpX3i+U457l2UXRDuo87hgKfgRazmu9/tQb0x2sr3Y0yrU+Zz0y+w== - dependencies: - "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.9.1" - "@typescript-eslint/types" "5.9.1" - "@typescript-eslint/typescript-estree" "5.9.1" - eslint-scope "^5.1.1" - eslint-utils "^3.0.0" - "@typescript-eslint/parser@^5.4.0": version "5.9.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.9.1.tgz#b114011010a87e17b3265ca715e16c76a9834cef" @@ -907,6 +895,14 @@ "@typescript-eslint/typescript-estree" "5.9.1" debug "^4.3.2" +"@typescript-eslint/scope-manager@5.10.0": + version "5.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.10.0.tgz#bb5d872e8b9e36203908595507fbc4d3105329cb" + integrity sha512-tgNgUgb4MhqK6DoKn3RBhyZ9aJga7EQrw+2/OiDk5hKf3pTVZWyqBi7ukP+Z0iEEDMF5FDa64LqODzlfE4O/Dg== + dependencies: + "@typescript-eslint/types" "5.10.0" + "@typescript-eslint/visitor-keys" "5.10.0" + "@typescript-eslint/scope-manager@5.9.1": version "5.9.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.9.1.tgz#6c27be89f1a9409f284d95dfa08ee3400166fe69" @@ -915,20 +911,38 @@ "@typescript-eslint/types" "5.9.1" "@typescript-eslint/visitor-keys" "5.9.1" -"@typescript-eslint/type-utils@5.9.1": - version "5.9.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.9.1.tgz#c6832ffe655b9b1fec642d36db1a262d721193de" - integrity sha512-tRSpdBnPRssjlUh35rE9ug5HrUvaB9ntREy7gPXXKwmIx61TNN7+l5YKgi1hMKxo5NvqZCfYhA5FvyuJG6X6vg== +"@typescript-eslint/type-utils@5.10.0": + version "5.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.10.0.tgz#8524b9479c19c478347a7df216827e749e4a51e5" + integrity sha512-TzlyTmufJO5V886N+hTJBGIfnjQDQ32rJYxPaeiyWKdjsv2Ld5l8cbS7pxim4DeNs62fKzRSt8Q14Evs4JnZyQ== dependencies: - "@typescript-eslint/experimental-utils" "5.9.1" + "@typescript-eslint/utils" "5.10.0" debug "^4.3.2" tsutils "^3.21.0" +"@typescript-eslint/types@5.10.0": + version "5.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.10.0.tgz#beb3cb345076f5b088afe996d57bcd1dfddaa75c" + integrity sha512-wUljCgkqHsMZbw60IbOqT/puLfyqqD5PquGiBo1u1IS3PLxdi3RDGlyf032IJyh+eQoGhz9kzhtZa+VC4eWTlQ== + "@typescript-eslint/types@5.9.1": version "5.9.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.9.1.tgz#1bef8f238a2fb32ebc6ff6d75020d9f47a1593c6" integrity sha512-SsWegWudWpkZCwwYcKoDwuAjoZXnM1y2EbEerTHho19Hmm+bQ56QG4L4jrtCu0bI5STaRTvRTZmjprWlTw/5NQ== +"@typescript-eslint/typescript-estree@5.10.0": + version "5.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.0.tgz#4be24a3dea0f930bb1397c46187d0efdd955a224" + integrity sha512-x+7e5IqfwLwsxTdliHRtlIYkgdtYXzE0CkFeV6ytAqq431ZyxCFzNMNR5sr3WOlIG/ihVZr9K/y71VHTF/DUQA== + dependencies: + "@typescript-eslint/types" "5.10.0" + "@typescript-eslint/visitor-keys" "5.10.0" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/typescript-estree@5.9.1": version "5.9.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.9.1.tgz#d5b996f49476495070d2b8dd354861cf33c005d6" @@ -942,6 +956,26 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/utils@5.10.0": + version "5.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.10.0.tgz#c3d152a85da77c400e37281355561c72fb1b5a65" + integrity sha512-IGYwlt1CVcFoE2ueW4/ioEwybR60RAdGeiJX/iDAw0t5w0wK3S7QncDwpmsM70nKgGTuVchEWB8lwZwHqPAWRg== + dependencies: + "@types/json-schema" "^7.0.9" + "@typescript-eslint/scope-manager" "5.10.0" + "@typescript-eslint/types" "5.10.0" + "@typescript-eslint/typescript-estree" "5.10.0" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" + +"@typescript-eslint/visitor-keys@5.10.0": + version "5.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.0.tgz#770215497ad67cd15a572b52089991d5dfe06281" + integrity sha512-GMxj0K1uyrFLPKASLmZzCuSddmjZVbVj3Ouy5QVuIGKZopxvOr24JsS7gruz6C3GExE01mublZ3mIBOaon9zuQ== + dependencies: + "@typescript-eslint/types" "5.10.0" + eslint-visitor-keys "^3.0.0" + "@typescript-eslint/visitor-keys@5.9.1": version "5.9.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.9.1.tgz#f52206f38128dd4f675cf28070a41596eee985b7" From 16d50964b1ef172d05a782af5e903906fca948d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Jan 2022 12:16:23 +0000 Subject: [PATCH 487/785] Bump @typescript-eslint/parser from 5.9.1 to 5.10.0 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.9.1 to 5.10.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.10.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 46 ++++++---------------------------------------- 1 file changed, 6 insertions(+), 40 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4ac086d8..f2a8353d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -886,13 +886,13 @@ tsutils "^3.21.0" "@typescript-eslint/parser@^5.4.0": - version "5.9.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.9.1.tgz#b114011010a87e17b3265ca715e16c76a9834cef" - integrity sha512-PLYO0AmwD6s6n0ZQB5kqPgfvh73p0+VqopQQLuNfi7Lm0EpfKyDalchpVwkE+81k5HeiRrTV/9w1aNHzjD7C4g== + version "5.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.10.0.tgz#8f59e036f5f1cffc178cacbd5ccdd02aeb96c91c" + integrity sha512-pJB2CCeHWtwOAeIxv8CHVGJhI5FNyJAIpx5Pt72YkK3QfEzt6qAlXZuyaBmyfOdM62qU0rbxJzNToPTVeJGrQw== dependencies: - "@typescript-eslint/scope-manager" "5.9.1" - "@typescript-eslint/types" "5.9.1" - "@typescript-eslint/typescript-estree" "5.9.1" + "@typescript-eslint/scope-manager" "5.10.0" + "@typescript-eslint/types" "5.10.0" + "@typescript-eslint/typescript-estree" "5.10.0" debug "^4.3.2" "@typescript-eslint/scope-manager@5.10.0": @@ -903,14 +903,6 @@ "@typescript-eslint/types" "5.10.0" "@typescript-eslint/visitor-keys" "5.10.0" -"@typescript-eslint/scope-manager@5.9.1": - version "5.9.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.9.1.tgz#6c27be89f1a9409f284d95dfa08ee3400166fe69" - integrity sha512-8BwvWkho3B/UOtzRyW07ffJXPaLSUKFBjpq8aqsRvu6HdEuzCY57+ffT7QoV4QXJXWSU1+7g3wE4AlgImmQ9pQ== - dependencies: - "@typescript-eslint/types" "5.9.1" - "@typescript-eslint/visitor-keys" "5.9.1" - "@typescript-eslint/type-utils@5.10.0": version "5.10.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.10.0.tgz#8524b9479c19c478347a7df216827e749e4a51e5" @@ -925,11 +917,6 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.10.0.tgz#beb3cb345076f5b088afe996d57bcd1dfddaa75c" integrity sha512-wUljCgkqHsMZbw60IbOqT/puLfyqqD5PquGiBo1u1IS3PLxdi3RDGlyf032IJyh+eQoGhz9kzhtZa+VC4eWTlQ== -"@typescript-eslint/types@5.9.1": - version "5.9.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.9.1.tgz#1bef8f238a2fb32ebc6ff6d75020d9f47a1593c6" - integrity sha512-SsWegWudWpkZCwwYcKoDwuAjoZXnM1y2EbEerTHho19Hmm+bQ56QG4L4jrtCu0bI5STaRTvRTZmjprWlTw/5NQ== - "@typescript-eslint/typescript-estree@5.10.0": version "5.10.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.0.tgz#4be24a3dea0f930bb1397c46187d0efdd955a224" @@ -943,19 +930,6 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/typescript-estree@5.9.1": - version "5.9.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.9.1.tgz#d5b996f49476495070d2b8dd354861cf33c005d6" - integrity sha512-gL1sP6A/KG0HwrahVXI9fZyeVTxEYV//6PmcOn1tD0rw8VhUWYeZeuWHwwhnewnvEMcHjhnJLOBhA9rK4vmb8A== - dependencies: - "@typescript-eslint/types" "5.9.1" - "@typescript-eslint/visitor-keys" "5.9.1" - 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.10.0": version "5.10.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.10.0.tgz#c3d152a85da77c400e37281355561c72fb1b5a65" @@ -976,14 +950,6 @@ "@typescript-eslint/types" "5.10.0" eslint-visitor-keys "^3.0.0" -"@typescript-eslint/visitor-keys@5.9.1": - version "5.9.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.9.1.tgz#f52206f38128dd4f675cf28070a41596eee985b7" - integrity sha512-Xh37pNz9e9ryW4TVdwiFzmr4hloty8cFj8GTWMXh3Z8swGwyQWeCcNgF0hm6t09iZd6eiZmIf4zHedQVP6TVtg== - dependencies: - "@typescript-eslint/types" "5.9.1" - 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 12d41928541863bae1778b6b8d34f3a6e7909f13 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Jan 2022 12:01:44 +0000 Subject: [PATCH 488/785] Bump @types/node from 17.0.9 to 17.0.10 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.9 to 17.0.10. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index f2a8353d..c63655a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -844,9 +844,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^17.0.0": - version "17.0.9" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.9.tgz#0b7f161afb5b1cc12518d29b2cdc7175d5490628" - integrity sha512-5dNBXu/FOER+EXnyah7rn8xlNrfMOQb/qXnw4NQgLkCygKBKhdmF/CA5oXVOKZLBEahw8s2WP9LxIcN/oDDRgQ== + version "17.0.10" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.10.tgz#616f16e9d3a2a3d618136b1be244315d95bd7cab" + integrity sha512-S/3xB4KzyFxYGCppyDt68yzBU9ysL88lSdIah4D6cptdcltc4NCPCAMc0+PCpg/lLIyC7IPvj2Z52OJWeIUkog== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.3" From f5467fc02391a25a28d53bbded35bb8ae9085778 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Jan 2022 12:01:24 +0000 Subject: [PATCH 489/785] Bump typescript from 4.5.4 to 4.5.5 Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.5.4 to 4.5.5. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v4.5.4...v4.5.5) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index c63655a3..9b368f6d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3272,9 +3272,9 @@ typedarray-to-buffer@^3.1.5: is-typedarray "^1.0.0" typescript@^4.5.2: - version "4.5.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.4.tgz#a17d3a0263bf5c8723b9c52f43c5084edf13c2e8" - integrity sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg== + version "4.5.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3" + integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA== universalify@^0.1.2: version "0.1.2" From 778e66e589eb47b1d9b967af9c7f026de9f74295 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Jan 2022 12:01:46 +0000 Subject: [PATCH 490/785] Bump @typescript-eslint/parser from 5.10.0 to 5.10.1 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.10.0 to 5.10.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.10.1/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9b368f6d..613ac3dc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -886,13 +886,13 @@ tsutils "^3.21.0" "@typescript-eslint/parser@^5.4.0": - version "5.10.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.10.0.tgz#8f59e036f5f1cffc178cacbd5ccdd02aeb96c91c" - integrity sha512-pJB2CCeHWtwOAeIxv8CHVGJhI5FNyJAIpx5Pt72YkK3QfEzt6qAlXZuyaBmyfOdM62qU0rbxJzNToPTVeJGrQw== + version "5.10.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.10.1.tgz#4ce9633cc33fc70bc13786cb793c1a76fe5ad6bd" + integrity sha512-GReo3tjNBwR5RnRO0K2wDIDN31cM3MmDtgyQ85oAxAmC5K3j/g85IjP+cDfcqDsDDBf1HNKQAD0WqOYL8jXqUA== dependencies: - "@typescript-eslint/scope-manager" "5.10.0" - "@typescript-eslint/types" "5.10.0" - "@typescript-eslint/typescript-estree" "5.10.0" + "@typescript-eslint/scope-manager" "5.10.1" + "@typescript-eslint/types" "5.10.1" + "@typescript-eslint/typescript-estree" "5.10.1" debug "^4.3.2" "@typescript-eslint/scope-manager@5.10.0": @@ -903,6 +903,14 @@ "@typescript-eslint/types" "5.10.0" "@typescript-eslint/visitor-keys" "5.10.0" +"@typescript-eslint/scope-manager@5.10.1": + version "5.10.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.10.1.tgz#f0539c73804d2423506db2475352a4dec36cd809" + integrity sha512-Lyvi559Gvpn94k7+ElXNMEnXu/iundV5uFmCUNnftbFrUbAJ1WBoaGgkbOBm07jVZa682oaBU37ao/NGGX4ZDg== + dependencies: + "@typescript-eslint/types" "5.10.1" + "@typescript-eslint/visitor-keys" "5.10.1" + "@typescript-eslint/type-utils@5.10.0": version "5.10.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.10.0.tgz#8524b9479c19c478347a7df216827e749e4a51e5" @@ -917,6 +925,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.10.0.tgz#beb3cb345076f5b088afe996d57bcd1dfddaa75c" integrity sha512-wUljCgkqHsMZbw60IbOqT/puLfyqqD5PquGiBo1u1IS3PLxdi3RDGlyf032IJyh+eQoGhz9kzhtZa+VC4eWTlQ== +"@typescript-eslint/types@5.10.1": + version "5.10.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.10.1.tgz#dca9bd4cb8c067fc85304a31f38ec4766ba2d1ea" + integrity sha512-ZvxQ2QMy49bIIBpTqFiOenucqUyjTQ0WNLhBM6X1fh1NNlYAC6Kxsx8bRTY3jdYsYg44a0Z/uEgQkohbR0H87Q== + "@typescript-eslint/typescript-estree@5.10.0": version "5.10.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.0.tgz#4be24a3dea0f930bb1397c46187d0efdd955a224" @@ -930,6 +943,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.10.1": + version "5.10.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.1.tgz#b268e67be0553f8790ba3fe87113282977adda15" + integrity sha512-PwIGnH7jIueXv4opcwEbVGDATjGPO1dx9RkUl5LlHDSe+FXxPwFL5W/qYd5/NHr7f6lo/vvTrAzd0KlQtRusJQ== + dependencies: + "@typescript-eslint/types" "5.10.1" + "@typescript-eslint/visitor-keys" "5.10.1" + 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.10.0": version "5.10.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.10.0.tgz#c3d152a85da77c400e37281355561c72fb1b5a65" @@ -950,6 +976,14 @@ "@typescript-eslint/types" "5.10.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.10.1": + version "5.10.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.1.tgz#29102de692f59d7d34ecc457ed59ab5fc558010b" + integrity sha512-NjQ0Xinhy9IL979tpoTRuLKxMc0zJC7QVSdeerXs2/QvOy2yRkzX5dRb10X5woNUdJgU8G3nYRDlI33sq1K4YQ== + dependencies: + "@typescript-eslint/types" "5.10.1" + 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 b14cac0c9561be497cf02f15e69f0f5b4de71981 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Jan 2022 12:01:53 +0000 Subject: [PATCH 491/785] Bump @types/node from 17.0.10 to 17.0.12 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.10 to 17.0.12. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9b368f6d..7b5433cb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -844,9 +844,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^17.0.0": - version "17.0.10" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.10.tgz#616f16e9d3a2a3d618136b1be244315d95bd7cab" - integrity sha512-S/3xB4KzyFxYGCppyDt68yzBU9ysL88lSdIah4D6cptdcltc4NCPCAMc0+PCpg/lLIyC7IPvj2Z52OJWeIUkog== + version "17.0.12" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.12.tgz#f7aa331b27f08244888c47b7df126184bc2339c5" + integrity sha512-4YpbAsnJXWYK/fpTVFlMIcUIho2AYCi4wg5aNPrG1ng7fn/1/RZfCIpRCiBX+12RVa34RluilnvCqD+g3KiSiA== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.3" From 773ab805b64d2d21b6e5fc1d69a2231a0ba965b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Jan 2022 12:12:19 +0000 Subject: [PATCH 492/785] Bump @typescript-eslint/eslint-plugin from 5.10.0 to 5.10.1 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.10.0 to 5.10.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.10.1/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 70 ++++++++++++++----------------------------------------- 1 file changed, 18 insertions(+), 52 deletions(-) diff --git a/yarn.lock b/yarn.lock index 1d5505ec..7e49be5a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -871,13 +871,13 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.4.0": - version "5.10.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.10.0.tgz#e90afea96dff8620892ad216b0e4ccdf8ee32d3a" - integrity sha512-XXVKnMsq2fuu9K2KsIxPUGqb6xAImz8MEChClbXmE3VbveFtBUU5bzM6IPVWqzyADIgdkS2Ws/6Xo7W2TeZWjQ== + version "5.10.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.10.1.tgz#870195d0f2146b36d11fc71131b75aba52354c69" + integrity sha512-xN3CYqFlyE/qOcy978/L0xLR2HlcAGIyIK5sMOasxaaAPfQRj/MmMV6OC3I7NZO84oEUdWCOju34Z9W8E0pFDQ== dependencies: - "@typescript-eslint/scope-manager" "5.10.0" - "@typescript-eslint/type-utils" "5.10.0" - "@typescript-eslint/utils" "5.10.0" + "@typescript-eslint/scope-manager" "5.10.1" + "@typescript-eslint/type-utils" "5.10.1" + "@typescript-eslint/utils" "5.10.1" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -895,14 +895,6 @@ "@typescript-eslint/typescript-estree" "5.10.1" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.10.0": - version "5.10.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.10.0.tgz#bb5d872e8b9e36203908595507fbc4d3105329cb" - integrity sha512-tgNgUgb4MhqK6DoKn3RBhyZ9aJga7EQrw+2/OiDk5hKf3pTVZWyqBi7ukP+Z0iEEDMF5FDa64LqODzlfE4O/Dg== - dependencies: - "@typescript-eslint/types" "5.10.0" - "@typescript-eslint/visitor-keys" "5.10.0" - "@typescript-eslint/scope-manager@5.10.1": version "5.10.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.10.1.tgz#f0539c73804d2423506db2475352a4dec36cd809" @@ -911,38 +903,20 @@ "@typescript-eslint/types" "5.10.1" "@typescript-eslint/visitor-keys" "5.10.1" -"@typescript-eslint/type-utils@5.10.0": - version "5.10.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.10.0.tgz#8524b9479c19c478347a7df216827e749e4a51e5" - integrity sha512-TzlyTmufJO5V886N+hTJBGIfnjQDQ32rJYxPaeiyWKdjsv2Ld5l8cbS7pxim4DeNs62fKzRSt8Q14Evs4JnZyQ== +"@typescript-eslint/type-utils@5.10.1": + version "5.10.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.10.1.tgz#5e526c00142585e40ab1503e83f1ff608c367405" + integrity sha512-AfVJkV8uck/UIoDqhu+ptEdBoQATON9GXnhOpPLzkQRJcSChkvD//qsz9JVffl2goxX+ybs5klvacE9vmrQyCw== dependencies: - "@typescript-eslint/utils" "5.10.0" + "@typescript-eslint/utils" "5.10.1" debug "^4.3.2" tsutils "^3.21.0" -"@typescript-eslint/types@5.10.0": - version "5.10.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.10.0.tgz#beb3cb345076f5b088afe996d57bcd1dfddaa75c" - integrity sha512-wUljCgkqHsMZbw60IbOqT/puLfyqqD5PquGiBo1u1IS3PLxdi3RDGlyf032IJyh+eQoGhz9kzhtZa+VC4eWTlQ== - "@typescript-eslint/types@5.10.1": version "5.10.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.10.1.tgz#dca9bd4cb8c067fc85304a31f38ec4766ba2d1ea" integrity sha512-ZvxQ2QMy49bIIBpTqFiOenucqUyjTQ0WNLhBM6X1fh1NNlYAC6Kxsx8bRTY3jdYsYg44a0Z/uEgQkohbR0H87Q== -"@typescript-eslint/typescript-estree@5.10.0": - version "5.10.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.0.tgz#4be24a3dea0f930bb1397c46187d0efdd955a224" - integrity sha512-x+7e5IqfwLwsxTdliHRtlIYkgdtYXzE0CkFeV6ytAqq431ZyxCFzNMNR5sr3WOlIG/ihVZr9K/y71VHTF/DUQA== - dependencies: - "@typescript-eslint/types" "5.10.0" - "@typescript-eslint/visitor-keys" "5.10.0" - debug "^4.3.2" - globby "^11.0.4" - is-glob "^4.0.3" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.10.1": version "5.10.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.1.tgz#b268e67be0553f8790ba3fe87113282977adda15" @@ -956,26 +930,18 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/utils@5.10.0": - version "5.10.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.10.0.tgz#c3d152a85da77c400e37281355561c72fb1b5a65" - integrity sha512-IGYwlt1CVcFoE2ueW4/ioEwybR60RAdGeiJX/iDAw0t5w0wK3S7QncDwpmsM70nKgGTuVchEWB8lwZwHqPAWRg== +"@typescript-eslint/utils@5.10.1": + version "5.10.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.10.1.tgz#fa682a33af47080ba2c4368ee0ad2128213a1196" + integrity sha512-RRmlITiUbLuTRtn/gcPRi4202niF+q7ylFLCKu4c+O/PcpRvZ/nAUwQ2G00bZgpWkhrNLNnvhZLbDn8Ml0qsQw== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.10.0" - "@typescript-eslint/types" "5.10.0" - "@typescript-eslint/typescript-estree" "5.10.0" + "@typescript-eslint/scope-manager" "5.10.1" + "@typescript-eslint/types" "5.10.1" + "@typescript-eslint/typescript-estree" "5.10.1" eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.10.0": - version "5.10.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.0.tgz#770215497ad67cd15a572b52089991d5dfe06281" - integrity sha512-GMxj0K1uyrFLPKASLmZzCuSddmjZVbVj3Ouy5QVuIGKZopxvOr24JsS7gruz6C3GExE01mublZ3mIBOaon9zuQ== - dependencies: - "@typescript-eslint/types" "5.10.0" - eslint-visitor-keys "^3.0.0" - "@typescript-eslint/visitor-keys@5.10.1": version "5.10.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.1.tgz#29102de692f59d7d34ecc457ed59ab5fc558010b" From c19ded49b61b971464c62d82a1647035ec3fbe2b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 28 Jan 2022 12:01:36 +0000 Subject: [PATCH 493/785] Bump @types/node from 17.0.12 to 17.0.13 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.12 to 17.0.13. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7e49be5a..b20d2df9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -844,9 +844,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^17.0.0": - version "17.0.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.12.tgz#f7aa331b27f08244888c47b7df126184bc2339c5" - integrity sha512-4YpbAsnJXWYK/fpTVFlMIcUIho2AYCi4wg5aNPrG1ng7fn/1/RZfCIpRCiBX+12RVa34RluilnvCqD+g3KiSiA== + version "17.0.13" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.13.tgz#5ed7ed7c662948335fcad6c412bb42d99ea754e3" + integrity sha512-Y86MAxASe25hNzlDbsviXl8jQHb0RDvKt4c40ZJQ1Don0AAL0STLZSs4N+6gLEO55pedy7r2cLwS+ZDxPm/2Bw== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.3" From 4ae57adce38b3199f1c32947dea4eac5806fe7b2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Jan 2022 12:01:53 +0000 Subject: [PATCH 494/785] Bump eslint from 8.7.0 to 8.8.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.7.0 to 8.8.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.7.0...v8.8.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index b20d2df9..9a406827 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1525,9 +1525,9 @@ eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.1.0, eslint-visitor-keys@^3.2 integrity sha512-IOzT0X126zn7ALX0dwFiUQEdsfzrm4+ISsQS8nukaJXwEyYKRSnEIIDULYg1mCtGp7UUXgfGl7BIolXREQK+XQ== eslint@^8.1.0: - version "8.7.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.7.0.tgz#22e036842ee5b7cf87b03fe237731675b4d3633c" - integrity sha512-ifHYzkBGrzS2iDU7KjhCAVMGCvF6M3Xfs8X8b37cgrUlDt6bWRTpRh6T/gtSXv1HJ/BUGgmjvNvOEGu85Iif7w== + version "8.8.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.8.0.tgz#9762b49abad0cb4952539ffdb0a046392e571a2d" + integrity sha512-H3KXAzQGBH1plhYS3okDix2ZthuYJlQQEGE5k0IKuEqUSiyu4AmxxlJ2MtTYeJ3xB4jDhcYCwGOg2TXYdnDXlQ== dependencies: "@eslint/eslintrc" "^1.0.5" "@humanwhocodes/config-array" "^0.9.2" From 9602c58df5a5bd20aa8b60302bc54121c394f7af Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Feb 2022 12:01:10 +0000 Subject: [PATCH 495/785] Bump @types/node from 17.0.13 to 17.0.14 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.13 to 17.0.14. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9a406827..f465b367 100644 --- a/yarn.lock +++ b/yarn.lock @@ -844,9 +844,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^17.0.0": - version "17.0.13" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.13.tgz#5ed7ed7c662948335fcad6c412bb42d99ea754e3" - integrity sha512-Y86MAxASe25hNzlDbsviXl8jQHb0RDvKt4c40ZJQ1Don0AAL0STLZSs4N+6gLEO55pedy7r2cLwS+ZDxPm/2Bw== + version "17.0.14" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.14.tgz#33b9b94f789a8fedd30a68efdbca4dbb06b61f20" + integrity sha512-SbjLmERksKOGzWzPNuW7fJM7fk3YXVTFiZWB/Hs99gwhk+/dnrQRPBQjPW9aO+fi1tAffi9PrwFvsmOKmDTyng== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.3" From 1ca422cca71372227fc83df67a0a0a18ff4f2110 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Feb 2022 12:01:26 +0000 Subject: [PATCH 496/785] Bump @typescript-eslint/eslint-plugin from 5.10.1 to 5.10.2 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.10.1 to 5.10.2. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.10.2/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 70 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 52 insertions(+), 18 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9a406827..93a23681 100644 --- a/yarn.lock +++ b/yarn.lock @@ -871,13 +871,13 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.4.0": - version "5.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.10.1.tgz#870195d0f2146b36d11fc71131b75aba52354c69" - integrity sha512-xN3CYqFlyE/qOcy978/L0xLR2HlcAGIyIK5sMOasxaaAPfQRj/MmMV6OC3I7NZO84oEUdWCOju34Z9W8E0pFDQ== + version "5.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.10.2.tgz#f8c1d59fc37bd6d9d11c97267fdfe722c4777152" + integrity sha512-4W/9lLuE+v27O/oe7hXJKjNtBLnZE8tQAFpapdxwSVHqtmIoPB1gph3+ahNwVuNL37BX7YQHyGF9Xv6XCnIX2Q== dependencies: - "@typescript-eslint/scope-manager" "5.10.1" - "@typescript-eslint/type-utils" "5.10.1" - "@typescript-eslint/utils" "5.10.1" + "@typescript-eslint/scope-manager" "5.10.2" + "@typescript-eslint/type-utils" "5.10.2" + "@typescript-eslint/utils" "5.10.2" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -903,12 +903,20 @@ "@typescript-eslint/types" "5.10.1" "@typescript-eslint/visitor-keys" "5.10.1" -"@typescript-eslint/type-utils@5.10.1": - version "5.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.10.1.tgz#5e526c00142585e40ab1503e83f1ff608c367405" - integrity sha512-AfVJkV8uck/UIoDqhu+ptEdBoQATON9GXnhOpPLzkQRJcSChkvD//qsz9JVffl2goxX+ybs5klvacE9vmrQyCw== +"@typescript-eslint/scope-manager@5.10.2": + version "5.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.10.2.tgz#92c0bc935ec00f3d8638cdffb3d0e70c9b879639" + integrity sha512-39Tm6f4RoZoVUWBYr3ekS75TYgpr5Y+X0xLZxXqcZNDWZdJdYbKd3q2IR4V9y5NxxiPu/jxJ8XP7EgHiEQtFnw== + dependencies: + "@typescript-eslint/types" "5.10.2" + "@typescript-eslint/visitor-keys" "5.10.2" + +"@typescript-eslint/type-utils@5.10.2": + version "5.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.10.2.tgz#ad5acdf98a7d2ab030bea81f17da457519101ceb" + integrity sha512-uRKSvw/Ccs5FYEoXW04Z5VfzF2iiZcx8Fu7DGIB7RHozuP0VbKNzP1KfZkHBTM75pCpsWxIthEH1B33dmGBKHw== dependencies: - "@typescript-eslint/utils" "5.10.1" + "@typescript-eslint/utils" "5.10.2" debug "^4.3.2" tsutils "^3.21.0" @@ -917,6 +925,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.10.1.tgz#dca9bd4cb8c067fc85304a31f38ec4766ba2d1ea" integrity sha512-ZvxQ2QMy49bIIBpTqFiOenucqUyjTQ0WNLhBM6X1fh1NNlYAC6Kxsx8bRTY3jdYsYg44a0Z/uEgQkohbR0H87Q== +"@typescript-eslint/types@5.10.2": + version "5.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.10.2.tgz#604d15d795c4601fffba6ecb4587ff9fdec68ce8" + integrity sha512-Qfp0qk/5j2Rz3p3/WhWgu4S1JtMcPgFLnmAKAW061uXxKSa7VWKZsDXVaMXh2N60CX9h6YLaBoy9PJAfCOjk3w== + "@typescript-eslint/typescript-estree@5.10.1": version "5.10.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.1.tgz#b268e67be0553f8790ba3fe87113282977adda15" @@ -930,15 +943,28 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/utils@5.10.1": - version "5.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.10.1.tgz#fa682a33af47080ba2c4368ee0ad2128213a1196" - integrity sha512-RRmlITiUbLuTRtn/gcPRi4202niF+q7ylFLCKu4c+O/PcpRvZ/nAUwQ2G00bZgpWkhrNLNnvhZLbDn8Ml0qsQw== +"@typescript-eslint/typescript-estree@5.10.2": + version "5.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.2.tgz#810906056cd3ddcb35aa333fdbbef3713b0fe4a7" + integrity sha512-WHHw6a9vvZls6JkTgGljwCsMkv8wu8XU8WaYKeYhxhWXH/atZeiMW6uDFPLZOvzNOGmuSMvHtZKd6AuC8PrwKQ== + dependencies: + "@typescript-eslint/types" "5.10.2" + "@typescript-eslint/visitor-keys" "5.10.2" + 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.10.2": + version "5.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.10.2.tgz#1fcd37547c32c648ab11aea7173ec30060ee87a8" + integrity sha512-vuJaBeig1NnBRkf7q9tgMLREiYD7zsMrsN1DA3wcoMDvr3BTFiIpKjGiYZoKPllfEwN7spUjv7ZqD+JhbVjEPg== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.10.1" - "@typescript-eslint/types" "5.10.1" - "@typescript-eslint/typescript-estree" "5.10.1" + "@typescript-eslint/scope-manager" "5.10.2" + "@typescript-eslint/types" "5.10.2" + "@typescript-eslint/typescript-estree" "5.10.2" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -950,6 +976,14 @@ "@typescript-eslint/types" "5.10.1" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.10.2": + version "5.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.2.tgz#fdbf272d8e61c045d865bd6c8b41bea73d222f3d" + integrity sha512-zHIhYGGGrFJvvyfwHk5M08C5B5K4bewkm+rrvNTKk1/S15YHR+SA/QUF8ZWscXSfEaB8Nn2puZj+iHcoxVOD/Q== + dependencies: + "@typescript-eslint/types" "5.10.2" + 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 bf1be3f24f0a8684b99fbb86a9110479f9c5a2ce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Feb 2022 12:12:43 +0000 Subject: [PATCH 497/785] Bump @typescript-eslint/parser from 5.10.1 to 5.10.2 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.10.1 to 5.10.2. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.10.2/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 46 ++++++---------------------------------------- 1 file changed, 6 insertions(+), 40 deletions(-) diff --git a/yarn.lock b/yarn.lock index 94e351a5..5d09e517 100644 --- a/yarn.lock +++ b/yarn.lock @@ -886,23 +886,15 @@ tsutils "^3.21.0" "@typescript-eslint/parser@^5.4.0": - version "5.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.10.1.tgz#4ce9633cc33fc70bc13786cb793c1a76fe5ad6bd" - integrity sha512-GReo3tjNBwR5RnRO0K2wDIDN31cM3MmDtgyQ85oAxAmC5K3j/g85IjP+cDfcqDsDDBf1HNKQAD0WqOYL8jXqUA== + version "5.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.10.2.tgz#b6076d27cc5499ce3f2c625f5ccde946ecb7db9a" + integrity sha512-JaNYGkaQVhP6HNF+lkdOr2cAs2wdSZBoalE22uYWq8IEv/OVH0RksSGydk+sW8cLoSeYmC+OHvRyv2i4AQ7Czg== dependencies: - "@typescript-eslint/scope-manager" "5.10.1" - "@typescript-eslint/types" "5.10.1" - "@typescript-eslint/typescript-estree" "5.10.1" + "@typescript-eslint/scope-manager" "5.10.2" + "@typescript-eslint/types" "5.10.2" + "@typescript-eslint/typescript-estree" "5.10.2" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.10.1": - version "5.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.10.1.tgz#f0539c73804d2423506db2475352a4dec36cd809" - integrity sha512-Lyvi559Gvpn94k7+ElXNMEnXu/iundV5uFmCUNnftbFrUbAJ1WBoaGgkbOBm07jVZa682oaBU37ao/NGGX4ZDg== - dependencies: - "@typescript-eslint/types" "5.10.1" - "@typescript-eslint/visitor-keys" "5.10.1" - "@typescript-eslint/scope-manager@5.10.2": version "5.10.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.10.2.tgz#92c0bc935ec00f3d8638cdffb3d0e70c9b879639" @@ -920,29 +912,11 @@ debug "^4.3.2" tsutils "^3.21.0" -"@typescript-eslint/types@5.10.1": - version "5.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.10.1.tgz#dca9bd4cb8c067fc85304a31f38ec4766ba2d1ea" - integrity sha512-ZvxQ2QMy49bIIBpTqFiOenucqUyjTQ0WNLhBM6X1fh1NNlYAC6Kxsx8bRTY3jdYsYg44a0Z/uEgQkohbR0H87Q== - "@typescript-eslint/types@5.10.2": version "5.10.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.10.2.tgz#604d15d795c4601fffba6ecb4587ff9fdec68ce8" integrity sha512-Qfp0qk/5j2Rz3p3/WhWgu4S1JtMcPgFLnmAKAW061uXxKSa7VWKZsDXVaMXh2N60CX9h6YLaBoy9PJAfCOjk3w== -"@typescript-eslint/typescript-estree@5.10.1": - version "5.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.1.tgz#b268e67be0553f8790ba3fe87113282977adda15" - integrity sha512-PwIGnH7jIueXv4opcwEbVGDATjGPO1dx9RkUl5LlHDSe+FXxPwFL5W/qYd5/NHr7f6lo/vvTrAzd0KlQtRusJQ== - dependencies: - "@typescript-eslint/types" "5.10.1" - "@typescript-eslint/visitor-keys" "5.10.1" - debug "^4.3.2" - globby "^11.0.4" - is-glob "^4.0.3" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.10.2": version "5.10.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.2.tgz#810906056cd3ddcb35aa333fdbbef3713b0fe4a7" @@ -968,14 +942,6 @@ eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.10.1": - version "5.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.1.tgz#29102de692f59d7d34ecc457ed59ab5fc558010b" - integrity sha512-NjQ0Xinhy9IL979tpoTRuLKxMc0zJC7QVSdeerXs2/QvOy2yRkzX5dRb10X5woNUdJgU8G3nYRDlI33sq1K4YQ== - dependencies: - "@typescript-eslint/types" "5.10.1" - eslint-visitor-keys "^3.0.0" - "@typescript-eslint/visitor-keys@5.10.2": version "5.10.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.2.tgz#fdbf272d8e61c045d865bd6c8b41bea73d222f3d" From a5cd87378739c38811e76c6643e9037af909fccb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Feb 2022 12:01:33 +0000 Subject: [PATCH 498/785] Bump @types/node from 17.0.14 to 17.0.15 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.14 to 17.0.15. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5d09e517..bc0de597 100644 --- a/yarn.lock +++ b/yarn.lock @@ -844,9 +844,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^17.0.0": - version "17.0.14" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.14.tgz#33b9b94f789a8fedd30a68efdbca4dbb06b61f20" - integrity sha512-SbjLmERksKOGzWzPNuW7fJM7fk3YXVTFiZWB/Hs99gwhk+/dnrQRPBQjPW9aO+fi1tAffi9PrwFvsmOKmDTyng== + version "17.0.15" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.15.tgz#97779282c09c09577120a2162e71d8380003590a" + integrity sha512-zWt4SDDv1S9WRBNxLFxFRHxdD9tvH8f5/kg5/IaLFdnSNXsDY4eL3Q3XXN+VxUnWIhyVFDwcsmAprvwXoM/ClA== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.3" From 451affe297d6d38d2cab7f1f6d0677cbfcfaaf9b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Feb 2022 12:01:51 +0000 Subject: [PATCH 499/785] Bump jest from 27.4.7 to 27.5.0 Bumps [jest](https://github.com/facebook/jest) from 27.4.7 to 27.5.0. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v27.4.7...v27.5.0) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 771 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 404 insertions(+), 367 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5d09e517..54ff4235 100644 --- a/yarn.lock +++ b/yarn.lock @@ -537,158 +537,158 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^27.4.6": - version "27.4.6" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.4.6.tgz#0742e6787f682b22bdad56f9db2a8a77f6a86107" - integrity sha512-jauXyacQD33n47A44KrlOVeiXHEXDqapSdfb9kTekOchH/Pd18kBIO1+xxJQRLuG+LUuljFCwTG92ra4NW7SpA== +"@jest/console@^27.5.0": + version "27.5.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.5.0.tgz#82289a589ad5803555b50b64178128b7a8e45282" + integrity sha512-WUzX5neFb0IOQOy/7A2VhiGdxJKk85Xns2Oq29JaHmtnSel+BsjwyQZxzAs2Xxfd2i452fwdDG9ox/IWi81bdQ== dependencies: - "@jest/types" "^27.4.2" + "@jest/types" "^27.5.0" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^27.4.6" - jest-util "^27.4.2" + jest-message-util "^27.5.0" + jest-util "^27.5.0" slash "^3.0.0" -"@jest/core@^27.4.7": - version "27.4.7" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.4.7.tgz#84eabdf42a25f1fa138272ed229bcf0a1b5e6913" - integrity sha512-n181PurSJkVMS+kClIFSX/LLvw9ExSb+4IMtD6YnfxZVerw9ANYtW0bPrm0MJu2pfe9SY9FJ9FtQ+MdZkrZwjg== +"@jest/core@^27.5.0": + version "27.5.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.5.0.tgz#27b383f497ff1671cc30fd5e22eba9d9b10c3031" + integrity sha512-DcUTkZyon+dRozTEjy38Bgt3PIU51GdUJuz3uHKg5maGtmCaYqPUGiM3Xddqi7eIMC7E3fTGIlHqH9i0pTOy6Q== dependencies: - "@jest/console" "^27.4.6" - "@jest/reporters" "^27.4.6" - "@jest/test-result" "^27.4.6" - "@jest/transform" "^27.4.6" - "@jest/types" "^27.4.2" + "@jest/console" "^27.5.0" + "@jest/reporters" "^27.5.0" + "@jest/test-result" "^27.5.0" + "@jest/transform" "^27.5.0" + "@jest/types" "^27.5.0" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" - graceful-fs "^4.2.4" - jest-changed-files "^27.4.2" - jest-config "^27.4.7" - jest-haste-map "^27.4.6" - jest-message-util "^27.4.6" - jest-regex-util "^27.4.0" - jest-resolve "^27.4.6" - jest-resolve-dependencies "^27.4.6" - jest-runner "^27.4.6" - jest-runtime "^27.4.6" - jest-snapshot "^27.4.6" - jest-util "^27.4.2" - jest-validate "^27.4.6" - jest-watcher "^27.4.6" + graceful-fs "^4.2.9" + jest-changed-files "^27.5.0" + jest-config "^27.5.0" + jest-haste-map "^27.5.0" + jest-message-util "^27.5.0" + jest-regex-util "^27.5.0" + jest-resolve "^27.5.0" + jest-resolve-dependencies "^27.5.0" + jest-runner "^27.5.0" + jest-runtime "^27.5.0" + jest-snapshot "^27.5.0" + jest-util "^27.5.0" + jest-validate "^27.5.0" + jest-watcher "^27.5.0" micromatch "^4.0.4" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.4.6": - version "27.4.6" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.4.6.tgz#1e92885d64f48c8454df35ed9779fbcf31c56d8b" - integrity sha512-E6t+RXPfATEEGVidr84WngLNWZ8ffCPky8RqqRK6u1Bn0LK92INe0MDttyPl/JOzaq92BmDzOeuqk09TvM22Sg== +"@jest/environment@^27.5.0": + version "27.5.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.5.0.tgz#a473bc76261aad7dfa3a1d8e35155953a5ba3436" + integrity sha512-lg0JFsMaLKgpwzs0knOg21Z4OQwaJoBLutnmYzip4tyLTXP21VYWtYGpLXgx42fw/Mw05m1WDXWKgwR6WnsiTw== dependencies: - "@jest/fake-timers" "^27.4.6" - "@jest/types" "^27.4.2" + "@jest/fake-timers" "^27.5.0" + "@jest/types" "^27.5.0" "@types/node" "*" - jest-mock "^27.4.6" + jest-mock "^27.5.0" -"@jest/fake-timers@^27.4.6": - version "27.4.6" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.4.6.tgz#e026ae1671316dbd04a56945be2fa251204324e8" - integrity sha512-mfaethuYF8scV8ntPpiVGIHQgS0XIALbpY2jt2l7wb/bvq4Q5pDLk4EP4D7SAvYT1QrPOPVZAtbdGAOOyIgs7A== +"@jest/fake-timers@^27.5.0": + version "27.5.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.5.0.tgz#f9e07b4c723a535f7c532cfb403394fa40d88c8a" + integrity sha512-e3WrlpqSHq3HAQ03JFjTn8YCrsyg640/sr1rjkM2rNv8z1ufjudpv4xq6DvvTJYB6FuUrfg0g+7bSKPet5QfCQ== dependencies: - "@jest/types" "^27.4.2" + "@jest/types" "^27.5.0" "@sinonjs/fake-timers" "^8.0.1" "@types/node" "*" - jest-message-util "^27.4.6" - jest-mock "^27.4.6" - jest-util "^27.4.2" + jest-message-util "^27.5.0" + jest-mock "^27.5.0" + jest-util "^27.5.0" -"@jest/globals@^27.4.6": - version "27.4.6" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.4.6.tgz#3f09bed64b0fd7f5f996920258bd4be8f52f060a" - integrity sha512-kAiwMGZ7UxrgPzu8Yv9uvWmXXxsy0GciNejlHvfPIfWkSxChzv6bgTS3YqBkGuHcis+ouMFI2696n2t+XYIeFw== +"@jest/globals@^27.5.0": + version "27.5.0" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.5.0.tgz#16271323f79e3b0fe0842e9588241d202a6c2aff" + integrity sha512-wWpMnTiR65Q4JD7fr2BqN+ZDbi99mmILnEM6u7AaX4geASEIVvQsiB4RCvwZrIX5YZCsAjviJQVq9CYddLABkg== dependencies: - "@jest/environment" "^27.4.6" - "@jest/types" "^27.4.2" - expect "^27.4.6" + "@jest/environment" "^27.5.0" + "@jest/types" "^27.5.0" + expect "^27.5.0" -"@jest/reporters@^27.4.6": - version "27.4.6" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.4.6.tgz#b53dec3a93baf9b00826abf95b932de919d6d8dd" - integrity sha512-+Zo9gV81R14+PSq4wzee4GC2mhAN9i9a7qgJWL90Gpx7fHYkWpTBvwWNZUXvJByYR9tAVBdc8VxDWqfJyIUrIQ== +"@jest/reporters@^27.5.0": + version "27.5.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.5.0.tgz#e7602e12656b5051bf4e784cbdd82d4ec1299e33" + integrity sha512-DG+BmVSx2uaJSTKz5z1eScgHTQ6/cZ5CCKSpmpr4sXQPwV2V5aUMOBDwXX1MnqNRhH7/Rq9K97ynnocvho5aMA== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.4.6" - "@jest/test-result" "^27.4.6" - "@jest/transform" "^27.4.6" - "@jest/types" "^27.4.2" + "@jest/console" "^27.5.0" + "@jest/test-result" "^27.5.0" + "@jest/transform" "^27.5.0" + "@jest/types" "^27.5.0" "@types/node" "*" chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" glob "^7.1.2" - graceful-fs "^4.2.4" + graceful-fs "^4.2.9" istanbul-lib-coverage "^3.0.0" istanbul-lib-instrument "^5.1.0" istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-haste-map "^27.4.6" - jest-resolve "^27.4.6" - jest-util "^27.4.2" - jest-worker "^27.4.6" + jest-haste-map "^27.5.0" + jest-resolve "^27.5.0" + jest-util "^27.5.0" + jest-worker "^27.5.0" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" terminal-link "^2.0.0" v8-to-istanbul "^8.1.0" -"@jest/source-map@^27.4.0": - version "27.4.0" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.4.0.tgz#2f0385d0d884fb3e2554e8f71f8fa957af9a74b6" - integrity sha512-Ntjx9jzP26Bvhbm93z/AKcPRj/9wrkI88/gK60glXDx1q+IeI0rf7Lw2c89Ch6ofonB0On/iRDreQuQ6te9pgQ== +"@jest/source-map@^27.5.0": + version "27.5.0" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.5.0.tgz#f22a7e759b8807491f84719c01acf433b917c7a0" + integrity sha512-0xr7VZ+JNCRrlCyRMYhquUm8eU3kNdGDaIW4s3L625bNjk273v9ZhAm3YczIuzJzYH0pnjT+QSCiZQegWKjeow== dependencies: callsites "^3.0.0" - graceful-fs "^4.2.4" + graceful-fs "^4.2.9" source-map "^0.6.0" -"@jest/test-result@^27.4.6": - version "27.4.6" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.4.6.tgz#b3df94c3d899c040f602cea296979844f61bdf69" - integrity sha512-fi9IGj3fkOrlMmhQqa/t9xum8jaJOOAi/lZlm6JXSc55rJMXKHxNDN1oCP39B0/DhNOa2OMupF9BcKZnNtXMOQ== +"@jest/test-result@^27.5.0": + version "27.5.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.5.0.tgz#29e0ace33570c9dcbd47c67e954f77a7d7fff98e" + integrity sha512-Lxecvx5mN6WIeynIyW0dWDQm8UPGMHvTwxUPK+OsZaqBDMGaNDSZtw53VoVk7HyT6AcRblMR/pfa0XucmH4hGw== dependencies: - "@jest/console" "^27.4.6" - "@jest/types" "^27.4.2" + "@jest/console" "^27.5.0" + "@jest/types" "^27.5.0" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.4.6": - version "27.4.6" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.4.6.tgz#447339b8a3d7b5436f50934df30854e442a9d904" - integrity sha512-3GL+nsf6E1PsyNsJuvPyIz+DwFuCtBdtvPpm/LMXVkBJbdFvQYCDpccYT56qq5BGniXWlE81n2qk1sdXfZebnw== +"@jest/test-sequencer@^27.5.0": + version "27.5.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.5.0.tgz#68beceb3de818dcb34fb3ea59be3c22c890bb6e5" + integrity sha512-WzjcDflqbpWe+SnJPCvB2gB6haGfrkzAgzY6Pb1aq+EPoVAj2mwBaKN0ROWI4H87aSslCjq2M+BUQFNJ8VpnDA== dependencies: - "@jest/test-result" "^27.4.6" - graceful-fs "^4.2.4" - jest-haste-map "^27.4.6" - jest-runtime "^27.4.6" + "@jest/test-result" "^27.5.0" + graceful-fs "^4.2.9" + jest-haste-map "^27.5.0" + jest-runtime "^27.5.0" -"@jest/transform@^27.4.6": - version "27.4.6" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.4.6.tgz#153621940b1ed500305eacdb31105d415dc30231" - integrity sha512-9MsufmJC8t5JTpWEQJ0OcOOAXaH5ioaIX6uHVBLBMoCZPfKKQF+EqP8kACAvCZ0Y1h2Zr3uOccg8re+Dr5jxyw== +"@jest/transform@^27.5.0": + version "27.5.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.5.0.tgz#a4941e69ac51e8aa9a255ff4855b564c228c400b" + integrity sha512-yXUy/iO3TH1itxJ9BF7LLjuXt8TtgtjAl0PBQbUaCvRa+L0yYBob6uayW9dFRX/CDQweouLhvmXh44zRiaB+yA== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^27.4.2" + "@jest/types" "^27.5.0" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" - graceful-fs "^4.2.4" - jest-haste-map "^27.4.6" - jest-regex-util "^27.4.0" - jest-util "^27.4.2" + graceful-fs "^4.2.9" + jest-haste-map "^27.5.0" + jest-regex-util "^27.5.0" + jest-util "^27.5.0" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" @@ -706,6 +706,17 @@ "@types/yargs" "^16.0.0" chalk "^4.0.0" +"@jest/types@^27.5.0": + version "27.5.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.5.0.tgz#6ad04a5c5355fd9f46e5cf761850e0edb3c209dd" + integrity sha512-oDHEp7gwSgA82RZ6pzUL3ugM2njP/lVB1MsxRZNOBk+CoNvh9SpH1lQixPFc/kDlV50v59csiW4HLixWmhmgPQ== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^16.0.0" + chalk "^4.0.0" + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -1086,18 +1097,18 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= -babel-jest@^27.4.6: - version "27.4.6" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.4.6.tgz#4d024e69e241cdf4f396e453a07100f44f7ce314" - integrity sha512-qZL0JT0HS1L+lOuH+xC2DVASR3nunZi/ozGhpgauJHgmI7f8rudxf6hUjEHympdQ/J64CdKmPkgfJ+A3U6QCrg== +babel-jest@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.5.0.tgz#c653985241af3c76f59d70d65a570860c2594a50" + integrity sha512-puhCyvBTNLevhbd1oyw6t3gWBicWoUARQYKCBB/B1moif17NbyhxbsfadqZIw8zfJJD+W7Vw0Nb20pEjLxkXqQ== dependencies: - "@jest/transform" "^27.4.6" - "@jest/types" "^27.4.2" + "@jest/transform" "^27.5.0" + "@jest/types" "^27.5.0" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^27.4.0" + babel-preset-jest "^27.5.0" chalk "^4.0.0" - graceful-fs "^4.2.4" + graceful-fs "^4.2.9" slash "^3.0.0" babel-plugin-istanbul@^6.1.1: @@ -1111,10 +1122,10 @@ babel-plugin-istanbul@^6.1.1: istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^27.4.0: - version "27.4.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.4.0.tgz#d7831fc0f93573788d80dee7e682482da4c730d6" - integrity sha512-Jcu7qS4OX5kTWBc45Hz7BMmgXuJqRnhatqpUhnzGC3OBYpOmf2tv6jFNwZpwM7wU7MUuv2r9IPS/ZlYOuburVw== +babel-plugin-jest-hoist@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.5.0.tgz#8fdf07835f2165a068de3ce95fd7749a89801b51" + integrity sha512-ztwNkHl+g1GaoQcb8f2BER4C3LMvSXuF7KVqtUioXQgScSEnkl6lLgCILUYIR+CPTwL8H3F/PNLze64HPWF9JA== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -1139,12 +1150,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^27.4.0: - version "27.4.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.4.0.tgz#70d0e676a282ccb200fbabd7f415db5fdf393bca" - integrity sha512-NK4jGYpnBvNxcGo7/ZpZJr51jCGT+3bwwpVIDY2oNfTxJJldRtB4VAcYdgp1loDE50ODuTu+yBjpMAswv5tlpg== +babel-preset-jest@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.5.0.tgz#4e308711c3d2ff1f45cf5d9a23646e37b621fc9f" + integrity sha512-7bfu1cJBlgK/nKfTvMlElzA3jpi6GzDWX3fntnyP2cQSzoi/KUz6ewGlcb3PSRYZGyv+uPnVHY0Im3JbsViqgA== dependencies: - babel-plugin-jest-hoist "^27.4.0" + babel-plugin-jest-hoist "^27.5.0" babel-preset-current-node-syntax "^1.0.0" balanced-match@^1.0.0: @@ -1406,6 +1417,11 @@ diff-sequences@^27.4.0: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.4.0.tgz#d783920ad8d06ec718a060d00196dfef25b132a5" integrity sha512-YqiQzkrsmHMH5uuh8OdQFU9/ZpADnwzml8z0O5HvRNda+5UZsaX/xN+AAxfR2hWq1Y7HZnAzO9J5lJXOuDz2Ww== +diff-sequences@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.5.0.tgz#a8ac0cb742b17d6f30a6c43e233893a2402c0729" + integrity sha512-ZsOBWnhXiH+Zn0DcBNX/tiQsqrREHs/6oQsEVy2VJJjrTblykPima11pyHMSA/7PGmD+fwclTnKVKL/qtNREDQ== + diff@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" @@ -1643,15 +1659,15 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^27.4.6: - version "27.4.6" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.4.6.tgz#f335e128b0335b6ceb4fcab67ece7cbd14c942e6" - integrity sha512-1M/0kAALIaj5LaG66sFJTbRsWTADnylly82cu4bspI0nl+pgP4E6Bh/aqdHlTUjul06K7xQnnrAoqfxVU0+/ag== +expect@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.5.0.tgz#ea2fbebb483c274043098c34a53923a0aee493f0" + integrity sha512-z73GZ132cBqrapO0X6BeRjyBXqOt9YeRtnDteHJIQqp5s2pZ41Hz23VUbsVFMfkrsFLU9GwoIRS0ZzLuFK8M5w== dependencies: - "@jest/types" "^27.4.2" - jest-get-type "^27.4.0" - jest-matcher-utils "^27.4.6" - jest-message-util "^27.4.6" + "@jest/types" "^27.5.0" + jest-get-type "^27.5.0" + jest-matcher-utils "^27.5.0" + jest-message-util "^27.5.0" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1839,6 +1855,11 @@ graceful-fs@^4.2.4: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== +graceful-fs@^4.2.9: + version "4.2.9" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96" + integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ== + has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -2047,84 +2068,84 @@ istanbul-reports@^3.1.3: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.4.2.tgz#da2547ea47c6e6a5f6ed336151bd2075736eb4a5" - integrity sha512-/9x8MjekuzUQoPjDHbBiXbNEBauhrPU2ct7m8TfCg69ywt1y/N+yYwGh3gCpnqUS3klYWDU/lSNgv+JhoD2k1A== +jest-changed-files@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.5.0.tgz#61e8d0a7394c1ee1cec4c2893e206e62b1566066" + integrity sha512-BGWKI7E6ORqbF5usF1oA4ftbkhVZVrXr8jB0/BrU6TAn3kfOVwX2Zx6pKIXYutJ+qNEjT8Da/gGak0ajya/StA== dependencies: - "@jest/types" "^27.4.2" + "@jest/types" "^27.5.0" execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.4.6: - version "27.4.6" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.4.6.tgz#d3af34c0eb742a967b1919fbb351430727bcea6c" - integrity sha512-UA7AI5HZrW4wRM72Ro80uRR2Fg+7nR0GESbSI/2M+ambbzVuA63mn5T1p3Z/wlhntzGpIG1xx78GP2YIkf6PhQ== +jest-circus@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.5.0.tgz#fcff8829ceb2c8ef4b4532ace7734d156c6664b9" + integrity sha512-+NPd1OxpAHYKjbW8dgL0huFgmtZRKSUKee/UtRgZJEfAxCeA12d7sp0coh5EGDBpW4fCk1Pcia/2dG+j6BQvdw== dependencies: - "@jest/environment" "^27.4.6" - "@jest/test-result" "^27.4.6" - "@jest/types" "^27.4.2" + "@jest/environment" "^27.5.0" + "@jest/test-result" "^27.5.0" + "@jest/types" "^27.5.0" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" - expect "^27.4.6" + expect "^27.5.0" is-generator-fn "^2.0.0" - jest-each "^27.4.6" - jest-matcher-utils "^27.4.6" - jest-message-util "^27.4.6" - jest-runtime "^27.4.6" - jest-snapshot "^27.4.6" - jest-util "^27.4.2" - pretty-format "^27.4.6" + jest-each "^27.5.0" + jest-matcher-utils "^27.5.0" + jest-message-util "^27.5.0" + jest-runtime "^27.5.0" + jest-snapshot "^27.5.0" + jest-util "^27.5.0" + pretty-format "^27.5.0" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.4.7: - version "27.4.7" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.4.7.tgz#d00e759e55d77b3bcfea0715f527c394ca314e5a" - integrity sha512-zREYhvjjqe1KsGV15mdnxjThKNDgza1fhDT+iUsXWLCq3sxe9w5xnvyctcYVT5PcdLSjv7Y5dCwTS3FCF1tiuw== +jest-cli@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.5.0.tgz#06557ad22818740fb28481089a574ba107a8b369" + integrity sha512-9ANs79Goz1ULKtG7HDm/F//4E69v8EFOLXRIHmeC/eK1xTUeQGlU6XP0Zwst386sKaKB4O60qhWY/UaTBS2MLA== dependencies: - "@jest/core" "^27.4.7" - "@jest/test-result" "^27.4.6" - "@jest/types" "^27.4.2" + "@jest/core" "^27.5.0" + "@jest/test-result" "^27.5.0" + "@jest/types" "^27.5.0" chalk "^4.0.0" exit "^0.1.2" - graceful-fs "^4.2.4" + graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^27.4.7" - jest-util "^27.4.2" - jest-validate "^27.4.6" + jest-config "^27.5.0" + jest-util "^27.5.0" + jest-validate "^27.5.0" prompts "^2.0.1" yargs "^16.2.0" -jest-config@^27.4.7: - version "27.4.7" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.4.7.tgz#4f084b2acbd172c8b43aa4cdffe75d89378d3972" - integrity sha512-xz/o/KJJEedHMrIY9v2ParIoYSrSVY6IVeE4z5Z3i101GoA5XgfbJz+1C8EYPsv7u7f39dS8F9v46BHDhn0vlw== +jest-config@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.5.0.tgz#d96ccf8e26d3f2f3ae6543686c48449c201bb621" + integrity sha512-eOIpvpXFz5WHuIYZN1QmvBLEjsSk3w+IAC/2jBpZClbprF53Bj9meBMgAbE15DSkaaJBDFmhXXd1L2eCLaWxQw== dependencies: "@babel/core" "^7.8.0" - "@jest/test-sequencer" "^27.4.6" - "@jest/types" "^27.4.2" - babel-jest "^27.4.6" + "@jest/test-sequencer" "^27.5.0" + "@jest/types" "^27.5.0" + babel-jest "^27.5.0" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.1" - graceful-fs "^4.2.4" - jest-circus "^27.4.6" - jest-environment-jsdom "^27.4.6" - jest-environment-node "^27.4.6" - jest-get-type "^27.4.0" - jest-jasmine2 "^27.4.6" - jest-regex-util "^27.4.0" - jest-resolve "^27.4.6" - jest-runner "^27.4.6" - jest-util "^27.4.2" - jest-validate "^27.4.6" + graceful-fs "^4.2.9" + jest-circus "^27.5.0" + jest-environment-jsdom "^27.5.0" + jest-environment-node "^27.5.0" + jest-get-type "^27.5.0" + jest-jasmine2 "^27.5.0" + jest-regex-util "^27.5.0" + jest-resolve "^27.5.0" + jest-runner "^27.5.0" + jest-util "^27.5.0" + jest-validate "^27.5.0" micromatch "^4.0.4" - pretty-format "^27.4.6" + pretty-format "^27.5.0" slash "^3.0.0" jest-diff@^27.0.0: @@ -2137,146 +2158,151 @@ jest-diff@^27.0.0: jest-get-type "^27.4.0" pretty-format "^27.4.2" -jest-diff@^27.4.6: - version "27.4.6" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.4.6.tgz#93815774d2012a2cbb6cf23f84d48c7a2618f98d" - integrity sha512-zjaB0sh0Lb13VyPsd92V7HkqF6yKRH9vm33rwBt7rPYrpQvS1nCvlIy2pICbKta+ZjWngYLNn4cCK4nyZkjS/w== +jest-diff@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.5.0.tgz#34dc608a3b9159df178dd480b6d835b5e6b92082" + integrity sha512-zztvHDCq/QcAVv+o6rts0reupSOxyrX+KLQEOMWCW2trZgcBFgp/oTK7hJCGpXvEIqKrQzyQlaPKn9W04+IMQg== dependencies: chalk "^4.0.0" - diff-sequences "^27.4.0" - jest-get-type "^27.4.0" - pretty-format "^27.4.6" + diff-sequences "^27.5.0" + jest-get-type "^27.5.0" + pretty-format "^27.5.0" -jest-docblock@^27.4.0: - version "27.4.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.4.0.tgz#06c78035ca93cbbb84faf8fce64deae79a59f69f" - integrity sha512-7TBazUdCKGV7svZ+gh7C8esAnweJoG+SvcF6Cjqj4l17zA2q1cMwx2JObSioubk317H+cjcHgP+7fTs60paulg== +jest-docblock@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.5.0.tgz#096fa3a8b55d019a954ef7cc205c791bf94b2352" + integrity sha512-U4MtJgdZn2x+jpPzd7NAYvDmgJAA5h9QxVAwsyuH7IymGzY8VGHhAkHcIGOmtmdC61ORLxCbEhj6fCJsaCWzXA== dependencies: detect-newline "^3.0.0" -jest-each@^27.4.6: - version "27.4.6" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.4.6.tgz#e7e8561be61d8cc6dbf04296688747ab186c40ff" - integrity sha512-n6QDq8y2Hsmn22tRkgAk+z6MCX7MeVlAzxmZDshfS2jLcaBlyhpF3tZSJLR+kXmh23GEvS0ojMR8i6ZeRvpQcA== +jest-each@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.5.0.tgz#7bd00a767df0fbec0caba3df0d2c0b3268a2ce84" + integrity sha512-2vpajSdDMZmAxjSP1f4BG9KKduwHtuaI0w66oqLUkfaGUU7Ix/W+d8BW0h3/QEJiew7hR0GSblqdFwTEEbhBdw== dependencies: - "@jest/types" "^27.4.2" + "@jest/types" "^27.5.0" chalk "^4.0.0" - jest-get-type "^27.4.0" - jest-util "^27.4.2" - pretty-format "^27.4.6" - -jest-environment-jsdom@^27.4.6: - version "27.4.6" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.4.6.tgz#c23a394eb445b33621dfae9c09e4c8021dea7b36" - integrity sha512-o3dx5p/kHPbUlRvSNjypEcEtgs6LmvESMzgRFQE6c+Prwl2JLA4RZ7qAnxc5VM8kutsGRTB15jXeeSbJsKN9iA== - dependencies: - "@jest/environment" "^27.4.6" - "@jest/fake-timers" "^27.4.6" - "@jest/types" "^27.4.2" + jest-get-type "^27.5.0" + jest-util "^27.5.0" + pretty-format "^27.5.0" + +jest-environment-jsdom@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.5.0.tgz#6d22d9b76890e9b82c7e1062a15730efb3fb7361" + integrity sha512-sX49N8rjp6HSHeGpNgLk6mtHRd1IPAnE/u7wLQkb6Tz/1E08Q++Y8Zk/IbpVdcFywbzH1icFqEuDuHJ6o+uXXg== + dependencies: + "@jest/environment" "^27.5.0" + "@jest/fake-timers" "^27.5.0" + "@jest/types" "^27.5.0" "@types/node" "*" - jest-mock "^27.4.6" - jest-util "^27.4.2" + jest-mock "^27.5.0" + jest-util "^27.5.0" jsdom "^16.6.0" -jest-environment-node@^27.4.6: - version "27.4.6" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.4.6.tgz#ee8cd4ef458a0ef09d087c8cd52ca5856df90242" - integrity sha512-yfHlZ9m+kzTKZV0hVfhVu6GuDxKAYeFHrfulmy7Jxwsq4V7+ZK7f+c0XP/tbVDMQW7E4neG2u147hFkuVz0MlQ== +jest-environment-node@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.5.0.tgz#1ab357b4715bff88d48c8b62b8379002ff955dd1" + integrity sha512-7UzisMMfGyrURhS/eUa7p7mgaqN3ajHylsjOgfcn0caNeYRZq4LHKZLfAxrPM34DWLnBZcRupEJlpQsizdSUsw== dependencies: - "@jest/environment" "^27.4.6" - "@jest/fake-timers" "^27.4.6" - "@jest/types" "^27.4.2" + "@jest/environment" "^27.5.0" + "@jest/fake-timers" "^27.5.0" + "@jest/types" "^27.5.0" "@types/node" "*" - jest-mock "^27.4.6" - jest-util "^27.4.2" + jest-mock "^27.5.0" + jest-util "^27.5.0" jest-get-type@^27.4.0: version "27.4.0" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.4.0.tgz#7503d2663fffa431638337b3998d39c5e928e9b5" integrity sha512-tk9o+ld5TWq41DkK14L4wox4s2D9MtTpKaAVzXfr5CUKm5ZK2ExcaFE0qls2W71zE/6R2TxxrK9w2r6svAFDBQ== -jest-haste-map@^27.4.6: - version "27.4.6" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.4.6.tgz#c60b5233a34ca0520f325b7e2cc0a0140ad0862a" - integrity sha512-0tNpgxg7BKurZeFkIOvGCkbmOHbLFf4LUQOxrQSMjvrQaQe3l6E8x6jYC1NuWkGo5WDdbr8FEzUxV2+LWNawKQ== +jest-get-type@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.5.0.tgz#861c24aa1b176be83c902292cb9618d580cac8a7" + integrity sha512-Vp6O8a52M/dahXRG/E0EJuWQROps2mDQ0sJYPgO8HskhdLwj9ajgngy2OAqZgV6e/RcU67WUHq6TgfvJb8flbA== + +jest-haste-map@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.5.0.tgz#7cc3a920caf304c89fbfceb5d5717b929873f175" + integrity sha512-0KfckSBEKV+D6e0toXmIj4zzp72EiBnvkC0L+xYxenkLhAdkp2/8tye4AgMzz7Fqb1r8SWtz7+s1UQLrxMBang== dependencies: - "@jest/types" "^27.4.2" + "@jest/types" "^27.5.0" "@types/graceful-fs" "^4.1.2" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" - graceful-fs "^4.2.4" - jest-regex-util "^27.4.0" - jest-serializer "^27.4.0" - jest-util "^27.4.2" - jest-worker "^27.4.6" + graceful-fs "^4.2.9" + jest-regex-util "^27.5.0" + jest-serializer "^27.5.0" + jest-util "^27.5.0" + jest-worker "^27.5.0" micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.4.6: - version "27.4.6" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.4.6.tgz#109e8bc036cb455950ae28a018f983f2abe50127" - integrity sha512-uAGNXF644I/whzhsf7/qf74gqy9OuhvJ0XYp8SDecX2ooGeaPnmJMjXjKt0mqh1Rl5dtRGxJgNrHlBQIBfS5Nw== +jest-jasmine2@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.5.0.tgz#589d6574d1318d3fb41b3fc368344117ec417dcc" + integrity sha512-X7sT3HLNjjrBEepilxzPyNhNdyunaFBepo1L3T/fvYb9tb8Wb8qY576gwIa+SZcqYUqAA7/bT3EpZI4lAp0Qew== dependencies: - "@jest/environment" "^27.4.6" - "@jest/source-map" "^27.4.0" - "@jest/test-result" "^27.4.6" - "@jest/types" "^27.4.2" + "@jest/environment" "^27.5.0" + "@jest/source-map" "^27.5.0" + "@jest/test-result" "^27.5.0" + "@jest/types" "^27.5.0" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^27.4.6" + expect "^27.5.0" is-generator-fn "^2.0.0" - jest-each "^27.4.6" - jest-matcher-utils "^27.4.6" - jest-message-util "^27.4.6" - jest-runtime "^27.4.6" - jest-snapshot "^27.4.6" - jest-util "^27.4.2" - pretty-format "^27.4.6" + jest-each "^27.5.0" + jest-matcher-utils "^27.5.0" + jest-message-util "^27.5.0" + jest-runtime "^27.5.0" + jest-snapshot "^27.5.0" + jest-util "^27.5.0" + pretty-format "^27.5.0" throat "^6.0.1" -jest-leak-detector@^27.4.6: - version "27.4.6" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.4.6.tgz#ed9bc3ce514b4c582637088d9faf58a33bd59bf4" - integrity sha512-kkaGixDf9R7CjHm2pOzfTxZTQQQ2gHTIWKY/JZSiYTc90bZp8kSZnUMS3uLAfwTZwc0tcMRoEX74e14LG1WapA== +jest-leak-detector@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.5.0.tgz#c98c02e64eab4da9a8b91f058d2b7473272272ee" + integrity sha512-Ak3k+DD3ao5d4/zzJrxAQ5UV5wiCrp47jH94ZD4/vXSzQgE6WBVDfg83VtculLILO7Y6/Q/7yzKSrtN9Na8luA== dependencies: - jest-get-type "^27.4.0" - pretty-format "^27.4.6" + jest-get-type "^27.5.0" + pretty-format "^27.5.0" -jest-matcher-utils@^27.4.6: - version "27.4.6" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.4.6.tgz#53ca7f7b58170638590e946f5363b988775509b8" - integrity sha512-XD4PKT3Wn1LQnRAq7ZsTI0VRuEc9OrCPFiO1XL7bftTGmfNF0DcEwMHRgqiu7NGf8ZoZDREpGrCniDkjt79WbA== +jest-matcher-utils@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.5.0.tgz#d2fc737224fb3bfa38eaa2393ac5bc953d5c5697" + integrity sha512-5ruyzWMGb1ilCWD6ECwNdOhQBeIXAjHmHd5c3uO6quR7RIMHPRP2ucOaejz2j+0R0Ko4GanWM6SqXAeF8nYN5g== dependencies: chalk "^4.0.0" - jest-diff "^27.4.6" - jest-get-type "^27.4.0" - pretty-format "^27.4.6" + jest-diff "^27.5.0" + jest-get-type "^27.5.0" + pretty-format "^27.5.0" -jest-message-util@^27.4.6: - version "27.4.6" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.4.6.tgz#9fdde41a33820ded3127465e1a5896061524da31" - integrity sha512-0p5szriFU0U74czRSFjH6RyS7UYIAkn/ntwMuOwTGWrQIOh5NzXXrq72LOqIkJKKvFbPq+byZKuBz78fjBERBA== +jest-message-util@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.5.0.tgz#654a781b38a305b1fd8120053c784c67bca00a52" + integrity sha512-lfbWRhTtmZMEHPAtl0SrvNzK1F4UnVNMHOliRQT2BJ4sBFzIb0gBCHA4ebWD4o6l1fUyvDPxM01K9OIMQTAdQw== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^27.4.2" + "@jest/types" "^27.5.0" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" - graceful-fs "^4.2.4" + graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^27.4.6" + pretty-format "^27.5.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^27.4.6: - version "27.4.6" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.4.6.tgz#77d1ba87fbd33ccb8ef1f061697e7341b7635195" - integrity sha512-kvojdYRkst8iVSZ1EJ+vc1RRD9llueBjKzXzeCytH3dMM7zvPV/ULcfI2nr0v0VUgm3Bjt3hBCQvOeaBz+ZTHw== +jest-mock@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.5.0.tgz#1018656fe6bcd0f58fd1edca7f420169f6707c6e" + integrity sha512-PHluG6MJGng82/sxh8OiB9fnxzNn3cazceSHCAmAKs4g5rMhc3EZCrJXv+4w61rA2WGagMUj7QLLrA1SRlFpzQ== dependencies: - "@jest/types" "^27.4.2" + "@jest/types" "^27.5.0" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -2284,129 +2310,128 @@ jest-pnp-resolver@^1.2.2: resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== -jest-regex-util@^27.4.0: - version "27.4.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.4.0.tgz#e4c45b52653128843d07ad94aec34393ea14fbca" - integrity sha512-WeCpMpNnqJYMQoOjm1nTtsgbR4XHAk1u00qDoNBQoykM280+/TmgA5Qh5giC1ecy6a5d4hbSsHzpBtu5yvlbEg== +jest-regex-util@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.5.0.tgz#26c26cf15a73edba13cb8930e261443d25ed8608" + integrity sha512-e9LqSd6HsDsqd7KS3rNyYwmQAaG9jq4U3LbnwVxN/y3nNlDzm2OFs596uo9zrUY+AV1opXq6ome78tRDUCRWfA== -jest-resolve-dependencies@^27.4.6: - version "27.4.6" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.4.6.tgz#fc50ee56a67d2c2183063f6a500cc4042b5e2327" - integrity sha512-W85uJZcFXEVZ7+MZqIPCscdjuctruNGXUZ3OHSXOfXR9ITgbUKeHj+uGcies+0SsvI5GtUfTw4dY7u9qjTvQOw== +jest-resolve-dependencies@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.5.0.tgz#8e3b15589848995ddc9a39f49462dad5b7bc14a2" + integrity sha512-xQsy7CmrT4CJxdNUEdzZU2M/v6YmtQ/pkJM+sx7TA1siG1zfsZuo78PZvzglwRMQFr88f3Su4Om8OEBAic+SMw== dependencies: - "@jest/types" "^27.4.2" - jest-regex-util "^27.4.0" - jest-snapshot "^27.4.6" + "@jest/types" "^27.5.0" + jest-regex-util "^27.5.0" + jest-snapshot "^27.5.0" -jest-resolve@^27.4.6: - version "27.4.6" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.4.6.tgz#2ec3110655e86d5bfcfa992e404e22f96b0b5977" - integrity sha512-SFfITVApqtirbITKFAO7jOVN45UgFzcRdQanOFzjnbd+CACDoyeX7206JyU92l4cRr73+Qy/TlW51+4vHGt+zw== +jest-resolve@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.5.0.tgz#a8e95a68dfb4a59faa508d7b6d2c6a02dcabb712" + integrity sha512-PkDpYEGV/nFqThnIrlPtj8oTxyAV3iuuS6or7dZYyUWaHr/tyyVb5qfBmZS6FEr7ozBHgjrF1bgcgIefnlicbw== dependencies: - "@jest/types" "^27.4.2" + "@jest/types" "^27.5.0" chalk "^4.0.0" - graceful-fs "^4.2.4" - jest-haste-map "^27.4.6" + graceful-fs "^4.2.9" + jest-haste-map "^27.5.0" jest-pnp-resolver "^1.2.2" - jest-util "^27.4.2" - jest-validate "^27.4.6" + jest-util "^27.5.0" + jest-validate "^27.5.0" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^27.4.6: - version "27.4.6" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.4.6.tgz#1d390d276ec417e9b4d0d081783584cbc3e24773" - integrity sha512-IDeFt2SG4DzqalYBZRgbbPmpwV3X0DcntjezPBERvnhwKGWTW7C5pbbA5lVkmvgteeNfdd/23gwqv3aiilpYPg== +jest-runner@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.5.0.tgz#b5747a4444b4d3faae019bd201943948882d26c3" + integrity sha512-RMzXhkJLLOKKgUPY2trpyVBijaFmswMtgoCCBk2PQVRHC6yo1vLd1/jmFP39s5OXXnt7rntuzKSYvxl+QUibqQ== dependencies: - "@jest/console" "^27.4.6" - "@jest/environment" "^27.4.6" - "@jest/test-result" "^27.4.6" - "@jest/transform" "^27.4.6" - "@jest/types" "^27.4.2" + "@jest/console" "^27.5.0" + "@jest/environment" "^27.5.0" + "@jest/test-result" "^27.5.0" + "@jest/transform" "^27.5.0" + "@jest/types" "^27.5.0" "@types/node" "*" chalk "^4.0.0" emittery "^0.8.1" - exit "^0.1.2" - graceful-fs "^4.2.4" - jest-docblock "^27.4.0" - jest-environment-jsdom "^27.4.6" - jest-environment-node "^27.4.6" - jest-haste-map "^27.4.6" - jest-leak-detector "^27.4.6" - jest-message-util "^27.4.6" - jest-resolve "^27.4.6" - jest-runtime "^27.4.6" - jest-util "^27.4.2" - jest-worker "^27.4.6" + graceful-fs "^4.2.9" + jest-docblock "^27.5.0" + jest-environment-jsdom "^27.5.0" + jest-environment-node "^27.5.0" + jest-haste-map "^27.5.0" + jest-leak-detector "^27.5.0" + jest-message-util "^27.5.0" + jest-resolve "^27.5.0" + jest-runtime "^27.5.0" + jest-util "^27.5.0" + jest-worker "^27.5.0" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.4.6: - version "27.4.6" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.4.6.tgz#83ae923818e3ea04463b22f3597f017bb5a1cffa" - integrity sha512-eXYeoR/MbIpVDrjqy5d6cGCFOYBFFDeKaNWqTp0h6E74dK0zLHzASQXJpl5a2/40euBmKnprNLJ0Kh0LCndnWQ== - dependencies: - "@jest/environment" "^27.4.6" - "@jest/fake-timers" "^27.4.6" - "@jest/globals" "^27.4.6" - "@jest/source-map" "^27.4.0" - "@jest/test-result" "^27.4.6" - "@jest/transform" "^27.4.6" - "@jest/types" "^27.4.2" +jest-runtime@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.5.0.tgz#2497116742b9e7cc1e5381a9ded36602b8b0c78c" + integrity sha512-T7APxCPjN3p3ePcLuypbWtD0UZHyAdvIADZ9ABI/sFZ9t/Rf2xIUd6D7RzZIX+unewJRooVGWrgDIgeUuj0OUA== + dependencies: + "@jest/environment" "^27.5.0" + "@jest/fake-timers" "^27.5.0" + "@jest/globals" "^27.5.0" + "@jest/source-map" "^27.5.0" + "@jest/test-result" "^27.5.0" + "@jest/transform" "^27.5.0" + "@jest/types" "^27.5.0" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" execa "^5.0.0" glob "^7.1.3" - graceful-fs "^4.2.4" - jest-haste-map "^27.4.6" - jest-message-util "^27.4.6" - jest-mock "^27.4.6" - jest-regex-util "^27.4.0" - jest-resolve "^27.4.6" - jest-snapshot "^27.4.6" - jest-util "^27.4.2" + graceful-fs "^4.2.9" + jest-haste-map "^27.5.0" + jest-message-util "^27.5.0" + jest-mock "^27.5.0" + jest-regex-util "^27.5.0" + jest-resolve "^27.5.0" + jest-snapshot "^27.5.0" + jest-util "^27.5.0" slash "^3.0.0" strip-bom "^4.0.0" -jest-serializer@^27.4.0: - version "27.4.0" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.4.0.tgz#34866586e1cae2388b7d12ffa2c7819edef5958a" - integrity sha512-RDhpcn5f1JYTX2pvJAGDcnsNTnsV9bjYPU8xcV+xPwOXnUPOQwf4ZEuiU6G9H1UztH+OapMgu/ckEVwO87PwnQ== +jest-serializer@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.5.0.tgz#439a110df27f97a40c114a429b708c2ada15a81f" + integrity sha512-aSDFqQlVXtBH+Zb5dl9mCvTSFkabixk/9P9cpngL4yJKpmEi9USxfDhONFMzJrtftPvZw3PcltUVmtFZTB93rg== dependencies: "@types/node" "*" - graceful-fs "^4.2.4" + graceful-fs "^4.2.9" -jest-snapshot@^27.4.6: - version "27.4.6" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.4.6.tgz#e2a3b4fff8bdce3033f2373b2e525d8b6871f616" - integrity sha512-fafUCDLQfzuNP9IRcEqaFAMzEe7u5BF7mude51wyWv7VRex60WznZIC7DfKTgSIlJa8aFzYmXclmN328aqSDmQ== +jest-snapshot@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.5.0.tgz#c5c4c084f5e10036f31e7647de1a6f28c07681fc" + integrity sha512-cAJj15uqWGkro0bfcv/EgusBnqNgCpRruFQZghsMYTq4Fm2lk/VhAf8DgRr8wvhR6Ue1hkeL8tn70Cw4t8x/5A== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/transform" "^27.4.6" - "@jest/types" "^27.4.2" + "@jest/transform" "^27.5.0" + "@jest/types" "^27.5.0" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.4.6" - graceful-fs "^4.2.4" - jest-diff "^27.4.6" - jest-get-type "^27.4.0" - jest-haste-map "^27.4.6" - jest-matcher-utils "^27.4.6" - jest-message-util "^27.4.6" - jest-util "^27.4.2" + expect "^27.5.0" + graceful-fs "^4.2.9" + jest-diff "^27.5.0" + jest-get-type "^27.5.0" + jest-haste-map "^27.5.0" + jest-matcher-utils "^27.5.0" + jest-message-util "^27.5.0" + jest-util "^27.5.0" natural-compare "^1.4.0" - pretty-format "^27.4.6" + pretty-format "^27.5.0" semver "^7.3.2" -jest-util@^27.0.0, jest-util@^27.4.2: +jest-util@^27.0.0: version "27.4.2" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.4.2.tgz#ed95b05b1adfd761e2cda47e0144c6a58e05a621" integrity sha512-YuxxpXU6nlMan9qyLuxHaMMOzXAl5aGZWCSzben5DhLHemYQxCc4YK+4L3ZrCutT8GPQ+ui9k5D8rUJoDioMnA== @@ -2418,48 +2443,60 @@ jest-util@^27.0.0, jest-util@^27.4.2: graceful-fs "^4.2.4" picomatch "^2.2.3" -jest-validate@^27.4.6: - version "27.4.6" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.4.6.tgz#efc000acc4697b6cf4fa68c7f3f324c92d0c4f1f" - integrity sha512-872mEmCPVlBqbA5dToC57vA3yJaMRfIdpCoD3cyHWJOMx+SJwLNw0I71EkWs41oza/Er9Zno9XuTkRYCPDUJXQ== +jest-util@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.5.0.tgz#0b9540d91b0de65d288f235fa9899e6eeeab8d35" + integrity sha512-FUUqOx0gAzJy3ytatT1Ss372M1kmhczn8x7aE0++11oPGW1FyD/5NjYBI8w1KOXFm6IVjtaZm2szfJJL+CHs0g== dependencies: - "@jest/types" "^27.4.2" + "@jest/types" "^27.5.0" + "@types/node" "*" + chalk "^4.0.0" + ci-info "^3.2.0" + graceful-fs "^4.2.9" + picomatch "^2.2.3" + +jest-validate@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.5.0.tgz#b3df32372d2c832fa5a5e31ee2c37f94f79f7f1f" + integrity sha512-2XZzQWNrY9Ypo11mm4ZeVjvr++CQG/45XnmA2aWwx155lTwy1JGFI8LpQ2dBCSAeO21ooqg/FCIvv9WwfnPClA== + dependencies: + "@jest/types" "^27.5.0" camelcase "^6.2.0" chalk "^4.0.0" - jest-get-type "^27.4.0" + jest-get-type "^27.5.0" leven "^3.1.0" - pretty-format "^27.4.6" + pretty-format "^27.5.0" -jest-watcher@^27.4.6: - version "27.4.6" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.4.6.tgz#673679ebeffdd3f94338c24f399b85efc932272d" - integrity sha512-yKQ20OMBiCDigbD0quhQKLkBO+ObGN79MO4nT7YaCuQ5SM+dkBNWE8cZX0FjU6czwMvWw6StWbe+Wv4jJPJ+fw== +jest-watcher@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.5.0.tgz#ca11c3b9115c92a8fd2fd9e2def296d45206f1ca" + integrity sha512-MhIeIvEd6dnnspE0OfYrqHOAfZZdyFqx/k8U2nvVFSkLYf22qAFfyNWPVQYcwqKVNobcOhJoT0kV/nRHGbqK8A== dependencies: - "@jest/test-result" "^27.4.6" - "@jest/types" "^27.4.2" + "@jest/test-result" "^27.5.0" + "@jest/types" "^27.5.0" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^27.4.2" + jest-util "^27.5.0" string-length "^4.0.1" -jest-worker@^27.4.6: - version "27.4.6" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.4.6.tgz#5d2d93db419566cb680752ca0792780e71b3273e" - integrity sha512-gHWJF/6Xi5CTG5QCvROr6GcmpIqNYpDJyc8A1h/DyXqH1tD6SnRCM0d3U5msV31D2LB/U+E0M+W4oyvKV44oNw== +jest-worker@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.5.0.tgz#99ee77e4d06168107c27328bd7f54e74c3a48d59" + integrity sha512-8OEHiPNOPTfaWnJ2SUHM8fmgeGq37uuGsQBvGKQJl1f+6WIy6g7G3fE2ruI5294bUKUI9FaCWt5hDvO8HSwsSg== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^27.0.1: - version "27.4.7" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.4.7.tgz#87f74b9026a1592f2da05b4d258e57505f28eca4" - integrity sha512-8heYvsx7nV/m8m24Vk26Y87g73Ba6ueUd0MWed/NXMhSZIm62U/llVbS0PJe1SHunbyXjJ/BqG1z9bFjGUIvTg== + version "27.5.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.5.0.tgz#2c04ff88754e42e9fc5240840b91f9a9a8990875" + integrity sha512-sCMZhL9zy0fiFc4H0cKlXq7BcghMSxm5ZnEyaPWTteArU5ix6JjOKyOXSUBGLTQCmt5kuX9zEvQ9BSshHOPB3A== dependencies: - "@jest/core" "^27.4.7" + "@jest/core" "^27.5.0" import-local "^3.0.2" - jest-cli "^27.4.7" + jest-cli "^27.5.0" js-tokens@^4.0.0: version "4.0.0" @@ -2851,10 +2888,10 @@ pretty-format@^27.0.0, pretty-format@^27.4.2: ansi-styles "^5.0.0" react-is "^17.0.1" -pretty-format@^27.4.6: - version "27.4.6" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.4.6.tgz#1b784d2f53c68db31797b2348fa39b49e31846b7" - integrity sha512-NblstegA1y/RJW2VyML+3LlpFjzx62cUrtBIKIWDXEDkjNeleA7Od7nrzcs/VLQvAeV4CgSYhrN39DRN88Qi/g== +pretty-format@^27.5.0: + version "27.5.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.0.tgz#71e1af7a4b587d259fa4668dcd3e94af077767cb" + integrity sha512-xEi6BRPZ+J1AIS4BAtFC/+rh5jXlXObGZjx5+OSpM95vR/PGla78bFVHMy5GdZjP9wk3AHAMHROXq/r69zXltw== dependencies: ansi-regex "^5.0.1" ansi-styles "^5.0.0" From 7ab9d79d104dfcd92df651daf947d8dbee453075 Mon Sep 17 00:00:00 2001 From: Mark Haussmann Date: Tue, 8 Feb 2022 10:22:16 +1300 Subject: [PATCH 500/785] Fix support for piping STDIN Since the change to Open3 `STDIN` is not sent to prettier, so formatting produces an empty output. --- lib/prettier.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/prettier.rb b/lib/prettier.rb index 47b36b2d..e6a8b5be 100644 --- a/lib/prettier.rb +++ b/lib/prettier.rb @@ -12,7 +12,11 @@ def self.run(args) quoted = args.map { |arg| arg.start_with?('-') ? arg : "\"#{arg}\"" } command = "node #{BINARY} --plugin \"#{PLUGIN}\" #{quoted.join(' ')}" - stdout, stderr, status = Open3.capture3({ 'RBPRETTIER' => '1' }, command) + stdout, stderr, status = Open3.capture3( + { 'RBPRETTIER' => '1' }, + command, + stdin_data: STDIN + ) STDOUT.puts(stdout) # If we completed successfully, then just exit out. From 31b50b5899259603a226941b9dd0d559ebb08c86 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Feb 2022 12:01:40 +0000 Subject: [PATCH 501/785] Bump ts-node from 10.4.0 to 10.5.0 Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 10.4.0 to 10.5.0. - [Release notes](https://github.com/TypeStrong/ts-node/releases) - [Commits](https://github.com/TypeStrong/ts-node/compare/v10.4.0...v10.5.0) --- updated-dependencies: - dependency-name: ts-node dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/yarn.lock b/yarn.lock index 16aced40..18ca51e9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -994,12 +994,7 @@ acorn@^7.1.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.2.4, acorn@^8.4.1: - version "8.6.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.6.0.tgz#e3692ba0eb1a0c83eaa4f37f5fa7368dd7142895" - integrity sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw== - -acorn@^8.7.0: +acorn@^8.2.4, acorn@^8.4.1, acorn@^8.7.0: version "8.7.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf" integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ== @@ -3243,9 +3238,9 @@ ts-jest@^27.0.5: yargs-parser "20.x" ts-node@^10.2.1: - version "10.4.0" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.4.0.tgz#680f88945885f4e6cf450e7f0d6223dd404895f7" - integrity sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A== + version "10.5.0" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.5.0.tgz#618bef5854c1fbbedf5e31465cbb224a1d524ef9" + integrity sha512-6kEJKwVxAJ35W4akuiysfKwKmjkbYxwQMTBaAxo9KKAx/Yd26mPUyhGz3ji+EsJoAgrLqVsYHNuuYwQe22lbtw== dependencies: "@cspotcode/source-map-support" "0.7.0" "@tsconfig/node10" "^1.0.7" @@ -3258,6 +3253,7 @@ ts-node@^10.2.1: create-require "^1.1.0" diff "^4.0.1" make-error "^1.1.1" + v8-compile-cache-lib "^3.0.0" yn "3.1.1" tslib@^1.8.1: @@ -3325,6 +3321,11 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" +v8-compile-cache-lib@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.0.tgz#0582bcb1c74f3a2ee46487ceecf372e46bce53e8" + integrity sha512-mpSYqfsFvASnSn5qMiwrr4VKfumbPyONLCOPmsR3A6pTY/r0+tSaVbgPWSAIuzbk3lCTa+FForeTiO+wBQGkjA== + v8-compile-cache@^2.0.3: version "2.3.0" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" From 3dca71ca6329f5212aebfe3d5a606b922cc69de1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Feb 2022 12:01:49 +0000 Subject: [PATCH 502/785] Bump @types/node from 17.0.15 to 17.0.16 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.15 to 17.0.16. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 16aced40..86acef42 100644 --- a/yarn.lock +++ b/yarn.lock @@ -855,9 +855,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^17.0.0": - version "17.0.15" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.15.tgz#97779282c09c09577120a2162e71d8380003590a" - integrity sha512-zWt4SDDv1S9WRBNxLFxFRHxdD9tvH8f5/kg5/IaLFdnSNXsDY4eL3Q3XXN+VxUnWIhyVFDwcsmAprvwXoM/ClA== + version "17.0.16" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.16.tgz#e3733f46797b9df9e853ca9f719c8a6f7b84cd26" + integrity sha512-ydLaGVfQOQ6hI1xK2A5nVh8bl0OGoIfYMxPWHqqYe9bTkWCfqiVvZoh2I/QF2sNSkZzZyROBoTefIEI+PB6iIA== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.3" From 183c69ccf41cf126fb5f084c2c3a6f2acba2493a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Feb 2022 12:02:28 +0000 Subject: [PATCH 503/785] Bump @typescript-eslint/parser from 5.10.2 to 5.11.0 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.10.2 to 5.11.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.11.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index 16aced40..617eb1da 100644 --- a/yarn.lock +++ b/yarn.lock @@ -897,13 +897,13 @@ tsutils "^3.21.0" "@typescript-eslint/parser@^5.4.0": - version "5.10.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.10.2.tgz#b6076d27cc5499ce3f2c625f5ccde946ecb7db9a" - integrity sha512-JaNYGkaQVhP6HNF+lkdOr2cAs2wdSZBoalE22uYWq8IEv/OVH0RksSGydk+sW8cLoSeYmC+OHvRyv2i4AQ7Czg== + version "5.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.11.0.tgz#b4fcaf65513f9b34bdcbffdda055724a5efb7e04" + integrity sha512-x0DCjetHZYBRovJdr3U0zG9OOdNXUaFLJ82ehr1AlkArljJuwEsgnud+Q7umlGDFLFrs8tU8ybQDFocp/eX8mQ== dependencies: - "@typescript-eslint/scope-manager" "5.10.2" - "@typescript-eslint/types" "5.10.2" - "@typescript-eslint/typescript-estree" "5.10.2" + "@typescript-eslint/scope-manager" "5.11.0" + "@typescript-eslint/types" "5.11.0" + "@typescript-eslint/typescript-estree" "5.11.0" debug "^4.3.2" "@typescript-eslint/scope-manager@5.10.2": @@ -914,6 +914,14 @@ "@typescript-eslint/types" "5.10.2" "@typescript-eslint/visitor-keys" "5.10.2" +"@typescript-eslint/scope-manager@5.11.0": + version "5.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.11.0.tgz#f5aef83ff253f457ecbee5f46f762298f0101e4b" + integrity sha512-z+K4LlahDFVMww20t/0zcA7gq/NgOawaLuxgqGRVKS0PiZlCTIUtX0EJbC0BK1JtR4CelmkPK67zuCgpdlF4EA== + dependencies: + "@typescript-eslint/types" "5.11.0" + "@typescript-eslint/visitor-keys" "5.11.0" + "@typescript-eslint/type-utils@5.10.2": version "5.10.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.10.2.tgz#ad5acdf98a7d2ab030bea81f17da457519101ceb" @@ -928,6 +936,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.10.2.tgz#604d15d795c4601fffba6ecb4587ff9fdec68ce8" integrity sha512-Qfp0qk/5j2Rz3p3/WhWgu4S1JtMcPgFLnmAKAW061uXxKSa7VWKZsDXVaMXh2N60CX9h6YLaBoy9PJAfCOjk3w== +"@typescript-eslint/types@5.11.0": + version "5.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.11.0.tgz#ba345818a2540fdf2755c804dc2158517ab61188" + integrity sha512-cxgBFGSRCoBEhvSVLkKw39+kMzUKHlJGVwwMbPcTZX3qEhuXhrjwaZXWMxVfxDgyMm+b5Q5b29Llo2yow8Y7xQ== + "@typescript-eslint/typescript-estree@5.10.2": version "5.10.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.2.tgz#810906056cd3ddcb35aa333fdbbef3713b0fe4a7" @@ -941,6 +954,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.11.0": + version "5.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.11.0.tgz#53f9e09b88368191e52020af77c312a4777ffa43" + integrity sha512-yVH9hKIv3ZN3lw8m/Jy5I4oXO4ZBMqijcXCdA4mY8ull6TPTAoQnKKrcZ0HDXg7Bsl0Unwwx7jcXMuNZc0m4lg== + dependencies: + "@typescript-eslint/types" "5.11.0" + "@typescript-eslint/visitor-keys" "5.11.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.10.2": version "5.10.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.10.2.tgz#1fcd37547c32c648ab11aea7173ec30060ee87a8" @@ -961,6 +987,14 @@ "@typescript-eslint/types" "5.10.2" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.11.0": + version "5.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.11.0.tgz#888542381f1a2ac745b06d110c83c0b261487ebb" + integrity sha512-E8w/vJReMGuloGxJDkpPlGwhxocxOpSVgSvjiLO5IxZPmxZF30weOeJYyPSEACwM+X4NziYS9q+WkN/2DHYQwA== + dependencies: + "@typescript-eslint/types" "5.11.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 9fdcb4b8b5c6f3651bc61f2e21513bbabac26464 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Feb 2022 12:33:45 +0000 Subject: [PATCH 504/785] Bump jest from 27.5.0 to 27.5.1 Bumps [jest](https://github.com/facebook/jest) from 27.5.0 to 27.5.1. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v27.5.0...v27.5.1) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 782 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 408 insertions(+), 374 deletions(-) diff --git a/yarn.lock b/yarn.lock index 8967381f..abb12d87 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,13 @@ # yarn lockfile v1 +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" + integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg== + dependencies: + "@babel/highlight" "^7.16.7" + "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.0": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.0.tgz#0dfc80309beec8411e65e706461c408b0bb9b431" @@ -9,13 +16,6 @@ dependencies: "@babel/highlight" "^7.16.0" -"@babel/code-frame@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" - integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg== - dependencies: - "@babel/highlight" "^7.16.7" - "@babel/compat-data@^7.16.0", "@babel/compat-data@^7.16.4": version "7.16.4" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.16.4.tgz#081d6bbc336ec5c2435c6346b2ae1fb98b5ac68e" @@ -537,93 +537,93 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^27.5.0": - version "27.5.0" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.5.0.tgz#82289a589ad5803555b50b64178128b7a8e45282" - integrity sha512-WUzX5neFb0IOQOy/7A2VhiGdxJKk85Xns2Oq29JaHmtnSel+BsjwyQZxzAs2Xxfd2i452fwdDG9ox/IWi81bdQ== +"@jest/console@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.5.1.tgz#260fe7239602fe5130a94f1aa386eff54b014bba" + integrity sha512-kZ/tNpS3NXn0mlXXXPNuDZnb4c0oZ20r4K5eemM2k30ZC3G0T02nXUvyhf5YdbXWHPEJLc9qGLxEZ216MdL+Zg== dependencies: - "@jest/types" "^27.5.0" + "@jest/types" "^27.5.1" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^27.5.0" - jest-util "^27.5.0" + jest-message-util "^27.5.1" + jest-util "^27.5.1" slash "^3.0.0" -"@jest/core@^27.5.0": - version "27.5.0" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.5.0.tgz#27b383f497ff1671cc30fd5e22eba9d9b10c3031" - integrity sha512-DcUTkZyon+dRozTEjy38Bgt3PIU51GdUJuz3uHKg5maGtmCaYqPUGiM3Xddqi7eIMC7E3fTGIlHqH9i0pTOy6Q== +"@jest/core@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.5.1.tgz#267ac5f704e09dc52de2922cbf3af9edcd64b626" + integrity sha512-AK6/UTrvQD0Cd24NSqmIA6rKsu0tKIxfiCducZvqxYdmMisOYAsdItspT+fQDQYARPf8XgjAFZi0ogW2agH5nQ== dependencies: - "@jest/console" "^27.5.0" - "@jest/reporters" "^27.5.0" - "@jest/test-result" "^27.5.0" - "@jest/transform" "^27.5.0" - "@jest/types" "^27.5.0" + "@jest/console" "^27.5.1" + "@jest/reporters" "^27.5.1" + "@jest/test-result" "^27.5.1" + "@jest/transform" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.9" - jest-changed-files "^27.5.0" - jest-config "^27.5.0" - jest-haste-map "^27.5.0" - jest-message-util "^27.5.0" - jest-regex-util "^27.5.0" - jest-resolve "^27.5.0" - jest-resolve-dependencies "^27.5.0" - jest-runner "^27.5.0" - jest-runtime "^27.5.0" - jest-snapshot "^27.5.0" - jest-util "^27.5.0" - jest-validate "^27.5.0" - jest-watcher "^27.5.0" + jest-changed-files "^27.5.1" + jest-config "^27.5.1" + jest-haste-map "^27.5.1" + jest-message-util "^27.5.1" + jest-regex-util "^27.5.1" + jest-resolve "^27.5.1" + jest-resolve-dependencies "^27.5.1" + jest-runner "^27.5.1" + jest-runtime "^27.5.1" + jest-snapshot "^27.5.1" + jest-util "^27.5.1" + jest-validate "^27.5.1" + jest-watcher "^27.5.1" micromatch "^4.0.4" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.5.0": - version "27.5.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.5.0.tgz#a473bc76261aad7dfa3a1d8e35155953a5ba3436" - integrity sha512-lg0JFsMaLKgpwzs0knOg21Z4OQwaJoBLutnmYzip4tyLTXP21VYWtYGpLXgx42fw/Mw05m1WDXWKgwR6WnsiTw== +"@jest/environment@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.5.1.tgz#d7425820511fe7158abbecc010140c3fd3be9c74" + integrity sha512-/WQjhPJe3/ghaol/4Bq480JKXV/Rfw8nQdN7f41fM8VDHLcxKXou6QyXAh3EFr9/bVG3x74z1NWDkP87EiY8gA== dependencies: - "@jest/fake-timers" "^27.5.0" - "@jest/types" "^27.5.0" + "@jest/fake-timers" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" - jest-mock "^27.5.0" + jest-mock "^27.5.1" -"@jest/fake-timers@^27.5.0": - version "27.5.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.5.0.tgz#f9e07b4c723a535f7c532cfb403394fa40d88c8a" - integrity sha512-e3WrlpqSHq3HAQ03JFjTn8YCrsyg640/sr1rjkM2rNv8z1ufjudpv4xq6DvvTJYB6FuUrfg0g+7bSKPet5QfCQ== +"@jest/fake-timers@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.5.1.tgz#76979745ce0579c8a94a4678af7a748eda8ada74" + integrity sha512-/aPowoolwa07k7/oM3aASneNeBGCmGQsc3ugN4u6s4C/+s5M64MFo/+djTdiwcbQlRfFElGuDXWzaWj6QgKObQ== dependencies: - "@jest/types" "^27.5.0" + "@jest/types" "^27.5.1" "@sinonjs/fake-timers" "^8.0.1" "@types/node" "*" - jest-message-util "^27.5.0" - jest-mock "^27.5.0" - jest-util "^27.5.0" + jest-message-util "^27.5.1" + jest-mock "^27.5.1" + jest-util "^27.5.1" -"@jest/globals@^27.5.0": - version "27.5.0" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.5.0.tgz#16271323f79e3b0fe0842e9588241d202a6c2aff" - integrity sha512-wWpMnTiR65Q4JD7fr2BqN+ZDbi99mmILnEM6u7AaX4geASEIVvQsiB4RCvwZrIX5YZCsAjviJQVq9CYddLABkg== +"@jest/globals@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.5.1.tgz#7ac06ce57ab966566c7963431cef458434601b2b" + integrity sha512-ZEJNB41OBQQgGzgyInAv0UUfDDj3upmHydjieSxFvTRuZElrx7tXg/uVQ5hYVEwiXs3+aMsAeEc9X7xiSKCm4Q== dependencies: - "@jest/environment" "^27.5.0" - "@jest/types" "^27.5.0" - expect "^27.5.0" + "@jest/environment" "^27.5.1" + "@jest/types" "^27.5.1" + expect "^27.5.1" -"@jest/reporters@^27.5.0": - version "27.5.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.5.0.tgz#e7602e12656b5051bf4e784cbdd82d4ec1299e33" - integrity sha512-DG+BmVSx2uaJSTKz5z1eScgHTQ6/cZ5CCKSpmpr4sXQPwV2V5aUMOBDwXX1MnqNRhH7/Rq9K97ynnocvho5aMA== +"@jest/reporters@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.5.1.tgz#ceda7be96170b03c923c37987b64015812ffec04" + integrity sha512-cPXh9hWIlVJMQkVk84aIvXuBB4uQQmFqZiacloFuGiP3ah1sbCxCosidXFDfqG8+6fO1oR2dTJTlsOy4VFmUfw== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.5.0" - "@jest/test-result" "^27.5.0" - "@jest/transform" "^27.5.0" - "@jest/types" "^27.5.0" + "@jest/console" "^27.5.1" + "@jest/test-result" "^27.5.1" + "@jest/transform" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" chalk "^4.0.0" collect-v8-coverage "^1.0.0" @@ -635,60 +635,60 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-haste-map "^27.5.0" - jest-resolve "^27.5.0" - jest-util "^27.5.0" - jest-worker "^27.5.0" + jest-haste-map "^27.5.1" + jest-resolve "^27.5.1" + jest-util "^27.5.1" + jest-worker "^27.5.1" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" terminal-link "^2.0.0" v8-to-istanbul "^8.1.0" -"@jest/source-map@^27.5.0": - version "27.5.0" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.5.0.tgz#f22a7e759b8807491f84719c01acf433b917c7a0" - integrity sha512-0xr7VZ+JNCRrlCyRMYhquUm8eU3kNdGDaIW4s3L625bNjk273v9ZhAm3YczIuzJzYH0pnjT+QSCiZQegWKjeow== +"@jest/source-map@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.5.1.tgz#6608391e465add4205eae073b55e7f279e04e8cf" + integrity sha512-y9NIHUYF3PJRlHk98NdC/N1gl88BL08aQQgu4k4ZopQkCw9t9cV8mtl3TV8b/YCB8XaVTFrmUTAJvjsntDireg== dependencies: callsites "^3.0.0" graceful-fs "^4.2.9" source-map "^0.6.0" -"@jest/test-result@^27.5.0": - version "27.5.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.5.0.tgz#29e0ace33570c9dcbd47c67e954f77a7d7fff98e" - integrity sha512-Lxecvx5mN6WIeynIyW0dWDQm8UPGMHvTwxUPK+OsZaqBDMGaNDSZtw53VoVk7HyT6AcRblMR/pfa0XucmH4hGw== +"@jest/test-result@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.5.1.tgz#56a6585fa80f7cdab72b8c5fc2e871d03832f5bb" + integrity sha512-EW35l2RYFUcUQxFJz5Cv5MTOxlJIQs4I7gxzi2zVU7PJhOwfYq1MdC5nhSmYjX1gmMmLPvB3sIaC+BkcHRBfag== dependencies: - "@jest/console" "^27.5.0" - "@jest/types" "^27.5.0" + "@jest/console" "^27.5.1" + "@jest/types" "^27.5.1" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.5.0": - version "27.5.0" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.5.0.tgz#68beceb3de818dcb34fb3ea59be3c22c890bb6e5" - integrity sha512-WzjcDflqbpWe+SnJPCvB2gB6haGfrkzAgzY6Pb1aq+EPoVAj2mwBaKN0ROWI4H87aSslCjq2M+BUQFNJ8VpnDA== +"@jest/test-sequencer@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.5.1.tgz#4057e0e9cea4439e544c6353c6affe58d095745b" + integrity sha512-LCheJF7WB2+9JuCS7VB/EmGIdQuhtqjRNI9A43idHv3E4KltCTsPsLxvdaubFHSYwY/fNjMWjl6vNRhDiN7vpQ== dependencies: - "@jest/test-result" "^27.5.0" + "@jest/test-result" "^27.5.1" graceful-fs "^4.2.9" - jest-haste-map "^27.5.0" - jest-runtime "^27.5.0" + jest-haste-map "^27.5.1" + jest-runtime "^27.5.1" -"@jest/transform@^27.5.0": - version "27.5.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.5.0.tgz#a4941e69ac51e8aa9a255ff4855b564c228c400b" - integrity sha512-yXUy/iO3TH1itxJ9BF7LLjuXt8TtgtjAl0PBQbUaCvRa+L0yYBob6uayW9dFRX/CDQweouLhvmXh44zRiaB+yA== +"@jest/transform@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.5.1.tgz#6c3501dcc00c4c08915f292a600ece5ecfe1f409" + integrity sha512-ipON6WtYgl/1329g5AIJVbUuEh0wZVbdpGwC99Jw4LwuoBNS95MVphU6zOeD9pDkon+LLbFL7lOQRapbB8SCHw== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^27.5.0" + "@jest/types" "^27.5.1" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.9" - jest-haste-map "^27.5.0" - jest-regex-util "^27.5.0" - jest-util "^27.5.0" + jest-haste-map "^27.5.1" + jest-regex-util "^27.5.1" + jest-util "^27.5.1" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" @@ -706,10 +706,10 @@ "@types/yargs" "^16.0.0" chalk "^4.0.0" -"@jest/types@^27.5.0": - version "27.5.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.5.0.tgz#6ad04a5c5355fd9f46e5cf761850e0edb3c209dd" - integrity sha512-oDHEp7gwSgA82RZ6pzUL3ugM2njP/lVB1MsxRZNOBk+CoNvh9SpH1lQixPFc/kDlV50v59csiW4HLixWmhmgPQ== +"@jest/types@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.5.1.tgz#3c79ec4a8ba61c170bf937bcf9e98a9df175ec80" + integrity sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw== dependencies: "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" @@ -1092,16 +1092,16 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= -babel-jest@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.5.0.tgz#c653985241af3c76f59d70d65a570860c2594a50" - integrity sha512-puhCyvBTNLevhbd1oyw6t3gWBicWoUARQYKCBB/B1moif17NbyhxbsfadqZIw8zfJJD+W7Vw0Nb20pEjLxkXqQ== +babel-jest@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.5.1.tgz#a1bf8d61928edfefd21da27eb86a695bfd691444" + integrity sha512-cdQ5dXjGRd0IBRATiQ4mZGlGlRE8kJpjPOixdNRdT+m3UcNqmYWN6rK6nvtXYfY3D76cb8s/O1Ss8ea24PIwcg== dependencies: - "@jest/transform" "^27.5.0" - "@jest/types" "^27.5.0" + "@jest/transform" "^27.5.1" + "@jest/types" "^27.5.1" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^27.5.0" + babel-preset-jest "^27.5.1" chalk "^4.0.0" graceful-fs "^4.2.9" slash "^3.0.0" @@ -1117,10 +1117,10 @@ babel-plugin-istanbul@^6.1.1: istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.5.0.tgz#8fdf07835f2165a068de3ce95fd7749a89801b51" - integrity sha512-ztwNkHl+g1GaoQcb8f2BER4C3LMvSXuF7KVqtUioXQgScSEnkl6lLgCILUYIR+CPTwL8H3F/PNLze64HPWF9JA== +babel-plugin-jest-hoist@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.5.1.tgz#9be98ecf28c331eb9f5df9c72d6f89deb8181c2e" + integrity sha512-50wCwD5EMNW4aRpOwtqzyZHIewTYNxLA4nhB+09d8BIssfNfzBRhkBIHiaPv1Si226TQSvp8gxAJm2iY2qs2hQ== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -1145,12 +1145,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.5.0.tgz#4e308711c3d2ff1f45cf5d9a23646e37b621fc9f" - integrity sha512-7bfu1cJBlgK/nKfTvMlElzA3jpi6GzDWX3fntnyP2cQSzoi/KUz6ewGlcb3PSRYZGyv+uPnVHY0Im3JbsViqgA== +babel-preset-jest@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.5.1.tgz#91f10f58034cb7989cb4f962b69fa6eef6a6bc81" + integrity sha512-Nptf2FzlPCWYuJg41HBqXVT8ym6bXOevuCTbhxlUpjwtysGaIWFvDEjp4y+G7fl13FgOdjs7P/DmErqH7da0Ag== dependencies: - babel-plugin-jest-hoist "^27.5.0" + babel-plugin-jest-hoist "^27.5.1" babel-preset-current-node-syntax "^1.0.0" balanced-match@^1.0.0: @@ -1412,10 +1412,10 @@ diff-sequences@^27.4.0: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.4.0.tgz#d783920ad8d06ec718a060d00196dfef25b132a5" integrity sha512-YqiQzkrsmHMH5uuh8OdQFU9/ZpADnwzml8z0O5HvRNda+5UZsaX/xN+AAxfR2hWq1Y7HZnAzO9J5lJXOuDz2Ww== -diff-sequences@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.5.0.tgz#a8ac0cb742b17d6f30a6c43e233893a2402c0729" - integrity sha512-ZsOBWnhXiH+Zn0DcBNX/tiQsqrREHs/6oQsEVy2VJJjrTblykPima11pyHMSA/7PGmD+fwclTnKVKL/qtNREDQ== +diff-sequences@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.5.1.tgz#eaecc0d327fd68c8d9672a1e64ab8dccb2ef5327" + integrity sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ== diff@^4.0.1: version "4.0.2" @@ -1465,6 +1465,13 @@ end-of-stream@^1.1.0: dependencies: once "^1.4.0" +error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -1654,15 +1661,15 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.5.0.tgz#ea2fbebb483c274043098c34a53923a0aee493f0" - integrity sha512-z73GZ132cBqrapO0X6BeRjyBXqOt9YeRtnDteHJIQqp5s2pZ41Hz23VUbsVFMfkrsFLU9GwoIRS0ZzLuFK8M5w== +expect@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.5.1.tgz#83ce59f1e5bdf5f9d2b94b61d2050db48f3fef74" + integrity sha512-E1q5hSUG2AmYQwQJ041nvgpkODHQvB+RKlB4IYdru6uJsyFTRyZAP463M+1lINorwbqAmUggi6+WwkD8lCS/Dw== dependencies: - "@jest/types" "^27.5.0" - jest-get-type "^27.5.0" - jest-matcher-utils "^27.5.0" - jest-message-util "^27.5.0" + "@jest/types" "^27.5.1" + jest-get-type "^27.5.1" + jest-matcher-utils "^27.5.1" + jest-message-util "^27.5.1" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1967,6 +1974,11 @@ inherits@2: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + is-core-module@^2.2.0: version "2.8.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.0.tgz#0321336c3d0925e497fd97f5d95cb114a5ccd548" @@ -2063,85 +2075,87 @@ istanbul-reports@^3.1.3: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.5.0.tgz#61e8d0a7394c1ee1cec4c2893e206e62b1566066" - integrity sha512-BGWKI7E6ORqbF5usF1oA4ftbkhVZVrXr8jB0/BrU6TAn3kfOVwX2Zx6pKIXYutJ+qNEjT8Da/gGak0ajya/StA== +jest-changed-files@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.5.1.tgz#a348aed00ec9bf671cc58a66fcbe7c3dfd6a68f5" + integrity sha512-buBLMiByfWGCoMsLLzGUUSpAmIAGnbR2KJoMN10ziLhOLvP4e0SlypHnAel8iqQXTrcbmfEY9sSqae5sgUsTvw== dependencies: - "@jest/types" "^27.5.0" + "@jest/types" "^27.5.1" execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.5.0.tgz#fcff8829ceb2c8ef4b4532ace7734d156c6664b9" - integrity sha512-+NPd1OxpAHYKjbW8dgL0huFgmtZRKSUKee/UtRgZJEfAxCeA12d7sp0coh5EGDBpW4fCk1Pcia/2dG+j6BQvdw== +jest-circus@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.5.1.tgz#37a5a4459b7bf4406e53d637b49d22c65d125ecc" + integrity sha512-D95R7x5UtlMA5iBYsOHFFbMD/GVA4R/Kdq15f7xYWUfWHBto9NYRsOvnSauTgdF+ogCpJ4tyKOXhUifxS65gdw== dependencies: - "@jest/environment" "^27.5.0" - "@jest/test-result" "^27.5.0" - "@jest/types" "^27.5.0" + "@jest/environment" "^27.5.1" + "@jest/test-result" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" - expect "^27.5.0" + expect "^27.5.1" is-generator-fn "^2.0.0" - jest-each "^27.5.0" - jest-matcher-utils "^27.5.0" - jest-message-util "^27.5.0" - jest-runtime "^27.5.0" - jest-snapshot "^27.5.0" - jest-util "^27.5.0" - pretty-format "^27.5.0" + jest-each "^27.5.1" + jest-matcher-utils "^27.5.1" + jest-message-util "^27.5.1" + jest-runtime "^27.5.1" + jest-snapshot "^27.5.1" + jest-util "^27.5.1" + pretty-format "^27.5.1" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.5.0.tgz#06557ad22818740fb28481089a574ba107a8b369" - integrity sha512-9ANs79Goz1ULKtG7HDm/F//4E69v8EFOLXRIHmeC/eK1xTUeQGlU6XP0Zwst386sKaKB4O60qhWY/UaTBS2MLA== +jest-cli@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.5.1.tgz#278794a6e6458ea8029547e6c6cbf673bd30b145" + integrity sha512-Hc6HOOwYq4/74/c62dEE3r5elx8wjYqxY0r0G/nFrLDPMFRu6RA/u8qINOIkvhxG7mMQ5EJsOGfRpI8L6eFUVw== dependencies: - "@jest/core" "^27.5.0" - "@jest/test-result" "^27.5.0" - "@jest/types" "^27.5.0" + "@jest/core" "^27.5.1" + "@jest/test-result" "^27.5.1" + "@jest/types" "^27.5.1" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^27.5.0" - jest-util "^27.5.0" - jest-validate "^27.5.0" + jest-config "^27.5.1" + jest-util "^27.5.1" + jest-validate "^27.5.1" prompts "^2.0.1" yargs "^16.2.0" -jest-config@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.5.0.tgz#d96ccf8e26d3f2f3ae6543686c48449c201bb621" - integrity sha512-eOIpvpXFz5WHuIYZN1QmvBLEjsSk3w+IAC/2jBpZClbprF53Bj9meBMgAbE15DSkaaJBDFmhXXd1L2eCLaWxQw== +jest-config@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.5.1.tgz#5c387de33dca3f99ad6357ddeccd91bf3a0e4a41" + integrity sha512-5sAsjm6tGdsVbW9ahcChPAFCk4IlkQUknH5AvKjuLTSlcO/wCZKyFdn7Rg0EkC+OGgWODEy2hDpWB1PgzH0JNA== dependencies: "@babel/core" "^7.8.0" - "@jest/test-sequencer" "^27.5.0" - "@jest/types" "^27.5.0" - babel-jest "^27.5.0" + "@jest/test-sequencer" "^27.5.1" + "@jest/types" "^27.5.1" + babel-jest "^27.5.1" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.9" - jest-circus "^27.5.0" - jest-environment-jsdom "^27.5.0" - jest-environment-node "^27.5.0" - jest-get-type "^27.5.0" - jest-jasmine2 "^27.5.0" - jest-regex-util "^27.5.0" - jest-resolve "^27.5.0" - jest-runner "^27.5.0" - jest-util "^27.5.0" - jest-validate "^27.5.0" + jest-circus "^27.5.1" + jest-environment-jsdom "^27.5.1" + jest-environment-node "^27.5.1" + jest-get-type "^27.5.1" + jest-jasmine2 "^27.5.1" + jest-regex-util "^27.5.1" + jest-resolve "^27.5.1" + jest-runner "^27.5.1" + jest-util "^27.5.1" + jest-validate "^27.5.1" micromatch "^4.0.4" - pretty-format "^27.5.0" + parse-json "^5.2.0" + pretty-format "^27.5.1" slash "^3.0.0" + strip-json-comments "^3.1.1" jest-diff@^27.0.0: version "27.4.2" @@ -2153,151 +2167,151 @@ jest-diff@^27.0.0: jest-get-type "^27.4.0" pretty-format "^27.4.2" -jest-diff@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.5.0.tgz#34dc608a3b9159df178dd480b6d835b5e6b92082" - integrity sha512-zztvHDCq/QcAVv+o6rts0reupSOxyrX+KLQEOMWCW2trZgcBFgp/oTK7hJCGpXvEIqKrQzyQlaPKn9W04+IMQg== +jest-diff@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.5.1.tgz#a07f5011ac9e6643cf8a95a462b7b1ecf6680def" + integrity sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw== dependencies: chalk "^4.0.0" - diff-sequences "^27.5.0" - jest-get-type "^27.5.0" - pretty-format "^27.5.0" + diff-sequences "^27.5.1" + jest-get-type "^27.5.1" + pretty-format "^27.5.1" -jest-docblock@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.5.0.tgz#096fa3a8b55d019a954ef7cc205c791bf94b2352" - integrity sha512-U4MtJgdZn2x+jpPzd7NAYvDmgJAA5h9QxVAwsyuH7IymGzY8VGHhAkHcIGOmtmdC61ORLxCbEhj6fCJsaCWzXA== +jest-docblock@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.5.1.tgz#14092f364a42c6108d42c33c8cf30e058e25f6c0" + integrity sha512-rl7hlABeTsRYxKiUfpHrQrG4e2obOiTQWfMEH3PxPjOtdsfLQO4ReWSZaQ7DETm4xu07rl4q/h4zcKXyU0/OzQ== dependencies: detect-newline "^3.0.0" -jest-each@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.5.0.tgz#7bd00a767df0fbec0caba3df0d2c0b3268a2ce84" - integrity sha512-2vpajSdDMZmAxjSP1f4BG9KKduwHtuaI0w66oqLUkfaGUU7Ix/W+d8BW0h3/QEJiew7hR0GSblqdFwTEEbhBdw== +jest-each@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.5.1.tgz#5bc87016f45ed9507fed6e4702a5b468a5b2c44e" + integrity sha512-1Ff6p+FbhT/bXQnEouYy00bkNSY7OUpfIcmdl8vZ31A1UUaurOLPA8a8BbJOF2RDUElwJhmeaV7LnagI+5UwNQ== dependencies: - "@jest/types" "^27.5.0" + "@jest/types" "^27.5.1" chalk "^4.0.0" - jest-get-type "^27.5.0" - jest-util "^27.5.0" - pretty-format "^27.5.0" - -jest-environment-jsdom@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.5.0.tgz#6d22d9b76890e9b82c7e1062a15730efb3fb7361" - integrity sha512-sX49N8rjp6HSHeGpNgLk6mtHRd1IPAnE/u7wLQkb6Tz/1E08Q++Y8Zk/IbpVdcFywbzH1icFqEuDuHJ6o+uXXg== - dependencies: - "@jest/environment" "^27.5.0" - "@jest/fake-timers" "^27.5.0" - "@jest/types" "^27.5.0" + jest-get-type "^27.5.1" + jest-util "^27.5.1" + pretty-format "^27.5.1" + +jest-environment-jsdom@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.5.1.tgz#ea9ccd1fc610209655a77898f86b2b559516a546" + integrity sha512-TFBvkTC1Hnnnrka/fUb56atfDtJ9VMZ94JkjTbggl1PEpwrYtUBKMezB3inLmWqQsXYLcMwNoDQwoBTAvFfsfw== + dependencies: + "@jest/environment" "^27.5.1" + "@jest/fake-timers" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" - jest-mock "^27.5.0" - jest-util "^27.5.0" + jest-mock "^27.5.1" + jest-util "^27.5.1" jsdom "^16.6.0" -jest-environment-node@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.5.0.tgz#1ab357b4715bff88d48c8b62b8379002ff955dd1" - integrity sha512-7UzisMMfGyrURhS/eUa7p7mgaqN3ajHylsjOgfcn0caNeYRZq4LHKZLfAxrPM34DWLnBZcRupEJlpQsizdSUsw== +jest-environment-node@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.5.1.tgz#dedc2cfe52fab6b8f5714b4808aefa85357a365e" + integrity sha512-Jt4ZUnxdOsTGwSRAfKEnE6BcwsSPNOijjwifq5sDFSA2kesnXTvNqKHYgM0hDq3549Uf/KzdXNYn4wMZJPlFLw== dependencies: - "@jest/environment" "^27.5.0" - "@jest/fake-timers" "^27.5.0" - "@jest/types" "^27.5.0" + "@jest/environment" "^27.5.1" + "@jest/fake-timers" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" - jest-mock "^27.5.0" - jest-util "^27.5.0" + jest-mock "^27.5.1" + jest-util "^27.5.1" jest-get-type@^27.4.0: version "27.4.0" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.4.0.tgz#7503d2663fffa431638337b3998d39c5e928e9b5" integrity sha512-tk9o+ld5TWq41DkK14L4wox4s2D9MtTpKaAVzXfr5CUKm5ZK2ExcaFE0qls2W71zE/6R2TxxrK9w2r6svAFDBQ== -jest-get-type@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.5.0.tgz#861c24aa1b176be83c902292cb9618d580cac8a7" - integrity sha512-Vp6O8a52M/dahXRG/E0EJuWQROps2mDQ0sJYPgO8HskhdLwj9ajgngy2OAqZgV6e/RcU67WUHq6TgfvJb8flbA== +jest-get-type@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.5.1.tgz#3cd613c507b0f7ace013df407a1c1cd578bcb4f1" + integrity sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw== -jest-haste-map@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.5.0.tgz#7cc3a920caf304c89fbfceb5d5717b929873f175" - integrity sha512-0KfckSBEKV+D6e0toXmIj4zzp72EiBnvkC0L+xYxenkLhAdkp2/8tye4AgMzz7Fqb1r8SWtz7+s1UQLrxMBang== +jest-haste-map@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.5.1.tgz#9fd8bd7e7b4fa502d9c6164c5640512b4e811e7f" + integrity sha512-7GgkZ4Fw4NFbMSDSpZwXeBiIbx+t/46nJ2QitkOjvwPYyZmqttu2TDSimMHP1EkPOi4xUZAN1doE5Vd25H4Jng== dependencies: - "@jest/types" "^27.5.0" + "@jest/types" "^27.5.1" "@types/graceful-fs" "^4.1.2" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" - jest-regex-util "^27.5.0" - jest-serializer "^27.5.0" - jest-util "^27.5.0" - jest-worker "^27.5.0" + jest-regex-util "^27.5.1" + jest-serializer "^27.5.1" + jest-util "^27.5.1" + jest-worker "^27.5.1" micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.5.0.tgz#589d6574d1318d3fb41b3fc368344117ec417dcc" - integrity sha512-X7sT3HLNjjrBEepilxzPyNhNdyunaFBepo1L3T/fvYb9tb8Wb8qY576gwIa+SZcqYUqAA7/bT3EpZI4lAp0Qew== +jest-jasmine2@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.5.1.tgz#a037b0034ef49a9f3d71c4375a796f3b230d1ac4" + integrity sha512-jtq7VVyG8SqAorDpApwiJJImd0V2wv1xzdheGHRGyuT7gZm6gG47QEskOlzsN1PG/6WNaCo5pmwMHDf3AkG2pQ== dependencies: - "@jest/environment" "^27.5.0" - "@jest/source-map" "^27.5.0" - "@jest/test-result" "^27.5.0" - "@jest/types" "^27.5.0" + "@jest/environment" "^27.5.1" + "@jest/source-map" "^27.5.1" + "@jest/test-result" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^27.5.0" + expect "^27.5.1" is-generator-fn "^2.0.0" - jest-each "^27.5.0" - jest-matcher-utils "^27.5.0" - jest-message-util "^27.5.0" - jest-runtime "^27.5.0" - jest-snapshot "^27.5.0" - jest-util "^27.5.0" - pretty-format "^27.5.0" + jest-each "^27.5.1" + jest-matcher-utils "^27.5.1" + jest-message-util "^27.5.1" + jest-runtime "^27.5.1" + jest-snapshot "^27.5.1" + jest-util "^27.5.1" + pretty-format "^27.5.1" throat "^6.0.1" -jest-leak-detector@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.5.0.tgz#c98c02e64eab4da9a8b91f058d2b7473272272ee" - integrity sha512-Ak3k+DD3ao5d4/zzJrxAQ5UV5wiCrp47jH94ZD4/vXSzQgE6WBVDfg83VtculLILO7Y6/Q/7yzKSrtN9Na8luA== +jest-leak-detector@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.5.1.tgz#6ec9d54c3579dd6e3e66d70e3498adf80fde3fb8" + integrity sha512-POXfWAMvfU6WMUXftV4HolnJfnPOGEu10fscNCA76KBpRRhcMN2c8d3iT2pxQS3HLbA+5X4sOUPzYO2NUyIlHQ== dependencies: - jest-get-type "^27.5.0" - pretty-format "^27.5.0" + jest-get-type "^27.5.1" + pretty-format "^27.5.1" -jest-matcher-utils@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.5.0.tgz#d2fc737224fb3bfa38eaa2393ac5bc953d5c5697" - integrity sha512-5ruyzWMGb1ilCWD6ECwNdOhQBeIXAjHmHd5c3uO6quR7RIMHPRP2ucOaejz2j+0R0Ko4GanWM6SqXAeF8nYN5g== +jest-matcher-utils@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.5.1.tgz#9c0cdbda8245bc22d2331729d1091308b40cf8ab" + integrity sha512-z2uTx/T6LBaCoNWNFWwChLBKYxTMcGBRjAt+2SbP929/Fflb9aa5LGma654Rz8z9HLxsrUaYzxE9T/EFIL/PAw== dependencies: chalk "^4.0.0" - jest-diff "^27.5.0" - jest-get-type "^27.5.0" - pretty-format "^27.5.0" + jest-diff "^27.5.1" + jest-get-type "^27.5.1" + pretty-format "^27.5.1" -jest-message-util@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.5.0.tgz#654a781b38a305b1fd8120053c784c67bca00a52" - integrity sha512-lfbWRhTtmZMEHPAtl0SrvNzK1F4UnVNMHOliRQT2BJ4sBFzIb0gBCHA4ebWD4o6l1fUyvDPxM01K9OIMQTAdQw== +jest-message-util@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.5.1.tgz#bdda72806da10d9ed6425e12afff38cd1458b6cf" + integrity sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^27.5.0" + "@jest/types" "^27.5.1" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^27.5.0" + pretty-format "^27.5.1" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.5.0.tgz#1018656fe6bcd0f58fd1edca7f420169f6707c6e" - integrity sha512-PHluG6MJGng82/sxh8OiB9fnxzNn3cazceSHCAmAKs4g5rMhc3EZCrJXv+4w61rA2WGagMUj7QLLrA1SRlFpzQ== +jest-mock@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.5.1.tgz#19948336d49ef4d9c52021d34ac7b5f36ff967d6" + integrity sha512-K4jKbY1d4ENhbrG2zuPWaQBvDly+iZ2yAW+T1fATN78hc0sInwn7wZB8XtlNnvHug5RMwV897Xm4LqmPM4e2Og== dependencies: - "@jest/types" "^27.5.0" + "@jest/types" "^27.5.1" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -2305,125 +2319,125 @@ jest-pnp-resolver@^1.2.2: resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== -jest-regex-util@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.5.0.tgz#26c26cf15a73edba13cb8930e261443d25ed8608" - integrity sha512-e9LqSd6HsDsqd7KS3rNyYwmQAaG9jq4U3LbnwVxN/y3nNlDzm2OFs596uo9zrUY+AV1opXq6ome78tRDUCRWfA== +jest-regex-util@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.5.1.tgz#4da143f7e9fd1e542d4aa69617b38e4a78365b95" + integrity sha512-4bfKq2zie+x16okqDXjXn9ql2B0dScQu+vcwe4TvFVhkVyuWLqpZrZtXxLLWoXYgn0E87I6r6GRYHF7wFZBUvg== -jest-resolve-dependencies@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.5.0.tgz#8e3b15589848995ddc9a39f49462dad5b7bc14a2" - integrity sha512-xQsy7CmrT4CJxdNUEdzZU2M/v6YmtQ/pkJM+sx7TA1siG1zfsZuo78PZvzglwRMQFr88f3Su4Om8OEBAic+SMw== +jest-resolve-dependencies@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.5.1.tgz#d811ecc8305e731cc86dd79741ee98fed06f1da8" + integrity sha512-QQOOdY4PE39iawDn5rzbIePNigfe5B9Z91GDD1ae/xNDlu9kaat8QQ5EKnNmVWPV54hUdxCVwwj6YMgR2O7IOg== dependencies: - "@jest/types" "^27.5.0" - jest-regex-util "^27.5.0" - jest-snapshot "^27.5.0" + "@jest/types" "^27.5.1" + jest-regex-util "^27.5.1" + jest-snapshot "^27.5.1" -jest-resolve@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.5.0.tgz#a8e95a68dfb4a59faa508d7b6d2c6a02dcabb712" - integrity sha512-PkDpYEGV/nFqThnIrlPtj8oTxyAV3iuuS6or7dZYyUWaHr/tyyVb5qfBmZS6FEr7ozBHgjrF1bgcgIefnlicbw== +jest-resolve@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.5.1.tgz#a2f1c5a0796ec18fe9eb1536ac3814c23617b384" + integrity sha512-FFDy8/9E6CV83IMbDpcjOhumAQPDyETnU2KZ1O98DwTnz8AOBsW/Xv3GySr1mOZdItLR+zDZ7I/UdTFbgSOVCw== dependencies: - "@jest/types" "^27.5.0" + "@jest/types" "^27.5.1" chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^27.5.0" + jest-haste-map "^27.5.1" jest-pnp-resolver "^1.2.2" - jest-util "^27.5.0" - jest-validate "^27.5.0" + jest-util "^27.5.1" + jest-validate "^27.5.1" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.5.0.tgz#b5747a4444b4d3faae019bd201943948882d26c3" - integrity sha512-RMzXhkJLLOKKgUPY2trpyVBijaFmswMtgoCCBk2PQVRHC6yo1vLd1/jmFP39s5OXXnt7rntuzKSYvxl+QUibqQ== +jest-runner@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.5.1.tgz#071b27c1fa30d90540805c5645a0ec167c7b62e5" + integrity sha512-g4NPsM4mFCOwFKXO4p/H/kWGdJp9V8kURY2lX8Me2drgXqG7rrZAx5kv+5H7wtt/cdFIjhqYx1HrlqWHaOvDaQ== dependencies: - "@jest/console" "^27.5.0" - "@jest/environment" "^27.5.0" - "@jest/test-result" "^27.5.0" - "@jest/transform" "^27.5.0" - "@jest/types" "^27.5.0" + "@jest/console" "^27.5.1" + "@jest/environment" "^27.5.1" + "@jest/test-result" "^27.5.1" + "@jest/transform" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" chalk "^4.0.0" emittery "^0.8.1" graceful-fs "^4.2.9" - jest-docblock "^27.5.0" - jest-environment-jsdom "^27.5.0" - jest-environment-node "^27.5.0" - jest-haste-map "^27.5.0" - jest-leak-detector "^27.5.0" - jest-message-util "^27.5.0" - jest-resolve "^27.5.0" - jest-runtime "^27.5.0" - jest-util "^27.5.0" - jest-worker "^27.5.0" + jest-docblock "^27.5.1" + jest-environment-jsdom "^27.5.1" + jest-environment-node "^27.5.1" + jest-haste-map "^27.5.1" + jest-leak-detector "^27.5.1" + jest-message-util "^27.5.1" + jest-resolve "^27.5.1" + jest-runtime "^27.5.1" + jest-util "^27.5.1" + jest-worker "^27.5.1" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.5.0.tgz#2497116742b9e7cc1e5381a9ded36602b8b0c78c" - integrity sha512-T7APxCPjN3p3ePcLuypbWtD0UZHyAdvIADZ9ABI/sFZ9t/Rf2xIUd6D7RzZIX+unewJRooVGWrgDIgeUuj0OUA== - dependencies: - "@jest/environment" "^27.5.0" - "@jest/fake-timers" "^27.5.0" - "@jest/globals" "^27.5.0" - "@jest/source-map" "^27.5.0" - "@jest/test-result" "^27.5.0" - "@jest/transform" "^27.5.0" - "@jest/types" "^27.5.0" +jest-runtime@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.5.1.tgz#4896003d7a334f7e8e4a53ba93fb9bcd3db0a1af" + integrity sha512-o7gxw3Gf+H2IGt8fv0RiyE1+r83FJBRruoA+FXrlHw6xEyBsU8ugA6IPfTdVyA0w8HClpbK+DGJxH59UrNMx8A== + dependencies: + "@jest/environment" "^27.5.1" + "@jest/fake-timers" "^27.5.1" + "@jest/globals" "^27.5.1" + "@jest/source-map" "^27.5.1" + "@jest/test-result" "^27.5.1" + "@jest/transform" "^27.5.1" + "@jest/types" "^27.5.1" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" execa "^5.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^27.5.0" - jest-message-util "^27.5.0" - jest-mock "^27.5.0" - jest-regex-util "^27.5.0" - jest-resolve "^27.5.0" - jest-snapshot "^27.5.0" - jest-util "^27.5.0" + jest-haste-map "^27.5.1" + jest-message-util "^27.5.1" + jest-mock "^27.5.1" + jest-regex-util "^27.5.1" + jest-resolve "^27.5.1" + jest-snapshot "^27.5.1" + jest-util "^27.5.1" slash "^3.0.0" strip-bom "^4.0.0" -jest-serializer@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.5.0.tgz#439a110df27f97a40c114a429b708c2ada15a81f" - integrity sha512-aSDFqQlVXtBH+Zb5dl9mCvTSFkabixk/9P9cpngL4yJKpmEi9USxfDhONFMzJrtftPvZw3PcltUVmtFZTB93rg== +jest-serializer@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.5.1.tgz#81438410a30ea66fd57ff730835123dea1fb1f64" + integrity sha512-jZCyo6iIxO1aqUxpuBlwTDMkzOAJS4a3eYz3YzgxxVQFwLeSA7Jfq5cbqCY+JLvTDrWirgusI/0KwxKMgrdf7w== dependencies: "@types/node" "*" graceful-fs "^4.2.9" -jest-snapshot@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.5.0.tgz#c5c4c084f5e10036f31e7647de1a6f28c07681fc" - integrity sha512-cAJj15uqWGkro0bfcv/EgusBnqNgCpRruFQZghsMYTq4Fm2lk/VhAf8DgRr8wvhR6Ue1hkeL8tn70Cw4t8x/5A== +jest-snapshot@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.5.1.tgz#b668d50d23d38054a51b42c4039cab59ae6eb6a1" + integrity sha512-yYykXI5a0I31xX67mgeLw1DZ0bJB+gpq5IpSuCAoyDi0+BhgU/RIrL+RTzDmkNTchvDFWKP8lp+w/42Z3us5sA== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/transform" "^27.5.0" - "@jest/types" "^27.5.0" + "@jest/transform" "^27.5.1" + "@jest/types" "^27.5.1" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.5.0" + expect "^27.5.1" graceful-fs "^4.2.9" - jest-diff "^27.5.0" - jest-get-type "^27.5.0" - jest-haste-map "^27.5.0" - jest-matcher-utils "^27.5.0" - jest-message-util "^27.5.0" - jest-util "^27.5.0" + jest-diff "^27.5.1" + jest-get-type "^27.5.1" + jest-haste-map "^27.5.1" + jest-matcher-utils "^27.5.1" + jest-message-util "^27.5.1" + jest-util "^27.5.1" natural-compare "^1.4.0" - pretty-format "^27.5.0" + pretty-format "^27.5.1" semver "^7.3.2" jest-util@^27.0.0: @@ -2438,60 +2452,60 @@ jest-util@^27.0.0: graceful-fs "^4.2.4" picomatch "^2.2.3" -jest-util@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.5.0.tgz#0b9540d91b0de65d288f235fa9899e6eeeab8d35" - integrity sha512-FUUqOx0gAzJy3ytatT1Ss372M1kmhczn8x7aE0++11oPGW1FyD/5NjYBI8w1KOXFm6IVjtaZm2szfJJL+CHs0g== +jest-util@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.5.1.tgz#3ba9771e8e31a0b85da48fe0b0891fb86c01c2f9" + integrity sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw== dependencies: - "@jest/types" "^27.5.0" + "@jest/types" "^27.5.1" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.5.0.tgz#b3df32372d2c832fa5a5e31ee2c37f94f79f7f1f" - integrity sha512-2XZzQWNrY9Ypo11mm4ZeVjvr++CQG/45XnmA2aWwx155lTwy1JGFI8LpQ2dBCSAeO21ooqg/FCIvv9WwfnPClA== +jest-validate@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.5.1.tgz#9197d54dc0bdb52260b8db40b46ae668e04df067" + integrity sha512-thkNli0LYTmOI1tDB3FI1S1RTp/Bqyd9pTarJwL87OIBFuqEb5Apv5EaApEudYg4g86e3CT6kM0RowkhtEnCBQ== dependencies: - "@jest/types" "^27.5.0" + "@jest/types" "^27.5.1" camelcase "^6.2.0" chalk "^4.0.0" - jest-get-type "^27.5.0" + jest-get-type "^27.5.1" leven "^3.1.0" - pretty-format "^27.5.0" + pretty-format "^27.5.1" -jest-watcher@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.5.0.tgz#ca11c3b9115c92a8fd2fd9e2def296d45206f1ca" - integrity sha512-MhIeIvEd6dnnspE0OfYrqHOAfZZdyFqx/k8U2nvVFSkLYf22qAFfyNWPVQYcwqKVNobcOhJoT0kV/nRHGbqK8A== +jest-watcher@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.5.1.tgz#71bd85fb9bde3a2c2ec4dc353437971c43c642a2" + integrity sha512-z676SuD6Z8o8qbmEGhoEUFOM1+jfEiL3DXHK/xgEiG2EyNYfFG60jluWcupY6dATjfEsKQuibReS1djInQnoVw== dependencies: - "@jest/test-result" "^27.5.0" - "@jest/types" "^27.5.0" + "@jest/test-result" "^27.5.1" + "@jest/types" "^27.5.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^27.5.0" + jest-util "^27.5.1" string-length "^4.0.1" -jest-worker@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.5.0.tgz#99ee77e4d06168107c27328bd7f54e74c3a48d59" - integrity sha512-8OEHiPNOPTfaWnJ2SUHM8fmgeGq37uuGsQBvGKQJl1f+6WIy6g7G3fE2ruI5294bUKUI9FaCWt5hDvO8HSwsSg== +jest-worker@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" + integrity sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^27.0.1: - version "27.5.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.5.0.tgz#2c04ff88754e42e9fc5240840b91f9a9a8990875" - integrity sha512-sCMZhL9zy0fiFc4H0cKlXq7BcghMSxm5ZnEyaPWTteArU5ix6JjOKyOXSUBGLTQCmt5kuX9zEvQ9BSshHOPB3A== + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.5.1.tgz#dadf33ba70a779be7a6fc33015843b51494f63fc" + integrity sha512-Yn0mADZB89zTtjkPJEXwrac3LHudkQMR+Paqa8uxJHCBr9agxztUifWCyiYrjhMPBoUVBjyny0I7XH6ozDr7QQ== dependencies: - "@jest/core" "^27.5.0" + "@jest/core" "^27.5.1" import-local "^3.0.2" - jest-cli "^27.5.0" + jest-cli "^27.5.1" js-tokens@^4.0.0: version "4.0.0" @@ -2551,6 +2565,11 @@ jsesc@^2.5.1: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== +json-parse-even-better-errors@^2.3.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" + integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== + json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -2594,6 +2613,11 @@ levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" +lines-and-columns@^1.1.6: + version "1.2.4" + resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" + integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== + locate-path@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" @@ -2806,6 +2830,16 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" +parse-json@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" + integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== + dependencies: + "@babel/code-frame" "^7.0.0" + error-ex "^1.3.1" + json-parse-even-better-errors "^2.3.0" + lines-and-columns "^1.1.6" + parse5@6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" @@ -2883,10 +2917,10 @@ pretty-format@^27.0.0, pretty-format@^27.4.2: ansi-styles "^5.0.0" react-is "^17.0.1" -pretty-format@^27.5.0: - version "27.5.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.0.tgz#71e1af7a4b587d259fa4668dcd3e94af077767cb" - integrity sha512-xEi6BRPZ+J1AIS4BAtFC/+rh5jXlXObGZjx5+OSpM95vR/PGla78bFVHMy5GdZjP9wk3AHAMHROXq/r69zXltw== +pretty-format@^27.5.1: + version "27.5.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e" + integrity sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ== dependencies: ansi-regex "^5.0.1" ansi-styles "^5.0.0" From e3ebd05a8a43eafe8b30c7712abcd2af51004a65 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Feb 2022 12:39:38 +0000 Subject: [PATCH 505/785] Bump @typescript-eslint/eslint-plugin from 5.10.2 to 5.11.0 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.10.2 to 5.11.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.11.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 70 ++++++++++++++----------------------------------------- 1 file changed, 18 insertions(+), 52 deletions(-) diff --git a/yarn.lock b/yarn.lock index f9ceb49b..1950c122 100644 --- a/yarn.lock +++ b/yarn.lock @@ -882,13 +882,13 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.4.0": - version "5.10.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.10.2.tgz#f8c1d59fc37bd6d9d11c97267fdfe722c4777152" - integrity sha512-4W/9lLuE+v27O/oe7hXJKjNtBLnZE8tQAFpapdxwSVHqtmIoPB1gph3+ahNwVuNL37BX7YQHyGF9Xv6XCnIX2Q== + version "5.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.11.0.tgz#3b866371d8d75c70f9b81535e7f7d3aa26527c7a" + integrity sha512-HJh33bgzXe6jGRocOj4FmefD7hRY4itgjzOrSs3JPrTNXsX7j5+nQPciAUj/1nZtwo2kAc3C75jZO+T23gzSGw== dependencies: - "@typescript-eslint/scope-manager" "5.10.2" - "@typescript-eslint/type-utils" "5.10.2" - "@typescript-eslint/utils" "5.10.2" + "@typescript-eslint/scope-manager" "5.11.0" + "@typescript-eslint/type-utils" "5.11.0" + "@typescript-eslint/utils" "5.11.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -906,14 +906,6 @@ "@typescript-eslint/typescript-estree" "5.11.0" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.10.2": - version "5.10.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.10.2.tgz#92c0bc935ec00f3d8638cdffb3d0e70c9b879639" - integrity sha512-39Tm6f4RoZoVUWBYr3ekS75TYgpr5Y+X0xLZxXqcZNDWZdJdYbKd3q2IR4V9y5NxxiPu/jxJ8XP7EgHiEQtFnw== - dependencies: - "@typescript-eslint/types" "5.10.2" - "@typescript-eslint/visitor-keys" "5.10.2" - "@typescript-eslint/scope-manager@5.11.0": version "5.11.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.11.0.tgz#f5aef83ff253f457ecbee5f46f762298f0101e4b" @@ -922,38 +914,20 @@ "@typescript-eslint/types" "5.11.0" "@typescript-eslint/visitor-keys" "5.11.0" -"@typescript-eslint/type-utils@5.10.2": - version "5.10.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.10.2.tgz#ad5acdf98a7d2ab030bea81f17da457519101ceb" - integrity sha512-uRKSvw/Ccs5FYEoXW04Z5VfzF2iiZcx8Fu7DGIB7RHozuP0VbKNzP1KfZkHBTM75pCpsWxIthEH1B33dmGBKHw== +"@typescript-eslint/type-utils@5.11.0": + version "5.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.11.0.tgz#58be0ba73d1f6ef8983d79f7f0bc2209b253fefe" + integrity sha512-wDqdsYO6ofLaD4DsGZ0jGwxp4HrzD2YKulpEZXmgN3xo4BHJwf7kq49JTRpV0Gx6bxkSUmc9s0EIK1xPbFFpIA== dependencies: - "@typescript-eslint/utils" "5.10.2" + "@typescript-eslint/utils" "5.11.0" debug "^4.3.2" tsutils "^3.21.0" -"@typescript-eslint/types@5.10.2": - version "5.10.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.10.2.tgz#604d15d795c4601fffba6ecb4587ff9fdec68ce8" - integrity sha512-Qfp0qk/5j2Rz3p3/WhWgu4S1JtMcPgFLnmAKAW061uXxKSa7VWKZsDXVaMXh2N60CX9h6YLaBoy9PJAfCOjk3w== - "@typescript-eslint/types@5.11.0": version "5.11.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.11.0.tgz#ba345818a2540fdf2755c804dc2158517ab61188" integrity sha512-cxgBFGSRCoBEhvSVLkKw39+kMzUKHlJGVwwMbPcTZX3qEhuXhrjwaZXWMxVfxDgyMm+b5Q5b29Llo2yow8Y7xQ== -"@typescript-eslint/typescript-estree@5.10.2": - version "5.10.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.2.tgz#810906056cd3ddcb35aa333fdbbef3713b0fe4a7" - integrity sha512-WHHw6a9vvZls6JkTgGljwCsMkv8wu8XU8WaYKeYhxhWXH/atZeiMW6uDFPLZOvzNOGmuSMvHtZKd6AuC8PrwKQ== - dependencies: - "@typescript-eslint/types" "5.10.2" - "@typescript-eslint/visitor-keys" "5.10.2" - debug "^4.3.2" - globby "^11.0.4" - is-glob "^4.0.3" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.11.0": version "5.11.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.11.0.tgz#53f9e09b88368191e52020af77c312a4777ffa43" @@ -967,26 +941,18 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/utils@5.10.2": - version "5.10.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.10.2.tgz#1fcd37547c32c648ab11aea7173ec30060ee87a8" - integrity sha512-vuJaBeig1NnBRkf7q9tgMLREiYD7zsMrsN1DA3wcoMDvr3BTFiIpKjGiYZoKPllfEwN7spUjv7ZqD+JhbVjEPg== +"@typescript-eslint/utils@5.11.0": + version "5.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.11.0.tgz#d91548ef180d74c95d417950336d9260fdbe1dc5" + integrity sha512-g2I480tFE1iYRDyMhxPAtLQ9HAn0jjBtipgTCZmd9I9s11OV8CTsG+YfFciuNDcHqm4csbAgC2aVZCHzLxMSUw== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.10.2" - "@typescript-eslint/types" "5.10.2" - "@typescript-eslint/typescript-estree" "5.10.2" + "@typescript-eslint/scope-manager" "5.11.0" + "@typescript-eslint/types" "5.11.0" + "@typescript-eslint/typescript-estree" "5.11.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.10.2": - version "5.10.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.2.tgz#fdbf272d8e61c045d865bd6c8b41bea73d222f3d" - integrity sha512-zHIhYGGGrFJvvyfwHk5M08C5B5K4bewkm+rrvNTKk1/S15YHR+SA/QUF8ZWscXSfEaB8Nn2puZj+iHcoxVOD/Q== - dependencies: - "@typescript-eslint/types" "5.10.2" - eslint-visitor-keys "^3.0.0" - "@typescript-eslint/visitor-keys@5.11.0": version "5.11.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.11.0.tgz#888542381f1a2ac745b06d110c83c0b261487ebb" From a274252d277ed9dc8adf6396157456118b6b8c55 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Feb 2022 12:01:52 +0000 Subject: [PATCH 506/785] Bump @types/prettier from 2.4.3 to 2.4.4 Bumps [@types/prettier](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/prettier) from 2.4.3 to 2.4.4. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/prettier) --- updated-dependencies: - dependency-name: "@types/prettier" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index bc1020c1..5fd9fd5f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -860,9 +860,9 @@ integrity sha512-ydLaGVfQOQ6hI1xK2A5nVh8bl0OGoIfYMxPWHqqYe9bTkWCfqiVvZoh2I/QF2sNSkZzZyROBoTefIEI+PB6iIA== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": - version "2.4.3" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.3.tgz#a3c65525b91fca7da00ab1a3ac2b5a2a4afbffbf" - integrity sha512-QzSuZMBuG5u8HqYz01qtMdg/Jfctlnvj1z/lYnIDXs/golxw0fxtRAHd9KrzjR7Yxz1qVeI00o0kiO3PmVdJ9w== + version "2.4.4" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.4.tgz#5d9b63132df54d8909fce1c3f8ca260fdd693e17" + integrity sha512-ReVR2rLTV1kvtlWFyuot+d1pkpG2Fw/XKE3PDAdj57rbM97ttSp9JZ2UsP+2EHTylra9cUf6JA7tGwW1INzUrA== "@types/stack-utils@^2.0.0": version "2.0.1" From 912c6b1d81f36af6001195b29d113919fcd39d25 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Feb 2022 12:46:38 +0000 Subject: [PATCH 507/785] Bump @types/node from 17.0.16 to 17.0.17 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.16 to 17.0.17. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5fd9fd5f..f8be31c6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -855,9 +855,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^17.0.0": - version "17.0.16" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.16.tgz#e3733f46797b9df9e853ca9f719c8a6f7b84cd26" - integrity sha512-ydLaGVfQOQ6hI1xK2A5nVh8bl0OGoIfYMxPWHqqYe9bTkWCfqiVvZoh2I/QF2sNSkZzZyROBoTefIEI+PB6iIA== + version "17.0.17" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.17.tgz#a8ddf6e0c2341718d74ee3dc413a13a042c45a0c" + integrity sha512-e8PUNQy1HgJGV3iU/Bp2+D/DXh3PYeyli8LgIwsQcs1Ar1LoaWHSIT6Rw+H2rNJmiq6SNWiDytfx8+gYj7wDHw== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.4" From 344f55baba5039bd7554d2e6c2f4fe577b57e551 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Feb 2022 12:01:38 +0000 Subject: [PATCH 508/785] Bump eslint from 8.8.0 to 8.9.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.8.0 to 8.9.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.8.0...v8.9.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/yarn.lock b/yarn.lock index f8be31c6..8da72351 100644 --- a/yarn.lock +++ b/yarn.lock @@ -492,14 +492,14 @@ dependencies: "@cspotcode/source-map-consumer" "0.8.0" -"@eslint/eslintrc@^1.0.5": - version "1.0.5" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.0.5.tgz#33f1b838dbf1f923bfa517e008362b78ddbbf318" - integrity sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ== +"@eslint/eslintrc@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.1.0.tgz#583d12dbec5d4f22f333f9669f7d0b7c7815b4d3" + integrity sha512-C1DfL7XX4nPqGd6jcP01W9pVM1HYCuUkFk1432D7F0v3JSlUIeOYn9oCoi3eoLZ+iwBSb29BMFxxny0YrrEZqg== dependencies: ajv "^6.12.4" debug "^4.3.2" - espree "^9.2.0" + espree "^9.3.1" globals "^13.9.0" ignore "^4.0.6" import-fresh "^3.2.1" @@ -1517,10 +1517,10 @@ eslint-scope@^5.1.1: esrecurse "^4.3.0" estraverse "^4.1.1" -eslint-scope@^7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.0.tgz#c1f6ea30ac583031f203d65c73e723b01298f153" - integrity sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg== +eslint-scope@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.1.tgz#fff34894c2f65e5226d3041ac480b4513a163642" + integrity sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw== dependencies: esrecurse "^4.3.0" estraverse "^5.2.0" @@ -1537,17 +1537,17 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.1.0, eslint-visitor-keys@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.2.0.tgz#6fbb166a6798ee5991358bc2daa1ba76cc1254a1" - integrity sha512-IOzT0X126zn7ALX0dwFiUQEdsfzrm4+ISsQS8nukaJXwEyYKRSnEIIDULYg1mCtGp7UUXgfGl7BIolXREQK+XQ== +eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" + integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.1.0: - version "8.8.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.8.0.tgz#9762b49abad0cb4952539ffdb0a046392e571a2d" - integrity sha512-H3KXAzQGBH1plhYS3okDix2ZthuYJlQQEGE5k0IKuEqUSiyu4AmxxlJ2MtTYeJ3xB4jDhcYCwGOg2TXYdnDXlQ== + version "8.9.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.9.0.tgz#a2a8227a99599adc4342fd9b854cb8d8d6412fdb" + integrity sha512-PB09IGwv4F4b0/atrbcMFboF/giawbBLVC7fyDamk5Wtey4Jh2K+rYaBhCAbUyEI4QzB1ly09Uglc9iCtFaG2Q== dependencies: - "@eslint/eslintrc" "^1.0.5" + "@eslint/eslintrc" "^1.1.0" "@humanwhocodes/config-array" "^0.9.2" ajv "^6.10.0" chalk "^4.0.0" @@ -1555,10 +1555,10 @@ eslint@^8.1.0: debug "^4.3.2" doctrine "^3.0.0" escape-string-regexp "^4.0.0" - eslint-scope "^7.1.0" + eslint-scope "^7.1.1" eslint-utils "^3.0.0" - eslint-visitor-keys "^3.2.0" - espree "^9.3.0" + eslint-visitor-keys "^3.3.0" + espree "^9.3.1" esquery "^1.4.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -1583,14 +1583,14 @@ eslint@^8.1.0: text-table "^0.2.0" v8-compile-cache "^2.0.3" -espree@^9.2.0, espree@^9.3.0: - version "9.3.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.0.tgz#c1240d79183b72aaee6ccfa5a90bc9111df085a8" - integrity sha512-d/5nCsb0JcqsSEeQzFZ8DH1RmxPcglRWh24EFTlUEmCKoehXGdpsx0RkHDubqUI8LSAIKMQp4r9SzQ3n+sm4HQ== +espree@^9.3.1: + version "9.3.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.1.tgz#8793b4bc27ea4c778c19908e0719e7b8f4115bcd" + integrity sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ== dependencies: acorn "^8.7.0" acorn-jsx "^5.3.1" - eslint-visitor-keys "^3.1.0" + eslint-visitor-keys "^3.3.0" esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" From f358c48a49b3f69fd3615bae987832319c0a3f08 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Feb 2022 12:01:35 +0000 Subject: [PATCH 509/785] Bump @typescript-eslint/parser from 5.11.0 to 5.12.0 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.11.0 to 5.12.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.12.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index 8da72351..6be810b5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -897,13 +897,13 @@ tsutils "^3.21.0" "@typescript-eslint/parser@^5.4.0": - version "5.11.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.11.0.tgz#b4fcaf65513f9b34bdcbffdda055724a5efb7e04" - integrity sha512-x0DCjetHZYBRovJdr3U0zG9OOdNXUaFLJ82ehr1AlkArljJuwEsgnud+Q7umlGDFLFrs8tU8ybQDFocp/eX8mQ== + version "5.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.12.0.tgz#0ca669861813df99ce54916f66f524c625ed2434" + integrity sha512-MfSwg9JMBojMUoGjUmX+D2stoQj1CBYTCP0qnnVtu9A+YQXVKNtLjasYh+jozOcrb/wau8TCfWOkQTiOAruBog== dependencies: - "@typescript-eslint/scope-manager" "5.11.0" - "@typescript-eslint/types" "5.11.0" - "@typescript-eslint/typescript-estree" "5.11.0" + "@typescript-eslint/scope-manager" "5.12.0" + "@typescript-eslint/types" "5.12.0" + "@typescript-eslint/typescript-estree" "5.12.0" debug "^4.3.2" "@typescript-eslint/scope-manager@5.11.0": @@ -914,6 +914,14 @@ "@typescript-eslint/types" "5.11.0" "@typescript-eslint/visitor-keys" "5.11.0" +"@typescript-eslint/scope-manager@5.12.0": + version "5.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.12.0.tgz#59619e6e5e2b1ce6cb3948b56014d3a24da83f5e" + integrity sha512-GAMobtIJI8FGf1sLlUWNUm2IOkIjvn7laFWyRx7CLrv6nLBI7su+B7lbStqVlK5NdLvHRFiJo2HhiDF7Ki01WQ== + dependencies: + "@typescript-eslint/types" "5.12.0" + "@typescript-eslint/visitor-keys" "5.12.0" + "@typescript-eslint/type-utils@5.11.0": version "5.11.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.11.0.tgz#58be0ba73d1f6ef8983d79f7f0bc2209b253fefe" @@ -928,6 +936,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.11.0.tgz#ba345818a2540fdf2755c804dc2158517ab61188" integrity sha512-cxgBFGSRCoBEhvSVLkKw39+kMzUKHlJGVwwMbPcTZX3qEhuXhrjwaZXWMxVfxDgyMm+b5Q5b29Llo2yow8Y7xQ== +"@typescript-eslint/types@5.12.0": + version "5.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.12.0.tgz#5b4030a28222ee01e851836562c07769eecda0b8" + integrity sha512-JowqbwPf93nvf8fZn5XrPGFBdIK8+yx5UEGs2QFAYFI8IWYfrzz+6zqlurGr2ctShMaJxqwsqmra3WXWjH1nRQ== + "@typescript-eslint/typescript-estree@5.11.0": version "5.11.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.11.0.tgz#53f9e09b88368191e52020af77c312a4777ffa43" @@ -941,6 +954,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.12.0": + version "5.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.12.0.tgz#cabf545fd592722f0e2b4104711e63bf89525cd2" + integrity sha512-Dd9gVeOqt38QHR0BEA8oRaT65WYqPYbIc5tRFQPkfLquVEFPD1HAtbZT98TLBkEcCkvwDYOAvuSvAD9DnQhMfQ== + dependencies: + "@typescript-eslint/types" "5.12.0" + "@typescript-eslint/visitor-keys" "5.12.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.11.0": version "5.11.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.11.0.tgz#d91548ef180d74c95d417950336d9260fdbe1dc5" @@ -961,6 +987,14 @@ "@typescript-eslint/types" "5.11.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.12.0": + version "5.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.12.0.tgz#1ac9352ed140b07ba144ebf371b743fdf537ec16" + integrity sha512-cFwTlgnMV6TgezQynx2c/4/tx9Tufbuo9LPzmWqyRC3QC4qTGkAG1C6pBr0/4I10PAI/FlYunI3vJjIcu+ZHMg== + dependencies: + "@typescript-eslint/types" "5.12.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 3bd6b3e326f97804382330b1b84710bf2d2fc267 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Feb 2022 12:01:44 +0000 Subject: [PATCH 510/785] Bump @types/node from 17.0.17 to 17.0.18 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.17 to 17.0.18. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 8da72351..e7123012 100644 --- a/yarn.lock +++ b/yarn.lock @@ -855,9 +855,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^17.0.0": - version "17.0.17" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.17.tgz#a8ddf6e0c2341718d74ee3dc413a13a042c45a0c" - integrity sha512-e8PUNQy1HgJGV3iU/Bp2+D/DXh3PYeyli8LgIwsQcs1Ar1LoaWHSIT6Rw+H2rNJmiq6SNWiDytfx8+gYj7wDHw== + version "17.0.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.18.tgz#3b4fed5cfb58010e3a2be4b6e74615e4847f1074" + integrity sha512-eKj4f/BsN/qcculZiRSujogjvp5O/k4lOW5m35NopjZM/QwLOR075a8pJW5hD+Rtdm2DaCVPENS6KtSQnUD6BA== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.4" From 32af24fa6806235e64cd5cbc3df1874f3ed9ccfc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Feb 2022 12:17:35 +0000 Subject: [PATCH 511/785] Bump @typescript-eslint/eslint-plugin from 5.11.0 to 5.12.0 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.11.0 to 5.12.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.12.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 70 ++++++++++++++----------------------------------------- 1 file changed, 18 insertions(+), 52 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4daa3865..aa5bfd6a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -882,13 +882,13 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.4.0": - version "5.11.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.11.0.tgz#3b866371d8d75c70f9b81535e7f7d3aa26527c7a" - integrity sha512-HJh33bgzXe6jGRocOj4FmefD7hRY4itgjzOrSs3JPrTNXsX7j5+nQPciAUj/1nZtwo2kAc3C75jZO+T23gzSGw== + version "5.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.12.0.tgz#bb46dd7ce7015c0928b98af1e602118e97df6c70" + integrity sha512-fwCMkDimwHVeIOKeBHiZhRUfJXU8n6xW1FL9diDxAyGAFvKcH4csy0v7twivOQdQdA0KC8TDr7GGRd3L4Lv0rQ== dependencies: - "@typescript-eslint/scope-manager" "5.11.0" - "@typescript-eslint/type-utils" "5.11.0" - "@typescript-eslint/utils" "5.11.0" + "@typescript-eslint/scope-manager" "5.12.0" + "@typescript-eslint/type-utils" "5.12.0" + "@typescript-eslint/utils" "5.12.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -906,14 +906,6 @@ "@typescript-eslint/typescript-estree" "5.12.0" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.11.0": - version "5.11.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.11.0.tgz#f5aef83ff253f457ecbee5f46f762298f0101e4b" - integrity sha512-z+K4LlahDFVMww20t/0zcA7gq/NgOawaLuxgqGRVKS0PiZlCTIUtX0EJbC0BK1JtR4CelmkPK67zuCgpdlF4EA== - dependencies: - "@typescript-eslint/types" "5.11.0" - "@typescript-eslint/visitor-keys" "5.11.0" - "@typescript-eslint/scope-manager@5.12.0": version "5.12.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.12.0.tgz#59619e6e5e2b1ce6cb3948b56014d3a24da83f5e" @@ -922,38 +914,20 @@ "@typescript-eslint/types" "5.12.0" "@typescript-eslint/visitor-keys" "5.12.0" -"@typescript-eslint/type-utils@5.11.0": - version "5.11.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.11.0.tgz#58be0ba73d1f6ef8983d79f7f0bc2209b253fefe" - integrity sha512-wDqdsYO6ofLaD4DsGZ0jGwxp4HrzD2YKulpEZXmgN3xo4BHJwf7kq49JTRpV0Gx6bxkSUmc9s0EIK1xPbFFpIA== +"@typescript-eslint/type-utils@5.12.0": + version "5.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.12.0.tgz#aaf45765de71c6d9707c66ccff76ec2b9aa31bb6" + integrity sha512-9j9rli3zEBV+ae7rlbBOotJcI6zfc6SHFMdKI9M3Nc0sy458LJ79Os+TPWeBBL96J9/e36rdJOfCuyRSgFAA0Q== dependencies: - "@typescript-eslint/utils" "5.11.0" + "@typescript-eslint/utils" "5.12.0" debug "^4.3.2" tsutils "^3.21.0" -"@typescript-eslint/types@5.11.0": - version "5.11.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.11.0.tgz#ba345818a2540fdf2755c804dc2158517ab61188" - integrity sha512-cxgBFGSRCoBEhvSVLkKw39+kMzUKHlJGVwwMbPcTZX3qEhuXhrjwaZXWMxVfxDgyMm+b5Q5b29Llo2yow8Y7xQ== - "@typescript-eslint/types@5.12.0": version "5.12.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.12.0.tgz#5b4030a28222ee01e851836562c07769eecda0b8" integrity sha512-JowqbwPf93nvf8fZn5XrPGFBdIK8+yx5UEGs2QFAYFI8IWYfrzz+6zqlurGr2ctShMaJxqwsqmra3WXWjH1nRQ== -"@typescript-eslint/typescript-estree@5.11.0": - version "5.11.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.11.0.tgz#53f9e09b88368191e52020af77c312a4777ffa43" - integrity sha512-yVH9hKIv3ZN3lw8m/Jy5I4oXO4ZBMqijcXCdA4mY8ull6TPTAoQnKKrcZ0HDXg7Bsl0Unwwx7jcXMuNZc0m4lg== - dependencies: - "@typescript-eslint/types" "5.11.0" - "@typescript-eslint/visitor-keys" "5.11.0" - debug "^4.3.2" - globby "^11.0.4" - is-glob "^4.0.3" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.12.0": version "5.12.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.12.0.tgz#cabf545fd592722f0e2b4104711e63bf89525cd2" @@ -967,26 +941,18 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/utils@5.11.0": - version "5.11.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.11.0.tgz#d91548ef180d74c95d417950336d9260fdbe1dc5" - integrity sha512-g2I480tFE1iYRDyMhxPAtLQ9HAn0jjBtipgTCZmd9I9s11OV8CTsG+YfFciuNDcHqm4csbAgC2aVZCHzLxMSUw== +"@typescript-eslint/utils@5.12.0": + version "5.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.12.0.tgz#92fd3193191621ab863add2f553a7b38b65646af" + integrity sha512-k4J2WovnMPGI4PzKgDtQdNrCnmBHpMUFy21qjX2CoPdoBcSBIMvVBr9P2YDP8jOqZOeK3ThOL6VO/sy6jtnvzw== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.11.0" - "@typescript-eslint/types" "5.11.0" - "@typescript-eslint/typescript-estree" "5.11.0" + "@typescript-eslint/scope-manager" "5.12.0" + "@typescript-eslint/types" "5.12.0" + "@typescript-eslint/typescript-estree" "5.12.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.11.0": - version "5.11.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.11.0.tgz#888542381f1a2ac745b06d110c83c0b261487ebb" - integrity sha512-E8w/vJReMGuloGxJDkpPlGwhxocxOpSVgSvjiLO5IxZPmxZF30weOeJYyPSEACwM+X4NziYS9q+WkN/2DHYQwA== - dependencies: - "@typescript-eslint/types" "5.11.0" - eslint-visitor-keys "^3.0.0" - "@typescript-eslint/visitor-keys@5.12.0": version "5.12.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.12.0.tgz#1ac9352ed140b07ba144ebf371b743fdf537ec16" From 8c50c05501f7a57bcc37b3a8f3dfe6986449aa9f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Feb 2022 12:01:26 +0000 Subject: [PATCH 512/785] Bump eslint-config-prettier from 8.3.0 to 8.4.0 Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.3.0 to 8.4.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.3.0...v8.4.0) --- updated-dependencies: - dependency-name: eslint-config-prettier dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index aa5bfd6a..ff36cc06 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1505,9 +1505,9 @@ escodegen@^2.0.0: source-map "~0.6.1" eslint-config-prettier@^8.0.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a" - integrity sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew== + 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-scope@^5.1.1: version "5.1.1" From 14c494df382e3f47cbc47d7dcc06ede95b7b912f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Feb 2022 12:01:39 +0000 Subject: [PATCH 513/785] Bump @types/node from 17.0.18 to 17.0.19 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.18 to 17.0.19. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index aa5bfd6a..dcaac153 100644 --- a/yarn.lock +++ b/yarn.lock @@ -855,9 +855,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^17.0.0": - version "17.0.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.18.tgz#3b4fed5cfb58010e3a2be4b6e74615e4847f1074" - integrity sha512-eKj4f/BsN/qcculZiRSujogjvp5O/k4lOW5m35NopjZM/QwLOR075a8pJW5hD+Rtdm2DaCVPENS6KtSQnUD6BA== + version "17.0.19" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.19.tgz#726171367f404bfbe8512ba608a09ebad810c7e6" + integrity sha512-PfeQhvcMR4cPFVuYfBN4ifG7p9c+Dlh3yUZR6k+5yQK7wX3gDgVxBly4/WkBRs9x4dmcy1TVl08SY67wwtEvmA== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.4" From 4920a88d91bb33a6afeece7e3d2a35d2cc740285 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Feb 2022 12:01:29 +0000 Subject: [PATCH 514/785] Bump @typescript-eslint/parser from 5.12.0 to 5.12.1 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.12.0 to 5.12.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.12.1/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index dcaac153..6c77ddfd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -897,13 +897,13 @@ tsutils "^3.21.0" "@typescript-eslint/parser@^5.4.0": - version "5.12.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.12.0.tgz#0ca669861813df99ce54916f66f524c625ed2434" - integrity sha512-MfSwg9JMBojMUoGjUmX+D2stoQj1CBYTCP0qnnVtu9A+YQXVKNtLjasYh+jozOcrb/wau8TCfWOkQTiOAruBog== + version "5.12.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.12.1.tgz#b090289b553b8aa0899740d799d0f96e6f49771b" + integrity sha512-6LuVUbe7oSdHxUWoX/m40Ni8gsZMKCi31rlawBHt7VtW15iHzjbpj2WLiToG2758KjtCCiLRKZqfrOdl3cNKuw== dependencies: - "@typescript-eslint/scope-manager" "5.12.0" - "@typescript-eslint/types" "5.12.0" - "@typescript-eslint/typescript-estree" "5.12.0" + "@typescript-eslint/scope-manager" "5.12.1" + "@typescript-eslint/types" "5.12.1" + "@typescript-eslint/typescript-estree" "5.12.1" debug "^4.3.2" "@typescript-eslint/scope-manager@5.12.0": @@ -914,6 +914,14 @@ "@typescript-eslint/types" "5.12.0" "@typescript-eslint/visitor-keys" "5.12.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== + dependencies: + "@typescript-eslint/types" "5.12.1" + "@typescript-eslint/visitor-keys" "5.12.1" + "@typescript-eslint/type-utils@5.12.0": version "5.12.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.12.0.tgz#aaf45765de71c6d9707c66ccff76ec2b9aa31bb6" @@ -928,6 +936,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.12.0.tgz#5b4030a28222ee01e851836562c07769eecda0b8" integrity sha512-JowqbwPf93nvf8fZn5XrPGFBdIK8+yx5UEGs2QFAYFI8IWYfrzz+6zqlurGr2ctShMaJxqwsqmra3WXWjH1nRQ== +"@typescript-eslint/types@5.12.1": + version "5.12.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.12.1.tgz#46a36a28ff4d946821b58fe5a73c81dc2e12aa89" + integrity sha512-hfcbq4qVOHV1YRdhkDldhV9NpmmAu2vp6wuFODL71Y0Ixak+FLeEU4rnPxgmZMnGreGEghlEucs9UZn5KOfHJA== + "@typescript-eslint/typescript-estree@5.12.0": version "5.12.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.12.0.tgz#cabf545fd592722f0e2b4104711e63bf89525cd2" @@ -941,6 +954,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@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" + integrity sha512-ahOdkIY9Mgbza7L9sIi205Pe1inCkZWAHE1TV1bpxlU4RZNPtXaDZfiiFWcL9jdxvW1hDYZJXrFm+vlMkXRbBw== + dependencies: + "@typescript-eslint/types" "5.12.1" + "@typescript-eslint/visitor-keys" "5.12.1" + 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.12.0": version "5.12.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.12.0.tgz#92fd3193191621ab863add2f553a7b38b65646af" @@ -961,6 +987,14 @@ "@typescript-eslint/types" "5.12.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.12.1": + version "5.12.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.12.1.tgz#f722da106c8f9695ae5640574225e45af3e52ec3" + integrity sha512-l1KSLfupuwrXx6wc0AuOmC7Ko5g14ZOQ86wJJqRbdLbXLK02pK/DPiDDqCc7BqqiiA04/eAA6ayL0bgOrAkH7A== + dependencies: + "@typescript-eslint/types" "5.12.1" + 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 3b7279e68fa9f3db0f139a7fa0c863572041ca3c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Feb 2022 12:11:23 +0000 Subject: [PATCH 515/785] Bump @typescript-eslint/eslint-plugin from 5.12.0 to 5.12.1 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.12.0 to 5.12.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.12.1/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 70 ++++++++++++++----------------------------------------- 1 file changed, 18 insertions(+), 52 deletions(-) diff --git a/yarn.lock b/yarn.lock index 6c77ddfd..6832f2bc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -882,13 +882,13 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.4.0": - version "5.12.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.12.0.tgz#bb46dd7ce7015c0928b98af1e602118e97df6c70" - integrity sha512-fwCMkDimwHVeIOKeBHiZhRUfJXU8n6xW1FL9diDxAyGAFvKcH4csy0v7twivOQdQdA0KC8TDr7GGRd3L4Lv0rQ== + version "5.12.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.12.1.tgz#b2cd3e288f250ce8332d5035a2ff65aba3374ac4" + integrity sha512-M499lqa8rnNK7mUv74lSFFttuUsubIRdAbHcVaP93oFcKkEmHmLqy2n7jM9C8DVmFMYK61ExrZU6dLYhQZmUpw== dependencies: - "@typescript-eslint/scope-manager" "5.12.0" - "@typescript-eslint/type-utils" "5.12.0" - "@typescript-eslint/utils" "5.12.0" + "@typescript-eslint/scope-manager" "5.12.1" + "@typescript-eslint/type-utils" "5.12.1" + "@typescript-eslint/utils" "5.12.1" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -906,14 +906,6 @@ "@typescript-eslint/typescript-estree" "5.12.1" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.12.0": - version "5.12.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.12.0.tgz#59619e6e5e2b1ce6cb3948b56014d3a24da83f5e" - integrity sha512-GAMobtIJI8FGf1sLlUWNUm2IOkIjvn7laFWyRx7CLrv6nLBI7su+B7lbStqVlK5NdLvHRFiJo2HhiDF7Ki01WQ== - dependencies: - "@typescript-eslint/types" "5.12.0" - "@typescript-eslint/visitor-keys" "5.12.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" @@ -922,38 +914,20 @@ "@typescript-eslint/types" "5.12.1" "@typescript-eslint/visitor-keys" "5.12.1" -"@typescript-eslint/type-utils@5.12.0": - version "5.12.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.12.0.tgz#aaf45765de71c6d9707c66ccff76ec2b9aa31bb6" - integrity sha512-9j9rli3zEBV+ae7rlbBOotJcI6zfc6SHFMdKI9M3Nc0sy458LJ79Os+TPWeBBL96J9/e36rdJOfCuyRSgFAA0Q== +"@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== dependencies: - "@typescript-eslint/utils" "5.12.0" + "@typescript-eslint/utils" "5.12.1" debug "^4.3.2" tsutils "^3.21.0" -"@typescript-eslint/types@5.12.0": - version "5.12.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.12.0.tgz#5b4030a28222ee01e851836562c07769eecda0b8" - integrity sha512-JowqbwPf93nvf8fZn5XrPGFBdIK8+yx5UEGs2QFAYFI8IWYfrzz+6zqlurGr2ctShMaJxqwsqmra3WXWjH1nRQ== - "@typescript-eslint/types@5.12.1": version "5.12.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.12.1.tgz#46a36a28ff4d946821b58fe5a73c81dc2e12aa89" integrity sha512-hfcbq4qVOHV1YRdhkDldhV9NpmmAu2vp6wuFODL71Y0Ixak+FLeEU4rnPxgmZMnGreGEghlEucs9UZn5KOfHJA== -"@typescript-eslint/typescript-estree@5.12.0": - version "5.12.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.12.0.tgz#cabf545fd592722f0e2b4104711e63bf89525cd2" - integrity sha512-Dd9gVeOqt38QHR0BEA8oRaT65WYqPYbIc5tRFQPkfLquVEFPD1HAtbZT98TLBkEcCkvwDYOAvuSvAD9DnQhMfQ== - dependencies: - "@typescript-eslint/types" "5.12.0" - "@typescript-eslint/visitor-keys" "5.12.0" - debug "^4.3.2" - globby "^11.0.4" - is-glob "^4.0.3" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.12.1": version "5.12.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.12.1.tgz#6a9425b9c305bcbc38e2d1d9a24c08e15e02b722" @@ -967,26 +941,18 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/utils@5.12.0": - version "5.12.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.12.0.tgz#92fd3193191621ab863add2f553a7b38b65646af" - integrity sha512-k4J2WovnMPGI4PzKgDtQdNrCnmBHpMUFy21qjX2CoPdoBcSBIMvVBr9P2YDP8jOqZOeK3ThOL6VO/sy6jtnvzw== +"@typescript-eslint/utils@5.12.1": + version "5.12.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.12.1.tgz#447c24a05d9c33f9c6c64cb48f251f2371eef920" + integrity sha512-Qq9FIuU0EVEsi8fS6pG+uurbhNTtoYr4fq8tKjBupsK5Bgbk2I32UGm0Sh+WOyjOPgo/5URbxxSNV6HYsxV4MQ== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.12.0" - "@typescript-eslint/types" "5.12.0" - "@typescript-eslint/typescript-estree" "5.12.0" + "@typescript-eslint/scope-manager" "5.12.1" + "@typescript-eslint/types" "5.12.1" + "@typescript-eslint/typescript-estree" "5.12.1" eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.12.0": - version "5.12.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.12.0.tgz#1ac9352ed140b07ba144ebf371b743fdf537ec16" - integrity sha512-cFwTlgnMV6TgezQynx2c/4/tx9Tufbuo9LPzmWqyRC3QC4qTGkAG1C6pBr0/4I10PAI/FlYunI3vJjIcu+ZHMg== - dependencies: - "@typescript-eslint/types" "5.12.0" - eslint-visitor-keys "^3.0.0" - "@typescript-eslint/visitor-keys@5.12.1": version "5.12.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.12.1.tgz#f722da106c8f9695ae5640574225e45af3e52ec3" From 2e9e1ff49ad71921848e4f2ccf2d60a545eec5aa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 23 Feb 2022 12:01:32 +0000 Subject: [PATCH 516/785] Bump @types/jest from 27.4.0 to 27.4.1 Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 27.4.0 to 27.4.1. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 42 ++++++------------------------------------ 1 file changed, 6 insertions(+), 36 deletions(-) diff --git a/yarn.lock b/yarn.lock index 6832f2bc..90b47b20 100644 --- a/yarn.lock +++ b/yarn.lock @@ -837,11 +837,11 @@ "@types/istanbul-lib-report" "*" "@types/jest@^27.0.1": - version "27.4.0" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.4.0.tgz#037ab8b872067cae842a320841693080f9cb84ed" - integrity sha512-gHl8XuC1RZ8H2j5sHv/JqsaxXkDDM9iDOgu0Wp8sjs4u/snb2PVehyWXJPr+ORA0RPpgw231mnutWI1+0hgjIQ== + version "27.4.1" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.4.1.tgz#185cbe2926eaaf9662d340cc02e548ce9e11ab6d" + integrity sha512-23iPJADSmicDVrWk+HT58LMJtzLAnB2AgIzplQuq/bSrGaxCrlvRFjGbXmamnnk/mAmCdLStiGqggu28ocUyiw== dependencies: - jest-diff "^27.0.0" + jest-matcher-utils "^27.0.0" pretty-format "^27.0.0" "@types/json-schema@^7.0.9": @@ -1407,11 +1407,6 @@ detect-newline@^3.0.0: resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== -diff-sequences@^27.4.0: - version "27.4.0" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.4.0.tgz#d783920ad8d06ec718a060d00196dfef25b132a5" - integrity sha512-YqiQzkrsmHMH5uuh8OdQFU9/ZpADnwzml8z0O5HvRNda+5UZsaX/xN+AAxfR2hWq1Y7HZnAzO9J5lJXOuDz2Ww== - diff-sequences@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.5.1.tgz#eaecc0d327fd68c8d9672a1e64ab8dccb2ef5327" @@ -2157,16 +2152,6 @@ jest-config@^27.5.1: slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^27.0.0: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.4.2.tgz#786b2a5211d854f848e2dcc1e324448e9481f36f" - integrity sha512-ujc9ToyUZDh9KcqvQDkk/gkbf6zSaeEg9AiBxtttXW59H/AcqEYp1ciXAtJp+jXWva5nAf/ePtSsgWwE5mqp4Q== - dependencies: - chalk "^4.0.0" - diff-sequences "^27.4.0" - jest-get-type "^27.4.0" - pretty-format "^27.4.2" - jest-diff@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.5.1.tgz#a07f5011ac9e6643cf8a95a462b7b1ecf6680def" @@ -2220,11 +2205,6 @@ jest-environment-node@^27.5.1: jest-mock "^27.5.1" jest-util "^27.5.1" -jest-get-type@^27.4.0: - version "27.4.0" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.4.0.tgz#7503d2663fffa431638337b3998d39c5e928e9b5" - integrity sha512-tk9o+ld5TWq41DkK14L4wox4s2D9MtTpKaAVzXfr5CUKm5ZK2ExcaFE0qls2W71zE/6R2TxxrK9w2r6svAFDBQ== - jest-get-type@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.5.1.tgz#3cd613c507b0f7ace013df407a1c1cd578bcb4f1" @@ -2281,7 +2261,7 @@ jest-leak-detector@^27.5.1: jest-get-type "^27.5.1" pretty-format "^27.5.1" -jest-matcher-utils@^27.5.1: +jest-matcher-utils@^27.0.0, jest-matcher-utils@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.5.1.tgz#9c0cdbda8245bc22d2331729d1091308b40cf8ab" integrity sha512-z2uTx/T6LBaCoNWNFWwChLBKYxTMcGBRjAt+2SbP929/Fflb9aa5LGma654Rz8z9HLxsrUaYzxE9T/EFIL/PAw== @@ -2907,17 +2887,7 @@ prettier@>=2.3.0: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.1.tgz#fff75fa9d519c54cf0fce328c1017d94546bc56a" integrity sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg== -pretty-format@^27.0.0, pretty-format@^27.4.2: - version "27.4.2" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.4.2.tgz#e4ce92ad66c3888423d332b40477c87d1dac1fb8" - integrity sha512-p0wNtJ9oLuvgOQDEIZ9zQjZffK7KtyR6Si0jnXULIDwrlNF8Cuir3AZP0hHv0jmKuNN/edOnbMjnzd4uTcmWiw== - dependencies: - "@jest/types" "^27.4.2" - ansi-regex "^5.0.1" - ansi-styles "^5.0.0" - react-is "^17.0.1" - -pretty-format@^27.5.1: +pretty-format@^27.0.0, pretty-format@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e" integrity sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ== From 1eb7ff287daa6e7daaac6c926ae791564846026f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 23 Feb 2022 12:01:45 +0000 Subject: [PATCH 517/785] Bump @types/node from 17.0.19 to 17.0.20 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.19 to 17.0.20. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 6832f2bc..b1160ed3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -855,9 +855,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^17.0.0": - version "17.0.19" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.19.tgz#726171367f404bfbe8512ba608a09ebad810c7e6" - integrity sha512-PfeQhvcMR4cPFVuYfBN4ifG7p9c+Dlh3yUZR6k+5yQK7wX3gDgVxBly4/WkBRs9x4dmcy1TVl08SY67wwtEvmA== + version "17.0.20" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.20.tgz#29626bd9c9119df5b8194353d34044c895fe56e3" + integrity sha512-Q15Clj3lZSLnhVA6yKw1G7SQz46DeL9gO1TEgfK1OQGvMdQ6TUWmCeWf1QBUNkw2BDfV52i2YuYd9OF3ZwGhjw== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.4" From 735614c530f43df04a8afa86cbcdaefbb4ef7362 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Feb 2022 12:01:59 +0000 Subject: [PATCH 518/785] Bump @types/node from 17.0.20 to 17.0.21 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.20 to 17.0.21. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index ca789652..5832b735 100644 --- a/yarn.lock +++ b/yarn.lock @@ -855,9 +855,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^17.0.0": - version "17.0.20" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.20.tgz#29626bd9c9119df5b8194353d34044c895fe56e3" - integrity sha512-Q15Clj3lZSLnhVA6yKw1G7SQz46DeL9gO1TEgfK1OQGvMdQ6TUWmCeWf1QBUNkw2BDfV52i2YuYd9OF3ZwGhjw== + version "17.0.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.21.tgz#864b987c0c68d07b4345845c3e63b75edd143644" + integrity sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.4" From e05388b445a1ad1b2f83830a585fa7211602d28c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Feb 2022 12:01:36 +0000 Subject: [PATCH 519/785] Bump eslint from 8.9.0 to 8.10.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.9.0 to 8.10.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.9.0...v8.10.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5832b735..690a85f7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -492,10 +492,10 @@ dependencies: "@cspotcode/source-map-consumer" "0.8.0" -"@eslint/eslintrc@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.1.0.tgz#583d12dbec5d4f22f333f9669f7d0b7c7815b4d3" - integrity sha512-C1DfL7XX4nPqGd6jcP01W9pVM1HYCuUkFk1432D7F0v3JSlUIeOYn9oCoi3eoLZ+iwBSb29BMFxxny0YrrEZqg== +"@eslint/eslintrc@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.2.0.tgz#7ce1547a5c46dfe56e1e45c3c9ed18038c721c6a" + integrity sha512-igm9SjJHNEJRiUnecP/1R5T3wKLEJ7pL6e2P+GUSfCd0dGjPYYZve08uzw8L2J8foVHFz+NGu12JxRcU2gGo6w== dependencies: ajv "^6.12.4" debug "^4.3.2" @@ -1538,11 +1538,11 @@ eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.3.0: integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.1.0: - version "8.9.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.9.0.tgz#a2a8227a99599adc4342fd9b854cb8d8d6412fdb" - integrity sha512-PB09IGwv4F4b0/atrbcMFboF/giawbBLVC7fyDamk5Wtey4Jh2K+rYaBhCAbUyEI4QzB1ly09Uglc9iCtFaG2Q== + version "8.10.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.10.0.tgz#931be395eb60f900c01658b278e05b6dae47199d" + integrity sha512-tcI1D9lfVec+R4LE1mNDnzoJ/f71Kl/9Cv4nG47jOueCMBrCCKYXr4AUVS7go6mWYGFD4+EoN6+eXSrEbRzXVw== dependencies: - "@eslint/eslintrc" "^1.1.0" + "@eslint/eslintrc" "^1.2.0" "@humanwhocodes/config-array" "^0.9.2" ajv "^6.10.0" chalk "^4.0.0" From 889acfc078859021081489a328cbfe08058de4b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Mar 2022 12:01:33 +0000 Subject: [PATCH 520/785] Bump @typescript-eslint/parser from 5.12.1 to 5.13.0 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.12.1 to 5.13.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.13.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index 690a85f7..2213a4bb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -897,13 +897,13 @@ tsutils "^3.21.0" "@typescript-eslint/parser@^5.4.0": - version "5.12.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.12.1.tgz#b090289b553b8aa0899740d799d0f96e6f49771b" - integrity sha512-6LuVUbe7oSdHxUWoX/m40Ni8gsZMKCi31rlawBHt7VtW15iHzjbpj2WLiToG2758KjtCCiLRKZqfrOdl3cNKuw== + version "5.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.13.0.tgz#0394ed8f2f849273c0bf4b811994d177112ced5c" + integrity sha512-GdrU4GvBE29tm2RqWOM0P5QfCtgCyN4hXICj/X9ibKED16136l9ZpoJvCL5pSKtmJzA+NRDzQ312wWMejCVVfg== dependencies: - "@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" debug "^4.3.2" "@typescript-eslint/scope-manager@5.12.1": @@ -914,6 +914,14 @@ "@typescript-eslint/types" "5.12.1" "@typescript-eslint/visitor-keys" "5.12.1" +"@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.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" @@ -928,6 +936,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" @@ -941,6 +954,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@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.12.1": version "5.12.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.12.1.tgz#447c24a05d9c33f9c6c64cb48f251f2371eef920" @@ -961,6 +987,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 09151666e339853b1499bb6cd58e2e890ae7064b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Mar 2022 12:22:21 +0000 Subject: [PATCH 521/785] Bump @typescript-eslint/eslint-plugin from 5.12.1 to 5.13.0 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.12.1 to 5.13.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.13.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 70 ++++++++++++++----------------------------------------- 1 file changed, 18 insertions(+), 52 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2213a4bb..008be2fd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -882,13 +882,13 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.4.0": - version "5.12.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.12.1.tgz#b2cd3e288f250ce8332d5035a2ff65aba3374ac4" - integrity sha512-M499lqa8rnNK7mUv74lSFFttuUsubIRdAbHcVaP93oFcKkEmHmLqy2n7jM9C8DVmFMYK61ExrZU6dLYhQZmUpw== + 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" @@ -906,14 +906,6 @@ "@typescript-eslint/typescript-estree" "5.13.0" debug "^4.3.2" -"@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== - dependencies: - "@typescript-eslint/types" "5.12.1" - "@typescript-eslint/visitor-keys" "5.12.1" - "@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" @@ -922,38 +914,20 @@ "@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" -"@typescript-eslint/types@5.12.1": - version "5.12.1" - 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" - integrity sha512-ahOdkIY9Mgbza7L9sIi205Pe1inCkZWAHE1TV1bpxlU4RZNPtXaDZfiiFWcL9jdxvW1hDYZJXrFm+vlMkXRbBw== - dependencies: - "@typescript-eslint/types" "5.12.1" - "@typescript-eslint/visitor-keys" "5.12.1" - debug "^4.3.2" - globby "^11.0.4" - is-glob "^4.0.3" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.13.0": version "5.13.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.13.0.tgz#b37c07b748ff030a3e93d87c842714e020b78141" @@ -967,26 +941,18 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/utils@5.12.1": - 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/utils@5.13.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" -"@typescript-eslint/visitor-keys@5.12.1": - version "5.12.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.12.1.tgz#f722da106c8f9695ae5640574225e45af3e52ec3" - integrity sha512-l1KSLfupuwrXx6wc0AuOmC7Ko5g14ZOQ86wJJqRbdLbXLK02pK/DPiDDqCc7BqqiiA04/eAA6ayL0bgOrAkH7A== - dependencies: - "@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" From 06dcc905a5839fd7cfa101229755a30b0c97eda5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Mar 2022 12:22:39 +0000 Subject: [PATCH 522/785] Bump typescript from 4.5.5 to 4.6.2 Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.5.5 to 4.6.2. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v4.5.5...v4.6.2) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2213a4bb..720ce0b1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3343,9 +3343,9 @@ typedarray-to-buffer@^3.1.5: is-typedarray "^1.0.0" typescript@^4.5.2: - version "4.5.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3" - integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA== + version "4.6.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.2.tgz#fe12d2727b708f4eef40f51598b3398baa9611d4" + integrity sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg== universalify@^0.1.2: version "0.1.2" From 389215c21482cd2bb266f18eab0088f60f2aeca1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Mar 2022 12:01:49 +0000 Subject: [PATCH 523/785] Bump ts-node from 10.5.0 to 10.6.0 Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 10.5.0 to 10.6.0. - [Release notes](https://github.com/TypeStrong/ts-node/releases) - [Commits](https://github.com/TypeStrong/ts-node/compare/v10.5.0...v10.6.0) --- updated-dependencies: - dependency-name: ts-node dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index d97ea11a..800e0898 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3242,9 +3242,9 @@ ts-jest@^27.0.5: yargs-parser "20.x" ts-node@^10.2.1: - version "10.5.0" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.5.0.tgz#618bef5854c1fbbedf5e31465cbb224a1d524ef9" - integrity sha512-6kEJKwVxAJ35W4akuiysfKwKmjkbYxwQMTBaAxo9KKAx/Yd26mPUyhGz3ji+EsJoAgrLqVsYHNuuYwQe22lbtw== + version "10.6.0" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.6.0.tgz#c3f4195d5173ce3affdc8f2fd2e9a7ac8de5376a" + integrity sha512-CJen6+dfOXolxudBQXnVjRVvYTmTWbyz7cn+xq2XTsvnaXbHqr4gXSCNbS2Jj8yTZMuGwUoBESLaOkLascVVvg== dependencies: "@cspotcode/source-map-support" "0.7.0" "@tsconfig/node10" "^1.0.7" From 969bcf31996b7a4cf75ca32c9cfafbdbeade58ba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 12:01:31 +0000 Subject: [PATCH 524/785] Bump eslint-config-prettier from 8.4.0 to 8.5.0 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] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index d5a260d0..930f0740 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1500,9 +1500,9 @@ escodegen@^2.0.0: source-map "~0.6.1" eslint-config-prettier@^8.0.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== + 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-scope@^5.1.1: version "5.1.1" From d8d0ac70e10b828be9ea2bd1dae90d4ceeb0fe17 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Mar 2022 12:01:29 +0000 Subject: [PATCH 525/785] Bump ts-node from 10.6.0 to 10.7.0 Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 10.6.0 to 10.7.0. - [Release notes](https://github.com/TypeStrong/ts-node/releases) - [Commits](https://github.com/TypeStrong/ts-node/compare/v10.6.0...v10.7.0) --- updated-dependencies: - dependency-name: ts-node dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 930f0740..395000af 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3242,9 +3242,9 @@ ts-jest@^27.0.5: yargs-parser "20.x" ts-node@^10.2.1: - version "10.6.0" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.6.0.tgz#c3f4195d5173ce3affdc8f2fd2e9a7ac8de5376a" - integrity sha512-CJen6+dfOXolxudBQXnVjRVvYTmTWbyz7cn+xq2XTsvnaXbHqr4gXSCNbS2Jj8yTZMuGwUoBESLaOkLascVVvg== + version "10.7.0" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.7.0.tgz#35d503d0fab3e2baa672a0e94f4b40653c2463f5" + integrity sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A== dependencies: "@cspotcode/source-map-support" "0.7.0" "@tsconfig/node10" "^1.0.7" From 2aa394409923ea18482ed8bd8388b072806890f3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Mar 2022 12:01:34 +0000 Subject: [PATCH 526/785] Bump @typescript-eslint/eslint-plugin from 5.13.0 to 5.14.0 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.13.0 to 5.14.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.14.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 70 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 52 insertions(+), 18 deletions(-) diff --git a/yarn.lock b/yarn.lock index 395000af..c95a057a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -882,13 +882,13 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.4.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== + version "5.14.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.14.0.tgz#5119b67152356231a0e24b998035288a9cd21335" + integrity sha512-ir0wYI4FfFUDfLcuwKzIH7sMVA+db7WYen47iRSaCGl+HMAZI9fpBwfDo45ZALD3A45ZGyHWDNLhbg8tZrMX4w== dependencies: - "@typescript-eslint/scope-manager" "5.13.0" - "@typescript-eslint/type-utils" "5.13.0" - "@typescript-eslint/utils" "5.13.0" + "@typescript-eslint/scope-manager" "5.14.0" + "@typescript-eslint/type-utils" "5.14.0" + "@typescript-eslint/utils" "5.14.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -914,12 +914,20 @@ "@typescript-eslint/types" "5.13.0" "@typescript-eslint/visitor-keys" "5.13.0" -"@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== +"@typescript-eslint/scope-manager@5.14.0": + version "5.14.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.14.0.tgz#ea518962b42db8ed0a55152ea959c218cb53ca7b" + integrity sha512-LazdcMlGnv+xUc5R4qIlqH0OWARyl2kaP8pVCS39qSL3Pd1F7mI10DbdXeARcE62sVQE4fHNvEqMWsypWO+yEw== + dependencies: + "@typescript-eslint/types" "5.14.0" + "@typescript-eslint/visitor-keys" "5.14.0" + +"@typescript-eslint/type-utils@5.14.0": + version "5.14.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.14.0.tgz#711f08105860b12988454e91df433567205a8f0b" + integrity sha512-d4PTJxsqaUpv8iERTDSQBKUCV7Q5yyXjqXUl3XF7Sd9ogNLuKLkxz82qxokqQ4jXdTPZudWpmNtr/JjbbvUixw== dependencies: - "@typescript-eslint/utils" "5.13.0" + "@typescript-eslint/utils" "5.14.0" debug "^4.3.2" tsutils "^3.21.0" @@ -928,6 +936,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.13.0.tgz#da1de4ae905b1b9ff682cab0bed6b2e3be9c04e5" integrity sha512-LmE/KO6DUy0nFY/OoQU0XelnmDt+V8lPQhh8MOVa7Y5k2gGRd6U9Kp3wAjhB4OHg57tUO0nOnwYQhRRyEAyOyg== +"@typescript-eslint/types@5.14.0": + version "5.14.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.14.0.tgz#96317cf116cea4befabc0defef371a1013f8ab11" + integrity sha512-BR6Y9eE9360LNnW3eEUqAg6HxS9Q35kSIs4rp4vNHRdfg0s+/PgHgskvu5DFTM7G5VKAVjuyaN476LCPrdA7Mw== + "@typescript-eslint/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" @@ -941,15 +954,28 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/utils@5.13.0": - version "5.13.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.13.0.tgz#2328feca700eb02837298339a2e49c46b41bd0af" - integrity sha512-+9oHlPWYNl6AwwoEt5TQryEHwiKRVjz7Vk6kaBeD3/kwHE5YqTGHtm/JZY8Bo9ITOeKutFaXnBlMgSATMJALUQ== +"@typescript-eslint/typescript-estree@5.14.0": + version "5.14.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.14.0.tgz#78b7f7385d5b6f2748aacea5c9b7f6ae62058314" + integrity sha512-QGnxvROrCVtLQ1724GLTHBTR0lZVu13izOp9njRvMkCBgWX26PKvmMP8k82nmXBRD3DQcFFq2oj3cKDwr0FaUA== + dependencies: + "@typescript-eslint/types" "5.14.0" + "@typescript-eslint/visitor-keys" "5.14.0" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + +"@typescript-eslint/utils@5.14.0": + version "5.14.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.14.0.tgz#6c8bc4f384298cbbb32b3629ba7415f9f80dc8c4" + integrity sha512-EHwlII5mvUA0UsKYnVzySb/5EE/t03duUTweVy8Zqt3UQXBrpEVY144OTceFKaOe4xQXZJrkptCf7PjEBeGK4w== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.13.0" - "@typescript-eslint/types" "5.13.0" - "@typescript-eslint/typescript-estree" "5.13.0" + "@typescript-eslint/scope-manager" "5.14.0" + "@typescript-eslint/types" "5.14.0" + "@typescript-eslint/typescript-estree" "5.14.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -961,6 +987,14 @@ "@typescript-eslint/types" "5.13.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.14.0": + version "5.14.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.14.0.tgz#1927005b3434ccd0d3ae1b2ecf60e65943c36986" + integrity sha512-yL0XxfzR94UEkjBqyymMLgCBdojzEuy/eim7N9/RIcTNxpJudAcqsU8eRyfzBbcEzGoPWfdM3AGak3cN08WOIw== + dependencies: + "@typescript-eslint/types" "5.14.0" + eslint-visitor-keys "^3.0.0" + 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 144aabdd6ef9ead1a18dcd97543802ece82bc305 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Mar 2022 12:14:24 +0000 Subject: [PATCH 527/785] Bump @typescript-eslint/parser from 5.13.0 to 5.14.0 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.13.0 to 5.14.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.14.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 46 ++++++---------------------------------------- 1 file changed, 6 insertions(+), 40 deletions(-) diff --git a/yarn.lock b/yarn.lock index c95a057a..0bb1a2cd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -897,23 +897,15 @@ tsutils "^3.21.0" "@typescript-eslint/parser@^5.4.0": - version "5.13.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.13.0.tgz#0394ed8f2f849273c0bf4b811994d177112ced5c" - integrity sha512-GdrU4GvBE29tm2RqWOM0P5QfCtgCyN4hXICj/X9ibKED16136l9ZpoJvCL5pSKtmJzA+NRDzQ312wWMejCVVfg== + version "5.14.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.14.0.tgz#7c79f898aa3cff0ceee6f1d34eeed0f034fb9ef3" + integrity sha512-aHJN8/FuIy1Zvqk4U/gcO/fxeMKyoSv/rS46UXMXOJKVsLQ+iYPuXNbpbH7cBLcpSbmyyFbwrniLx5+kutu1pw== dependencies: - "@typescript-eslint/scope-manager" "5.13.0" - "@typescript-eslint/types" "5.13.0" - "@typescript-eslint/typescript-estree" "5.13.0" + "@typescript-eslint/scope-manager" "5.14.0" + "@typescript-eslint/types" "5.14.0" + "@typescript-eslint/typescript-estree" "5.14.0" debug "^4.3.2" -"@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.13.0" - "@typescript-eslint/visitor-keys" "5.13.0" - "@typescript-eslint/scope-manager@5.14.0": version "5.14.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.14.0.tgz#ea518962b42db8ed0a55152ea959c218cb53ca7b" @@ -931,29 +923,11 @@ debug "^4.3.2" tsutils "^3.21.0" -"@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/types@5.14.0": version "5.14.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.14.0.tgz#96317cf116cea4befabc0defef371a1013f8ab11" integrity sha512-BR6Y9eE9360LNnW3eEUqAg6HxS9Q35kSIs4rp4vNHRdfg0s+/PgHgskvu5DFTM7G5VKAVjuyaN476LCPrdA7Mw== -"@typescript-eslint/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/typescript-estree@5.14.0": version "5.14.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.14.0.tgz#78b7f7385d5b6f2748aacea5c9b7f6ae62058314" @@ -979,14 +953,6 @@ eslint-scope "^5.1.1" eslint-utils "^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" - "@typescript-eslint/visitor-keys@5.14.0": version "5.14.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.14.0.tgz#1927005b3434ccd0d3ae1b2ecf60e65943c36986" From 88f9dec69982fde55e5caf694502c36cdb33ecee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Mar 2022 12:01:32 +0000 Subject: [PATCH 528/785] Bump eslint from 8.10.0 to 8.11.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.10.0 to 8.11.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.10.0...v8.11.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/yarn.lock b/yarn.lock index 0bb1a2cd..a696ef60 100644 --- a/yarn.lock +++ b/yarn.lock @@ -492,16 +492,16 @@ dependencies: "@cspotcode/source-map-consumer" "0.8.0" -"@eslint/eslintrc@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.2.0.tgz#7ce1547a5c46dfe56e1e45c3c9ed18038c721c6a" - integrity sha512-igm9SjJHNEJRiUnecP/1R5T3wKLEJ7pL6e2P+GUSfCd0dGjPYYZve08uzw8L2J8foVHFz+NGu12JxRcU2gGo6w== +"@eslint/eslintrc@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.2.1.tgz#8b5e1c49f4077235516bc9ec7d41378c0f69b8c6" + integrity sha512-bxvbYnBPN1Gibwyp6NrpnFzA3YtRL3BBAyEAFVIpNTm2Rn4Vy87GA5M4aSn3InRrlsbX5N0GW7XIx+U4SAEKdQ== dependencies: ajv "^6.12.4" debug "^4.3.2" espree "^9.3.1" globals "^13.9.0" - ignore "^4.0.6" + ignore "^5.2.0" import-fresh "^3.2.1" js-yaml "^4.1.0" minimatch "^3.0.4" @@ -1538,11 +1538,11 @@ eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.3.0: integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.1.0: - version "8.10.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.10.0.tgz#931be395eb60f900c01658b278e05b6dae47199d" - integrity sha512-tcI1D9lfVec+R4LE1mNDnzoJ/f71Kl/9Cv4nG47jOueCMBrCCKYXr4AUVS7go6mWYGFD4+EoN6+eXSrEbRzXVw== + version "8.11.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.11.0.tgz#88b91cfba1356fc10bb9eb592958457dfe09fb37" + integrity sha512-/KRpd9mIRg2raGxHRGwW9ZywYNAClZrHjdueHcrVDuO3a6bj83eoTirCCk0M0yPwOjWYKHwRVRid+xK4F/GHgA== dependencies: - "@eslint/eslintrc" "^1.2.0" + "@eslint/eslintrc" "^1.2.1" "@humanwhocodes/config-array" "^0.9.2" ajv "^6.10.0" chalk "^4.0.0" @@ -1925,11 +1925,6 @@ iconv-lite@0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" -ignore@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" - integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== - ignore@^5.1.4, ignore@^5.1.8, ignore@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" From a753097825221fb814dacd58fe49874c18c5b796 Mon Sep 17 00:00:00 2001 From: Daniel Leavitt Date: Mon, 14 Mar 2022 12:27:10 -0700 Subject: [PATCH 529/785] don't force-indent operator assignment --- src/ruby/nodes/assign.ts | 39 ++++++++++++++++++------------- test/js/ruby/nodes/assign.test.ts | 34 +++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 16 deletions(-) diff --git a/src/ruby/nodes/assign.ts b/src/ruby/nodes/assign.ts index 4988da39..90cda112 100644 --- a/src/ruby/nodes/assign.ts +++ b/src/ruby/nodes/assign.ts @@ -1,10 +1,29 @@ import type { Plugin, Ruby } from "../../types"; import prettier from "../../prettier"; import { skipAssignIndent } from "../../utils"; +import { Doc, Path } from "../../types/plugin"; const { group, indent, join, line } = prettier; -export const printAssign: Plugin.Printer = (path, opts, print) => { +export const printAssign: Plugin.Printer = (...args) => { + return printOpAssignOrAssign("=", ...args); +}; + +export const printOpAssign: Plugin.Printer = ( + path, + opts, + print +) => { + const opDoc = path.call(print, "op"); + return printOpAssignOrAssign(opDoc, path, opts, print); +}; + +function printOpAssignOrAssign( + opDoc: Doc, + path: Path, + opts: Plugin.Options, + print: Plugin.Print +): Doc { const valueNode = path.getValue().value; const targetDoc = path.call(print, "target"); @@ -21,23 +40,11 @@ export const printAssign: Plugin.Printer = (path, opts, print) => { } if (skipAssignIndent(valueNode)) { - return group([targetDoc, " = ", rightSideDoc]); + return group([targetDoc, " ", opDoc, " ", rightSideDoc]); } - return group([targetDoc, " =", indent([line, rightSideDoc])]); -}; - -export const printOpAssign: Plugin.Printer = ( - path, - opts, - print -) => - group([ - path.call(print, "target"), - " ", - path.call(print, "op"), - indent([line, path.call(print, "value")]) - ]); + return group([targetDoc, " ", opDoc, indent([line, rightSideDoc])]); +} export const printVarField: Plugin.Printer = ( path, diff --git a/test/js/ruby/nodes/assign.test.ts b/test/js/ruby/nodes/assign.test.ts index 9dddd72a..a15d0971 100644 --- a/test/js/ruby/nodes/assign.test.ts +++ b/test/js/ruby/nodes/assign.test.ts @@ -84,6 +84,40 @@ describe("assign", () => { `) ); }); + + describe("assignment operators", () => { + // some but not all + const operators = ["||", "&&", "+", "*", "%", "**", "<<"]; + + test.each(operators)("array %s= [...] is not force-indented", (op) => { + expect(`a ${op}= [${long}, ${long}, ${long}]`).toChangeFormat( + ruby(` + a ${op}= [ + ${long}, + ${long}, + ${long} + ] + `) + ); + }); + + test.each(operators)("hash %s= { ... } is not force-indented", (op) => { + expect( + `a ${op}= { a: ${long}, b: ${long}, c: ${long} }` + ).toChangeFormat( + ruby(` + a ${op}= { + a: + ${long}, + b: + ${long}, + c: + ${long} + } + `) + ); + }); + }); }); describe("constants", () => { From 10563bb0d08df5b2a90a3c4df4a4e0c38fe1d379 Mon Sep 17 00:00:00 2001 From: Daniel Leavitt Date: Sun, 13 Mar 2022 22:24:43 -0700 Subject: [PATCH 530/785] Indent word literals same as collection literals Percent literals for collections (%w, %W, %i, %I) get the same "skipAssignIndent" behavior that array/hash literals do. --- src/utils/skipAssignIndent.ts | 6 +++++- test/js/ruby/nodes/assign.test.ts | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/utils/skipAssignIndent.ts b/src/utils/skipAssignIndent.ts index e7cd2fa9..c0420d58 100644 --- a/src/utils/skipAssignIndent.ts +++ b/src/utils/skipAssignIndent.ts @@ -6,7 +6,11 @@ const skippable = [ "hash", "heredoc", "lambda", - "regexp_literal" + "qsymbols", + "qwords", + "regexp_literal", + "symbols", + "words" ]; function skipAssignIndent(node: Ruby.AnyNode): boolean { diff --git a/test/js/ruby/nodes/assign.test.ts b/test/js/ruby/nodes/assign.test.ts index a15d0971..195b7f95 100644 --- a/test/js/ruby/nodes/assign.test.ts +++ b/test/js/ruby/nodes/assign.test.ts @@ -64,6 +64,21 @@ describe("assign", () => { ); }); + describe("assignments from quotewords and similar", () => { + const cases = ["w", "W", "i", "I"]; + + test.each(cases)("x = %s[...] is not force-indented", (literal) => { + expect(`a = %${literal}[${long} ${long}]`).toChangeFormat( + ruby(` + a = %${literal}[ + ${long} + ${long} + ] + `) + ); + }); + }); + test("chained methods on array literals don't get oddly indented", () => { expect(`a = [${long}].freeze`).toChangeFormat( ruby(` From 7d631da8a252cd50e7806c769a4f12cca4b9a830 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Mar 2022 12:01:29 +0000 Subject: [PATCH 531/785] Bump @typescript-eslint/parser from 5.14.0 to 5.15.0 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.14.0 to 5.15.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.15.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index a696ef60..4ef696a8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -897,13 +897,13 @@ tsutils "^3.21.0" "@typescript-eslint/parser@^5.4.0": - version "5.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.14.0.tgz#7c79f898aa3cff0ceee6f1d34eeed0f034fb9ef3" - integrity sha512-aHJN8/FuIy1Zvqk4U/gcO/fxeMKyoSv/rS46UXMXOJKVsLQ+iYPuXNbpbH7cBLcpSbmyyFbwrniLx5+kutu1pw== + version "5.15.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.15.0.tgz#95f603f8fe6eca7952a99bfeef9b85992972e728" + integrity sha512-NGAYP/+RDM2sVfmKiKOCgJYPstAO40vPAgACoWPO/+yoYKSgAXIFaBKsV8P0Cc7fwKgvj27SjRNX4L7f4/jCKQ== dependencies: - "@typescript-eslint/scope-manager" "5.14.0" - "@typescript-eslint/types" "5.14.0" - "@typescript-eslint/typescript-estree" "5.14.0" + "@typescript-eslint/scope-manager" "5.15.0" + "@typescript-eslint/types" "5.15.0" + "@typescript-eslint/typescript-estree" "5.15.0" debug "^4.3.2" "@typescript-eslint/scope-manager@5.14.0": @@ -914,6 +914,14 @@ "@typescript-eslint/types" "5.14.0" "@typescript-eslint/visitor-keys" "5.14.0" +"@typescript-eslint/scope-manager@5.15.0": + version "5.15.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.15.0.tgz#d97afab5e0abf4018d1289bd711be21676cdd0ee" + integrity sha512-EFiZcSKrHh4kWk0pZaa+YNJosvKE50EnmN4IfgjkA3bTHElPtYcd2U37QQkNTqwMCS7LXeDeZzEqnsOH8chjSg== + dependencies: + "@typescript-eslint/types" "5.15.0" + "@typescript-eslint/visitor-keys" "5.15.0" + "@typescript-eslint/type-utils@5.14.0": version "5.14.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.14.0.tgz#711f08105860b12988454e91df433567205a8f0b" @@ -928,6 +936,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.14.0.tgz#96317cf116cea4befabc0defef371a1013f8ab11" integrity sha512-BR6Y9eE9360LNnW3eEUqAg6HxS9Q35kSIs4rp4vNHRdfg0s+/PgHgskvu5DFTM7G5VKAVjuyaN476LCPrdA7Mw== +"@typescript-eslint/types@5.15.0": + version "5.15.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.15.0.tgz#c7bdd103843b1abae97b5518219d3e2a0d79a501" + integrity sha512-yEiTN4MDy23vvsIksrShjNwQl2vl6kJeG9YkVJXjXZnkJElzVK8nfPsWKYxcsGWG8GhurYXP4/KGj3aZAxbeOA== + "@typescript-eslint/typescript-estree@5.14.0": version "5.14.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.14.0.tgz#78b7f7385d5b6f2748aacea5c9b7f6ae62058314" @@ -941,6 +954,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.15.0": + version "5.15.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.15.0.tgz#81513a742a9c657587ad1ddbca88e76c6efb0aac" + integrity sha512-Hb0e3dGc35b75xLzixM3cSbG1sSbrTBQDfIScqdyvrfJZVEi4XWAT+UL/HMxEdrJNB8Yk28SKxPLtAhfCbBInA== + dependencies: + "@typescript-eslint/types" "5.15.0" + "@typescript-eslint/visitor-keys" "5.15.0" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/utils@5.14.0": version "5.14.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.14.0.tgz#6c8bc4f384298cbbb32b3629ba7415f9f80dc8c4" @@ -961,6 +987,14 @@ "@typescript-eslint/types" "5.14.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.15.0": + version "5.15.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.15.0.tgz#5669739fbf516df060f978be6a6dce75855a8027" + integrity sha512-+vX5FKtgvyHbmIJdxMJ2jKm9z2BIlXJiuewI8dsDYMp5LzPUcuTT78Ya5iwvQg3VqSVdmxyM8Anj1Jeq7733ZQ== + dependencies: + "@typescript-eslint/types" "5.15.0" + eslint-visitor-keys "^3.0.0" + abab@^2.0.3, abab@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.5.tgz#c0b678fb32d60fc1219c784d6a826fe385aeb79a" From ae1f84ec32edf7509cb956cd1b94ea33cbd5e1b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Mar 2022 12:10:13 +0000 Subject: [PATCH 532/785] Bump @typescript-eslint/eslint-plugin from 5.14.0 to 5.15.0 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.14.0 to 5.15.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.15.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 70 ++++++++++++++----------------------------------------- 1 file changed, 18 insertions(+), 52 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4ef696a8..a3166971 100644 --- a/yarn.lock +++ b/yarn.lock @@ -882,13 +882,13 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.4.0": - version "5.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.14.0.tgz#5119b67152356231a0e24b998035288a9cd21335" - integrity sha512-ir0wYI4FfFUDfLcuwKzIH7sMVA+db7WYen47iRSaCGl+HMAZI9fpBwfDo45ZALD3A45ZGyHWDNLhbg8tZrMX4w== + version "5.15.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.15.0.tgz#c28ef7f2e688066db0b6a9d95fb74185c114fb9a" + integrity sha512-u6Db5JfF0Esn3tiAKELvoU5TpXVSkOpZ78cEGn/wXtT2RVqs2vkt4ge6N8cRCyw7YVKhmmLDbwI2pg92mlv7cA== dependencies: - "@typescript-eslint/scope-manager" "5.14.0" - "@typescript-eslint/type-utils" "5.14.0" - "@typescript-eslint/utils" "5.14.0" + "@typescript-eslint/scope-manager" "5.15.0" + "@typescript-eslint/type-utils" "5.15.0" + "@typescript-eslint/utils" "5.15.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -906,14 +906,6 @@ "@typescript-eslint/typescript-estree" "5.15.0" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.14.0": - version "5.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.14.0.tgz#ea518962b42db8ed0a55152ea959c218cb53ca7b" - integrity sha512-LazdcMlGnv+xUc5R4qIlqH0OWARyl2kaP8pVCS39qSL3Pd1F7mI10DbdXeARcE62sVQE4fHNvEqMWsypWO+yEw== - dependencies: - "@typescript-eslint/types" "5.14.0" - "@typescript-eslint/visitor-keys" "5.14.0" - "@typescript-eslint/scope-manager@5.15.0": version "5.15.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.15.0.tgz#d97afab5e0abf4018d1289bd711be21676cdd0ee" @@ -922,38 +914,20 @@ "@typescript-eslint/types" "5.15.0" "@typescript-eslint/visitor-keys" "5.15.0" -"@typescript-eslint/type-utils@5.14.0": - version "5.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.14.0.tgz#711f08105860b12988454e91df433567205a8f0b" - integrity sha512-d4PTJxsqaUpv8iERTDSQBKUCV7Q5yyXjqXUl3XF7Sd9ogNLuKLkxz82qxokqQ4jXdTPZudWpmNtr/JjbbvUixw== +"@typescript-eslint/type-utils@5.15.0": + version "5.15.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.15.0.tgz#d2c02eb2bdf54d0a645ba3a173ceda78346cf248" + integrity sha512-KGeDoEQ7gHieLydujGEFLyLofipe9PIzfvA/41urz4hv+xVxPEbmMQonKSynZ0Ks2xDhJQ4VYjB3DnRiywvKDA== dependencies: - "@typescript-eslint/utils" "5.14.0" + "@typescript-eslint/utils" "5.15.0" debug "^4.3.2" tsutils "^3.21.0" -"@typescript-eslint/types@5.14.0": - version "5.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.14.0.tgz#96317cf116cea4befabc0defef371a1013f8ab11" - integrity sha512-BR6Y9eE9360LNnW3eEUqAg6HxS9Q35kSIs4rp4vNHRdfg0s+/PgHgskvu5DFTM7G5VKAVjuyaN476LCPrdA7Mw== - "@typescript-eslint/types@5.15.0": version "5.15.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.15.0.tgz#c7bdd103843b1abae97b5518219d3e2a0d79a501" integrity sha512-yEiTN4MDy23vvsIksrShjNwQl2vl6kJeG9YkVJXjXZnkJElzVK8nfPsWKYxcsGWG8GhurYXP4/KGj3aZAxbeOA== -"@typescript-eslint/typescript-estree@5.14.0": - version "5.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.14.0.tgz#78b7f7385d5b6f2748aacea5c9b7f6ae62058314" - integrity sha512-QGnxvROrCVtLQ1724GLTHBTR0lZVu13izOp9njRvMkCBgWX26PKvmMP8k82nmXBRD3DQcFFq2oj3cKDwr0FaUA== - dependencies: - "@typescript-eslint/types" "5.14.0" - "@typescript-eslint/visitor-keys" "5.14.0" - debug "^4.3.2" - globby "^11.0.4" - is-glob "^4.0.3" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.15.0": version "5.15.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.15.0.tgz#81513a742a9c657587ad1ddbca88e76c6efb0aac" @@ -967,26 +941,18 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/utils@5.14.0": - version "5.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.14.0.tgz#6c8bc4f384298cbbb32b3629ba7415f9f80dc8c4" - integrity sha512-EHwlII5mvUA0UsKYnVzySb/5EE/t03duUTweVy8Zqt3UQXBrpEVY144OTceFKaOe4xQXZJrkptCf7PjEBeGK4w== +"@typescript-eslint/utils@5.15.0": + version "5.15.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.15.0.tgz#468510a0974d3ced8342f37e6c662778c277f136" + integrity sha512-081rWu2IPKOgTOhHUk/QfxuFog8m4wxW43sXNOMSCdh578tGJ1PAaWPsj42LOa7pguh173tNlMigsbrHvh/mtA== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.14.0" - "@typescript-eslint/types" "5.14.0" - "@typescript-eslint/typescript-estree" "5.14.0" + "@typescript-eslint/scope-manager" "5.15.0" + "@typescript-eslint/types" "5.15.0" + "@typescript-eslint/typescript-estree" "5.15.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.14.0": - version "5.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.14.0.tgz#1927005b3434ccd0d3ae1b2ecf60e65943c36986" - integrity sha512-yL0XxfzR94UEkjBqyymMLgCBdojzEuy/eim7N9/RIcTNxpJudAcqsU8eRyfzBbcEzGoPWfdM3AGak3cN08WOIw== - dependencies: - "@typescript-eslint/types" "5.14.0" - eslint-visitor-keys "^3.0.0" - "@typescript-eslint/visitor-keys@5.15.0": version "5.15.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.15.0.tgz#5669739fbf516df060f978be6a6dce75855a8027" From 819d7558d0d994a25c921bfe849b60000bd4401c Mon Sep 17 00:00:00 2001 From: Daniel Leavitt Date: Tue, 15 Mar 2022 20:39:23 -0700 Subject: [PATCH 533/785] support for rbs version 2 --- .github/workflows/main.yml | 1 + src/rbs/parser.rb | 41 ++++++++++++++++++++++ src/rbs/printer.ts | 36 +++++++++---------- src/types/rbs.ts | 6 ++-- test/rb/rbs_test.rb | 71 ++++++++++++++++++++++++++++++++++++++ test/rb/test_helper.rb | 1 + 6 files changed, 134 insertions(+), 22 deletions(-) create mode 100644 test/rb/rbs_test.rb diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f9fb05b4..c7d76b3a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,6 +16,7 @@ jobs: - "2.6" - "2.7" - "3.0" + - "3.1" runs-on: ${{ matrix.platform }} env: PLUGIN_RUBY_CI: true diff --git a/src/rbs/parser.rb b/src/rbs/parser.rb index 39e15075..34d3b59b 100644 --- a/src/rbs/parser.rb +++ b/src/rbs/parser.rb @@ -98,6 +98,47 @@ def to_json(*a) end end +if defined?(RBS::AST::Declarations::ModuleTypeParams) + # This class was removed in rbs 2.0. Monkeypatch < 2.0 to give the same json + # output + class RBS::AST::Declarations::ModuleTypeParams + def to_json(*a) + params.to_json(*a) + end + end + + # make this look like the new AST::TypeParam json + class RBS::AST::Declarations::ModuleTypeParams::TypeParam + def to_json(*a) + { name: name, variance: variance, unchecked: skip_validation }.to_json(*a) + end + end + + # https://github.com/ruby/rbs/commit/3ccdcb1f3ac5dcb866280f745866a852658195e6 + class RBS::MethodType + # promote the array of symbols into TypeParam looking-things + def to_json(*a) + type_param_objects = + type_params.map do |name| + { + name: name, + variance: 'invariant', + unchecked: 'false', + upper_bound: nil + # location - harder to get this but not needed + } + end + + { + type_params: type_param_objects, + type: type, + block: block, + location: location + }.to_json(*a) + end + end +end + # The main parser interface. module Prettier class RBSParser diff --git a/src/rbs/printer.ts b/src/rbs/printer.ts index 09448263..842fd8ae 100644 --- a/src/rbs/printer.ts +++ b/src/rbs/printer.ts @@ -447,30 +447,26 @@ const printer: Plugin.PrinterConfig = { path: Plugin.Path, node: RBS.NameAndTypeParams ) { - if (node.type_params.params.length === 0) { + if (node.type_params.length === 0) { return node.name; } - const docs = path.map( - (paramPath) => { - const node = paramPath.getValue(); - const parts = []; + const docs = path.map((paramPath) => { + const node = paramPath.getValue(); + const parts = []; - if (node.skip_validation) { - parts.push("unchecked"); - } + if (node.unchecked) { + parts.push("unchecked"); + } - if (node.variance === "covariant") { - parts.push("out"); - } else if (node.variance === "contravariant") { - parts.push("in"); - } + if (node.variance === "covariant") { + parts.push("out"); + } else if (node.variance === "contravariant") { + parts.push("in"); + } - return join(" ", [...parts, node.name]); - }, - "type_params", - "params" - ); + return join(" ", [...parts, node.name]); + }, "type_params"); return [node.name, "[", join(", ", docs), "]"]; } @@ -568,7 +564,9 @@ const printer: Plugin.PrinterConfig = { // We won't have a type_params key if we're printing a block if (node.type_params && node.type_params.length > 0) { - parts.push("[", join(", ", node.type_params), "] "); + const typeParamNames = node.type_params.map((tp) => tp.name); + + parts.push("[", join(", ", typeParamNames), "] "); } const params = path.call(printMethodParams, "type"); diff --git a/src/types/rbs.ts b/src/types/rbs.ts index 58aa5e0a..d1a417cf 100644 --- a/src/types/rbs.ts +++ b/src/types/rbs.ts @@ -18,7 +18,7 @@ export type MethodParams = { }; export type MethodSignature = { - type_params: string[], + type_params: Param[], type: MethodParams & { return_type: Type }, block: { required: boolean } & MethodSignature }; @@ -74,13 +74,13 @@ export type MethodDefinition = Member & { member: "method_definition" }; export type Param = { name: string, - skip_validation: boolean, + unchecked: boolean, variance: "invariant" | "covariant" | "contravariant" }; export type NameAndTypeParams = { name: string, - type_params: { params: Param[] } + type_params: Param[] }; export type Class = { declaration: "class", super_class?: NameAndArgs, members: Member[] } & NameAndTypeParams; diff --git a/test/rb/rbs_test.rb b/test/rb/rbs_test.rb new file mode 100644 index 00000000..1e424748 --- /dev/null +++ b/test/rb/rbs_test.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +require 'test_helper' + +class RBSTest < Minitest::Test + # https://github.com/ruby/rbs/commit/c5da467adacc75fe9294ec1630f1b7931d9d6871 + def test_module_type_params_empty + actual = declaration_json("interface _Foo\nend")['type_params'] + assert_instance_of Array, actual + assert_empty actual + end + + def test_module_type_params_fancy + source = <<~SOURCE + class Foo[unchecked in A, B] + end + SOURCE + + actual = declaration_json(source)['type_params'] + assert_instance_of Array, actual + assert_equal 2, actual.length + + type_a, type_b = actual + + assert_equal 'A', type_a['name'] + assert_equal 'contravariant', type_a['variance'] + assert_equal true, type_a['unchecked'] + + assert_equal 'B', type_b['name'] + assert_equal 'invariant', type_b['variance'] + assert_equal false, type_b['unchecked'] + end + + # https://github.com/ruby/rbs/commit/3ccdcb1f3ac5dcb866280f745866a852658195e6 + def test_generic_method + source = <<~SOURCE + class T + def t: [A, B] (A) -> B + end + SOURCE + + actual = member_json(source)['types'].first['type_params'] + assert_equal 2, actual.length + + type_a, type_b = actual + assert_equal 'A', type_a['name'] + assert_equal 'B', type_b['name'] + end + + private + + def declaration_json(source) + JSON.parse(first_declaration(source).to_json) + end + + def member_json(source) + JSON.parse(first_member(source).to_json) + end + + def parse(source) + Prettier::RBSParser.parse(source) + end + + def first_declaration(source) + parse(source)[:declarations].first + end + + def first_member(source) + first_declaration(source).members.first + end +end diff --git a/test/rb/test_helper.rb b/test/rb/test_helper.rb index 4d77642c..b2047e0b 100644 --- a/test/rb/test_helper.rb +++ b/test/rb/test_helper.rb @@ -4,5 +4,6 @@ require 'prettier' require_relative '../../src/ruby/parser' +require_relative '../../src/rbs/parser' require 'minitest/autorun' From 32532e88d78e0752d4781337cd2f32c330e05ee0 Mon Sep 17 00:00:00 2001 From: Daniel Leavitt Date: Tue, 15 Mar 2022 22:20:43 -0700 Subject: [PATCH 534/785] support rbs bounded type arguments --- src/rbs/printer.ts | 10 +++++++++- src/types/rbs.ts | 1 + test/js/rbs/rbs.test.ts | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/src/rbs/printer.ts b/src/rbs/printer.ts index 842fd8ae..50a86664 100644 --- a/src/rbs/printer.ts +++ b/src/rbs/printer.ts @@ -465,7 +465,15 @@ const printer: Plugin.PrinterConfig = { parts.push("in"); } - return join(" ", [...parts, node.name]); + if (node.upper_bound) { + const path = paramPath as Plugin.Path< + RequiredKeys + >; + const upperBound = path.call(printType, "upper_bound"); + return join(" ", [...parts, node.name, "<", upperBound]); + } else { + return join(" ", [...parts, node.name]); + } }, "type_params"); return [node.name, "[", join(", ", docs), "]"]; diff --git a/src/types/rbs.ts b/src/types/rbs.ts index d1a417cf..02056482 100644 --- a/src/types/rbs.ts +++ b/src/types/rbs.ts @@ -76,6 +76,7 @@ export type Param = { name: string, unchecked: boolean, variance: "invariant" | "covariant" | "contravariant" + upper_bound?: Type, }; export type NameAndTypeParams = { diff --git a/test/js/rbs/rbs.test.ts b/test/js/rbs/rbs.test.ts index 7e7f4fc4..58724145 100644 --- a/test/js/rbs/rbs.test.ts +++ b/test/js/rbs/rbs.test.ts @@ -47,6 +47,26 @@ describe("rbs", () => { expect(content).toMatchFormat(); }); + if (atLeastVersion("3.1")) { + test("interface with bounded type param", () => { + const content = rbs(` + interface _Foo[A < B] + end + `); + + expect(content).toMatchFormat(); + }); + + test("interface with fancy bounded type params", () => { + const content = rbs(` + interface _Foo[U < singleton(::Hash), V < W[X, Y]] + end + `); + + expect(content).toMatchFormat(); + }); + } + test("class", () => { const content = rbs(` class Foo @@ -74,6 +94,26 @@ describe("rbs", () => { expect(content).toMatchFormat(); }); + if (atLeastVersion("3.1")) { + test("class with bounded type param", () => { + const content = rbs(` + class Foo[A < B] + end + `); + + expect(content).toMatchFormat(); + }); + + test("class with fancy bounded type params", () => { + const content = rbs(` + class Foo[U < singleton(::Hash), V < W[X, Y]] + end + `); + + expect(content).toMatchFormat(); + }); + } + test("class with annotations", () => { const content = rbs(` %a{This is an annotation.} From edd094a3ff94f3b3a6ee4a84c599b3c17d8497c5 Mon Sep 17 00:00:00 2001 From: Daniel Leavitt Date: Fri, 18 Mar 2022 11:17:22 -0700 Subject: [PATCH 535/785] icky cast of rbs upper bound fixes a type error; guessing there's a better way to accomplish this --- src/rbs/printer.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/rbs/printer.ts b/src/rbs/printer.ts index 50a86664..59abacbc 100644 --- a/src/rbs/printer.ts +++ b/src/rbs/printer.ts @@ -466,9 +466,7 @@ const printer: Plugin.PrinterConfig = { } if (node.upper_bound) { - const path = paramPath as Plugin.Path< - RequiredKeys - >; + const path = paramPath as Plugin.Path<{ upper_bound: RBS.Type }>; const upperBound = path.call(printType, "upper_bound"); return join(" ", [...parts, node.name, "<", upperBound]); } else { From da7b93e65812bcb0ac6c18eeb05210a2c9eb3996 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Mar 2022 12:01:48 +0000 Subject: [PATCH 536/785] Bump @types/node from 17.0.21 to 17.0.22 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.21 to 17.0.22. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index a3166971..2e515cf9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -855,9 +855,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^17.0.0": - version "17.0.21" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.21.tgz#864b987c0c68d07b4345845c3e63b75edd143644" - integrity sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ== + version "17.0.22" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.22.tgz#38b6c4b9b2f3ed9f2e376cce42a298fb2375251e" + integrity sha512-8FwbVoG4fy+ykY86XCAclKZDORttqE5/s7dyWZKLXTdv3vRy5HozBEinG5IqhvPXXzIZEcTVbuHlQEI6iuwcmw== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.4" From c52492394f479c608707d62d212dc44146094344 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Mar 2022 12:02:05 +0000 Subject: [PATCH 537/785] Bump @typescript-eslint/eslint-plugin from 5.15.0 to 5.16.0 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.15.0 to 5.16.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.16.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 70 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 52 insertions(+), 18 deletions(-) diff --git a/yarn.lock b/yarn.lock index a3166971..89b2ea70 100644 --- a/yarn.lock +++ b/yarn.lock @@ -882,13 +882,13 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.4.0": - version "5.15.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.15.0.tgz#c28ef7f2e688066db0b6a9d95fb74185c114fb9a" - integrity sha512-u6Db5JfF0Esn3tiAKELvoU5TpXVSkOpZ78cEGn/wXtT2RVqs2vkt4ge6N8cRCyw7YVKhmmLDbwI2pg92mlv7cA== + version "5.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.16.0.tgz#78f246dd8d1b528fc5bfca99a8a64d4023a3d86d" + integrity sha512-SJoba1edXvQRMmNI505Uo4XmGbxCK9ARQpkvOd00anxzri9RNQk0DDCxD+LIl+jYhkzOJiOMMKYEHnHEODjdCw== dependencies: - "@typescript-eslint/scope-manager" "5.15.0" - "@typescript-eslint/type-utils" "5.15.0" - "@typescript-eslint/utils" "5.15.0" + "@typescript-eslint/scope-manager" "5.16.0" + "@typescript-eslint/type-utils" "5.16.0" + "@typescript-eslint/utils" "5.16.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -914,12 +914,20 @@ "@typescript-eslint/types" "5.15.0" "@typescript-eslint/visitor-keys" "5.15.0" -"@typescript-eslint/type-utils@5.15.0": - version "5.15.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.15.0.tgz#d2c02eb2bdf54d0a645ba3a173ceda78346cf248" - integrity sha512-KGeDoEQ7gHieLydujGEFLyLofipe9PIzfvA/41urz4hv+xVxPEbmMQonKSynZ0Ks2xDhJQ4VYjB3DnRiywvKDA== +"@typescript-eslint/scope-manager@5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.16.0.tgz#7e7909d64bd0c4d8aef629cdc764b9d3e1d3a69a" + integrity sha512-P+Yab2Hovg8NekLIR/mOElCDPyGgFZKhGoZA901Yax6WR6HVeGLbsqJkZ+Cvk5nts/dAlFKm8PfL43UZnWdpIQ== + dependencies: + "@typescript-eslint/types" "5.16.0" + "@typescript-eslint/visitor-keys" "5.16.0" + +"@typescript-eslint/type-utils@5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.16.0.tgz#b482bdde1d7d7c0c7080f7f2f67ea9580b9e0692" + integrity sha512-SKygICv54CCRl1Vq5ewwQUJV/8padIWvPgCxlWPGO/OgQLCijY9G7lDu6H+mqfQtbzDNlVjzVWQmeqbLMBLEwQ== dependencies: - "@typescript-eslint/utils" "5.15.0" + "@typescript-eslint/utils" "5.16.0" debug "^4.3.2" tsutils "^3.21.0" @@ -928,6 +936,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.15.0.tgz#c7bdd103843b1abae97b5518219d3e2a0d79a501" integrity sha512-yEiTN4MDy23vvsIksrShjNwQl2vl6kJeG9YkVJXjXZnkJElzVK8nfPsWKYxcsGWG8GhurYXP4/KGj3aZAxbeOA== +"@typescript-eslint/types@5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.16.0.tgz#5827b011982950ed350f075eaecb7f47d3c643ee" + integrity sha512-oUorOwLj/3/3p/HFwrp6m/J2VfbLC8gjW5X3awpQJ/bSG+YRGFS4dpsvtQ8T2VNveV+LflQHjlLvB6v0R87z4g== + "@typescript-eslint/typescript-estree@5.15.0": version "5.15.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.15.0.tgz#81513a742a9c657587ad1ddbca88e76c6efb0aac" @@ -941,15 +954,28 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/utils@5.15.0": - version "5.15.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.15.0.tgz#468510a0974d3ced8342f37e6c662778c277f136" - integrity sha512-081rWu2IPKOgTOhHUk/QfxuFog8m4wxW43sXNOMSCdh578tGJ1PAaWPsj42LOa7pguh173tNlMigsbrHvh/mtA== +"@typescript-eslint/typescript-estree@5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.16.0.tgz#32259459ec62f5feddca66adc695342f30101f61" + integrity sha512-SE4VfbLWUZl9MR+ngLSARptUv2E8brY0luCdgmUevU6arZRY/KxYoLI/3V/yxaURR8tLRN7bmZtJdgmzLHI6pQ== + dependencies: + "@typescript-eslint/types" "5.16.0" + "@typescript-eslint/visitor-keys" "5.16.0" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + +"@typescript-eslint/utils@5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.16.0.tgz#42218b459d6d66418a4eb199a382bdc261650679" + integrity sha512-iYej2ER6AwmejLWMWzJIHy3nPJeGDuCqf8Jnb+jAQVoPpmWzwQOfa9hWVB8GIQE5gsCv/rfN4T+AYb/V06WseQ== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.15.0" - "@typescript-eslint/types" "5.15.0" - "@typescript-eslint/typescript-estree" "5.15.0" + "@typescript-eslint/scope-manager" "5.16.0" + "@typescript-eslint/types" "5.16.0" + "@typescript-eslint/typescript-estree" "5.16.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -961,6 +987,14 @@ "@typescript-eslint/types" "5.15.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.16.0.tgz#f27dc3b943e6317264c7492e390c6844cd4efbbb" + integrity sha512-jqxO8msp5vZDhikTwq9ubyMHqZ67UIvawohr4qF3KhlpL7gzSjOd+8471H3nh5LyABkaI85laEKKU8SnGUK5/g== + dependencies: + "@typescript-eslint/types" "5.16.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 8563496f4d5629649ecf4737c9b68ed88efedea5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Mar 2022 12:21:18 +0000 Subject: [PATCH 538/785] Bump @typescript-eslint/parser from 5.15.0 to 5.16.0 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.15.0 to 5.16.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.16.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 46 ++++++---------------------------------------- 1 file changed, 6 insertions(+), 40 deletions(-) diff --git a/yarn.lock b/yarn.lock index 0bc3917d..771130e3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -897,23 +897,15 @@ tsutils "^3.21.0" "@typescript-eslint/parser@^5.4.0": - version "5.15.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.15.0.tgz#95f603f8fe6eca7952a99bfeef9b85992972e728" - integrity sha512-NGAYP/+RDM2sVfmKiKOCgJYPstAO40vPAgACoWPO/+yoYKSgAXIFaBKsV8P0Cc7fwKgvj27SjRNX4L7f4/jCKQ== + version "5.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.16.0.tgz#e4de1bde4b4dad5b6124d3da227347616ed55508" + integrity sha512-fkDq86F0zl8FicnJtdXakFs4lnuebH6ZADDw6CYQv0UZeIjHvmEw87m9/29nk2Dv5Lmdp0zQ3zDQhiMWQf/GbA== dependencies: - "@typescript-eslint/scope-manager" "5.15.0" - "@typescript-eslint/types" "5.15.0" - "@typescript-eslint/typescript-estree" "5.15.0" + "@typescript-eslint/scope-manager" "5.16.0" + "@typescript-eslint/types" "5.16.0" + "@typescript-eslint/typescript-estree" "5.16.0" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.15.0": - version "5.15.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.15.0.tgz#d97afab5e0abf4018d1289bd711be21676cdd0ee" - integrity sha512-EFiZcSKrHh4kWk0pZaa+YNJosvKE50EnmN4IfgjkA3bTHElPtYcd2U37QQkNTqwMCS7LXeDeZzEqnsOH8chjSg== - dependencies: - "@typescript-eslint/types" "5.15.0" - "@typescript-eslint/visitor-keys" "5.15.0" - "@typescript-eslint/scope-manager@5.16.0": version "5.16.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.16.0.tgz#7e7909d64bd0c4d8aef629cdc764b9d3e1d3a69a" @@ -931,29 +923,11 @@ debug "^4.3.2" tsutils "^3.21.0" -"@typescript-eslint/types@5.15.0": - version "5.15.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.15.0.tgz#c7bdd103843b1abae97b5518219d3e2a0d79a501" - integrity sha512-yEiTN4MDy23vvsIksrShjNwQl2vl6kJeG9YkVJXjXZnkJElzVK8nfPsWKYxcsGWG8GhurYXP4/KGj3aZAxbeOA== - "@typescript-eslint/types@5.16.0": version "5.16.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.16.0.tgz#5827b011982950ed350f075eaecb7f47d3c643ee" integrity sha512-oUorOwLj/3/3p/HFwrp6m/J2VfbLC8gjW5X3awpQJ/bSG+YRGFS4dpsvtQ8T2VNveV+LflQHjlLvB6v0R87z4g== -"@typescript-eslint/typescript-estree@5.15.0": - version "5.15.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.15.0.tgz#81513a742a9c657587ad1ddbca88e76c6efb0aac" - integrity sha512-Hb0e3dGc35b75xLzixM3cSbG1sSbrTBQDfIScqdyvrfJZVEi4XWAT+UL/HMxEdrJNB8Yk28SKxPLtAhfCbBInA== - dependencies: - "@typescript-eslint/types" "5.15.0" - "@typescript-eslint/visitor-keys" "5.15.0" - debug "^4.3.2" - globby "^11.0.4" - is-glob "^4.0.3" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.16.0": version "5.16.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.16.0.tgz#32259459ec62f5feddca66adc695342f30101f61" @@ -979,14 +953,6 @@ eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.15.0": - version "5.15.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.15.0.tgz#5669739fbf516df060f978be6a6dce75855a8027" - integrity sha512-+vX5FKtgvyHbmIJdxMJ2jKm9z2BIlXJiuewI8dsDYMp5LzPUcuTT78Ya5iwvQg3VqSVdmxyM8Anj1Jeq7733ZQ== - dependencies: - "@typescript-eslint/types" "5.15.0" - eslint-visitor-keys "^3.0.0" - "@typescript-eslint/visitor-keys@5.16.0": version "5.16.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.16.0.tgz#f27dc3b943e6317264c7492e390c6844cd4efbbb" From b64b3f8ce91df202a012b704709b4077ee6e8b4f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Mar 2022 12:01:52 +0000 Subject: [PATCH 539/785] Bump @types/node from 17.0.22 to 17.0.23 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.22 to 17.0.23. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 771130e3..d78a39e2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -855,9 +855,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^17.0.0": - version "17.0.22" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.22.tgz#38b6c4b9b2f3ed9f2e376cce42a298fb2375251e" - integrity sha512-8FwbVoG4fy+ykY86XCAclKZDORttqE5/s7dyWZKLXTdv3vRy5HozBEinG5IqhvPXXzIZEcTVbuHlQEI6iuwcmw== + version "17.0.23" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.23.tgz#3b41a6e643589ac6442bdbd7a4a3ded62f33f7da" + integrity sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.4.4" From 2ff054ef02a2f36125e7c606866f80bbfcc80b22 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Mar 2022 12:26:54 +0000 Subject: [PATCH 540/785] Bump minimist from 1.2.5 to 1.2.6 Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6. - [Release notes](https://github.com/substack/minimist/releases) - [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6) --- updated-dependencies: - dependency-name: minimist dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index d78a39e2..b7f563fe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2684,9 +2684,9 @@ minimatch@^3.0.4: brace-expansion "^1.1.7" minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + version "1.2.6" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" + integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== mri@^1.1.5: version "1.2.0" From fc5ed5855791e32a019aaf2b2829fbc6fa6026bf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Mar 2022 12:01:43 +0000 Subject: [PATCH 541/785] Bump typescript from 4.6.2 to 4.6.3 Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.6.2 to 4.6.3. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v4.6.2...v4.6.3) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index b7f563fe..424e39eb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3304,9 +3304,9 @@ typedarray-to-buffer@^3.1.5: is-typedarray "^1.0.0" typescript@^4.5.2: - version "4.6.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.2.tgz#fe12d2727b708f4eef40f51598b3398baa9611d4" - integrity sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg== + version "4.6.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.3.tgz#eefeafa6afdd31d725584c67a0eaba80f6fc6c6c" + integrity sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw== universalify@^0.1.2: version "0.1.2" From 39e77d82195931059a7d373ac95d4e4dd526f533 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Mar 2022 12:01:55 +0000 Subject: [PATCH 542/785] Bump prettier from 2.5.1 to 2.6.1 Bumps [prettier](https://github.com/prettier/prettier) from 2.5.1 to 2.6.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.5.1...2.6.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index b7f563fe..a2a12ed5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2878,9 +2878,9 @@ prelude-ls@~1.1.2: integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= prettier@>=2.3.0: - version "2.5.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.1.tgz#fff75fa9d519c54cf0fce328c1017d94546bc56a" - integrity sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg== + version "2.6.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.1.tgz#d472797e0d7461605c1609808e27b80c0f9cfe17" + integrity sha512-8UVbTBYGwN37Bs9LERmxCPjdvPxlEowx2urIL6urHzdb3SDq4B/Z6xLFCblrSnE4iKWcS6ziJ3aOYrc1kz/E2A== pretty-format@^27.0.0, pretty-format@^27.5.1: version "27.5.1" From 96f2e2fa6619417eded26956f25656bdedce2068 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Mar 2022 12:02:04 +0000 Subject: [PATCH 543/785] Bump ts-jest from 27.1.3 to 27.1.4 Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 27.1.3 to 27.1.4. - [Release notes](https://github.com/kulshekhar/ts-jest/releases) - [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/kulshekhar/ts-jest/compare/v27.1.3...v27.1.4) --- updated-dependencies: - dependency-name: ts-jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 36 ++++-------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/yarn.lock b/yarn.lock index b7f563fe..cff3fa61 100644 --- a/yarn.lock +++ b/yarn.lock @@ -695,17 +695,6 @@ source-map "^0.6.1" write-file-atomic "^3.0.0" -"@jest/types@^27.4.2": - version "27.4.2" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.4.2.tgz#96536ebd34da6392c2b7c7737d693885b5dd44a5" - integrity sha512-j35yw0PMTPpZsUoOBiuHzr1zTYoad1cVIE0ajEjcrJONxxrko/IRGKkXx3os0Nsi4Hu3+5VmDbVfq5WhG/pWAg== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^16.0.0" - chalk "^4.0.0" - "@jest/types@^27.5.1": version "27.5.1" resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.5.1.tgz#3c79ec4a8ba61c170bf937bcf9e98a9df175ec80" @@ -1847,11 +1836,6 @@ globby@^11.0.4: merge2 "^1.3.0" slash "^3.0.0" -graceful-fs@^4.2.4: - version "4.2.8" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" - integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== - graceful-fs@^4.2.9: version "4.2.9" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96" @@ -2415,19 +2399,7 @@ jest-snapshot@^27.5.1: pretty-format "^27.5.1" semver "^7.3.2" -jest-util@^27.0.0: - version "27.4.2" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.4.2.tgz#ed95b05b1adfd761e2cda47e0144c6a58e05a621" - integrity sha512-YuxxpXU6nlMan9qyLuxHaMMOzXAl5aGZWCSzben5DhLHemYQxCc4YK+4L3ZrCutT8GPQ+ui9k5D8rUJoDioMnA== - dependencies: - "@jest/types" "^27.4.2" - "@types/node" "*" - chalk "^4.0.0" - ci-info "^3.2.0" - graceful-fs "^4.2.4" - picomatch "^2.2.3" - -jest-util@^27.5.1: +jest-util@^27.0.0, jest-util@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.5.1.tgz#3ba9771e8e31a0b85da48fe0b0891fb86c01c2f9" integrity sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw== @@ -3223,9 +3195,9 @@ tr46@^2.1.0: punycode "^2.1.1" ts-jest@^27.0.5: - version "27.1.3" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.1.3.tgz#1f723e7e74027c4da92c0ffbd73287e8af2b2957" - integrity sha512-6Nlura7s6uM9BVUAoqLH7JHyMXjz8gluryjpPXxr3IxZdAXnU6FhjvVLHFtfd1vsE1p8zD1OJfskkc0jhTSnkA== + version "27.1.4" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.1.4.tgz#84d42cf0f4e7157a52e7c64b1492c46330943e00" + integrity sha512-qjkZlVPWVctAezwsOD1OPzbZ+k7zA5z3oxII4dGdZo5ggX/PL7kvwTM0pXTr10fAtbiVpJaL3bWd502zAhpgSQ== dependencies: bs-logger "0.x" fast-json-stable-stringify "2.x" From 650af6d65f2d2135e94da18a483af3037c928028 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 25 Mar 2022 09:51:07 -0400 Subject: [PATCH 544/785] Fix gem build --- prettier.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prettier.gemspec b/prettier.gemspec index c2dbbbf5..2d7da08e 100644 --- a/prettier.gemspec +++ b/prettier.gemspec @@ -17,7 +17,7 @@ Gem::Specification.new do |spec| %w[LICENSE bin/console package.json rubocop.yml] + Dir['{{exe,lib,dist}/**/*,*.md}'] + Dir[ - 'node_modules/prettier/{package.json,index.js,doc.js,bin-prettier.js,third-party.js,parser-*.js}' + 'node_modules/prettier/{package.json,index.js,cli.js,doc.js,bin-prettier.js,third-party.js,parser-*.js}' ] end From a614110c174906c36bd6f1835d025581f87e3988 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 25 Mar 2022 09:52:27 -0400 Subject: [PATCH 545/785] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b92a3eb..579d20d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#1035](https://github.com/prettier/plugin-ruby/issues/1035) - qcn, kddnewton - Ensure we don't try to print `return` incorrectly when multiple statements are contained within parentheses. - [#1048](https://github.com/prettier/plugin-ruby/pull/1048) - kddnewton - Completely refactor the Ruby parser to use classes instead of hashes. Also remove a lot of the `body` keys are replace them with actual names. - [#1042](https://github.com/prettier/plugin-ruby/issues/1042) - JoshuaKGoldberg, kddnewton - Ensure blocks are printed correctly when there are trailing comments on the `do` keyword. +- [#1134](https://github.com/prettier/plugin-ruby/pull/1134) - mhssmnn - Fix piping for STDIN to the gem process. ### Removed From 3c0e1a0fd9a4e06e67d426a831a0c362023cae42 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 25 Mar 2022 09:53:56 -0400 Subject: [PATCH 546/785] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 579d20d6..e8f98cef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#1048](https://github.com/prettier/plugin-ruby/pull/1048) - kddnewton - Completely refactor the Ruby parser to use classes instead of hashes. Also remove a lot of the `body` keys are replace them with actual names. - [#1042](https://github.com/prettier/plugin-ruby/issues/1042) - JoshuaKGoldberg, kddnewton - Ensure blocks are printed correctly when there are trailing comments on the `do` keyword. - [#1134](https://github.com/prettier/plugin-ruby/pull/1134) - mhssmnn - Fix piping for STDIN to the gem process. +- [#1167](https://github.com/prettier/plugin-ruby/pull/1167) - dleavitt - More consistent assignment indentation. ### Removed From afd9bac6ae51da2205c2aae6af6e6d90392200d1 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 25 Mar 2022 10:16:27 -0400 Subject: [PATCH 547/785] Fix up formatting on main --- lib/prettier.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/prettier.rb b/lib/prettier.rb index e6a8b5be..973112e7 100644 --- a/lib/prettier.rb +++ b/lib/prettier.rb @@ -12,11 +12,8 @@ def self.run(args) quoted = args.map { |arg| arg.start_with?('-') ? arg : "\"#{arg}\"" } command = "node #{BINARY} --plugin \"#{PLUGIN}\" #{quoted.join(' ')}" - stdout, stderr, status = Open3.capture3( - { 'RBPRETTIER' => '1' }, - command, - stdin_data: STDIN - ) + stdout, stderr, status = + Open3.capture3({ 'RBPRETTIER' => '1' }, command, stdin_data: STDIN) STDOUT.puts(stdout) # If we completed successfully, then just exit out. From 8a678584ef7ee7baa91e3a9eed209c426ce4417e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Mar 2022 12:01:43 +0000 Subject: [PATCH 548/785] Bump eslint from 8.11.0 to 8.12.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.11.0 to 8.12.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.11.0...v8.12.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 85a16fd1..6e806293 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1527,9 +1527,9 @@ eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.3.0: integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.1.0: - version "8.11.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.11.0.tgz#88b91cfba1356fc10bb9eb592958457dfe09fb37" - integrity sha512-/KRpd9mIRg2raGxHRGwW9ZywYNAClZrHjdueHcrVDuO3a6bj83eoTirCCk0M0yPwOjWYKHwRVRid+xK4F/GHgA== + version "8.12.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.12.0.tgz#c7a5bd1cfa09079aae64c9076c07eada66a46e8e" + integrity sha512-it1oBL9alZg1S8UycLm5YDMAkIhtH6FtAzuZs6YvoGVldWjbS08BkAdb/ymP9LlAyq8koANu32U7Ib/w+UNh8Q== dependencies: "@eslint/eslintrc" "^1.2.1" "@humanwhocodes/config-array" "^0.9.2" From fb287405b64b37b91a9ac4687a2abb04ca53631d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 12:01:34 +0000 Subject: [PATCH 549/785] Bump @typescript-eslint/eslint-plugin from 5.16.0 to 5.17.0 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.16.0 to 5.17.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.17.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 70 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 52 insertions(+), 18 deletions(-) diff --git a/yarn.lock b/yarn.lock index 6e806293..eb7872b5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -871,13 +871,13 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.4.0": - version "5.16.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.16.0.tgz#78f246dd8d1b528fc5bfca99a8a64d4023a3d86d" - integrity sha512-SJoba1edXvQRMmNI505Uo4XmGbxCK9ARQpkvOd00anxzri9RNQk0DDCxD+LIl+jYhkzOJiOMMKYEHnHEODjdCw== + version "5.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.17.0.tgz#704eb4e75039000531255672bf1c85ee85cf1d67" + integrity sha512-qVstvQilEd89HJk3qcbKt/zZrfBZ+9h2ynpAGlWjWiizA7m/MtLT9RoX6gjtpE500vfIg8jogAkDzdCxbsFASQ== dependencies: - "@typescript-eslint/scope-manager" "5.16.0" - "@typescript-eslint/type-utils" "5.16.0" - "@typescript-eslint/utils" "5.16.0" + "@typescript-eslint/scope-manager" "5.17.0" + "@typescript-eslint/type-utils" "5.17.0" + "@typescript-eslint/utils" "5.17.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -903,12 +903,20 @@ "@typescript-eslint/types" "5.16.0" "@typescript-eslint/visitor-keys" "5.16.0" -"@typescript-eslint/type-utils@5.16.0": - version "5.16.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.16.0.tgz#b482bdde1d7d7c0c7080f7f2f67ea9580b9e0692" - integrity sha512-SKygICv54CCRl1Vq5ewwQUJV/8padIWvPgCxlWPGO/OgQLCijY9G7lDu6H+mqfQtbzDNlVjzVWQmeqbLMBLEwQ== +"@typescript-eslint/scope-manager@5.17.0": + version "5.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.17.0.tgz#4cea7d0e0bc0e79eb60cad431c89120987c3f952" + integrity sha512-062iCYQF/doQ9T2WWfJohQKKN1zmmXVfAcS3xaiialiw8ZUGy05Em6QVNYJGO34/sU1a7a+90U3dUNfqUDHr3w== + dependencies: + "@typescript-eslint/types" "5.17.0" + "@typescript-eslint/visitor-keys" "5.17.0" + +"@typescript-eslint/type-utils@5.17.0": + version "5.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.17.0.tgz#1c4549d68c89877662224aabb29fbbebf5fc9672" + integrity sha512-3hU0RynUIlEuqMJA7dragb0/75gZmwNwFf/QJokWzPehTZousP/MNifVSgjxNcDCkM5HI2K22TjQWUmmHUINSg== dependencies: - "@typescript-eslint/utils" "5.16.0" + "@typescript-eslint/utils" "5.17.0" debug "^4.3.2" tsutils "^3.21.0" @@ -917,6 +925,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.16.0.tgz#5827b011982950ed350f075eaecb7f47d3c643ee" integrity sha512-oUorOwLj/3/3p/HFwrp6m/J2VfbLC8gjW5X3awpQJ/bSG+YRGFS4dpsvtQ8T2VNveV+LflQHjlLvB6v0R87z4g== +"@typescript-eslint/types@5.17.0": + version "5.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.17.0.tgz#861ec9e669ffa2aa9b873dd4d28d9b1ce26d216f" + integrity sha512-AgQ4rWzmCxOZLioFEjlzOI3Ch8giDWx8aUDxyNw9iOeCvD3GEYAB7dxWGQy4T/rPVe8iPmu73jPHuaSqcjKvxw== + "@typescript-eslint/typescript-estree@5.16.0": version "5.16.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.16.0.tgz#32259459ec62f5feddca66adc695342f30101f61" @@ -930,15 +943,28 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/utils@5.16.0": - version "5.16.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.16.0.tgz#42218b459d6d66418a4eb199a382bdc261650679" - integrity sha512-iYej2ER6AwmejLWMWzJIHy3nPJeGDuCqf8Jnb+jAQVoPpmWzwQOfa9hWVB8GIQE5gsCv/rfN4T+AYb/V06WseQ== +"@typescript-eslint/typescript-estree@5.17.0": + version "5.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.17.0.tgz#a7cba7dfc8f9cc2ac78c18584e684507df4f2488" + integrity sha512-X1gtjEcmM7Je+qJRhq7ZAAaNXYhTgqMkR10euC4Si6PIjb+kwEQHSxGazXUQXFyqfEXdkGf6JijUu5R0uceQzg== + dependencies: + "@typescript-eslint/types" "5.17.0" + "@typescript-eslint/visitor-keys" "5.17.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.17.0": + version "5.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.17.0.tgz#549a9e1d491c6ccd3624bc3c1b098f5cfb45f306" + integrity sha512-DVvndq1QoxQH+hFv+MUQHrrWZ7gQ5KcJzyjhzcqB1Y2Xes1UQQkTRPUfRpqhS8mhTWsSb2+iyvDW1Lef5DD7vA== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.16.0" - "@typescript-eslint/types" "5.16.0" - "@typescript-eslint/typescript-estree" "5.16.0" + "@typescript-eslint/scope-manager" "5.17.0" + "@typescript-eslint/types" "5.17.0" + "@typescript-eslint/typescript-estree" "5.17.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -950,6 +976,14 @@ "@typescript-eslint/types" "5.16.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.17.0": + version "5.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.17.0.tgz#52daae45c61b0211b4c81b53a71841911e479128" + integrity sha512-6K/zlc4OfCagUu7Am/BD5k8PSWQOgh34Nrv9Rxe2tBzlJ7uOeJ/h7ugCGDCeEZHT6k2CJBhbk9IsbkPI0uvUkA== + dependencies: + "@typescript-eslint/types" "5.17.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 3336b954a0e96879e3bdda85cada8cb5661a0a5a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 12:10:06 +0000 Subject: [PATCH 550/785] Bump @typescript-eslint/parser from 5.16.0 to 5.17.0 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.16.0 to 5.17.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.17.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 46 ++++++---------------------------------------- 1 file changed, 6 insertions(+), 40 deletions(-) diff --git a/yarn.lock b/yarn.lock index eb7872b5..e908a964 100644 --- a/yarn.lock +++ b/yarn.lock @@ -886,23 +886,15 @@ tsutils "^3.21.0" "@typescript-eslint/parser@^5.4.0": - version "5.16.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.16.0.tgz#e4de1bde4b4dad5b6124d3da227347616ed55508" - integrity sha512-fkDq86F0zl8FicnJtdXakFs4lnuebH6ZADDw6CYQv0UZeIjHvmEw87m9/29nk2Dv5Lmdp0zQ3zDQhiMWQf/GbA== + version "5.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.17.0.tgz#7def77d5bcd8458d12d52909118cf3f0a45f89d5" + integrity sha512-aRzW9Jg5Rlj2t2/crzhA2f23SIYFlF9mchGudyP0uiD6SenIxzKoLjwzHbafgHn39dNV/TV7xwQkLfFTZlJ4ig== dependencies: - "@typescript-eslint/scope-manager" "5.16.0" - "@typescript-eslint/types" "5.16.0" - "@typescript-eslint/typescript-estree" "5.16.0" + "@typescript-eslint/scope-manager" "5.17.0" + "@typescript-eslint/types" "5.17.0" + "@typescript-eslint/typescript-estree" "5.17.0" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.16.0": - version "5.16.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.16.0.tgz#7e7909d64bd0c4d8aef629cdc764b9d3e1d3a69a" - integrity sha512-P+Yab2Hovg8NekLIR/mOElCDPyGgFZKhGoZA901Yax6WR6HVeGLbsqJkZ+Cvk5nts/dAlFKm8PfL43UZnWdpIQ== - dependencies: - "@typescript-eslint/types" "5.16.0" - "@typescript-eslint/visitor-keys" "5.16.0" - "@typescript-eslint/scope-manager@5.17.0": version "5.17.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.17.0.tgz#4cea7d0e0bc0e79eb60cad431c89120987c3f952" @@ -920,29 +912,11 @@ debug "^4.3.2" tsutils "^3.21.0" -"@typescript-eslint/types@5.16.0": - version "5.16.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.16.0.tgz#5827b011982950ed350f075eaecb7f47d3c643ee" - integrity sha512-oUorOwLj/3/3p/HFwrp6m/J2VfbLC8gjW5X3awpQJ/bSG+YRGFS4dpsvtQ8T2VNveV+LflQHjlLvB6v0R87z4g== - "@typescript-eslint/types@5.17.0": version "5.17.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.17.0.tgz#861ec9e669ffa2aa9b873dd4d28d9b1ce26d216f" integrity sha512-AgQ4rWzmCxOZLioFEjlzOI3Ch8giDWx8aUDxyNw9iOeCvD3GEYAB7dxWGQy4T/rPVe8iPmu73jPHuaSqcjKvxw== -"@typescript-eslint/typescript-estree@5.16.0": - version "5.16.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.16.0.tgz#32259459ec62f5feddca66adc695342f30101f61" - integrity sha512-SE4VfbLWUZl9MR+ngLSARptUv2E8brY0luCdgmUevU6arZRY/KxYoLI/3V/yxaURR8tLRN7bmZtJdgmzLHI6pQ== - dependencies: - "@typescript-eslint/types" "5.16.0" - "@typescript-eslint/visitor-keys" "5.16.0" - debug "^4.3.2" - globby "^11.0.4" - is-glob "^4.0.3" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.17.0": version "5.17.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.17.0.tgz#a7cba7dfc8f9cc2ac78c18584e684507df4f2488" @@ -968,14 +942,6 @@ eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.16.0": - version "5.16.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.16.0.tgz#f27dc3b943e6317264c7492e390c6844cd4efbbb" - integrity sha512-jqxO8msp5vZDhikTwq9ubyMHqZ67UIvawohr4qF3KhlpL7gzSjOd+8471H3nh5LyABkaI85laEKKU8SnGUK5/g== - dependencies: - "@typescript-eslint/types" "5.16.0" - eslint-visitor-keys "^3.0.0" - "@typescript-eslint/visitor-keys@5.17.0": version "5.17.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.17.0.tgz#52daae45c61b0211b4c81b53a71841911e479128" From 41ff7ad1341a9b26367f4eb8e0f0af9dcc185f64 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Apr 2022 12:01:26 +0000 Subject: [PATCH 551/785] Bump prettier from 2.6.1 to 2.6.2 Bumps [prettier](https://github.com/prettier/prettier) from 2.6.1 to 2.6.2. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.6.1...2.6.2) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index e908a964..b3f5cd56 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2850,9 +2850,9 @@ prelude-ls@~1.1.2: integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= prettier@>=2.3.0: - version "2.6.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.1.tgz#d472797e0d7461605c1609808e27b80c0f9cfe17" - integrity sha512-8UVbTBYGwN37Bs9LERmxCPjdvPxlEowx2urIL6urHzdb3SDq4B/Z6xLFCblrSnE4iKWcS6ziJ3aOYrc1kz/E2A== + version "2.6.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.2.tgz#e26d71a18a74c3d0f0597f55f01fb6c06c206032" + integrity sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew== pretty-format@^27.0.0, pretty-format@^27.5.1: version "27.5.1" From d3e7566ceb563c7d931709b6d77c1d5249eb8369 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 4 Apr 2022 19:58:38 -0400 Subject: [PATCH 552/785] PRETTIER_RUBY_TIMEOUT_MS --- CHANGELOG.md | 4 + package.json | 4 +- src/parser/getInfo.js | 11 +- yarn.lock | 708 ++++++++++++++++-------------------------- 4 files changed, 284 insertions(+), 443 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8f98cef..d8bf5302 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Added + +- kddnewton - The ability to set the `PRETTIER_RUBY_TIMEOUT_MS` environment variable to control how long to wait for the parser server to spin up. + ### Changed - [#1028](https://github.com/prettier/plugin-ruby/issues/1028) - levymetal, kddnewton - Fix up some nested formatting with very complicated RSpec assertions. diff --git a/package.json b/package.json index 6d87ad18..2a4317c2 100644 --- a/package.json +++ b/package.json @@ -26,8 +26,8 @@ "@types/jest": "^27.0.1", "@types/node": "^17.0.0", "@types/prettier": "^2.4.2", - "@typescript-eslint/eslint-plugin": "^5.4.0", - "@typescript-eslint/parser": "^5.4.0", + "@typescript-eslint/eslint-plugin": "^5.18.0", + "@typescript-eslint/parser": "^5.18.0", "eslint": "^8.1.0", "eslint-config-prettier": "^8.0.0", "husky": "^7.0.0", diff --git a/src/parser/getInfo.js b/src/parser/getInfo.js index 1243c224..a35cc368 100644 --- a/src/parser/getInfo.js +++ b/src/parser/getInfo.js @@ -1,12 +1,19 @@ // eslint-disable-next-line @typescript-eslint/no-var-requires const { existsSync, readFileSync } = require("fs"); +// This is how long to wait for the parser to spin up. For the most part, 5 +// seconds is plenty of time. But in some environments, it may be necessary to +// increase this value. +const timeoutMs = parseInt(process.env.PRETTIER_RUBY_TIMEOUT_MS || "5000", 10); + const filepath = process.argv[process.argv.length - 1]; const timeout = setTimeout(() => { clearInterval(interval); - throw new Error("Failed to get information from parse server in time."); -}, 5000); + throw new Error(`Failed to get information from parse server in time. If this + happens repeatedly, try increasing the PRETTIER_RUBY_TIMEOUT_MS environment + variable beyond 5000.`); +}, timeoutMs); const interval = setInterval(() => { if (existsSync(filepath)) { diff --git a/yarn.lock b/yarn.lock index b3f5cd56..04a60927 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,101 +2,61 @@ # yarn lockfile v1 -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.16.7": +"@ampproject/remapping@^2.1.0": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.1.2.tgz#4edca94973ded9630d20101cd8559cedb8d8bd34" + integrity sha512-hoyByceqwKirw7w3Z7gnIIZC3Wx3J484Y3L/cMpXFbr7d9ZQj2mODrirNzcJa+SM3UlpWXYvKV4RlRpFXlWgXg== + dependencies: + "@jridgewell/trace-mapping" "^0.3.0" + +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg== dependencies: "@babel/highlight" "^7.16.7" -"@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.0.tgz#0dfc80309beec8411e65e706461c408b0bb9b431" - integrity sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA== - dependencies: - "@babel/highlight" "^7.16.0" - -"@babel/compat-data@^7.16.0", "@babel/compat-data@^7.16.4": - version "7.16.4" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.16.4.tgz#081d6bbc336ec5c2435c6346b2ae1fb98b5ac68e" - integrity sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q== - -"@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.2": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.16.0.tgz#c4ff44046f5fe310525cc9eb4ef5147f0c5374d4" - integrity sha512-mYZEvshBRHGsIAiyH5PzCFTCfbWfoYbO/jcSdXQSUQu1/pW0xDZAUP7KEc32heqWTAfAHhV9j1vH8Sav7l+JNQ== - dependencies: - "@babel/code-frame" "^7.16.0" - "@babel/generator" "^7.16.0" - "@babel/helper-compilation-targets" "^7.16.0" - "@babel/helper-module-transforms" "^7.16.0" - "@babel/helpers" "^7.16.0" - "@babel/parser" "^7.16.0" - "@babel/template" "^7.16.0" - "@babel/traverse" "^7.16.0" - "@babel/types" "^7.16.0" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.1.2" - semver "^6.3.0" - source-map "^0.5.0" +"@babel/compat-data@^7.17.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.17.7.tgz#078d8b833fbbcc95286613be8c716cef2b519fa2" + integrity sha512-p8pdE6j0a29TNGebNm7NzYZWB3xVZJBZ7XGs42uAKzQo8VQ3F0By/cQCtUEABwIqw5zo6WA4NbmxsfzADzMKnQ== -"@babel/core@^7.8.0": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.16.7.tgz#db990f931f6d40cb9b87a0dc7d2adc749f1dcbcf" - integrity sha512-aeLaqcqThRNZYmbMqtulsetOQZ/5gbR/dWruUCJcpas4Qoyy+QeagfDsPdMrqwsPRDNxJvBlRiZxxX7THO7qtA== +"@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.2", "@babel/core@^7.8.0": + version "7.17.8" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.8.tgz#3dac27c190ebc3a4381110d46c80e77efe172e1a" + integrity sha512-OdQDV/7cRBtJHLSOBqqbYNkOcydOgnX59TZx4puf41fzcVtN3e/4yqY8lMQsK+5X2lJtAdmA+6OHqsj1hBJ4IQ== dependencies: + "@ampproject/remapping" "^2.1.0" "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.16.7" - "@babel/helper-compilation-targets" "^7.16.7" - "@babel/helper-module-transforms" "^7.16.7" - "@babel/helpers" "^7.16.7" - "@babel/parser" "^7.16.7" + "@babel/generator" "^7.17.7" + "@babel/helper-compilation-targets" "^7.17.7" + "@babel/helper-module-transforms" "^7.17.7" + "@babel/helpers" "^7.17.8" + "@babel/parser" "^7.17.8" "@babel/template" "^7.16.7" - "@babel/traverse" "^7.16.7" - "@babel/types" "^7.16.7" + "@babel/traverse" "^7.17.3" + "@babel/types" "^7.17.0" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.1.2" semver "^6.3.0" - source-map "^0.5.0" -"@babel/generator@^7.16.0", "@babel/generator@^7.7.2": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.16.0.tgz#d40f3d1d5075e62d3500bccb67f3daa8a95265b2" - integrity sha512-RR8hUCfRQn9j9RPKEVXo9LiwoxLPYn6hNZlvUOR8tSnaxlD0p0+la00ZP9/SnRt6HchKr+X0fO2r8vrETiJGew== +"@babel/generator@^7.17.3", "@babel/generator@^7.17.7", "@babel/generator@^7.7.2": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.17.7.tgz#8da2599beb4a86194a3b24df6c085931d9ee45ad" + integrity sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w== dependencies: - "@babel/types" "^7.16.0" + "@babel/types" "^7.17.0" jsesc "^2.5.1" source-map "^0.5.0" -"@babel/generator@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.16.7.tgz#b42bf46a3079fa65e1544135f32e7958f048adbb" - integrity sha512-/ST3Sg8MLGY5HVYmrjOgL60ENux/HfO/CsUh7y4MalThufhE/Ff/6EibFDHi4jiDCaWfJKoqbE6oTh21c5hrRg== +"@babel/helper-compilation-targets@^7.17.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.7.tgz#a3c2924f5e5f0379b356d4cfb313d1414dc30e46" + integrity sha512-UFzlz2jjd8kroj0hmCFV5zr+tQPi1dpC2cRsDV/3IEW8bJfCPrPpmcSN6ZS8RqIq4LXcmpipCQFPddyFA5Yc7w== dependencies: - "@babel/types" "^7.16.7" - jsesc "^2.5.1" - source-map "^0.5.0" - -"@babel/helper-compilation-targets@^7.16.0": - version "7.16.3" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.3.tgz#5b480cd13f68363df6ec4dc8ac8e2da11363cbf0" - integrity sha512-vKsoSQAyBmxS35JUOOt+07cLc6Nk/2ljLIHwmq2/NM6hdioUaqEXq/S+nXvbvXbZkNDlWOymPanJGOc4CBjSJA== - dependencies: - "@babel/compat-data" "^7.16.0" - "@babel/helper-validator-option" "^7.14.5" - browserslist "^4.17.5" - semver "^6.3.0" - -"@babel/helper-compilation-targets@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz#06e66c5f299601e6c7da350049315e83209d551b" - integrity sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA== - dependencies: - "@babel/compat-data" "^7.16.4" + "@babel/compat-data" "^7.17.7" "@babel/helper-validator-option" "^7.16.7" browserslist "^4.17.5" semver "^6.3.0" @@ -108,15 +68,6 @@ dependencies: "@babel/types" "^7.16.7" -"@babel/helper-function-name@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.16.0.tgz#b7dd0797d00bbfee4f07e9c4ea5b0e30c8bb1481" - integrity sha512-BZh4mEk1xi2h4HFjWUXRQX5AEx4rvaZxHgax9gcjdLWdkjsY7MKt5p0otjsg5noXw+pB+clMCjw+aEVYADMjog== - dependencies: - "@babel/helper-get-function-arity" "^7.16.0" - "@babel/template" "^7.16.0" - "@babel/types" "^7.16.0" - "@babel/helper-function-name@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz#f1ec51551fb1c8956bc8dd95f38523b6cf375f8f" @@ -126,13 +77,6 @@ "@babel/template" "^7.16.7" "@babel/types" "^7.16.7" -"@babel/helper-get-function-arity@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.0.tgz#0088c7486b29a9cb5d948b1a1de46db66e089cfa" - integrity sha512-ASCquNcywC1NkYh/z7Cgp3w31YW8aojjYIlNg4VeJiHkqyP4AzIvr4qx7pYDb4/s8YcsZWqqOSxgkvjUz1kpDQ== - dependencies: - "@babel/types" "^7.16.0" - "@babel/helper-get-function-arity@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz#ea08ac753117a669f1508ba06ebcc49156387419" @@ -140,13 +84,6 @@ dependencies: "@babel/types" "^7.16.7" -"@babel/helper-hoist-variables@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.0.tgz#4c9023c2f1def7e28ff46fc1dbcd36a39beaa81a" - integrity sha512-1AZlpazjUR0EQZQv3sgRNfM9mEVWPK3M6vlalczA+EECcPz3XPh6VplbErL5UoMpChhSck5wAJHthlj1bYpcmg== - dependencies: - "@babel/types" "^7.16.0" - "@babel/helper-hoist-variables@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz#86bcb19a77a509c7b77d0e22323ef588fa58c246" @@ -154,20 +91,6 @@ dependencies: "@babel/types" "^7.16.7" -"@babel/helper-member-expression-to-functions@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.0.tgz#29287040efd197c77636ef75188e81da8bccd5a4" - integrity sha512-bsjlBFPuWT6IWhl28EdrQ+gTvSvj5tqVP5Xeftp07SEuz5pLnsXZuDkDD3Rfcxy0IsHmbZ+7B2/9SHzxO0T+sQ== - dependencies: - "@babel/types" "^7.16.0" - -"@babel/helper-module-imports@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz#90538e60b672ecf1b448f5f4f5433d37e79a3ec3" - integrity sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg== - dependencies: - "@babel/types" "^7.16.0" - "@babel/helper-module-imports@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz#25612a8091a999704461c8a222d0efec5d091437" @@ -175,76 +98,31 @@ dependencies: "@babel/types" "^7.16.7" -"@babel/helper-module-transforms@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.16.0.tgz#1c82a8dd4cb34577502ebd2909699b194c3e9bb5" - integrity sha512-My4cr9ATcaBbmaEa8M0dZNA74cfI6gitvUAskgDtAFmAqyFKDSHQo5YstxPbN+lzHl2D9l/YOEFqb2mtUh4gfA== - dependencies: - "@babel/helper-module-imports" "^7.16.0" - "@babel/helper-replace-supers" "^7.16.0" - "@babel/helper-simple-access" "^7.16.0" - "@babel/helper-split-export-declaration" "^7.16.0" - "@babel/helper-validator-identifier" "^7.15.7" - "@babel/template" "^7.16.0" - "@babel/traverse" "^7.16.0" - "@babel/types" "^7.16.0" - -"@babel/helper-module-transforms@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz#7665faeb721a01ca5327ddc6bba15a5cb34b6a41" - integrity sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng== +"@babel/helper-module-transforms@^7.17.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.17.7.tgz#3943c7f777139e7954a5355c815263741a9c1cbd" + integrity sha512-VmZD99F3gNTYB7fJRDTi+u6l/zxY0BE6OIxPSU7a50s6ZUQkHwSDmV92FfM+oCG0pZRVojGYhkR8I0OGeCVREw== dependencies: "@babel/helper-environment-visitor" "^7.16.7" "@babel/helper-module-imports" "^7.16.7" - "@babel/helper-simple-access" "^7.16.7" + "@babel/helper-simple-access" "^7.17.7" "@babel/helper-split-export-declaration" "^7.16.7" "@babel/helper-validator-identifier" "^7.16.7" "@babel/template" "^7.16.7" - "@babel/traverse" "^7.16.7" - "@babel/types" "^7.16.7" - -"@babel/helper-optimise-call-expression@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.0.tgz#cecdb145d70c54096b1564f8e9f10cd7d193b338" - integrity sha512-SuI467Gi2V8fkofm2JPnZzB/SUuXoJA5zXe/xzyPP2M04686RzFKFHPK6HDVN6JvWBIEW8tt9hPR7fXdn2Lgpw== - dependencies: - "@babel/types" "^7.16.0" + "@babel/traverse" "^7.17.3" + "@babel/types" "^7.17.0" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.8.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz#5ac822ce97eec46741ab70a517971e443a70c5a9" - integrity sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ== - -"@babel/helper-replace-supers@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.16.0.tgz#73055e8d3cf9bcba8ddb55cad93fedc860f68f17" - integrity sha512-TQxuQfSCdoha7cpRNJvfaYxxxzmbxXw/+6cS7V02eeDYyhxderSoMVALvwupA54/pZcOTtVeJ0xccp1nGWladA== - dependencies: - "@babel/helper-member-expression-to-functions" "^7.16.0" - "@babel/helper-optimise-call-expression" "^7.16.0" - "@babel/traverse" "^7.16.0" - "@babel/types" "^7.16.0" - -"@babel/helper-simple-access@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.16.0.tgz#21d6a27620e383e37534cf6c10bba019a6f90517" - integrity sha512-o1rjBT/gppAqKsYfUdfHq5Rk03lMQrkPHG1OWzHWpLgVXRH4HnMM9Et9CVdIqwkCQlobnGHEJMsgWP/jE1zUiw== - dependencies: - "@babel/types" "^7.16.0" - -"@babel/helper-simple-access@^7.16.7": +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.8.0": version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz#d656654b9ea08dbb9659b69d61063ccd343ff0f7" - integrity sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g== - dependencies: - "@babel/types" "^7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz#aa3a8ab4c3cceff8e65eb9e73d87dc4ff320b2f5" + integrity sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA== -"@babel/helper-split-export-declaration@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.0.tgz#29672f43663e936df370aaeb22beddb3baec7438" - integrity sha512-0YMMRpuDFNGTHNRiiqJX19GjNXA4H0E8jZ2ibccfSxaCogbm3am5WN/2nQNj0YnQwGWM1J06GOcQ2qnh3+0paw== +"@babel/helper-simple-access@^7.17.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz#aaa473de92b7987c6dfa7ce9a7d9674724823367" + integrity sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA== dependencies: - "@babel/types" "^7.16.0" + "@babel/types" "^7.17.0" "@babel/helper-split-export-declaration@^7.16.7": version "7.16.7" @@ -253,71 +131,38 @@ dependencies: "@babel/types" "^7.16.7" -"@babel/helper-validator-identifier@^7.15.7": - version "7.15.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz#220df993bfe904a4a6b02ab4f3385a5ebf6e2389" - integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w== - "@babel/helper-validator-identifier@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz#e8c602438c4a8195751243da9031d1607d247cad" integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw== -"@babel/helper-validator-option@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" - integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow== - "@babel/helper-validator-option@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz#b203ce62ce5fe153899b617c08957de860de4d23" integrity sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ== -"@babel/helpers@^7.16.0": - version "7.16.3" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.16.3.tgz#27fc64f40b996e7074dc73128c3e5c3e7f55c43c" - integrity sha512-Xn8IhDlBPhvYTvgewPKawhADichOsbkZuzN7qz2BusOM0brChsyXMDJvldWaYMMUNiCQdQzNEioXTp3sC8Nt8w== - dependencies: - "@babel/template" "^7.16.0" - "@babel/traverse" "^7.16.3" - "@babel/types" "^7.16.0" - -"@babel/helpers@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.16.7.tgz#7e3504d708d50344112767c3542fc5e357fffefc" - integrity sha512-9ZDoqtfY7AuEOt3cxchfii6C7GDyyMBffktR5B2jvWv8u2+efwvpnVKXMWzNehqy68tKgAfSwfdw/lWpthS2bw== +"@babel/helpers@^7.17.8": + version "7.17.8" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.17.8.tgz#288450be8c6ac7e4e44df37bcc53d345e07bc106" + integrity sha512-QcL86FGxpfSJwGtAvv4iG93UL6bmqBdmoVY0CMCU2g+oD2ezQse3PT5Pa+jiD6LJndBQi0EDlpzOWNlLuhz5gw== dependencies: "@babel/template" "^7.16.7" - "@babel/traverse" "^7.16.7" - "@babel/types" "^7.16.7" - -"@babel/highlight@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.0.tgz#6ceb32b2ca4b8f5f361fb7fd821e3fddf4a1725a" - integrity sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g== - dependencies: - "@babel/helper-validator-identifier" "^7.15.7" - chalk "^2.0.0" - js-tokens "^4.0.0" + "@babel/traverse" "^7.17.3" + "@babel/types" "^7.17.0" "@babel/highlight@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.7.tgz#81a01d7d675046f0d96f82450d9d9578bdfd6b0b" - integrity sha512-aKpPMfLvGO3Q97V0qhw/V2SWNWlwfJknuwAunU7wZLSfrM4xTBvg7E5opUVi1kJTBKihE38CPg4nBiqX83PWYw== + version "7.16.10" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.10.tgz#744f2eb81579d6eea753c227b0f570ad785aba88" + integrity sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw== dependencies: "@babel/helper-validator-identifier" "^7.16.7" chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.0", "@babel/parser@^7.16.3": - version "7.16.4" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.4.tgz#d5f92f57cf2c74ffe9b37981c0e72fee7311372e" - integrity sha512-6V0qdPUaiVHH3RtZeLIsc+6pDhbYzHR8ogA8w+f+Wc77DuXto19g2QUwveINoS34Uw+W8/hQDGJCx+i4n7xcng== - -"@babel/parser@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.7.tgz#d372dda9c89fcec340a82630a9f533f2fe15877e" - integrity sha512-sR4eaSrnM7BV7QPzGfEX5paG/6wrZM3I0HDzfIAK06ESvo9oy3xBuVBxE3MbQaKNhvg8g/ixjMWo2CGpzpHsDA== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.17.3", "@babel/parser@^7.17.8": + version "7.17.8" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.8.tgz#2817fb9d885dd8132ea0f8eb615a6388cca1c240" + integrity sha512-BoHhDJrJXqcg+ZL16Xv39H9n+AqJ4pcDrQBGZN+wHxIysrLZ3/ECwCBUch/1zUNhnsXULcONU3Ei5Hmkfk6kiQ== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -404,22 +249,13 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-typescript@^7.7.2": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.0.tgz#2feeb13d9334cc582ea9111d3506f773174179bb" - integrity sha512-Xv6mEXqVdaqCBfJFyeab0fH2DnUoMsDmhamxsSi4j8nLd4Vtw213WMJr55xxqipC/YVWyPY3K0blJncPYji+dQ== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/template@^7.16.0", "@babel/template@^7.3.3": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.0.tgz#d16a35ebf4cd74e202083356fab21dd89363ddd6" - integrity sha512-MnZdpFD/ZdYhXwiunMqqgyZyucaYsbL0IrjoGjaVhGilz+x8YB++kRfygSOIj1yOtWKPlx7NBp+9I1RQSgsd5A== + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.7.tgz#39c9b55ee153151990fb038651d58d3fd03f98f8" + integrity sha512-YhUIJHHGkqPgEcMYkPCKTyGUdoGKWtopIycQyjJH8OjvRgOYsXsaKehLVPScKJWAULPxMa4N1vCe6szREFlZ7A== dependencies: - "@babel/code-frame" "^7.16.0" - "@babel/parser" "^7.16.0" - "@babel/types" "^7.16.0" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/template@^7.16.7": +"@babel/template@^7.16.7", "@babel/template@^7.3.3": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.7.tgz#8d126c8701fde4d66b264b3eba3d96f07666d155" integrity sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w== @@ -428,49 +264,26 @@ "@babel/parser" "^7.16.7" "@babel/types" "^7.16.7" -"@babel/traverse@^7.16.0", "@babel/traverse@^7.16.3", "@babel/traverse@^7.7.2": - version "7.16.3" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.3.tgz#f63e8a938cc1b780f66d9ed3c54f532ca2d14787" - integrity sha512-eolumr1vVMjqevCpwVO99yN/LoGL0EyHiLO5I043aYQvwOJ9eR5UsZSClHVCzfhBduMAsSzgA/6AyqPjNayJag== - dependencies: - "@babel/code-frame" "^7.16.0" - "@babel/generator" "^7.16.0" - "@babel/helper-function-name" "^7.16.0" - "@babel/helper-hoist-variables" "^7.16.0" - "@babel/helper-split-export-declaration" "^7.16.0" - "@babel/parser" "^7.16.3" - "@babel/types" "^7.16.0" - debug "^4.1.0" - globals "^11.1.0" - -"@babel/traverse@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.7.tgz#dac01236a72c2560073658dd1a285fe4e0865d76" - integrity sha512-8KWJPIb8c2VvY8AJrydh6+fVRo2ODx1wYBU2398xJVq0JomuLBZmVQzLPBblJgHIGYG4znCpUZUZ0Pt2vdmVYQ== +"@babel/traverse@^7.17.3", "@babel/traverse@^7.7.2": + version "7.17.3" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.17.3.tgz#0ae0f15b27d9a92ba1f2263358ea7c4e7db47b57" + integrity sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw== dependencies: "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.16.7" + "@babel/generator" "^7.17.3" "@babel/helper-environment-visitor" "^7.16.7" "@babel/helper-function-name" "^7.16.7" "@babel/helper-hoist-variables" "^7.16.7" "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/parser" "^7.16.7" - "@babel/types" "^7.16.7" + "@babel/parser" "^7.17.3" + "@babel/types" "^7.17.0" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.16.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.16.0.tgz#db3b313804f96aadd0b776c4823e127ad67289ba" - integrity sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg== - dependencies: - "@babel/helper-validator-identifier" "^7.15.7" - to-fast-properties "^2.0.0" - -"@babel/types@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.16.7.tgz#4ed19d51f840ed4bd5645be6ce40775fecf03159" - integrity sha512-E8HuV7FO9qLpx6OtoGfUQ2cjIYnbFwvZWYBS+87EwtdMvmUPJSwykpovFB+8insbpF0uJcpr8KMUi64XZntZcg== +"@babel/types@^7.0.0", "@babel/types@^7.16.7", "@babel/types@^7.17.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.17.0.tgz#a826e368bccb6b3d84acd76acad5c0d87342390b" + integrity sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw== dependencies: "@babel/helper-validator-identifier" "^7.16.7" to-fast-properties "^2.0.0" @@ -508,9 +321,9 @@ strip-json-comments "^3.1.1" "@humanwhocodes/config-array@^0.9.2": - version "0.9.2" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.2.tgz#68be55c737023009dfc5fe245d51181bb6476914" - integrity sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA== + version "0.9.5" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.5.tgz#2cbaf9a89460da24b5ca6531b8bbfc23e1df50c7" + integrity sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw== dependencies: "@humanwhocodes/object-schema" "^1.2.1" debug "^4.1.1" @@ -706,6 +519,24 @@ "@types/yargs" "^16.0.0" chalk "^4.0.0" +"@jridgewell/resolve-uri@^3.0.3": + version "3.0.5" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz#68eb521368db76d040a6315cdb24bf2483037b9c" + integrity sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew== + +"@jridgewell/sourcemap-codec@^1.4.10": + version "1.4.11" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz#771a1d8d744eeb71b6adb35808e1a6c7b9b8c8ec" + integrity sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg== + +"@jridgewell/trace-mapping@^0.3.0": + version "0.3.4" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.4.tgz#f6a0832dffd5b8a6aaa633b7d9f8e8e94c83a0c3" + integrity sha512-vFv9ttIedivx0ux3QSjhgtCVjPZd5l46ZOMDSCwnH1yUO2e964gO8LZGyv2QkqcgR6TnBU1v+1IFqmeoG+0UJQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -767,9 +598,9 @@ integrity sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA== "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": - version "7.1.16" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.16.tgz#bc12c74b7d65e82d29876b5d0baf5c625ac58702" - integrity sha512-EAEHtisTMM+KaKwfWdC3oyllIqswlznXCIVCt7/oRNrh+DhgT4UEBNC/jlADNjvw7UnfbcdkGQcPVZ1xYiLcrQ== + version "7.1.19" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.19.tgz#7b497495b7d1b4812bdb9d02804d0576f43ee460" + integrity sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" @@ -778,9 +609,9 @@ "@types/babel__traverse" "*" "@types/babel__generator@*": - version "7.6.3" - resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.3.tgz#f456b4b2ce79137f768aa130d2423d2f0ccfaba5" - integrity sha512-/GWCmzJWqV7diQW54smJZzWbSFf4QYtF71WCKhcx6Ru/tFyQIY2eiiITcCAeuPbNSvT9YCGkVMqqvSk2Z0mXiA== + version "7.6.4" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.4.tgz#1f20ce4c5b1990b37900b63f050182d28c2439b7" + integrity sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg== dependencies: "@babel/types" "^7.0.0" @@ -807,9 +638,9 @@ "@types/node" "*" "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762" - integrity sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw== + version "2.0.4" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44" + integrity sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g== "@types/istanbul-lib-report@*": version "3.0.0" @@ -834,9 +665,9 @@ pretty-format "^27.0.0" "@types/json-schema@^7.0.9": - version "7.0.9" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" - integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== + version "7.0.11" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" + integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== "@types/minimatch@^3.0.3": version "3.0.5" @@ -859,9 +690,9 @@ integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== "@types/yargs-parser@*": - version "20.2.1" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.1.tgz#3b9ce2489919d9e4fea439b76916abc34b2df129" - integrity sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw== + version "21.0.0" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b" + integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== "@types/yargs@^16.0.0": version "16.0.4" @@ -870,14 +701,14 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^5.4.0": - version "5.17.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.17.0.tgz#704eb4e75039000531255672bf1c85ee85cf1d67" - integrity sha512-qVstvQilEd89HJk3qcbKt/zZrfBZ+9h2ynpAGlWjWiizA7m/MtLT9RoX6gjtpE500vfIg8jogAkDzdCxbsFASQ== +"@typescript-eslint/eslint-plugin@^5.18.0": + version "5.18.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.18.0.tgz#950df411cec65f90d75d6320a03b2c98f6c3af7d" + integrity sha512-tzrmdGMJI/uii9/V6lurMo4/o+dMTKDH82LkNjhJ3adCW22YQydoRs5MwTiqxGF9CSYxPxQ7EYb4jLNlIs+E+A== dependencies: - "@typescript-eslint/scope-manager" "5.17.0" - "@typescript-eslint/type-utils" "5.17.0" - "@typescript-eslint/utils" "5.17.0" + "@typescript-eslint/scope-manager" "5.18.0" + "@typescript-eslint/type-utils" "5.18.0" + "@typescript-eslint/utils" "5.18.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -885,69 +716,69 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/parser@^5.4.0": - version "5.17.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.17.0.tgz#7def77d5bcd8458d12d52909118cf3f0a45f89d5" - integrity sha512-aRzW9Jg5Rlj2t2/crzhA2f23SIYFlF9mchGudyP0uiD6SenIxzKoLjwzHbafgHn39dNV/TV7xwQkLfFTZlJ4ig== +"@typescript-eslint/parser@^5.18.0": + version "5.18.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.18.0.tgz#2bcd4ff21df33621df33e942ccb21cb897f004c6" + integrity sha512-+08nYfurBzSSPndngnHvFw/fniWYJ5ymOrn/63oMIbgomVQOvIDhBoJmYZ9lwQOCnQV9xHGvf88ze3jFGUYooQ== dependencies: - "@typescript-eslint/scope-manager" "5.17.0" - "@typescript-eslint/types" "5.17.0" - "@typescript-eslint/typescript-estree" "5.17.0" + "@typescript-eslint/scope-manager" "5.18.0" + "@typescript-eslint/types" "5.18.0" + "@typescript-eslint/typescript-estree" "5.18.0" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.17.0": - version "5.17.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.17.0.tgz#4cea7d0e0bc0e79eb60cad431c89120987c3f952" - integrity sha512-062iCYQF/doQ9T2WWfJohQKKN1zmmXVfAcS3xaiialiw8ZUGy05Em6QVNYJGO34/sU1a7a+90U3dUNfqUDHr3w== +"@typescript-eslint/scope-manager@5.18.0": + version "5.18.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.18.0.tgz#a7d7b49b973ba8cebf2a3710eefd457ef2fb5505" + integrity sha512-C0CZML6NyRDj+ZbMqh9FnPscg2PrzSaVQg3IpTmpe0NURMVBXlghGZgMYqBw07YW73i0MCqSDqv2SbywnCS8jQ== dependencies: - "@typescript-eslint/types" "5.17.0" - "@typescript-eslint/visitor-keys" "5.17.0" + "@typescript-eslint/types" "5.18.0" + "@typescript-eslint/visitor-keys" "5.18.0" -"@typescript-eslint/type-utils@5.17.0": - version "5.17.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.17.0.tgz#1c4549d68c89877662224aabb29fbbebf5fc9672" - integrity sha512-3hU0RynUIlEuqMJA7dragb0/75gZmwNwFf/QJokWzPehTZousP/MNifVSgjxNcDCkM5HI2K22TjQWUmmHUINSg== +"@typescript-eslint/type-utils@5.18.0": + version "5.18.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.18.0.tgz#62dbfc8478abf36ba94a90ddf10be3cc8e471c74" + integrity sha512-vcn9/6J5D6jtHxpEJrgK8FhaM8r6J1/ZiNu70ZUJN554Y3D9t3iovi6u7JF8l/e7FcBIxeuTEidZDR70UuCIfA== dependencies: - "@typescript-eslint/utils" "5.17.0" + "@typescript-eslint/utils" "5.18.0" debug "^4.3.2" tsutils "^3.21.0" -"@typescript-eslint/types@5.17.0": - version "5.17.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.17.0.tgz#861ec9e669ffa2aa9b873dd4d28d9b1ce26d216f" - integrity sha512-AgQ4rWzmCxOZLioFEjlzOI3Ch8giDWx8aUDxyNw9iOeCvD3GEYAB7dxWGQy4T/rPVe8iPmu73jPHuaSqcjKvxw== +"@typescript-eslint/types@5.18.0": + version "5.18.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.18.0.tgz#4f0425d85fdb863071680983853c59a62ce9566e" + integrity sha512-bhV1+XjM+9bHMTmXi46p1Led5NP6iqQcsOxgx7fvk6gGiV48c6IynY0apQb7693twJDsXiVzNXTflhplmaiJaw== -"@typescript-eslint/typescript-estree@5.17.0": - version "5.17.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.17.0.tgz#a7cba7dfc8f9cc2ac78c18584e684507df4f2488" - integrity sha512-X1gtjEcmM7Je+qJRhq7ZAAaNXYhTgqMkR10euC4Si6PIjb+kwEQHSxGazXUQXFyqfEXdkGf6JijUu5R0uceQzg== +"@typescript-eslint/typescript-estree@5.18.0": + version "5.18.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.18.0.tgz#6498e5ee69a32e82b6e18689e2f72e4060986474" + integrity sha512-wa+2VAhOPpZs1bVij9e5gyVu60ReMi/KuOx4LKjGx2Y3XTNUDJgQ+5f77D49pHtqef/klglf+mibuHs9TrPxdQ== dependencies: - "@typescript-eslint/types" "5.17.0" - "@typescript-eslint/visitor-keys" "5.17.0" + "@typescript-eslint/types" "5.18.0" + "@typescript-eslint/visitor-keys" "5.18.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.17.0": - version "5.17.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.17.0.tgz#549a9e1d491c6ccd3624bc3c1b098f5cfb45f306" - integrity sha512-DVvndq1QoxQH+hFv+MUQHrrWZ7gQ5KcJzyjhzcqB1Y2Xes1UQQkTRPUfRpqhS8mhTWsSb2+iyvDW1Lef5DD7vA== +"@typescript-eslint/utils@5.18.0": + version "5.18.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.18.0.tgz#27fc84cf95c1a96def0aae31684cb43a37e76855" + integrity sha512-+hFGWUMMri7OFY26TsOlGa+zgjEy1ssEipxpLjtl4wSll8zy85x0GrUSju/FHdKfVorZPYJLkF3I4XPtnCTewA== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.17.0" - "@typescript-eslint/types" "5.17.0" - "@typescript-eslint/typescript-estree" "5.17.0" + "@typescript-eslint/scope-manager" "5.18.0" + "@typescript-eslint/types" "5.18.0" + "@typescript-eslint/typescript-estree" "5.18.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.17.0": - version "5.17.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.17.0.tgz#52daae45c61b0211b4c81b53a71841911e479128" - integrity sha512-6K/zlc4OfCagUu7Am/BD5k8PSWQOgh34Nrv9Rxe2tBzlJ7uOeJ/h7ugCGDCeEZHT6k2CJBhbk9IsbkPI0uvUkA== +"@typescript-eslint/visitor-keys@5.18.0": + version "5.18.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.18.0.tgz#c7c07709823804171d569017f3b031ced7253e60" + integrity sha512-Hf+t+dJsjAKpKSkg3EHvbtEpFFb/1CiOHnvI8bjHgOD4/wAw3gKrA0i94LrbekypiZVanJu3McWJg7rWDMzRTg== dependencies: - "@typescript-eslint/types" "5.17.0" + "@typescript-eslint/types" "5.18.0" eslint-visitor-keys "^3.0.0" abab@^2.0.3, abab@^2.0.5: @@ -1155,7 +986,7 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@^3.0.1: +braces@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== @@ -1168,14 +999,14 @@ browser-process-hrtime@^1.0.0: integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== browserslist@^4.17.5: - version "4.18.1" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.18.1.tgz#60d3920f25b6860eb917c6c7b185576f4d8b017f" - integrity sha512-8ScCzdpPwR2wQh8IT82CA2VgDwjHyqMovPBZSNH54+tm4Jk2pCuv90gmAdH6J84OCRWi0b4gMe6O6XPXuJnjgQ== + version "4.20.2" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.20.2.tgz#567b41508757ecd904dab4d1c646c612cd3d4f88" + integrity sha512-CQOBCqp/9pDvDbx3xfMi+86pr4KXIf2FDkTTdeuYw8OxS9t898LA1Khq57gtufFILXpfgsSx5woNgsBgvGjpsA== dependencies: - caniuse-lite "^1.0.30001280" - electron-to-chromium "^1.3.896" + caniuse-lite "^1.0.30001317" + electron-to-chromium "^1.4.84" escalade "^3.1.1" - node-releases "^2.0.1" + node-releases "^2.0.2" picocolors "^1.0.0" bs-logger@0.x: @@ -1208,14 +1039,14 @@ camelcase@^5.3.1: integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== camelcase@^6.2.0: - version "6.2.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.1.tgz#250fd350cfd555d0d2160b1d51510eaf8326e86e" - integrity sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA== + version "6.3.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001280: - version "1.0.30001282" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001282.tgz#38c781ee0a90ccfe1fe7fefd00e43f5ffdcb96fd" - integrity sha512-YhF/hG6nqBEllymSIjLtR2iWDDnChvhnVJqp+vloyt2tEHFG1yBR+ac2B/rOw0qOK0m0lEXU2dv4E/sMk5P9Kg== +caniuse-lite@^1.0.30001317: + version "1.0.30001325" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001325.tgz#2b4ad19b77aa36f61f2eaf72e636d7481d55e606" + integrity sha512-sB1bZHjseSjDtijV1Hb7PB2Zd58Kyx+n/9EotvZ4Qcz2K3d0lWB8dB4nb8wN/TsOGFq3UuAm0zQZNQ4SoR7TrQ== chalk@^2.0.0: version "2.4.2" @@ -1248,9 +1079,9 @@ char-regex@^1.0.2: integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== ci-info@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.2.0.tgz#2876cb948a498797b5236f0095bc057d0dca38b6" - integrity sha512-dVqRX7fLUm8J6FgHJ418XuIgDLZDkYcDFTeL6TA2gt5WlIZUQrrH6EZrNClwT/H0FateUsZkGIOPRrLbP+PR9A== + version "3.3.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.3.0.tgz#b4ed1fb6818dea4803a55c623041f9165d2066b2" + integrity sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw== cjs-module-lexer@^1.0.0: version "1.2.2" @@ -1360,9 +1191,9 @@ data-urls@^2.0.0: whatwg-url "^8.0.0" debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2: - version "4.3.2" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" - integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" @@ -1427,10 +1258,10 @@ domexception@^2.0.1: dependencies: webidl-conversions "^5.0.0" -electron-to-chromium@^1.3.896: - version "1.3.901" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.901.tgz#ce2c3157d61bce9f42f1e83225c17358ae9f4918" - integrity sha512-ToJdV2vzwT2jeAsw8zIggTFllJ4Kxvwghk39AhJEHHlIxor10wsFI3wo69p8nFc0s/ATWBqugPv/k3nW4Y9Mww== +electron-to-chromium@^1.4.84: + version "1.4.103" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.103.tgz#abfe376a4d70fa1e1b4b353b95df5d6dfd05da3a" + integrity sha512-c/uKWR1Z/W30Wy/sx3dkZoj4BijbXX85QKWu9jJfjho3LBAXNEGAEW3oWiGb+dotA6C6BzCTxL2/aLes7jlUeg== emittery@^0.8.1: version "0.8.1" @@ -1660,10 +1491,10 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== -fast-glob@^3.1.1: - version "3.2.7" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1" - integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q== +fast-glob@^3.2.9: + version "3.2.11" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.11.tgz#a1172ad95ceb8a16e20caa5c5e56480e5129c1d9" + integrity sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" @@ -1726,9 +1557,9 @@ flat-cache@^3.0.4: rimraf "^3.0.2" flatted@^3.1.0: - version "3.2.4" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.4.tgz#28d9969ea90661b5134259f312ab6aa7929ac5e2" - integrity sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw== + version "3.2.5" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.5.tgz#76c8584f4fc843db64702a6bd04ab7a8bd666da3" + integrity sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg== form-data@^3.0.0: version "3.0.1" @@ -1818,28 +1649,28 @@ globals@^11.1.0: integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== globals@^13.6.0, globals@^13.9.0: - version "13.12.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.12.0.tgz#4d733760304230a0082ed96e21e5c565f898089e" - integrity sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg== + version "13.13.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.13.0.tgz#ac32261060d8070e2719dd6998406e27d2b5727b" + integrity sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A== dependencies: type-fest "^0.20.2" globby@^11.0.4: - version "11.0.4" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" - integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg== + version "11.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" + integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== dependencies: array-union "^2.1.0" dir-glob "^3.0.1" - fast-glob "^3.1.1" - ignore "^5.1.4" - merge2 "^1.3.0" + fast-glob "^3.2.9" + ignore "^5.2.0" + merge2 "^1.4.1" slash "^3.0.0" graceful-fs@^4.2.9: - version "4.2.9" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96" - integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ== + version "4.2.10" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" + integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== has-flag@^3.0.0: version "3.0.0" @@ -1923,9 +1754,9 @@ import-fresh@^3.0.0, import-fresh@^3.2.1: resolve-from "^4.0.0" import-local@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.3.tgz#4d51c2c495ca9393da259ec66b62e022920211e0" - integrity sha512-bE9iaUY3CXH8Cwfan/abDKAxe1KGT9kyGsBPqf6DMK/z0a2OzAsrukeYNgIH6cH5Xr452jb1TUL8rSfCLjZ9uA== + version "3.1.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.1.0.tgz#b4479df8a5fd44f6cdce24070675676063c95cb4" + integrity sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg== dependencies: pkg-dir "^4.2.0" resolve-cwd "^3.0.0" @@ -1953,10 +1784,10 @@ is-arrayish@^0.2.1: resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= -is-core-module@^2.2.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.0.tgz#0321336c3d0925e497fd97f5d95cb114a5ccd548" - integrity sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw== +is-core-module@^2.8.1: + version "2.8.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.1.tgz#f59fdfca701d5879d0a6b100a40aa1560ce27211" + integrity sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA== dependencies: has "^1.0.3" @@ -2042,9 +1873,9 @@ istanbul-lib-source-maps@^4.0.0: source-map "^0.6.1" istanbul-reports@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.3.tgz#4bcae3103b94518117930d51283690960b50d3c2" - integrity sha512-x9LtDVtfm/t1GFiLl3NffC7hz+I1ragvgX1P/Lg1NlIagifZDKUkuuaAxH/qpwj2IuEfD8G2Bs/UKp+sZ/pKkg== + version "3.1.4" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.4.tgz#1b6f068ecbc6c331040aab5741991273e609e40c" + integrity sha512-r1/DshN4KSE7xWEknZLLLLDn5CJybV3nw01VTkp6D5jzLuELlcbudfj/eSQFvrKsJuTVCGnePO7ho82Nw9zzfw== dependencies: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" @@ -2528,11 +2359,9 @@ json-stable-stringify-without-jsonify@^1.0.1: integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= json5@2.x, json5@^2.1.2: - version "2.2.0" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" - integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== - dependencies: - minimist "^1.2.5" + version "2.2.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" + integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== kleur@^3.0.3: version "3.0.3" @@ -2618,30 +2447,30 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -merge2@^1.3.0: +merge2@^1.3.0, merge2@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== micromatch@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" - integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== + version "4.0.5" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" + integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== dependencies: - braces "^3.0.1" - picomatch "^2.2.3" + braces "^3.0.2" + picomatch "^2.3.1" -mime-db@1.51.0: - version "1.51.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c" - integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g== +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== mime-types@^2.1.12: - version "2.1.34" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24" - integrity sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A== + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: - mime-db "1.51.0" + mime-db "1.52.0" mimic-fn@^2.1.0: version "2.1.0" @@ -2649,17 +2478,12 @@ mimic-fn@^2.1.0: integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== dependencies: brace-expansion "^1.1.7" -minimist@^1.2.5: - version "1.2.6" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" - integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== - mri@^1.1.5: version "1.2.0" resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b" @@ -2691,10 +2515,10 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= -node-releases@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.1.tgz#3d1d395f204f1f2f29a54358b9fb678765ad2fc5" - integrity sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA== +node-releases@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.2.tgz#7139fe71e2f4f11b47d4d2986aaf8c48699e0c01" + integrity sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg== normalize-path@^3.0.0: version "3.0.0" @@ -2807,7 +2631,7 @@ path-key@^3.0.0, path-key@^3.1.0: resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== -path-parse@^1.0.6: +path-parse@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== @@ -2822,15 +2646,15 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== -picomatch@^2.0.4, picomatch@^2.2.3: - version "2.3.0" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" - integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== +picomatch@^2.0.4, picomatch@^2.2.3, picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== pirates@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.4.tgz#07df81e61028e402735cdd49db701e4885b4e6e6" - integrity sha512-ZIrVPH+A52Dw84R0L3/VS9Op04PuQ2SEoJL6bkshmiTic/HldyW9Tf7oH5mhJZBK7NmDx27vSMrYEXPXclpDKw== + version "4.0.5" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b" + integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ== pkg-dir@^4.2.0: version "4.2.0" @@ -2944,12 +2768,13 @@ resolve.exports@^1.1.0: integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== resolve@^1.20.0: - version "1.20.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" - integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== + version "1.22.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198" + integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== dependencies: - is-core-module "^2.2.0" - path-parse "^1.0.6" + is-core-module "^2.8.1" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" reusify@^1.0.4: version "1.0.4" @@ -3012,9 +2837,9 @@ shebang-regex@^3.0.0: integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== signal-exit@^3.0.2, signal-exit@^3.0.3: - version "3.0.5" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.5.tgz#9e3e8cc0c75a99472b44321033a7702e7738252f" - integrity sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ== + version "3.0.7" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== sisteransi@^1.0.5: version "1.0.5" @@ -3027,9 +2852,9 @@ slash@^3.0.0: integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== source-map-support@^0.5.6: - version "0.5.20" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9" - integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw== + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -3129,6 +2954,11 @@ supports-hyperlinks@^2.0.0: has-flag "^4.0.0" supports-color "^7.0.0" +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + symbol-tree@^3.2.4: version "3.2.4" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" @@ -3303,9 +3133,9 @@ v8-compile-cache@^2.0.3: integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== v8-to-istanbul@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.0.tgz#0aeb763894f1a0a1676adf8a8b7612a38902446c" - integrity sha512-/PRhfd8aTNp9Ggr62HPzXg2XasNFGy5PBt0Rp04du7/8GNNSgxFL6WBTkgMKSL9bFjH+8kKEG3f37FmxiTqUUA== + version "8.1.1" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz#77b752fd3975e31bbcef938f85e9bd1c7a8d60ed" + integrity sha512-FGtKtv3xIpR6BYhvgH8MI/y78oT7d8Au3ww4QIxymrCtZEh5b8gCw2siywE+puhEmuWKDtmfrvF5UlB298ut3w== dependencies: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" @@ -3400,9 +3230,9 @@ write-file-atomic@^3.0.0: typedarray-to-buffer "^3.1.5" ws@^7.4.6: - version "7.5.5" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.5.tgz#8b4bc4af518cfabd0473ae4f99144287b33eb881" - integrity sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w== + version "7.5.7" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.7.tgz#9e0ac77ee50af70d58326ecff7e85eb3fa375e67" + integrity sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A== xml-name-validator@^3.0.0: version "3.0.0" From 143833f73062ffd38534b759017024edb5c7f31b Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 4 Apr 2022 20:18:25 -0400 Subject: [PATCH 553/785] Fix up `return` when nodes return arrays of docs. --- CHANGELOG.md | 1 + src/ruby/nodes/return.ts | 14 +++++++++----- test/js/ruby/nodes/return.test.ts | 8 ++++++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8bf5302..d31e151f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#1042](https://github.com/prettier/plugin-ruby/issues/1042) - JoshuaKGoldberg, kddnewton - Ensure blocks are printed correctly when there are trailing comments on the `do` keyword. - [#1134](https://github.com/prettier/plugin-ruby/pull/1134) - mhssmnn - Fix piping for STDIN to the gem process. - [#1167](https://github.com/prettier/plugin-ruby/pull/1167) - dleavitt - More consistent assignment indentation. +- [#1074](https://github.com/prettier/plugin-ruby/issues/1074) - wagenet, kddnewton - Fix up `return` when nodes return arrays of docs. ### Removed diff --git a/src/ruby/nodes/return.ts b/src/ruby/nodes/return.ts index 1521f612..53203211 100644 --- a/src/ruby/nodes/return.ts +++ b/src/ruby/nodes/return.ts @@ -42,6 +42,7 @@ function canSkipParens(paren: Ruby.Paren) { export const printReturn: Plugin.Printer = (path, opts, print) => { const node = path.getValue(); let parts: Plugin.Doc | Plugin.Doc[] = ""; + let joining = false; if (node.args.type === "args_add_block") { const args = node.args.args; @@ -83,20 +84,23 @@ export const printReturn: Plugin.Printer = (path, opts, print) => { // possible that you're printing an array nested under some parentheses, in // which case we still want to descend down that far. For example, // return([1, 2, 3]) should print as return 1, 2, 3. - parts = (path as any).call(print, ...steps); + parts = (path as any).call((targetPath: Plugin.Path) => { + const target = targetPath.getValue(); + joining = target.type === "args" || target.type === "args_add_block"; + + return print(targetPath); + }, ...steps); } // If we didn't hit any of our special cases, then just print out the // arguments normally here. if (parts === "") { parts = path.call(print, "args"); + joining = true; } const useBrackets = Array.isArray(parts) && parts.length > 1; - - // If we got the value straight out of the parens, then `parts` would only - // be a singular doc as opposed to an array. - const value = Array.isArray(parts) ? join([",", line], parts) : parts; + const value = joining ? join([",", line], parts) : parts; return group([ "return", diff --git a/test/js/ruby/nodes/return.test.ts b/test/js/ruby/nodes/return.test.ts index 1a20f7b2..dc2f6e03 100644 --- a/test/js/ruby/nodes/return.test.ts +++ b/test/js/ruby/nodes/return.test.ts @@ -92,4 +92,12 @@ describe("return", () => { expect(content).toMatchFormat(); }); + + test("returning a value with a modifier if", () => { + const content = ruby(` + return :inactive if given_date.before?(first_event_date) + `); + + expect(content).toMatchFormat(); + }); }); From e0065af129e11b18cca9076834d4836df7f48d14 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 4 Apr 2022 20:27:34 -0400 Subject: [PATCH 554/785] Update CHANGELOG --- .github/workflows/main.yml | 1 - CHANGELOG.md | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c7d76b3a..f9fb05b4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,6 @@ jobs: - "2.6" - "2.7" - "3.0" - - "3.1" runs-on: ${{ matrix.platform }} env: PLUGIN_RUBY_CI: true diff --git a/CHANGELOG.md b/CHANGELOG.md index d31e151f..9f69534d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Added -- kddnewton - The ability to set the `PRETTIER_RUBY_TIMEOUT_MS` environment variable to control how long to wait for the parser server to spin up. +- [#1065](https://github.com/prettier/plugin-ruby/issues/1065) - langalex, kddnewton - The ability to set the `PRETTIER_RUBY_TIMEOUT_MS` environment variable to control how long to wait for the parser server to spin up. +- [#1173](https://github.com/prettier/plugin-ruby/pull/1173) - dleavitt - Support for RBS 2.x on Ruby 3.1. ### Changed From cffe655473c518072bb99324d12d02664a783d52 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 4 Apr 2022 20:33:54 -0400 Subject: [PATCH 555/785] Bump to v2.1.0 --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f69534d..17796c03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [2.1.0] - 2022-04-04 + ### Added - [#1065](https://github.com/prettier/plugin-ruby/issues/1065) - langalex, kddnewton - The ability to set the `PRETTIER_RUBY_TIMEOUT_MS` environment variable to control how long to wait for the parser server to spin up. @@ -1206,7 +1208,8 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v2.0.0...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v2.1.0...HEAD +[2.1.0]: https://github.com/prettier/plugin-ruby/compare/v2.0.0...v2.1.0 [2.0.0]: https://github.com/prettier/plugin-ruby/compare/v2.0.0-rc4...v2.0.0 [2.0.0-rc4]: https://github.com/prettier/plugin-ruby/compare/v2.0.0-rc3...v2.0.0-rc4 [2.0.0-rc3]: https://github.com/prettier/plugin-ruby/compare/v2.0.0-rc2...v2.0.0-rc3 diff --git a/package.json b/package.json index 2a4317c2..fd51b2bf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "2.0.0", + "version": "2.1.0", "description": "prettier plugin for the Ruby programming language", "main": "dist/plugin.js", "scripts": { From 22fb1cd784f3c43cd230e3fa158f2f33abc2824b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 12:01:49 +0000 Subject: [PATCH 556/785] Bump eslint from 8.12.0 to 8.13.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.12.0 to 8.13.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.12.0...v8.13.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 04a60927..a7ba538e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1358,9 +1358,9 @@ eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.3.0: integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.1.0: - version "8.12.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.12.0.tgz#c7a5bd1cfa09079aae64c9076c07eada66a46e8e" - integrity sha512-it1oBL9alZg1S8UycLm5YDMAkIhtH6FtAzuZs6YvoGVldWjbS08BkAdb/ymP9LlAyq8koANu32U7Ib/w+UNh8Q== + version "8.13.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.13.0.tgz#6fcea43b6811e655410f5626cfcf328016badcd7" + integrity sha512-D+Xei61eInqauAyTJ6C0q6x9mx7kTUC1KZ0m0LSEexR0V+e94K12LmWX076ZIsldwfQ2RONdaJe0re0TRGQbRQ== dependencies: "@eslint/eslintrc" "^1.2.1" "@humanwhocodes/config-array" "^0.9.2" From 99378e5734621591f48c39f59c1ead846760b5e2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 12:01:56 +0000 Subject: [PATCH 557/785] Bump @types/prettier from 2.4.4 to 2.6.0 Bumps [@types/prettier](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/prettier) from 2.4.4 to 2.6.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/prettier) --- updated-dependencies: - dependency-name: "@types/prettier" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 04a60927..5ed44c34 100644 --- a/yarn.lock +++ b/yarn.lock @@ -680,9 +680,9 @@ integrity sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": - version "2.4.4" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.4.tgz#5d9b63132df54d8909fce1c3f8ca260fdd693e17" - integrity sha512-ReVR2rLTV1kvtlWFyuot+d1pkpG2Fw/XKE3PDAdj57rbM97ttSp9JZ2UsP+2EHTylra9cUf6JA7tGwW1INzUrA== + version "2.6.0" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.6.0.tgz#efcbd41937f9ae7434c714ab698604822d890759" + integrity sha512-G/AdOadiZhnJp0jXCaBQU449W2h716OW/EoXeYkCytxKL06X1WCXB4DZpp8TpZ8eyIJVS1cw4lrlkkSYU21cDw== "@types/stack-utils@^2.0.0": version "2.0.1" From 2d3611ad99c9b424ec57e3b2a077ee6a193a3656 Mon Sep 17 00:00:00 2001 From: Nicolas Goutay Date: Mon, 11 Apr 2022 14:47:25 +0000 Subject: [PATCH 558/785] Fix additional issues with AlpineJS syntax in haml In PR https://github.com/prettier/plugin-ruby/pull/1097, I added support for haml attributes starting with '@', which are extensively used in AlpineJS. However, the PR was incomplete, and did not work in all cases. This PR adds two jest test cases that fail with the current code, and a fix that passes all specs. The fix also collocates @-attributes support with other haml edge cases (in the printer) instead of hooking into a separate part of the codebase. --- src/haml/parser.rb | 6 ------ src/haml/printer.ts | 2 +- test/js/haml/tag.test.ts | 2 ++ 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/haml/parser.rb b/src/haml/parser.rb index 84d84e3c..cd8d9796 100644 --- a/src/haml/parser.rb +++ b/src/haml/parser.rb @@ -44,12 +44,6 @@ def parse_value(string, level = 0) if hash # Explicitly not using Enumerable#to_h here to support Ruby 2.5 hash.each_with_object({}) do |(key, value), response| - # For attributes that starts with @, wrap the attribute in quotes - # For other attributes, remove the quotes - # AlpineJS uses @-attributes - # {'type': 'submit'} => {type: 'submit'} - # {'@click': 'open'} => {'@click': 'open'} - key = "\'#{key}\'" if key.start_with?('@') response[key] = parse_value(value, level + 1) end else diff --git a/src/haml/printer.ts b/src/haml/printer.ts index 3a964a09..9cf1afef 100644 --- a/src/haml/printer.ts +++ b/src/haml/printer.ts @@ -31,7 +31,7 @@ function printHashKey(key: string, opts: Plugin.Options) { let quoted = key; const joiner = opts.rubyHashLabel ? ":" : " =>"; - if (key.includes(":") || key.includes("-")) { + if (key.includes(":") || key.includes("-") || key.includes('@')) { const quote = opts.rubySingleQuote ? "'" : '"'; quoted = `${quote}${key}${quote}`; } diff --git a/test/js/haml/tag.test.ts b/test/js/haml/tag.test.ts index 5ec61d8f..62a7efb7 100644 --- a/test/js/haml/tag.test.ts +++ b/test/js/haml/tag.test.ts @@ -106,6 +106,8 @@ describe("tag", () => { test("attributes prefixed with @", () => { expect(haml("%span{'@click': 'open = true'}")).toMatchFormat(); + expect(haml("%span{'@click.outside': 'open = true'}")).toMatchFormat(); + expect(haml("%span{'@keydown.arrow-up.prevent': 'open = true'}")).toMatchFormat(); }); }); From fadd47d85bf8636cc3470ef9525baa33a06e68e8 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 11 Apr 2022 12:47:06 -0400 Subject: [PATCH 559/785] Fix up lint --- src/haml/printer.ts | 2 +- test/js/haml/tag.test.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/haml/printer.ts b/src/haml/printer.ts index 9cf1afef..78aa4c4e 100644 --- a/src/haml/printer.ts +++ b/src/haml/printer.ts @@ -31,7 +31,7 @@ function printHashKey(key: string, opts: Plugin.Options) { let quoted = key; const joiner = opts.rubyHashLabel ? ":" : " =>"; - if (key.includes(":") || key.includes("-") || key.includes('@')) { + if (key.includes(":") || key.includes("-") || key.includes("@")) { const quote = opts.rubySingleQuote ? "'" : '"'; quoted = `${quote}${key}${quote}`; } diff --git a/test/js/haml/tag.test.ts b/test/js/haml/tag.test.ts index 62a7efb7..6ca2911f 100644 --- a/test/js/haml/tag.test.ts +++ b/test/js/haml/tag.test.ts @@ -107,7 +107,9 @@ describe("tag", () => { test("attributes prefixed with @", () => { expect(haml("%span{'@click': 'open = true'}")).toMatchFormat(); expect(haml("%span{'@click.outside': 'open = true'}")).toMatchFormat(); - expect(haml("%span{'@keydown.arrow-up.prevent': 'open = true'}")).toMatchFormat(); + expect( + haml("%span{'@keydown.arrow-up.prevent': 'open = true'}") + ).toMatchFormat(); }); }); From 0a07b6f611a79036db620e25600b7286b19ebc86 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Apr 2022 14:10:18 +0000 Subject: [PATCH 560/785] Bump @typescript-eslint/parser from 5.18.0 to 5.19.0 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.18.0 to 5.19.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.19.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index e3d07feb..85f6c4ad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -717,13 +717,13 @@ tsutils "^3.21.0" "@typescript-eslint/parser@^5.18.0": - version "5.18.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.18.0.tgz#2bcd4ff21df33621df33e942ccb21cb897f004c6" - integrity sha512-+08nYfurBzSSPndngnHvFw/fniWYJ5ymOrn/63oMIbgomVQOvIDhBoJmYZ9lwQOCnQV9xHGvf88ze3jFGUYooQ== + version "5.19.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.19.0.tgz#05e587c1492868929b931afa0cb5579b0f728e75" + integrity sha512-yhktJjMCJX8BSBczh1F/uY8wGRYrBeyn84kH6oyqdIJwTGKmzX5Qiq49LRQ0Jh0LXnWijEziSo6BRqny8nqLVQ== dependencies: - "@typescript-eslint/scope-manager" "5.18.0" - "@typescript-eslint/types" "5.18.0" - "@typescript-eslint/typescript-estree" "5.18.0" + "@typescript-eslint/scope-manager" "5.19.0" + "@typescript-eslint/types" "5.19.0" + "@typescript-eslint/typescript-estree" "5.19.0" debug "^4.3.2" "@typescript-eslint/scope-manager@5.18.0": @@ -734,6 +734,14 @@ "@typescript-eslint/types" "5.18.0" "@typescript-eslint/visitor-keys" "5.18.0" +"@typescript-eslint/scope-manager@5.19.0": + version "5.19.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.19.0.tgz#97e59b0bcbcb54dbcdfba96fc103b9020bbe9cb4" + integrity sha512-Fz+VrjLmwq5fbQn5W7cIJZ066HxLMKvDEmf4eu1tZ8O956aoX45jAuBB76miAECMTODyUxH61AQM7q4/GOMQ5g== + dependencies: + "@typescript-eslint/types" "5.19.0" + "@typescript-eslint/visitor-keys" "5.19.0" + "@typescript-eslint/type-utils@5.18.0": version "5.18.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.18.0.tgz#62dbfc8478abf36ba94a90ddf10be3cc8e471c74" @@ -748,6 +756,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.18.0.tgz#4f0425d85fdb863071680983853c59a62ce9566e" integrity sha512-bhV1+XjM+9bHMTmXi46p1Led5NP6iqQcsOxgx7fvk6gGiV48c6IynY0apQb7693twJDsXiVzNXTflhplmaiJaw== +"@typescript-eslint/types@5.19.0": + version "5.19.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.19.0.tgz#12d3d600d754259da771806ee8b2c842d3be8d12" + integrity sha512-zR1ithF4Iyq1wLwkDcT+qFnhs8L5VUtjgac212ftiOP/ZZUOCuuF2DeGiZZGQXGoHA50OreZqLH5NjDcDqn34w== + "@typescript-eslint/typescript-estree@5.18.0": version "5.18.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.18.0.tgz#6498e5ee69a32e82b6e18689e2f72e4060986474" @@ -761,6 +774,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.19.0": + version "5.19.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.19.0.tgz#fc987b8f62883f9ea6a5b488bdbcd20d33c0025f" + integrity sha512-dRPuD4ocXdaE1BM/dNR21elSEUPKaWgowCA0bqJ6YbYkvtrPVEvZ+zqcX5a8ECYn3q5iBSSUcBBD42ubaOp0Hw== + dependencies: + "@typescript-eslint/types" "5.19.0" + "@typescript-eslint/visitor-keys" "5.19.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.18.0": version "5.18.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.18.0.tgz#27fc84cf95c1a96def0aae31684cb43a37e76855" @@ -781,6 +807,14 @@ "@typescript-eslint/types" "5.18.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.19.0": + version "5.19.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.19.0.tgz#c84ebc7f6c744707a361ca5ec7f7f64cd85b8af6" + integrity sha512-Ym7zZoMDZcAKWsULi2s7UMLREdVQdScPQ/fKWMYefarCztWlHPFVJo8racf8R0Gc8FAEJ2eD4of8As1oFtnQlQ== + dependencies: + "@typescript-eslint/types" "5.19.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 f995f10be072c7e76dcd4a15c28a3e4197202997 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Apr 2022 14:19:42 +0000 Subject: [PATCH 561/785] Bump @typescript-eslint/eslint-plugin from 5.18.0 to 5.19.0 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.18.0 to 5.19.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.19.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 70 ++++++++++++++----------------------------------------- 1 file changed, 18 insertions(+), 52 deletions(-) diff --git a/yarn.lock b/yarn.lock index 85f6c4ad..40a09510 100644 --- a/yarn.lock +++ b/yarn.lock @@ -702,13 +702,13 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.18.0": - version "5.18.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.18.0.tgz#950df411cec65f90d75d6320a03b2c98f6c3af7d" - integrity sha512-tzrmdGMJI/uii9/V6lurMo4/o+dMTKDH82LkNjhJ3adCW22YQydoRs5MwTiqxGF9CSYxPxQ7EYb4jLNlIs+E+A== + version "5.19.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.19.0.tgz#9608a4b6d0427104bccf132f058cba629a6553c0" + integrity sha512-w59GpFqDYGnWFim9p6TGJz7a3qWeENJuAKCqjGSx+Hq/bwq3RZwXYqy98KIfN85yDqz9mq6QXiY5h0FjGQLyEg== dependencies: - "@typescript-eslint/scope-manager" "5.18.0" - "@typescript-eslint/type-utils" "5.18.0" - "@typescript-eslint/utils" "5.18.0" + "@typescript-eslint/scope-manager" "5.19.0" + "@typescript-eslint/type-utils" "5.19.0" + "@typescript-eslint/utils" "5.19.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -726,14 +726,6 @@ "@typescript-eslint/typescript-estree" "5.19.0" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.18.0": - version "5.18.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.18.0.tgz#a7d7b49b973ba8cebf2a3710eefd457ef2fb5505" - integrity sha512-C0CZML6NyRDj+ZbMqh9FnPscg2PrzSaVQg3IpTmpe0NURMVBXlghGZgMYqBw07YW73i0MCqSDqv2SbywnCS8jQ== - dependencies: - "@typescript-eslint/types" "5.18.0" - "@typescript-eslint/visitor-keys" "5.18.0" - "@typescript-eslint/scope-manager@5.19.0": version "5.19.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.19.0.tgz#97e59b0bcbcb54dbcdfba96fc103b9020bbe9cb4" @@ -742,38 +734,20 @@ "@typescript-eslint/types" "5.19.0" "@typescript-eslint/visitor-keys" "5.19.0" -"@typescript-eslint/type-utils@5.18.0": - version "5.18.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.18.0.tgz#62dbfc8478abf36ba94a90ddf10be3cc8e471c74" - integrity sha512-vcn9/6J5D6jtHxpEJrgK8FhaM8r6J1/ZiNu70ZUJN554Y3D9t3iovi6u7JF8l/e7FcBIxeuTEidZDR70UuCIfA== +"@typescript-eslint/type-utils@5.19.0": + version "5.19.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.19.0.tgz#80f2125b0dfe82494bbae1ea99f1c0186d420282" + integrity sha512-O6XQ4RI4rQcBGshTQAYBUIGsKqrKeuIOz9v8bckXZnSeXjn/1+BDZndHLe10UplQeJLXDNbaZYrAytKNQO2T4Q== dependencies: - "@typescript-eslint/utils" "5.18.0" + "@typescript-eslint/utils" "5.19.0" debug "^4.3.2" tsutils "^3.21.0" -"@typescript-eslint/types@5.18.0": - version "5.18.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.18.0.tgz#4f0425d85fdb863071680983853c59a62ce9566e" - integrity sha512-bhV1+XjM+9bHMTmXi46p1Led5NP6iqQcsOxgx7fvk6gGiV48c6IynY0apQb7693twJDsXiVzNXTflhplmaiJaw== - "@typescript-eslint/types@5.19.0": version "5.19.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.19.0.tgz#12d3d600d754259da771806ee8b2c842d3be8d12" integrity sha512-zR1ithF4Iyq1wLwkDcT+qFnhs8L5VUtjgac212ftiOP/ZZUOCuuF2DeGiZZGQXGoHA50OreZqLH5NjDcDqn34w== -"@typescript-eslint/typescript-estree@5.18.0": - version "5.18.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.18.0.tgz#6498e5ee69a32e82b6e18689e2f72e4060986474" - integrity sha512-wa+2VAhOPpZs1bVij9e5gyVu60ReMi/KuOx4LKjGx2Y3XTNUDJgQ+5f77D49pHtqef/klglf+mibuHs9TrPxdQ== - dependencies: - "@typescript-eslint/types" "5.18.0" - "@typescript-eslint/visitor-keys" "5.18.0" - debug "^4.3.2" - globby "^11.0.4" - is-glob "^4.0.3" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.19.0": version "5.19.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.19.0.tgz#fc987b8f62883f9ea6a5b488bdbcd20d33c0025f" @@ -787,26 +761,18 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/utils@5.18.0": - version "5.18.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.18.0.tgz#27fc84cf95c1a96def0aae31684cb43a37e76855" - integrity sha512-+hFGWUMMri7OFY26TsOlGa+zgjEy1ssEipxpLjtl4wSll8zy85x0GrUSju/FHdKfVorZPYJLkF3I4XPtnCTewA== +"@typescript-eslint/utils@5.19.0": + version "5.19.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.19.0.tgz#fe87f1e3003d9973ec361ed10d36b4342f1ded1e" + integrity sha512-ZuEckdupXpXamKvFz/Ql8YnePh2ZWcwz7APICzJL985Rp5C2AYcHO62oJzIqNhAMtMK6XvrlBTZeNG8n7gS3lQ== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.18.0" - "@typescript-eslint/types" "5.18.0" - "@typescript-eslint/typescript-estree" "5.18.0" + "@typescript-eslint/scope-manager" "5.19.0" + "@typescript-eslint/types" "5.19.0" + "@typescript-eslint/typescript-estree" "5.19.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.18.0": - version "5.18.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.18.0.tgz#c7c07709823804171d569017f3b031ced7253e60" - integrity sha512-Hf+t+dJsjAKpKSkg3EHvbtEpFFb/1CiOHnvI8bjHgOD4/wAw3gKrA0i94LrbekypiZVanJu3McWJg7rWDMzRTg== - dependencies: - "@typescript-eslint/types" "5.18.0" - eslint-visitor-keys "^3.0.0" - "@typescript-eslint/visitor-keys@5.19.0": version "5.19.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.19.0.tgz#c84ebc7f6c744707a361ca5ec7f7f64cd85b8af6" From 9981128f879fcfbfe192c7a6797bdb009c538017 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 13 Apr 2022 09:47:49 -0400 Subject: [PATCH 562/785] Fix for #1198 --- CHANGELOG.md | 4 ++++ src/parser/server.rb | 5 ++++- src/ruby/nodes/blocks.ts | 13 +++++++++++-- src/utils/getChildNodes.ts | 3 ++- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17796c03..138d08c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Changed + +- [#1198](https://github.com/prettier/plugin-ruby/issues/1198) - pas-f, kddnewton - Fix crashes on JRuby with do blocks. + ## [2.1.0] - 2022-04-04 ### Added diff --git a/src/parser/server.rb b/src/parser/server.rb index 39c06f7c..f46cf8ef 100644 --- a/src/parser/server.rb +++ b/src/parser/server.rb @@ -19,7 +19,10 @@ module Prettier quit = false trap(:INT) { quit = true } trap(:TERM) { quit = true } -trap(:QUIT) { quit = true } if Signal.list.key?('QUIT') + +if Signal.list.key?('QUIT') && RUBY_ENGINE != 'jruby' + trap(:QUIT) { quit = true } +end # The information variable stores the actual connection information, which will # either be an IP address and port or a path to a unix socket file. diff --git a/src/ruby/nodes/blocks.ts b/src/ruby/nodes/blocks.ts index 3324709c..27f1ec2e 100644 --- a/src/ruby/nodes/blocks.ts +++ b/src/ruby/nodes/blocks.ts @@ -49,8 +49,17 @@ type Block = Ruby.BraceBlock | Ruby.DoBlock; function printBlock(braces: boolean): Plugin.Printer { return function printBlockWithBraces(path, opts, print) { const node = path.getValue(); - const stmts: Ruby.AnyNode[] = - node.type === "brace_block" ? node.stmts.body : node.bodystmt.stmts.body; + let stmts: Ruby.AnyNode[]; + + if (node.type === "brace_block") { + stmts = node.stmts.body; + } else if ((node as any).bodystmt.type === "statements") { + // This is here to fix an issue in JRuby where it doesn't correctly + // support rescue/else/ensure inside blocks. + stmts = (node as any).bodystmt.body; + } else { + stmts = node.bodystmt.stmts.body; + } let doBlockBody: Plugin.Doc = ""; if ( diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts index 486762d0..e6c771bd 100644 --- a/src/utils/getChildNodes.ts +++ b/src/utils/getChildNodes.ts @@ -8,12 +8,13 @@ function throwBadNode(node: AnyNode) { throw new Error(`Unknown node ${node.type}`); } -function getChildNodes(node: AnyNode): ChildNode[] { +function getChildNodes(node: AnyNode | Ruby.Comment): ChildNode[] { switch (node.type) { case "CHAR": case "__end__": case "backref": case "backtick": + case "comment": case "const": case "cvar": case "float": From 9266a4d9e2f167c7c7a647e138450fee7559a618 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Apr 2022 12:01:31 +0000 Subject: [PATCH 563/785] Bump @types/node from 17.0.23 to 17.0.24 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.23 to 17.0.24. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 40a09510..86106a6a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -675,9 +675,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^17.0.0": - version "17.0.23" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.23.tgz#3b41a6e643589ac6442bdbd7a4a3ded62f33f7da" - integrity sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw== + version "17.0.24" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.24.tgz#20ba1bf69c1b4ab405c7a01e950c4f446b05029f" + integrity sha512-aveCYRQbgTH9Pssp1voEP7HiuWlD2jW2BO56w+bVrJn04i61yh6mRfoKO6hEYQD9vF+W8Chkwc6j1M36uPkx4g== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.6.0" From 2f405032933065970ffab328d55cbcff24f5c306 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Apr 2022 12:01:47 +0000 Subject: [PATCH 564/785] Bump @typescript-eslint/parser from 5.19.0 to 5.20.0 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.19.0 to 5.20.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.20.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index 86106a6a..043d8397 100644 --- a/yarn.lock +++ b/yarn.lock @@ -717,13 +717,13 @@ tsutils "^3.21.0" "@typescript-eslint/parser@^5.18.0": - version "5.19.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.19.0.tgz#05e587c1492868929b931afa0cb5579b0f728e75" - integrity sha512-yhktJjMCJX8BSBczh1F/uY8wGRYrBeyn84kH6oyqdIJwTGKmzX5Qiq49LRQ0Jh0LXnWijEziSo6BRqny8nqLVQ== + version "5.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.20.0.tgz#4991c4ee0344315c2afc2a62f156565f689c8d0b" + integrity sha512-UWKibrCZQCYvobmu3/N8TWbEeo/EPQbS41Ux1F9XqPzGuV7pfg6n50ZrFo6hryynD8qOTTfLHtHjjdQtxJ0h/w== dependencies: - "@typescript-eslint/scope-manager" "5.19.0" - "@typescript-eslint/types" "5.19.0" - "@typescript-eslint/typescript-estree" "5.19.0" + "@typescript-eslint/scope-manager" "5.20.0" + "@typescript-eslint/types" "5.20.0" + "@typescript-eslint/typescript-estree" "5.20.0" debug "^4.3.2" "@typescript-eslint/scope-manager@5.19.0": @@ -734,6 +734,14 @@ "@typescript-eslint/types" "5.19.0" "@typescript-eslint/visitor-keys" "5.19.0" +"@typescript-eslint/scope-manager@5.20.0": + version "5.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.20.0.tgz#79c7fb8598d2942e45b3c881ced95319818c7980" + integrity sha512-h9KtuPZ4D/JuX7rpp1iKg3zOH0WNEa+ZIXwpW/KWmEFDxlA/HSfCMhiyF1HS/drTICjIbpA6OqkAhrP/zkCStg== + dependencies: + "@typescript-eslint/types" "5.20.0" + "@typescript-eslint/visitor-keys" "5.20.0" + "@typescript-eslint/type-utils@5.19.0": version "5.19.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.19.0.tgz#80f2125b0dfe82494bbae1ea99f1c0186d420282" @@ -748,6 +756,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.19.0.tgz#12d3d600d754259da771806ee8b2c842d3be8d12" integrity sha512-zR1ithF4Iyq1wLwkDcT+qFnhs8L5VUtjgac212ftiOP/ZZUOCuuF2DeGiZZGQXGoHA50OreZqLH5NjDcDqn34w== +"@typescript-eslint/types@5.20.0": + version "5.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.20.0.tgz#fa39c3c2aa786568302318f1cb51fcf64258c20c" + integrity sha512-+d8wprF9GyvPwtoB4CxBAR/s0rpP25XKgnOvMf/gMXYDvlUC3rPFHupdTQ/ow9vn7UDe5rX02ovGYQbv/IUCbg== + "@typescript-eslint/typescript-estree@5.19.0": version "5.19.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.19.0.tgz#fc987b8f62883f9ea6a5b488bdbcd20d33c0025f" @@ -761,6 +774,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.20.0": + version "5.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.20.0.tgz#ab73686ab18c8781bbf249c9459a55dc9417d6b0" + integrity sha512-36xLjP/+bXusLMrT9fMMYy1KJAGgHhlER2TqpUVDYUQg4w0q/NW/sg4UGAgVwAqb8V4zYg43KMUpM8vV2lve6w== + dependencies: + "@typescript-eslint/types" "5.20.0" + "@typescript-eslint/visitor-keys" "5.20.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.19.0": version "5.19.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.19.0.tgz#fe87f1e3003d9973ec361ed10d36b4342f1ded1e" @@ -781,6 +807,14 @@ "@typescript-eslint/types" "5.19.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.20.0": + version "5.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.20.0.tgz#70236b5c6b67fbaf8b2f58bf3414b76c1e826c2a" + integrity sha512-1flRpNF+0CAQkMNlTJ6L/Z5jiODG/e5+7mk6XwtPOUS3UrTz3UOiAg9jG2VtKsWI6rZQfy4C6a232QNRZTRGlg== + dependencies: + "@typescript-eslint/types" "5.20.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 8ac4ea596c071b326fd39dc6460f38718eed8291 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Apr 2022 12:01:55 +0000 Subject: [PATCH 565/785] Bump @types/node from 17.0.24 to 17.0.25 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.24 to 17.0.25. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 86106a6a..4ea8654f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -675,9 +675,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*", "@types/node@^17.0.0": - version "17.0.24" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.24.tgz#20ba1bf69c1b4ab405c7a01e950c4f446b05029f" - integrity sha512-aveCYRQbgTH9Pssp1voEP7HiuWlD2jW2BO56w+bVrJn04i61yh6mRfoKO6hEYQD9vF+W8Chkwc6j1M36uPkx4g== + version "17.0.25" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.25.tgz#527051f3c2f77aa52e5dc74e45a3da5fb2301448" + integrity sha512-wANk6fBrUwdpY4isjWrKTufkrXdu1D2YHCot2fD/DfWxF5sMrVSA+KN7ydckvaTCh0HiqX9IVl0L5/ZoXg5M7w== "@types/prettier@^2.1.5", "@types/prettier@^2.4.2": version "2.6.0" From a8c342d6caaed8a3a244660cba26be9615221ef4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Apr 2022 12:14:21 +0000 Subject: [PATCH 566/785] Bump @typescript-eslint/eslint-plugin from 5.19.0 to 5.20.0 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.19.0 to 5.20.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.20.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 70 ++++++++++++++----------------------------------------- 1 file changed, 18 insertions(+), 52 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7505951c..583a4071 100644 --- a/yarn.lock +++ b/yarn.lock @@ -702,13 +702,13 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.18.0": - version "5.19.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.19.0.tgz#9608a4b6d0427104bccf132f058cba629a6553c0" - integrity sha512-w59GpFqDYGnWFim9p6TGJz7a3qWeENJuAKCqjGSx+Hq/bwq3RZwXYqy98KIfN85yDqz9mq6QXiY5h0FjGQLyEg== + version "5.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.20.0.tgz#022531a639640ff3faafaf251d1ce00a2ef000a1" + integrity sha512-fapGzoxilCn3sBtC6NtXZX6+P/Hef7VDbyfGqTTpzYydwhlkevB+0vE0EnmHPVTVSy68GUncyJ/2PcrFBeCo5Q== dependencies: - "@typescript-eslint/scope-manager" "5.19.0" - "@typescript-eslint/type-utils" "5.19.0" - "@typescript-eslint/utils" "5.19.0" + "@typescript-eslint/scope-manager" "5.20.0" + "@typescript-eslint/type-utils" "5.20.0" + "@typescript-eslint/utils" "5.20.0" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -726,14 +726,6 @@ "@typescript-eslint/typescript-estree" "5.20.0" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.19.0": - version "5.19.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.19.0.tgz#97e59b0bcbcb54dbcdfba96fc103b9020bbe9cb4" - integrity sha512-Fz+VrjLmwq5fbQn5W7cIJZ066HxLMKvDEmf4eu1tZ8O956aoX45jAuBB76miAECMTODyUxH61AQM7q4/GOMQ5g== - dependencies: - "@typescript-eslint/types" "5.19.0" - "@typescript-eslint/visitor-keys" "5.19.0" - "@typescript-eslint/scope-manager@5.20.0": version "5.20.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.20.0.tgz#79c7fb8598d2942e45b3c881ced95319818c7980" @@ -742,38 +734,20 @@ "@typescript-eslint/types" "5.20.0" "@typescript-eslint/visitor-keys" "5.20.0" -"@typescript-eslint/type-utils@5.19.0": - version "5.19.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.19.0.tgz#80f2125b0dfe82494bbae1ea99f1c0186d420282" - integrity sha512-O6XQ4RI4rQcBGshTQAYBUIGsKqrKeuIOz9v8bckXZnSeXjn/1+BDZndHLe10UplQeJLXDNbaZYrAytKNQO2T4Q== +"@typescript-eslint/type-utils@5.20.0": + version "5.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.20.0.tgz#151c21cbe9a378a34685735036e5ddfc00223be3" + integrity sha512-WxNrCwYB3N/m8ceyoGCgbLmuZwupvzN0rE8NBuwnl7APgjv24ZJIjkNzoFBXPRCGzLNkoU/WfanW0exvp/+3Iw== dependencies: - "@typescript-eslint/utils" "5.19.0" + "@typescript-eslint/utils" "5.20.0" debug "^4.3.2" tsutils "^3.21.0" -"@typescript-eslint/types@5.19.0": - version "5.19.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.19.0.tgz#12d3d600d754259da771806ee8b2c842d3be8d12" - integrity sha512-zR1ithF4Iyq1wLwkDcT+qFnhs8L5VUtjgac212ftiOP/ZZUOCuuF2DeGiZZGQXGoHA50OreZqLH5NjDcDqn34w== - "@typescript-eslint/types@5.20.0": version "5.20.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.20.0.tgz#fa39c3c2aa786568302318f1cb51fcf64258c20c" integrity sha512-+d8wprF9GyvPwtoB4CxBAR/s0rpP25XKgnOvMf/gMXYDvlUC3rPFHupdTQ/ow9vn7UDe5rX02ovGYQbv/IUCbg== -"@typescript-eslint/typescript-estree@5.19.0": - version "5.19.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.19.0.tgz#fc987b8f62883f9ea6a5b488bdbcd20d33c0025f" - integrity sha512-dRPuD4ocXdaE1BM/dNR21elSEUPKaWgowCA0bqJ6YbYkvtrPVEvZ+zqcX5a8ECYn3q5iBSSUcBBD42ubaOp0Hw== - dependencies: - "@typescript-eslint/types" "5.19.0" - "@typescript-eslint/visitor-keys" "5.19.0" - debug "^4.3.2" - globby "^11.0.4" - is-glob "^4.0.3" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.20.0": version "5.20.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.20.0.tgz#ab73686ab18c8781bbf249c9459a55dc9417d6b0" @@ -787,26 +761,18 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/utils@5.19.0": - version "5.19.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.19.0.tgz#fe87f1e3003d9973ec361ed10d36b4342f1ded1e" - integrity sha512-ZuEckdupXpXamKvFz/Ql8YnePh2ZWcwz7APICzJL985Rp5C2AYcHO62oJzIqNhAMtMK6XvrlBTZeNG8n7gS3lQ== +"@typescript-eslint/utils@5.20.0": + version "5.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.20.0.tgz#b8e959ed11eca1b2d5414e12417fd94cae3517a5" + integrity sha512-lHONGJL1LIO12Ujyx8L8xKbwWSkoUKFSO+0wDAqGXiudWB2EO7WEUT+YZLtVbmOmSllAjLb9tpoIPwpRe5Tn6w== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.19.0" - "@typescript-eslint/types" "5.19.0" - "@typescript-eslint/typescript-estree" "5.19.0" + "@typescript-eslint/scope-manager" "5.20.0" + "@typescript-eslint/types" "5.20.0" + "@typescript-eslint/typescript-estree" "5.20.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.19.0": - version "5.19.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.19.0.tgz#c84ebc7f6c744707a361ca5ec7f7f64cd85b8af6" - integrity sha512-Ym7zZoMDZcAKWsULi2s7UMLREdVQdScPQ/fKWMYefarCztWlHPFVJo8racf8R0Gc8FAEJ2eD4of8As1oFtnQlQ== - dependencies: - "@typescript-eslint/types" "5.19.0" - eslint-visitor-keys "^3.0.0" - "@typescript-eslint/visitor-keys@5.20.0": version "5.20.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.20.0.tgz#70236b5c6b67fbaf8b2f58bf3414b76c1e826c2a" From c16f7fcc3295976477d291002894ce4d85aafc76 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 6 Apr 2022 21:43:29 -0400 Subject: [PATCH 567/785] Swap HAML --- src/haml/embed.ts | 75 ---------------------------------- src/haml/parser.ts | 29 ------------- src/parser/server.rb | 10 +++-- src/plugin.ts | 29 ++++++++++++- src/ruby/parser.rb | 2 +- src/types.ts | 1 - src/types/haml.ts | 81 ------------------------------------- test/js/haml/filter.test.ts | 74 +-------------------------------- test/js/haml/parser.test.ts | 32 --------------- test/js/haml/script.test.ts | 2 +- test/js/haml/tag.test.ts | 27 +++---------- 11 files changed, 41 insertions(+), 321 deletions(-) delete mode 100644 src/haml/embed.ts delete mode 100644 src/haml/parser.ts delete mode 100644 src/types/haml.ts delete mode 100644 test/js/haml/parser.test.ts diff --git a/src/haml/embed.ts b/src/haml/embed.ts deleted file mode 100644 index a5b89a9c..00000000 --- a/src/haml/embed.ts +++ /dev/null @@ -1,75 +0,0 @@ -import type { Plugin, HAML } from "../types"; -import prettier from "../prettier"; - -const { - hardline, - indent, - literalline, - markAsRoot, - mapDoc, - stripTrailingHardline -} = prettier; - -// This function is in here because it handles embedded parser values. I don't -// have a test that exercises it because I'm not sure for which parser it is -// necessary, but since it's in prettier core I'm keeping it here. -/* istanbul ignore next */ -function replaceNewlines(doc: Plugin.Doc) { - return mapDoc(doc, (currentDoc) => - typeof currentDoc === "string" && currentDoc.includes("\n") - ? currentDoc.split(/(\n)/g).map((v, i) => (i % 2 === 0 ? v : literalline)) - : currentDoc - ); -} - -const embed: Plugin.Embed = (path, _print, textToDoc, opts) => { - const node = path.getValue(); - - // We're only going to embed other languages on filter nodes. - if (node.type !== "filter") { - return null; - } - - let parser = node.value.name; - - // We don't want to deal with some weird recursive parser situation, so we - // need to explicitly call out the HAML parser here and just return null. - if (parser === "haml") { - return null; - } - - // In HAML the name of the JS filter is :javascript, whereas in prettier the - // name of the JS parser is babel. Here we explicitly handle that conversion. - if (parser === "javascript") { - parser = "babel"; - } - - // If there aren't any plugins that look like the name of the filter, then we - // will just exit early. - if ( - !opts.plugins.some( - (plugin) => - typeof plugin !== "string" && - plugin.parsers && - Object.prototype.hasOwnProperty.call(plugin.parsers, parser) - ) - ) { - return null; - } - - // If there is a plugin that has a parser that matches the name of this - // filter, then we're going to assume that's correct for embedding and go - // ahead and switch to that parser. - return markAsRoot([ - ":", - node.value.name, - indent([ - hardline, - replaceNewlines( - stripTrailingHardline(textToDoc(node.value.text, { parser })) - ) - ]) - ]); -}; - -export default embed; diff --git a/src/haml/parser.ts b/src/haml/parser.ts deleted file mode 100644 index 44a8a736..00000000 --- a/src/haml/parser.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { Plugin, HAML } from "../types"; -import parseSync from "../parser/parseSync"; - -const parser: Plugin.Parser = { - // This function is responsible for taking an input string of text and - // returning to prettier a JavaScript object that is the equivalent AST that - // represents the code stored in that string. We accomplish this by spawning a - // new process and reading JSON off STDOUT. - parse(text) { - return parseSync("haml", text); - }, - astFormat: "haml", - // This function handles checking whether or not the source string has the - // pragma for prettier. This is an optional workflow for incremental adoption. - hasPragma(text) { - return /^\s*-#\s*@(prettier|format)/.test(text); - }, - // These functions are just placeholders until we can actually perform this - // properly. The functions are necessary otherwise the format with cursor - // functions break. - locStart() { - return 0; - }, - locEnd() { - return 0; - } -}; - -export default parser; diff --git a/src/parser/server.rb b/src/parser/server.rb index f46cf8ef..e2e2319d 100644 --- a/src/parser/server.rb +++ b/src/parser/server.rb @@ -12,7 +12,9 @@ module Prettier require_relative '../ruby/parser' require_relative '../rbs/parser' -require_relative '../haml/parser' +# require_relative '../haml/parser' + +require 'syntax_tree/haml' # Make sure we trap these signals to be sure we get the quit command coming from # the parent node process @@ -79,11 +81,11 @@ module Prettier when 'ping' 'pong' when 'ruby' - SyntaxTree.parse(source) + PrettierSyntaxTree.parse(source) when 'rbs' Prettier::RBSParser.parse(source) when 'haml' - Prettier::HAMLParser.parse(source) + SyntaxTree::Haml.format(source) end if response @@ -91,7 +93,7 @@ module Prettier else socket.write('{ "error": true }') end - rescue SyntaxTree::ParseError => error + rescue PrettierSyntaxTree::ParseError => error loc = { start: { line: error.lineno, column: error.column } } socket.write(JSON.fast_generate(error: error.message, loc: loc)) rescue StandardError => error diff --git a/src/plugin.ts b/src/plugin.ts index 77f47ee5..50e5dd4c 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -4,8 +4,33 @@ import rubyParser from "./ruby/parser"; import rbsPrinter from "./rbs/printer"; import rbsParser from "./rbs/parser"; -import hamlPrinter from "./haml/printer"; -import hamlParser from "./haml/parser"; +import parseSync from "./parser/parseSync"; +import type { Plugin } from "./types"; + +const hamlParser: Plugin.Parser = { + parse(text) { + return parseSync("haml", text); + }, + astFormat: "haml", + hasPragma(text) { + return /^\s*-#\s*@(prettier|format)/.test(text); + }, + locStart() { + return 0; + }, + locEnd() { + return 0; + } +}; + +const hamlPrinter: Plugin.PrinterConfig = { + print(path) { + return path.getValue(); + }, + insertPragma(text) { + return `-# @format${text.startsWith("-#") ? "\n" : "\n\n"}${text}`; + } +}; /* * metadata mostly pulled from linguist and rubocop: diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb index fd951e6e..bf1ea385 100644 --- a/src/ruby/parser.rb +++ b/src/ruby/parser.rb @@ -3,7 +3,7 @@ require 'ripper' # require_relative 'syntax_tree/version' -class SyntaxTree < Ripper +class PrettierSyntaxTree < Ripper # Represents a line in the source. If this class is being used, it means that # every character in the string is 1 byte in length, so we can just return the # start of the line + the index. diff --git a/src/types.ts b/src/types.ts index a42a842b..e83e34fc 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,4 +1,3 @@ -export * as HAML from "./types/haml"; export * as Plugin from "./types/plugin"; export * as RBS from "./types/rbs"; export * as Ruby from "./types/ruby"; diff --git a/src/types/haml.ts b/src/types/haml.ts deleted file mode 100644 index 6184c870..00000000 --- a/src/types/haml.ts +++ /dev/null @@ -1,81 +0,0 @@ -// This file contains all of the types that represent objects being returned -// from the HAML parser. - -export type AnyNode = ( - | Comment - | DocType - | Filter - | HAMLComment - | Plain - | Root - | Script - | SilentScript - | Tag -); - -export type Comment = { - type: "comment", - value: { revealed: boolean, conditional?: string, text?: string }, - children: AnyNode[] -}; - -export type DocType = { - type: "doctype", - value: { type: string, version?: string, encoding?: string } -}; - -export type Filter = { - type: "filter", - value: { name: string, text: string } -}; - -export type HAMLComment = { - type: "haml_comment", - value: { text?: string }, - line: number -}; - -export type Plain = { - type: "plain", - value: { text: string } -}; - -export type Root = { - type: "root", - children: AnyNode[], - supports_multiline: boolean -}; - -export type Script = { - type: "script", - value: { - escape_html: boolean, - preserve: boolean, - interpolate: boolean, - text: string - }, - children: AnyNode[] -}; - -export type SilentScript = { - type: "silent_script", - value: { text: string, keyword: string }, - children: AnyNode[] -}; - -export type TagAttrs = string | { [property: string]: TagAttrs } -export type Tag = { - type: "tag", - value: { - name: string, - attributes: { class?: string, id?: string } & Record, - dynamic_attributes: { new?: string, old?: TagAttrs }, - object_ref?: string, - nuke_outer_whitespace: boolean, - nuke_inner_whitespace: boolean, - self_closing: boolean, - value?: string, - parse: boolean - }, - children: AnyNode[] -}; diff --git a/test/js/haml/filter.test.ts b/test/js/haml/filter.test.ts index f00aad6c..711ba4c2 100644 --- a/test/js/haml/filter.test.ts +++ b/test/js/haml/filter.test.ts @@ -26,78 +26,6 @@ describe("filter", () => { .foo { height: 100px; width: 100px; } `); - expect(content).toChangeFormat( - haml(` - :css - .foo { - height: 100px; - width: 100px; - } - `) - ); - }); - - test("javascript", () => { - const content = haml(` - :javascript - 1+1 - `); - - expect(content).toChangeFormat( - haml(` - :javascript - 1 + 1; - `) - ); - }); - - test("less", () => { - const content = haml(` - :less - .foo { .bar { height: 100px; } } - `); - - expect(content).toChangeFormat( - haml(` - :less - .foo { - .bar { - height: 100px; - } - } - `) - ); - }); - - test("markdown", () => { - const content = haml(` - :markdown - *Hello, world!* - `); - - expect(content).toChangeFormat( - haml(` - :markdown - _Hello, world!_ - `) - ); - }); - - test("scss", () => { - const content = haml(` - :scss - .foo { .bar { height: 100px; } } - `); - - expect(content).toChangeFormat( - haml(` - :scss - .foo { - .bar { - height: 100px; - } - } - `) - ); + expect(content).toMatchFormat(); }); }); diff --git a/test/js/haml/parser.test.ts b/test/js/haml/parser.test.ts deleted file mode 100644 index 8a6b1068..00000000 --- a/test/js/haml/parser.test.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { HAML, Plugin } from "../../../src/types"; -import parser from "../../../src/haml/parser"; - -describe("parser", () => { - test("parse", () => { - expect(parser.parse("= foo", {}, {} as Plugin.Options).type).toEqual( - "root" - ); - }); - - test("parse failure", () => { - expect(() => - parser.parse(`%div("invalid ": 1)`, {}, {} as Plugin.Options) - ).toThrowError(); - }); - - test("hasPragma", () => { - const withPragma = "-# @prettier"; - const withoutPragma = "-# foo"; - - expect(parser.hasPragma(withPragma)).toBe(true); - expect(parser.hasPragma(withoutPragma)).toBe(false); - }); - - test("locStart", () => { - expect(parser.locStart({} as HAML.AnyNode)).toEqual(0); - }); - - test("locEnd", () => { - expect(parser.locEnd({} as HAML.AnyNode)).toEqual(0); - }); -}); diff --git a/test/js/haml/script.test.ts b/test/js/haml/script.test.ts index 35569303..833bf31c 100644 --- a/test/js/haml/script.test.ts +++ b/test/js/haml/script.test.ts @@ -15,7 +15,7 @@ describe("script", () => { expect(content).toMatchFormat(); }); - test("escape", () => { + test.skip("escape", () => { expect(haml(`& I like #{"cheese & crackers"}`)).toMatchFormat(); }); diff --git a/test/js/haml/tag.test.ts b/test/js/haml/tag.test.ts index 6ca2911f..e69b5514 100644 --- a/test/js/haml/tag.test.ts +++ b/test/js/haml/tag.test.ts @@ -44,7 +44,7 @@ describe("tag", () => { }); test("dynamic attributes (ruby hash)", () => { - const content = haml("%div{data: { controller: 'lesson-evaluation' }}"); + const content = haml(`%div{data: { controller: "lesson-evaluation" }}`); expect(content).toMatchFormat(); }); @@ -62,7 +62,7 @@ describe("tag", () => { test("hash label, single quote", () => { const content = haml(`%section(xml:lang="en" title="title")`); - const expected = "%section{'xml:lang': 'en', title: 'title'}"; + const expected = `%section{"xml:lang": "en", title: "title"}`; expect(content).toChangeFormat(expected); }); @@ -80,23 +80,6 @@ describe("tag", () => { expect(content).toMatchFormat(); }); - test("hash rocket, single quote", () => { - const content = haml(`%section(xml:lang="en" title="title")`); - const expected = `%section{:'xml:lang' => 'en', :title => 'title'}`; - - expect(content).toChangeFormat(expected, { rubyHashLabel: false }); - }); - - test("hash rocket, double quote", () => { - const content = haml(`%section(xml:lang="en" title="title")`); - const expected = '%section{:"xml:lang" => "en", :title => "title"}'; - - expect(content).toChangeFormat(expected, { - rubyHashLabel: false, - rubySingleQuote: false - }); - }); - test("non-strings", () => { const content = haml(`%section(foo=1 bar=2)`); const expected = `%section(foo=1 bar=2)`; @@ -105,10 +88,10 @@ describe("tag", () => { }); test("attributes prefixed with @", () => { - expect(haml("%span{'@click': 'open = true'}")).toMatchFormat(); - expect(haml("%span{'@click.outside': 'open = true'}")).toMatchFormat(); + expect(haml(`%span{"@click": "open = true"}`)).toMatchFormat(); + expect(haml(`%span{"@click.outside": "open = true"}`)).toMatchFormat(); expect( - haml("%span{'@keydown.arrow-up.prevent': 'open = true'}") + haml(`%span{"@keydown.arrow-up.prevent": "open = true"}`) ).toMatchFormat(); }); }); From 276768174ab9c368af05590fa35bbcab29bd97d9 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 6 Apr 2022 21:55:39 -0400 Subject: [PATCH 568/785] Swap RBS --- src/parser/server.rb | 6 +- src/plugin.ts | 28 +- src/rbs/parser.rb | 155 --------- src/rbs/parser.ts | 32 -- src/rbs/printer.ts | 671 ------------------------------------- src/types.ts | 1 - src/types/rbs.ts | 108 ------ test/js/rbs/method.txt | 12 +- test/js/rbs/parser.test.ts | 45 --- test/js/rbs/rbs.test.ts | 6 +- test/js/rbs/record.txt | 2 +- 11 files changed, 37 insertions(+), 1029 deletions(-) delete mode 100644 src/rbs/parser.rb delete mode 100644 src/rbs/parser.ts delete mode 100644 src/rbs/printer.ts delete mode 100644 src/types/rbs.ts delete mode 100644 test/js/rbs/parser.test.ts diff --git a/src/parser/server.rb b/src/parser/server.rb index e2e2319d..f1248537 100644 --- a/src/parser/server.rb +++ b/src/parser/server.rb @@ -11,10 +11,8 @@ module Prettier end require_relative '../ruby/parser' -require_relative '../rbs/parser' -# require_relative '../haml/parser' - require 'syntax_tree/haml' +require 'syntax_tree/rbs' # Make sure we trap these signals to be sure we get the quit command coming from # the parent node process @@ -83,7 +81,7 @@ module Prettier when 'ruby' PrettierSyntaxTree.parse(source) when 'rbs' - Prettier::RBSParser.parse(source) + SyntaxTree::RBS.format(source) when 'haml' SyntaxTree::Haml.format(source) end diff --git a/src/plugin.ts b/src/plugin.ts index 50e5dd4c..2f645e14 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -1,12 +1,34 @@ import rubyPrinter from "./ruby/printer"; import rubyParser from "./ruby/parser"; -import rbsPrinter from "./rbs/printer"; -import rbsParser from "./rbs/parser"; - import parseSync from "./parser/parseSync"; import type { Plugin } from "./types"; +const rbsParser: Plugin.Parser = { + parse(text) { + return parseSync("rbs", text); + }, + astFormat: "rbs", + hasPragma(text) { + return /^\s*#[^\S\n]*@(format|prettier)\s*(\n|$)/.test(text); + }, + locStart() { + return 0; + }, + locEnd() { + return 0; + } +}; + +const rbsPrinter: Plugin.PrinterConfig = { + print(path) { + return path.getValue(); + }, + insertPragma(text) { + return `# @format${text[0] === "#" ? "\n" : "\n\n"}${text}`; + } +}; + const hamlParser: Plugin.Parser = { parse(text) { return parseSync("haml", text); diff --git a/src/rbs/parser.rb b/src/rbs/parser.rb deleted file mode 100644 index 34d3b59b..00000000 --- a/src/rbs/parser.rb +++ /dev/null @@ -1,155 +0,0 @@ -#!/usr/bin/env ruby - -begin - require 'rbs' -rescue LoadError - # If we can't load the rbs gem, then we're going to provide a shim parser that - # will warn and bail out. - class Prettier::RBSParser - def self.parse(text) - warn( - 'The `rbs` gem could not be loaded. Please ensure you have it ' \ - 'installed and that it is available in the gem path.' - ) - - false - end - end - - return -end - -# This was removed at some point, so we need to support both versions. -RBS::KEYWORD_RAW = - if RBS::Parser.const_defined?(:KEYWORDS_RE) - RBS::Parser::KEYWORDS_RE - else - RBS::Parser::KEYWORDS.keys.join('|') - end - -# This enforces that the full matched string is a keyword. -RBS::KEYWORD_FULL = /\A#{RBS::KEYWORD_RAW}\z/ - -# Monkey-patch this so that we can get the character positions. -class RBS::Location - def to_json(*args) - { - start: { - line: start_line, - column: start_column - }, - end: { - line: end_line, - column: end_column - }, - start_pos: start_pos, - end_pos: end_pos - }.to_json(*args) - end -end - -# Monkey-patch this so that we get whether or not it needs to be escaped. -class RBS::Types::Function::Param - def to_json(*a) - escaped = name && RBS::KEYWORD_FULL.match?(name) - - # More modern versions of RBS just include the ` in the name so there's no - # need to escape it further. - escaped = false if name.to_s.start_with?('`') - - { type: type, name: name, escaped: escaped }.to_json(*a) - end -end - -# Monkey-patch this so that we get the name field in the serialized JSON, as -# well as information about whether or not we need to escape it. -class RBS::AST::Members::MethodDefinition - def to_json(*a) - { - member: :method_definition, - name: name, - kind: kind, - types: types, - annotations: annotations, - location: location, - comment: comment, - overload: overload - }.to_json(*a) - end -end - -# Monkey-patch this so that we get the information we need about how to join the -# key-value pairs of the record. -class RBS::Types::Record - def to_json(*a) - fields_extra = {} - - # Explicitly not using Enumerable#to_h here to support Ruby 2.5 - fields.each do |key, type| - if key.is_a?(Symbol) && key.match?(/\A[A-Za-z_][A-Za-z_]*\z/) && - !key.match?(RBS::KEYWORD_RAW) - fields_extra[key] = { type: type, joiner: :label } - else - fields_extra[key.inspect] = { type: type, joiner: :rocket } - end - end - - { class: :record, fields: fields_extra, location: location }.to_json(*a) - end -end - -if defined?(RBS::AST::Declarations::ModuleTypeParams) - # This class was removed in rbs 2.0. Monkeypatch < 2.0 to give the same json - # output - class RBS::AST::Declarations::ModuleTypeParams - def to_json(*a) - params.to_json(*a) - end - end - - # make this look like the new AST::TypeParam json - class RBS::AST::Declarations::ModuleTypeParams::TypeParam - def to_json(*a) - { name: name, variance: variance, unchecked: skip_validation }.to_json(*a) - end - end - - # https://github.com/ruby/rbs/commit/3ccdcb1f3ac5dcb866280f745866a852658195e6 - class RBS::MethodType - # promote the array of symbols into TypeParam looking-things - def to_json(*a) - type_param_objects = - type_params.map do |name| - { - name: name, - variance: 'invariant', - unchecked: 'false', - upper_bound: nil - # location - harder to get this but not needed - } - end - - { - type_params: type_param_objects, - type: type, - block: block, - location: location - }.to_json(*a) - end - end -end - -# The main parser interface. -module Prettier - class RBSParser - def self.parse(text) - { - declarations: RBS::Parser.parse_signature(text), - location: { - start_pos: 0, - end_pos: text.length - } - } - end - end -end diff --git a/src/rbs/parser.ts b/src/rbs/parser.ts deleted file mode 100644 index 646b1515..00000000 --- a/src/rbs/parser.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { Plugin, RBS } from "../types"; -import parseSync from "../parser/parseSync"; - -const parser: Plugin.Parser = { - // This function is responsible for taking an input string of text and - // returning to prettier a JavaScript object that is the equivalent AST that - // represents the code stored in that string. We accomplish this by spawning a - // new Ruby process of parser.rb and reading JSON off STDOUT. - parse(text) { - return parseSync("rbs", text); - }, - astFormat: "rbs", - // This function handles checking whether or not the source string has the - // pragma for prettier. This is an optional workflow for incremental adoption. - hasPragma(text) { - return /^\s*#[^\S\n]*@(format|prettier)\s*(\n|$)/.test(text); - }, - // This function is critical for comments and cursor support, and is - // responsible for returning the index of the character within the source - // string that is the beginning of the given node. - locStart(node) { - return node.location.start_pos; - }, - // This function is critical for comments and cursor support, and is - // responsible for returning the index of the character within the source - // string that is the ending of the given node. - locEnd(node) { - return node.location.end_pos; - } -}; - -export default parser; diff --git a/src/rbs/printer.ts b/src/rbs/printer.ts deleted file mode 100644 index 59abacbc..00000000 --- a/src/rbs/printer.ts +++ /dev/null @@ -1,671 +0,0 @@ -import type { util } from "prettier"; -import type { RequiredKeys, Plugin, RBS } from "../types"; -import prettier from "../prettier"; - -const { group, hardline, indent, makeString, join, line, softline } = prettier; - -// For some lists of entities in the AST, the parser returns them as an unsorted -// object (presumably because Ruby hashes have implicit ordering). We do not -// have that in JavaScript, so here we sort each object by its position in the -// source string. -function getSortedKeys>( - object: T -): (keyof T)[] { - return Object.keys(object).sort( - (left, right) => - object[left].type.location.start_pos - - object[right].type.location.start_pos - ); -} - -// In some cases, we want to just defer to whatever was in the source. -function getSource(node: { location: RBS.Location }, opts: Plugin.Options) { - const { location } = node; - return opts.originalText.slice(location.start_pos, location.end_pos); -} - -const printer: Plugin.PrinterConfig = { - // This is the generic node print function, used to convert any node in the - // AST into its equivalent Doc representation. - print(path, opts, print) { - const node = path.getValue(); - let doc = null; - - if (node.declarations) { - // Prints out the root of the tree, which includes zero or more - // declarations. - return [ - join([hardline, hardline], path.map(print, "declarations")), - hardline - ]; - } - - /* istanbul ignore else */ - if (node.declaration) { - switch (node.declaration) { - // Prints out a type alias, which is a declaration that looks like: - // type foo = String - case "alias": { - doc = group([ - "type ", - node.name, - " =", - indent(group([line, path.call(printType, "type")])) - ]); - break; - } - // Prints out a class declarations, which looks like: - // class Foo end - case "class": { - const nodePath = path as Plugin.Path; - const parts: Plugin.Doc[] = [ - "class ", - printNameAndTypeParams(nodePath, node) - ]; - - if (node.super_class) { - const superPath = nodePath as Plugin.Path< - RequiredKeys - >; - parts.push(" < ", superPath.call(printNameAndArgs, "super_class")); - } - - parts.push(indent(printMembers(nodePath)), hardline, "end"); - doc = group(parts); - break; - } - // Prints out a constant or a global declaration, which looks like: - // Foo: String - // $foo: String - case "constant": - case "global": { - doc = group([node.name, ": ", path.call(printType, "type")]); - break; - } - // Prints out an interface declaration, which looks like: - // interface _Foo end - case "interface": { - const nodePath = path as Plugin.Path; - - doc = group([ - "interface ", - printNameAndTypeParams(nodePath, node), - indent(printMembers(nodePath)), - hardline, - "end" - ]); - break; - } - // Prints out a module declaration, which looks like: - // module Foo end - case "module": { - const nodePath = path as Plugin.Path; - const parts: Plugin.Doc[] = [ - "module ", - printNameAndTypeParams(nodePath, node) - ]; - - if (node.self_types.length > 0) { - parts.push( - " : ", - join(", ", nodePath.map(printNameAndArgs, "self_types")) - ); - } - - parts.push(indent(printMembers(nodePath)), hardline, "end"); - doc = group(parts); - break; - } - /* istanbul ignore next */ - default: - throw new Error(`unknown declaration: ${(node as any).declaration}`); - } - } else if (node.member) { - switch (node.member) { - // Prints out an alias within a declaration, which looks like: - // alias foo bar - // alias self.foo self.bar - case "alias": { - if (node.kind === "singleton") { - doc = ["alias self.", node.new_name, " self.", node.old_name]; - } else { - doc = ["alias ", node.new_name, " ", node.old_name]; - } - break; - } - // Prints out an attr_* meta method, which looks like: - // attr_accessor foo - // attr_reader self.foo() - // attr_writer self.foo(@bar): String - case "attr_accessor": - case "attr_reader": - case "attr_writer": { - const parts: Plugin.Doc[] = [node.member, " "]; - - if (node.kind === "singleton") { - parts.push("self."); - } - - parts.push(node.name); - - if (node.ivar_name === false) { - parts.push("()"); - } else if (node.ivar_name) { - parts.push("(", node.ivar_name, ")"); - } - - parts.push(": ", path.call(printType, "type")); - doc = group(parts); - break; - } - // Prints out a class or instance variable member, which looks like: - // @foo: String - // @@foo: String - case "class_variable": - case "instance_variable": { - doc = group([node.name, ": ", path.call(printType, "type")]); - break; - } - // Prints out a class instance variable member, which looks like: - // self.@foo: String - case "class_instance_variable": { - doc = ["self.", node.name, ": ", path.call(printType, "type")]; - break; - } - // Prints out a mixin, which looks like: - // include Foo - // prepend Foo - // extend Foo - case "include": - case "extend": - case "prepend": { - const nodePath = path as Plugin.Path; - - doc = group([node.member, " ", printNameAndArgs(nodePath)]); - break; - } - case "public": - case "private": { - doc = node.member; - break; - } - case "method_definition": { - const nodePath = path as Plugin.Path; - - doc = printMethodDefinition(nodePath, node); - break; - } - /* istanbul ignore next */ - default: - throw new Error(`unknown member: ${(node as any).member}`); - } - } else { - const ast = JSON.stringify(node, null, 2); - throw new Error(`Unsupported node encountered:\n${ast}`); - } - - // An annotation can be attached to most kinds of nodes, and should be - // printed using %a{}. Certain nodes can't have annotations at all. - if (node.annotations && node.annotations.length > 0) { - const annotationsPath = path as Plugin.Path<{ - annotations: RBS.Annotation[]; - }>; - - doc = [ - join( - hardline, - annotationsPath.map((annotationPath) => { - const annotationNode = annotationPath.getValue(); - - // If there are already braces inside the annotation, then we're - // just going to print out the original string to avoid having to - // escape anything. - if (/[{}]/.test(annotationNode.string)) { - return getSource(annotationNode, opts); - } - - return ["%a{", annotationNode.string, "}"]; - }, "annotations") - ), - hardline, - doc - ]; - } - - // Comments come in as one whole string, so here we split it up into - // multiple lines and then prefix it with the pound sign. - if (node.comment) { - doc = [ - join( - hardline, - node.comment.string - .slice(0, -1) - .split("\n") - .map((segment) => `# ${segment}`) - ), - hardline, - doc - ]; - } - - return doc; - - // Prints out a string in the source, which looks like: - // 'foo' - function printString(node: RBS.Literal) { - // We're going to go straight to the source here, as if we don't then - // we're going to end up with the result of String#inspect, which does - // weird things to escape sequences. - const value = getSource(node, opts); - - // Get the quote that was used in the source and the quote that we want to - // be using. - const originalQuote = value[0]; - const preferredQuote = opts.rubySingleQuote ? "'" : '"'; - - // Determine if we're allowed to change the quote based on whether or not - // there is an escape sequence in the source string. - const quote = value.match(new RegExp(`\\\\[^${originalQuote}]`)) - ? originalQuote - : preferredQuote; - - return makeString(value.slice(1, -1), quote as util.Quote, false); - } - - // Certain nodes are names with optional arguments attached, as in Array[A]. - // We handle all of that printing centralized here. - function printNameAndArgs(path: Plugin.Path) { - const node = path.getValue(); - - if (node.args.length === 0) { - return node.name; - } - - return group([ - node.name, - "[", - join(", ", path.map(printType, "args")), - "]" - ]); - } - - // This is the big function that prints out any individual type, which can - // look like all kinds of things, listed in the case statement below. - function printType( - path: Plugin.Path, - options?: number | { forceParens: boolean } - ): Plugin.Doc { - const node = path.getValue(); - const forceParens = typeof options === "object" && options.forceParens; - - switch (node.class) { - case "literal": - if (node.literal[0] === '"') { - return printString(node); - } - return node.literal; - case "optional": { - const nodePath = path as Plugin.Path; - - return [ - nodePath.call( - (typePath) => printType(typePath, { forceParens: true }), - "type" - ), - "?" - ]; - } - case "tuple": { - // If we don't have any sub types, we explicitly need the space in - // between the brackets to not confuse the parser. - if (node.types.length === 0) { - return "[ ]"; - } - - const nodePath = path as Plugin.Path; - return group([ - "[", - join(", ", nodePath.map(printType, "types")), - "]" - ]); - } - case "union": { - const nodePath = path as Plugin.Path; - const doc = group( - join([line, "| "], nodePath.map(printType, "types")) - ); - - if (forceParens) { - return ["(", doc, ")"]; - } - - return doc; - } - case "intersection": { - const nodePath = path as Plugin.Path; - const doc = group( - join( - [line, "& "], - nodePath.map( - (typePath) => printType(typePath, { forceParens: true }), - "types" - ) - ) - ); - - if (forceParens) { - return ["(", doc, ")"]; - } - - return doc; - } - case "class_singleton": - return ["singleton(", node.name, ")"]; - case "proc": - return [ - "^", - printMethodSignature(path as Plugin.Path) - ]; - case "record": { - const nodePath = path as Plugin.Path; - const parts: Plugin.Doc[] = []; - - getSortedKeys(node.fields).forEach((field) => { - const fieldParts = []; - - if (node.fields[field].joiner === "rocket") { - fieldParts.push(`${field} => `); - } else { - fieldParts.push(`${field}: `); - } - - fieldParts.push(nodePath.call(printType, "fields", field, "type")); - parts.push(fieldParts); - }); - - return group([ - "{", - indent([line, join([",", line], parts)]), - line, - "}" - ]); - } - case "class_instance": - case "interface": { - const nodePath = path as Plugin.Path; - return printNameAndArgs(nodePath); - } - case "alias": - case "variable": - return node.name; - case "bool": - case "bot": - case "class": - case "instance": - case "nil": - case "self": - case "top": - case "untyped": - case "void": - return node.class; - /* istanbul ignore next */ - default: - throw new Error(`unknown type: ${(node as any).class}`); - } - } - - // Prints out the members of a class, module, or interface. - function printMembers( - path: Plugin.Path - ) { - let lastLine: number | null = null; - const docs: Plugin.Doc[] = []; - - path.each((memberPath) => { - const memberNode = memberPath.getValue(); - - if ( - lastLine !== null && - memberNode.location.start.line - lastLine >= 2 - ) { - docs.push([hardline, hardline]); - } else { - docs.push(hardline); - } - - docs.push(print(memberPath)); - lastLine = memberNode.location.end.line; - }, "members"); - - return docs; - } - - // Prints out the name of a class, interface, or module declaration. - // Additionally loops through each type parameter if there are any and print - // them out joined by commas. Checks for validation and variance. - function printNameAndTypeParams( - path: Plugin.Path, - node: RBS.NameAndTypeParams - ) { - if (node.type_params.length === 0) { - return node.name; - } - - const docs = path.map((paramPath) => { - const node = paramPath.getValue(); - const parts = []; - - if (node.unchecked) { - parts.push("unchecked"); - } - - if (node.variance === "covariant") { - parts.push("out"); - } else if (node.variance === "contravariant") { - parts.push("in"); - } - - if (node.upper_bound) { - const path = paramPath as Plugin.Path<{ upper_bound: RBS.Type }>; - const upperBound = path.call(printType, "upper_bound"); - return join(" ", [...parts, node.name, "<", upperBound]); - } else { - return join(" ", [...parts, node.name]); - } - }, "type_params"); - - return [node.name, "[", join(", ", docs), "]"]; - } - - // Returns an array of printed parameters so that the calling function can - // join them together in whatever way. - function printMethodParams(path: Plugin.Path) { - const node = path.getValue(); - let parts: Plugin.Doc[] = []; - - // required positionals, as in (A) - parts = parts.concat(path.map(printMethodParam, "required_positionals")); - - // optional positionals, as in (?A) - parts = parts.concat( - path.map( - (paramPath) => ["?", printMethodParam(paramPath)], - "optional_positionals" - ) - ); - - // rest positional, as in (*A) - if (node.rest_positionals) { - const restPositionalsPath = path as Plugin.Path< - RequiredKeys - >; - parts.push([ - "*", - restPositionalsPath.call(printMethodParam, "rest_positionals") - ]); - } - - // trailing positionals are required positionals after a rest - parts = parts.concat(path.map(printMethodParam, "trailing_positionals")); - - // required keywords, as in (a: A) - getSortedKeys(node.required_keywords).forEach((name) => { - parts.push([ - name, - ": ", - path.call(printMethodParam, "required_keywords", name) - ]); - }); - - // optional keywords, as in (?a: A) - getSortedKeys(node.optional_keywords).forEach((name) => { - parts.push([ - "?", - name, - ": ", - path.call(printMethodParam, "optional_keywords", name) - ]); - }); - - // rest keyword, as in (**A) - if (node.rest_keywords) { - const restKeywordsPath = path as Plugin.Path< - RequiredKeys - >; - parts.push([ - "**", - restKeywordsPath.call(printMethodParam, "rest_keywords") - ]); - } - - return parts; - - // Prints out a method parameter at a given path. Handles printing out the - // name if there is one (and whether or not it's escaped). - function printMethodParam(path: Plugin.Path) { - const node = path.getValue(); - const parts = [path.call(printType, "type")]; - - if (node.name) { - parts.push(" "); - - if (node.escaped) { - parts.push("`", node.name, "`"); - } else { - parts.push(node.name); - } - } - - return parts; - } - } - - // Prints out a specific method signature, which looks like: - // (T t) -> void - function printMethodSignature( - path: Plugin.Path - ): Plugin.Doc { - const node = path.getValue(); - const parts = []; - - // We won't have a type_params key if we're printing a block - if (node.type_params && node.type_params.length > 0) { - const typeParamNames = node.type_params.map((tp) => tp.name); - - parts.push("[", join(", ", typeParamNames), "] "); - } - - const params = path.call(printMethodParams, "type"); - - if (params.length > 0) { - parts.push( - "(", - indent([softline, join([",", line], params)]), - softline, - ") " - ); - } - - if (node.block) { - if (!node.block.required) { - parts.push("?"); - } - - parts.push( - "{", - indent([line, path.call(printMethodSignature, "block")]), - line, - "} " - ); - } - - parts.push( - "-> ", - path.call( - (typePath) => printType(typePath, { forceParens: true }), - "type", - "return_type" - ) - ); - - return group(parts); - } - - // Prints out a method definition, which looks like: - // def t: (T t) -> void - function printMethodDefinition( - path: Plugin.Path, - node: RBS.MethodDefinition - ) { - let typeDocs: Plugin.Doc = path.map(printMethodSignature, "types"); - - if (node.overload) { - typeDocs.push("..."); - } - - if (typeDocs.length === 1) { - typeDocs = [" ", typeDocs[0]]; - } else { - typeDocs = indent(group([line, join([line, "| "], typeDocs)])); - } - - const parts: Plugin.Doc[] = ["def "]; - - if (node.kind === "singleton") { - parts.push("self."); - } else if (node.kind === "singleton_instance") { - parts.push("self?."); - } - - const escaped = isMethodNameEscaped(); - parts.push(escaped ? `\`${node.name}\`` : node.name, ":", typeDocs); - - return group(parts); - - // Determine if a method name is escaped in the original source. - function isMethodNameEscaped() { - const pos = node.location.start_pos + 4; - const name = opts.originalText.slice(pos, pos + 2).trimStart(); - - return name[0] === "`" && name[1] !== ":"; - } - } - }, - // This is an escape-hatch to ignore nodes in the tree. If you have a comment - // that includes this pattern, then the entire node will be ignored and just - // the original source will be printed out. - hasPrettierIgnore(path) { - const node = path.getValue(); - - return ( - (node.comment && node.comment.string.includes("prettier-ignore")) || false - ); - }, - // This function handles adding the format pragma to a source string. This is - // an optional workflow for incremental adoption. - insertPragma(text) { - return `# @format${text[0] === "#" ? "\n" : "\n\n"}${text}`; - } -}; - -export default printer; diff --git a/src/types.ts b/src/types.ts index e83e34fc..ccfab44f 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,4 +1,3 @@ export * as Plugin from "./types/plugin"; -export * as RBS from "./types/rbs"; export * as Ruby from "./types/ruby"; export * from "./types/utils"; diff --git a/src/types/rbs.ts b/src/types/rbs.ts deleted file mode 100644 index 02056482..00000000 --- a/src/types/rbs.ts +++ /dev/null @@ -1,108 +0,0 @@ -// This file contains all of the types that represent objects being returned -// from the RBS parser. - -export type MethodParam = { - name?: string - escaped: boolean, - type: Type -}; - -export type MethodParams = { - required_positionals: MethodParam[], - optional_positionals: MethodParam[], - rest_positionals?: MethodParam, - trailing_positionals: MethodParam[] - required_keywords: Record, - optional_keywords: Record, - rest_keywords?: MethodParam -}; - -export type MethodSignature = { - type_params: Param[], - type: MethodParams & { return_type: Type }, - block: { required: boolean } & MethodSignature -}; - -export type Type = { location: Location } & ( - | { class: "literal", literal: string } - | { class: "optional", type: Type } - | { class: "tuple", types: Type[] } - | { class: "union", types: Type[] } - | { class: "intersection", types: Type[] } - | { class: "class_singleton", name: string } - | { class: "proc" } & MethodSignature - | { class: "record", fields: Record } - | { class: "class_instance" } & NameAndArgs - | { class: "interface" } & NameAndArgs - | { class: "alias", name: string } - | { class: "variable", name: string } - | { class: "bool" } - | { class: "bot" } - | { class: "class" } - | { class: "instance" } - | { class: "nil" } - | { class: "self" } - | { class: "top" } - | { class: "untyped" } - | { class: "void" } -); - -export type Literal = Type & { class: "literal" }; - -export type NameAndArgs = { name: string, args: Type[] }; - -export type Location = { - start: { line: number, column: number }, - end: { line: number, column: number }, - start_pos: number, - end_pos: number -}; - -export type Member = { location: Location } & ( - | { member: "alias", new_name: string, old_name: string, kind: "instance" | "singleton" } - | { member: "attr_accessor" | "attr_reader" | "attr_writer", name: string, ivar_name?: string | false, kind: "instance" | "singleton", type: Type } - | { member: "class_variable" | "class_instance_variable" | "instance_variable", name: string, type: Type } - | { member: "include" } & NameAndArgs - | { member: "extend" } & NameAndArgs - | { member: "prepend" } & NameAndArgs - | { member: "public" } - | { member: "private" } - | { member: "method_definition", overload: boolean, name: string, types: MethodSignature[], kind: "instance" | "singleton" | "singleton_instance" } -); - -export type MethodDefinition = Member & { member: "method_definition" }; - -export type Param = { - name: string, - unchecked: boolean, - variance: "invariant" | "covariant" | "contravariant" - upper_bound?: Type, -}; - -export type NameAndTypeParams = { - name: string, - type_params: Param[] -}; - -export type Class = { declaration: "class", super_class?: NameAndArgs, members: Member[] } & NameAndTypeParams; -export type Interface = { declaration: "interface", members: Member[] } & NameAndTypeParams; -export type Module = { declaration: "module", self_types: NameAndArgs[], members: Member[] } & NameAndTypeParams; - -type Declaration = { location: Location } & ( - | { declaration: "alias", name: string, type: Type } - | Class - | { declaration: "constant", name: string, type: Type } - | { declaration: "global", name: string, type: Type } - | Interface - | Module -); - -type Root = { declarations: Declaration[], location: Location }; - -export type Annotation = { string: string, location: Location }; - -export type AnyNode = { comment?: { string: string }, annotations?: Annotation[] } & ( - | ({ declaration: undefined, member: undefined } & Root) - | ({ declarations: undefined, member: undefined } & Declaration) - | ({ declaration: undefined, declarations: undefined } & Member) -); diff --git a/test/js/rbs/method.txt b/test/js/rbs/method.txt index abc4047e..dfd4dd65 100644 --- a/test/js/rbs/method.txt +++ b/test/js/rbs/method.txt @@ -1,11 +1,11 @@ def t: -> void def t: -> void | ... -def t: -> ('a' | 'b' | 'c') -def t: -> ('a' | 'b' | 'c')? -def t: -> ('a' & 'b' & 'c') -def t: -> ('a' & 'b' & 'c')? -def t: -> ('a' & ('b' | 'c')) -def t: -> ('a' & ('b' | 'c'))? +def t: -> ("a" | "b" | "c") +def t: -> ("a" | "b" | "c")? +def t: -> ("a" & "b" & "c") +def t: -> ("a" & "b" & "c")? +def t: -> ("a" & ("b" | "c")) +def t: -> ("a" & ("b" | "c"))? def self.t: -> void def self.t: -> void | ... def self?.t: -> void diff --git a/test/js/rbs/parser.test.ts b/test/js/rbs/parser.test.ts deleted file mode 100644 index efa7ea76..00000000 --- a/test/js/rbs/parser.test.ts +++ /dev/null @@ -1,45 +0,0 @@ -import type { Plugin, RBS } from "../../../src/types"; -import { ruby } from "../utils"; -import parser from "../../../src/rbs/parser"; - -function parse(source: string) { - return parser.parse(source, {}, {} as Plugin.Options); -} - -describe("parser", () => { - test("parse", () => { - expect(parse("class Foo end").declarations).toHaveLength(1); - }); - - test("parse failure", () => { - expect(() => parse("<>")).toThrowError(); - }); - - test("hasPragma", () => { - const withPragma = ruby(` - # @prettier - module Foo - end - `); - - const withoutPragma = ruby(` - module Foo - end - `); - - expect(parser.hasPragma(withPragma)).toBe(true); - expect(parser.hasPragma(withoutPragma)).toBe(false); - }); - - test("locStart", () => { - const node = { location: { start_pos: 5 } } as RBS.AnyNode; - - expect(parser.locStart(node)).toEqual(5); - }); - - test("locEnd", () => { - const node = { location: { end_pos: 5 } } as RBS.AnyNode; - - expect(parser.locEnd(node)).toEqual(5); - }); -}); diff --git a/test/js/rbs/rbs.test.ts b/test/js/rbs/rbs.test.ts index 58724145..9b174aa3 100644 --- a/test/js/rbs/rbs.test.ts +++ b/test/js/rbs/rbs.test.ts @@ -223,7 +223,7 @@ describe("rbs", () => { }); test("uses default quotes", () => { - expect(rbs("T: 'foo'")).toMatchFormat(); + expect(rbs(`T: "foo"`)).toMatchFormat(); }); test("changes quotes to match", () => { @@ -237,11 +237,11 @@ describe("rbs", () => { }); test("unescapes double quotes when using single quotes", () => { - expect(rbs(`T: "super \\" duper"`)).toChangeFormat(`T: 'super " duper'`); + expect(rbs(`T: "super \\" duper"`)).toChangeFormat(`T: "super \\" duper"`); }); test("unescapes single quotes when using double quotes", () => { - expect(rbs(`T: 'super \\' duper'`)).toChangeFormat(`T: "super ' duper"`, { + expect(rbs(`T: 'super \\' duper'`)).toChangeFormat(`T: 'super \\' duper'`, { rubySingleQuote: false }); }); diff --git a/test/js/rbs/record.txt b/test/js/rbs/record.txt index debba3ed..d5e3a6e0 100644 --- a/test/js/rbs/record.txt +++ b/test/js/rbs/record.txt @@ -1,3 +1,3 @@ { foo: Integer } -{ foo: untyped, 3 => 'hoge' } +{ foo: untyped, 3 => "hoge" } { :+ => 1 } From c0ee8ff2b374335f655f3c2a31f41e5ff37c5c79 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 6 Apr 2022 22:10:04 -0400 Subject: [PATCH 569/785] Clean up types for the plugin --- src/plugin.ts | 111 +++++++++++++++++++++++++------------------------- 1 file changed, 56 insertions(+), 55 deletions(-) diff --git a/src/plugin.ts b/src/plugin.ts index 2f645e14..4dfe8220 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -1,65 +1,24 @@ +import type { Parser, Plugin, SupportLanguage } from "prettier"; + import rubyPrinter from "./ruby/printer"; import rubyParser from "./ruby/parser"; import parseSync from "./parser/parseSync"; -import type { Plugin } from "./types"; -const rbsParser: Plugin.Parser = { - parse(text) { - return parseSync("rbs", text); - }, - astFormat: "rbs", - hasPragma(text) { - return /^\s*#[^\S\n]*@(format|prettier)\s*(\n|$)/.test(text); - }, - locStart() { - return 0; - }, - locEnd() { - return 0; - } -}; +interface ExtendedSupportLanguage extends SupportLanguage { + interpreters?: string[] +} -const rbsPrinter: Plugin.PrinterConfig = { - print(path) { - return path.getValue(); - }, - insertPragma(text) { - return `# @format${text[0] === "#" ? "\n" : "\n\n"}${text}`; - } -}; - -const hamlParser: Plugin.Parser = { - parse(text) { - return parseSync("haml", text); - }, - astFormat: "haml", - hasPragma(text) { - return /^\s*-#\s*@(prettier|format)/.test(text); - }, - locStart() { - return 0; - }, - locEnd() { - return 0; - } -}; - -const hamlPrinter: Plugin.PrinterConfig = { - print(path) { - return path.getValue(); - }, - insertPragma(text) { - return `-# @format${text.startsWith("-#") ? "\n" : "\n\n"}${text}`; - } -}; +interface ExtendedPlugin extends Omit { + languages: ExtendedSupportLanguage[] +} /* * metadata mostly pulled from linguist and rubocop: * https://github.com/github/linguist/blob/master/lib/linguist/languages.yml * https://github.com/rubocop/rubocop/blob/master/spec/rubocop/target_finder_spec.rb */ -const plugin = { +const plugin: ExtendedPlugin = { languages: [ { name: "Ruby", @@ -134,14 +93,56 @@ const plugin = { } ], parsers: { - ruby: rubyParser, - rbs: rbsParser, - haml: hamlParser + ruby: rubyParser as Parser, + rbs: { + parse(text) { + return parseSync("rbs", text); + }, + astFormat: "rbs", + hasPragma(text) { + return /^\s*#[^\S\n]*@(prettier|format)\s*(\n|$)/.test(text); + }, + locStart() { + return 0; + }, + locEnd() { + return 0; + } + }, + haml: { + parse(text) { + return parseSync("haml", text); + }, + astFormat: "haml", + hasPragma(text) { + return /^\s*-#\s*@(prettier|format)/.test(text); + }, + locStart() { + return 0; + }, + locEnd() { + return 0; + } + } }, printers: { ruby: rubyPrinter, - rbs: rbsPrinter, - haml: hamlPrinter + rbs: { + print(path) { + return path.getValue(); + }, + insertPragma(text) { + return `# @format${text.startsWith("#") ? "\n" : "\n\n"}${text}`; + } + }, + haml: { + print(path) { + return path.getValue(); + }, + insertPragma(text) { + return `-# @format${text.startsWith("-#") ? "\n" : "\n\n"}${text}`; + } + } }, options: { rubyArrayLiteral: { From 3f75192779518a162ea56f462bcc65b8305e404f Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 6 Apr 2022 22:33:00 -0400 Subject: [PATCH 570/785] Swap ruby --- src/parser/server.rb | 10 +- src/plugin.ts | 31 +- src/ruby/embed.ts | 145 - src/ruby/location.ts | 17 - src/ruby/nodes.ts | 296 - src/ruby/nodes/alias.ts | 69 - src/ruby/nodes/aref.ts | 52 - src/ruby/nodes/args.ts | 172 - src/ruby/nodes/arrays.ts | 145 - src/ruby/nodes/assign.ts | 56 - src/ruby/nodes/calls.ts | 330 - src/ruby/nodes/case.ts | 59 - src/ruby/nodes/class.ts | 57 - src/ruby/nodes/commands.ts | 163 - src/ruby/nodes/conditionals.ts | 323 - src/ruby/nodes/constants.ts | 45 - src/ruby/nodes/flow.ts | 70 - src/ruby/nodes/hashes.ts | 159 - src/ruby/nodes/heredocs.ts | 34 - src/ruby/nodes/hooks.ts | 33 - src/ruby/nodes/ints.ts | 27 - src/ruby/nodes/lambdas.ts | 80 - src/ruby/nodes/loops.ts | 91 - src/ruby/nodes/massign.ts | 80 - src/ruby/nodes/methods.ts | 71 - src/ruby/nodes/operators.ts | 73 - src/ruby/nodes/params.ts | 124 - src/ruby/nodes/patterns.ts | 161 - src/ruby/nodes/regexp.ts | 57 - src/ruby/nodes/rescue.ts | 103 - src/ruby/nodes/return.ts | 115 - src/ruby/nodes/statements.ts | 162 - src/ruby/nodes/strings.ts | 293 - src/ruby/nodes/super.ts | 26 - src/ruby/nodes/undef.ts | 31 - src/ruby/parser.rb | 9134 -------------------- src/ruby/parser.ts | 33 - src/ruby/printer.ts | 78 - src/ruby/toProc.ts | 114 - src/types.ts | 124 +- src/types/plugin.ts | 97 - src/types/ruby.ts | 228 - src/types/utils.ts | 24 - src/utils.ts | 13 - src/utils/containsAssignment.ts | 18 - src/utils/getTrailingComma.ts | 7 - src/utils/hasAncestor.ts | 19 - src/utils/inlineEnsureParens.ts | 55 - src/utils/isEmptyBodyStmt.ts | 8 - src/utils/isEmptyParams.ts | 15 - src/utils/isEmptyStmts.ts | 13 - src/utils/literallineWithoutBreakParent.ts | 9 - src/utils/makeCall.ts | 19 - src/utils/noIndent.ts | 10 - src/utils/printEmptyCollection.ts | 58 - src/utils/skipAssignIndent.ts | 23 - test/js/ruby/toProc.test.ts | 210 - test/js/setupTests.ts | 11 +- 58 files changed, 157 insertions(+), 13923 deletions(-) delete mode 100644 src/ruby/embed.ts delete mode 100644 src/ruby/location.ts delete mode 100644 src/ruby/nodes.ts delete mode 100644 src/ruby/nodes/alias.ts delete mode 100644 src/ruby/nodes/aref.ts delete mode 100644 src/ruby/nodes/args.ts delete mode 100644 src/ruby/nodes/arrays.ts delete mode 100644 src/ruby/nodes/assign.ts delete mode 100644 src/ruby/nodes/calls.ts delete mode 100644 src/ruby/nodes/case.ts delete mode 100644 src/ruby/nodes/class.ts delete mode 100644 src/ruby/nodes/commands.ts delete mode 100644 src/ruby/nodes/conditionals.ts delete mode 100644 src/ruby/nodes/constants.ts delete mode 100644 src/ruby/nodes/flow.ts delete mode 100644 src/ruby/nodes/hashes.ts delete mode 100644 src/ruby/nodes/heredocs.ts delete mode 100644 src/ruby/nodes/hooks.ts delete mode 100644 src/ruby/nodes/ints.ts delete mode 100644 src/ruby/nodes/lambdas.ts delete mode 100644 src/ruby/nodes/loops.ts delete mode 100644 src/ruby/nodes/massign.ts delete mode 100644 src/ruby/nodes/methods.ts delete mode 100644 src/ruby/nodes/operators.ts delete mode 100644 src/ruby/nodes/params.ts delete mode 100644 src/ruby/nodes/patterns.ts delete mode 100644 src/ruby/nodes/regexp.ts delete mode 100644 src/ruby/nodes/rescue.ts delete mode 100644 src/ruby/nodes/return.ts delete mode 100644 src/ruby/nodes/statements.ts delete mode 100644 src/ruby/nodes/strings.ts delete mode 100644 src/ruby/nodes/super.ts delete mode 100644 src/ruby/nodes/undef.ts delete mode 100644 src/ruby/parser.rb delete mode 100644 src/ruby/parser.ts delete mode 100644 src/ruby/printer.ts delete mode 100644 src/ruby/toProc.ts delete mode 100644 src/types/plugin.ts delete mode 100644 src/types/ruby.ts delete mode 100644 src/types/utils.ts delete mode 100644 src/utils.ts delete mode 100644 src/utils/containsAssignment.ts delete mode 100644 src/utils/getTrailingComma.ts delete mode 100644 src/utils/hasAncestor.ts delete mode 100644 src/utils/inlineEnsureParens.ts delete mode 100644 src/utils/isEmptyBodyStmt.ts delete mode 100644 src/utils/isEmptyParams.ts delete mode 100644 src/utils/isEmptyStmts.ts delete mode 100644 src/utils/literallineWithoutBreakParent.ts delete mode 100644 src/utils/makeCall.ts delete mode 100644 src/utils/noIndent.ts delete mode 100644 src/utils/printEmptyCollection.ts delete mode 100644 src/utils/skipAssignIndent.ts delete mode 100644 test/js/ruby/toProc.test.ts diff --git a/src/parser/server.rb b/src/parser/server.rb index f1248537..72e05ac9 100644 --- a/src/parser/server.rb +++ b/src/parser/server.rb @@ -6,11 +6,7 @@ require 'fileutils' require 'open3' -# Ensure the parent module is defined before requiring the parsers. -module Prettier -end - -require_relative '../ruby/parser' +require 'syntax_tree' require 'syntax_tree/haml' require 'syntax_tree/rbs' @@ -79,7 +75,7 @@ module Prettier when 'ping' 'pong' when 'ruby' - PrettierSyntaxTree.parse(source) + SyntaxTree.format(source) when 'rbs' SyntaxTree::RBS.format(source) when 'haml' @@ -91,7 +87,7 @@ module Prettier else socket.write('{ "error": true }') end - rescue PrettierSyntaxTree::ParseError => error + rescue SyntaxTree::Parser::ParseError => error loc = { start: { line: error.lineno, column: error.column } } socket.write(JSON.fast_generate(error: error.message, loc: loc)) rescue StandardError => error diff --git a/src/plugin.ts b/src/plugin.ts index 4dfe8220..182589ac 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -1,8 +1,4 @@ -import type { Parser, Plugin, SupportLanguage } from "prettier"; - -import rubyPrinter from "./ruby/printer"; -import rubyParser from "./ruby/parser"; - +import type { Plugin, SupportLanguage } from "prettier"; import parseSync from "./parser/parseSync"; interface ExtendedSupportLanguage extends SupportLanguage { @@ -93,7 +89,21 @@ const plugin: ExtendedPlugin = { } ], parsers: { - ruby: rubyParser as Parser, + ruby: { + parse(text) { + return parseSync("ruby", text); + }, + astFormat: "ruby", + hasPragma(text) { + return /^\s*#[^\S\n]*@(?:prettier|format)\s*?(?:\n|$)/m.test(text); + }, + locStart() { + return 0; + }, + locEnd() { + return 0; + } + }, rbs: { parse(text) { return parseSync("rbs", text); @@ -126,7 +136,14 @@ const plugin: ExtendedPlugin = { } }, printers: { - ruby: rubyPrinter, + ruby: { + print(path) { + return path.getValue(); + }, + insertPragma(text) { + return `# @format${text.startsWith("#") ? "\n" : "\n\n"}${text}`; + }, + }, rbs: { print(path) { return path.getValue(); diff --git a/src/ruby/embed.ts b/src/ruby/embed.ts deleted file mode 100644 index b7fb494b..00000000 --- a/src/ruby/embed.ts +++ /dev/null @@ -1,145 +0,0 @@ -import type { Plugin, Ruby } from "../types"; -import prettier from "../prettier"; -import { literallineWithoutBreakParent } from "../utils"; - -const { - group, - indent, - dedent, - lineSuffix, - mapDoc, - markAsRoot, - stripTrailingHardline -} = prettier; - -const parsers: Record = { - css: "css", - javascript: "babel", - js: "babel", - less: "less", - markdown: "markdown", - ruby: "ruby", - scss: "scss" -}; - -// This function is in here because it handles embedded parser values. I don't -// have a test that exercises it because I'm not sure for which parser it is -// necessary, but since it's in prettier core I'm keeping it here. -/* istanbul ignore next */ -function replaceNewlines(doc: Plugin.Doc) { - return mapDoc(doc, (currentDoc: Plugin.Doc) => - typeof currentDoc === "string" && currentDoc.includes("\n") - ? currentDoc - .split(/(\n)/g) - .map((v, i) => (i % 2 === 0 ? v : literallineWithoutBreakParent)) - : currentDoc - ); -} - -// Returns a number that represents the minimum amount of leading whitespace -// that is present on every line in the given string. So for example if you have -// the following heredoc: -// -// <<~HERE -// my -// content -// here -// HERE -// -// then the return value of this function would be 2. If you indented every line -// of the inner content 2 more spaces then this function would return 4. -function getCommonLeadingWhitespace(content: string) { - const pattern = /^\s+/; - - return content - .split("\n") - .slice(0, -1) - .filter((line) => line.trim().length > 0) - .reduce((minimum, line) => { - const matched = pattern.exec(line); - const length = matched ? matched[0].length : 0; - - return minimum === null ? length : Math.min(minimum, length); - }, content.length); -} - -// Returns a new string with the common whitespace stripped out. Effectively it -// emulates what a squiggly heredoc does in Ruby. -function stripCommonLeadingWhitespace(content: string) { - const lines = content.split("\n"); - const minimum = getCommonLeadingWhitespace(content); - - return lines.map((line) => line.slice(minimum)).join("\n"); -} - -// A type assertion so that TypeScript knows we're working with an array of -// exclusively plain string content. -function isTStringContentArray( - body: Ruby.StringContent[] -): body is Ruby.TStringContent[] { - return body.every((part) => part.type === "tstring_content"); -} - -const embed: Plugin.Embed = (path, print, textToDoc) => { - const node = path.getValue(); - - // Currently we only support embedded formatting on heredoc nodes - if (node.type !== "heredoc") { - return null; - } - - // First, ensure that we don't have any interpolation - const { beging, parts, ending } = node; - const isSquiggly = beging.value[2] === "~"; - - if (!isTStringContentArray(parts)) { - return null; - } - - // Next, find the parser associated with this heredoc (if there is one). For - // example, if you use <<~CSS, we'd hook it up to the css parser. - const parser = parsers[beging.value.slice(3).toLowerCase()]; - if (!parser) { - return null; - } - - // Get the content as if it were a source string. - let content = parts.map((part) => part.value).join(""); - - // If we're using a squiggly heredoc, then we're going to manually strip off - // the leading whitespace of each line up to the minimum leading whitespace so - // that the embedded parser can handle that for us. - if (isSquiggly) { - content = stripCommonLeadingWhitespace(content); - } - - // Pass that content into the embedded parser. Get back the doc node. - const formatted = [ - literallineWithoutBreakParent, - replaceNewlines(stripTrailingHardline(textToDoc(content, { parser }))) - ]; - - // If we're using a squiggly heredoc, then we can properly handle indentation - // ourselves. - if (isSquiggly) { - return [ - path.call(print, "beging"), - lineSuffix( - dedent([ - indent(markAsRoot(formatted)), - { type: "line", hard: true }, - ending.trim() - ]) - ) - ]; - } - - // Otherwise, we need to just assume it's formatted correctly and return the - // content as it is. - return markAsRoot([ - path.call(print, "beging"), - lineSuffix(group([formatted, literallineWithoutBreakParent, ending.trim()])) - ]); -}; - -export default embed; diff --git a/src/ruby/location.ts b/src/ruby/location.ts deleted file mode 100644 index a5ae7b69..00000000 --- a/src/ruby/location.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { Location } from "../types/ruby"; - -export function getStartLine(location: Location) { - return location[0]; -} - -export function getStartChar(location: Location) { - return location[1]; -} - -export function getEndLine(location: Location) { - return location[2]; -} - -export function getEndChar(location: Location) { - return location[3]; -} diff --git a/src/ruby/nodes.ts b/src/ruby/nodes.ts deleted file mode 100644 index 805ae81a..00000000 --- a/src/ruby/nodes.ts +++ /dev/null @@ -1,296 +0,0 @@ -import type { Plugin, Ruby } from "../types"; - -import { printAlias } from "./nodes/alias"; -import { printAref, printArefField } from "./nodes/aref"; -import { - printArgParen, - printArgs, - printArgsAddBlock, - printArgStar, - printBlockArg -} from "./nodes/args"; -import { - printArray, - printQsymbols, - printQwords, - printSymbols, - printWord, - printWords -} from "./nodes/arrays"; -import { - printAssign, - printOpAssign, - printVarField, - printVarRef -} from "./nodes/assign"; -import { printBlockVar, printBraceBlock, printDoBlock } from "./nodes/blocks"; -import { - printCall, - printCallContainer, - printMethodAddArg, - printMethodAddBlock -} from "./nodes/calls"; -import { printCase, printWhen } from "./nodes/case"; -import { printClass, printModule, printSClass } from "./nodes/class"; -import { printCommand, printCommandCall } from "./nodes/commands"; -import { - printElse, - printElsif, - printIf, - printIfModifier, - printTernary, - printUnless, - printUnlessModifier -} from "./nodes/conditionals"; -import { - printConstPath, - printConstRef, - printDefined, - printField, - printTopConst -} from "./nodes/constants"; -import { printBreak, printNext, printYield, printYield0 } from "./nodes/flow"; -import { - printAssoc, - printAssocSplat, - printHash, - printHashContents -} from "./nodes/hashes"; -import { printHeredoc } from "./nodes/heredocs"; -import { printBEGIN, printEND } from "./nodes/hooks"; -import { printInt } from "./nodes/ints"; -import { printLambda } from "./nodes/lambdas"; -import { printFor, printUntil, printWhile } from "./nodes/loops"; -import { - printMAssign, - printMLHS, - printMLHSParen, - printMRHS, - printMRHSAddStar, - printMRHSNewFromArgs -} from "./nodes/massign"; -import { printAccessControl, printDef, printDefEndless } from "./nodes/methods"; -import { - printBinary, - printDot2, - printDot3, - printNot, - printUnary -} from "./nodes/operators"; -import { - printArgsForward, - printExcessedComma, - printKeywordRestParam, - printParams, - printRestParam -} from "./nodes/params"; -import { - printAryPtn, - printFndPtn, - printHshPtn, - printIn, - printRAssign -} from "./nodes/patterns"; -import { printRegexpLiteral } from "./nodes/regexp"; -import { - printBegin, - printEnsure, - printRedo, - printRescue, - printRescueEx, - printRescueMod, - printRetry -} from "./nodes/rescue"; -import { printReturn, printReturn0 } from "./nodes/return"; -import { - printBodyStmt, - printComment, - printEndContent, - printParen, - printProgram, - printStatements -} from "./nodes/statements"; -import { - printChar, - printDynaSymbol, - printStringConcat, - printStringDVar, - printStringEmbExpr, - printStringLiteral, - printSymbolLiteral, - printXStringLiteral -} from "./nodes/strings"; -import { printSuper, printZSuper } from "./nodes/super"; -import { printUndef } from "./nodes/undef"; - -type Token = - | Ruby.EndContent - | Ruby.Backref - | Ruby.Backtick - | Ruby.Const - | Ruby.CVar - | Ruby.Float - | Ruby.GVar - | Ruby.HeredocBegin - | Ruby.Identifier - | Ruby.Imaginary - | Ruby.Int - | Ruby.IVar - | Ruby.Keyword - | Ruby.Label - | Ruby.Lbrace - | Ruby.Lparen - | Ruby.Op - | Ruby.Period - | Ruby.Rational - | Ruby.TStringContent; - -const printToken: Plugin.Printer = (path) => path.getValue().value; -const printVoidStmt: Plugin.Printer = () => ""; - -const nodes: Record< - Ruby.AnyNode["type"] | "comment" | "embdoc", - Plugin.Printer -> = { - BEGIN: printBEGIN, - CHAR: printChar, - END: printEND, - __end__: printEndContent, - access_ctrl: printAccessControl, - alias: printAlias, - aref: printAref, - aref_field: printArefField, - arg_paren: printArgParen, - args: printArgs, - args_add_block: printArgsAddBlock, - args_forward: printArgsForward, - arg_star: printArgStar, - array: printArray, - aryptn: printAryPtn, - assign: printAssign, - assoc: printAssoc, - assoc_splat: printAssocSplat, - assoclist_from_args: printHashContents, - backref: printToken, - backtick: printToken, - bare_assoc_hash: printHashContents, - begin: printBegin, - binary: printBinary, - block_var: printBlockVar, - blockarg: printBlockArg, - bodystmt: printBodyStmt, - brace_block: printBraceBlock, - break: printBreak, - call: printCall, - case: printCase, - class: printClass, - command: printCommand, - command_call: printCommandCall, - comment: printComment, - const: printToken, - const_path_field: printConstPath, - const_path_ref: printConstPath, - const_ref: printConstRef, - cvar: printToken, - def: printDef, - def_endless: printDefEndless, - defined: printDefined, - defs: printDef, - do_block: printDoBlock, - dot2: printDot2, - dot3: printDot3, - dyna_symbol: printDynaSymbol, - else: printElse, - elsif: printElsif, - embdoc: printComment, - ensure: printEnsure, - excessed_comma: printExcessedComma, - fcall: printCallContainer, - field: printField, - float: printToken, - fndptn: printFndPtn, - for: printFor, - gvar: printToken, - hash: printHash, - heredoc: printHeredoc, - heredoc_beg: printToken, - hshptn: printHshPtn, - ident: printToken, - if: printIf, - if_mod: printIfModifier, - ifop: printTernary, - imaginary: printToken, - in: printIn, - int: printInt, - ivar: printToken, - kw: printToken, - kwrest_param: printKeywordRestParam, - label: printToken, - lambda: printLambda, - lbrace: printToken, - lparen: printToken, - massign: printMAssign, - method_add_arg: printMethodAddArg, - method_add_block: printMethodAddBlock, - mlhs: printMLHS, - mlhs_paren: printMLHSParen, - module: printModule, - mrhs: printMRHS, - mrhs_add_star: printMRHSAddStar, - mrhs_new_from_args: printMRHSNewFromArgs, - next: printNext, - not: printNot, - op: printToken, - opassign: printOpAssign, - params: printParams, - paren: printParen, - period: printToken, - program: printProgram, - qsymbols: printQsymbols, - qwords: printQwords, - rassign: printRAssign, - rational: printToken, - redo: printRedo, - regexp_literal: printRegexpLiteral, - rescue: printRescue, - rescue_ex: printRescueEx, - rescue_mod: printRescueMod, - rest_param: printRestParam, - retry: printRetry, - return0: printReturn0, - return: printReturn, - sclass: printSClass, - statements: printStatements, - string_concat: printStringConcat, - string_dvar: printStringDVar, - string_embexpr: printStringEmbExpr, - string_literal: printStringLiteral, - super: printSuper, - symbol_literal: printSymbolLiteral, - symbols: printSymbols, - top_const_field: printTopConst, - top_const_ref: printTopConst, - tstring_content: printToken, - unary: printUnary, - undef: printUndef, - unless: printUnless, - unless_mod: printUnlessModifier, - until: printUntil, - until_mod: printUntil, - var_alias: printAlias, - var_field: printVarField, - var_ref: printVarRef, - vcall: printCallContainer, - void_stmt: printVoidStmt, - when: printWhen, - while: printWhile, - while_mod: printWhile, - word: printWord, - words: printWords, - xstring_literal: printXStringLiteral, - yield0: printYield0, - yield: printYield, - zsuper: printZSuper -}; - -export default nodes; diff --git a/src/ruby/nodes/alias.ts b/src/ruby/nodes/alias.ts deleted file mode 100644 index 3ea96cfc..00000000 --- a/src/ruby/nodes/alias.ts +++ /dev/null @@ -1,69 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; - -const { addTrailingComment, align, group, hardline, line } = prettier; - -type AliasArg = Ruby.Backref | Ruby.DynaSymbol | Ruby.GVar | Ruby.SymbolLiteral; - -// The `alias` keyword is used to make a method respond to another name as well -// as the current one. For example, to get the method `foo` to also respond to -// `bar`, you would: -// -// alias bar foo -// -// Now, in the current context you can call `bar` and it will execute the `foo` -// method. -// -// When you're aliasing two methods, you can either provide bare words (like the -// example above) or you can provide symbols (note that this includes dynamic -// symbols like :"foo-#{bar}-baz"). In general, to be consistent with the ruby -// style guide, we prefer bare words: -// -// https://github.com/rubocop-hq/ruby-style-guide#alias-method-lexically -// -// The `alias` node contains two children. The left and right align with the -// arguments passed to the keyword. So, for the above example the left would be -// the symbol literal `bar` and the right could be the symbol literal `foo`. -export const printAlias: Plugin.Printer = ( - path, - opts, - print -) => { - const keyword = "alias "; - const node = path.getValue(); - - // In general, return the printed doc of the argument at the provided index. - // Special handling is given for symbol literals that are not bare words, as - // we convert those into bare words by just pulling out the ident node. - const printAliasArg = (argPath: Plugin.Path) => { - const argNode = argPath.getValue(); - - if (argNode.type === "symbol_literal") { - // If we're going to descend into the symbol literal to grab out the ident - // node, then we need to make sure we copy over any comments as well, - // otherwise we could accidentally skip printing them. - if (argNode.comments) { - argNode.comments.forEach((comment) => { - addTrailingComment(argNode.value, comment); - }); - } - - return argPath.call(print, "value"); - } - - return print(argPath); - }; - - return group([ - keyword, - path.call(printAliasArg, "left"), - group( - align(keyword.length, [ - // If the left child has any comments, then we need to explicitly break - // this into two lines - node.left.comments ? hardline : line, - path.call(printAliasArg, "right") - ]) - ) - ]); -}; diff --git a/src/ruby/nodes/aref.ts b/src/ruby/nodes/aref.ts deleted file mode 100644 index e5429ffa..00000000 --- a/src/ruby/nodes/aref.ts +++ /dev/null @@ -1,52 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; - -const { group, indent, join, line, softline } = prettier; - -// `aref` nodes are when you're pulling a value out of a collection at a -// specific index. Put another way, it's any time you're calling the method -// `#[]`. -// -// The nodes usually contains two children, details below in the -// `printArefField` function. In some cases, you don't necessarily have the -// second child node, because you can call procs with a pretty esoteric syntax. -// In the following example, you wouldn't have a second child, and `"foo"` would -// be the first child. -// -// foo[] -// -export const printAref: Plugin.Printer = (path, opts, print) => { - if (!path.getValue().index) { - return [path.call(print, "collection"), "[]"]; - } - - return printArefField(path, opts, print); -}; - -// `aref_field` nodes are for assigning values into collections at specific -// indices. Put another way, it's any time you're calling the method `#[]=`. -// The `aref_field` node itself is just the left side of the assignment, and -// they're always wrapped in `assign` nodes. -// -// The nodes always contain two children, the name of the array (usually a -// `vcall` node and the index (usually an `args_add_block` node). The -// `args_add_block` is one of a couple nodes that has special handling where its -// printed form is actually an array to make joining easier. -// -// So in the following example, `"foo"` is the array and `["bar"]` is the index. -// -// foo[bar] = baz -// -export const printArefField: Plugin.Printer = ( - path, - opts, - print -) => { - return group([ - path.call(print, "collection"), - "[", - indent([softline, join([",", line], path.call(print, "index"))]), - softline, - "]" - ]); -}; diff --git a/src/ruby/nodes/args.ts b/src/ruby/nodes/args.ts deleted file mode 100644 index 6e1d142f..00000000 --- a/src/ruby/nodes/args.ts +++ /dev/null @@ -1,172 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; - -import { getTrailingComma } from "../../utils"; -import toProc from "../toProc"; - -const { group, ifBreak, indent, join, line, softline } = prettier; - -const noTrailingComma = ["command", "command_call"]; - -function getArgs(node: Ruby.Args | Ruby.ArgsAddBlock): Ruby.AnyNode[] { - switch (node.type) { - case "args": - return node.parts; - case "args_add_block": { - const args = getArgs(node.args); - return node.block ? [...args, node.block] : args; - } - } -} - -function getArgParenTrailingComma(node: Ruby.Args | Ruby.ArgsAddBlock) { - // If we have a block, then we don't want to add a trailing comma. - if (node.type === "args_add_block" && node.block) { - return ""; - } - - // If we only have one argument and that first argument necessitates that we - // skip putting a comma (because it would interfere with parsing the argument) - // then we don't want to add a trailing comma. - const args = getArgs(node); - if (args.length === 1 && noTrailingComma.includes(args[0].type)) { - return ""; - } - - return ifBreak(",", ""); -} - -export const printArgParen: Plugin.Printer = ( - path, - opts, - print -) => { - const argsNode = path.getValue().args; - - if (argsNode === null) { - return ""; - } - - // Here we can skip the entire rest of the method by just checking if it's - // an args_forward node, as we're guaranteed that there are no other arg - // nodes. - if (argsNode.type === "args_forward") { - return group([ - "(", - indent([softline, path.call(print, "args")]), - softline, - ")" - ]); - } - - // Now here we return a doc that represents the whole grouped expression, - // including the surrouding parentheses. - return group([ - "(", - indent([ - softline, - join([",", line], path.call(print, "args")), - getTrailingComma(opts) ? getArgParenTrailingComma(argsNode) : "" - ]), - softline, - ")" - ]); -}; - -export const printArgs: Plugin.Printer = ( - path, - { rubyToProc }, - print -) => { - const args = path.map(print, "parts"); - - // Don't bother trying to do any kind of fancy toProc transform if the - // option is disabled. - if (rubyToProc) { - let blockNode = null; - - // Look up the chain to see if these arguments are contained within a - // method_add_block node, and if they are that that node has a block - // associated with it. If it does, we're going to attempt to transform it - // into the to_proc shorthand and add it to the list of arguments. - [1, 2, 3].find((parent) => { - const parentNode = path.getParentNode(parent) as Ruby.AnyNode; - blockNode = - parentNode && - parentNode.type === "method_add_block" && - parentNode.block; - - return blockNode; - }); - - const proc = blockNode && toProc(path, blockNode); - - // If we have a successful to_proc transformation, but we're part of an - // aref node, that means it's something to the effect of - // - // foo[:bar].each(&:to_s) - // - // In this case we need to just return regular arguments, otherwise we - // would end up putting &:to_s inside the brackets accidentally. - if (proc && path.getParentNode(1).type !== "aref") { - args.push(proc); - } - } - - return args; -}; - -export const printArgsAddBlock: Plugin.Printer = ( - path, - opts, - print -) => { - const node = path.getValue(); - const parts = path.call(print, "args") as Plugin.Doc[]; - - if (node.block) { - let blockDoc = path.call(print, "block") as any; - - if (!(node.block.comments || []).some(({ leading }) => leading)) { - // If we don't have any leading comments, we can just prepend the - // operator. - blockDoc = ["&", blockDoc]; - } else { - // If we have a method call like: - // - // foo( - // # comment - // &block - // ) - // - // then we need to make sure we don't accidentally prepend the operator - // before the comment. - // - // In prettier >= 2.3.0, the comments are printed as an array before the - // content. I don't love this kind of reflection, but it's the simplest - // way at the moment to get this right. - blockDoc = blockDoc[0].concat(["&", blockDoc[1]], blockDoc.slice(2)); - } - - parts.push(blockDoc); - } - - return parts; -}; - -export const printBlockArg: Plugin.Printer = ( - path, - opts, - print -) => { - return ["&", path.call(print, "name")]; -}; - -export const printArgStar: Plugin.Printer = ( - path, - opts, - print -) => { - const node = path.getValue(); - return node.value ? ["*", path.call(print, "value")] : "*"; -}; diff --git a/src/ruby/nodes/arrays.ts b/src/ruby/nodes/arrays.ts deleted file mode 100644 index 06ef07cf..00000000 --- a/src/ruby/nodes/arrays.ts +++ /dev/null @@ -1,145 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; -import { getTrailingComma, printEmptyCollection } from "../../utils"; - -const { group, ifBreak, indent, join, line, softline } = prettier; - -// Checks that every argument within this args node is a string_literal node -// that has no spaces or interpolations. This means we're dealing with an array -// that looks something like: -// -// ['a', 'b', 'c'] -// -function isStringArray(args: Ruby.Args) { - return ( - args.parts.length > 1 && - args.parts.every((arg) => { - // We want to verify that every node inside of this array is a string - // literal. We also want to make sure none of them have comments attached. - if (arg.type !== "string_literal" || arg.comments) { - return false; - } - - // If the string has multiple parts (meaning plain string content but also - // interpolated content) then we know it's not a simple string. - if (arg.parts.length !== 1) { - return false; - } - - const part = arg.parts[0]; - - // If the only part of this string is not @tstring_content then it's - // interpolated, so again we can return false. - if (part.type !== "tstring_content") { - return false; - } - - // Finally, verify that the string doesn't contain a space, an escape - // character, or brackets so that we know it can be put into a string - // literal array. - return !/[\s\\[\]]/.test(part.value); - }) - ); -} - -// Checks that every argument within this args node is a symbol_literal node (as -// opposed to a dyna_symbol) so it has no interpolation. This means we're -// dealing with an array that looks something like: -// -// [:a, :b, :c] -// -function isSymbolArray(args: Ruby.Args) { - return ( - args.parts.length > 1 && - args.parts.every((arg) => arg.type === "symbol_literal" && !arg.comments) - ); -} - -// Prints out a word that is a part of a special array literal that accepts -// interpolation. The body is an array of either plain strings or interpolated -// expressions. -export const printWord: Plugin.Printer = (path, opts, print) => { - return path.map(print, "parts"); -}; - -// Prints out a special array literal. Accepts the parts of the array literal as -// an argument, where the first element of the parts array is a string that -// contains the special start. -function printArrayLiteralParts(start: string, parts: Plugin.Doc[]) { - return group([ - start, - "[", - indent([softline, join(line, parts)]), - softline, - "]" - ]); -} - -function printArrayLiteral(start: string): Plugin.Printer { - return function printArrayLiteralWithStart(path, opts, print) { - return printArrayLiteralParts(start, (path as any).map(print, "elems")); - }; -} - -export const printQsymbols = printArrayLiteral("%i"); -export const printQwords = printArrayLiteral("%w"); -export const printSymbols = printArrayLiteral("%I"); -export const printWords = printArrayLiteral("%W"); - -// An array node is any literal array in Ruby. This includes all of the special -// array literals as well as regular arrays. If it is a special array literal -// then it will have one child that represents the special array, otherwise it -// will have one child that contains all of the elements of the array. -export const printArray: Plugin.Printer = (path, opts, print) => { - const array = path.getValue(); - const contents = array.cnts; - - // If there is no inner arguments node, then we're dealing with an empty - // array, so we can go ahead and return. - if (contents === null) { - return printEmptyCollection(path, opts, "[", "]"); - } - - if (opts.rubyArrayLiteral) { - // If we have an array that contains only simple string literals with no - // spaces or interpolation, then we're going to print a %w array. - if (isStringArray(contents)) { - const printString = (stringPath: Plugin.Path) => - stringPath.call(print, "parts", 0); - - const nodePath = path as Plugin.Path<{ - cnts: { parts: Ruby.StringLiteral[] }; - }>; - const parts = nodePath.map(printString, "cnts", "parts"); - - return printArrayLiteralParts("%w", parts); - } - - // If we have an array that contains only simple symbol literals with no - // interpolation, then we're going to print a %i array. - if (isSymbolArray(contents)) { - const printSymbol = (symbolPath: Plugin.Path) => - symbolPath.call(print, "value"); - - const nodePath = path as Plugin.Path<{ - cnts: { parts: Ruby.SymbolLiteral[] }; - }>; - const parts = nodePath.map(printSymbol, "cnts", "parts"); - - return printArrayLiteralParts("%i", parts); - } - } - - // Here we have a normal array of any type of object with no special literal - // types or anything. - return group([ - "[", - indent([ - softline, - join([",", line], path.call(print, "cnts")), - getTrailingComma(opts) ? ifBreak(",", "") : "" - ]), - softline, - "]" - ]); -}; diff --git a/src/ruby/nodes/assign.ts b/src/ruby/nodes/assign.ts deleted file mode 100644 index 90cda112..00000000 --- a/src/ruby/nodes/assign.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; -import { skipAssignIndent } from "../../utils"; -import { Doc, Path } from "../../types/plugin"; - -const { group, indent, join, line } = prettier; - -export const printAssign: Plugin.Printer = (...args) => { - return printOpAssignOrAssign("=", ...args); -}; - -export const printOpAssign: Plugin.Printer = ( - path, - opts, - print -) => { - const opDoc = path.call(print, "op"); - return printOpAssignOrAssign(opDoc, path, opts, print); -}; - -function printOpAssignOrAssign( - opDoc: Doc, - path: Path, - opts: Plugin.Options, - print: Plugin.Print -): Doc { - const valueNode = path.getValue().value; - - const targetDoc = path.call(print, "target"); - const valueDoc = path.call(print, "value"); - - let rightSideDoc = valueDoc; - - // If the right side of this assignment is a multiple assignment, then we need - // to join it together with commas. - if ( - ["mrhs", "mrhs_add_star", "mrhs_new_from_args"].includes(valueNode.type) - ) { - rightSideDoc = group(join([",", line], valueDoc)); - } - - if (skipAssignIndent(valueNode)) { - return group([targetDoc, " ", opDoc, " ", rightSideDoc]); - } - - return group([targetDoc, " ", opDoc, indent([line, rightSideDoc])]); -} - -export const printVarField: Plugin.Printer = ( - path, - opts, - print -) => (path.getValue().value ? path.call(print, "value") : ""); - -export const printVarRef: Plugin.Printer = (path, opts, print) => - path.call(print, "value"); diff --git a/src/ruby/nodes/calls.ts b/src/ruby/nodes/calls.ts deleted file mode 100644 index cd6af2be..00000000 --- a/src/ruby/nodes/calls.ts +++ /dev/null @@ -1,330 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; -import { makeCall, noIndent } from "../../utils"; -import toProc from "../toProc"; - -const { group, hardline, ifBreak, indent, join, softline } = prettier; -const chained = ["call", "method_add_arg", "method_add_block"]; - -function hasLeadingComments(node: Ruby.AnyNode) { - return node.comments?.some(({ leading }) => leading); -} - -// We decorate these nodes with a bunch of extra stuff so that we can display -// nice method chains. -type Chain = { - chain?: number; - callChain?: number; - breakDoc?: Plugin.Doc[]; - firstReceiverType?: string; -}; - -type ChainedCall = Ruby.Call & Chain; -type ChainedMethodAddArg = Ruby.MethodAddArg & Chain; -type ChainedMethodAddBlock = Ruby.MethodAddBlock & Chain; - -export const printCall: Plugin.Printer = (path, opts, print) => { - const node = path.getValue(); - - const receiverDoc = path.call(print, "receiver"); - const operatorDoc = makeCall(path, opts, print); - - // You can call lambdas with a special syntax that looks like func.(*args). - // In this case, "call" is returned for the 3rd child node. We don't alter - // call syntax so if `call` is implicit, we don't print it out. - const messageDoc = node.message === "call" ? "" : path.call(print, "message"); - - // Create some arrays that are going to represent each side of our call. - let leftSideDoc = [receiverDoc]; - let rightSideDoc = [operatorDoc, messageDoc]; - - // If there are leading comments on the right side of the call, then it means - // we have a structure where there's a receiver and an operator together, then - // a comment, then the message, as in: - // - // foo. - // # comment - // baz - // - // In the case we need to group the receiver and the operator together or - // we'll end up with a syntax error. - const operatorIsTrailing = - node.message !== "call" && hasLeadingComments(node.message); - - if (operatorIsTrailing) { - leftSideDoc = [receiverDoc, operatorDoc]; - rightSideDoc = [messageDoc]; - } - - // For certain left sides of the call nodes, we want to attach directly to - // the } or end. - if (noIndent.includes(node.receiver.type)) { - return [leftSideDoc, rightSideDoc]; - } - - if ( - node.receiver.type === "call" && - node.receiver.message !== "call" && - node.receiver.message.value === "where" && - messageDoc === "not" - ) { - // This is very specialized behavior wherein we group .where.not calls - // together because it looks better. For more information, see - // https://github.com/prettier/plugin-ruby/issues/862. - } else { - // Otherwise, we're going to put a line node into the right side doc. - rightSideDoc.unshift(node.receiver.comments ? hardline : softline); - } - - // Get a reference to the parent node so we can check if we're inside a chain - const parentNode = path.getParentNode(); - - // If our parent node is a chained node then we're not going to group the - // right side of the expression, as we want to have a nice multi-line layout. - if (chained.includes(parentNode.type) && !node.comments) { - parentNode.chain = (node.chain || 0) + 1; - parentNode.callChain = (node.callChain || 0) + 1; - parentNode.firstReceiverType = node.firstReceiverType || node.receiver.type; - - // Here we're going to determine what doc nodes to send up to the parent - // node to represent when we're in the multi-line form. - let breakDocLHS: Plugin.Doc[]; - - if (node.breakDoc && operatorIsTrailing) { - // Here we already have a child node that has passed up its - // representation. In this case node.breakDoc represents the receiver - // without any lines inserted. With regard to this node, it means it's - // everything up until the operator. So we're just going to append the - // operator. - breakDocLHS = node.breakDoc.concat(operatorDoc); - } else if (node.breakDoc) { - // Here we don't need a trailing operator, so we're just going to use the - // existing node.breakDoc. The operator will be a part of the rightSideDoc - // variable. - breakDocLHS = node.breakDoc; - } else { - // Here we're at the bottom of the chain, so there's no representation yet - // for the receiver. So we're just going to pass up the left side. - breakDocLHS = leftSideDoc; - } - - parentNode.breakDoc = breakDocLHS.concat(rightSideDoc); - } - - // If we're at the top of a chain, then we're going to print out a nice - // multi-line layout if this doesn't break into multiple lines. - if ( - !chained.includes(parentNode.type) && - (node.chain || 0) >= 3 && - node.breakDoc - ) { - return ifBreak(group(indent(node.breakDoc.concat(rightSideDoc))), [ - leftSideDoc, - group(rightSideDoc) - ]); - } - - return group([leftSideDoc, group(indent(rightSideDoc))]); -}; - -export const printMethodAddArg: Plugin.Printer = ( - path, - opts, - print -) => { - const node = path.getValue(); - - const methodDoc = path.call(print, "call"); - const argsDoc = path.call(print, "args") as Plugin.Doc[]; - - // You can end up here if you have a method with a ? ending, presumably - // because the parser knows that it cannot be a local variable. You can also - // end up here if you are explicitly using an empty set of parentheses. - if (argsDoc.length === 0) { - // If you're using an explicit set of parentheses on something that looks - // like a constant, then we need to match that in order to maintain valid - // Ruby. For example, you could do something like Foo(), on which we would - // need to keep the parentheses to make it look like a method call. - if (node.call.type === "fcall" && node.call.value.type === "const") { - return [methodDoc, "()"]; - } - - // If you're using an explicit set parentheses with the special call syntax, - // then we need to explicitly print out an extra set of parentheses. For - // example, if you call something like Foo.new.() (implicitly calling the - // #call method on a new instance of the Foo class), then we have to print - // out those parentheses, otherwise we'll end up with Foo.new. - if (node.call.type === "call" && node.call.message === "call") { - return [methodDoc, "()"]; - } - - return methodDoc; - } - - // This case will ONLY be hit if we can successfully turn the block into a - // to_proc call. In that case, we just explicitly add the parens around it. - if (node.args.type === "args" && argsDoc.length > 0) { - return [methodDoc, "(", ...argsDoc, ")"]; - } - - // Get a reference to the parent node so we can check if we're inside a chain - const parentNode = path.getParentNode(); - - // If our parent node is a chained node then we're not going to group the - // right side of the expression, as we want to have a nice multi-line layout. - if (chained.includes(parentNode.type) && !node.comments) { - parentNode.chain = (node.chain || 0) + 1; - parentNode.breakDoc = (node.breakDoc || [methodDoc]).concat(argsDoc); - parentNode.firstReceiverType = node.firstReceiverType; - } - - // This is the threshold at which we will start to try to make a nicely - // indented call chain. For the most part, it's always 3. - let threshold = 3; - - // Here, we have very specialized behavior where if we're within a sig block, - // then we're going to assume we're creating a Sorbet type signature. In that - // case, we really want the threshold to be lowered to 2 so that we create - // method chains off of any two method calls within the block. For more - // details, see - // https://github.com/prettier/plugin-ruby/issues/863. - let sigBlock = path.getParentNode(2); - if (sigBlock) { - // If we're at a do_block, then we want to go one more level up. This is - // because do_blocks have bodystmt nodes instead of just stmt nodes. - if (sigBlock.type === "do_block") { - sigBlock = path.getParentNode(3); - } - - if (sigBlock.type === "method_add_block") { - // Pulling this out into a separate variable so we can get back some of - // our type safety. - const sigBlockNode = sigBlock as Ruby.MethodAddBlock; - - if ( - sigBlockNode.block && - sigBlockNode.call.type === "method_add_arg" && - sigBlockNode.call.call.type === "fcall" && - sigBlockNode.call.call.value.value === "sig" - ) { - threshold = 2; - } - } - } - - // If we're at the top of a chain, then we're going to print out a nice - // multi-line layout if this doesn't break into multiple lines. - if ( - !chained.includes(parentNode.type) && - (node.chain || 0) >= threshold && - node.breakDoc - ) { - // This is pretty specialized behavior. Basically if we're at the top of a - // chain but we've only had method calls without arguments and now we have - // arguments, then we're effectively trying to call a method with arguments - // that is nested under a bunch of stuff. So we group together to first part - // to make it so just the arguments break. This looks like, for example: - // - // config.action_dispatch.rescue_responses.merge!( - // 'ActiveRecord::ConnectionTimeoutError' => :service_unavailable, - // 'ActiveRecord::QueryCanceled' => :service_unavailable - // ) - // - if (node.callChain === node.chain) { - return [group(indent(node.breakDoc)), group(argsDoc)]; - } - - return ifBreak(group(indent(node.breakDoc.concat(argsDoc))), [ - methodDoc, - argsDoc - ]); - } - - // If there are already parentheses, then we can just use the doc that's - // already printed. - if (node.args.type == "arg_paren") { - return group([methodDoc, argsDoc]); - } - - return [methodDoc, " ", join(", ", argsDoc), " "]; -}; - -export const printMethodAddBlock: Plugin.Printer = ( - path, - opts, - print -) => { - const node = path.getValue(); - - const callDoc = path.call(print, "call"); - const blockDoc = path.call(print, "block"); - - // Don't bother trying to do any kind of fancy toProc transform if the option - // is disabled. - if (opts.rubyToProc) { - const proc = toProc(path, node.block); - - if (proc && node.call.type === "call") { - return group([ - path.call(print, "call"), - "(", - indent([softline, proc]), - [softline, ")"] - ]); - } - - if (proc) { - return path.call(print, "call"); - } - } - - // Get a reference to the parent node so we can check if we're inside a chain - const parentNode = path.getParentNode(); - - // If our parent node is a chained node then we're not going to group the - // right side of the expression, as we want to have a nice multi-line layout. - if (chained.includes(parentNode.type)) { - parentNode.chain = (node.chain || 0) + 1; - parentNode.breakDoc = (node.breakDoc || [callDoc]).concat(blockDoc); - parentNode.firstReceiverType = node.firstReceiverType; - } - - // If we're at the top of a chain, then we're going to print out a nice - // multi-line layout if this doesn't break into multiple lines. - if ( - !chained.includes(parentNode.type) && - (node.chain || 0) >= 3 && - node.breakDoc - ) { - // This is pretty specialized behavior. Basically if we're at the top of a - // chain but we've only had method calls without arguments and now we have - // a method call with a block, then we're effectively trying to call a - // method with arguments that is nested under a bunch of stuff. So we group - // together to first part to make it so just the block breaks. This looks - // like, for example: - // - // Rails.application.routes.draw do - // root 'articles#index' - // resources :articles - // end - // - if (node.callChain === node.chain) { - return [group(indent(node.breakDoc)), group(blockDoc)]; - } - - return ifBreak(group(indent(node.breakDoc.concat(blockDoc))), [ - callDoc, - blockDoc - ]); - } - - return [callDoc, blockDoc]; -}; - -export const printCallContainer: Plugin.Printer = ( - path, - opts, - print -) => { - return path.call(print, "value"); -}; diff --git a/src/ruby/nodes/case.ts b/src/ruby/nodes/case.ts deleted file mode 100644 index 38195675..00000000 --- a/src/ruby/nodes/case.ts +++ /dev/null @@ -1,59 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; - -const { align, fill, group, hardline, indent, line } = prettier; - -export const printCase: Plugin.Printer = (path, opts, print) => { - const parts: Plugin.Doc[] = ["case"]; - - // You don't need to explicitly have something to test against in a case - // statement (without it it effectively becomes an if/elsif chain). - if (path.getValue().value) { - parts.push(" ", path.call(print, "value")); - } - - return [...parts, hardline, path.call(print, "cons"), hardline, "end"]; -}; - -export const printWhen: Plugin.Printer = (path, opts, print) => { - const node = path.getValue(); - - // The `fill` builder command expects an array of docs alternating with - // line breaks. This is so it can loop through and determine where to break. - const preds = fill( - (path.call(print, "args") as Plugin.Doc[]).reduce( - (accum: Plugin.Doc[], pred, index) => { - if (index === 0) { - return [pred]; - } - - // Pull off the last element and make it concat with a comma so that - // we can maintain alternating lines and docs. - return [ - ...accum.slice(0, -1), - [accum[accum.length - 1], ","], - line, - pred - ]; - }, - [] as Plugin.Doc[] - ) - ); - - const stmts = path.call(print, "stmts") as Plugin.Doc[]; - const parts: Plugin.Doc[] = [["when ", align("when ".length, preds)]]; - - // It's possible in a when to just have empty void statements, in which case - // we would skip adding the body. - if (!stmts.every((part) => !part)) { - parts.push(indent([hardline, stmts])); - } - - // This is the next clause on the case statement, either another `when` or - // an `else` clause. - if (node.cons) { - parts.push(hardline, path.call(print, "cons")); - } - - return group(parts); -}; diff --git a/src/ruby/nodes/class.ts b/src/ruby/nodes/class.ts deleted file mode 100644 index a03b7502..00000000 --- a/src/ruby/nodes/class.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; -import { isEmptyBodyStmt } from "../../utils"; - -const { group, hardline, indent } = prettier; - -export const printClass: Plugin.Printer = (path, opts, print) => { - const node = path.getValue(); - - const parts = ["class ", path.call(print, "constant")]; - if (node.superclass) { - parts.push(" < ", path.call(print, "superclass")); - } - - const declaration = group(parts); - if (isEmptyBodyStmt(node.bodystmt)) { - return group([declaration, hardline, "end"]); - } - - return group([ - declaration, - indent([hardline, path.call(print, "bodystmt")]), - [hardline, "end"] - ]); -}; - -export const printModule: Plugin.Printer = (path, opts, print) => { - const node = path.getValue(); - const declaration = group(["module ", path.call(print, "constant")]); - - if (isEmptyBodyStmt(node.bodystmt)) { - return group([declaration, hardline, "end"]); - } - - return group([ - declaration, - indent([hardline, path.call(print, "bodystmt")]), - hardline, - "end" - ]); -}; - -export const printSClass: Plugin.Printer = (path, opts, print) => { - const node = path.getValue(); - const declaration = ["class << ", path.call(print, "target")]; - - if (isEmptyBodyStmt(node.bodystmt)) { - return group([declaration, hardline, "end"]); - } - - return group([ - declaration, - indent([hardline, path.call(print, "bodystmt")]), - hardline, - "end" - ]); -}; diff --git a/src/ruby/nodes/commands.ts b/src/ruby/nodes/commands.ts deleted file mode 100644 index 74424247..00000000 --- a/src/ruby/nodes/commands.ts +++ /dev/null @@ -1,163 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; -import { makeCall } from "../../utils"; - -const { align, group, ifBreak, indent, join, line, softline } = prettier; - -function throwBadDoc(doc: never): never; -function throwBadDoc(doc: Plugin.Doc) { - throw new Error(`Unknown doc ${doc}`); -} - -function reduceDocLength(sum: number, doc: Plugin.Doc) { - // If we've hit a line, then we're going to start the counting back at 0 since - // it will be starting from the beginning of a line. - if (typeof doc === "object" && !Array.isArray(doc) && doc.type === "line") { - return 0; - } - - return sum + docBreakLength(doc); -} - -// Loop through the already created doc nodes and determine the overall length -// so that we can properly align the command arguments. -function docBreakLength(doc: Plugin.Doc): number { - if (Array.isArray(doc)) { - return doc.reduce(reduceDocLength, 0); - } - - if (typeof doc === "string") { - return doc.length; - } - - switch (doc.type) { - case "concat": - case "fill": - return doc.parts.reduce(reduceDocLength, 0); - case "align": - case "group": - case "indent": - case "line-suffix": - return docBreakLength(doc.contents); - case "if-break": - return docBreakLength(doc.breakContents); - case "line": - return 0; - case "break-parent": - case "cursor": - case "indent-if-break": - case "label": - case "line-suffix-boundary": - case "trim": - return 0; - default: - throwBadDoc(doc); - } -} - -function hasDef(node: Ruby.Command) { - return ( - node.args.type === "args_add_block" && - node.args.args.type === "args" && - node.args.args.parts[0] && - ["def", "defs"].includes(node.args.args.parts[0].type) - ); -} - -// Very special handling case for rspec matchers. In general with rspec matchers -// you expect to see something like: -// -// expect(foo).to receive(:bar).with( -// 'one', -// 'two', -// 'three', -// 'four', -// 'five' -// ) -// -// In this case the arguments are aligned to the left side as opposed to being -// aligned with the `receive` call. -function skipArgsAlign(node: Ruby.CommandCall) { - return ["to", "not_to", "to_not"].includes(node.message.value); -} - -// If there is a ternary argument to a command and it's going to get broken -// into multiple lines, then we're going to have to use parentheses around the -// command in order to make sure operator precedence doesn't get messed up. -function hasTernaryArg(node: Ruby.Args | Ruby.ArgsAddBlock): boolean { - switch (node.type) { - case "args": - return node.parts.some((child) => child.type === "ifop"); - case "args_add_block": - return hasTernaryArg(node.args) || node.block?.type === "ifop"; - } -} - -export const printCommand: Plugin.Printer = ( - path, - opts, - print -) => { - const node = path.getValue(); - - const command = path.call(print, "message"); - const joinedArgs = join([",", line], path.call(print, "args")); - - const hasTernary = hasTernaryArg(node.args); - let breakArgs; - - if (hasTernary) { - breakArgs = indent([softline, joinedArgs]); - } else if (hasDef(node)) { - breakArgs = joinedArgs; - } else { - breakArgs = align(docBreakLength(command) + 1, joinedArgs); - } - - return group( - ifBreak( - [ - command, - hasTernary ? "(" : " ", - breakArgs, - hasTernary ? [softline, ")"] : "" - ], - [command, " ", joinedArgs] - ) - ); -}; - -export const printCommandCall: Plugin.Printer = ( - path, - opts, - print -) => { - const node = path.getValue(); - const parts = [ - path.call(print, "receiver"), - makeCall(path, opts, print), - path.call(print, "message") - ]; - - if (!node.args) { - return parts; - } - - const argDocs = join([",", line], path.call(print, "args")); - let breakDoc; - - if (hasTernaryArg(node.args)) { - breakDoc = parts.concat("(", indent([softline, argDocs]), softline, ")"); - parts.push(" "); - } else if (skipArgsAlign(node)) { - parts.push(" "); - breakDoc = parts.concat(argDocs); - } else { - parts.push(" "); - breakDoc = parts.concat(align(docBreakLength(parts), argDocs)); - } - - const joinedDoc = parts.concat(argDocs); - - return group(ifBreak(breakDoc, joinedDoc)); -}; diff --git a/src/ruby/nodes/conditionals.ts b/src/ruby/nodes/conditionals.ts deleted file mode 100644 index ea18e9da..00000000 --- a/src/ruby/nodes/conditionals.ts +++ /dev/null @@ -1,323 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; -import { - containsAssignment, - inlineEnsureParens, - isEmptyStmts -} from "../../utils"; - -const { align, breakParent, hardline, group, ifBreak, indent, softline } = - prettier; - -type Conditional = Ruby.If | Ruby.Unless; - -// If the statements are just a single if/unless, in block or modifier form, or -// a ternary -function containsSingleConditional(stmts: Ruby.Statements) { - return ( - stmts.body.length === 1 && - ["if", "if_mod", "ifop", "unless", "unless_mod"].includes( - stmts.body[0].type - ) - ); -} - -function printWithAddition( - keyword: string, - path: Plugin.Path, - print: Plugin.Print, - breaking: boolean -) { - return [ - `${keyword} `, - align(keyword.length + 1, path.call(print, "pred")), - indent([softline, path.call(print, "stmts")]), - [softline, path.call(print, "cons")], - [softline, "end"], - breaking ? breakParent : "" - ]; -} - -// For the unary `not` operator, we need to explicitly add parentheses to it in -// order for it to be valid from within a ternary. Otherwise if the clause of -// the ternary isn't a unary `not`, we can just pass it along. -function printTernaryClause(clause: Plugin.Doc) { - if (Array.isArray(clause)) { - const [part] = clause; - - if (Array.isArray(part) && part[0] === "not") { - // We are inside of a statements list and the statement is a unary `not`. - return ["not(", part[2], ")"]; - } - - if (clause[0] === "not") { - // We are inside a ternary condition and the clause is a unary `not`. - return ["not(", clause[2], ")"]; - } - } - - return clause; -} - -// The conditions for a ternary look like `foo : bar` where `foo` represents -// the truthy clause and `bar` represents the falsy clause. In the case that the -// parent node is an `unless`, these have to flip in order. -function printTernaryClauses( - keyword: string, - truthyClause: Plugin.Doc, - falsyClause: Plugin.Doc -) { - const parts = [ - printTernaryClause(truthyClause), - " : ", - printTernaryClause(falsyClause) - ]; - - return keyword === "if" ? parts : parts.reverse(); -} - -// Handles ternary nodes. If it does not fit on one line, then we break out into -// an if/else statement. Otherwise we remain as a ternary. -export const printTernary: Plugin.Printer = ( - path, - _opts, - print -) => { - const predicateDoc = path.call(print, "pred"); - const truthyDoc = path.call(print, "tthy"); - const falsyDoc = path.call(print, "flsy"); - - return group( - ifBreak( - [ - "if ", - align(3, predicateDoc), - indent([softline, truthyDoc]), - [softline, "else"], - indent([softline, falsyDoc]), - [softline, "end"] - ], - [predicateDoc, " ? ", ...printTernaryClauses("if", truthyDoc, falsyDoc)] - ) - ); -}; - -function isModifier( - node: Conditional | Ruby.IfModifier | Ruby.UnlessModifier -): node is Ruby.IfModifier | Ruby.UnlessModifier { - return node.type === "if_mod" || node.type === "unless_mod"; -} - -// Prints an `if_mod` or `unless_mod` node. Because it was previously in the -// modifier form, we're guaranteed to not have an additional node, so we can -// just work with the predicate and the body. -function printSingle( - keyword: string -): Plugin.Printer { - return function printSingleWithKeyword(path, { rubyModifier }, print) { - const node = path.getValue(); - - const predicateDoc = path.call(print, "pred"); - const statementsDoc = path.call(print, isModifier(node) ? "stmt" : "stmts"); - - const multilineParts = [ - `${keyword} `, - align(keyword.length + 1, predicateDoc), - indent([softline, statementsDoc]), - softline, - "end" - ]; - - // If we do not allow modifier form conditionals or there are comments - // inside of the body of the conditional, then we must print in the - // multiline form. - if (!rubyModifier || (!isModifier(node) && node.stmts.body[0].comments)) { - return [multilineParts, breakParent]; - } - - const inline = inlineEnsureParens(path, [ - statementsDoc, - ` ${keyword} `, - predicateDoc - ]); - - // With an expression with a conditional modifier (expression if true), the - // conditional body is parsed before the predicate expression, meaning that - // if the parser encountered a variable declaration, it would initialize - // that variable first before evaluating the predicate expression. That - // parse order means the difference between a NameError or not. #591 - // https://docs.ruby-lang.org/en/2.0.0/syntax/control_expressions_rdoc.html#label-Modifier+if+and+unless - if (isModifier(node) && containsAssignment(node.stmt)) { - return inline; - } - - return group(ifBreak(multilineParts, inline)); - }; -} - -const noTernary = [ - "alias", - "assign", - "break", - "command", - "command_call", - "heredoc", - "if", - "if_mod", - "ifop", - "lambda", - "massign", - "next", - "opassign", - "rescue_mod", - "return", - "return0", - "super", - "undef", - "unless", - "unless_mod", - "until_mod", - "var_alias", - "void_stmt", - "while_mod", - "yield", - "yield0", - "zsuper" -]; - -// Certain expressions cannot be reduced to a ternary without adding parens -// around them. In this case we say they cannot be ternaried and default instead -// to breaking them into multiple lines. -function canTernaryStmts(stmts: Ruby.Statements) { - if (stmts.body.length !== 1) { - return false; - } - - const stmt = stmts.body[0]; - - // If the user is using one of the lower precedence "and" or "or" operators, - // then we can't use a ternary expression as it would break the flow control. - if (stmt.type === "binary" && ["and", "or"].includes(stmt.op)) { - return false; - } - - // Check against the blocklist of statement types that are not allowed to be - // a part of a ternary expression. - return !noTernary.includes(stmt.type); -} - -// In order for an `if` or `unless` expression to be shortened to a ternary, -// there has to be one and only one "addition" (another clause attached) which -// is of the "else" type. Both the body of the main node and the body of the -// additional node must have only one statement, and that statement list must -// pass the `canTernaryStmts` check. -function canTernary(path: Plugin.Path) { - const node = path.getValue(); - - return ( - !["assign", "opassign", "command_call", "command"].includes( - node.pred.type - ) && - node.cons && - node.cons.type === "else" && - canTernaryStmts(node.stmts) && - canTernaryStmts(node.cons.stmts) - ); -} - -// A normalized print function for both `if` and `unless` nodes. -function printConditional(keyword: string): Plugin.Printer { - return function printConditionalWithKeyword(path, opts, print) { - if (canTernary(path)) { - let ternaryParts = [ - path.call(print, "pred"), - " ? ", - ...printTernaryClauses( - keyword, - path.call(print, "stmts"), - path.call(print, "cons", "stmts") - ) - ]; - - if (["binary", "call"].includes(path.getParentNode().type)) { - ternaryParts = ["(", ...ternaryParts, ")"]; - } - - return group( - ifBreak(printWithAddition(keyword, path, print, false), ternaryParts) - ); - } - - const node = path.getValue(); - - // If there's an additional clause that wasn't matched earlier, we know we - // can't go for the inline option. - if (node.cons) { - return group(printWithAddition(keyword, path, print, true)); - } - - // If the body of the conditional is empty, then we explicitly have to use - // the block form. - if (isEmptyStmts(node.stmts)) { - return [ - `${keyword} `, - align(keyword.length + 1, path.call(print, "pred")), - hardline, - "end" - ]; - } - - // Two situations in which we need to use the block form: - // - // 1. If the predicate of the conditional contains an assignment, then we - // can't know for sure that it doesn't impact the body of the conditional. - // - // 2. If the conditional contains just another conditional, then collapsing - // it would result in double modifiers on the same line. - if ( - containsAssignment(node.pred) || - containsSingleConditional(node.stmts) - ) { - return [ - `${keyword} `, - align(keyword.length + 1, path.call(print, "pred")), - indent([hardline, path.call(print, "stmts")]), - hardline, - "end" - ]; - } - - return printSingle(keyword)(path, opts, print); - }; -} - -export const printElse: Plugin.Printer = (path, opts, print) => { - const node = path.getValue(); - - return [ - node.stmts.body.length === 1 && node.stmts.body[0].type === "command" - ? breakParent - : "", - "else", - indent([softline, path.call(print, "stmts")]) - ]; -}; - -export const printElsif: Plugin.Printer = (path, opts, print) => { - const node = path.getValue(); - const parts = [ - group(["elsif ", align("elsif".length - 1, path.call(print, "pred"))]), - indent([hardline, path.call(print, "stmts")]) - ]; - - if (node.cons) { - parts.push(group([hardline, path.call(print, "cons")])); - } - - return group(parts); -}; - -export const printIf = printConditional("if"); -export const printIfModifier = printSingle("if"); -export const printUnless = printConditional("unless"); -export const printUnlessModifier = printSingle("unless"); diff --git a/src/ruby/nodes/constants.ts b/src/ruby/nodes/constants.ts deleted file mode 100644 index bc1f46c4..00000000 --- a/src/ruby/nodes/constants.ts +++ /dev/null @@ -1,45 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; -import { makeCall } from "../../utils"; - -const { group, indent, softline } = prettier; - -type ConstPath = Ruby.ConstPathField | Ruby.ConstPathRef; -export const printConstPath: Plugin.Printer = ( - path, - opts, - print -) => [path.call(print, "parent"), "::", path.call(print, "constant")]; - -export const printConstRef: Plugin.Printer = ( - path, - opts, - print -) => path.call(print, "constant"); - -export const printDefined: Plugin.Printer = ( - path, - opts, - print -) => { - return group([ - "defined?(", - indent([softline, path.call(print, "value")]), - softline, - ")" - ]); -}; - -export const printField: Plugin.Printer = (path, opts, print) => { - return group([ - path.call(print, "parent"), - makeCall(path, opts, print), - path.call(print, "name") - ]); -}; - -type TopConst = Ruby.TopConstField | Ruby.TopConstRef; -export const printTopConst: Plugin.Printer = (path, opts, print) => [ - "::", - path.call(print, "constant") -]; diff --git a/src/ruby/nodes/flow.ts b/src/ruby/nodes/flow.ts deleted file mode 100644 index aba8043f..00000000 --- a/src/ruby/nodes/flow.ts +++ /dev/null @@ -1,70 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; - -const { join } = prettier; - -// If there are parentheses around these nodes, then we can't skip printing them -// without changing the semantic meaning of the statement. -const unskippableParens = [ - "if_mod", - "rescue_mod", - "unless_mod", - "until_mod", - "while_mod" -]; - -type FlowControl = Ruby.Break | Ruby.Next; - -function printFlowControl(keyword: string): Plugin.Printer { - return function printFlowControlWithKeyword(path, opts, print) { - const node = path.getValue(); - - // If we don't have any arguments to the keyword, then it's always going to - // come in as an args node, in which case we can just print the keyword. - if (node.args.type === "args") { - return keyword; - } - - // Special handling if we've got parentheses on this call to the keyword. If - // we do and we can skip them, then we will. If we don't, then we'll print - // them right after the keyword with no space. - const paren = node.args.args.type === "args" && node.args.args.parts[0]; - - if (paren && paren.type === "paren") { - const stmts = (paren.cnts as Ruby.Statements).body; - - // Here we're checking if we can skip past the parentheses entirely. - if (stmts.length === 1 && !unskippableParens.includes(stmts[0].type)) { - return [ - `${keyword} `, - (path as any).call(print, "args", "args", "parts", 0, "cnts") - ]; - } - - // Here we know we can't, so just printing out the parentheses as normal. - return [keyword, (path as any).call(print, "args", "args", "parts", 0)]; - } - - // If we didn't hit the super special handling, then we're just going to - // print out the arguments to the keyword like normal. - return [`${keyword} `, join(", ", path.call(print, "args"))]; - }; -} - -export const printBreak = printFlowControl("break"); - -export const printNext = printFlowControl("next"); - -export const printYield: Plugin.Printer = (path, opts, print) => { - const node = path.getValue(); - const argsDoc = path.call(print, "args"); - - if (node.args.type === "paren") { - return ["yield", argsDoc]; - } - - return ["yield ", join(", ", argsDoc)]; -}; - -export const printYield0: Plugin.Printer = (path) => - path.getValue().value; diff --git a/src/ruby/nodes/hashes.ts b/src/ruby/nodes/hashes.ts deleted file mode 100644 index 9762269c..00000000 --- a/src/ruby/nodes/hashes.ts +++ /dev/null @@ -1,159 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; -import { - getTrailingComma, - printEmptyCollection, - skipAssignIndent -} from "../../utils"; - -const { group, ifBreak, indent, join, line } = prettier; - -type KeyPrinter = ( - path: Plugin.Path, - print: Plugin.Print -) => Plugin.Doc; - -type HashContents = (Ruby.AssoclistFromArgs | Ruby.BareAssocHash) & { - keyPrinter: KeyPrinter; -}; - -// When attempting to convert a hash rocket into a hash label, you need to take -// care because only certain patterns are allowed. Ruby source says that they -// have to match keyword arguments to methods, but don't specify what that is. -// After some experimentation, it looks like it's: -// -// * Starts with a letter (either case) or an underscore -// * Does not end in equal -// -// This function represents that check, as it determines if it can convert the -// symbol node into a hash label. -function isValidHashLabel(symbolLiteral: Ruby.SymbolLiteral) { - const label = symbolLiteral.value.value; - return label.match(/^[_A-Za-z]/) && !label.endsWith("="); -} - -function canUseHashLabels(contentsNode: HashContents) { - return contentsNode.assocs.every((assocNode) => { - if (assocNode.type === "assoc_splat") { - return true; - } - - switch (assocNode.key.type) { - case "label": - return true; - case "symbol_literal": - return isValidHashLabel(assocNode.key); - case "dyna_symbol": - return true; - default: - return false; - } - }); -} - -const printHashKeyLabel: KeyPrinter = (path, print) => { - const node = path.getValue(); - - switch (node.type) { - case "label": - return print(path); - case "symbol_literal": - return [(path as Plugin.Path).call(print, "value"), ":"]; - case "dyna_symbol": - return [print(path), ":"]; - default: - // This should never happen, but keeping it here so that the two key - // printers can maintain the same signature. - return ""; - } -}; - -const printHashKeyRocket: KeyPrinter = (path, print) => { - const node = path.getValue(); - let doc = print(path); - - if (node.type === "label") { - const sDoc = doc as string; // since we know this is a label - doc = [":", sDoc.slice(0, sDoc.length - 1)]; - } else if (node.type === "dyna_symbol") { - doc = [":", doc]; - } - - return [doc, " =>"]; -}; - -export const printAssoc: Plugin.Printer = (path, opts, print) => { - const node = path.getValue(); - const { keyPrinter } = path.getParentNode() as HashContents; - - const parts = [path.call((keyPath) => keyPrinter(keyPath, print), "key")]; - const valueDoc = path.call(print, "value"); - - // If we're printing a child hash then we want it to break along with its - // parent hash, so we don't group the parts. - if (node.value.type === "hash") { - parts.push(" ", valueDoc); - return parts; - } - - if (!skipAssignIndent(node.value) || node.key.comments) { - parts.push(indent([line, valueDoc])); - } else { - parts.push(" ", valueDoc); - } - - return group(parts); -}; - -export const printAssocSplat: Plugin.Printer = ( - path, - opts, - print -) => ["**", path.call(print, "value")]; - -export const printHashContents: Plugin.Printer = ( - path, - opts, - print -) => { - const node = path.getValue(); - - // First determine which key printer we're going to use, so that the child - // nodes can reference it when they go to get printed. - node.keyPrinter = - opts.rubyHashLabel && canUseHashLabels(path.getValue()) - ? printHashKeyLabel - : printHashKeyRocket; - - return join([",", line], path.map(print, "assocs")); -}; - -export const printHash: Plugin.Printer = (path, opts, print) => { - const node = path.getValue(); - - // Hashes normally have a single assoclist_from_args child node. If it's - // missing, then it means we're dealing with an empty hash, so we can just - // exit here and print. - if (node.cnts === null) { - return printEmptyCollection(path, opts, "{", "}"); - } - - const doc = [ - "{", - indent([ - line, - path.call(print, "cnts"), - getTrailingComma(opts) ? ifBreak(",", "") : "" - ]), - line, - "}" - ]; - - // If we're inside another hash, then we don't want to group our contents - // because we want this hash to break along with its parent hash. - if (path.getParentNode().type === "assoc") { - return doc; - } - - return group(doc); -}; diff --git a/src/ruby/nodes/heredocs.ts b/src/ruby/nodes/heredocs.ts deleted file mode 100644 index ba62f1a5..00000000 --- a/src/ruby/nodes/heredocs.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; -import { literallineWithoutBreakParent } from "../../utils"; - -const { group, lineSuffix, join } = prettier; - -export const printHeredoc: Plugin.Printer = ( - path, - opts, - print -) => { - const node = path.getValue(); - - // Print out each part of the heredoc to its own doc node. - const parts = path.map((partPath) => { - const part = partPath.getValue(); - - if (part.type !== "tstring_content") { - return print(partPath); - } - - return join(literallineWithoutBreakParent, part.value.split(/\r?\n/)); - }, "parts"); - - // We use a literalline break because matching indentation is required - // for the heredoc contents and ending. If the line suffix contains a - // break-parent, all ancestral groups are broken, and heredocs automatically - // break lines in groups they appear in. We prefer them to appear in-line if - // possible, so we use a literalline without the break-parent. - return group([ - path.call(print, "beging"), - lineSuffix(group([literallineWithoutBreakParent, ...parts, node.ending])) - ]); -}; diff --git a/src/ruby/nodes/hooks.ts b/src/ruby/nodes/hooks.ts deleted file mode 100644 index 899a9a0d..00000000 --- a/src/ruby/nodes/hooks.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; - -const { group, indent, line } = prettier; - -// The `BEGIN` and `END` keywords are used to hook into the Ruby process. Any -// `BEGIN` blocks are executed right when the process starts up, and the `END` -// blocks are executed right before exiting. -// -// BEGIN { -// # content goes here -// } -// -// END { -// # content goes here -// } -// -// Interesting side note, you don't use `do...end` blocks with these hooks. Both -// nodes contain one child which is a `stmts` node. -function printHook(name: string): Plugin.Printer { - return function printHookWithName(path, opts, print) { - return group([ - name, - " ", - path.call(print, "lbrace"), - indent([line, path.call(print, "stmts")]), - [line, "}"] - ]); - }; -} - -export const printBEGIN = printHook("BEGIN"); -export const printEND = printHook("END"); diff --git a/src/ruby/nodes/ints.ts b/src/ruby/nodes/ints.ts deleted file mode 100644 index 55b3c73a..00000000 --- a/src/ruby/nodes/ints.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; - -// An @int node is any literal integer in Ruby. They can come in a number of -// bases, and look like the following: -// -// Binary (2) - 0b0110 -// Octal (8) - 0o34 or 034 -// Decimal (10) - 159 or 0d159 -// Hexidecimal (16) - 0xac5 -// -// If it's a decimal number, it can be optional separated by any number of -// arbitrarily places underscores. This can be useful for dollars and cents -// (34_99), dates (2020_11_30), and normal 3 digit separation (1_222_333). -export const printInt: Plugin.Printer = (path) => { - const { value } = path.getValue(); - - // If the number is a base 10 number, is sufficiently large, and is not - // already formatted with underscores, then add them in in between the - // numbers every three characters starting from the right. - if (!value.startsWith("0") && value.length >= 5 && !value.includes("_")) { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const segments = ` ${value}`.slice((value.length + 2) % 3).match(/.{3}/g)!; - return segments.join("_").trim(); - } - - return value; -}; diff --git a/src/ruby/nodes/lambdas.ts b/src/ruby/nodes/lambdas.ts deleted file mode 100644 index 5b65b5bd..00000000 --- a/src/ruby/nodes/lambdas.ts +++ /dev/null @@ -1,80 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; -import { hasAncestor, isEmptyParams } from "../../utils"; - -const { group, ifBreak, indent, line } = prettier; - -// We can have our params coming in as the first child of the main lambda node, -// or if we have them wrapped in parens then they'll be one level deeper. Even -// though it's possible to omit the parens if you only have one argument, we're -// going to keep them in no matter what for consistency. -function printLambdaParams( - path: Plugin.Path, - print: Plugin.Print -) { - let node = path.getValue().params; - - // In this case we had something like -> (foo) { bar } which would mean that - // we're looking at a paren node, so we'll descend one level deeper to get at - // the actual params node. - if (node.type !== "params") { - node = node.cnts; - } - - // If we don't have any params at all, then we're just going to bail out and - // print nothing. This is to avoid printing an empty set of parentheses. - if (isEmptyParams(node)) { - return ""; - } - - return path.call(print, "params"); -} - -// Lambda nodes represent stabby lambda literals, which can come in a couple of -// flavors. They can use either braces or do...end for their block, and their -// arguments can be not present, have no parentheses for a single argument, or -// have parentheses for multiple arguments. Below are a couple of examples: -// -// -> { 1 } -// -> a { a + 1 } -// ->(a) { a + 1 } -// ->(a, b) { a + b } -// ->(a, b = 1) { a + b } -// -// -> do -// 1 -// end -// -// -> a do -// a + 1 -// end -// -// ->(a, b) do -// a + b -// end -// -// Generally, we're going to favor do...end for the multi-line form and braces -// for the single-line form. However, if we have an ancestor that is a command -// or command_call node, then we'll need to use braces either way because of -// operator precendence. -export const printLambda: Plugin.Printer = (path, opts, print) => { - const params = printLambdaParams(path, print); - const inCommand = hasAncestor(path, ["command", "command_call"]); - - const stmtsDoc = path.call(print, "stmts"); - - return group( - ifBreak( - [ - "->", - params, - " ", - inCommand ? "{" : "do", - indent([line, stmtsDoc]), - line, - inCommand ? "}" : "end" - ], - ["->", params, " { ", stmtsDoc, " }"] - ) - ); -}; diff --git a/src/ruby/nodes/loops.ts b/src/ruby/nodes/loops.ts deleted file mode 100644 index 9f6336c9..00000000 --- a/src/ruby/nodes/loops.ts +++ /dev/null @@ -1,91 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; -import { - containsAssignment, - inlineEnsureParens, - isEmptyStmts -} from "../../utils"; - -const { align, breakParent, group, hardline, ifBreak, indent, join, softline } = - prettier; - -type Loop = Ruby.While | Ruby.WhileModifier | Ruby.Until | Ruby.UntilModifier; - -function isModifier( - node: Loop -): node is Ruby.WhileModifier | Ruby.UntilModifier { - return node.type === "while_mod" || node.type === "until_mod"; -} - -function printLoop(keyword: string): Plugin.Printer { - return function printLoopWithOptions(path, { rubyModifier }, print) { - const node = path.getValue(); - const predicateDoc = path.call(print, "pred"); - - // If the only statement inside this while loop is a void statement, then we - // can shorten to just displaying the predicate and then a semicolon. - if (!isModifier(node) && isEmptyStmts(node.stmts)) { - return group([group([keyword, " ", predicateDoc]), hardline, "end"]); - } - - const statementDoc = path.call(print, isModifier(node) ? "stmt" : "stmts"); - const inlineLoop = inlineEnsureParens(path, [ - statementDoc, - ` ${keyword} `, - predicateDoc - ]); - - // If we're in the modifier form and we're modifying a `begin`, then this is - // a special case where we need to explicitly use the modifier form because - // otherwise the semantic meaning changes. This looks like: - // - // begin - // foo - // end while bar - // - // The above is effectively a `do...while` loop (which we don't have in - // ruby). - if (isModifier(node) && node.stmt.type === "begin") { - return inlineLoop; - } - - const blockLoop = [ - [`${keyword} `, align(keyword.length + 1, predicateDoc)], - indent([softline, statementDoc]), - softline, - "end" - ]; - - // If we're disallowing inline loops or if the predicate of the loop - // contains an assignment (in which case we can't know for certain that that - // assignment doesn't impact the statements inside the loop) then we can't - // use the modifier form and we must use the block form. - if (!rubyModifier || containsAssignment(node.pred)) { - return [breakParent, blockLoop]; - } - - return group(ifBreak(blockLoop, inlineLoop)); - }; -} - -export const printFor: Plugin.Printer = (path, opts, print) => { - const node = path.getValue(); - - let indexDoc = path.call(print, "index"); - if (node.index.type === "mlhs") { - indexDoc = join(", ", indexDoc); - } - - return group([ - "for ", - indexDoc, - " in ", - path.call(print, "collection"), - indent([hardline, path.call(print, "stmts")]), - hardline, - "end" - ]); -}; - -export const printWhile = printLoop("while"); -export const printUntil = printLoop("until"); diff --git a/src/ruby/nodes/massign.ts b/src/ruby/nodes/massign.ts deleted file mode 100644 index 6b7b2298..00000000 --- a/src/ruby/nodes/massign.ts +++ /dev/null @@ -1,80 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; - -const { group, indent, join, line, softline } = prettier; - -export const printMAssign: Plugin.Printer = ( - path, - opts, - print -) => { - const node = path.getValue(); - let valueDoc = path.call(print, "value"); - - if ( - ["mrhs", "mrhs_add_star", "mrhs_new_from_args"].includes(node.value.type) - ) { - valueDoc = group(join([",", line], valueDoc)); - } - - const targetDoc: Plugin.Doc[] = [ - join([",", line], path.call(print, "target")) - ]; - if (node.target.type === "mlhs" && node.target.comma) { - targetDoc.push(","); - } - - return group([group(targetDoc), " =", indent([line, valueDoc])]); -}; - -export const printMLHS: Plugin.Printer = (path, opts, print) => { - return path.map(print, "parts"); -}; - -export const printMLHSParen: Plugin.Printer = ( - path, - opts, - print -) => { - if (["massign", "mlhs_paren"].includes(path.getParentNode().type)) { - // If we're nested in brackets as part of the left hand side of an - // assignment, i.e., (a, b, c) = 1, 2, 3 - // ignore the current node and just go straight to the content - return path.call(print, "cnts"); - } - - const node = path.getValue(); - const parts: Plugin.Doc[] = [ - softline, - join([",", line], path.call(print, "cnts")) - ]; - - if ((node.cnts as any).comma) { - parts.push(","); - } - - return group(["(", indent(parts), [softline, ")"]]); -}; - -export const printMRHS: Plugin.Printer = (path, opts, print) => { - return path.map(print, "parts"); -}; - -export const printMRHSAddStar: Plugin.Printer = ( - path, - opts, - print -) => { - return [ - ...(path.call(print, "mrhs") as Plugin.Doc[]), - ["*", path.call(print, "star")] - ]; -}; - -export const printMRHSNewFromArgs: Plugin.Printer = ( - path, - opts, - print -) => { - return path.call(print, "args"); -}; diff --git a/src/ruby/nodes/methods.ts b/src/ruby/nodes/methods.ts deleted file mode 100644 index 68195c97..00000000 --- a/src/ruby/nodes/methods.ts +++ /dev/null @@ -1,71 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; -import { isEmptyBodyStmt, isEmptyParams } from "../../utils"; - -const { group, hardline, indent, line } = prettier; - -export const printDef: Plugin.Printer = ( - path, - opts, - print -) => { - const node = path.getValue(); - const declaration: Plugin.Doc[] = ["def "]; - - // In this case, we're printing a method that's defined as a singleton, so - // we need to include the target and the operator before the name. - if (node.type === "defs") { - declaration.push(path.call(print, "target"), path.call(print, "op")); - } - - // In case there are no parens but there are parameters - const useParens = - node.params.type === "params" && !isEmptyParams(node.params); - - declaration.push( - path.call(print, "name"), - useParens ? "(" : "", - path.call(print, "params"), - useParens ? ")" : "" - ); - - if (isEmptyBodyStmt(node.bodystmt)) { - return group([...declaration, "; end"]); - } - - return group([ - group(declaration), - indent([hardline, path.call(print, "bodystmt")]), - hardline, - "end" - ]); -}; - -export const printDefEndless: Plugin.Printer = ( - path, - opts, - print -) => { - const node = path.getValue(); - let paramsDoc: Plugin.Doc = ""; - - // If we have any kind of parameters, we're going to print the whole - // parentheses. If we don't, then we're just going to skip them entirely. - if (node.paren && !isEmptyParams(node.paren.cnts)) { - paramsDoc = path.call(print, "paren"); - } - - return group([ - "def ", - path.call(print, "name"), - paramsDoc, - " =", - indent(group([line, path.call(print, "stmt")])) - ]); -}; - -export const printAccessControl: Plugin.Printer = ( - path, - opts, - print -) => path.call(print, "value"); diff --git a/src/ruby/nodes/operators.ts b/src/ruby/nodes/operators.ts deleted file mode 100644 index f60a3fb6..00000000 --- a/src/ruby/nodes/operators.ts +++ /dev/null @@ -1,73 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; -import { noIndent } from "../../utils"; - -const { group, indent, line, softline } = prettier; - -export const printBinary: Plugin.Printer = (path, opts, print) => { - const node = path.getValue(); - const space = node.op === "**" ? "" : " "; - - if (noIndent.includes(node.right.type)) { - return group([ - group(path.call(print, "left")), - space, - node.op, - space, - group(path.call(print, "right")) - ]); - } - - return group([ - group(path.call(print, "left")), - space, - group( - indent([ - node.op, - space === "" ? softline : line, - path.call(print, "right") - ]) - ) - ]); -}; - -// dot2 nodes are used with ranges (or flip-flops). They can optionally drop -// their left side for beginless ranges or their right side for endless ranges. -export const printDot2: Plugin.Printer = (path, opts, print) => { - const node = path.getValue(); - - return [ - node.left ? path.call(print, "left") : "", - "..", - node.right ? path.call(print, "right") : "" - ]; -}; - -// dot3 nodes are used with ranges (or flip-flops). They can optionally drop -// their left side for beginless ranges or their right side for endless ranges. -export const printDot3: Plugin.Printer = (path, opts, print) => { - const node = path.getValue(); - - return [ - node.left ? path.call(print, "left") : "", - "...", - node.right ? path.call(print, "right") : "" - ]; -}; - -export const printUnary: Plugin.Printer = (path, opts, print) => { - const node = path.getValue(); - - return [node.op, path.call(print, "value")]; -}; - -export const printNot: Plugin.Printer = (path, opts, print) => { - const node = path.getValue(); - const valueDoc = path.call(print, "value"); - - if (node.paren) { - return ["not", "(", valueDoc, ")"]; - } - - return ["not", " ", valueDoc]; -}; diff --git a/src/ruby/nodes/params.ts b/src/ruby/nodes/params.ts deleted file mode 100644 index 8871ff08..00000000 --- a/src/ruby/nodes/params.ts +++ /dev/null @@ -1,124 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; - -const { group, hardline, join, indent, line, lineSuffix, softline } = prettier; - -type RestParam = Ruby.KeywordRestParam | Ruby.RestParam; - -function printRestParamSymbol(symbol: string): Plugin.Printer { - return function printRestParamWithSymbol(path, opts, print) { - const node = path.getValue(); - - return node.name ? [symbol, path.call(print, "name")] : symbol; - }; -} - -export const printParams: Plugin.Printer = (path, opts, print) => { - const node = path.getValue(); - let parts: Plugin.Doc[] = []; - - if (node.reqs) { - path.each((reqPath) => { - // For some very strange reason, if you have a comment attached to a - // rest_param, it shows up here in the list of required params. - if ((reqPath.getValue().type as any) !== "rest_param") { - parts.push(print(reqPath)); - } - }, "reqs"); - } - - if (node.opts) { - parts = parts.concat( - path.map((optlPath) => join(" = ", optlPath.map(print)), "opts") - ); - } - - if (node.rest && node.rest.type !== "excessed_comma") { - parts.push(path.call(print, "rest")); - } - - if (node.posts) { - parts = parts.concat(path.map(print, "posts")); - } - - if (node.keywords) { - parts = parts.concat( - path.map((kwargPath) => { - const kwarg = kwargPath.getValue(); - const keyDoc = kwargPath.call(print, 0); - - if (kwarg[1]) { - return group([keyDoc, " ", kwargPath.call(print, 1)]); - } - - return keyDoc; - }, "keywords") - ); - } - - if (node.kwrest) { - parts.push(node.kwrest === "nil" ? "**nil" : path.call(print, "kwrest")); - } - - if (node.block) { - parts.push(path.call(print, "block")); - } - - const contents: Plugin.Doc[] = [join([",", line], parts)]; - - // You can put an extra comma at the end of block args between pipes to - // change what it does. Below is the difference: - // - // [[1, 2], [3, 4]].each { |x| p x } # prints [1, 2] then [3, 4] - // [[1, 2], [3, 4]].each { |x,| p x } # prints 1 then 3 - // - // In ruby 2.5, the excessed comma is indicated by having a 0 in the rest - // param position. In ruby 2.6+ it's indicated by having an "excessed_comma" - // node in the rest position. Seems odd, but it's true. - if ( - (node.rest as any) === 0 || - (node.rest && node.rest.type === "excessed_comma") - ) { - contents.push(","); - } - - // If the parent node is a paren then we skipped printing the parentheses so - // that we could handle them here and get nicer formatting. - const parentNode = path.getParentNode(); - - if (["lambda", "paren"].includes(parentNode.type)) { - const parts: Plugin.Doc[] = ["("]; - - // If the parent node is a paren and the paren has comments that are - // attached to the left paren, then we need to print those out explicitly - // here. - if (parentNode.type === "paren" && parentNode.lparen.comments) { - const comments: Plugin.Doc[] = []; - - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - (parentNode as Ruby.Paren).lparen.comments!.forEach((comment, index) => { - comment.printed = true; - comments.push(lineSuffix(`${index === 0 ? " " : ""}#${comment.value}`)); - }); - - parts.push(join(hardline, comments)); - } - - return group([...parts, indent([softline, ...contents]), softline, ")"]); - } - - return group(contents); -}; - -export const printArgsForward: Plugin.Printer = (path) => - path.getValue().value; -export const printKeywordRestParam = printRestParamSymbol("**"); -export const printRestParam = printRestParamSymbol("*"); - -export const printExcessedComma: Plugin.Printer = ( - path, - opts, - print -) => { - return path.call(print, "value"); -}; diff --git a/src/ruby/nodes/patterns.ts b/src/ruby/nodes/patterns.ts deleted file mode 100644 index 3280113f..00000000 --- a/src/ruby/nodes/patterns.ts +++ /dev/null @@ -1,161 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; - -const { align, group, hardline, indent, join, line } = prettier; - -const patterns = ["aryptn", "binary", "fndptn", "hshptn", "rassign"]; - -const printPatternArg: Plugin.Printer = (path, opts, print) => { - // Pinning is a really special syntax in pattern matching that's not really - // all that well supported in ripper. Here we're just going to the original - // source to see if the variable is pinned. - if ( - opts.originalText && - opts.originalText[opts.locStart(path.getValue()) - 1] === "^" - ) { - return ["^", path.call(print)]; - } - - return path.call(print); -}; - -export const printAryPtn: Plugin.Printer = (path, opts, print) => { - const node = path.getValue(); - let argDocs: Plugin.Doc[] = []; - - if (node.reqs.length > 0) { - argDocs = argDocs.concat( - path.map((argPath) => printPatternArg(argPath, opts, print), "reqs") - ); - } - - if (node.rest) { - argDocs.push(["*", path.call(print, "rest")]); - } - - if (node.posts.length > 0) { - argDocs = argDocs.concat(path.map(print, "posts")); - } - - let argDoc: Plugin.Doc = group(join([",", line], argDocs)); - - // There are a couple of cases where we _must_ use brackets. They include: - // - // * When the number of arguments inside the array pattern is one 1, then we - // have to include them, otherwise it matches the whole array. Consider the - // difference between `in [elem]` and `in elem`. - // * If we have a wrapping constant, then we definitely need the brackets. - // Consider the difference between `in Const[elem]` and `in Const elem` - // * If we're nested inside a parent pattern, then we have to have brackets. - // Consider the difference between `in key: first, second` and - // `in key: [first, second]`. - if ( - argDocs.length === 1 || - node.constant || - patterns.includes(path.getParentNode().type) - ) { - argDoc = ["[", argDoc, "]"]; - } - - if (node.constant) { - return [path.call(print, "constant"), argDoc]; - } - - return argDoc; -}; - -export const printFndPtn: Plugin.Printer = (path, opts, print) => { - const node = path.getValue(); - const docs = [ - "[", - group( - join( - [",", line], - [ - ["*", path.call(print, "left")], - ...path.map(print, "values"), - ["*", path.call(print, "right")] - ] - ) - ), - "]" - ]; - - if (node.constant) { - return [path.call(print, "constant"), docs]; - } - - return docs; -}; - -export const printHshPtn: Plugin.Printer = (path, opts, print) => { - const node = path.getValue(); - let args: Plugin.Doc | Plugin.Doc[] = []; - - if (node.keywords.length > 0) { - const printPair = (pairPath: Plugin.Path<[Ruby.Label, Ruby.AnyNode]>) => { - const parts = [pairPath.call(print, 0)]; - - if (pairPath.getValue()[1]) { - parts.push( - " ", - pairPath.call( - (pairValuePath) => printPatternArg(pairValuePath, opts, print), - 1 - ) - ); - } - - return parts; - }; - - args = args.concat(path.map(printPair, "keywords")); - } - - if (node.kwrest) { - args.push(["**", path.call(print, "kwrest")]); - } - - args = group(join([",", line], args)); - - if (node.constant) { - args = ["[", args, "]"]; - } else if (patterns.includes(path.getParentNode().type)) { - args = ["{ ", args, " }"]; - } - - if (node.constant) { - return [path.call(print, "constant"), args]; - } - - return args; -}; - -export const printIn: Plugin.Printer = (path, opts, print) => { - const keyword = "in "; - const parts: Plugin.Doc[] = [ - keyword, - align( - keyword.length, - path.call( - (valuePath) => printPatternArg(valuePath, opts, print), - "pattern" - ) - ), - indent([hardline, path.call(print, "stmts")]) - ]; - - if (path.getValue().cons) { - parts.push(hardline, path.call(print, "cons")); - } - - return group(parts); -}; - -export const printRAssign: Plugin.Printer = (path, opts, print) => - group([ - path.call(print, "value"), - " ", - path.call(print, "op"), - group(indent([line, path.call(print, "pattern")])) - ]); diff --git a/src/ruby/nodes/regexp.ts b/src/ruby/nodes/regexp.ts deleted file mode 100644 index 7f9d3602..00000000 --- a/src/ruby/nodes/regexp.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import { hasAncestor } from "../../utils"; - -function hasContent(node: Ruby.RegexpLiteral, pattern: RegExp) { - return node.parts.some( - (part) => part.type === "tstring_content" && pattern.test(part.value) - ); -} - -// If the first part of this regex is plain string content, we have a space -// or an =, and we're contained within a command or command_call node, then we -// want to use braces because otherwise we could end up with an ambiguous -// operator, e.g. foo / bar/ or foo /=bar/ -function forwardSlashIsAmbiguous(path: Plugin.Path) { - const node = path.getValue(); - const firstPart = node.parts[0]; - - return ( - firstPart && - firstPart.type === "tstring_content" && - [" ", "="].includes(firstPart.value[0]) && - hasAncestor(path, ["command", "command_call"]) - ); -} - -// This function is responsible for printing out regexp_literal nodes. They can -// either use the special %r literal syntax or they can use forward slashes. At -// the end of either of those they can have modifiers like m or x that have -// special meaning for the regex engine. -// -// We favor the use of forward slashes unless the regex contains a forward slash -// itself. In that case we switch over to using %r with braces. -export const printRegexpLiteral: Plugin.Printer = ( - path, - opts, - print -) => { - const node = path.getValue(); - const docs = path.map(print, "parts"); - - // We should use braces if using a forward slash would be ambiguous in the - // current context or if there's a forward slash in the content of the regexp. - const useBraces = forwardSlashIsAmbiguous(path) || hasContent(node, /\//); - - // If we should be using braces but we have braces in the body of the regexp, - // then we're just going to resort to using whatever the original content was. - if (useBraces && hasContent(node, /[{}]/)) { - return [node.beging, ...docs, node.ending]; - } - - return [ - useBraces ? "%r{" : "/", - ...docs, - useBraces ? "}" : "/", - node.ending.slice(1) - ]; -}; diff --git a/src/ruby/nodes/rescue.ts b/src/ruby/nodes/rescue.ts deleted file mode 100644 index 87dd785b..00000000 --- a/src/ruby/nodes/rescue.ts +++ /dev/null @@ -1,103 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; - -const { align, group, hardline, indent, join, line } = prettier; - -export const printBegin: Plugin.Printer = (path, opts, print) => { - return [ - "begin", - indent([hardline, path.call(print, "bodystmt")]), - hardline, - "end" - ]; -}; - -export const printEnsure: Plugin.Printer = (path, opts, print) => { - return [ - path.call(print, "keyword"), - indent([hardline, path.call(print, "stmts")]) - ]; -}; - -export const printRescue: Plugin.Printer = (path, opts, print) => { - const node = path.getValue(); - const parts: Plugin.Doc[] = ["rescue"]; - - if (node.extn) { - parts.push(align("rescue ".length, path.call(print, "extn"))); - } else { - // If you don't specify an error to rescue in a `begin/rescue` block, then - // implicitly you're rescuing from `StandardError`. In this case, we're - // just going to explicitly add it. - parts.push(" StandardError"); - } - - const stmtsDoc = path.call(print, "stmts") as Plugin.Doc[]; - - if (stmtsDoc.length > 0) { - parts.push(indent([hardline, stmtsDoc])); - } - - // This is the next clause on the `begin` statement, either another - // `rescue`, and `ensure`, or an `else` clause. - if (node.cons) { - parts.push([hardline, path.call(print, "cons")]); - } - - return group(parts); -}; - -// This is a container node that we're adding into the AST that isn't present in -// Ripper solely so that we have a nice place to attach inline comments. -export const printRescueEx: Plugin.Printer = ( - path, - opts, - print -) => { - const node = path.getValue(); - const parts: Plugin.Doc[] = []; - - if (node.extns) { - // If there's just one exception being rescued, then it's just going to be a - // single doc node. - let exceptionDoc = path.call(print, "extns"); - - // If there are multiple exceptions being rescued, then we're going to have - // multiple doc nodes returned as an array that we need to join together. - if ( - ["mrhs", "mrhs_add_star", "mrhs_new_from_args"].includes(node.extns.type) - ) { - exceptionDoc = group(join([",", line], exceptionDoc)); - } - - parts.push(" ", exceptionDoc); - } - - if (node.var) { - parts.push(" => ", path.call(print, "var")); - } - - return group(parts); -}; - -export const printRescueMod: Plugin.Printer = ( - path, - opts, - print -) => { - return [ - "begin", - indent([hardline, path.call(print, "stmt")]), - hardline, - "rescue StandardError", - indent([hardline, path.call(print, "value")]), - hardline, - "end" - ]; -}; - -export const printRedo: Plugin.Printer = (path) => - path.getValue().value; - -export const printRetry: Plugin.Printer = (path) => - path.getValue().value; diff --git a/src/ruby/nodes/return.ts b/src/ruby/nodes/return.ts deleted file mode 100644 index 53203211..00000000 --- a/src/ruby/nodes/return.ts +++ /dev/null @@ -1,115 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; - -const { group, ifBreak, indent, line, join, softline } = prettier; - -// You can't skip the parentheses if you have comments or certain operators with -// lower precedence than the return keyword. -function canSkipParens(paren: Ruby.Paren) { - const stmts = paren.cnts as Ruby.Statements; - - // return( - // foo - // bar - // ) - if (stmts.body.length !== 1) { - return false; - } - - // return( - // # a - // b - // ) - if (stmts.comments) { - return false; - } - - const stmt = stmts.body[0]; - - // return (a or b) - if (stmt.type === "binary" && ["and", "or"].includes(stmt.op)) { - return false; - } - - // return (not a) - if (stmt.type === "not") { - return false; - } - - return true; -} - -export const printReturn: Plugin.Printer = (path, opts, print) => { - const node = path.getValue(); - let parts: Plugin.Doc | Plugin.Doc[] = ""; - let joining = false; - - if (node.args.type === "args_add_block") { - const args = node.args.args; - const steps: PropertyKey[] = ["args", "args"]; - - if (args.type === "args" && args.parts.length === 1 && args.parts[0]) { - // This is the first and only argument being passed to the return keyword. - let arg = args.parts[0]; - steps.push("parts", 0); - - // If the body of the return contains parens, then just skip directly to - // the content of the parens so that we can skip printing parens if we - // don't want them. - if (arg.type === "paren") { - // If we can't skip over the parentheses, then we know we can just bail - // out here and print the only argument as normal since it's a paren. - if (!canSkipParens(arg)) { - return ["return", path.call(print, "args")]; - } - - arg = (arg.cnts as Ruby.Statements).body[0]; - steps.push("cnts", "body", 0); - } - - // If we're returning an array literal that isn't a special array that has - // at least 2 elements, then we want to grab the arguments so that we can - // print them out as if they were normal return arguments. - if (arg.type === "array" && arg.cnts) { - const contents = arg.cnts; - - if (contents.type === "args" && contents.parts.length > 1) { - // If we have just regular arguments and we have more than 1. - steps.push("cnts"); - } - } - } - - // We're doing this weird dance with the steps variable because it's - // possible that you're printing an array nested under some parentheses, in - // which case we still want to descend down that far. For example, - // return([1, 2, 3]) should print as return 1, 2, 3. - parts = (path as any).call((targetPath: Plugin.Path) => { - const target = targetPath.getValue(); - joining = target.type === "args" || target.type === "args_add_block"; - - return print(targetPath); - }, ...steps); - } - - // If we didn't hit any of our special cases, then just print out the - // arguments normally here. - if (parts === "") { - parts = path.call(print, "args"); - joining = true; - } - - const useBrackets = Array.isArray(parts) && parts.length > 1; - const value = joining ? join([",", line], parts) : parts; - - return group([ - "return", - ifBreak(useBrackets ? " [" : "(", " "), - indent([softline, value]), - softline, - ifBreak(useBrackets ? "]" : ")", "") - ]); -}; - -export const printReturn0: Plugin.Printer = (path) => - path.getValue().value; diff --git a/src/ruby/nodes/statements.ts b/src/ruby/nodes/statements.ts deleted file mode 100644 index f67dda7b..00000000 --- a/src/ruby/nodes/statements.ts +++ /dev/null @@ -1,162 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; -import { isEmptyStmts } from "../../utils"; -import { getEndLine, getStartLine } from "../location"; - -const { - breakParent, - dedent, - group, - hardline, - indent, - join, - line, - literalline, - softline, - trim -} = prettier; - -export const printBodyStmt: Plugin.Printer = ( - path, - opts, - print -) => { - const node = path.getValue(); - const parts = []; - - if (!isEmptyStmts(node.stmts)) { - parts.push(path.call(print, "stmts")); - } - - if (node.rsc) { - parts.push(dedent([hardline, path.call(print, "rsc")])); - } - - if (node.els) { - // Before Ruby 2.6, this piece of bodystmt was an explicit "else" node - /* istanbul ignore next */ - const stmts = - (node.els as any).type === "else" - ? (path as any).call(print, "els", "body", 0) - : path.call(print, "els"); - - parts.push([dedent([hardline, "else"]), hardline, stmts]); - } - - if (node.ens) { - parts.push(dedent([hardline, path.call(print, "ens")])); - } - - return group(parts); -}; - -const argNodeTypes = ["args", "args_add_block"]; - -export const printParen: Plugin.Printer = (path, opts, print) => { - const contentNode = path.getValue().cnts; - - if (!contentNode) { - return [path.call(print, "lparen"), ")"]; - } - - let contentDoc = path.call(print, "cnts"); - - // If the content is params, we're going to let it handle its own parentheses - // so that it breaks nicely. - if (contentNode.type === "params") { - return contentDoc; - } - - // If we have an arg type node as the contents, then it's going to return an - // array, so we need to explicitly join that content here. - if (argNodeTypes.includes(contentNode.type)) { - contentDoc = join([",", line], contentDoc); - } - - return group([ - path.call(print, "lparen"), - indent([softline, contentDoc]), - softline, - ")" - ]); -}; - -export const printEndContent: Plugin.Printer = (path) => { - const node = path.getValue(); - return [trim, "__END__", literalline, node.value]; -}; - -export const printComment: Plugin.Printer = (path, opts) => { - return opts.printer.printComment(path, opts); -}; - -export const printProgram: Plugin.Printer = ( - path, - opts, - print -) => [path.call(print, "stmts"), hardline]; - -type StmtsVoidWithComments = Ruby.Statements & { - body: [{ type: "void_stmt"; comments: Ruby.Comment[] }]; -}; - -export const printStatements: Plugin.Printer = ( - path, - opts, - print -) => { - const stmts = path.getValue().body; - - // This is a special case where we have only comments inside a statement - // list. In this case we want to avoid doing any kind of line number - // tracking and just print out the comments. - if ( - stmts.length === 1 && - stmts[0].type === "void_stmt" && - stmts[0].comments - ) { - const nodePath = path as Plugin.Path; - const comments = nodePath.map( - (commentPath) => { - commentPath.getValue().printed = true; - return opts.printer.printComment(commentPath, opts); - }, - "body", - 0, - "comments" - ); - - return [breakParent, join(hardline, comments)]; - } - - const parts: Plugin.Doc[] = []; - let lineNo: null | number = null; - - stmts.forEach((stmt, index) => { - if (stmt.type === "void_stmt") { - return; - } - - const printed = path.call(print, "body", index); - - if (lineNo === null) { - parts.push(printed); - } else if ( - getStartLine(stmt.loc) - lineNo > 1 || - [stmt.type, stmts[index - 1].type].includes("access_ctrl") - ) { - parts.push(hardline, hardline, printed); - } else if ( - getStartLine(stmt.loc) !== lineNo || - path.getParentNode().type !== "string_embexpr" - ) { - parts.push(hardline, printed); - } else { - parts.push("; ", printed); - } - - lineNo = getEndLine(stmt.loc); - }); - - return parts; -}; diff --git a/src/ruby/nodes/strings.ts b/src/ruby/nodes/strings.ts deleted file mode 100644 index 95f6c23f..00000000 --- a/src/ruby/nodes/strings.ts +++ /dev/null @@ -1,293 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; -import { getEndLine, getStartLine } from "../location"; - -const { group, hardline, indent, literalline, removeLines, softline, join } = - prettier; - -// If there is some part of this string that matches an escape sequence or that -// contains the interpolation pattern ("#{"), then we are locked into whichever -// quote the user chose. (If they chose single quotes, then double quoting -// would activate the escape sequence, and if they chose double quotes, then -// single quotes would deactivate it.) -function isQuoteLocked(node: Ruby.DynaSymbol | Ruby.StringLiteral) { - return node.parts.some( - (part) => - part.type === "tstring_content" && - (part.value.includes("#{") || part.value.includes("\\")) - ); -} - -// A string is considered to be able to use single quotes if it contains only -// plain string content and that content does not contain a single quote. -function isSingleQuotable(node: Ruby.DynaSymbol | Ruby.StringLiteral) { - return node.parts.every( - (part) => part.type === "tstring_content" && !part.value.includes("'") - ); -} - -const quotePattern = new RegExp("\\\\([\\s\\S])|(['\"])", "g"); - -function normalizeQuotes(content: string, enclosingQuote: string) { - // Escape and unescape single and double quotes as needed to be able to - // enclose `content` with `enclosingQuote`. - return content.replace(quotePattern, (match, escaped, quote) => { - if (quote === enclosingQuote) { - return `\\${quote}`; - } - - if (quote) { - return quote; - } - - return `\\${escaped}`; - }); -} - -const quotePairs = { - "(": ")", - "[": "]", - "{": "}", - "<": ">" -}; - -type Quote = keyof typeof quotePairs; - -function getClosingQuote(quote: string) { - if (!quote.startsWith("%")) { - return quote; - } - - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const boundary = /%[Qq]?(.)/.exec(quote)![1]; - if (boundary in quotePairs) { - return quotePairs[boundary as Quote]; - } - - return boundary; -} - -// Prints a @CHAR node. @CHAR nodes are special character strings that usually -// are strings of length 1. If they're any longer than we'll try to apply the -// correct quotes. -export const printChar: Plugin.Printer = (path, opts) => { - const { value } = path.getValue(); - - if (value.length !== 2) { - return value; - } - - const quote = opts.rubySingleQuote ? "'" : '"'; - return [quote, value.slice(1), quote]; -}; - -const printPercentSDynaSymbol: Plugin.Printer = ( - path, - opts, - print -) => { - const node = path.getValue(); - const parts = []; - - // Push on the quote, which includes the opening character. - parts.push(node.quote); - - path.each((childPath) => { - const childNode = childPath.getValue(); - - if (childNode.type !== "tstring_content") { - // Here we are printing an embedded variable or expression. - parts.push(print(childPath)); - } else { - // Here we are printing plain string content. - parts.push(join(literalline, childNode.value.split("\n"))); - } - }, "parts"); - - // Push on the closing character, which is the opposite of the third - // character from the opening. - parts.push(quotePairs[node.quote[2] as Quote]); - - return parts; -}; - -// We don't actually want to print %s symbols, as they're much more rarely seen -// in the wild. But we're going to be forced into it if it's a multi-line symbol -// or if the quoting would get super complicated. -function shouldPrintPercentSDynaSymbol(node: Ruby.DynaSymbol) { - // We shouldn't print a %s dyna symbol if it was not already that way in the - // original source. - if (node.quote[0] !== "%") { - return false; - } - - // Here we're going to check if there is a closing character, a new line, or a - // quote in the content of the dyna symbol. If there is, then quoting could - // get weird, so just bail out and stick to the original bounds in the source. - const closing = quotePairs[node.quote[2] as Quote]; - - return node.parts.some( - (child) => - child.type === "tstring_content" && - (child.value.includes("\n") || - child.value.includes(closing) || - child.value.includes("'") || - child.value.includes('"')) - ); -} - -// Prints a dynamic symbol. Assumes there's a quote property attached to the -// node that will tell us which quote to use when printing. We're just going to -// use whatever quote was provided. -// -// In the case of a plain dyna symbol, node.quote will be either :" or :' -// For %s dyna symbols, node.quote will be %s[, %s(, %s{, or %s< -export const printDynaSymbol: Plugin.Printer = ( - path, - opts, - print -) => { - const node = path.getValue(); - - if (shouldPrintPercentSDynaSymbol(node)) { - return printPercentSDynaSymbol(path, opts, print); - } - - const parts = []; - let quote: string; - - if (isQuoteLocked(node)) { - if (node.quote.startsWith("%")) { - quote = opts.rubySingleQuote ? "'" : '"'; - } else if (node.quote.startsWith(":")) { - quote = node.quote.slice(1); - } else { - quote = node.quote; - } - } else { - quote = opts.rubySingleQuote && isSingleQuotable(node) ? "'" : '"'; - } - - parts.push(quote); - - path.each((childPath) => { - const child = childPath.getValue() as Ruby.StringContent; - - if (child.type !== "tstring_content") { - parts.push(print(childPath)); - } else { - parts.push( - join(literalline, normalizeQuotes(child.value, quote).split("\n")) - ); - } - }, "parts"); - - parts.push(quote); - - // If we're inside of an assoc_new node as the key, then it will handle - // printing the : on its own since it could change sides. - const parentNode = path.getParentNode(); - if (parentNode.type !== "assoc" || parentNode.key !== node) { - parts.unshift(":"); - } - - return parts; -}; - -export const printStringConcat: Plugin.Printer = ( - path, - opts, - print -) => { - return group([ - path.call(print, "left"), - " \\", - indent([hardline, path.call(print, "right")]) - ]); -}; - -// Prints out an interpolated variable in the string by converting it into an -// embedded expression. -export const printStringDVar: Plugin.Printer = ( - path, - opts, - print -) => ["#{", path.call(print, "var"), "}"]; - -export const printStringEmbExpr: Plugin.Printer = ( - path, - opts, - print -) => { - const node = path.getValue(); - const doc = path.call(print, "stmts"); - - // If the contents of this embedded expression were originally on the same - // line in the source, then we're going to leave them in place and assume - // that's the way the developer wanted this expression represented. - if (getStartLine(node.loc) === getEndLine(node.loc)) { - return ["#{", removeLines(doc), "}"]; - } - - return group(["#{", indent([softline, doc]), [softline, "}"]]); -}; - -// Prints out a literal string. This function does its best to respect the -// wishes of the user with regards to single versus double quotes, but if the -// string contains any escape expressions then it will just keep the original -// quotes. -export const printStringLiteral: Plugin.Printer = ( - path, - { rubySingleQuote }, - print -) => { - const node = path.getValue(); - - // If the string is empty, it will not have any parts, so just print out the - // quotes corresponding to the config - if (node.parts.length === 0) { - return rubySingleQuote ? "''" : '""'; - } - - // Determine the quote that should enclose the new string - let quote: string; - if (isQuoteLocked(node)) { - quote = node.quote; - } else { - quote = rubySingleQuote && isSingleQuotable(node) ? "'" : '"'; - } - - const parts = path.map((partPath) => { - const part = partPath.getValue(); - - // In this case, the part of the string is an embedded expression - if (part.type !== "tstring_content") { - return print(partPath); - } - - // In this case, the part of the string is just regular string content - return join(literalline, normalizeQuotes(part.value, quote).split("\n")); - }, "parts"); - - return [quote, ...parts, getClosingQuote(quote)]; -}; - -// Prints out a symbol literal. Its child will always be the ident that -// represents the string content of the symbol. -export const printSymbolLiteral: Plugin.Printer = ( - path, - opts, - print -) => { - return [":", path.call(print, "value")]; -}; - -// Prints out an xstring literal. Its child is an array of string parts, -// including plain string content and interpolated content. -export const printXStringLiteral: Plugin.Printer = ( - path, - opts, - print -) => { - return ["`", ...path.map(print, "parts"), "`"]; -}; diff --git a/src/ruby/nodes/super.ts b/src/ruby/nodes/super.ts deleted file mode 100644 index 159145bb..00000000 --- a/src/ruby/nodes/super.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; - -const { align, group, join, line } = prettier; - -export const printSuper: Plugin.Printer = (path, opts, print) => { - const { args } = path.getValue(); - - if (args.type === "arg_paren") { - // In case there are explicitly no arguments but they are using parens, - // we assume they are attempting to override a parent method and pass no - // arguments up. - return args.args === null ? "super()" : ["super", path.call(print, "args")]; - } - - const keyword = "super "; - - return group([ - keyword, - align(keyword.length, group(join([",", line], path.call(print, "args")))) - ]); -}; - -// Version of super without any parens or args. -export const printZSuper: Plugin.Printer = (path) => - path.getValue().value; diff --git a/src/ruby/nodes/undef.ts b/src/ruby/nodes/undef.ts deleted file mode 100644 index 79fdc9e5..00000000 --- a/src/ruby/nodes/undef.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; - -const { addTrailingComment, align, group, join, line } = prettier; - -export const printUndef: Plugin.Printer = (path, opts, print) => { - const symsDocs = path.map((symbolPath) => { - const symbolNode = symbolPath.getValue(); - - // If we're not printing a symbol literal then it's a dyna symbol, so - // we're just going to print that node on its own. - if (symbolNode.type !== "symbol_literal") { - return print(symbolPath); - } - - // We need to make sure we copy over any comments before we do the - // printing so they get printed as well. - if (symbolNode.comments) { - symbolNode.comments.forEach((comment) => { - addTrailingComment(symbolNode.value, comment); - }); - } - - // If we're printing a symbol literal, then we want to descend into it and - // just print the underlying contents so that it prints as a bare word. - return symbolPath.call(print, "value"); - }, "syms"); - - const keyword = "undef "; - return group([keyword, align(keyword.length, join([",", line], symsDocs))]); -}; diff --git a/src/ruby/parser.rb b/src/ruby/parser.rb deleted file mode 100644 index bf1ea385..00000000 --- a/src/ruby/parser.rb +++ /dev/null @@ -1,9134 +0,0 @@ -# frozen_string_literal: true - -require 'ripper' -# require_relative 'syntax_tree/version' - -class PrettierSyntaxTree < Ripper - # Represents a line in the source. If this class is being used, it means that - # every character in the string is 1 byte in length, so we can just return the - # start of the line + the index. - class SingleByteString - def initialize(start) - @start = start - end - - def [](byteindex) - @start + byteindex - end - end - - # Represents a line in the source. If this class is being used, it means that - # there are characters in the string that are multi-byte, so we will build up - # an array of indices, such that array[byteindex] will be equal to the index - # of the character within the string. - class MultiByteString - def initialize(start, line) - @indices = [] - - line - .each_char - .with_index(start) do |char, index| - char.bytesize.times { @indices << index } - end - end - - def [](byteindex) - @indices[byteindex] - end - end - - # Represents the location of a node in the tree from the source code. - class Location - attr_reader :start_line, :start_char, :end_line, :end_char - - def initialize(start_line:, start_char:, end_line:, end_char:) - @start_line = start_line - @start_char = start_char - @end_line = end_line - @end_char = end_char - end - - def ==(other) - other.is_a?(Location) && start_line == other.start_line && - start_char == other.start_char && end_line == other.end_line && - end_char == other.end_char - end - - def to(other) - Location.new( - start_line: start_line, - start_char: start_char, - end_line: other.end_line, - end_char: other.end_char - ) - end - - def to_json(*opts) - [start_line, start_char, end_line, end_char].to_json(*opts) - end - - def self.token(line:, char:, size:) - new( - start_line: line, - start_char: char, - end_line: line, - end_char: char + size - ) - end - - def self.fixed(line:, char:) - new(start_line: line, start_char: char, end_line: line, end_char: char) - end - end - - # A special parser error so that we can get nice syntax displays on the error - # message when prettier prints out the results. - class ParseError < StandardError - attr_reader :lineno, :column - - def initialize(error, lineno, column) - super(error) - @lineno = lineno - @column = column - end - end - - attr_reader :source, :lines, :tokens - - # This is an attr_accessor so Stmts objects can grab comments out of this - # array and attach them to themselves. - attr_accessor :comments - - def initialize(source, *) - super - - # We keep the source around so that we can refer back to it when we're - # generating the AST. Sometimes it's easier to just reference the source - # string when you want to check if it contains a certain character, for - # example. - @source = source - - # Similarly, we keep the lines of the source string around to be able to - # check if certain lines contain certain characters. For example, we'll use - # this to generate the content that goes after the __END__ keyword. Or we'll - # use this to check if a comment has other content on its line. - @lines = source.split("\n") - - # This is the full set of comments that have been found by the parser. It's - # a running list. At the end of every block of statements, they will go in - # and attempt to grab any comments that are on their own line and turn them - # into regular statements. So at the end of parsing the only comments left - # in here will be comments on lines that also contain code. - @comments = [] - - # This is the current embdoc (comments that start with =begin and end with - # =end). Since they can't be nested, there's no need for a stack here, as - # there can only be one active. These end up getting dumped into the - # comments list before getting picked up by the statements that surround - # them. - @embdoc = nil - - # This is an optional node that can be present if the __END__ keyword is - # used in the file. In that case, this will represent the content after that - # keyword. - @__end__ = nil - - # Heredocs can actually be nested together if you're using interpolation, so - # this is a stack of heredoc nodes that are currently being created. When we - # get to the token that finishes off a heredoc node, we pop the top - # one off. If there are others surrounding it, then the body events will now - # be added to the correct nodes. - @heredocs = [] - - # This is a running list of tokens that have fired. It's useful - # mostly for maintaining location information. For example, if you're inside - # the handle of a def event, then in order to determine where the AST node - # started, you need to look backward in the tokens to find a def - # keyword. Most of the time, when a parser event consumes one of these - # events, it will be deleted from the list. So ideally, this list stays - # pretty short over the course of parsing a source string. - @tokens = [] - - # Here we're going to build up a list of SingleByteString or MultiByteString - # objects. They're each going to represent a string in the source. They are - # used by the `char_pos` method to determine where we are in the source - # string. - @line_counts = [] - last_index = 0 - - @source.lines.each do |line| - if line.size == line.bytesize - @line_counts << SingleByteString.new(last_index) - else - @line_counts << MultiByteString.new(last_index, line) - end - - last_index += line.size - end - end - - def self.parse(source) - parser = new(source) - response = parser.parse - response unless parser.error? - end - - private - - # ---------------------------------------------------------------------------- - # :section: Helper methods - # The following methods are used by the ripper event handlers to either - # determine their bounds or query other nodes. - # ---------------------------------------------------------------------------- - - # This represents the current place in the source string that we've gotten to - # so far. We have a memoized line_counts object that we can use to get the - # number of characters that we've had to go through to get to the beginning of - # this line, then we add the number of columns into this line that we've gone - # through. - def char_pos - @line_counts[lineno - 1][column] - end - - # As we build up a list of tokens, we'll periodically need to go backwards and - # find the ones that we've already hit in order to determine the location - # information for nodes that use them. For example, if you have a module node - # then you'll look backward for a kw token to determine your start location. - # - # This works with nesting since we're deleting tokens from the list once - # they've been used up. For example if you had nested module declarations then - # the innermost declaration would grab the last kw node that matches "module" - # (which would happen to be the innermost keyword). Then the outer one would - # only be able to grab the first one. In this way all of the tokens act as - # their own stack. - def find_token(type, value = :any, consume: true) - index = - tokens.rindex do |token| - token.is_a?(type) && (value == :any || (token.value == value)) - end - - if consume - # If we're expecting to be able to find a token and consume it, - # but can't actually find it, then we need to raise an error. This is - # _usually_ caused by a syntax error in the source that we're printing. It - # could also be caused by accidentally attempting to consume a token twice - # by two different parser event handlers. - unless index - message = "Cannot find expected #{value == :any ? type : value}" - raise ParseError.new(message, lineno, column) - end - - tokens.delete_at(index) - elsif index - tokens[index] - end - end - - # A helper function to find a :: operator. We do special handling instead of - # using find_token here because we don't pop off all of the :: - # operators so you could end up getting the wrong information if you have for - # instance ::X::Y::Z. - def find_colon2_before(const) - index = - tokens.rindex do |token| - token.is_a?(Op) && token.value == '::' && - token.location.start_char < const.location.start_char - end - - tokens[index] - end - - # Finds the next position in the source string that begins a statement. This - # is used to bind statements lists and make sure they don't include a - # preceding comment. For example, we want the following comment to be attached - # to the class node and not the statement node: - # - # class Foo # :nodoc: - # ... - # end - # - # By finding the next non-space character, we can make sure that the bounds of - # the statement list are correct. - def find_next_statement_start(position) - remaining = source[position..-1] - - if remaining.sub(/\A +/, '')[0] == '#' - return position + remaining.index("\n") - end - - position - end - - # ---------------------------------------------------------------------------- - # :section: Ripper event handlers - # The following methods all handle a dispatched ripper event. - # ---------------------------------------------------------------------------- - - # BEGINBlock represents the use of the +BEGIN+ keyword, which hooks into the - # lifecycle of the interpreter. Whatever is inside the block will get executed - # when the program starts. - # - # BEGIN { - # } - # - # Interestingly, the BEGIN keyword doesn't allow the do and end keywords for - # the block. Only braces are permitted. - class BEGINBlock - # [LBrace] the left brace that is seen after the keyword - attr_reader :lbrace - - # [Statements] the expressions to be executed - attr_reader :statements - - # [Location] the location of this node - attr_reader :location - - def initialize(lbrace:, statements:, location:) - @lbrace = lbrace - @statements = statements - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('BEGIN') - q.breakable - q.pp(statements) - end - end - - def to_json(*opts) - { - type: :BEGIN, - lbrace: lbrace, - stmts: statements, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_BEGIN: (Statements statements) -> BEGINBlock - def on_BEGIN(statements) - lbrace = find_token(LBrace) - rbrace = find_token(RBrace) - - statements.bind( - find_next_statement_start(lbrace.location.end_char), - rbrace.location.start_char - ) - - keyword = find_token(Kw, 'BEGIN') - - BEGINBlock.new( - lbrace: lbrace, - statements: statements, - location: keyword.location.to(rbrace.location) - ) - end - - # CHAR irepresents a single codepoint in the script encoding. - # - # ?a - # - # In the example above, the CHAR node represents the string literal "a". You - # can use control characters with this as well, as in ?\C-a. - class CHAR - # [String] the value of the character literal - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('CHAR') - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :CHAR, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_CHAR: (String value) -> CHAR - def on_CHAR(value) - node = - CHAR.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # ENDBlock represents the use of the +END+ keyword, which hooks into the - # lifecycle of the interpreter. Whatever is inside the block will get executed - # when the program ends. - # - # END { - # } - # - # Interestingly, the END keyword doesn't allow the do and end keywords for the - # block. Only braces are permitted. - class ENDBlock - # [LBrace] the left brace that is seen after the keyword - attr_reader :lbrace - - # [Statements] the expressions to be executed - attr_reader :statements - - # [Location] the location of this node - attr_reader :location - - def initialize(lbrace:, statements:, location:) - @lbrace = lbrace - @statements = statements - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('END') - q.breakable - q.pp(statements) - end - end - - def to_json(*opts) - { type: :END, lbrace: lbrace, stmts: statements, loc: location }.to_json( - *opts - ) - end - end - - # :call-seq: - # on_END: (Statements statements) -> ENDBlock - def on_END(statements) - lbrace = find_token(LBrace) - rbrace = find_token(RBrace) - - statements.bind( - find_next_statement_start(lbrace.location.end_char), - rbrace.location.start_char - ) - - keyword = find_token(Kw, 'END') - - ENDBlock.new( - lbrace: lbrace, - statements: statements, - location: keyword.location.to(rbrace.location) - ) - end - - # EndContent represents the use of __END__ syntax, which allows individual - # scripts to keep content after the main ruby code that can be read through - # the DATA constant. - # - # puts DATA.read - # - # __END__ - # some other content that is not executed by the program - # - class EndContent - # [String] the content after the script - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('__end__') - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :__end__, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on___end__: (String value) -> EndContent - def on___end__(value) - @__end__ = - EndContent.new( - value: lines[lineno..-1].join("\n"), - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - end - - # Alias represents the use of the +alias+ keyword with regular arguments (not - # global variables). The +alias+ keyword is used to make a method respond to - # another name as well as the current one. - # - # alias aliased_name name - # - # For the example above, in the current context you can now call aliased_name - # and it will execute the name method. When you're aliasing two methods, you - # can either provide bare words (like the example above) or you can provide - # symbols (note that this includes dynamic symbols like - # :"left-#{middle}-right"). - class Alias - # [DynaSymbol | SymbolLiteral] the new name of the method - attr_reader :left - - # [DynaSymbol | SymbolLiteral] the old name of the method - attr_reader :right - - # [Location] the location of this node - attr_reader :location - - def initialize(left:, right:, location:) - @left = left - @right = right - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('alias') - q.breakable - q.pp(left) - q.breakable - q.pp(right) - end - end - - def to_json(*opts) - { type: :alias, left: left, right: right, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_alias: ( - # (DynaSymbol | SymbolLiteral) left, - # (DynaSymbol | SymbolLiteral) right - # ) -> Alias - def on_alias(left, right) - keyword = find_token(Kw, 'alias') - - Alias.new( - left: left, - right: right, - location: keyword.location.to(right.location) - ) - end - - # ARef represents when you're pulling a value out of a collection at a - # specific index. Put another way, it's any time you're calling the method - # #[]. - # - # collection[index] - # - # The nodes usually contains two children, the collection and the index. In - # some cases, you don't necessarily have the second child node, because you - # can call procs with a pretty esoteric syntax. In the following example, you - # wouldn't have a second child node: - # - # collection[] - # - class ARef - # [untyped] the value being indexed - attr_reader :collection - - # [nil | Args | ArgsAddBlock] the value being passed within the brackets - attr_reader :index - - # [Location] the location of this node - attr_reader :location - - def initialize(collection:, index:, location:) - @collection = collection - @index = index - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('aref') - q.breakable - q.pp(collection) - q.breakable - q.pp(index) - end - end - - def to_json(*opts) - { - type: :aref, - collection: collection, - index: index, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_aref: (untyped collection, (nil | Args | ArgsAddBlock) index) -> ARef - def on_aref(collection, index) - find_token(LBracket) - rbracket = find_token(RBracket) - - ARef.new( - collection: collection, - index: index, - location: collection.location.to(rbracket.location) - ) - end - - # ARefField represents assigning values into collections at specific indices. - # Put another way, it's any time you're calling the method #[]=. The - # ARefField node itself is just the left side of the assignment, and they're - # always wrapped in assign nodes. - # - # collection[index] = value - # - class ARefField - # [untyped] the value being indexed - attr_reader :collection - - # [nil | ArgsAddBlock] the value being passed within the brackets - attr_reader :index - - # [Location] the location of this node - attr_reader :location - - def initialize(collection:, index:, location:) - @collection = collection - @index = index - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('aref_field') - q.breakable - q.pp(collection) - q.breakable - q.pp(index) - end - end - - def to_json(*opts) - { - type: :aref_field, - collection: collection, - index: index, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_aref_field: ( - # untyped collection, - # (nil | ArgsAddBlock) index - # ) -> ARefField - def on_aref_field(collection, index) - find_token(LBracket) - rbracket = find_token(RBracket) - - ARefField.new( - collection: collection, - index: index, - location: collection.location.to(rbracket.location) - ) - end - - # def on_arg_ambiguous(value) - # value - # end - - # ArgParen represents wrapping arguments to a method inside a set of - # parentheses. - # - # method(argument) - # - # In the example above, there would be an ArgParen node around the - # ArgsAddBlock node that represents the set of arguments being sent to the - # method method. The argument child node can be +nil+ if no arguments were - # passed, as in: - # - # method() - # - class ArgParen - # [nil | Args | ArgsAddBlock | ArgsForward] the arguments inside the - # parentheses - attr_reader :arguments - - # [Location] the location of this node - attr_reader :location - - def initialize(arguments:, location:) - @arguments = arguments - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('arg_paren') - q.breakable - q.pp(arguments) - end - end - - def to_json(*opts) - { type: :arg_paren, args: arguments, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_arg_paren: ( - # (nil | Args | ArgsAddBlock | ArgsForward) arguments - # ) -> ArgParen - def on_arg_paren(arguments) - lparen = find_token(LParen) - rparen = find_token(RParen) - - # If the arguments exceed the ending of the parentheses, then we know we - # have a heredoc in the arguments, and we need to use the bounds of the - # arguments to determine how large the arg_paren is. - ending = - if arguments && arguments.location.end_line > rparen.location.end_line - arguments - else - rparen - end - - ArgParen.new( - arguments: arguments, - location: lparen.location.to(ending.location) - ) - end - - # Args represents a list of arguments being passed to a method call or array - # literal. - # - # method(first, second, third) - # - class Args - # [Array[ untyped ]] the arguments that this node wraps - attr_reader :parts - - # [Location] the location of this node - attr_reader :location - - def initialize(parts:, location:) - @parts = parts - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('args') - q.breakable - q.group(2, '(', ')') { q.seplist(parts) { |part| q.pp(part) } } - end - end - - def to_json(*opts) - { type: :args, parts: parts, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_args_add: (Args arguments, untyped argument) -> Args - def on_args_add(arguments, argument) - if arguments.parts.empty? - # If this is the first argument being passed into the list of arguments, - # then we're going to use the bounds of the argument to override the - # parent node's location since this will be more accurate. - Args.new(parts: [argument], location: argument.location) - else - # Otherwise we're going to update the existing list with the argument - # being added as well as the new end bounds. - Args.new( - parts: arguments.parts << argument, - location: arguments.location.to(argument.location) - ) - end - end - - # ArgsAddBlock represents a list of arguments and potentially a block - # argument. ArgsAddBlock is commonly seen being passed to any method where you - # use parentheses (wrapped in an ArgParen node). It’s also used to pass - # arguments to the various control-flow keywords like +return+. - # - # method(argument, &block) - # - class ArgsAddBlock - # [Args] the arguments before the optional block - attr_reader :arguments - - # [nil | untyped] the optional block argument - attr_reader :block - - # [Location] the location of this node - attr_reader :location - - def initialize(arguments:, block:, location:) - @arguments = arguments - @block = block - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('args_add_block') - q.breakable - q.pp(arguments) - q.breakable - q.pp(block) - end - end - - def to_json(*opts) - { - type: :args_add_block, - args: arguments, - block: block, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_args_add_block: ( - # Args arguments, - # (false | untyped) block - # ) -> ArgsAddBlock - def on_args_add_block(arguments, block) - ending = block || arguments - - ArgsAddBlock.new( - arguments: arguments, - block: block || nil, - location: arguments.location.to(ending.location) - ) - end - - # Star represents using a splat operator on an expression. - # - # method(*arguments) - # - class ArgStar - # [nil | untyped] the expression being splatted - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('arg_star') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :arg_star, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_args_add_star: (Args arguments, untyped star) -> Args - def on_args_add_star(arguments, argument) - beginning = find_token(Op, '*') - ending = argument || beginning - - location = - if arguments.parts.empty? - ending.location - else - arguments.location.to(ending.location) - end - - arg_star = - ArgStar.new( - value: argument, - location: beginning.location.to(ending.location) - ) - - Args.new(parts: arguments.parts << arg_star, location: location) - end - - # ArgsForward represents forwarding all kinds of arguments onto another method - # call. - # - # def request(method, path, **headers, &block); end - # - # def get(...) - # request(:GET, ...) - # end - # - # def post(...) - # request(:POST, ...) - # end - # - # In the example above, both the get and post methods are forwarding all of - # their arguments (positional, keyword, and block) on to the request method. - # The ArgsForward node appears in both the caller (the request method calls) - # and the callee (the get and post definitions). - class ArgsForward - # [String] the value of the operator - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('args_forward') - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :args_forward, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_args_forward: () -> ArgsForward - def on_args_forward - op = find_token(Op, '...') - - ArgsForward.new(value: op.value, location: op.location) - end - - # :call-seq: - # on_args_new: () -> Args - def on_args_new - Args.new(parts: [], location: Location.fixed(line: lineno, char: char_pos)) - end - - # ArrayLiteral represents any form of an array literal, and contains myriad - # child nodes because of the special array literal syntax like %w and %i. - # - # [] - # [one, two, three] - # [*one_two_three] - # %i[one two three] - # %w[one two three] - # %I[one two three] - # %W[one two three] - # - # Every line in the example above produces an ArrayLiteral node. In order, the - # child contents node of this ArrayLiteral node would be nil, Args, QSymbols, - # QWords, Symbols, and Words. - class ArrayLiteral - # [nil | Args | QSymbols | QWords | Symbols | Words] the - # contents of the array - attr_reader :contents - - # [Location] the location of this node - attr_reader :location - - def initialize(contents:, location:) - @contents = contents - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('array') - q.breakable - q.pp(contents) - end - end - - def to_json(*opts) - { type: :array, cnts: contents, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_array: ((nil | Args) contents) -> - # ArrayLiteral | QSymbols | QWords | Symbols | Words - def on_array(contents) - if !contents || contents.is_a?(Args) - lbracket = find_token(LBracket) - rbracket = find_token(RBracket) - - ArrayLiteral.new( - contents: contents, - location: lbracket.location.to(rbracket.location) - ) - else - tstring_end = find_token(TStringEnd) - - contents.class.new( - elements: contents.elements, - location: contents.location.to(tstring_end.location) - ) - end - end - - # AryPtn represents matching against an array pattern using the Ruby 2.7+ - # pattern matching syntax. It’s one of the more complicated nodes, because - # the four parameters that it accepts can almost all be nil. - # - # case [1, 2, 3] - # in [Integer, Integer] - # "matched" - # in Container[Integer, Integer] - # "matched" - # in [Integer, *, Integer] - # "matched" - # end - # - # An AryPtn node is created with four parameters: an optional constant - # wrapper, an array of positional matches, an optional splat with identifier, - # and an optional array of positional matches that occur after the splat. - # All of the in clauses above would create an AryPtn node. - class AryPtn - # [nil | VarRef] the optional constant wrapper - attr_reader :constant - - # [Array[ untyped ]] the regular positional arguments that this array - # pattern is matching against - attr_reader :requireds - - # [nil | VarField] the optional starred identifier that grabs up a list of - # positional arguments - attr_reader :rest - - # [Array[ untyped ]] the list of positional arguments occurring after the - # optional star if there is one - attr_reader :posts - - # [Location] the location of this node - attr_reader :location - - def initialize(constant:, requireds:, rest:, posts:, location:) - @constant = constant - @requireds = requireds - @rest = rest - @posts = posts - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('aryptn') - - if constant - q.breakable - q.pp(constant) - end - - if requireds.any? - q.breakable - q.group(2, '(', ')') do - q.seplist(requireds) { |required| q.pp(required) } - end - end - - if rest - q.breakable - q.pp(rest) - end - - if posts.any? - q.breakable - q.group(2, '(', ')') { q.seplist(posts) { |post| q.pp(post) } } - end - end - end - - def to_json(*opts) - { - type: :aryptn, - constant: constant, - reqs: requireds, - rest: rest, - posts: posts, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_aryptn: ( - # (nil | VarRef) constant, - # (nil | Array[untyped]) requireds, - # (nil | VarField) rest, - # (nil | Array[untyped]) posts - # ) -> AryPtn - def on_aryptn(constant, requireds, rest, posts) - parts = [constant, *requireds, rest, *posts].compact - - AryPtn.new( - constant: constant, - requireds: requireds || [], - rest: rest, - posts: posts || [], - location: parts[0].location.to(parts[-1].location) - ) - end - - # Assign represents assigning something to a variable or constant. Generally, - # the left side of the assignment is going to be any node that ends with the - # name "Field". - # - # variable = value - # - class Assign - # [ARefField | ConstPathField | Field | TopConstField | VarField] the target - # to assign the result of the expression to - attr_reader :target - - # [untyped] the expression to be assigned - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(target:, value:, location:) - @target = target - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('assign') - q.breakable - q.pp(target) - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :assign, target: target, value: value, loc: location }.to_json( - *opts - ) - end - end - - # :call-seq: - # on_assign: ( - # (ARefField | ConstPathField | Field | TopConstField | VarField) target, - # untyped value - # ) -> Assign - def on_assign(target, value) - Assign.new( - target: target, - value: value, - location: target.location.to(value.location) - ) - end - - # Assoc represents a key-value pair within a hash. It is a child node of - # either an AssocListFromArgs or a BareAssocHash. - # - # { key1: value1, key2: value2 } - # - # In the above example, the would be two AssocNew nodes. - class Assoc - # [untyped] the key of this pair - attr_reader :key - - # [untyped] the value of this pair - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(key:, value:, location:) - @key = key - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('assoc') - q.breakable - q.pp(key) - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :assoc, key: key, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_assoc_new: (untyped key, untyped value) -> Assoc - def on_assoc_new(key, value) - Assoc.new(key: key, value: value, location: key.location.to(value.location)) - end - - # AssocSplat represents double-splatting a value into a hash (either a hash - # literal or a bare hash in a method call). - # - # { **pairs } - # - class AssocSplat - # [untyped] the expression that is being splatted - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('assoc_splat') - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :assoc_splat, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_assoc_splat: (untyped value) -> AssocSplat - def on_assoc_splat(value) - operator = find_token(Op, '**') - - AssocSplat.new(value: value, location: operator.location.to(value.location)) - end - - # AssocListFromArgs represents the key-value pairs of a hash literal. Its - # parent node is always a hash. - # - # { key1: value1, key2: value2 } - # - class AssocListFromArgs - # [Array[ AssocNew | AssocSplat ]] - attr_reader :assocs - - # [Location] the location of this node - attr_reader :location - - def initialize(assocs:, location:) - @assocs = assocs - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('assoclist_from_args') - q.breakable - q.group(2, '(', ')') { q.seplist(assocs) { |assoc| q.pp(assoc) } } - end - end - - def to_json(*opts) - { type: :assoclist_from_args, assocs: assocs, loc: location }.to_json( - *opts - ) - end - end - - # :call-seq: - # on_assoclist_from_args: ( - # Array[AssocNew | AssocSplat] assocs - # ) -> AssocListFromArgs - def on_assoclist_from_args(assocs) - AssocListFromArgs.new( - assocs: assocs, - location: assocs[0].location.to(assocs[-1].location) - ) - end - - # Backref represents a global variable referencing a matched value. It comes - # in the form of a $ followed by a positive integer. - # - # $1 - # - class Backref - # [String] the name of the global backreference variable - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('backref') - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :backref, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_backref: (String value) -> Backref - def on_backref(value) - node = - Backref.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # Backtick represents the use of the ` operator. It's usually found being used - # for an XStringLiteral, but could also be found as the name of a method being - # defined. - class Backtick - # [String] the backtick in the string - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('backtick') - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :backtick, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_backtick: (String value) -> Backtick - def on_backtick(value) - node = - Backtick.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # BareAssocHash represents a hash of contents being passed as a method - # argument (and therefore has omitted braces). It's very similar to an - # AssocListFromArgs node. - # - # method(key1: value1, key2: value2) - # - class BareAssocHash - # [Array[ AssocNew | AssocSplat ]] - attr_reader :assocs - - # [Location] the location of this node - attr_reader :location - - def initialize(assocs:, location:) - @assocs = assocs - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('bare_assoc_hash') - q.breakable - q.group(2, '(', ')') { q.seplist(assocs) { |assoc| q.pp(assoc) } } - end - end - - def to_json(*opts) - { type: :bare_assoc_hash, assocs: assocs, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_bare_assoc_hash: (Array[AssocNew | AssocSplat] assocs) -> BareAssocHash - def on_bare_assoc_hash(assocs) - BareAssocHash.new( - assocs: assocs, - location: assocs[0].location.to(assocs[-1].location) - ) - end - - # Begin represents a begin..end chain. - # - # begin - # value - # end - # - class Begin - # [BodyStmt] the bodystmt that contains the contents of this begin block - attr_reader :bodystmt - - # [Location] the location of this node - attr_reader :location - - def initialize(bodystmt:, location:) - @bodystmt = bodystmt - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('begin') - q.breakable - q.pp(bodystmt) - end - end - - def to_json(*opts) - { type: :begin, bodystmt: bodystmt, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_begin: (BodyStmt bodystmt) -> Begin - def on_begin(bodystmt) - keyword = find_token(Kw, 'begin') - end_char = - if bodystmt.rescue_clause || bodystmt.ensure_clause || - bodystmt.else_clause - bodystmt.location.end_char - else - find_token(Kw, 'end').location.end_char - end - - bodystmt.bind(keyword.location.end_char, end_char) - - Begin.new( - bodystmt: bodystmt, - location: keyword.location.to(bodystmt.location) - ) - end - - # Binary represents any expression that involves two sub-expressions with an - # operator in between. This can be something that looks like a mathematical - # operation: - # - # 1 + 1 - # - # but can also be something like pushing a value onto an array: - # - # array << value - # - class Binary - # [untyped] the left-hand side of the expression - attr_reader :left - - # [String] the operator used between the two expressions - attr_reader :operator - - # [untyped] the right-hand side of the expression - attr_reader :right - - # [Location] the location of this node - attr_reader :location - - def initialize(left:, operator:, right:, location:) - @left = left - @operator = operator - @right = right - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('binary') - q.breakable - q.pp(left) - q.breakable - q.text(operator) - q.breakable - q.pp(right) - end - end - - def to_json(*opts) - { - type: :binary, - left: left, - op: operator, - right: right, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_binary: (untyped left, (Op | Symbol) operator, untyped right) -> Binary - def on_binary(left, operator, right) - # On most Ruby implementations, operator is a Symbol that represents that - # operation being performed. For instance in the example `1 < 2`, the - # `operator` object would be `:<`. However, on JRuby, it's an `@op` node, - # so here we're going to explicitly convert it into the same normalized - # form. - operator = tokens.delete(operator).value unless operator.is_a?(Symbol) - - Binary.new( - left: left, - operator: operator, - right: right, - location: left.location.to(right.location) - ) - end - - # BlockVar represents the parameters being declared for a block. Effectively - # this node is everything contained within the pipes. This includes all of the - # various parameter types, as well as block-local variable declarations. - # - # method do |positional, optional = value, keyword:, █ local| - # end - # - class BlockVar - # [Params] the parameters being declared with the block - attr_reader :params - - # [Array[ Ident ]] the list of block-local variable declarations - attr_reader :locals - - # [Location] the location of this node - attr_reader :location - - def initialize(params:, locals:, location:) - @params = params - @locals = locals - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('block_var') - q.breakable - q.pp(params) - - if locals.any? - q.breakable - q.group(2, '(', ')') { q.seplist(locals) { |local| q.pp(local) } } - end - end - end - - def to_json(*opts) - { - type: :block_var, - params: params, - locals: locals, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_block_var: (Params params, (nil | Array[Ident]) locals) -> BlockVar - def on_block_var(params, locals) - index = - tokens.rindex do |node| - node.is_a?(Op) && %w[| ||].include?(node.value) && - node.location.start_char < params.location.start_char - end - - beginning = tokens[index] - ending = tokens[-1] - - BlockVar.new( - params: params, - locals: locals || [], - location: beginning.location.to(ending.location) - ) - end - - # BlockArg represents declaring a block parameter on a method definition. - # - # def method(&block); end - # - class BlockArg - # [Ident] the name of the block argument - attr_reader :name - - # [Location] the location of this node - attr_reader :location - - def initialize(name:, location:) - @name = name - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('blockarg') - q.breakable - q.pp(name) - end - end - - def to_json(*opts) - { type: :blockarg, name: name, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_blockarg: (Ident name) -> BlockArg - def on_blockarg(name) - operator = find_token(Op, '&') - - BlockArg.new(name: name, location: operator.location.to(name.location)) - end - - # bodystmt can't actually determine its bounds appropriately because it - # doesn't necessarily know where it started. So the parent node needs to - # report back down into this one where it goes. - class BodyStmt - # [Statements] the list of statements inside the begin clause - attr_reader :statements - - # [nil | Rescue] the optional rescue chain attached to the begin clause - attr_reader :rescue_clause - - # [nil | Statements] the optional set of statements inside the else clause - attr_reader :else_clause - - # [nil | Ensure] the optional ensure clause - attr_reader :ensure_clause - - # [Location] the location of this node - attr_reader :location - - def initialize( - statements:, - rescue_clause:, - else_clause:, - ensure_clause:, - location: - ) - @statements = statements - @rescue_clause = rescue_clause - @else_clause = else_clause - @ensure_clause = ensure_clause - @location = location - end - - def bind(start_char, end_char) - @location = - Location.new( - start_line: location.start_line, - start_char: start_char, - end_line: location.end_line, - end_char: end_char - ) - - parts = [rescue_clause, else_clause, ensure_clause] - - # Here we're going to determine the bounds for the statements - consequent = parts.compact.first - statements.bind( - start_char, - consequent ? consequent.location.start_char : end_char - ) - - # Next we're going to determine the rescue clause if there is one - if rescue_clause - consequent = parts.drop(1).compact.first - rescue_clause.bind_end( - consequent ? consequent.location.start_char : end_char - ) - end - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('bodystmt') - q.breakable - q.pp(statements) - - if rescue_clause - q.breakable - q.pp(rescue_clause) - end - - if else_clause - q.breakable - q.pp(else_clause) - end - - if ensure_clause - q.breakable - q.pp(ensure_clause) - end - end - end - - def to_json(*opts) - { - type: :bodystmt, - stmts: statements, - rsc: rescue_clause, - els: else_clause, - ens: ensure_clause, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_bodystmt: ( - # Statements statements, - # (nil | Rescue) rescue_clause, - # (nil | Statements) else_clause, - # (nil | Ensure) ensure_clause - # ) -> BodyStmt - def on_bodystmt(statements, rescue_clause, else_clause, ensure_clause) - BodyStmt.new( - statements: statements, - rescue_clause: rescue_clause, - else_clause: else_clause, - ensure_clause: ensure_clause, - location: Location.fixed(line: lineno, char: char_pos) - ) - end - - # BraceBlock represents passing a block to a method call using the { } - # operators. - # - # method { |variable| variable + 1 } - # - class BraceBlock - # [LBrace] the left brace that opens this block - attr_reader :lbrace - - # [nil | BlockVar] the optional set of parameters to the block - attr_reader :block_var - - # [Statements] the list of expressions to evaluate within the block - attr_reader :statements - - # [Location] the location of this node - attr_reader :location - - def initialize(lbrace:, block_var:, statements:, location:) - @lbrace = lbrace - @block_var = block_var - @statements = statements - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('brace_block') - - if block_var - q.breakable - q.pp(block_var) - end - - q.breakable - q.pp(statements) - end - end - - def to_json(*opts) - { - type: :brace_block, - lbrace: lbrace, - block_var: block_var, - stmts: statements, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_brace_block: ( - # (nil | BlockVar) block_var, - # Statements statements - # ) -> BraceBlock - def on_brace_block(block_var, statements) - lbrace = find_token(LBrace) - rbrace = find_token(RBrace) - - statements.bind( - find_next_statement_start((block_var || lbrace).location.end_char), - rbrace.location.start_char - ) - - location = - Location.new( - start_line: lbrace.location.start_line, - start_char: lbrace.location.start_char, - end_line: [rbrace.location.end_line, statements.location.end_line].max, - end_char: rbrace.location.end_char - ) - - BraceBlock.new( - lbrace: lbrace, - block_var: block_var, - statements: statements, - location: location - ) - end - - # Break represents using the +break+ keyword. - # - # break - # - # It can also optionally accept arguments, as in: - # - # break 1 - # - class Break - # [Args | ArgsAddBlock] the arguments being sent to the keyword - attr_reader :arguments - - # [Location] the location of this node - attr_reader :location - - def initialize(arguments:, location:) - @arguments = arguments - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('break') - q.breakable - q.pp(arguments) - end - end - - def to_json(*opts) - { type: :break, args: arguments, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_break: ((Args | ArgsAddBlock) arguments) -> Break - def on_break(arguments) - keyword = find_token(Kw, 'break') - - location = keyword.location - location = location.to(arguments.location) unless arguments.is_a?(Args) - - Break.new(arguments: arguments, location: location) - end - - # Call represents a method call. This node doesn't contain the arguments being - # passed (if arguments are passed, this node will get nested under a - # MethodAddArg node). - # - # receiver.message - # - class Call - # [untyped] the receiver of the method call - attr_reader :receiver - - # [:"::" | Op | Period] the operator being used to send the message - attr_reader :operator - - # [:call | Backtick | Const | Ident | Op] the message being sent - attr_reader :message - - # [Location] the location of this node - attr_reader :location - - def initialize(receiver:, operator:, message:, location:) - @receiver = receiver - @operator = operator - @message = message - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('call') - q.breakable - q.pp(receiver) - q.breakable - q.pp(operator) - q.breakable - q.pp(message) - end - end - - def to_json(*opts) - { - type: :call, - receiver: receiver, - op: operator, - message: message, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_call: ( - # untyped receiver, - # (:"::" | Op | Period) operator, - # (:call | Backtick | Const | Ident | Op) message - # ) -> Call - def on_call(receiver, operator, message) - ending = message - ending = operator if message == :call - - Call.new( - receiver: receiver, - operator: operator, - message: message, - location: - Location.new( - start_line: receiver.location.start_line, - start_char: receiver.location.start_char, - end_line: [ending.location.end_line, receiver.location.end_line].max, - end_char: ending.location.end_char - ) - ) - end - - # Case represents the beginning of a case chain. - # - # case value - # when 1 - # "one" - # when 2 - # "two" - # else - # "number" - # end - # - class Case - # [nil | untyped] optional value being switched on - attr_reader :value - - # [In | When] the next clause in the chain - attr_reader :consequent - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, consequent:, location:) - @value = value - @consequent = consequent - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('case') - - if value - q.breakable - q.pp(value) - end - - q.breakable - q.pp(consequent) - end - end - - def to_json(*opts) - { type: :case, value: value, cons: consequent, loc: location }.to_json( - *opts - ) - end - end - - # RAssign represents a single-line pattern match. - # - # value in pattern - # value => pattern - # - class RAssign - # [untyped] the left-hand expression - attr_reader :value - - # [Kw | Op] the operator being used to match against the pattern, which is - # either => or in - attr_reader :operator - - # [untyped] the pattern on the right-hand side of the expression - attr_reader :pattern - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, operator:, pattern:, location:) - @value = value - @operator = operator - @pattern = pattern - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('rassign') - - q.breakable - q.pp(value) - - q.breakable - q.pp(operator) - - q.breakable - q.pp(pattern) - end - end - - def to_json(*opts) - { - type: :rassign, - value: value, - op: operator, - pattern: pattern, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_case: (untyped value, untyped consequent) -> Case | RAssign - def on_case(value, consequent) - if keyword = find_token(Kw, 'case', consume: false) - tokens.delete(keyword) - - Case.new( - value: value, - consequent: consequent, - location: keyword.location.to(consequent.location) - ) - else - operator = find_token(Kw, 'in', consume: false) || find_token(Op, '=>') - - RAssign.new( - value: value, - operator: operator, - pattern: consequent, - location: value.location.to(consequent.location) - ) - end - end - - # Class represents defining a class using the +class+ keyword. - # - # class Container - # end - # - # Classes can have path names as their class name in case it's being nested - # under a namespace, as in: - # - # class Namespace::Container - # end - # - # Classes can also be defined as a top-level path, in the case that it's - # already in a namespace but you want to define it at the top-level instead, - # as in: - # - # module OtherNamespace - # class ::Namespace::Container - # end - # end - # - # All of these declarations can also have an optional superclass reference, as - # in: - # - # class Child < Parent - # end - # - # That superclass can actually be any Ruby expression, it doesn't necessarily - # need to be a constant, as in: - # - # class Child < method - # end - # - class ClassDeclaration - # [ConstPathRef | ConstRef | TopConstRef] the name of the class being - # defined - attr_reader :constant - - # [nil | untyped] the optional superclass declaration - attr_reader :superclass - - # [BodyStmt] the expressions to execute within the context of the class - attr_reader :bodystmt - - # [Location] the location of this node - attr_reader :location - - def initialize(constant:, superclass:, bodystmt:, location:) - @constant = constant - @superclass = superclass - @bodystmt = bodystmt - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('class') - - q.breakable - q.pp(constant) - - if superclass - q.breakable - q.pp(superclass) - end - - q.breakable - q.pp(bodystmt) - end - end - - def to_json(*opts) - { - type: :class, - constant: constant, - superclass: superclass, - bodystmt: bodystmt, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_class: ( - # (ConstPathRef | ConstRef | TopConstRef) constant, - # untyped superclass, - # BodyStmt bodystmt - # ) -> ClassDeclaration - def on_class(constant, superclass, bodystmt) - beginning = find_token(Kw, 'class') - ending = find_token(Kw, 'end') - - bodystmt.bind( - find_next_statement_start((superclass || constant).location.end_char), - ending.location.start_char - ) - - ClassDeclaration.new( - constant: constant, - superclass: superclass, - bodystmt: bodystmt, - location: beginning.location.to(ending.location) - ) - end - - # Comma represents the use of the , operator. - class Comma - # [String] the comma in the string - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - end - - # :call-seq: - # on_comma: (String value) -> Comma - def on_comma(value) - node = - Comma.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # Command represents a method call with arguments and no parentheses. Note - # that Command nodes only happen when there is no explicit receiver for this - # method. - # - # method argument - # - class Command - # [Const | Ident] the message being sent to the implicit receiver - attr_reader :message - - # [Args | ArgsAddBlock] the arguments being sent with the message - attr_reader :arguments - - # [Location] the location of this node - attr_reader :location - - def initialize(message:, arguments:, location:) - @message = message - @arguments = arguments - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('command') - - q.breakable - q.pp(message) - - q.breakable - q.pp(arguments) - end - end - - def to_json(*opts) - { - type: :command, - message: message, - args: arguments, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_command: ( - # (Const | Ident) message, - # (Args | ArgsAddBlock) arguments - # ) -> Command - def on_command(message, arguments) - Command.new( - message: message, - arguments: arguments, - location: message.location.to(arguments.location) - ) - end - - # CommandCall represents a method call on an object with arguments and no - # parentheses. - # - # object.method argument - # - class CommandCall - # [untyped] the receiver of the message - attr_reader :receiver - - # [:"::" | Op | Period] the operator used to send the message - attr_reader :operator - - # [Const | Ident | Op] the message being send - attr_reader :message - - # [Args | ArgsAddBlock] the arguments going along with the message - attr_reader :arguments - - # [Location] the location of this node - attr_reader :location - - def initialize(receiver:, operator:, message:, arguments:, location:) - @receiver = receiver - @operator = operator - @message = message - @arguments = arguments - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('command_call') - - q.breakable - q.pp(receiver) - - q.breakable - q.pp(operator) - - q.breakable - q.pp(message) - - q.breakable - q.pp(arguments) - end - end - - def to_json(*opts) - { - type: :command_call, - receiver: receiver, - op: operator, - message: message, - args: arguments, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_command_call: ( - # untyped receiver, - # (:"::" | Op | Period) operator, - # (Const | Ident | Op) message, - # (Args | ArgsAddBlock) arguments - # ) -> CommandCall - def on_command_call(receiver, operator, message, arguments) - ending = arguments || message - - CommandCall.new( - receiver: receiver, - operator: operator, - message: message, - arguments: arguments, - location: receiver.location.to(ending.location) - ) - end - - # Comment represents a comment in the source. - # - # # comment - # - class Comment - # [String] the contents of the comment - attr_reader :value - - # [boolean] whether or not there is code on the same line as this comment. - # If there is, then inline will be true. - attr_reader :inline - alias inline? inline - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, inline:, location:) - @value = value - @inline = inline - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('comment') - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { - type: :comment, - value: value.force_encoding('UTF-8'), - inline: inline, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_comment: (String value) -> Comment - def on_comment(value) - line = lineno - comment = - Comment.new( - value: value[1..-1].chomp, - inline: value.strip != lines[line - 1], - location: - Location.token(line: line, char: char_pos, size: value.size - 1) - ) - - @comments << comment - comment - end - - # Const represents a literal value that _looks_ like a constant. This could - # actually be a reference to a constant: - # - # Constant - # - # It could also be something that looks like a constant in another context, as - # in a method call to a capitalized method: - # - # object.Constant - # - # or a symbol that starts with a capital letter: - # - # :Constant - # - class Const - # [String] the name of the constant - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('const') - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :const, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_const: (String value) -> Const - def on_const(value) - node = - Const.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # ConstPathField represents the child node of some kind of assignment. It - # represents when you're assigning to a constant that is being referenced as - # a child of another variable. - # - # object::Const = value - # - class ConstPathField - # [untyped] the source of the constant - attr_reader :parent - - # [Const] the constant itself - attr_reader :constant - - # [Location] the location of this node - attr_reader :location - - def initialize(parent:, constant:, location:) - @parent = parent - @constant = constant - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('const_path_field') - - q.breakable - q.pp(parent) - - q.breakable - q.pp(constant) - end - end - - def to_json(*opts) - { - type: :const_path_field, - parent: parent, - constant: constant, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_const_path_field: (untyped parent, Const constant) -> ConstPathField - def on_const_path_field(parent, constant) - ConstPathField.new( - parent: parent, - constant: constant, - location: parent.location.to(constant.location) - ) - end - - # ConstPathRef represents referencing a constant by a path. - # - # object::Const - # - class ConstPathRef - # [untyped] the source of the constant - attr_reader :parent - - # [Const] the constant itself - attr_reader :constant - - # [Location] the location of this node - attr_reader :location - - def initialize(parent:, constant:, location:) - @parent = parent - @constant = constant - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('const_path_ref') - - q.breakable - q.pp(parent) - - q.breakable - q.pp(constant) - end - end - - def to_json(*opts) - { - type: :const_path_ref, - parent: parent, - constant: constant, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_const_path_ref: (untyped parent, Const constant) -> ConstPathRef - def on_const_path_ref(parent, constant) - ConstPathRef.new( - parent: parent, - constant: constant, - location: parent.location.to(constant.location) - ) - end - - # ConstRef represents the name of the constant being used in a class or module - # declaration. - # - # class Container - # end - # - class ConstRef - # [Const] the constant itself - attr_reader :constant - - # [Location] the location of this node - attr_reader :location - - def initialize(constant:, location:) - @constant = constant - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('const_ref') - - q.breakable - q.pp(constant) - end - end - - def to_json(*opts) - { type: :const_ref, constant: constant, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_const_ref: (Const constant) -> ConstRef - def on_const_ref(constant) - ConstRef.new(constant: constant, location: constant.location) - end - - # CVar represents the use of a class variable. - # - # @@variable - # - class CVar - # [String] the name of the class variable - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('cvar') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :cvar, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_cvar: (String value) -> CVar - def on_cvar(value) - node = - CVar.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # Def represents defining a regular method on the current self object. - # - # def method(param) result end - # - class Def - # [Backtick | Const | Ident | Kw | Op] the name of the method - attr_reader :name - - # [Params | Paren] the parameter declaration for the method - attr_reader :params - - # [BodyStmt] the expressions to be executed by the method - attr_reader :bodystmt - - # [Location] the location of this node - attr_reader :location - - def initialize(name:, params:, bodystmt:, location:) - @name = name - @params = params - @bodystmt = bodystmt - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('def') - - q.breakable - q.pp(name) - - q.breakable - q.pp(params) - - q.breakable - q.pp(bodystmt) - end - end - - def to_json(*opts) - { - type: :def, - name: name, - params: params, - bodystmt: bodystmt, - loc: location - }.to_json(*opts) - end - end - - # DefEndless represents defining a single-line method since Ruby 3.0+. - # - # def method = result - # - class DefEndless - # [Backtick | Const | Ident | Kw | Op] the name of the method - attr_reader :name - - # [Paren] the parameter declaration for the method - attr_reader :paren - - # [untyped] the expression to be executed by the method - attr_reader :statement - - # [Location] the location of this node - attr_reader :location - - def initialize(name:, paren:, statement:, location:) - @name = name - @paren = paren - @statement = statement - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('def_endless') - - q.breakable - q.pp(name) - - q.breakable - q.pp(paren) - - q.breakable - q.pp(statement) - end - end - - def to_json(*opts) - { - type: :def_endless, - name: name, - paren: paren, - stmt: statement, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_def: ( - # (Backtick | Const | Ident | Kw | Op) name, - # (Params | Paren) params, - # untyped bodystmt - # ) -> Def | DefEndless - def on_def(name, params, bodystmt) - # Make sure to delete this token in case you're defining something like def - # class which would lead to this being a kw and causing all kinds of trouble - tokens.delete(name) - - # Find the beginning of the method definition, which works for single-line - # and normal method definitions. - beginning = find_token(Kw, 'def') - - # If we don't have a bodystmt node, then we have a single-line method - unless bodystmt.is_a?(BodyStmt) - node = - DefEndless.new( - name: name, - paren: params, - statement: bodystmt, - location: beginning.location.to(bodystmt.location) - ) - - return node - end - - # If there aren't any params then we need to correct the params node - # location information - if params.is_a?(Params) && params.empty? - end_char = name.location.end_char - location = - Location.new( - start_line: params.location.start_line, - start_char: end_char, - end_line: params.location.end_line, - end_char: end_char - ) - - params = Params.new(location: location) - end - - ending = find_token(Kw, 'end') - bodystmt.bind( - find_next_statement_start(params.location.end_char), - ending.location.start_char - ) - - Def.new( - name: name, - params: params, - bodystmt: bodystmt, - location: beginning.location.to(ending.location) - ) - end - - # Defined represents the use of the +defined?+ operator. It can be used with - # and without parentheses. - # - # defined?(variable) - # - class Defined - # [untyped] the value being sent to the keyword - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('defined') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :defined, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_defined: (untyped value) -> Defined - def on_defined(value) - beginning = find_token(Kw, 'defined?') - ending = value - - range = beginning.location.end_char...value.location.start_char - if source[range].include?('(') - find_token(LParen) - ending = find_token(RParen) - end - - Defined.new(value: value, location: beginning.location.to(ending.location)) - end - - # Defs represents defining a singleton method on an object. - # - # def object.method(param) result end - # - class Defs - # [untyped] the target where the method is being defined - attr_reader :target - - # [Op | Period] the operator being used to declare the method - attr_reader :operator - - # [Backtick | Const | Ident | Kw | Op] the name of the method - attr_reader :name - - # [Params | Paren] the parameter declaration for the method - attr_reader :params - - # [BodyStmt] the expressions to be executed by the method - attr_reader :bodystmt - - # [Location] the location of this node - attr_reader :location - - def initialize(target:, operator:, name:, params:, bodystmt:, location:) - @target = target - @operator = operator - @name = name - @params = params - @bodystmt = bodystmt - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('defs') - - q.breakable - q.pp(target) - - q.breakable - q.pp(operator) - - q.breakable - q.pp(name) - - q.breakable - q.pp(params) - - q.breakable - q.pp(bodystmt) - end - end - - def to_json(*opts) - { - type: :defs, - target: target, - op: operator, - name: name, - params: params, - bodystmt: bodystmt, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_defs: ( - # untyped target, - # (Op | Period) operator, - # (Backtick | Const | Ident | Kw | Op) name, - # (Params | Paren) params, - # BodyStmt bodystmt - # ) -> Defs - def on_defs(target, operator, name, params, bodystmt) - # Make sure to delete this token in case you're defining something - # like def class which would lead to this being a kw and causing all kinds - # of trouble - tokens.delete(name) - - # If there aren't any params then we need to correct the params node - # location information - if params.is_a?(Params) && params.empty? - end_char = name.location.end_char - location = - Location.new( - start_line: params.location.start_line, - start_char: end_char, - end_line: params.location.end_line, - end_char: end_char - ) - - params = Params.new(location: location) - end - - beginning = find_token(Kw, 'def') - ending = find_token(Kw, 'end') - - bodystmt.bind( - find_next_statement_start(params.location.end_char), - ending.location.start_char - ) - - Defs.new( - target: target, - operator: operator, - name: name, - params: params, - bodystmt: bodystmt, - location: beginning.location.to(ending.location) - ) - end - - # DoBlock represents passing a block to a method call using the +do+ and +end+ - # keywords. - # - # method do |value| - # end - # - class DoBlock - # [Kw] the do keyword that opens this block - attr_reader :keyword - - # [nil | BlockVar] the optional variable declaration within this block - attr_reader :block_var - - # [BodyStmt] the expressions to be executed within this block - attr_reader :bodystmt - - # [Location] the location of this node - attr_reader :location - - def initialize(keyword:, block_var:, bodystmt:, location:) - @keyword = keyword - @block_var = block_var - @bodystmt = bodystmt - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('do_block') - - if block_var - q.breakable - q.pp(block_var) - end - - q.breakable - q.pp(bodystmt) - end - end - - def to_json(*opts) - { - type: :do_block, - keyword: keyword, - block_var: block_var, - bodystmt: bodystmt, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_do_block: (BlockVar block_var, BodyStmt bodystmt) -> DoBlock - def on_do_block(block_var, bodystmt) - beginning = find_token(Kw, 'do') - ending = find_token(Kw, 'end') - - bodystmt.bind( - find_next_statement_start((block_var || beginning).location.end_char), - ending.location.start_char - ) - - DoBlock.new( - keyword: beginning, - block_var: block_var, - bodystmt: bodystmt, - location: beginning.location.to(ending.location) - ) - end - - # Dot2 represents using the .. operator between two expressions. Usually this - # is to create a range object. - # - # 1..2 - # - # Sometimes this operator is used to create a flip-flop. - # - # if value == 5 .. value == 10 - # end - # - # One of the sides of the expression may be nil, but not both. - class Dot2 - # [nil | untyped] the left side of the expression - attr_reader :left - - # [nil | untyped] the right side of the expression - attr_reader :right - - # [Location] the location of this node - attr_reader :location - - def initialize(left:, right:, location:) - @left = left - @right = right - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('dot2') - - if left - q.breakable - q.pp(left) - end - - if right - q.breakable - q.pp(right) - end - end - end - - def to_json(*opts) - { type: :dot2, left: left, right: right, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_dot2: ((nil | untyped) left, (nil | untyped) right) -> Dot2 - def on_dot2(left, right) - operator = find_token(Op, '..') - - beginning = left || operator - ending = right || operator - - Dot2.new( - left: left, - right: right, - location: beginning.location.to(ending.location) - ) - end - - # Dot3 represents using the ... operator between two expressions. Usually this - # is to create a range object. It's effectively the same event as the Dot2 - # node but with this operator you're asking Ruby to omit the final value. - # - # 1...2 - # - # Like Dot2 it can also be used to create a flip-flop. - # - # if value == 5 ... value == 10 - # end - # - # One of the sides of the expression may be nil, but not both. - class Dot3 - # [nil | untyped] the left side of the expression - attr_reader :left - - # [nil | untyped] the right side of the expression - attr_reader :right - - # [Location] the location of this node - attr_reader :location - - def initialize(left:, right:, location:) - @left = left - @right = right - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('dot3') - - if left - q.breakable - q.pp(left) - end - - if right - q.breakable - q.pp(right) - end - end - end - - def to_json(*opts) - { type: :dot3, left: left, right: right, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_dot3: ((nil | untyped) left, (nil | untyped) right) -> Dot3 - def on_dot3(left, right) - operator = find_token(Op, '...') - - beginning = left || operator - ending = right || operator - - Dot3.new( - left: left, - right: right, - location: beginning.location.to(ending.location) - ) - end - - # DynaSymbol represents a symbol literal that uses quotes to dynamically - # define its value. - # - # :"#{variable}" - # - # They can also be used as a special kind of dynamic hash key, as in: - # - # { "#{key}": value } - # - class DynaSymbol - # [Array[ StringDVar | StringEmbExpr | TStringContent ]] the parts of the - # dynamic symbol - attr_reader :parts - - # [String] the quote used to delimit the dynamic symbol - attr_reader :quote - - # [Location] the location of this node - attr_reader :location - - def initialize(parts:, quote:, location:) - @parts = parts - @quote = quote - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('dyna_symbol') - - q.breakable - q.group(2, '(', ')') { q.seplist(parts) { |part| q.pp(part) } } - end - end - - def to_json(*opts) - { type: :dyna_symbol, parts: parts, quote: quote, loc: location }.to_json( - *opts - ) - end - end - - # :call-seq: - # on_dyna_symbol: (StringContent string_content) -> DynaSymbol - def on_dyna_symbol(string_content) - if find_token(SymBeg, consume: false) - # A normal dynamic symbol - symbeg = find_token(SymBeg) - tstring_end = find_token(TStringEnd) - - DynaSymbol.new( - quote: symbeg.value, - parts: string_content.parts, - location: symbeg.location.to(tstring_end.location) - ) - else - # A dynamic symbol as a hash key - tstring_beg = find_token(TStringBeg) - label_end = find_token(LabelEnd) - - DynaSymbol.new( - parts: string_content.parts, - quote: label_end.value[0], - location: tstring_beg.location.to(label_end.location) - ) - end - end - - # Else represents the end of an +if+, +unless+, or +case+ chain. - # - # if variable - # else - # end - # - class Else - # [Statements] the expressions to be executed - attr_reader :statements - - # [Location] the location of this node - attr_reader :location - - def initialize(statements:, location:) - @statements = statements - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('else') - - q.breakable - q.pp(statements) - end - end - - def to_json(*opts) - { type: :else, stmts: statements, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_else: (Statements statements) -> Else - def on_else(statements) - beginning = find_token(Kw, 'else') - - # else can either end with an end keyword (in which case we'll want to - # consume that event) or it can end with an ensure keyword (in which case - # we'll leave that to the ensure to handle). - index = - tokens.rindex do |token| - token.is_a?(Kw) && %w[end ensure].include?(token.value) - end - - node = tokens[index] - ending = node.value == 'end' ? tokens.delete_at(index) : node - - statements.bind(beginning.location.end_char, ending.location.start_char) - - Else.new( - statements: statements, - location: beginning.location.to(ending.location) - ) - end - - # Elsif represents another clause in an +if+ or +unless+ chain. - # - # if variable - # elsif other_variable - # end - # - class Elsif - # [untyped] the expression to be checked - attr_reader :predicate - - # [Statements] the expressions to be executed - attr_reader :statements - - # [nil | Elsif | Else] the next clause in the chain - attr_reader :consequent - - # [Location] the location of this node - attr_reader :location - - def initialize(predicate:, statements:, consequent:, location:) - @predicate = predicate - @statements = statements - @consequent = consequent - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('elsif') - - q.breakable - q.pp(predicate) - - q.breakable - q.pp(statements) - - if consequent - q.breakable - q.pp(consequent) - end - end - end - - def to_json(*opts) - { - type: :elsif, - pred: predicate, - stmts: statements, - cons: consequent, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_elsif: ( - # untyped predicate, - # Statements statements, - # (nil | Elsif | Else) consequent - # ) -> Elsif - def on_elsif(predicate, statements, consequent) - beginning = find_token(Kw, 'elsif') - ending = consequent || find_token(Kw, 'end') - - statements.bind(predicate.location.end_char, ending.location.start_char) - - Elsif.new( - predicate: predicate, - statements: statements, - consequent: consequent, - location: beginning.location.to(ending.location) - ) - end - - # EmbDoc represents a multi-line comment. - # - # =begin - # first line - # second line - # =end - # - class EmbDoc - # [String] the contents of the comment - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def inline? - false - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('embdoc') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :embdoc, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_embdoc: (String value) -> EmbDoc - def on_embdoc(value) - @embdoc.value << value - @embdoc - end - - # :call-seq: - # on_embdoc_beg: (String value) -> EmbDoc - def on_embdoc_beg(value) - @embdoc = - EmbDoc.new( - value: value, - location: Location.fixed(line: lineno, char: char_pos) - ) - end - - # :call-seq: - # on_embdoc_end: (String value) -> EmbDoc - def on_embdoc_end(value) - location = @embdoc.location - embdoc = - EmbDoc.new( - value: @embdoc.value << value.chomp, - location: - Location.new( - start_line: location.start_line, - start_char: location.start_char, - end_line: lineno, - end_char: char_pos + value.length - 1 - ) - ) - - @comments << embdoc - @embdoc = nil - - embdoc - end - - # EmbExprBeg represents the beginning token for using interpolation inside of - # a parent node that accepts string content (like a string or regular - # expression). - # - # "Hello, #{person}!" - # - class EmbExprBeg - # [String] the #{ used in the string - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - end - - # :call-seq: - # on_embexpr_beg: (String value) -> EmbExprBeg - def on_embexpr_beg(value) - node = - EmbExprBeg.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # EmbExprEnd represents the ending token for using interpolation inside of a - # parent node that accepts string content (like a string or regular - # expression). - # - # "Hello, #{person}!" - # - class EmbExprEnd - # [String] the } used in the string - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - end - - # :call-seq: - # on_embexpr_end: (String value) -> EmbExprEnd - def on_embexpr_end(value) - node = - EmbExprEnd.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # EmbVar represents the use of shorthand interpolation for an instance, class, - # or global variable into a parent node that accepts string content (like a - # string or regular expression). - # - # "#@variable" - # - # In the example above, an EmbVar node represents the # because it forces - # @variable to be interpolated. - class EmbVar - # [String] the # used in the string - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - end - - # :call-seq: - # on_embvar: (String value) -> EmbVar - def on_embvar(value) - node = - EmbVar.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # Ensure represents the use of the +ensure+ keyword and its subsequent - # statements. - # - # begin - # ensure - # end - # - class Ensure - # [Kw] the ensure keyword that began this node - attr_reader :keyword - - # [Statements] the expressions to be executed - attr_reader :statements - - # [Location] the location of this node - attr_reader :location - - def initialize(keyword:, statements:, location:) - @keyword = keyword - @statements = statements - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('ensure') - - q.breakable - q.pp(statements) - end - end - - def to_json(*opts) - { - type: :ensure, - keyword: keyword, - stmts: statements, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_ensure: (Statements statements) -> Ensure - def on_ensure(statements) - keyword = find_token(Kw, 'ensure') - - # We don't want to consume the :@kw event, because that would break - # def..ensure..end chains. - ending = find_token(Kw, 'end', consume: false) - statements.bind( - find_next_statement_start(keyword.location.end_char), - ending.location.start_char - ) - - Ensure.new( - keyword: keyword, - statements: statements, - location: keyword.location.to(ending.location) - ) - end - - # ExcessedComma represents a trailing comma in a list of block parameters. It - # changes the block parameters such that they will destructure. - # - # [[1, 2, 3], [2, 3, 4]].each do |first, second,| - # end - # - # In the above example, an ExcessedComma node would appear in the third - # position of the Params node that is used to declare that block. The third - # position typically represents a rest-type parameter, but in this case is - # used to indicate that a trailing comma was used. - class ExcessedComma - # [String] the comma - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('excessed_comma') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :excessed_comma, value: value, loc: location }.to_json(*opts) - end - end - - # The handler for this event accepts no parameters (though in previous - # versions of Ruby it accepted a string literal with a value of ","). - # - # :call-seq: - # on_excessed_comma: () -> ExcessedComma - def on_excessed_comma(*) - comma = find_token(Comma) - - ExcessedComma.new(value: comma.value, location: comma.location) - end - - # FCall represents the piece of a method call that comes before any arguments - # (i.e., just the name of the method). It is used in places where the parser - # is sure that it is a method call and not potentially a local variable. - # - # method(argument) - # - # In the above example, it's referring to the +method+ segment. - class FCall - # [Const | Ident] the name of the method - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('fcall') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :fcall, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_fcall: ((Const | Ident) value) -> FCall - def on_fcall(value) - FCall.new(value: value, location: value.location) - end - - # Field is always the child of an assignment. It represents assigning to a - # “field” on an object. - # - # object.variable = value - # - class Field - # [untyped] the parent object that owns the field being assigned - attr_reader :parent - - # [:"::" | Op | Period] the operator being used for the assignment - attr_reader :operator - - # [Const | Ident] the name of the field being assigned - attr_reader :name - - # [Location] the location of this node - attr_reader :location - - def initialize(parent:, operator:, name:, location:) - @parent = parent - @operator = operator - @name = name - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('field') - - q.breakable - q.pp(parent) - - q.breakable - q.pp(operator) - - q.breakable - q.pp(name) - end - end - - def to_json(*opts) - { - type: :field, - parent: parent, - op: operator, - name: name, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_field: ( - # untyped parent, - # (:"::" | Op | Period) operator - # (Const | Ident) name - # ) -> Field - def on_field(parent, operator, name) - Field.new( - parent: parent, - operator: operator, - name: name, - location: parent.location.to(name.location) - ) - end - - # FloatLiteral represents a floating point number literal. - # - # 1.0 - # - class FloatLiteral - # [String] the value of the floating point number literal - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('float') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :float, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_float: (String value) -> FloatLiteral - def on_float(value) - node = - FloatLiteral.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # FndPtn represents matching against a pattern where you find a pattern in an - # array using the Ruby 3.0+ pattern matching syntax. - # - # case value - # in [*, 7, *] - # end - # - class FndPtn - # [nil | untyped] the optional constant wrapper - attr_reader :constant - - # [VarField] the splat on the left-hand side - attr_reader :left - - # [Array[ untyped ]] the list of positional expressions in the pattern that - # are being matched - attr_reader :values - - # [VarField] the splat on the right-hand side - attr_reader :right - - # [Location] the location of this node - attr_reader :location - - def initialize(constant:, left:, values:, right:, location:) - @constant = constant - @left = left - @values = values - @right = right - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('fndptn') - - if constant - q.breakable - q.pp(constant) - end - - q.breakable - q.pp(left) - - q.breakable - q.group(2, '(', ')') { q.seplist(values) { |value| q.pp(value) } } - - q.breakable - q.pp(right) - end - end - - def to_json(*opts) - { - type: :fndptn, - constant: constant, - left: left, - values: values, - right: right, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_fndptn: ( - # (nil | untyped) constant, - # VarField left, - # Array[untyped] values, - # VarField right - # ) -> FndPtn - def on_fndptn(constant, left, values, right) - beginning = constant || find_token(LBracket) - ending = find_token(RBracket) - - FndPtn.new( - constant: constant, - left: left, - values: values, - right: right, - location: beginning.location.to(ending.location) - ) - end - - # For represents using a +for+ loop. - # - # for value in list do - # end - # - class For - # [MLHS | VarField] the variable declaration being used to - # pull values out of the object being enumerated - attr_reader :index - - # [untyped] the object being enumerated in the loop - attr_reader :collection - - # [Statements] the statements to be executed - attr_reader :statements - - # [Location] the location of this node - attr_reader :location - - def initialize(index:, collection:, statements:, location:) - @index = index - @collection = collection - @statements = statements - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('for') - - q.breakable - q.pp(index) - - q.breakable - q.pp(collection) - - q.breakable - q.pp(statements) - end - end - - def to_json(*opts) - { - type: :for, - index: index, - collection: collection, - stmts: statements, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_for: ( - # (MLHS | VarField) value, - # untyped collection, - # Statements statements - # ) -> For - def on_for(index, collection, statements) - beginning = find_token(Kw, 'for') - ending = find_token(Kw, 'end') - - # Consume the do keyword if it exists so that it doesn't get confused for - # some other block - keyword = find_token(Kw, 'do', consume: false) - if keyword && keyword.location.start_char > collection.location.end_char && - keyword.location.end_char < ending.location.start_char - tokens.delete(keyword) - end - - statements.bind( - (keyword || collection).location.end_char, - ending.location.start_char - ) - - For.new( - index: index, - collection: collection, - statements: statements, - location: beginning.location.to(ending.location) - ) - end - - # GVar represents a global variable literal. - # - # $variable - # - class GVar - # [String] the name of the global variable - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('gvar') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :gvar, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_gvar: (String value) -> GVar - def on_gvar(value) - node = - GVar.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # HashLiteral represents a hash literal. - # - # { key => value } - # - class HashLiteral - # [nil | AssocListFromArgs] the contents of the hash - attr_reader :contents - - # [Location] the location of this node - attr_reader :location - - def initialize(contents:, location:) - @contents = contents - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('hash') - - q.breakable - q.pp(contents) - end - end - - def to_json(*opts) - { type: :hash, cnts: contents, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_hash: ((nil | AssocListFromArgs) contents) -> HashLiteral - def on_hash(contents) - lbrace = find_token(LBrace) - rbrace = find_token(RBrace) - - if contents - # Here we're going to expand out the location information for the contents - # node so that it can grab up any remaining comments inside the hash. - location = - Location.new( - start_line: contents.location.start_line, - start_char: lbrace.location.end_char, - end_line: contents.location.end_line, - end_char: rbrace.location.start_char - ) - - contents = contents.class.new(assocs: contents.assocs, location: location) - end - - HashLiteral.new( - contents: contents, - location: lbrace.location.to(rbrace.location) - ) - end - - # Heredoc represents a heredoc string literal. - # - # <<~DOC - # contents - # DOC - # - class Heredoc - # [HeredocBeg] the opening of the heredoc - attr_reader :beginning - - # [String] the ending of the heredoc - attr_reader :ending - - # [Array[ StringEmbExpr | StringDVar | TStringContent ]] the parts of the - # heredoc string literal - attr_reader :parts - - # [Location] the location of this node - attr_reader :location - - def initialize(beginning:, ending: nil, parts: [], location:) - @beginning = beginning - @ending = ending - @parts = parts - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('heredoc') - - q.breakable - q.group(2, '(', ')') { q.seplist(parts) { |part| q.pp(part) } } - end - end - - def to_json(*opts) - { - type: :heredoc, - beging: beginning, - ending: ending, - parts: parts, - loc: location - }.to_json(*opts) - end - end - - # HeredocBeg represents the beginning declaration of a heredoc. - # - # <<~DOC - # contents - # DOC - # - # In the example above the HeredocBeg node represents <<~DOC. - class HeredocBeg - # [String] the opening declaration of the heredoc - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('heredoc_beg') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :heredoc_beg, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_heredoc_beg: (String value) -> HeredocBeg - def on_heredoc_beg(value) - location = - Location.token(line: lineno, char: char_pos, size: value.size + 1) - - # Here we're going to artificially create an extra node type so that if - # there are comments after the declaration of a heredoc, they get printed. - beginning = HeredocBeg.new(value: value, location: location) - @heredocs << Heredoc.new(beginning: beginning, location: location) - - beginning - end - - # :call-seq: - # on_heredoc_dedent: (StringContent string, Integer width) -> Heredoc - def on_heredoc_dedent(string, width) - heredoc = @heredocs[-1] - - @heredocs[-1] = - Heredoc.new( - beginning: heredoc.beginning, - ending: heredoc.ending, - parts: string.parts, - location: heredoc.location - ) - end - - # :call-seq: - # on_heredoc_end: (String value) -> Heredoc - def on_heredoc_end(value) - heredoc = @heredocs[-1] - - @heredocs[-1] = - Heredoc.new( - beginning: heredoc.beginning, - ending: value.chomp, - parts: heredoc.parts, - location: - Location.new( - start_line: heredoc.location.start_line, - start_char: heredoc.location.start_char, - end_line: lineno, - end_char: char_pos - ) - ) - end - - # HshPtn represents matching against a hash pattern using the Ruby 2.7+ - # pattern matching syntax. - # - # case value - # in { key: } - # end - # - class HshPtn - # [nil | untyped] the optional constant wrapper - attr_reader :constant - - # [Array[ [Label, untyped] ]] the set of tuples representing the keywords - # that should be matched against in the pattern - attr_reader :keywords - - # [nil | VarField] an optional parameter to gather up all remaining keywords - attr_reader :keyword_rest - - # [Location] the location of this node - attr_reader :location - - def initialize(constant:, keywords:, keyword_rest:, location:) - @constant = constant - @keywords = keywords - @keyword_rest = keyword_rest - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('hshptn') - - if constant - q.breakable - q.pp(constant) - end - - if keywords.any? - q.breakable - q.group(2, '(', ')') do - q.seplist(keywords) { |keyword| q.pp(keyword) } - end - end - - if keyword_rest - q.breakable - q.pp(keyword_rest) - end - end - end - - def to_json(*opts) - { - type: :hshptn, - constant: constant, - keywords: keywords, - kwrest: keyword_rest, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_hshptn: ( - # (nil | untyped) constant, - # Array[[Label, untyped]] keywords, - # (nil | VarField) keyword_rest - # ) -> HshPtn - def on_hshptn(constant, keywords, keyword_rest) - parts = [constant, keywords, keyword_rest].flatten(2).compact - - HshPtn.new( - constant: constant, - keywords: keywords, - keyword_rest: keyword_rest, - location: parts[0].location.to(parts[-1].location) - ) - end - - # Ident represents an identifier anywhere in code. It can represent a very - # large number of things, depending on where it is in the syntax tree. - # - # value - # - class Ident - # [String] the value of the identifier - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('ident') - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { - type: :ident, - value: value.force_encoding('UTF-8'), - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_ident: (String value) -> Ident - def on_ident(value) - node = - Ident.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # If represents the first clause in an +if+ chain. - # - # if predicate - # end - # - class If - # [untyped] the expression to be checked - attr_reader :predicate - - # [Statements] the expressions to be executed - attr_reader :statements - - # [nil, Elsif, Else] the next clause in the chain - attr_reader :consequent - - # [Location] the location of this node - attr_reader :location - - def initialize(predicate:, statements:, consequent:, location:) - @predicate = predicate - @statements = statements - @consequent = consequent - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('if') - - q.breakable - q.pp(predicate) - - q.breakable - q.pp(statements) - - if consequent - q.breakable - q.pp(consequent) - end - end - end - - def to_json(*opts) - { - type: :if, - pred: predicate, - stmts: statements, - cons: consequent, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_if: ( - # untyped predicate, - # Statements statements, - # (nil | Elsif | Else) consequent - # ) -> If - def on_if(predicate, statements, consequent) - beginning = find_token(Kw, 'if') - ending = consequent || find_token(Kw, 'end') - - statements.bind(predicate.location.end_char, ending.location.start_char) - - If.new( - predicate: predicate, - statements: statements, - consequent: consequent, - location: beginning.location.to(ending.location) - ) - end - - # IfOp represents a ternary clause. - # - # predicate ? truthy : falsy - # - class IfOp - # [untyped] the expression to be checked - attr_reader :predicate - - # [untyped] the expression to be executed if the predicate is truthy - attr_reader :truthy - - # [untyped] the expression to be executed if the predicate is falsy - attr_reader :falsy - - # [Location] the location of this node - attr_reader :location - - def initialize(predicate:, truthy:, falsy:, location:) - @predicate = predicate - @truthy = truthy - @falsy = falsy - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('ifop') - - q.breakable - q.pp(predicate) - - q.breakable - q.pp(truthy) - - q.breakable - q.pp(falsy) - end - end - - def to_json(*opts) - { - type: :ifop, - pred: predicate, - tthy: truthy, - flsy: falsy, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_ifop: (untyped predicate, untyped truthy, untyped falsy) -> IfOp - def on_ifop(predicate, truthy, falsy) - IfOp.new( - predicate: predicate, - truthy: truthy, - falsy: falsy, - location: predicate.location.to(falsy.location) - ) - end - - # IfMod represents the modifier form of an +if+ statement. - # - # expression if predicate - # - class IfMod - # [untyped] the expression to be executed - attr_reader :statement - - # [untyped] the expression to be checked - attr_reader :predicate - - # [Location] the location of this node - attr_reader :location - - def initialize(statement:, predicate:, location:) - @statement = statement - @predicate = predicate - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('if_mod') - - q.breakable - q.pp(statement) - - q.breakable - q.pp(predicate) - end - end - - def to_json(*opts) - { - type: :if_mod, - stmt: statement, - pred: predicate, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_if_mod: (untyped predicate, untyped statement) -> IfMod - def on_if_mod(predicate, statement) - find_token(Kw, 'if') - - IfMod.new( - statement: statement, - predicate: predicate, - location: statement.location.to(predicate.location) - ) - end - - # def on_ignored_nl(value) - # value - # end - - # def on_ignored_sp(value) - # value - # end - - # Imaginary represents an imaginary number literal. - # - # 1i - # - class Imaginary - # [String] the value of the imaginary number literal - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('imaginary') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :imaginary, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_imaginary: (String value) -> Imaginary - def on_imaginary(value) - node = - Imaginary.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # In represents using the +in+ keyword within the Ruby 2.7+ pattern matching - # syntax. - # - # case value - # in pattern - # end - # - class In - # [untyped] the pattern to check against - attr_reader :pattern - - # [Statements] the expressions to execute if the pattern matched - attr_reader :statements - - # [nil | In | Else] the next clause in the chain - attr_reader :consequent - - # [Location] the location of this node - attr_reader :location - - def initialize(pattern:, statements:, consequent:, location:) - @pattern = pattern - @statements = statements - @consequent = consequent - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('in') - - q.breakable - q.pp(pattern) - - q.breakable - q.pp(statements) - - if consequent - q.breakable - q.pp(consequent) - end - end - end - - def to_json(*opts) - { - type: :in, - pattern: pattern, - stmts: statements, - cons: consequent, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_in: (RAssign pattern, nil statements, nil consequent) -> RAssign - # | ( - # untyped pattern, - # Statements statements, - # (nil | In | Else) consequent - # ) -> In - def on_in(pattern, statements, consequent) - # Here we have a rightward assignment - return pattern unless statements - - beginning = find_token(Kw, 'in') - ending = consequent || find_token(Kw, 'end') - - statements.bind(beginning.location.end_char, ending.location.start_char) - - In.new( - pattern: pattern, - statements: statements, - consequent: consequent, - location: beginning.location.to(ending.location) - ) - end - - # Int represents an integer number literal. - # - # 1 - # - class Int - # [String] the value of the integer - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('int') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :int, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_int: (String value) -> Int - def on_int(value) - node = - Int.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # IVar represents an instance variable literal. - # - # @variable - # - class IVar - # [String] the name of the instance variable - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('ivar') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :ivar, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_ivar: (String value) -> IVar - def on_ivar(value) - node = - IVar.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # Kw represents the use of a keyword. It can be almost anywhere in the syntax - # tree, so you end up seeing it quite a lot. - # - # if value - # end - # - # In the above example, there would be two Kw nodes: one for the if and one - # for the end. Note that anything that matches the list of keywords in Ruby - # will use a Kw, so if you use a keyword in a symbol literal for instance: - # - # :if - # - # then the contents of the symbol node will contain a Kw node. - class Kw - # [String] the value of the keyword - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('kw') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :kw, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_kw: (String value) -> Kw - def on_kw(value) - node = - Kw.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # KwRestParam represents defining a parameter in a method definition that - # accepts all remaining keyword parameters. - # - # def method(**kwargs) end - # - class KwRestParam - # [nil | Ident] the name of the parameter - attr_reader :name - - # [Location] the location of this node - attr_reader :location - - def initialize(name:, location:) - @name = name - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('kwrest_param') - - q.breakable - q.pp(name) - end - end - - def to_json(*opts) - { type: :kwrest_param, name: name, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_kwrest_param: ((nil | Ident) name) -> KwRestParam - def on_kwrest_param(name) - location = find_token(Op, '**').location - location = location.to(name.location) if name - - KwRestParam.new(name: name, location: location) - end - - # Label represents the use of an identifier to associate with an object. You - # can find it in a hash key, as in: - # - # { key: value } - # - # In this case "key:" would be the body of the label. You can also find it in - # pattern matching, as in: - # - # case value - # in key: - # end - # - # In this case "key:" would be the body of the label. - class Label - # [String] the value of the label - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('label') - - q.breakable - q.text(':') - q.text(value[0...-1]) - end - end - - def to_json(*opts) - { type: :label, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_label: (String value) -> Label - def on_label(value) - node = - Label.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # LabelEnd represents the end of a dynamic symbol. - # - # { "key": value } - # - # In the example above, LabelEnd represents the "\":" token at the end of the - # hash key. This node is important for determining the type of quote being - # used by the label. - class LabelEnd - # [String] the end of the label - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - end - - # :call-seq: - # on_label_end: (String value) -> LabelEnd - def on_label_end(value) - node = - LabelEnd.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # Lambda represents using a lambda literal (not the lambda method call). - # - # ->(value) { value * 2 } - # - class Lambda - # [Params | Paren] the parameter declaration for this lambda - attr_reader :params - - # [BodyStmt | Statements] the expressions to be executed in this lambda - attr_reader :statements - - # [Location] the location of this node - attr_reader :location - - def initialize(params:, statements:, location:) - @params = params - @statements = statements - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('lambda') - - q.breakable - q.pp(params) - - q.breakable - q.pp(statements) - end - end - - def to_json(*opts) - { - type: :lambda, - params: params, - stmts: statements, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_lambda: ( - # (Params | Paren) params, - # (BodyStmt | Statements) statements - # ) -> Lambda - def on_lambda(params, statements) - beginning = find_token(TLambda) - - if token = find_token(TLamBeg, consume: false) - opening = tokens.delete(token) - closing = find_token(RBrace) - else - opening = find_token(Kw, 'do') - closing = find_token(Kw, 'end') - end - - statements.bind(opening.location.end_char, closing.location.start_char) - - Lambda.new( - params: params, - statements: statements, - location: beginning.location.to(closing.location) - ) - end - - # LBrace represents the use of a left brace, i.e., {. - class LBrace - # [String] the left brace - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('lbrace') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :lbrace, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_lbrace: (String value) -> LBrace - def on_lbrace(value) - node = - LBrace.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # LBracket represents the use of a left bracket, i.e., [. - class LBracket - # [String] the left bracket - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - end - - # :call-seq: - # on_lbracket: (String value) -> LBracket - def on_lbracket(value) - node = - LBracket.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # LParen represents the use of a left parenthesis, i.e., (. - class LParen - # [String] the left parenthesis - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('lparen') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :lparen, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_lparen: (String value) -> LParen - def on_lparen(value) - node = - LParen.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # def on_magic_comment(key, value) - # [key, value] - # end - - # MAssign is a parent node of any kind of multiple assignment. This includes - # splitting out variables on the left like: - # - # first, second, third = value - # - # as well as splitting out variables on the right, as in: - # - # value = first, second, third - # - # Both sides support splats, as well as variables following them. There's also - # destructuring behavior that you can achieve with the following: - # - # first, = value - # - class MAssign - # [Mlhs | MlhsParen] the target of the multiple assignment - attr_reader :target - - # [untyped] the value being assigned - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(target:, value:, location:) - @target = target - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('massign') - - q.breakable - q.pp(target) - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :massign, target: target, value: value, loc: location }.to_json( - *opts - ) - end - end - - # :call-seq: - # on_massign: ((Mlhs | MlhsParen) target, untyped value) -> MAssign - def on_massign(target, value) - comma_range = target.location.end_char...value.location.start_char - target.comma = true if source[comma_range].strip.start_with?(',') - - MAssign.new( - target: target, - value: value, - location: target.location.to(value.location) - ) - end - - # MethodAddArg represents a method call with arguments and parentheses. - # - # method(argument) - # - # MethodAddArg can also represent with a method on an object, as in: - # - # object.method(argument) - # - # Finally, MethodAddArg can represent calling a method with no receiver that - # ends in a ?. In this case, the parser knows it's a method call and not a - # local variable, so it uses a MethodAddArg node as opposed to a VCall node, - # as in: - # - # method? - # - class MethodAddArg - # [Call | FCall] the method call - attr_reader :call - - # [ArgParen | Args | ArgsAddBlock] the arguments to the method call - attr_reader :arguments - - # [Location] the location of this node - attr_reader :location - - def initialize(call:, arguments:, location:) - @call = call - @arguments = arguments - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('method_add_arg') - - q.breakable - q.pp(call) - - q.breakable - q.pp(arguments) - end - end - - def to_json(*opts) - { - type: :method_add_arg, - call: call, - args: arguments, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_method_add_arg: ( - # (Call | FCall) call, - # (ArgParen | Args | ArgsAddBlock) arguments - # ) -> MethodAddArg - def on_method_add_arg(call, arguments) - location = call.location - - location = location.to(arguments.location) unless arguments.is_a?(Args) - - MethodAddArg.new(call: call, arguments: arguments, location: location) - end - - # MethodAddBlock represents a method call with a block argument. - # - # method {} - # - class MethodAddBlock - # [Call | Command | CommandCall | FCall | MethodAddArg] the method call - attr_reader :call - - # [BraceBlock | DoBlock] the block being sent with the method call - attr_reader :block - - # [Location] the location of this node - attr_reader :location - - def initialize(call:, block:, location:) - @call = call - @block = block - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('method_add_block') - - q.breakable - q.pp(call) - - q.breakable - q.pp(block) - end - end - - def to_json(*opts) - { - type: :method_add_block, - call: call, - block: block, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_method_add_block: ( - # (Call | Command | CommandCall | FCall | MethodAddArg) call, - # (BraceBlock | DoBlock) block - # ) -> MethodAddBlock - def on_method_add_block(call, block) - MethodAddBlock.new( - call: call, - block: block, - location: call.location.to(block.location) - ) - end - - # MLHS represents a list of values being destructured on the left-hand side - # of a multiple assignment. - # - # first, second, third = value - # - class MLHS - # Array[ARefField | ArgStar | Field | Ident | MlhsParen | VarField] the - # parts of the left-hand side of a multiple assignment - attr_reader :parts - - # [boolean] whether or not there is a trailing comma at the end of this - # list, which impacts destructuring. It's an attr_accessor so that while - # the syntax tree is being built it can be set by its parent node - attr_accessor :comma - - # [Location] the location of this node - attr_reader :location - - def initialize(parts:, comma: false, location:) - @parts = parts - @comma = comma - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('mlhs') - - q.breakable - q.group(2, '(', ')') { q.seplist(parts) { |part| q.pp(part) } } - end - end - - def to_json(*opts) - { type: :mlhs, parts: parts, comma: comma, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_mlhs_add: ( - # MLHS mlhs, - # (ARefField | Field | Ident | MlhsParen | VarField) part - # ) -> MLHS - def on_mlhs_add(mlhs, part) - location = - mlhs.parts.empty? ? part.location : mlhs.location.to(part.location) - - MLHS.new(parts: mlhs.parts << part, location: location) - end - - # :call-seq: - # on_mlhs_add_post: (MLHS left, MLHS right) -> MLHS - def on_mlhs_add_post(left, right) - MLHS.new( - parts: left.parts + right.parts, - location: left.location.to(right.location) - ) - end - - # :call-seq: - # on_mlhs_add_star: ( - # MLHS mlhs, - # (nil | ARefField | Field | Ident | VarField) part - # ) -> MLHS - def on_mlhs_add_star(mlhs, part) - beginning = find_token(Op, '*') - ending = part || beginning - - location = beginning.location.to(ending.location) - arg_star = ArgStar.new(value: part, location: location) - - location = mlhs.location.to(location) unless mlhs.parts.empty? - MLHS.new(parts: mlhs.parts << arg_star, location: location) - end - - # :call-seq: - # on_mlhs_new: () -> MLHS - def on_mlhs_new - MLHS.new(parts: [], location: Location.fixed(line: lineno, char: char_pos)) - end - - # MLHSParen represents parentheses being used to destruct values in a multiple - # assignment on the left hand side. - # - # (left, right) = value - # - class MLHSParen - # [Mlhs | MlhsParen] the contents inside of the parentheses - attr_reader :contents - - # [Location] the location of this node - attr_reader :location - - def initialize(contents:, location:) - @contents = contents - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('mlhs_paren') - - q.breakable - q.pp(contents) - end - end - - def to_json(*opts) - { type: :mlhs_paren, cnts: contents, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_mlhs_paren: ((Mlhs | MlhsParen) contents) -> MLHSParen - def on_mlhs_paren(contents) - lparen = find_token(LParen) - rparen = find_token(RParen) - - comma_range = lparen.location.end_char...rparen.location.start_char - contents.comma = true if source[comma_range].strip.end_with?(',') - - MLHSParen.new( - contents: contents, - location: lparen.location.to(rparen.location) - ) - end - - # ModuleDeclaration represents defining a module using the +module+ keyword. - # - # module Namespace - # end - # - class ModuleDeclaration - # [ConstPathRef | ConstRef | TopConstRef] the name of the module - attr_reader :constant - - # [BodyStmt] the expressions to be executed in the context of the module - attr_reader :bodystmt - - # [Location] the location of this node - attr_reader :location - - def initialize(constant:, bodystmt:, location:) - @constant = constant - @bodystmt = bodystmt - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('module') - - q.breakable - q.pp(constant) - - q.breakable - q.pp(bodystmt) - end - end - - def to_json(*opts) - { - type: :module, - constant: constant, - bodystmt: bodystmt, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_module: ( - # (ConstPathRef | ConstRef | TopConstRef) constant, - # BodyStmt bodystmt - # ) -> ModuleDeclaration - def on_module(constant, bodystmt) - beginning = find_token(Kw, 'module') - ending = find_token(Kw, 'end') - - bodystmt.bind( - find_next_statement_start(constant.location.end_char), - ending.location.start_char - ) - - ModuleDeclaration.new( - constant: constant, - bodystmt: bodystmt, - location: beginning.location.to(ending.location) - ) - end - - # MRHS represents the values that are being assigned on the right-hand side of - # a multiple assignment. - # - # values = first, second, third - # - class MRHS - # Array[untyped] the parts that are being assigned - attr_reader :parts - - # [Location] the location of this node - attr_reader :location - - def initialize(parts:, location:) - @parts = parts - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('mrhs') - - q.breakable - q.group(2, '(', ')') { q.seplist(parts) { |part| q.pp(part) } } - end - end - - def to_json(*opts) - { type: :mrhs, parts: parts, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_mrhs_new: () -> MRHS - def on_mrhs_new - MRHS.new(parts: [], location: Location.fixed(line: lineno, char: char_pos)) - end - - # :call-seq: - # on_mrhs_add: (MRHS mrhs, untyped part) -> MRHS - def on_mrhs_add(mrhs, part) - if mrhs.is_a?(MRHSNewFromArgs) - MRHS.new( - parts: [*mrhs.arguments.parts, part], - location: mrhs.location.to(part.location) - ) - elsif mrhs.parts.empty? - MRHS.new(parts: [part], location: mrhs.location) - else - MRHS.new(parts: mrhs.parts << part, loc: mrhs.location.to(part.location)) - end - end - - # MRHSAddStar represents using the splat operator to expand out a value on the - # right hand side of a multiple assignment. - # - # values = first, *rest - # - class MRHSAddStar - # [MRHS | MRHSNewFromArgs] the values before the splatted expression - attr_reader :mrhs - - # [untyped] the splatted expression - attr_reader :star - - # [Location] the location of this node - attr_reader :location - - def initialize(mrhs:, star:, location:) - @mrhs = mrhs - @star = star - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('mrhs_add_star') - - q.breakable - q.pp(mrhs) - - q.breakable - q.pp(star) - end - end - - def to_json(*opts) - { type: :mrhs_add_star, mrhs: mrhs, star: star, loc: location }.to_json( - *opts - ) - end - end - - # :call-seq: - # on_mrhs_add_star: ( - # (MRHS | MRHSNewFromArgs) mrhs, - # untyped star - # ) -> MRHSAddStar - def on_mrhs_add_star(mrhs, star) - beginning = find_token(Op, '*') - ending = star || beginning - - MRHSAddStar.new( - mrhs: mrhs, - star: star, - location: beginning.location.to(ending.location) - ) - end - - # MRHSNewFromArgs represents the shorthand of a multiple assignment that - # allows you to assign values using just commas as opposed to assigning from - # an array. - # - # values = first, second, third - # - class MRHSNewFromArgs - # [Args] the arguments being used in the assignment - attr_reader :arguments - - # [Location] the location of this node - attr_reader :location - - def initialize(arguments:, location:) - @arguments = arguments - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('mrhs_new_from_args') - - q.breakable - q.pp(arguments) - end - end - - def to_json(*opts) - { type: :mrhs_new_from_args, args: arguments, loc: location }.to_json( - *opts - ) - end - end - - # :call-seq: - # on_mrhs_new_from_args: (Args arguments) -> MRHSNewFromArgs - def on_mrhs_new_from_args(arguments) - MRHSNewFromArgs.new(arguments: arguments, location: arguments.location) - end - - # Next represents using the +next+ keyword. - # - # next - # - # The +next+ keyword can also optionally be called with an argument: - # - # next value - # - # +next+ can even be called with multiple arguments, but only if parentheses - # are omitted, as in: - # - # next first, second, third - # - # If a single value is being given, parentheses can be used, as in: - # - # next(value) - # - class Next - # [Args | ArgsAddBlock] the arguments passed to the next keyword - attr_reader :arguments - - # [Location] the location of this node - attr_reader :location - - def initialize(arguments:, location:) - @arguments = arguments - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('next') - - q.breakable - q.pp(arguments) - end - end - - def to_json(*opts) - { type: :next, args: arguments, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_next: ((Args | ArgsAddBlock) arguments) -> Next - def on_next(arguments) - keyword = find_token(Kw, 'next') - - location = keyword.location - location = location.to(arguments.location) unless arguments.is_a?(Args) - - Next.new(arguments: arguments, location: location) - end - - # def on_nl(value) - # value - # end - - # def on_nokw_param(value) - # value - # end - - # Op represents an operator literal in the source. - # - # 1 + 2 - # - # In the example above, the Op node represents the + operator. - class Op - # [String] the operator - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('op') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :op, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_op: (String value) -> Op - def on_op(value) - node = - Op.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # OpAssign represents assigning a value to a variable or constant using an - # operator like += or ||=. - # - # variable += value - # - class OpAssign - # [ARefField | ConstPathField | Field | TopConstField | VarField] the target - # to assign the result of the expression to - attr_reader :target - - # [Op] the operator being used for the assignment - attr_reader :operator - - # [untyped] the expression to be assigned - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(target:, operator:, value:, location:) - @target = target - @operator = operator - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('opassign') - - q.breakable - q.pp(target) - - q.breakable - q.pp(operator) - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { - type: :opassign, - target: target, - op: operator, - value: value, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_opassign: ( - # (ARefField | ConstPathField | Field | TopConstField | VarField) target, - # Op operator, - # untyped value - # ) -> OpAssign - def on_opassign(target, operator, value) - OpAssign.new( - target: target, - operator: operator, - value: value, - location: target.location.to(value.location) - ) - end - - # def on_operator_ambiguous(value) - # value - # end - - # Params represents defining parameters on a method or lambda. - # - # def method(param) end - # - class Params - # [Array[ Ident ]] any required parameters - attr_reader :requireds - - # [Array[ [ Ident, untyped ] ]] any optional parameters and their default - # values - attr_reader :optionals - - # [nil | ArgsForward | ExcessedComma | RestParam] the optional rest - # parameter - attr_reader :rest - - # [Array[ Ident ]] any positional parameters that exist after a rest - # parameter - attr_reader :posts - - # [Array[ [ Ident, nil | untyped ] ]] any keyword parameters and their - # optional default values - attr_reader :keywords - - # [nil | :nil | KwRestParam] the optional keyword rest parameter - attr_reader :keyword_rest - - # [nil | BlockArg] the optional block parameter - attr_reader :block - - # [Location] the location of this node - attr_reader :location - - def initialize( - requireds: [], - optionals: [], - rest: nil, - posts: [], - keywords: [], - keyword_rest: nil, - block: nil, - location: - ) - @requireds = requireds - @optionals = optionals - @rest = rest - @posts = posts - @keywords = keywords - @keyword_rest = keyword_rest - @block = block - @location = location - end - - # Params nodes are the most complicated in the tree. Occasionally you want - # to know if they are "empty", which means not having any parameters - # declared. This logic accesses every kind of parameter and determines if - # it's missing. - def empty? - requireds.empty? && optionals.empty? && !rest && posts.empty? && - keywords.empty? && !keyword_rest && !block - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('params') - - if requireds.any? - q.breakable - q.group(2, '(', ')') { q.seplist(requireds) { |name| q.pp(name) } } - end - - if optionals.any? - q.breakable - q.group(2, '(', ')') do - q.seplist(optionals) do |(name, default)| - q.pp(name) - q.text('=') - q.group(2) do - q.breakable('') - q.pp(default) - end - end - end - end - - if rest - q.breakable - q.pp(rest) - end - - if posts.any? - q.breakable - q.group(2, '(', ')') { q.seplist(posts) { |value| q.pp(value) } } - end - - if keywords.any? - q.breakable - q.group(2, '(', ')') do - q.seplist(keywords) do |(name, default)| - q.pp(name) - - if default - q.text('=') - q.group(2) do - q.breakable('') - q.pp(default) - end - end - end - end - end - - if keyword_rest - q.breakable - q.pp(keyword_rest) - end - - if block - q.breakable - q.pp(block) - end - end - end - - def to_json(*opts) - { - type: :params, - reqs: requireds, - opts: optionals, - rest: rest, - posts: posts, - keywords: keywords, - kwrest: keyword_rest, - block: block, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_params: ( - # (nil | Array[Ident]) requireds, - # (nil | Array[[Ident, untyped]]) optionals, - # (nil | ArgsForward | ExcessedComma | RestParam) rest, - # (nil | Array[Ident]) posts, - # (nil | Array[[Ident, nil | untyped]]) keywords, - # (nil | :nil | KwRestParam) keyword_rest, - # (nil | BlockArg) block - # ) -> Params - def on_params( - requireds, - optionals, - rest, - posts, - keywords, - keyword_rest, - block - ) - parts = [ - *requireds, - *optionals&.flatten(1), - rest, - *posts, - *keywords&.flat_map { |(key, value)| [key, value || nil] }, - (keyword_rest if keyword_rest != :nil), - block - ].compact - - location = - if parts.any? - parts[0].location.to(parts[-1].location) - else - Location.fixed(line: lineno, char: char_pos) - end - - Params.new( - requireds: requireds || [], - optionals: optionals || [], - rest: rest, - posts: posts || [], - keywords: keywords || [], - keyword_rest: keyword_rest, - block: block, - location: location - ) - end - - # Paren represents using balanced parentheses in a couple places in a Ruby - # program. In general parentheses can be used anywhere a Ruby expression can - # be used. - # - # (1 + 2) - # - class Paren - # [LParen] the left parenthesis that opened this statement - attr_reader :lparen - - # [untyped] the expression inside the parentheses - attr_reader :contents - - # [Location] the location of this node - attr_reader :location - - def initialize(lparen:, contents:, location:) - @lparen = lparen - @contents = contents - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('paren') - - q.breakable - q.pp(contents) - end - end - - def to_json(*opts) - { type: :paren, lparen: lparen, cnts: contents, loc: location }.to_json( - *opts - ) - end - end - - # :call-seq: - # on_paren: (untyped contents) -> Paren - def on_paren(contents) - lparen = find_token(LParen) - rparen = find_token(RParen) - - if contents && contents.is_a?(Params) - location = contents.location - location = - Location.new( - start_line: location.start_line, - start_char: find_next_statement_start(lparen.location.end_char), - end_line: location.end_line, - end_char: rparen.location.start_char - ) - - contents = - Params.new( - requireds: contents.requireds, - optionals: contents.optionals, - rest: contents.rest, - posts: contents.posts, - keywords: contents.keywords, - keyword_rest: contents.keyword_rest, - block: contents.block, - location: location - ) - end - - Paren.new( - lparen: lparen, - contents: contents, - location: lparen.location.to(rparen.location) - ) - end - - # If we encounter a parse error, just immediately bail out so that our runner - # can catch it. - def on_parse_error(error, *) - raise ParseError.new(error, lineno, column) - end - alias on_alias_error on_parse_error - alias on_assign_error on_parse_error - alias on_class_name_error on_parse_error - alias on_param_error on_parse_error - - # Period represents the use of the +.+ operator. It is usually found in method - # calls. - class Period - # [String] the period - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('period') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :period, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_period: (String value) -> Period - def on_period(value) - Period.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - end - - # Program represents the overall syntax tree. - class Program - # [Statements] the top-level expressions of the program - attr_reader :statements - - # [Array[ Comment | EmbDoc ]] the comments inside the program - attr_reader :comments - - # [Location] the location of this node - attr_reader :location - - def initialize(statements:, comments:, location:) - @statements = statements - @comments = comments - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('program') - - q.breakable - q.pp(statements) - end - end - - def to_json(*opts) - { - type: :program, - stmts: statements, - comments: comments, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_program: (Statements statements) -> Program - def on_program(statements) - location = - Location.new( - start_line: 1, - start_char: 0, - end_line: lines.length, - end_char: source.length - ) - - statements.body << @__end__ if @__end__ - statements.bind(0, source.length) - - Program.new(statements: statements, comments: @comments, location: location) - end - - # QSymbols represents a symbol literal array without interpolation. - # - # %i[one two three] - # - class QSymbols - # [Array[ TStringContent ]] the elements of the array - attr_reader :elements - - # [Location] the location of this node - attr_reader :location - - def initialize(elements:, location:) - @elements = elements - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('qsymbols') - - q.breakable - q.group(2, '(', ')') { q.seplist(elements) { |element| q.pp(element) } } - end - end - - def to_json(*opts) - { type: :qsymbols, elems: elements, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_qsymbols_add: (QSymbols qsymbols, TStringContent element) -> QSymbols - def on_qsymbols_add(qsymbols, element) - QSymbols.new( - elements: qsymbols.elements << element, - location: qsymbols.location.to(element.location) - ) - end - - # QSymbolsBeg represents the beginning of a symbol literal array. - # - # %i[one two three] - # - # In the snippet above, QSymbolsBeg represents the "%i[" token. Note that - # these kinds of arrays can start with a lot of different delimiter types - # (e.g., %i| or %i<). - class QSymbolsBeg - # [String] the beginning of the array literal - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - end - - # :call-seq: - # on_qsymbols_beg: (String value) -> QSymbolsBeg - def on_qsymbols_beg(value) - node = - QSymbolsBeg.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # :call-seq: - # on_qsymbols_new: () -> QSymbols - def on_qsymbols_new - qsymbols_beg = find_token(QSymbolsBeg) - - QSymbols.new(elements: [], location: qsymbols_beg.location) - end - - # QWords represents a string literal array without interpolation. - # - # %w[one two three] - # - class QWords - # [Array[ TStringContent ]] the elements of the array - attr_reader :elements - - # [Location] the location of this node - attr_reader :location - - def initialize(elements:, location:) - @elements = elements - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('qwords') - - q.breakable - q.group(2, '(', ')') { q.seplist(elements) { |element| q.pp(element) } } - end - end - - def to_json(*opts) - { type: :qwords, elems: elements, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_qwords_add: (QWords qwords, TStringContent element) -> QWords - def on_qwords_add(qwords, element) - QWords.new( - elements: qwords.elements << element, - location: qwords.location.to(element.location) - ) - end - - # QWordsBeg represents the beginning of a string literal array. - # - # %w[one two three] - # - # In the snippet above, QWordsBeg represents the "%w[" token. Note that these - # kinds of arrays can start with a lot of different delimiter types (e.g., - # %w| or %w<). - class QWordsBeg - # [String] the beginning of the array literal - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - end - - # :call-seq: - # on_qwords_beg: (String value) -> QWordsBeg - def on_qwords_beg(value) - node = - QWordsBeg.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # :call-seq: - # on_qwords_new: () -> QWords - def on_qwords_new - qwords_beg = find_token(QWordsBeg) - - QWords.new(elements: [], location: qwords_beg.location) - end - - # RationalLiteral represents the use of a rational number literal. - # - # 1r - # - class RationalLiteral - # [String] the rational number literal - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('rational') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :rational, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_rational: (String value) -> RationalLiteral - def on_rational(value) - node = - RationalLiteral.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # RBrace represents the use of a right brace, i.e., +++. - class RBrace - # [String] the right brace - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - end - - # :call-seq: - # on_rbrace: (String value) -> RBrace - def on_rbrace(value) - node = - RBrace.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # RBracket represents the use of a right bracket, i.e., +]+. - class RBracket - # [String] the right bracket - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - end - - # :call-seq: - # on_rbracket: (String value) -> RBracket - def on_rbracket(value) - node = - RBracket.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # Redo represents the use of the +redo+ keyword. - # - # redo - # - class Redo - # [String] the value of the keyword - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('redo') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :redo, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_redo: () -> Redo - def on_redo - keyword = find_token(Kw, 'redo') - - Redo.new(value: keyword.value, location: keyword.location) - end - - # RegexpContent represents the body of a regular expression. - # - # /.+ #{pattern} .+/ - # - # In the example above, a RegexpContent node represents everything contained - # within the forward slashes. - class RegexpContent - # [String] the opening of the regular expression - attr_reader :beginning - - # [Array[ StringDVar | StringEmbExpr | TStringContent ]] the parts of the - # regular expression - attr_reader :parts - - # [Location] the location of this node - attr_reader :location - - def initialize(beginning:, parts:, location:) - @beginning = beginning - @parts = parts - @location = location - end - end - - # :call-seq: - # on_regexp_add: ( - # RegexpContent regexp_content, - # (StringDVar | StringEmbExpr | TStringContent) part - # ) -> RegexpContent - def on_regexp_add(regexp_content, part) - RegexpContent.new( - beginning: regexp_content.beginning, - parts: regexp_content.parts << part, - location: regexp_content.location.to(part.location) - ) - end - - # RegexpBeg represents the start of a regular expression literal. - # - # /.+/ - # - # In the example above, RegexpBeg represents the first / token. Regular - # expression literals can also be declared using the %r syntax, as in: - # - # %r{.+} - # - class RegexpBeg - # [String] the beginning of the regular expression - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - end - - # :call-seq: - # on_regexp_beg: (String value) -> RegexpBeg - def on_regexp_beg(value) - node = - RegexpBeg.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # RegexpEnd represents the end of a regular expression literal. - # - # /.+/m - # - # In the example above, the RegexpEnd event represents the /m at the end of - # the regular expression literal. You can also declare regular expression - # literals using %r, as in: - # - # %r{.+}m - # - class RegexpEnd - # [String] the end of the regular expression - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - end - - # :call-seq: - # on_regexp_end: (String value) -> RegexpEnd - def on_regexp_end(value) - RegexpEnd.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - end - - # RegexpLiteral represents a regular expression literal. - # - # /.+/ - # - class RegexpLiteral - # [String] the beginning of the regular expression literal - attr_reader :beginning - - # [String] the ending of the regular expression literal - attr_reader :ending - - # [Array[ StringEmbExpr | StringDVar | TStringContent ]] the parts of the - # regular expression literal - attr_reader :parts - - # [Locatione] the location of this node - attr_reader :location - - def initialize(beginning:, ending:, parts:, location:) - @beginning = beginning - @ending = ending - @parts = parts - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('regexp_literal') - - q.breakable - q.group(2, '(', ')') { q.seplist(parts) { |part| q.pp(part) } } - end - end - - def to_json(*opts) - { - type: :regexp_literal, - beging: beginning, - ending: ending, - parts: parts, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_regexp_literal: ( - # RegexpContent regexp_content, - # RegexpEnd ending - # ) -> RegexpLiteral - def on_regexp_literal(regexp_content, ending) - RegexpLiteral.new( - beginning: regexp_content.beginning, - ending: ending.value, - parts: regexp_content.parts, - location: regexp_content.location.to(ending.location) - ) - end - - # :call-seq: - # on_regexp_new: () -> RegexpContent - def on_regexp_new - regexp_beg = find_token(RegexpBeg) - - RegexpContent.new( - beginning: regexp_beg.value, - parts: [], - location: regexp_beg.location - ) - end - - # RescueEx represents the list of exceptions being rescued in a rescue clause. - # - # begin - # rescue Exception => exception - # end - # - class RescueEx - # [untyped] the list of exceptions being rescued - attr_reader :exceptions - - # [nil | Field | VarField] the expression being used to capture the raised - # exception - attr_reader :variable - - # [Location] the location of this node - attr_reader :location - - def initialize(exceptions:, variable:, location:) - @exceptions = exceptions - @variable = variable - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('rescue_ex') - - q.breakable - q.pp(exceptions) - - q.breakable - q.pp(variable) - end - end - - def to_json(*opts) - { - type: :rescue_ex, - extns: exceptions, - var: variable, - loc: location - }.to_json(*opts) - end - end - - # Rescue represents the use of the rescue keyword inside of a BodyStmt node. - # - # begin - # rescue - # end - # - class Rescue - # [RescueEx] the exceptions being rescued - attr_reader :exception - - # [Statements] the expressions to evaluate when an error is rescued - attr_reader :statements - - # [nil | Rescue] the optional next clause in the chain - attr_reader :consequent - - # [Location] the location of this node - attr_reader :location - - def initialize(exception:, statements:, consequent:, location:) - @exception = exception - @statements = statements - @consequent = consequent - @location = location - end - - def bind_end(end_char) - @location = - Location.new( - start_line: location.start_line, - start_char: location.start_char, - end_line: location.end_line, - end_char: end_char - ) - - if consequent - consequent.bind_end(end_char) - statements.bind_end(consequent.location.start_char) - else - statements.bind_end(end_char) - end - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('rescue') - - if exception - q.breakable - q.pp(exception) - end - - q.breakable - q.pp(statements) - - if consequent - q.breakable - q.pp(consequent) - end - end - end - - def to_json(*opts) - { - type: :rescue, - extn: exception, - stmts: statements, - cons: consequent, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_rescue: ( - # (nil | [untyped] | MRHS | MRHSAddStar) exceptions, - # (nil | Field | VarField) variable, - # Statements statements, - # (nil | Rescue) consequent - # ) -> Rescue - def on_rescue(exceptions, variable, statements, consequent) - keyword = find_token(Kw, 'rescue') - exceptions = exceptions[0] if exceptions.is_a?(Array) - - last_node = variable || exceptions || keyword - statements.bind( - find_next_statement_start(last_node.location.end_char), - char_pos - ) - - # We add an additional inner node here that ripper doesn't provide so that - # we have a nice place to attach inline comments. But we only need it if we - # have an exception or a variable that we're rescuing. - rescue_ex = - if exceptions || variable - RescueEx.new( - exceptions: exceptions, - variable: variable, - location: - Location.new( - start_line: keyword.location.start_line, - start_char: keyword.location.end_char + 1, - end_line: last_node.location.end_line, - end_char: last_node.location.end_char - ) - ) - end - - Rescue.new( - exception: rescue_ex, - statements: statements, - consequent: consequent, - location: - Location.new( - start_line: keyword.location.start_line, - start_char: keyword.location.start_char, - end_line: lineno, - end_char: char_pos - ) - ) - end - - # RescueMod represents the use of the modifier form of a +rescue+ clause. - # - # expression rescue value - # - class RescueMod - # [untyped] the expression to execute - attr_reader :statement - - # [untyped] the value to use if the executed expression raises an error - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(statement:, value:, location:) - @statement = statement - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('rescue_mod') - - q.breakable - q.pp(statement) - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { - type: :rescue_mod, - stmt: statement, - value: value, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_rescue_mod: (untyped statement, untyped value) -> RescueMod - def on_rescue_mod(statement, value) - find_token(Kw, 'rescue') - - RescueMod.new( - statement: statement, - value: value, - location: statement.location.to(value.location) - ) - end - - # RestParam represents defining a parameter in a method definition that - # accepts all remaining positional parameters. - # - # def method(*rest) end - # - class RestParam - # [nil | Ident] the name of the parameter - attr_reader :name - - # [Location] the location of this node - attr_reader :location - - def initialize(name:, location:) - @name = name - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('rest_param') - - q.breakable - q.pp(name) - end - end - - def to_json(*opts) - { type: :rest_param, name: name, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_rest_param: ((nil | Ident) name) -> RestParam - def on_rest_param(name) - location = find_token(Op, '*').location - location = location.to(name.location) if name - - RestParam.new(name: name, location: location) - end - - # Retry represents the use of the +retry+ keyword. - # - # retry - # - class Retry - # [String] the value of the keyword - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('retry') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :retry, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_retry: () -> Retry - def on_retry - keyword = find_token(Kw, 'retry') - - Retry.new(value: keyword.value, location: keyword.location) - end - - # Return represents using the +return+ keyword with arguments. - # - # return value - # - class Return - # [Args | ArgsAddBlock] the arguments being passed to the keyword - attr_reader :arguments - - # [Location] the location of this node - attr_reader :location - - def initialize(arguments:, location:) - @arguments = arguments - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('return') - - q.breakable - q.pp(arguments) - end - end - - def to_json(*opts) - { type: :return, args: arguments, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_return: ((Args | ArgsAddBlock) arguments) -> Return - def on_return(arguments) - keyword = find_token(Kw, 'return') - - Return.new( - arguments: arguments, - location: keyword.location.to(arguments.location) - ) - end - - # Return0 represents the bare +return+ keyword with no arguments. - # - # return - # - class Return0 - # [String] the value of the keyword - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('return0') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :return0, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_return0: () -> Return0 - def on_return0 - keyword = find_token(Kw, 'return') - - Return0.new(value: keyword.value, location: keyword.location) - end - - # RParen represents the use of a right parenthesis, i.e., +)+. - class RParen - # [String] the parenthesis - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - end - - # :call-seq: - # on_rparen: (String value) -> RParen - def on_rparen(value) - node = - RParen.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # SClass represents a block of statements that should be evaluated within the - # context of the singleton class of an object. It's frequently used to define - # singleton methods. - # - # class << self - # end - # - class SClass - # [untyped] the target of the singleton class to enter - attr_reader :target - - # [BodyStmt] the expressions to be executed - attr_reader :bodystmt - - # [Location] the location of this node - attr_reader :location - - def initialize(target:, bodystmt:, location:) - @target = target - @bodystmt = bodystmt - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('sclass') - - q.breakable - q.pp(target) - - q.breakable - q.pp(bodystmt) - end - end - - def to_json(*opts) - { - type: :sclass, - target: target, - bodystmt: bodystmt, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_sclass: (untyped target, BodyStmt bodystmt) -> SClass - def on_sclass(target, bodystmt) - beginning = find_token(Kw, 'class') - ending = find_token(Kw, 'end') - - bodystmt.bind( - find_next_statement_start(target.location.end_char), - ending.location.start_char - ) - - SClass.new( - target: target, - bodystmt: bodystmt, - location: beginning.location.to(ending.location) - ) - end - - # def on_semicolon(value) - # value - # end - - # def on_sp(value) - # value - # end - - # stmts_add is a parser event that represents a single statement inside a - # list of statements within any lexical block. It accepts as arguments the - # parent stmts node as well as an stmt which can be any expression in - # Ruby. - def on_stmts_add(statements, statement) - statements << statement - end - - # Everything that has a block of code inside of it has a list of statements. - # Normally we would just track those as a node that has an array body, but we - # have some special handling in order to handle empty statement lists. They - # need to have the right location information, so all of the parent node of - # stmts nodes will report back down the location information. We then - # propagate that onto void_stmt nodes inside the stmts in order to make sure - # all comments get printed appropriately. - class Statements - # [SyntaxTree] the parser that created this node - attr_reader :parser - - # [Array[ untyped ]] the list of expressions contained within this node - attr_reader :body - - # [Location] the location of this node - attr_reader :location - - def initialize(parser:, body:, location:) - @parser = parser - @body = body - @location = location - end - - def bind(start_char, end_char) - @location = - Location.new( - start_line: location.start_line, - start_char: start_char, - end_line: location.end_line, - end_char: end_char - ) - - if body[0].is_a?(VoidStmt) - location = body[0].location - location = - Location.new( - start_line: location.start_line, - start_char: start_char, - end_line: location.end_line, - end_char: start_char - ) - - body[0] = VoidStmt.new(location: location) - end - - attach_comments(start_char, end_char) - end - - def bind_end(end_char) - @location = - Location.new( - start_line: location.start_line, - start_char: location.start_char, - end_line: location.end_line, - end_char: end_char - ) - end - - def <<(statement) - @location = - body.any? ? location.to(statement.location) : statement.location - - body << statement - self - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('statements') - - q.breakable - q.seplist(body) { |statement| q.pp(statement) } - end - end - - def to_json(*opts) - { type: :statements, body: body, loc: location }.to_json(*opts) - end - - private - - def attach_comments(start_char, end_char) - attachable = - parser.comments.select do |comment| - !comment.inline? && start_char <= comment.location.start_char && - end_char >= comment.location.end_char && - !comment.value.include?('prettier-ignore') - end - - return if attachable.empty? - - parser.comments -= attachable - @body = (body + attachable).sort_by! { |node| node.location.start_char } - end - end - - # :call-seq: - # on_stmts_new: () -> Statements - def on_stmts_new - Statements.new( - parser: self, - body: [], - location: Location.fixed(line: lineno, char: char_pos) - ) - end - - # StringContent represents the contents of a string-like value. - # - # "string" - # - class StringContent - # [Array[ StringEmbExpr | StringDVar | TStringContent ]] the parts of the - # string - attr_reader :parts - - # [Location] the location of this node - attr_reader :location - - def initialize(parts:, location:) - @parts = parts - @location = location - end - end - - # :call-seq: - # on_string_add: ( - # String string, - # (StringEmbExpr | StringDVar | TStringContent) part - # ) -> StringContent - def on_string_add(string, part) - location = - string.parts.any? ? string.location.to(part.location) : part.location - - StringContent.new(parts: string.parts << part, location: location) - end - - # StringConcat represents concatenating two strings together using a backward - # slash. - # - # "first" \ - # "second" - # - class StringConcat - # [StringConcat | StringLiteral] the left side of the concatenation - attr_reader :left - - # [StringLiteral] the right side of the concatenation - attr_reader :right - - # [Location] the location of this node - attr_reader :location - - def initialize(left:, right:, location:) - @left = left - @right = right - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('string_concat') - - q.breakable - q.pp(left) - - q.breakable - q.pp(right) - end - end - - def to_json(*opts) - { type: :string_concat, left: left, right: right, loc: location }.to_json( - *opts - ) - end - end - - # :call-seq: - # on_string_concat: ( - # (StringConcat | StringLiteral) left, - # StringLiteral right - # ) -> StringConcat - def on_string_concat(left, right) - StringConcat.new( - left: left, - right: right, - location: left.location.to(right.location) - ) - end - - # :call-seq: - # on_string_content: () -> StringContent - def on_string_content - StringContent.new( - parts: [], - location: Location.fixed(line: lineno, char: char_pos) - ) - end - - # StringDVar represents shorthand interpolation of a variable into a string. - # It allows you to take an instance variable, class variable, or global - # variable and omit the braces when interpolating. - # - # "#@variable" - # - class StringDVar - # [Backref | VarRef] the variable being interpolated - attr_reader :variable - - # [Location] the location of this node - attr_reader :location - - def initialize(variable:, location:) - @variable = variable - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('string_dvar') - - q.breakable - q.pp(variable) - end - end - - def to_json(*opts) - { type: :string_dvar, var: variable, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_string_dvar: ((Backref | VarRef) variable) -> StringDVar - def on_string_dvar(variable) - embvar = find_token(EmbVar) - - StringDVar.new( - variable: variable, - location: embvar.location.to(variable.location) - ) - end - - # StringEmbExpr represents interpolated content. It can be contained within a - # couple of different parent nodes, including regular expressions, strings, - # and dynamic symbols. - # - # "string #{expression}" - # - class StringEmbExpr - # [Statements] the expressions to be interpolated - attr_reader :statements - - # [Location] the location of this node - attr_reader :location - - def initialize(statements:, location:) - @statements = statements - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('string_embexpr') - - q.breakable - q.pp(statements) - end - end - - def to_json(*opts) - { type: :string_embexpr, stmts: statements, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_string_embexpr: (Statements statements) -> StringEmbExpr - def on_string_embexpr(statements) - embexpr_beg = find_token(EmbExprBeg) - embexpr_end = find_token(EmbExprEnd) - - statements.bind( - embexpr_beg.location.end_char, - embexpr_end.location.start_char - ) - - StringEmbExpr.new( - statements: statements, - location: embexpr_beg.location.to(embexpr_end.location) - ) - end - - # StringLiteral represents a string literal. - # - # "string" - # - class StringLiteral - # [Array[ StringEmbExpr | StringDVar | TStringContent ]] the parts of the - # string literal - attr_reader :parts - - # [String] which quote was used by the string literal - attr_reader :quote - - # [Location] the location of this node - attr_reader :location - - def initialize(parts:, quote:, location:) - @parts = parts - @quote = quote - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('string_literal') - - q.breakable - q.group(2, '(', ')') { q.seplist(parts) { |part| q.pp(part) } } - end - end - - def to_json(*opts) - { - type: :string_literal, - parts: parts, - quote: quote, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_string_literal: (String string) -> Heredoc | StringLiteral - def on_string_literal(string) - heredoc = @heredocs[-1] - - if heredoc && heredoc.ending - heredoc = @heredocs.pop - - Heredoc.new( - beginning: heredoc.beginning, - ending: heredoc.ending, - parts: string.parts, - location: heredoc.location - ) - else - tstring_beg = find_token(TStringBeg) - tstring_end = find_token(TStringEnd) - - StringLiteral.new( - parts: string.parts, - quote: tstring_beg.value, - location: tstring_beg.location.to(tstring_end.location) - ) - end - end - - # Super represents using the +super+ keyword with arguments. It can optionally - # use parentheses. - # - # super(value) - # - class Super - # [ArgParen | Args | ArgsAddBlock] the arguments to the keyword - attr_reader :arguments - - # [Location] the location of this node - attr_reader :location - - def initialize(arguments:, location:) - @arguments = arguments - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('super') - - q.breakable - q.pp(arguments) - end - end - - def to_json(*opts) - { type: :super, args: arguments, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_super: ((ArgParen | Args | ArgsAddBlock) arguments) -> Super - def on_super(arguments) - keyword = find_token(Kw, 'super') - - Super.new( - arguments: arguments, - location: keyword.location.to(arguments.location) - ) - end - - # SymBeg represents the beginning of a symbol literal. - # - # :symbol - # - # SymBeg is also used for dynamic symbols, as in: - # - # :"symbol" - # - # Finally, SymBeg is also used for symbols using the %s syntax, as in: - # - # %s[symbol] - # - # The value of this node is a string. In most cases (as in the first example - # above) it will contain just ":". In the case of dynamic symbols it will - # contain ":'" or ":\"". In the case of %s symbols, it will contain the start - # of the symbol including the %s and the delimiter. - class SymBeg - # [String] the beginning of the symbol - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - end - - # symbeg is a token that represents the beginning of a symbol literal. - # In most cases it will contain just ":" as in the value, but if its a dynamic - # symbol being defined it will contain ":'" or ":\"". - def on_symbeg(value) - node = - SymBeg.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # SymbolContent represents symbol contents and is always the child of a - # SymbolLiteral node. - # - # :symbol - # - class SymbolContent - # [Backtick | Const | CVar | GVar | Ident | IVar | Kw | Op] the value of the - # symbol - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - end - - # :call-seq: - # on_symbol: ( - # (Backtick | Const | CVar | GVar | Ident | IVar | Kw | Op) value - # ) -> SymbolContent - def on_symbol(value) - tokens.pop - - SymbolContent.new(value: value, location: value.location) - end - - # SymbolLiteral represents a symbol in the system with no interpolation - # (as opposed to a DynaSymbol which has interpolation). - # - # :symbol - # - class SymbolLiteral - # [Backtick | Const | CVar | GVar | Ident | IVar | Kw | Op] the value of the - # symbol - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('symbol_literal') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :symbol_literal, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_symbol_literal: ( - # ( - # Backtick | Const | CVar | GVar | Ident | - # IVar | Kw | Op | SymbolContent - # ) value - # ) -> SymbolLiteral - def on_symbol_literal(value) - if tokens[-1] == value - SymbolLiteral.new(value: tokens.pop, location: value.location) - else - symbeg = find_token(SymBeg) - - SymbolLiteral.new( - value: value.value, - location: symbeg.location.to(value.location) - ) - end - end - - # Symbols represents a symbol array literal with interpolation. - # - # %I[one two three] - # - class Symbols - # [Array[ Word ]] the words in the symbol array literal - attr_reader :elements - - # [Location] the location of this node - attr_reader :location - - def initialize(elements:, location:) - @elements = elements - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('symbols') - - q.breakable - q.group(2, '(', ')') { q.seplist(elements) { |element| q.pp(element) } } - end - end - - def to_json(*opts) - { type: :symbols, elems: elements, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_symbols_add: (Symbols symbols, Word word) -> Symbols - def on_symbols_add(symbols, word) - Symbols.new( - elements: symbols.elements << word, - location: symbols.location.to(word.location) - ) - end - - # SymbolsBeg represents the start of a symbol array literal with - # interpolation. - # - # %I[one two three] - # - # In the snippet above, SymbolsBeg represents the "%I[" token. Note that these - # kinds of arrays can start with a lot of different delimiter types - # (e.g., %I| or %I<). - class SymbolsBeg - # [String] the beginning of the symbol literal array - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - end - - # :call-seq: - # on_symbols_beg: (String value) -> SymbolsBeg - def on_symbols_beg(value) - node = - SymbolsBeg.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # :call-seq: - # on_symbols_new: () -> Symbols - def on_symbols_new - symbols_beg = find_token(SymbolsBeg) - - Symbols.new(elements: [], location: symbols_beg.location) - end - - # TLambda represents the beginning of a lambda literal. - # - # -> { value } - # - # In the example above the TLambda represents the +->+ operator. - class TLambda - # [String] the beginning of the lambda literal - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - end - - # :call-seq: - # on_tlambda: (String value) -> TLambda - def on_tlambda(value) - node = - TLambda.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # TLamBeg represents the beginning of the body of a lambda literal using - # braces. - # - # -> { value } - # - # In the example above the TLamBeg represents the +{+ operator. - class TLamBeg - # [String] the beginning of the body of the lambda literal - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - end - - # :call-seq: - # on_tlambeg: (String value) -> TLamBeg - def on_tlambeg(value) - node = - TLamBeg.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # TopConstField is always the child node of some kind of assignment. It - # represents when you're assigning to a constant that is being referenced at - # the top level. - # - # ::Constant = value - # - class TopConstField - # [Const] the constant being assigned - attr_reader :constant - - # [Location] the location of this node - attr_reader :location - - def initialize(constant:, location:) - @constant = constant - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('top_const_field') - - q.breakable - q.pp(constant) - end - end - - def to_json(*opts) - { type: :top_const_field, constant: constant, loc: location }.to_json( - *opts - ) - end - end - - # :call-seq: - # on_top_const_field: (Const constant) -> TopConstRef - def on_top_const_field(constant) - operator = find_colon2_before(constant) - - TopConstField.new( - constant: constant, - location: operator.location.to(constant.location) - ) - end - - # TopConstRef is very similar to TopConstField except that it is not involved - # in an assignment. - # - # ::Constant - # - class TopConstRef - # [Const] the constant being referenced - attr_reader :constant - - # [Location] the location of this node - attr_reader :location - - def initialize(constant:, location:) - @constant = constant - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('top_const_ref') - - q.breakable - q.pp(constant) - end - end - - def to_json(*opts) - { type: :top_const_ref, constant: constant, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_top_const_ref: (Const constant) -> TopConstRef - def on_top_const_ref(constant) - operator = find_colon2_before(constant) - - TopConstRef.new( - constant: constant, - location: operator.location.to(constant.location) - ) - end - - # TStringBeg represents the beginning of a string literal. - # - # "string" - # - # In the example above, TStringBeg represents the first set of quotes. Strings - # can also use single quotes. They can also be declared using the +%q+ and - # +%Q+ syntax, as in: - # - # %q{string} - # - class TStringBeg - # [String] the beginning of the string - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - end - - # :call-seq: - # on_tstring_beg: (String value) -> TStringBeg - def on_tstring_beg(value) - node = - TStringBeg.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # TStringContent represents plain characters inside of an entity that accepts - # string content like a string, heredoc, command string, or regular - # expression. - # - # "string" - # - # In the example above, TStringContent represents the +string+ token contained - # within the string. - class TStringContent - # [String] the content of the string - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('tstring_content') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { - type: :tstring_content, - value: value.force_encoding('UTF-8'), - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_tstring_content: (String value) -> TStringContent - def on_tstring_content(value) - TStringContent.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - end - - # TStringEnd represents the end of a string literal. - # - # "string" - # - # In the example above, TStringEnd represents the second set of quotes. - # Strings can also use single quotes. They can also be declared using the +%q+ - # and +%Q+ syntax, as in: - # - # %q{string} - # - class TStringEnd - # [String] the end of the string - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - end - - # :call-seq: - # on_tstring_end: (String value) -> TStringEnd - def on_tstring_end(value) - node = - TStringEnd.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # Not represents the unary +not+ method being called on an expression. - # - # not value - # - class Not - # [untyped] the statement on which to operate - attr_reader :statement - - # [boolean] whether or not parentheses were used - attr_reader :parentheses - - # [Location] the location of this node - attr_reader :location - - def initialize(statement:, parentheses:, location:) - @statement = statement - @parentheses = parentheses - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('not') - - q.breakable - q.pp(statement) - end - end - - def to_json(*opts) - { - type: :not, - value: statement, - paren: parentheses, - loc: location - }.to_json(*opts) - end - end - - # Unary represents a unary method being called on an expression, as in +!+ or - # +~+. - # - # !value - # - class Unary - # [String] the operator being used - attr_reader :operator - - # [untyped] the statement on which to operate - attr_reader :statement - - # [Location] the location of this node - attr_reader :location - - def initialize(operator:, statement:, location:) - @operator = operator - @statement = statement - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('unary') - - q.breakable - q.pp(operator) - - q.breakable - q.pp(statement) - end - end - - def to_json(*opts) - { type: :unary, op: operator, value: statement, loc: location }.to_json( - *opts - ) - end - end - - # :call-seq: - # on_unary: (:not operator, untyped statement) -> Not - # | (Symbol operator, untyped statement) -> Unary - def on_unary(operator, statement) - if operator == :not - # We have somewhat special handling of the not operator since if it has - # parentheses they don't get reported as a paren node for some reason. - - beginning = find_token(Kw, 'not') - ending = statement - - range = beginning.location.end_char...statement.location.start_char - paren = source[range].include?('(') - - if paren - find_token(LParen) - ending = find_token(RParen) - end - - Not.new( - statement: statement, - parentheses: paren, - location: beginning.location.to(ending.location) - ) - else - # Special case instead of using find_token here. It turns out that - # if you have a range that goes from a negative number to a negative - # number then you can end up with a .. or a ... that's higher in the - # stack. So we need to explicitly disallow those operators. - index = - tokens.rindex do |token| - token.is_a?(Op) && - token.location.start_char < statement.location.start_char && - !%w[.. ...].include?(token.value) - end - - beginning = tokens.delete_at(index) - - Unary.new( - operator: operator[0], # :+@ -> "+" - statement: statement, - location: beginning.location.to(statement.location) - ) - end - end - - # Undef represents the use of the +undef+ keyword. - # - # undef method - # - class Undef - # [Array[ DynaSymbol | SymbolLiteral ]] the symbols to undefine - attr_reader :symbols - - # [Location] the location of this node - attr_reader :location - - def initialize(symbols:, location:) - @symbols = symbols - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('undef') - - q.breakable - q.group(2, '(', ')') { q.seplist(symbols) { |symbol| q.pp(symbol) } } - end - end - - def to_json(*opts) - { type: :undef, syms: symbols, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_undef: (Array[DynaSymbol | SymbolLiteral] symbols) -> Undef - def on_undef(symbols) - keyword = find_token(Kw, 'undef') - - Undef.new( - symbols: symbols, - location: keyword.location.to(symbols.last.location) - ) - end - - # Unless represents the first clause in an +unless+ chain. - # - # unless predicate - # end - # - class Unless - # [untyped] the expression to be checked - attr_reader :predicate - - # [Statements] the expressions to be executed - attr_reader :statements - - # [nil, Elsif, Else] the next clause in the chain - attr_reader :consequent - - # [Location] the location of this node - attr_reader :location - - def initialize(predicate:, statements:, consequent:, location:) - @predicate = predicate - @statements = statements - @consequent = consequent - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('unless') - - q.breakable - q.pp(predicate) - - q.breakable - q.pp(statements) - - if consequent - q.breakable - q.pp(consequent) - end - end - end - - def to_json(*opts) - { - type: :unless, - pred: predicate, - stmts: statements, - cons: consequent, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_unless: ( - # untyped predicate, - # Statements statements, - # ((nil | Elsif | Else) consequent) - # ) -> Unless - def on_unless(predicate, statements, consequent) - beginning = find_token(Kw, 'unless') - ending = consequent || find_token(Kw, 'end') - - statements.bind(predicate.location.end_char, ending.location.start_char) - - Unless.new( - predicate: predicate, - statements: statements, - consequent: consequent, - location: beginning.location.to(ending.location) - ) - end - - # UnlessMod represents the modifier form of an +unless+ statement. - # - # expression unless predicate - # - class UnlessMod - # [untyped] the expression to be executed - attr_reader :statement - - # [untyped] the expression to be checked - attr_reader :predicate - - # [Location] the location of this node - attr_reader :location - - def initialize(statement:, predicate:, location:) - @statement = statement - @predicate = predicate - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('unless_mod') - - q.breakable - q.pp(statement) - - q.breakable - q.pp(predicate) - end - end - - def to_json(*opts) - { - type: :unless_mod, - stmt: statement, - pred: predicate, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_unless_mod: (untyped predicate, untyped statement) -> UnlessMod - def on_unless_mod(predicate, statement) - find_token(Kw, 'unless') - - UnlessMod.new( - statement: statement, - predicate: predicate, - location: statement.location.to(predicate.location) - ) - end - - # Until represents an +until+ loop. - # - # until predicate - # end - # - class Until - # [untyped] the expression to be checked - attr_reader :predicate - - # [Statements] the expressions to be executed - attr_reader :statements - - # [Location] the location of this node - attr_reader :location - - def initialize(predicate:, statements:, location:) - @predicate = predicate - @statements = statements - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('until') - - q.breakable - q.pp(predicate) - - q.breakable - q.pp(statements) - end - end - - def to_json(*opts) - { - type: :until, - pred: predicate, - stmts: statements, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_until: (untyped predicate, Statements statements) -> Until - def on_until(predicate, statements) - beginning = find_token(Kw, 'until') - ending = find_token(Kw, 'end') - - # Consume the do keyword if it exists so that it doesn't get confused for - # some other block - keyword = find_token(Kw, 'do', consume: false) - if keyword && keyword.location.start_char > predicate.location.end_char && - keyword.location.end_char < ending.location.start_char - tokens.delete(keyword) - end - - # Update the Statements location information - statements.bind(predicate.location.end_char, ending.location.start_char) - - Until.new( - predicate: predicate, - statements: statements, - location: beginning.location.to(ending.location) - ) - end - - # UntilMod represents the modifier form of a +until+ loop. - # - # expression until predicate - # - class UntilMod - # [untyped] the expression to be executed - attr_reader :statement - - # [untyped] the expression to be checked - attr_reader :predicate - - # [Location] the location of this node - attr_reader :location - - def initialize(statement:, predicate:, location:) - @statement = statement - @predicate = predicate - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('until_mod') - - q.breakable - q.pp(statement) - - q.breakable - q.pp(predicate) - end - end - - def to_json(*opts) - { - type: :until_mod, - stmt: statement, - pred: predicate, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_until_mod: (untyped predicate, untyped statement) -> UntilMod - def on_until_mod(predicate, statement) - find_token(Kw, 'until') - - UntilMod.new( - statement: statement, - predicate: predicate, - location: statement.location.to(predicate.location) - ) - end - - # VarAlias represents when you're using the +alias+ keyword with global - # variable arguments. - # - # alias $new $old - # - class VarAlias - # [GVar] the new alias of the variable - attr_reader :left - - # [Backref | GVar] the current name of the variable to be aliased - attr_reader :right - - # [Location] the location of this node - attr_reader :location - - def initialize(left:, right:, location:) - @left = left - @right = right - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('var_alias') - - q.breakable - q.pp(left) - - q.breakable - q.pp(right) - end - end - - def to_json(*opts) - { type: :var_alias, left: left, right: right, loc: location }.to_json( - *opts - ) - end - end - - # :call-seq: - # on_var_alias: (GVar left, (Backref | GVar) right) -> VarAlias - def on_var_alias(left, right) - keyword = find_token(Kw, 'alias') - - VarAlias.new( - left: left, - right: right, - location: keyword.location.to(right.location) - ) - end - - # VarField represents a variable that is being assigned a value. As such, it - # is always a child of an assignment type node. - # - # variable = value - # - # In the example above, the VarField node represents the +variable+ token. - class VarField - # [nil | Const | CVar | GVar | Ident | IVar] the target of this node - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('var_field') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :var_field, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_var_field: ( - # (nil | Const | CVar | GVar | Ident | IVar) value - # ) -> VarField - def on_var_field(value) - location = - if value - value.location - else - # You can hit this pattern if you're assigning to a splat using pattern - # matching syntax in Ruby 2.7+ - Location.fixed(line: lineno, char: char_pos) - end - - VarField.new(value: value, location: location) - end - - # VarRef represents a variable reference. - # - # true - # - # This can be a plain local variable like the example above. It can also be a - # constant, a class variable, a global variable, an instance variable, a - # keyword (like +self+, +nil+, +true+, or +false+), or a numbered block - # variable. - class VarRef - # [Const | CVar | GVar | Ident | IVar | Kw] the value of this node - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('var_ref') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :var_ref, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_var_ref: ((Const | CVar | GVar | Ident | IVar | Kw) value) -> VarRef - def on_var_ref(value) - VarRef.new(value: value, location: value.location) - end - - # AccessCtrl represents a call to a method visibility control, i.e., +public+, - # +protected+, or +private+. - # - # private - # - class AccessCtrl - # [Ident] the value of this expression - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('access_ctrl') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :access_ctrl, value: value, loc: location }.to_json(*opts) - end - end - - # VCall represent any plain named object with Ruby that could be either a - # local variable or a method call. - # - # variable - # - class VCall - # [Ident] the value of this expression - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('vcall') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :vcall, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_vcall: (Ident ident) -> AccessCtrl | VCall - def on_vcall(ident) - @controls ||= %w[private protected public].freeze - - if @controls.include?(ident.value) && ident.value == lines[lineno - 1].strip - # Access controls like private, protected, and public are reported as - # vcall nodes since they're technically method calls. We want to be able - # add new lines around them as necessary, so here we're going to - # explicitly track those as a different node type. - AccessCtrl.new(value: ident, location: ident.location) - else - VCall.new(value: ident, location: ident.location) - end - end - - # VoidStmt represents an empty lexical block of code. - # - # ;; - # - class VoidStmt - # [Location] the location of this node - attr_reader :location - - def initialize(location:) - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') { q.text('void_stmt') } - end - - def to_json(*opts) - { type: :void_stmt, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_void_stmt: () -> VoidStmt - def on_void_stmt - VoidStmt.new(location: Location.fixed(line: lineno, char: char_pos)) - end - - # When represents a +when+ clause in a +case+ chain. - # - # case value - # when predicate - # end - # - class When - # [untyped] the arguments to the when clause - attr_reader :arguments - - # [Statements] the expressions to be executed - attr_reader :statements - - # [nil | Else | When] the next clause in the chain - attr_reader :consequent - - # [Location] the location of this node - attr_reader :location - - def initialize(arguments:, statements:, consequent:, location:) - @arguments = arguments - @statements = statements - @consequent = consequent - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('when') - - q.breakable - q.pp(arguments) - - q.breakable - q.pp(statements) - - if consequent - q.breakable - q.pp(consequent) - end - end - end - - def to_json(*opts) - { - type: :when, - args: arguments, - stmts: statements, - cons: consequent, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_when: ( - # untyped arguments, - # Statements statements, - # (nil | Else | When) consequent - # ) -> When - def on_when(arguments, statements, consequent) - beginning = find_token(Kw, 'when') - ending = consequent || find_token(Kw, 'end') - - statements.bind(arguments.location.end_char, ending.location.start_char) - - When.new( - arguments: arguments, - statements: statements, - consequent: consequent, - location: beginning.location.to(ending.location) - ) - end - - # While represents a +while+ loop. - # - # while predicate - # end - # - class While - # [untyped] the expression to be checked - attr_reader :predicate - - # [Statements] the expressions to be executed - attr_reader :statements - - # [Location] the location of this node - attr_reader :location - - def initialize(predicate:, statements:, location:) - @predicate = predicate - @statements = statements - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('while') - - q.breakable - q.pp(predicate) - - q.breakable - q.pp(statements) - end - end - - def to_json(*opts) - { - type: :while, - pred: predicate, - stmts: statements, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_while: (untyped predicate, Statements statements) -> While - def on_while(predicate, statements) - beginning = find_token(Kw, 'while') - ending = find_token(Kw, 'end') - - # Consume the do keyword if it exists so that it doesn't get confused for - # some other block - keyword = find_token(Kw, 'do', consume: false) - if keyword && keyword.location.start_char > predicate.location.end_char && - keyword.location.end_char < ending.location.start_char - tokens.delete(keyword) - end - - # Update the Statements location information - statements.bind(predicate.location.end_char, ending.location.start_char) - - While.new( - predicate: predicate, - statements: statements, - location: beginning.location.to(ending.location) - ) - end - - # WhileMod represents the modifier form of a +while+ loop. - # - # expression while predicate - # - class WhileMod - # [untyped] the expression to be executed - attr_reader :statement - - # [untyped] the expression to be checked - attr_reader :predicate - - # [Location] the location of this node - attr_reader :location - - def initialize(statement:, predicate:, location:) - @statement = statement - @predicate = predicate - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('while_mod') - - q.breakable - q.pp(statement) - - q.breakable - q.pp(predicate) - end - end - - def to_json(*opts) - { - type: :while_mod, - stmt: statement, - pred: predicate, - loc: location - }.to_json(*opts) - end - end - - # :call-seq: - # on_while_mod: (untyped predicate, untyped statement) -> WhileMod - def on_while_mod(predicate, statement) - find_token(Kw, 'while') - - WhileMod.new( - statement: statement, - predicate: predicate, - location: statement.location.to(predicate.location) - ) - end - - # Word represents an element within a special array literal that accepts - # interpolation. - # - # %W[a#{b}c xyz] - # - # In the example above, there would be two Word nodes within a parent Words - # node. - class Word - # [Array[ StringEmbExpr | StringDVar | TStringContent ]] the parts of the - # word - attr_reader :parts - - # [Location] the location of this node - attr_reader :location - - def initialize(parts:, location:) - @parts = parts - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('word') - - q.breakable - q.group(2, '(', ')') { q.seplist(parts) { |part| q.pp(part) } } - end - end - - def to_json(*opts) - { type: :word, parts: parts, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_word_add: ( - # Word word, - # (StringEmbExpr | StringDVar | TStringContent) part - # ) -> Word - def on_word_add(word, part) - location = - word.parts.empty? ? part.location : word.location.to(part.location) - - Word.new(parts: word.parts << part, location: location) - end - - # :call-seq: - # on_word_new: () -> Word - def on_word_new - Word.new(parts: [], location: Location.fixed(line: lineno, char: char_pos)) - end - - # Words represents a string literal array with interpolation. - # - # %W[one two three] - # - class Words - # [Array[ Word ]] the elements of this array - attr_reader :elements - - # [Location] the location of this node - attr_reader :location - - def initialize(elements:, location:) - @elements = elements - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('words') - - q.breakable - q.group(2, '(', ')') { q.seplist(elements) { |element| q.pp(element) } } - end - end - - def to_json(*opts) - { type: :words, elems: elements, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_words_add: (Words words, Word word) -> Words - def on_words_add(words, word) - Words.new( - elements: words.elements << word, - location: words.location.to(word.location) - ) - end - - # WordsBeg represents the beginning of a string literal array with - # interpolation. - # - # %W[one two three] - # - # In the snippet above, a WordsBeg would be created with the value of "%W[". - # Note that these kinds of arrays can start with a lot of different delimiter - # types (e.g., %W| or %W<). - class WordsBeg - # [String] the start of the word literal array - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - end - - # :call-seq: - # on_words_beg: (String value) -> WordsBeg - def on_words_beg(value) - node = - WordsBeg.new( - value: value, - location: Location.token(line: lineno, char: char_pos, size: value.size) - ) - - tokens << node - node - end - - # :call-seq: - # on_words_new: () -> Words - def on_words_new - words_beg = find_token(WordsBeg) - - Words.new(elements: [], location: words_beg.location) - end - - # def on_words_sep(value) - # value - # end - - # XString represents the contents of an XStringLiteral. - # - # `ls` - # - class XString - # [Array[ StringEmbExpr | StringDVar | TStringContent ]] the parts of the - # xstring - attr_reader :parts - - # [Location] the location of this node - attr_reader :location - - def initialize(parts:, location:) - @parts = parts - @location = location - end - end - - # :call-seq: - # on_xstring_add: ( - # XString xstring, - # (StringEmbExpr | StringDVar | TStringContent) part - # ) -> XString - def on_xstring_add(xstring, part) - XString.new( - parts: xstring.parts << part, - location: xstring.location.to(part.location) - ) - end - - # :call-seq: - # on_xstring_new: () -> XString - def on_xstring_new - heredoc = @heredocs[-1] - - location = - if heredoc && heredoc.beginning.value.include?('`') - heredoc.location - else - find_token(Backtick).location - end - - XString.new(parts: [], location: location) - end - - # XStringLiteral represents a string that gets executed. - # - # `ls` - # - class XStringLiteral - # [Array[ StringEmbExpr | StringDVar | TStringContent ]] the parts of the - # xstring - attr_reader :parts - - # [Location] the location of this node - attr_reader :location - - def initialize(parts:, location:) - @parts = parts - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('xstring_literal') - - q.breakable - q.group(2, '(', ')') { q.seplist(parts) { |part| q.pp(part) } } - end - end - - def to_json(*opts) - { type: :xstring_literal, parts: parts, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_xstring_literal: (XString xstring) -> Heredoc | XStringLiteral - def on_xstring_literal(xstring) - heredoc = @heredocs[-1] - - if heredoc && heredoc.beginning.value.include?('`') - Heredoc.new( - beginning: heredoc.beginning, - ending: heredoc.ending, - parts: xstring.parts, - location: heredoc.location - ) - else - ending = find_token(TStringEnd) - - XStringLiteral.new( - parts: xstring.parts, - location: xstring.location.to(ending.location) - ) - end - end - - # Yield represents using the +yield+ keyword with arguments. - # - # yield value - # - class Yield - # [ArgsAddBlock | Paren] the arguments passed to the yield - attr_reader :arguments - - # [Location] the location of this node - attr_reader :location - - def initialize(arguments:, location:) - @arguments = arguments - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('yield') - - q.breakable - q.pp(arguments) - end - end - - def to_json(*opts) - { type: :yield, args: arguments, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_yield: ((ArgsAddBlock | Paren) arguments) -> Yield - def on_yield(arguments) - keyword = find_token(Kw, 'yield') - - Yield.new( - arguments: arguments, - location: keyword.location.to(arguments.location) - ) - end - - # Yield0 represents the bare +yield+ keyword with no arguments. - # - # yield - # - class Yield0 - # [String] the value of the keyword - attr_reader :value - - # [Location] the location of this node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('yield0') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :yield0, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_yield0: () -> Yield0 - def on_yield0 - keyword = find_token(Kw, 'yield') - - Yield0.new(value: keyword.value, location: keyword.location) - end - - # ZSuper represents the bare +super+ keyword with no arguments. - # - # super - # - class ZSuper - # [String] the value of the keyword - attr_reader :value - - # [Location] the location of the node - attr_reader :location - - def initialize(value:, location:) - @value = value - @location = location - end - - def pretty_print(q) - q.group(2, '(', ')') do - q.text('zsuper') - - q.breakable - q.pp(value) - end - end - - def to_json(*opts) - { type: :zsuper, value: value, loc: location }.to_json(*opts) - end - end - - # :call-seq: - # on_zsuper: () -> ZSuper - def on_zsuper - keyword = find_token(Kw, 'super') - - ZSuper.new(value: keyword.value, location: keyword.location) - end -end diff --git a/src/ruby/parser.ts b/src/ruby/parser.ts deleted file mode 100644 index 2570d540..00000000 --- a/src/ruby/parser.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { Plugin, Ruby } from "../types"; -import parseSync from "../parser/parseSync"; -import { getEndChar, getStartChar } from "./location"; - -const parser: Plugin.Parser = { - // This function is responsible for taking an input string of text and - // returning to prettier a JavaScript object that is the equivalent AST that - // represents the code stored in that string. We accomplish this by spawning a - // new Ruby process of parser.rb and reading JSON off STDOUT. - parse(text) { - return parseSync("ruby", text); - }, - astFormat: "ruby", - // This function handles checking whether or not the source string has the - // pragma for prettier. This is an optional workflow for incremental adoption. - hasPragma(text) { - return /^\s*#[^\S\n]*@(?:prettier|format)\s*?(?:\n|$)/m.test(text); - }, - // This function is critical for comments and cursor support, and is - // responsible for returning the index of the character within the source - // string that is the beginning of the given node. - locStart(node) { - return getStartChar(node.loc); - }, - // This function is critical for comments and cursor support, and is - // responsible for returning the index of the character within the source - // string that is the ending of the given node. - locEnd(node) { - return getEndChar(node.loc); - } -}; - -export default parser; diff --git a/src/ruby/printer.ts b/src/ruby/printer.ts deleted file mode 100644 index f2adeead..00000000 --- a/src/ruby/printer.ts +++ /dev/null @@ -1,78 +0,0 @@ -import type { Plugin, Ruby } from "../types"; -import prettier from "../prettier"; - -import { getChildNodes } from "../utils"; -import embed from "./embed"; -import nodes from "./nodes"; - -const { trim } = prettier; - -const noComments = ["args", "args_add_block", "mlhs", "mlhs_paren"]; - -const printer: Plugin.PrinterConfig = { - // Certain nodes are used more for organizational purposed than for actually - // displaying content, so we tell prettier that we don't want comments - // attached to them. - canAttachComment(node) { - return !noComments.includes(node.type); - }, - embed, - // This function tells prettier how to recurse down our AST so that it can - // find where it needs to attach the comments. - getCommentChildNodes(node: Ruby.AnyNode) { - return getChildNodes(node); - }, - // This is an escape-hatch to ignore nodes in the tree. If you have a comment - // that includes this pattern, then the entire node will be ignored and just - // the original source will be printed out. - hasPrettierIgnore(path) { - const node = path.getValue(); - - return ( - (node.comments && - node.comments.some((comment) => - comment.value.includes("prettier-ignore") - )) || - false - ); - }, - // To be honest I'm not 100% sure this function is actually necessary, but it - // *feels* like a block comment equivalent in JavaScript so I'm going to leave - // it in place for now. - isBlockComment(comment) { - return comment.type === "embdoc"; - }, - // This function handles adding the format pragma to a source string. This is - // an optional workflow for incremental adoption. - insertPragma(text) { - const boundary = text.startsWith("#") ? "\n" : "\n\n"; - - return `# @format${boundary}${text}`; - }, - // This is the generic node print function, used to convert any node in the - // AST into its equivalent Doc representation. - print(path, opts, print) { - const node = path.getValue(); - const printer = nodes[node.type]; - - if (!printer) { - throw new Error(`Unsupported node type: ${node.type}`); - } - - return printer(path, opts, print); - }, - // This is the generic print function for any comment in the AST. It handles - // both regular comments that begin with a # and embdoc comments, which are - // surrounded by =begin..=end. - printComment(path) { - const comment = (path as any as Plugin.Path).getValue(); - - if (comment.type === "comment") { - return `#${comment.value}`; - } - - return [trim, comment.value]; - } -}; - -export default printer; diff --git a/src/ruby/toProc.ts b/src/ruby/toProc.ts deleted file mode 100644 index 5ad82131..00000000 --- a/src/ruby/toProc.ts +++ /dev/null @@ -1,114 +0,0 @@ -import type { Plugin, Ruby } from "../types"; - -function isPeriod(node: Ruby.CallOperator) { - // Older versions of Ruby didn't have a @period ripper event, so we need to - // explicitly cast to any here. - if (node === "::" || (node as any) === ".") { - return true; - } - - return node.type === "period"; -} - -// If you have a simple block that only calls a method on the single required -// parameter that is passed to it, then you can replace that block with the -// simpler `Symbol#to_proc`. Meaning, it would go from: -// -// [1, 2, 3].map { |i| i.to_s } -// -// to: -// -// [1, 2, 3].map(&:to_s) -// -// This works with `do` blocks as well. -function toProc( - path: Plugin.Path, - node: Ruby.BraceBlock | Ruby.DoBlock -) { - // Ensure that there are variables being passed to this block. - const params = node.block_var && node.block_var.params; - if (!params) { - return null; - } - - // Ensure there is one and only one parameter, and that it is required. - if ( - params.reqs.length !== 1 || - params.opts.length !== 0 || - params.rest || - params.posts.length !== 0 || - params.keywords.length !== 0 || - params.kwrest || - params.block - ) { - return null; - } - - // Get the list of statements from the block - let statements: Ruby.AnyNode[]; - - if (node.type === "do_block") { - // If you have any other clauses on the bodystmt, then we can't transform. - if (node.bodystmt.rsc || node.bodystmt.els || node.bodystmt.ens) { - return null; - } - - statements = node.bodystmt.stmts.body; - } else { - statements = node.stmts.body; - } - - // Ensure the block contains only one statement - if (statements.length !== 1) { - return null; - } - - // Ensure that statement is a call and that it has no comments attached - const [call] = statements; - if (call.type !== "call" || call.comments) { - return null; - } - - // Ensure the call is a method of the block argument - if ( - call.receiver.type !== "var_ref" || - call.receiver.value.value !== params.reqs[0].value || - !isPeriod(call.op) || - call.message === "call" || - call.message.type !== "ident" - ) { - return null; - } - - // Ensure that we're not inside of a hash that is being passed to a key that - // corresponds to `:if` or `:unless` to avoid problems with callbacks with - // Rails. For more context, see: - // https://github.com/prettier/plugin-ruby/issues/449 - let parentNode = null; - - if (path.getValue().type === "method_add_block") { - parentNode = path.getParentNode(); - } else { - parentNode = path.getParentNode(2); - } - - if (parentNode && parentNode.type === "assoc") { - const assocNode = parentNode as Ruby.Assoc; - const key = assocNode.key; - - if (key.type === "label" && ["if:", "unless:"].includes(key.value)) { - return null; - } - - if ( - key.type === "symbol_literal" && - ["if", "unless"].includes(key.value.value) - ) { - return null; - } - } - - return `&:${call.message.value}`; -} - -export default toProc; diff --git a/src/types.ts b/src/types.ts index ccfab44f..3e79eb3f 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,3 +1,121 @@ -export * as Plugin from "./types/plugin"; -export * as Ruby from "./types/ruby"; -export * from "./types/utils"; +import type * as Prettier from "prettier"; + +// The type of elements that make up the given array T. +export type ArrayElement = T extends (infer E)[] ? E : never; + +// A union of the properties of the given object that are arrays. +export type ArrayProperties = { [K in keyof T]: T[K] extends any[] ? K : never }[keyof T]; + +// A union of the properties of the given array T that can be used to index it. +// If the array is a tuple, then that's going to be the explicit indices of the +// array, otherwise it's going to just be number. +export type IndexProperties = IsTuple extends true ? Exclude["length"], T["length"]> : number; + +// Effectively performing T[P], except that it's telling TypeScript that it's +// safe to do this for tuples, arrays, or objects. +export type IndexValue = T extends any[] ? P extends number ? T[P] : never : P extends keyof T ? T[P] : never; + +// Determines if an object T is an array like string[] (in which case this +// evaluates to false) or a tuple like [string] (in which case this evaluates to +// true). +// eslint-disable-next-line @typescript-eslint/no-unused-vars +type IsTuple = T extends [] ? true : T extends [infer First, ...infer Remain] ? IsTuple : false; + +// The same object T as currently exists, except the keys provided by P are +// required instead of optional. +export type RequiredKeys = T & Required>; + +type CallProperties = T extends any[] ? IndexProperties : keyof T; +type IterProperties = T extends any[] ? IndexProperties : ArrayProperties; + +type CallCallback = (path: Path, index: number, value: any) => U; +type EachCallback = (path: Path>, index: number, value: any) => void; +type MapCallback = (path: Path>, index: number, value: any) => U; + +// This path interface is going to override a bunch of functions on the regular +// prettier AstPath interface. This is because we want stricter types than the +// current version of @types/prettier provides. +// +// For each of the tree walk functions (call, each, and map) this provides 5 +// strict type signatures, along with a fallback at the end if you end up +// calling more than 5 properties deep (we don't do that but I've included it +// for completeness). +// +// getParentNode is being overridden because previously it was restricted to the +// type T of the given AST, but it's very unlikely you're going to be receiving +// a parent node that exactly matches your current node. So for now just +// returning any. +interface StrictPath { + call(callback: CallCallback): U; + call>(callback: CallCallback, U>, prop1: P1): U; + call>(callback: CallCallback, P2>, U>, prop1: P1, prop2: P2): U; + call, P3 extends CallProperties>>(callback: CallCallback, P2>, P3>, U>, prop1: P1, prop2: P2, prop3: P3): U; + call, P3 extends CallProperties>, P4 extends CallProperties, P3>>>(callback: CallCallback, P2>, P3>, P4>, U>, prop1: P1, prop2: P2, prop3: P3, prop4: P4): U; + call(callback: CallCallback, prop1: P, prop2: P, prop3: P, prop4: P, ...props: P[]): U; + + each(callback: EachCallback): void; + each>(callback: EachCallback>, prop1: P1): void; + each>(callback: EachCallback, P2>>, prop1: P1, prop2: P2): void; + each, P3 extends IterProperties>>(callback: EachCallback, P2>, P3>>, prop1: P1, prop2: P2, prop3: P3): void; + each, P3 extends IterProperties>, P4 extends IterProperties, P3>>>(callback: EachCallback, P2>, P3>, P4>>, prop1: P1, prop2: P2, prop3: P3, prop4: P4): void; + each

(callback: EachCallback, prop1: P, prop2: P, prop3: P, prop4: P, ...props: P[]): void; + + getParentNode: (count?: number | undefined) => any | null, + + map(callback: MapCallback): U[]; + map>(callback: MapCallback, U>, prop1: P1): U[]; + map>(callback: MapCallback, P2>, U>, prop1: P1, prop2: P2): U[]; + map, P3 extends IterProperties>>(callback: MapCallback, P2>, P3>, U>, prop1: P1, prop2: P2, prop3: P3): U[]; + map, P3 extends IterProperties>, P4 extends IterProperties, P3>>>(callback: MapCallback, P2>, P3>, P4>, U>, prop1: P1, prop2: P2, prop3: P3, prop4: P4): U[]; + map(callback: MapCallback, prop1: P, prop2: P, prop3: P, prop4: P, ...props: P[]): U[]; +}; + +// Reexporting the Doc type mostly because it's annoying to have to reference +// type so deeply in the Prettier namespace. Also because we only really want to +// be pulling in types from this file as they're less likely to change. +export type Doc = Prettier.doc.builders.Doc; + +// This is the same embed as is present in prettier, except that it's required. +export type Embed = Required>["embed"]; + +// These are the regular options from prettier except they also include all of +// the options we defined in our plugin configuration. +export type Options = Prettier.ParserOptions & { + printer: RequiredKeys, + rubyArrayLiteral: boolean, + rubyHashLabel: boolean, + rubyModifier: boolean, + rubySingleQuote: boolean, + rubyToProc: boolean +}; + +// hasPragma was not required, but since we're testing it explicitly we're going +// to add that into the parser object as being required. Additionally we're +// going to change the signature of our parse function to accept our options as +// opposed to the generic options that don't contain the options we defined in +// our plugin configuration. +export type Parser = Omit, "hasPragma" | "parse"> & Required, "hasPragma">> & { + parse: (text: string, parsers: { [name: string]: Prettier.Parser }, options: Options) => any +}; + +// We're overwriting a bunch of function here that walk around the tree here +// because if you restrict the AST for the main path then presumably you're +// printing a lower node in the tree that won't match the current AST type. +export type Path = Omit, keyof StrictPath> & StrictPath; + +// The printer from prettier is missing a couple of keys. We should presumably +// upstream this so that it's accurate in all plugins. +export type PrinterConfig = Omit, "insertPragma" | "print"> & Required, "insertPragma">> & { + getCommentChildNodes?: (node: any) => any[], + isBlockComment?: (comment: any, options: Options) => boolean, + print: Printer +}; + +// This is the regular print node, except it's not restricted by the AST that +// is passed to the parent AST. That's because when you're using it, you are not +// typically printing the same node type again. +export type Print = (path: Path) => Doc; + +// This is the regular printer, except it uses our overridden options and print +// types. +export type Printer = (path: Path, options: Options, print: Print) => Doc; diff --git a/src/types/plugin.ts b/src/types/plugin.ts deleted file mode 100644 index 2de62dc6..00000000 --- a/src/types/plugin.ts +++ /dev/null @@ -1,97 +0,0 @@ -import type * as Prettier from "prettier"; -import type { ArrayElement, ArrayProperties, IndexProperties, IndexValue, RequiredKeys } from "./utils"; - -type CallProperties = T extends any[] ? IndexProperties : keyof T; -type IterProperties = T extends any[] ? IndexProperties : ArrayProperties; - -type CallCallback = (path: Path, index: number, value: any) => U; -type EachCallback = (path: Path>, index: number, value: any) => void; -type MapCallback = (path: Path>, index: number, value: any) => U; - -// This path interface is going to override a bunch of functions on the regular -// prettier AstPath interface. This is because we want stricter types than the -// current version of @types/prettier provides. -// -// For each of the tree walk functions (call, each, and map) this provides 5 -// strict type signatures, along with a fallback at the end if you end up -// calling more than 5 properties deep (we don't do that but I've included it -// for completeness). -// -// getParentNode is being overridden because previously it was restricted to the -// type T of the given AST, but it's very unlikely you're going to be receiving -// a parent node that exactly matches your current node. So for now just -// returning any. -interface StrictPath { - call(callback: CallCallback): U; - call>(callback: CallCallback, U>, prop1: P1): U; - call>(callback: CallCallback, P2>, U>, prop1: P1, prop2: P2): U; - call, P3 extends CallProperties>>(callback: CallCallback, P2>, P3>, U>, prop1: P1, prop2: P2, prop3: P3): U; - call, P3 extends CallProperties>, P4 extends CallProperties, P3>>>(callback: CallCallback, P2>, P3>, P4>, U>, prop1: P1, prop2: P2, prop3: P3, prop4: P4): U; - call(callback: CallCallback, prop1: P, prop2: P, prop3: P, prop4: P, ...props: P[]): U; - - each(callback: EachCallback): void; - each>(callback: EachCallback>, prop1: P1): void; - each>(callback: EachCallback, P2>>, prop1: P1, prop2: P2): void; - each, P3 extends IterProperties>>(callback: EachCallback, P2>, P3>>, prop1: P1, prop2: P2, prop3: P3): void; - each, P3 extends IterProperties>, P4 extends IterProperties, P3>>>(callback: EachCallback, P2>, P3>, P4>>, prop1: P1, prop2: P2, prop3: P3, prop4: P4): void; - each

(callback: EachCallback, prop1: P, prop2: P, prop3: P, prop4: P, ...props: P[]): void; - - getParentNode: (count?: number | undefined) => any | null, - - map(callback: MapCallback): U[]; - map>(callback: MapCallback, U>, prop1: P1): U[]; - map>(callback: MapCallback, P2>, U>, prop1: P1, prop2: P2): U[]; - map, P3 extends IterProperties>>(callback: MapCallback, P2>, P3>, U>, prop1: P1, prop2: P2, prop3: P3): U[]; - map, P3 extends IterProperties>, P4 extends IterProperties, P3>>>(callback: MapCallback, P2>, P3>, P4>, U>, prop1: P1, prop2: P2, prop3: P3, prop4: P4): U[]; - map(callback: MapCallback, prop1: P, prop2: P, prop3: P, prop4: P, ...props: P[]): U[]; -}; - -// Reexporting the Doc type mostly because it's annoying to have to reference -// type so deeply in the Prettier namespace. Also because we only really want to -// be pulling in types from this file as they're less likely to change. -export type Doc = Prettier.doc.builders.Doc; - -// This is the same embed as is present in prettier, except that it's required. -export type Embed = Required>["embed"]; - -// These are the regular options from prettier except they also include all of -// the options we defined in our plugin configuration. -export type Options = Prettier.ParserOptions & { - printer: RequiredKeys, - rubyArrayLiteral: boolean, - rubyHashLabel: boolean, - rubyModifier: boolean, - rubySingleQuote: boolean, - rubyToProc: boolean -}; - -// hasPragma was not required, but since we're testing it explicitly we're going -// to add that into the parser object as being required. Additionally we're -// going to change the signature of our parse function to accept our options as -// opposed to the generic options that don't contain the options we defined in -// our plugin configuration. -export type Parser = Omit, "hasPragma" | "parse"> & Required, "hasPragma">> & { - parse: (text: string, parsers: { [name: string]: Prettier.Parser }, options: Options) => any -}; - -// We're overwriting a bunch of function here that walk around the tree here -// because if you restrict the AST for the main path then presumably you're -// printing a lower node in the tree that won't match the current AST type. -export type Path = Omit, keyof StrictPath> & StrictPath; - -// The printer from prettier is missing a couple of keys. We should presumably -// upstream this so that it's accurate in all plugins. -export type PrinterConfig = Omit, "insertPragma" | "print"> & Required, "insertPragma">> & { - getCommentChildNodes?: (node: any) => any[], - isBlockComment?: (comment: any, options: Options) => boolean, - print: Printer -}; - -// This is the regular print node, except it's not restricted by the AST that -// is passed to the parent AST. That's because when you're using it, you are not -// typically printing the same node type again. -export type Print = (path: Path) => Doc; - -// This is the regular printer, except it uses our overridden options and print -// types. -export type Printer = (path: Path, options: Options, print: Print) => Doc; diff --git a/src/types/ruby.ts b/src/types/ruby.ts deleted file mode 100644 index 56c3a4c5..00000000 --- a/src/types/ruby.ts +++ /dev/null @@ -1,228 +0,0 @@ -// This file contains all of the types that represent objects being returned -// from our ripper-based parser. - -// These are common additions to the various node types. -type Comments = { comments?: Comment[] }; -export type Location = [number, number, number, number]; - -// These are utility types used to construct the various node types. -type ScannerEvent = { type: T, value: string, loc: Location } & Comments; -type ParserEvent0 = { type: T, value: string, loc: Location } & Comments; -type ParserEvent> = { type: T, loc: Location } & Comments & V; - -// This is the main expression type that goes in places where the AST will -// accept just about anything. -// eslint-disable-next-line @typescript-eslint/ban-types -export type AnyNode = AccessCtrl | Alias | Aref | ArefField | ArgParen | Args | ArgsAddBlock | ArgsForward | ArgStar | Array | Aryptn | Assign | Assoc | AssocSplat | AssoclistFromArgs | BEGIN | Backref | Backtick | BareAssocHash | Begin | Binary | BlockVar | Blockarg | Bodystmt | BraceBlock | Break | CVar | Call | Case | Char | Class | Command | CommandCall | Const | ConstPathField | ConstPathRef | ConstRef | Def | Defined | Defs | DefEndless | DoBlock | Dot2 | Dot3 | DynaSymbol | END | Else | Elsif | EndContent | Ensure | ExcessedComma | Fcall | Field | Float | FndPtn | For | GVar | Hash | Heredoc | HeredocBegin | Hshptn | IVar | Identifier | If | IfModifier | Imaginary | In | Int | Keyword | KeywordRestParam | Label | Lambda | Lbrace | Lparen | Massign | MethodAddArg | MethodAddBlock | Mlhs | MlhsParen | Module | Mrhs | MrhsAddStar | MrhsNewFromArgs | Next | Not | Op | Opassign | Params | Paren | Period | Program | Qwords | Qsymbols | Rassign | Rational | Redo | RegexpLiteral | Rescue | RescueEx | RescueModifier | RestParam | Retry | Return | Return0 | Sclass | Statements | StringConcat | StringDVar | StringEmbExpr | StringLiteral | Super | Symbols | SymbolLiteral | TStringContent | Ternary | TopConstField | TopConstRef | Unary | Undef | Unless | UnlessModifier | Until | UntilModifier | VCall | VarAlias | VarField | VarRef | VoidStmt | When | While | WhileModifier | Word | Words | XStringLiteral | Yield | Yield0 | Zsuper - -// This is a special scanner event that contains a comment. It can be attached -// to almost any kind of node, which is why it's pulled out here separately. -type UndecoratedComment = { type: "comment", value: string, inline: boolean, loc: Location }; -type UndecoratedEmbDoc = { type: "embdoc", value: string, loc: Location }; - -// Prettier will attach various metadata to comment nodes, which we're adding in -// to the type here. -type CommentDecorations = { leading: boolean, printed: boolean }; -export type Comment = UndecoratedComment & CommentDecorations; -export type EmbDoc = UndecoratedEmbDoc & CommentDecorations; - -// These are the scanner events that contain only a single string. They're -// always leaves in the tree. Ignored ones that can't show up in the tree but -// are present in ripper include: -// -// comma, embdoc, embdoc_beg, embdoc_end, embexpr_beg, embexpr_end, embvar, -// heredoc_end, ignored_nl, ignored_sp, label_end, lbracket, nl, qsymbols_beg, -// qwords_beg, rbrace, rbracket, regexp_beg, regexp_end, rparen, semicolon, sp, -// symbbeg, symbols_beg, tlambda, tlambeg, tstring_beg, tstring_nd, words_beg, -// words_sep -// -export type Backref = ScannerEvent<"backref">; -export type Backtick = ScannerEvent<"backtick">; -export type Char = ScannerEvent<"CHAR">; -export type Const = ScannerEvent<"const">; -export type CVar = ScannerEvent<"cvar">; -export type EndContent = ScannerEvent<"__end__">; -export type Float = ScannerEvent<"float">; -export type GVar = ScannerEvent<"gvar">; -export type HeredocBegin = ScannerEvent<"heredoc_beg">; -export type Identifier = ScannerEvent<"ident">; -export type Imaginary = ScannerEvent<"imaginary">; -export type Int = ScannerEvent<"int">; -export type IVar = ScannerEvent<"ivar">; -export type Keyword = ScannerEvent<"kw">; -export type Label = ScannerEvent<"label">; -export type Lbrace = ScannerEvent<"lbrace">; -export type Lparen = ScannerEvent<"lparen">; -export type Op = ScannerEvent<"op">; -export type Period = ScannerEvent<"period">; -export type Rational = ScannerEvent<"rational">; -export type TStringContent = ScannerEvent<"tstring_content">; - -// These are the parser events that don't receive any arguments. (In earlier -// versions of ripper they were scanner events, now they're parser events with -// arity 0.) Ignored ones that can't show up in the tree but are present in -// ripper include: -// -// args_new, mlhs_new, mrhs_new, qsymbols_new, qwords_new, regexp_new, -// stmts_new, string_content, symbols_new, word_new, words_new, xstring_new -// -export type ArgsForward = ParserEvent0<"args_forward">; -export type ExcessedComma = ParserEvent0<"excessed_comma">; -export type Redo = ParserEvent0<"redo">; -export type Retry = ParserEvent0<"retry">; -export type Return0 = ParserEvent0<"return0">; -export type VoidStmt = { type: "void_stmt", loc: Location } & Comments; -export type Yield0 = ParserEvent0<"yield0">; -export type Zsuper = ParserEvent0<"zsuper">; - -// Below are various parser events grouped by their relative functionality. -// The grouping is pretty loose, but it should convey a certain sense of the -// area of Ruby that it's related to. It does not include certain events that -// are present in ripper that we remove from tree before they get to this -// form, including: -// -// heredoc_dedent, magic_comment, nokw_param, symbol -// - -// These are various parser events that have to do with string or string-like -// nodes. -export type StringContent = StringDVar | StringEmbExpr | TStringContent; -export type DynaSymbol = ParserEvent<"dyna_symbol", { parts: StringContent[], quote: string }>; -export type Heredoc = ParserEvent<"heredoc", { beging: HeredocBegin, ending: string, parts: StringContent[] }>; -export type RegexpLiteral = ParserEvent<"regexp_literal", { parts: StringContent[], beging: string, ending: string }>; -export type StringConcat = ParserEvent<"string_concat", { left: StringConcat | StringLiteral, right: StringLiteral }>; -export type StringDVar = ParserEvent<"string_dvar", { var: Backref | VarRef }>; -export type StringEmbExpr = ParserEvent<"string_embexpr", { stmts: Statements }>; -export type StringLiteral = ParserEvent<"string_literal", { parts: StringContent[], quote: string }>; -export type SymbolLiteral = ParserEvent<"symbol_literal", { value: Backtick | Const | CVar | GVar | Identifier | IVar | Keyword | Op }>; -export type XStringLiteral = ParserEvent<"xstring_literal", { parts: StringContent[] }>; - -// These are various parser events that have to do with arrays. -export type Array = ParserEvent<"array", { cnts: null | Args }>; -export type Qsymbols = ParserEvent<"qsymbols", { elems: TStringContent[] }>; -export type Qwords = ParserEvent<"qwords", { elems: TStringContent[] }>; -export type Symbols = ParserEvent<"symbols", { elems: Word[] }>; -export type Word = ParserEvent<"word", { parts: StringContent[] }>; -export type Words = ParserEvent<"words", { elems: Word[] }>; - -// These are various parser events that have to do with hashes. -type HashContent = Assoc | AssocSplat; -export type Assoc = ParserEvent<"assoc", { key: AnyNode, value: AnyNode }>; -export type AssocSplat = ParserEvent<"assoc_splat", { value: AnyNode }>; -export type AssoclistFromArgs = ParserEvent<"assoclist_from_args", { assocs: HashContent[] }>; -export type BareAssocHash = ParserEvent<"bare_assoc_hash", { assocs: HashContent[] }>; -export type Hash = ParserEvent<"hash", { cnts: null | AssoclistFromArgs }>; - -// These are various parser events for assignment. -type Assignable = ArefField | ConstPathField | Field | TopConstField | VarField; -export type ArefField = ParserEvent<"aref_field", { collection: AnyNode, index: ArgsAddBlock | null }>; -export type Assign = ParserEvent<"assign", { target: Assignable, value: AnyNode }>; -export type ConstPathField = ParserEvent<"const_path_field", { parent: ConstPathRef | Paren | TopConstRef | VarRef, constant: Const }>; -export type Field = ParserEvent<"field", { parent: AnyNode, op: CallOperator, name: Const | Identifier }>; -export type Opassign = ParserEvent<"opassign", { target: Assignable, op: Op, value: AnyNode }>; -export type TopConstField = ParserEvent<"top_const_field", { constant: Const }>; -export type VarField = ParserEvent<"var_field", { value: null | Const | CVar | GVar | Identifier | IVar }>; - -// These are various parser events that have to do with multiple assignment. -export type Massign = ParserEvent<"massign", { target: Mlhs | MlhsParen, value: AnyNode }>; -export type Mlhs = ParserEvent<"mlhs", { parts: (ArefField | Field | Identifier | MlhsParen | VarField)[], comma: undefined | true }>; -export type MlhsParen = ParserEvent<"mlhs_paren", { cnts: Mlhs | MlhsParen }>; -export type Mrhs = ParserEvent<"mrhs", { parts: AnyNode[] }>; -export type MrhsAddStar = ParserEvent<"mrhs_add_star", { mrhs: Mrhs | MrhsNewFromArgs, star: AnyNode }>; -export type MrhsNewFromArgs = ParserEvent<"mrhs_new_from_args", { args: Args }>; - -// These are various parser events for control flow constructs. -export type Case = ParserEvent<"case", { value: AnyNode, cons: In | When }>; -export type Else = ParserEvent<"else", { stmts: Statements }>; -export type Elsif = ParserEvent<"elsif", { pred: AnyNode, stmts: Statements, cons: null | Elsif | Else }>; -export type Ensure = ParserEvent<"ensure", { keyword: Keyword, stmts: Statements }>; -export type For = ParserEvent<"for", { index: Mlhs | VarField, collection: AnyNode, stmts: Statements }>; -export type If = ParserEvent<"if", { pred: AnyNode, stmts: Statements, cons: null | Elsif | Else }>; -export type IfModifier = ParserEvent<"if_mod", { pred: AnyNode, stmt: AnyNode }>; -export type In = ParserEvent<"in", { pattern: AnyNode, stmts: Statements, cons: null | In | Else }>; -export type Rescue = ParserEvent<"rescue", { extn: null | RescueEx, stmts: Statements, cons: null | Rescue }>; -export type RescueEx = ParserEvent<"rescue_ex", { extns: AnyNode, var: null | Field | VarField }>; -export type RescueModifier = ParserEvent<"rescue_mod", { stmt: AnyNode, value: AnyNode }>; -export type Ternary = ParserEvent<"ifop", { pred: AnyNode, tthy: AnyNode, flsy: AnyNode }>; -export type Unless = ParserEvent<"unless", { pred: AnyNode, stmts: Statements, cons: null | Elsif | Else }>; -export type UnlessModifier = ParserEvent<"unless_mod", { pred: AnyNode, stmt: AnyNode }>; -export type Until = ParserEvent<"until", { pred: AnyNode, stmts: Statements }>; -export type UntilModifier = ParserEvent<"until_mod", { pred: AnyNode, stmt: AnyNode }>; -export type When = ParserEvent<"when", { args: Args, stmts: Statements, cons: null | Else | When }>; -export type While = ParserEvent<"while", { pred: AnyNode, stmts: Statements }>; -export type WhileModifier = ParserEvent<"while_mod", { pred: AnyNode, stmt: AnyNode }>; - -// These are various parser events for control flow keywords. -export type Break = ParserEvent<"break", { args: Args | ArgsAddBlock }>; -export type Next = ParserEvent<"next", { args: Args | ArgsAddBlock }>; -export type Return = ParserEvent<"return", { args: Args | ArgsAddBlock }>; -export type Super = ParserEvent<"super", { args: Args | ArgParen | ArgsAddBlock }>; -export type Yield = ParserEvent<"yield", { args: ArgsAddBlock | Paren }>; - -// These are various parser events for pattern matching. -export type Aryptn = ParserEvent<"aryptn", { constant: null | VarRef, reqs: AnyNode[], rest: null | VarField, posts: AnyNode[] }>; -export type FndPtn = ParserEvent<"fndptn", { constant: null | AnyNode, left: VarField, values: AnyNode[], right: VarField }>; -export type Hshptn = ParserEvent<"hshptn", { constant: null | AnyNode, keywords: [Label, AnyNode][], kwrest: null | VarField }>; -export type Rassign = ParserEvent<"rassign", { value: AnyNode, op: Op | Keyword, pattern: AnyNode }>; - -// These are various parser events for method declarations. -type DefName = Backtick | Const | Identifier | Keyword | Op; -type ParenAroundParams = Omit & { cnts: Params }; - -export type Blockarg = ParserEvent<"blockarg", { name: Identifier }>; -export type Def = ParserEvent<"def", { name: DefName, params: Params | Paren, bodystmt: Bodystmt }>; -export type Defs = ParserEvent<"defs", { target: AnyNode, op: Op | Period, name: DefName, params: Params | Paren, bodystmt: Bodystmt }>; -export type DefEndless = ParserEvent<"def_endless", { name: DefName, paren: null | ParenAroundParams, stmt: AnyNode }>; -export type KeywordRestParam = ParserEvent<"kwrest_param", { name: null | Identifier }>; -export type Lambda = ParserEvent<"lambda", { params: Params | ParenAroundParams, stmts: Bodystmt | Statements }>; -export type Params = ParserEvent<"params", { reqs: Identifier[], opts: [Identifier, AnyNode][], rest: null | ArgsForward | ExcessedComma | RestParam, posts: Identifier[], keywords: [Label, AnyNode][], kwrest: null | "nil" | KeywordRestParam, block: null | Blockarg }>; -export type RestParam = ParserEvent<"rest_param", { name: null | Identifier }>; - -// These are various parser events for method calls. -export type CallOperator = Op | Period | "::"; -export type ArgParen = ParserEvent<"arg_paren", { args: Args | ArgsAddBlock | ArgsForward | null }>; -export type Args = ParserEvent<"args", { parts: AnyNode[] }>; -export type ArgsAddBlock = ParserEvent<"args_add_block", { args: Args, block: null | AnyNode }>; -export type ArgStar = ParserEvent<"arg_star", { value: AnyNode }>; -export type BlockVar = ParserEvent<"block_var", { params: Params, locals: Identifier[] }>; -export type BraceBlock = ParserEvent<"brace_block", { lbrace: Lbrace, block_var: null | BlockVar, stmts: Statements }>; -export type Call = ParserEvent<"call", { receiver: AnyNode, op: CallOperator, message: Backtick | Op | Identifier | Const | "call" }>; -export type Command = ParserEvent<"command", { message: Const | Identifier, args: Args | ArgsAddBlock }>; -export type CommandCall = ParserEvent<"command_call", { receiver: AnyNode, op: CallOperator, message: Op | Identifier | Const, args: Args | ArgsAddBlock }>; -export type DoBlock = ParserEvent<"do_block", { keyword: Keyword, block_var: null | BlockVar, bodystmt: Bodystmt }>; -export type Fcall = ParserEvent<"fcall", { value: Const | Identifier }>; -export type MethodAddArg = ParserEvent<"method_add_arg", { call: Call | Fcall, args: Args | ArgParen | ArgsAddBlock }>; -export type MethodAddBlock = ParserEvent<"method_add_block", { call: AnyNode, block: BraceBlock | DoBlock }>; -export type VCall = ParserEvent<"vcall", { value: Identifier }>; - -// These are various parser events for statements you would find in a method body. -type Dot = { left: AnyNode, right: AnyNode } | { left: null, right: AnyNode } | { left: AnyNode, right: null }; -export type Aref = ParserEvent<"aref", { collection: AnyNode, index: Args | ArgsAddBlock | null }>; -export type BEGIN = ParserEvent<"BEGIN", { lbrace: Lbrace, stmts: Statements }>; -export type Binary = ParserEvent<"binary", { left: AnyNode, op: string, right: AnyNode }>; -export type ConstPathRef = ParserEvent<"const_path_ref", { parent: AnyNode, constant: Const }>; -export type ConstRef = ParserEvent<"const_ref", { constant: Const }>; -export type Defined = ParserEvent<"defined", { value: AnyNode }>; -export type Dot2 = ParserEvent<"dot2", Dot>; -export type Dot3 = ParserEvent<"dot3", Dot>; -export type END = ParserEvent<"END", { lbrace: Lbrace, stmts: Statements }>; -export type Not = ParserEvent<"not", { value: AnyNode, paren: boolean }>; -export type Paren = ParserEvent<"paren", { lparen: Lparen, cnts: AnyNode }>; -export type TopConstRef = ParserEvent<"top_const_ref", { constant: Const }>; -export type Unary = ParserEvent<"unary", { value: AnyNode, op: string }>; -export type VarRef = ParserEvent<"var_ref", { value: Const | CVar | GVar | Identifier | IVar | Keyword }>; - -// These are various parser events for statements you would find in a class definition body. -export type AccessCtrl = ParserEvent<"access_ctrl", { value: Identifier }>; -export type Alias = ParserEvent<"alias", { left: DynaSymbol | SymbolLiteral, right: DynaSymbol | SymbolLiteral }>; -export type Class = ParserEvent<"class", { constant: ConstPathRef | ConstRef | TopConstRef, superclass: null | AnyNode, bodystmt: Bodystmt }>; -export type Module = ParserEvent<"module", { constant: ConstPathRef | ConstRef | TopConstRef, bodystmt: Bodystmt }>; -export type Sclass = ParserEvent<"sclass", { target: AnyNode, bodystmt: Bodystmt }>; -export type VarAlias = ParserEvent<"var_alias", { left: GVar, right: Backref | GVar }>; -export type Undef = ParserEvent<"undef", { syms: (DynaSymbol | SymbolLiteral)[] }>; - -// These are various parser events for statement containers, generally pretty high in the tree. -export type Begin = ParserEvent<"begin", { bodystmt: Bodystmt }>; -export type Bodystmt = ParserEvent<"bodystmt", { stmts: Statements, rsc: null | Rescue, els: null | Statements, ens: null | Ensure }>; -export type Program = ParserEvent<"program", { stmts: Statements }>; -export type Statements = ParserEvent<"statements", { body: AnyNode[] }>; diff --git a/src/types/utils.ts b/src/types/utils.ts deleted file mode 100644 index cdd68a5e..00000000 --- a/src/types/utils.ts +++ /dev/null @@ -1,24 +0,0 @@ -// The type of elements that make up the given array T. -export type ArrayElement = T extends (infer E)[] ? E : never; - -// A union of the properties of the given object that are arrays. -export type ArrayProperties = { [K in keyof T]: T[K] extends any[] ? K : never }[keyof T]; - -// A union of the properties of the given array T that can be used to index it. -// If the array is a tuple, then that's going to be the explicit indices of the -// array, otherwise it's going to just be number. -export type IndexProperties = IsTuple extends true ? Exclude["length"], T["length"]> : number; - -// Effectively performing T[P], except that it's telling TypeScript that it's -// safe to do this for tuples, arrays, or objects. -export type IndexValue = T extends any[] ? P extends number ? T[P] : never : P extends keyof T ? T[P] : never; - -// Determines if an object T is an array like string[] (in which case this -// evaluates to false) or a tuple like [string] (in which case this evaluates to -// true). -// eslint-disable-next-line @typescript-eslint/no-unused-vars -type IsTuple = T extends [] ? true : T extends [infer First, ...infer Remain] ? IsTuple : false; - -// The same object T as currently exists, except the keys provided by P are -// required instead of optional. -export type RequiredKeys = T & Required>; diff --git a/src/utils.ts b/src/utils.ts deleted file mode 100644 index 0d397944..00000000 --- a/src/utils.ts +++ /dev/null @@ -1,13 +0,0 @@ -export { default as containsAssignment } from "./utils/containsAssignment"; -export { default as getTrailingComma } from "./utils/getTrailingComma"; -export { default as isEmptyBodyStmt } from "./utils/isEmptyBodyStmt"; -export { default as isEmptyParams } from "./utils/isEmptyParams"; -export { default as isEmptyStmts } from "./utils/isEmptyStmts"; -export { default as getChildNodes } from "./utils/getChildNodes"; -export { default as hasAncestor } from "./utils/hasAncestor"; -export { default as inlineEnsureParens } from "./utils/inlineEnsureParens"; -export { default as literallineWithoutBreakParent } from "./utils/literallineWithoutBreakParent"; -export { default as makeCall } from "./utils/makeCall"; -export { default as noIndent } from "./utils/noIndent"; -export { default as printEmptyCollection } from "./utils/printEmptyCollection"; -export { default as skipAssignIndent } from "./utils/skipAssignIndent"; diff --git a/src/utils/containsAssignment.ts b/src/utils/containsAssignment.ts deleted file mode 100644 index cb9e9cfe..00000000 --- a/src/utils/containsAssignment.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { Ruby } from "../types"; -import getChildNodes from "./getChildNodes"; - -// If the node is a type of assignment or if the node is a paren and nested -// inside that paren is a node that is a type of assignment. -function containsAssignment(node: null | Ruby.AnyNode | Ruby.Statements) { - if (!node) { - return false; - } - - if (["assign", "massign", "opassign"].includes(node.type)) { - return true; - } - - return getChildNodes(node).some(containsAssignment); -} - -export default containsAssignment; diff --git a/src/utils/getTrailingComma.ts b/src/utils/getTrailingComma.ts deleted file mode 100644 index 41e17724..00000000 --- a/src/utils/getTrailingComma.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Plugin } from "../types"; - -function getTrailingComma(opts: Plugin.Options) { - return ["all", "es5"].includes(opts.trailingComma); -} - -export default getTrailingComma; diff --git a/src/utils/hasAncestor.ts b/src/utils/hasAncestor.ts deleted file mode 100644 index 6cf917e6..00000000 --- a/src/utils/hasAncestor.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Plugin } from "../types"; - -function hasAncestor(path: Plugin.Path<{ type: string }>, types: string[]) { - let parent = 0; - let parentNode = path.getParentNode(); - - while (parentNode) { - if (types.includes(parentNode.type)) { - return true; - } - - parent += 1; - parentNode = path.getParentNode(parent); - } - - return false; -} - -export default hasAncestor; diff --git a/src/utils/inlineEnsureParens.ts b/src/utils/inlineEnsureParens.ts deleted file mode 100644 index 4f5938f2..00000000 --- a/src/utils/inlineEnsureParens.ts +++ /dev/null @@ -1,55 +0,0 @@ -import type { Plugin, Ruby } from "../types"; - -const needsParens = [ - "args", - "assign", - "assoc", - "binary", - "call", - "massign", - "opassign" -]; - -// If you have a modifier statement (for instance an inline if statement or an -// inline while loop) there are times when you need to wrap the entire statement -// in parentheses. This occurs when you have something like: -// -// foo[:foo] = -// if bar? -// baz -// end -// -// Normally we would shorten this to an inline version, which would result in: -// -// foo[:foo] = baz if bar? -// -// but this actually has different semantic meaning. The first example will -// result in a nil being inserted into the hash for the :foo key, whereas the -// second example will result in an empty hash because the if statement applies -// to the entire assignment. -// -// We can fix this in a couple of ways. We can use the then keyword, as in: -// -// foo[:foo] = if bar? then baz end -// -// but I haven't actually seen this anywhere. We can also just leave it as is -// with the multi-line version, but for a short predicate and short value it -// looks pretty silly. The last option and the one I've selected here is to add -// parentheses on both sides of the expression, as in: -// -// foo[:foo] = (baz if bar?) -// -// This approach maintains the nice conciseness of the inline version, while -// keeping the correct semantic meaning. -function inlineEnsureParens( - path: Plugin.Path, - parts: Plugin.Doc[] -) { - if (needsParens.includes(path.getParentNode().type)) { - return ["(", ...parts, ")"]; - } - - return parts; -} - -export default inlineEnsureParens; diff --git a/src/utils/isEmptyBodyStmt.ts b/src/utils/isEmptyBodyStmt.ts deleted file mode 100644 index 842718e9..00000000 --- a/src/utils/isEmptyBodyStmt.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { Ruby } from "../types"; -import isEmptyStmts from "./isEmptyStmts"; - -function isEmptyBodyStmt(node: Ruby.Bodystmt) { - return isEmptyStmts(node.stmts) && !node.rsc && !node.ens && !node.els; -} - -export default isEmptyBodyStmt; diff --git a/src/utils/isEmptyParams.ts b/src/utils/isEmptyParams.ts deleted file mode 100644 index c4a25e68..00000000 --- a/src/utils/isEmptyParams.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Ruby } from "../types"; - -function isEmptyParams(node: Ruby.Params) { - return ( - node.reqs.length === 0 && - node.opts.length === 0 && - !node.rest && - node.posts.length === 0 && - node.keywords.length === 0 && - !node.kwrest && - !node.block - ); -} - -export default isEmptyParams; diff --git a/src/utils/isEmptyStmts.ts b/src/utils/isEmptyStmts.ts deleted file mode 100644 index b80a7265..00000000 --- a/src/utils/isEmptyStmts.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { Ruby } from "../types"; - -function isEmptyStmts(node: Ruby.AnyNode | Ruby.Statements) { - return ( - node && - node.type === "statements" && - node.body.length === 1 && - node.body[0].type === "void_stmt" && - !node.body[0].comments - ); -} - -export default isEmptyStmts; diff --git a/src/utils/literallineWithoutBreakParent.ts b/src/utils/literallineWithoutBreakParent.ts deleted file mode 100644 index 4262f364..00000000 --- a/src/utils/literallineWithoutBreakParent.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Plugin } from "../types"; - -const literallineWithoutBreakParent = { - type: "line", - hard: true, - literal: true -} as Plugin.Doc; - -export default literallineWithoutBreakParent; diff --git a/src/utils/makeCall.ts b/src/utils/makeCall.ts deleted file mode 100644 index f9338d70..00000000 --- a/src/utils/makeCall.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Plugin, Ruby } from "../types"; - -type Callable = Ruby.Call | Ruby.CommandCall | Ruby.Field; - -const makeCall: Plugin.Printer = (path, opts, print) => { - const node = path.getValue(); - const operator = node.op; - - // Ignoring the next block for coverage information because it's only relevant - // in Ruby 2.5 and below. - /* istanbul ignore next */ - if ([".", "&."].includes(operator as any)) { - return operator as Plugin.Doc; - } - - return operator === "::" ? "." : path.call(print, "op"); -}; - -export default makeCall; diff --git a/src/utils/noIndent.ts b/src/utils/noIndent.ts deleted file mode 100644 index defbd741..00000000 --- a/src/utils/noIndent.ts +++ /dev/null @@ -1,10 +0,0 @@ -const noIndent = [ - "array", - "hash", - "heredoc", - "if", - "unless", - "xstring_literal" -]; - -export default noIndent; diff --git a/src/utils/printEmptyCollection.ts b/src/utils/printEmptyCollection.ts deleted file mode 100644 index c3dc4714..00000000 --- a/src/utils/printEmptyCollection.ts +++ /dev/null @@ -1,58 +0,0 @@ -import type { Plugin, Ruby, RequiredKeys } from "../types"; -import prettier from "../prettier"; -import { getEndChar, getStartChar } from "../ruby/location"; - -const { group, hardline, indent, join, line } = prettier; - -function containedWithin(node: Ruby.Array | Ruby.Hash) { - return function containedWithinNode(comment: Ruby.Comment) { - return ( - getStartChar(comment.loc) >= getStartChar(node.loc) && - getEndChar(comment.loc) <= getEndChar(node.loc) - ); - }; -} - -// Empty collections are array or hash literals that do not contain any -// contents. They can, however, have comments inside the body. You can solve -// this by having a child node inside the array that gets the comments attached -// to it, but that requires modifying the parser. Instead, we can just manually -// print out the non-leading comments here. -function printEmptyCollection( - path: Plugin.Path, - opts: Plugin.Options, - startToken: string, - endToken: string -) { - const node = path.getValue(); - const containedWithinNode = containedWithin(node); - - // If there are no comments or only leading comments, then we can just print - // out the start and end token and be done, as there are no comments inside - // the body of this node. - if (!node.comments || !node.comments.some(containedWithinNode)) { - return `${startToken}${endToken}`; - } - - const comments: Plugin.Doc[] = []; - const nodePath = path as Plugin.Path>; - - // For each comment, go through its path and print it out manually. - nodePath.each((commentPath) => { - const comment = commentPath.getValue(); - - if (containedWithinNode(comment)) { - comment.printed = true; - comments.push(opts.printer.printComment(commentPath, opts)); - } - }, "comments"); - - return group([ - startToken, - indent([hardline, join(hardline, comments)]), - line, - endToken - ]); -} - -export default printEmptyCollection; diff --git a/src/utils/skipAssignIndent.ts b/src/utils/skipAssignIndent.ts deleted file mode 100644 index c0420d58..00000000 --- a/src/utils/skipAssignIndent.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { Ruby } from "../types"; - -const skippable = [ - "array", - "dyna_symbol", - "hash", - "heredoc", - "lambda", - "qsymbols", - "qwords", - "regexp_literal", - "symbols", - "words" -]; - -function skipAssignIndent(node: Ruby.AnyNode): boolean { - return ( - skippable.includes(node.type) || - (node.type === "call" && skipAssignIndent(node.receiver)) - ); -} - -export default skipAssignIndent; diff --git a/test/js/ruby/toProc.test.ts b/test/js/ruby/toProc.test.ts deleted file mode 100644 index a10b746c..00000000 --- a/test/js/ruby/toProc.test.ts +++ /dev/null @@ -1,210 +0,0 @@ -import { ruby } from "../utils"; - -describe("to_proc transform", () => { - test("basic inline", () => { - expect("loop { |i| i.to_s }").toChangeFormat("loop(&:to_s)", { - rubyToProc: true - }); - }); - - test("basic inline with option turned off", () => { - expect("loop { |i| i.to_s }").toMatchFormat({ rubyToProc: false }); - }); - - test("basic multi-line", () => { - const content = ruby(` - list.each do |node| - node.print - end - `); - - expect(content).toChangeFormat("list.each(&:print)", { - rubyToProc: true - }); - }); - - test("maintains to_proc if already in use when rubyToProc false", () => { - expect("loop(&:to_s)").toMatchFormat({ rubyToProc: false }); - }); - - test("maintains to_proc if already in use when rubyToProc true", () => { - expect("loop(&:to_s)").toMatchFormat({ rubyToProc: true }); - }); - - test("multi-line with comment", () => { - const content = ruby(` - foo.each do |bar| - # comment - bar.baz - end - `); - - expect(content).toMatchFormat({ rubyToProc: true }); - }); - - test("happens for command nodes", () => { - const content = ruby(` - command 'foo' do |bar| - bar.to_s - end - `); - - expect(content).toChangeFormat("command 'foo', &:to_s", { - rubyToProc: true - }); - }); - - test("happens for command call nodes", () => { - const content = ruby(` - command.call 'foo' do |bar| - bar.to_s - end - `); - - expect(content).toChangeFormat("command.call 'foo', &:to_s", { - rubyToProc: true - }); - }); - - test("with args and parens", () => { - expect("foo(bar) { |baz| baz.to_i }").toChangeFormat("foo(bar, &:to_i)", { - rubyToProc: true - }); - }); - - test("with commands", () => { - const content = ruby(` - command bar do |baz| - baz.to_i - end - `); - - expect(content).toChangeFormat("command bar, &:to_i", { - rubyToProc: true - }); - }); - - test("with command calls", () => { - const content = ruby(` - command.call bar do |baz| - baz.to_i - end - `); - - expect(content).toChangeFormat("command.call bar, &:to_i", { - rubyToProc: true - }); - }); - - test("when inside of an aref node", () => { - const content = "foo[:bar].each { |baz| baz.to_s }"; - const expected = "foo[:bar].each(&:to_s)"; - - expect(content).toChangeFormat(expected, { rubyToProc: true }); - }); - - describe("when not to transform", () => { - test("when called with &.", () => { - const content = "loop { |i| i&.to_s }"; - - expect(content).toMatchFormat({ rubyToProc: true }); - }); - - test("when there are multiple lines", () => { - const content = ruby(` - loop do |i| - i.to_s - i.next - end - `); - - expect(content).toMatchFormat({ rubyToProc: true }); - }); - - test("when there is a rescue, else, or ensure", () => { - const content = ruby(` - loop do |i| - i.to_s - rescue Foo - foo - end - `); - - expect(content).toMatchFormat({ rubyToProc: true }); - }); - - test("when there are args to the method call", () => { - const content = "loop { |i| i.to_s(:db) }"; - - expect(content).toMatchFormat({ rubyToProc: true }); - }); - - test("when there are multiple args", () => { - const content = "loop { |i, j| i.to_s }"; - - expect(content).toMatchFormat({ rubyToProc: true }); - }); - - test("when we're inside an if:", () => { - const content = "{ if: proc { |i| i.to_s } }"; - - expect(content).toMatchFormat({ rubyToProc: true }); - }); - - test("when we're inside an :if =>", () => { - const content = "{ :if => proc { |i| i.to_s } }"; - const expected = "{ if: proc { |i| i.to_s } }"; - - expect(content).toChangeFormat(expected, { rubyToProc: true }); - }); - - test("when we're inside a regular hash", () => { - const content = "{ when: proc { |i| i.to_s } }"; - const expected = "{ when: proc(&:to_s) }"; - - expect(content).toChangeFormat(expected, { rubyToProc: true }); - }); - - test("when we're inside a regular hash", () => { - const content = "{ when: proc { |i| i.to_s } }"; - const expected = "{ when: proc(&:to_s) }"; - - expect(content).toChangeFormat(expected, { rubyToProc: true }); - }); - - test("when there are no variables", () => { - expect("loop { i.to_s }").toMatchFormat({ rubyToProc: true }); - }); - }); - - describe.each(["if", "unless"])( - "does not transform when used inside hash with %s", - (keyword) => { - test(`hash literal with :${keyword} key`, () => { - expect(`{ ${keyword}: ->(foo) { foo.to_s } }`).toMatchFormat({ - rubyToProc: true - }); - }); - - test(`hash literal with hashrocket :${keyword} key`, () => { - expect(`{ :${keyword} => ->(foo) { foo.to_s } }`).toMatchFormat({ - rubyHashLabel: false, - rubyToProc: true - }); - }); - - test(`method arguments with :${keyword} key`, () => { - expect(`bar ${keyword}: ->(foo) { foo.to_s }`).toMatchFormat({ - rubyToProc: true - }); - }); - - test(`method arguments with hashrocket :${keyword} key`, () => { - expect(`bar :${keyword} => ->(foo) { foo.to_s }`).toMatchFormat({ - rubyHashLabel: false, - rubyToProc: true - }); - }); - } - ); -}); diff --git a/test/js/setupTests.ts b/test/js/setupTests.ts index d6bb28d5..8f5c23b4 100644 --- a/test/js/setupTests.ts +++ b/test/js/setupTests.ts @@ -1,10 +1,17 @@ import prettier from "prettier"; +import type * as Prettier from "prettier"; -import type { Plugin } from "../../src/types"; import type { Code } from "./types"; import plugin from "../../src/plugin"; -type Config = Partial; +type Config = Partial & { + printer: Omit & { printComment: () => any }, + rubyArrayLiteral: boolean, + rubyHashLabel: boolean, + rubyModifier: boolean, + rubySingleQuote: boolean, + rubyToProc: boolean +}>; function normalize(code: Code) { const string = typeof code === "string" ? code : code.code; From ea6c1c6a490575377c2f64a6553843d8609409e8 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 6 Apr 2022 22:39:48 -0400 Subject: [PATCH 571/785] Start cleaning up Ruby tests --- package.json | 2 +- src/{parser => }/getInfo.js | 0 src/{parser => }/netcat.js | 0 src/{parser => }/parseSync.ts | 13 +++------- src/plugin.ts | 2 +- src/{parser => }/server.rb | 0 test/js/globalSetup.ts | 6 ++--- test/js/ruby/errors.test.ts | 7 ------ test/js/ruby/locations.test.ts | 10 -------- test/js/ruby/pragma.test.ts | 46 ---------------------------------- 10 files changed, 8 insertions(+), 78 deletions(-) rename src/{parser => }/getInfo.js (100%) rename src/{parser => }/netcat.js (100%) rename src/{parser => }/parseSync.ts (95%) rename src/{parser => }/server.rb (100%) delete mode 100644 test/js/ruby/locations.test.ts delete mode 100644 test/js/ruby/pragma.test.ts diff --git a/package.json b/package.json index fd51b2bf..a8a44b3f 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "checkFormat": "prettier --check '**/*'", "lint": "eslint --cache .", - "prepublishOnly": "tsc -p tsconfig.build.json && cp src/parser/getInfo.js dist/parser && cp src/parser/netcat.js dist/parser && cp src/parser/server.rb dist/parser && cp src/haml/parser.rb dist/haml && cp src/rbs/parser.rb dist/rbs && cp src/ruby/parser.rb dist/ruby", + "prepublishOnly": "tsc -p tsconfig.build.json && cp src/getInfo.js dist && cp src/netcat.js dist && cp src/server.rb dist", "test": "jest" }, "repository": { diff --git a/src/parser/getInfo.js b/src/getInfo.js similarity index 100% rename from src/parser/getInfo.js rename to src/getInfo.js diff --git a/src/parser/netcat.js b/src/netcat.js similarity index 100% rename from src/parser/netcat.js rename to src/netcat.js diff --git a/src/parser/parseSync.ts b/src/parseSync.ts similarity index 95% rename from src/parser/parseSync.ts rename to src/parseSync.ts index 388b7313..cdfc7ede 100644 --- a/src/parser/parseSync.ts +++ b/src/parseSync.ts @@ -77,16 +77,9 @@ function spawnServer(): ParserArgs { // the Ruby server or the getInfo.js script directly. Instead, we need to copy them and all // the files they depend on to a temporary directory. - const sourceFiles = [ - "parser/server.rb", - "parser/getInfo.js", - "parser/netcat.js", - "ruby/parser.rb", - "rbs/parser.rb", - "haml/parser.rb" - ]; - serverRbPath = path.join(tempDir, "parser", "server.rb"); - getInfoJsPath = path.join(tempDir, "parser", "getInfo.js"); + const sourceFiles = ["server.rb", "getInfo.js", "netcat.js"]; + serverRbPath = path.join(tempDir, "server.rb"); + getInfoJsPath = path.join(tempDir, "getInfo.js"); sourceFiles.forEach((rubyFile) => { const destDir = path.join(tempDir, path.dirname(rubyFile)); diff --git a/src/plugin.ts b/src/plugin.ts index 182589ac..2e0c8dfd 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -1,5 +1,5 @@ import type { Plugin, SupportLanguage } from "prettier"; -import parseSync from "./parser/parseSync"; +import parseSync from "./parseSync"; interface ExtendedSupportLanguage extends SupportLanguage { interpreters?: string[] diff --git a/src/parser/server.rb b/src/server.rb similarity index 100% rename from src/parser/server.rb rename to src/server.rb diff --git a/test/js/globalSetup.ts b/test/js/globalSetup.ts index 8cd5001d..90609508 100644 --- a/test/js/globalSetup.ts +++ b/test/js/globalSetup.ts @@ -2,7 +2,7 @@ import { spawn, spawnSync } from "child_process"; import { unlinkSync } from "fs"; import path from "path"; -import { getLang, getInfoFilepath } from "../../src/parser/parseSync"; +import { getLang, getInfoFilepath } from "../../src/parseSync"; // This is somewhat similar to the spawnServer function in parseSync but // slightly different in that it logs its information into environment variables @@ -17,7 +17,7 @@ function globalSetup() { const filepath = getInfoFilepath(); const server = spawn( "ruby", - [path.join(__dirname, "../../src/parser/server.rb"), filepath], + [path.join(__dirname, "../../src/server.rb"), filepath], { env: Object.assign({}, process.env, { LANG: getLang() }), detached: true, @@ -27,7 +27,7 @@ function globalSetup() { // Get the connection information from the parsing server. const information = spawnSync("node", [ - path.join(__dirname, "../../src/parser/getInfo.js"), + path.join(__dirname, "../../src/getInfo.js"), filepath ]); diff --git a/test/js/ruby/errors.test.ts b/test/js/ruby/errors.test.ts index b1054e33..a01611b4 100644 --- a/test/js/ruby/errors.test.ts +++ b/test/js/ruby/errors.test.ts @@ -1,5 +1,4 @@ import prettier from "prettier"; -import printer from "../../../src/ruby/printer"; describe("errors", () => { const cases = [ @@ -20,10 +19,4 @@ describe("errors", () => { expect(format).toThrow(); }); - - test("when encountering an unsupported node type", () => { - const path = { getValue: () => ({ type: "unsupported", body: {} }) }; - - expect(() => (printer as any).print(path)).toThrow("Unsupported"); - }); }); diff --git a/test/js/ruby/locations.test.ts b/test/js/ruby/locations.test.ts deleted file mode 100644 index c3239faa..00000000 --- a/test/js/ruby/locations.test.ts +++ /dev/null @@ -1,10 +0,0 @@ -import parser from "../../../src/ruby/parser"; - -describe("locations", () => { - test("locStart and locEnd are defined", () => { - const { hasOwnProperty } = Object.prototype; - - expect(hasOwnProperty.call(parser, "locStart")).toBe(true); - expect(hasOwnProperty.call(parser, "locEnd")).toBe(true); - }); -}); diff --git a/test/js/ruby/pragma.test.ts b/test/js/ruby/pragma.test.ts deleted file mode 100644 index b763f3e0..00000000 --- a/test/js/ruby/pragma.test.ts +++ /dev/null @@ -1,46 +0,0 @@ -import parser from "../../../src/ruby/parser"; -import printer from "../../../src/ruby/printer"; -import { ruby } from "../utils"; - -describe("pragma", () => { - describe("hasPragma", () => { - test("checks for @prettier comments", () => { - expect(parser.hasPragma("# @prettier")).toBe(true); - }); - - test("checks for @format comments", () => { - expect(parser.hasPragma("# @format")).toBe(true); - }); - - test("does not check for anything else", () => { - expect(parser.hasPragma("# @foobar")).toBe(false); - }); - - test("works when the comment is not on the first line", () => { - const content = ruby(` - # typed: true - # @format - `); - - expect(parser.hasPragma(content)).toBe(true); - }); - }); - - describe("insertPragma", () => { - test("inserts normally", () => { - const content = "foo + bar"; - - expect(printer.insertPragma(content)).toEqual(`# @format\n\n${content}`); - }); - - test("inserts when there is already a comment at the top", () => { - const content = ruby(` - # frozen_string_literal: true - - foo - `); - - expect(printer.insertPragma(content)).toEqual(`# @format\n${content}`); - }); - }); -}); From dbc9a09ab8758a4b279e0e789ca243fee047e6ea Mon Sep 17 00:00:00 2001 From: Drew Bragg Date: Thu, 21 Apr 2022 09:26:13 -0400 Subject: [PATCH 572/785] Fix ignore magic comment test --- test/js/ruby/ignore.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/js/ruby/ignore.test.ts b/test/js/ruby/ignore.test.ts index f0626f20..4983fae5 100644 --- a/test/js/ruby/ignore.test.ts +++ b/test/js/ruby/ignore.test.ts @@ -3,7 +3,7 @@ import { ruby } from "../utils"; describe("ignore", () => { test("you can ignore code blocks", () => { const content = ruby(` - # prettier-ignore + # stree-ignore class Foo; def bar; 1+1+1; end; end `); From 43d7154d1494b5e8cd7ebc97a4c00d04c48f2630 Mon Sep 17 00:00:00 2001 From: Drew Bragg Date: Thu, 21 Apr 2022 09:26:40 -0400 Subject: [PATCH 573/785] Fix whitespace in test --- test/js/ruby/nodes/conditionals.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/test/js/ruby/nodes/conditionals.test.ts b/test/js/ruby/nodes/conditionals.test.ts index 1ca139b8..9cf015bf 100644 --- a/test/js/ruby/nodes/conditionals.test.ts +++ b/test/js/ruby/nodes/conditionals.test.ts @@ -129,7 +129,6 @@ describe("conditionals", () => { test("empty first body with present second body", () => { const content = ruby(` ${keyword} a - else b end From c699d864bd00c2ff87576f175727faa32c4debd3 Mon Sep 17 00:00:00 2001 From: Drew Bragg Date: Thu, 21 Apr 2022 09:27:40 -0400 Subject: [PATCH 574/785] Remove tests referencing `rubyModifier` setting --- test/js/ruby/nodes/conditionals.test.ts | 107 ------------------------ test/js/ruby/nodes/loops.test.ts | 53 ------------ 2 files changed, 160 deletions(-) diff --git a/test/js/ruby/nodes/conditionals.test.ts b/test/js/ruby/nodes/conditionals.test.ts index 9cf015bf..99592a33 100644 --- a/test/js/ruby/nodes/conditionals.test.ts +++ b/test/js/ruby/nodes/conditionals.test.ts @@ -230,113 +230,6 @@ describe("conditionals", () => { }); }); - describe("when inline not allowed", () => { - describe.each(["if", "unless"])("%s keyword", (keyword) => { - test("inline changes", () => { - expect(`1 ${keyword} a`).toChangeFormat(`${keyword} a\n 1\nend`, { - rubyModifier: false - }); - }); - - test("multi line stays", () => { - expect(`${keyword} a\n 1\nend`).toMatchFormat({ - rubyModifier: false - }); - }); - - test("inline breaking changes", () => { - expect(`${long} ${keyword} ${long}`).toChangeFormat( - `${keyword} ${long}\n ${long}\nend`, - { - rubyModifier: false - } - ); - }); - - test("multi line breaking stays", () => { - expect(`${keyword} ${long}\n ${long}\nend`).toMatchFormat({ - rubyModifier: false - }); - }); - - test("not operator", () => { - expect(`${keyword} not a\n b\nend`).toMatchFormat({ - rubyModifier: false - }); - }); - - test("not operator parens", () => { - expect("not(true)").toMatchFormat(); - }); - - test("empty first body", () => { - const content = ruby(` - ${keyword} a - end - `); - - expect(content).toMatchFormat({ rubyModifier: false }); - }); - - test("empty first body with present second body", () => { - const content = ruby(` - ${keyword} a - - else - b - end - `); - - expect(content).toMatchFormat({ rubyModifier: false }); - }); - - test("comment in body", () => { - const content = ruby(` - ${keyword} a - # comment - end - `); - - expect(content).toMatchFormat({ rubyModifier: false }); - }); - - test("comment on node in body", () => { - const content = ruby(` - ${keyword} a - break # comment - end - `); - - expect(content).toMatchFormat({ rubyModifier: false }); - }); - - test("align long predicates", () => { - expect(`foo ${keyword} ${long} || ${long}a`).toChangeFormat( - ruby(` - ${keyword} ${long} || - ${Array(keyword.length).fill("").join(" ")}${long}a - foo - end - `) - ); - }); - - test("single line should break up", () => { - const content = "foo = if bar? then baz end"; - const expected = ruby(` - foo = - if bar? - baz - end - `); - - expect(content).toChangeFormat(expected, { - rubyModifier: false - }); - }); - }); - }); - describe("ternaries", () => { test("non-breaking", () => { expect("a ? 1 : 2").toMatchFormat(); diff --git a/test/js/ruby/nodes/loops.test.ts b/test/js/ruby/nodes/loops.test.ts index 6512fda7..0b6034c4 100644 --- a/test/js/ruby/nodes/loops.test.ts +++ b/test/js/ruby/nodes/loops.test.ts @@ -98,59 +98,6 @@ describe.each(["while", "until"])("%s", (keyword) => { }); }); - describe("inlines not allowed", () => { - test("maintains multiline", () => { - expect(`${keyword} a\n 1\nend`).toMatchFormat({ rubyModifier: false }); - }); - - test("transforms to multiline", () => { - expect(`1 ${keyword} a`).toChangeFormat(`${keyword} a\n 1\nend`, { - rubyModifier: false - }); - }); - - test("breaks on large predicates", () => { - expect(`${keyword} ${long}\n 1\nend`).toMatchFormat({ - rubyModifier: false - }); - }); - - test("breaks inlines on large predicates", () => { - expect(`1 ${keyword} ${long}`).toChangeFormat( - `${keyword} ${long}\n 1\nend`, - { rubyModifier: false } - ); - }); - - test("does not break into block when modifying a begin", () => { - const content = ruby(` - begin - foo - end ${keyword} bar - `); - - expect(content).toMatchFormat({ rubyModifier: false }); - }); - - test("empty body", () => { - const content = ruby(` - while foo - end - `); - - expect(content).toMatchFormat({ rubyModifier: false }); - }); - - test("empty body, long predicate", () => { - const content = ruby(` - while ${long} - end - `); - - expect(content).toMatchFormat({ rubyModifier: false }); - }); - }); - describe.each(["while", "until"])( "add parens when necessary %s", (keyword) => { From 64445b4ed5b7b13f981eb78fe9f4c8908614837e Mon Sep 17 00:00:00 2001 From: Drew Bragg Date: Thu, 21 Apr 2022 09:28:16 -0400 Subject: [PATCH 575/785] Correct method format --- test/js/ruby/nodes/kwargs.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/js/ruby/nodes/kwargs.test.ts b/test/js/ruby/nodes/kwargs.test.ts index 86351a6e..c7a4dfc7 100644 --- a/test/js/ruby/nodes/kwargs.test.ts +++ b/test/js/ruby/nodes/kwargs.test.ts @@ -1,13 +1,13 @@ describe("kwargs", () => { test("basic", () => { - expect("def foo(bar: baz); end").toMatchFormat(); + expect("def foo(bar: baz)\nend").toMatchFormat(); }); test("optional", () => { - expect("def foo(bar:); end").toMatchFormat(); + expect("def foo(bar:)\nend").toMatchFormat(); }); test("double splat", () => { - expect("def foo(bar:, **baz); end").toMatchFormat(); + expect("def foo(bar:, **baz)\nend").toMatchFormat(); }); }); From da71932aed43f55777c6c1ff317051f736fac79b Mon Sep 17 00:00:00 2001 From: Drew Bragg Date: Thu, 21 Apr 2022 09:29:24 -0400 Subject: [PATCH 576/785] Use double quotes over signle quotes --- test/js/ruby/nodes/conditionals.test.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/js/ruby/nodes/conditionals.test.ts b/test/js/ruby/nodes/conditionals.test.ts index 99592a33..6c966bb7 100644 --- a/test/js/ruby/nodes/conditionals.test.ts +++ b/test/js/ruby/nodes/conditionals.test.ts @@ -27,32 +27,32 @@ describe("conditionals", () => { describe("modifiers", () => { describe.each(["if", "unless"])("%s keyword", (keyword) => { test("when modifying an assignment expression", () => { - const content = `text = '${long}' ${keyword} text`; + const content = `text = "${long}" ${keyword} text`; const expected = ruby(` text = - '${long}' ${keyword} text + "${long}" ${keyword} text `); expect(content).toChangeFormat(expected); }); test("when modifying an abbreviated assignment expression", () => { - const content = `text ||= '${long}' ${keyword} text`; + const content = `text ||= "${long}" ${keyword} text`; const expected = ruby(` text ||= - '${long}' ${keyword} text + "${long}" ${keyword} text `); expect(content).toChangeFormat(expected); }); test("when modifying an expression with an assignment descendant", () => { - const content = `true && (text = '${long}') ${keyword} text`; + const content = `true && (text = "${long}") ${keyword} text`; const expected = ruby(` true && ( text = - '${long}' + "${long}" ) ${keyword} text `); @@ -541,7 +541,7 @@ describe("conditionals", () => { test("lower precendence operators", () => { const content = ruby(` if x.nil? - puts 'nil' and return + puts "nil" and return else x end @@ -654,8 +654,8 @@ describe("conditionals", () => { if (atLeastVersion("3.0")) { test.each(["if", "unless"])("%s with pattern matching", (keyword) => { const content = ruby(` - user = { role: 'admin', login: 'matz' } - puts "admin: #{name}" ${keyword} user in { role: 'admin', name: } + user = { role: "admin", login: "matz" } + puts "admin: #{name}" ${keyword} user in { role: "admin", name: } `); expect(content).toMatchFormat(); From 1d767d92758333193044af43b791fa2b7d62e054 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 7 Apr 2022 11:36:25 -0400 Subject: [PATCH 577/785] Fix up a bunch of tests --- .github/ISSUE_TEMPLATE/bug.md | 8 +- .github/ISSUE_TEMPLATE/formatting.md | 8 +- .github/workflows/main.yml | 8 +- .prettierignore | 4 - Gemfile | 9 +- README.md | 10 +- bin/print.ts | 3 +- prettier.gemspec | 10 + rubocop.yml | 12 +- src/plugin.ts | 45 +- src/prettier.ts | 24 - src/types.ts | 121 ---- test/js/haml/tag.test.ts | 2 +- test/js/rbs/rbs.test.ts | 8 +- test/js/ruby/comments.test.ts | 12 +- test/js/ruby/embed.test.ts | 144 ----- test/js/ruby/encoding.test.ts | 2 +- test/js/ruby/nodes/alias.test.ts | 4 +- test/js/ruby/nodes/arrays.test.ts | 48 +- test/js/ruby/nodes/assign.test.ts | 4 +- test/js/ruby/nodes/blocks.test.ts | 10 +- test/js/ruby/nodes/calls.test.ts | 14 +- test/js/ruby/nodes/case.test.ts | 12 +- test/js/ruby/nodes/class.test.ts | 3 +- test/js/ruby/nodes/hashes.test.ts | 137 +---- test/js/ruby/nodes/heredocs.test.ts | 16 +- test/js/ruby/nodes/hooks.test.ts | 6 +- test/js/ruby/nodes/method.test.ts | 98 +--- test/js/ruby/nodes/patterns.test.ts | 2 +- test/js/ruby/nodes/strings.test.ts | 54 +- test/js/setupTests.ts | 7 +- test/rb/metadata_test.rb | 825 --------------------------- test/rb/parser_test.rb | 21 - test/rb/rbs_test.rb | 71 --- test/rb/test_helper.rb | 3 - 35 files changed, 138 insertions(+), 1627 deletions(-) delete mode 100644 src/prettier.ts delete mode 100644 src/types.ts delete mode 100644 test/js/ruby/embed.test.ts delete mode 100644 test/rb/metadata_test.rb delete mode 100644 test/rb/parser_test.rb delete mode 100644 test/rb/rbs_test.rb diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md index c1f2fbd7..6b958779 100644 --- a/.github/ISSUE_TEMPLATE/bug.md +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -9,13 +9,7 @@ about: Issues with prettier crashing - Ruby version: latest - Node version: latest - `@prettier/plugin-ruby` or `prettier` gem version: latest -- Options: - - `rubyArrayLiteral` - `true` - - `rubyHashLabel` - `true` - - `rubyModifier` - `true` - - `rubySingleQuote` - `true` - - `rubyToProc` - `false` - - `trailingComma` - `"none"` +- `syntax_tree` version: latest ## Input diff --git a/.github/ISSUE_TEMPLATE/formatting.md b/.github/ISSUE_TEMPLATE/formatting.md index e18e8565..45318417 100644 --- a/.github/ISSUE_TEMPLATE/formatting.md +++ b/.github/ISSUE_TEMPLATE/formatting.md @@ -9,13 +9,7 @@ about: Issues for ugly or incorrect code - Ruby version: latest - Node version: latest - `@prettier/plugin-ruby` or `prettier` gem version: latest -- Options: - - `rubyArrayLiteral` - `true` - - `rubyHashLabel` - `true` - - `rubyModifier` - `true` - - `rubySingleQuote` - `true` - - `rubyToProc` - `false` - - `trailingComma` - `"none"` +- `syntax_tree` version: latest ## Input diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f9fb05b4..fa400c7e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,9 +13,9 @@ jobs: - ubuntu-latest - windows-latest ruby: - - "2.6" - - "2.7" + - "2.7.5" - "3.0" + - "3.1" runs-on: ${{ matrix.platform }} env: PLUGIN_RUBY_CI: true @@ -73,7 +73,7 @@ jobs: - uses: ruby/setup-ruby@v1 with: bundler-cache: true - ruby-version: "3.0" + ruby-version: "3.1" - uses: actions/setup-node@v2 with: node-version: 12.x @@ -106,7 +106,7 @@ jobs: - uses: ruby/setup-ruby@v1 with: bundler-cache: true - ruby-version: "3.0" + ruby-version: "3.1" - uses: actions/setup-node@v2 with: node-version: 12.x diff --git a/.prettierignore b/.prettierignore index 577f115a..58c5e943 100644 --- a/.prettierignore +++ b/.prettierignore @@ -17,7 +17,3 @@ *.txt *.gem - -# I'm ignoring this for now because it's a dump of a bunch of types that I don't -# want running onto multiple lines at the moment. -/src/types diff --git a/Gemfile b/Gemfile index c2d85b51..96709a7f 100644 --- a/Gemfile +++ b/Gemfile @@ -1,11 +1,8 @@ # frozen_string_literal: true -source 'https://rubygems.org' +source "https://rubygems.org" gemspec -gem 'bundler', '~> 2.1' -gem 'haml', '~> 5.2' -gem 'minitest', '~> 5.14' -gem 'rake', '~> 13.0' -gem 'rbs', '~> 1.0' +gem "syntax_tree", path: "../../ruby-syntax-tree/syntax_tree" +gem "rbs", "~> 2" diff --git a/README.md b/README.md index b96517c2..18aaa392 100644 --- a/README.md +++ b/README.md @@ -132,27 +132,21 @@ Below are the options (from [`src/plugin.js`](src/plugin.js)) that `@prettier/pl | ------------------ | ---------------------- | :------: | ------------------------------------------------------------------------------------------------------------------------------------ | | `printWidth` | `--print-width` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)). | | `requirePragma` | `--require-pragma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#require-pragma)). | -| `rubyArrayLiteral` | `--ruby-array-literal` | `true` | When possible, favor the use of string and symbol array literals. | -| `rubyHashLabel` | `--ruby-hash-label` | `true` | When possible, uses the shortened hash key syntax, as opposed to hash rockets. | -| `rubyModifier` | `--ruby-modifier` | `true` | When it fits on one line, allows while and until statements to use the modifier form. | -| `rubySingleQuote` | `--ruby-single-quote` | `true` | When double quotes are not necessary for interpolation, prefers the use of single quotes for string literals. | -| `rubyToProc` | `--ruby-to-proc` | `false` | When possible, convert blocks to the more concise `Symbol#to_proc` syntax. | | `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). | -| `trailingComma` | `--trailing-comma` | `"none"` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#trailing-comma)). `"es5"` is equivalent to `true`. | Any of these can be added to your existing [prettier configuration file](https://prettier.io/docs/en/configuration.html). For example: ```json { - "rubySingleQuote": false + "tabWidth": 4 } ``` Or, they can be passed to `prettier` as arguments: ```bash -bundle exec rbprettier --ruby-single-quote false --write '**/*' +bundle exec rbprettier --tab-width 4 --write '**/*' ``` ### Usage with RuboCop diff --git a/bin/print.ts b/bin/print.ts index 2f5b3934..2ccc81bd 100755 --- a/bin/print.ts +++ b/bin/print.ts @@ -27,8 +27,7 @@ if (fs.existsSync(process.argv[contentIdx])) { const { formatted } = prettier.formatWithCursor(content, { parser, plugins: [plugin as any as string], // hacky, but it works - cursorOffset: 1, - rubySingleQuote: false + cursorOffset: 1 } as any); console.log(formatted); diff --git a/prettier.gemspec b/prettier.gemspec index 2d7da08e..bb3143a9 100644 --- a/prettier.gemspec +++ b/prettier.gemspec @@ -21,7 +21,17 @@ Gem::Specification.new do |spec| ] end + spec.required_ruby_version = '>= 2.7.3' + spec.bindir = 'exe' spec.executables = 'rbprettier' spec.require_paths = %w[lib] + + # spec.add_dependency 'syntax_tree' + spec.add_dependency 'syntax_tree-haml' + spec.add_dependency 'syntax_tree-rbs' + + spec.add_development_dependency 'bundler' + spec.add_development_dependency 'minitest' + spec.add_development_dependency 'rake' end diff --git a/rubocop.yml b/rubocop.yml index 4d960c32..db663ad0 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -13,7 +13,7 @@ Layout: Layout/LineLength: Enabled: true -Style/MultilineIfModifier: # rubyModifier +Style/MultilineIfModifier: Enabled: false # When method chains with multiple blocks are chained together, rubocop will let @@ -23,19 +23,19 @@ Style/MultilineIfModifier: # rubyModifier Style/MultilineBlockChain: Enabled: false -Style/SymbolArray: # rubyArrayLiteral +Style/SymbolArray: Enabled: false -Style/WordArray: # rubyArrayLiteral +Style/WordArray: Enabled: false -Style/TrailingCommaInArguments: # trailingComma +Style/TrailingCommaInArguments: Enabled: false -Style/TrailingCommaInArrayLiteral: # trailingComma +Style/TrailingCommaInArrayLiteral: Enabled: false -Style/TrailingCommaInHashLiteral: # trailingComma +Style/TrailingCommaInHashLiteral: Enabled: false # lambdas that are constructed with the lambda method call cannot be safely diff --git a/src/plugin.ts b/src/plugin.ts index 2e0c8dfd..14531719 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -161,52 +161,9 @@ const plugin: ExtendedPlugin = { } } }, - options: { - rubyArrayLiteral: { - type: "boolean", - category: "Ruby", - default: true, - description: - "When possible, favor the use of string and symbol array literals.", - since: "1.0.0" - }, - rubyHashLabel: { - type: "boolean", - category: "Ruby", - default: true, - description: - "When possible, uses the shortened hash key syntax, as opposed to hash rockets.", - since: "1.0.0" - }, - rubyModifier: { - type: "boolean", - category: "Ruby", - default: true, - description: - "When it fits on one line, allows if, unless, while, and until statements to use the modifier form.", - since: "1.0.0" - }, - rubySingleQuote: { - type: "boolean", - category: "Ruby", - default: true, - description: - "When double quotes are not necessary for interpolation, prefers the use of single quotes for string literals.", - since: "1.0.0" - }, - rubyToProc: { - type: "boolean", - category: "Ruby", - default: false, - description: - "When possible, convert blocks to the more concise Symbol#to_proc syntax.", - since: "1.0.0" - } - }, defaultOptions: { printWidth: 80, - tabWidth: 2, - trailingComma: "none" + tabWidth: 2 } }; diff --git a/src/prettier.ts b/src/prettier.ts deleted file mode 100644 index 4f4f5a82..00000000 --- a/src/prettier.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type * as Prettier from "prettier"; - -type Doc = Prettier.doc.builders.Doc; -type Builders = Omit & { - // Explicitly overwriting the type of the join builder because I don't want to - // have to go around saying "as Doc[]" everywhere. - join: (sep: Doc, docs: Doc | Doc[]) => Prettier.doc.builders.Concat; -}; - -// If `RBPRETTIER` is set, then this is being run from the `Prettier::run` ruby -// method. In that case, we need to pull `prettier` from the node_modules -// directly, as it's been shipped with the gem. -/* istanbul ignore next */ -// eslint-disable-next-line @typescript-eslint/no-var-requires -const source: typeof Prettier = require(process.env.RBPRETTIER - ? "../node_modules/prettier" - : "prettier"); - -// Cramming everything together to make it simpler to pull in all of the right -// utilities and builders. -const builders = source.doc.builders as Builders; -const exported = { ...builders, ...source.doc.utils, ...source.util }; - -export default exported; diff --git a/src/types.ts b/src/types.ts deleted file mode 100644 index 3e79eb3f..00000000 --- a/src/types.ts +++ /dev/null @@ -1,121 +0,0 @@ -import type * as Prettier from "prettier"; - -// The type of elements that make up the given array T. -export type ArrayElement = T extends (infer E)[] ? E : never; - -// A union of the properties of the given object that are arrays. -export type ArrayProperties = { [K in keyof T]: T[K] extends any[] ? K : never }[keyof T]; - -// A union of the properties of the given array T that can be used to index it. -// If the array is a tuple, then that's going to be the explicit indices of the -// array, otherwise it's going to just be number. -export type IndexProperties = IsTuple extends true ? Exclude["length"], T["length"]> : number; - -// Effectively performing T[P], except that it's telling TypeScript that it's -// safe to do this for tuples, arrays, or objects. -export type IndexValue = T extends any[] ? P extends number ? T[P] : never : P extends keyof T ? T[P] : never; - -// Determines if an object T is an array like string[] (in which case this -// evaluates to false) or a tuple like [string] (in which case this evaluates to -// true). -// eslint-disable-next-line @typescript-eslint/no-unused-vars -type IsTuple = T extends [] ? true : T extends [infer First, ...infer Remain] ? IsTuple : false; - -// The same object T as currently exists, except the keys provided by P are -// required instead of optional. -export type RequiredKeys = T & Required>; - -type CallProperties = T extends any[] ? IndexProperties : keyof T; -type IterProperties = T extends any[] ? IndexProperties : ArrayProperties; - -type CallCallback = (path: Path, index: number, value: any) => U; -type EachCallback = (path: Path>, index: number, value: any) => void; -type MapCallback = (path: Path>, index: number, value: any) => U; - -// This path interface is going to override a bunch of functions on the regular -// prettier AstPath interface. This is because we want stricter types than the -// current version of @types/prettier provides. -// -// For each of the tree walk functions (call, each, and map) this provides 5 -// strict type signatures, along with a fallback at the end if you end up -// calling more than 5 properties deep (we don't do that but I've included it -// for completeness). -// -// getParentNode is being overridden because previously it was restricted to the -// type T of the given AST, but it's very unlikely you're going to be receiving -// a parent node that exactly matches your current node. So for now just -// returning any. -interface StrictPath { - call(callback: CallCallback): U; - call>(callback: CallCallback, U>, prop1: P1): U; - call>(callback: CallCallback, P2>, U>, prop1: P1, prop2: P2): U; - call, P3 extends CallProperties>>(callback: CallCallback, P2>, P3>, U>, prop1: P1, prop2: P2, prop3: P3): U; - call, P3 extends CallProperties>, P4 extends CallProperties, P3>>>(callback: CallCallback, P2>, P3>, P4>, U>, prop1: P1, prop2: P2, prop3: P3, prop4: P4): U; - call(callback: CallCallback, prop1: P, prop2: P, prop3: P, prop4: P, ...props: P[]): U; - - each(callback: EachCallback): void; - each>(callback: EachCallback>, prop1: P1): void; - each>(callback: EachCallback, P2>>, prop1: P1, prop2: P2): void; - each, P3 extends IterProperties>>(callback: EachCallback, P2>, P3>>, prop1: P1, prop2: P2, prop3: P3): void; - each, P3 extends IterProperties>, P4 extends IterProperties, P3>>>(callback: EachCallback, P2>, P3>, P4>>, prop1: P1, prop2: P2, prop3: P3, prop4: P4): void; - each

(callback: EachCallback, prop1: P, prop2: P, prop3: P, prop4: P, ...props: P[]): void; - - getParentNode: (count?: number | undefined) => any | null, - - map(callback: MapCallback): U[]; - map>(callback: MapCallback, U>, prop1: P1): U[]; - map>(callback: MapCallback, P2>, U>, prop1: P1, prop2: P2): U[]; - map, P3 extends IterProperties>>(callback: MapCallback, P2>, P3>, U>, prop1: P1, prop2: P2, prop3: P3): U[]; - map, P3 extends IterProperties>, P4 extends IterProperties, P3>>>(callback: MapCallback, P2>, P3>, P4>, U>, prop1: P1, prop2: P2, prop3: P3, prop4: P4): U[]; - map(callback: MapCallback, prop1: P, prop2: P, prop3: P, prop4: P, ...props: P[]): U[]; -}; - -// Reexporting the Doc type mostly because it's annoying to have to reference -// type so deeply in the Prettier namespace. Also because we only really want to -// be pulling in types from this file as they're less likely to change. -export type Doc = Prettier.doc.builders.Doc; - -// This is the same embed as is present in prettier, except that it's required. -export type Embed = Required>["embed"]; - -// These are the regular options from prettier except they also include all of -// the options we defined in our plugin configuration. -export type Options = Prettier.ParserOptions & { - printer: RequiredKeys, - rubyArrayLiteral: boolean, - rubyHashLabel: boolean, - rubyModifier: boolean, - rubySingleQuote: boolean, - rubyToProc: boolean -}; - -// hasPragma was not required, but since we're testing it explicitly we're going -// to add that into the parser object as being required. Additionally we're -// going to change the signature of our parse function to accept our options as -// opposed to the generic options that don't contain the options we defined in -// our plugin configuration. -export type Parser = Omit, "hasPragma" | "parse"> & Required, "hasPragma">> & { - parse: (text: string, parsers: { [name: string]: Prettier.Parser }, options: Options) => any -}; - -// We're overwriting a bunch of function here that walk around the tree here -// because if you restrict the AST for the main path then presumably you're -// printing a lower node in the tree that won't match the current AST type. -export type Path = Omit, keyof StrictPath> & StrictPath; - -// The printer from prettier is missing a couple of keys. We should presumably -// upstream this so that it's accurate in all plugins. -export type PrinterConfig = Omit, "insertPragma" | "print"> & Required, "insertPragma">> & { - getCommentChildNodes?: (node: any) => any[], - isBlockComment?: (comment: any, options: Options) => boolean, - print: Printer -}; - -// This is the regular print node, except it's not restricted by the AST that -// is passed to the parent AST. That's because when you're using it, you are not -// typically printing the same node type again. -export type Print = (path: Path) => Doc; - -// This is the regular printer, except it uses our overridden options and print -// types. -export type Printer = (path: Path, options: Options, print: Print) => Doc; diff --git a/test/js/haml/tag.test.ts b/test/js/haml/tag.test.ts index e69b5514..59749792 100644 --- a/test/js/haml/tag.test.ts +++ b/test/js/haml/tag.test.ts @@ -71,7 +71,7 @@ describe("tag", () => { const content = haml(`%section(xml:lang="en" title="title")`); const expected = `%section{"xml:lang": "en", title: "title"}`; - expect(content).toChangeFormat(expected, { rubySingleQuote: false }); + expect(content).toChangeFormat(expected); }); test("hash label, single quote, interpolation", () => { diff --git a/test/js/rbs/rbs.test.ts b/test/js/rbs/rbs.test.ts index 9b174aa3..d1a8918c 100644 --- a/test/js/rbs/rbs.test.ts +++ b/test/js/rbs/rbs.test.ts @@ -227,9 +227,7 @@ describe("rbs", () => { }); test("changes quotes to match", () => { - expect(rbs("T: 'foo'")).toChangeFormat(`T: "foo"`, { - rubySingleQuote: false - }); + expect(rbs("T: 'foo'")).toChangeFormat(`T: "foo"`); }); test("keeps string the same when there is an escape sequence", () => { @@ -241,9 +239,7 @@ describe("rbs", () => { }); test("unescapes single quotes when using double quotes", () => { - expect(rbs(`T: 'super \\' duper'`)).toChangeFormat(`T: 'super \\' duper'`, { - rubySingleQuote: false - }); + expect(rbs(`T: 'super \\' duper'`)).toChangeFormat(`T: 'super \\' duper'`); }); test("maintains escape sequences when using double quotes", () => { diff --git a/test/js/ruby/comments.test.ts b/test/js/ruby/comments.test.ts index 5c34fbf1..fda5b8e6 100644 --- a/test/js/ruby/comments.test.ts +++ b/test/js/ruby/comments.test.ts @@ -156,11 +156,11 @@ describe("comments", () => { }); test("commands", () => { - expect("command 'foo' # this is an inline comment").toMatchFormat(); + expect(`command "foo" # this is an inline comment`).toMatchFormat(); }); test("command calls", () => { - expect("command.call 'foo' # this is an inline comment").toMatchFormat(); + expect(`command.call "foo" # this is an inline comment`).toMatchFormat(); }); }); @@ -186,9 +186,9 @@ describe("comments", () => { { # these are comments # inside of a hash - foo: 'bar', + foo: "bar", # and then some more - bar: 'baz' + bar: "baz" } `); @@ -244,8 +244,8 @@ describe("comments", () => { test("works with multi-byte characters", () => { const content = ruby(` [ - ['先生小'], # - ['小'] + ["先生小"], # + ["小"] ] `); diff --git a/test/js/ruby/embed.test.ts b/test/js/ruby/embed.test.ts deleted file mode 100644 index beeca9ac..00000000 --- a/test/js/ruby/embed.test.ts +++ /dev/null @@ -1,144 +0,0 @@ -import { ruby } from "../utils"; - -describe("embed", () => { - test("ignores parsers it can't find", () => { - const content = ruby(` - <<-JAVA - int i=0; - JAVA - `); - - expect(content).toMatchFormat(); - }); - - test("formats correctly on straight heredocs", () => { - const content = ruby(` - <<-JS.squish - const a=1; - const b=2; - return a+b; - JS - `); - - const expected = ruby(` - <<-JS.squish - const a = 1; - const b = 2; - return a + b; - JS - `); - - expect(content).toChangeFormat(expected); - }); - - test("formats correctly on squiggly heredocs", () => { - const content = ruby(` - <<~JS.squish - const a=1; - const b=2; - return a+b; - JS - `); - - const expected = ruby(` - <<~JS.squish - const a = 1; - const b = 2; - return a + b; - JS - `); - - expect(content).toChangeFormat(expected); - }); - - test("does not format if the heredoc has an interpolation", () => { - const content = ruby(` - <<~JS.squish - const a=1; - const b=#{2}; - return a+b; - JS - `); - - expect(content).toMatchFormat(); - }); - - test("removes whitespace so embedded parsers don't misinterpret", () => { - const content = ruby(` - <<~MARKDOWN - foo - MARKDOWN - `); - - const expected = ruby(` - <<~MARKDOWN - foo - MARKDOWN - `); - - expect(content).toChangeFormat(expected); - }); - - test("keeps parent indentation", () => { - const content = ruby(` - some_block do - another_block do - x += 1 - description <<~JS - // This is a DSL method on the another_block inner block. - // This is another line of the string. - JS - end - end - `); - - expect(content).toMatchFormat(); - }); - - test("correctly indents nested code while keeping parent indentation", () => { - const content = ruby(` - some_block do - another_block do - x += 1 - description <<~JS - [1, function () { return 2; }, 3]; - JS - end - end - `); - - const expected = ruby(` - some_block do - another_block do - x += 1 - description <<~JS - [ - 1, - function () { - return 2; - }, - 3 - ]; - JS - end - end - `); - - expect(content).toChangeFormat(expected); - }); - - test("doesn't consider empty lines as part of the common leading whitespace", () => { - const content = ruby(` - some_block do - x += 1 - description <<~MARKDOWN - This is a line. It's followed by two literal line breaks. - - This is another line of the string. - MARKDOWN - end - `); - - expect(content).toMatchFormat(); - }); -}); diff --git a/test/js/ruby/encoding.test.ts b/test/js/ruby/encoding.test.ts index 39693dbe..e097d79a 100644 --- a/test/js/ruby/encoding.test.ts +++ b/test/js/ruby/encoding.test.ts @@ -10,7 +10,7 @@ describe("encoding", () => { }); test("string literals", () => { - expect(`${header}\n'ひらがな'`).toMatchFormat(); + expect(`${header}\n"ひらがな"`).toMatchFormat(); }); test("regexp literals", () => { diff --git a/test/js/ruby/nodes/alias.test.ts b/test/js/ruby/nodes/alias.test.ts index f1f67398..f36dc0fd 100644 --- a/test/js/ruby/nodes/alias.test.ts +++ b/test/js/ruby/nodes/alias.test.ts @@ -22,11 +22,11 @@ describe("alias", () => { }); test("dynamic symbols do not get transformed (left)", () => { - expect("alias :'foo' :bar").toChangeFormat("alias :'foo' bar"); + expect(`alias :"foo" :bar`).toChangeFormat(`alias :"foo" bar`); }); test("dynamic symbols do not get transformed (right)", () => { - expect("alias :foo :'bar'").toChangeFormat("alias foo :'bar'"); + expect(`alias :foo :"bar"`).toChangeFormat(`alias foo :"bar"`); }); test("global aliases", () => { diff --git a/test/js/ruby/nodes/arrays.test.ts b/test/js/ruby/nodes/arrays.test.ts index 1bd4311b..2e027e5b 100644 --- a/test/js/ruby/nodes/arrays.test.ts +++ b/test/js/ruby/nodes/arrays.test.ts @@ -10,7 +10,7 @@ describe("array", () => { }); test("does not transform single string arrays", () => { - expect("['a']").toMatchFormat(); + expect(`["a"]`).toMatchFormat(); }); test("does not transform single symbol arrays", () => { @@ -18,43 +18,35 @@ describe("array", () => { }); test("transforms basic string arrays", () => { - expect("['a', 'b', 'c', 'd', 'e']").toChangeFormat("%w[a b c d e]"); + expect(`["a", "b", "c", "d", "e"]`).toChangeFormat("%w[a b c d e]"); }); test("does not transform string arrays with interpolation", () => { - expect(`['a', "#{b}", 'c']`).toMatchFormat(); + expect(`["a", "#{b}", "c"]`).toMatchFormat(); }); test("does not transform string arrays with spaces", () => { - expect("['a', 'b c', 'd', 'e']").toMatchFormat(); + expect(`["a", "b c", "d", "e"]`).toMatchFormat(); }); test("does not transform string arrays with tabs", () => { - expect(`['a', "b\\tc", 'd', 'e']`).toMatchFormat(); + expect(`["a", "b\\tc", "d", "e"]`).toMatchFormat(); }); test("does not transform string arrays with newlines", () => { - expect(`['a', "b\\nc", 'd', 'e']`).toMatchFormat(); + expect(`["a", "b\\nc", "d", "e"]`).toMatchFormat(); }); test("does not transform string arrays with carriage returns", () => { - expect(`['a', "b\\rc", 'd', 'e']`).toMatchFormat(); + expect(`["a", "b\\rc", "d", "e"]`).toMatchFormat(); }); test("does not transform string arrays with interpolation", () => { - expect(`['a', "b#{c}d", 'e']`).toMatchFormat(); + expect(`["a", "b#{c}d", "e"]`).toMatchFormat(); }); test("does not transform string arrays with brackets", () => { - expect(`['a [] b', 'c [] d']`).toMatchFormat(); - }); - - test("does not transform string arrays if disabled", () => { - expect(`['a', 'b']`).toMatchFormat({ rubyArrayLiteral: false }); - }); - - test("does not transform symbol arrays if disabled", () => { - expect("[:a, :b]").toMatchFormat({ rubyArrayLiteral: false }); + expect(`["a [] b", "c [] d"]`).toMatchFormat(); }); test("transforms basic symbol arrays", () => { @@ -62,7 +54,7 @@ describe("array", () => { }); test("does not transform symbol arrays with dynamic symbols", () => { - expect("[:'a + b']").toMatchFormat(); + expect(`[:"a + b"]`).toMatchFormat(); }); test("handles splats", () => { @@ -85,13 +77,6 @@ describe("array", () => { expect(contents).toMatchFormat(); }); - test("adds trailing commas when requested", () => { - const before = `[${long}, ${long}, ${long}]`; - const after = `[\n ${long},\n ${long},\n ${long},\n]`; - - expect(before).toChangeFormat(after, { trailingComma: "all" }); - }); - test("breaking maintains calls on the end", () => { expect(`[${long}].freeze`).toChangeFormat(`[\n ${long}\n].freeze`); }); @@ -126,19 +111,6 @@ describe("array", () => { expect(content).toMatchFormat(); }); - - test("with trailing commas", () => { - const content = ruby(` - [ - ${long}, - <<~HERE, - this is the heredoc - HERE - ] - `); - - expect(content).toMatchFormat({ trailingComma: "all" }); - }); }); test("with leading comments but none in body", () => { diff --git a/test/js/ruby/nodes/assign.test.ts b/test/js/ruby/nodes/assign.test.ts index 195b7f95..f68d801b 100644 --- a/test/js/ruby/nodes/assign.test.ts +++ b/test/js/ruby/nodes/assign.test.ts @@ -137,11 +137,11 @@ describe("assign", () => { describe("constants", () => { test("assigning to constant", () => { - expect("Pret::TIER = 'config'").toMatchFormat(); + expect(`Pret::TIER = "config"`).toMatchFormat(); }); test("assigning to top level constants", () => { - expect("::PRETTIER = 'config'").toMatchFormat(); + expect(`::PRETTIER = "config"`).toMatchFormat(); }); }); }); diff --git a/test/js/ruby/nodes/blocks.test.ts b/test/js/ruby/nodes/blocks.test.ts index de1173fd..c831e507 100644 --- a/test/js/ruby/nodes/blocks.test.ts +++ b/test/js/ruby/nodes/blocks.test.ts @@ -26,19 +26,19 @@ describe("blocks", () => { }); test("multi-line on command, no body", () => { - expect("command 'foobar' do\nend").toMatchFormat(); + expect(`command "foobar" do\nend`).toMatchFormat(); }); test("multi-line on command call, no body", () => { - expect("command.call 'foobar' do\nend").toMatchFormat(); + expect(`command.call "foobar" do\nend`).toMatchFormat(); }); test("multi-line on command, with body", () => { - expect("command 'foobar' do\n foo\nend").toMatchFormat(); + expect(`command "foobar" do\n foo\nend`).toMatchFormat(); }); test("multi-line on command call, with body", () => { - expect("command.call 'foobar' do\n foo\nend").toMatchFormat(); + expect(`command.call "foobar" do\n foo\nend`).toMatchFormat(); }); test("blocks nested inside commands use braces", () => { @@ -124,7 +124,7 @@ describe("blocks", () => { ruby(` assert_nil( ( - 'a'.sub! 'b' do + "a".sub! "b" do end&.foo do end ) diff --git a/test/js/ruby/nodes/calls.test.ts b/test/js/ruby/nodes/calls.test.ts index 33c936ca..9823efd5 100644 --- a/test/js/ruby/nodes/calls.test.ts +++ b/test/js/ruby/nodes/calls.test.ts @@ -2,7 +2,7 @@ import { long, ruby } from "../../utils"; describe("calls", () => { test("simple calls", () => { - const content = "posts.active.where('created_at > ?', 1.year.ago)"; + const content = `posts.active.where("created_at > ?", 1.year.ago)`; expect(content).toMatchFormat(); }); @@ -33,8 +33,8 @@ describe("calls", () => { test("chains of methods with one with arguments right at the top", () => { const content = ruby(` aaa.bbb.ccc.ddd.eee.merge( - ${long.slice(0, 30)}: 'aaa', - ${long.slice(0, 31)}: 'bbb' + ${long.slice(0, 30)}: "aaa", + ${long.slice(0, 31)}: "bbb" ) `); @@ -62,9 +62,9 @@ describe("calls", () => { const content = ruby(` Customer .active - .where(foo: 'bar') + .where(foo: "bar") .where.not(banned_at: nil) - .order(created_at: 'desc') + .order(created_at: "desc") .limit(10) `); @@ -125,7 +125,7 @@ describe("calls", () => { }); test("bang with a special operator on a command_call", () => { - expect("!domain&.include? '@'").toMatchFormat(); + expect(`!domain&.include? "@"`).toMatchFormat(); }); test("#call shorthand does not eliminate empty parentheses", () => { @@ -194,7 +194,7 @@ describe("calls", () => { # then remove remaining rows with duplicate emails uniq { |contact| contact[:email] } .tap do |res| - CSV.open(OUTPUT_PATH, 'wb') do |csv| + CSV.open(OUTPUT_PATH, "wb") do |csv| csv << HEADERS res.each { |d| csv << d.values } end diff --git a/test/js/ruby/nodes/case.test.ts b/test/js/ruby/nodes/case.test.ts index f9d4e71f..b5904a8d 100644 --- a/test/js/ruby/nodes/case.test.ts +++ b/test/js/ruby/nodes/case.test.ts @@ -37,9 +37,9 @@ describe("case", () => { test("breaking with multiple predicates, one when", () => { const content = ruby(` case foo - when '${long}', - 'a${long}', - 'b${long}' + when "${long}", + "a${long}", + "b${long}" bar end `); @@ -50,15 +50,15 @@ describe("case", () => { test("breaking with multiple predicates, each one not too long", () => { const content = ruby(` case foo - when '${long.slice(0, 40)}', '${long.slice(0, 40)}' + when "${long.slice(0, 40)}", "${long.slice(0, 40)}" bar end `); const expected = ruby(` case foo - when '${long.slice(0, 40)}', - '${long.slice(0, 40)}' + when "${long.slice(0, 40)}", + "${long.slice(0, 40)}" bar end `); diff --git a/test/js/ruby/nodes/class.test.ts b/test/js/ruby/nodes/class.test.ts index a69c4d6e..c6f31faa 100644 --- a/test/js/ruby/nodes/class.test.ts +++ b/test/js/ruby/nodes/class.test.ts @@ -39,7 +39,8 @@ describe("class", () => { test("class push blocks", () => { const content = ruby(` class << Prettier - def foo; end + def foo + end end `); diff --git a/test/js/ruby/nodes/hashes.test.ts b/test/js/ruby/nodes/hashes.test.ts index d32ab7ae..bf131ff3 100644 --- a/test/js/ruby/nodes/hashes.test.ts +++ b/test/js/ruby/nodes/hashes.test.ts @@ -37,18 +37,10 @@ describe("hash", () => { ); }); - test("breaking with trailing commas", () => { - const expected = `{\n ${long}:\n ${long},\n}`; - - expect(`{ ${long}: ${long} }`).toChangeFormat(expected, { - trailingComma: "all" - }); - }); - describe("heredocs as values", () => { test("as the first value", () => { const content = ruby(` - { foo: <<~HERE, bar: 'bar' } + { foo: <<~HERE, bar: "bar" } this is the heredoc HERE `); @@ -58,7 +50,7 @@ describe("hash", () => { test("as the last value", () => { const content = ruby(` - { foo: 'foo', bar: <<~HERE } + { foo: "foo", bar: <<~HERE } this is the heredoc HERE `); @@ -66,23 +58,9 @@ describe("hash", () => { expect(content).toMatchFormat(); }); - test("with trailing commas", () => { - const content = ruby(` - { - foo: - ${long}, - bar: <<~HERE, - this is the heredoc - HERE - } - `); - - expect(content).toMatchFormat({ trailingComma: "all" }); - }); - test("when exceeding line length", () => { const content = ruby(` - { foo: '${long}', bar: <<~HERE } + { foo: "${long}", bar: <<~HERE } this is the heredoc HERE `); @@ -90,7 +68,7 @@ describe("hash", () => { const expected = ruby(` { foo: - '${long}', + "${long}", bar: <<~HERE this is the heredoc HERE @@ -103,20 +81,12 @@ describe("hash", () => { describe("dynamic string keys", () => { test("basic", () => { - expect(`{ 'foo': 'bar' }`).toMatchFormat(); + expect(`{ "foo": "bar" }`).toMatchFormat(); }); test("with interpolation", () => { expect(`{ "#{1 + 1}": 2 }`).toMatchFormat(); }); - - test("basic without hash labels", () => { - expect(`{ :'foo' => 'bar' }`).toMatchFormat({ rubyHashLabel: false }); - }); - - test("with interpolation without hash labels", () => { - expect(`{ :"#{1 + 1}" => 2 }`).toMatchFormat({ rubyHashLabel: false }); - }); }); describe("bare assoc hash", () => { @@ -132,44 +102,6 @@ describe("hash", () => { expect("foobar(alpha: alpha, beta: beta)").toMatchFormat(); }); - test("does not add trailing commas on breaking commands", () => { - expect(`foobar ${long}: ${long}, a${long}: a${long}`).toChangeFormat( - ruby(` - foobar ${long}: - ${long}, - a${long}: - a${long} - `), - { trailingComma: "all" } - ); - }); - - test("does not add trailing commas on breaking command calls", () => { - expect(`foo.bar ${long}: ${long}, a${long}: a${long}`).toChangeFormat( - ruby(` - foo.bar ${long}: - ${long}, - a${long}: - a${long} - `), - { trailingComma: "all" } - ); - }); - - test("does add trailing commas on breaking calls", () => { - expect(`foobar(${long}: ${long}, a${long}: a${long})`).toChangeFormat( - ruby(` - foobar( - ${long}: - ${long}, - a${long}: - a${long}, - ) - `), - { trailingComma: "all" } - ); - }); - test("breaks contents and parens together", () => { const content = ruby(` foobar(key1: ${long.slice(0, 32)}, key2: ${long.slice(0, 32)}) @@ -188,12 +120,12 @@ describe("hash", () => { describe("when hash labels allowed", () => { test("hash labels stay", () => { - expect("{ a: 'a', b: 'b', c: 'c' }").toMatchFormat(); + expect(`{ a: "a", b: "b", c: "c" }`).toMatchFormat(); }); test("hash rockets get replaced", () => { - expect("{ :a => 'a', :b => 'b', :c => 'c' }").toChangeFormat( - "{ a: 'a', b: 'b', c: 'c' }" + expect(`{ :a => "a", :b => "b", :c => "c" }`).toChangeFormat( + `{ a: "a", b: "b", c: "c" }` ); }); @@ -202,61 +134,20 @@ describe("hash", () => { }); test("ending in equals stays", () => { - expect("{ :foo= => 'bar' }").toMatchFormat(); + expect(`{ :foo= => "bar" }`).toMatchFormat(); }); test("starting with non-letter/non-underscore stays", () => { - expect("{ :@foo => 'bar' }").toMatchFormat(); + expect(`{ :@foo => "bar" }`).toMatchFormat(); }); test("starting with underscore converts", () => { - expect("{ :_foo => 'bar' }").toChangeFormat("{ _foo: 'bar' }"); - }); - }); - - describe("when hash labels disallowed", () => { - test("hash labels get replaced", () => { - expect("{ a: 'a', b: 'b', c: 'c' }").toChangeFormat( - "{ :a => 'a', :b => 'b', :c => 'c' }", - { - rubyHashLabel: false - } - ); - }); - - test("hash rockets stay", () => { - expect("{ :a => 'a', :b => 'b', :c => 'c' }").toMatchFormat({ - rubyHashLabel: false - }); - }); - - test("hash rockets stay when needed", () => { - expect("{ Foo => 1, Bar => 2 }").toMatchFormat({ - rubyHashLabel: false - }); - }); - - test("ending in equals stays", () => { - expect("{ :foo= => 'bar' }").toMatchFormat({ - rubyHashLabel: false - }); - }); - - test("starting with non-letter/non-underscore stays", () => { - expect("{ :@foo => 'bar' }").toMatchFormat({ - rubyHashLabel: false - }); - }); - - test("starting with underscore stays", () => { - expect("{ :_foo => 'bar' }").toMatchFormat({ - rubyHashLabel: false - }); + expect(`{ :_foo => "bar" }`).toChangeFormat(`{ _foo: "bar" }`); }); }); test("prints hashes with consistent keys", () => { - expect("{ a: 'a', b => 'b' }").toChangeFormat("{ :a => 'a', b => 'b' }"); + expect(`{ a: "a", b => "b" }`).toChangeFormat(`{ :a => "a", b => "b" }`); }); test("print hashes with correct braces when contents fits", () => { @@ -306,14 +197,14 @@ describe("hash", () => { test("splits if the key has a comment attached", () => { const content = ruby(` items = { - :'foo-bar'=> # Inline comment + :"foo-bar"=> # Inline comment baz, } `); const expected = ruby(` items = { - 'foo-bar': # Inline comment + "foo-bar": # Inline comment baz } `); diff --git a/test/js/ruby/nodes/heredocs.test.ts b/test/js/ruby/nodes/heredocs.test.ts index 668fb7f1..0300d361 100644 --- a/test/js/ruby/nodes/heredocs.test.ts +++ b/test/js/ruby/nodes/heredocs.test.ts @@ -240,7 +240,7 @@ describe("heredocs", () => { foo FOO ${long}: - 'bar' + "bar" ) `); @@ -256,7 +256,7 @@ describe("heredocs", () => { `); const expected = ruby(` - puts(<<~TEXT) { 'sample block' } + puts(<<~TEXT) { "sample block" } Hello TEXT `); @@ -279,7 +279,7 @@ describe("heredocs", () => { const expected = ruby(` scope :late_for_checkin, - -> { select(<<~EOS.squish).data_push.having('something') } + -> { select(<<~EOS.squish).data_push.having("something") } some complicated query here EOS `); @@ -308,7 +308,7 @@ describe("heredocs", () => { test("call w/ short breakable arg after heredoc literal", () => { const content = ruby(` - p(<<-BAR, ['value', 'value', 125_484, 0o24024103]) + p(<<-BAR, ["value", "value", 125_484, 0o24024103]) text BAR `); @@ -321,12 +321,12 @@ describe("heredocs", () => { call(1, 2, 3, <<-HERE) do foo HERE - puts 'more code' + puts "more code" end `); const expected = ruby(` - call(1, 2, 3, <<-HERE) { puts 'more code' } + call(1, 2, 3, <<-HERE) { puts "more code" } foo HERE `); @@ -346,7 +346,7 @@ describe("heredocs", () => { test("in parens args with trailing args after", () => { const content = ruby(` - Foo.new(<<-ARG1, 'test2') + Foo.new(<<-ARG1, "test2") test1 line 1 test1 line 2 ARG1 @@ -357,7 +357,7 @@ describe("heredocs", () => { test("in paren args with a call", () => { const content = ruby(` - Foo.new(<<~ARG1.upcase.chomp, 'test2') + Foo.new(<<~ARG1.upcase.chomp, "test2") test1 line 1 test1 line 2 ARG1 diff --git a/test/js/ruby/nodes/hooks.test.ts b/test/js/ruby/nodes/hooks.test.ts index 39987281..a35660d5 100644 --- a/test/js/ruby/nodes/hooks.test.ts +++ b/test/js/ruby/nodes/hooks.test.ts @@ -2,11 +2,11 @@ import { long, ruby } from "../../utils"; describe.each(["BEGIN", "END"])("%s hook", (hook) => { test("shortens to one line", () => { - expect(`${hook} {\n p 'hook'\n}`).toChangeFormat(`${hook} { p 'hook' }`); + expect(`${hook} {\n p "hook"\n}`).toChangeFormat(`${hook} { p "hook" }`); }); test("maintains single lines", () => { - expect(`${hook} { p 'hook' }`).toMatchFormat(); + expect(`${hook} { p "hook" }`).toMatchFormat(); }); test("maintains multi line", () => { @@ -20,7 +20,7 @@ describe.each(["BEGIN", "END"])("%s hook", (hook) => { test("does not move comments on the declaration", () => { const content = ruby(` ${hook} { # comment - p 'hook' + p "hook" } `); diff --git a/test/js/ruby/nodes/method.test.ts b/test/js/ruby/nodes/method.test.ts index 15b63195..397f38c9 100644 --- a/test/js/ruby/nodes/method.test.ts +++ b/test/js/ruby/nodes/method.test.ts @@ -3,35 +3,35 @@ import { atLeastVersion, long, ruby } from "../../utils"; describe("method", () => { describe("definitions", () => { test("shorthand for empty methods", () => { - expect("def foo; end").toMatchFormat(); + expect("def foo; end").toChangeFormat("def foo\nend"); }); test("shorthand for empty methods with parens", () => { - expect("def foo(); end").toMatchFormat(); + expect("def foo(); end").toChangeFormat("def foo()\nend"); }); test("single arg, no parens", () => { - expect("def foo bar\nend").toChangeFormat("def foo(bar); end"); + expect("def foo bar\nend").toChangeFormat("def foo(bar)\nend"); }); test("single arg, with parens", () => { - expect("def foo(bar)\nend").toChangeFormat("def foo(bar); end"); + expect("def foo(bar)\nend").toMatchFormat(); }); test("shorthand for empty singleton methods", () => { - expect("def self.foo; end").toMatchFormat(); + expect("def self.foo; end").toChangeFormat("def self.foo\nend"); }); test("shorthand for empty singleton methods with parens", () => { - expect("def self.foo(); end").toMatchFormat(); + expect("def self.foo(); end").toChangeFormat("def self.foo()\nend"); }); test("singleton, single arg, no parens", () => { - expect("def self.foo bar\nend").toChangeFormat("def self.foo(bar); end"); + expect("def self.foo bar\nend").toChangeFormat("def self.foo(bar)\nend"); }); test("singleton, single arg, with parens", () => { - expect("def self.foo(bar)\nend").toChangeFormat("def self.foo(bar); end"); + expect("def self.foo(bar)\nend").toMatchFormat(); }); test("shorthand with a body", () => { @@ -41,17 +41,17 @@ describe("method", () => { }); test("single splat arg with no name", () => { - expect("def foo(*); end").toMatchFormat(); + expect("def foo(*); end").toChangeFormat("def foo(*)\nend"); }); test("double splat arg with no name", () => { - expect("def foo(**); end").toMatchFormat(); + expect("def foo(**); end").toChangeFormat("def foo(**)\nend"); }); test("with helper method", () => { const content = ruby(` private def foo - 'bar' + "bar" end `); @@ -61,7 +61,7 @@ describe("method", () => { test("with helper method on defs", () => { const content = ruby(` private def self.foo - 'bar' + "bar" end `); @@ -71,7 +71,7 @@ describe("method", () => { test("every single arg type", () => { const content = ruby(` def method(req, *rest, post, kwarg:, kwarg_opt: 1, **kwarg_rest, &block) - 'foo' + "foo" end `); @@ -84,7 +84,8 @@ describe("method", () => { def foo( ${long}:, a${long}: - ); end + ) + end `); expect(content).toChangeFormat(expected); @@ -113,7 +114,7 @@ describe("method", () => { **kwarg_rest, # kwarg_rest comment &block # block comment ) - 'foo' + "foo" end `); @@ -123,9 +124,9 @@ describe("method", () => { test("with comments on optional params", () => { const content = ruby(` def method( - optl = 'value' # comment + optl = "value" # comment ) - 'foo' + "foo" end `); @@ -134,7 +135,7 @@ describe("method", () => { if (atLeastVersion("2.7")) { test("nokw_param", () => { - expect("def foo(**nil); end").toMatchFormat(); + expect("def foo(**nil); end").toChangeFormat("def foo(**nil)\nend"); }); test("args_forward", () => { @@ -390,67 +391,6 @@ describe("method", () => { ); }); }); - - describe("with trailing commas", () => { - test("starting with no trailing comma changes", () => { - expect(`foo(${long}, a${long})`).toChangeFormat( - `foo(\n ${long},\n a${long},\n)`, - { - trailingComma: "all" - } - ); - }); - - test("starting with trailing comma stays", () => { - expect(`foo(${long}, a${long},)`).toChangeFormat( - `foo(\n ${long},\n a${long},\n)`, - { - trailingComma: "all" - } - ); - }); - - test("with block on the end", () => { - expect(`foo(${long}, &block)`).toChangeFormat( - `foo(\n ${long},\n &block\n)`, - { - trailingComma: "all" - } - ); - }); - - test("on commands", () => { - expect(`command ${long}, a${long}`).toChangeFormat( - ruby(` - command ${long}, - a${long} - `), - { trailingComma: "all" } - ); - }); - - test("on command calls", () => { - expect(`command.call ${long}, a${long}`).toChangeFormat( - ruby(` - command.call ${long}, - a${long} - `), - { trailingComma: "all" } - ); - }); - - test("on long commands within an arg_paren", () => { - const expected = ruby(` - foo( - ${long} 'bar' - ) - `); - - expect(`foo(${long} 'bar')`).toChangeFormat(expected, { - trailingComma: "all" - }); - }); - }); }); }); }); diff --git a/test/js/ruby/nodes/patterns.test.ts b/test/js/ruby/nodes/patterns.test.ts index 136def0d..dbb49b79 100644 --- a/test/js/ruby/nodes/patterns.test.ts +++ b/test/js/ruby/nodes/patterns.test.ts @@ -33,7 +33,7 @@ describe("patterns", () => { cases.push("[*, 0, *]", "[*, 0, 1, 2, *]", "FooBar[*, 0, *]"); test("rassign", () => { - const content = "{ db: { user: 'John' } } => { db: { user: } }"; + const content = `{ db: { user: "John" } } => { db: { user: } }`; expect(content).toMatchFormat(); }); diff --git a/test/js/ruby/nodes/strings.test.ts b/test/js/ruby/nodes/strings.test.ts index c7fee41a..c0167972 100644 --- a/test/js/ruby/nodes/strings.test.ts +++ b/test/js/ruby/nodes/strings.test.ts @@ -25,19 +25,19 @@ describe("strings", () => { describe("with single quotes", () => { test("empty single quote strings stay", () => { - expect("''").toMatchFormat(); + expect("''").toChangeFormat(`""`); }); test("empty double quote strings change", () => { - expect(`""`).toChangeFormat("''"); + expect(`""`).toMatchFormat(); }); test("basic strings with single quotes stay", () => { - expect("'abc'").toMatchFormat(); + expect("'abc'").toChangeFormat(`"abc"`); }); test("basic strings with double quotes change", () => { - expect(`"abc"`).toChangeFormat("'abc'"); + expect(`"abc"`).toMatchFormat(); }); test("double quotes with inner single quotes stay", () => { @@ -69,29 +69,27 @@ describe("strings", () => { describe("with double quotes", () => { test("empty single quote strings change", () => { - expect("''").toChangeFormat(`""`, { rubySingleQuote: false }); + expect("''").toChangeFormat(`""`); }); test("empty double quote strings stay", () => { - expect(`""`).toMatchFormat({ rubySingleQuote: false }); + expect(`""`).toMatchFormat(); }); test("basic strings with single quotes change", () => { - expect("'abc'").toChangeFormat(`"abc"`, { rubySingleQuote: false }); + expect("'abc'").toChangeFormat(`"abc"`); }); test("basic strings with double quotes stay", () => { - expect(`"abc"`).toMatchFormat({ rubySingleQuote: false }); + expect(`"abc"`).toMatchFormat(); }); test("double quotes with inner single quotes stay", () => { - expect(`"abc's"`).toMatchFormat({ rubySingleQuote: false }); + expect(`"abc's"`).toMatchFormat(); }); test("double quotes get escaped", () => { - expect(`'"foo"'`).toChangeFormat(`"\\"foo\\""`, { - rubySingleQuote: false - }); + expect(`'"foo"'`).toChangeFormat(`"\\"foo\\""`); }); describe("escape sequences", () => { @@ -165,11 +163,11 @@ describe("strings", () => { describe("char literals", () => { test("single chars get changed", () => { - expect("?a").toChangeFormat("'a'"); + expect("?a").toChangeFormat(`"a"`); }); test("single chars get changed with double quotes", () => { - expect("?a").toChangeFormat(`"a"`, { rubySingleQuote: false }); + expect("?a").toChangeFormat(`"a"`); }); test("control escape sequences stay", () => { @@ -217,45 +215,31 @@ describe("strings", () => { }); test("with single quotes", () => { - expect(":'abc'").toMatchFormat(); + expect(":'abc'").toChangeFormat(`:"abc"`); }); test("with double quotes", () => { - expect(`:"abc"`).toChangeFormat(":'abc'"); + expect(`:"abc"`).toMatchFormat(); }); test("with double quotes with double quotes desired", () => { - expect(`:"abc"`).toMatchFormat({ rubySingleQuote: false }); - }); - - test("with false interpolation and single quotes, no rubySingleQuote", () => { - expect(":'abc#{foo}abc'").toMatchFormat({ rubySingleQuote: false }); + expect(`:"abc"`).toMatchFormat(); }); test("with real interpolation and double quotes", () => { expect(`:"abc#{foo}abc"`).toMatchFormat(); }); - test("with real interpolation and double quotes, rubySingleQuote", () => { - expect(`:"abc#{foo}abc"`).toMatchFormat({ rubySingleQuote: true }); - }); - test("%s literal", () => { - expect("%s[abc]").toChangeFormat(":'abc'"); + expect("%s[abc]").toChangeFormat(`:"abc"`); }); test("%s literal with false interpolation", () => { - expect("%s[abc#{d}]").toChangeFormat(":'abc#{d}'"); + expect("%s[abc#{d}]").toChangeFormat(`:"abc#{d}"`); }); test("%s literal as hash key", () => { - expect("{ %s[abc] => d }").toChangeFormat("{ 'abc': d }"); - }); - - test("%s literal as hash key, no rubySingleQuote", () => { - expect("{ %s[abc] => d }").toChangeFormat(`{ "abc": d }`, { - rubySingleQuote: false - }); + expect("{ %s[abc] => d }").toChangeFormat(`{ "abc": d }`); }); test("symbol literal as a hash key", () => { @@ -273,7 +257,7 @@ describe("strings", () => { }); test("gets correct quotes", () => { - const content = "where('lint_tool_configs.plugin': plugins + %w[core])"; + const content = `where("lint_tool_configs.plugin": plugins + %w[core])`; expect(content).toMatchFormat(); }); diff --git a/test/js/setupTests.ts b/test/js/setupTests.ts index 8f5c23b4..818c2592 100644 --- a/test/js/setupTests.ts +++ b/test/js/setupTests.ts @@ -5,12 +5,7 @@ import type { Code } from "./types"; import plugin from "../../src/plugin"; type Config = Partial & { - printer: Omit & { printComment: () => any }, - rubyArrayLiteral: boolean, - rubyHashLabel: boolean, - rubyModifier: boolean, - rubySingleQuote: boolean, - rubyToProc: boolean + printer: Omit & { printComment: () => any } }>; function normalize(code: Code) { diff --git a/test/rb/metadata_test.rb b/test/rb/metadata_test.rb deleted file mode 100644 index a9ae45b6..00000000 --- a/test/rb/metadata_test.rb +++ /dev/null @@ -1,825 +0,0 @@ -# frozen_string_literal: true - -require 'test_helper' - -class MetadataTest < Minitest::Test - def test_BEGIN - assert_metadata SyntaxTree::BEGINBlock, <<~SOURCE - BEGIN { - } - SOURCE - end - - def test_END - assert_metadata SyntaxTree::ENDBlock, <<~SOURCE - END { - } - SOURCE - end - - def test_alias - assert_metadata SyntaxTree::Alias, 'alias foo bar' - end - - def test_array_args - assert_metadata SyntaxTree::ArrayLiteral, <<~SOURCE - [ - foo, - bar, - baz - ] - SOURCE - end - - def test_aref - assert_metadata SyntaxTree::ARef, 'foo[bar]' - end - - def test_aref_field - assert_node_metadata( - SyntaxTree::ARefField, - parse('foo[bar] = baz').target, - start_char: 0, - end_char: 8 - ) - end - - def test_args - assert_node_metadata( - SyntaxTree::Args, - parse('foo bar, baz').arguments.arguments, - start_char: 4, - end_char: 12 - ) - end - - def test_args_add_block - assert_node_metadata( - SyntaxTree::ArgsAddBlock, - parse('foo bar, baz').arguments, - start_char: 4, - end_char: 12 - ) - end - - def test_arg_paren - content = <<~SOURCE - foo( - a, - b, - c - ) - SOURCE - - assert_node_metadata( - SyntaxTree::ArgParen, - parse(content).arguments, - start_char: 3, - end_char: 20, - start_line: 1, - end_line: 5 - ) - end - - def test_assign - assert_metadata SyntaxTree::Assign, 'foo = bar' - end - - def test_assoc - assert_node_metadata( - SyntaxTree::Assoc, - parse('{ foo: bar, bar: baz }').contents.assocs.first, - start_char: 2, - end_char: 10 - ) - end - - def test_assoc_splat - assert_node_metadata( - SyntaxTree::AssocSplat, - parse('foo **bar').arguments.arguments.parts.first.assocs.first, - start_char: 4, - end_char: 9 - ) - end - - def test_assoclist_from_args - assert_node_metadata( - SyntaxTree::AssocListFromArgs, - parse('{ foo => bar }').contents, - start_char: 1, - end_char: 13 - ) - end - - def test_bare_assoc_hash - assert_node_metadata( - SyntaxTree::BareAssocHash, - parse('foo(bar: baz)').arguments.arguments.arguments.parts.first, - start_char: 4, - end_char: 12 - ) - end - - def test_begin - assert_metadata SyntaxTree::Begin, <<~SOURCE - begin - begin; end - end - SOURCE - end - - def test_binary - assert_metadata SyntaxTree::Binary, 'foo + bar' - end - - def test_blockarg - assert_node_metadata( - SyntaxTree::BlockArg, - parse('def foo(&bar) end').params.contents.block, - start_char: 8, - end_char: 12 - ) - end - - def test_block_var - assert_node_metadata( - SyntaxTree::BlockVar, - parse('foo { |bar| }').block.block_var, - start_char: 6, - end_char: 11 - ) - end - - def test_bodystmt - assert_node_metadata( - SyntaxTree::BodyStmt, - parse('class Foo; def foo; end; end').bodystmt, - start_char: 9, - end_char: 25 - ) - end - - def test_brace_block - assert_node_metadata( - SyntaxTree::BraceBlock, - parse('foo { bar }').block, - start_char: 4, - end_char: 11 - ) - end - - def test_break - assert_metadata SyntaxTree::Break, 'break foo' - end - - def test_call - assert_metadata SyntaxTree::Call, 'foo.bar' - end - - def test_case - assert_metadata SyntaxTree::Case, <<~SOURCE - case foo - when bar - case baz - when qux - end - end - SOURCE - end - - def test_class - assert_metadata SyntaxTree::ClassDeclaration, <<~SOURCE - class Foo - class Bar; end - end - SOURCE - end - - def test_command - assert_metadata SyntaxTree::Command, 'foo bar' - end - - def test_command_call - assert_metadata SyntaxTree::CommandCall, 'foo.bar baz' - end - - def test_const_ref - assert_node_metadata( - SyntaxTree::ConstRef, - parse('class Foo; end').constant, - start_char: 6, - end_char: 9 - ) - end - - def test_const_path_field - assert_node_metadata( - SyntaxTree::ConstPathField, - parse('Foo::Bar = baz').target, - start_char: 0, - end_char: 8 - ) - end - - def test_const_path_ref - assert_metadata SyntaxTree::ConstPathRef, 'Foo::Bar' - end - - def test_def - assert_metadata SyntaxTree::Def, <<~SOURCE - def foo - def bar; end - end - SOURCE - end - - def test_defined - assert_metadata SyntaxTree::Defined, <<~SOURCE - defined?( - Foo - ) - SOURCE - end - - def test_defs - assert_metadata SyntaxTree::Defs, <<~SOURCE - def Object.foo - def Object.bar; end - end - SOURCE - end - - def test_do_block - assert_node_metadata( - SyntaxTree::DoBlock, - parse('foo do; bar; end').block, - start_char: 4, - end_char: 16 - ) - end - - def test_dot2 - assert_metadata SyntaxTree::Dot2, 'foo..bar' - end - - def test_dot3 - assert_metadata SyntaxTree::Dot3, 'foo...bar' - end - - def test_dyna_symbol - assert_metadata SyntaxTree::DynaSymbol, ':"foo #{bar} baz"' - end - - def test_else - content = <<~SOURCE - if foo - bar - else - baz - end - SOURCE - - assert_node_metadata( - SyntaxTree::Else, - parse(content).consequent, - start_char: 13, - end_char: 27, - start_line: 3, - end_line: 5 - ) - end - - def test_elsif - content = <<~SOURCE - if foo - bar - elsif bar - qux - end - SOURCE - - assert_node_metadata( - SyntaxTree::Elsif, - parse(content).consequent, - start_char: 13, - end_char: 32, - start_line: 3, - end_line: 5 - ) - end - - def test_ensure - content = <<~SOURCE - begin - foo - ensure - bar - end - SOURCE - - assert_node_metadata( - SyntaxTree::Ensure, - parse(content).bodystmt.ensure_clause, - start_char: 12, - end_char: 28, - start_line: 3, - end_line: 5 - ) - end - - if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.6') - def test_excessed_comma - assert_node_metadata( - SyntaxTree::ExcessedComma, - parse('foo { |bar,| }').block.block_var.params.rest, - start_char: 10, - end_char: 11 - ) - end - end - - def test_fcall - assert_node_metadata( - SyntaxTree::FCall, - parse('foo(bar)').call, - start_char: 0, - end_char: 3 - ) - end - - def test_field - assert_node_metadata( - SyntaxTree::Field, - parse('foo.bar = baz').target, - start_char: 0, - end_char: 7 - ) - end - - def test_for - assert_metadata SyntaxTree::For, <<~SOURCE - for foo in bar do - for baz in qux do - end - end - SOURCE - end - - def test_hash - assert_metadata SyntaxTree::HashLiteral, <<~SOURCE - { - foo: 'bar' - } - SOURCE - end - - def test_if - assert_metadata SyntaxTree::If, <<~SOURCE - if foo - if bar; end - end - SOURCE - end - - def test_ifop - assert_metadata SyntaxTree::IfOp, 'foo ? bar : baz' - end - - def test_if_mod - assert_metadata SyntaxTree::IfMod, 'foo if bar' - end - - def test_kwrest_param - assert_node_metadata( - SyntaxTree::KwRestParam, - parse('def foo(**bar); end').params.contents.keyword_rest, - start_char: 8, - end_char: 13 - ) - end - - def test_lambda - assert_metadata SyntaxTree::Lambda, <<~SOURCE - -> (foo, bar) { - foo + bar - } - SOURCE - end - - def test_massign - assert_metadata SyntaxTree::MAssign, 'foo, bar, baz = 1, 2, 3' - end - - def test_method_add_arg - assert_metadata SyntaxTree::MethodAddArg, 'foo(bar)' - end - - def test_method_add_block - assert_metadata SyntaxTree::MethodAddBlock, 'foo { bar }' - end - - def test_mlhs - assert_node_metadata( - SyntaxTree::MLHS, - parse('foo, bar, baz = 1, 2, 3').target, - start_char: 0, - end_char: 13 - ) - end - - def test_mlhs_add_post - assert_node_metadata( - SyntaxTree::MLHS, - parse('foo, *bar, baz = 1, 2, 3').target, - start_char: 0, - end_char: 14 - ) - end - - def test_mlhs_add_star - assert_node_metadata( - SyntaxTree::MLHS, - parse('foo, *bar = 1, 2, 3').target, - start_char: 0, - end_char: 9 - ) - end - - def test_mlhs_paren - assert_node_metadata( - SyntaxTree::MLHSParen, - parse('(foo, bar) = baz').target, - start_char: 0, - end_char: 10 - ) - end - - def test_module - assert_metadata SyntaxTree::ModuleDeclaration, <<~SOURCE - module Foo - module Bar; end - end - SOURCE - end - - def test_mrhs_add_star - assert_node_metadata( - SyntaxTree::MRHSAddStar, - parse('foo, bar = *baz').value, - start_char: 11, - end_char: 15 - ) - end - - def test_next - assert_metadata SyntaxTree::Next, 'next foo' - end - - def test_opassign - assert_metadata SyntaxTree::OpAssign, 'foo ||= bar' - end - - def test_params - content = <<~SOURCE - def foo( - bar, - baz - ); end - SOURCE - - assert_node_metadata( - SyntaxTree::Params, - parse(content).params.contents, - start_char: 8, - end_char: 22, - start_line: 2, - end_line: 3 - ) - end - - def test_paren - assert_metadata SyntaxTree::Paren, '()' - end - - def test_qsymbols - assert_metadata SyntaxTree::QSymbols, '%i[foo bar baz]' - end - - def test_qwords - assert_metadata SyntaxTree::QWords, '%w[foo bar baz]' - end - - def test_redo - assert_metadata SyntaxTree::Redo, 'redo' - end - - def test_regexp_literal - assert_metadata SyntaxTree::RegexpLiteral, '/foo/' - assert_metadata SyntaxTree::RegexpLiteral, '%r{foo}' - assert_metadata SyntaxTree::RegexpLiteral, '%r(foo)' - - assert_node_metadata( - SyntaxTree::RegexpLiteral, - parse('%r(foo)'), - beginning: '%r(', - ending: ')', - start_char: 0, - end_char: 7 - ) - end - - def test_rescue - assert_node_metadata( - SyntaxTree::Rescue, - parse('begin; foo; rescue => bar; baz; end').bodystmt.rescue_clause, - start_char: 12, - end_char: 35 - ) - end - - def test_rescue_mod - assert_metadata SyntaxTree::RescueMod, 'foo rescue bar' - end - - def test_rest_param - assert_node_metadata( - SyntaxTree::RestParam, - parse('def foo(*bar); end').params.contents.rest, - start_char: 8, - end_char: 12 - ) - end - - def test_retry - assert_metadata SyntaxTree::Retry, 'retry' - end - - def test_return - assert_metadata SyntaxTree::Return, 'return foo' - end - - def test_return0 - assert_metadata SyntaxTree::Return0, 'return' - end - - def test_sclass - assert_metadata SyntaxTree::SClass, <<~SOURCE - class << Foo - class << Bar; end - end - SOURCE - end - - def test_string_concat - assert_metadata SyntaxTree::StringConcat, <<~SOURCE - 'foo' \ - 'bar' - SOURCE - end - - def test_string_dvar - assert_node_metadata( - SyntaxTree::StringDVar, - parse('"#$foo"').parts.first, - start_char: 1, - end_char: 6 - ) - end - - def test_string_embexpr - assert_node_metadata( - SyntaxTree::StringEmbExpr, - parse('"foo #{bar} baz"').parts[1], - start_char: 5, - end_char: 11 - ) - end - - def test_string_literal - assert_metadata SyntaxTree::StringLiteral, '"foo"' - end - - def test_super - assert_metadata SyntaxTree::Super, 'super foo' - end - - def test_symbol_literal - assert_metadata SyntaxTree::SymbolLiteral, ':foo' - end - - def test_symbols - assert_metadata SyntaxTree::Symbols, '%I[f#{o}o b#{a}r b#{a}z]' - end - - def test_top_const_field - assert_node_metadata( - SyntaxTree::TopConstField, - parse('::Foo = bar').target, - start_char: 0, - end_char: 5 - ) - end - - def test_top_const_ref - assert_metadata SyntaxTree::TopConstRef, '::Foo' - end - - def test_unary - assert_metadata SyntaxTree::Unary, '-foo' - assert_metadata SyntaxTree::Not, 'not foo' - end - - def test_undef - assert_metadata SyntaxTree::Undef, 'undef foo, bar' - end - - def test_unless - assert_metadata SyntaxTree::Unless, <<~SOURCE - unless foo - unless bar; end - end - SOURCE - end - - def test_unless_mod - assert_metadata SyntaxTree::UnlessMod, 'foo unless bar' - end - - def test_until - assert_metadata SyntaxTree::Until, <<~SOURCE - until foo - until bar; end - end - SOURCE - end - - def test_until_mod - assert_metadata SyntaxTree::UntilMod, 'foo until bar' - end - - def test_while - assert_metadata SyntaxTree::While, <<~SOURCE - while foo - while bar; end - end - SOURCE - end - - def test_var_alias - assert_metadata SyntaxTree::VarAlias, 'alias $foo $bar' - end - - def test_var_field - assert_node_metadata( - SyntaxTree::VarField, - parse('foo = 1').target, - start_char: 0, - end_char: 3 - ) - end - - def test_var_ref - assert_metadata SyntaxTree::VarRef, 'true' - end - - def test_vcall - assert_metadata SyntaxTree::VCall, 'foo' - end - - def test_void_stmt - assert_node_metadata( - SyntaxTree::VoidStmt, - parse('; ;'), - start_char: 0, - end_char: 0 - ) - end - - def test_when - assert_node_metadata( - SyntaxTree::When, - parse('case foo; when bar; baz; end').consequent, - start_char: 10, - end_char: 28 - ) - end - - def test_while_mod - assert_metadata SyntaxTree::WhileMod, 'foo while bar' - end - - def test_words - assert_metadata SyntaxTree::Words, '%W[f#{o}o b#{a}r b#{a}z]' - end - - def test_xstring - assert_metadata SyntaxTree::XStringLiteral, <<~SOURCE - ` - foo - bar - ` - SOURCE - end - - def test_yield - assert_metadata SyntaxTree::Yield, 'yield foo' - end - - def test_yield0 - assert_metadata SyntaxTree::Yield0, 'yield' - end - - def test_zsuper - assert_metadata SyntaxTree::ZSuper, 'super' - end - - if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7') - def test_args_forward - content = <<~SOURCE - def foo(...) - bar(...) - end - SOURCE - - assert_node_metadata( - SyntaxTree::ArgsForward, - parse(content).params.contents.rest, - start_char: 8, - end_char: 11 - ) - end - - def test_aryptn - content = <<~SOURCE - case foo - in bar, baz - qux - end - SOURCE - - assert_node_metadata( - SyntaxTree::AryPtn, - parse(content).consequent.pattern, - start_char: 12, - end_char: 20, - start_line: 2, - end_line: 2 - ) - end - - def test_in - content = <<~SOURCE - case foo - in bar - baz - end - SOURCE - - assert_node_metadata( - SyntaxTree::In, - parse(content).consequent, - start_char: 9, - end_char: 25, - start_line: 2, - end_line: 4 - ) - end - end - - private - - def assert_metadata(type, ruby) - assert_node_metadata( - type, - parse(ruby), - start_line: 1, - start_char: 0, - end_line: [1, ruby.count("\n")].max, - end_char: ruby.chomp.size - ) - end - - def assert_node_metadata( - type, - node, - start_char:, - end_char:, - start_line: 1, - end_line: 1, - **metadata - ) - assert_kind_of(type, node) - - assert_equal(start_line, node.location.start_line) - assert_equal(start_char, node.location.start_char) - assert_equal(end_line, node.location.end_line) - assert_equal(end_char, node.location.end_char) - - metadata.each { |key, value| assert_equal(value, node.public_send(key)) } - end - - def parse(ruby) - SyntaxTree.parse(ruby).statements.body.first - end -end diff --git a/test/rb/parser_test.rb b/test/rb/parser_test.rb deleted file mode 100644 index 2d612357..00000000 --- a/test/rb/parser_test.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -require 'test_helper' - -class ParserTest < Minitest::Test - def test_events - filepath = File.expand_path('../../src/ruby/parser.rb', __dir__) - pattern = /(?:alias|def) on_([^(\s]+)/ - - # This is a list of all of the parser events that Ripper will emit - all_events = Ripper::EVENTS - - # This is a list of all of the parser events for which we have an explicitly - # defined event handler in our parser. - handled_events = - File.read(filepath).scan(pattern).map { |event,| event.to_sym } - - # Assert here that there are no missing events. - assert_empty(all_events - handled_events) - end -end diff --git a/test/rb/rbs_test.rb b/test/rb/rbs_test.rb deleted file mode 100644 index 1e424748..00000000 --- a/test/rb/rbs_test.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -require 'test_helper' - -class RBSTest < Minitest::Test - # https://github.com/ruby/rbs/commit/c5da467adacc75fe9294ec1630f1b7931d9d6871 - def test_module_type_params_empty - actual = declaration_json("interface _Foo\nend")['type_params'] - assert_instance_of Array, actual - assert_empty actual - end - - def test_module_type_params_fancy - source = <<~SOURCE - class Foo[unchecked in A, B] - end - SOURCE - - actual = declaration_json(source)['type_params'] - assert_instance_of Array, actual - assert_equal 2, actual.length - - type_a, type_b = actual - - assert_equal 'A', type_a['name'] - assert_equal 'contravariant', type_a['variance'] - assert_equal true, type_a['unchecked'] - - assert_equal 'B', type_b['name'] - assert_equal 'invariant', type_b['variance'] - assert_equal false, type_b['unchecked'] - end - - # https://github.com/ruby/rbs/commit/3ccdcb1f3ac5dcb866280f745866a852658195e6 - def test_generic_method - source = <<~SOURCE - class T - def t: [A, B] (A) -> B - end - SOURCE - - actual = member_json(source)['types'].first['type_params'] - assert_equal 2, actual.length - - type_a, type_b = actual - assert_equal 'A', type_a['name'] - assert_equal 'B', type_b['name'] - end - - private - - def declaration_json(source) - JSON.parse(first_declaration(source).to_json) - end - - def member_json(source) - JSON.parse(first_member(source).to_json) - end - - def parse(source) - Prettier::RBSParser.parse(source) - end - - def first_declaration(source) - parse(source)[:declarations].first - end - - def first_member(source) - first_declaration(source).members.first - end -end diff --git a/test/rb/test_helper.rb b/test/rb/test_helper.rb index b2047e0b..4b93f91d 100644 --- a/test/rb/test_helper.rb +++ b/test/rb/test_helper.rb @@ -3,7 +3,4 @@ $LOAD_PATH.unshift(File.expand_path('../../lib', __dir__)) require 'prettier' -require_relative '../../src/ruby/parser' -require_relative '../../src/rbs/parser' - require 'minitest/autorun' From 22dd186d0dd868cf5a307969377dbcf454ecb28b Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 21 Apr 2022 13:09:49 -0400 Subject: [PATCH 578/785] Fix a couple more tests --- src/server.rb | 2 +- test/js/ruby/nodes/strings.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server.rb b/src/server.rb index 72e05ac9..879926ef 100644 --- a/src/server.rb +++ b/src/server.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'bundler/setup' if ENV['PLUGIN_RUBY_CI'] +require 'bundler/setup' # if ENV['PLUGIN_RUBY_CI'] require 'socket' require 'json' require 'fileutils' diff --git a/test/js/ruby/nodes/strings.test.ts b/test/js/ruby/nodes/strings.test.ts index c0167972..41fde744 100644 --- a/test/js/ruby/nodes/strings.test.ts +++ b/test/js/ruby/nodes/strings.test.ts @@ -118,7 +118,7 @@ describe("strings", () => { }); test("concatenation", () => { - expect(`'abc' \\\n 'def' \\\n 'ghi'`).toMatchFormat(); + expect(`"abc" \\\n "def" \\\n "ghi"`).toMatchFormat(); }); describe("interpolation", () => { @@ -235,7 +235,7 @@ describe("strings", () => { }); test("%s literal with false interpolation", () => { - expect("%s[abc#{d}]").toChangeFormat(`:"abc#{d}"`); + expect("%s[abc#{d}]").toChangeFormat(`:'abc#{d}'`); }); test("%s literal as hash key", () => { From 69da2ac69c56a062f6cface1d52fdc00de0ba245 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 21 Apr 2022 14:17:19 -0400 Subject: [PATCH 579/785] Better encoding guessing --- src/server.rb | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/server.rb b/src/server.rb index 879926ef..448f4f33 100644 --- a/src/server.rb +++ b/src/server.rb @@ -68,7 +68,27 @@ # Start up a new thread that will handle each successive connection. Thread.new(server.accept_nonblock) do |socket| - parser, source = socket.read.force_encoding('UTF-8').split('|', 2) + parser, source = socket.read.split('|', 2) + + # First, ensure we get the right encoding for this string. + encoding = + source.each_line do |line| + # Skip past the first line if it contains a shebang so that we get + # to the encoding line. + next if line.start_with?("#!") + + # If the line isn't an encoding magic comment, we're going to + # default to UTF-8. + break "UTF-8" unless line.include?("coding") + + # Otherwise, we're going to use Ripper to try to extract out the + # encoding from the magic comment. + break Ripper.new(line).tap(&:parse).encoding + end + + # Now that we have our guessed encoding, we're going to force it into + # the string so that it gets parsed correctly. + source = source.force_encoding(encoding) response = case parser From e8c59acdc8c28a7be29dfb900e8d935f5941d7f5 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 21 Apr 2022 14:36:07 -0400 Subject: [PATCH 580/785] Fix up expectation on calls test --- test/js/ruby/comments.test.ts | 7 ++++++- test/js/ruby/nodes/blocks.test.ts | 11 ++++++++++- test/js/ruby/nodes/calls.test.ts | 16 ++++++++-------- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/test/js/ruby/comments.test.ts b/test/js/ruby/comments.test.ts index fda5b8e6..4483b3df 100644 --- a/test/js/ruby/comments.test.ts +++ b/test/js/ruby/comments.test.ts @@ -218,7 +218,12 @@ describe("comments", () => { .baz `); - expect(content).toMatchFormat(); + const expected = ruby(` + foo.bar # comment + .baz + `); + + expect(content).toChangeFormat(expected); }); describe("declaration style comments", () => { diff --git a/test/js/ruby/nodes/blocks.test.ts b/test/js/ruby/nodes/blocks.test.ts index c831e507..afc43817 100644 --- a/test/js/ruby/nodes/blocks.test.ts +++ b/test/js/ruby/nodes/blocks.test.ts @@ -59,7 +59,16 @@ describe("blocks", () => { end.to_i `); - expect(content).toMatchFormat(); + const expected = ruby(` + method + .each do |foo| + bar + baz + end + .to_i + `); + + expect(content).toChangeFormat(expected); }); test("doesn't do weird things with comments", () => { diff --git a/test/js/ruby/nodes/calls.test.ts b/test/js/ruby/nodes/calls.test.ts index 9823efd5..7697b6df 100644 --- a/test/js/ruby/nodes/calls.test.ts +++ b/test/js/ruby/nodes/calls.test.ts @@ -75,8 +75,9 @@ describe("calls", () => { test("basic chains", () => { const content = ruby(` sig do - params(contacts: Contact::ActiveRecord_Relation) - .returns(Customer::ActiveRecord_Relation) + params(contacts: Contact::ActiveRecord_Relation).returns( + Customer::ActiveRecord_Relation + ) end `); @@ -141,12 +142,11 @@ describe("calls", () => { const content = `result = [${item}, ${item}, ${item}].map(&:foo?).bbb.ccc`; const expected = ruby(` - result = - [ - ${item}, - ${item}, - ${item} - ].map(&:foo?).bbb.ccc + result = [ + ${item}, + ${item}, + ${item} + ].map(&:foo?).bbb.ccc `); expect(content).toChangeFormat(expected); From 7658e5bf9bd9fa3f60ad71672caf28e63abd2d73 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 22 Apr 2022 12:24:28 -0400 Subject: [PATCH 581/785] Update dependencies --- Gemfile | 3 --- prettier.gemspec | 3 ++- src/server.rb | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 96709a7f..be173b20 100644 --- a/Gemfile +++ b/Gemfile @@ -3,6 +3,3 @@ source "https://rubygems.org" gemspec - -gem "syntax_tree", path: "../../ruby-syntax-tree/syntax_tree" -gem "rbs", "~> 2" diff --git a/prettier.gemspec b/prettier.gemspec index bb3143a9..3e4931d9 100644 --- a/prettier.gemspec +++ b/prettier.gemspec @@ -27,9 +27,10 @@ Gem::Specification.new do |spec| spec.executables = 'rbprettier' spec.require_paths = %w[lib] - # spec.add_dependency 'syntax_tree' + spec.add_dependency 'syntax_tree' spec.add_dependency 'syntax_tree-haml' spec.add_dependency 'syntax_tree-rbs' + spec.add_dependency 'rbs', '~> 2' spec.add_development_dependency 'bundler' spec.add_development_dependency 'minitest' diff --git a/src/server.rb b/src/server.rb index 448f4f33..8c813e8d 100644 --- a/src/server.rb +++ b/src/server.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'bundler/setup' # if ENV['PLUGIN_RUBY_CI'] +require 'bundler/setup' require 'socket' require 'json' require 'fileutils' From 1cdf0216e113d1ba4ecca15d0ef0e8920a76d14c Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 22 Apr 2022 12:41:53 -0400 Subject: [PATCH 582/785] Reformat --- CHANGELOG.md | 10 +- README.md | 16 +- Rakefile | 10 +- bin/console | 6 +- bin/debug | 14 +- bin/lex | 2 +- bin/sexp | 6 +- exe/rbprettier | 4 +- lib/prettier.rb | 18 +- lib/prettier/rake/task.rb | 10 +- prettier.gemspec | 40 ++-- src/haml/parser.rb | 143 ------------- src/haml/printer.ts | 427 ------------------------------------- src/plugin.ts | 6 +- src/ruby/nodes/blocks.ts | 131 ------------ src/server.rb | 81 +++---- src/utils/getChildNodes.ts | 326 ---------------------------- test/js/rbs/rbs.test.ts | 8 +- test/js/setupTests.ts | 23 +- test/rb/rake_test.rb | 10 +- test/rb/test_helper.rb | 6 +- test/rb/version_test.rb | 2 +- 22 files changed, 138 insertions(+), 1161 deletions(-) delete mode 100644 src/haml/parser.rb delete mode 100644 src/haml/printer.ts delete mode 100644 src/ruby/nodes/blocks.ts delete mode 100644 src/utils/getChildNodes.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 138d08c5..e53b53c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -320,7 +320,6 @@ The comment in the above example should stay in place. ```ruby begin - rescue Foo, Bar # comment end @@ -476,7 +475,8 @@ return (a or b) if c? - kddnewton - Support for the `nokw_param` node for specifying when methods should no accept keywords, as in: ```ruby -def foo(**nil); end +def foo(**nil) +end ``` - kddnewton - Support for the `args_forward` node for forwarding all types of arguments, as in: @@ -522,9 +522,9 @@ will now be printed as: ```ruby Config::Download.new( - 'prettier', - filename: 'prettier.yml', - url: 'https://raw.githubusercontent.com/...' + "prettier", + filename: "prettier.yml", + url: "https://raw.githubusercontent.com/..." ).perform ``` diff --git a/README.md b/README.md index 18aaa392..6b72a543 100644 --- a/README.md +++ b/README.md @@ -59,9 +59,9 @@ d = [ 30_643_069_058 ] a, s = [], $*[0] -s.each_byte { |b| a << ('%036b' % d[b.chr.to_i]).scan(/\d{6}/) } +s.each_byte { |b| a << ("%036b" % d[b.chr.to_i]).scan(/\d{6}/) } a.transpose.each do |a| - a.join.each_byte { |i| print i == 49 ? ($*[1] || '#') : 32.chr } + a.join.each_byte { |i| printi == 49 ? ($*[1] || "#") : 32.chr } puts end ``` @@ -83,7 +83,7 @@ This plugin currently supports formatting the following kinds of files: Add this line to your application's Gemfile: ```ruby -gem 'prettier' +gem "prettier" ``` And then execute: @@ -128,11 +128,11 @@ The `prettier` executable is now installed and ready for use: Below are the options (from [`src/plugin.js`](src/plugin.js)) that `@prettier/plugin-ruby` currently supports: -| API Option | CLI Option | Default | Description | -| ------------------ | ---------------------- | :------: | ------------------------------------------------------------------------------------------------------------------------------------ | -| `printWidth` | `--print-width` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)). | -| `requirePragma` | `--require-pragma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#require-pragma)). | -| `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). | +| API Option | CLI Option | Default | Description | +| --------------- | ------------------ | :-----: | --------------------------------------------------------------------------------------------------- | +| `printWidth` | `--print-width` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)). | +| `requirePragma` | `--require-pragma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#require-pragma)). | +| `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). | Any of these can be added to your existing [prettier configuration file](https://prettier.io/docs/en/configuration.html). For example: diff --git a/Rakefile b/Rakefile index b2132881..a4eb3b0f 100644 --- a/Rakefile +++ b/Rakefile @@ -1,12 +1,12 @@ # frozen_string_literal: true -require 'bundler/gem_tasks' -require 'rake/testtask' +require "bundler/gem_tasks" +require "rake/testtask" Rake::TestTask.new(:test) do |t| - t.libs << 'test/rb' - t.libs << 'lib' - t.test_files = FileList['test/rb/**/*_test.rb'] + t.libs << "test/rb" + t.libs << "lib" + t.test_files = FileList["test/rb/**/*_test.rb"] end task default: :test diff --git a/bin/console b/bin/console index 5d2f5a89..05b9a575 100755 --- a/bin/console +++ b/bin/console @@ -1,7 +1,7 @@ #!/usr/bin/env ruby -require 'bundler/setup' -require 'prettier' +require "bundler/setup" +require "prettier" -require 'irb' +require "irb" IRB.start(__FILE__) diff --git a/bin/debug b/bin/debug index 2f80a61d..15d16356 100755 --- a/bin/debug +++ b/bin/debug @@ -1,23 +1,23 @@ #!/usr/bin/env ruby -require 'bundler/inline' +require "bundler/inline" gemfile do - source 'https://rubygems.org' - gem 'sinatra', require: 'sinatra/base' - gem 'webrick' + source "https://rubygems.org" + gem "sinatra", require: "sinatra/base" + gem "webrick" end -require_relative '../src/ruby/parser' +require_relative "../src/ruby/parser" class App < Sinatra::Base HTML = DATA.read - get '/' do + get "/" do HTML end - post '/ast' do + post "/ast" do response = Prettier::Parser.parse(request.body.read) response ? JSON.fast_generate(response) : halt(422) rescue Prettier::Parser::ParserError diff --git a/bin/lex b/bin/lex index b0fdc359..58af05a6 100755 --- a/bin/lex +++ b/bin/lex @@ -1,6 +1,6 @@ #!/usr/bin/env ruby -require 'ripper' +require "ripper" source = File.file?(ARGV[0]) ? File.read(ARGV[0]) : ARGV[0].gsub('\\n', "\n") pp Ripper.lex(source) diff --git a/bin/sexp b/bin/sexp index 348ec402..1c18538c 100755 --- a/bin/sexp +++ b/bin/sexp @@ -1,10 +1,10 @@ #!/usr/bin/env ruby -require_relative '../src/ruby/parser' +require_relative "../src/ruby/parser" source = if !ARGV[0] - File.read('test.rb') + File.read("test.rb") elsif File.file?(ARGV[0]) File.read(ARGV[0]) else @@ -13,7 +13,7 @@ source = parsed = SyntaxTree.parse(source) -puts '=== SOURCE === ' +puts "=== SOURCE === " puts source puts "\n=== COMMENTS ===" diff --git a/exe/rbprettier b/exe/rbprettier index 3f3ba279..f5b653a3 100755 --- a/exe/rbprettier +++ b/exe/rbprettier @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # frozen_string_literal: true -$:.unshift(File.expand_path(File.join('..', 'lib'), __dir__)) -require 'prettier' +$:.unshift(File.expand_path(File.join("..", "lib"), __dir__)) +require "prettier" exit(Prettier.run(ARGV)) diff --git a/lib/prettier.rb b/lib/prettier.rb index 973112e7..3a41899e 100644 --- a/lib/prettier.rb +++ b/lib/prettier.rb @@ -1,19 +1,19 @@ # frozen_string_literal: true -require 'json' unless defined?(JSON) -require 'open3' +require "json" unless defined?(JSON) +require "open3" module Prettier - PLUGIN = -File.expand_path('..', __dir__) - BINARY = -File.join(PLUGIN, 'node_modules', 'prettier', 'bin-prettier.js') - VERSION = -JSON.parse(File.read(File.join(PLUGIN, 'package.json')))['version'] + PLUGIN = -File.expand_path("..", __dir__) + BINARY = -File.join(PLUGIN, "node_modules", "prettier", "bin-prettier.js") + VERSION = -JSON.parse(File.read(File.join(PLUGIN, "package.json")))["version"] def self.run(args) - quoted = args.map { |arg| arg.start_with?('-') ? arg : "\"#{arg}\"" } - command = "node #{BINARY} --plugin \"#{PLUGIN}\" #{quoted.join(' ')}" + quoted = args.map { |arg| arg.start_with?("-") ? arg : "\"#{arg}\"" } + command = "node #{BINARY} --plugin \"#{PLUGIN}\" #{quoted.join(" ")}" stdout, stderr, status = - Open3.capture3({ 'RBPRETTIER' => '1' }, command, stdin_data: STDIN) + Open3.capture3({ "RBPRETTIER" => "1" }, command, stdin_data: STDIN) STDOUT.puts(stdout) # If we completed successfully, then just exit out. @@ -30,7 +30,7 @@ def self.run(args) If you installed this dependency through git instead of from rubygems, it does not install the necessary files by default. To fix this you can either install them yourself by cd-ing into the directory where this gem - is located (#{File.expand_path('..', __dir__)}) and running: + is located (#{File.expand_path("..", __dir__)}) and running: `yarn && yarn prepublishOnly` or diff --git a/lib/prettier/rake/task.rb b/lib/prettier/rake/task.rb index a5591297..35932601 100644 --- a/lib/prettier/rake/task.rb +++ b/lib/prettier/rake/task.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require 'rake' -require 'rake/tasklib' +require "rake" +require "rake/tasklib" module Prettier module Rake @@ -35,7 +35,7 @@ class Task < ::Rake::TaskLib def initialize(name = :prettier) @name = name @write = true - @source_files = 'lib/**/*.rb' + @source_files = "lib/**/*.rb" yield self if block_given? define_task @@ -44,12 +44,12 @@ def initialize(name = :prettier) private def define_task - desc 'Runs prettier over source files' + desc "Runs prettier over source files" task(name) { run_task } end def run_task - Prettier.run([('--write' if write), source_files].compact) + Prettier.run([("--write" if write), source_files].compact) exit($?.exitstatus) if $?&.exited? end end diff --git a/prettier.gemspec b/prettier.gemspec index 3e4931d9..7ad78393 100644 --- a/prettier.gemspec +++ b/prettier.gemspec @@ -1,38 +1,38 @@ # frozen_string_literal: true -require 'json' unless defined?(JSON) -package = JSON.parse(File.read(File.join(__dir__, 'package.json'))) +require "json" unless defined?(JSON) +package = JSON.parse(File.read(File.join(__dir__, "package.json"))) Gem::Specification.new do |spec| - spec.name = 'prettier' - spec.version = package['version'] - spec.authors = [package['author']] + spec.name = "prettier" + spec.version = package["version"] + spec.authors = [package["author"]] - spec.summary = package['description'] - spec.homepage = package['homepage'] - spec.license = package['license'] + spec.summary = package["description"] + spec.homepage = package["homepage"] + spec.license = package["license"] spec.files = Dir.chdir(__dir__) do %w[LICENSE bin/console package.json rubocop.yml] + - Dir['{{exe,lib,dist}/**/*,*.md}'] + + Dir["{{exe,lib,dist}/**/*,*.md}"] + Dir[ - 'node_modules/prettier/{package.json,index.js,cli.js,doc.js,bin-prettier.js,third-party.js,parser-*.js}' + "node_modules/prettier/{package.json,index.js,cli.js,doc.js,bin-prettier.js,third-party.js,parser-*.js}" ] end - spec.required_ruby_version = '>= 2.7.3' + spec.required_ruby_version = ">= 2.7.3" - spec.bindir = 'exe' - spec.executables = 'rbprettier' + spec.bindir = "exe" + spec.executables = "rbprettier" spec.require_paths = %w[lib] - spec.add_dependency 'syntax_tree' - spec.add_dependency 'syntax_tree-haml' - spec.add_dependency 'syntax_tree-rbs' - spec.add_dependency 'rbs', '~> 2' + spec.add_dependency "syntax_tree" + spec.add_dependency "syntax_tree-haml" + spec.add_dependency "syntax_tree-rbs" + spec.add_dependency "rbs", "~> 2" - spec.add_development_dependency 'bundler' - spec.add_development_dependency 'minitest' - spec.add_development_dependency 'rake' + spec.add_development_dependency "bundler" + spec.add_development_dependency "minitest" + spec.add_development_dependency "rake" end diff --git a/src/haml/parser.rb b/src/haml/parser.rb deleted file mode 100644 index cd8d9796..00000000 --- a/src/haml/parser.rb +++ /dev/null @@ -1,143 +0,0 @@ -# frozen_string_literal: true - -require 'ripper' - -begin - require 'haml' -rescue LoadError - # If we can't load the haml gem, then we're going to provide a shim parser - # that will warn and bail out. - class Prettier::HAMLParser - def self.parse(text) - warn( - 'The `haml` gem could not be loaded. Please ensure you have it ' \ - 'installed and that it is available in the gem path.' - ) - - false - end - end - - return -end - -class Haml::Parser::ParseNode - class DeepAttributeParser - def parse(string) - Haml::AttributeParser.available? ? parse_value(string) : string - end - - private - - def literal(string, level) - level == 0 ? string : "&#{string}" - end - - def parse_value(string, level = 0) - response = Ripper.sexp(string) - return literal(string, level) unless response - - case response[1][0][0] - when :hash - hash = Haml::AttributeParser.parse(string) - - if hash - # Explicitly not using Enumerable#to_h here to support Ruby 2.5 - hash.each_with_object({}) do |(key, value), response| - response[key] = parse_value(value, level + 1) - end - else - literal(string, level) - end - when :string_literal - string[1...-1] - else - literal(string, level) - end - end - end - - ESCAPE = /Haml::Helpers.html_escape\(\((.+)\)\)/.freeze - - # If a node comes in as the plain type but starts with one of the special - # characters that haml parses, then we need to escape it with a \ when - # printing. So here we make a regexp pattern to check if the node needs to be - # escaped. - special_chars = - Haml::Parser::SPECIAL_CHARACTERS.map { |char| Regexp.escape(char) } - - SPECIAL_START = /\A(?:#{special_chars.join('|')})/ - - def as_json - case type - when :comment, :doctype, :silent_script - to_h.tap do |json| - json.delete(:parent) - json[:children] = children.map(&:as_json) - end - when :filter, :haml_comment - to_h.tap { |json| json.delete(:parent) } - when :plain - to_h.tap do |json| - json.delete(:parent) - json[:children] = children.map(&:as_json) - - text = json[:value][:text] - json[:value][:text] = "\\#{text}" if text.match?(SPECIAL_START) - end - when :root - to_h.tap do |json| - json[:children] = children.map(&:as_json) - - # We need this information in the printer to know how to lay out - # multi-line attributes. - json[:supports_multiline] = - Gem::Version.new(Haml::VERSION) >= Gem::Version.new('5.2') - end - when :script - to_h.tap do |json| - json.delete(:parent) - json[:children] = children.map(&:as_json) - - if json[:value][:text].match?(ESCAPE) - json[:value][:text].gsub!(ESCAPE) { $1 } - json[:value].merge!(escape_html: 'escape_html', interpolate: true) - end - end - when :tag - to_h.tap do |json| - json.delete(:parent) - - # For some reason this is actually using a symbol to represent a null - # object ref instead of nil itself, so just replacing it here for - # simplicity in the printer - json[:value][:object_ref] = nil if json[:value][:object_ref] == :nil - - # Get a reference to the dynamic attributes hash - dynamic_attributes = value[:dynamic_attributes].to_h - - # If we have any in the old style, then we're going to pass it through - # the deep attribute parser filter. - if dynamic_attributes[:old] - dynamic_attributes[:old] = - DeepAttributeParser.new.parse(dynamic_attributes[:old]) - end - - json.merge!( - children: children.map(&:as_json), - value: value.merge(dynamic_attributes: dynamic_attributes) - ) - end - else - raise ArgumentError, "Unsupported type: #{type}" - end - end -end - -module Prettier - class HAMLParser - def self.parse(source) - Haml::Parser.new({}).call(source).as_json - end - end -end diff --git a/src/haml/printer.ts b/src/haml/printer.ts deleted file mode 100644 index 78aa4c4e..00000000 --- a/src/haml/printer.ts +++ /dev/null @@ -1,427 +0,0 @@ -import type { Plugin, HAML } from "../types"; -import prettier from "../prettier"; -import embed from "./embed"; - -const { - align, - fill, - group, - hardline, - ifBreak, - indent, - join, - line, - makeString, - softline -} = prettier; - -const docTypes = { - basic: "Basic", - frameset: "Frameset", - mobile: "Mobile", - rdfa: "RDFa", - strict: "Strict", - xml: "XML" -} as const; - -const docVersions = ["1.1", "5"]; - -// Prints out a hash key according to the configured prettier options. -function printHashKey(key: string, opts: Plugin.Options) { - let quoted = key; - const joiner = opts.rubyHashLabel ? ":" : " =>"; - - if (key.includes(":") || key.includes("-") || key.includes("@")) { - const quote = opts.rubySingleQuote ? "'" : '"'; - quoted = `${quote}${key}${quote}`; - } - - return `${opts.rubyHashLabel ? "" : ":"}${quoted}${joiner}`; -} - -// Prints out the value inside of a hash key-value pair according to the -// configured prettier options. -function printHashValue(value: string | number, opts: Plugin.Options) { - if (typeof value !== "string") { - return value.toString(); - } - - // This is a very special syntax created by the parser to let us know that - // this should be printed literally instead of as a string. - if (value.startsWith("&")) { - return value.slice(1); - } - - const quote = - opts.rubySingleQuote && !value.includes("#{") && !value.includes("'") - ? "'" - : '"'; - - return makeString(value, quote); -} - -// This will print an attributes object to a Doc node. It handles nesting on -// multiple levels and will print out according to whether or not the version of -// HAML being used supports multi-line attributes. -function printAttributes( - object: HAML.TagAttrs, - opts: Plugin.Options & { supportsMultiline: boolean; headerLength: number }, - level = 0 -) { - if (typeof object !== "object") { - return printHashValue(object, opts); - } - - const boundary = level === 0 ? softline : line; - const parts: Plugin.Doc[] = Object.keys(object).map((key) => [ - printHashKey(key, opts), - " ", - printAttributes(object[key], opts, level + 1) - ]); - - // If we have support for multi-line attributes laid out like a regular hash, - // then we print them that way here. - if (opts.supportsMultiline) { - return group([ - "{", - indent(group([boundary, join([",", line], parts)])), - boundary, - "}" - ]); - } - - // Otherwise, if we only have one attribute, then just print it inline - // regardless of how long it is. - if (parts.length === 0) { - return group(["{", parts[0], "}"]); - } - - // Otherwise, depending on how long the line is it will split the content into - // multi-line attributes that old Haml understands. - return group([ - "{", - parts[0], - ",", - align(opts.headerLength + 1, [line, join([",", line], parts.slice(1))]), - "}" - ]); -} - -// A utility function used in a silent script that is meant to determine if a -// child node is a continuation of a parent node (as in a when clause within a -// case statement or an else clause within an if). -function isContinuation( - parentNode: HAML.SilentScript, - childNode: HAML.AnyNode -) { - if (childNode.type !== "silent_script") { - return false; - } - - const parent = parentNode.value.keyword; - const child = childNode.value.keyword; - - return ( - (parent === "case" && ["when", "else"].includes(child)) || - (["if", "unless"].includes(parent) && ["elsif", "else"].includes(child)) - ); -} - -const printer: Plugin.PrinterConfig = { - embed, - // This is our printer's main print function that will switch on the type of - // node and print it out by returning a Doc tree. - print(path, opts, print) { - const node = path.getValue(); - - switch (node.type) { - // https://haml.info/docs/yardoc/file.REFERENCE.html#html-comments- - case "comment": { - const { value } = node; - const parts = ["/"]; - - if (value.revealed) { - parts.push("!"); - } - - if (value.conditional) { - parts.push(value.conditional); - } else if (value.text) { - parts.push(" ", value.text); - } - - return printWithChildren(node, group(parts)); - } - // https://haml.info/docs/yardoc/file.REFERENCE.html#doctype- - case "doctype": { - const { value } = node; - const parts = ["!!!"]; - - if (value.type in docTypes) { - parts.push(docTypes[value.type as keyof typeof docTypes]); - } else if (value.version && docVersions.includes(value.version)) { - parts.push(value.version); - } else { - parts.push(value.type); - } - - if (value.encoding) { - parts.push(value.encoding); - } - - return group(join(" ", parts)); - } - // https://haml.info/docs/yardoc/file.REFERENCE.html#filters - case "filter": - return group([ - ":", - node.value.name, - indent([hardline, join(hardline, node.value.text.trim().split("\n"))]) - ]); - // https://haml.info/docs/yardoc/file.REFERENCE.html#haml-comments-- - case "haml_comment": { - const { value } = node; - const parts: Plugin.Doc[] = ["-#"]; - - if (value.text) { - if (opts.originalText.split("\n")[node.line - 1].trim() === "-#") { - const lines = value.text.trim().split("\n"); - - parts.push(indent([hardline, join(hardline, lines)])); - } else { - parts.push(" ", value.text.trim()); - } - } - - return parts; - } - // https://haml.info/docs/yardoc/file.REFERENCE.html#plain-text - case "plain": - return node.value.text; - // The root node in the AST that we build in the parser. - case "root": { - const nodePath = path as Plugin.Path; - - return [join(hardline, nodePath.map(print, "children")), hardline]; - } - // https://haml.info/docs/yardoc/file.REFERENCE.html#inserting_ruby - case "script": { - const { value } = node; - const parts = []; - - if (value.escape_html) { - parts.unshift("&"); - } - - if (value.preserve) { - parts.push("~"); - } else if (!value.interpolate) { - parts.push("="); - } - - if (value.escape_html && !value.preserve && value.interpolate) { - parts.push(" ", value.text.trim().slice(1, -1)); - } else { - parts.push(" ", value.text.trim()); - } - - return printWithChildren(node, group(parts)); - } - // https://haml.info/docs/yardoc/file.REFERENCE.html#running-ruby-- - case "silent_script": { - const parts: Plugin.Doc[] = [`- ${node.value.text.trim()}`]; - - if (node.children.length > 0) { - const nodePath = path as Plugin.Path; - - parts.push( - nodePath.map((childPath) => { - const child = childPath.getValue(); - const concated = [hardline, print(childPath)]; - - return isContinuation(node, child) ? concated : indent(concated); - }, "children") - ); - } - - return group(parts); - } - // https://haml.info/docs/yardoc/file.REFERENCE.html#element-name- - case "tag": { - const { value } = node; - const { attributes, dynamic_attributes } = value; - const parts = []; - - // If we have a tag that isn't a div, then we need to print out that - // name of that tag first. If it is a div, first we'll check if there - // are any other things that would force us to print out the div - // explicitly, and otherwise we'll leave it off. - if (value.name !== "div") { - parts.push(`%${value.name}`); - } - - // If we have a class attribute, then we're going to print that here - // using the special class syntax. - if (attributes.class) { - parts.push(`.${attributes.class.replace(/ /g, ".")}`); - } - - // If we have an id attribute, then we're going to print that here using - // the special id syntax. - if (attributes.id) { - parts.push(`#${attributes.id}`); - } - - // If we're using dynamic attributes on this tag, then they come in as a - // string that looks like the output of Hash#inspect from Ruby. So here - // we're going to split it all up and print it out nicely. - if (dynamic_attributes.new) { - const docs: Plugin.Doc[] = []; - - dynamic_attributes.new - .slice(1, -2) - .split(",") - .forEach((pair, index) => { - if (index !== 0) { - docs.push(line); - } - docs.push(join("=", pair.slice(1).split('" => '))); - }); - - parts.push( - group(["(", align(parts.join("").length + 1, fill(docs)), ")"]) - ); - } - - // If there are any static attributes that are not class or id (because - // we already took care of those), then we're going to print them out - // here. - const staticAttributes = Object.keys(attributes).filter( - (name) => !["class", "id"].includes(name) - ); - - if (staticAttributes.length > 0) { - const docs = staticAttributes.reduce((accum, key) => { - const doc = `${printHashKey(key, opts)} ${printHashValue( - attributes[key], - opts - )}`; - - return accum.length === 0 ? [doc] : [...accum, ",", line, doc]; - }, [] as Plugin.Doc[]); - - parts.push( - group(["{", align(parts.join("").length + 1, fill(docs)), "}"]) - ); - } - - // If there are dynamic attributes that don't use the newer syntax, then - // we're going to print them out here. - if (dynamic_attributes.old) { - if (parts.length === 0) { - parts.push("%div"); - } - - if (typeof dynamic_attributes.old === "string") { - parts.push(dynamic_attributes.old); - } else { - // This is kind of a total hack in that I don't think you're - // really supposed to directly use `path.stack`, but it's the - // easiest way to get the root node without having to know how - // many levels deep we are. - const root = path.stack[0] as HAML.Root; - - parts.push( - printAttributes(dynamic_attributes.old, { - ...opts, - supportsMultiline: root.supports_multiline, - headerLength: parts.join("").length - }) - ); - } - } - - // https://haml.info/docs/yardoc/file.REFERENCE.html#object-reference- - if (value.object_ref) { - if (parts.length === 0) { - parts.push("%div"); - } - parts.push(value.object_ref); - } - - // https://haml.info/docs/yardoc/file.REFERENCE.html#whitespace-removal--and- - if (value.nuke_outer_whitespace) { - parts.push(">"); - } - - if (value.nuke_inner_whitespace) { - parts.push("<"); - } - - // https://haml.info/docs/yardoc/file.REFERENCE.html#empty-void-tags- - if (value.self_closing) { - parts.push("/"); - } - - if (value.value) { - let contents: Plugin.Doc[]; - - if (value.parse && value.value.match(/#[{$@]/)) { - // There's a weird case here where if the value includes - // interpolation and it's marked as { parse: true }, then we don't - // actually want the = prefix, and we want to remove extra escaping. - contents = [ - ifBreak("", " "), - value.value.slice(1, -1).replace(/\\"/g, '"') - ]; - } else if (value.parse) { - contents = ["= ", value.value]; - } else { - contents = [ifBreak("", " "), value.value]; - } - - return printWithChildren( - node, - group([group(parts), indent([softline, ...contents])]) - ); - } - - // In case none of the other if statements have matched and we're - // printing a div, we need to explicitly add it back into the array. - if (parts.length === 0 && value.name === "div") { - parts.push("%div"); - } - - return printWithChildren(node, group(parts)); - } - default: - throw new Error(`Unsupported node encountered: ${(node as any).type}`); - } - - // It's common to a couple of nodes to attach nested child nodes on the - // children property. This utility prints them out grouped together with - // their parent node docs. - function printWithChildren( - node: HAML.Comment | HAML.Script | HAML.Tag, - docs: Plugin.Doc - ) { - if (node.children.length === 0) { - return docs; - } - - const nodePath = path as Plugin.Path; - - return group([ - docs, - indent([hardline, join(hardline, nodePath.map(print, "children"))]) - ]); - } - }, - // This function handles adding the format pragma to a source string. This is - // an optional workflow for incremental adoption. - insertPragma(text) { - return `-# @format${text.startsWith("-#") ? "\n" : "\n\n"}${text}`; - } -}; - -export default printer; diff --git a/src/plugin.ts b/src/plugin.ts index 14531719..4a6ff5ab 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -2,11 +2,11 @@ import type { Plugin, SupportLanguage } from "prettier"; import parseSync from "./parseSync"; interface ExtendedSupportLanguage extends SupportLanguage { - interpreters?: string[] + interpreters?: string[]; } interface ExtendedPlugin extends Omit { - languages: ExtendedSupportLanguage[] + languages: ExtendedSupportLanguage[]; } /* @@ -142,7 +142,7 @@ const plugin: ExtendedPlugin = { }, insertPragma(text) { return `# @format${text.startsWith("#") ? "\n" : "\n\n"}${text}`; - }, + } }, rbs: { print(path) { diff --git a/src/ruby/nodes/blocks.ts b/src/ruby/nodes/blocks.ts deleted file mode 100644 index 27f1ec2e..00000000 --- a/src/ruby/nodes/blocks.ts +++ /dev/null @@ -1,131 +0,0 @@ -import type { Plugin, Ruby } from "../../types"; -import prettier from "../../prettier"; -import { hasAncestor } from "../../utils"; - -const { breakParent, group, ifBreak, indent, join, removeLines, softline } = - prettier; - -export const printBlockVar: Plugin.Printer = ( - path, - opts, - print -) => { - const parts = ["|", removeLines(path.call(print, "params"))]; - - // The second part of this node is a list of optional block-local variables - if (path.getValue().locals.length > 0) { - parts.push("; ", join(", ", path.map(print, "locals"))); - } - - parts.push("| "); - return parts; -}; - -// You have to go through the main print function if you could potentially have -// comments attached. So we're doing this weird reflection on the printed docs -// to retroactively change the printed keyword depending on if we're using -// braces or not. Ideally we wouldn't do this, we would instead do this -// reflection in the child printer, but this keeps the logic to just this file -// and contains it, so keeping it here for now. -function printBlockBegin( - path: Plugin.Path, - print: Plugin.Print, - useBraces: boolean -) { - let docs = print(path); - const doc = useBraces && !path.getValue().comments ? "{" : "do"; - - if (Array.isArray(docs)) { - docs[1] = doc; - } else { - docs = doc; - } - - return docs; -} - -type Block = Ruby.BraceBlock | Ruby.DoBlock; - -function printBlock(braces: boolean): Plugin.Printer { - return function printBlockWithBraces(path, opts, print) { - const node = path.getValue(); - let stmts: Ruby.AnyNode[]; - - if (node.type === "brace_block") { - stmts = node.stmts.body; - } else if ((node as any).bodystmt.type === "statements") { - // This is here to fix an issue in JRuby where it doesn't correctly - // support rescue/else/ensure inside blocks. - stmts = (node as any).bodystmt.body; - } else { - stmts = node.bodystmt.stmts.body; - } - - let doBlockBody: Plugin.Doc = ""; - if ( - stmts.length !== 1 || - stmts[0].type !== "void_stmt" || - stmts[0].comments - ) { - doBlockBody = indent([ - softline, - path.call(print, node.type === "brace_block" ? "stmts" : "bodystmt") - ]); - } - - // If this block is nested underneath a command or command_call node, then - // we can't use `do...end` because that will get associated with the parent - // node as opposed to the current node (because of the difference in - // operator precedence). Instead, we still use a multi-line format but - // switch to using braces instead. - const useBraces = braces && hasAncestor(path, ["command", "command_call"]); - - const doBlock = [ - " ", - path.call( - (beginPath) => printBlockBegin(beginPath, print, useBraces), - node.type === "brace_block" ? "lbrace" : "keyword" - ), - node.block_var ? [" ", path.call(print, "block_var")] : "", - doBlockBody, - [softline, useBraces ? "}" : "end"] - ]; - - // We can hit this next pattern if within the block the only statement is a - // comment. - if ( - stmts.length === 1 && - stmts[0].type === "void_stmt" && - stmts[0].comments - ) { - return [breakParent, doBlock]; - } - - const blockReceiver = (path.getParentNode() as Ruby.MethodAddBlock).call; - - // If the parent node is a command node, then there are no parentheses - // around the arguments to that command, so we need to break the block - if (["command", "command_call"].includes(blockReceiver.type)) { - return [breakParent, doBlock]; - } - - const hasBody = stmts.some(({ type }) => type !== "void_stmt"); - const braceBlock = [ - " ", - path.call( - (beginPath) => printBlockBegin(beginPath, print, true), - node.type === "brace_block" ? "lbrace" : "keyword" - ), - hasBody || node.block_var ? " " : "", - node.block_var ? path.call(print, "block_var") : "", - path.call(print, node.type === "brace_block" ? "stmts" : "bodystmt"), - hasBody ? " " : "", - "}" - ]; - - return group(ifBreak(doBlock, braceBlock)); - }; -} - -export const printBraceBlock = printBlock(true); -export const printDoBlock = printBlock(false); diff --git a/src/server.rb b/src/server.rb index 8c813e8d..dfb08aa3 100644 --- a/src/server.rb +++ b/src/server.rb @@ -1,14 +1,14 @@ # frozen_string_literal: true -require 'bundler/setup' -require 'socket' -require 'json' -require 'fileutils' -require 'open3' +require "bundler/setup" +require "socket" +require "json" +require "fileutils" +require "open3" -require 'syntax_tree' -require 'syntax_tree/haml' -require 'syntax_tree/rbs' +require "syntax_tree" +require "syntax_tree/haml" +require "syntax_tree/rbs" # Make sure we trap these signals to be sure we get the quit command coming from # the parent node process @@ -16,13 +16,13 @@ trap(:INT) { quit = true } trap(:TERM) { quit = true } -if Signal.list.key?('QUIT') && RUBY_ENGINE != 'jruby' +if Signal.list.key?("QUIT") && RUBY_ENGINE != "jruby" trap(:QUIT) { quit = true } end # The information variable stores the actual connection information, which will # either be an IP address and port or a path to a unix socket file. -information = '' +information = "" # The candidates array is a list of potential programs that could be used to # connect to our server. We'll run through them after the server starts to find @@ -32,7 +32,7 @@ if Gem.win_platform? # If we're on windows, we're going to start up a TCP server. The 0 here means # to bind to some available port. - server = TCPServer.new('127.0.0.1', 0) + server = TCPServer.new("127.0.0.1", 0) address = server.local_address # Ensure that we close the server when this process exits. @@ -54,7 +54,7 @@ end information = server.local_address.unix_path - candidates = ['nc -w 3 -U', 'ncat -w 3 -U'] + candidates = ["nc -w 3 -U", "ncat -w 3 -U"] end # This is the actual listening thread that will be acting as our server. We have @@ -68,23 +68,30 @@ # Start up a new thread that will handle each successive connection. Thread.new(server.accept_nonblock) do |socket| - parser, source = socket.read.split('|', 2) - - # First, ensure we get the right encoding for this string. - encoding = - source.each_line do |line| - # Skip past the first line if it contains a shebang so that we get - # to the encoding line. - next if line.start_with?("#!") - - # If the line isn't an encoding magic comment, we're going to - # default to UTF-8. - break "UTF-8" unless line.include?("coding") - - # Otherwise, we're going to use Ripper to try to extract out the - # encoding from the magic comment. - break Ripper.new(line).tap(&:parse).encoding + parser, source = socket.read.split("|", 2) + + # First, ensure we get the right encoding for this string. To do this + # we're going to find all of the comments at the top of the file first + # that contain comments. Then we'll pass them through ripper to find the + # encoding. + lines = [] + + source.each_line do |line| + if line.start_with?(/\s*#/) + lines << line + else + break end + end + + # We're going to default to UTF-8 in case we can't find the correct + # encoding. + encoding = "UTF-8" + comments = lines.join + + if comments.include?("coding") + encoding = Ripper.new(comments).tap(&:parse).encoding + end # Now that we have our guessed encoding, we're going to force it into # the string so that it gets parsed correctly. @@ -92,20 +99,20 @@ response = case parser - when 'ping' - 'pong' - when 'ruby' + when "ping" + "pong" + when "ruby" SyntaxTree.format(source) - when 'rbs' + when "rbs" SyntaxTree::RBS.format(source) - when 'haml' + when "haml" SyntaxTree::Haml.format(source) end if response socket.write(JSON.fast_generate(response)) else - socket.write('{ "error": true }') + socket.write("{ \"error\": true }") end rescue SyntaxTree::Parser::ParseError => error loc = { start: { line: error.lineno, column: error.column } } @@ -137,9 +144,9 @@ # We do not care about stderr here, so throw it away stdout, _stderr, status = - Open3.capture3("#{candidate} #{information}", stdin_data: 'ping') + Open3.capture3("#{candidate} #{information}", stdin_data: "ping") - candidate if JSON.parse(stdout) == 'pong' && status.exitstatus == 0 + candidate if JSON.parse(stdout) == "pong" && status.exitstatus == 0 rescue StandardError # We don't actually care if this fails, because we'll just skip that # connection option. @@ -155,7 +162,7 @@ # Default to running the netcat.js script that we ship with the plugin. It's a # good fallback as it will always work, but it is slower than the other options. -prefix ||= "node #{File.expand_path('netcat.js', __dir__)}" +prefix ||= "node #{File.expand_path("netcat.js", __dir__)}" # Write out our connection information to the file given as the first argument # to this script. diff --git a/src/utils/getChildNodes.ts b/src/utils/getChildNodes.ts deleted file mode 100644 index e6c771bd..00000000 --- a/src/utils/getChildNodes.ts +++ /dev/null @@ -1,326 +0,0 @@ -import type { Ruby } from "../types"; - -type AnyNode = Ruby.AnyNode | Ruby.VoidStmt; -type ChildNode = AnyNode | null; - -function throwBadNode(node: never): never; -function throwBadNode(node: AnyNode) { - throw new Error(`Unknown node ${node.type}`); -} - -function getChildNodes(node: AnyNode | Ruby.Comment): ChildNode[] { - switch (node.type) { - case "CHAR": - case "__end__": - case "backref": - case "backtick": - case "comment": - case "const": - case "cvar": - case "float": - case "gvar": - case "heredoc_beg": - case "ident": - case "imaginary": - case "int": - case "ivar": - case "kw": - case "label": - case "lbrace": - case "lparen": - case "op": - case "period": - case "rational": - case "tstring_content": - return []; - case "BEGIN": - return [node.lbrace, node.stmts]; - case "END": - return [node.lbrace, node.stmts]; - case "access_ctrl": - return [node.value]; - case "alias": - return [node.left, node.right]; - case "aref": - return [node.collection, node.index]; - case "aref_field": - return [node.collection, node.index]; - case "arg_paren": - return [node.args]; - case "args": - return node.parts; - case "args_add_block": - return [node.args, node.block]; - case "args_forward": - return []; - case "arg_star": - return [node.value]; - case "array": - return [node.cnts]; - case "aryptn": - return [node.constant, ...node.reqs, node.rest, ...node.posts]; - case "assign": - return [node.target, node.value]; - case "assoc": - return [node.key, node.value]; - case "assoc_splat": - return [node.value]; - case "assoclist_from_args": - return node.assocs; - case "bare_assoc_hash": - return node.assocs; - case "begin": - return [node.bodystmt]; - case "binary": - return [node.left, node.right]; - case "block_var": - return [node.params, ...node.locals]; - case "blockarg": - return [node.name]; - case "bodystmt": - return [node.stmts, node.rsc, node.els, node.ens]; - case "brace_block": - return [node.lbrace, node.block_var, node.stmts]; - case "break": - return [node.args]; - case "call": { - const childNodes: ChildNode[] = [node.receiver]; - - if (node.op !== "::") { - childNodes.push(node.op); - } - - if (node.message !== "call") { - childNodes.push(node.message); - } - - return childNodes; - } - case "case": - return [node.value, node.cons]; - case "class": - return [node.constant, node.superclass, node.bodystmt]; - case "command": - return [node.message, node.args]; - case "command_call": - return [node.receiver, node.message, node.args]; - case "const_path_field": - return [node.parent, node.constant]; - case "const_path_ref": - return [node.parent, node.constant]; - case "const_ref": - return [node.constant]; - case "def": - return [node.name, node.params, node.bodystmt]; - case "def_endless": - return [node.name, node.paren, node.stmt]; - case "defined": - return [node.value]; - case "defs": - return [node.target, node.op, node.name, node.params, node.bodystmt]; - case "do_block": - return [node.keyword, node.block_var, node.bodystmt]; - case "dot2": - return [node.left, node.right]; - case "dot3": - return [node.left, node.right]; - case "dyna_symbol": - return node.parts; - case "else": - return [node.stmts]; - case "elsif": - return [node.pred, node.stmts, node.cons]; - case "ensure": - return [node.keyword, node.stmts]; - case "excessed_comma": - return []; - case "fcall": - return [node.value]; - case "field": { - const childNodes: ChildNode[] = [node.parent]; - - if (node.op !== "::") { - childNodes.push(node.op); - } - - childNodes.push(node.name); - return childNodes; - } - case "fndptn": - return [node.constant, node.left, ...node.values, node.right]; - case "for": - return [node.index, node.collection, node.stmts]; - case "hash": - return [node.cnts]; - case "heredoc": - return [node.beging, ...node.parts]; - case "hshptn": { - const childNodes: ChildNode[] = [node.constant]; - - node.keywords.forEach(([key, value]) => { - childNodes.push(key, value); - }); - - childNodes.push(node.kwrest); - return childNodes; - } - case "if": - return [node.pred, node.stmts, node.cons]; - case "ifop": - return [node.pred, node.tthy, node.flsy]; - case "if_mod": - return [node.stmt, node.pred]; - case "in": - return [node.pattern, node.stmts, node.cons]; - case "kwrest_param": - return [node.name]; - case "lambda": - return [node.params, node.stmts]; - case "massign": - return [node.target, node.value]; - case "method_add_arg": - return [node.call, node.args]; - case "method_add_block": - return [node.call, node.block]; - case "mlhs": - return node.parts; - case "mlhs_paren": - return [node.cnts]; - case "module": - return [node.constant, node.bodystmt]; - case "mrhs": - return node.parts; - case "mrhs_add_star": - return [node.mrhs, node.star]; - case "mrhs_new_from_args": - return [node.args]; - case "next": - return [node.args]; - case "not": - return [node.value]; - case "opassign": - return [node.target, node.op, node.value]; - case "params": { - let childNodes: ChildNode[] = [...node.reqs]; - - node.opts.forEach(([key, value]) => { - childNodes.push(key, value); - }); - - childNodes.push(node.rest); - childNodes = childNodes.concat(node.posts); - - node.keywords.forEach(([key, value]) => { - childNodes.push(key); - - if (value) { - childNodes.push(value); - } - }); - - if (node.kwrest && node.kwrest !== "nil") { - childNodes.push(node.kwrest); - } - - if (node.block) { - childNodes.push(node.block); - } - - return childNodes; - } - case "paren": - return [node.lparen, node.cnts]; - case "program": - return [node.stmts]; - case "qsymbols": - return []; - case "qwords": - return []; - case "rassign": - return [node.value, node.op, node.pattern]; - case "redo": - return []; - case "regexp_literal": - return node.parts; - case "rescue": - return [node.extn, node.stmts, node.cons]; - case "rescue_ex": - return [node.extns, node.var]; - case "rescue_mod": - return [node.stmt, node.value]; - case "rest_param": - return [node.name]; - case "retry": - return []; - case "return": - return [node.args]; - case "return0": - return []; - case "sclass": - return [node.target, node.bodystmt]; - case "statements": - return node.body; - case "string_concat": - return [node.left, node.right]; - case "string_dvar": - return [node.var]; - case "string_embexpr": - return [node.stmts]; - case "string_literal": - return node.parts; - case "super": - return [node.args]; - case "symbol_literal": - return [node.value]; - case "symbols": - return []; - case "top_const_field": - return [node.constant]; - case "top_const_ref": - return [node.constant]; - case "unary": - return [node.value]; - case "undef": - return node.syms; - case "unless": - return [node.pred, node.stmts, node.cons]; - case "unless_mod": - return [node.stmt, node.pred]; - case "until": - return [node.pred, node.stmts]; - case "until_mod": - return [node.stmt, node.pred]; - case "var_alias": - return [node.left, node.right]; - case "var_field": - return [node.value]; - case "var_ref": - return [node.value]; - case "vcall": - return [node.value]; - case "void_stmt": - return []; - case "when": - return [node.args, node.stmts, node.cons]; - case "while": - return [node.pred, node.stmts]; - case "while_mod": - return [node.stmt, node.pred]; - case "word": - return node.parts; - case "words": - return []; - case "xstring_literal": - return node.parts; - case "yield": - return [node.args]; - case "yield0": - return []; - case "zsuper": - return []; - default: - throwBadNode(node); - } -} - -export default getChildNodes; diff --git a/test/js/rbs/rbs.test.ts b/test/js/rbs/rbs.test.ts index d1a8918c..a1e6dd86 100644 --- a/test/js/rbs/rbs.test.ts +++ b/test/js/rbs/rbs.test.ts @@ -235,11 +235,15 @@ describe("rbs", () => { }); test("unescapes double quotes when using single quotes", () => { - expect(rbs(`T: "super \\" duper"`)).toChangeFormat(`T: "super \\" duper"`); + expect(rbs(`T: "super \\" duper"`)).toChangeFormat( + `T: "super \\" duper"` + ); }); test("unescapes single quotes when using double quotes", () => { - expect(rbs(`T: 'super \\' duper'`)).toChangeFormat(`T: 'super \\' duper'`); + expect(rbs(`T: 'super \\' duper'`)).toChangeFormat( + `T: 'super \\' duper'` + ); }); test("maintains escape sequences when using double quotes", () => { diff --git a/test/js/setupTests.ts b/test/js/setupTests.ts index 818c2592..593ecb94 100644 --- a/test/js/setupTests.ts +++ b/test/js/setupTests.ts @@ -1,25 +1,18 @@ import prettier from "prettier"; -import type * as Prettier from "prettier"; import type { Code } from "./types"; import plugin from "../../src/plugin"; -type Config = Partial & { - printer: Omit & { printComment: () => any } -}>; - function normalize(code: Code) { const string = typeof code === "string" ? code : code.code; return string.replace(/\r?\n/g, "\n").trim(); } -function checkFormat(before: Code, after: Code, config: Config) { +function checkFormat(before: Code, after: Code) { const originalText = typeof before === "string" ? before : before.code; const formatted = prettier.format(originalText, { parser: typeof before === "string" ? "ruby" : before.parser, - originalText, - plugins: [plugin as any as string], - ...config + plugins: [plugin as any as string] }); const expected = normalize(after); @@ -32,11 +25,11 @@ function checkFormat(before: Code, after: Code, config: Config) { } expect.extend({ - toChangeFormat(before: Code, after: Code, config: Config = {}) { - return checkFormat(before, after, config); + toChangeFormat(before: Code, after: Code) { + return checkFormat(before, after); }, - toMatchFormat(before: Code, config: Config = {}) { - return checkFormat(before, before, config); + toMatchFormat(before: Code) { + return checkFormat(before, before); } }); @@ -45,8 +38,8 @@ declare global { namespace jest { // eslint-disable-next-line @typescript-eslint/no-unused-vars interface Matchers { - toChangeFormat(after: Code, config?: Config): CustomMatcherResult; - toMatchFormat(config?: Config): CustomMatcherResult; + toChangeFormat(after: Code): CustomMatcherResult; + toMatchFormat(): CustomMatcherResult; } } } diff --git a/test/rb/rake_test.rb b/test/rb/rake_test.rb index ab3335c3..65891544 100644 --- a/test/rb/rake_test.rb +++ b/test/rb/rake_test.rb @@ -1,13 +1,13 @@ # frozen_string_literal: true -require 'test_helper' -require 'prettier/rake/task' +require "test_helper" +require "prettier/rake/task" class RakeTest < Minitest::Test Invoke = Struct.new(:args) def test_task - source_files = '{app,config,lib}/**/*.rb' + source_files = "{app,config,lib}/**/*.rb" Prettier::Rake::Task.new do |t| t.name = :format t.write = true @@ -16,9 +16,9 @@ def test_task invoke = nil Prettier.stub(:run, ->(args) { invoke = Invoke.new(args) }) do - Rake::Task['format'].invoke + Rake::Task["format"].invoke end - assert_equal ['--write', source_files], invoke.args + assert_equal ["--write", source_files], invoke.args end end diff --git a/test/rb/test_helper.rb b/test/rb/test_helper.rb index 4b93f91d..f223f7f0 100644 --- a/test/rb/test_helper.rb +++ b/test/rb/test_helper.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -$LOAD_PATH.unshift(File.expand_path('../../lib', __dir__)) +$LOAD_PATH.unshift(File.expand_path("../../lib", __dir__)) -require 'prettier' -require 'minitest/autorun' +require "prettier" +require "minitest/autorun" diff --git a/test/rb/version_test.rb b/test/rb/version_test.rb index 9d55356e..289590be 100644 --- a/test/rb/version_test.rb +++ b/test/rb/version_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'test_helper' +require "test_helper" class VersionTest < Minitest::Test def test_version From 22652c66404cc1bfe789fd2cbdc2d36f8260871c Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 22 Apr 2022 14:39:03 -0400 Subject: [PATCH 583/785] Update to latest RBS version --- prettier.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prettier.gemspec b/prettier.gemspec index 7ad78393..79daa149 100644 --- a/prettier.gemspec +++ b/prettier.gemspec @@ -29,7 +29,7 @@ Gem::Specification.new do |spec| spec.add_dependency "syntax_tree" spec.add_dependency "syntax_tree-haml" - spec.add_dependency "syntax_tree-rbs" + spec.add_dependency "syntax_tree-rbs", ">= 0.2.0" spec.add_dependency "rbs", "~> 2" spec.add_development_dependency "bundler" From 235833640695d506f55d81c76e90d42c12b6b71f Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 22 Apr 2022 14:51:04 -0400 Subject: [PATCH 584/785] Update to latest dependencies --- prettier.gemspec | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/prettier.gemspec b/prettier.gemspec index 79daa149..62a944a9 100644 --- a/prettier.gemspec +++ b/prettier.gemspec @@ -27,10 +27,9 @@ Gem::Specification.new do |spec| spec.executables = "rbprettier" spec.require_paths = %w[lib] - spec.add_dependency "syntax_tree" - spec.add_dependency "syntax_tree-haml" + spec.add_dependency "syntax_tree", ">= 2.0.1" + spec.add_dependency "syntax_tree-haml", ">= 1.1.0" spec.add_dependency "syntax_tree-rbs", ">= 0.2.0" - spec.add_dependency "rbs", "~> 2" spec.add_development_dependency "bundler" spec.add_development_dependency "minitest" From de35a67f52c9ef43f159319b53ca5a4609babb83 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 22 Apr 2022 15:12:46 -0400 Subject: [PATCH 585/785] Simplify encoding work --- src/server.rb | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/src/server.rb b/src/server.rb index dfb08aa3..67d05ac2 100644 --- a/src/server.rb +++ b/src/server.rb @@ -70,33 +70,6 @@ Thread.new(server.accept_nonblock) do |socket| parser, source = socket.read.split("|", 2) - # First, ensure we get the right encoding for this string. To do this - # we're going to find all of the comments at the top of the file first - # that contain comments. Then we'll pass them through ripper to find the - # encoding. - lines = [] - - source.each_line do |line| - if line.start_with?(/\s*#/) - lines << line - else - break - end - end - - # We're going to default to UTF-8 in case we can't find the correct - # encoding. - encoding = "UTF-8" - comments = lines.join - - if comments.include?("coding") - encoding = Ripper.new(comments).tap(&:parse).encoding - end - - # Now that we have our guessed encoding, we're going to force it into - # the string so that it gets parsed correctly. - source = source.force_encoding(encoding) - response = case parser when "ping" @@ -110,7 +83,7 @@ end if response - socket.write(JSON.fast_generate(response)) + socket.write(JSON.fast_generate(response.force_encoding("UTF-8"))) else socket.write("{ \"error\": true }") end From 90bf53655e858b40f92d340ffef5ee8d8cbc4605 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 22 Apr 2022 15:13:21 -0400 Subject: [PATCH 586/785] Simplify Ruby versions --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fa400c7e..93956cbc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,9 +13,9 @@ jobs: - ubuntu-latest - windows-latest ruby: - - "2.7.5" - - "3.0" - - "3.1" + - '2.7' + - '3.0' + - '3.1' runs-on: ${{ matrix.platform }} env: PLUGIN_RUBY_CI: true From 36ba3985c13e4d6efac6fe28d1d0d7a0832023f1 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 22 Apr 2022 15:18:34 -0400 Subject: [PATCH 587/785] Reformat with prettier --- .github/workflows/main.yml | 6 +++--- src/server.rb | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 93956cbc..bdd529fe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,9 +13,9 @@ jobs: - ubuntu-latest - windows-latest ruby: - - '2.7' - - '3.0' - - '3.1' + - "2.7" + - "3.0" + - "3.1" runs-on: ${{ matrix.platform }} env: PLUGIN_RUBY_CI: true diff --git a/src/server.rb b/src/server.rb index 67d05ac2..8da4c065 100644 --- a/src/server.rb +++ b/src/server.rb @@ -68,7 +68,22 @@ # Start up a new thread that will handle each successive connection. Thread.new(server.accept_nonblock) do |socket| - parser, source = socket.read.split("|", 2) + parser, source = socket.read.force_encoding("UTF-8").split("|", 2) + + source.each_line do |line| + case line + when /^\s*#.+?coding/ + # If we've found an encoding comment, then we're going to take that + # into account and reclassify the encoding for the source. + encoding = Ripper.new(line).tap(&:parse).encoding + source = source.force_encoding(encoding) + break + when /^\s*#/ + # continue + else + break + end + end response = case parser From 2b7c5730fabb21490cc4b5b81fa87973ccaf2125 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 22 Apr 2022 15:41:21 -0400 Subject: [PATCH 588/785] Ignore macos and ubuntu for yarn pnp test for now --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bdd529fe..f7933201 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -59,8 +59,8 @@ jobs: fail-fast: false matrix: platform: - - macos-latest - - ubuntu-latest + # - macos-latest + # - ubuntu-latest - windows-latest yarn: - 2.x From 2d6df00164238cfff6dd39eb6d9c7b4baa9716a9 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 22 Apr 2022 15:50:17 -0400 Subject: [PATCH 589/785] Update to latest syntax tree --- README.md | 2 +- prettier.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6b72a543..3001f821 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ d = [ a, s = [], $*[0] s.each_byte { |b| a << ("%036b" % d[b.chr.to_i]).scan(/\d{6}/) } a.transpose.each do |a| - a.join.each_byte { |i| printi == 49 ? ($*[1] || "#") : 32.chr } + a.join.each_byte { |i| print i == 49 ? ($*[1] || "#") : 32.chr } puts end ``` diff --git a/prettier.gemspec b/prettier.gemspec index 62a944a9..0c7990fc 100644 --- a/prettier.gemspec +++ b/prettier.gemspec @@ -27,7 +27,7 @@ Gem::Specification.new do |spec| spec.executables = "rbprettier" spec.require_paths = %w[lib] - spec.add_dependency "syntax_tree", ">= 2.0.1" + spec.add_dependency "syntax_tree", ">= 2.3.1" spec.add_dependency "syntax_tree-haml", ">= 1.1.0" spec.add_dependency "syntax_tree-rbs", ">= 0.2.0" From f38684608677db74481333c6659e745f5c04204e Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 22 Apr 2022 16:21:08 -0400 Subject: [PATCH 590/785] Strip typescript --- .eslintignore | 1 - .github/workflows/main.yml | 3 - .gitignore | 1 - .prettierignore | 1 - bin/{doc.ts => doc} | 11 +- bin/pragma | 6 + bin/pragma.ts | 6 - bin/{print.ts => print} | 12 +- lib/prettier.rb | 4 +- package.json | 28 +- prettier.gemspec | 2 +- src/getInfo.js | 1 - src/netcat.js | 1 - src/{parseSync.ts => parseSync.js} | 37 +- src/{plugin.ts => plugin.js} | 15 +- test/js/{files.test.ts => files.test.js} | 11 +- test/js/{globalSetup.ts => globalSetup.js} | 10 +- .../{globalTeardown.ts => globalTeardown.js} | 2 +- .../haml/{comment.test.ts => comment.test.js} | 2 +- .../haml/{doctype.test.ts => doctype.test.js} | 2 +- .../haml/{filter.test.ts => filter.test.js} | 2 +- ...amlComment.test.ts => hamlComment.test.js} | 2 +- test/js/haml/{plain.test.ts => plain.test.js} | 2 +- .../haml/{script.test.ts => script.test.js} | 2 +- ...entScript.test.ts => silentScript.test.js} | 2 +- test/js/haml/{tag.test.ts => tag.test.js} | 2 +- test/js/rbs/{rbs.test.ts => rbs.test.js} | 12 +- .../{comments.test.ts => comments.test.js} | 2 +- .../{encoding.test.ts => encoding.test.js} | 0 .../ruby/{errors.test.ts => errors.test.js} | 2 +- .../ruby/{ignore.test.ts => ignore.test.js} | 2 +- .../ruby/{layout.test.ts => layout.test.js} | 2 +- .../nodes/{alias.test.ts => alias.test.js} | 2 +- .../ruby/nodes/{aref.test.ts => aref.test.js} | 2 +- .../nodes/{arrays.test.ts => arrays.test.js} | 2 +- .../nodes/{assign.test.ts => assign.test.js} | 2 +- .../nodes/{binary.test.ts => binary.test.js} | 2 +- .../nodes/{blocks.test.ts => blocks.test.js} | 2 +- .../nodes/{break.test.ts => break.test.js} | 2 +- .../nodes/{calls.test.ts => calls.test.js} | 2 +- .../ruby/nodes/{case.test.ts => case.test.js} | 2 +- .../nodes/{class.test.ts => class.test.js} | 2 +- ...ditionals.test.ts => conditionals.test.js} | 2 +- .../{defined.test.ts => defined.test.js} | 2 +- .../nodes/{embdoc.test.ts => embdoc.test.js} | 2 +- .../nodes/{field.test.ts => field.test.js} | 0 .../nodes/{hashes.test.ts => hashes.test.js} | 2 +- .../{heredocs.test.ts => heredocs.test.js} | 2 +- .../nodes/{hooks.test.ts => hooks.test.js} | 2 +- .../nodes/{kwargs.test.ts => kwargs.test.js} | 0 .../nodes/{lambda.test.ts => lambda.test.js} | 2 +- .../nodes/{loops.test.ts => loops.test.js} | 2 +- .../{massign.test.ts => massign.test.js} | 0 .../nodes/{method.test.ts => method.test.js} | 2 +- .../ruby/nodes/{next.test.ts => next.test.js} | 2 +- .../{numbers.test.ts => numbers.test.js} | 0 .../{patterns.test.ts => patterns.test.js} | 2 +- .../nodes/{ranges.test.ts => ranges.test.js} | 2 +- .../nodes/{regexp.test.ts => regexp.test.js} | 2 +- .../nodes/{rescue.test.ts => rescue.test.js} | 2 +- .../nodes/{return.test.ts => return.test.js} | 2 +- .../{strings.test.ts => strings.test.js} | 2 +- .../nodes/{super.test.ts => super.test.js} | 2 +- .../nodes/{unary.test.ts => unary.test.js} | 0 .../nodes/{undef.test.ts => undef.test.js} | 2 +- .../nodes/{yield.test.ts => yield.test.js} | 0 test/js/{setupTests.ts => setupTests.js} | 26 +- test/js/types.ts | 4 - test/js/{utils.ts => utils.js} | 25 +- tsconfig.build.json | 4 - tsconfig.json | 12 - yarn.lock | 363 +----------------- 72 files changed, 146 insertions(+), 532 deletions(-) rename bin/{doc.ts => doc} (61%) create mode 100755 bin/pragma delete mode 100755 bin/pragma.ts rename bin/{print.ts => print} (77%) rename src/{parseSync.ts => parseSync.js} (88%) rename src/{plugin.ts => plugin.js} (90%) rename test/js/{files.test.ts => files.test.js} (54%) rename test/js/{globalSetup.ts => globalSetup.js} (84%) rename test/js/{globalTeardown.ts => globalTeardown.js} (93%) rename test/js/haml/{comment.test.ts => comment.test.js} (94%) rename test/js/haml/{doctype.test.ts => doctype.test.js} (95%) rename test/js/haml/{filter.test.ts => filter.test.js} (92%) rename test/js/haml/{hamlComment.test.ts => hamlComment.test.js} (92%) rename test/js/haml/{plain.test.ts => plain.test.js} (90%) rename test/js/haml/{script.test.ts => script.test.js} (95%) rename test/js/haml/{silentScript.test.ts => silentScript.test.js} (96%) rename test/js/haml/{tag.test.ts => tag.test.js} (98%) rename test/js/rbs/{rbs.test.ts => rbs.test.js} (96%) rename test/js/ruby/{comments.test.ts => comments.test.js} (99%) rename test/js/ruby/{encoding.test.ts => encoding.test.js} (100%) rename test/js/ruby/{errors.test.ts => errors.test.js} (91%) rename test/js/ruby/{ignore.test.ts => ignore.test.js} (85%) rename test/js/ruby/{layout.test.ts => layout.test.js} (95%) rename test/js/ruby/nodes/{alias.test.ts => alias.test.js} (97%) rename test/js/ruby/nodes/{aref.test.ts => aref.test.js} (94%) rename test/js/ruby/nodes/{arrays.test.ts => arrays.test.js} (98%) rename test/js/ruby/nodes/{assign.test.ts => assign.test.js} (98%) rename test/js/ruby/nodes/{binary.test.ts => binary.test.js} (93%) rename test/js/ruby/nodes/{blocks.test.ts => blocks.test.js} (99%) rename test/js/ruby/nodes/{break.test.ts => break.test.js} (95%) rename test/js/ruby/nodes/{calls.test.ts => calls.test.js} (99%) rename test/js/ruby/nodes/{case.test.ts => case.test.js} (97%) rename test/js/ruby/nodes/{class.test.ts => class.test.js} (98%) rename test/js/ruby/nodes/{conditionals.test.ts => conditionals.test.js} (99%) rename test/js/ruby/nodes/{defined.test.ts => defined.test.js} (94%) rename test/js/ruby/nodes/{embdoc.test.ts => embdoc.test.js} (94%) rename test/js/ruby/nodes/{field.test.ts => field.test.js} (100%) rename test/js/ruby/nodes/{hashes.test.ts => hashes.test.js} (99%) rename test/js/ruby/nodes/{heredocs.test.ts => heredocs.test.js} (99%) rename test/js/ruby/nodes/{hooks.test.ts => hooks.test.js} (94%) rename test/js/ruby/nodes/{kwargs.test.ts => kwargs.test.js} (100%) rename test/js/ruby/nodes/{lambda.test.ts => lambda.test.js} (98%) rename test/js/ruby/nodes/{loops.test.ts => loops.test.js} (98%) rename test/js/ruby/nodes/{massign.test.ts => massign.test.js} (100%) rename test/js/ruby/nodes/{method.test.ts => method.test.js} (99%) rename test/js/ruby/nodes/{next.test.ts => next.test.js} (94%) rename test/js/ruby/nodes/{numbers.test.ts => numbers.test.js} (100%) rename test/js/ruby/nodes/{patterns.test.ts => patterns.test.js} (96%) rename test/js/ruby/nodes/{ranges.test.ts => ranges.test.js} (93%) rename test/js/ruby/nodes/{regexp.test.ts => regexp.test.js} (97%) rename test/js/ruby/nodes/{rescue.test.ts => rescue.test.js} (98%) rename test/js/ruby/nodes/{return.test.ts => return.test.js} (98%) rename test/js/ruby/nodes/{strings.test.ts => strings.test.js} (99%) rename test/js/ruby/nodes/{super.test.ts => super.test.js} (97%) rename test/js/ruby/nodes/{unary.test.ts => unary.test.js} (100%) rename test/js/ruby/nodes/{undef.test.ts => undef.test.js} (96%) rename test/js/ruby/nodes/{yield.test.ts => yield.test.js} (100%) rename test/js/{setupTests.ts => setupTests.js} (50%) delete mode 100644 test/js/types.ts rename test/js/{utils.ts => utils.js} (71%) delete mode 100644 tsconfig.build.json delete mode 100644 tsconfig.json diff --git a/.eslintignore b/.eslintignore index e55c14fb..7053dc17 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1 @@ /coverage/ -/dist/ diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f7933201..46f96c8d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -49,7 +49,6 @@ jobs: node-version: 12.x cache: yarn - run: yarn install --frozen-lockfile - - run: yarn prepublishOnly - run: yarn checkFormat - run: yarn lint @@ -79,7 +78,6 @@ jobs: node-version: 12.x cache: yarn - run: yarn install --frozen-lockfile - - run: yarn run prepublishOnly - run: yarn pack # Windows runners don't have /tmp, let's make sure it exists - run: mkdir -p /tmp @@ -112,7 +110,6 @@ jobs: node-version: 12.x cache: yarn - run: yarn install --frozen-lockfile - - run: yarn prepublishOnly - run: gem build -o prettier.gem - run: gem unpack prettier.gem - run: prettier/exe/rbprettier --help diff --git a/.gitignore b/.gitignore index 37e289b9..1a035cd8 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,6 @@ /test.rbs /test.haml *.gem -/dist/ # This is to better support the GitHub actions checking - since bundler changes # to being shipped by default with Ruby starting on 2.6. diff --git a/.prettierignore b/.prettierignore index 58c5e943..f430e82a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,6 +1,5 @@ /.bundle/ /coverage/ -/dist/ /pkg/ /playground/ /vendor/ diff --git a/bin/doc.ts b/bin/doc similarity index 61% rename from bin/doc.ts rename to bin/doc index 89aa9955..7022b8c6 100755 --- a/bin/doc.ts +++ b/bin/doc @@ -1,11 +1,10 @@ -#!./node_modules/.bin/ts-node +#!/usr/bin/env node -import fs from "fs"; -import prettier from "prettier"; +const fs = require("fs"); +const prettier = require("prettier"); +const plugin = require("../src/plugin"); -import plugin from "../src/plugin"; - -const debug = (prettier as any).__debug; +const debug = prettier.__debug; const code = fs.existsSync(process.argv[2]) ? fs.readFileSync(process.argv[2], "utf-8") diff --git a/bin/pragma b/bin/pragma new file mode 100755 index 00000000..c47b52a4 --- /dev/null +++ b/bin/pragma @@ -0,0 +1,6 @@ +#!/usr/bin/env node + +const fs = require("fs"); +const parser = require("../src/ruby/parser"); + +console.log(parser.hasPragma(fs.readFileSync(process.argv[2], "utf-8"))); diff --git a/bin/pragma.ts b/bin/pragma.ts deleted file mode 100755 index 501cdae8..00000000 --- a/bin/pragma.ts +++ /dev/null @@ -1,6 +0,0 @@ -#!./node_modules/.bin/ts-node - -import fs from "fs"; -import parser from "../src/ruby/parser"; - -console.log(parser.hasPragma(fs.readFileSync(process.argv[2], "utf-8"))); diff --git a/bin/print.ts b/bin/print similarity index 77% rename from bin/print.ts rename to bin/print index 2ccc81bd..08391d50 100755 --- a/bin/print.ts +++ b/bin/print @@ -1,9 +1,9 @@ -#!./node_modules/.bin/ts-node +#!/usr/bin/env node -import fs from "fs"; -import prettier from "prettier"; +const fs = require("fs"); +const prettier = require("prettier"); -import plugin from "../src/plugin"; +const plugin = require("../src/plugin"); let parser = "ruby"; let contentIdx = 2; @@ -26,8 +26,8 @@ if (fs.existsSync(process.argv[contentIdx])) { const { formatted } = prettier.formatWithCursor(content, { parser, - plugins: [plugin as any as string], // hacky, but it works + plugins: [plugin], cursorOffset: 1 -} as any); +}); console.log(formatted); diff --git a/lib/prettier.rb b/lib/prettier.rb index 3a41899e..b2a4c1fb 100644 --- a/lib/prettier.rb +++ b/lib/prettier.rb @@ -32,9 +32,9 @@ def self.run(args) either install them yourself by cd-ing into the directory where this gem is located (#{File.expand_path("..", __dir__)}) and running: - `yarn && yarn prepublishOnly` + `yarn install` or - `npm install && npm run prepublishOnly` + `npm install` or you can change the source in your Gemfile to point directly to rubygems. MSG diff --git a/package.json b/package.json index a8a44b3f..ef58c6d7 100644 --- a/package.json +++ b/package.json @@ -2,11 +2,10 @@ "name": "@prettier/plugin-ruby", "version": "2.1.0", "description": "prettier plugin for the Ruby programming language", - "main": "dist/plugin.js", + "main": "src/plugin.js", "scripts": { "checkFormat": "prettier --check '**/*'", "lint": "eslint --cache .", - "prepublishOnly": "tsc -p tsconfig.build.json && cp src/getInfo.js dist && cp src/netcat.js dist && cp src/server.rb dist", "test": "jest" }, "repository": { @@ -23,24 +22,15 @@ "prettier": ">=2.3.0" }, "devDependencies": { - "@types/jest": "^27.0.1", - "@types/node": "^17.0.0", - "@types/prettier": "^2.4.2", - "@typescript-eslint/eslint-plugin": "^5.18.0", - "@typescript-eslint/parser": "^5.18.0", "eslint": "^8.1.0", "eslint-config-prettier": "^8.0.0", "husky": "^7.0.0", "jest": "^27.0.1", - "pretty-quick": "^3.1.2", - "ts-jest": "^27.0.5", - "ts-node": "^10.2.1", - "typescript": "^4.5.2" + "pretty-quick": "^3.1.2" }, "eslintConfig": { "extends": [ "eslint:recommended", - "plugin:@typescript-eslint/recommended", "prettier" ], "env": { @@ -48,21 +38,17 @@ "jest": true, "node": true }, - "parser": "@typescript-eslint/parser", "rules": { - "no-unused-vars": "off", - "@typescript-eslint/explicit-module-boundary-types": "off", - "@typescript-eslint/no-explicit-any": "off" + "no-unused-vars": "off" } }, "jest": { - "globalSetup": "./test/js/globalSetup.ts", - "globalTeardown": "./test/js/globalTeardown.ts", - "preset": "ts-jest", + "globalSetup": "./test/js/globalSetup.js", + "globalTeardown": "./test/js/globalTeardown.js", "setupFilesAfterEnv": [ - "./test/js/setupTests.ts" + "./test/js/setupTests.js" ], - "testRegex": ".test.ts$" + "testRegex": ".test.js$" }, "husky": { "hooks": { diff --git a/prettier.gemspec b/prettier.gemspec index 0c7990fc..e64c36a0 100644 --- a/prettier.gemspec +++ b/prettier.gemspec @@ -15,7 +15,7 @@ Gem::Specification.new do |spec| spec.files = Dir.chdir(__dir__) do %w[LICENSE bin/console package.json rubocop.yml] + - Dir["{{exe,lib,dist}/**/*,*.md}"] + + Dir["{{exe,lib,src}/**/*,*.md}"] + Dir[ "node_modules/prettier/{package.json,index.js,cli.js,doc.js,bin-prettier.js,third-party.js,parser-*.js}" ] diff --git a/src/getInfo.js b/src/getInfo.js index a35cc368..f4c854af 100644 --- a/src/getInfo.js +++ b/src/getInfo.js @@ -1,4 +1,3 @@ -// eslint-disable-next-line @typescript-eslint/no-var-requires const { existsSync, readFileSync } = require("fs"); // This is how long to wait for the parser to spin up. For the most part, 5 diff --git a/src/netcat.js b/src/netcat.js index 4a6971a0..c36e465a 100644 --- a/src/netcat.js +++ b/src/netcat.js @@ -2,7 +2,6 @@ // On average, this is 2-3x slower than netcat, but still much faster than // spawning a new Ruby process. -// eslint-disable-next-line @typescript-eslint/no-var-requires const { createConnection } = require("net"); const sock = process.argv[process.argv.length - 1]; diff --git a/src/parseSync.ts b/src/parseSync.js similarity index 88% rename from src/parseSync.ts rename to src/parseSync.js index cdfc7ede..962cdf14 100644 --- a/src/parseSync.ts +++ b/src/parseSync.js @@ -1,18 +1,17 @@ -import { spawn, spawnSync } from "child_process"; -import { +const { spawn, spawnSync } = require("child_process"); +const { existsSync, unlinkSync, mkdtempSync, copyFileSync, mkdirSync, rmdirSync -} from "fs"; -import os from "os"; -import path from "path"; -import process from "process"; +} = require("fs"); +const os = require("os"); +const path = require("path"); +const process = require("process"); -type ParserArgs = { cmd: string; args: string[] }; -let parserArgs: undefined | ParserArgs; +let parserArgs; if (process.env.PRETTIER_RUBY_HOST) { const [cmd, ...args] = process.env.PRETTIER_RUBY_HOST.split(" "); @@ -23,7 +22,7 @@ if (process.env.PRETTIER_RUBY_HOST) { // parse using UTF-8. Unfortunately, the way that you accomplish this looks // differently depending on your platform. /* istanbul ignore next */ -export function getLang() { +function getLang() { const { env, platform } = process; const envValue = env.LC_ALL || env.LC_CTYPE || env.LANG; @@ -56,7 +55,7 @@ export function getLang() { // Generate the filepath that should be used to communicate the connection // information between this process and the parser server. -export function getInfoFilepath() { +function getInfoFilepath() { return path.join(os.tmpdir(), `prettier-ruby-parser-${process.pid}.info`); } @@ -64,13 +63,13 @@ export function getInfoFilepath() { // server with that filepath as an argument, then spawn another process that // will read that information in order to enable us to connect to it in the // spawnSync function. -function spawnServer(): ParserArgs { +function spawnServer() { const tempDir = mkdtempSync(path.join(os.tmpdir(), "prettier-plugin-ruby-")); const filepath = getInfoFilepath(); let serverRbPath = path.join(__dirname, "./server.rb"); let getInfoJsPath = path.join(__dirname, "./getInfo.js"); - let cleanupTempFiles: () => void | undefined; + let cleanupTempFiles; if (runningInPnPZip()) { // If we're running in a Yarn PnP environment inside a ZIP file, it's not possible to run @@ -164,15 +163,11 @@ function runningInPnPZip() { return process.versions.pnp && __dirname.includes(".zip"); } -// You can optionally return location information from the source string when -// raising an error that prettier will handle for you nicely. -type LocatedError = Error & { loc?: any }; - // Formats and sends a request to the parser server. We use netcat (or something // like it) here since Prettier requires the results of `parse` to be // synchronous and Node.js does not offer a mechanism for synchronous socket // requests. -function parseSync(parser: string, source: string) { +function parseSync(parser, source) { if (!parserArgs) { parserArgs = spawnServer(); } @@ -195,7 +190,7 @@ function parseSync(parser: string, source: string) { const parsed = JSON.parse(stdout); if (parsed.error) { - const error: LocatedError = new Error(parsed.error); + const error = new Error(parsed.error); if (parsed.loc) { error.loc = parsed.loc; } @@ -206,4 +201,8 @@ function parseSync(parser: string, source: string) { return parsed; } -export default parseSync; +module.exports = { + getLang, + getInfoFilepath, + parseSync +}; diff --git a/src/plugin.ts b/src/plugin.js similarity index 90% rename from src/plugin.ts rename to src/plugin.js index 4a6ff5ab..5d37ef8b 100644 --- a/src/plugin.ts +++ b/src/plugin.js @@ -1,20 +1,11 @@ -import type { Plugin, SupportLanguage } from "prettier"; -import parseSync from "./parseSync"; - -interface ExtendedSupportLanguage extends SupportLanguage { - interpreters?: string[]; -} - -interface ExtendedPlugin extends Omit { - languages: ExtendedSupportLanguage[]; -} +const { parseSync } = require("./parseSync"); /* * metadata mostly pulled from linguist and rubocop: * https://github.com/github/linguist/blob/master/lib/linguist/languages.yml * https://github.com/rubocop/rubocop/blob/master/spec/rubocop/target_finder_spec.rb */ -const plugin: ExtendedPlugin = { +const plugin = { languages: [ { name: "Ruby", @@ -167,4 +158,4 @@ const plugin: ExtendedPlugin = { } }; -export = plugin; +module.exports = plugin; diff --git a/test/js/files.test.ts b/test/js/files.test.js similarity index 54% rename from test/js/files.test.ts rename to test/js/files.test.js index 4ecb7eca..f1e65868 100644 --- a/test/js/files.test.ts +++ b/test/js/files.test.js @@ -1,14 +1,13 @@ -import path from "path"; -import { FileInfoOptions, getFileInfo } from "prettier"; +const path = require("path"); +const prettier = require("prettier"); -// eslint-disable-next-line @typescript-eslint/no-var-requires const plugin = require("../../src/plugin"); -function getInferredParser(filename: string) { +function getInferredParser(filename) { const filepath = path.join(__dirname, filename); - const fileInfoOptions = { plugins: [plugin] } as any as FileInfoOptions; + const fileInfoOptions = { plugins: [plugin] }; - return getFileInfo(filepath, fileInfoOptions).then( + return prettier.getFileInfo(filepath, fileInfoOptions).then( ({ inferredParser }) => inferredParser ); } diff --git a/test/js/globalSetup.ts b/test/js/globalSetup.js similarity index 84% rename from test/js/globalSetup.ts rename to test/js/globalSetup.js index 90609508..8af21f27 100644 --- a/test/js/globalSetup.ts +++ b/test/js/globalSetup.js @@ -1,8 +1,8 @@ -import { spawn, spawnSync } from "child_process"; -import { unlinkSync } from "fs"; -import path from "path"; +const { spawn, spawnSync } = require("child_process"); +const { unlinkSync } = require("fs"); +const path = require("path"); -import { getLang, getInfoFilepath } from "../../src/parseSync"; +const { getLang, getInfoFilepath } = require("../../src/parseSync"); // This is somewhat similar to the spawnServer function in parseSync but // slightly different in that it logs its information into environment variables @@ -42,4 +42,4 @@ function globalSetup() { server.unref(); } -export default globalSetup; +module.exports = globalSetup; diff --git a/test/js/globalTeardown.ts b/test/js/globalTeardown.js similarity index 93% rename from test/js/globalTeardown.ts rename to test/js/globalTeardown.js index b4b20e9a..35320778 100644 --- a/test/js/globalTeardown.ts +++ b/test/js/globalTeardown.js @@ -13,4 +13,4 @@ function globalTeardown() { } } -export default globalTeardown; +module.exports = globalTeardown; diff --git a/test/js/haml/comment.test.ts b/test/js/haml/comment.test.js similarity index 94% rename from test/js/haml/comment.test.ts rename to test/js/haml/comment.test.js index 0b29db72..4342cdeb 100644 --- a/test/js/haml/comment.test.ts +++ b/test/js/haml/comment.test.js @@ -1,4 +1,4 @@ -import { haml } from "../utils"; +const { haml } = require("../utils"); describe("comment", () => { test("single line", () => { diff --git a/test/js/haml/doctype.test.ts b/test/js/haml/doctype.test.js similarity index 95% rename from test/js/haml/doctype.test.ts rename to test/js/haml/doctype.test.js index bd1ffe58..a6ebfcf0 100644 --- a/test/js/haml/doctype.test.ts +++ b/test/js/haml/doctype.test.js @@ -1,4 +1,4 @@ -import { haml } from "../utils"; +const { haml } = require("../utils"); describe("doctype", () => { test("basic", () => { diff --git a/test/js/haml/filter.test.ts b/test/js/haml/filter.test.js similarity index 92% rename from test/js/haml/filter.test.ts rename to test/js/haml/filter.test.js index 711ba4c2..ba01a0e5 100644 --- a/test/js/haml/filter.test.ts +++ b/test/js/haml/filter.test.js @@ -1,4 +1,4 @@ -import { haml } from "../utils"; +const { haml } = require("../utils"); describe("filter", () => { test("self", () => { diff --git a/test/js/haml/hamlComment.test.ts b/test/js/haml/hamlComment.test.js similarity index 92% rename from test/js/haml/hamlComment.test.ts rename to test/js/haml/hamlComment.test.js index de38dfae..edffe41b 100644 --- a/test/js/haml/hamlComment.test.ts +++ b/test/js/haml/hamlComment.test.js @@ -1,4 +1,4 @@ -import { haml } from "../utils"; +const { haml } = require("../utils"); describe("haml comment", () => { test("empty", () => { diff --git a/test/js/haml/plain.test.ts b/test/js/haml/plain.test.js similarity index 90% rename from test/js/haml/plain.test.ts rename to test/js/haml/plain.test.js index 4f824053..0058b262 100644 --- a/test/js/haml/plain.test.ts +++ b/test/js/haml/plain.test.js @@ -1,4 +1,4 @@ -import { haml } from "../utils"; +const { haml } = require("../utils"); describe("plain", () => { const specialChars = ["%", ".", "#", "/", "!", "=", "&", "~", "-", "\\", ":"]; diff --git a/test/js/haml/script.test.ts b/test/js/haml/script.test.js similarity index 95% rename from test/js/haml/script.test.ts rename to test/js/haml/script.test.js index 833bf31c..bca36c45 100644 --- a/test/js/haml/script.test.ts +++ b/test/js/haml/script.test.js @@ -1,4 +1,4 @@ -import { haml } from "../utils"; +const { haml } = require("../utils"); describe("script", () => { test("single line", () => { diff --git a/test/js/haml/silentScript.test.ts b/test/js/haml/silentScript.test.js similarity index 96% rename from test/js/haml/silentScript.test.ts rename to test/js/haml/silentScript.test.js index d263bd14..af626f38 100644 --- a/test/js/haml/silentScript.test.ts +++ b/test/js/haml/silentScript.test.js @@ -1,4 +1,4 @@ -import { haml } from "../utils"; +const { haml } = require("../utils"); describe("silent script", () => { test("single line", () => { diff --git a/test/js/haml/tag.test.ts b/test/js/haml/tag.test.js similarity index 98% rename from test/js/haml/tag.test.ts rename to test/js/haml/tag.test.js index 59749792..978837d8 100644 --- a/test/js/haml/tag.test.ts +++ b/test/js/haml/tag.test.js @@ -1,4 +1,4 @@ -import { long, haml } from "../utils"; +const { long, haml } = require("../utils"); describe("tag", () => { test("class", () => { diff --git a/test/js/rbs/rbs.test.ts b/test/js/rbs/rbs.test.js similarity index 96% rename from test/js/rbs/rbs.test.ts rename to test/js/rbs/rbs.test.js index a1e6dd86..8ac2f838 100644 --- a/test/js/rbs/rbs.test.ts +++ b/test/js/rbs/rbs.test.js @@ -1,10 +1,10 @@ -import fs from "fs"; -import os from "os"; -import path from "path"; +const fs = require("fs"); +const os = require("os"); +const path = require("path"); -import { atLeastVersion, rbs } from "../utils"; +const { atLeastVersion, rbs } = require("../utils"); -function testCases(name: string, transform: (_source: string) => string) { +function testCases(name, transform) { const buffer = fs.readFileSync(path.resolve(__dirname, `${name}.txt`)); const sources = buffer.toString().slice(0, -1).split(/\r?\n/); @@ -15,7 +15,7 @@ function testCases(name: string, transform: (_source: string) => string) { }); } -function describeCases(name: string, transform: (_source: string) => string) { +function describeCases(name, transform) { describe(name, () => { testCases(name, transform); }); diff --git a/test/js/ruby/comments.test.ts b/test/js/ruby/comments.test.js similarity index 99% rename from test/js/ruby/comments.test.ts rename to test/js/ruby/comments.test.js index 4483b3df..d361880a 100644 --- a/test/js/ruby/comments.test.ts +++ b/test/js/ruby/comments.test.js @@ -1,4 +1,4 @@ -import { ruby } from "../utils"; +const { ruby } = require("../utils"); describe("comments", () => { describe("on their own line", () => { diff --git a/test/js/ruby/encoding.test.ts b/test/js/ruby/encoding.test.js similarity index 100% rename from test/js/ruby/encoding.test.ts rename to test/js/ruby/encoding.test.js diff --git a/test/js/ruby/errors.test.ts b/test/js/ruby/errors.test.js similarity index 91% rename from test/js/ruby/errors.test.ts rename to test/js/ruby/errors.test.js index a01611b4..4f90e2cd 100644 --- a/test/js/ruby/errors.test.ts +++ b/test/js/ruby/errors.test.js @@ -1,4 +1,4 @@ -import prettier from "prettier"; +const prettier = require("prettier"); describe("errors", () => { const cases = [ diff --git a/test/js/ruby/ignore.test.ts b/test/js/ruby/ignore.test.js similarity index 85% rename from test/js/ruby/ignore.test.ts rename to test/js/ruby/ignore.test.js index 4983fae5..e1855482 100644 --- a/test/js/ruby/ignore.test.ts +++ b/test/js/ruby/ignore.test.js @@ -1,4 +1,4 @@ -import { ruby } from "../utils"; +const { ruby } = require("../utils"); describe("ignore", () => { test("you can ignore code blocks", () => { diff --git a/test/js/ruby/layout.test.ts b/test/js/ruby/layout.test.js similarity index 95% rename from test/js/ruby/layout.test.ts rename to test/js/ruby/layout.test.js index 37da3f63..b94fa48d 100644 --- a/test/js/ruby/layout.test.ts +++ b/test/js/ruby/layout.test.js @@ -1,4 +1,4 @@ -import { ruby } from "../utils"; +const { ruby } = require("../utils"); describe("layout", () => { test("turns multiple blank lines into just one blank line", () => { diff --git a/test/js/ruby/nodes/alias.test.ts b/test/js/ruby/nodes/alias.test.js similarity index 97% rename from test/js/ruby/nodes/alias.test.ts rename to test/js/ruby/nodes/alias.test.js index f36dc0fd..f29c6c01 100644 --- a/test/js/ruby/nodes/alias.test.ts +++ b/test/js/ruby/nodes/alias.test.js @@ -1,4 +1,4 @@ -import { long, ruby } from "../../utils"; +const { long, ruby } = require("../../utils"); describe("alias", () => { test("bare word aliases", () => { diff --git a/test/js/ruby/nodes/aref.test.ts b/test/js/ruby/nodes/aref.test.js similarity index 94% rename from test/js/ruby/nodes/aref.test.ts rename to test/js/ruby/nodes/aref.test.js index 8bb699cd..d18d7230 100644 --- a/test/js/ruby/nodes/aref.test.ts +++ b/test/js/ruby/nodes/aref.test.js @@ -1,4 +1,4 @@ -import { ruby } from "../../utils"; +const { ruby } = require("../../utils"); describe("aref", () => { test("literal reference", () => { diff --git a/test/js/ruby/nodes/arrays.test.ts b/test/js/ruby/nodes/arrays.test.js similarity index 98% rename from test/js/ruby/nodes/arrays.test.ts rename to test/js/ruby/nodes/arrays.test.js index 2e027e5b..72c55465 100644 --- a/test/js/ruby/nodes/arrays.test.ts +++ b/test/js/ruby/nodes/arrays.test.js @@ -1,4 +1,4 @@ -import { long, ruby } from "../../utils"; +const { long, ruby } = require("../../utils"); describe("array", () => { test("empty arrays", () => { diff --git a/test/js/ruby/nodes/assign.test.ts b/test/js/ruby/nodes/assign.test.js similarity index 98% rename from test/js/ruby/nodes/assign.test.ts rename to test/js/ruby/nodes/assign.test.js index f68d801b..44eca0a0 100644 --- a/test/js/ruby/nodes/assign.test.ts +++ b/test/js/ruby/nodes/assign.test.js @@ -1,4 +1,4 @@ -import { long, ruby } from "../../utils"; +const { long, ruby } = require("../../utils"); describe("assign", () => { describe("single assignment", () => { diff --git a/test/js/ruby/nodes/binary.test.ts b/test/js/ruby/nodes/binary.test.js similarity index 93% rename from test/js/ruby/nodes/binary.test.ts rename to test/js/ruby/nodes/binary.test.js index a04618c4..e02693bd 100644 --- a/test/js/ruby/nodes/binary.test.ts +++ b/test/js/ruby/nodes/binary.test.js @@ -1,4 +1,4 @@ -import { long, ruby } from "../../utils"; +const { long, ruby } = require("../../utils"); describe("binary", () => { test("single line", () => { diff --git a/test/js/ruby/nodes/blocks.test.ts b/test/js/ruby/nodes/blocks.test.js similarity index 99% rename from test/js/ruby/nodes/blocks.test.ts rename to test/js/ruby/nodes/blocks.test.js index afc43817..74b45120 100644 --- a/test/js/ruby/nodes/blocks.test.ts +++ b/test/js/ruby/nodes/blocks.test.js @@ -1,4 +1,4 @@ -import { long, ruby } from "../../utils"; +const { long, ruby } = require("../../utils"); describe("blocks", () => { test("empty", () => { diff --git a/test/js/ruby/nodes/break.test.ts b/test/js/ruby/nodes/break.test.js similarity index 95% rename from test/js/ruby/nodes/break.test.ts rename to test/js/ruby/nodes/break.test.js index 8a51b2bb..8842d5f6 100644 --- a/test/js/ruby/nodes/break.test.ts +++ b/test/js/ruby/nodes/break.test.js @@ -1,4 +1,4 @@ -import { ruby } from "../../utils"; +const { ruby } = require("../../utils"); describe("break", () => { test("empty break", () => { diff --git a/test/js/ruby/nodes/calls.test.ts b/test/js/ruby/nodes/calls.test.js similarity index 99% rename from test/js/ruby/nodes/calls.test.ts rename to test/js/ruby/nodes/calls.test.js index 7697b6df..bab58d43 100644 --- a/test/js/ruby/nodes/calls.test.ts +++ b/test/js/ruby/nodes/calls.test.js @@ -1,4 +1,4 @@ -import { long, ruby } from "../../utils"; +const { long, ruby } = require("../../utils"); describe("calls", () => { test("simple calls", () => { diff --git a/test/js/ruby/nodes/case.test.ts b/test/js/ruby/nodes/case.test.js similarity index 97% rename from test/js/ruby/nodes/case.test.ts rename to test/js/ruby/nodes/case.test.js index b5904a8d..1be33ef4 100644 --- a/test/js/ruby/nodes/case.test.ts +++ b/test/js/ruby/nodes/case.test.js @@ -1,4 +1,4 @@ -import { long, ruby } from "../../utils"; +const { long, ruby } = require("../../utils"); describe("case", () => { test("empty case", () => { diff --git a/test/js/ruby/nodes/class.test.ts b/test/js/ruby/nodes/class.test.js similarity index 98% rename from test/js/ruby/nodes/class.test.ts rename to test/js/ruby/nodes/class.test.js index c6f31faa..e2c82bf6 100644 --- a/test/js/ruby/nodes/class.test.ts +++ b/test/js/ruby/nodes/class.test.js @@ -1,4 +1,4 @@ -import { long, ruby } from "../../utils"; +const { long, ruby } = require("../../utils"); describe("class", () => { test("basic nesting", () => { diff --git a/test/js/ruby/nodes/conditionals.test.ts b/test/js/ruby/nodes/conditionals.test.js similarity index 99% rename from test/js/ruby/nodes/conditionals.test.ts rename to test/js/ruby/nodes/conditionals.test.js index 6c966bb7..89506951 100644 --- a/test/js/ruby/nodes/conditionals.test.ts +++ b/test/js/ruby/nodes/conditionals.test.js @@ -1,4 +1,4 @@ -import { long, ruby, atLeastVersion } from "../../utils"; +const { long, ruby, atLeastVersion } = require("../../utils"); describe("conditionals", () => { describe("not operator", () => { diff --git a/test/js/ruby/nodes/defined.test.ts b/test/js/ruby/nodes/defined.test.js similarity index 94% rename from test/js/ruby/nodes/defined.test.ts rename to test/js/ruby/nodes/defined.test.js index 3e23e252..d1503a03 100644 --- a/test/js/ruby/nodes/defined.test.ts +++ b/test/js/ruby/nodes/defined.test.js @@ -1,4 +1,4 @@ -import { long } from "../../utils"; +const { long } = require("../../utils"); describe("defined", () => { test("no parens", () => { diff --git a/test/js/ruby/nodes/embdoc.test.ts b/test/js/ruby/nodes/embdoc.test.js similarity index 94% rename from test/js/ruby/nodes/embdoc.test.ts rename to test/js/ruby/nodes/embdoc.test.js index 592c1a70..e6e9b6f1 100644 --- a/test/js/ruby/nodes/embdoc.test.ts +++ b/test/js/ruby/nodes/embdoc.test.js @@ -1,4 +1,4 @@ -import { ruby } from "../../utils"; +const { ruby } = require("../../utils"); describe("embdoc", () => { test("basic embdocs", () => { diff --git a/test/js/ruby/nodes/field.test.ts b/test/js/ruby/nodes/field.test.js similarity index 100% rename from test/js/ruby/nodes/field.test.ts rename to test/js/ruby/nodes/field.test.js diff --git a/test/js/ruby/nodes/hashes.test.ts b/test/js/ruby/nodes/hashes.test.js similarity index 99% rename from test/js/ruby/nodes/hashes.test.ts rename to test/js/ruby/nodes/hashes.test.js index bf131ff3..8ecd8b17 100644 --- a/test/js/ruby/nodes/hashes.test.ts +++ b/test/js/ruby/nodes/hashes.test.js @@ -1,4 +1,4 @@ -import { long, ruby } from "../../utils"; +const { long, ruby } = require("../../utils"); describe("hash", () => { test("empty", () => { diff --git a/test/js/ruby/nodes/heredocs.test.ts b/test/js/ruby/nodes/heredocs.test.js similarity index 99% rename from test/js/ruby/nodes/heredocs.test.ts rename to test/js/ruby/nodes/heredocs.test.js index 0300d361..a348b3bd 100644 --- a/test/js/ruby/nodes/heredocs.test.ts +++ b/test/js/ruby/nodes/heredocs.test.js @@ -1,4 +1,4 @@ -import { long, ruby } from "../../utils"; +const { long, ruby } = require("../../utils"); describe("heredocs", () => { describe("straight", () => { diff --git a/test/js/ruby/nodes/hooks.test.ts b/test/js/ruby/nodes/hooks.test.js similarity index 94% rename from test/js/ruby/nodes/hooks.test.ts rename to test/js/ruby/nodes/hooks.test.js index a35660d5..2d7b0cb1 100644 --- a/test/js/ruby/nodes/hooks.test.ts +++ b/test/js/ruby/nodes/hooks.test.js @@ -1,4 +1,4 @@ -import { long, ruby } from "../../utils"; +const { long, ruby } = require("../../utils"); describe.each(["BEGIN", "END"])("%s hook", (hook) => { test("shortens to one line", () => { diff --git a/test/js/ruby/nodes/kwargs.test.ts b/test/js/ruby/nodes/kwargs.test.js similarity index 100% rename from test/js/ruby/nodes/kwargs.test.ts rename to test/js/ruby/nodes/kwargs.test.js diff --git a/test/js/ruby/nodes/lambda.test.ts b/test/js/ruby/nodes/lambda.test.js similarity index 98% rename from test/js/ruby/nodes/lambda.test.ts rename to test/js/ruby/nodes/lambda.test.js index a2222910..8a9588f7 100644 --- a/test/js/ruby/nodes/lambda.test.ts +++ b/test/js/ruby/nodes/lambda.test.js @@ -1,4 +1,4 @@ -import { long, ruby } from "../../utils"; +const { long, ruby } = require("../../utils"); describe("lambda", () => { test("plain stabby lambda literal", () => { diff --git a/test/js/ruby/nodes/loops.test.ts b/test/js/ruby/nodes/loops.test.js similarity index 98% rename from test/js/ruby/nodes/loops.test.ts rename to test/js/ruby/nodes/loops.test.js index 0b6034c4..d08dfcf6 100644 --- a/test/js/ruby/nodes/loops.test.ts +++ b/test/js/ruby/nodes/loops.test.js @@ -1,4 +1,4 @@ -import { long, ruby } from "../../utils"; +const { long, ruby } = require("../../utils"); describe.each(["while", "until"])("%s", (keyword) => { test("aligns predicates", () => { diff --git a/test/js/ruby/nodes/massign.test.ts b/test/js/ruby/nodes/massign.test.js similarity index 100% rename from test/js/ruby/nodes/massign.test.ts rename to test/js/ruby/nodes/massign.test.js diff --git a/test/js/ruby/nodes/method.test.ts b/test/js/ruby/nodes/method.test.js similarity index 99% rename from test/js/ruby/nodes/method.test.ts rename to test/js/ruby/nodes/method.test.js index 397f38c9..288885ba 100644 --- a/test/js/ruby/nodes/method.test.ts +++ b/test/js/ruby/nodes/method.test.js @@ -1,4 +1,4 @@ -import { atLeastVersion, long, ruby } from "../../utils"; +const { atLeastVersion, long, ruby } = require("../../utils"); describe("method", () => { describe("definitions", () => { diff --git a/test/js/ruby/nodes/next.test.ts b/test/js/ruby/nodes/next.test.js similarity index 94% rename from test/js/ruby/nodes/next.test.ts rename to test/js/ruby/nodes/next.test.js index 9e2dbdd4..53d2629b 100644 --- a/test/js/ruby/nodes/next.test.ts +++ b/test/js/ruby/nodes/next.test.js @@ -1,4 +1,4 @@ -import { ruby } from "../../utils"; +const { ruby } = require("../../utils"); describe("next", () => { test("bare", () => { diff --git a/test/js/ruby/nodes/numbers.test.ts b/test/js/ruby/nodes/numbers.test.js similarity index 100% rename from test/js/ruby/nodes/numbers.test.ts rename to test/js/ruby/nodes/numbers.test.js diff --git a/test/js/ruby/nodes/patterns.test.ts b/test/js/ruby/nodes/patterns.test.js similarity index 96% rename from test/js/ruby/nodes/patterns.test.ts rename to test/js/ruby/nodes/patterns.test.js index dbb49b79..deb8aed6 100644 --- a/test/js/ruby/nodes/patterns.test.ts +++ b/test/js/ruby/nodes/patterns.test.js @@ -1,4 +1,4 @@ -import { atLeastVersion, atMostVersion, ruby } from "../../utils"; +const { atLeastVersion, atMostVersion, ruby } = require("../../utils"); describe("patterns", () => { if (atMostVersion("2.7")) { diff --git a/test/js/ruby/nodes/ranges.test.ts b/test/js/ruby/nodes/ranges.test.js similarity index 93% rename from test/js/ruby/nodes/ranges.test.ts rename to test/js/ruby/nodes/ranges.test.js index 3e3d67d2..62d6a8cb 100644 --- a/test/js/ruby/nodes/ranges.test.ts +++ b/test/js/ruby/nodes/ranges.test.js @@ -1,4 +1,4 @@ -import { atLeastVersion } from "../../utils"; +const { atLeastVersion } = require("../../utils"); describe("ranges", () => { test("two dot", () => { diff --git a/test/js/ruby/nodes/regexp.test.ts b/test/js/ruby/nodes/regexp.test.js similarity index 97% rename from test/js/ruby/nodes/regexp.test.ts rename to test/js/ruby/nodes/regexp.test.js index 59866495..5ff7983e 100644 --- a/test/js/ruby/nodes/regexp.test.ts +++ b/test/js/ruby/nodes/regexp.test.js @@ -1,4 +1,4 @@ -import { ruby } from "../../utils"; +const { ruby } = require("../../utils"); describe("regexp", () => { test("basic", () => { diff --git a/test/js/ruby/nodes/rescue.test.ts b/test/js/ruby/nodes/rescue.test.js similarity index 98% rename from test/js/ruby/nodes/rescue.test.ts rename to test/js/ruby/nodes/rescue.test.js index b3948af7..30e4c9b4 100644 --- a/test/js/ruby/nodes/rescue.test.ts +++ b/test/js/ruby/nodes/rescue.test.js @@ -1,4 +1,4 @@ -import { ruby } from "../../utils"; +const { ruby } = require("../../utils"); describe("rescue", () => { test("inline", () => { diff --git a/test/js/ruby/nodes/return.test.ts b/test/js/ruby/nodes/return.test.js similarity index 98% rename from test/js/ruby/nodes/return.test.ts rename to test/js/ruby/nodes/return.test.js index dc2f6e03..94f3c842 100644 --- a/test/js/ruby/nodes/return.test.ts +++ b/test/js/ruby/nodes/return.test.js @@ -1,4 +1,4 @@ -import { long, ruby } from "../../utils"; +const { long, ruby } = require("../../utils"); describe("return", () => { test("bare", () => { diff --git a/test/js/ruby/nodes/strings.test.ts b/test/js/ruby/nodes/strings.test.js similarity index 99% rename from test/js/ruby/nodes/strings.test.ts rename to test/js/ruby/nodes/strings.test.js index 41fde744..34e90cc1 100644 --- a/test/js/ruby/nodes/strings.test.ts +++ b/test/js/ruby/nodes/strings.test.js @@ -1,4 +1,4 @@ -import { long, ruby } from "../../utils"; +const { long, ruby } = require("../../utils"); describe("strings", () => { describe("%-literals with escape sequences in the middle", () => { diff --git a/test/js/ruby/nodes/super.test.ts b/test/js/ruby/nodes/super.test.js similarity index 97% rename from test/js/ruby/nodes/super.test.ts rename to test/js/ruby/nodes/super.test.js index 76a9cd62..0ed4b73c 100644 --- a/test/js/ruby/nodes/super.test.ts +++ b/test/js/ruby/nodes/super.test.js @@ -1,4 +1,4 @@ -import { ruby } from "../../utils"; +const { ruby } = require("../../utils"); describe("super", () => { test("bare", () => { diff --git a/test/js/ruby/nodes/unary.test.ts b/test/js/ruby/nodes/unary.test.js similarity index 100% rename from test/js/ruby/nodes/unary.test.ts rename to test/js/ruby/nodes/unary.test.js diff --git a/test/js/ruby/nodes/undef.test.ts b/test/js/ruby/nodes/undef.test.js similarity index 96% rename from test/js/ruby/nodes/undef.test.ts rename to test/js/ruby/nodes/undef.test.js index fb4f81c1..cdef0e48 100644 --- a/test/js/ruby/nodes/undef.test.ts +++ b/test/js/ruby/nodes/undef.test.js @@ -1,4 +1,4 @@ -import { long, ruby } from "../../utils"; +const { long, ruby } = require("../../utils"); describe("undef", () => { test("single inline", () => { diff --git a/test/js/ruby/nodes/yield.test.ts b/test/js/ruby/nodes/yield.test.js similarity index 100% rename from test/js/ruby/nodes/yield.test.ts rename to test/js/ruby/nodes/yield.test.js diff --git a/test/js/setupTests.ts b/test/js/setupTests.js similarity index 50% rename from test/js/setupTests.ts rename to test/js/setupTests.js index 593ecb94..266cf2df 100644 --- a/test/js/setupTests.ts +++ b/test/js/setupTests.js @@ -1,18 +1,17 @@ -import prettier from "prettier"; +const prettier = require("prettier"); -import type { Code } from "./types"; -import plugin from "../../src/plugin"; +const plugin = require("../../src/plugin"); -function normalize(code: Code) { +function normalize(code) { const string = typeof code === "string" ? code : code.code; return string.replace(/\r?\n/g, "\n").trim(); } -function checkFormat(before: Code, after: Code) { +function checkFormat(before, after) { const originalText = typeof before === "string" ? before : before.code; const formatted = prettier.format(originalText, { parser: typeof before === "string" ? "ruby" : before.parser, - plugins: [plugin as any as string] + plugins: [plugin] }); const expected = normalize(after); @@ -25,21 +24,10 @@ function checkFormat(before: Code, after: Code) { } expect.extend({ - toChangeFormat(before: Code, after: Code) { + toChangeFormat(before, after) { return checkFormat(before, after); }, - toMatchFormat(before: Code) { + toMatchFormat(before) { return checkFormat(before, before); } }); - -declare global { - // eslint-disable-next-line @typescript-eslint/no-namespace - namespace jest { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - interface Matchers { - toChangeFormat(after: Code): CustomMatcherResult; - toMatchFormat(): CustomMatcherResult; - } - } -} diff --git a/test/js/types.ts b/test/js/types.ts deleted file mode 100644 index 26de5835..00000000 --- a/test/js/types.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type Code = - | string - | { code: string; parser: "rbs" } - | { code: string; parser: "haml" }; diff --git a/test/js/utils.ts b/test/js/utils.js similarity index 71% rename from test/js/utils.ts rename to test/js/utils.js index 2d0f0242..ae0584f6 100644 --- a/test/js/utils.ts +++ b/test/js/utils.js @@ -1,8 +1,6 @@ -import type { Code } from "./types"; +const long = Array(80).fill("a").join(""); -export const long = Array(80).fill("a").join(""); - -function stripLeadingWhitespace(code: string) { +function stripLeadingWhitespace(code) { if (!code.includes("\n")) { return code; } @@ -15,15 +13,15 @@ function stripLeadingWhitespace(code: string) { return content.map((line) => line.slice(indent)).join("\n"); } -export function ruby(code: string) { +function ruby(code) { return stripLeadingWhitespace(code); } -export function rbs(code: string): Code { +function rbs(code) { return { code: stripLeadingWhitespace(code), parser: "rbs" }; } -export function haml(code: string): Code { +function haml(code) { return { code: stripLeadingWhitespace(code), parser: "haml" }; } @@ -32,10 +30,19 @@ export function haml(code: string): Code { // should be always available. TypeScript doesn't know that though, so we // explicitly allow it to be undefined by coalescing with the empty string. -export function atLeastVersion(version: string) { +function atLeastVersion(version) { return (process.env.RUBY_VERSION || "") >= version; } -export function atMostVersion(version: string) { +function atMostVersion(version) { return (process.env.RUBY_VERSION || "") < version; } + +module.exports = { + long, + ruby, + rbs, + haml, + atLeastVersion, + atMostVersion +}; diff --git a/tsconfig.build.json b/tsconfig.build.json deleted file mode 100644 index f4f4548c..00000000 --- a/tsconfig.build.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "./tsconfig.json", - "exclude": ["bin", "test"] -} diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index 043f24e5..00000000 --- a/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - "allowJs": false, - "esModuleInterop": true, - "module": "commonjs", - "moduleResolution": "node", - "outDir": "dist", - "sourceMap": false, - "strict": true, - "target": "es2019" - } -} diff --git a/yarn.lock b/yarn.lock index 583a4071..b75a3549 100644 --- a/yarn.lock +++ b/yarn.lock @@ -293,18 +293,6 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@cspotcode/source-map-consumer@0.8.0": - version "0.8.0" - resolved "https://registry.yarnpkg.com/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz#33bf4b7b39c178821606f669bbc447a6a629786b" - integrity sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg== - -"@cspotcode/source-map-support@0.7.0": - version "0.7.0" - resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz#4789840aa859e46d2f3173727ab707c66bf344f5" - integrity sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA== - dependencies: - "@cspotcode/source-map-consumer" "0.8.0" - "@eslint/eslintrc@^1.2.1": version "1.2.1" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.2.1.tgz#8b5e1c49f4077235516bc9ec7d41378c0f69b8c6" @@ -537,27 +525,6 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@nodelib/fs.scandir@2.1.5": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" - integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== - dependencies: - "@nodelib/fs.stat" "2.0.5" - run-parallel "^1.1.9" - -"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" - integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== - -"@nodelib/fs.walk@^1.2.3": - version "1.2.8" - resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" - integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== - dependencies: - "@nodelib/fs.scandir" "2.1.5" - fastq "^1.6.0" - "@sinonjs/commons@^1.7.0": version "1.8.3" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" @@ -577,26 +544,6 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== -"@tsconfig/node10@^1.0.7": - version "1.0.8" - resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9" - integrity sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg== - -"@tsconfig/node12@^1.0.7": - version "1.0.9" - resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.9.tgz#62c1f6dee2ebd9aead80dc3afa56810e58e1a04c" - integrity sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw== - -"@tsconfig/node14@^1.0.0": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.1.tgz#95f2d167ffb9b8d2068b0b235302fafd4df711f2" - integrity sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg== - -"@tsconfig/node16@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.2.tgz#423c77877d0569db20e1fc80885ac4118314010e" - integrity sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA== - "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": version "7.1.19" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.19.tgz#7b497495b7d1b4812bdb9d02804d0576f43ee460" @@ -656,30 +603,17 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@^27.0.1": - version "27.4.1" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.4.1.tgz#185cbe2926eaaf9662d340cc02e548ce9e11ab6d" - integrity sha512-23iPJADSmicDVrWk+HT58LMJtzLAnB2AgIzplQuq/bSrGaxCrlvRFjGbXmamnnk/mAmCdLStiGqggu28ocUyiw== - dependencies: - jest-matcher-utils "^27.0.0" - pretty-format "^27.0.0" - -"@types/json-schema@^7.0.9": - version "7.0.11" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" - integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== - "@types/minimatch@^3.0.3": version "3.0.5" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== -"@types/node@*", "@types/node@^17.0.0": +"@types/node@*": version "17.0.25" resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.25.tgz#527051f3c2f77aa52e5dc74e45a3da5fb2301448" integrity sha512-wANk6fBrUwdpY4isjWrKTufkrXdu1D2YHCot2fD/DfWxF5sMrVSA+KN7ydckvaTCh0HiqX9IVl0L5/ZoXg5M7w== -"@types/prettier@^2.1.5", "@types/prettier@^2.4.2": +"@types/prettier@^2.1.5": version "2.6.0" resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.6.0.tgz#efcbd41937f9ae7434c714ab698604822d890759" integrity sha512-G/AdOadiZhnJp0jXCaBQU449W2h716OW/EoXeYkCytxKL06X1WCXB4DZpp8TpZ8eyIJVS1cw4lrlkkSYU21cDw== @@ -701,86 +635,6 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^5.18.0": - version "5.20.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.20.0.tgz#022531a639640ff3faafaf251d1ce00a2ef000a1" - integrity sha512-fapGzoxilCn3sBtC6NtXZX6+P/Hef7VDbyfGqTTpzYydwhlkevB+0vE0EnmHPVTVSy68GUncyJ/2PcrFBeCo5Q== - dependencies: - "@typescript-eslint/scope-manager" "5.20.0" - "@typescript-eslint/type-utils" "5.20.0" - "@typescript-eslint/utils" "5.20.0" - debug "^4.3.2" - functional-red-black-tree "^1.0.1" - ignore "^5.1.8" - regexpp "^3.2.0" - semver "^7.3.5" - tsutils "^3.21.0" - -"@typescript-eslint/parser@^5.18.0": - version "5.20.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.20.0.tgz#4991c4ee0344315c2afc2a62f156565f689c8d0b" - integrity sha512-UWKibrCZQCYvobmu3/N8TWbEeo/EPQbS41Ux1F9XqPzGuV7pfg6n50ZrFo6hryynD8qOTTfLHtHjjdQtxJ0h/w== - dependencies: - "@typescript-eslint/scope-manager" "5.20.0" - "@typescript-eslint/types" "5.20.0" - "@typescript-eslint/typescript-estree" "5.20.0" - debug "^4.3.2" - -"@typescript-eslint/scope-manager@5.20.0": - version "5.20.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.20.0.tgz#79c7fb8598d2942e45b3c881ced95319818c7980" - integrity sha512-h9KtuPZ4D/JuX7rpp1iKg3zOH0WNEa+ZIXwpW/KWmEFDxlA/HSfCMhiyF1HS/drTICjIbpA6OqkAhrP/zkCStg== - dependencies: - "@typescript-eslint/types" "5.20.0" - "@typescript-eslint/visitor-keys" "5.20.0" - -"@typescript-eslint/type-utils@5.20.0": - version "5.20.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.20.0.tgz#151c21cbe9a378a34685735036e5ddfc00223be3" - integrity sha512-WxNrCwYB3N/m8ceyoGCgbLmuZwupvzN0rE8NBuwnl7APgjv24ZJIjkNzoFBXPRCGzLNkoU/WfanW0exvp/+3Iw== - dependencies: - "@typescript-eslint/utils" "5.20.0" - debug "^4.3.2" - tsutils "^3.21.0" - -"@typescript-eslint/types@5.20.0": - version "5.20.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.20.0.tgz#fa39c3c2aa786568302318f1cb51fcf64258c20c" - integrity sha512-+d8wprF9GyvPwtoB4CxBAR/s0rpP25XKgnOvMf/gMXYDvlUC3rPFHupdTQ/ow9vn7UDe5rX02ovGYQbv/IUCbg== - -"@typescript-eslint/typescript-estree@5.20.0": - version "5.20.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.20.0.tgz#ab73686ab18c8781bbf249c9459a55dc9417d6b0" - integrity sha512-36xLjP/+bXusLMrT9fMMYy1KJAGgHhlER2TqpUVDYUQg4w0q/NW/sg4UGAgVwAqb8V4zYg43KMUpM8vV2lve6w== - dependencies: - "@typescript-eslint/types" "5.20.0" - "@typescript-eslint/visitor-keys" "5.20.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.20.0": - version "5.20.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.20.0.tgz#b8e959ed11eca1b2d5414e12417fd94cae3517a5" - integrity sha512-lHONGJL1LIO12Ujyx8L8xKbwWSkoUKFSO+0wDAqGXiudWB2EO7WEUT+YZLtVbmOmSllAjLb9tpoIPwpRe5Tn6w== - dependencies: - "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.20.0" - "@typescript-eslint/types" "5.20.0" - "@typescript-eslint/typescript-estree" "5.20.0" - eslint-scope "^5.1.1" - eslint-utils "^3.0.0" - -"@typescript-eslint/visitor-keys@5.20.0": - version "5.20.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.20.0.tgz#70236b5c6b67fbaf8b2f58bf3414b76c1e826c2a" - integrity sha512-1flRpNF+0CAQkMNlTJ6L/Z5jiODG/e5+7mk6XwtPOUS3UrTz3UOiAg9jG2VtKsWI6rZQfy4C6a232QNRZTRGlg== - dependencies: - "@typescript-eslint/types" "5.20.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" @@ -804,17 +658,12 @@ acorn-walk@^7.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== -acorn-walk@^8.1.1: - version "8.2.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" - integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== - acorn@^7.1.1: version "7.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.2.4, acorn@^8.4.1, acorn@^8.7.0: +acorn@^8.2.4, acorn@^8.7.0: version "8.7.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf" integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ== @@ -875,11 +724,6 @@ anymatch@^3.0.3: normalize-path "^3.0.0" picomatch "^2.0.4" -arg@^4.1.0: - version "4.1.3" - resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" - integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== - argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -1009,13 +853,6 @@ browserslist@^4.17.5: node-releases "^2.0.2" picocolors "^1.0.0" -bs-logger@0.x: - version "0.2.6" - resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" - integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== - dependencies: - fast-json-stable-stringify "2.x" - bser@2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" @@ -1150,11 +987,6 @@ convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: dependencies: safe-buffer "~5.1.1" -create-require@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" - integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== - cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -1232,18 +1064,6 @@ diff-sequences@^27.5.1: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.5.1.tgz#eaecc0d327fd68c8d9672a1e64ab8dccb2ef5327" integrity sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ== -diff@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" - integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== - -dir-glob@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" - integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== - dependencies: - path-type "^4.0.0" - doctrine@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" @@ -1324,14 +1144,6 @@ eslint-config-prettier@^8.0.0: resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz#5a81680ec934beca02c7b1a61cf8ca34b66feab1" integrity sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q== -eslint-scope@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" - integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== - dependencies: - esrecurse "^4.3.0" - estraverse "^4.1.1" - eslint-scope@^7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.1.tgz#fff34894c2f65e5226d3041ac480b4513a163642" @@ -1352,7 +1164,7 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.3.0: +eslint-visitor-keys@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== @@ -1426,11 +1238,6 @@ esrecurse@^4.3.0: dependencies: estraverse "^5.2.0" -estraverse@^4.1.1: - version "4.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" - integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== - estraverse@^5.1.0, estraverse@^5.2.0: version "5.3.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" @@ -1491,18 +1298,7 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== -fast-glob@^3.2.9: - version "3.2.11" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.11.tgz#a1172ad95ceb8a16e20caa5c5e56480e5129c1d9" - integrity sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.4" - -fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: +fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== @@ -1512,13 +1308,6 @@ fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= -fastq@^1.6.0: - version "1.13.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" - integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== - dependencies: - reusify "^1.0.4" - fb-watchman@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85" @@ -1617,13 +1406,6 @@ get-stream@^6.0.0: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== -glob-parent@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - glob-parent@^6.0.1: version "6.0.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" @@ -1655,18 +1437,6 @@ globals@^13.6.0, globals@^13.9.0: dependencies: type-fest "^0.20.2" -globby@^11.0.4: - version "11.1.0" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" - integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== - dependencies: - array-union "^2.1.0" - dir-glob "^3.0.1" - fast-glob "^3.2.9" - ignore "^5.2.0" - merge2 "^1.4.1" - slash "^3.0.0" - graceful-fs@^4.2.9: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" @@ -1740,7 +1510,7 @@ iconv-lite@0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" -ignore@^5.1.4, ignore@^5.1.8, ignore@^5.2.0: +ignore@^5.1.4, ignore@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== @@ -1806,7 +1576,7 @@ is-generator-fn@^2.0.0: resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: +is-glob@^4.0.0, is-glob@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== @@ -2071,7 +1841,7 @@ jest-leak-detector@^27.5.1: jest-get-type "^27.5.1" pretty-format "^27.5.1" -jest-matcher-utils@^27.0.0, jest-matcher-utils@^27.5.1: +jest-matcher-utils@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.5.1.tgz#9c0cdbda8245bc22d2331729d1091308b40cf8ab" integrity sha512-z2uTx/T6LBaCoNWNFWwChLBKYxTMcGBRjAt+2SbP929/Fflb9aa5LGma654Rz8z9HLxsrUaYzxE9T/EFIL/PAw== @@ -2230,7 +2000,7 @@ jest-snapshot@^27.5.1: pretty-format "^27.5.1" semver "^7.3.2" -jest-util@^27.0.0, jest-util@^27.5.1: +jest-util@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.5.1.tgz#3ba9771e8e31a0b85da48fe0b0891fb86c01c2f9" integrity sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw== @@ -2358,7 +2128,7 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= -json5@2.x, json5@^2.1.2: +json5@^2.1.2: version "2.2.1" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== @@ -2401,11 +2171,6 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" -lodash.memoize@4.x: - version "4.1.2" - resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" - integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= - lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" @@ -2430,11 +2195,6 @@ make-dir@^3.0.0: dependencies: semver "^6.0.0" -make-error@1.x, make-error@^1.1.1: - version "1.3.6" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" - integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== - makeerror@1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a" @@ -2447,11 +2207,6 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -merge2@^1.3.0, merge2@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" - integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== - micromatch@^4.0.4: version "4.0.5" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" @@ -2636,11 +2391,6 @@ path-parse@^1.0.7: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== -path-type@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" - integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== - picocolors@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" @@ -2678,7 +2428,7 @@ prettier@>=2.3.0: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.2.tgz#e26d71a18a74c3d0f0597f55f01fb6c06c206032" integrity sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew== -pretty-format@^27.0.0, pretty-format@^27.5.1: +pretty-format@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e" integrity sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ== @@ -2725,11 +2475,6 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -queue-microtask@^1.2.2: - version "1.2.3" - resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" - integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== - react-is@^17.0.1: version "17.0.2" resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" @@ -2776,11 +2521,6 @@ resolve@^1.20.0: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" -reusify@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" - integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== - rimraf@^3.0.0, rimraf@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" @@ -2788,13 +2528,6 @@ rimraf@^3.0.0, rimraf@^3.0.2: dependencies: glob "^7.1.3" -run-parallel@^1.1.9: - version "1.2.0" - resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" - integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== - dependencies: - queue-microtask "^1.2.2" - safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" @@ -2812,18 +2545,18 @@ saxes@^5.0.1: dependencies: xmlchars "^2.2.0" -semver@7.x, semver@^7.3.2, semver@^7.3.5: +semver@^6.0.0, semver@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + +semver@^7.3.2: version "7.3.5" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== dependencies: lru-cache "^6.0.0" -semver@^6.0.0, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -3024,51 +2757,6 @@ tr46@^2.1.0: dependencies: punycode "^2.1.1" -ts-jest@^27.0.5: - version "27.1.4" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.1.4.tgz#84d42cf0f4e7157a52e7c64b1492c46330943e00" - integrity sha512-qjkZlVPWVctAezwsOD1OPzbZ+k7zA5z3oxII4dGdZo5ggX/PL7kvwTM0pXTr10fAtbiVpJaL3bWd502zAhpgSQ== - dependencies: - bs-logger "0.x" - fast-json-stable-stringify "2.x" - jest-util "^27.0.0" - json5 "2.x" - lodash.memoize "4.x" - make-error "1.x" - semver "7.x" - yargs-parser "20.x" - -ts-node@^10.2.1: - version "10.7.0" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.7.0.tgz#35d503d0fab3e2baa672a0e94f4b40653c2463f5" - integrity sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A== - dependencies: - "@cspotcode/source-map-support" "0.7.0" - "@tsconfig/node10" "^1.0.7" - "@tsconfig/node12" "^1.0.7" - "@tsconfig/node14" "^1.0.0" - "@tsconfig/node16" "^1.0.2" - acorn "^8.4.1" - acorn-walk "^8.1.1" - arg "^4.1.0" - create-require "^1.1.0" - diff "^4.0.1" - make-error "^1.1.1" - v8-compile-cache-lib "^3.0.0" - yn "3.1.1" - -tslib@^1.8.1: - version "1.14.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" - integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== - -tsutils@^3.21.0: - version "3.21.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" - integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== - dependencies: - tslib "^1.8.1" - type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" @@ -3105,11 +2793,6 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typescript@^4.5.2: - version "4.6.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.3.tgz#eefeafa6afdd31d725584c67a0eaba80f6fc6c6c" - integrity sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw== - universalify@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" @@ -3122,11 +2805,6 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" -v8-compile-cache-lib@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.0.tgz#0582bcb1c74f3a2ee46487ceecf372e46bce53e8" - integrity sha512-mpSYqfsFvASnSn5qMiwrr4VKfumbPyONLCOPmsR3A6pTY/r0+tSaVbgPWSAIuzbk3lCTa+FForeTiO+wBQGkjA== - v8-compile-cache@^2.0.3: version "2.3.0" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" @@ -3254,7 +2932,7 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yargs-parser@20.x, yargs-parser@^20.2.2: +yargs-parser@^20.2.2: version "20.2.9" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== @@ -3271,8 +2949,3 @@ yargs@^16.2.0: string-width "^4.2.0" y18n "^5.0.5" yargs-parser "^20.2.2" - -yn@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" - integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== From 82334dbf7689d8f8d0402b90bb534727ef50e932 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 22 Apr 2022 16:36:58 -0400 Subject: [PATCH 591/785] Fix up formatting on main --- test/js/files.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/js/files.test.js b/test/js/files.test.js index f1e65868..90bc1121 100644 --- a/test/js/files.test.js +++ b/test/js/files.test.js @@ -7,9 +7,9 @@ function getInferredParser(filename) { const filepath = path.join(__dirname, filename); const fileInfoOptions = { plugins: [plugin] }; - return prettier.getFileInfo(filepath, fileInfoOptions).then( - ({ inferredParser }) => inferredParser - ); + return prettier + .getFileInfo(filepath, fileInfoOptions) + .then(({ inferredParser }) => inferredParser); } describe("files", () => { From 42e4a90b069ffbc4918a2b2c8bac99c84cd56ca8 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 22 Apr 2022 16:38:40 -0400 Subject: [PATCH 592/785] Remove old debugging utilities now covered by SyntaxTree --- bin/console | 7 -- bin/debug | 163 ----------------------------------------------- bin/lex | 6 -- bin/sexp | 23 ------- prettier.gemspec | 2 +- 5 files changed, 1 insertion(+), 200 deletions(-) delete mode 100755 bin/console delete mode 100755 bin/debug delete mode 100755 bin/lex delete mode 100755 bin/sexp diff --git a/bin/console b/bin/console deleted file mode 100755 index 05b9a575..00000000 --- a/bin/console +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env ruby - -require "bundler/setup" -require "prettier" - -require "irb" -IRB.start(__FILE__) diff --git a/bin/debug b/bin/debug deleted file mode 100755 index 15d16356..00000000 --- a/bin/debug +++ /dev/null @@ -1,163 +0,0 @@ -#!/usr/bin/env ruby - -require "bundler/inline" - -gemfile do - source "https://rubygems.org" - gem "sinatra", require: "sinatra/base" - gem "webrick" -end - -require_relative "../src/ruby/parser" - -class App < Sinatra::Base - HTML = DATA.read - - get "/" do - HTML - end - - post "/ast" do - response = Prettier::Parser.parse(request.body.read) - response ? JSON.fast_generate(response) : halt(422) - rescue Prettier::Parser::ParserError - halt 422 - end - - start! -end - -__END__ - - - - - - - @prettier/plugin-ruby - - - -

@prettier/plugin-ruby

- - -
    - - - diff --git a/bin/lex b/bin/lex deleted file mode 100755 index 58af05a6..00000000 --- a/bin/lex +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env ruby - -require "ripper" - -source = File.file?(ARGV[0]) ? File.read(ARGV[0]) : ARGV[0].gsub('\\n', "\n") -pp Ripper.lex(source) diff --git a/bin/sexp b/bin/sexp deleted file mode 100755 index 1c18538c..00000000 --- a/bin/sexp +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env ruby - -require_relative "../src/ruby/parser" - -source = - if !ARGV[0] - File.read("test.rb") - elsif File.file?(ARGV[0]) - File.read(ARGV[0]) - else - ARGV[0].gsub('\\n', "\n") - end - -parsed = SyntaxTree.parse(source) - -puts "=== SOURCE === " -puts source - -puts "\n=== COMMENTS ===" -pp parsed.comments - -puts "\n=== S-EXPS ===" -pp parsed diff --git a/prettier.gemspec b/prettier.gemspec index e64c36a0..3fd2c017 100644 --- a/prettier.gemspec +++ b/prettier.gemspec @@ -14,7 +14,7 @@ Gem::Specification.new do |spec| spec.files = Dir.chdir(__dir__) do - %w[LICENSE bin/console package.json rubocop.yml] + + %w[LICENSE package.json rubocop.yml] + Dir["{{exe,lib,src}/**/*,*.md}"] + Dir[ "node_modules/prettier/{package.json,index.js,cli.js,doc.js,bin-prettier.js,third-party.js,parser-*.js}" From 43b7ab55d1182e191a33a311a62462c99a8a7517 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 22 Apr 2022 16:45:33 -0400 Subject: [PATCH 593/785] Fix up formatting on main --- prettier.gemspec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/prettier.gemspec b/prettier.gemspec index 3fd2c017..c2b45719 100644 --- a/prettier.gemspec +++ b/prettier.gemspec @@ -14,8 +14,7 @@ Gem::Specification.new do |spec| spec.files = Dir.chdir(__dir__) do - %w[LICENSE package.json rubocop.yml] + - Dir["{{exe,lib,src}/**/*,*.md}"] + + %w[LICENSE package.json rubocop.yml] + Dir["{{exe,lib,src}/**/*,*.md}"] + Dir[ "node_modules/prettier/{package.json,index.js,cli.js,doc.js,bin-prettier.js,third-party.js,parser-*.js}" ] From 0815dfed50e8bd68596b0aaec5a40250d7b8bb53 Mon Sep 17 00:00:00 2001 From: Nat Budin Date: Sat, 23 Apr 2022 09:37:31 -0700 Subject: [PATCH 594/785] Copy source files from the correct path The syntax_tree-based plugin doesn't store the source files in the same location in the package as before. So, the parseSync logic needs to know about that so it can copy the files from the new directory. --- .github/workflows/main.yml | 5 +++-- src/parseSync.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 46f96c8d..35027e8e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -58,8 +58,8 @@ jobs: fail-fast: false matrix: platform: - # - macos-latest - # - ubuntu-latest + - macos-latest + - ubuntu-latest - windows-latest yarn: - 2.x @@ -73,6 +73,7 @@ jobs: with: bundler-cache: true ruby-version: "3.1" + - run: gem install syntax_tree syntax_tree-haml syntax_tree-rbs - uses: actions/setup-node@v2 with: node-version: 12.x diff --git a/src/parseSync.js b/src/parseSync.js index 962cdf14..e4afbb1c 100644 --- a/src/parseSync.js +++ b/src/parseSync.js @@ -86,7 +86,7 @@ function spawnServer() { mkdirSync(destDir); } copyFileSync( - path.join(__dirname, "..", rubyFile), + path.join(__dirname, "..", "src", rubyFile), path.join(tempDir, rubyFile) ); }); From b16f96f6b2b1115f1eebcb1f2478ad8ceb1d1555 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Apr 2022 12:01:23 +0000 Subject: [PATCH 595/785] Bump eslint from 8.13.0 to 8.14.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.13.0 to 8.14.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.13.0...v8.14.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index b75a3549..69b00d18 100644 --- a/yarn.lock +++ b/yarn.lock @@ -293,10 +293,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@eslint/eslintrc@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.2.1.tgz#8b5e1c49f4077235516bc9ec7d41378c0f69b8c6" - integrity sha512-bxvbYnBPN1Gibwyp6NrpnFzA3YtRL3BBAyEAFVIpNTm2Rn4Vy87GA5M4aSn3InRrlsbX5N0GW7XIx+U4SAEKdQ== +"@eslint/eslintrc@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.2.2.tgz#4989b9e8c0216747ee7cca314ae73791bb281aae" + integrity sha512-lTVWHs7O2hjBFZunXTZYnYqtB9GakA1lnxIf+gKq2nY5gxkkNi/lQvveW6t8gFdOHTg6nG50Xs95PrLqVpcaLg== dependencies: ajv "^6.12.4" debug "^4.3.2" @@ -1170,11 +1170,11 @@ eslint-visitor-keys@^3.3.0: integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.1.0: - version "8.13.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.13.0.tgz#6fcea43b6811e655410f5626cfcf328016badcd7" - integrity sha512-D+Xei61eInqauAyTJ6C0q6x9mx7kTUC1KZ0m0LSEexR0V+e94K12LmWX076ZIsldwfQ2RONdaJe0re0TRGQbRQ== + version "8.14.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.14.0.tgz#62741f159d9eb4a79695b28ec4989fcdec623239" + integrity sha512-3/CE4aJX7LNEiE3i6FeodHmI/38GZtWCsAtsymScmzYapx8q1nVVb+eLcLSzATmCPXw5pT4TqVs1E0OmxAd9tw== dependencies: - "@eslint/eslintrc" "^1.2.1" + "@eslint/eslintrc" "^1.2.2" "@humanwhocodes/config-array" "^0.9.2" ajv "^6.10.0" chalk "^4.0.0" From aba756d7e9da3c00b72b3b989b189cce8885a32a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Apr 2022 12:01:06 +0000 Subject: [PATCH 596/785] Bump jest from 27.5.1 to 28.0.1 Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 27.5.1 to 28.0.1. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v28.0.1/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 1352 +++++++++++++++++++------------------------------- 2 files changed, 522 insertions(+), 832 deletions(-) diff --git a/package.json b/package.json index ef58c6d7..c2ca81a0 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "eslint": "^8.1.0", "eslint-config-prettier": "^8.0.0", "husky": "^7.0.0", - "jest": "^27.0.1", + "jest": "^28.0.1", "pretty-quick": "^3.1.2" }, "eslintConfig": { diff --git a/yarn.lock b/yarn.lock index 69b00d18..3f320a5a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21,7 +21,28 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.17.7.tgz#078d8b833fbbcc95286613be8c716cef2b519fa2" integrity sha512-p8pdE6j0a29TNGebNm7NzYZWB3xVZJBZ7XGs42uAKzQo8VQ3F0By/cQCtUEABwIqw5zo6WA4NbmxsfzADzMKnQ== -"@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.2", "@babel/core@^7.8.0": +"@babel/core@^7.11.6": + version "7.17.9" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.9.tgz#6bae81a06d95f4d0dec5bb9d74bbc1f58babdcfe" + integrity sha512-5ug+SfZCpDAkVp9SFIZAzlW18rlzsOcJGaetCjkySnrXXDUw9AR8cDUm1iByTmdWM6yxX6/zycaV76w3YTF2gw== + dependencies: + "@ampproject/remapping" "^2.1.0" + "@babel/code-frame" "^7.16.7" + "@babel/generator" "^7.17.9" + "@babel/helper-compilation-targets" "^7.17.7" + "@babel/helper-module-transforms" "^7.17.7" + "@babel/helpers" "^7.17.9" + "@babel/parser" "^7.17.9" + "@babel/template" "^7.16.7" + "@babel/traverse" "^7.17.9" + "@babel/types" "^7.17.0" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.1" + semver "^6.3.0" + +"@babel/core@^7.12.3": version "7.17.8" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.8.tgz#3dac27c190ebc3a4381110d46c80e77efe172e1a" integrity sha512-OdQDV/7cRBtJHLSOBqqbYNkOcydOgnX59TZx4puf41fzcVtN3e/4yqY8lMQsK+5X2lJtAdmA+6OHqsj1hBJ4IQ== @@ -51,6 +72,15 @@ jsesc "^2.5.1" source-map "^0.5.0" +"@babel/generator@^7.17.9": + version "7.17.9" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.17.9.tgz#f4af9fd38fa8de143c29fce3f71852406fc1e2fc" + integrity sha512-rAdDousTwxbIxbz5I7GEQ3lUip+xVCXooZNbsydCWs3xA7ZsYOv+CFRdzGxRX78BmQHu9B1Eso59AOZQOJDEdQ== + dependencies: + "@babel/types" "^7.17.0" + jsesc "^2.5.1" + source-map "^0.5.0" + "@babel/helper-compilation-targets@^7.17.7": version "7.17.7" resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.7.tgz#a3c2924f5e5f0379b356d4cfb313d1414dc30e46" @@ -77,6 +107,14 @@ "@babel/template" "^7.16.7" "@babel/types" "^7.16.7" +"@babel/helper-function-name@^7.17.9": + version "7.17.9" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz#136fcd54bc1da82fcb47565cf16fd8e444b1ff12" + integrity sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg== + dependencies: + "@babel/template" "^7.16.7" + "@babel/types" "^7.17.0" + "@babel/helper-get-function-arity@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz#ea08ac753117a669f1508ba06ebcc49156387419" @@ -150,6 +188,15 @@ "@babel/traverse" "^7.17.3" "@babel/types" "^7.17.0" +"@babel/helpers@^7.17.9": + version "7.17.9" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.17.9.tgz#b2af120821bfbe44f9907b1826e168e819375a1a" + integrity sha512-cPCt915ShDWUEzEp3+UNRktO2n6v49l5RSnG9M5pS24hA+2FAc5si+Pn1i4VVbQQ+jh+bIZhPFQOJOzbrOYY1Q== + dependencies: + "@babel/template" "^7.16.7" + "@babel/traverse" "^7.17.9" + "@babel/types" "^7.17.0" + "@babel/highlight@^7.16.7": version "7.16.10" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.10.tgz#744f2eb81579d6eea753c227b0f570ad785aba88" @@ -164,6 +211,11 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.8.tgz#2817fb9d885dd8132ea0f8eb615a6388cca1c240" integrity sha512-BoHhDJrJXqcg+ZL16Xv39H9n+AqJ4pcDrQBGZN+wHxIysrLZ3/ECwCBUch/1zUNhnsXULcONU3Ei5Hmkfk6kiQ== +"@babel/parser@^7.17.9": + version "7.17.9" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.9.tgz#9c94189a6062f0291418ca021077983058e171ef" + integrity sha512-vqUSBLP8dQHFPdPi9bc5GK9vRkYHJ49fsZdtoJ8EQ8ibpwk5rPKfvNIwChB0KVXcIjcepEBBd2VHC5r9Gy8ueg== + "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" @@ -280,6 +332,22 @@ debug "^4.1.0" globals "^11.1.0" +"@babel/traverse@^7.17.9": + version "7.17.9" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.17.9.tgz#1f9b207435d9ae4a8ed6998b2b82300d83c37a0d" + integrity sha512-PQO8sDIJ8SIwipTPiR71kJQCKQYB5NGImbOviK8K+kg5xkNSYXLBupuX9QhatFowrsvo9Hj8WgArg3W7ijNAQw== + dependencies: + "@babel/code-frame" "^7.16.7" + "@babel/generator" "^7.17.9" + "@babel/helper-environment-visitor" "^7.16.7" + "@babel/helper-function-name" "^7.17.9" + "@babel/helper-hoist-variables" "^7.16.7" + "@babel/helper-split-export-declaration" "^7.16.7" + "@babel/parser" "^7.17.9" + "@babel/types" "^7.17.0" + debug "^4.1.0" + globals "^11.1.0" + "@babel/types@^7.0.0", "@babel/types@^7.16.7", "@babel/types@^7.17.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3": version "7.17.0" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.17.0.tgz#a826e368bccb6b3d84acd76acad5c0d87342390b" @@ -338,173 +406,195 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.5.1.tgz#260fe7239602fe5130a94f1aa386eff54b014bba" - integrity sha512-kZ/tNpS3NXn0mlXXXPNuDZnb4c0oZ20r4K5eemM2k30ZC3G0T02nXUvyhf5YdbXWHPEJLc9qGLxEZ216MdL+Zg== +"@jest/console@^28.0.1": + version "28.0.1" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-28.0.1.tgz#4869cecbc5ffddbd03feaaeddcc73110d9e23f49" + integrity sha512-c05/4ZS+1d/TM4svDxrsh+vbYUPC08C0zG/DWJgdv2rtkDgYHRfLtt9bSaWpSISE+NtqdRbnzbUtJeBXjTKyhQ== dependencies: - "@jest/types" "^27.5.1" + "@jest/types" "^28.0.1" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^27.5.1" - jest-util "^27.5.1" + jest-message-util "^28.0.1" + jest-util "^28.0.1" slash "^3.0.0" -"@jest/core@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.5.1.tgz#267ac5f704e09dc52de2922cbf3af9edcd64b626" - integrity sha512-AK6/UTrvQD0Cd24NSqmIA6rKsu0tKIxfiCducZvqxYdmMisOYAsdItspT+fQDQYARPf8XgjAFZi0ogW2agH5nQ== +"@jest/core@^28.0.1": + version "28.0.1" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-28.0.1.tgz#9d3cd1f157f3e53c0e61e242ae39a1872befc374" + integrity sha512-hTxTpwJPOwHpCFwo4s6QVHq423RtZNaBsb/JQdicLzGvQuxnAzvaA7H3NFiv+TB6ExSOdW5aG2Q5nz/IwYCHIQ== dependencies: - "@jest/console" "^27.5.1" - "@jest/reporters" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/transform" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/console" "^28.0.1" + "@jest/reporters" "^28.0.1" + "@jest/test-result" "^28.0.1" + "@jest/transform" "^28.0.1" + "@jest/types" "^28.0.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - emittery "^0.8.1" + ci-info "^3.2.0" exit "^0.1.2" graceful-fs "^4.2.9" - jest-changed-files "^27.5.1" - jest-config "^27.5.1" - jest-haste-map "^27.5.1" - jest-message-util "^27.5.1" - jest-regex-util "^27.5.1" - jest-resolve "^27.5.1" - jest-resolve-dependencies "^27.5.1" - jest-runner "^27.5.1" - jest-runtime "^27.5.1" - jest-snapshot "^27.5.1" - jest-util "^27.5.1" - jest-validate "^27.5.1" - jest-watcher "^27.5.1" + jest-changed-files "^28.0.0" + jest-config "^28.0.1" + jest-haste-map "^28.0.1" + jest-message-util "^28.0.1" + jest-regex-util "^28.0.0" + jest-resolve "^28.0.1" + jest-resolve-dependencies "^28.0.1" + jest-runner "^28.0.1" + jest-runtime "^28.0.1" + jest-snapshot "^28.0.1" + jest-util "^28.0.1" + jest-validate "^28.0.1" + jest-watcher "^28.0.1" micromatch "^4.0.4" + pretty-format "^28.0.1" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.5.1.tgz#d7425820511fe7158abbecc010140c3fd3be9c74" - integrity sha512-/WQjhPJe3/ghaol/4Bq480JKXV/Rfw8nQdN7f41fM8VDHLcxKXou6QyXAh3EFr9/bVG3x74z1NWDkP87EiY8gA== +"@jest/environment@^28.0.1": + version "28.0.1" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-28.0.1.tgz#a50cefc75329b7f499b65694fc405509bd3a8ec9" + integrity sha512-PuN3TBNFSUKNgEgFgJxb15/GOyhXc46wbyCobUcf8ijUgteEmVXD4FfUZpe5QXg/bpmydufzx/02BRlUfkM44Q== dependencies: - "@jest/fake-timers" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/fake-timers" "^28.0.1" + "@jest/types" "^28.0.1" "@types/node" "*" - jest-mock "^27.5.1" + jest-mock "^28.0.1" -"@jest/fake-timers@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.5.1.tgz#76979745ce0579c8a94a4678af7a748eda8ada74" - integrity sha512-/aPowoolwa07k7/oM3aASneNeBGCmGQsc3ugN4u6s4C/+s5M64MFo/+djTdiwcbQlRfFElGuDXWzaWj6QgKObQ== +"@jest/expect-utils@^28.0.1": + version "28.0.1" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-28.0.1.tgz#c6aa0fb629e3d205384406c2e6cb00b7916c597a" + integrity sha512-ctuvt7SeoVlG3P2eemtq3/TF5a7ncnpC18Ctv1BjCfBjkjVKtAkDblw6qhx24tZlYdhm0lrihwK80pkzmkUctw== dependencies: - "@jest/types" "^27.5.1" - "@sinonjs/fake-timers" "^8.0.1" + jest-get-type "^28.0.0" + +"@jest/expect@^28.0.1": + version "28.0.1" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-28.0.1.tgz#eb836dc95686e724de3419bf08e43f12466a9fb2" + integrity sha512-qRAiC7/gJ/1z2O+TnGCVUTJ/HkqXhDCSm4R7ydfY/rOMryvFzccpALmHdI8joovGRQvkHStM/wwHRHRQTc8+zQ== + dependencies: + expect "^28.0.1" + jest-snapshot "^28.0.1" + +"@jest/fake-timers@^28.0.1": + version "28.0.1" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-28.0.1.tgz#e0a95401a06b28224475fe0a124835d6e689869b" + integrity sha512-w7JleyVymoVWMvsnRRpM/ySM+K6qq+cLwK33VbFAghKTHp14oBiOio1Hh1egUyFdNybmKZxQvBBwB0M/48LgGQ== + dependencies: + "@jest/types" "^28.0.1" + "@sinonjs/fake-timers" "^9.1.1" "@types/node" "*" - jest-message-util "^27.5.1" - jest-mock "^27.5.1" - jest-util "^27.5.1" + jest-message-util "^28.0.1" + jest-mock "^28.0.1" + jest-util "^28.0.1" -"@jest/globals@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.5.1.tgz#7ac06ce57ab966566c7963431cef458434601b2b" - integrity sha512-ZEJNB41OBQQgGzgyInAv0UUfDDj3upmHydjieSxFvTRuZElrx7tXg/uVQ5hYVEwiXs3+aMsAeEc9X7xiSKCm4Q== +"@jest/globals@^28.0.1": + version "28.0.1" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-28.0.1.tgz#165eced7e768c595c2eba5ae8e6d9784224328e9" + integrity sha512-KBWuQ1PQjm8IKUObSSQAGlGguJZHKaVCHWY99FSGwjyf58hT9yCYH2wFfLhWocy4Y5otK2gZbsCwWVX6WXft2Q== dependencies: - "@jest/environment" "^27.5.1" - "@jest/types" "^27.5.1" - expect "^27.5.1" + "@jest/environment" "^28.0.1" + "@jest/expect" "^28.0.1" + "@jest/types" "^28.0.1" -"@jest/reporters@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.5.1.tgz#ceda7be96170b03c923c37987b64015812ffec04" - integrity sha512-cPXh9hWIlVJMQkVk84aIvXuBB4uQQmFqZiacloFuGiP3ah1sbCxCosidXFDfqG8+6fO1oR2dTJTlsOy4VFmUfw== +"@jest/reporters@^28.0.1": + version "28.0.1" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-28.0.1.tgz#711145ea5e6c29c9f8050cb65d3ef98fe68a8290" + integrity sha512-XMjv+E0fi2QA1qbV1q/NiODueljjfM9i2SpOFqGLc8pHeAcfYfFAZIWI6DXe+2dL4RylDiAlV6Ll5KU4GyUuvA== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/transform" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/console" "^28.0.1" + "@jest/test-result" "^28.0.1" + "@jest/transform" "^28.0.1" + "@jest/types" "^28.0.1" + "@jridgewell/trace-mapping" "^0.3.7" "@types/node" "*" chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" - glob "^7.1.2" + glob "^7.1.3" graceful-fs "^4.2.9" istanbul-lib-coverage "^3.0.0" istanbul-lib-instrument "^5.1.0" istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-haste-map "^27.5.1" - jest-resolve "^27.5.1" - jest-util "^27.5.1" - jest-worker "^27.5.1" + jest-util "^28.0.1" + jest-worker "^28.0.1" slash "^3.0.0" - source-map "^0.6.0" string-length "^4.0.1" terminal-link "^2.0.0" - v8-to-istanbul "^8.1.0" + v8-to-istanbul "^9.0.0" -"@jest/source-map@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.5.1.tgz#6608391e465add4205eae073b55e7f279e04e8cf" - integrity sha512-y9NIHUYF3PJRlHk98NdC/N1gl88BL08aQQgu4k4ZopQkCw9t9cV8mtl3TV8b/YCB8XaVTFrmUTAJvjsntDireg== +"@jest/schemas@^28.0.0": + version "28.0.0" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-28.0.0.tgz#55cf5fcc82440a2a39b717bb949570c501fd5410" + integrity sha512-Pap9Jvwr8KYFvDgkya/p0FCVya+jZkWt57lHpwBylfjgmwi/gtXfhyAO/Cw+jKuMafHcXY0beNf2XV2pkcu9vA== dependencies: + "@sinclair/typebox" "^0.23.3" + +"@jest/source-map@^28.0.0": + version "28.0.0" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-28.0.0.tgz#d026fc1cd7e95fd7ce788d0b27838d9796da0a74" + integrity sha512-yeD/Y94j6UJPiaZTG5Sdww7pbHvEc7RlTucoVAdXaBaSuNcyrAkLlJonAb/xX/efCugDOEbFJdATsSnDEh45Nw== + dependencies: + "@jridgewell/trace-mapping" "^0.3.7" callsites "^3.0.0" graceful-fs "^4.2.9" - source-map "^0.6.0" -"@jest/test-result@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.5.1.tgz#56a6585fa80f7cdab72b8c5fc2e871d03832f5bb" - integrity sha512-EW35l2RYFUcUQxFJz5Cv5MTOxlJIQs4I7gxzi2zVU7PJhOwfYq1MdC5nhSmYjX1gmMmLPvB3sIaC+BkcHRBfag== +"@jest/test-result@^28.0.1": + version "28.0.1" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-28.0.1.tgz#4c0eb5d7c3947c70f7ae1a119a9bc049b8465fbf" + integrity sha512-8LhoEbdIkkYK+PZx6JhfRvI1Jw7tfB77OEJUQwp0diBvXJpjPKeFFWfsbpm7djdXuKoKvXKNzSGgjXDOFbxuhg== dependencies: - "@jest/console" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/console" "^28.0.1" + "@jest/types" "^28.0.1" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.5.1.tgz#4057e0e9cea4439e544c6353c6affe58d095745b" - integrity sha512-LCheJF7WB2+9JuCS7VB/EmGIdQuhtqjRNI9A43idHv3E4KltCTsPsLxvdaubFHSYwY/fNjMWjl6vNRhDiN7vpQ== +"@jest/test-sequencer@^28.0.1": + version "28.0.1" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-28.0.1.tgz#7260db16c12f055f80809348740c2fd2d903f6e0" + integrity sha512-PbXoEP9aovOC+KunEy65vuSAB/ZMLNcBVdMUIH2hsfFDWhQx/8OnHsz3dr3g1U6qNuCpXzD1fyM8/1TrUU0uFw== dependencies: - "@jest/test-result" "^27.5.1" + "@jest/test-result" "^28.0.1" graceful-fs "^4.2.9" - jest-haste-map "^27.5.1" - jest-runtime "^27.5.1" + jest-haste-map "^28.0.1" + slash "^3.0.0" -"@jest/transform@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.5.1.tgz#6c3501dcc00c4c08915f292a600ece5ecfe1f409" - integrity sha512-ipON6WtYgl/1329g5AIJVbUuEh0wZVbdpGwC99Jw4LwuoBNS95MVphU6zOeD9pDkon+LLbFL7lOQRapbB8SCHw== +"@jest/transform@^28.0.1": + version "28.0.1" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-28.0.1.tgz#44fced5a366af7cc5f69745c92014bf45c408d90" + integrity sha512-45fxjycts6CTPMeusSICYhMkMgFAs1opvgEBYcMmukucJw/AgVEMsGFqheWyDzlU6GJ+h9cpft/zkTGPJtzRGQ== dependencies: - "@babel/core" "^7.1.0" - "@jest/types" "^27.5.1" + "@babel/core" "^7.11.6" + "@jest/types" "^28.0.1" + "@jridgewell/trace-mapping" "^0.3.7" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.9" - jest-haste-map "^27.5.1" - jest-regex-util "^27.5.1" - jest-util "^27.5.1" + jest-haste-map "^28.0.1" + jest-regex-util "^28.0.0" + jest-util "^28.0.1" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" - source-map "^0.6.1" - write-file-atomic "^3.0.0" + write-file-atomic "^4.0.1" -"@jest/types@^27.5.1": - version "27.5.1" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.5.1.tgz#3c79ec4a8ba61c170bf937bcf9e98a9df175ec80" - integrity sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw== +"@jest/types@^28.0.1": + version "28.0.1" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-28.0.1.tgz#4bf819b570efd6fc89d8fa45a7b2c13db58800c3" + integrity sha512-Z48DBfQDtTZZAImaa1m8O1SCP9gx355FhuA6xuS8e7V5gQbj4l2hk/+EELN4UU/O9i5gjQuc94N/gC61/Qxfxw== dependencies: + "@jest/schemas" "^28.0.0" "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" "@types/node" "*" - "@types/yargs" "^16.0.0" + "@types/yargs" "^17.0.8" chalk "^4.0.0" "@jridgewell/resolve-uri@^3.0.3": @@ -525,6 +615,19 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" +"@jridgewell/trace-mapping@^0.3.7": + version "0.3.9" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + +"@sinclair/typebox@^0.23.3": + version "0.23.4" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.23.4.tgz#6ff93fd2585ce44f7481c9ff6af610fbb5de98a4" + integrity sha512-0/WqSvpVbCBAV1yPeko7eAczKbs78dNVAaX14quVlwOb2wxfKuXCx91h4NrEfkYK9zEnyVSW4JVI/trP3iS+Qg== + "@sinonjs/commons@^1.7.0": version "1.8.3" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" @@ -532,19 +635,14 @@ dependencies: type-detect "4.0.8" -"@sinonjs/fake-timers@^8.0.1": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-8.1.0.tgz#3fdc2b6cb58935b21bfb8d1625eb1300484316e7" - integrity sha512-OAPJUAtgeINhh/TAlUID4QTs53Njm7xzddaVlEs/SXwgtiD1tW22zAB/W1wdqfrpmikgaWQ9Fw6Ws+hsiRm5Vg== +"@sinonjs/fake-timers@^9.1.1": + version "9.1.2" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-9.1.2.tgz#4eaab737fab77332ab132d396a3c0d364bd0ea8c" + integrity sha512-BPS4ynJW/o92PUR4wgriz2Ud5gpST5vz6GQfMixEDK0Z8ZCUv2M7SkBLykH56T++Xs+8ln9zTGbOvNGIe02/jw== dependencies: "@sinonjs/commons" "^1.7.0" -"@tootallnate/once@1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" - integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== - -"@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": +"@types/babel__core@^7.1.14": version "7.1.19" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.19.tgz#7b497495b7d1b4812bdb9d02804d0576f43ee460" integrity sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw== @@ -570,14 +668,14 @@ "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" -"@types/babel__traverse@*", "@types/babel__traverse@^7.0.4", "@types/babel__traverse@^7.0.6": +"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": version "7.14.2" resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.14.2.tgz#ffcd470bbb3f8bf30481678fb5502278ca833a43" integrity sha512-K2waXdXBi2302XUdcHcR1jCeU0LL4TD9HRs/gk0N2Xvrht+G/BfJa4QObBQZfhMdxiCpV3COl5Nfq4uKTeTnJA== dependencies: "@babel/types" "^7.3.0" -"@types/graceful-fs@^4.1.2": +"@types/graceful-fs@^4.1.3": version "4.1.5" resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15" integrity sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw== @@ -628,53 +726,23 @@ resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b" integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== -"@types/yargs@^16.0.0": - version "16.0.4" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.4.tgz#26aad98dd2c2a38e421086ea9ad42b9e51642977" - integrity sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw== +"@types/yargs@^17.0.8": + version "17.0.10" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.10.tgz#591522fce85d8739bca7b8bb90d048e4478d186a" + integrity sha512-gmEaFwpj/7f/ROdtIlci1R1VYU1J4j95m8T+Tj3iBgiBFKg1foE/PSl93bBd5T9LDXNPo8UlNN6W0qwD8O5OaA== dependencies: "@types/yargs-parser" "*" -abab@^2.0.3, abab@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.5.tgz#c0b678fb32d60fc1219c784d6a826fe385aeb79a" - integrity sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q== - -acorn-globals@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-6.0.0.tgz#46cdd39f0f8ff08a876619b55f5ac8a6dc770b45" - integrity sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg== - dependencies: - acorn "^7.1.1" - acorn-walk "^7.1.1" - acorn-jsx@^5.3.1: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn-walk@^7.1.1: - version "7.2.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" - integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== - -acorn@^7.1.1: - version "7.4.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" - integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== - -acorn@^8.2.4, acorn@^8.7.0: +acorn@^8.7.0: version "8.7.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf" integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ== -agent-base@6: - version "6.0.2" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" - integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== - dependencies: - debug "4" - ajv@^6.10.0, ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" @@ -751,21 +819,15 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= - -babel-jest@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.5.1.tgz#a1bf8d61928edfefd21da27eb86a695bfd691444" - integrity sha512-cdQ5dXjGRd0IBRATiQ4mZGlGlRE8kJpjPOixdNRdT+m3UcNqmYWN6rK6nvtXYfY3D76cb8s/O1Ss8ea24PIwcg== +babel-jest@^28.0.1: + version "28.0.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-28.0.1.tgz#effa686f25551d930bf3b645d7513091094f8968" + integrity sha512-UbL+4xVftxnIcPKzCqmwZHwaPG8DyKOCXoWPeuKrvUFtyeUpePy6VtRiMN1Dv001NbEMNP4FVjfKwv1xe2PWZQ== dependencies: - "@jest/transform" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/transform" "^28.0.1" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^27.5.1" + babel-preset-jest "^28.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" slash "^3.0.0" @@ -781,14 +843,14 @@ babel-plugin-istanbul@^6.1.1: istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.5.1.tgz#9be98ecf28c331eb9f5df9c72d6f89deb8181c2e" - integrity sha512-50wCwD5EMNW4aRpOwtqzyZHIewTYNxLA4nhB+09d8BIssfNfzBRhkBIHiaPv1Si226TQSvp8gxAJm2iY2qs2hQ== +babel-plugin-jest-hoist@^28.0.0: + version "28.0.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-28.0.0.tgz#7429bb64b97170822dce58ee763555ebc983cbdc" + integrity sha512-Eu+TDlmKd2SsnvmlooVeHFryVHHom6ffCLSZuqrN8WpIHE0H6qiIPW5h5rFlzIZQmVqnZR2qHnbm2eQWIP7hZg== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" - "@types/babel__core" "^7.0.0" + "@types/babel__core" "^7.1.14" "@types/babel__traverse" "^7.0.6" babel-preset-current-node-syntax@^1.0.0: @@ -809,12 +871,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.5.1.tgz#91f10f58034cb7989cb4f962b69fa6eef6a6bc81" - integrity sha512-Nptf2FzlPCWYuJg41HBqXVT8ym6bXOevuCTbhxlUpjwtysGaIWFvDEjp4y+G7fl13FgOdjs7P/DmErqH7da0Ag== +babel-preset-jest@^28.0.0: + version "28.0.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-28.0.0.tgz#9e7c5f4097b63a3e9edb8f59b8030eca6901771c" + integrity sha512-JLyjfCmqCWS3tXUw86ei5fQwuwn34slNBPTluNbhoqHVI1Cbw6MsmvgEl54jPjbyzkmA6XAHJTg3EGNY7rnr4A== dependencies: - babel-plugin-jest-hoist "^27.5.1" + babel-plugin-jest-hoist "^28.0.0" babel-preset-current-node-syntax "^1.0.0" balanced-match@^1.0.0: @@ -837,11 +899,6 @@ braces@^3.0.2: dependencies: fill-range "^7.0.1" -browser-process-hrtime@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" - integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== - browserslist@^4.17.5: version "4.20.2" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.20.2.tgz#567b41508757ecd904dab4d1c646c612cd3d4f88" @@ -968,13 +1025,6 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -combined-stream@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -996,50 +1046,19 @@ cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -cssom@^0.4.4: - version "0.4.4" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10" - integrity sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw== - -cssom@~0.3.6: - version "0.3.8" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" - integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== - -cssstyle@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-2.3.0.tgz#ff665a0ddbdc31864b09647f34163443d90b0852" - integrity sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A== - dependencies: - cssom "~0.3.6" - -data-urls@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b" - integrity sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ== - dependencies: - abab "^2.0.3" - whatwg-mimetype "^2.3.0" - whatwg-url "^8.0.0" - -debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2: +debug@^4.1.0, debug@^4.1.1, debug@^4.3.2: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" -decimal.js@^10.2.1: - version "10.3.1" - resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.3.1.tgz#d8c3a444a9c6774ba60ca6ad7261c3a94fd5e783" - integrity sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ== - dedent@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= -deep-is@^0.1.3, deep-is@~0.1.3: +deep-is@^0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== @@ -1049,20 +1068,15 @@ deepmerge@^4.2.2: resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= - detect-newline@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== -diff-sequences@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.5.1.tgz#eaecc0d327fd68c8d9672a1e64ab8dccb2ef5327" - integrity sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ== +diff-sequences@^28.0.0: + version "28.0.0" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-28.0.0.tgz#06d253f0005463bf203d96fdbd6296c5f1d1888c" + integrity sha512-GTIQPn2pPa1DMoEH70P9yQgYLcGW8bjPR5EOL2JO9/7DQHX+9tTFJee3UmlGWuyUvIqMgpXXssrckLubiEUZTg== doctrine@^3.0.0: version "3.0.0" @@ -1071,22 +1085,15 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -domexception@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/domexception/-/domexception-2.0.1.tgz#fb44aefba793e1574b0af6aed2801d057529f304" - integrity sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg== - dependencies: - webidl-conversions "^5.0.0" - electron-to-chromium@^1.4.84: version "1.4.103" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.103.tgz#abfe376a4d70fa1e1b4b353b95df5d6dfd05da3a" integrity sha512-c/uKWR1Z/W30Wy/sx3dkZoj4BijbXX85QKWu9jJfjho3LBAXNEGAEW3oWiGb+dotA6C6BzCTxL2/aLes7jlUeg== -emittery@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.8.1.tgz#bb23cc86d03b30aa75a7f734819dee2e1ba70860" - integrity sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg== +emittery@^0.10.2: + version "0.10.2" + resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.10.2.tgz#902eec8aedb8c41938c46e9385e9db7e03182933" + integrity sha512-aITqOwnLanpHLNXZJENbOgjUBeHocD+xsSJmNrjovKBW5HbSpW3d1pEls7GFQPUWXiwG9+0P4GtHfEqC/4M0Iw== emoji-regex@^8.0.0: version "8.0.0" @@ -1127,18 +1134,6 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -escodegen@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.0.0.tgz#5e32b12833e8aa8fa35e1bf0befa89380484c7dd" - integrity sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw== - dependencies: - esprima "^4.0.1" - estraverse "^5.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.6.1" - eslint-config-prettier@^8.0.0: version "8.5.0" resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz#5a81680ec934beca02c7b1a61cf8ca34b66feab1" @@ -1219,7 +1214,7 @@ espree@^9.3.1: acorn-jsx "^5.3.1" eslint-visitor-keys "^3.3.0" -esprima@^4.0.0, esprima@^4.0.1: +esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== @@ -1283,15 +1278,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.5.1.tgz#83ce59f1e5bdf5f9d2b94b61d2050db48f3fef74" - integrity sha512-E1q5hSUG2AmYQwQJ041nvgpkODHQvB+RKlB4IYdru6uJsyFTRyZAP463M+1lINorwbqAmUggi6+WwkD8lCS/Dw== +expect@^28.0.1: + version "28.0.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-28.0.1.tgz#7bfac95d375d4310d5061f7e9b7f2afa55a1c1c0" + integrity sha512-sJjuHVbveEUczNITHKgHUepbEyj+UzjACMNuEln5tZI6b9L/y8jTXAN8VnOCnMoK7vuQPSttO/5HlKB+G3Enpw== dependencies: - "@jest/types" "^27.5.1" - jest-get-type "^27.5.1" - jest-matcher-utils "^27.5.1" - jest-message-util "^27.5.1" + "@jest/expect-utils" "^28.0.1" + jest-get-type "^28.0.0" + jest-matcher-utils "^28.0.1" + jest-message-util "^28.0.1" + jest-util "^28.0.1" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1303,7 +1299,7 @@ fast-json-stable-stringify@^2.0.0: resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== -fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: +fast-levenshtein@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= @@ -1350,15 +1346,6 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.5.tgz#76c8584f4fc843db64702a6bd04ab7a8bd666da3" integrity sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg== -form-data@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -1413,7 +1400,7 @@ glob-parent@^6.0.1: dependencies: is-glob "^4.0.3" -glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4: +glob@^7.1.3, glob@^7.1.4: version "7.2.0" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== @@ -1459,35 +1446,11 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" -html-encoding-sniffer@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz#42a6dc4fd33f00281176e8b23759ca4e4fa185f3" - integrity sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ== - dependencies: - whatwg-encoding "^1.0.5" - html-escaper@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== -http-proxy-agent@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" - integrity sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg== - dependencies: - "@tootallnate/once" "1" - agent-base "6" - debug "4" - -https-proxy-agent@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" - integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA== - dependencies: - agent-base "6" - debug "4" - human-signals@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" @@ -1503,13 +1466,6 @@ husky@^7.0.0: resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.4.tgz#242048245dc49c8fb1bf0cc7cfb98dd722531535" integrity sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ== -iconv-lite@0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - ignore@^5.1.4, ignore@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" @@ -1588,21 +1544,11 @@ is-number@^7.0.0: resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== -is-potential-custom-element-name@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" - integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== - is-stream@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== -is-typedarray@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= - isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -1650,228 +1596,188 @@ istanbul-reports@^3.1.3: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.5.1.tgz#a348aed00ec9bf671cc58a66fcbe7c3dfd6a68f5" - integrity sha512-buBLMiByfWGCoMsLLzGUUSpAmIAGnbR2KJoMN10ziLhOLvP4e0SlypHnAel8iqQXTrcbmfEY9sSqae5sgUsTvw== +jest-changed-files@^28.0.0: + version "28.0.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-28.0.0.tgz#f06ad666ef6ec766a77e13cb3f55bd5c0dec0461" + integrity sha512-9hFz/LuADUTv7zN+t0Ig+J/as2mtILTmgoT2XQdG/ezGbA1tfqoSwEKCXFcDaldzkskZddbh+QI2sACQGaxg6Q== dependencies: - "@jest/types" "^27.5.1" execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.5.1.tgz#37a5a4459b7bf4406e53d637b49d22c65d125ecc" - integrity sha512-D95R7x5UtlMA5iBYsOHFFbMD/GVA4R/Kdq15f7xYWUfWHBto9NYRsOvnSauTgdF+ogCpJ4tyKOXhUifxS65gdw== +jest-circus@^28.0.1: + version "28.0.1" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-28.0.1.tgz#5bad5888e4965735e765188fc21e6c73ffe8d984" + integrity sha512-33Ulac556FQcgQkDEXVVDag4PGQd+lWP9bxsuVg4q+b4x1cMiWNMCUjN5Dv1q/n90PvGzWxqXuN5X3gF93msew== dependencies: - "@jest/environment" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/environment" "^28.0.1" + "@jest/expect" "^28.0.1" + "@jest/test-result" "^28.0.1" + "@jest/types" "^28.0.1" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" - expect "^27.5.1" is-generator-fn "^2.0.0" - jest-each "^27.5.1" - jest-matcher-utils "^27.5.1" - jest-message-util "^27.5.1" - jest-runtime "^27.5.1" - jest-snapshot "^27.5.1" - jest-util "^27.5.1" - pretty-format "^27.5.1" + jest-each "^28.0.1" + jest-matcher-utils "^28.0.1" + jest-message-util "^28.0.1" + jest-runtime "^28.0.1" + jest-snapshot "^28.0.1" + jest-util "^28.0.1" + pretty-format "^28.0.1" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.5.1.tgz#278794a6e6458ea8029547e6c6cbf673bd30b145" - integrity sha512-Hc6HOOwYq4/74/c62dEE3r5elx8wjYqxY0r0G/nFrLDPMFRu6RA/u8qINOIkvhxG7mMQ5EJsOGfRpI8L6eFUVw== +jest-cli@^28.0.1: + version "28.0.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-28.0.1.tgz#0d1b90e6726dab104cb5f5e7e8fcdef20ba75644" + integrity sha512-N6m5FwG0E0sFuhT6eRhskvfPrm+e5UXoErdR1cw2csIlpZpzvnl+bP60JH/UAG9KW1wYNDo2N3tVYn/zoMbhOA== dependencies: - "@jest/core" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/core" "^28.0.1" + "@jest/test-result" "^28.0.1" + "@jest/types" "^28.0.1" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^27.5.1" - jest-util "^27.5.1" - jest-validate "^27.5.1" + jest-config "^28.0.1" + jest-util "^28.0.1" + jest-validate "^28.0.1" prompts "^2.0.1" - yargs "^16.2.0" + yargs "^17.3.1" -jest-config@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.5.1.tgz#5c387de33dca3f99ad6357ddeccd91bf3a0e4a41" - integrity sha512-5sAsjm6tGdsVbW9ahcChPAFCk4IlkQUknH5AvKjuLTSlcO/wCZKyFdn7Rg0EkC+OGgWODEy2hDpWB1PgzH0JNA== +jest-config@^28.0.1: + version "28.0.1" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-28.0.1.tgz#69bc6304edd7f44746d59393acb9ce6e55c00ef4" + integrity sha512-Zp7hsNMxhBrMYx9R+OXWXElX4TDRotgilwGwkRT7YZ4wE8d0w5LKS0mKrd9sExoIWc+cFii/WAeDXlt8/AtfCA== dependencies: - "@babel/core" "^7.8.0" - "@jest/test-sequencer" "^27.5.1" - "@jest/types" "^27.5.1" - babel-jest "^27.5.1" + "@babel/core" "^7.11.6" + "@jest/test-sequencer" "^28.0.1" + "@jest/types" "^28.0.1" + babel-jest "^28.0.1" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" - glob "^7.1.1" + glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^27.5.1" - jest-environment-jsdom "^27.5.1" - jest-environment-node "^27.5.1" - jest-get-type "^27.5.1" - jest-jasmine2 "^27.5.1" - jest-regex-util "^27.5.1" - jest-resolve "^27.5.1" - jest-runner "^27.5.1" - jest-util "^27.5.1" - jest-validate "^27.5.1" + jest-circus "^28.0.1" + jest-environment-node "^28.0.1" + jest-get-type "^28.0.0" + jest-regex-util "^28.0.0" + jest-resolve "^28.0.1" + jest-runner "^28.0.1" + jest-util "^28.0.1" + jest-validate "^28.0.1" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^27.5.1" + pretty-format "^28.0.1" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.5.1.tgz#a07f5011ac9e6643cf8a95a462b7b1ecf6680def" - integrity sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw== +jest-diff@^28.0.1: + version "28.0.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-28.0.1.tgz#fe29002a53c0a663c6cb395cad91ea0b82b0c826" + integrity sha512-XtUUND9AlP6y+O5gnxm54rcFxs65isB1NahScgBU+NqiUYdKK9qXMXAotkTJHui6GUdjApXq0zvSXB6zQh9CNg== dependencies: chalk "^4.0.0" - diff-sequences "^27.5.1" - jest-get-type "^27.5.1" - pretty-format "^27.5.1" + diff-sequences "^28.0.0" + jest-get-type "^28.0.0" + pretty-format "^28.0.1" -jest-docblock@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.5.1.tgz#14092f364a42c6108d42c33c8cf30e058e25f6c0" - integrity sha512-rl7hlABeTsRYxKiUfpHrQrG4e2obOiTQWfMEH3PxPjOtdsfLQO4ReWSZaQ7DETm4xu07rl4q/h4zcKXyU0/OzQ== +jest-docblock@^28.0.0: + version "28.0.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-28.0.0.tgz#7f39dc998da47dac243157fbe7fbc1e993ab0eb8" + integrity sha512-88od+z1QkHyvtpj1gRA6QGysopOzImocHNNlvvM7OydDe9ER6z1siLtHJXbKEfi5FoxMpYqDtszYIS50JVs0WA== dependencies: detect-newline "^3.0.0" -jest-each@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.5.1.tgz#5bc87016f45ed9507fed6e4702a5b468a5b2c44e" - integrity sha512-1Ff6p+FbhT/bXQnEouYy00bkNSY7OUpfIcmdl8vZ31A1UUaurOLPA8a8BbJOF2RDUElwJhmeaV7LnagI+5UwNQ== +jest-each@^28.0.1: + version "28.0.1" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-28.0.1.tgz#bd8d78f066df0366cfd351a5f9ba5acfa119ef89" + integrity sha512-C7ftacESgAPcs2CydQYJKBFi0T0jkuxZWds2f901coi0SJ4M9ONhFHR2WmfJpHiPWGhAl3N9E8qn8QCZhCk9fA== dependencies: - "@jest/types" "^27.5.1" + "@jest/types" "^28.0.1" chalk "^4.0.0" - jest-get-type "^27.5.1" - jest-util "^27.5.1" - pretty-format "^27.5.1" - -jest-environment-jsdom@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.5.1.tgz#ea9ccd1fc610209655a77898f86b2b559516a546" - integrity sha512-TFBvkTC1Hnnnrka/fUb56atfDtJ9VMZ94JkjTbggl1PEpwrYtUBKMezB3inLmWqQsXYLcMwNoDQwoBTAvFfsfw== - dependencies: - "@jest/environment" "^27.5.1" - "@jest/fake-timers" "^27.5.1" - "@jest/types" "^27.5.1" - "@types/node" "*" - jest-mock "^27.5.1" - jest-util "^27.5.1" - jsdom "^16.6.0" - -jest-environment-node@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.5.1.tgz#dedc2cfe52fab6b8f5714b4808aefa85357a365e" - integrity sha512-Jt4ZUnxdOsTGwSRAfKEnE6BcwsSPNOijjwifq5sDFSA2kesnXTvNqKHYgM0hDq3549Uf/KzdXNYn4wMZJPlFLw== - dependencies: - "@jest/environment" "^27.5.1" - "@jest/fake-timers" "^27.5.1" - "@jest/types" "^27.5.1" + jest-get-type "^28.0.0" + jest-util "^28.0.1" + pretty-format "^28.0.1" + +jest-environment-node@^28.0.1: + version "28.0.1" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-28.0.1.tgz#d2eacc122481438102a324b3f83216b873773a18" + integrity sha512-oGlrqMpLyHgpUThI/8hdDQfcWXKtXuWcFVTKYAeVWvD14btGUn90RlIeCqTbGv197t7NwV51PHDZBFbp1RWceQ== + dependencies: + "@jest/environment" "^28.0.1" + "@jest/fake-timers" "^28.0.1" + "@jest/types" "^28.0.1" "@types/node" "*" - jest-mock "^27.5.1" - jest-util "^27.5.1" + jest-mock "^28.0.1" + jest-util "^28.0.1" -jest-get-type@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.5.1.tgz#3cd613c507b0f7ace013df407a1c1cd578bcb4f1" - integrity sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw== +jest-get-type@^28.0.0: + version "28.0.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-28.0.0.tgz#8d36b49c151bc3a9e078a2e92d502e778ed49164" + integrity sha512-754LtawzW+Qk4o5rC+eDqfcQ9dV8z9uvbaVenmK8pju11PBGfuMDvQwRxoPews0LCaumNmYHjcAwmkYINTlhIA== -jest-haste-map@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.5.1.tgz#9fd8bd7e7b4fa502d9c6164c5640512b4e811e7f" - integrity sha512-7GgkZ4Fw4NFbMSDSpZwXeBiIbx+t/46nJ2QitkOjvwPYyZmqttu2TDSimMHP1EkPOi4xUZAN1doE5Vd25H4Jng== +jest-haste-map@^28.0.1: + version "28.0.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-28.0.1.tgz#48fa7e2c9f205118a713b04bd80c07de2795d281" + integrity sha512-qjpK9NDBiwlSHbKS0rDUDOTTDSHT4tNnJbUewfMsSiWFAOAqgcBDG3o5f1N9Srx5Hz14QsdnDuK9oy6oyQqJ9g== dependencies: - "@jest/types" "^27.5.1" - "@types/graceful-fs" "^4.1.2" + "@jest/types" "^28.0.1" + "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" - jest-regex-util "^27.5.1" - jest-serializer "^27.5.1" - jest-util "^27.5.1" - jest-worker "^27.5.1" + jest-regex-util "^28.0.0" + jest-util "^28.0.1" + jest-worker "^28.0.1" micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.5.1.tgz#a037b0034ef49a9f3d71c4375a796f3b230d1ac4" - integrity sha512-jtq7VVyG8SqAorDpApwiJJImd0V2wv1xzdheGHRGyuT7gZm6gG47QEskOlzsN1PG/6WNaCo5pmwMHDf3AkG2pQ== - dependencies: - "@jest/environment" "^27.5.1" - "@jest/source-map" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/types" "^27.5.1" - "@types/node" "*" - chalk "^4.0.0" - co "^4.6.0" - expect "^27.5.1" - is-generator-fn "^2.0.0" - jest-each "^27.5.1" - jest-matcher-utils "^27.5.1" - jest-message-util "^27.5.1" - jest-runtime "^27.5.1" - jest-snapshot "^27.5.1" - jest-util "^27.5.1" - pretty-format "^27.5.1" - throat "^6.0.1" - -jest-leak-detector@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.5.1.tgz#6ec9d54c3579dd6e3e66d70e3498adf80fde3fb8" - integrity sha512-POXfWAMvfU6WMUXftV4HolnJfnPOGEu10fscNCA76KBpRRhcMN2c8d3iT2pxQS3HLbA+5X4sOUPzYO2NUyIlHQ== +jest-leak-detector@^28.0.1: + version "28.0.1" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-28.0.1.tgz#26e4737145ee6b2aef871eda2f9606bd63fb33ca" + integrity sha512-g+0cRjOeNy0Wy/9LfgzyyVjKNnkFddEXisac+5arM3JwdW4hjZJR+5lwiIuMxuPtacldLWhu0pN63KV+Z33smQ== dependencies: - jest-get-type "^27.5.1" - pretty-format "^27.5.1" + jest-get-type "^28.0.0" + pretty-format "^28.0.1" -jest-matcher-utils@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.5.1.tgz#9c0cdbda8245bc22d2331729d1091308b40cf8ab" - integrity sha512-z2uTx/T6LBaCoNWNFWwChLBKYxTMcGBRjAt+2SbP929/Fflb9aa5LGma654Rz8z9HLxsrUaYzxE9T/EFIL/PAw== +jest-matcher-utils@^28.0.1: + version "28.0.1" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-28.0.1.tgz#9a19300603dac3fbeadc95a6e7f6285466735e22" + integrity sha512-AE1oD7mFC/rcdKYa3Nebd+zo9HOUq+x5l3ol9EHgVanxffPcDxuQELvDGDUG6jq4w/x8IDmvPHjZ42ZD5iGwCg== dependencies: chalk "^4.0.0" - jest-diff "^27.5.1" - jest-get-type "^27.5.1" - pretty-format "^27.5.1" + jest-diff "^28.0.1" + jest-get-type "^28.0.0" + pretty-format "^28.0.1" -jest-message-util@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.5.1.tgz#bdda72806da10d9ed6425e12afff38cd1458b6cf" - integrity sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g== +jest-message-util@^28.0.1: + version "28.0.1" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-28.0.1.tgz#2ee286d662363cdcf466b5c6a94615380c9dcb2d" + integrity sha512-Eb+s5Ow4MxcQb4gcIVWVdnLxCnaPrl6DZjOVe7MjKHhexmJlkVTdwvdC//YrAsJKWMU8eG2rdaGbgBk2zG2MLA== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^27.5.1" + "@jest/types" "^28.0.1" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^27.5.1" + pretty-format "^28.0.1" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.5.1.tgz#19948336d49ef4d9c52021d34ac7b5f36ff967d6" - integrity sha512-K4jKbY1d4ENhbrG2zuPWaQBvDly+iZ2yAW+T1fATN78hc0sInwn7wZB8XtlNnvHug5RMwV897Xm4LqmPM4e2Og== +jest-mock@^28.0.1: + version "28.0.1" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-28.0.1.tgz#74d1e303e0825a83c54dceaf0f5095100667eeaa" + integrity sha512-pEi1eywUvu7Ko8T5QX6l4X4694cd9NqzyeFFnH7QYDEm4INKxNbgBKLnaNmp025SlH9WHHDkHTeY4zRHPicMHw== dependencies: - "@jest/types" "^27.5.1" + "@jest/types" "^28.0.1" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -1879,181 +1785,173 @@ jest-pnp-resolver@^1.2.2: resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== -jest-regex-util@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.5.1.tgz#4da143f7e9fd1e542d4aa69617b38e4a78365b95" - integrity sha512-4bfKq2zie+x16okqDXjXn9ql2B0dScQu+vcwe4TvFVhkVyuWLqpZrZtXxLLWoXYgn0E87I6r6GRYHF7wFZBUvg== +jest-regex-util@^28.0.0: + version "28.0.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-28.0.0.tgz#b8d0bf9761328ae21900ab3f3b0ce8c4d392a73a" + integrity sha512-VqrjkteNiucN3ctI/AtBzO7iitfk5YGArPwU2cJ3WyT5Z6kGFHw/HQp0fSTkOUHdwVdJkFzbI5nh0yC82f9Kfg== -jest-resolve-dependencies@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.5.1.tgz#d811ecc8305e731cc86dd79741ee98fed06f1da8" - integrity sha512-QQOOdY4PE39iawDn5rzbIePNigfe5B9Z91GDD1ae/xNDlu9kaat8QQ5EKnNmVWPV54hUdxCVwwj6YMgR2O7IOg== +jest-resolve-dependencies@^28.0.1: + version "28.0.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-28.0.1.tgz#4448647423f16d7e27438d0704b091858741838e" + integrity sha512-ypEOCjf1OoDOmfotDWeMuMxOgT1WipFmFfS2pHnM4WMNaHBPpQtTRYSRyJN3tqSt4g1+1iP4Ldx2UgLyr3qZWQ== dependencies: - "@jest/types" "^27.5.1" - jest-regex-util "^27.5.1" - jest-snapshot "^27.5.1" + jest-regex-util "^28.0.0" + jest-snapshot "^28.0.1" -jest-resolve@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.5.1.tgz#a2f1c5a0796ec18fe9eb1536ac3814c23617b384" - integrity sha512-FFDy8/9E6CV83IMbDpcjOhumAQPDyETnU2KZ1O98DwTnz8AOBsW/Xv3GySr1mOZdItLR+zDZ7I/UdTFbgSOVCw== +jest-resolve@^28.0.1: + version "28.0.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-28.0.1.tgz#8d51581b52028df3d10746605e13b4a46ba7a37d" + integrity sha512-nQahkVO8flCRsXtlq3JZb+pElJ+9s2L9TQ0xs6x1DLXgZ3FvB3XRfQGnsqtxyMKEAbbEfypGQv1rUVpIrWfssg== dependencies: - "@jest/types" "^27.5.1" chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^27.5.1" + jest-haste-map "^28.0.1" jest-pnp-resolver "^1.2.2" - jest-util "^27.5.1" - jest-validate "^27.5.1" + jest-util "^28.0.1" + jest-validate "^28.0.1" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.5.1.tgz#071b27c1fa30d90540805c5645a0ec167c7b62e5" - integrity sha512-g4NPsM4mFCOwFKXO4p/H/kWGdJp9V8kURY2lX8Me2drgXqG7rrZAx5kv+5H7wtt/cdFIjhqYx1HrlqWHaOvDaQ== +jest-runner@^28.0.1: + version "28.0.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-28.0.1.tgz#006e2b483e67a7bbba46d82bdcb1e84d9d9ec6b4" + integrity sha512-aVRI4Ngaa9hxDg60tAm4ebqJcaI2vUyR04TuNSArI6MZh8Rfio4mP0tjqVI28TzK8RKH3JMg3ARf66nlAwOl7g== dependencies: - "@jest/console" "^27.5.1" - "@jest/environment" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/transform" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/console" "^28.0.1" + "@jest/environment" "^28.0.1" + "@jest/test-result" "^28.0.1" + "@jest/transform" "^28.0.1" + "@jest/types" "^28.0.1" "@types/node" "*" chalk "^4.0.0" - emittery "^0.8.1" + emittery "^0.10.2" graceful-fs "^4.2.9" - jest-docblock "^27.5.1" - jest-environment-jsdom "^27.5.1" - jest-environment-node "^27.5.1" - jest-haste-map "^27.5.1" - jest-leak-detector "^27.5.1" - jest-message-util "^27.5.1" - jest-resolve "^27.5.1" - jest-runtime "^27.5.1" - jest-util "^27.5.1" - jest-worker "^27.5.1" - source-map-support "^0.5.6" + jest-docblock "^28.0.0" + jest-environment-node "^28.0.1" + jest-haste-map "^28.0.1" + jest-leak-detector "^28.0.1" + jest-message-util "^28.0.1" + jest-resolve "^28.0.1" + jest-runtime "^28.0.1" + jest-util "^28.0.1" + jest-watcher "^28.0.1" + jest-worker "^28.0.1" + source-map-support "0.5.13" throat "^6.0.1" -jest-runtime@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.5.1.tgz#4896003d7a334f7e8e4a53ba93fb9bcd3db0a1af" - integrity sha512-o7gxw3Gf+H2IGt8fv0RiyE1+r83FJBRruoA+FXrlHw6xEyBsU8ugA6IPfTdVyA0w8HClpbK+DGJxH59UrNMx8A== - dependencies: - "@jest/environment" "^27.5.1" - "@jest/fake-timers" "^27.5.1" - "@jest/globals" "^27.5.1" - "@jest/source-map" "^27.5.1" - "@jest/test-result" "^27.5.1" - "@jest/transform" "^27.5.1" - "@jest/types" "^27.5.1" +jest-runtime@^28.0.1: + version "28.0.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-28.0.1.tgz#2b33b86c26a14bcba9d3be0ded50010e559ba2be" + integrity sha512-bC22PNBaMK/tX6rMIUf7Usn9V1DallrRyA5QzTqRjz0E2E1UZMUZzKWzhbV6opCI1QSgr5srn0qNUl0MpgWm1g== + dependencies: + "@jest/environment" "^28.0.1" + "@jest/fake-timers" "^28.0.1" + "@jest/globals" "^28.0.1" + "@jest/source-map" "^28.0.0" + "@jest/test-result" "^28.0.1" + "@jest/transform" "^28.0.1" + "@jest/types" "^28.0.1" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" execa "^5.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^27.5.1" - jest-message-util "^27.5.1" - jest-mock "^27.5.1" - jest-regex-util "^27.5.1" - jest-resolve "^27.5.1" - jest-snapshot "^27.5.1" - jest-util "^27.5.1" + jest-haste-map "^28.0.1" + jest-message-util "^28.0.1" + jest-mock "^28.0.1" + jest-regex-util "^28.0.0" + jest-resolve "^28.0.1" + jest-snapshot "^28.0.1" + jest-util "^28.0.1" slash "^3.0.0" strip-bom "^4.0.0" -jest-serializer@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.5.1.tgz#81438410a30ea66fd57ff730835123dea1fb1f64" - integrity sha512-jZCyo6iIxO1aqUxpuBlwTDMkzOAJS4a3eYz3YzgxxVQFwLeSA7Jfq5cbqCY+JLvTDrWirgusI/0KwxKMgrdf7w== - dependencies: - "@types/node" "*" - graceful-fs "^4.2.9" - -jest-snapshot@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.5.1.tgz#b668d50d23d38054a51b42c4039cab59ae6eb6a1" - integrity sha512-yYykXI5a0I31xX67mgeLw1DZ0bJB+gpq5IpSuCAoyDi0+BhgU/RIrL+RTzDmkNTchvDFWKP8lp+w/42Z3us5sA== +jest-snapshot@^28.0.1: + version "28.0.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-28.0.1.tgz#864d5445323c3a8c4124941394825c7f3b1874b0" + integrity sha512-xaNY3ZZtOBYIpYSAqLpClZJs66wWVpKgsQiFvu8xxjjQBRmwYwu2CAmdaiL5wmd9KxrGX+viLm2vI964hIiIcw== dependencies: - "@babel/core" "^7.7.2" + "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" - "@babel/types" "^7.0.0" - "@jest/transform" "^27.5.1" - "@jest/types" "^27.5.1" - "@types/babel__traverse" "^7.0.4" + "@babel/types" "^7.3.3" + "@jest/expect-utils" "^28.0.1" + "@jest/transform" "^28.0.1" + "@jest/types" "^28.0.1" + "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.5.1" + expect "^28.0.1" graceful-fs "^4.2.9" - jest-diff "^27.5.1" - jest-get-type "^27.5.1" - jest-haste-map "^27.5.1" - jest-matcher-utils "^27.5.1" - jest-message-util "^27.5.1" - jest-util "^27.5.1" + jest-diff "^28.0.1" + jest-get-type "^28.0.0" + jest-haste-map "^28.0.1" + jest-matcher-utils "^28.0.1" + jest-message-util "^28.0.1" + jest-util "^28.0.1" natural-compare "^1.4.0" - pretty-format "^27.5.1" - semver "^7.3.2" + pretty-format "^28.0.1" + semver "^7.3.5" -jest-util@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.5.1.tgz#3ba9771e8e31a0b85da48fe0b0891fb86c01c2f9" - integrity sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw== +jest-util@^28.0.1: + version "28.0.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-28.0.1.tgz#af1da8ea0f8035a489ddd68b547ae3ed428426fa" + integrity sha512-gFpqWx9XqBmJRYqSnQ2FbpxWpvAU3TIGFQcfBrwnMVvwbB1ZHhhoQgS+oD0Ek61l9XkLsoWW20woaNlCRf4eMA== dependencies: - "@jest/types" "^27.5.1" + "@jest/types" "^28.0.1" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.5.1.tgz#9197d54dc0bdb52260b8db40b46ae668e04df067" - integrity sha512-thkNli0LYTmOI1tDB3FI1S1RTp/Bqyd9pTarJwL87OIBFuqEb5Apv5EaApEudYg4g86e3CT6kM0RowkhtEnCBQ== +jest-validate@^28.0.1: + version "28.0.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-28.0.1.tgz#7f360030a2c8eeb91b62de92ab00829119a0ad73" + integrity sha512-1mWGDluyjCSGc5u/gw0JKo6SlVfALiho5bLTfqmStOsdy3k69k7/dp18dq49WctHwQ9C+i4SkqpbQG7l63nxiw== dependencies: - "@jest/types" "^27.5.1" + "@jest/types" "^28.0.1" camelcase "^6.2.0" chalk "^4.0.0" - jest-get-type "^27.5.1" + jest-get-type "^28.0.0" leven "^3.1.0" - pretty-format "^27.5.1" + pretty-format "^28.0.1" -jest-watcher@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.5.1.tgz#71bd85fb9bde3a2c2ec4dc353437971c43c642a2" - integrity sha512-z676SuD6Z8o8qbmEGhoEUFOM1+jfEiL3DXHK/xgEiG2EyNYfFG60jluWcupY6dATjfEsKQuibReS1djInQnoVw== +jest-watcher@^28.0.1: + version "28.0.1" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-28.0.1.tgz#1460553913120ddfe3045fda7e80144819cc576e" + integrity sha512-tKyjsQal10vBomcyn79ZTutv0N0/dSfYJ+WRFJ3nlaMejiDlLKjMGQ/QrcwcXIXMXQyt0tJG1ycmqLbJg5AK6A== dependencies: - "@jest/test-result" "^27.5.1" - "@jest/types" "^27.5.1" + "@jest/test-result" "^28.0.1" + "@jest/types" "^28.0.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^27.5.1" + emittery "^0.10.2" + jest-util "^28.0.1" string-length "^4.0.1" -jest-worker@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" - integrity sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg== +jest-worker@^28.0.1: + version "28.0.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-28.0.1.tgz#7abc005335a5937e6a4f8d24c980c7630a849012" + integrity sha512-Z3j1jfZwtt2ruKwU391a4/kKdYEId7Vy9+6Jeeq5Xl0glJDnOAvO5ixNmgMokMmbpet41jc4MpUx71ciyeTB/A== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" -jest@^27.0.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.5.1.tgz#dadf33ba70a779be7a6fc33015843b51494f63fc" - integrity sha512-Yn0mADZB89zTtjkPJEXwrac3LHudkQMR+Paqa8uxJHCBr9agxztUifWCyiYrjhMPBoUVBjyny0I7XH6ozDr7QQ== +jest@^28.0.1: + version "28.0.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-28.0.1.tgz#064ab082ba3af4c09fc0b227c14b17858083eda7" + integrity sha512-rqP6qSiZ00LUpajUBJIBKjCSE2tOy4x0Y/HI4EJntg51tND02VEiKjKkzgebFyMsFs85H+HGxLgezwOwa1bfwA== dependencies: - "@jest/core" "^27.5.1" + "@jest/core" "^28.0.1" import-local "^3.0.2" - jest-cli "^27.5.1" + jest-cli "^28.0.1" js-tokens@^4.0.0: version "4.0.0" @@ -2075,39 +1973,6 @@ js-yaml@^4.1.0: dependencies: argparse "^2.0.1" -jsdom@^16.6.0: - version "16.7.0" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.7.0.tgz#918ae71965424b197c819f8183a754e18977b710" - integrity sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw== - dependencies: - abab "^2.0.5" - acorn "^8.2.4" - acorn-globals "^6.0.0" - cssom "^0.4.4" - cssstyle "^2.3.0" - data-urls "^2.0.0" - decimal.js "^10.2.1" - domexception "^2.0.1" - escodegen "^2.0.0" - form-data "^3.0.0" - html-encoding-sniffer "^2.0.1" - http-proxy-agent "^4.0.1" - https-proxy-agent "^5.0.0" - is-potential-custom-element-name "^1.0.1" - nwsapi "^2.2.0" - parse5 "6.0.1" - saxes "^5.0.1" - symbol-tree "^3.2.4" - tough-cookie "^4.0.0" - w3c-hr-time "^1.0.2" - w3c-xmlserializer "^2.0.0" - webidl-conversions "^6.1.0" - whatwg-encoding "^1.0.5" - whatwg-mimetype "^2.3.0" - whatwg-url "^8.5.0" - ws "^7.4.6" - xml-name-validator "^3.0.0" - jsesc@^2.5.1: version "2.5.2" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" @@ -2128,7 +1993,7 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= -json5@^2.1.2: +json5@^2.1.2, json5@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== @@ -2151,14 +2016,6 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" -levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - lines-and-columns@^1.1.6: version "1.2.4" resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" @@ -2176,11 +2033,6 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lodash@^4.7.0: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - lru-cache@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" @@ -2215,18 +2067,6 @@ micromatch@^4.0.4: braces "^3.0.2" picomatch "^2.3.1" -mime-db@1.52.0: - version "1.52.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" - integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== - -mime-types@^2.1.12: - version "2.1.35" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" - integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== - dependencies: - mime-db "1.52.0" - mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" @@ -2287,11 +2127,6 @@ npm-run-path@^4.0.0, npm-run-path@^4.0.1: dependencies: path-key "^3.0.0" -nwsapi@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7" - integrity sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ== - once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -2306,18 +2141,6 @@ onetime@^5.1.0, onetime@^5.1.2: dependencies: mimic-fn "^2.1.0" -optionator@^0.8.1: - version "0.8.3" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" - integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.6" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - word-wrap "~1.2.3" - optionator@^0.9.1: version "0.9.1" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" @@ -2366,11 +2189,6 @@ parse-json@^5.2.0: json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" -parse5@6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" - integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== - path-exists@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" @@ -2418,24 +2236,20 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= - prettier@>=2.3.0: version "2.6.2" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.2.tgz#e26d71a18a74c3d0f0597f55f01fb6c06c206032" integrity sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew== -pretty-format@^27.5.1: - version "27.5.1" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e" - integrity sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ== +pretty-format@^28.0.1: + version "28.0.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-28.0.1.tgz#ae6753bd2bf26fdd552f41194568ccbef23d22af" + integrity sha512-utVSIy0ImophYyJALfiWULOeMnfoxLZEzii/92VcSzN7OX5U1r7erAMqfDJyuv31ugw4Rp5tOYUMndsZV1w8DQ== dependencies: + "@jest/schemas" "^28.0.0" ansi-regex "^5.0.1" ansi-styles "^5.0.0" - react-is "^17.0.1" + react-is "^18.0.0" pretty-quick@^3.1.2: version "3.1.3" @@ -2457,11 +2271,6 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" -psl@^1.1.33: - version "1.8.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" - integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== - pump@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" @@ -2470,15 +2279,15 @@ pump@^3.0.0: end-of-stream "^1.1.0" once "^1.3.1" -punycode@^2.1.0, punycode@^2.1.1: +punycode@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -react-is@^17.0.1: - version "17.0.2" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" - integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== +react-is@^18.0.0: + version "18.0.0" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.0.0.tgz#026f6c4a27dbe33bf4a35655b9e1327c4e55e3f5" + integrity sha512-yUcBYdBBbo3QiPsgYDcfQcIkGZHfxOaoE6HLSnr1sPzMhdyxusbfKOSUbSd/ocGi32dxcj366PsTj+5oggeKKw== regexpp@^3.2.0: version "3.2.0" @@ -2533,27 +2342,15 @@ safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -"safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -saxes@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/saxes/-/saxes-5.0.1.tgz#eebab953fa3b7608dbe94e5dadb15c888fa6696d" - integrity sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw== - dependencies: - xmlchars "^2.2.0" - semver@^6.0.0, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.3.2: - version "7.3.5" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" - integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== +semver@^7.3.5: + version "7.3.7" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" + integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== dependencies: lru-cache "^6.0.0" @@ -2569,7 +2366,7 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== -signal-exit@^3.0.2, signal-exit@^3.0.3: +signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: version "3.0.7" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== @@ -2584,10 +2381,10 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -source-map-support@^0.5.6: - version "0.5.21" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" - integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== +source-map-support@0.5.13: + version "0.5.13" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" + integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -2597,16 +2394,11 @@ source-map@^0.5.0: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= -source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: +source-map@^0.6.0, source-map@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -source-map@^0.7.3: - version "0.7.3" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" - integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== - sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -2627,7 +2419,7 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -string-width@^4.1.0, string-width@^4.2.0: +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -2692,11 +2484,6 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== -symbol-tree@^3.2.4: - version "3.2.4" - resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" - integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== - terminal-link@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/terminal-link/-/terminal-link-2.1.1.tgz#14a64a27ab3c0df933ea546fba55f2d078edc994" @@ -2741,22 +2528,6 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -tough-cookie@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.0.0.tgz#d822234eeca882f991f0f908824ad2622ddbece4" - integrity sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg== - dependencies: - psl "^1.1.33" - punycode "^2.1.1" - universalify "^0.1.2" - -tr46@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.1.0.tgz#fa87aa81ca5d5941da8cbf1f9b749dc969a4e240" - integrity sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw== - dependencies: - punycode "^2.1.1" - type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" @@ -2764,13 +2535,6 @@ type-check@^0.4.0, type-check@~0.4.0: dependencies: prelude-ls "^1.2.1" -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= - dependencies: - prelude-ls "~1.1.2" - type-detect@4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" @@ -2786,18 +2550,6 @@ type-fest@^0.21.3: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== -typedarray-to-buffer@^3.1.5: - version "3.1.5" - resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" - integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== - dependencies: - is-typedarray "^1.0.0" - -universalify@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" - integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== - uri-js@^4.2.2: version "4.4.1" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" @@ -2810,28 +2562,14 @@ v8-compile-cache@^2.0.3: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== -v8-to-istanbul@^8.1.0: - version "8.1.1" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz#77b752fd3975e31bbcef938f85e9bd1c7a8d60ed" - integrity sha512-FGtKtv3xIpR6BYhvgH8MI/y78oT7d8Au3ww4QIxymrCtZEh5b8gCw2siywE+puhEmuWKDtmfrvF5UlB298ut3w== +v8-to-istanbul@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.0.0.tgz#be0dae58719fc53cb97e5c7ac1d7e6d4f5b19511" + integrity sha512-HcvgY/xaRm7isYmyx+lFKA4uQmfUbN0J4M0nNItvzTvH/iQ9kW5j/t4YSR+Ge323/lrgDAWJoF46tzGQHwBHFw== dependencies: + "@jridgewell/trace-mapping" "^0.3.7" "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" - source-map "^0.7.3" - -w3c-hr-time@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" - integrity sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ== - dependencies: - browser-process-hrtime "^1.0.0" - -w3c-xmlserializer@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz#3e7104a05b75146cc60f564380b7f683acf1020a" - integrity sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA== - dependencies: - xml-name-validator "^3.0.0" walker@^1.0.7: version "1.0.8" @@ -2840,37 +2578,6 @@ walker@^1.0.7: dependencies: makeerror "1.0.12" -webidl-conversions@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-5.0.0.tgz#ae59c8a00b121543a2acc65c0434f57b0fc11aff" - integrity sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA== - -webidl-conversions@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" - integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== - -whatwg-encoding@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" - integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== - dependencies: - iconv-lite "0.4.24" - -whatwg-mimetype@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" - integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== - -whatwg-url@^8.0.0, whatwg-url@^8.5.0: - version "8.7.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.7.0.tgz#656a78e510ff8f3937bc0bcbe9f5c0ac35941b77" - integrity sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg== - dependencies: - lodash "^4.7.0" - tr46 "^2.1.0" - webidl-conversions "^6.1.0" - which@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" @@ -2878,7 +2585,7 @@ which@^2.0.1: dependencies: isexe "^2.0.0" -word-wrap@^1.2.3, word-wrap@~1.2.3: +word-wrap@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== @@ -2897,30 +2604,13 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= -write-file-atomic@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" - integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== +write-file-atomic@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-4.0.1.tgz#9faa33a964c1c85ff6f849b80b42a88c2c537c8f" + integrity sha512-nSKUxgAbyioruk6hU87QzVbY279oYT6uiwgDoujth2ju4mJ+TZau7SQBhtbTmUyuNYTuXnSyRn66FV0+eCgcrQ== dependencies: imurmurhash "^0.1.4" - is-typedarray "^1.0.0" - signal-exit "^3.0.2" - typedarray-to-buffer "^3.1.5" - -ws@^7.4.6: - version "7.5.7" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.7.tgz#9e0ac77ee50af70d58326ecff7e85eb3fa375e67" - integrity sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A== - -xml-name-validator@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" - integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== - -xmlchars@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" - integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== + signal-exit "^3.0.7" y18n@^5.0.5: version "5.0.8" @@ -2932,20 +2622,20 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yargs-parser@^20.2.2: - version "20.2.9" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== +yargs-parser@^21.0.0: + version "21.0.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.0.1.tgz#0267f286c877a4f0f728fceb6f8a3e4cb95c6e35" + integrity sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg== -yargs@^16.2.0: - version "16.2.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" - integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== +yargs@^17.3.1: + version "17.4.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.4.1.tgz#ebe23284207bb75cee7c408c33e722bfb27b5284" + integrity sha512-WSZD9jgobAg3ZKuCQZSa3g9QOJeCCqLoLAykiWgmXnDo9EPnn4RPf5qVTtzgOx66o6/oqhcA5tHtJXpG8pMt3g== dependencies: cliui "^7.0.2" escalade "^3.1.1" get-caller-file "^2.0.5" require-directory "^2.1.1" - string-width "^4.2.0" + string-width "^4.2.3" y18n "^5.0.5" - yargs-parser "^20.2.2" + yargs-parser "^21.0.0" From 4c236c722ea4f055f8dd51806882dc5b7eedc546 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Apr 2022 12:01:35 +0000 Subject: [PATCH 597/785] Bump jest from 28.0.1 to 28.0.2 Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 28.0.1 to 28.0.2. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v28.0.2/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 696 +++++++++++++++++++++++++++--------------------------- 1 file changed, 348 insertions(+), 348 deletions(-) diff --git a/yarn.lock b/yarn.lock index 3f320a5a..ce351f57 100644 --- a/yarn.lock +++ b/yarn.lock @@ -406,109 +406,109 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^28.0.1": - version "28.0.1" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-28.0.1.tgz#4869cecbc5ffddbd03feaaeddcc73110d9e23f49" - integrity sha512-c05/4ZS+1d/TM4svDxrsh+vbYUPC08C0zG/DWJgdv2rtkDgYHRfLtt9bSaWpSISE+NtqdRbnzbUtJeBXjTKyhQ== +"@jest/console@^28.0.2": + version "28.0.2" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-28.0.2.tgz#d11e8b43ae431ae9b3112656848417ae4008fcad" + integrity sha512-tiRpnMeeyQuuzgL5UNSeiqMwF8UOWPbAE5rzcu/1zyq4oPG2Ox6xm4YCOruwbp10F8odWc+XwVxTyGzMSLMqxA== dependencies: - "@jest/types" "^28.0.1" + "@jest/types" "^28.0.2" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^28.0.1" - jest-util "^28.0.1" + jest-message-util "^28.0.2" + jest-util "^28.0.2" slash "^3.0.0" -"@jest/core@^28.0.1": - version "28.0.1" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-28.0.1.tgz#9d3cd1f157f3e53c0e61e242ae39a1872befc374" - integrity sha512-hTxTpwJPOwHpCFwo4s6QVHq423RtZNaBsb/JQdicLzGvQuxnAzvaA7H3NFiv+TB6ExSOdW5aG2Q5nz/IwYCHIQ== +"@jest/core@^28.0.2": + version "28.0.2" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-28.0.2.tgz#b8433545c32b5e368bfb4d46c9cd01d58c19f0ef" + integrity sha512-AK6xU9wfo9E3wA4fY8t59I2t5hnS3eCVYhD1OVZPMZyUrtIQbU1HR+h9jz3ulsEv39xSDH94QY2IJr46O637ag== dependencies: - "@jest/console" "^28.0.1" - "@jest/reporters" "^28.0.1" - "@jest/test-result" "^28.0.1" - "@jest/transform" "^28.0.1" - "@jest/types" "^28.0.1" + "@jest/console" "^28.0.2" + "@jest/reporters" "^28.0.2" + "@jest/test-result" "^28.0.2" + "@jest/transform" "^28.0.2" + "@jest/types" "^28.0.2" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" ci-info "^3.2.0" exit "^0.1.2" graceful-fs "^4.2.9" - jest-changed-files "^28.0.0" - jest-config "^28.0.1" - jest-haste-map "^28.0.1" - jest-message-util "^28.0.1" - jest-regex-util "^28.0.0" - jest-resolve "^28.0.1" - jest-resolve-dependencies "^28.0.1" - jest-runner "^28.0.1" - jest-runtime "^28.0.1" - jest-snapshot "^28.0.1" - jest-util "^28.0.1" - jest-validate "^28.0.1" - jest-watcher "^28.0.1" + jest-changed-files "^28.0.2" + jest-config "^28.0.2" + jest-haste-map "^28.0.2" + jest-message-util "^28.0.2" + jest-regex-util "^28.0.2" + jest-resolve "^28.0.2" + jest-resolve-dependencies "^28.0.2" + jest-runner "^28.0.2" + jest-runtime "^28.0.2" + jest-snapshot "^28.0.2" + jest-util "^28.0.2" + jest-validate "^28.0.2" + jest-watcher "^28.0.2" micromatch "^4.0.4" - pretty-format "^28.0.1" + pretty-format "^28.0.2" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^28.0.1": - version "28.0.1" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-28.0.1.tgz#a50cefc75329b7f499b65694fc405509bd3a8ec9" - integrity sha512-PuN3TBNFSUKNgEgFgJxb15/GOyhXc46wbyCobUcf8ijUgteEmVXD4FfUZpe5QXg/bpmydufzx/02BRlUfkM44Q== +"@jest/environment@^28.0.2": + version "28.0.2" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-28.0.2.tgz#a865949d876b2d364b979bbc0a46338ffd23de26" + integrity sha512-IvI7dEfqVEffDYlw9FQfVBt6kXt/OI38V7QUIur0ulOQgzpKYJDVvLzj4B1TVmHWTGW5tcnJdlZ3hqzV6/I9Qg== dependencies: - "@jest/fake-timers" "^28.0.1" - "@jest/types" "^28.0.1" + "@jest/fake-timers" "^28.0.2" + "@jest/types" "^28.0.2" "@types/node" "*" - jest-mock "^28.0.1" + jest-mock "^28.0.2" -"@jest/expect-utils@^28.0.1": - version "28.0.1" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-28.0.1.tgz#c6aa0fb629e3d205384406c2e6cb00b7916c597a" - integrity sha512-ctuvt7SeoVlG3P2eemtq3/TF5a7ncnpC18Ctv1BjCfBjkjVKtAkDblw6qhx24tZlYdhm0lrihwK80pkzmkUctw== +"@jest/expect-utils@^28.0.2": + version "28.0.2" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-28.0.2.tgz#0a055868d225261eac82a12013e2e0735238774d" + integrity sha512-YryfH2zN5c7M8eLtn9oTBRj1sfD+X4cHNXJnTejqCveOS33wADEZUxJ7de5++lRvByNpRpfAnc8zTK7yrUJqgA== dependencies: - jest-get-type "^28.0.0" + jest-get-type "^28.0.2" -"@jest/expect@^28.0.1": - version "28.0.1" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-28.0.1.tgz#eb836dc95686e724de3419bf08e43f12466a9fb2" - integrity sha512-qRAiC7/gJ/1z2O+TnGCVUTJ/HkqXhDCSm4R7ydfY/rOMryvFzccpALmHdI8joovGRQvkHStM/wwHRHRQTc8+zQ== +"@jest/expect@^28.0.2": + version "28.0.2" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-28.0.2.tgz#ca94154c63a69027da0932b712b0104618cb98b1" + integrity sha512-rxgWG/updGoQtHFw/duImu5gPN48+kHvhVjLJ0fFk2mYQ+3dp7/zLiNTjSQxc92Bq4VOk+b6ln0gSgKM4etOtQ== dependencies: - expect "^28.0.1" - jest-snapshot "^28.0.1" + expect "^28.0.2" + jest-snapshot "^28.0.2" -"@jest/fake-timers@^28.0.1": - version "28.0.1" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-28.0.1.tgz#e0a95401a06b28224475fe0a124835d6e689869b" - integrity sha512-w7JleyVymoVWMvsnRRpM/ySM+K6qq+cLwK33VbFAghKTHp14oBiOio1Hh1egUyFdNybmKZxQvBBwB0M/48LgGQ== +"@jest/fake-timers@^28.0.2": + version "28.0.2" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-28.0.2.tgz#d36e62bc58f39d65ea6adac1ff7749e63aff05f3" + integrity sha512-R75yUv+WeybPa4ZVhX9C+8XN0TKjUoceUX+/QEaDVQGxZZOK50eD74cs7iMDTtpodh00d8iLlc9197vgF6oZjA== dependencies: - "@jest/types" "^28.0.1" + "@jest/types" "^28.0.2" "@sinonjs/fake-timers" "^9.1.1" "@types/node" "*" - jest-message-util "^28.0.1" - jest-mock "^28.0.1" - jest-util "^28.0.1" + jest-message-util "^28.0.2" + jest-mock "^28.0.2" + jest-util "^28.0.2" -"@jest/globals@^28.0.1": - version "28.0.1" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-28.0.1.tgz#165eced7e768c595c2eba5ae8e6d9784224328e9" - integrity sha512-KBWuQ1PQjm8IKUObSSQAGlGguJZHKaVCHWY99FSGwjyf58hT9yCYH2wFfLhWocy4Y5otK2gZbsCwWVX6WXft2Q== +"@jest/globals@^28.0.2": + version "28.0.2" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-28.0.2.tgz#999164fb1b09f2cb5ba47c890d185722876b2ec1" + integrity sha512-gkOd1rTTLoZGM2OqOtf5wyzf8HNoM2a+dGbyWgqO3spQiA/OBE+d1kQlZ6mYs9NtJwJ1/TNAJNyBaPXIeo7xEw== dependencies: - "@jest/environment" "^28.0.1" - "@jest/expect" "^28.0.1" - "@jest/types" "^28.0.1" + "@jest/environment" "^28.0.2" + "@jest/expect" "^28.0.2" + "@jest/types" "^28.0.2" -"@jest/reporters@^28.0.1": - version "28.0.1" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-28.0.1.tgz#711145ea5e6c29c9f8050cb65d3ef98fe68a8290" - integrity sha512-XMjv+E0fi2QA1qbV1q/NiODueljjfM9i2SpOFqGLc8pHeAcfYfFAZIWI6DXe+2dL4RylDiAlV6Ll5KU4GyUuvA== +"@jest/reporters@^28.0.2": + version "28.0.2" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-28.0.2.tgz#ce8efb1499f9b9f57d285289125dd7cb93130b20" + integrity sha512-YOxPWwVwgY2u6h6XOnOILZVZFUthIr86ttvXrdRg8VC/8fg2Vwk4d/fxY6uLDCFE/3CFthXTsVB05kmBjckCsw== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^28.0.1" - "@jest/test-result" "^28.0.1" - "@jest/transform" "^28.0.1" - "@jest/types" "^28.0.1" + "@jest/console" "^28.0.2" + "@jest/test-result" "^28.0.2" + "@jest/transform" "^28.0.2" + "@jest/types" "^28.0.2" "@jridgewell/trace-mapping" "^0.3.7" "@types/node" "*" chalk "^4.0.0" @@ -521,76 +521,76 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-util "^28.0.1" - jest-worker "^28.0.1" + jest-util "^28.0.2" + jest-worker "^28.0.2" slash "^3.0.0" string-length "^4.0.1" terminal-link "^2.0.0" v8-to-istanbul "^9.0.0" -"@jest/schemas@^28.0.0": - version "28.0.0" - resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-28.0.0.tgz#55cf5fcc82440a2a39b717bb949570c501fd5410" - integrity sha512-Pap9Jvwr8KYFvDgkya/p0FCVya+jZkWt57lHpwBylfjgmwi/gtXfhyAO/Cw+jKuMafHcXY0beNf2XV2pkcu9vA== +"@jest/schemas@^28.0.2": + version "28.0.2" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-28.0.2.tgz#08c30df6a8d07eafea0aef9fb222c5e26d72e613" + integrity sha512-YVDJZjd4izeTDkij00vHHAymNXQ6WWsdChFRK86qck6Jpr3DCL5W3Is3vslviRlP+bLuMYRLbdp98amMvqudhA== dependencies: "@sinclair/typebox" "^0.23.3" -"@jest/source-map@^28.0.0": - version "28.0.0" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-28.0.0.tgz#d026fc1cd7e95fd7ce788d0b27838d9796da0a74" - integrity sha512-yeD/Y94j6UJPiaZTG5Sdww7pbHvEc7RlTucoVAdXaBaSuNcyrAkLlJonAb/xX/efCugDOEbFJdATsSnDEh45Nw== +"@jest/source-map@^28.0.2": + version "28.0.2" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-28.0.2.tgz#914546f4410b67b1d42c262a1da7e0406b52dc90" + integrity sha512-Y9dxC8ZpN3kImkk0LkK5XCEneYMAXlZ8m5bflmSL5vrwyeUpJfentacCUg6fOb8NOpOO7hz2+l37MV77T6BFPw== dependencies: "@jridgewell/trace-mapping" "^0.3.7" callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^28.0.1": - version "28.0.1" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-28.0.1.tgz#4c0eb5d7c3947c70f7ae1a119a9bc049b8465fbf" - integrity sha512-8LhoEbdIkkYK+PZx6JhfRvI1Jw7tfB77OEJUQwp0diBvXJpjPKeFFWfsbpm7djdXuKoKvXKNzSGgjXDOFbxuhg== +"@jest/test-result@^28.0.2": + version "28.0.2" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-28.0.2.tgz#bc8e15a95347e3c2149572ae06a5a6fed939c522" + integrity sha512-4EUqgjq9VzyUiVTvZfI9IRJD6t3NYBNP4f+Eq8Zr93+hkJ0RrGU4OBTw8tfNzidKX+bmuYzn8FxqpxOPIGGCMA== dependencies: - "@jest/console" "^28.0.1" - "@jest/types" "^28.0.1" + "@jest/console" "^28.0.2" + "@jest/types" "^28.0.2" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^28.0.1": - version "28.0.1" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-28.0.1.tgz#7260db16c12f055f80809348740c2fd2d903f6e0" - integrity sha512-PbXoEP9aovOC+KunEy65vuSAB/ZMLNcBVdMUIH2hsfFDWhQx/8OnHsz3dr3g1U6qNuCpXzD1fyM8/1TrUU0uFw== +"@jest/test-sequencer@^28.0.2": + version "28.0.2" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-28.0.2.tgz#7669b7d8ff2aa7a8221b11bb37cce552de81b1bb" + integrity sha512-zhnZ8ydkZQTPL7YucB86eOlD79zPy5EGSUKiR2Iv93RVEDU6OEP33kwDBg70ywOcxeJGDRhyo09q7TafNCBiIg== dependencies: - "@jest/test-result" "^28.0.1" + "@jest/test-result" "^28.0.2" graceful-fs "^4.2.9" - jest-haste-map "^28.0.1" + jest-haste-map "^28.0.2" slash "^3.0.0" -"@jest/transform@^28.0.1": - version "28.0.1" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-28.0.1.tgz#44fced5a366af7cc5f69745c92014bf45c408d90" - integrity sha512-45fxjycts6CTPMeusSICYhMkMgFAs1opvgEBYcMmukucJw/AgVEMsGFqheWyDzlU6GJ+h9cpft/zkTGPJtzRGQ== +"@jest/transform@^28.0.2": + version "28.0.2" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-28.0.2.tgz#2b33d93fdf5827309cbd332bf968fa0dd049e7b2" + integrity sha512-PgvB/DEwVY+vJAGTRSFhdmorytx54aXKK1+VQIxVtdFVAe0mJ2fUIRWQuGimveEJWT4ELJImZAIYOgs8z2L0eg== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^28.0.1" + "@jest/types" "^28.0.2" "@jridgewell/trace-mapping" "^0.3.7" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.9" - jest-haste-map "^28.0.1" - jest-regex-util "^28.0.0" - jest-util "^28.0.1" + jest-haste-map "^28.0.2" + jest-regex-util "^28.0.2" + jest-util "^28.0.2" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" write-file-atomic "^4.0.1" -"@jest/types@^28.0.1": - version "28.0.1" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-28.0.1.tgz#4bf819b570efd6fc89d8fa45a7b2c13db58800c3" - integrity sha512-Z48DBfQDtTZZAImaa1m8O1SCP9gx355FhuA6xuS8e7V5gQbj4l2hk/+EELN4UU/O9i5gjQuc94N/gC61/Qxfxw== +"@jest/types@^28.0.2": + version "28.0.2" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-28.0.2.tgz#70b9538c1863fb060b2f438ca008b5563d00c5b4" + integrity sha512-hi3jUdm9iht7I2yrV5C4s3ucCJHUP8Eh3W6rQ1s4n/Qw9rQgsda4eqCt+r3BKRi7klVmZfQlMx1nGlzNMP2d8A== dependencies: - "@jest/schemas" "^28.0.0" + "@jest/schemas" "^28.0.2" "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" "@types/node" "*" @@ -819,15 +819,15 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^28.0.1: - version "28.0.1" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-28.0.1.tgz#effa686f25551d930bf3b645d7513091094f8968" - integrity sha512-UbL+4xVftxnIcPKzCqmwZHwaPG8DyKOCXoWPeuKrvUFtyeUpePy6VtRiMN1Dv001NbEMNP4FVjfKwv1xe2PWZQ== +babel-jest@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-28.0.2.tgz#72c050b4fbd108e561f9d9c7bad4893b20399b12" + integrity sha512-OlbfoOpHmU3jzAWoiT98bBuAhjrSZMxSVk5ALkCL/8ocb8dyx8F4H9NlBjH2xd08MI5306Yxa0+y87cjY55Eqw== dependencies: - "@jest/transform" "^28.0.1" + "@jest/transform" "^28.0.2" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^28.0.0" + babel-preset-jest "^28.0.2" chalk "^4.0.0" graceful-fs "^4.2.9" slash "^3.0.0" @@ -843,10 +843,10 @@ babel-plugin-istanbul@^6.1.1: istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^28.0.0: - version "28.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-28.0.0.tgz#7429bb64b97170822dce58ee763555ebc983cbdc" - integrity sha512-Eu+TDlmKd2SsnvmlooVeHFryVHHom6ffCLSZuqrN8WpIHE0H6qiIPW5h5rFlzIZQmVqnZR2qHnbm2eQWIP7hZg== +babel-plugin-jest-hoist@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-28.0.2.tgz#9307d03a633be6fc4b1a6bc5c3a87e22bd01dd3b" + integrity sha512-Kizhn/ZL+68ZQHxSnHyuvJv8IchXD62KQxV77TBDV/xoBFBOfgRAk97GNs6hXdTTCiVES9nB2I6+7MXXrk5llQ== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -871,12 +871,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^28.0.0: - version "28.0.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-28.0.0.tgz#9e7c5f4097b63a3e9edb8f59b8030eca6901771c" - integrity sha512-JLyjfCmqCWS3tXUw86ei5fQwuwn34slNBPTluNbhoqHVI1Cbw6MsmvgEl54jPjbyzkmA6XAHJTg3EGNY7rnr4A== +babel-preset-jest@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-28.0.2.tgz#d8210fe4e46c1017e9fa13d7794b166e93aa9f89" + integrity sha512-sYzXIdgIXXroJTFeB3S6sNDWtlJ2dllCdTEsnZ65ACrMojj3hVNFRmnJ1HZtomGi+Be7aqpY/HJ92fr8OhKVkQ== dependencies: - babel-plugin-jest-hoist "^28.0.0" + babel-plugin-jest-hoist "^28.0.2" babel-preset-current-node-syntax "^1.0.0" balanced-match@^1.0.0: @@ -1073,10 +1073,10 @@ detect-newline@^3.0.0: resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== -diff-sequences@^28.0.0: - version "28.0.0" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-28.0.0.tgz#06d253f0005463bf203d96fdbd6296c5f1d1888c" - integrity sha512-GTIQPn2pPa1DMoEH70P9yQgYLcGW8bjPR5EOL2JO9/7DQHX+9tTFJee3UmlGWuyUvIqMgpXXssrckLubiEUZTg== +diff-sequences@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-28.0.2.tgz#40f8d4ffa081acbd8902ba35c798458d0ff1af41" + integrity sha512-YtEoNynLDFCRznv/XDalsKGSZDoj0U5kLnXvY0JSq3nBboRrZXjD81+eSiwi+nzcZDwedMmcowcxNwwgFW23mQ== doctrine@^3.0.0: version "3.0.0" @@ -1278,16 +1278,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^28.0.1: - version "28.0.1" - resolved "https://registry.yarnpkg.com/expect/-/expect-28.0.1.tgz#7bfac95d375d4310d5061f7e9b7f2afa55a1c1c0" - integrity sha512-sJjuHVbveEUczNITHKgHUepbEyj+UzjACMNuEln5tZI6b9L/y8jTXAN8VnOCnMoK7vuQPSttO/5HlKB+G3Enpw== +expect@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/expect/-/expect-28.0.2.tgz#86f0d6fa971bc533faf68d4d103d00f343d6a4b3" + integrity sha512-X0qIuI/zKv98k34tM+uGeOgAC73lhs4vROF9MkPk94C1zujtwv4Cla8SxhWn0G1OwvG9gLLL7RjFBkwGVaZ83w== dependencies: - "@jest/expect-utils" "^28.0.1" - jest-get-type "^28.0.0" - jest-matcher-utils "^28.0.1" - jest-message-util "^28.0.1" - jest-util "^28.0.1" + "@jest/expect-utils" "^28.0.2" + jest-get-type "^28.0.2" + jest-matcher-utils "^28.0.2" + jest-message-util "^28.0.2" + jest-util "^28.0.2" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1596,188 +1596,188 @@ istanbul-reports@^3.1.3: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^28.0.0: - version "28.0.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-28.0.0.tgz#f06ad666ef6ec766a77e13cb3f55bd5c0dec0461" - integrity sha512-9hFz/LuADUTv7zN+t0Ig+J/as2mtILTmgoT2XQdG/ezGbA1tfqoSwEKCXFcDaldzkskZddbh+QI2sACQGaxg6Q== +jest-changed-files@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-28.0.2.tgz#7d7810660a5bd043af9e9cfbe4d58adb05e91531" + integrity sha512-QX9u+5I2s54ZnGoMEjiM2WeBvJR2J7w/8ZUmH2um/WLAuGAYFQcsVXY9+1YL6k0H/AGUdH8pXUAv6erDqEsvIA== dependencies: execa "^5.0.0" throat "^6.0.1" -jest-circus@^28.0.1: - version "28.0.1" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-28.0.1.tgz#5bad5888e4965735e765188fc21e6c73ffe8d984" - integrity sha512-33Ulac556FQcgQkDEXVVDag4PGQd+lWP9bxsuVg4q+b4x1cMiWNMCUjN5Dv1q/n90PvGzWxqXuN5X3gF93msew== +jest-circus@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-28.0.2.tgz#deb0a06491ae2d61ff67e28985b6ce3729db4a93" + integrity sha512-5U0K43UZSwu9xBo3RmK366Y8i0YMTGe2hgFm7TYka6ecT5lB0VZ+/TQTTsDVxa9q1TuOWRa7EskSMm1Q74Hy/Q== dependencies: - "@jest/environment" "^28.0.1" - "@jest/expect" "^28.0.1" - "@jest/test-result" "^28.0.1" - "@jest/types" "^28.0.1" + "@jest/environment" "^28.0.2" + "@jest/expect" "^28.0.2" + "@jest/test-result" "^28.0.2" + "@jest/types" "^28.0.2" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" is-generator-fn "^2.0.0" - jest-each "^28.0.1" - jest-matcher-utils "^28.0.1" - jest-message-util "^28.0.1" - jest-runtime "^28.0.1" - jest-snapshot "^28.0.1" - jest-util "^28.0.1" - pretty-format "^28.0.1" + jest-each "^28.0.2" + jest-matcher-utils "^28.0.2" + jest-message-util "^28.0.2" + jest-runtime "^28.0.2" + jest-snapshot "^28.0.2" + jest-util "^28.0.2" + pretty-format "^28.0.2" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^28.0.1: - version "28.0.1" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-28.0.1.tgz#0d1b90e6726dab104cb5f5e7e8fcdef20ba75644" - integrity sha512-N6m5FwG0E0sFuhT6eRhskvfPrm+e5UXoErdR1cw2csIlpZpzvnl+bP60JH/UAG9KW1wYNDo2N3tVYn/zoMbhOA== +jest-cli@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-28.0.2.tgz#1db7587960adecb130fa830a7547e1aef861d9f6" + integrity sha512-X6KSoKiSDZ07lds9awDMd14VUmtLS0sxgbUzZi1m6JewWdwXtuadTBff1kAUcAmKgJTYBPnVN0u2BKp7AIzllA== dependencies: - "@jest/core" "^28.0.1" - "@jest/test-result" "^28.0.1" - "@jest/types" "^28.0.1" + "@jest/core" "^28.0.2" + "@jest/test-result" "^28.0.2" + "@jest/types" "^28.0.2" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^28.0.1" - jest-util "^28.0.1" - jest-validate "^28.0.1" + jest-config "^28.0.2" + jest-util "^28.0.2" + jest-validate "^28.0.2" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^28.0.1: - version "28.0.1" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-28.0.1.tgz#69bc6304edd7f44746d59393acb9ce6e55c00ef4" - integrity sha512-Zp7hsNMxhBrMYx9R+OXWXElX4TDRotgilwGwkRT7YZ4wE8d0w5LKS0mKrd9sExoIWc+cFii/WAeDXlt8/AtfCA== +jest-config@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-28.0.2.tgz#43053a24ae6efd4da25bbe473d4bc98da008ac18" + integrity sha512-4E5r24Dw1DsyF4ObkwiDEqXIwrX7p01mnngWKtB/0Jdb0SpR1UGAm8Bjg6GTozCA4SlSj/Bbq7LTkg0WrzLanQ== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^28.0.1" - "@jest/types" "^28.0.1" - babel-jest "^28.0.1" + "@jest/test-sequencer" "^28.0.2" + "@jest/types" "^28.0.2" + babel-jest "^28.0.2" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^28.0.1" - jest-environment-node "^28.0.1" - jest-get-type "^28.0.0" - jest-regex-util "^28.0.0" - jest-resolve "^28.0.1" - jest-runner "^28.0.1" - jest-util "^28.0.1" - jest-validate "^28.0.1" + jest-circus "^28.0.2" + jest-environment-node "^28.0.2" + jest-get-type "^28.0.2" + jest-regex-util "^28.0.2" + jest-resolve "^28.0.2" + jest-runner "^28.0.2" + jest-util "^28.0.2" + jest-validate "^28.0.2" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^28.0.1" + pretty-format "^28.0.2" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^28.0.1: - version "28.0.1" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-28.0.1.tgz#fe29002a53c0a663c6cb395cad91ea0b82b0c826" - integrity sha512-XtUUND9AlP6y+O5gnxm54rcFxs65isB1NahScgBU+NqiUYdKK9qXMXAotkTJHui6GUdjApXq0zvSXB6zQh9CNg== +jest-diff@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-28.0.2.tgz#a543c90082560cd6cb14c5f28c39e6d4618ad7a6" + integrity sha512-33Rnf821Y54OAloav0PGNWHlbtEorXpjwchnToyyWbec10X74FOW7hGfvrXLGz7xOe2dz0uo9JVFAHHj/2B5pg== dependencies: chalk "^4.0.0" - diff-sequences "^28.0.0" - jest-get-type "^28.0.0" - pretty-format "^28.0.1" + diff-sequences "^28.0.2" + jest-get-type "^28.0.2" + pretty-format "^28.0.2" -jest-docblock@^28.0.0: - version "28.0.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-28.0.0.tgz#7f39dc998da47dac243157fbe7fbc1e993ab0eb8" - integrity sha512-88od+z1QkHyvtpj1gRA6QGysopOzImocHNNlvvM7OydDe9ER6z1siLtHJXbKEfi5FoxMpYqDtszYIS50JVs0WA== +jest-docblock@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-28.0.2.tgz#3cab8abea53275c9d670cdca814fc89fba1298c2" + integrity sha512-FH10WWw5NxLoeSdQlJwu+MTiv60aXV/t8KEwIRGEv74WARE1cXIqh1vGdy2CraHuWOOrnzTWj/azQKqW4fO7xg== dependencies: detect-newline "^3.0.0" -jest-each@^28.0.1: - version "28.0.1" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-28.0.1.tgz#bd8d78f066df0366cfd351a5f9ba5acfa119ef89" - integrity sha512-C7ftacESgAPcs2CydQYJKBFi0T0jkuxZWds2f901coi0SJ4M9ONhFHR2WmfJpHiPWGhAl3N9E8qn8QCZhCk9fA== +jest-each@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-28.0.2.tgz#fcf6843e9afe5a3f2d0b1c02aab1f41889d92f1d" + integrity sha512-/W5Wc0b+ipR36kDaLngdVEJ/5UYPOITK7rW0djTlCCQdMuWpCFJweMW4TzAoJ6GiRrljPL8FwiyOSoSHKrda2w== dependencies: - "@jest/types" "^28.0.1" + "@jest/types" "^28.0.2" chalk "^4.0.0" - jest-get-type "^28.0.0" - jest-util "^28.0.1" - pretty-format "^28.0.1" - -jest-environment-node@^28.0.1: - version "28.0.1" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-28.0.1.tgz#d2eacc122481438102a324b3f83216b873773a18" - integrity sha512-oGlrqMpLyHgpUThI/8hdDQfcWXKtXuWcFVTKYAeVWvD14btGUn90RlIeCqTbGv197t7NwV51PHDZBFbp1RWceQ== - dependencies: - "@jest/environment" "^28.0.1" - "@jest/fake-timers" "^28.0.1" - "@jest/types" "^28.0.1" + jest-get-type "^28.0.2" + jest-util "^28.0.2" + pretty-format "^28.0.2" + +jest-environment-node@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-28.0.2.tgz#bd58e192b8f36a37e52c52fac812bd24b360c0b9" + integrity sha512-o9u5UHZ+NCuIoa44KEF0Behhsz/p1wMm0WumsZfWR1k4IVoWSt3aN0BavSC5dd26VxSGQvkrCnJxxOzhhUEG3Q== + dependencies: + "@jest/environment" "^28.0.2" + "@jest/fake-timers" "^28.0.2" + "@jest/types" "^28.0.2" "@types/node" "*" - jest-mock "^28.0.1" - jest-util "^28.0.1" + jest-mock "^28.0.2" + jest-util "^28.0.2" -jest-get-type@^28.0.0: - version "28.0.0" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-28.0.0.tgz#8d36b49c151bc3a9e078a2e92d502e778ed49164" - integrity sha512-754LtawzW+Qk4o5rC+eDqfcQ9dV8z9uvbaVenmK8pju11PBGfuMDvQwRxoPews0LCaumNmYHjcAwmkYINTlhIA== +jest-get-type@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-28.0.2.tgz#34622e628e4fdcd793d46db8a242227901fcf203" + integrity sha512-ioj2w9/DxSYHfOm5lJKCdcAmPJzQXmbM/Url3rhlghrPvT3tt+7a/+oXc9azkKmLvoiXjtV83bEWqi+vs5nlPA== -jest-haste-map@^28.0.1: - version "28.0.1" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-28.0.1.tgz#48fa7e2c9f205118a713b04bd80c07de2795d281" - integrity sha512-qjpK9NDBiwlSHbKS0rDUDOTTDSHT4tNnJbUewfMsSiWFAOAqgcBDG3o5f1N9Srx5Hz14QsdnDuK9oy6oyQqJ9g== +jest-haste-map@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-28.0.2.tgz#0c768f43680013cfd2a4471a3ec76c47bfb9e7c6" + integrity sha512-EokdL7l5uk4TqWGawwrIt8w3tZNcbeiRxmKGEURf42pl+/rWJy3sCJlon5HBhJXZTW978jk6600BLQOI7i25Ig== dependencies: - "@jest/types" "^28.0.1" + "@jest/types" "^28.0.2" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" - jest-regex-util "^28.0.0" - jest-util "^28.0.1" - jest-worker "^28.0.1" + jest-regex-util "^28.0.2" + jest-util "^28.0.2" + jest-worker "^28.0.2" micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^28.0.1: - version "28.0.1" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-28.0.1.tgz#26e4737145ee6b2aef871eda2f9606bd63fb33ca" - integrity sha512-g+0cRjOeNy0Wy/9LfgzyyVjKNnkFddEXisac+5arM3JwdW4hjZJR+5lwiIuMxuPtacldLWhu0pN63KV+Z33smQ== +jest-leak-detector@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-28.0.2.tgz#cbde3d22d09bd690ececdc2ed01c608435328456" + integrity sha512-UGaSPYtxKXl/YKacq6juRAKmMp1z2os8NaU8PSC+xvNikmu3wF6QFrXrihMM4hXeMr9HuNotBrQZHmzDY8KIBQ== dependencies: - jest-get-type "^28.0.0" - pretty-format "^28.0.1" + jest-get-type "^28.0.2" + pretty-format "^28.0.2" -jest-matcher-utils@^28.0.1: - version "28.0.1" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-28.0.1.tgz#9a19300603dac3fbeadc95a6e7f6285466735e22" - integrity sha512-AE1oD7mFC/rcdKYa3Nebd+zo9HOUq+x5l3ol9EHgVanxffPcDxuQELvDGDUG6jq4w/x8IDmvPHjZ42ZD5iGwCg== +jest-matcher-utils@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-28.0.2.tgz#eb461af204b6d0f05281e9228094f0ab7e9e8537" + integrity sha512-SxtTiI2qLJHFtOz/bySStCnwCvISAuxQ/grS+74dfTy5AuJw3Sgj9TVUvskcnImTfpzLoMCDJseRaeRrVYbAOA== dependencies: chalk "^4.0.0" - jest-diff "^28.0.1" - jest-get-type "^28.0.0" - pretty-format "^28.0.1" + jest-diff "^28.0.2" + jest-get-type "^28.0.2" + pretty-format "^28.0.2" -jest-message-util@^28.0.1: - version "28.0.1" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-28.0.1.tgz#2ee286d662363cdcf466b5c6a94615380c9dcb2d" - integrity sha512-Eb+s5Ow4MxcQb4gcIVWVdnLxCnaPrl6DZjOVe7MjKHhexmJlkVTdwvdC//YrAsJKWMU8eG2rdaGbgBk2zG2MLA== +jest-message-util@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-28.0.2.tgz#f3cf36be72be4c4c4058cb34bd6673996d26dee3" + integrity sha512-knK7XyojvwYh1XiF2wmVdskgM/uN11KsjcEWWHfnMZNEdwXCrqB4sCBO94F4cfiAwCS8WFV6CDixDwPlMh/wdA== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^28.0.1" + "@jest/types" "^28.0.2" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^28.0.1" + pretty-format "^28.0.2" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^28.0.1: - version "28.0.1" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-28.0.1.tgz#74d1e303e0825a83c54dceaf0f5095100667eeaa" - integrity sha512-pEi1eywUvu7Ko8T5QX6l4X4694cd9NqzyeFFnH7QYDEm4INKxNbgBKLnaNmp025SlH9WHHDkHTeY4zRHPicMHw== +jest-mock@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-28.0.2.tgz#059b500b34c1dd76474ebcdeccc249fe4dd0249f" + integrity sha512-vfnJ4zXRB0i24jOTGtQJyl26JKsgBKtqRlCnsrORZbG06FToSSn33h2x/bmE8XxqxkLWdZBRo+/65l8Vi3nD+g== dependencies: - "@jest/types" "^28.0.1" + "@jest/types" "^28.0.2" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -1785,173 +1785,173 @@ jest-pnp-resolver@^1.2.2: resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== -jest-regex-util@^28.0.0: - version "28.0.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-28.0.0.tgz#b8d0bf9761328ae21900ab3f3b0ce8c4d392a73a" - integrity sha512-VqrjkteNiucN3ctI/AtBzO7iitfk5YGArPwU2cJ3WyT5Z6kGFHw/HQp0fSTkOUHdwVdJkFzbI5nh0yC82f9Kfg== +jest-regex-util@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-28.0.2.tgz#afdc377a3b25fb6e80825adcf76c854e5bf47ead" + integrity sha512-4s0IgyNIy0y9FK+cjoVYoxamT7Zeo7MhzqRGx7YDYmaQn1wucY9rotiGkBzzcMXTtjrCAP/f7f+E0F7+fxPNdw== -jest-resolve-dependencies@^28.0.1: - version "28.0.1" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-28.0.1.tgz#4448647423f16d7e27438d0704b091858741838e" - integrity sha512-ypEOCjf1OoDOmfotDWeMuMxOgT1WipFmFfS2pHnM4WMNaHBPpQtTRYSRyJN3tqSt4g1+1iP4Ldx2UgLyr3qZWQ== +jest-resolve-dependencies@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-28.0.2.tgz#44e1a65ccaaf3b73d4fa8e9add4eeff5b752e1cb" + integrity sha512-Xgkc51baZJQ9UcZg8UN9rGtnvqoVHeDNP6iM4QV3W/phzbFyRCiAxqgJ2GyuBnzGm2EirUlIcstlvOR/6trHmw== dependencies: - jest-regex-util "^28.0.0" - jest-snapshot "^28.0.1" + jest-regex-util "^28.0.2" + jest-snapshot "^28.0.2" -jest-resolve@^28.0.1: - version "28.0.1" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-28.0.1.tgz#8d51581b52028df3d10746605e13b4a46ba7a37d" - integrity sha512-nQahkVO8flCRsXtlq3JZb+pElJ+9s2L9TQ0xs6x1DLXgZ3FvB3XRfQGnsqtxyMKEAbbEfypGQv1rUVpIrWfssg== +jest-resolve@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-28.0.2.tgz#46faf8f418fbb7dd37ae958c7393c8bcaf331f8d" + integrity sha512-4smZQ+Z4bzRNAXmj2HSrDYOAVar/SBDClUWxDJrz3BHbw+URXGAPenziWIShmybBlcRnX0lVCs43UiB7+Fh+lg== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^28.0.1" + jest-haste-map "^28.0.2" jest-pnp-resolver "^1.2.2" - jest-util "^28.0.1" - jest-validate "^28.0.1" + jest-util "^28.0.2" + jest-validate "^28.0.2" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^28.0.1: - version "28.0.1" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-28.0.1.tgz#006e2b483e67a7bbba46d82bdcb1e84d9d9ec6b4" - integrity sha512-aVRI4Ngaa9hxDg60tAm4ebqJcaI2vUyR04TuNSArI6MZh8Rfio4mP0tjqVI28TzK8RKH3JMg3ARf66nlAwOl7g== +jest-runner@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-28.0.2.tgz#48b0bdf2a5c286e591d41e4e304856362eaf18de" + integrity sha512-biaiCtgNAeTl1GrHezlWLbTStoi/aP4X2FOZaAhdbHUAflUg4bal6q3Ck8VNhTGzkXVeFtVVZFHE5PHlyUAJBw== dependencies: - "@jest/console" "^28.0.1" - "@jest/environment" "^28.0.1" - "@jest/test-result" "^28.0.1" - "@jest/transform" "^28.0.1" - "@jest/types" "^28.0.1" + "@jest/console" "^28.0.2" + "@jest/environment" "^28.0.2" + "@jest/test-result" "^28.0.2" + "@jest/transform" "^28.0.2" + "@jest/types" "^28.0.2" "@types/node" "*" chalk "^4.0.0" emittery "^0.10.2" graceful-fs "^4.2.9" - jest-docblock "^28.0.0" - jest-environment-node "^28.0.1" - jest-haste-map "^28.0.1" - jest-leak-detector "^28.0.1" - jest-message-util "^28.0.1" - jest-resolve "^28.0.1" - jest-runtime "^28.0.1" - jest-util "^28.0.1" - jest-watcher "^28.0.1" - jest-worker "^28.0.1" + jest-docblock "^28.0.2" + jest-environment-node "^28.0.2" + jest-haste-map "^28.0.2" + jest-leak-detector "^28.0.2" + jest-message-util "^28.0.2" + jest-resolve "^28.0.2" + jest-runtime "^28.0.2" + jest-util "^28.0.2" + jest-watcher "^28.0.2" + jest-worker "^28.0.2" source-map-support "0.5.13" throat "^6.0.1" -jest-runtime@^28.0.1: - version "28.0.1" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-28.0.1.tgz#2b33b86c26a14bcba9d3be0ded50010e559ba2be" - integrity sha512-bC22PNBaMK/tX6rMIUf7Usn9V1DallrRyA5QzTqRjz0E2E1UZMUZzKWzhbV6opCI1QSgr5srn0qNUl0MpgWm1g== - dependencies: - "@jest/environment" "^28.0.1" - "@jest/fake-timers" "^28.0.1" - "@jest/globals" "^28.0.1" - "@jest/source-map" "^28.0.0" - "@jest/test-result" "^28.0.1" - "@jest/transform" "^28.0.1" - "@jest/types" "^28.0.1" +jest-runtime@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-28.0.2.tgz#3e11c9b66891ea959a455dce0e62509bfa5a73f1" + integrity sha512-fUoJ/GVrCj7pdYYXfET8bBudDmefmnscd/0jBkBAgHTs3qu+rGXUAV3QN/ECNhWhhEXoJ5a2PnSFTJ8RmXM6xQ== + dependencies: + "@jest/environment" "^28.0.2" + "@jest/fake-timers" "^28.0.2" + "@jest/globals" "^28.0.2" + "@jest/source-map" "^28.0.2" + "@jest/test-result" "^28.0.2" + "@jest/transform" "^28.0.2" + "@jest/types" "^28.0.2" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" execa "^5.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^28.0.1" - jest-message-util "^28.0.1" - jest-mock "^28.0.1" - jest-regex-util "^28.0.0" - jest-resolve "^28.0.1" - jest-snapshot "^28.0.1" - jest-util "^28.0.1" + jest-haste-map "^28.0.2" + jest-message-util "^28.0.2" + jest-mock "^28.0.2" + jest-regex-util "^28.0.2" + jest-resolve "^28.0.2" + jest-snapshot "^28.0.2" + jest-util "^28.0.2" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^28.0.1: - version "28.0.1" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-28.0.1.tgz#864d5445323c3a8c4124941394825c7f3b1874b0" - integrity sha512-xaNY3ZZtOBYIpYSAqLpClZJs66wWVpKgsQiFvu8xxjjQBRmwYwu2CAmdaiL5wmd9KxrGX+viLm2vI964hIiIcw== +jest-snapshot@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-28.0.2.tgz#d20f38d47e4f7e0cab752c21f99fcdc7e127c350" + integrity sha512-Y+2red99KRYY5vxA3HIE1p7p2MxPZz5uwamly18DII/9m/D2QQKcYqETS+/DjDthOxpnJWFqqku7MDzdpnHkHg== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^28.0.1" - "@jest/transform" "^28.0.1" - "@jest/types" "^28.0.1" + "@jest/expect-utils" "^28.0.2" + "@jest/transform" "^28.0.2" + "@jest/types" "^28.0.2" "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^28.0.1" + expect "^28.0.2" graceful-fs "^4.2.9" - jest-diff "^28.0.1" - jest-get-type "^28.0.0" - jest-haste-map "^28.0.1" - jest-matcher-utils "^28.0.1" - jest-message-util "^28.0.1" - jest-util "^28.0.1" + jest-diff "^28.0.2" + jest-get-type "^28.0.2" + jest-haste-map "^28.0.2" + jest-matcher-utils "^28.0.2" + jest-message-util "^28.0.2" + jest-util "^28.0.2" natural-compare "^1.4.0" - pretty-format "^28.0.1" + pretty-format "^28.0.2" semver "^7.3.5" -jest-util@^28.0.1: - version "28.0.1" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-28.0.1.tgz#af1da8ea0f8035a489ddd68b547ae3ed428426fa" - integrity sha512-gFpqWx9XqBmJRYqSnQ2FbpxWpvAU3TIGFQcfBrwnMVvwbB1ZHhhoQgS+oD0Ek61l9XkLsoWW20woaNlCRf4eMA== +jest-util@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-28.0.2.tgz#8e22cdd6e0549e0a393055f0e2da7eacc334b143" + integrity sha512-EVdpIRCC8lzqhp9A0u0aAKlsFIzufK6xKxNK7awsnebTdOP4hpyQW5o6Ox2qPl8gbeUKYF+POLyItaND53kpGA== dependencies: - "@jest/types" "^28.0.1" + "@jest/types" "^28.0.2" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^28.0.1: - version "28.0.1" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-28.0.1.tgz#7f360030a2c8eeb91b62de92ab00829119a0ad73" - integrity sha512-1mWGDluyjCSGc5u/gw0JKo6SlVfALiho5bLTfqmStOsdy3k69k7/dp18dq49WctHwQ9C+i4SkqpbQG7l63nxiw== +jest-validate@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-28.0.2.tgz#58bb7e826c054a8bb3b54c05f73758d96cf6dbef" + integrity sha512-nr0UOvCTtxP0YPdsk01Gk7e7c0xIiEe2nncAe3pj0wBfUvAykTVrMrdeASlAJnlEQCBuwN/GF4hKoCzbkGNCNw== dependencies: - "@jest/types" "^28.0.1" + "@jest/types" "^28.0.2" camelcase "^6.2.0" chalk "^4.0.0" - jest-get-type "^28.0.0" + jest-get-type "^28.0.2" leven "^3.1.0" - pretty-format "^28.0.1" + pretty-format "^28.0.2" -jest-watcher@^28.0.1: - version "28.0.1" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-28.0.1.tgz#1460553913120ddfe3045fda7e80144819cc576e" - integrity sha512-tKyjsQal10vBomcyn79ZTutv0N0/dSfYJ+WRFJ3nlaMejiDlLKjMGQ/QrcwcXIXMXQyt0tJG1ycmqLbJg5AK6A== +jest-watcher@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-28.0.2.tgz#649fa24df531d4071be5784b6274d494d788c88b" + integrity sha512-uIVJLpQ/5VTGQWBiBatHsi7jrCqHjHl0e0dFHMWzwuIfUbdW/muk0DtSr0fteY2T7QTFylv+7a5Rm8sBKrE12Q== dependencies: - "@jest/test-result" "^28.0.1" - "@jest/types" "^28.0.1" + "@jest/test-result" "^28.0.2" + "@jest/types" "^28.0.2" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.10.2" - jest-util "^28.0.1" + jest-util "^28.0.2" string-length "^4.0.1" -jest-worker@^28.0.1: - version "28.0.1" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-28.0.1.tgz#7abc005335a5937e6a4f8d24c980c7630a849012" - integrity sha512-Z3j1jfZwtt2ruKwU391a4/kKdYEId7Vy9+6Jeeq5Xl0glJDnOAvO5ixNmgMokMmbpet41jc4MpUx71ciyeTB/A== +jest-worker@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-28.0.2.tgz#75f7e5126541289ba02e9c1a67e46349ddb8141d" + integrity sha512-pijNxfjxT0tGAx+8+OzZ+eayVPCwy/rsZFhebmC0F4YnXu1EHPEPxg7utL3m5uX3EaFH1/jwDxGa1EbjJCST2g== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^28.0.1: - version "28.0.1" - resolved "https://registry.yarnpkg.com/jest/-/jest-28.0.1.tgz#064ab082ba3af4c09fc0b227c14b17858083eda7" - integrity sha512-rqP6qSiZ00LUpajUBJIBKjCSE2tOy4x0Y/HI4EJntg51tND02VEiKjKkzgebFyMsFs85H+HGxLgezwOwa1bfwA== + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest/-/jest-28.0.2.tgz#41385ca21d009708bb9fc65e08663110e08e2cc0" + integrity sha512-COUtjybolW4koQvO7kCfq5kgbeeU5WbSJfVZprz4zbS8AL32+RAZZTUjBEyRRdpsXqss/pHIvSL7/P+LyMYHXg== dependencies: - "@jest/core" "^28.0.1" + "@jest/core" "^28.0.2" import-local "^3.0.2" - jest-cli "^28.0.1" + jest-cli "^28.0.2" js-tokens@^4.0.0: version "4.0.0" @@ -2241,12 +2241,12 @@ prettier@>=2.3.0: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.2.tgz#e26d71a18a74c3d0f0597f55f01fb6c06c206032" integrity sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew== -pretty-format@^28.0.1: - version "28.0.1" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-28.0.1.tgz#ae6753bd2bf26fdd552f41194568ccbef23d22af" - integrity sha512-utVSIy0ImophYyJALfiWULOeMnfoxLZEzii/92VcSzN7OX5U1r7erAMqfDJyuv31ugw4Rp5tOYUMndsZV1w8DQ== +pretty-format@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-28.0.2.tgz#6a24d71cbb61a5e5794ba7513fe22101675481bc" + integrity sha512-UmGZ1IERwS3yY35LDMTaBUYI1w4udZDdJGGT/DqQeKG9ZLDn7/K2Jf/JtYSRiHCCKMHvUA+zsEGSmHdpaVp1yw== dependencies: - "@jest/schemas" "^28.0.0" + "@jest/schemas" "^28.0.2" ansi-regex "^5.0.1" ansi-styles "^5.0.0" react-is "^18.0.0" From 00f47efd8fdaa2e1d71d0a6dcee0c63a3139805d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 29 Apr 2022 12:01:32 +0000 Subject: [PATCH 598/785] Bump jest from 28.0.2 to 28.0.3 Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 28.0.2 to 28.0.3. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v28.0.3/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 182 +++++++++++++++++++++++++++--------------------------- 1 file changed, 91 insertions(+), 91 deletions(-) diff --git a/yarn.lock b/yarn.lock index ce351f57..493a51bd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -418,15 +418,15 @@ jest-util "^28.0.2" slash "^3.0.0" -"@jest/core@^28.0.2": - version "28.0.2" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-28.0.2.tgz#b8433545c32b5e368bfb4d46c9cd01d58c19f0ef" - integrity sha512-AK6xU9wfo9E3wA4fY8t59I2t5hnS3eCVYhD1OVZPMZyUrtIQbU1HR+h9jz3ulsEv39xSDH94QY2IJr46O637ag== +"@jest/core@^28.0.3": + version "28.0.3" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-28.0.3.tgz#2b8223914ef6ae16ff740e65235ef8ef49c46d52" + integrity sha512-cCQW06vEZ+5r50SB06pOnSWsOBs7F+lswPYnKKfBz1ncLlj1sMqmvjgam8q40KhlZ8Ut4eNAL2Hvfx4BKIO2FA== dependencies: "@jest/console" "^28.0.2" - "@jest/reporters" "^28.0.2" + "@jest/reporters" "^28.0.3" "@jest/test-result" "^28.0.2" - "@jest/transform" "^28.0.2" + "@jest/transform" "^28.0.3" "@jest/types" "^28.0.2" "@types/node" "*" ansi-escapes "^4.2.1" @@ -435,15 +435,15 @@ exit "^0.1.2" graceful-fs "^4.2.9" jest-changed-files "^28.0.2" - jest-config "^28.0.2" + jest-config "^28.0.3" jest-haste-map "^28.0.2" jest-message-util "^28.0.2" jest-regex-util "^28.0.2" - jest-resolve "^28.0.2" - jest-resolve-dependencies "^28.0.2" - jest-runner "^28.0.2" - jest-runtime "^28.0.2" - jest-snapshot "^28.0.2" + jest-resolve "^28.0.3" + jest-resolve-dependencies "^28.0.3" + jest-runner "^28.0.3" + jest-runtime "^28.0.3" + jest-snapshot "^28.0.3" jest-util "^28.0.2" jest-validate "^28.0.2" jest-watcher "^28.0.2" @@ -470,13 +470,13 @@ dependencies: jest-get-type "^28.0.2" -"@jest/expect@^28.0.2": - version "28.0.2" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-28.0.2.tgz#ca94154c63a69027da0932b712b0104618cb98b1" - integrity sha512-rxgWG/updGoQtHFw/duImu5gPN48+kHvhVjLJ0fFk2mYQ+3dp7/zLiNTjSQxc92Bq4VOk+b6ln0gSgKM4etOtQ== +"@jest/expect@^28.0.3": + version "28.0.3" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-28.0.3.tgz#80e0233bee62586e1112f904d28b904dd1143ef2" + integrity sha512-VEzZr85bqNomgayQkR7hWG5HnbZYWYWagQriZsixhLmOzU6PCpMP61aeVhkCoRrg7ri5f7JDpeTPzDAajIwFHw== dependencies: expect "^28.0.2" - jest-snapshot "^28.0.2" + jest-snapshot "^28.0.3" "@jest/fake-timers@^28.0.2": version "28.0.2" @@ -490,24 +490,24 @@ jest-mock "^28.0.2" jest-util "^28.0.2" -"@jest/globals@^28.0.2": - version "28.0.2" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-28.0.2.tgz#999164fb1b09f2cb5ba47c890d185722876b2ec1" - integrity sha512-gkOd1rTTLoZGM2OqOtf5wyzf8HNoM2a+dGbyWgqO3spQiA/OBE+d1kQlZ6mYs9NtJwJ1/TNAJNyBaPXIeo7xEw== +"@jest/globals@^28.0.3": + version "28.0.3" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-28.0.3.tgz#70f68a06c863d1c9d14aea151c69b9690e3efeb4" + integrity sha512-q/zXYI6CKtTSIt1WuTHBYizJhH7K8h+xG5PE3C0oawLlPIvUMDYmpj0JX0XsJwPRLCsz/fYXHZVG46AaEhSPmw== dependencies: "@jest/environment" "^28.0.2" - "@jest/expect" "^28.0.2" + "@jest/expect" "^28.0.3" "@jest/types" "^28.0.2" -"@jest/reporters@^28.0.2": - version "28.0.2" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-28.0.2.tgz#ce8efb1499f9b9f57d285289125dd7cb93130b20" - integrity sha512-YOxPWwVwgY2u6h6XOnOILZVZFUthIr86ttvXrdRg8VC/8fg2Vwk4d/fxY6uLDCFE/3CFthXTsVB05kmBjckCsw== +"@jest/reporters@^28.0.3": + version "28.0.3" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-28.0.3.tgz#9996189e5552e37fcdffe0f41c07754f5d2ea854" + integrity sha512-xrbIc7J/xwo+D7AY3enAR9ZWYCmJ8XIkstTukTGpKDph0gLl/TJje9jl3dssvE4KJzYqMKiSrnE5Nt68I4fTEg== dependencies: "@bcoe/v8-coverage" "^0.2.3" "@jest/console" "^28.0.2" "@jest/test-result" "^28.0.2" - "@jest/transform" "^28.0.2" + "@jest/transform" "^28.0.3" "@jest/types" "^28.0.2" "@jridgewell/trace-mapping" "^0.3.7" "@types/node" "*" @@ -564,10 +564,10 @@ jest-haste-map "^28.0.2" slash "^3.0.0" -"@jest/transform@^28.0.2": - version "28.0.2" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-28.0.2.tgz#2b33d93fdf5827309cbd332bf968fa0dd049e7b2" - integrity sha512-PgvB/DEwVY+vJAGTRSFhdmorytx54aXKK1+VQIxVtdFVAe0mJ2fUIRWQuGimveEJWT4ELJImZAIYOgs8z2L0eg== +"@jest/transform@^28.0.3": + version "28.0.3" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-28.0.3.tgz#591fb5ebc1d84db5c5f21e1225c7406c35f5eb1e" + integrity sha512-+Y0ikI7SwoW/YbK8t9oKwC70h4X2Gd0OVuz5tctRvSV/EDQU00AAkoqevXgPSSFimUmp/sp7Yl8s/1bExDqOIg== dependencies: "@babel/core" "^7.11.6" "@jest/types" "^28.0.2" @@ -819,12 +819,12 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-28.0.2.tgz#72c050b4fbd108e561f9d9c7bad4893b20399b12" - integrity sha512-OlbfoOpHmU3jzAWoiT98bBuAhjrSZMxSVk5ALkCL/8ocb8dyx8F4H9NlBjH2xd08MI5306Yxa0+y87cjY55Eqw== +babel-jest@^28.0.3: + version "28.0.3" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-28.0.3.tgz#843dc170da5b9671d4054ada9fdcd28f85f92a6e" + integrity sha512-S0ADyYdcrt5fp9YldRYWCUHdk1BKt9AkvBkLWBoNAEV9NoWZPIj5+MYhPcGgTS65mfv3a+Ymf2UqgWoAVd41cA== dependencies: - "@jest/transform" "^28.0.2" + "@jest/transform" "^28.0.3" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" babel-preset-jest "^28.0.2" @@ -1604,13 +1604,13 @@ jest-changed-files@^28.0.2: execa "^5.0.0" throat "^6.0.1" -jest-circus@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-28.0.2.tgz#deb0a06491ae2d61ff67e28985b6ce3729db4a93" - integrity sha512-5U0K43UZSwu9xBo3RmK366Y8i0YMTGe2hgFm7TYka6ecT5lB0VZ+/TQTTsDVxa9q1TuOWRa7EskSMm1Q74Hy/Q== +jest-circus@^28.0.3: + version "28.0.3" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-28.0.3.tgz#45f77090b4b9fe5c1b84f72816868c9d4c0f57b1" + integrity sha512-HJ3rUCm3A3faSy7KVH5MFCncqJLtrjEFkTPn9UIcs4Kq77+TXqHsOaI+/k73aHe6DJQigLUXq9rCYj3MYFlbIw== dependencies: "@jest/environment" "^28.0.2" - "@jest/expect" "^28.0.2" + "@jest/expect" "^28.0.3" "@jest/test-result" "^28.0.2" "@jest/types" "^28.0.2" "@types/node" "*" @@ -1621,52 +1621,52 @@ jest-circus@^28.0.2: jest-each "^28.0.2" jest-matcher-utils "^28.0.2" jest-message-util "^28.0.2" - jest-runtime "^28.0.2" - jest-snapshot "^28.0.2" + jest-runtime "^28.0.3" + jest-snapshot "^28.0.3" jest-util "^28.0.2" pretty-format "^28.0.2" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-28.0.2.tgz#1db7587960adecb130fa830a7547e1aef861d9f6" - integrity sha512-X6KSoKiSDZ07lds9awDMd14VUmtLS0sxgbUzZi1m6JewWdwXtuadTBff1kAUcAmKgJTYBPnVN0u2BKp7AIzllA== +jest-cli@^28.0.3: + version "28.0.3" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-28.0.3.tgz#4a4e55078ec772e0ea2583dd4c4b38fb306dc556" + integrity sha512-NCPTEONCnhYGo1qzPP4OOcGF04YasM5GZSwQLI1HtEluxa3ct4U65IbZs6DSRt8XN1Rq0jhXwv02m5lHB28Uyg== dependencies: - "@jest/core" "^28.0.2" + "@jest/core" "^28.0.3" "@jest/test-result" "^28.0.2" "@jest/types" "^28.0.2" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^28.0.2" + jest-config "^28.0.3" jest-util "^28.0.2" jest-validate "^28.0.2" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-28.0.2.tgz#43053a24ae6efd4da25bbe473d4bc98da008ac18" - integrity sha512-4E5r24Dw1DsyF4ObkwiDEqXIwrX7p01mnngWKtB/0Jdb0SpR1UGAm8Bjg6GTozCA4SlSj/Bbq7LTkg0WrzLanQ== +jest-config@^28.0.3: + version "28.0.3" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-28.0.3.tgz#9c0556d60d692153a6bc8652974182c22db9244f" + integrity sha512-3gWOEHwGpNhyYOk9vnUMv94x15QcdjACm7A3lERaluwnyD6d1WZWe9RFCShgIXVOHzRfG1hWxsI2U0gKKSGgDQ== dependencies: "@babel/core" "^7.11.6" "@jest/test-sequencer" "^28.0.2" "@jest/types" "^28.0.2" - babel-jest "^28.0.2" + babel-jest "^28.0.3" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^28.0.2" + jest-circus "^28.0.3" jest-environment-node "^28.0.2" jest-get-type "^28.0.2" jest-regex-util "^28.0.2" - jest-resolve "^28.0.2" - jest-runner "^28.0.2" + jest-resolve "^28.0.3" + jest-runner "^28.0.3" jest-util "^28.0.2" jest-validate "^28.0.2" micromatch "^4.0.4" @@ -1790,18 +1790,18 @@ jest-regex-util@^28.0.2: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-28.0.2.tgz#afdc377a3b25fb6e80825adcf76c854e5bf47ead" integrity sha512-4s0IgyNIy0y9FK+cjoVYoxamT7Zeo7MhzqRGx7YDYmaQn1wucY9rotiGkBzzcMXTtjrCAP/f7f+E0F7+fxPNdw== -jest-resolve-dependencies@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-28.0.2.tgz#44e1a65ccaaf3b73d4fa8e9add4eeff5b752e1cb" - integrity sha512-Xgkc51baZJQ9UcZg8UN9rGtnvqoVHeDNP6iM4QV3W/phzbFyRCiAxqgJ2GyuBnzGm2EirUlIcstlvOR/6trHmw== +jest-resolve-dependencies@^28.0.3: + version "28.0.3" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-28.0.3.tgz#76d8f59f7e76ba36d76a1677eeaaed24560da7e0" + integrity sha512-lCgHMm0/5p0qHemrOzm7kI6JDei28xJwIf7XOEcv1HeAVHnsON8B8jO/woqlU+/GcOXb58ymieYqhk3zjGWnvQ== dependencies: jest-regex-util "^28.0.2" - jest-snapshot "^28.0.2" + jest-snapshot "^28.0.3" -jest-resolve@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-28.0.2.tgz#46faf8f418fbb7dd37ae958c7393c8bcaf331f8d" - integrity sha512-4smZQ+Z4bzRNAXmj2HSrDYOAVar/SBDClUWxDJrz3BHbw+URXGAPenziWIShmybBlcRnX0lVCs43UiB7+Fh+lg== +jest-resolve@^28.0.3: + version "28.0.3" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-28.0.3.tgz#63f8e6b53e40f265b3ca9116195221dd43e3d16d" + integrity sha512-lfgjd9JhEjpjIN3HLUfdysdK+A7ePQoYmd7WL9DUEWqdnngb1rF56eee6iDXJxl/3eSolpP43VD7VrhjL3NsoQ== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" @@ -1813,15 +1813,15 @@ jest-resolve@^28.0.2: resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-28.0.2.tgz#48b0bdf2a5c286e591d41e4e304856362eaf18de" - integrity sha512-biaiCtgNAeTl1GrHezlWLbTStoi/aP4X2FOZaAhdbHUAflUg4bal6q3Ck8VNhTGzkXVeFtVVZFHE5PHlyUAJBw== +jest-runner@^28.0.3: + version "28.0.3" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-28.0.3.tgz#a8a409c685ad3081a44b149b2eb04bc4d47faaf9" + integrity sha512-4OsHMjBLtYUWCENucAQ4Za0jGfEbOFi/Fusv6dzUuaweqx8apb4+5p2LR2yvgF4StFulmxyC238tGLftfu+zBA== dependencies: "@jest/console" "^28.0.2" "@jest/environment" "^28.0.2" "@jest/test-result" "^28.0.2" - "@jest/transform" "^28.0.2" + "@jest/transform" "^28.0.3" "@jest/types" "^28.0.2" "@types/node" "*" chalk "^4.0.0" @@ -1832,25 +1832,25 @@ jest-runner@^28.0.2: jest-haste-map "^28.0.2" jest-leak-detector "^28.0.2" jest-message-util "^28.0.2" - jest-resolve "^28.0.2" - jest-runtime "^28.0.2" + jest-resolve "^28.0.3" + jest-runtime "^28.0.3" jest-util "^28.0.2" jest-watcher "^28.0.2" jest-worker "^28.0.2" source-map-support "0.5.13" throat "^6.0.1" -jest-runtime@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-28.0.2.tgz#3e11c9b66891ea959a455dce0e62509bfa5a73f1" - integrity sha512-fUoJ/GVrCj7pdYYXfET8bBudDmefmnscd/0jBkBAgHTs3qu+rGXUAV3QN/ECNhWhhEXoJ5a2PnSFTJ8RmXM6xQ== +jest-runtime@^28.0.3: + version "28.0.3" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-28.0.3.tgz#02346a34de0ac61d23bdb0e8c035ad973d7bb087" + integrity sha512-7FtPUmvbZEHLOdjsF6dyHg5Pe4E0DU+f3Vvv8BPzVR7mQA6nFR4clQYLAPyJGnsUvN8WRWn+b5a5SVwnj1WaGg== dependencies: "@jest/environment" "^28.0.2" "@jest/fake-timers" "^28.0.2" - "@jest/globals" "^28.0.2" + "@jest/globals" "^28.0.3" "@jest/source-map" "^28.0.2" "@jest/test-result" "^28.0.2" - "@jest/transform" "^28.0.2" + "@jest/transform" "^28.0.3" "@jest/types" "^28.0.2" chalk "^4.0.0" cjs-module-lexer "^1.0.0" @@ -1862,16 +1862,16 @@ jest-runtime@^28.0.2: jest-message-util "^28.0.2" jest-mock "^28.0.2" jest-regex-util "^28.0.2" - jest-resolve "^28.0.2" - jest-snapshot "^28.0.2" + jest-resolve "^28.0.3" + jest-snapshot "^28.0.3" jest-util "^28.0.2" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-28.0.2.tgz#d20f38d47e4f7e0cab752c21f99fcdc7e127c350" - integrity sha512-Y+2red99KRYY5vxA3HIE1p7p2MxPZz5uwamly18DII/9m/D2QQKcYqETS+/DjDthOxpnJWFqqku7MDzdpnHkHg== +jest-snapshot@^28.0.3: + version "28.0.3" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-28.0.3.tgz#9a768d0c617d070e87c1bd37240f22b344616154" + integrity sha512-nVzAAIlAbrMuvVUrS1YxmAeo1TfSsDDU+K5wv/Ow56MBp+L+Y71ksAbwRp3kGCgZAz4oOXcAMPAwtT9Yh1hlQQ== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" @@ -1879,7 +1879,7 @@ jest-snapshot@^28.0.2: "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" "@jest/expect-utils" "^28.0.2" - "@jest/transform" "^28.0.2" + "@jest/transform" "^28.0.3" "@jest/types" "^28.0.2" "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" @@ -1945,13 +1945,13 @@ jest-worker@^28.0.2: supports-color "^8.0.0" jest@^28.0.1: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest/-/jest-28.0.2.tgz#41385ca21d009708bb9fc65e08663110e08e2cc0" - integrity sha512-COUtjybolW4koQvO7kCfq5kgbeeU5WbSJfVZprz4zbS8AL32+RAZZTUjBEyRRdpsXqss/pHIvSL7/P+LyMYHXg== + version "28.0.3" + resolved "https://registry.yarnpkg.com/jest/-/jest-28.0.3.tgz#92a7d6ee097b61de4ba2db7f3ab723e81a99b32d" + integrity sha512-uS+T5J3w5xyzd1KSJCGKhCo8WTJXbNl86f5SW11wgssbandJOVLRKKUxmhdFfmKxhPeksl1hHZ0HaA8VBzp7xA== dependencies: - "@jest/core" "^28.0.2" + "@jest/core" "^28.0.3" import-local "^3.0.2" - jest-cli "^28.0.2" + jest-cli "^28.0.3" js-tokens@^4.0.0: version "4.0.0" From a19b0a807d78c57b76ba0d6b020f0254ed8ec3e6 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 4 May 2022 22:57:29 -0400 Subject: [PATCH 599/785] Positive process ID on windows --- src/parseSync.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/parseSync.js b/src/parseSync.js index e4afbb1c..9b2d08dc 100644 --- a/src/parseSync.js +++ b/src/parseSync.js @@ -132,7 +132,11 @@ function spawnServer() { try { if (server.pid) { - process.kill(-server.pid); + // Kill the server process if it's still running. If we're on windows + // we're going to use the process ID number. If we're not, we're going + // to use the negative process ID to indicate the group. + const pid = process.platform === "win32" ? server.pid : -server.pid; + process.kill(pid); } } catch (e) { if (process.env.PLUGIN_RUBY_CI) { From 69acc91799e6e3bcc561211bda9c276628bec3e0 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 4 May 2022 23:06:19 -0400 Subject: [PATCH 600/785] Update CHANGELOG --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e53b53c9..59041572 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,20 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Added + +- [#1190](https://github.com/prettier/plugin-ruby/pull/1190) - kddnewton - Encoding for source files is now guessed in a much better way. + ### Changed - [#1198](https://github.com/prettier/plugin-ruby/issues/1198) - pas-f, kddnewton - Fix crashes on JRuby with do blocks. +- [#1131](https://github.com/prettier/plugin-ruby/issues/1131) - hyrious, kddnewton - Ensure zombie processes are not left around when the server exits. +- [#1206](https://github.com/prettier/plugin-ruby/pull/1206) - kddnewton - Switch back to plain JavaScript for development. +- [#1190](https://github.com/prettier/plugin-ruby/pull/1190) - kddnewton - Switch over to using Syntax Tree for the backend. + +### Removed + +- [#1190](https://github.com/prettier/plugin-ruby/pull/1190) - kddnewton - The configuration options have been removed. Instead, configuration is to be done through modifying Syntax Tree. ## [2.1.0] - 2022-04-04 From 2379c92459edd93ea5496a628a191522d2ece2e2 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 4 May 2022 23:08:40 -0400 Subject: [PATCH 601/785] Bump to v3.0.0 --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59041572..3167848e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [3.0.0] - 2022-05-04 + ### Added - [#1190](https://github.com/prettier/plugin-ruby/pull/1190) - kddnewton - Encoding for source files is now guessed in a much better way. @@ -1223,7 +1225,8 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v2.1.0...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v3.0.0...HEAD +[3.0.0]: https://github.com/prettier/plugin-ruby/compare/v2.1.0...v3.0.0 [2.1.0]: https://github.com/prettier/plugin-ruby/compare/v2.0.0...v2.1.0 [2.0.0]: https://github.com/prettier/plugin-ruby/compare/v2.0.0-rc4...v2.0.0 [2.0.0-rc4]: https://github.com/prettier/plugin-ruby/compare/v2.0.0-rc3...v2.0.0-rc4 diff --git a/package.json b/package.json index c2ca81a0..dc5f6f49 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "2.1.0", + "version": "3.0.0", "description": "prettier plugin for the Ruby programming language", "main": "src/plugin.js", "scripts": { From 513a9ebb37d1bc0f6a052f987043615049a68824 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 4 May 2022 23:26:52 -0400 Subject: [PATCH 602/785] Document necessary Ruby dependencies --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 3001f821..d0fa6db9 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,12 @@ Or if you're using `yarn`, then add the plugin by: yarn add --dev prettier @prettier/plugin-ruby ``` +You'll also need to add the necessary Ruby dependencies. You can do this by running: + +```bash +gem install syntax_tree syntax_tree-haml syntax_tree-rbs +``` + The `prettier` executable is now installed and ready for use: ```bash From c5e34859d3830223dc678662b31300f52a48c3dc Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 5 May 2022 12:06:06 -0400 Subject: [PATCH 603/785] Document needing bundler --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d0fa6db9..5f6abff4 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,7 @@ yarn add --dev prettier @prettier/plugin-ruby You'll also need to add the necessary Ruby dependencies. You can do this by running: ```bash -gem install syntax_tree syntax_tree-haml syntax_tree-rbs +gem install bundler syntax_tree syntax_tree-haml syntax_tree-rbs ``` The `prettier` executable is now installed and ready for use: From 19cb95b6b1f3c72635ba0ff571ccd73e7376536f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 May 2022 12:01:29 +0000 Subject: [PATCH 604/785] Bump jest from 28.0.3 to 28.1.0 Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 28.0.3 to 28.1.0. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v28.1.0/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 573 +++++++++++++++++++++++++++--------------------------- 1 file changed, 287 insertions(+), 286 deletions(-) diff --git a/yarn.lock b/yarn.lock index 493a51bd..9af83b72 100644 --- a/yarn.lock +++ b/yarn.lock @@ -406,28 +406,28 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^28.0.2": - version "28.0.2" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-28.0.2.tgz#d11e8b43ae431ae9b3112656848417ae4008fcad" - integrity sha512-tiRpnMeeyQuuzgL5UNSeiqMwF8UOWPbAE5rzcu/1zyq4oPG2Ox6xm4YCOruwbp10F8odWc+XwVxTyGzMSLMqxA== +"@jest/console@^28.1.0": + version "28.1.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-28.1.0.tgz#db78222c3d3b0c1db82f1b9de51094c2aaff2176" + integrity sha512-tscn3dlJFGay47kb4qVruQg/XWlmvU0xp3EJOjzzY+sBaI+YgwKcvAmTcyYU7xEiLLIY5HCdWRooAL8dqkFlDA== dependencies: - "@jest/types" "^28.0.2" + "@jest/types" "^28.1.0" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^28.0.2" - jest-util "^28.0.2" + jest-message-util "^28.1.0" + jest-util "^28.1.0" slash "^3.0.0" -"@jest/core@^28.0.3": - version "28.0.3" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-28.0.3.tgz#2b8223914ef6ae16ff740e65235ef8ef49c46d52" - integrity sha512-cCQW06vEZ+5r50SB06pOnSWsOBs7F+lswPYnKKfBz1ncLlj1sMqmvjgam8q40KhlZ8Ut4eNAL2Hvfx4BKIO2FA== +"@jest/core@^28.1.0": + version "28.1.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-28.1.0.tgz#784a1e6ce5358b46fcbdcfbbd93b1b713ed4ea80" + integrity sha512-/2PTt0ywhjZ4NwNO4bUqD9IVJfmFVhVKGlhvSpmEfUCuxYf/3NHcKmRFI+I71lYzbTT3wMuYpETDCTHo81gC/g== dependencies: - "@jest/console" "^28.0.2" - "@jest/reporters" "^28.0.3" - "@jest/test-result" "^28.0.2" - "@jest/transform" "^28.0.3" - "@jest/types" "^28.0.2" + "@jest/console" "^28.1.0" + "@jest/reporters" "^28.1.0" + "@jest/test-result" "^28.1.0" + "@jest/transform" "^28.1.0" + "@jest/types" "^28.1.0" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" @@ -435,80 +435,80 @@ exit "^0.1.2" graceful-fs "^4.2.9" jest-changed-files "^28.0.2" - jest-config "^28.0.3" - jest-haste-map "^28.0.2" - jest-message-util "^28.0.2" + jest-config "^28.1.0" + jest-haste-map "^28.1.0" + jest-message-util "^28.1.0" jest-regex-util "^28.0.2" - jest-resolve "^28.0.3" - jest-resolve-dependencies "^28.0.3" - jest-runner "^28.0.3" - jest-runtime "^28.0.3" - jest-snapshot "^28.0.3" - jest-util "^28.0.2" - jest-validate "^28.0.2" - jest-watcher "^28.0.2" + jest-resolve "^28.1.0" + jest-resolve-dependencies "^28.1.0" + jest-runner "^28.1.0" + jest-runtime "^28.1.0" + jest-snapshot "^28.1.0" + jest-util "^28.1.0" + jest-validate "^28.1.0" + jest-watcher "^28.1.0" micromatch "^4.0.4" - pretty-format "^28.0.2" + pretty-format "^28.1.0" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^28.0.2": - version "28.0.2" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-28.0.2.tgz#a865949d876b2d364b979bbc0a46338ffd23de26" - integrity sha512-IvI7dEfqVEffDYlw9FQfVBt6kXt/OI38V7QUIur0ulOQgzpKYJDVvLzj4B1TVmHWTGW5tcnJdlZ3hqzV6/I9Qg== +"@jest/environment@^28.1.0": + version "28.1.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-28.1.0.tgz#dedf7d59ec341b9292fcf459fd0ed819eb2e228a" + integrity sha512-S44WGSxkRngzHslhV6RoAExekfF7Qhwa6R5+IYFa81mpcj0YgdBnRSmvHe3SNwOt64yXaE5GG8Y2xM28ii5ssA== dependencies: - "@jest/fake-timers" "^28.0.2" - "@jest/types" "^28.0.2" + "@jest/fake-timers" "^28.1.0" + "@jest/types" "^28.1.0" "@types/node" "*" - jest-mock "^28.0.2" + jest-mock "^28.1.0" -"@jest/expect-utils@^28.0.2": - version "28.0.2" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-28.0.2.tgz#0a055868d225261eac82a12013e2e0735238774d" - integrity sha512-YryfH2zN5c7M8eLtn9oTBRj1sfD+X4cHNXJnTejqCveOS33wADEZUxJ7de5++lRvByNpRpfAnc8zTK7yrUJqgA== +"@jest/expect-utils@^28.1.0": + version "28.1.0" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-28.1.0.tgz#a5cde811195515a9809b96748ae8bcc331a3538a" + integrity sha512-5BrG48dpC0sB80wpeIX5FU6kolDJI4K0n5BM9a5V38MGx0pyRvUBSS0u2aNTdDzmOrCjhOg8pGs6a20ivYkdmw== dependencies: jest-get-type "^28.0.2" -"@jest/expect@^28.0.3": - version "28.0.3" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-28.0.3.tgz#80e0233bee62586e1112f904d28b904dd1143ef2" - integrity sha512-VEzZr85bqNomgayQkR7hWG5HnbZYWYWagQriZsixhLmOzU6PCpMP61aeVhkCoRrg7ri5f7JDpeTPzDAajIwFHw== +"@jest/expect@^28.1.0": + version "28.1.0" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-28.1.0.tgz#2e5a31db692597070932366a1602b5157f0f217c" + integrity sha512-be9ETznPLaHOmeJqzYNIXv1ADEzENuQonIoobzThOYPuK/6GhrWNIJDVTgBLCrz3Am73PyEU2urQClZp0hLTtA== dependencies: - expect "^28.0.2" - jest-snapshot "^28.0.3" + expect "^28.1.0" + jest-snapshot "^28.1.0" -"@jest/fake-timers@^28.0.2": - version "28.0.2" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-28.0.2.tgz#d36e62bc58f39d65ea6adac1ff7749e63aff05f3" - integrity sha512-R75yUv+WeybPa4ZVhX9C+8XN0TKjUoceUX+/QEaDVQGxZZOK50eD74cs7iMDTtpodh00d8iLlc9197vgF6oZjA== +"@jest/fake-timers@^28.1.0": + version "28.1.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-28.1.0.tgz#ea77878aabd5c5d50e1fc53e76d3226101e33064" + integrity sha512-Xqsf/6VLeAAq78+GNPzI7FZQRf5cCHj1qgQxCjws9n8rKw8r1UYoeaALwBvyuzOkpU3c1I6emeMySPa96rxtIg== dependencies: - "@jest/types" "^28.0.2" + "@jest/types" "^28.1.0" "@sinonjs/fake-timers" "^9.1.1" "@types/node" "*" - jest-message-util "^28.0.2" - jest-mock "^28.0.2" - jest-util "^28.0.2" + jest-message-util "^28.1.0" + jest-mock "^28.1.0" + jest-util "^28.1.0" -"@jest/globals@^28.0.3": - version "28.0.3" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-28.0.3.tgz#70f68a06c863d1c9d14aea151c69b9690e3efeb4" - integrity sha512-q/zXYI6CKtTSIt1WuTHBYizJhH7K8h+xG5PE3C0oawLlPIvUMDYmpj0JX0XsJwPRLCsz/fYXHZVG46AaEhSPmw== +"@jest/globals@^28.1.0": + version "28.1.0" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-28.1.0.tgz#a4427d2eb11763002ff58e24de56b84ba79eb793" + integrity sha512-3m7sTg52OTQR6dPhsEQSxAvU+LOBbMivZBwOvKEZ+Rb+GyxVnXi9HKgOTYkx/S99T8yvh17U4tNNJPIEQmtwYw== dependencies: - "@jest/environment" "^28.0.2" - "@jest/expect" "^28.0.3" - "@jest/types" "^28.0.2" + "@jest/environment" "^28.1.0" + "@jest/expect" "^28.1.0" + "@jest/types" "^28.1.0" -"@jest/reporters@^28.0.3": - version "28.0.3" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-28.0.3.tgz#9996189e5552e37fcdffe0f41c07754f5d2ea854" - integrity sha512-xrbIc7J/xwo+D7AY3enAR9ZWYCmJ8XIkstTukTGpKDph0gLl/TJje9jl3dssvE4KJzYqMKiSrnE5Nt68I4fTEg== +"@jest/reporters@^28.1.0": + version "28.1.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-28.1.0.tgz#5183a28b9b593b6000fa9b89b031c7216b58a9a0" + integrity sha512-qxbFfqap/5QlSpIizH9c/bFCDKsQlM4uAKSOvZrP+nIdrjqre3FmKzpTtYyhsaVcOSNK7TTt2kjm+4BJIjysFA== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^28.0.2" - "@jest/test-result" "^28.0.2" - "@jest/transform" "^28.0.3" - "@jest/types" "^28.0.2" + "@jest/console" "^28.1.0" + "@jest/test-result" "^28.1.0" + "@jest/transform" "^28.1.0" + "@jest/types" "^28.1.0" "@jridgewell/trace-mapping" "^0.3.7" "@types/node" "*" chalk "^4.0.0" @@ -521,10 +521,11 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-util "^28.0.2" - jest-worker "^28.0.2" + jest-util "^28.1.0" + jest-worker "^28.1.0" slash "^3.0.0" string-length "^4.0.1" + strip-ansi "^6.0.0" terminal-link "^2.0.0" v8-to-istanbul "^9.0.0" @@ -544,51 +545,51 @@ callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^28.0.2": - version "28.0.2" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-28.0.2.tgz#bc8e15a95347e3c2149572ae06a5a6fed939c522" - integrity sha512-4EUqgjq9VzyUiVTvZfI9IRJD6t3NYBNP4f+Eq8Zr93+hkJ0RrGU4OBTw8tfNzidKX+bmuYzn8FxqpxOPIGGCMA== +"@jest/test-result@^28.1.0": + version "28.1.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-28.1.0.tgz#fd149dee123510dd2fcadbbf5f0020f98ad7f12c" + integrity sha512-sBBFIyoPzrZho3N+80P35A5oAkSKlGfsEFfXFWuPGBsW40UAjCkGakZhn4UQK4iQlW2vgCDMRDOob9FGKV8YoQ== dependencies: - "@jest/console" "^28.0.2" - "@jest/types" "^28.0.2" + "@jest/console" "^28.1.0" + "@jest/types" "^28.1.0" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^28.0.2": - version "28.0.2" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-28.0.2.tgz#7669b7d8ff2aa7a8221b11bb37cce552de81b1bb" - integrity sha512-zhnZ8ydkZQTPL7YucB86eOlD79zPy5EGSUKiR2Iv93RVEDU6OEP33kwDBg70ywOcxeJGDRhyo09q7TafNCBiIg== +"@jest/test-sequencer@^28.1.0": + version "28.1.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-28.1.0.tgz#ce7294bbe986415b9a30e218c7e705e6ebf2cdf2" + integrity sha512-tZCEiVWlWNTs/2iK9yi6o3AlMfbbYgV4uuZInSVdzZ7ftpHZhCMuhvk2HLYhCZzLgPFQ9MnM1YaxMnh3TILFiQ== dependencies: - "@jest/test-result" "^28.0.2" + "@jest/test-result" "^28.1.0" graceful-fs "^4.2.9" - jest-haste-map "^28.0.2" + jest-haste-map "^28.1.0" slash "^3.0.0" -"@jest/transform@^28.0.3": - version "28.0.3" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-28.0.3.tgz#591fb5ebc1d84db5c5f21e1225c7406c35f5eb1e" - integrity sha512-+Y0ikI7SwoW/YbK8t9oKwC70h4X2Gd0OVuz5tctRvSV/EDQU00AAkoqevXgPSSFimUmp/sp7Yl8s/1bExDqOIg== +"@jest/transform@^28.1.0": + version "28.1.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-28.1.0.tgz#224a3c9ba4cc98e2ff996c0a89a2d59db15c74ce" + integrity sha512-omy2xe5WxlAfqmsTjTPxw+iXRTRnf+NtX0ToG+4S0tABeb4KsKmPUHq5UBuwunHg3tJRwgEQhEp0M/8oiatLEA== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^28.0.2" + "@jest/types" "^28.1.0" "@jridgewell/trace-mapping" "^0.3.7" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.9" - jest-haste-map "^28.0.2" + jest-haste-map "^28.1.0" jest-regex-util "^28.0.2" - jest-util "^28.0.2" + jest-util "^28.1.0" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" write-file-atomic "^4.0.1" -"@jest/types@^28.0.2": - version "28.0.2" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-28.0.2.tgz#70b9538c1863fb060b2f438ca008b5563d00c5b4" - integrity sha512-hi3jUdm9iht7I2yrV5C4s3ucCJHUP8Eh3W6rQ1s4n/Qw9rQgsda4eqCt+r3BKRi7klVmZfQlMx1nGlzNMP2d8A== +"@jest/types@^28.1.0": + version "28.1.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-28.1.0.tgz#508327a89976cbf9bd3e1cc74641a29fd7dfd519" + integrity sha512-xmEggMPr317MIOjjDoZ4ejCSr9Lpbt/u34+dvc99t7DS8YirW5rwZEhzKPC2BMUFkUhI48qs6qLUSGw5FuL0GA== dependencies: "@jest/schemas" "^28.0.2" "@types/istanbul-lib-coverage" "^2.0.0" @@ -819,12 +820,12 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^28.0.3: - version "28.0.3" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-28.0.3.tgz#843dc170da5b9671d4054ada9fdcd28f85f92a6e" - integrity sha512-S0ADyYdcrt5fp9YldRYWCUHdk1BKt9AkvBkLWBoNAEV9NoWZPIj5+MYhPcGgTS65mfv3a+Ymf2UqgWoAVd41cA== +babel-jest@^28.1.0: + version "28.1.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-28.1.0.tgz#95a67f8e2e7c0042e7b3ad3951b8af41a533b5ea" + integrity sha512-zNKk0yhDZ6QUwfxh9k07GII6siNGMJWVUU49gmFj5gfdqDKLqa2RArXOF2CODp4Dr7dLxN2cvAV+667dGJ4b4w== dependencies: - "@jest/transform" "^28.0.3" + "@jest/transform" "^28.1.0" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" babel-preset-jest "^28.0.2" @@ -1278,16 +1279,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/expect/-/expect-28.0.2.tgz#86f0d6fa971bc533faf68d4d103d00f343d6a4b3" - integrity sha512-X0qIuI/zKv98k34tM+uGeOgAC73lhs4vROF9MkPk94C1zujtwv4Cla8SxhWn0G1OwvG9gLLL7RjFBkwGVaZ83w== +expect@^28.1.0: + version "28.1.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-28.1.0.tgz#10e8da64c0850eb8c39a480199f14537f46e8360" + integrity sha512-qFXKl8Pmxk8TBGfaFKRtcQjfXEnKAs+dmlxdwvukJZorwrAabT7M3h8oLOG01I2utEhkmUTi17CHaPBovZsKdw== dependencies: - "@jest/expect-utils" "^28.0.2" + "@jest/expect-utils" "^28.1.0" jest-get-type "^28.0.2" - jest-matcher-utils "^28.0.2" - jest-message-util "^28.0.2" - jest-util "^28.0.2" + jest-matcher-utils "^28.1.0" + jest-message-util "^28.1.0" + jest-util "^28.1.0" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1604,86 +1605,86 @@ jest-changed-files@^28.0.2: execa "^5.0.0" throat "^6.0.1" -jest-circus@^28.0.3: - version "28.0.3" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-28.0.3.tgz#45f77090b4b9fe5c1b84f72816868c9d4c0f57b1" - integrity sha512-HJ3rUCm3A3faSy7KVH5MFCncqJLtrjEFkTPn9UIcs4Kq77+TXqHsOaI+/k73aHe6DJQigLUXq9rCYj3MYFlbIw== +jest-circus@^28.1.0: + version "28.1.0" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-28.1.0.tgz#e229f590911bd54d60efaf076f7acd9360296dae" + integrity sha512-rNYfqfLC0L0zQKRKsg4n4J+W1A2fbyGH7Ss/kDIocp9KXD9iaL111glsLu7+Z7FHuZxwzInMDXq+N1ZIBkI/TQ== dependencies: - "@jest/environment" "^28.0.2" - "@jest/expect" "^28.0.3" - "@jest/test-result" "^28.0.2" - "@jest/types" "^28.0.2" + "@jest/environment" "^28.1.0" + "@jest/expect" "^28.1.0" + "@jest/test-result" "^28.1.0" + "@jest/types" "^28.1.0" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" is-generator-fn "^2.0.0" - jest-each "^28.0.2" - jest-matcher-utils "^28.0.2" - jest-message-util "^28.0.2" - jest-runtime "^28.0.3" - jest-snapshot "^28.0.3" - jest-util "^28.0.2" - pretty-format "^28.0.2" + jest-each "^28.1.0" + jest-matcher-utils "^28.1.0" + jest-message-util "^28.1.0" + jest-runtime "^28.1.0" + jest-snapshot "^28.1.0" + jest-util "^28.1.0" + pretty-format "^28.1.0" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^28.0.3: - version "28.0.3" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-28.0.3.tgz#4a4e55078ec772e0ea2583dd4c4b38fb306dc556" - integrity sha512-NCPTEONCnhYGo1qzPP4OOcGF04YasM5GZSwQLI1HtEluxa3ct4U65IbZs6DSRt8XN1Rq0jhXwv02m5lHB28Uyg== +jest-cli@^28.1.0: + version "28.1.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-28.1.0.tgz#cd1d8adb9630102d5ba04a22895f63decdd7ac1f" + integrity sha512-fDJRt6WPRriHrBsvvgb93OxgajHHsJbk4jZxiPqmZbMDRcHskfJBBfTyjFko0jjfprP544hOktdSi9HVgl4VUQ== dependencies: - "@jest/core" "^28.0.3" - "@jest/test-result" "^28.0.2" - "@jest/types" "^28.0.2" + "@jest/core" "^28.1.0" + "@jest/test-result" "^28.1.0" + "@jest/types" "^28.1.0" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^28.0.3" - jest-util "^28.0.2" - jest-validate "^28.0.2" + jest-config "^28.1.0" + jest-util "^28.1.0" + jest-validate "^28.1.0" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^28.0.3: - version "28.0.3" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-28.0.3.tgz#9c0556d60d692153a6bc8652974182c22db9244f" - integrity sha512-3gWOEHwGpNhyYOk9vnUMv94x15QcdjACm7A3lERaluwnyD6d1WZWe9RFCShgIXVOHzRfG1hWxsI2U0gKKSGgDQ== +jest-config@^28.1.0: + version "28.1.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-28.1.0.tgz#fca22ca0760e746fe1ce1f9406f6b307ab818501" + integrity sha512-aOV80E9LeWrmflp7hfZNn/zGA4QKv/xsn2w8QCBP0t0+YqObuCWTSgNbHJ0j9YsTuCO08ZR/wsvlxqqHX20iUA== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^28.0.2" - "@jest/types" "^28.0.2" - babel-jest "^28.0.3" + "@jest/test-sequencer" "^28.1.0" + "@jest/types" "^28.1.0" + babel-jest "^28.1.0" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^28.0.3" - jest-environment-node "^28.0.2" + jest-circus "^28.1.0" + jest-environment-node "^28.1.0" jest-get-type "^28.0.2" jest-regex-util "^28.0.2" - jest-resolve "^28.0.3" - jest-runner "^28.0.3" - jest-util "^28.0.2" - jest-validate "^28.0.2" + jest-resolve "^28.1.0" + jest-runner "^28.1.0" + jest-util "^28.1.0" + jest-validate "^28.1.0" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^28.0.2" + pretty-format "^28.1.0" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-28.0.2.tgz#a543c90082560cd6cb14c5f28c39e6d4618ad7a6" - integrity sha512-33Rnf821Y54OAloav0PGNWHlbtEorXpjwchnToyyWbec10X74FOW7hGfvrXLGz7xOe2dz0uo9JVFAHHj/2B5pg== +jest-diff@^28.1.0: + version "28.1.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-28.1.0.tgz#77686fef899ec1873dbfbf9330e37dd429703269" + integrity sha512-8eFd3U3OkIKRtlasXfiAQfbovgFgRDb0Ngcs2E+FMeBZ4rUezqIaGjuyggJBp+llosQXNEWofk/Sz4Hr5gMUhA== dependencies: chalk "^4.0.0" diff-sequences "^28.0.2" jest-get-type "^28.0.2" - pretty-format "^28.0.2" + pretty-format "^28.1.0" jest-docblock@^28.0.2: version "28.0.2" @@ -1692,92 +1693,92 @@ jest-docblock@^28.0.2: dependencies: detect-newline "^3.0.0" -jest-each@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-28.0.2.tgz#fcf6843e9afe5a3f2d0b1c02aab1f41889d92f1d" - integrity sha512-/W5Wc0b+ipR36kDaLngdVEJ/5UYPOITK7rW0djTlCCQdMuWpCFJweMW4TzAoJ6GiRrljPL8FwiyOSoSHKrda2w== +jest-each@^28.1.0: + version "28.1.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-28.1.0.tgz#54ae66d6a0a5b1913e9a87588d26c2687c39458b" + integrity sha512-a/XX02xF5NTspceMpHujmOexvJ4GftpYXqr6HhhmKmExtMXsyIN/fvanQlt/BcgFoRKN4OCXxLQKth9/n6OPFg== dependencies: - "@jest/types" "^28.0.2" + "@jest/types" "^28.1.0" chalk "^4.0.0" jest-get-type "^28.0.2" - jest-util "^28.0.2" - pretty-format "^28.0.2" + jest-util "^28.1.0" + pretty-format "^28.1.0" -jest-environment-node@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-28.0.2.tgz#bd58e192b8f36a37e52c52fac812bd24b360c0b9" - integrity sha512-o9u5UHZ+NCuIoa44KEF0Behhsz/p1wMm0WumsZfWR1k4IVoWSt3aN0BavSC5dd26VxSGQvkrCnJxxOzhhUEG3Q== +jest-environment-node@^28.1.0: + version "28.1.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-28.1.0.tgz#6ed2150aa31babba0c488c5b4f4d813a585c68e6" + integrity sha512-gBLZNiyrPw9CSMlTXF1yJhaBgWDPVvH0Pq6bOEwGMXaYNzhzhw2kA/OijNF8egbCgDS0/veRv97249x2CX+udQ== dependencies: - "@jest/environment" "^28.0.2" - "@jest/fake-timers" "^28.0.2" - "@jest/types" "^28.0.2" + "@jest/environment" "^28.1.0" + "@jest/fake-timers" "^28.1.0" + "@jest/types" "^28.1.0" "@types/node" "*" - jest-mock "^28.0.2" - jest-util "^28.0.2" + jest-mock "^28.1.0" + jest-util "^28.1.0" jest-get-type@^28.0.2: version "28.0.2" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-28.0.2.tgz#34622e628e4fdcd793d46db8a242227901fcf203" integrity sha512-ioj2w9/DxSYHfOm5lJKCdcAmPJzQXmbM/Url3rhlghrPvT3tt+7a/+oXc9azkKmLvoiXjtV83bEWqi+vs5nlPA== -jest-haste-map@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-28.0.2.tgz#0c768f43680013cfd2a4471a3ec76c47bfb9e7c6" - integrity sha512-EokdL7l5uk4TqWGawwrIt8w3tZNcbeiRxmKGEURf42pl+/rWJy3sCJlon5HBhJXZTW978jk6600BLQOI7i25Ig== +jest-haste-map@^28.1.0: + version "28.1.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-28.1.0.tgz#6c1ee2daf1c20a3e03dbd8e5b35c4d73d2349cf0" + integrity sha512-xyZ9sXV8PtKi6NCrJlmq53PyNVHzxmcfXNVvIRHpHmh1j/HChC4pwKgyjj7Z9us19JMw8PpQTJsFWOsIfT93Dw== dependencies: - "@jest/types" "^28.0.2" + "@jest/types" "^28.1.0" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" jest-regex-util "^28.0.2" - jest-util "^28.0.2" - jest-worker "^28.0.2" + jest-util "^28.1.0" + jest-worker "^28.1.0" micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-28.0.2.tgz#cbde3d22d09bd690ececdc2ed01c608435328456" - integrity sha512-UGaSPYtxKXl/YKacq6juRAKmMp1z2os8NaU8PSC+xvNikmu3wF6QFrXrihMM4hXeMr9HuNotBrQZHmzDY8KIBQ== +jest-leak-detector@^28.1.0: + version "28.1.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-28.1.0.tgz#b65167776a8787443214d6f3f54935a4c73c8a45" + integrity sha512-uIJDQbxwEL2AMMs2xjhZl2hw8s77c3wrPaQ9v6tXJLGaaQ+4QrNJH5vuw7hA7w/uGT/iJ42a83opAqxGHeyRIA== dependencies: jest-get-type "^28.0.2" - pretty-format "^28.0.2" + pretty-format "^28.1.0" -jest-matcher-utils@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-28.0.2.tgz#eb461af204b6d0f05281e9228094f0ab7e9e8537" - integrity sha512-SxtTiI2qLJHFtOz/bySStCnwCvISAuxQ/grS+74dfTy5AuJw3Sgj9TVUvskcnImTfpzLoMCDJseRaeRrVYbAOA== +jest-matcher-utils@^28.1.0: + version "28.1.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-28.1.0.tgz#2ae398806668eeabd293c61712227cb94b250ccf" + integrity sha512-onnax0n2uTLRQFKAjC7TuaxibrPSvZgKTcSCnNUz/tOjJ9UhxNm7ZmPpoQavmTDUjXvUQ8KesWk2/VdrxIFzTQ== dependencies: chalk "^4.0.0" - jest-diff "^28.0.2" + jest-diff "^28.1.0" jest-get-type "^28.0.2" - pretty-format "^28.0.2" + pretty-format "^28.1.0" -jest-message-util@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-28.0.2.tgz#f3cf36be72be4c4c4058cb34bd6673996d26dee3" - integrity sha512-knK7XyojvwYh1XiF2wmVdskgM/uN11KsjcEWWHfnMZNEdwXCrqB4sCBO94F4cfiAwCS8WFV6CDixDwPlMh/wdA== +jest-message-util@^28.1.0: + version "28.1.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-28.1.0.tgz#7e8f0b9049e948e7b94c2a52731166774ba7d0af" + integrity sha512-RpA8mpaJ/B2HphDMiDlrAZdDytkmwFqgjDZovM21F35lHGeUeCvYmm6W+sbQ0ydaLpg5bFAUuWG1cjqOl8vqrw== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^28.0.2" + "@jest/types" "^28.1.0" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^28.0.2" + pretty-format "^28.1.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-28.0.2.tgz#059b500b34c1dd76474ebcdeccc249fe4dd0249f" - integrity sha512-vfnJ4zXRB0i24jOTGtQJyl26JKsgBKtqRlCnsrORZbG06FToSSn33h2x/bmE8XxqxkLWdZBRo+/65l8Vi3nD+g== +jest-mock@^28.1.0: + version "28.1.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-28.1.0.tgz#ccc7cc12a9b330b3182db0c651edc90d163ff73e" + integrity sha512-H7BrhggNn77WhdL7O1apG0Q/iwl0Bdd5E1ydhCJzL3oBLh/UYxAwR3EJLsBZ9XA3ZU4PA3UNw4tQjduBTCTmLw== dependencies: - "@jest/types" "^28.0.2" + "@jest/types" "^28.1.0" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -1790,168 +1791,168 @@ jest-regex-util@^28.0.2: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-28.0.2.tgz#afdc377a3b25fb6e80825adcf76c854e5bf47ead" integrity sha512-4s0IgyNIy0y9FK+cjoVYoxamT7Zeo7MhzqRGx7YDYmaQn1wucY9rotiGkBzzcMXTtjrCAP/f7f+E0F7+fxPNdw== -jest-resolve-dependencies@^28.0.3: - version "28.0.3" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-28.0.3.tgz#76d8f59f7e76ba36d76a1677eeaaed24560da7e0" - integrity sha512-lCgHMm0/5p0qHemrOzm7kI6JDei28xJwIf7XOEcv1HeAVHnsON8B8jO/woqlU+/GcOXb58ymieYqhk3zjGWnvQ== +jest-resolve-dependencies@^28.1.0: + version "28.1.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-28.1.0.tgz#167becb8bee6e20b5ef4a3a728ec67aef6b0b79b" + integrity sha512-Ue1VYoSZquPwEvng7Uefw8RmZR+me/1kr30H2jMINjGeHgeO/JgrR6wxj2ofkJ7KSAA11W3cOrhNCbj5Dqqd9g== dependencies: jest-regex-util "^28.0.2" - jest-snapshot "^28.0.3" + jest-snapshot "^28.1.0" -jest-resolve@^28.0.3: - version "28.0.3" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-28.0.3.tgz#63f8e6b53e40f265b3ca9116195221dd43e3d16d" - integrity sha512-lfgjd9JhEjpjIN3HLUfdysdK+A7ePQoYmd7WL9DUEWqdnngb1rF56eee6iDXJxl/3eSolpP43VD7VrhjL3NsoQ== +jest-resolve@^28.1.0: + version "28.1.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-28.1.0.tgz#b1f32748a6cee7d1779c7ef639c0a87078de3d35" + integrity sha512-vvfN7+tPNnnhDvISuzD1P+CRVP8cK0FHXRwPAcdDaQv4zgvwvag2n55/h5VjYcM5UJG7L4TwE5tZlzcI0X2Lhw== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^28.0.2" + jest-haste-map "^28.1.0" jest-pnp-resolver "^1.2.2" - jest-util "^28.0.2" - jest-validate "^28.0.2" + jest-util "^28.1.0" + jest-validate "^28.1.0" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^28.0.3: - version "28.0.3" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-28.0.3.tgz#a8a409c685ad3081a44b149b2eb04bc4d47faaf9" - integrity sha512-4OsHMjBLtYUWCENucAQ4Za0jGfEbOFi/Fusv6dzUuaweqx8apb4+5p2LR2yvgF4StFulmxyC238tGLftfu+zBA== +jest-runner@^28.1.0: + version "28.1.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-28.1.0.tgz#aefe2a1e618a69baa0b24a50edc54fdd7e728eaa" + integrity sha512-FBpmuh1HB2dsLklAlRdOxNTTHKFR6G1Qmd80pVDvwbZXTriqjWqjei5DKFC1UlM732KjYcE6yuCdiF0WUCOS2w== dependencies: - "@jest/console" "^28.0.2" - "@jest/environment" "^28.0.2" - "@jest/test-result" "^28.0.2" - "@jest/transform" "^28.0.3" - "@jest/types" "^28.0.2" + "@jest/console" "^28.1.0" + "@jest/environment" "^28.1.0" + "@jest/test-result" "^28.1.0" + "@jest/transform" "^28.1.0" + "@jest/types" "^28.1.0" "@types/node" "*" chalk "^4.0.0" emittery "^0.10.2" graceful-fs "^4.2.9" jest-docblock "^28.0.2" - jest-environment-node "^28.0.2" - jest-haste-map "^28.0.2" - jest-leak-detector "^28.0.2" - jest-message-util "^28.0.2" - jest-resolve "^28.0.3" - jest-runtime "^28.0.3" - jest-util "^28.0.2" - jest-watcher "^28.0.2" - jest-worker "^28.0.2" + jest-environment-node "^28.1.0" + jest-haste-map "^28.1.0" + jest-leak-detector "^28.1.0" + jest-message-util "^28.1.0" + jest-resolve "^28.1.0" + jest-runtime "^28.1.0" + jest-util "^28.1.0" + jest-watcher "^28.1.0" + jest-worker "^28.1.0" source-map-support "0.5.13" throat "^6.0.1" -jest-runtime@^28.0.3: - version "28.0.3" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-28.0.3.tgz#02346a34de0ac61d23bdb0e8c035ad973d7bb087" - integrity sha512-7FtPUmvbZEHLOdjsF6dyHg5Pe4E0DU+f3Vvv8BPzVR7mQA6nFR4clQYLAPyJGnsUvN8WRWn+b5a5SVwnj1WaGg== +jest-runtime@^28.1.0: + version "28.1.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-28.1.0.tgz#4847dcb2a4eb4b0f9eaf41306897e51fb1665631" + integrity sha512-wNYDiwhdH/TV3agaIyVF0lsJ33MhyujOe+lNTUiolqKt8pchy1Hq4+tDMGbtD5P/oNLA3zYrpx73T9dMTOCAcg== dependencies: - "@jest/environment" "^28.0.2" - "@jest/fake-timers" "^28.0.2" - "@jest/globals" "^28.0.3" + "@jest/environment" "^28.1.0" + "@jest/fake-timers" "^28.1.0" + "@jest/globals" "^28.1.0" "@jest/source-map" "^28.0.2" - "@jest/test-result" "^28.0.2" - "@jest/transform" "^28.0.3" - "@jest/types" "^28.0.2" + "@jest/test-result" "^28.1.0" + "@jest/transform" "^28.1.0" + "@jest/types" "^28.1.0" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" execa "^5.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^28.0.2" - jest-message-util "^28.0.2" - jest-mock "^28.0.2" + jest-haste-map "^28.1.0" + jest-message-util "^28.1.0" + jest-mock "^28.1.0" jest-regex-util "^28.0.2" - jest-resolve "^28.0.3" - jest-snapshot "^28.0.3" - jest-util "^28.0.2" + jest-resolve "^28.1.0" + jest-snapshot "^28.1.0" + jest-util "^28.1.0" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^28.0.3: - version "28.0.3" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-28.0.3.tgz#9a768d0c617d070e87c1bd37240f22b344616154" - integrity sha512-nVzAAIlAbrMuvVUrS1YxmAeo1TfSsDDU+K5wv/Ow56MBp+L+Y71ksAbwRp3kGCgZAz4oOXcAMPAwtT9Yh1hlQQ== +jest-snapshot@^28.1.0: + version "28.1.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-28.1.0.tgz#4b74fa8816707dd10fe9d551c2c258e5a67b53b6" + integrity sha512-ex49M2ZrZsUyQLpLGxQtDbahvgBjlLPgklkqGM0hq/F7W/f8DyqZxVHjdy19QKBm4O93eDp+H5S23EiTbbUmHw== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^28.0.2" - "@jest/transform" "^28.0.3" - "@jest/types" "^28.0.2" + "@jest/expect-utils" "^28.1.0" + "@jest/transform" "^28.1.0" + "@jest/types" "^28.1.0" "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^28.0.2" + expect "^28.1.0" graceful-fs "^4.2.9" - jest-diff "^28.0.2" + jest-diff "^28.1.0" jest-get-type "^28.0.2" - jest-haste-map "^28.0.2" - jest-matcher-utils "^28.0.2" - jest-message-util "^28.0.2" - jest-util "^28.0.2" + jest-haste-map "^28.1.0" + jest-matcher-utils "^28.1.0" + jest-message-util "^28.1.0" + jest-util "^28.1.0" natural-compare "^1.4.0" - pretty-format "^28.0.2" + pretty-format "^28.1.0" semver "^7.3.5" -jest-util@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-28.0.2.tgz#8e22cdd6e0549e0a393055f0e2da7eacc334b143" - integrity sha512-EVdpIRCC8lzqhp9A0u0aAKlsFIzufK6xKxNK7awsnebTdOP4hpyQW5o6Ox2qPl8gbeUKYF+POLyItaND53kpGA== +jest-util@^28.1.0: + version "28.1.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-28.1.0.tgz#d54eb83ad77e1dd441408738c5a5043642823be5" + integrity sha512-qYdCKD77k4Hwkose2YBEqQk7PzUf/NSE+rutzceduFveQREeH6b+89Dc9+wjX9dAwHcgdx4yedGA3FQlU/qCTA== dependencies: - "@jest/types" "^28.0.2" + "@jest/types" "^28.1.0" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-28.0.2.tgz#58bb7e826c054a8bb3b54c05f73758d96cf6dbef" - integrity sha512-nr0UOvCTtxP0YPdsk01Gk7e7c0xIiEe2nncAe3pj0wBfUvAykTVrMrdeASlAJnlEQCBuwN/GF4hKoCzbkGNCNw== +jest-validate@^28.1.0: + version "28.1.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-28.1.0.tgz#8a6821f48432aba9f830c26e28226ad77b9a0e18" + integrity sha512-Lly7CJYih3vQBfjLeANGgBSBJ7pEa18cxpQfQEq2go2xyEzehnHfQTjoUia8xUv4x4J80XKFIDwJJThXtRFQXQ== dependencies: - "@jest/types" "^28.0.2" + "@jest/types" "^28.1.0" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^28.0.2" leven "^3.1.0" - pretty-format "^28.0.2" + pretty-format "^28.1.0" -jest-watcher@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-28.0.2.tgz#649fa24df531d4071be5784b6274d494d788c88b" - integrity sha512-uIVJLpQ/5VTGQWBiBatHsi7jrCqHjHl0e0dFHMWzwuIfUbdW/muk0DtSr0fteY2T7QTFylv+7a5Rm8sBKrE12Q== +jest-watcher@^28.1.0: + version "28.1.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-28.1.0.tgz#aaa7b4164a4e77eeb5f7d7b25ede5e7b4e9c9aaf" + integrity sha512-tNHMtfLE8Njcr2IRS+5rXYA4BhU90gAOwI9frTGOqd+jX0P/Au/JfRSNqsf5nUTcWdbVYuLxS1KjnzILSoR5hA== dependencies: - "@jest/test-result" "^28.0.2" - "@jest/types" "^28.0.2" + "@jest/test-result" "^28.1.0" + "@jest/types" "^28.1.0" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.10.2" - jest-util "^28.0.2" + jest-util "^28.1.0" string-length "^4.0.1" -jest-worker@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-28.0.2.tgz#75f7e5126541289ba02e9c1a67e46349ddb8141d" - integrity sha512-pijNxfjxT0tGAx+8+OzZ+eayVPCwy/rsZFhebmC0F4YnXu1EHPEPxg7utL3m5uX3EaFH1/jwDxGa1EbjJCST2g== +jest-worker@^28.1.0: + version "28.1.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-28.1.0.tgz#ced54757a035e87591e1208253a6e3aac1a855e5" + integrity sha512-ZHwM6mNwaWBR52Snff8ZvsCTqQsvhCxP/bT1I6T6DAnb6ygkshsyLQIMxFwHpYxht0HOoqt23JlC01viI7T03A== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^28.0.1: - version "28.0.3" - resolved "https://registry.yarnpkg.com/jest/-/jest-28.0.3.tgz#92a7d6ee097b61de4ba2db7f3ab723e81a99b32d" - integrity sha512-uS+T5J3w5xyzd1KSJCGKhCo8WTJXbNl86f5SW11wgssbandJOVLRKKUxmhdFfmKxhPeksl1hHZ0HaA8VBzp7xA== + version "28.1.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-28.1.0.tgz#f420e41c8f2395b9a30445a97189ebb57593d831" + integrity sha512-TZR+tHxopPhzw3c3560IJXZWLNHgpcz1Zh0w5A65vynLGNcg/5pZ+VildAd7+XGOu6jd58XMY/HNn0IkZIXVXg== dependencies: - "@jest/core" "^28.0.3" + "@jest/core" "^28.1.0" import-local "^3.0.2" - jest-cli "^28.0.3" + jest-cli "^28.1.0" js-tokens@^4.0.0: version "4.0.0" @@ -2241,10 +2242,10 @@ prettier@>=2.3.0: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.2.tgz#e26d71a18a74c3d0f0597f55f01fb6c06c206032" integrity sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew== -pretty-format@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-28.0.2.tgz#6a24d71cbb61a5e5794ba7513fe22101675481bc" - integrity sha512-UmGZ1IERwS3yY35LDMTaBUYI1w4udZDdJGGT/DqQeKG9ZLDn7/K2Jf/JtYSRiHCCKMHvUA+zsEGSmHdpaVp1yw== +pretty-format@^28.1.0: + version "28.1.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-28.1.0.tgz#8f5836c6a0dfdb834730577ec18029052191af55" + integrity sha512-79Z4wWOYCdvQkEoEuSlBhHJqWeZ8D8YRPiPctJFCtvuaClGpiwiQYSCUOE6IEKUbbFukKOTFIUAXE8N4EQTo1Q== dependencies: "@jest/schemas" "^28.0.2" ansi-regex "^5.0.1" From 8b7800edbcc762589981d18346e71e058352e6a2 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 12 May 2022 10:03:44 -0400 Subject: [PATCH 605/785] Bump deps --- package.json | 4 +- test/js/haml/script.test.js | 4 - test/js/ruby/nodes/hashes.test.js | 2 +- test/js/ruby/nodes/patterns.test.js | 14 +- test/js/ruby/nodes/strings.test.js | 2 +- yarn.lock | 375 +++++++++++----------------- 6 files changed, 155 insertions(+), 246 deletions(-) diff --git a/package.json b/package.json index dc5f6f49..99cf5779 100644 --- a/package.json +++ b/package.json @@ -22,9 +22,9 @@ "prettier": ">=2.3.0" }, "devDependencies": { - "eslint": "^8.1.0", + "eslint": "^8.15.0", "eslint-config-prettier": "^8.0.0", - "husky": "^7.0.0", + "husky": "^8.0.1", "jest": "^28.0.1", "pretty-quick": "^3.1.2" }, diff --git a/test/js/haml/script.test.js b/test/js/haml/script.test.js index bca36c45..510c30c0 100644 --- a/test/js/haml/script.test.js +++ b/test/js/haml/script.test.js @@ -15,10 +15,6 @@ describe("script", () => { expect(content).toMatchFormat(); }); - test.skip("escape", () => { - expect(haml(`& I like #{"cheese & crackers"}`)).toMatchFormat(); - }); - test("escape with interpolate", () => { expect(haml(`&= "I like cheese & crackers"`)).toMatchFormat(); }); diff --git a/test/js/ruby/nodes/hashes.test.js b/test/js/ruby/nodes/hashes.test.js index 8ecd8b17..7e8478a5 100644 --- a/test/js/ruby/nodes/hashes.test.js +++ b/test/js/ruby/nodes/hashes.test.js @@ -81,7 +81,7 @@ describe("hash", () => { describe("dynamic string keys", () => { test("basic", () => { - expect(`{ "foo": "bar" }`).toMatchFormat(); + expect(`{ "foo": "bar" }`).toChangeFormat(`{ foo: "bar" }`); }); test("with interpolation", () => { diff --git a/test/js/ruby/nodes/patterns.test.js b/test/js/ruby/nodes/patterns.test.js index deb8aed6..74fbc04d 100644 --- a/test/js/ruby/nodes/patterns.test.js +++ b/test/js/ruby/nodes/patterns.test.js @@ -23,7 +23,7 @@ describe("patterns", () => { "*c, d, e", "0, [1, _] => bar", "^bar", - "x: 0.. => px, **rest", + "{ x: 0.. => px, **rest }", "**rest", "SuperPoint[x: 0.. => px]", "a, b if b == a * 2" @@ -79,18 +79,6 @@ describe("patterns", () => { expect(content).toMatchFormat(); }); - test("with comments in an array pattern", () => { - const content = ruby(` - case foo - in foo:, # foo comment - bar: # bar comment - bar - end - `); - - expect(content).toMatchFormat(); - }); - test("multiple clauses", () => { const content = ruby(` case foo diff --git a/test/js/ruby/nodes/strings.test.js b/test/js/ruby/nodes/strings.test.js index 34e90cc1..4e0223f3 100644 --- a/test/js/ruby/nodes/strings.test.js +++ b/test/js/ruby/nodes/strings.test.js @@ -239,7 +239,7 @@ describe("strings", () => { }); test("%s literal as hash key", () => { - expect("{ %s[abc] => d }").toChangeFormat(`{ "abc": d }`); + expect("{ %s[abc] => d }").toChangeFormat(`{ abc: d }`); }); test("symbol literal as a hash key", () => { diff --git a/yarn.lock b/yarn.lock index 9af83b72..10f732ad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3,11 +3,12 @@ "@ampproject/remapping@^2.1.0": - version "2.1.2" - resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.1.2.tgz#4edca94973ded9630d20101cd8559cedb8d8bd34" - integrity sha512-hoyByceqwKirw7w3Z7gnIIZC3Wx3J484Y3L/cMpXFbr7d9ZQj2mODrirNzcJa+SM3UlpWXYvKV4RlRpFXlWgXg== + version "2.2.0" + resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.0.tgz#56c133824780de3174aed5ab6834f3026790154d" + integrity sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w== dependencies: - "@jridgewell/trace-mapping" "^0.3.0" + "@jridgewell/gen-mapping" "^0.1.0" + "@jridgewell/trace-mapping" "^0.3.9" "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.7": version "7.16.7" @@ -16,79 +17,49 @@ dependencies: "@babel/highlight" "^7.16.7" -"@babel/compat-data@^7.17.7": - version "7.17.7" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.17.7.tgz#078d8b833fbbcc95286613be8c716cef2b519fa2" - integrity sha512-p8pdE6j0a29TNGebNm7NzYZWB3xVZJBZ7XGs42uAKzQo8VQ3F0By/cQCtUEABwIqw5zo6WA4NbmxsfzADzMKnQ== +"@babel/compat-data@^7.17.10": + version "7.17.10" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.17.10.tgz#711dc726a492dfc8be8220028b1b92482362baab" + integrity sha512-GZt/TCsG70Ms19gfZO1tM4CVnXsPgEPBCpJu+Qz3L0LUDsY5nZqFZglIoPC1kIYOtNBZlrnFT+klg12vFGZXrw== -"@babel/core@^7.11.6": - version "7.17.9" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.9.tgz#6bae81a06d95f4d0dec5bb9d74bbc1f58babdcfe" - integrity sha512-5ug+SfZCpDAkVp9SFIZAzlW18rlzsOcJGaetCjkySnrXXDUw9AR8cDUm1iByTmdWM6yxX6/zycaV76w3YTF2gw== +"@babel/core@^7.11.6", "@babel/core@^7.12.3": + version "7.17.10" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.10.tgz#74ef0fbf56b7dfc3f198fc2d927f4f03e12f4b05" + integrity sha512-liKoppandF3ZcBnIYFjfSDHZLKdLHGJRkoWtG8zQyGJBQfIYobpnVGI5+pLBNtS6psFLDzyq8+h5HiVljW9PNA== dependencies: "@ampproject/remapping" "^2.1.0" "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.17.9" - "@babel/helper-compilation-targets" "^7.17.7" + "@babel/generator" "^7.17.10" + "@babel/helper-compilation-targets" "^7.17.10" "@babel/helper-module-transforms" "^7.17.7" "@babel/helpers" "^7.17.9" - "@babel/parser" "^7.17.9" + "@babel/parser" "^7.17.10" "@babel/template" "^7.16.7" - "@babel/traverse" "^7.17.9" - "@babel/types" "^7.17.0" + "@babel/traverse" "^7.17.10" + "@babel/types" "^7.17.10" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.1" semver "^6.3.0" -"@babel/core@^7.12.3": - version "7.17.8" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.8.tgz#3dac27c190ebc3a4381110d46c80e77efe172e1a" - integrity sha512-OdQDV/7cRBtJHLSOBqqbYNkOcydOgnX59TZx4puf41fzcVtN3e/4yqY8lMQsK+5X2lJtAdmA+6OHqsj1hBJ4IQ== - dependencies: - "@ampproject/remapping" "^2.1.0" - "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.17.7" - "@babel/helper-compilation-targets" "^7.17.7" - "@babel/helper-module-transforms" "^7.17.7" - "@babel/helpers" "^7.17.8" - "@babel/parser" "^7.17.8" - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.17.3" - "@babel/types" "^7.17.0" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.1.2" - semver "^6.3.0" - -"@babel/generator@^7.17.3", "@babel/generator@^7.17.7", "@babel/generator@^7.7.2": - version "7.17.7" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.17.7.tgz#8da2599beb4a86194a3b24df6c085931d9ee45ad" - integrity sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w== - dependencies: - "@babel/types" "^7.17.0" - jsesc "^2.5.1" - source-map "^0.5.0" - -"@babel/generator@^7.17.9": - version "7.17.9" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.17.9.tgz#f4af9fd38fa8de143c29fce3f71852406fc1e2fc" - integrity sha512-rAdDousTwxbIxbz5I7GEQ3lUip+xVCXooZNbsydCWs3xA7ZsYOv+CFRdzGxRX78BmQHu9B1Eso59AOZQOJDEdQ== +"@babel/generator@^7.17.10", "@babel/generator@^7.7.2": + version "7.17.10" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.17.10.tgz#c281fa35b0c349bbe9d02916f4ae08fc85ed7189" + integrity sha512-46MJZZo9y3o4kmhBVc7zW7i8dtR1oIK/sdO5NcfcZRhTGYi+KKJRtHNgsU6c4VUcJmUNV/LQdebD/9Dlv4K+Tg== dependencies: - "@babel/types" "^7.17.0" + "@babel/types" "^7.17.10" + "@jridgewell/gen-mapping" "^0.1.0" jsesc "^2.5.1" - source-map "^0.5.0" -"@babel/helper-compilation-targets@^7.17.7": - version "7.17.7" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.7.tgz#a3c2924f5e5f0379b356d4cfb313d1414dc30e46" - integrity sha512-UFzlz2jjd8kroj0hmCFV5zr+tQPi1dpC2cRsDV/3IEW8bJfCPrPpmcSN6ZS8RqIq4LXcmpipCQFPddyFA5Yc7w== +"@babel/helper-compilation-targets@^7.17.10": + version "7.17.10" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.10.tgz#09c63106d47af93cf31803db6bc49fef354e2ebe" + integrity sha512-gh3RxjWbauw/dFiU/7whjd0qN9K6nPJMqe6+Er7rOavFh0CQUSwhAE3IcTho2rywPJFxej6TUUHDkWcYI6gGqQ== dependencies: - "@babel/compat-data" "^7.17.7" + "@babel/compat-data" "^7.17.10" "@babel/helper-validator-option" "^7.16.7" - browserslist "^4.17.5" + browserslist "^4.20.2" semver "^6.3.0" "@babel/helper-environment-visitor@^7.16.7": @@ -98,15 +69,6 @@ dependencies: "@babel/types" "^7.16.7" -"@babel/helper-function-name@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz#f1ec51551fb1c8956bc8dd95f38523b6cf375f8f" - integrity sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA== - dependencies: - "@babel/helper-get-function-arity" "^7.16.7" - "@babel/template" "^7.16.7" - "@babel/types" "^7.16.7" - "@babel/helper-function-name@^7.17.9": version "7.17.9" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz#136fcd54bc1da82fcb47565cf16fd8e444b1ff12" @@ -115,13 +77,6 @@ "@babel/template" "^7.16.7" "@babel/types" "^7.17.0" -"@babel/helper-get-function-arity@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz#ea08ac753117a669f1508ba06ebcc49156387419" - integrity sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw== - dependencies: - "@babel/types" "^7.16.7" - "@babel/helper-hoist-variables@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz#86bcb19a77a509c7b77d0e22323ef588fa58c246" @@ -179,15 +134,6 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz#b203ce62ce5fe153899b617c08957de860de4d23" integrity sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ== -"@babel/helpers@^7.17.8": - version "7.17.8" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.17.8.tgz#288450be8c6ac7e4e44df37bcc53d345e07bc106" - integrity sha512-QcL86FGxpfSJwGtAvv4iG93UL6bmqBdmoVY0CMCU2g+oD2ezQse3PT5Pa+jiD6LJndBQi0EDlpzOWNlLuhz5gw== - dependencies: - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.17.3" - "@babel/types" "^7.17.0" - "@babel/helpers@^7.17.9": version "7.17.9" resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.17.9.tgz#b2af120821bfbe44f9907b1826e168e819375a1a" @@ -198,23 +144,18 @@ "@babel/types" "^7.17.0" "@babel/highlight@^7.16.7": - version "7.16.10" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.10.tgz#744f2eb81579d6eea753c227b0f570ad785aba88" - integrity sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw== + version "7.17.9" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.17.9.tgz#61b2ee7f32ea0454612def4fccdae0de232b73e3" + integrity sha512-J9PfEKCbFIv2X5bjTMiZu6Vf341N05QIY+d6FvVKynkG1S7G0j3I0QoRtWIrXhZ+/Nlb5Q0MzqL7TokEJ5BNHg== dependencies: "@babel/helper-validator-identifier" "^7.16.7" chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.17.3", "@babel/parser@^7.17.8": - version "7.17.8" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.8.tgz#2817fb9d885dd8132ea0f8eb615a6388cca1c240" - integrity sha512-BoHhDJrJXqcg+ZL16Xv39H9n+AqJ4pcDrQBGZN+wHxIysrLZ3/ECwCBUch/1zUNhnsXULcONU3Ei5Hmkfk6kiQ== - -"@babel/parser@^7.17.9": - version "7.17.9" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.9.tgz#9c94189a6062f0291418ca021077983058e171ef" - integrity sha512-vqUSBLP8dQHFPdPi9bc5GK9vRkYHJ49fsZdtoJ8EQ8ibpwk5rPKfvNIwChB0KVXcIjcepEBBd2VHC5r9Gy8ueg== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.17.10": + version "7.17.10" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.10.tgz#873b16db82a8909e0fbd7f115772f4b739f6ce78" + integrity sha512-n2Q6i+fnJqzOaq2VkdXxy2TCPCWQZHiCo0XqmrCvDWcZQKRyZzYi4Z0yxlBuN0w+r2ZHmre+Q087DSrw3pbJDQ== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -301,9 +242,9 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-typescript@^7.7.2": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.7.tgz#39c9b55ee153151990fb038651d58d3fd03f98f8" - integrity sha512-YhUIJHHGkqPgEcMYkPCKTyGUdoGKWtopIycQyjJH8OjvRgOYsXsaKehLVPScKJWAULPxMa4N1vCe6szREFlZ7A== + version "7.17.10" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.17.10.tgz#80031e6042cad6a95ed753f672ebd23c30933195" + integrity sha512-xJefea1DWXW09pW4Tm9bjwVlPDyYA2it3fWlmEjpYz6alPvTUjL0EOzNzI/FEOyI3r4/J7uVH5UqKgl1TQ5hqQ== dependencies: "@babel/helper-plugin-utils" "^7.16.7" @@ -316,42 +257,26 @@ "@babel/parser" "^7.16.7" "@babel/types" "^7.16.7" -"@babel/traverse@^7.17.3", "@babel/traverse@^7.7.2": - version "7.17.3" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.17.3.tgz#0ae0f15b27d9a92ba1f2263358ea7c4e7db47b57" - integrity sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw== +"@babel/traverse@^7.17.10", "@babel/traverse@^7.17.3", "@babel/traverse@^7.17.9", "@babel/traverse@^7.7.2": + version "7.17.10" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.17.10.tgz#1ee1a5ac39f4eac844e6cf855b35520e5eb6f8b5" + integrity sha512-VmbrTHQteIdUUQNTb+zE12SHS/xQVIShmBPhlNP12hD5poF2pbITW1Z4172d03HegaQWhLffdkRJYtAzp0AGcw== dependencies: "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.17.3" - "@babel/helper-environment-visitor" "^7.16.7" - "@babel/helper-function-name" "^7.16.7" - "@babel/helper-hoist-variables" "^7.16.7" - "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/parser" "^7.17.3" - "@babel/types" "^7.17.0" - debug "^4.1.0" - globals "^11.1.0" - -"@babel/traverse@^7.17.9": - version "7.17.9" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.17.9.tgz#1f9b207435d9ae4a8ed6998b2b82300d83c37a0d" - integrity sha512-PQO8sDIJ8SIwipTPiR71kJQCKQYB5NGImbOviK8K+kg5xkNSYXLBupuX9QhatFowrsvo9Hj8WgArg3W7ijNAQw== - dependencies: - "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.17.9" + "@babel/generator" "^7.17.10" "@babel/helper-environment-visitor" "^7.16.7" "@babel/helper-function-name" "^7.17.9" "@babel/helper-hoist-variables" "^7.16.7" "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/parser" "^7.17.9" - "@babel/types" "^7.17.0" + "@babel/parser" "^7.17.10" + "@babel/types" "^7.17.10" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.16.7", "@babel/types@^7.17.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3": - version "7.17.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.17.0.tgz#a826e368bccb6b3d84acd76acad5c0d87342390b" - integrity sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw== +"@babel/types@^7.0.0", "@babel/types@^7.16.7", "@babel/types@^7.17.0", "@babel/types@^7.17.10", "@babel/types@^7.3.0", "@babel/types@^7.3.3": + version "7.17.10" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.17.10.tgz#d35d7b4467e439fcf06d195f8100e0fea7fc82c4" + integrity sha512-9O26jG0mBYfGkUYCYZRnBwbVLd1UZOICEr2Em6InB6jVfsAv1GKgwXHmrSg+WFWDmeKTA6vyTZiN8tCSM5Oo3A== dependencies: "@babel/helper-validator-identifier" "^7.16.7" to-fast-properties "^2.0.0" @@ -361,19 +286,19 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@eslint/eslintrc@^1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.2.2.tgz#4989b9e8c0216747ee7cca314ae73791bb281aae" - integrity sha512-lTVWHs7O2hjBFZunXTZYnYqtB9GakA1lnxIf+gKq2nY5gxkkNi/lQvveW6t8gFdOHTg6nG50Xs95PrLqVpcaLg== +"@eslint/eslintrc@^1.2.3": + version "1.2.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.2.3.tgz#fcaa2bcef39e13d6e9e7f6271f4cc7cae1174886" + integrity sha512-uGo44hIwoLGNyduRpjdEpovcbMdd+Nv7amtmJxnKmI8xj6yd5LncmSwDa5NgX/41lIFJtkjD6YdVfgEzPfJ5UA== dependencies: ajv "^6.12.4" debug "^4.3.2" - espree "^9.3.1" + espree "^9.3.2" globals "^13.9.0" ignore "^5.2.0" import-fresh "^3.2.1" js-yaml "^4.1.0" - minimatch "^3.0.4" + minimatch "^3.1.2" strip-json-comments "^3.1.1" "@humanwhocodes/config-array@^0.9.2": @@ -598,36 +523,41 @@ "@types/yargs" "^17.0.8" chalk "^4.0.0" +"@jridgewell/gen-mapping@^0.1.0": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996" + integrity sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w== + dependencies: + "@jridgewell/set-array" "^1.0.0" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/resolve-uri@^3.0.3": - version "3.0.5" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz#68eb521368db76d040a6315cdb24bf2483037b9c" - integrity sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew== + version "3.0.7" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz#30cd49820a962aff48c8fffc5cd760151fca61fe" + integrity sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA== -"@jridgewell/sourcemap-codec@^1.4.10": - version "1.4.11" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz#771a1d8d744eeb71b6adb35808e1a6c7b9b8c8ec" - integrity sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg== +"@jridgewell/set-array@^1.0.0": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.1.tgz#36a6acc93987adcf0ba50c66908bd0b70de8afea" + integrity sha512-Ct5MqZkLGEXTVmQYbGtx9SVqD2fqwvdubdps5D3djjAkgkKwT918VNOz65pEHFaYTeWcukmJmH5SwsA9Tn2ObQ== -"@jridgewell/trace-mapping@^0.3.0": - version "0.3.4" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.4.tgz#f6a0832dffd5b8a6aaa633b7d9f8e8e94c83a0c3" - integrity sha512-vFv9ttIedivx0ux3QSjhgtCVjPZd5l46ZOMDSCwnH1yUO2e964gO8LZGyv2QkqcgR6TnBU1v+1IFqmeoG+0UJQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" +"@jridgewell/sourcemap-codec@^1.4.10": + version "1.4.13" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz#b6461fb0c2964356c469e115f504c95ad97ab88c" + integrity sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w== -"@jridgewell/trace-mapping@^0.3.7": - version "0.3.9" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" - integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== +"@jridgewell/trace-mapping@^0.3.7", "@jridgewell/trace-mapping@^0.3.9": + version "0.3.13" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.13.tgz#dcfe3e95f224c8fe97a87a5235defec999aa92ea" + integrity sha512-o1xbKhp9qnIAoHJSWd6KlCZfqslL4valSF81H8ImioOAxluWYWOpWkpyktY2vnt4tbrX9XYaxovq6cgowaJp2w== dependencies: "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" "@sinclair/typebox@^0.23.3": - version "0.23.4" - resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.23.4.tgz#6ff93fd2585ce44f7481c9ff6af610fbb5de98a4" - integrity sha512-0/WqSvpVbCBAV1yPeko7eAczKbs78dNVAaX14quVlwOb2wxfKuXCx91h4NrEfkYK9zEnyVSW4JVI/trP3iS+Qg== + version "0.23.5" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.23.5.tgz#93f7b9f4e3285a7a9ade7557d9a8d36809cbc47d" + integrity sha512-AFBVi/iT4g20DHoujvMH1aEDn8fGJh4xsRGCP6d8RpLPMqsNPvW01Jcn0QysXTsg++/xj25NmJsGyH9xug/wKg== "@sinonjs/commons@^1.7.0": version "1.8.3" @@ -670,9 +600,9 @@ "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": - version "7.14.2" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.14.2.tgz#ffcd470bbb3f8bf30481678fb5502278ca833a43" - integrity sha512-K2waXdXBi2302XUdcHcR1jCeU0LL4TD9HRs/gk0N2Xvrht+G/BfJa4QObBQZfhMdxiCpV3COl5Nfq4uKTeTnJA== + version "7.17.1" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.17.1.tgz#1a0e73e8c28c7e832656db372b779bfd2ef37314" + integrity sha512-kVzjari1s2YVi77D3w1yuvohV2idweYXMCDzqBiVNN63TcDWrIlTVOYpqVrvbbyOE/IyzBoTKF0fdnLPEORFxA== dependencies: "@babel/types" "^7.3.0" @@ -708,9 +638,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*": - version "17.0.25" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.25.tgz#527051f3c2f77aa52e5dc74e45a3da5fb2301448" - integrity sha512-wANk6fBrUwdpY4isjWrKTufkrXdu1D2YHCot2fD/DfWxF5sMrVSA+KN7ydckvaTCh0HiqX9IVl0L5/ZoXg5M7w== + version "17.0.32" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.32.tgz#51d59d7a90ef2d0ae961791e0900cad2393a0149" + integrity sha512-eAIcfAvhf/BkHcf4pkLJ7ECpBAhh9kcxRBpip9cTiO+hf+aJrsxYxBeS6OXvOd9WqNAJmavXVpZvY1rBjNsXmw== "@types/prettier@^2.1.5": version "2.6.0" @@ -734,15 +664,15 @@ dependencies: "@types/yargs-parser" "*" -acorn-jsx@^5.3.1: +acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn@^8.7.0: - version "8.7.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf" - integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ== +acorn@^8.7.1: + version "8.7.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.1.tgz#0197122c843d1bf6d0a5e83220a788f278f63c30" + integrity sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A== ajv@^6.10.0, ajv@^6.12.4: version "6.12.6" @@ -900,15 +830,15 @@ braces@^3.0.2: dependencies: fill-range "^7.0.1" -browserslist@^4.17.5: - version "4.20.2" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.20.2.tgz#567b41508757ecd904dab4d1c646c612cd3d4f88" - integrity sha512-CQOBCqp/9pDvDbx3xfMi+86pr4KXIf2FDkTTdeuYw8OxS9t898LA1Khq57gtufFILXpfgsSx5woNgsBgvGjpsA== +browserslist@^4.20.2: + version "4.20.3" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.20.3.tgz#eb7572f49ec430e054f56d52ff0ebe9be915f8bf" + integrity sha512-NBhymBQl1zM0Y5dQT/O+xiLP9/rzOIQdKM/eMJBAq7yBgaB6krIYLGejrwVYnSHZdqjscB1SPuAjHwxjvN6Wdg== dependencies: - caniuse-lite "^1.0.30001317" - electron-to-chromium "^1.4.84" + caniuse-lite "^1.0.30001332" + electron-to-chromium "^1.4.118" escalade "^3.1.1" - node-releases "^2.0.2" + node-releases "^2.0.3" picocolors "^1.0.0" bser@2.1.1: @@ -938,10 +868,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001317: - version "1.0.30001325" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001325.tgz#2b4ad19b77aa36f61f2eaf72e636d7481d55e606" - integrity sha512-sB1bZHjseSjDtijV1Hb7PB2Zd58Kyx+n/9EotvZ4Qcz2K3d0lWB8dB4nb8wN/TsOGFq3UuAm0zQZNQ4SoR7TrQ== +caniuse-lite@^1.0.30001332: + version "1.0.30001340" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001340.tgz#029a2f8bfc025d4820fafbfaa6259fd7778340c7" + integrity sha512-jUNz+a9blQTQVu4uFcn17uAD8IDizPzQkIKh3LCJfg9BkyIqExYYdyc/ZSlWUSKb8iYiXxKsxbv4zYSvkqjrxw== chalk@^2.0.0: version "2.4.2" @@ -974,9 +904,9 @@ char-regex@^1.0.2: integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== ci-info@^3.2.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.3.0.tgz#b4ed1fb6818dea4803a55c623041f9165d2066b2" - integrity sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw== + version "3.3.1" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.3.1.tgz#58331f6f472a25fe3a50a351ae3052936c2c7f32" + integrity sha512-SXgeMX9VwDe7iFFaEWkA5AstuER9YKqy4EhHqr4DVqkwmD9rpVimkMKWHdjn30Ja45txyjhSn63lVX69eVCckg== cjs-module-lexer@^1.0.0: version "1.2.2" @@ -1086,10 +1016,10 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -electron-to-chromium@^1.4.84: - version "1.4.103" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.103.tgz#abfe376a4d70fa1e1b4b353b95df5d6dfd05da3a" - integrity sha512-c/uKWR1Z/W30Wy/sx3dkZoj4BijbXX85QKWu9jJfjho3LBAXNEGAEW3oWiGb+dotA6C6BzCTxL2/aLes7jlUeg== +electron-to-chromium@^1.4.118: + version "1.4.137" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.137.tgz#186180a45617283f1c012284458510cd99d6787f" + integrity sha512-0Rcpald12O11BUogJagX3HsCN3FE83DSqWjgXoHo5a72KUKMSfI39XBgJpgNNxS9fuGzytaFjE06kZkiVFy2qA== emittery@^0.10.2: version "0.10.2" @@ -1165,12 +1095,12 @@ eslint-visitor-keys@^3.3.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== -eslint@^8.1.0: - version "8.14.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.14.0.tgz#62741f159d9eb4a79695b28ec4989fcdec623239" - integrity sha512-3/CE4aJX7LNEiE3i6FeodHmI/38GZtWCsAtsymScmzYapx8q1nVVb+eLcLSzATmCPXw5pT4TqVs1E0OmxAd9tw== +eslint@^8.15.0: + version "8.15.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.15.0.tgz#fea1d55a7062da48d82600d2e0974c55612a11e9" + integrity sha512-GG5USZ1jhCu8HJkzGgeK8/+RGnHaNYZGrGDzUtigK3BsGESW/rs2az23XqE0WVwDxy1VRvvjSSGu5nB0Bu+6SA== dependencies: - "@eslint/eslintrc" "^1.2.2" + "@eslint/eslintrc" "^1.2.3" "@humanwhocodes/config-array" "^0.9.2" ajv "^6.10.0" chalk "^4.0.0" @@ -1181,7 +1111,7 @@ eslint@^8.1.0: eslint-scope "^7.1.1" eslint-utils "^3.0.0" eslint-visitor-keys "^3.3.0" - espree "^9.3.1" + espree "^9.3.2" esquery "^1.4.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -1197,7 +1127,7 @@ eslint@^8.1.0: json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" lodash.merge "^4.6.2" - minimatch "^3.0.4" + minimatch "^3.1.2" natural-compare "^1.4.0" optionator "^0.9.1" regexpp "^3.2.0" @@ -1206,13 +1136,13 @@ eslint@^8.1.0: text-table "^0.2.0" v8-compile-cache "^2.0.3" -espree@^9.3.1: - version "9.3.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.1.tgz#8793b4bc27ea4c778c19908e0719e7b8f4115bcd" - integrity sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ== +espree@^9.3.2: + version "9.3.2" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.2.tgz#f58f77bd334731182801ced3380a8cc859091596" + integrity sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA== dependencies: - acorn "^8.7.0" - acorn-jsx "^5.3.1" + acorn "^8.7.1" + acorn-jsx "^5.3.2" eslint-visitor-keys "^3.3.0" esprima@^4.0.0: @@ -1419,9 +1349,9 @@ globals@^11.1.0: integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== globals@^13.6.0, globals@^13.9.0: - version "13.13.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.13.0.tgz#ac32261060d8070e2719dd6998406e27d2b5727b" - integrity sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A== + version "13.15.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.15.0.tgz#38113218c907d2f7e98658af246cef8b77e90bac" + integrity sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog== dependencies: type-fest "^0.20.2" @@ -1462,10 +1392,10 @@ human-signals@^2.1.0: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== -husky@^7.0.0: - version "7.0.4" - resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.4.tgz#242048245dc49c8fb1bf0cc7cfb98dd722531535" - integrity sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ== +husky@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.1.tgz#511cb3e57de3e3190514ae49ed50f6bc3f50b3e9" + integrity sha512-xs7/chUH/CKdOCs7Zy0Aev9e/dKOMZf3K1Az1nar3tzlv0jfqnYtu235bstsWTmXOR0EfINrPa97yy4Lz6RiKw== ignore@^5.1.4, ignore@^5.2.0: version "5.2.0" @@ -1512,9 +1442,9 @@ is-arrayish@^0.2.1: integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= is-core-module@^2.8.1: - version "2.8.1" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.1.tgz#f59fdfca701d5879d0a6b100a40aa1560ce27211" - integrity sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA== + version "2.9.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.9.0.tgz#e1c34429cd51c6dd9e09e0799e396e27b19a9c69" + integrity sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A== dependencies: has "^1.0.3" @@ -1561,9 +1491,9 @@ istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.1.0.tgz#7b49198b657b27a730b8e9cb601f1e1bff24c59a" - integrity sha512-czwUz525rkOFDJxfKK6mYfIs9zBKILyrZQxjz3ABhjQXhbhFsSbo1HW/BFcsDnfJYJWA6thRR5/TUY2qs5W99Q== + version "5.2.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.0.tgz#31d18bdd127f825dd02ea7bfdfd906f8ab840e9f" + integrity sha512-6Lthe1hqXHBNsqvgDzGO6l03XNeu3CrG4RqQ1KM9+l5+jNGpEJfIELx1NS3SEHmJQA8np/u+E4EPRKRiu6m19A== dependencies: "@babel/core" "^7.12.3" "@babel/parser" "^7.14.7" @@ -1994,7 +1924,7 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= -json5@^2.1.2, json5@^2.2.1: +json5@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== @@ -2073,7 +2003,7 @@ mimic-fn@^2.1.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== -minimatch@^3.0.4: +minimatch@^3.0.4, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -2111,10 +2041,10 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= -node-releases@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.2.tgz#7139fe71e2f4f11b47d4d2986aaf8c48699e0c01" - integrity sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg== +node-releases@^2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.4.tgz#f38252370c43854dc48aa431c766c6c398f40476" + integrity sha512-gbMzqQtTtDz/00jQzZ21PQzdI9PyLYqUSvD0p3naOhX4odFji0ZxYdnVwPTxmSwkmxhcFImpozceidSG+AgoPQ== normalize-path@^3.0.0: version "3.0.0" @@ -2286,9 +2216,9 @@ punycode@^2.1.0: integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== react-is@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.0.0.tgz#026f6c4a27dbe33bf4a35655b9e1327c4e55e3f5" - integrity sha512-yUcBYdBBbo3QiPsgYDcfQcIkGZHfxOaoE6HLSnr1sPzMhdyxusbfKOSUbSd/ocGi32dxcj366PsTj+5oggeKKw== + version "18.1.0" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.1.0.tgz#61aaed3096d30eacf2a2127118b5b41387d32a67" + integrity sha512-Fl7FuabXsJnV5Q1qIOQwx/sagGF18kogb4gpfcG4gjLBWO0WDiiz1ko/ExayuxE7InyQkBLkxRFG5oxY6Uu3Kg== regexpp@^3.2.0: version "3.2.0" @@ -2390,11 +2320,6 @@ source-map-support@0.5.13: buffer-from "^1.0.0" source-map "^0.6.0" -source-map@^0.5.0: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= - source-map@^0.6.0, source-map@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" @@ -2629,9 +2554,9 @@ yargs-parser@^21.0.0: integrity sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg== yargs@^17.3.1: - version "17.4.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.4.1.tgz#ebe23284207bb75cee7c408c33e722bfb27b5284" - integrity sha512-WSZD9jgobAg3ZKuCQZSa3g9QOJeCCqLoLAykiWgmXnDo9EPnn4RPf5qVTtzgOx66o6/oqhcA5tHtJXpG8pMt3g== + version "17.5.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.5.0.tgz#2706c5431f8c119002a2b106fc9f58b9bb9097a3" + integrity sha512-3sLxVhbAB5OC8qvVRebCLWuouhwh/rswsiDYx3WGxajUk/l4G20SKfrKKFeNIHboUFt2JFgv2yfn+5cgOr/t5A== dependencies: cliui "^7.0.2" escalade "^3.1.1" From 7bed720f8f05f2be2c4abb4cec9758b3fbc71e2f Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 12 May 2022 10:13:26 -0400 Subject: [PATCH 606/785] Support passing rubyPlugins options --- .github/workflows/main.yml | 8 ++++---- README.md | 11 ++++++----- src/parseSync.js | 20 ++++++++++++-------- src/plugin.js | 21 +++++++++++++++------ src/server.rb | 5 +++++ test/js/globalSetup.js | 2 +- 6 files changed, 43 insertions(+), 24 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 35027e8e..bcc38d69 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,7 @@ jobs: ruby-version: ${{ matrix.ruby }} - uses: actions/setup-node@v2 with: - node-version: 12.x + node-version: 16.x cache: yarn - run: yarn install --frozen-lockfile - run: yarn test @@ -46,7 +46,7 @@ jobs: ruby-version: "3.0" - uses: actions/setup-node@v2 with: - node-version: 12.x + node-version: 16.x cache: yarn - run: yarn install --frozen-lockfile - run: yarn checkFormat @@ -76,7 +76,7 @@ jobs: - run: gem install syntax_tree syntax_tree-haml syntax_tree-rbs - uses: actions/setup-node@v2 with: - node-version: 12.x + node-version: 16.x cache: yarn - run: yarn install --frozen-lockfile - run: yarn pack @@ -108,7 +108,7 @@ jobs: ruby-version: "3.1" - uses: actions/setup-node@v2 with: - node-version: 12.x + node-version: 16.x cache: yarn - run: yarn install --frozen-lockfile - run: gem build -o prettier.gem diff --git a/README.md b/README.md index 5f6abff4..a9d1f73a 100644 --- a/README.md +++ b/README.md @@ -134,11 +134,12 @@ The `prettier` executable is now installed and ready for use: Below are the options (from [`src/plugin.js`](src/plugin.js)) that `@prettier/plugin-ruby` currently supports: -| API Option | CLI Option | Default | Description | -| --------------- | ------------------ | :-----: | --------------------------------------------------------------------------------------------------- | -| `printWidth` | `--print-width` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)). | -| `requirePragma` | `--require-pragma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#require-pragma)). | -| `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). | +| API Option | CLI Option | Default | Description | +| --------------- | ------------------ | :-----: | --------------------------------------------------------------------------------------------------------------------------- | +| `printWidth` | `--print-width` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)). | +| `requirePragma` | `--require-pragma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#require-pragma)). | +| `rubyPlugins` | `--ruby-plugins` | `""` | The comma-separated list of plugins to require. See [Syntax Tree](https://github.com/ruby-syntax-tree/syntax_tree#plugins). | +| `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). | Any of these can be added to your existing [prettier configuration file](https://prettier.io/docs/en/configuration.html). For example: diff --git a/src/parseSync.js b/src/parseSync.js index 9b2d08dc..343ef151 100644 --- a/src/parseSync.js +++ b/src/parseSync.js @@ -63,7 +63,7 @@ function getInfoFilepath() { // server with that filepath as an argument, then spawn another process that // will read that information in order to enable us to connect to it in the // spawnSync function. -function spawnServer() { +function spawnServer(opts) { const tempDir = mkdtempSync(path.join(os.tmpdir(), "prettier-plugin-ruby-")); const filepath = getInfoFilepath(); @@ -114,11 +114,15 @@ function spawnServer() { }; } - const server = spawn("ruby", [serverRbPath, filepath], { - env: Object.assign({}, process.env, { LANG: getLang() }), - detached: true, - stdio: "inherit" - }); + const server = spawn( + "ruby", + [serverRbPath, `--plugins=${opts.rubyPlugins}`, filepath], + { + env: Object.assign({}, process.env, { LANG: getLang() }), + detached: true, + stdio: "inherit" + } + ); server.unref(); process.on("exit", () => { @@ -171,9 +175,9 @@ function runningInPnPZip() { // like it) here since Prettier requires the results of `parse` to be // synchronous and Node.js does not offer a mechanism for synchronous socket // requests. -function parseSync(parser, source) { +function parseSync(parser, source, opts) { if (!parserArgs) { - parserArgs = spawnServer(); + parserArgs = spawnServer(opts); } const response = spawnSync(parserArgs.cmd, parserArgs.args, { diff --git a/src/plugin.js b/src/plugin.js index 5d37ef8b..9dcda0d3 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -81,8 +81,8 @@ const plugin = { ], parsers: { ruby: { - parse(text) { - return parseSync("ruby", text); + parse(text, _parsers, opts) { + return parseSync("ruby", text, opts); }, astFormat: "ruby", hasPragma(text) { @@ -96,8 +96,8 @@ const plugin = { } }, rbs: { - parse(text) { - return parseSync("rbs", text); + parse(text, _parsers, opts) { + return parseSync("rbs", text, opts); }, astFormat: "rbs", hasPragma(text) { @@ -111,8 +111,8 @@ const plugin = { } }, haml: { - parse(text) { - return parseSync("haml", text); + parse(text, _parsers, opts) { + return parseSync("haml", text, opts); }, astFormat: "haml", hasPragma(text) { @@ -152,6 +152,15 @@ const plugin = { } } }, + options: { + rubyPlugins: { + type: "string", + category: "Ruby", + default: "", + description: "The comma-separated list of plugins to require", + since: "3.1.0" + } + }, defaultOptions: { printWidth: 80, tabWidth: 2 diff --git a/src/server.rb b/src/server.rb index 8da4c065..78eab145 100644 --- a/src/server.rb +++ b/src/server.rb @@ -10,6 +10,11 @@ require "syntax_tree/haml" require "syntax_tree/rbs" +# First, require all of the plugins that the user specified. +ARGV.shift[/^--plugins=(.*)$/, 1] + .split(",") + .each { |plugin| require "syntax_tree/#{plugin}" } + # Make sure we trap these signals to be sure we get the quit command coming from # the parent node process quit = false diff --git a/test/js/globalSetup.js b/test/js/globalSetup.js index 8af21f27..6e316c5b 100644 --- a/test/js/globalSetup.js +++ b/test/js/globalSetup.js @@ -17,7 +17,7 @@ function globalSetup() { const filepath = getInfoFilepath(); const server = spawn( "ruby", - [path.join(__dirname, "../../src/server.rb"), filepath], + [path.join(__dirname, "../../src/server.rb"), "--plugins=", filepath], { env: Object.assign({}, process.env, { LANG: getLang() }), detached: true, From cf7659f1e4680eb8febb4b2cdd15f5652502caef Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 12 May 2022 10:27:20 -0400 Subject: [PATCH 607/785] Bump to v3.1.0 --- CHANGELOG.md | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3167848e..4a1f13e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [3.1.0] - 2022-05-12 + +### Added + +- [#1224](https://github.com/prettier/plugin-ruby/pull/1224) - kddnewton - Support passing the `rubyPlugins` option to configure Syntax Tree. + ## [3.0.0] - 2022-05-04 ### Added diff --git a/package.json b/package.json index 99cf5779..9a1cd976 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "3.0.0", + "version": "3.1.0", "description": "prettier plugin for the Ruby programming language", "main": "src/plugin.js", "scripts": { From 815e9bb5c169dfee46c3e6188a0b60c775cd4d02 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 12 May 2022 10:30:56 -0400 Subject: [PATCH 608/785] Update rubocop config --- CHANGELOG.md | 6 ++++++ package.json | 2 +- rubocop.yml | 34 +++++++++++++++++++++++++++------- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a1f13e3..f52d9dcb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [3.1.1] - 2022-05-12 + +### Changed + +- [#1125](https://github.com/prettier/plugin-ruby/pull/1225) - kddnewton - Update the bundled rubocop config to be in sync with Syntax Tree. + ## [3.1.0] - 2022-05-12 ### Added diff --git a/package.json b/package.json index 9a1cd976..cec00fbb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "3.1.0", + "version": "3.1.1", "description": "prettier plugin for the Ruby programming language", "main": "src/plugin.js", "scripts": { diff --git a/rubocop.yml b/rubocop.yml index db663ad0..eff5aede 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -1,6 +1,5 @@ # Disabling all Layout/* rules, as they're unnecessary when the user is using -# prettier to handle all of the formatting. - +# Syntax Tree to handle all of the formatting. Layout: Enabled: false @@ -16,6 +15,16 @@ Layout/LineLength: Style/MultilineIfModifier: Enabled: false +# Syntax Tree will expand empty methods to put the end keyword on the subsequent +# line to reduce git diff noise. +Style/EmptyMethod: + EnforcedStyle: expanded + +# lambdas that are constructed with the lambda method call cannot be safely +# turned into lambda literals without removing a method call. +Style/Lambda: + Enabled: false + # When method chains with multiple blocks are chained together, rubocop will let # them pass if they're using braces but not if they're using do and end # keywords. Because we will break individual blocks down to using keywords if @@ -23,12 +32,28 @@ Style/MultilineIfModifier: Style/MultilineBlockChain: Enabled: false +# Syntax Tree by default uses double quotes, so changing the configuration here +# to match that. +Style/StringLiterals: + EnforcedStyle: double_quotes + +Style/StringLiteralsInInterpolation: + EnforcedStyle: double_quotes + +Style/QuotedSymbols: + EnforcedStyle: double_quotes + +# We let users have a little more freedom with symbol and words arrays. If the +# user only has an individual item like ["value"] then we don't bother +# converting it because it ends up being just noise. Style/SymbolArray: Enabled: false Style/WordArray: Enabled: false +# We don't support trailing commas in Syntax Tree by default, so just turning +# these off for now. Style/TrailingCommaInArguments: Enabled: false @@ -37,8 +62,3 @@ Style/TrailingCommaInArrayLiteral: Style/TrailingCommaInHashLiteral: Enabled: false - -# lambdas that are constructed with the lambda method call cannot be safely -# turned into lambda literals without removing a method call. -Style/Lambda: - Enabled: false From 02a2294d5d7ce2455644e1b3ebc84d2f6f77a539 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 12 May 2022 10:54:36 -0400 Subject: [PATCH 609/785] Document minimum ruby version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a9d1f73a..def987cf 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ end ## Getting started -To run `prettier` with the Ruby plugin, you're going to need [`ruby`](https://www.ruby-lang.org/en/documentation/installation/) (version `2.5` or newer) and [`node`](https://nodejs.org/en/download/) (version `8.3` or newer). If you're integrating with a project that is not already using `prettier`, you should use the Ruby gem. Otherwise you can use the `npm` package directly. +To run `prettier` with the Ruby plugin, you're going to need [`ruby`](https://www.ruby-lang.org/en/documentation/installation/) (version `2.7.3` or newer) and [`node`](https://nodejs.org/en/download/) (version `8.3` or newer). If you're integrating with a project that is not already using `prettier`, you should use the Ruby gem. Otherwise you can use the `npm` package directly. Note that currently the editor integrations work best with the `npm` package, as most of the major editor plugins expect a `node_modules` directory. You can get them to work with the Ruby gem, but it requires manually configuring the paths. From 38f62b7cb6d41e2d9ae23d8fe33c320dcc9ecf41 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 13 May 2022 22:16:28 -0400 Subject: [PATCH 610/785] Pass printwidth through to server --- README.md | 2 +- src/parseSync.js | 2 +- src/server.rb | 19 +++++++++++++++---- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index def987cf..23869966 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,7 @@ yarn add --dev prettier @prettier/plugin-ruby You'll also need to add the necessary Ruby dependencies. You can do this by running: ```bash -gem install bundler syntax_tree syntax_tree-haml syntax_tree-rbs +gem install bundler prettier_print syntax_tree syntax_tree-haml syntax_tree-rbs ``` The `prettier` executable is now installed and ready for use: diff --git a/src/parseSync.js b/src/parseSync.js index 343ef151..c39467bf 100644 --- a/src/parseSync.js +++ b/src/parseSync.js @@ -181,7 +181,7 @@ function parseSync(parser, source, opts) { } const response = spawnSync(parserArgs.cmd, parserArgs.args, { - input: `${parser}|${source}`, + input: `${parser}|${opts.printWidth}|${source}`, maxBuffer: 15 * 1024 * 1024 }); diff --git a/src/server.rb b/src/server.rb index 78eab145..ab4496b6 100644 --- a/src/server.rb +++ b/src/server.rb @@ -6,6 +6,7 @@ require "fileutils" require "open3" +require "prettier_print" require "syntax_tree" require "syntax_tree/haml" require "syntax_tree/rbs" @@ -73,7 +74,8 @@ # Start up a new thread that will handle each successive connection. Thread.new(server.accept_nonblock) do |socket| - parser, source = socket.read.force_encoding("UTF-8").split("|", 2) + parser, width, source = + socket.read.force_encoding("UTF-8").split("|", 3) source.each_line do |line| case line @@ -90,16 +92,25 @@ end end + maxwidth = width.to_i response = case parser when "ping" "pong" when "ruby" - SyntaxTree.format(source) + formatter = SyntaxTree::Formatter.new(source, [], maxwidth) + SyntaxTree.parse(source).format(formatter) + formatter.flush + formatter.output.join when "rbs" - SyntaxTree::RBS.format(source) + formatter = SyntaxTree::RBS::Formatter.new(source, [], maxwidth) + SyntaxTree::RBS.parse(source).format(formatter) + formatter.flush + formatter.output.join when "haml" - SyntaxTree::Haml.format(source) + PrettierPrint.format(+"", maxwidth) do |q| + SyntaxTree::Haml.parse(source).format(q) + end end if response From cbdc6083e2afe812dab6230a7202ef4e171df239 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 13 May 2022 22:34:33 -0400 Subject: [PATCH 611/785] Bump to v3.1.2 --- CHANGELOG.md | 11 ++++++++++- package.json | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f52d9dcb..218eca5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [3.1.2] - 2022-05-13 + +### Changed + +- [#1127](https://github.com/prettier/plugin-ruby/issues/1227) - mscrivo, kddnewton - Support passing the `printWidth` option. + ## [3.1.1] - 2022-05-12 ### Changed @@ -1237,7 +1243,10 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v3.0.0...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v3.1.2...HEAD +[3.1.2]: https://github.com/prettier/plugin-ruby/compare/v3.1.1...v3.1.2 +[3.1.1]: https://github.com/prettier/plugin-ruby/compare/v3.1.0...v3.1.1 +[3.1.0]: https://github.com/prettier/plugin-ruby/compare/v3.0.0...v3.1.0 [3.0.0]: https://github.com/prettier/plugin-ruby/compare/v2.1.0...v3.0.0 [2.1.0]: https://github.com/prettier/plugin-ruby/compare/v2.0.0...v2.1.0 [2.0.0]: https://github.com/prettier/plugin-ruby/compare/v2.0.0-rc4...v2.0.0 diff --git a/package.json b/package.json index cec00fbb..b9a37b9e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "3.1.1", + "version": "3.1.2", "description": "prettier plugin for the Ruby programming language", "main": "src/plugin.js", "scripts": { From 73b4f0e0b249eae700a5f883bc3ca053c00b0ac4 Mon Sep 17 00:00:00 2001 From: Boris Petrov Date: Thu, 26 May 2022 09:03:44 +0300 Subject: [PATCH 612/785] Disable the single- vs double-quotes rules in `rubocop.yml` --- rubocop.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rubocop.yml b/rubocop.yml index eff5aede..64316d0c 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -32,16 +32,16 @@ Style/Lambda: Style/MultilineBlockChain: Enabled: false -# Syntax Tree by default uses double quotes, so changing the configuration here -# to match that. +# Disable the single- vs double-quotes rules as these depend on whether the user +# has added or not `plugin/single_quotes` for `syntax_tree` Style/StringLiterals: - EnforcedStyle: double_quotes + Enabled: false Style/StringLiteralsInInterpolation: - EnforcedStyle: double_quotes + Enabled: false Style/QuotedSymbols: - EnforcedStyle: double_quotes + Enabled: false # We let users have a little more freedom with symbol and words arrays. If the # user only has an individual item like ["value"] then we don't bother @@ -52,8 +52,8 @@ Style/SymbolArray: Style/WordArray: Enabled: false -# We don't support trailing commas in Syntax Tree by default, so just turning -# these off for now. +# Disable the trailing-comma rules as these depend on whether the user has added +# or not `plugin/trailing_comma` for `syntax_tree` Style/TrailingCommaInArguments: Enabled: false From 2e1413090ea072c1ad47de4ec7a106d74fa1ce81 Mon Sep 17 00:00:00 2001 From: Ryan Seys Date: Tue, 31 May 2022 13:36:21 -0700 Subject: [PATCH 613/785] Fix some tests failing on main --- test/js/ruby/nodes/patterns.test.js | 109 ++++++++++++++++++++++++++-- test/js/ruby/nodes/strings.test.js | 4 +- 2 files changed, 104 insertions(+), 9 deletions(-) diff --git a/test/js/ruby/nodes/patterns.test.js b/test/js/ruby/nodes/patterns.test.js index 74fbc04d..6e5117fc 100644 --- a/test/js/ruby/nodes/patterns.test.js +++ b/test/js/ruby/nodes/patterns.test.js @@ -15,18 +15,13 @@ describe("patterns", () => { "-1..1", "Integer", "bar", - "_, _", "0 | 1 | 2", "Integer => bar", "Object[0, *bar, 1]", - "a, b, *c, d, e", - "*c, d, e", - "0, [1, _] => bar", "^bar", "{ x: 0.. => px, **rest }", "**rest", - "SuperPoint[x: 0.. => px]", - "a, b if b == a * 2" + "SuperPoint[x: 0.. => px]" ]; if (atLeastVersion("3.0")) { @@ -56,6 +51,96 @@ describe("patterns", () => { expect(content).toMatchFormat(); }); + test("a, b, *c, d, e", () => { + const content = ruby(` + case foo + in a, b, *c, d, e + baz + end + `); + + const expectedContent = ruby(` + case foo + in [a, b, *c, d, e] + baz + end + `); + + expect(content).toChangeFormat(expectedContent); + }); + + test("0, [1, _] => bar", () => { + const content = ruby(` + case foo + in 0, [1, _] => bar + baz + end + `); + + const expectedContent = ruby(` + case foo + in [0, [1, _] => bar] + baz + end + `); + + expect(content).toChangeFormat(expectedContent); + }); + + test("*c, d, e", () => { + const content = ruby(` + case foo + in *c, d, e + baz + end + `); + + const expectedContent = ruby(` + case foo + in [*c, d, e] + baz + end + `); + + expect(content).toChangeFormat(expectedContent); + }); + + test("_, _", () => { + const content = ruby(` + case foo + in _, _ + baz + end + `); + + const expectedContent = ruby(` + case foo + in [_, _] + baz + end + `); + + expect(content).toChangeFormat(expectedContent); + }); + + test("a, b if b == a * 2", () => { + const content = ruby(` + case foo + in a, b if b == a * 2 + baz + end + `); + + const expectedContent = ruby(` + case foo + in [a, b] if b == a * 2 + baz + end + `); + + expect(content).toChangeFormat(expectedContent); + }); + test("with a single array element", () => { const content = ruby(` case value @@ -76,7 +161,17 @@ describe("patterns", () => { end `); - expect(content).toMatchFormat(); + const expectedContent = ruby(` + case foo + in [ + 1, # 1 comment + 2 + ] # 2 comment + bar + end + `); + + expect(content).toChangeFormat(expectedContent); }); test("multiple clauses", () => { diff --git a/test/js/ruby/nodes/strings.test.js b/test/js/ruby/nodes/strings.test.js index 4e0223f3..e085a62b 100644 --- a/test/js/ruby/nodes/strings.test.js +++ b/test/js/ruby/nodes/strings.test.js @@ -88,8 +88,8 @@ describe("strings", () => { expect(`"abc's"`).toMatchFormat(); }); - test("double quotes get escaped", () => { - expect(`'"foo"'`).toChangeFormat(`"\\"foo\\""`); + test("double quotes do not get escaped if it results in more quotes", () => { + expect(`'"foo"'`).toMatchFormat(); }); describe("escape sequences", () => { From eb43c9c25f40523eba07eecd8adb56418562fa5f Mon Sep 17 00:00:00 2001 From: Ryan Seys Date: Tue, 31 May 2022 14:47:52 -0700 Subject: [PATCH 614/785] Bump syntax_tree to >= 2.7.1 --- prettier.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prettier.gemspec b/prettier.gemspec index c2b45719..e5ad4985 100644 --- a/prettier.gemspec +++ b/prettier.gemspec @@ -26,7 +26,7 @@ Gem::Specification.new do |spec| spec.executables = "rbprettier" spec.require_paths = %w[lib] - spec.add_dependency "syntax_tree", ">= 2.3.1" + spec.add_dependency "syntax_tree", ">= 2.7.1" spec.add_dependency "syntax_tree-haml", ">= 1.1.0" spec.add_dependency "syntax_tree-rbs", ">= 0.2.0" From 7a6f83f59ee325ba482a70214a82e00da368a89a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Jun 2022 12:01:07 +0000 Subject: [PATCH 615/785] Bump eslint from 8.15.0 to 8.17.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.15.0 to 8.17.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.15.0...v8.17.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/yarn.lock b/yarn.lock index 10f732ad..97a3c990 100644 --- a/yarn.lock +++ b/yarn.lock @@ -286,15 +286,15 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@eslint/eslintrc@^1.2.3": - version "1.2.3" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.2.3.tgz#fcaa2bcef39e13d6e9e7f6271f4cc7cae1174886" - integrity sha512-uGo44hIwoLGNyduRpjdEpovcbMdd+Nv7amtmJxnKmI8xj6yd5LncmSwDa5NgX/41lIFJtkjD6YdVfgEzPfJ5UA== +"@eslint/eslintrc@^1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.0.tgz#29f92c30bb3e771e4a2048c95fa6855392dfac4f" + integrity sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw== dependencies: ajv "^6.12.4" debug "^4.3.2" espree "^9.3.2" - globals "^13.9.0" + globals "^13.15.0" ignore "^5.2.0" import-fresh "^3.2.1" js-yaml "^4.1.0" @@ -1096,11 +1096,11 @@ eslint-visitor-keys@^3.3.0: integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.15.0: - version "8.15.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.15.0.tgz#fea1d55a7062da48d82600d2e0974c55612a11e9" - integrity sha512-GG5USZ1jhCu8HJkzGgeK8/+RGnHaNYZGrGDzUtigK3BsGESW/rs2az23XqE0WVwDxy1VRvvjSSGu5nB0Bu+6SA== + version "8.17.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.17.0.tgz#1cfc4b6b6912f77d24b874ca1506b0fe09328c21" + integrity sha512-gq0m0BTJfci60Fz4nczYxNAlED+sMcihltndR8t9t1evnU/azx53x3t2UHXC/uRjcbvRw/XctpaNygSTcQD+Iw== dependencies: - "@eslint/eslintrc" "^1.2.3" + "@eslint/eslintrc" "^1.3.0" "@humanwhocodes/config-array" "^0.9.2" ajv "^6.10.0" chalk "^4.0.0" @@ -1118,7 +1118,7 @@ eslint@^8.15.0: file-entry-cache "^6.0.1" functional-red-black-tree "^1.0.1" glob-parent "^6.0.1" - globals "^13.6.0" + globals "^13.15.0" ignore "^5.2.0" import-fresh "^3.0.0" imurmurhash "^0.1.4" @@ -1348,7 +1348,7 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -globals@^13.6.0, globals@^13.9.0: +globals@^13.15.0: version "13.15.0" resolved "https://registry.yarnpkg.com/globals/-/globals-13.15.0.tgz#38113218c907d2f7e98658af246cef8b77e90bac" integrity sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog== From 8f67c62d078976d81e641765cda612840171faf6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Jun 2022 12:01:32 +0000 Subject: [PATCH 616/785] Bump jest from 28.1.0 to 28.1.1 Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 28.1.0 to 28.1.1. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v28.1.1/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 618 +++++++++++++++++++++++++++--------------------------- 1 file changed, 310 insertions(+), 308 deletions(-) diff --git a/yarn.lock b/yarn.lock index 97a3c990..0db50134 100644 --- a/yarn.lock +++ b/yarn.lock @@ -331,28 +331,28 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^28.1.0": - version "28.1.0" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-28.1.0.tgz#db78222c3d3b0c1db82f1b9de51094c2aaff2176" - integrity sha512-tscn3dlJFGay47kb4qVruQg/XWlmvU0xp3EJOjzzY+sBaI+YgwKcvAmTcyYU7xEiLLIY5HCdWRooAL8dqkFlDA== +"@jest/console@^28.1.1": + version "28.1.1" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-28.1.1.tgz#305f8ca50b6e70413839f54c0e002b60a0f2fd7d" + integrity sha512-0RiUocPVFEm3WRMOStIHbRWllG6iW6E3/gUPnf4lkrVFyXIIDeCe+vlKeYyFOMhB2EPE6FLFCNADSOOQMaqvyA== dependencies: - "@jest/types" "^28.1.0" + "@jest/types" "^28.1.1" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^28.1.0" - jest-util "^28.1.0" + jest-message-util "^28.1.1" + jest-util "^28.1.1" slash "^3.0.0" -"@jest/core@^28.1.0": - version "28.1.0" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-28.1.0.tgz#784a1e6ce5358b46fcbdcfbbd93b1b713ed4ea80" - integrity sha512-/2PTt0ywhjZ4NwNO4bUqD9IVJfmFVhVKGlhvSpmEfUCuxYf/3NHcKmRFI+I71lYzbTT3wMuYpETDCTHo81gC/g== +"@jest/core@^28.1.1": + version "28.1.1" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-28.1.1.tgz#086830bec6267accf9af5ca76f794858e9f9f092" + integrity sha512-3pYsBoZZ42tXMdlcFeCc/0j9kOlK7MYuXs2B1QbvDgMoW1K9NJ4G/VYvIbMb26iqlkTfPHo7SC2JgjDOk/mxXw== dependencies: - "@jest/console" "^28.1.0" - "@jest/reporters" "^28.1.0" - "@jest/test-result" "^28.1.0" - "@jest/transform" "^28.1.0" - "@jest/types" "^28.1.0" + "@jest/console" "^28.1.1" + "@jest/reporters" "^28.1.1" + "@jest/test-result" "^28.1.1" + "@jest/transform" "^28.1.1" + "@jest/types" "^28.1.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" @@ -360,80 +360,80 @@ exit "^0.1.2" graceful-fs "^4.2.9" jest-changed-files "^28.0.2" - jest-config "^28.1.0" - jest-haste-map "^28.1.0" - jest-message-util "^28.1.0" + jest-config "^28.1.1" + jest-haste-map "^28.1.1" + jest-message-util "^28.1.1" jest-regex-util "^28.0.2" - jest-resolve "^28.1.0" - jest-resolve-dependencies "^28.1.0" - jest-runner "^28.1.0" - jest-runtime "^28.1.0" - jest-snapshot "^28.1.0" - jest-util "^28.1.0" - jest-validate "^28.1.0" - jest-watcher "^28.1.0" + jest-resolve "^28.1.1" + jest-resolve-dependencies "^28.1.1" + jest-runner "^28.1.1" + jest-runtime "^28.1.1" + jest-snapshot "^28.1.1" + jest-util "^28.1.1" + jest-validate "^28.1.1" + jest-watcher "^28.1.1" micromatch "^4.0.4" - pretty-format "^28.1.0" + pretty-format "^28.1.1" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^28.1.0": - version "28.1.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-28.1.0.tgz#dedf7d59ec341b9292fcf459fd0ed819eb2e228a" - integrity sha512-S44WGSxkRngzHslhV6RoAExekfF7Qhwa6R5+IYFa81mpcj0YgdBnRSmvHe3SNwOt64yXaE5GG8Y2xM28ii5ssA== +"@jest/environment@^28.1.1": + version "28.1.1" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-28.1.1.tgz#c4cbf85283278d768f816ebd1a258ea6f9e39d4f" + integrity sha512-9auVQ2GzQ7nrU+lAr8KyY838YahElTX9HVjbQPPS2XjlxQ+na18G113OoBhyBGBtD6ZnO/SrUy5WR8EzOj1/Uw== dependencies: - "@jest/fake-timers" "^28.1.0" - "@jest/types" "^28.1.0" + "@jest/fake-timers" "^28.1.1" + "@jest/types" "^28.1.1" "@types/node" "*" - jest-mock "^28.1.0" + jest-mock "^28.1.1" -"@jest/expect-utils@^28.1.0": - version "28.1.0" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-28.1.0.tgz#a5cde811195515a9809b96748ae8bcc331a3538a" - integrity sha512-5BrG48dpC0sB80wpeIX5FU6kolDJI4K0n5BM9a5V38MGx0pyRvUBSS0u2aNTdDzmOrCjhOg8pGs6a20ivYkdmw== +"@jest/expect-utils@^28.1.1": + version "28.1.1" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-28.1.1.tgz#d84c346025b9f6f3886d02c48a6177e2b0360587" + integrity sha512-n/ghlvdhCdMI/hTcnn4qV57kQuV9OTsZzH1TTCVARANKhl6hXJqLKUkwX69ftMGpsbpt96SsDD8n8LD2d9+FRw== dependencies: jest-get-type "^28.0.2" -"@jest/expect@^28.1.0": - version "28.1.0" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-28.1.0.tgz#2e5a31db692597070932366a1602b5157f0f217c" - integrity sha512-be9ETznPLaHOmeJqzYNIXv1ADEzENuQonIoobzThOYPuK/6GhrWNIJDVTgBLCrz3Am73PyEU2urQClZp0hLTtA== +"@jest/expect@^28.1.1": + version "28.1.1" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-28.1.1.tgz#ea4fcc8504b45835029221c0dc357c622a761326" + integrity sha512-/+tQprrFoT6lfkMj4mW/mUIfAmmk/+iQPmg7mLDIFOf2lyf7EBHaS+x3RbeR0VZVMe55IvX7QRoT/2aK3AuUXg== dependencies: - expect "^28.1.0" - jest-snapshot "^28.1.0" + expect "^28.1.1" + jest-snapshot "^28.1.1" -"@jest/fake-timers@^28.1.0": - version "28.1.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-28.1.0.tgz#ea77878aabd5c5d50e1fc53e76d3226101e33064" - integrity sha512-Xqsf/6VLeAAq78+GNPzI7FZQRf5cCHj1qgQxCjws9n8rKw8r1UYoeaALwBvyuzOkpU3c1I6emeMySPa96rxtIg== +"@jest/fake-timers@^28.1.1": + version "28.1.1" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-28.1.1.tgz#47ce33296ab9d680c76076d51ddbe65ceb3337f1" + integrity sha512-BY/3+TyLs5+q87rGWrGUY5f8e8uC3LsVHS9Diz8+FV3ARXL4sNnkLlIB8dvDvRrp+LUCGM+DLqlsYubizGUjIA== dependencies: - "@jest/types" "^28.1.0" + "@jest/types" "^28.1.1" "@sinonjs/fake-timers" "^9.1.1" "@types/node" "*" - jest-message-util "^28.1.0" - jest-mock "^28.1.0" - jest-util "^28.1.0" + jest-message-util "^28.1.1" + jest-mock "^28.1.1" + jest-util "^28.1.1" -"@jest/globals@^28.1.0": - version "28.1.0" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-28.1.0.tgz#a4427d2eb11763002ff58e24de56b84ba79eb793" - integrity sha512-3m7sTg52OTQR6dPhsEQSxAvU+LOBbMivZBwOvKEZ+Rb+GyxVnXi9HKgOTYkx/S99T8yvh17U4tNNJPIEQmtwYw== +"@jest/globals@^28.1.1": + version "28.1.1" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-28.1.1.tgz#c0a7977f85e26279cc090d9adcdf82b8a34c4061" + integrity sha512-dEgl/6v7ToB4vXItdvcltJBgny0xBE6xy6IYQrPJAJggdEinGxCDMivNv7sFzPcTITGquXD6UJwYxfJ/5ZwDSg== dependencies: - "@jest/environment" "^28.1.0" - "@jest/expect" "^28.1.0" - "@jest/types" "^28.1.0" + "@jest/environment" "^28.1.1" + "@jest/expect" "^28.1.1" + "@jest/types" "^28.1.1" -"@jest/reporters@^28.1.0": - version "28.1.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-28.1.0.tgz#5183a28b9b593b6000fa9b89b031c7216b58a9a0" - integrity sha512-qxbFfqap/5QlSpIizH9c/bFCDKsQlM4uAKSOvZrP+nIdrjqre3FmKzpTtYyhsaVcOSNK7TTt2kjm+4BJIjysFA== +"@jest/reporters@^28.1.1": + version "28.1.1" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-28.1.1.tgz#9389f4bb3cce4d9b586f6195f83c79cd2a1c8662" + integrity sha512-597Zj4D4d88sZrzM4atEGLuO7SdA/YrOv9SRXHXRNC+/FwPCWxZhBAEzhXoiJzfRwn8zes/EjS8Lo6DouGN5Gg== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^28.1.0" - "@jest/test-result" "^28.1.0" - "@jest/transform" "^28.1.0" - "@jest/types" "^28.1.0" + "@jest/console" "^28.1.1" + "@jest/test-result" "^28.1.1" + "@jest/transform" "^28.1.1" + "@jest/types" "^28.1.1" "@jridgewell/trace-mapping" "^0.3.7" "@types/node" "*" chalk "^4.0.0" @@ -446,8 +446,9 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-util "^28.1.0" - jest-worker "^28.1.0" + jest-message-util "^28.1.1" + jest-util "^28.1.1" + jest-worker "^28.1.1" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" @@ -470,51 +471,51 @@ callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^28.1.0": - version "28.1.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-28.1.0.tgz#fd149dee123510dd2fcadbbf5f0020f98ad7f12c" - integrity sha512-sBBFIyoPzrZho3N+80P35A5oAkSKlGfsEFfXFWuPGBsW40UAjCkGakZhn4UQK4iQlW2vgCDMRDOob9FGKV8YoQ== +"@jest/test-result@^28.1.1": + version "28.1.1" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-28.1.1.tgz#c6f18d1bbb01aa88925dd687872a75f8414b317a" + integrity sha512-hPmkugBktqL6rRzwWAtp1JtYT4VHwv8OQ+9lE5Gymj6dHzubI/oJHMUpPOt8NrdVWSrz9S7bHjJUmv2ggFoUNQ== dependencies: - "@jest/console" "^28.1.0" - "@jest/types" "^28.1.0" + "@jest/console" "^28.1.1" + "@jest/types" "^28.1.1" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^28.1.0": - version "28.1.0" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-28.1.0.tgz#ce7294bbe986415b9a30e218c7e705e6ebf2cdf2" - integrity sha512-tZCEiVWlWNTs/2iK9yi6o3AlMfbbYgV4uuZInSVdzZ7ftpHZhCMuhvk2HLYhCZzLgPFQ9MnM1YaxMnh3TILFiQ== +"@jest/test-sequencer@^28.1.1": + version "28.1.1" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-28.1.1.tgz#f594ee2331df75000afe0d1ae3237630ecec732e" + integrity sha512-nuL+dNSVMcWB7OOtgb0EGH5AjO4UBCt68SLP08rwmC+iRhyuJWS9MtZ/MpipxFwKAlHFftbMsydXqWre8B0+XA== dependencies: - "@jest/test-result" "^28.1.0" + "@jest/test-result" "^28.1.1" graceful-fs "^4.2.9" - jest-haste-map "^28.1.0" + jest-haste-map "^28.1.1" slash "^3.0.0" -"@jest/transform@^28.1.0": - version "28.1.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-28.1.0.tgz#224a3c9ba4cc98e2ff996c0a89a2d59db15c74ce" - integrity sha512-omy2xe5WxlAfqmsTjTPxw+iXRTRnf+NtX0ToG+4S0tABeb4KsKmPUHq5UBuwunHg3tJRwgEQhEp0M/8oiatLEA== +"@jest/transform@^28.1.1": + version "28.1.1" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-28.1.1.tgz#83541f2a3f612077c8501f49cc4e205d4e4a6b27" + integrity sha512-PkfaTUuvjUarl1EDr5ZQcCA++oXkFCP9QFUkG0yVKVmNObjhrqDy0kbMpMebfHWm3CCDHjYNem9eUSH8suVNHQ== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^28.1.0" + "@jest/types" "^28.1.1" "@jridgewell/trace-mapping" "^0.3.7" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.9" - jest-haste-map "^28.1.0" + jest-haste-map "^28.1.1" jest-regex-util "^28.0.2" - jest-util "^28.1.0" + jest-util "^28.1.1" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" write-file-atomic "^4.0.1" -"@jest/types@^28.1.0": - version "28.1.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-28.1.0.tgz#508327a89976cbf9bd3e1cc74641a29fd7dfd519" - integrity sha512-xmEggMPr317MIOjjDoZ4ejCSr9Lpbt/u34+dvc99t7DS8YirW5rwZEhzKPC2BMUFkUhI48qs6qLUSGw5FuL0GA== +"@jest/types@^28.1.1": + version "28.1.1" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-28.1.1.tgz#d059bbc80e6da6eda9f081f293299348bd78ee0b" + integrity sha512-vRXVqSg1VhDnB8bWcmvLzmg0Bt9CRKVgHPXqYwvWMX3TvAjeO+nRuK6+VdTKCtWOvYlmkF/HqNAL/z+N3B53Kw== dependencies: "@jest/schemas" "^28.0.2" "@types/istanbul-lib-coverage" "^2.0.0" @@ -750,15 +751,15 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^28.1.0: - version "28.1.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-28.1.0.tgz#95a67f8e2e7c0042e7b3ad3951b8af41a533b5ea" - integrity sha512-zNKk0yhDZ6QUwfxh9k07GII6siNGMJWVUU49gmFj5gfdqDKLqa2RArXOF2CODp4Dr7dLxN2cvAV+667dGJ4b4w== +babel-jest@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-28.1.1.tgz#2a3a4ae50964695b2d694ccffe4bec537c5a3586" + integrity sha512-MEt0263viUdAkTq5D7upHPNxvt4n9uLUGa6pPz3WviNBMtOmStb1lIXS3QobnoqM+qnH+vr4EKlvhe8QcmxIYw== dependencies: - "@jest/transform" "^28.1.0" + "@jest/transform" "^28.1.1" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^28.0.2" + babel-preset-jest "^28.1.1" chalk "^4.0.0" graceful-fs "^4.2.9" slash "^3.0.0" @@ -774,10 +775,10 @@ babel-plugin-istanbul@^6.1.1: istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-28.0.2.tgz#9307d03a633be6fc4b1a6bc5c3a87e22bd01dd3b" - integrity sha512-Kizhn/ZL+68ZQHxSnHyuvJv8IchXD62KQxV77TBDV/xoBFBOfgRAk97GNs6hXdTTCiVES9nB2I6+7MXXrk5llQ== +babel-plugin-jest-hoist@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-28.1.1.tgz#5e055cdcc47894f28341f87f5e35aad2df680b11" + integrity sha512-NovGCy5Hn25uMJSAU8FaHqzs13cFoOI4lhIujiepssjCKRsAo3TA734RDWSGxuFTsUJXerYOqQQodlxgmtqbzw== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -802,12 +803,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-28.0.2.tgz#d8210fe4e46c1017e9fa13d7794b166e93aa9f89" - integrity sha512-sYzXIdgIXXroJTFeB3S6sNDWtlJ2dllCdTEsnZ65ACrMojj3hVNFRmnJ1HZtomGi+Be7aqpY/HJ92fr8OhKVkQ== +babel-preset-jest@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-28.1.1.tgz#5b6e5e69f963eb2d70f739c607b8f723c0ee75e4" + integrity sha512-FCq9Oud0ReTeWtcneYf/48981aTfXYuB9gbU4rBNNJVBSQ6ssv7E6v/qvbBxtOWwZFXjLZwpg+W3q7J6vhH25g== dependencies: - babel-plugin-jest-hoist "^28.0.2" + babel-plugin-jest-hoist "^28.1.1" babel-preset-current-node-syntax "^1.0.0" balanced-match@^1.0.0: @@ -1004,10 +1005,10 @@ detect-newline@^3.0.0: resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== -diff-sequences@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-28.0.2.tgz#40f8d4ffa081acbd8902ba35c798458d0ff1af41" - integrity sha512-YtEoNynLDFCRznv/XDalsKGSZDoj0U5kLnXvY0JSq3nBboRrZXjD81+eSiwi+nzcZDwedMmcowcxNwwgFW23mQ== +diff-sequences@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-28.1.1.tgz#9989dc731266dc2903457a70e996f3a041913ac6" + integrity sha512-FU0iFaH/E23a+a718l8Qa/19bF9p06kgE0KipMOMadwa3SjnaElKzPaUC0vnibs6/B/9ni97s61mcejk8W1fQw== doctrine@^3.0.0: version "3.0.0" @@ -1209,16 +1210,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^28.1.0: - version "28.1.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-28.1.0.tgz#10e8da64c0850eb8c39a480199f14537f46e8360" - integrity sha512-qFXKl8Pmxk8TBGfaFKRtcQjfXEnKAs+dmlxdwvukJZorwrAabT7M3h8oLOG01I2utEhkmUTi17CHaPBovZsKdw== +expect@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-28.1.1.tgz#ca6fff65f6517cf7220c2e805a49c19aea30b420" + integrity sha512-/AANEwGL0tWBwzLNOvO0yUdy2D52jVdNXppOqswC49sxMN2cPWsGCQdzuIf9tj6hHoBQzNvx75JUYuQAckPo3w== dependencies: - "@jest/expect-utils" "^28.1.0" + "@jest/expect-utils" "^28.1.1" jest-get-type "^28.0.2" - jest-matcher-utils "^28.1.0" - jest-message-util "^28.1.0" - jest-util "^28.1.0" + jest-matcher-utils "^28.1.1" + jest-message-util "^28.1.1" + jest-util "^28.1.1" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1535,180 +1536,180 @@ jest-changed-files@^28.0.2: execa "^5.0.0" throat "^6.0.1" -jest-circus@^28.1.0: - version "28.1.0" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-28.1.0.tgz#e229f590911bd54d60efaf076f7acd9360296dae" - integrity sha512-rNYfqfLC0L0zQKRKsg4n4J+W1A2fbyGH7Ss/kDIocp9KXD9iaL111glsLu7+Z7FHuZxwzInMDXq+N1ZIBkI/TQ== +jest-circus@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-28.1.1.tgz#3d27da6a974d85a466dc0cdc6ddeb58daaa57bb4" + integrity sha512-75+BBVTsL4+p2w198DQpCeyh1RdaS2lhEG87HkaFX/UG0gJExVq2skG2pT7XZEGBubNj2CytcWSPan4QEPNosw== dependencies: - "@jest/environment" "^28.1.0" - "@jest/expect" "^28.1.0" - "@jest/test-result" "^28.1.0" - "@jest/types" "^28.1.0" + "@jest/environment" "^28.1.1" + "@jest/expect" "^28.1.1" + "@jest/test-result" "^28.1.1" + "@jest/types" "^28.1.1" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" is-generator-fn "^2.0.0" - jest-each "^28.1.0" - jest-matcher-utils "^28.1.0" - jest-message-util "^28.1.0" - jest-runtime "^28.1.0" - jest-snapshot "^28.1.0" - jest-util "^28.1.0" - pretty-format "^28.1.0" + jest-each "^28.1.1" + jest-matcher-utils "^28.1.1" + jest-message-util "^28.1.1" + jest-runtime "^28.1.1" + jest-snapshot "^28.1.1" + jest-util "^28.1.1" + pretty-format "^28.1.1" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^28.1.0: - version "28.1.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-28.1.0.tgz#cd1d8adb9630102d5ba04a22895f63decdd7ac1f" - integrity sha512-fDJRt6WPRriHrBsvvgb93OxgajHHsJbk4jZxiPqmZbMDRcHskfJBBfTyjFko0jjfprP544hOktdSi9HVgl4VUQ== +jest-cli@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-28.1.1.tgz#23ddfde8940e1818585ae4a568877b33b0e51cfe" + integrity sha512-+sUfVbJqb1OjBZ0OdBbI6OWfYM1i7bSfzYy6gze1F1w3OKWq8ZTEKkZ8a7ZQPq6G/G1qMh/uKqpdWhgl11NFQQ== dependencies: - "@jest/core" "^28.1.0" - "@jest/test-result" "^28.1.0" - "@jest/types" "^28.1.0" + "@jest/core" "^28.1.1" + "@jest/test-result" "^28.1.1" + "@jest/types" "^28.1.1" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^28.1.0" - jest-util "^28.1.0" - jest-validate "^28.1.0" + jest-config "^28.1.1" + jest-util "^28.1.1" + jest-validate "^28.1.1" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^28.1.0: - version "28.1.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-28.1.0.tgz#fca22ca0760e746fe1ce1f9406f6b307ab818501" - integrity sha512-aOV80E9LeWrmflp7hfZNn/zGA4QKv/xsn2w8QCBP0t0+YqObuCWTSgNbHJ0j9YsTuCO08ZR/wsvlxqqHX20iUA== +jest-config@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-28.1.1.tgz#e90b97b984f14a6c24a221859e81b258990fce2f" + integrity sha512-tASynMhS+jVV85zKvjfbJ8nUyJS/jUSYZ5KQxLUN2ZCvcQc/OmhQl2j6VEL3ezQkNofxn5pQ3SPYWPHb0unTZA== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^28.1.0" - "@jest/types" "^28.1.0" - babel-jest "^28.1.0" + "@jest/test-sequencer" "^28.1.1" + "@jest/types" "^28.1.1" + babel-jest "^28.1.1" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^28.1.0" - jest-environment-node "^28.1.0" + jest-circus "^28.1.1" + jest-environment-node "^28.1.1" jest-get-type "^28.0.2" jest-regex-util "^28.0.2" - jest-resolve "^28.1.0" - jest-runner "^28.1.0" - jest-util "^28.1.0" - jest-validate "^28.1.0" + jest-resolve "^28.1.1" + jest-runner "^28.1.1" + jest-util "^28.1.1" + jest-validate "^28.1.1" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^28.1.0" + pretty-format "^28.1.1" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^28.1.0: - version "28.1.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-28.1.0.tgz#77686fef899ec1873dbfbf9330e37dd429703269" - integrity sha512-8eFd3U3OkIKRtlasXfiAQfbovgFgRDb0Ngcs2E+FMeBZ4rUezqIaGjuyggJBp+llosQXNEWofk/Sz4Hr5gMUhA== +jest-diff@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-28.1.1.tgz#1a3eedfd81ae79810931c63a1d0f201b9120106c" + integrity sha512-/MUUxeR2fHbqHoMMiffe/Afm+U8U4olFRJ0hiVG2lZatPJcnGxx292ustVu7bULhjV65IYMxRdploAKLbcrsyg== dependencies: chalk "^4.0.0" - diff-sequences "^28.0.2" + diff-sequences "^28.1.1" jest-get-type "^28.0.2" - pretty-format "^28.1.0" + pretty-format "^28.1.1" -jest-docblock@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-28.0.2.tgz#3cab8abea53275c9d670cdca814fc89fba1298c2" - integrity sha512-FH10WWw5NxLoeSdQlJwu+MTiv60aXV/t8KEwIRGEv74WARE1cXIqh1vGdy2CraHuWOOrnzTWj/azQKqW4fO7xg== +jest-docblock@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-28.1.1.tgz#6f515c3bf841516d82ecd57a62eed9204c2f42a8" + integrity sha512-3wayBVNiOYx0cwAbl9rwm5kKFP8yHH3d/fkEaL02NPTkDojPtheGB7HZSFY4wzX+DxyrvhXz0KSCVksmCknCuA== dependencies: detect-newline "^3.0.0" -jest-each@^28.1.0: - version "28.1.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-28.1.0.tgz#54ae66d6a0a5b1913e9a87588d26c2687c39458b" - integrity sha512-a/XX02xF5NTspceMpHujmOexvJ4GftpYXqr6HhhmKmExtMXsyIN/fvanQlt/BcgFoRKN4OCXxLQKth9/n6OPFg== +jest-each@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-28.1.1.tgz#ba5238dacf4f31d9fe23ddc2c44c01e7c23885c4" + integrity sha512-A042rqh17ZvEhRceDMi784ppoXR7MWGDEKTXEZXb4svt0eShMZvijGxzKsx+yIjeE8QYmHPrnHiTSQVhN4nqaw== dependencies: - "@jest/types" "^28.1.0" + "@jest/types" "^28.1.1" chalk "^4.0.0" jest-get-type "^28.0.2" - jest-util "^28.1.0" - pretty-format "^28.1.0" + jest-util "^28.1.1" + pretty-format "^28.1.1" -jest-environment-node@^28.1.0: - version "28.1.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-28.1.0.tgz#6ed2150aa31babba0c488c5b4f4d813a585c68e6" - integrity sha512-gBLZNiyrPw9CSMlTXF1yJhaBgWDPVvH0Pq6bOEwGMXaYNzhzhw2kA/OijNF8egbCgDS0/veRv97249x2CX+udQ== +jest-environment-node@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-28.1.1.tgz#1c86c59003a7d319fa06ea3b1bbda6c193715c67" + integrity sha512-2aV/eeY/WNgUUJrrkDJ3cFEigjC5fqT1+fCclrY6paqJ5zVPoM//sHmfgUUp7WLYxIdbPwMiVIzejpN56MxnNA== dependencies: - "@jest/environment" "^28.1.0" - "@jest/fake-timers" "^28.1.0" - "@jest/types" "^28.1.0" + "@jest/environment" "^28.1.1" + "@jest/fake-timers" "^28.1.1" + "@jest/types" "^28.1.1" "@types/node" "*" - jest-mock "^28.1.0" - jest-util "^28.1.0" + jest-mock "^28.1.1" + jest-util "^28.1.1" jest-get-type@^28.0.2: version "28.0.2" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-28.0.2.tgz#34622e628e4fdcd793d46db8a242227901fcf203" integrity sha512-ioj2w9/DxSYHfOm5lJKCdcAmPJzQXmbM/Url3rhlghrPvT3tt+7a/+oXc9azkKmLvoiXjtV83bEWqi+vs5nlPA== -jest-haste-map@^28.1.0: - version "28.1.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-28.1.0.tgz#6c1ee2daf1c20a3e03dbd8e5b35c4d73d2349cf0" - integrity sha512-xyZ9sXV8PtKi6NCrJlmq53PyNVHzxmcfXNVvIRHpHmh1j/HChC4pwKgyjj7Z9us19JMw8PpQTJsFWOsIfT93Dw== +jest-haste-map@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-28.1.1.tgz#471685f1acd365a9394745bb97c8fc16289adca3" + integrity sha512-ZrRSE2o3Ezh7sb1KmeLEZRZ4mgufbrMwolcFHNRSjKZhpLa8TdooXOOFlSwoUzlbVs1t0l7upVRW2K7RWGHzbQ== dependencies: - "@jest/types" "^28.1.0" + "@jest/types" "^28.1.1" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" jest-regex-util "^28.0.2" - jest-util "^28.1.0" - jest-worker "^28.1.0" + jest-util "^28.1.1" + jest-worker "^28.1.1" micromatch "^4.0.4" - walker "^1.0.7" + walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^28.1.0: - version "28.1.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-28.1.0.tgz#b65167776a8787443214d6f3f54935a4c73c8a45" - integrity sha512-uIJDQbxwEL2AMMs2xjhZl2hw8s77c3wrPaQ9v6tXJLGaaQ+4QrNJH5vuw7hA7w/uGT/iJ42a83opAqxGHeyRIA== +jest-leak-detector@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-28.1.1.tgz#537f37afd610a4b3f4cab15e06baf60484548efb" + integrity sha512-4jvs8V8kLbAaotE+wFR7vfUGf603cwYtFf1/PYEsyX2BAjSzj8hQSVTP6OWzseTl0xL6dyHuKs2JAks7Pfubmw== dependencies: jest-get-type "^28.0.2" - pretty-format "^28.1.0" + pretty-format "^28.1.1" -jest-matcher-utils@^28.1.0: - version "28.1.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-28.1.0.tgz#2ae398806668eeabd293c61712227cb94b250ccf" - integrity sha512-onnax0n2uTLRQFKAjC7TuaxibrPSvZgKTcSCnNUz/tOjJ9UhxNm7ZmPpoQavmTDUjXvUQ8KesWk2/VdrxIFzTQ== +jest-matcher-utils@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-28.1.1.tgz#a7c4653c2b782ec96796eb3088060720f1e29304" + integrity sha512-NPJPRWrbmR2nAJ+1nmnfcKKzSwgfaciCCrYZzVnNoxVoyusYWIjkBMNvu0RHJe7dNj4hH3uZOPZsQA+xAYWqsw== dependencies: chalk "^4.0.0" - jest-diff "^28.1.0" + jest-diff "^28.1.1" jest-get-type "^28.0.2" - pretty-format "^28.1.0" + pretty-format "^28.1.1" -jest-message-util@^28.1.0: - version "28.1.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-28.1.0.tgz#7e8f0b9049e948e7b94c2a52731166774ba7d0af" - integrity sha512-RpA8mpaJ/B2HphDMiDlrAZdDytkmwFqgjDZovM21F35lHGeUeCvYmm6W+sbQ0ydaLpg5bFAUuWG1cjqOl8vqrw== +jest-message-util@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-28.1.1.tgz#60aa0b475cfc08c8a9363ed2fb9108514dd9ab89" + integrity sha512-xoDOOT66fLfmTRiqkoLIU7v42mal/SqwDKvfmfiWAdJMSJiU+ozgluO7KbvoAgiwIrrGZsV7viETjc8GNrA/IQ== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^28.1.0" + "@jest/types" "^28.1.1" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^28.1.0" + pretty-format "^28.1.1" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^28.1.0: - version "28.1.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-28.1.0.tgz#ccc7cc12a9b330b3182db0c651edc90d163ff73e" - integrity sha512-H7BrhggNn77WhdL7O1apG0Q/iwl0Bdd5E1ydhCJzL3oBLh/UYxAwR3EJLsBZ9XA3ZU4PA3UNw4tQjduBTCTmLw== +jest-mock@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-28.1.1.tgz#37903d269427fa1ef5b2447be874e1c62a39a371" + integrity sha512-bDCb0FjfsmKweAvE09dZT59IMkzgN0fYBH6t5S45NoJfd2DHkS3ySG2K+hucortryhO3fVuXdlxWcbtIuV/Skw== dependencies: - "@jest/types" "^28.1.0" + "@jest/types" "^28.1.1" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -1721,168 +1722,169 @@ jest-regex-util@^28.0.2: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-28.0.2.tgz#afdc377a3b25fb6e80825adcf76c854e5bf47ead" integrity sha512-4s0IgyNIy0y9FK+cjoVYoxamT7Zeo7MhzqRGx7YDYmaQn1wucY9rotiGkBzzcMXTtjrCAP/f7f+E0F7+fxPNdw== -jest-resolve-dependencies@^28.1.0: - version "28.1.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-28.1.0.tgz#167becb8bee6e20b5ef4a3a728ec67aef6b0b79b" - integrity sha512-Ue1VYoSZquPwEvng7Uefw8RmZR+me/1kr30H2jMINjGeHgeO/JgrR6wxj2ofkJ7KSAA11W3cOrhNCbj5Dqqd9g== +jest-resolve-dependencies@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-28.1.1.tgz#3dffaaa56f4b41bc6b61053899d1756401763a27" + integrity sha512-p8Y150xYJth4EXhOuB8FzmS9r8IGLEioiaetgdNGb9VHka4fl0zqWlVe4v7mSkYOuEUg2uB61iE+zySDgrOmgQ== dependencies: jest-regex-util "^28.0.2" - jest-snapshot "^28.1.0" + jest-snapshot "^28.1.1" -jest-resolve@^28.1.0: - version "28.1.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-28.1.0.tgz#b1f32748a6cee7d1779c7ef639c0a87078de3d35" - integrity sha512-vvfN7+tPNnnhDvISuzD1P+CRVP8cK0FHXRwPAcdDaQv4zgvwvag2n55/h5VjYcM5UJG7L4TwE5tZlzcI0X2Lhw== +jest-resolve@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-28.1.1.tgz#bc2eaf384abdcc1aaf3ba7c50d1adf01e59095e5" + integrity sha512-/d1UbyUkf9nvsgdBildLe6LAD4DalgkgZcKd0nZ8XUGPyA/7fsnaQIlKVnDiuUXv/IeZhPEDrRJubVSulxrShA== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^28.1.0" + jest-haste-map "^28.1.1" jest-pnp-resolver "^1.2.2" - jest-util "^28.1.0" - jest-validate "^28.1.0" + jest-util "^28.1.1" + jest-validate "^28.1.1" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^28.1.0: - version "28.1.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-28.1.0.tgz#aefe2a1e618a69baa0b24a50edc54fdd7e728eaa" - integrity sha512-FBpmuh1HB2dsLklAlRdOxNTTHKFR6G1Qmd80pVDvwbZXTriqjWqjei5DKFC1UlM732KjYcE6yuCdiF0WUCOS2w== +jest-runner@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-28.1.1.tgz#9ecdb3f27a00059986797aa6b012ba8306aa436c" + integrity sha512-W5oFUiDBgTsCloTAj6q95wEvYDB0pxIhY6bc5F26OucnwBN+K58xGTGbliSMI4ChQal5eANDF+xvELaYkJxTmA== dependencies: - "@jest/console" "^28.1.0" - "@jest/environment" "^28.1.0" - "@jest/test-result" "^28.1.0" - "@jest/transform" "^28.1.0" - "@jest/types" "^28.1.0" + "@jest/console" "^28.1.1" + "@jest/environment" "^28.1.1" + "@jest/test-result" "^28.1.1" + "@jest/transform" "^28.1.1" + "@jest/types" "^28.1.1" "@types/node" "*" chalk "^4.0.0" emittery "^0.10.2" graceful-fs "^4.2.9" - jest-docblock "^28.0.2" - jest-environment-node "^28.1.0" - jest-haste-map "^28.1.0" - jest-leak-detector "^28.1.0" - jest-message-util "^28.1.0" - jest-resolve "^28.1.0" - jest-runtime "^28.1.0" - jest-util "^28.1.0" - jest-watcher "^28.1.0" - jest-worker "^28.1.0" + jest-docblock "^28.1.1" + jest-environment-node "^28.1.1" + jest-haste-map "^28.1.1" + jest-leak-detector "^28.1.1" + jest-message-util "^28.1.1" + jest-resolve "^28.1.1" + jest-runtime "^28.1.1" + jest-util "^28.1.1" + jest-watcher "^28.1.1" + jest-worker "^28.1.1" source-map-support "0.5.13" throat "^6.0.1" -jest-runtime@^28.1.0: - version "28.1.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-28.1.0.tgz#4847dcb2a4eb4b0f9eaf41306897e51fb1665631" - integrity sha512-wNYDiwhdH/TV3agaIyVF0lsJ33MhyujOe+lNTUiolqKt8pchy1Hq4+tDMGbtD5P/oNLA3zYrpx73T9dMTOCAcg== +jest-runtime@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-28.1.1.tgz#569e1dc3c36c6c4c0b29516c1c49b6ad580abdaf" + integrity sha512-J89qEJWW0leOsqyi0D9zHpFEYHwwafFdS9xgvhFHtIdRghbadodI0eA+DrthK/1PebBv3Px8mFSMGKrtaVnleg== dependencies: - "@jest/environment" "^28.1.0" - "@jest/fake-timers" "^28.1.0" - "@jest/globals" "^28.1.0" + "@jest/environment" "^28.1.1" + "@jest/fake-timers" "^28.1.1" + "@jest/globals" "^28.1.1" "@jest/source-map" "^28.0.2" - "@jest/test-result" "^28.1.0" - "@jest/transform" "^28.1.0" - "@jest/types" "^28.1.0" + "@jest/test-result" "^28.1.1" + "@jest/transform" "^28.1.1" + "@jest/types" "^28.1.1" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" execa "^5.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^28.1.0" - jest-message-util "^28.1.0" - jest-mock "^28.1.0" + jest-haste-map "^28.1.1" + jest-message-util "^28.1.1" + jest-mock "^28.1.1" jest-regex-util "^28.0.2" - jest-resolve "^28.1.0" - jest-snapshot "^28.1.0" - jest-util "^28.1.0" + jest-resolve "^28.1.1" + jest-snapshot "^28.1.1" + jest-util "^28.1.1" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^28.1.0: - version "28.1.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-28.1.0.tgz#4b74fa8816707dd10fe9d551c2c258e5a67b53b6" - integrity sha512-ex49M2ZrZsUyQLpLGxQtDbahvgBjlLPgklkqGM0hq/F7W/f8DyqZxVHjdy19QKBm4O93eDp+H5S23EiTbbUmHw== +jest-snapshot@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-28.1.1.tgz#ab825c16c8d8b5e883bd57eee6ca8748c42ab848" + integrity sha512-1KjqHJ98adRcbIdMizjF5DipwZFbvxym/kFO4g4fVZCZRxH/dqV8TiBFCa6rqic3p0karsy8RWS1y4E07b7P0A== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^28.1.0" - "@jest/transform" "^28.1.0" - "@jest/types" "^28.1.0" + "@jest/expect-utils" "^28.1.1" + "@jest/transform" "^28.1.1" + "@jest/types" "^28.1.1" "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^28.1.0" + expect "^28.1.1" graceful-fs "^4.2.9" - jest-diff "^28.1.0" + jest-diff "^28.1.1" jest-get-type "^28.0.2" - jest-haste-map "^28.1.0" - jest-matcher-utils "^28.1.0" - jest-message-util "^28.1.0" - jest-util "^28.1.0" + jest-haste-map "^28.1.1" + jest-matcher-utils "^28.1.1" + jest-message-util "^28.1.1" + jest-util "^28.1.1" natural-compare "^1.4.0" - pretty-format "^28.1.0" + pretty-format "^28.1.1" semver "^7.3.5" -jest-util@^28.1.0: - version "28.1.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-28.1.0.tgz#d54eb83ad77e1dd441408738c5a5043642823be5" - integrity sha512-qYdCKD77k4Hwkose2YBEqQk7PzUf/NSE+rutzceduFveQREeH6b+89Dc9+wjX9dAwHcgdx4yedGA3FQlU/qCTA== +jest-util@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-28.1.1.tgz#ff39e436a1aca397c0ab998db5a51ae2b7080d05" + integrity sha512-FktOu7ca1DZSyhPAxgxB6hfh2+9zMoJ7aEQA759Z6p45NuO8mWcqujH+UdHlCm/V6JTWwDztM2ITCzU1ijJAfw== dependencies: - "@jest/types" "^28.1.0" + "@jest/types" "^28.1.1" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^28.1.0: - version "28.1.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-28.1.0.tgz#8a6821f48432aba9f830c26e28226ad77b9a0e18" - integrity sha512-Lly7CJYih3vQBfjLeANGgBSBJ7pEa18cxpQfQEq2go2xyEzehnHfQTjoUia8xUv4x4J80XKFIDwJJThXtRFQXQ== +jest-validate@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-28.1.1.tgz#59b7b339b3c85b5144bd0c06ad3600f503a4acc8" + integrity sha512-Kpf6gcClqFCIZ4ti5++XemYJWUPCFUW+N2gknn+KgnDf549iLul3cBuKVe1YcWRlaF8tZV8eJCap0eECOEE3Ug== dependencies: - "@jest/types" "^28.1.0" + "@jest/types" "^28.1.1" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^28.0.2" leven "^3.1.0" - pretty-format "^28.1.0" + pretty-format "^28.1.1" -jest-watcher@^28.1.0: - version "28.1.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-28.1.0.tgz#aaa7b4164a4e77eeb5f7d7b25ede5e7b4e9c9aaf" - integrity sha512-tNHMtfLE8Njcr2IRS+5rXYA4BhU90gAOwI9frTGOqd+jX0P/Au/JfRSNqsf5nUTcWdbVYuLxS1KjnzILSoR5hA== +jest-watcher@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-28.1.1.tgz#533597fb3bfefd52b5cd115cd916cffd237fb60c" + integrity sha512-RQIpeZ8EIJMxbQrXpJQYIIlubBnB9imEHsxxE41f54ZwcqWLysL/A0ZcdMirf+XsMn3xfphVQVV4EW0/p7i7Ug== dependencies: - "@jest/test-result" "^28.1.0" - "@jest/types" "^28.1.0" + "@jest/test-result" "^28.1.1" + "@jest/types" "^28.1.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.10.2" - jest-util "^28.1.0" + jest-util "^28.1.1" string-length "^4.0.1" -jest-worker@^28.1.0: - version "28.1.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-28.1.0.tgz#ced54757a035e87591e1208253a6e3aac1a855e5" - integrity sha512-ZHwM6mNwaWBR52Snff8ZvsCTqQsvhCxP/bT1I6T6DAnb6ygkshsyLQIMxFwHpYxht0HOoqt23JlC01viI7T03A== +jest-worker@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-28.1.1.tgz#3480c73247171dfd01eda77200f0063ab6a3bf28" + integrity sha512-Au7slXB08C6h+xbJPp7VIb6U0XX5Kc9uel/WFc6/rcTzGiaVCBRngBExSYuXSLFPULPSYU3cJ3ybS988lNFQhQ== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^28.0.1: - version "28.1.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-28.1.0.tgz#f420e41c8f2395b9a30445a97189ebb57593d831" - integrity sha512-TZR+tHxopPhzw3c3560IJXZWLNHgpcz1Zh0w5A65vynLGNcg/5pZ+VildAd7+XGOu6jd58XMY/HNn0IkZIXVXg== + version "28.1.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-28.1.1.tgz#3c39a3a09791e16e9ef283597d24ab19a0df701e" + integrity sha512-qw9YHBnjt6TCbIDMPMpJZqf9E12rh6869iZaN08/vpOGgHJSAaLLUn6H8W3IAEuy34Ls3rct064mZLETkxJ2XA== dependencies: - "@jest/core" "^28.1.0" + "@jest/core" "^28.1.1" + "@jest/types" "^28.1.1" import-local "^3.0.2" - jest-cli "^28.1.0" + jest-cli "^28.1.1" js-tokens@^4.0.0: version "4.0.0" @@ -2172,10 +2174,10 @@ prettier@>=2.3.0: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.2.tgz#e26d71a18a74c3d0f0597f55f01fb6c06c206032" integrity sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew== -pretty-format@^28.1.0: - version "28.1.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-28.1.0.tgz#8f5836c6a0dfdb834730577ec18029052191af55" - integrity sha512-79Z4wWOYCdvQkEoEuSlBhHJqWeZ8D8YRPiPctJFCtvuaClGpiwiQYSCUOE6IEKUbbFukKOTFIUAXE8N4EQTo1Q== +pretty-format@^28.1.1: + version "28.1.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-28.1.1.tgz#f731530394e0f7fcd95aba6b43c50e02d86b95cb" + integrity sha512-wwJbVTGFHeucr5Jw2bQ9P+VYHyLdAqedFLEkdQUVaBF/eiidDwH5OpilINq4mEfhbCjLnirt6HTTDhv1HaTIQw== dependencies: "@jest/schemas" "^28.0.2" ansi-regex "^5.0.1" @@ -2497,7 +2499,7 @@ v8-to-istanbul@^9.0.0: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" -walker@^1.0.7: +walker@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== From dd2fa77f1b990729f07658ff76028769ca8eff88 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Jun 2022 12:01:02 +0000 Subject: [PATCH 617/785] Bump prettier from 2.6.2 to 2.7.0 Bumps [prettier](https://github.com/prettier/prettier) from 2.6.2 to 2.7.0. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.6.2...2.7.0) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 0db50134..ed6b028a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2170,9 +2170,9 @@ prelude-ls@^1.2.1: integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== prettier@>=2.3.0: - version "2.6.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.2.tgz#e26d71a18a74c3d0f0597f55f01fb6c06c206032" - integrity sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew== + version "2.7.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.0.tgz#a4fdae07e5596c51c9857ea676cd41a0163879d6" + integrity sha512-nwoX4GMFgxoPC6diHvSwmK/4yU8FFH3V8XWtLQrbj4IBsK2pkYhG4kf/ljF/haaZ/aii+wNJqISrCDPgxGWDVQ== pretty-format@^28.1.1: version "28.1.1" From 90c395f9bf55b1d8d92c425059d7cec63bc9bdeb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Jun 2022 12:05:36 +0000 Subject: [PATCH 618/785] Bump prettier from 2.7.0 to 2.7.1 Bumps [prettier](https://github.com/prettier/prettier) from 2.7.0 to 2.7.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.7.0...2.7.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index ed6b028a..85759998 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2170,9 +2170,9 @@ prelude-ls@^1.2.1: integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== prettier@>=2.3.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.0.tgz#a4fdae07e5596c51c9857ea676cd41a0163879d6" - integrity sha512-nwoX4GMFgxoPC6diHvSwmK/4yU8FFH3V8XWtLQrbj4IBsK2pkYhG4kf/ljF/haaZ/aii+wNJqISrCDPgxGWDVQ== + version "2.7.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" + integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== pretty-format@^28.1.1: version "28.1.1" From d5012bf7e505f8832755d8a725eaab7966cdd2a3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Jun 2022 12:03:08 +0000 Subject: [PATCH 619/785] Bump eslint from 8.17.0 to 8.18.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.17.0 to 8.18.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.17.0...v8.18.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 85759998..e6e3ab1a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1097,9 +1097,9 @@ eslint-visitor-keys@^3.3.0: integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.15.0: - version "8.17.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.17.0.tgz#1cfc4b6b6912f77d24b874ca1506b0fe09328c21" - integrity sha512-gq0m0BTJfci60Fz4nczYxNAlED+sMcihltndR8t9t1evnU/azx53x3t2UHXC/uRjcbvRw/XctpaNygSTcQD+Iw== + version "8.18.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.18.0.tgz#78d565d16c993d0b73968c523c0446b13da784fd" + integrity sha512-As1EfFMVk7Xc6/CvhssHUjsAQSkpfXvUGMFC3ce8JDe6WvqCgRrLOBQbVpsBFr1X1V+RACOadnzVvcUS5ni2bA== dependencies: "@eslint/eslintrc" "^1.3.0" "@humanwhocodes/config-array" "^0.9.2" From ae8c13e0c468386fee941b4f49b2752ba8c40584 Mon Sep 17 00:00:00 2001 From: Mark Haussmann Date: Mon, 27 Jun 2022 11:28:49 +1200 Subject: [PATCH 620/785] Resolves process waiting on STDIN Seems like #1134 caused the process to wait for stdin. This PR only passes the `:stdin_data` option if `STDIN` is not attached to a terminal. --- lib/prettier.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/prettier.rb b/lib/prettier.rb index b2a4c1fb..963c6182 100644 --- a/lib/prettier.rb +++ b/lib/prettier.rb @@ -11,9 +11,10 @@ module Prettier def self.run(args) quoted = args.map { |arg| arg.start_with?("-") ? arg : "\"#{arg}\"" } command = "node #{BINARY} --plugin \"#{PLUGIN}\" #{quoted.join(" ")}" + opts = STDIN.tty? ? {} : { stdin_data: STDIN } stdout, stderr, status = - Open3.capture3({ "RBPRETTIER" => "1" }, command, stdin_data: STDIN) + Open3.capture3({ "RBPRETTIER" => "1" }, command, opts) STDOUT.puts(stdout) # If we completed successfully, then just exit out. From 61beda638532dec9a8c8da2dda2735b9f3667874 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Jun 2022 12:01:28 +0000 Subject: [PATCH 621/785] Bump jest from 28.1.1 to 28.1.2 Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 28.1.1 to 28.1.2. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v28.1.2/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 252 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 130 insertions(+), 122 deletions(-) diff --git a/yarn.lock b/yarn.lock index e6e3ab1a..0b819ab9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -343,15 +343,15 @@ jest-util "^28.1.1" slash "^3.0.0" -"@jest/core@^28.1.1": - version "28.1.1" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-28.1.1.tgz#086830bec6267accf9af5ca76f794858e9f9f092" - integrity sha512-3pYsBoZZ42tXMdlcFeCc/0j9kOlK7MYuXs2B1QbvDgMoW1K9NJ4G/VYvIbMb26iqlkTfPHo7SC2JgjDOk/mxXw== +"@jest/core@^28.1.2": + version "28.1.2" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-28.1.2.tgz#eac519b9acbd154313854b8823a47b5c645f785a" + integrity sha512-Xo4E+Sb/nZODMGOPt2G3cMmCBqL4/W2Ijwr7/mrXlq4jdJwcFQ/9KrrJZT2adQRk2otVBXXOz1GRQ4Z5iOgvRQ== dependencies: "@jest/console" "^28.1.1" - "@jest/reporters" "^28.1.1" + "@jest/reporters" "^28.1.2" "@jest/test-result" "^28.1.1" - "@jest/transform" "^28.1.1" + "@jest/transform" "^28.1.2" "@jest/types" "^28.1.1" "@types/node" "*" ansi-escapes "^4.2.1" @@ -360,15 +360,15 @@ exit "^0.1.2" graceful-fs "^4.2.9" jest-changed-files "^28.0.2" - jest-config "^28.1.1" + jest-config "^28.1.2" jest-haste-map "^28.1.1" jest-message-util "^28.1.1" jest-regex-util "^28.0.2" jest-resolve "^28.1.1" - jest-resolve-dependencies "^28.1.1" - jest-runner "^28.1.1" - jest-runtime "^28.1.1" - jest-snapshot "^28.1.1" + jest-resolve-dependencies "^28.1.2" + jest-runner "^28.1.2" + jest-runtime "^28.1.2" + jest-snapshot "^28.1.2" jest-util "^28.1.1" jest-validate "^28.1.1" jest-watcher "^28.1.1" @@ -378,12 +378,12 @@ slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^28.1.1": - version "28.1.1" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-28.1.1.tgz#c4cbf85283278d768f816ebd1a258ea6f9e39d4f" - integrity sha512-9auVQ2GzQ7nrU+lAr8KyY838YahElTX9HVjbQPPS2XjlxQ+na18G113OoBhyBGBtD6ZnO/SrUy5WR8EzOj1/Uw== +"@jest/environment@^28.1.2": + version "28.1.2" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-28.1.2.tgz#94a052c0c5f9f8c8e6d13ea6da78dbc5d7d9b85b" + integrity sha512-I0CR1RUMmOzd0tRpz10oUfaChBWs+/Hrvn5xYhMEF/ZqrDaaeHwS8yDBqEWCrEnkH2g+WE/6g90oBv3nKpcm8Q== dependencies: - "@jest/fake-timers" "^28.1.1" + "@jest/fake-timers" "^28.1.2" "@jest/types" "^28.1.1" "@types/node" "*" jest-mock "^28.1.1" @@ -395,46 +395,46 @@ dependencies: jest-get-type "^28.0.2" -"@jest/expect@^28.1.1": - version "28.1.1" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-28.1.1.tgz#ea4fcc8504b45835029221c0dc357c622a761326" - integrity sha512-/+tQprrFoT6lfkMj4mW/mUIfAmmk/+iQPmg7mLDIFOf2lyf7EBHaS+x3RbeR0VZVMe55IvX7QRoT/2aK3AuUXg== +"@jest/expect@^28.1.2": + version "28.1.2" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-28.1.2.tgz#0b25acedff46e1e1e5606285306c8a399c12534f" + integrity sha512-HBzyZBeFBiOelNbBKN0pilWbbrGvwDUwAqMC46NVJmWm8AVkuE58NbG1s7DR4cxFt4U5cVLxofAoHxgvC5MyOw== dependencies: expect "^28.1.1" - jest-snapshot "^28.1.1" + jest-snapshot "^28.1.2" -"@jest/fake-timers@^28.1.1": - version "28.1.1" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-28.1.1.tgz#47ce33296ab9d680c76076d51ddbe65ceb3337f1" - integrity sha512-BY/3+TyLs5+q87rGWrGUY5f8e8uC3LsVHS9Diz8+FV3ARXL4sNnkLlIB8dvDvRrp+LUCGM+DLqlsYubizGUjIA== +"@jest/fake-timers@^28.1.2": + version "28.1.2" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-28.1.2.tgz#d49e8ee4e02ba85a6e844a52a5e7c59c23e3b76f" + integrity sha512-xSYEI7Y0D5FbZN2LsCUj/EKRR1zfQYmGuAUVh6xTqhx7V5JhjgMcK5Pa0iR6WIk0GXiHDe0Ke4A+yERKE9saqg== dependencies: "@jest/types" "^28.1.1" - "@sinonjs/fake-timers" "^9.1.1" + "@sinonjs/fake-timers" "^9.1.2" "@types/node" "*" jest-message-util "^28.1.1" jest-mock "^28.1.1" jest-util "^28.1.1" -"@jest/globals@^28.1.1": - version "28.1.1" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-28.1.1.tgz#c0a7977f85e26279cc090d9adcdf82b8a34c4061" - integrity sha512-dEgl/6v7ToB4vXItdvcltJBgny0xBE6xy6IYQrPJAJggdEinGxCDMivNv7sFzPcTITGquXD6UJwYxfJ/5ZwDSg== +"@jest/globals@^28.1.2": + version "28.1.2" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-28.1.2.tgz#92fab296e337c7309c25e4202fb724f62249d83f" + integrity sha512-cz0lkJVDOtDaYhvT3Fv2U1B6FtBnV+OpEyJCzTHM1fdoTsU4QNLAt/H4RkiwEUU+dL4g/MFsoTuHeT2pvbo4Hg== dependencies: - "@jest/environment" "^28.1.1" - "@jest/expect" "^28.1.1" + "@jest/environment" "^28.1.2" + "@jest/expect" "^28.1.2" "@jest/types" "^28.1.1" -"@jest/reporters@^28.1.1": - version "28.1.1" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-28.1.1.tgz#9389f4bb3cce4d9b586f6195f83c79cd2a1c8662" - integrity sha512-597Zj4D4d88sZrzM4atEGLuO7SdA/YrOv9SRXHXRNC+/FwPCWxZhBAEzhXoiJzfRwn8zes/EjS8Lo6DouGN5Gg== +"@jest/reporters@^28.1.2": + version "28.1.2" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-28.1.2.tgz#0327be4ce4d0d9ae49e7908656f89669d0c2a260" + integrity sha512-/whGLhiwAqeCTmQEouSigUZJPVl7sW8V26EiboImL+UyXznnr1a03/YZ2BX8OlFw0n+Zlwu+EZAITZtaeRTxyA== dependencies: "@bcoe/v8-coverage" "^0.2.3" "@jest/console" "^28.1.1" "@jest/test-result" "^28.1.1" - "@jest/transform" "^28.1.1" + "@jest/transform" "^28.1.2" "@jest/types" "^28.1.1" - "@jridgewell/trace-mapping" "^0.3.7" + "@jridgewell/trace-mapping" "^0.3.13" "@types/node" "*" chalk "^4.0.0" collect-v8-coverage "^1.0.0" @@ -453,7 +453,7 @@ string-length "^4.0.1" strip-ansi "^6.0.0" terminal-link "^2.0.0" - v8-to-istanbul "^9.0.0" + v8-to-istanbul "^9.0.1" "@jest/schemas@^28.0.2": version "28.0.2" @@ -462,12 +462,12 @@ dependencies: "@sinclair/typebox" "^0.23.3" -"@jest/source-map@^28.0.2": - version "28.0.2" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-28.0.2.tgz#914546f4410b67b1d42c262a1da7e0406b52dc90" - integrity sha512-Y9dxC8ZpN3kImkk0LkK5XCEneYMAXlZ8m5bflmSL5vrwyeUpJfentacCUg6fOb8NOpOO7hz2+l37MV77T6BFPw== +"@jest/source-map@^28.1.2": + version "28.1.2" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-28.1.2.tgz#7fe832b172b497d6663cdff6c13b0a920e139e24" + integrity sha512-cV8Lx3BeStJb8ipPHnqVw/IM2VCMWO3crWZzYodSIkxXnRcXJipCdx1JCK0K5MsJJouZQTH73mzf4vgxRaH9ww== dependencies: - "@jridgewell/trace-mapping" "^0.3.7" + "@jridgewell/trace-mapping" "^0.3.13" callsites "^3.0.0" graceful-fs "^4.2.9" @@ -491,14 +491,14 @@ jest-haste-map "^28.1.1" slash "^3.0.0" -"@jest/transform@^28.1.1": - version "28.1.1" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-28.1.1.tgz#83541f2a3f612077c8501f49cc4e205d4e4a6b27" - integrity sha512-PkfaTUuvjUarl1EDr5ZQcCA++oXkFCP9QFUkG0yVKVmNObjhrqDy0kbMpMebfHWm3CCDHjYNem9eUSH8suVNHQ== +"@jest/transform@^28.1.2": + version "28.1.2" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-28.1.2.tgz#b367962c53fd53821269bde050ce373e111327c1" + integrity sha512-3o+lKF6iweLeJFHBlMJysdaPbpoMmtbHEFsjzSv37HIq/wWt5ijTeO2Yf7MO5yyczCopD507cNwNLeX8Y/CuIg== dependencies: "@babel/core" "^7.11.6" "@jest/types" "^28.1.1" - "@jridgewell/trace-mapping" "^0.3.7" + "@jridgewell/trace-mapping" "^0.3.13" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^1.4.0" @@ -547,7 +547,15 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz#b6461fb0c2964356c469e115f504c95ad97ab88c" integrity sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w== -"@jridgewell/trace-mapping@^0.3.7", "@jridgewell/trace-mapping@^0.3.9": +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.13": + version "0.3.14" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz#b231a081d8f66796e475ad588a1ef473112701ed" + integrity sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + +"@jridgewell/trace-mapping@^0.3.9": version "0.3.13" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.13.tgz#dcfe3e95f224c8fe97a87a5235defec999aa92ea" integrity sha512-o1xbKhp9qnIAoHJSWd6KlCZfqslL4valSF81H8ImioOAxluWYWOpWkpyktY2vnt4tbrX9XYaxovq6cgowaJp2w== @@ -567,7 +575,7 @@ dependencies: type-detect "4.0.8" -"@sinonjs/fake-timers@^9.1.1": +"@sinonjs/fake-timers@^9.1.2": version "9.1.2" resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-9.1.2.tgz#4eaab737fab77332ab132d396a3c0d364bd0ea8c" integrity sha512-BPS4ynJW/o92PUR4wgriz2Ud5gpST5vz6GQfMixEDK0Z8ZCUv2M7SkBLykH56T++Xs+8ln9zTGbOvNGIe02/jw== @@ -751,12 +759,12 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-28.1.1.tgz#2a3a4ae50964695b2d694ccffe4bec537c5a3586" - integrity sha512-MEt0263viUdAkTq5D7upHPNxvt4n9uLUGa6pPz3WviNBMtOmStb1lIXS3QobnoqM+qnH+vr4EKlvhe8QcmxIYw== +babel-jest@^28.1.2: + version "28.1.2" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-28.1.2.tgz#2b37fb81439f14d34d8b2cc4a4bd7efabf9acbfe" + integrity sha512-pfmoo6sh4L/+5/G2OOfQrGJgvH7fTa1oChnuYH2G/6gA+JwDvO8PELwvwnofKBMNrQsam0Wy/Rw+QSrBNewq2Q== dependencies: - "@jest/transform" "^28.1.1" + "@jest/transform" "^28.1.2" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" babel-preset-jest "^28.1.1" @@ -1536,13 +1544,13 @@ jest-changed-files@^28.0.2: execa "^5.0.0" throat "^6.0.1" -jest-circus@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-28.1.1.tgz#3d27da6a974d85a466dc0cdc6ddeb58daaa57bb4" - integrity sha512-75+BBVTsL4+p2w198DQpCeyh1RdaS2lhEG87HkaFX/UG0gJExVq2skG2pT7XZEGBubNj2CytcWSPan4QEPNosw== +jest-circus@^28.1.2: + version "28.1.2" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-28.1.2.tgz#0d5a5623eccb244efe87d1edc365696e4fcf80ce" + integrity sha512-E2vdPIJG5/69EMpslFhaA46WkcrN74LI5V/cSJ59L7uS8UNoXbzTxmwhpi9XrIL3zqvMt5T0pl5k2l2u2GwBNQ== dependencies: - "@jest/environment" "^28.1.1" - "@jest/expect" "^28.1.1" + "@jest/environment" "^28.1.2" + "@jest/expect" "^28.1.2" "@jest/test-result" "^28.1.1" "@jest/types" "^28.1.1" "@types/node" "*" @@ -1553,52 +1561,52 @@ jest-circus@^28.1.1: jest-each "^28.1.1" jest-matcher-utils "^28.1.1" jest-message-util "^28.1.1" - jest-runtime "^28.1.1" - jest-snapshot "^28.1.1" + jest-runtime "^28.1.2" + jest-snapshot "^28.1.2" jest-util "^28.1.1" pretty-format "^28.1.1" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-28.1.1.tgz#23ddfde8940e1818585ae4a568877b33b0e51cfe" - integrity sha512-+sUfVbJqb1OjBZ0OdBbI6OWfYM1i7bSfzYy6gze1F1w3OKWq8ZTEKkZ8a7ZQPq6G/G1qMh/uKqpdWhgl11NFQQ== +jest-cli@^28.1.2: + version "28.1.2" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-28.1.2.tgz#b89012e5bad14135e71b1628b85475d3773a1bbc" + integrity sha512-l6eoi5Do/IJUXAFL9qRmDiFpBeEJAnjJb1dcd9i/VWfVWbp3mJhuH50dNtX67Ali4Ecvt4eBkWb4hXhPHkAZTw== dependencies: - "@jest/core" "^28.1.1" + "@jest/core" "^28.1.2" "@jest/test-result" "^28.1.1" "@jest/types" "^28.1.1" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^28.1.1" + jest-config "^28.1.2" jest-util "^28.1.1" jest-validate "^28.1.1" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-28.1.1.tgz#e90b97b984f14a6c24a221859e81b258990fce2f" - integrity sha512-tASynMhS+jVV85zKvjfbJ8nUyJS/jUSYZ5KQxLUN2ZCvcQc/OmhQl2j6VEL3ezQkNofxn5pQ3SPYWPHb0unTZA== +jest-config@^28.1.2: + version "28.1.2" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-28.1.2.tgz#ba00ad30caf62286c86e7c1099e915218a0ac8c6" + integrity sha512-g6EfeRqddVbjPVBVY4JWpUY4IvQoFRIZcv4V36QkqzE0IGhEC/VkugFeBMAeUE7PRgC8KJF0yvJNDeQRbamEVA== dependencies: "@babel/core" "^7.11.6" "@jest/test-sequencer" "^28.1.1" "@jest/types" "^28.1.1" - babel-jest "^28.1.1" + babel-jest "^28.1.2" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^28.1.1" - jest-environment-node "^28.1.1" + jest-circus "^28.1.2" + jest-environment-node "^28.1.2" jest-get-type "^28.0.2" jest-regex-util "^28.0.2" jest-resolve "^28.1.1" - jest-runner "^28.1.1" + jest-runner "^28.1.2" jest-util "^28.1.1" jest-validate "^28.1.1" micromatch "^4.0.4" @@ -1635,13 +1643,13 @@ jest-each@^28.1.1: jest-util "^28.1.1" pretty-format "^28.1.1" -jest-environment-node@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-28.1.1.tgz#1c86c59003a7d319fa06ea3b1bbda6c193715c67" - integrity sha512-2aV/eeY/WNgUUJrrkDJ3cFEigjC5fqT1+fCclrY6paqJ5zVPoM//sHmfgUUp7WLYxIdbPwMiVIzejpN56MxnNA== +jest-environment-node@^28.1.2: + version "28.1.2" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-28.1.2.tgz#3e2eb47f6d173b0648d5f7c717cb1c26651d5c8a" + integrity sha512-oYsZz9Qw27XKmOgTtnl0jW7VplJkN2oeof+SwAwKFQacq3CLlG9u4kTGuuLWfvu3J7bVutWlrbEQMOCL/jughw== dependencies: - "@jest/environment" "^28.1.1" - "@jest/fake-timers" "^28.1.1" + "@jest/environment" "^28.1.2" + "@jest/fake-timers" "^28.1.2" "@jest/types" "^28.1.1" "@types/node" "*" jest-mock "^28.1.1" @@ -1722,13 +1730,13 @@ jest-regex-util@^28.0.2: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-28.0.2.tgz#afdc377a3b25fb6e80825adcf76c854e5bf47ead" integrity sha512-4s0IgyNIy0y9FK+cjoVYoxamT7Zeo7MhzqRGx7YDYmaQn1wucY9rotiGkBzzcMXTtjrCAP/f7f+E0F7+fxPNdw== -jest-resolve-dependencies@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-28.1.1.tgz#3dffaaa56f4b41bc6b61053899d1756401763a27" - integrity sha512-p8Y150xYJth4EXhOuB8FzmS9r8IGLEioiaetgdNGb9VHka4fl0zqWlVe4v7mSkYOuEUg2uB61iE+zySDgrOmgQ== +jest-resolve-dependencies@^28.1.2: + version "28.1.2" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-28.1.2.tgz#ca528858e0c6642d5a1dda8fc7cda10230c275bc" + integrity sha512-OXw4vbOZuyRTBi3tapWBqdyodU+T33ww5cPZORuTWkg+Y8lmsxQlVu3MWtJh6NMlKRTHQetF96yGPv01Ye7Mbg== dependencies: jest-regex-util "^28.0.2" - jest-snapshot "^28.1.1" + jest-snapshot "^28.1.2" jest-resolve@^28.1.1: version "28.1.1" @@ -1745,44 +1753,44 @@ jest-resolve@^28.1.1: resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-28.1.1.tgz#9ecdb3f27a00059986797aa6b012ba8306aa436c" - integrity sha512-W5oFUiDBgTsCloTAj6q95wEvYDB0pxIhY6bc5F26OucnwBN+K58xGTGbliSMI4ChQal5eANDF+xvELaYkJxTmA== +jest-runner@^28.1.2: + version "28.1.2" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-28.1.2.tgz#f293409592a62234285a71237e38499a3554e350" + integrity sha512-6/k3DlAsAEr5VcptCMdhtRhOoYClZQmxnVMZvZ/quvPGRpN7OBQYPIC32tWSgOnbgqLXNs5RAniC+nkdFZpD4A== dependencies: "@jest/console" "^28.1.1" - "@jest/environment" "^28.1.1" + "@jest/environment" "^28.1.2" "@jest/test-result" "^28.1.1" - "@jest/transform" "^28.1.1" + "@jest/transform" "^28.1.2" "@jest/types" "^28.1.1" "@types/node" "*" chalk "^4.0.0" emittery "^0.10.2" graceful-fs "^4.2.9" jest-docblock "^28.1.1" - jest-environment-node "^28.1.1" + jest-environment-node "^28.1.2" jest-haste-map "^28.1.1" jest-leak-detector "^28.1.1" jest-message-util "^28.1.1" jest-resolve "^28.1.1" - jest-runtime "^28.1.1" + jest-runtime "^28.1.2" jest-util "^28.1.1" jest-watcher "^28.1.1" jest-worker "^28.1.1" source-map-support "0.5.13" throat "^6.0.1" -jest-runtime@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-28.1.1.tgz#569e1dc3c36c6c4c0b29516c1c49b6ad580abdaf" - integrity sha512-J89qEJWW0leOsqyi0D9zHpFEYHwwafFdS9xgvhFHtIdRghbadodI0eA+DrthK/1PebBv3Px8mFSMGKrtaVnleg== +jest-runtime@^28.1.2: + version "28.1.2" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-28.1.2.tgz#d68f34f814a848555a345ceda23289f14d59a688" + integrity sha512-i4w93OsWzLOeMXSi9epmakb2+3z0AchZtUQVF1hesBmcQQy4vtaql5YdVe9KexdJaVRyPDw8DoBR0j3lYsZVYw== dependencies: - "@jest/environment" "^28.1.1" - "@jest/fake-timers" "^28.1.1" - "@jest/globals" "^28.1.1" - "@jest/source-map" "^28.0.2" + "@jest/environment" "^28.1.2" + "@jest/fake-timers" "^28.1.2" + "@jest/globals" "^28.1.2" + "@jest/source-map" "^28.1.2" "@jest/test-result" "^28.1.1" - "@jest/transform" "^28.1.1" + "@jest/transform" "^28.1.2" "@jest/types" "^28.1.1" chalk "^4.0.0" cjs-module-lexer "^1.0.0" @@ -1795,15 +1803,15 @@ jest-runtime@^28.1.1: jest-mock "^28.1.1" jest-regex-util "^28.0.2" jest-resolve "^28.1.1" - jest-snapshot "^28.1.1" + jest-snapshot "^28.1.2" jest-util "^28.1.1" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-28.1.1.tgz#ab825c16c8d8b5e883bd57eee6ca8748c42ab848" - integrity sha512-1KjqHJ98adRcbIdMizjF5DipwZFbvxym/kFO4g4fVZCZRxH/dqV8TiBFCa6rqic3p0karsy8RWS1y4E07b7P0A== +jest-snapshot@^28.1.2: + version "28.1.2" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-28.1.2.tgz#93d31b87b11b384f5946fe0767541496135f8d52" + integrity sha512-wzrieFttZYfLvrCVRJxX+jwML2YTArOUqFpCoSVy1QUapx+LlV9uLbV/mMEhYj4t7aMeE9aSQFHSvV/oNoDAMA== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" @@ -1811,7 +1819,7 @@ jest-snapshot@^28.1.1: "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" "@jest/expect-utils" "^28.1.1" - "@jest/transform" "^28.1.1" + "@jest/transform" "^28.1.2" "@jest/types" "^28.1.1" "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" @@ -1877,14 +1885,14 @@ jest-worker@^28.1.1: supports-color "^8.0.0" jest@^28.0.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest/-/jest-28.1.1.tgz#3c39a3a09791e16e9ef283597d24ab19a0df701e" - integrity sha512-qw9YHBnjt6TCbIDMPMpJZqf9E12rh6869iZaN08/vpOGgHJSAaLLUn6H8W3IAEuy34Ls3rct064mZLETkxJ2XA== + version "28.1.2" + resolved "https://registry.yarnpkg.com/jest/-/jest-28.1.2.tgz#451ff24081ce31ca00b07b60c61add13aa96f8eb" + integrity sha512-Tuf05DwLeCh2cfWCQbcz9UxldoDyiR1E9Igaei5khjonKncYdc6LDfynKCEWozK0oLE3GD+xKAo2u8x/0s6GOg== dependencies: - "@jest/core" "^28.1.1" + "@jest/core" "^28.1.2" "@jest/types" "^28.1.1" import-local "^3.0.2" - jest-cli "^28.1.1" + jest-cli "^28.1.2" js-tokens@^4.0.0: version "4.0.0" @@ -2490,12 +2498,12 @@ v8-compile-cache@^2.0.3: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== -v8-to-istanbul@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.0.0.tgz#be0dae58719fc53cb97e5c7ac1d7e6d4f5b19511" - integrity sha512-HcvgY/xaRm7isYmyx+lFKA4uQmfUbN0J4M0nNItvzTvH/iQ9kW5j/t4YSR+Ge323/lrgDAWJoF46tzGQHwBHFw== +v8-to-istanbul@^9.0.1: + version "9.0.1" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.0.1.tgz#b6f994b0b5d4ef255e17a0d17dc444a9f5132fa4" + integrity sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w== dependencies: - "@jridgewell/trace-mapping" "^0.3.7" + "@jridgewell/trace-mapping" "^0.3.12" "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" From a455e400f54e46725ab57eb93fedb41648463ba5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Jul 2022 12:01:08 +0000 Subject: [PATCH 622/785] Bump eslint from 8.18.0 to 8.19.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.18.0 to 8.19.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.18.0...v8.19.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 0b819ab9..0e18eb86 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1105,9 +1105,9 @@ eslint-visitor-keys@^3.3.0: integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.15.0: - version "8.18.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.18.0.tgz#78d565d16c993d0b73968c523c0446b13da784fd" - integrity sha512-As1EfFMVk7Xc6/CvhssHUjsAQSkpfXvUGMFC3ce8JDe6WvqCgRrLOBQbVpsBFr1X1V+RACOadnzVvcUS5ni2bA== + version "8.19.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.19.0.tgz#7342a3cbc4fbc5c106a1eefe0fd0b50b6b1a7d28" + integrity sha512-SXOPj3x9VKvPe81TjjUJCYlV4oJjQw68Uek+AM0X4p+33dj2HY5bpTZOgnQHcG2eAm1mtCU9uNMnJi7exU/kYw== dependencies: "@eslint/eslintrc" "^1.3.0" "@humanwhocodes/config-array" "^0.9.2" From 60da42492aa0053a476a0bab67e02d2b90c92409 Mon Sep 17 00:00:00 2001 From: Spencer Oberstadt Date: Mon, 11 Jul 2022 22:20:53 -0400 Subject: [PATCH 623/785] Run Rake task in check mode if write disabled --- lib/prettier/rake/task.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/prettier/rake/task.rb b/lib/prettier/rake/task.rb index 35932601..0da0fc9e 100644 --- a/lib/prettier/rake/task.rb +++ b/lib/prettier/rake/task.rb @@ -49,7 +49,7 @@ def define_task end def run_task - Prettier.run([("--write" if write), source_files].compact) + Prettier.run([write ? "--write" : "--check", source_files].compact) exit($?.exitstatus) if $?&.exited? end end From 6c42ebd8379b1a66b511ea2b5ab0542dcbe374f4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Jul 2022 12:01:05 +0000 Subject: [PATCH 624/785] Bump jest from 28.1.2 to 28.1.3 Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 28.1.2 to 28.1.3. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v28.1.3/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 655 +++++++++++++++++++++++++++--------------------------- 1 file changed, 331 insertions(+), 324 deletions(-) diff --git a/yarn.lock b/yarn.lock index 0e18eb86..dec46833 100644 --- a/yarn.lock +++ b/yarn.lock @@ -331,109 +331,109 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^28.1.1": - version "28.1.1" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-28.1.1.tgz#305f8ca50b6e70413839f54c0e002b60a0f2fd7d" - integrity sha512-0RiUocPVFEm3WRMOStIHbRWllG6iW6E3/gUPnf4lkrVFyXIIDeCe+vlKeYyFOMhB2EPE6FLFCNADSOOQMaqvyA== +"@jest/console@^28.1.3": + version "28.1.3" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-28.1.3.tgz#2030606ec03a18c31803b8a36382762e447655df" + integrity sha512-QPAkP5EwKdK/bxIr6C1I4Vs0rm2nHiANzj/Z5X2JQkrZo6IqvC4ldZ9K95tF0HdidhA8Bo6egxSzUFPYKcEXLw== dependencies: - "@jest/types" "^28.1.1" + "@jest/types" "^28.1.3" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^28.1.1" - jest-util "^28.1.1" + jest-message-util "^28.1.3" + jest-util "^28.1.3" slash "^3.0.0" -"@jest/core@^28.1.2": - version "28.1.2" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-28.1.2.tgz#eac519b9acbd154313854b8823a47b5c645f785a" - integrity sha512-Xo4E+Sb/nZODMGOPt2G3cMmCBqL4/W2Ijwr7/mrXlq4jdJwcFQ/9KrrJZT2adQRk2otVBXXOz1GRQ4Z5iOgvRQ== - dependencies: - "@jest/console" "^28.1.1" - "@jest/reporters" "^28.1.2" - "@jest/test-result" "^28.1.1" - "@jest/transform" "^28.1.2" - "@jest/types" "^28.1.1" +"@jest/core@^28.1.3": + version "28.1.3" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-28.1.3.tgz#0ebf2bd39840f1233cd5f2d1e6fc8b71bd5a1ac7" + integrity sha512-CIKBrlaKOzA7YG19BEqCw3SLIsEwjZkeJzf5bdooVnW4bH5cktqe3JX+G2YV1aK5vP8N9na1IGWFzYaTp6k6NA== + dependencies: + "@jest/console" "^28.1.3" + "@jest/reporters" "^28.1.3" + "@jest/test-result" "^28.1.3" + "@jest/transform" "^28.1.3" + "@jest/types" "^28.1.3" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" ci-info "^3.2.0" exit "^0.1.2" graceful-fs "^4.2.9" - jest-changed-files "^28.0.2" - jest-config "^28.1.2" - jest-haste-map "^28.1.1" - jest-message-util "^28.1.1" + jest-changed-files "^28.1.3" + jest-config "^28.1.3" + jest-haste-map "^28.1.3" + jest-message-util "^28.1.3" jest-regex-util "^28.0.2" - jest-resolve "^28.1.1" - jest-resolve-dependencies "^28.1.2" - jest-runner "^28.1.2" - jest-runtime "^28.1.2" - jest-snapshot "^28.1.2" - jest-util "^28.1.1" - jest-validate "^28.1.1" - jest-watcher "^28.1.1" + jest-resolve "^28.1.3" + jest-resolve-dependencies "^28.1.3" + jest-runner "^28.1.3" + jest-runtime "^28.1.3" + jest-snapshot "^28.1.3" + jest-util "^28.1.3" + jest-validate "^28.1.3" + jest-watcher "^28.1.3" micromatch "^4.0.4" - pretty-format "^28.1.1" + pretty-format "^28.1.3" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^28.1.2": - version "28.1.2" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-28.1.2.tgz#94a052c0c5f9f8c8e6d13ea6da78dbc5d7d9b85b" - integrity sha512-I0CR1RUMmOzd0tRpz10oUfaChBWs+/Hrvn5xYhMEF/ZqrDaaeHwS8yDBqEWCrEnkH2g+WE/6g90oBv3nKpcm8Q== +"@jest/environment@^28.1.3": + version "28.1.3" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-28.1.3.tgz#abed43a6b040a4c24fdcb69eab1f97589b2d663e" + integrity sha512-1bf40cMFTEkKyEf585R9Iz1WayDjHoHqvts0XFYEqyKM3cFWDpeMoqKKTAF9LSYQModPUlh8FKptoM2YcMWAXA== dependencies: - "@jest/fake-timers" "^28.1.2" - "@jest/types" "^28.1.1" + "@jest/fake-timers" "^28.1.3" + "@jest/types" "^28.1.3" "@types/node" "*" - jest-mock "^28.1.1" + jest-mock "^28.1.3" -"@jest/expect-utils@^28.1.1": - version "28.1.1" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-28.1.1.tgz#d84c346025b9f6f3886d02c48a6177e2b0360587" - integrity sha512-n/ghlvdhCdMI/hTcnn4qV57kQuV9OTsZzH1TTCVARANKhl6hXJqLKUkwX69ftMGpsbpt96SsDD8n8LD2d9+FRw== +"@jest/expect-utils@^28.1.3": + version "28.1.3" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-28.1.3.tgz#58561ce5db7cd253a7edddbc051fb39dda50f525" + integrity sha512-wvbi9LUrHJLn3NlDW6wF2hvIMtd4JUl2QNVrjq+IBSHirgfrR3o9RnVtxzdEGO2n9JyIWwHnLfby5KzqBGg2YA== dependencies: jest-get-type "^28.0.2" -"@jest/expect@^28.1.2": - version "28.1.2" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-28.1.2.tgz#0b25acedff46e1e1e5606285306c8a399c12534f" - integrity sha512-HBzyZBeFBiOelNbBKN0pilWbbrGvwDUwAqMC46NVJmWm8AVkuE58NbG1s7DR4cxFt4U5cVLxofAoHxgvC5MyOw== +"@jest/expect@^28.1.3": + version "28.1.3" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-28.1.3.tgz#9ac57e1d4491baca550f6bdbd232487177ad6a72" + integrity sha512-lzc8CpUbSoE4dqT0U+g1qODQjBRHPpCPXissXD4mS9+sWQdmmpeJ9zSH1rS1HEkrsMN0fb7nKrJ9giAR1d3wBw== dependencies: - expect "^28.1.1" - jest-snapshot "^28.1.2" + expect "^28.1.3" + jest-snapshot "^28.1.3" -"@jest/fake-timers@^28.1.2": - version "28.1.2" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-28.1.2.tgz#d49e8ee4e02ba85a6e844a52a5e7c59c23e3b76f" - integrity sha512-xSYEI7Y0D5FbZN2LsCUj/EKRR1zfQYmGuAUVh6xTqhx7V5JhjgMcK5Pa0iR6WIk0GXiHDe0Ke4A+yERKE9saqg== +"@jest/fake-timers@^28.1.3": + version "28.1.3" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-28.1.3.tgz#230255b3ad0a3d4978f1d06f70685baea91c640e" + integrity sha512-D/wOkL2POHv52h+ok5Oj/1gOG9HSywdoPtFsRCUmlCILXNn5eIWmcnd3DIiWlJnpGvQtmajqBP95Ei0EimxfLw== dependencies: - "@jest/types" "^28.1.1" + "@jest/types" "^28.1.3" "@sinonjs/fake-timers" "^9.1.2" "@types/node" "*" - jest-message-util "^28.1.1" - jest-mock "^28.1.1" - jest-util "^28.1.1" + jest-message-util "^28.1.3" + jest-mock "^28.1.3" + jest-util "^28.1.3" -"@jest/globals@^28.1.2": - version "28.1.2" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-28.1.2.tgz#92fab296e337c7309c25e4202fb724f62249d83f" - integrity sha512-cz0lkJVDOtDaYhvT3Fv2U1B6FtBnV+OpEyJCzTHM1fdoTsU4QNLAt/H4RkiwEUU+dL4g/MFsoTuHeT2pvbo4Hg== +"@jest/globals@^28.1.3": + version "28.1.3" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-28.1.3.tgz#a601d78ddc5fdef542728309894895b4a42dc333" + integrity sha512-XFU4P4phyryCXu1pbcqMO0GSQcYe1IsalYCDzRNyhetyeyxMcIxa11qPNDpVNLeretItNqEmYYQn1UYz/5x1NA== dependencies: - "@jest/environment" "^28.1.2" - "@jest/expect" "^28.1.2" - "@jest/types" "^28.1.1" + "@jest/environment" "^28.1.3" + "@jest/expect" "^28.1.3" + "@jest/types" "^28.1.3" -"@jest/reporters@^28.1.2": - version "28.1.2" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-28.1.2.tgz#0327be4ce4d0d9ae49e7908656f89669d0c2a260" - integrity sha512-/whGLhiwAqeCTmQEouSigUZJPVl7sW8V26EiboImL+UyXznnr1a03/YZ2BX8OlFw0n+Zlwu+EZAITZtaeRTxyA== +"@jest/reporters@^28.1.3": + version "28.1.3" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-28.1.3.tgz#9adf6d265edafc5fc4a434cfb31e2df5a67a369a" + integrity sha512-JuAy7wkxQZVNU/V6g9xKzCGC5LVXx9FDcABKsSXp5MiKPEE2144a/vXTEDoyzjUpZKfVwp08Wqg5A4WfTMAzjg== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^28.1.1" - "@jest/test-result" "^28.1.1" - "@jest/transform" "^28.1.2" - "@jest/types" "^28.1.1" + "@jest/console" "^28.1.3" + "@jest/test-result" "^28.1.3" + "@jest/transform" "^28.1.3" + "@jest/types" "^28.1.3" "@jridgewell/trace-mapping" "^0.3.13" "@types/node" "*" chalk "^4.0.0" @@ -446,21 +446,21 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^28.1.1" - jest-util "^28.1.1" - jest-worker "^28.1.1" + jest-message-util "^28.1.3" + jest-util "^28.1.3" + jest-worker "^28.1.3" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" terminal-link "^2.0.0" v8-to-istanbul "^9.0.1" -"@jest/schemas@^28.0.2": - version "28.0.2" - resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-28.0.2.tgz#08c30df6a8d07eafea0aef9fb222c5e26d72e613" - integrity sha512-YVDJZjd4izeTDkij00vHHAymNXQ6WWsdChFRK86qck6Jpr3DCL5W3Is3vslviRlP+bLuMYRLbdp98amMvqudhA== +"@jest/schemas@^28.1.3": + version "28.1.3" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-28.1.3.tgz#ad8b86a66f11f33619e3d7e1dcddd7f2d40ff905" + integrity sha512-/l/VWsdt/aBXgjshLWOFyFt3IVdYypu5y2Wn2rOO1un6nkqIn8SLXzgIMYXFyYsRWDyF5EthmKJMIdJvk08grg== dependencies: - "@sinclair/typebox" "^0.23.3" + "@sinclair/typebox" "^0.24.1" "@jest/source-map@^28.1.2": version "28.1.2" @@ -471,53 +471,53 @@ callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^28.1.1": - version "28.1.1" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-28.1.1.tgz#c6f18d1bbb01aa88925dd687872a75f8414b317a" - integrity sha512-hPmkugBktqL6rRzwWAtp1JtYT4VHwv8OQ+9lE5Gymj6dHzubI/oJHMUpPOt8NrdVWSrz9S7bHjJUmv2ggFoUNQ== +"@jest/test-result@^28.1.3": + version "28.1.3" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-28.1.3.tgz#5eae945fd9f4b8fcfce74d239e6f725b6bf076c5" + integrity sha512-kZAkxnSE+FqE8YjW8gNuoVkkC9I7S1qmenl8sGcDOLropASP+BkcGKwhXoyqQuGOGeYY0y/ixjrd/iERpEXHNg== dependencies: - "@jest/console" "^28.1.1" - "@jest/types" "^28.1.1" + "@jest/console" "^28.1.3" + "@jest/types" "^28.1.3" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^28.1.1": - version "28.1.1" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-28.1.1.tgz#f594ee2331df75000afe0d1ae3237630ecec732e" - integrity sha512-nuL+dNSVMcWB7OOtgb0EGH5AjO4UBCt68SLP08rwmC+iRhyuJWS9MtZ/MpipxFwKAlHFftbMsydXqWre8B0+XA== +"@jest/test-sequencer@^28.1.3": + version "28.1.3" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-28.1.3.tgz#9d0c283d906ac599c74bde464bc0d7e6a82886c3" + integrity sha512-NIMPEqqa59MWnDi1kvXXpYbqsfQmSJsIbnd85mdVGkiDfQ9WQQTXOLsvISUfonmnBT+w85WEgneCigEEdHDFxw== dependencies: - "@jest/test-result" "^28.1.1" + "@jest/test-result" "^28.1.3" graceful-fs "^4.2.9" - jest-haste-map "^28.1.1" + jest-haste-map "^28.1.3" slash "^3.0.0" -"@jest/transform@^28.1.2": - version "28.1.2" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-28.1.2.tgz#b367962c53fd53821269bde050ce373e111327c1" - integrity sha512-3o+lKF6iweLeJFHBlMJysdaPbpoMmtbHEFsjzSv37HIq/wWt5ijTeO2Yf7MO5yyczCopD507cNwNLeX8Y/CuIg== +"@jest/transform@^28.1.3": + version "28.1.3" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-28.1.3.tgz#59d8098e50ab07950e0f2fc0fc7ec462371281b0" + integrity sha512-u5dT5di+oFI6hfcLOHGTAfmUxFRrjK+vnaP0kkVow9Md/M7V/MxqQMOz/VV25UZO8pzeA9PjfTpOu6BDuwSPQA== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^28.1.1" + "@jest/types" "^28.1.3" "@jridgewell/trace-mapping" "^0.3.13" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.9" - jest-haste-map "^28.1.1" + jest-haste-map "^28.1.3" jest-regex-util "^28.0.2" - jest-util "^28.1.1" + jest-util "^28.1.3" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" write-file-atomic "^4.0.1" -"@jest/types@^28.1.1": - version "28.1.1" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-28.1.1.tgz#d059bbc80e6da6eda9f081f293299348bd78ee0b" - integrity sha512-vRXVqSg1VhDnB8bWcmvLzmg0Bt9CRKVgHPXqYwvWMX3TvAjeO+nRuK6+VdTKCtWOvYlmkF/HqNAL/z+N3B53Kw== +"@jest/types@^28.1.3": + version "28.1.3" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-28.1.3.tgz#b05de80996ff12512bc5ceb1d208285a7d11748b" + integrity sha512-RyjiyMUZrKz/c+zlMFO1pm70DcIlST8AeWTkoUdZevew44wcNZQHsEVOiCVtgVnlFFD82FPaXycys58cf2muVQ== dependencies: - "@jest/schemas" "^28.0.2" + "@jest/schemas" "^28.1.3" "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" "@types/node" "*" @@ -563,10 +563,10 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@sinclair/typebox@^0.23.3": - version "0.23.5" - resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.23.5.tgz#93f7b9f4e3285a7a9ade7557d9a8d36809cbc47d" - integrity sha512-AFBVi/iT4g20DHoujvMH1aEDn8fGJh4xsRGCP6d8RpLPMqsNPvW01Jcn0QysXTsg++/xj25NmJsGyH9xug/wKg== +"@sinclair/typebox@^0.24.1": + version "0.24.19" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.19.tgz#5297278e0d8a1aea084685a3216074910ac6c113" + integrity sha512-gHJu8cdYTD5p4UqmQHrxaWrtb/jkH5imLXzuBypWhKzNkW0qfmgz+w1xaJccWVuJta1YYUdlDiPHXRTR4Ku0MQ== "@sinonjs/commons@^1.7.0": version "1.8.3" @@ -759,15 +759,15 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^28.1.2: - version "28.1.2" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-28.1.2.tgz#2b37fb81439f14d34d8b2cc4a4bd7efabf9acbfe" - integrity sha512-pfmoo6sh4L/+5/G2OOfQrGJgvH7fTa1oChnuYH2G/6gA+JwDvO8PELwvwnofKBMNrQsam0Wy/Rw+QSrBNewq2Q== +babel-jest@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-28.1.3.tgz#c1187258197c099072156a0a121c11ee1e3917d5" + integrity sha512-epUaPOEWMk3cWX0M/sPvCHHCe9fMFAa/9hXEgKP8nFfNl/jlGkE9ucq9NqkZGXLDduCJYS0UvSlPUwC0S+rH6Q== dependencies: - "@jest/transform" "^28.1.2" + "@jest/transform" "^28.1.3" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^28.1.1" + babel-preset-jest "^28.1.3" chalk "^4.0.0" graceful-fs "^4.2.9" slash "^3.0.0" @@ -783,10 +783,10 @@ babel-plugin-istanbul@^6.1.1: istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-28.1.1.tgz#5e055cdcc47894f28341f87f5e35aad2df680b11" - integrity sha512-NovGCy5Hn25uMJSAU8FaHqzs13cFoOI4lhIujiepssjCKRsAo3TA734RDWSGxuFTsUJXerYOqQQodlxgmtqbzw== +babel-plugin-jest-hoist@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-28.1.3.tgz#1952c4d0ea50f2d6d794353762278d1d8cca3fbe" + integrity sha512-Ys3tUKAmfnkRUpPdpa98eYrAR0nV+sSFUZZEGuQ2EbFd1y4SOLtD5QDNHAq+bb9a+bbXvYQC4b+ID/THIMcU6Q== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -811,12 +811,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-28.1.1.tgz#5b6e5e69f963eb2d70f739c607b8f723c0ee75e4" - integrity sha512-FCq9Oud0ReTeWtcneYf/48981aTfXYuB9gbU4rBNNJVBSQ6ssv7E6v/qvbBxtOWwZFXjLZwpg+W3q7J6vhH25g== +babel-preset-jest@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-28.1.3.tgz#5dfc20b99abed5db994406c2b9ab94c73aaa419d" + integrity sha512-L+fupJvlWAHbQfn74coNX3zf60LXMJsezNvvx8eIh7iOR1luJ1poxYgQk1F8PYtNq/6QODDHCqsSnTFSWC491A== dependencies: - babel-plugin-jest-hoist "^28.1.1" + babel-plugin-jest-hoist "^28.1.3" babel-preset-current-node-syntax "^1.0.0" balanced-match@^1.0.0: @@ -1218,16 +1218,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/expect/-/expect-28.1.1.tgz#ca6fff65f6517cf7220c2e805a49c19aea30b420" - integrity sha512-/AANEwGL0tWBwzLNOvO0yUdy2D52jVdNXppOqswC49sxMN2cPWsGCQdzuIf9tj6hHoBQzNvx75JUYuQAckPo3w== +expect@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/expect/-/expect-28.1.3.tgz#90a7c1a124f1824133dd4533cce2d2bdcb6603ec" + integrity sha512-eEh0xn8HlsuOBxFgIss+2mX85VAS4Qy3OSkjV7rlBWljtA4oWH37glVGyOZSZvErDT/yBywZdPGwCXuTvSG85g== dependencies: - "@jest/expect-utils" "^28.1.1" + "@jest/expect-utils" "^28.1.3" jest-get-type "^28.0.2" - jest-matcher-utils "^28.1.1" - jest-message-util "^28.1.1" - jest-util "^28.1.1" + jest-matcher-utils "^28.1.3" + jest-message-util "^28.1.3" + jest-util "^28.1.3" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1536,94 +1536,94 @@ istanbul-reports@^3.1.3: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-28.0.2.tgz#7d7810660a5bd043af9e9cfbe4d58adb05e91531" - integrity sha512-QX9u+5I2s54ZnGoMEjiM2WeBvJR2J7w/8ZUmH2um/WLAuGAYFQcsVXY9+1YL6k0H/AGUdH8pXUAv6erDqEsvIA== +jest-changed-files@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-28.1.3.tgz#d9aeee6792be3686c47cb988a8eaf82ff4238831" + integrity sha512-esaOfUWJXk2nfZt9SPyC8gA1kNfdKLkQWyzsMlqq8msYSlNKfmZxfRgZn4Cd4MGVUF+7v6dBs0d5TOAKa7iIiA== dependencies: execa "^5.0.0" - throat "^6.0.1" + p-limit "^3.1.0" -jest-circus@^28.1.2: - version "28.1.2" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-28.1.2.tgz#0d5a5623eccb244efe87d1edc365696e4fcf80ce" - integrity sha512-E2vdPIJG5/69EMpslFhaA46WkcrN74LI5V/cSJ59L7uS8UNoXbzTxmwhpi9XrIL3zqvMt5T0pl5k2l2u2GwBNQ== +jest-circus@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-28.1.3.tgz#d14bd11cf8ee1a03d69902dc47b6bd4634ee00e4" + integrity sha512-cZ+eS5zc79MBwt+IhQhiEp0OeBddpc1n8MBo1nMB8A7oPMKEO+Sre+wHaLJexQUj9Ya/8NOBY0RESUgYjB6fow== dependencies: - "@jest/environment" "^28.1.2" - "@jest/expect" "^28.1.2" - "@jest/test-result" "^28.1.1" - "@jest/types" "^28.1.1" + "@jest/environment" "^28.1.3" + "@jest/expect" "^28.1.3" + "@jest/test-result" "^28.1.3" + "@jest/types" "^28.1.3" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" is-generator-fn "^2.0.0" - jest-each "^28.1.1" - jest-matcher-utils "^28.1.1" - jest-message-util "^28.1.1" - jest-runtime "^28.1.2" - jest-snapshot "^28.1.2" - jest-util "^28.1.1" - pretty-format "^28.1.1" + jest-each "^28.1.3" + jest-matcher-utils "^28.1.3" + jest-message-util "^28.1.3" + jest-runtime "^28.1.3" + jest-snapshot "^28.1.3" + jest-util "^28.1.3" + p-limit "^3.1.0" + pretty-format "^28.1.3" slash "^3.0.0" stack-utils "^2.0.3" - throat "^6.0.1" -jest-cli@^28.1.2: - version "28.1.2" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-28.1.2.tgz#b89012e5bad14135e71b1628b85475d3773a1bbc" - integrity sha512-l6eoi5Do/IJUXAFL9qRmDiFpBeEJAnjJb1dcd9i/VWfVWbp3mJhuH50dNtX67Ali4Ecvt4eBkWb4hXhPHkAZTw== +jest-cli@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-28.1.3.tgz#558b33c577d06de55087b8448d373b9f654e46b2" + integrity sha512-roY3kvrv57Azn1yPgdTebPAXvdR2xfezaKKYzVxZ6It/5NCxzJym6tUI5P1zkdWhfUYkxEI9uZWcQdaFLo8mJQ== dependencies: - "@jest/core" "^28.1.2" - "@jest/test-result" "^28.1.1" - "@jest/types" "^28.1.1" + "@jest/core" "^28.1.3" + "@jest/test-result" "^28.1.3" + "@jest/types" "^28.1.3" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^28.1.2" - jest-util "^28.1.1" - jest-validate "^28.1.1" + jest-config "^28.1.3" + jest-util "^28.1.3" + jest-validate "^28.1.3" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^28.1.2: - version "28.1.2" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-28.1.2.tgz#ba00ad30caf62286c86e7c1099e915218a0ac8c6" - integrity sha512-g6EfeRqddVbjPVBVY4JWpUY4IvQoFRIZcv4V36QkqzE0IGhEC/VkugFeBMAeUE7PRgC8KJF0yvJNDeQRbamEVA== +jest-config@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-28.1.3.tgz#e315e1f73df3cac31447eed8b8740a477392ec60" + integrity sha512-MG3INjByJ0J4AsNBm7T3hsuxKQqFIiRo/AUqb1q9LRKI5UU6Aar9JHbr9Ivn1TVwfUD9KirRoM/T6u8XlcQPHQ== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^28.1.1" - "@jest/types" "^28.1.1" - babel-jest "^28.1.2" + "@jest/test-sequencer" "^28.1.3" + "@jest/types" "^28.1.3" + babel-jest "^28.1.3" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^28.1.2" - jest-environment-node "^28.1.2" + jest-circus "^28.1.3" + jest-environment-node "^28.1.3" jest-get-type "^28.0.2" jest-regex-util "^28.0.2" - jest-resolve "^28.1.1" - jest-runner "^28.1.2" - jest-util "^28.1.1" - jest-validate "^28.1.1" + jest-resolve "^28.1.3" + jest-runner "^28.1.3" + jest-util "^28.1.3" + jest-validate "^28.1.3" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^28.1.1" + pretty-format "^28.1.3" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-28.1.1.tgz#1a3eedfd81ae79810931c63a1d0f201b9120106c" - integrity sha512-/MUUxeR2fHbqHoMMiffe/Afm+U8U4olFRJ0hiVG2lZatPJcnGxx292ustVu7bULhjV65IYMxRdploAKLbcrsyg== +jest-diff@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-28.1.3.tgz#948a192d86f4e7a64c5264ad4da4877133d8792f" + integrity sha512-8RqP1B/OXzjjTWkqMX67iqgwBVJRgCyKD3L9nq+6ZqJMdvjE8RgHktqZ6jNrkdMT+dJuYNI3rhQpxaz7drJHfw== dependencies: chalk "^4.0.0" diff-sequences "^28.1.1" jest-get-type "^28.0.2" - pretty-format "^28.1.1" + pretty-format "^28.1.3" jest-docblock@^28.1.1: version "28.1.1" @@ -1632,92 +1632,92 @@ jest-docblock@^28.1.1: dependencies: detect-newline "^3.0.0" -jest-each@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-28.1.1.tgz#ba5238dacf4f31d9fe23ddc2c44c01e7c23885c4" - integrity sha512-A042rqh17ZvEhRceDMi784ppoXR7MWGDEKTXEZXb4svt0eShMZvijGxzKsx+yIjeE8QYmHPrnHiTSQVhN4nqaw== +jest-each@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-28.1.3.tgz#bdd1516edbe2b1f3569cfdad9acd543040028f81" + integrity sha512-arT1z4sg2yABU5uogObVPvSlSMQlDA48owx07BDPAiasW0yYpYHYOo4HHLz9q0BVzDVU4hILFjzJw0So9aCL/g== dependencies: - "@jest/types" "^28.1.1" + "@jest/types" "^28.1.3" chalk "^4.0.0" jest-get-type "^28.0.2" - jest-util "^28.1.1" - pretty-format "^28.1.1" + jest-util "^28.1.3" + pretty-format "^28.1.3" -jest-environment-node@^28.1.2: - version "28.1.2" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-28.1.2.tgz#3e2eb47f6d173b0648d5f7c717cb1c26651d5c8a" - integrity sha512-oYsZz9Qw27XKmOgTtnl0jW7VplJkN2oeof+SwAwKFQacq3CLlG9u4kTGuuLWfvu3J7bVutWlrbEQMOCL/jughw== +jest-environment-node@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-28.1.3.tgz#7e74fe40eb645b9d56c0c4b70ca4357faa349be5" + integrity sha512-ugP6XOhEpjAEhGYvp5Xj989ns5cB1K6ZdjBYuS30umT4CQEETaxSiPcZ/E1kFktX4GkrcM4qu07IIlDYX1gp+A== dependencies: - "@jest/environment" "^28.1.2" - "@jest/fake-timers" "^28.1.2" - "@jest/types" "^28.1.1" + "@jest/environment" "^28.1.3" + "@jest/fake-timers" "^28.1.3" + "@jest/types" "^28.1.3" "@types/node" "*" - jest-mock "^28.1.1" - jest-util "^28.1.1" + jest-mock "^28.1.3" + jest-util "^28.1.3" jest-get-type@^28.0.2: version "28.0.2" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-28.0.2.tgz#34622e628e4fdcd793d46db8a242227901fcf203" integrity sha512-ioj2w9/DxSYHfOm5lJKCdcAmPJzQXmbM/Url3rhlghrPvT3tt+7a/+oXc9azkKmLvoiXjtV83bEWqi+vs5nlPA== -jest-haste-map@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-28.1.1.tgz#471685f1acd365a9394745bb97c8fc16289adca3" - integrity sha512-ZrRSE2o3Ezh7sb1KmeLEZRZ4mgufbrMwolcFHNRSjKZhpLa8TdooXOOFlSwoUzlbVs1t0l7upVRW2K7RWGHzbQ== +jest-haste-map@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-28.1.3.tgz#abd5451129a38d9841049644f34b034308944e2b" + integrity sha512-3S+RQWDXccXDKSWnkHa/dPwt+2qwA8CJzR61w3FoYCvoo3Pn8tvGcysmMF0Bj0EX5RYvAI2EIvC57OmotfdtKA== dependencies: - "@jest/types" "^28.1.1" + "@jest/types" "^28.1.3" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" jest-regex-util "^28.0.2" - jest-util "^28.1.1" - jest-worker "^28.1.1" + jest-util "^28.1.3" + jest-worker "^28.1.3" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-28.1.1.tgz#537f37afd610a4b3f4cab15e06baf60484548efb" - integrity sha512-4jvs8V8kLbAaotE+wFR7vfUGf603cwYtFf1/PYEsyX2BAjSzj8hQSVTP6OWzseTl0xL6dyHuKs2JAks7Pfubmw== +jest-leak-detector@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-28.1.3.tgz#a6685d9b074be99e3adee816ce84fd30795e654d" + integrity sha512-WFVJhnQsiKtDEo5lG2mM0v40QWnBM+zMdHHyJs8AWZ7J0QZJS59MsyKeJHWhpBZBH32S48FOVvGyOFT1h0DlqA== dependencies: jest-get-type "^28.0.2" - pretty-format "^28.1.1" + pretty-format "^28.1.3" -jest-matcher-utils@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-28.1.1.tgz#a7c4653c2b782ec96796eb3088060720f1e29304" - integrity sha512-NPJPRWrbmR2nAJ+1nmnfcKKzSwgfaciCCrYZzVnNoxVoyusYWIjkBMNvu0RHJe7dNj4hH3uZOPZsQA+xAYWqsw== +jest-matcher-utils@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-28.1.3.tgz#5a77f1c129dd5ba3b4d7fc20728806c78893146e" + integrity sha512-kQeJ7qHemKfbzKoGjHHrRKH6atgxMk8Enkk2iPQ3XwO6oE/KYD8lMYOziCkeSB9G4adPM4nR1DE8Tf5JeWH6Bw== dependencies: chalk "^4.0.0" - jest-diff "^28.1.1" + jest-diff "^28.1.3" jest-get-type "^28.0.2" - pretty-format "^28.1.1" + pretty-format "^28.1.3" -jest-message-util@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-28.1.1.tgz#60aa0b475cfc08c8a9363ed2fb9108514dd9ab89" - integrity sha512-xoDOOT66fLfmTRiqkoLIU7v42mal/SqwDKvfmfiWAdJMSJiU+ozgluO7KbvoAgiwIrrGZsV7viETjc8GNrA/IQ== +jest-message-util@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-28.1.3.tgz#232def7f2e333f1eecc90649b5b94b0055e7c43d" + integrity sha512-PFdn9Iewbt575zKPf1286Ht9EPoJmYT7P0kY+RibeYZ2XtOr53pDLEFoTWXbd1h4JiGiWpTBC84fc8xMXQMb7g== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^28.1.1" + "@jest/types" "^28.1.3" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^28.1.1" + pretty-format "^28.1.3" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-28.1.1.tgz#37903d269427fa1ef5b2447be874e1c62a39a371" - integrity sha512-bDCb0FjfsmKweAvE09dZT59IMkzgN0fYBH6t5S45NoJfd2DHkS3ySG2K+hucortryhO3fVuXdlxWcbtIuV/Skw== +jest-mock@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-28.1.3.tgz#d4e9b1fc838bea595c77ab73672ebf513ab249da" + integrity sha512-o3J2jr6dMMWYVH4Lh/NKmDXdosrsJgi4AviS8oXLujcjpCMBb1FMsblDnOXKZKfSiHLxYub1eS0IHuRXsio9eA== dependencies: - "@jest/types" "^28.1.1" + "@jest/types" "^28.1.3" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -1730,169 +1730,169 @@ jest-regex-util@^28.0.2: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-28.0.2.tgz#afdc377a3b25fb6e80825adcf76c854e5bf47ead" integrity sha512-4s0IgyNIy0y9FK+cjoVYoxamT7Zeo7MhzqRGx7YDYmaQn1wucY9rotiGkBzzcMXTtjrCAP/f7f+E0F7+fxPNdw== -jest-resolve-dependencies@^28.1.2: - version "28.1.2" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-28.1.2.tgz#ca528858e0c6642d5a1dda8fc7cda10230c275bc" - integrity sha512-OXw4vbOZuyRTBi3tapWBqdyodU+T33ww5cPZORuTWkg+Y8lmsxQlVu3MWtJh6NMlKRTHQetF96yGPv01Ye7Mbg== +jest-resolve-dependencies@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-28.1.3.tgz#8c65d7583460df7275c6ea2791901fa975c1fe66" + integrity sha512-qa0QO2Q0XzQoNPouMbCc7Bvtsem8eQgVPNkwn9LnS+R2n8DaVDPL/U1gngC0LTl1RYXJU0uJa2BMC2DbTfFrHA== dependencies: jest-regex-util "^28.0.2" - jest-snapshot "^28.1.2" + jest-snapshot "^28.1.3" -jest-resolve@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-28.1.1.tgz#bc2eaf384abdcc1aaf3ba7c50d1adf01e59095e5" - integrity sha512-/d1UbyUkf9nvsgdBildLe6LAD4DalgkgZcKd0nZ8XUGPyA/7fsnaQIlKVnDiuUXv/IeZhPEDrRJubVSulxrShA== +jest-resolve@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-28.1.3.tgz#cfb36100341ddbb061ec781426b3c31eb51aa0a8" + integrity sha512-Z1W3tTjE6QaNI90qo/BJpfnvpxtaFTFw5CDgwpyE/Kz8U/06N1Hjf4ia9quUhCh39qIGWF1ZuxFiBiJQwSEYKQ== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^28.1.1" + jest-haste-map "^28.1.3" jest-pnp-resolver "^1.2.2" - jest-util "^28.1.1" - jest-validate "^28.1.1" + jest-util "^28.1.3" + jest-validate "^28.1.3" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^28.1.2: - version "28.1.2" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-28.1.2.tgz#f293409592a62234285a71237e38499a3554e350" - integrity sha512-6/k3DlAsAEr5VcptCMdhtRhOoYClZQmxnVMZvZ/quvPGRpN7OBQYPIC32tWSgOnbgqLXNs5RAniC+nkdFZpD4A== - dependencies: - "@jest/console" "^28.1.1" - "@jest/environment" "^28.1.2" - "@jest/test-result" "^28.1.1" - "@jest/transform" "^28.1.2" - "@jest/types" "^28.1.1" +jest-runner@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-28.1.3.tgz#5eee25febd730b4713a2cdfd76bdd5557840f9a1" + integrity sha512-GkMw4D/0USd62OVO0oEgjn23TM+YJa2U2Wu5zz9xsQB1MxWKDOlrnykPxnMsN0tnJllfLPinHTka61u0QhaxBA== + dependencies: + "@jest/console" "^28.1.3" + "@jest/environment" "^28.1.3" + "@jest/test-result" "^28.1.3" + "@jest/transform" "^28.1.3" + "@jest/types" "^28.1.3" "@types/node" "*" chalk "^4.0.0" emittery "^0.10.2" graceful-fs "^4.2.9" jest-docblock "^28.1.1" - jest-environment-node "^28.1.2" - jest-haste-map "^28.1.1" - jest-leak-detector "^28.1.1" - jest-message-util "^28.1.1" - jest-resolve "^28.1.1" - jest-runtime "^28.1.2" - jest-util "^28.1.1" - jest-watcher "^28.1.1" - jest-worker "^28.1.1" + jest-environment-node "^28.1.3" + jest-haste-map "^28.1.3" + jest-leak-detector "^28.1.3" + jest-message-util "^28.1.3" + jest-resolve "^28.1.3" + jest-runtime "^28.1.3" + jest-util "^28.1.3" + jest-watcher "^28.1.3" + jest-worker "^28.1.3" + p-limit "^3.1.0" source-map-support "0.5.13" - throat "^6.0.1" -jest-runtime@^28.1.2: - version "28.1.2" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-28.1.2.tgz#d68f34f814a848555a345ceda23289f14d59a688" - integrity sha512-i4w93OsWzLOeMXSi9epmakb2+3z0AchZtUQVF1hesBmcQQy4vtaql5YdVe9KexdJaVRyPDw8DoBR0j3lYsZVYw== +jest-runtime@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-28.1.3.tgz#a57643458235aa53e8ec7821949e728960d0605f" + integrity sha512-NU+881ScBQQLc1JHG5eJGU7Ui3kLKrmwCPPtYsJtBykixrM2OhVQlpMmFWJjMyDfdkGgBMNjXCGB/ebzsgNGQw== dependencies: - "@jest/environment" "^28.1.2" - "@jest/fake-timers" "^28.1.2" - "@jest/globals" "^28.1.2" + "@jest/environment" "^28.1.3" + "@jest/fake-timers" "^28.1.3" + "@jest/globals" "^28.1.3" "@jest/source-map" "^28.1.2" - "@jest/test-result" "^28.1.1" - "@jest/transform" "^28.1.2" - "@jest/types" "^28.1.1" + "@jest/test-result" "^28.1.3" + "@jest/transform" "^28.1.3" + "@jest/types" "^28.1.3" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" execa "^5.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^28.1.1" - jest-message-util "^28.1.1" - jest-mock "^28.1.1" + jest-haste-map "^28.1.3" + jest-message-util "^28.1.3" + jest-mock "^28.1.3" jest-regex-util "^28.0.2" - jest-resolve "^28.1.1" - jest-snapshot "^28.1.2" - jest-util "^28.1.1" + jest-resolve "^28.1.3" + jest-snapshot "^28.1.3" + jest-util "^28.1.3" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^28.1.2: - version "28.1.2" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-28.1.2.tgz#93d31b87b11b384f5946fe0767541496135f8d52" - integrity sha512-wzrieFttZYfLvrCVRJxX+jwML2YTArOUqFpCoSVy1QUapx+LlV9uLbV/mMEhYj4t7aMeE9aSQFHSvV/oNoDAMA== +jest-snapshot@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-28.1.3.tgz#17467b3ab8ddb81e2f605db05583d69388fc0668" + integrity sha512-4lzMgtiNlc3DU/8lZfmqxN3AYD6GGLbl+72rdBpXvcV+whX7mDrREzkPdp2RnmfIiWBg1YbuFSkXduF2JcafJg== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^28.1.1" - "@jest/transform" "^28.1.2" - "@jest/types" "^28.1.1" + "@jest/expect-utils" "^28.1.3" + "@jest/transform" "^28.1.3" + "@jest/types" "^28.1.3" "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^28.1.1" + expect "^28.1.3" graceful-fs "^4.2.9" - jest-diff "^28.1.1" + jest-diff "^28.1.3" jest-get-type "^28.0.2" - jest-haste-map "^28.1.1" - jest-matcher-utils "^28.1.1" - jest-message-util "^28.1.1" - jest-util "^28.1.1" + jest-haste-map "^28.1.3" + jest-matcher-utils "^28.1.3" + jest-message-util "^28.1.3" + jest-util "^28.1.3" natural-compare "^1.4.0" - pretty-format "^28.1.1" + pretty-format "^28.1.3" semver "^7.3.5" -jest-util@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-28.1.1.tgz#ff39e436a1aca397c0ab998db5a51ae2b7080d05" - integrity sha512-FktOu7ca1DZSyhPAxgxB6hfh2+9zMoJ7aEQA759Z6p45NuO8mWcqujH+UdHlCm/V6JTWwDztM2ITCzU1ijJAfw== +jest-util@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-28.1.3.tgz#f4f932aa0074f0679943220ff9cbba7e497028b0" + integrity sha512-XdqfpHwpcSRko/C35uLYFM2emRAltIIKZiJ9eAmhjsj0CqZMa0p1ib0R5fWIqGhn1a103DebTbpqIaP1qCQ6tQ== dependencies: - "@jest/types" "^28.1.1" + "@jest/types" "^28.1.3" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-28.1.1.tgz#59b7b339b3c85b5144bd0c06ad3600f503a4acc8" - integrity sha512-Kpf6gcClqFCIZ4ti5++XemYJWUPCFUW+N2gknn+KgnDf549iLul3cBuKVe1YcWRlaF8tZV8eJCap0eECOEE3Ug== +jest-validate@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-28.1.3.tgz#e322267fd5e7c64cea4629612c357bbda96229df" + integrity sha512-SZbOGBWEsaTxBGCOpsRWlXlvNkvTkY0XxRfh7zYmvd8uL5Qzyg0CHAXiXKROflh801quA6+/DsT4ODDthOC/OA== dependencies: - "@jest/types" "^28.1.1" + "@jest/types" "^28.1.3" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^28.0.2" leven "^3.1.0" - pretty-format "^28.1.1" + pretty-format "^28.1.3" -jest-watcher@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-28.1.1.tgz#533597fb3bfefd52b5cd115cd916cffd237fb60c" - integrity sha512-RQIpeZ8EIJMxbQrXpJQYIIlubBnB9imEHsxxE41f54ZwcqWLysL/A0ZcdMirf+XsMn3xfphVQVV4EW0/p7i7Ug== +jest-watcher@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-28.1.3.tgz#c6023a59ba2255e3b4c57179fc94164b3e73abd4" + integrity sha512-t4qcqj9hze+jviFPUN3YAtAEeFnr/azITXQEMARf5cMwKY2SMBRnCQTXLixTl20OR6mLh9KLMrgVJgJISym+1g== dependencies: - "@jest/test-result" "^28.1.1" - "@jest/types" "^28.1.1" + "@jest/test-result" "^28.1.3" + "@jest/types" "^28.1.3" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.10.2" - jest-util "^28.1.1" + jest-util "^28.1.3" string-length "^4.0.1" -jest-worker@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-28.1.1.tgz#3480c73247171dfd01eda77200f0063ab6a3bf28" - integrity sha512-Au7slXB08C6h+xbJPp7VIb6U0XX5Kc9uel/WFc6/rcTzGiaVCBRngBExSYuXSLFPULPSYU3cJ3ybS988lNFQhQ== +jest-worker@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-28.1.3.tgz#7e3c4ce3fa23d1bb6accb169e7f396f98ed4bb98" + integrity sha512-CqRA220YV/6jCo8VWvAt1KKx6eek1VIHMPeLEbpcfSfkEeWyBNppynM/o6q+Wmw+sOhos2ml34wZbSX3G13//g== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^28.0.1: - version "28.1.2" - resolved "https://registry.yarnpkg.com/jest/-/jest-28.1.2.tgz#451ff24081ce31ca00b07b60c61add13aa96f8eb" - integrity sha512-Tuf05DwLeCh2cfWCQbcz9UxldoDyiR1E9Igaei5khjonKncYdc6LDfynKCEWozK0oLE3GD+xKAo2u8x/0s6GOg== + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest/-/jest-28.1.3.tgz#e9c6a7eecdebe3548ca2b18894a50f45b36dfc6b" + integrity sha512-N4GT5on8UkZgH0O5LUavMRV1EDEhNTL0KEfRmDIeZHSV7p2XgLoY9t9VDUgL6o+yfdgYHVxuz81G8oB9VG5uyA== dependencies: - "@jest/core" "^28.1.2" - "@jest/types" "^28.1.1" + "@jest/core" "^28.1.3" + "@jest/types" "^28.1.3" import-local "^3.0.2" - jest-cli "^28.1.2" + jest-cli "^28.1.3" js-tokens@^4.0.0: version "4.0.0" @@ -2101,6 +2101,13 @@ p-limit@^2.2.0: dependencies: p-try "^2.0.0" +p-limit@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + p-locate@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" @@ -2182,12 +2189,12 @@ prettier@>=2.3.0: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== -pretty-format@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-28.1.1.tgz#f731530394e0f7fcd95aba6b43c50e02d86b95cb" - integrity sha512-wwJbVTGFHeucr5Jw2bQ9P+VYHyLdAqedFLEkdQUVaBF/eiidDwH5OpilINq4mEfhbCjLnirt6HTTDhv1HaTIQw== +pretty-format@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-28.1.3.tgz#c9fba8cedf99ce50963a11b27d982a9ae90970d5" + integrity sha512-8gFb/To0OmxHR9+ZTb14Df2vNxdGCX8g1xWGUTqUw5TiZvcQf5sHKObd5UcPyLLyowNwDAMTF3XWOG1B6mxl1Q== dependencies: - "@jest/schemas" "^28.0.2" + "@jest/schemas" "^28.1.3" ansi-regex "^5.0.1" ansi-styles "^5.0.0" react-is "^18.0.0" @@ -2442,11 +2449,6 @@ text-table@^0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= -throat@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/throat/-/throat-6.0.1.tgz#d514fedad95740c12c2d7fc70ea863eb51ade375" - integrity sha512-8hmiGIJMDlwjg7dlJ4yKGLK8EsYqKgPWbG3b4wjJddKNwc7N7Dpn08Df4szr/sZdMVeOstrdYSsqzX6BYbcB+w== - tmpl@1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" @@ -2575,3 +2577,8 @@ yargs@^17.3.1: string-width "^4.2.3" y18n "^5.0.5" yargs-parser "^21.0.0" + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== From 2629fb0baeab98e288a071a20627e9a9a20414aa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Jul 2022 12:01:29 +0000 Subject: [PATCH 625/785] Bump eslint from 8.19.0 to 8.20.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.19.0 to 8.20.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.19.0...v8.20.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index dec46833..6f2c7920 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1105,9 +1105,9 @@ eslint-visitor-keys@^3.3.0: integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.15.0: - version "8.19.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.19.0.tgz#7342a3cbc4fbc5c106a1eefe0fd0b50b6b1a7d28" - integrity sha512-SXOPj3x9VKvPe81TjjUJCYlV4oJjQw68Uek+AM0X4p+33dj2HY5bpTZOgnQHcG2eAm1mtCU9uNMnJi7exU/kYw== + version "8.20.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.20.0.tgz#048ac56aa18529967da8354a478be4ec0a2bc81b" + integrity sha512-d4ixhz5SKCa1D6SCPrivP7yYVi7nyD6A4vs6HIAul9ujBzcEmZVM3/0NN/yu5nKhmO1wjp5xQ46iRfmDGlOviA== dependencies: "@eslint/eslintrc" "^1.3.0" "@humanwhocodes/config-array" "^0.9.2" From 85bbb9128b83731d4c0f32232a786fcbbab90cd6 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 27 Jun 2022 10:03:19 -0400 Subject: [PATCH 626/785] Respect tabwidth --- src/parseSync.js | 2 +- src/server.rb | 31 +++++++++++++++++++++++-------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/parseSync.js b/src/parseSync.js index c39467bf..fabfeb52 100644 --- a/src/parseSync.js +++ b/src/parseSync.js @@ -181,7 +181,7 @@ function parseSync(parser, source, opts) { } const response = spawnSync(parserArgs.cmd, parserArgs.args, { - input: `${parser}|${opts.printWidth}|${source}`, + input: `${parser}|${opts.printWidth}|${opts.tabWidth}|${source}`, maxBuffer: 15 * 1024 * 1024 }); diff --git a/src/server.rb b/src/server.rb index ab4496b6..57d3232a 100644 --- a/src/server.rb +++ b/src/server.rb @@ -74,8 +74,8 @@ # Start up a new thread that will handle each successive connection. Thread.new(server.accept_nonblock) do |socket| - parser, width, source = - socket.read.force_encoding("UTF-8").split("|", 3) + parser, maxwidth_string, tabwidth_string, source = + socket.read.force_encoding("UTF-8").split("|", 4) source.each_line do |line| case line @@ -92,25 +92,40 @@ end end - maxwidth = width.to_i + # At the moment, we're not going to support odd tabwidths. It's going to + # have to be a multiple of 2, because of the way that the prettyprint + # gem functions. So we're going to just use integer division here. + scalar = tabwidth_string.to_i / 2 + genspace = ->(n) { " " * n * scalar } + + maxwidth = maxwidth_string.to_i response = case parser when "ping" "pong" when "ruby" - formatter = SyntaxTree::Formatter.new(source, [], maxwidth) + formatter = + SyntaxTree::Formatter.new(source, [], maxwidth, "\n", &genspace) SyntaxTree.parse(source).format(formatter) formatter.flush formatter.output.join when "rbs" - formatter = SyntaxTree::RBS::Formatter.new(source, [], maxwidth) + formatter = + SyntaxTree::RBS::Formatter.new( + source, + [], + maxwidth, + "\n", + &genspace + ) SyntaxTree::RBS.parse(source).format(formatter) formatter.flush formatter.output.join when "haml" - PrettierPrint.format(+"", maxwidth) do |q| - SyntaxTree::Haml.parse(source).format(q) - end + formatter = PrettierPrint.new(+"", maxwidth, "\n", &genspace) + SyntaxTree::Haml.parse(source).format(formatter) + formatter.flush + formatter.output end if response From d1eb56712d055c3305c9dd2eccafb0085d703be6 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 22 Jul 2022 13:17:06 -0400 Subject: [PATCH 627/785] Bump version to 3.2.0 --- CHANGELOG.md | 12 ++++++++++++ package.json | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 218eca5e..21d15d2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,18 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [3.2.0] - 2022-07-22 + +### Added + +- [#1250](https://github.com/prettier/plugin-ruby/issues/1250) - alexf101, kddnewton - Respect the `tabWidth` option. + +### Changed + +- [#1255](https://github.com/prettier/plugin-ruby/pull/1255) - soberstadt - The rake task now runs check if write is false. +- [#1237](https://github.com/prettier/plugin-ruby/issues/1237) - boris-petrov - Disable the style rules associated with quotes. +- [#1248](https://github.com/prettier/plugin-ruby/pull/1248) - mhssmnn - Fix process waiting on STDIN. + ## [3.1.2] - 2022-05-13 ### Changed diff --git a/package.json b/package.json index b9a37b9e..bd5e1045 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "3.1.2", + "version": "3.2.0", "description": "prettier plugin for the Ruby programming language", "main": "src/plugin.js", "scripts": { From 053b7beea4c0d8f42c17afe6da3c3b2853464c24 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Aug 2022 12:01:06 +0000 Subject: [PATCH 628/785] Bump eslint from 8.20.0 to 8.21.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.20.0 to 8.21.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.20.0...v8.21.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 168 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 148 insertions(+), 20 deletions(-) diff --git a/yarn.lock b/yarn.lock index 6f2c7920..074ccef7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -301,15 +301,20 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@humanwhocodes/config-array@^0.9.2": - version "0.9.5" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.5.tgz#2cbaf9a89460da24b5ca6531b8bbfc23e1df50c7" - integrity sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw== +"@humanwhocodes/config-array@^0.10.4": + version "0.10.4" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.10.4.tgz#01e7366e57d2ad104feea63e72248f22015c520c" + integrity sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw== dependencies: "@humanwhocodes/object-schema" "^1.2.1" debug "^4.1.1" minimatch "^3.0.4" +"@humanwhocodes/gitignore-to-minimatch@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz#316b0a63b91c10e53f242efb4ace5c3b34e8728d" + integrity sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA== + "@humanwhocodes/object-schema@^1.2.1": version "1.2.1" resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" @@ -563,6 +568,27 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== + dependencies: + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + +"@nodelib/fs.walk@^1.2.3": + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== + dependencies: + "@nodelib/fs.scandir" "2.1.5" + fastq "^1.6.0" + "@sinclair/typebox@^0.24.1": version "0.24.19" resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.19.tgz#5297278e0d8a1aea084685a3216074910ac6c113" @@ -678,10 +704,10 @@ acorn-jsx@^5.3.2: resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn@^8.7.1: - version "8.7.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.1.tgz#0197122c843d1bf6d0a5e83220a788f278f63c30" - integrity sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A== +acorn@^8.8.0: + version "8.8.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" + integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== ajv@^6.10.0, ajv@^6.12.4: version "6.12.6" @@ -1018,6 +1044,13 @@ diff-sequences@^28.1.1: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-28.1.1.tgz#9989dc731266dc2903457a70e996f3a041913ac6" integrity sha512-FU0iFaH/E23a+a718l8Qa/19bF9p06kgE0KipMOMadwa3SjnaElKzPaUC0vnibs6/B/9ni97s61mcejk8W1fQw== +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + doctrine@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" @@ -1105,12 +1138,13 @@ eslint-visitor-keys@^3.3.0: integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.15.0: - version "8.20.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.20.0.tgz#048ac56aa18529967da8354a478be4ec0a2bc81b" - integrity sha512-d4ixhz5SKCa1D6SCPrivP7yYVi7nyD6A4vs6HIAul9ujBzcEmZVM3/0NN/yu5nKhmO1wjp5xQ46iRfmDGlOviA== + version "8.21.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.21.0.tgz#1940a68d7e0573cef6f50037addee295ff9be9ef" + integrity sha512-/XJ1+Qurf1T9G2M5IHrsjp+xrGT73RZf23xA1z5wB1ZzzEAWSZKvRwhWxTFp1rvkvCfwcvAUNAP31bhKTTGfDA== dependencies: "@eslint/eslintrc" "^1.3.0" - "@humanwhocodes/config-array" "^0.9.2" + "@humanwhocodes/config-array" "^0.10.4" + "@humanwhocodes/gitignore-to-minimatch" "^1.0.2" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" @@ -1120,14 +1154,17 @@ eslint@^8.15.0: eslint-scope "^7.1.1" eslint-utils "^3.0.0" eslint-visitor-keys "^3.3.0" - espree "^9.3.2" + espree "^9.3.3" esquery "^1.4.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" + find-up "^5.0.0" functional-red-black-tree "^1.0.1" glob-parent "^6.0.1" globals "^13.15.0" + globby "^11.1.0" + grapheme-splitter "^1.0.4" ignore "^5.2.0" import-fresh "^3.0.0" imurmurhash "^0.1.4" @@ -1145,12 +1182,12 @@ eslint@^8.15.0: text-table "^0.2.0" v8-compile-cache "^2.0.3" -espree@^9.3.2: - version "9.3.2" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.2.tgz#f58f77bd334731182801ced3380a8cc859091596" - integrity sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA== +espree@^9.3.2, espree@^9.3.3: + version "9.3.3" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.3.tgz#2dd37c4162bb05f433ad3c1a52ddf8a49dc08e9d" + integrity sha512-ORs1Rt/uQTqUKjDdGCyrtYxbazf5umATSf/K4qxjmZHORR6HJk+2s/2Pqe+Kk49HHINC/xNIrGfgh8sZcll0ng== dependencies: - acorn "^8.7.1" + acorn "^8.8.0" acorn-jsx "^5.3.2" eslint-visitor-keys "^3.3.0" @@ -1234,6 +1271,17 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== +fast-glob@^3.2.9: + version "3.2.11" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.11.tgz#a1172ad95ceb8a16e20caa5c5e56480e5129c1d9" + integrity sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" @@ -1244,6 +1292,13 @@ fast-levenshtein@^2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= +fastq@^1.6.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" + integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== + dependencies: + reusify "^1.0.4" + fb-watchman@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85" @@ -1273,6 +1328,14 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" +find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" @@ -1333,6 +1396,13 @@ get-stream@^6.0.0: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== +glob-parent@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + glob-parent@^6.0.1: version "6.0.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" @@ -1364,11 +1434,28 @@ globals@^13.15.0: dependencies: type-fest "^0.20.2" +globby@^11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" + integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.2.9" + ignore "^5.2.0" + merge2 "^1.4.1" + slash "^3.0.0" + graceful-fs@^4.2.9: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== +grapheme-splitter@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" + integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== + has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -1472,7 +1559,7 @@ is-generator-fn@^2.0.0: resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== -is-glob@^4.0.0, is-glob@^4.0.3: +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== @@ -1969,6 +2056,13 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" @@ -2000,6 +2094,11 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== +merge2@^1.3.0, merge2@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + micromatch@^4.0.4: version "4.0.5" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" @@ -2101,7 +2200,7 @@ p-limit@^2.2.0: dependencies: p-try "^2.0.0" -p-limit@^3.1.0: +p-limit@^3.0.2, p-limit@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== @@ -2115,6 +2214,13 @@ p-locate@^4.1.0: dependencies: p-limit "^2.2.0" +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + p-try@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" @@ -2157,6 +2263,11 @@ path-parse@^1.0.7: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + picocolors@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" @@ -2232,6 +2343,11 @@ punycode@^2.1.0: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== +queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + react-is@^18.0.0: version "18.1.0" resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.1.0.tgz#61aaed3096d30eacf2a2127118b5b41387d32a67" @@ -2278,6 +2394,11 @@ resolve@^1.20.0: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + rimraf@^3.0.0, rimraf@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" @@ -2285,6 +2406,13 @@ rimraf@^3.0.0, rimraf@^3.0.2: dependencies: glob "^7.1.3" +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" From fdaa5d6ddf128d87d391b12ed9876c4846311c4a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Aug 2022 12:01:25 +0000 Subject: [PATCH 629/785] Bump eslint from 8.21.0 to 8.22.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.21.0 to 8.22.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.21.0...v8.22.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 074ccef7..f4654254 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1138,9 +1138,9 @@ eslint-visitor-keys@^3.3.0: integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.15.0: - version "8.21.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.21.0.tgz#1940a68d7e0573cef6f50037addee295ff9be9ef" - integrity sha512-/XJ1+Qurf1T9G2M5IHrsjp+xrGT73RZf23xA1z5wB1ZzzEAWSZKvRwhWxTFp1rvkvCfwcvAUNAP31bhKTTGfDA== + version "8.22.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.22.0.tgz#78fcb044196dfa7eef30a9d65944f6f980402c48" + integrity sha512-ci4t0sz6vSRKdmkOGmprBo6fmI4PrphDFMy5JEq/fNS0gQkJM3rLmrqcp8ipMcdobH3KtUP40KniAE9W19S4wA== dependencies: "@eslint/eslintrc" "^1.3.0" "@humanwhocodes/config-array" "^0.10.4" From daaca2142ce657a0e813574740cc12fa197ebf78 Mon Sep 17 00:00:00 2001 From: David Buchan-Swanson Date: Wed, 10 Aug 2022 16:01:48 +1000 Subject: [PATCH 630/785] add back support for standard prettier config options --- README.md | 14 ++++++++------ src/parseSync.js | 13 ++++++++++++- src/plugin.js | 4 +++- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 23869966..76454ed5 100644 --- a/README.md +++ b/README.md @@ -134,12 +134,14 @@ The `prettier` executable is now installed and ready for use: Below are the options (from [`src/plugin.js`](src/plugin.js)) that `@prettier/plugin-ruby` currently supports: -| API Option | CLI Option | Default | Description | -| --------------- | ------------------ | :-----: | --------------------------------------------------------------------------------------------------------------------------- | -| `printWidth` | `--print-width` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)). | -| `requirePragma` | `--require-pragma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#require-pragma)). | -| `rubyPlugins` | `--ruby-plugins` | `""` | The comma-separated list of plugins to require. See [Syntax Tree](https://github.com/ruby-syntax-tree/syntax_tree#plugins). | -| `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). | +| API Option | CLI Option | Default | Description | +| --------------- | ------------------ | :-----: | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| `printWidth` | `--print-width` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)). | +| `requirePragma` | `--require-pragma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#require-pragma)). | +| `rubyPlugins` | `--ruby-plugins` | `""` | The comma-separated list of plugins to require. See [Syntax Tree](https://github.com/ruby-syntax-tree/syntax_tree#plugins). | +| `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). | +| `singleQuote` | `--single-quote` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#quotes)). | +| `trailingComma` | `--trailing-comma` | `es5` | Almost same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#trailing-commas)). Will be on for any value except `none`. | Any of these can be added to your existing [prettier configuration file](https://prettier.io/docs/en/configuration.html). For example: diff --git a/src/parseSync.js b/src/parseSync.js index fabfeb52..a9a7c543 100644 --- a/src/parseSync.js +++ b/src/parseSync.js @@ -114,9 +114,20 @@ function spawnServer(opts) { }; } + const plugins = new Set(opts.rubyPlugins.split(",")); + if (opts.singleQuote) { + plugins.add("plugin/single_quotes"); + } + + if (opts.trailingComma !== "none") { + plugins.add("plugin/trailing_comma"); + } + + const rubyPlugins = Array.from(plugins).join(","); + const server = spawn( "ruby", - [serverRbPath, `--plugins=${opts.rubyPlugins}`, filepath], + [serverRbPath, `--plugins=${rubyPlugins}`, filepath], { env: Object.assign({}, process.env, { LANG: getLang() }), detached: true, diff --git a/src/plugin.js b/src/plugin.js index 9dcda0d3..45c3f95c 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -163,7 +163,9 @@ const plugin = { }, defaultOptions: { printWidth: 80, - tabWidth: 2 + tabWidth: 2, + trailingComma: "none", + singleQuote: false } }; From f61513dfb6ffdf6d4e56c401455738d76add8b4c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Aug 2022 12:01:23 +0000 Subject: [PATCH 631/785] Bump jest from 28.1.3 to 29.0.0 Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 28.1.3 to 29.0.0. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.0.0/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 742 ++++++++++++++++++++++++++------------------------- 2 files changed, 382 insertions(+), 362 deletions(-) diff --git a/package.json b/package.json index bd5e1045..15dd8fdd 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "eslint": "^8.15.0", "eslint-config-prettier": "^8.0.0", "husky": "^8.0.1", - "jest": "^28.0.1", + "jest": "^29.0.0", "pretty-quick": "^3.1.2" }, "eslintConfig": { diff --git a/yarn.lock b/yarn.lock index f4654254..c6224a57 100644 --- a/yarn.lock +++ b/yarn.lock @@ -110,6 +110,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz#aa3a8ab4c3cceff8e65eb9e73d87dc4ff320b2f5" integrity sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA== +"@babel/helper-plugin-utils@^7.18.6": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.18.9.tgz#4b8aea3b069d8cb8a72cdfe28ddf5ceca695ef2f" + integrity sha512-aBXPT3bmtLryXaoJLyYPXPlSD4p1ld9aYeR+sJNOZjJJGiOpb+fKfh3NkcCu7J54nUJwCERPBExCCpyCOHnu/w== + "@babel/helper-simple-access@^7.17.7": version "7.17.7" resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz#aaa473de92b7987c6dfa7ce9a7d9674724823367" @@ -192,6 +197,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" +"@babel/plugin-syntax-jsx@^7.7.2": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz#a8feef63b010150abd97f1649ec296e849943ca0" + integrity sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/plugin-syntax-logical-assignment-operators@^7.8.3": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" @@ -336,110 +348,110 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-28.1.3.tgz#2030606ec03a18c31803b8a36382762e447655df" - integrity sha512-QPAkP5EwKdK/bxIr6C1I4Vs0rm2nHiANzj/Z5X2JQkrZo6IqvC4ldZ9K95tF0HdidhA8Bo6egxSzUFPYKcEXLw== +"@jest/console@^29.0.0": + version "29.0.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.0.0.tgz#1e49fcbff7d20c88a6747f27e2fec0e759e405ca" + integrity sha512-rHsKEqT2Kx73PqO9qIOdwg0Grd6Y3COyqNpi5SKRI0qXgmlqXkOczQMfIb8I0Gdnc9/kaMj6cTnBGLyBA03Xrg== dependencies: - "@jest/types" "^28.1.3" + "@jest/types" "^29.0.0" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^28.1.3" - jest-util "^28.1.3" + jest-message-util "^29.0.0" + jest-util "^29.0.0" slash "^3.0.0" -"@jest/core@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-28.1.3.tgz#0ebf2bd39840f1233cd5f2d1e6fc8b71bd5a1ac7" - integrity sha512-CIKBrlaKOzA7YG19BEqCw3SLIsEwjZkeJzf5bdooVnW4bH5cktqe3JX+G2YV1aK5vP8N9na1IGWFzYaTp6k6NA== +"@jest/core@^29.0.0": + version "29.0.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.0.0.tgz#6e9213014895bd91117f500bc9e8865d66f981fb" + integrity sha512-9qljprspjQwbmnq3Wv9d/M6/ejMdWs1uAAljQAX9QsjJ1SlSByXw1mRA9UpR2BP9TxLLwEembbm0ykrT//2STg== dependencies: - "@jest/console" "^28.1.3" - "@jest/reporters" "^28.1.3" - "@jest/test-result" "^28.1.3" - "@jest/transform" "^28.1.3" - "@jest/types" "^28.1.3" + "@jest/console" "^29.0.0" + "@jest/reporters" "^29.0.0" + "@jest/test-result" "^29.0.0" + "@jest/transform" "^29.0.0" + "@jest/types" "^29.0.0" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" ci-info "^3.2.0" exit "^0.1.2" graceful-fs "^4.2.9" - jest-changed-files "^28.1.3" - jest-config "^28.1.3" - jest-haste-map "^28.1.3" - jest-message-util "^28.1.3" - jest-regex-util "^28.0.2" - jest-resolve "^28.1.3" - jest-resolve-dependencies "^28.1.3" - jest-runner "^28.1.3" - jest-runtime "^28.1.3" - jest-snapshot "^28.1.3" - jest-util "^28.1.3" - jest-validate "^28.1.3" - jest-watcher "^28.1.3" + jest-changed-files "^29.0.0" + jest-config "^29.0.0" + jest-haste-map "^29.0.0" + jest-message-util "^29.0.0" + jest-regex-util "^29.0.0" + jest-resolve "^29.0.0" + jest-resolve-dependencies "^29.0.0" + jest-runner "^29.0.0" + jest-runtime "^29.0.0" + jest-snapshot "^29.0.0" + jest-util "^29.0.0" + jest-validate "^29.0.0" + jest-watcher "^29.0.0" micromatch "^4.0.4" - pretty-format "^28.1.3" - rimraf "^3.0.0" + pretty-format "^29.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-28.1.3.tgz#abed43a6b040a4c24fdcb69eab1f97589b2d663e" - integrity sha512-1bf40cMFTEkKyEf585R9Iz1WayDjHoHqvts0XFYEqyKM3cFWDpeMoqKKTAF9LSYQModPUlh8FKptoM2YcMWAXA== +"@jest/environment@^29.0.0": + version "29.0.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.0.0.tgz#069758196cae8458d8b7a7778d0877f2ec04da83" + integrity sha512-ZHLvUENMAnwXowtyhmPRS0QLCXM4TS0ZfuiSR4QfRsJVN5lG4KdBDvI9kHJe/21vrgzPVOkvI7IBnkyPFCbV7g== dependencies: - "@jest/fake-timers" "^28.1.3" - "@jest/types" "^28.1.3" + "@jest/fake-timers" "^29.0.0" + "@jest/types" "^29.0.0" "@types/node" "*" - jest-mock "^28.1.3" + jest-mock "^29.0.0" -"@jest/expect-utils@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-28.1.3.tgz#58561ce5db7cd253a7edddbc051fb39dda50f525" - integrity sha512-wvbi9LUrHJLn3NlDW6wF2hvIMtd4JUl2QNVrjq+IBSHirgfrR3o9RnVtxzdEGO2n9JyIWwHnLfby5KzqBGg2YA== +"@jest/expect-utils@^29.0.0": + version "29.0.0" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.0.0.tgz#aa3a2cbe4630ac2095cd2bcd3040fe42015fe9ed" + integrity sha512-odQ+cjUpui6++a9Ua/oWn7CG0Af+EZe9weWZbfUQHTg7C3K9PCb0AnD4X7nyAe4WjfeZmVVyG5SJELMQaUbCtg== dependencies: - jest-get-type "^28.0.2" + jest-get-type "^29.0.0" -"@jest/expect@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-28.1.3.tgz#9ac57e1d4491baca550f6bdbd232487177ad6a72" - integrity sha512-lzc8CpUbSoE4dqT0U+g1qODQjBRHPpCPXissXD4mS9+sWQdmmpeJ9zSH1rS1HEkrsMN0fb7nKrJ9giAR1d3wBw== +"@jest/expect@^29.0.0": + version "29.0.0" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.0.0.tgz#e4586136c27aa460afa427db2cd494d890d07b48" + integrity sha512-X2S5NpZOeXXDGBLvU/4K1nAD5iIz6/9Gs041wToI0FiX3glh/aEGGsVv3+SxKddYIb6Ei+ZbqzJmfRzQ7nwPlQ== dependencies: - expect "^28.1.3" - jest-snapshot "^28.1.3" + expect "^29.0.0" + jest-snapshot "^29.0.0" -"@jest/fake-timers@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-28.1.3.tgz#230255b3ad0a3d4978f1d06f70685baea91c640e" - integrity sha512-D/wOkL2POHv52h+ok5Oj/1gOG9HSywdoPtFsRCUmlCILXNn5eIWmcnd3DIiWlJnpGvQtmajqBP95Ei0EimxfLw== +"@jest/fake-timers@^29.0.0": + version "29.0.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.0.0.tgz#6f9a3a6318af5fd6cbac52e20aa868f5643aba23" + integrity sha512-4tqH5fT9H0+Ms3Z1HLZ/JfpzJluep2Zo3uuj0KPyu6IIyYSHCDfkXuiBQNWUGvumZDLQ2Si03cC7Gq0r73VgVg== dependencies: - "@jest/types" "^28.1.3" + "@jest/types" "^29.0.0" "@sinonjs/fake-timers" "^9.1.2" "@types/node" "*" - jest-message-util "^28.1.3" - jest-mock "^28.1.3" - jest-util "^28.1.3" + jest-message-util "^29.0.0" + jest-mock "^29.0.0" + jest-util "^29.0.0" -"@jest/globals@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-28.1.3.tgz#a601d78ddc5fdef542728309894895b4a42dc333" - integrity sha512-XFU4P4phyryCXu1pbcqMO0GSQcYe1IsalYCDzRNyhetyeyxMcIxa11qPNDpVNLeretItNqEmYYQn1UYz/5x1NA== +"@jest/globals@^29.0.0": + version "29.0.0" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.0.0.tgz#8a65b224e2eb1458d3780652d4ad832611d16066" + integrity sha512-ZHQMh6BZtabbikh9wkuPpVQmPHEpc4EgOaY/UJNM6hHHA5HRmiP5rH54M8267nkGscuqM5KpWP+zAZ4XEOXZag== dependencies: - "@jest/environment" "^28.1.3" - "@jest/expect" "^28.1.3" - "@jest/types" "^28.1.3" + "@jest/environment" "^29.0.0" + "@jest/expect" "^29.0.0" + "@jest/types" "^29.0.0" + jest-mock "^29.0.0" -"@jest/reporters@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-28.1.3.tgz#9adf6d265edafc5fc4a434cfb31e2df5a67a369a" - integrity sha512-JuAy7wkxQZVNU/V6g9xKzCGC5LVXx9FDcABKsSXp5MiKPEE2144a/vXTEDoyzjUpZKfVwp08Wqg5A4WfTMAzjg== +"@jest/reporters@^29.0.0": + version "29.0.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.0.0.tgz#2bcdee6c8a347acdc93421fffc441a2c282a8b0f" + integrity sha512-6ZFLlHQwncULTucAKWeGJLGPvzjgC/0gFmxJi/LgU9G1v498r/RcWQiZBPqhJcSvpWGTCaqjvUGmPCLtrUpubw== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^28.1.3" - "@jest/test-result" "^28.1.3" - "@jest/transform" "^28.1.3" - "@jest/types" "^28.1.3" - "@jridgewell/trace-mapping" "^0.3.13" + "@jest/console" "^29.0.0" + "@jest/test-result" "^29.0.0" + "@jest/transform" "^29.0.0" + "@jest/types" "^29.0.0" + "@jridgewell/trace-mapping" "^0.3.15" "@types/node" "*" chalk "^4.0.0" collect-v8-coverage "^1.0.0" @@ -451,78 +463,78 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^28.1.3" - jest-util "^28.1.3" - jest-worker "^28.1.3" + jest-message-util "^29.0.0" + jest-util "^29.0.0" + jest-worker "^29.0.0" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" terminal-link "^2.0.0" v8-to-istanbul "^9.0.1" -"@jest/schemas@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-28.1.3.tgz#ad8b86a66f11f33619e3d7e1dcddd7f2d40ff905" - integrity sha512-/l/VWsdt/aBXgjshLWOFyFt3IVdYypu5y2Wn2rOO1un6nkqIn8SLXzgIMYXFyYsRWDyF5EthmKJMIdJvk08grg== +"@jest/schemas@^29.0.0": + version "29.0.0" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.0.0.tgz#5f47f5994dd4ef067fb7b4188ceac45f77fe952a" + integrity sha512-3Ab5HgYIIAnS0HjqJHQYZS+zXc4tUmTmBH3z83ajI6afXp8X3ZtdLX+nXx+I7LNkJD7uN9LAVhgnjDgZa2z0kA== dependencies: "@sinclair/typebox" "^0.24.1" -"@jest/source-map@^28.1.2": - version "28.1.2" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-28.1.2.tgz#7fe832b172b497d6663cdff6c13b0a920e139e24" - integrity sha512-cV8Lx3BeStJb8ipPHnqVw/IM2VCMWO3crWZzYodSIkxXnRcXJipCdx1JCK0K5MsJJouZQTH73mzf4vgxRaH9ww== +"@jest/source-map@^29.0.0": + version "29.0.0" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.0.0.tgz#f8d1518298089f8ae624e442bbb6eb870ee7783c" + integrity sha512-nOr+0EM8GiHf34mq2GcJyz/gYFyLQ2INDhAylrZJ9mMWoW21mLBfZa0BUVPPMxVYrLjeiRe2Z7kWXOGnS0TFhQ== dependencies: - "@jridgewell/trace-mapping" "^0.3.13" + "@jridgewell/trace-mapping" "^0.3.15" callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-28.1.3.tgz#5eae945fd9f4b8fcfce74d239e6f725b6bf076c5" - integrity sha512-kZAkxnSE+FqE8YjW8gNuoVkkC9I7S1qmenl8sGcDOLropASP+BkcGKwhXoyqQuGOGeYY0y/ixjrd/iERpEXHNg== +"@jest/test-result@^29.0.0": + version "29.0.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.0.0.tgz#592f556b94a9d9aed951dd43c310370239c9cb56" + integrity sha512-mv76j8ILaqOuZAWBGR1/ZSRinN5Q/eEji7kMcvADjd+gQGfn/Py+91nUrVakJT69idC66bvQ7yF24frQpzFKUg== dependencies: - "@jest/console" "^28.1.3" - "@jest/types" "^28.1.3" + "@jest/console" "^29.0.0" + "@jest/types" "^29.0.0" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-28.1.3.tgz#9d0c283d906ac599c74bde464bc0d7e6a82886c3" - integrity sha512-NIMPEqqa59MWnDi1kvXXpYbqsfQmSJsIbnd85mdVGkiDfQ9WQQTXOLsvISUfonmnBT+w85WEgneCigEEdHDFxw== +"@jest/test-sequencer@^29.0.0": + version "29.0.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.0.0.tgz#32da68bec6f83f5f2c7936946eac54d80ba96d0e" + integrity sha512-uL6yX//SUME1c/ucbY365obdsrPjvSoNBwB80WTe+drYL4jf7A87vA2+w4hYwXJEIGQspv5skg3iB/sJSys7ew== dependencies: - "@jest/test-result" "^28.1.3" + "@jest/test-result" "^29.0.0" graceful-fs "^4.2.9" - jest-haste-map "^28.1.3" + jest-haste-map "^29.0.0" slash "^3.0.0" -"@jest/transform@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-28.1.3.tgz#59d8098e50ab07950e0f2fc0fc7ec462371281b0" - integrity sha512-u5dT5di+oFI6hfcLOHGTAfmUxFRrjK+vnaP0kkVow9Md/M7V/MxqQMOz/VV25UZO8pzeA9PjfTpOu6BDuwSPQA== +"@jest/transform@^29.0.0": + version "29.0.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.0.0.tgz#a19c6af7724786ac286dde2037d077372ce8c76e" + integrity sha512-hwyBt8UR5o8GGaphmRqNQwVCctiOR8ncugCp/RlInEZvQ+ysKkS5TFfe5RgeQ0KtKdWByQqn5yA574LLOp3OWw== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^28.1.3" - "@jridgewell/trace-mapping" "^0.3.13" + "@jest/types" "^29.0.0" + "@jridgewell/trace-mapping" "^0.3.15" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^1.4.0" - fast-json-stable-stringify "^2.0.0" + fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^28.1.3" - jest-regex-util "^28.0.2" - jest-util "^28.1.3" + jest-haste-map "^29.0.0" + jest-regex-util "^29.0.0" + jest-util "^29.0.0" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" write-file-atomic "^4.0.1" -"@jest/types@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-28.1.3.tgz#b05de80996ff12512bc5ceb1d208285a7d11748b" - integrity sha512-RyjiyMUZrKz/c+zlMFO1pm70DcIlST8AeWTkoUdZevew44wcNZQHsEVOiCVtgVnlFFD82FPaXycys58cf2muVQ== +"@jest/types@^29.0.0": + version "29.0.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.0.0.tgz#16bef8898fec32c2c5c17a6eb770539986322587" + integrity sha512-ErShruvByUF7vphEtPugMAphCtDIDdfWh3DxpBLxPEtHhL/H5MaidHsOutnOUhKpPL7QA6/7GitjFgLOLeGa1A== dependencies: - "@jest/schemas" "^28.1.3" + "@jest/schemas" "^29.0.0" "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" "@types/node" "*" @@ -552,7 +564,7 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz#b6461fb0c2964356c469e115f504c95ad97ab88c" integrity sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w== -"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.13": +"@jridgewell/trace-mapping@^0.3.12": version "0.3.14" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz#b231a081d8f66796e475ad588a1ef473112701ed" integrity sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ== @@ -560,6 +572,14 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" +"@jridgewell/trace-mapping@^0.3.15": + version "0.3.15" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz#aba35c48a38d3fd84b37e66c9c0423f9744f9774" + integrity sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping@^0.3.9": version "0.3.13" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.13.tgz#dcfe3e95f224c8fe97a87a5235defec999aa92ea" @@ -785,15 +805,15 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-28.1.3.tgz#c1187258197c099072156a0a121c11ee1e3917d5" - integrity sha512-epUaPOEWMk3cWX0M/sPvCHHCe9fMFAa/9hXEgKP8nFfNl/jlGkE9ucq9NqkZGXLDduCJYS0UvSlPUwC0S+rH6Q== +babel-jest@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.0.0.tgz#abf783ce6eb999cfb6764915bd86d3055a8ae3be" + integrity sha512-EJM2dqxz9+uWJLLucZLPYAmRsHHt1IMkitAHGqjDlIP2IQXzkIMO3ATbBWk0lU6VwX4rNeVN04t/DDB8U5C2rg== dependencies: - "@jest/transform" "^28.1.3" + "@jest/transform" "^29.0.0" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^28.1.3" + babel-preset-jest "^29.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" slash "^3.0.0" @@ -809,10 +829,10 @@ babel-plugin-istanbul@^6.1.1: istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-28.1.3.tgz#1952c4d0ea50f2d6d794353762278d1d8cca3fbe" - integrity sha512-Ys3tUKAmfnkRUpPdpa98eYrAR0nV+sSFUZZEGuQ2EbFd1y4SOLtD5QDNHAq+bb9a+bbXvYQC4b+ID/THIMcU6Q== +babel-plugin-jest-hoist@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.0.0.tgz#ae4873399a199ede93697a15919d3d0f614a2eb1" + integrity sha512-B9oaXrlxXHFWeWqhDPg03iqQd2UN/mg/VdZOsLaqAVBkztru3ctTryAI4zisxLEEgmcUnLTKewqx0gGifoXD3A== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -837,12 +857,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-28.1.3.tgz#5dfc20b99abed5db994406c2b9ab94c73aaa419d" - integrity sha512-L+fupJvlWAHbQfn74coNX3zf60LXMJsezNvvx8eIh7iOR1luJ1poxYgQk1F8PYtNq/6QODDHCqsSnTFSWC491A== +babel-preset-jest@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.0.0.tgz#52d7f1afe3a15d14a3c5ab4349cbd388d98d330b" + integrity sha512-B5Ke47Xcs8rDF3p1korT3LoilpADCwbG93ALqtvqu6Xpf4d8alKkrCBTExbNzdHJcIuEPpfYvEaFFRGee2kUgQ== dependencies: - babel-plugin-jest-hoist "^28.1.3" + babel-plugin-jest-hoist "^29.0.0" babel-preset-current-node-syntax "^1.0.0" balanced-match@^1.0.0: @@ -1039,10 +1059,10 @@ detect-newline@^3.0.0: resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== -diff-sequences@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-28.1.1.tgz#9989dc731266dc2903457a70e996f3a041913ac6" - integrity sha512-FU0iFaH/E23a+a718l8Qa/19bF9p06kgE0KipMOMadwa3SjnaElKzPaUC0vnibs6/B/9ni97s61mcejk8W1fQw== +diff-sequences@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.0.0.tgz#bae49972ef3933556bcb0800b72e8579d19d9e4f" + integrity sha512-7Qe/zd1wxSDL4D/X/FPjOMB+ZMDt71W94KYaq05I2l0oQqgXgs7s4ftYYmV38gBSrPz2vcygxfs1xn0FT+rKNA== dir-glob@^3.0.1: version "3.0.1" @@ -1255,16 +1275,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/expect/-/expect-28.1.3.tgz#90a7c1a124f1824133dd4533cce2d2bdcb6603ec" - integrity sha512-eEh0xn8HlsuOBxFgIss+2mX85VAS4Qy3OSkjV7rlBWljtA4oWH37glVGyOZSZvErDT/yBywZdPGwCXuTvSG85g== +expect@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.0.0.tgz#e4af58cf4343683ffeca875d75d5c790f2712565" + integrity sha512-OKAHGwaBqZ6I7bas0cnrrvomEL2d0yp2XXYQhhnVHfaqDaKStUBxjWtlGu/uI2tBqwb9sBMvaS41DSJFsRRJHQ== dependencies: - "@jest/expect-utils" "^28.1.3" - jest-get-type "^28.0.2" - jest-matcher-utils "^28.1.3" - jest-message-util "^28.1.3" - jest-util "^28.1.3" + "@jest/expect-utils" "^29.0.0" + jest-get-type "^29.0.0" + jest-matcher-utils "^29.0.0" + jest-message-util "^29.0.0" + jest-util "^29.0.0" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1282,7 +1302,7 @@ fast-glob@^3.2.9: merge2 "^1.3.0" micromatch "^4.0.4" -fast-json-stable-stringify@^2.0.0: +fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== @@ -1623,188 +1643,188 @@ istanbul-reports@^3.1.3: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-28.1.3.tgz#d9aeee6792be3686c47cb988a8eaf82ff4238831" - integrity sha512-esaOfUWJXk2nfZt9SPyC8gA1kNfdKLkQWyzsMlqq8msYSlNKfmZxfRgZn4Cd4MGVUF+7v6dBs0d5TOAKa7iIiA== +jest-changed-files@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.0.0.tgz#aa238eae42d9372a413dd9a8dadc91ca1806dce0" + integrity sha512-28/iDMDrUpGoCitTURuDqUzWQoWmOmOKOFST1mi2lwh62X4BFf6khgH3uSuo1e49X/UDjuApAj3w0wLOex4VPQ== dependencies: execa "^5.0.0" p-limit "^3.1.0" -jest-circus@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-28.1.3.tgz#d14bd11cf8ee1a03d69902dc47b6bd4634ee00e4" - integrity sha512-cZ+eS5zc79MBwt+IhQhiEp0OeBddpc1n8MBo1nMB8A7oPMKEO+Sre+wHaLJexQUj9Ya/8NOBY0RESUgYjB6fow== +jest-circus@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.0.0.tgz#086e825159edf711c504cfc0ca0816bc756e5494" + integrity sha512-6EX70/+ZdzPLShBeokMVIpUaq5cQpOsO4OCDiV1drKUHht0hmUOWvY6LE4pBSFdepB0Sukw4Y0ajRqtvLBO9/A== dependencies: - "@jest/environment" "^28.1.3" - "@jest/expect" "^28.1.3" - "@jest/test-result" "^28.1.3" - "@jest/types" "^28.1.3" + "@jest/environment" "^29.0.0" + "@jest/expect" "^29.0.0" + "@jest/test-result" "^29.0.0" + "@jest/types" "^29.0.0" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" is-generator-fn "^2.0.0" - jest-each "^28.1.3" - jest-matcher-utils "^28.1.3" - jest-message-util "^28.1.3" - jest-runtime "^28.1.3" - jest-snapshot "^28.1.3" - jest-util "^28.1.3" + jest-each "^29.0.0" + jest-matcher-utils "^29.0.0" + jest-message-util "^29.0.0" + jest-runtime "^29.0.0" + jest-snapshot "^29.0.0" + jest-util "^29.0.0" p-limit "^3.1.0" - pretty-format "^28.1.3" + pretty-format "^29.0.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-28.1.3.tgz#558b33c577d06de55087b8448d373b9f654e46b2" - integrity sha512-roY3kvrv57Azn1yPgdTebPAXvdR2xfezaKKYzVxZ6It/5NCxzJym6tUI5P1zkdWhfUYkxEI9uZWcQdaFLo8mJQ== +jest-cli@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.0.0.tgz#ea38f017f5ad8f435f9b2910a7e8e18607ebc644" + integrity sha512-VZUPQjWJKL8QABFiBk1tHeJ3czBodjU9r22ceQmeL7X8/M73FYxTte0RkYPHI2SiLPWy99GZNWA+oOu9x0xKOA== dependencies: - "@jest/core" "^28.1.3" - "@jest/test-result" "^28.1.3" - "@jest/types" "^28.1.3" + "@jest/core" "^29.0.0" + "@jest/test-result" "^29.0.0" + "@jest/types" "^29.0.0" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^28.1.3" - jest-util "^28.1.3" - jest-validate "^28.1.3" + jest-config "^29.0.0" + jest-util "^29.0.0" + jest-validate "^29.0.0" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-28.1.3.tgz#e315e1f73df3cac31447eed8b8740a477392ec60" - integrity sha512-MG3INjByJ0J4AsNBm7T3hsuxKQqFIiRo/AUqb1q9LRKI5UU6Aar9JHbr9Ivn1TVwfUD9KirRoM/T6u8XlcQPHQ== +jest-config@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.0.0.tgz#fb2408b447ff9479a2aed7f0ee6f1888665ff8ca" + integrity sha512-RbcUgQBJDS0O8OThWUwm5UCfzo0zOymUX/cJzUNlYB1ZWqe3M8MFEcgwqgZSifYuYTi46xWu5cmkMiyRQAdnMw== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^28.1.3" - "@jest/types" "^28.1.3" - babel-jest "^28.1.3" + "@jest/test-sequencer" "^29.0.0" + "@jest/types" "^29.0.0" + babel-jest "^29.0.0" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^28.1.3" - jest-environment-node "^28.1.3" - jest-get-type "^28.0.2" - jest-regex-util "^28.0.2" - jest-resolve "^28.1.3" - jest-runner "^28.1.3" - jest-util "^28.1.3" - jest-validate "^28.1.3" + jest-circus "^29.0.0" + jest-environment-node "^29.0.0" + jest-get-type "^29.0.0" + jest-regex-util "^29.0.0" + jest-resolve "^29.0.0" + jest-runner "^29.0.0" + jest-util "^29.0.0" + jest-validate "^29.0.0" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^28.1.3" + pretty-format "^29.0.0" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-28.1.3.tgz#948a192d86f4e7a64c5264ad4da4877133d8792f" - integrity sha512-8RqP1B/OXzjjTWkqMX67iqgwBVJRgCyKD3L9nq+6ZqJMdvjE8RgHktqZ6jNrkdMT+dJuYNI3rhQpxaz7drJHfw== +jest-diff@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.0.0.tgz#24a3dd5846ae0e48cba0194b1397178b06b123ad" + integrity sha512-erkuYf1dQBHow3XJmS+bH6t9TZ0GwrSdQGauN8sTqyZlFByOjRadmHgTTcAHINeeSwxzGHN2ob3PXVvZphD7XQ== dependencies: chalk "^4.0.0" - diff-sequences "^28.1.1" - jest-get-type "^28.0.2" - pretty-format "^28.1.3" + diff-sequences "^29.0.0" + jest-get-type "^29.0.0" + pretty-format "^29.0.0" -jest-docblock@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-28.1.1.tgz#6f515c3bf841516d82ecd57a62eed9204c2f42a8" - integrity sha512-3wayBVNiOYx0cwAbl9rwm5kKFP8yHH3d/fkEaL02NPTkDojPtheGB7HZSFY4wzX+DxyrvhXz0KSCVksmCknCuA== +jest-docblock@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.0.0.tgz#3151bcc45ed7f5a8af4884dcc049aee699b4ceae" + integrity sha512-s5Kpra/kLzbqu9dEjov30kj1n4tfu3e7Pl8v+f8jOkeWNqM6Ds8jRaJfZow3ducoQUrf2Z4rs2N5S3zXnb83gw== dependencies: detect-newline "^3.0.0" -jest-each@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-28.1.3.tgz#bdd1516edbe2b1f3569cfdad9acd543040028f81" - integrity sha512-arT1z4sg2yABU5uogObVPvSlSMQlDA48owx07BDPAiasW0yYpYHYOo4HHLz9q0BVzDVU4hILFjzJw0So9aCL/g== +jest-each@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.0.0.tgz#1aff8fae85ed2094ca3b64ae9ab61225dbf20c6a" + integrity sha512-ACKRvqdo7Bc0YrjQbrQtokpQ2NZxdXA63OklJht7a9UarCJXlZeWh51wEUe0ORqbnu15nAnX1YFQHmVpS1+ZXA== dependencies: - "@jest/types" "^28.1.3" + "@jest/types" "^29.0.0" chalk "^4.0.0" - jest-get-type "^28.0.2" - jest-util "^28.1.3" - pretty-format "^28.1.3" - -jest-environment-node@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-28.1.3.tgz#7e74fe40eb645b9d56c0c4b70ca4357faa349be5" - integrity sha512-ugP6XOhEpjAEhGYvp5Xj989ns5cB1K6ZdjBYuS30umT4CQEETaxSiPcZ/E1kFktX4GkrcM4qu07IIlDYX1gp+A== - dependencies: - "@jest/environment" "^28.1.3" - "@jest/fake-timers" "^28.1.3" - "@jest/types" "^28.1.3" + jest-get-type "^29.0.0" + jest-util "^29.0.0" + pretty-format "^29.0.0" + +jest-environment-node@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.0.0.tgz#849fc1c0b149cf7e6f9513715a0ec6b775ee3506" + integrity sha512-Cns21Vgu0z7LjtssL0SWkxmjclHdwXeECFAP3ONit5NPnGCbv+0Rqby8w9vK7NpFlUaFgMmLYYBsUjSmIhwpvg== + dependencies: + "@jest/environment" "^29.0.0" + "@jest/fake-timers" "^29.0.0" + "@jest/types" "^29.0.0" "@types/node" "*" - jest-mock "^28.1.3" - jest-util "^28.1.3" + jest-mock "^29.0.0" + jest-util "^29.0.0" -jest-get-type@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-28.0.2.tgz#34622e628e4fdcd793d46db8a242227901fcf203" - integrity sha512-ioj2w9/DxSYHfOm5lJKCdcAmPJzQXmbM/Url3rhlghrPvT3tt+7a/+oXc9azkKmLvoiXjtV83bEWqi+vs5nlPA== +jest-get-type@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.0.0.tgz#843f6c50a1b778f7325df1129a0fd7aa713aef80" + integrity sha512-83X19z/HuLKYXYHskZlBAShO7UfLFXu/vWajw9ZNJASN32li8yHMaVGAQqxFW1RCFOkB7cubaL6FaJVQqqJLSw== -jest-haste-map@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-28.1.3.tgz#abd5451129a38d9841049644f34b034308944e2b" - integrity sha512-3S+RQWDXccXDKSWnkHa/dPwt+2qwA8CJzR61w3FoYCvoo3Pn8tvGcysmMF0Bj0EX5RYvAI2EIvC57OmotfdtKA== +jest-haste-map@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.0.0.tgz#52078a615aaa8a3ef017903e43cd413894fca768" + integrity sha512-mLyDt2WyNU0DZ64s7kRFkFJzrHEuXIxG+OKOs9/P5s1W7NzXE+P7SvLbxjz2Cg63cJjuglYRrD6fZcYf19T8Lw== dependencies: - "@jest/types" "^28.1.3" + "@jest/types" "^29.0.0" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" - jest-regex-util "^28.0.2" - jest-util "^28.1.3" - jest-worker "^28.1.3" + jest-regex-util "^29.0.0" + jest-util "^29.0.0" + jest-worker "^29.0.0" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-28.1.3.tgz#a6685d9b074be99e3adee816ce84fd30795e654d" - integrity sha512-WFVJhnQsiKtDEo5lG2mM0v40QWnBM+zMdHHyJs8AWZ7J0QZJS59MsyKeJHWhpBZBH32S48FOVvGyOFT1h0DlqA== +jest-leak-detector@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.0.0.tgz#7a6791cf61513550a8fc4a95f907f77db899204f" + integrity sha512-kBjNS0/z2+ZV/3N7R+ot5fKD2W1fHkoxC3kH/fkb2z24YSPfR9RGwiNX+YLRG9r0gWsxQx16boxzHT23G6rFBw== dependencies: - jest-get-type "^28.0.2" - pretty-format "^28.1.3" + jest-get-type "^29.0.0" + pretty-format "^29.0.0" -jest-matcher-utils@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-28.1.3.tgz#5a77f1c129dd5ba3b4d7fc20728806c78893146e" - integrity sha512-kQeJ7qHemKfbzKoGjHHrRKH6atgxMk8Enkk2iPQ3XwO6oE/KYD8lMYOziCkeSB9G4adPM4nR1DE8Tf5JeWH6Bw== +jest-matcher-utils@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.0.0.tgz#7e79d5d43ccbe4fe2b27f812986f196e7a98746c" + integrity sha512-HtCxFHI8lQSbN1RppFjtl6DIrS+x4d3lOhpJljVxFEXob4lxlKon3FunW0XoGxNSvIoD00AfTFspnufpOqszrg== dependencies: chalk "^4.0.0" - jest-diff "^28.1.3" - jest-get-type "^28.0.2" - pretty-format "^28.1.3" + jest-diff "^29.0.0" + jest-get-type "^29.0.0" + pretty-format "^29.0.0" -jest-message-util@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-28.1.3.tgz#232def7f2e333f1eecc90649b5b94b0055e7c43d" - integrity sha512-PFdn9Iewbt575zKPf1286Ht9EPoJmYT7P0kY+RibeYZ2XtOr53pDLEFoTWXbd1h4JiGiWpTBC84fc8xMXQMb7g== +jest-message-util@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.0.0.tgz#7995991fca9b41dc8410d0952894bbd4c5052ba8" + integrity sha512-4U0RdNV0TBTgVGzEchjryEpq4sqLO3gUQT7TEIbO5+q0K5MuiofOPcXk4GLpWviWByMRJjliQNMuzJ4YGT+oGQ== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^28.1.3" + "@jest/types" "^29.0.0" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^28.1.3" + pretty-format "^29.0.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-28.1.3.tgz#d4e9b1fc838bea595c77ab73672ebf513ab249da" - integrity sha512-o3J2jr6dMMWYVH4Lh/NKmDXdosrsJgi4AviS8oXLujcjpCMBb1FMsblDnOXKZKfSiHLxYub1eS0IHuRXsio9eA== +jest-mock@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.0.0.tgz#dff9e2a9caa9c813115db24e78d00a0cba9f0019" + integrity sha512-0AWznVt415KMCxcJPaE2+tWaruw0w8aRrKH1Y/NZUx3+Pd9f20jQjUR82iHqGSuYS4EOHL9uI8SjAhJk+ET91g== dependencies: - "@jest/types" "^28.1.3" + "@jest/types" "^29.0.0" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -1812,174 +1832,175 @@ jest-pnp-resolver@^1.2.2: resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== -jest-regex-util@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-28.0.2.tgz#afdc377a3b25fb6e80825adcf76c854e5bf47ead" - integrity sha512-4s0IgyNIy0y9FK+cjoVYoxamT7Zeo7MhzqRGx7YDYmaQn1wucY9rotiGkBzzcMXTtjrCAP/f7f+E0F7+fxPNdw== +jest-regex-util@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.0.0.tgz#b442987f688289df8eb6c16fa8df488b4cd007de" + integrity sha512-BV7VW7Sy0fInHWN93MMPtlClweYv2qrSCwfeFWmpribGZtQPWNvRSq9XOVgOEjU1iBGRKXUZil0o2AH7Iy9Lug== -jest-resolve-dependencies@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-28.1.3.tgz#8c65d7583460df7275c6ea2791901fa975c1fe66" - integrity sha512-qa0QO2Q0XzQoNPouMbCc7Bvtsem8eQgVPNkwn9LnS+R2n8DaVDPL/U1gngC0LTl1RYXJU0uJa2BMC2DbTfFrHA== +jest-resolve-dependencies@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.0.0.tgz#6c7886caa63838acb207f2caa7eb8f64930fb1e7" + integrity sha512-1TYUMcLZcUqa2fdUQ3leYtiXWXfNmimPvnJ34YDLLf0nyJ/aEeqlHJM9Ji2jw9Qxdh7nUypanjUlUV87yRHBFQ== dependencies: - jest-regex-util "^28.0.2" - jest-snapshot "^28.1.3" + jest-regex-util "^29.0.0" + jest-snapshot "^29.0.0" -jest-resolve@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-28.1.3.tgz#cfb36100341ddbb061ec781426b3c31eb51aa0a8" - integrity sha512-Z1W3tTjE6QaNI90qo/BJpfnvpxtaFTFw5CDgwpyE/Kz8U/06N1Hjf4ia9quUhCh39qIGWF1ZuxFiBiJQwSEYKQ== +jest-resolve@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.0.0.tgz#63d8e0b5cae115203da65cc8331722a315069351" + integrity sha512-MN19maPUXzibBshYg/cSrDWqiJwEBur6gbQb2lwOL4+6k14wdNW8Xh0uNPPxUntb7cpTi07uql/bUO5TVwiJbA== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^28.1.3" + jest-haste-map "^29.0.0" jest-pnp-resolver "^1.2.2" - jest-util "^28.1.3" - jest-validate "^28.1.3" + jest-util "^29.0.0" + jest-validate "^29.0.0" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-28.1.3.tgz#5eee25febd730b4713a2cdfd76bdd5557840f9a1" - integrity sha512-GkMw4D/0USd62OVO0oEgjn23TM+YJa2U2Wu5zz9xsQB1MxWKDOlrnykPxnMsN0tnJllfLPinHTka61u0QhaxBA== +jest-runner@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.0.0.tgz#8fff8a248b912e8be033a0b61d477a323b349397" + integrity sha512-OpTpRIBOIn9RXuMMrpS+h9ZoK+nZHaOuNOceUiDbDoOJ6pmeGu0zst7VR22xXT3fOCwWqg5qe0fZ23G+ve5P0Q== dependencies: - "@jest/console" "^28.1.3" - "@jest/environment" "^28.1.3" - "@jest/test-result" "^28.1.3" - "@jest/transform" "^28.1.3" - "@jest/types" "^28.1.3" + "@jest/console" "^29.0.0" + "@jest/environment" "^29.0.0" + "@jest/test-result" "^29.0.0" + "@jest/transform" "^29.0.0" + "@jest/types" "^29.0.0" "@types/node" "*" chalk "^4.0.0" emittery "^0.10.2" graceful-fs "^4.2.9" - jest-docblock "^28.1.1" - jest-environment-node "^28.1.3" - jest-haste-map "^28.1.3" - jest-leak-detector "^28.1.3" - jest-message-util "^28.1.3" - jest-resolve "^28.1.3" - jest-runtime "^28.1.3" - jest-util "^28.1.3" - jest-watcher "^28.1.3" - jest-worker "^28.1.3" + jest-docblock "^29.0.0" + jest-environment-node "^29.0.0" + jest-haste-map "^29.0.0" + jest-leak-detector "^29.0.0" + jest-message-util "^29.0.0" + jest-resolve "^29.0.0" + jest-runtime "^29.0.0" + jest-util "^29.0.0" + jest-watcher "^29.0.0" + jest-worker "^29.0.0" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-28.1.3.tgz#a57643458235aa53e8ec7821949e728960d0605f" - integrity sha512-NU+881ScBQQLc1JHG5eJGU7Ui3kLKrmwCPPtYsJtBykixrM2OhVQlpMmFWJjMyDfdkGgBMNjXCGB/ebzsgNGQw== - dependencies: - "@jest/environment" "^28.1.3" - "@jest/fake-timers" "^28.1.3" - "@jest/globals" "^28.1.3" - "@jest/source-map" "^28.1.2" - "@jest/test-result" "^28.1.3" - "@jest/transform" "^28.1.3" - "@jest/types" "^28.1.3" +jest-runtime@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.0.0.tgz#544e610ca0e55748819a31c18e3166abff7302f4" + integrity sha512-dU0qFpTRWZY7Rur7yBgpz4g67mITSozBZ1jlhoG4ER/P/NiTFyZ/W8nMd5floeAMafmbrOc/5A9SlCu7SQCoBA== + dependencies: + "@jest/environment" "^29.0.0" + "@jest/fake-timers" "^29.0.0" + "@jest/globals" "^29.0.0" + "@jest/source-map" "^29.0.0" + "@jest/test-result" "^29.0.0" + "@jest/transform" "^29.0.0" + "@jest/types" "^29.0.0" + "@types/node" "*" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" - execa "^5.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^28.1.3" - jest-message-util "^28.1.3" - jest-mock "^28.1.3" - jest-regex-util "^28.0.2" - jest-resolve "^28.1.3" - jest-snapshot "^28.1.3" - jest-util "^28.1.3" + jest-haste-map "^29.0.0" + jest-message-util "^29.0.0" + jest-mock "^29.0.0" + jest-regex-util "^29.0.0" + jest-resolve "^29.0.0" + jest-snapshot "^29.0.0" + jest-util "^29.0.0" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-28.1.3.tgz#17467b3ab8ddb81e2f605db05583d69388fc0668" - integrity sha512-4lzMgtiNlc3DU/8lZfmqxN3AYD6GGLbl+72rdBpXvcV+whX7mDrREzkPdp2RnmfIiWBg1YbuFSkXduF2JcafJg== +jest-snapshot@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.0.0.tgz#5a349608cb7fa12dbdafad999cd5a3ed571bfd90" + integrity sha512-rR3B8GInk/IibF0M/sQCukSM8xX8bPI3Q0kjoAw4HT9Mx0Q3bS0MmF74rsreBOnVJgzN0Iwrc7YY56Yp8KQ7kA== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" + "@babel/plugin-syntax-jsx" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^28.1.3" - "@jest/transform" "^28.1.3" - "@jest/types" "^28.1.3" + "@jest/expect-utils" "^29.0.0" + "@jest/transform" "^29.0.0" + "@jest/types" "^29.0.0" "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^28.1.3" + expect "^29.0.0" graceful-fs "^4.2.9" - jest-diff "^28.1.3" - jest-get-type "^28.0.2" - jest-haste-map "^28.1.3" - jest-matcher-utils "^28.1.3" - jest-message-util "^28.1.3" - jest-util "^28.1.3" + jest-diff "^29.0.0" + jest-get-type "^29.0.0" + jest-haste-map "^29.0.0" + jest-matcher-utils "^29.0.0" + jest-message-util "^29.0.0" + jest-util "^29.0.0" natural-compare "^1.4.0" - pretty-format "^28.1.3" + pretty-format "^29.0.0" semver "^7.3.5" -jest-util@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-28.1.3.tgz#f4f932aa0074f0679943220ff9cbba7e497028b0" - integrity sha512-XdqfpHwpcSRko/C35uLYFM2emRAltIIKZiJ9eAmhjsj0CqZMa0p1ib0R5fWIqGhn1a103DebTbpqIaP1qCQ6tQ== +jest-util@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.0.0.tgz#54dfddf25fb011a2ff93fe8d11738dee8ff7f663" + integrity sha512-HMjW/pkFgi34LGKumjNDK03DYonV+nPMNUZ63rZX8PFdBkdIWUtOCEiaa7sAJkWrw5MyMVzSpa22NcOJjoQ3JQ== dependencies: - "@jest/types" "^28.1.3" + "@jest/types" "^29.0.0" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-28.1.3.tgz#e322267fd5e7c64cea4629612c357bbda96229df" - integrity sha512-SZbOGBWEsaTxBGCOpsRWlXlvNkvTkY0XxRfh7zYmvd8uL5Qzyg0CHAXiXKROflh801quA6+/DsT4ODDthOC/OA== +jest-validate@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.0.0.tgz#714f9f013e7dc4cb3a20b098170fbed3fbad4252" + integrity sha512-UhgDKmahJnv5s5MK6a8kQ397YNS9euvL7gWTvUf7y0OO7vZeafUItlq3tguvfFVazQJ+kBGUm/XCJes7V61l8g== dependencies: - "@jest/types" "^28.1.3" + "@jest/types" "^29.0.0" camelcase "^6.2.0" chalk "^4.0.0" - jest-get-type "^28.0.2" + jest-get-type "^29.0.0" leven "^3.1.0" - pretty-format "^28.1.3" + pretty-format "^29.0.0" -jest-watcher@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-28.1.3.tgz#c6023a59ba2255e3b4c57179fc94164b3e73abd4" - integrity sha512-t4qcqj9hze+jviFPUN3YAtAEeFnr/azITXQEMARf5cMwKY2SMBRnCQTXLixTl20OR6mLh9KLMrgVJgJISym+1g== +jest-watcher@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.0.0.tgz#7ecdf96acaafa0d1afe4be9695f3c81978afd20d" + integrity sha512-GoRq5QJt5/dv3keK7rIzg9R0e/HpTnjyMNYtCTTDZgGIj6QUDMpiJqt7Mwfyyaxwg5PS8gVyQvRQn6Lril4cuQ== dependencies: - "@jest/test-result" "^28.1.3" - "@jest/types" "^28.1.3" + "@jest/test-result" "^29.0.0" + "@jest/types" "^29.0.0" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.10.2" - jest-util "^28.1.3" + jest-util "^29.0.0" string-length "^4.0.1" -jest-worker@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-28.1.3.tgz#7e3c4ce3fa23d1bb6accb169e7f396f98ed4bb98" - integrity sha512-CqRA220YV/6jCo8VWvAt1KKx6eek1VIHMPeLEbpcfSfkEeWyBNppynM/o6q+Wmw+sOhos2ml34wZbSX3G13//g== +jest-worker@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.0.0.tgz#a1c7b67b2d9ce057383999b32d8b71794efcd0b9" + integrity sha512-2t9Panx3F9N1wAvRuZT7xLEptRFc1C5G90DOHniIGz1JIgF9uhd5u8jNBsc7wN63lhnaiLeVLnNx21wT7OVFEQ== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" -jest@^28.0.1: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest/-/jest-28.1.3.tgz#e9c6a7eecdebe3548ca2b18894a50f45b36dfc6b" - integrity sha512-N4GT5on8UkZgH0O5LUavMRV1EDEhNTL0KEfRmDIeZHSV7p2XgLoY9t9VDUgL6o+yfdgYHVxuz81G8oB9VG5uyA== +jest@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.0.0.tgz#0614bce40ffd3a1a19a30c8a2c66d19103712001" + integrity sha512-9uz4Tclskb8WrfRXqu66FsFCFoyYctwWXpruKwnD95FZqkyoEAA1oGH53HUn7nQx7uEgZTKdNl/Yo6DqqU+XMg== dependencies: - "@jest/core" "^28.1.3" - "@jest/types" "^28.1.3" + "@jest/core" "^29.0.0" + "@jest/types" "^29.0.0" import-local "^3.0.2" - jest-cli "^28.1.3" + jest-cli "^29.0.0" js-tokens@^4.0.0: version "4.0.0" @@ -2300,13 +2321,12 @@ prettier@>=2.3.0: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== -pretty-format@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-28.1.3.tgz#c9fba8cedf99ce50963a11b27d982a9ae90970d5" - integrity sha512-8gFb/To0OmxHR9+ZTb14Df2vNxdGCX8g1xWGUTqUw5TiZvcQf5sHKObd5UcPyLLyowNwDAMTF3XWOG1B6mxl1Q== +pretty-format@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.0.0.tgz#a9a604ca71678f803f34f6563a25a638fce267ba" + integrity sha512-tMkFRn1vxRwZdiDETcveuNeonRKDg4doOvI+iyb1sOAtxYioGzRicqnsr+d3C/lLv9hBiM/2lDBi5ilR81h2bQ== dependencies: - "@jest/schemas" "^28.1.3" - ansi-regex "^5.0.1" + "@jest/schemas" "^29.0.0" ansi-styles "^5.0.0" react-is "^18.0.0" @@ -2399,7 +2419,7 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rimraf@^3.0.0, rimraf@^3.0.2: +rimraf@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== From 8517e34a5b4191cd6b2330a28c056f5e5445f4dd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Aug 2022 12:01:10 +0000 Subject: [PATCH 632/785] Bump eslint from 8.22.0 to 8.23.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.22.0 to 8.23.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.22.0...v8.23.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/yarn.lock b/yarn.lock index c6224a57..8c265d90 100644 --- a/yarn.lock +++ b/yarn.lock @@ -298,14 +298,14 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@eslint/eslintrc@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.0.tgz#29f92c30bb3e771e4a2048c95fa6855392dfac4f" - integrity sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw== +"@eslint/eslintrc@^1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.1.tgz#de0807bfeffc37b964a7d0400e0c348ce5a2543d" + integrity sha512-OhSY22oQQdw3zgPOOwdoj01l/Dzl1Z+xyUP33tkSN+aqyEhymJCcPHyXt+ylW8FSe0TfRC2VG+ROQOapD0aZSQ== dependencies: ajv "^6.12.4" debug "^4.3.2" - espree "^9.3.2" + espree "^9.4.0" globals "^13.15.0" ignore "^5.2.0" import-fresh "^3.2.1" @@ -327,6 +327,11 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz#316b0a63b91c10e53f242efb4ace5c3b34e8728d" integrity sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA== +"@humanwhocodes/module-importer@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" + integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== + "@humanwhocodes/object-schema@^1.2.1": version "1.2.1" resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" @@ -1158,13 +1163,14 @@ eslint-visitor-keys@^3.3.0: integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.15.0: - version "8.22.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.22.0.tgz#78fcb044196dfa7eef30a9d65944f6f980402c48" - integrity sha512-ci4t0sz6vSRKdmkOGmprBo6fmI4PrphDFMy5JEq/fNS0gQkJM3rLmrqcp8ipMcdobH3KtUP40KniAE9W19S4wA== + version "8.23.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.23.0.tgz#a184918d288820179c6041bb3ddcc99ce6eea040" + integrity sha512-pBG/XOn0MsJcKcTRLr27S5HpzQo4kLr+HjLQIyK4EiCsijDl/TB+h5uEuJU6bQ8Edvwz1XWOjpaP2qgnXGpTcA== dependencies: - "@eslint/eslintrc" "^1.3.0" + "@eslint/eslintrc" "^1.3.1" "@humanwhocodes/config-array" "^0.10.4" "@humanwhocodes/gitignore-to-minimatch" "^1.0.2" + "@humanwhocodes/module-importer" "^1.0.1" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" @@ -1174,7 +1180,7 @@ eslint@^8.15.0: eslint-scope "^7.1.1" eslint-utils "^3.0.0" eslint-visitor-keys "^3.3.0" - espree "^9.3.3" + espree "^9.4.0" esquery "^1.4.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -1200,12 +1206,11 @@ eslint@^8.15.0: strip-ansi "^6.0.1" strip-json-comments "^3.1.0" text-table "^0.2.0" - v8-compile-cache "^2.0.3" -espree@^9.3.2, espree@^9.3.3: - version "9.3.3" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.3.tgz#2dd37c4162bb05f433ad3c1a52ddf8a49dc08e9d" - integrity sha512-ORs1Rt/uQTqUKjDdGCyrtYxbazf5umATSf/K4qxjmZHORR6HJk+2s/2Pqe+Kk49HHINC/xNIrGfgh8sZcll0ng== +espree@^9.4.0: + version "9.4.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.4.0.tgz#cd4bc3d6e9336c433265fc0aa016fc1aaf182f8a" + integrity sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw== dependencies: acorn "^8.8.0" acorn-jsx "^5.3.2" @@ -2643,11 +2648,6 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" -v8-compile-cache@^2.0.3: - version "2.3.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" - integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== - v8-to-istanbul@^9.0.1: version "9.0.1" resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.0.1.tgz#b6f994b0b5d4ef255e17a0d17dc444a9f5132fa4" From 1c4b5368f2bb1af7f3e3c0ba61c13619c18eb2dc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Aug 2022 12:01:12 +0000 Subject: [PATCH 633/785] Bump jest from 29.0.0 to 29.0.1 Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.0.0 to 29.0.1. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.0.1/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 582 +++++++++++++++++++++++++++--------------------------- 1 file changed, 291 insertions(+), 291 deletions(-) diff --git a/yarn.lock b/yarn.lock index c6224a57..3baea5b5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -348,28 +348,28 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^29.0.0": - version "29.0.0" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.0.0.tgz#1e49fcbff7d20c88a6747f27e2fec0e759e405ca" - integrity sha512-rHsKEqT2Kx73PqO9qIOdwg0Grd6Y3COyqNpi5SKRI0qXgmlqXkOczQMfIb8I0Gdnc9/kaMj6cTnBGLyBA03Xrg== +"@jest/console@^29.0.1": + version "29.0.1" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.0.1.tgz#e0e429cfc89900e3a46ce27f493bf488395ade39" + integrity sha512-SxLvSKf9gk4Rvt3p2KRQWVQ3sVj7S37rjlCHwp2+xNcRO/X+Uw0idbkfOtciUpjghHIxyggqcrrKhThQ+vClLQ== dependencies: - "@jest/types" "^29.0.0" + "@jest/types" "^29.0.1" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^29.0.0" - jest-util "^29.0.0" + jest-message-util "^29.0.1" + jest-util "^29.0.1" slash "^3.0.0" -"@jest/core@^29.0.0": - version "29.0.0" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.0.0.tgz#6e9213014895bd91117f500bc9e8865d66f981fb" - integrity sha512-9qljprspjQwbmnq3Wv9d/M6/ejMdWs1uAAljQAX9QsjJ1SlSByXw1mRA9UpR2BP9TxLLwEembbm0ykrT//2STg== - dependencies: - "@jest/console" "^29.0.0" - "@jest/reporters" "^29.0.0" - "@jest/test-result" "^29.0.0" - "@jest/transform" "^29.0.0" - "@jest/types" "^29.0.0" +"@jest/core@^29.0.1": + version "29.0.1" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.0.1.tgz#a49517795f692a510b6fae55a9c09e659826c472" + integrity sha512-EcFrXkYh8I1GYHRH9V4TU7jr4P6ckaPqGo/z4AIJjHDZxicjYgWB6fx1xFb5bhEM87eUjCF4FAY5t+RamLWQmA== + dependencies: + "@jest/console" "^29.0.1" + "@jest/reporters" "^29.0.1" + "@jest/test-result" "^29.0.1" + "@jest/transform" "^29.0.1" + "@jest/types" "^29.0.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" @@ -377,80 +377,80 @@ exit "^0.1.2" graceful-fs "^4.2.9" jest-changed-files "^29.0.0" - jest-config "^29.0.0" - jest-haste-map "^29.0.0" - jest-message-util "^29.0.0" + jest-config "^29.0.1" + jest-haste-map "^29.0.1" + jest-message-util "^29.0.1" jest-regex-util "^29.0.0" - jest-resolve "^29.0.0" - jest-resolve-dependencies "^29.0.0" - jest-runner "^29.0.0" - jest-runtime "^29.0.0" - jest-snapshot "^29.0.0" - jest-util "^29.0.0" - jest-validate "^29.0.0" - jest-watcher "^29.0.0" + jest-resolve "^29.0.1" + jest-resolve-dependencies "^29.0.1" + jest-runner "^29.0.1" + jest-runtime "^29.0.1" + jest-snapshot "^29.0.1" + jest-util "^29.0.1" + jest-validate "^29.0.1" + jest-watcher "^29.0.1" micromatch "^4.0.4" - pretty-format "^29.0.0" + pretty-format "^29.0.1" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.0.0": - version "29.0.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.0.0.tgz#069758196cae8458d8b7a7778d0877f2ec04da83" - integrity sha512-ZHLvUENMAnwXowtyhmPRS0QLCXM4TS0ZfuiSR4QfRsJVN5lG4KdBDvI9kHJe/21vrgzPVOkvI7IBnkyPFCbV7g== +"@jest/environment@^29.0.1": + version "29.0.1" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.0.1.tgz#d236ce9e906744ac58bfc59ae6f7c9882ace7927" + integrity sha512-iLcFfoq2K6DAB+Mc+2VNLzZVmHdwQFeSqvoM/X8SMON6s/+yEi1iuRX3snx/JfwSnvmiMXjSr0lktxNxOcqXYA== dependencies: - "@jest/fake-timers" "^29.0.0" - "@jest/types" "^29.0.0" + "@jest/fake-timers" "^29.0.1" + "@jest/types" "^29.0.1" "@types/node" "*" - jest-mock "^29.0.0" + jest-mock "^29.0.1" -"@jest/expect-utils@^29.0.0": - version "29.0.0" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.0.0.tgz#aa3a2cbe4630ac2095cd2bcd3040fe42015fe9ed" - integrity sha512-odQ+cjUpui6++a9Ua/oWn7CG0Af+EZe9weWZbfUQHTg7C3K9PCb0AnD4X7nyAe4WjfeZmVVyG5SJELMQaUbCtg== +"@jest/expect-utils@^29.0.1": + version "29.0.1" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.0.1.tgz#c1a84ee66caaef537f351dd82f7c63d559cf78d5" + integrity sha512-Tw5kUUOKmXGQDmQ9TSgTraFFS7HMC1HG/B7y0AN2G2UzjdAXz9BzK2rmNpCSDl7g7y0Gf/VLBm//blonvhtOTQ== dependencies: jest-get-type "^29.0.0" -"@jest/expect@^29.0.0": - version "29.0.0" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.0.0.tgz#e4586136c27aa460afa427db2cd494d890d07b48" - integrity sha512-X2S5NpZOeXXDGBLvU/4K1nAD5iIz6/9Gs041wToI0FiX3glh/aEGGsVv3+SxKddYIb6Ei+ZbqzJmfRzQ7nwPlQ== +"@jest/expect@^29.0.1": + version "29.0.1" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.0.1.tgz#0ffde7f5b4c87f1dd6f8664726bd53f6cd1f7014" + integrity sha512-qKB3q52XDV8VUEiqKKLgLrJx7puQ8sYVqIDlul6n7SIXWS97DOK3KqbR2rDDaMtmenRHqEUl2fI+aFzx0oSemA== dependencies: - expect "^29.0.0" - jest-snapshot "^29.0.0" + expect "^29.0.1" + jest-snapshot "^29.0.1" -"@jest/fake-timers@^29.0.0": - version "29.0.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.0.0.tgz#6f9a3a6318af5fd6cbac52e20aa868f5643aba23" - integrity sha512-4tqH5fT9H0+Ms3Z1HLZ/JfpzJluep2Zo3uuj0KPyu6IIyYSHCDfkXuiBQNWUGvumZDLQ2Si03cC7Gq0r73VgVg== +"@jest/fake-timers@^29.0.1": + version "29.0.1" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.0.1.tgz#51ba7a82431db479d4b828576c139c4c0dc5e409" + integrity sha512-XZ+kAhLChVQ+KJNa5034p7O1Mz3vtWrelxDcMoxhZkgqmWDaEQAW9qJeutaeCfPvwaEwKYVyKDYfWpcyT8RiMw== dependencies: - "@jest/types" "^29.0.0" + "@jest/types" "^29.0.1" "@sinonjs/fake-timers" "^9.1.2" "@types/node" "*" - jest-message-util "^29.0.0" - jest-mock "^29.0.0" - jest-util "^29.0.0" + jest-message-util "^29.0.1" + jest-mock "^29.0.1" + jest-util "^29.0.1" -"@jest/globals@^29.0.0": - version "29.0.0" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.0.0.tgz#8a65b224e2eb1458d3780652d4ad832611d16066" - integrity sha512-ZHQMh6BZtabbikh9wkuPpVQmPHEpc4EgOaY/UJNM6hHHA5HRmiP5rH54M8267nkGscuqM5KpWP+zAZ4XEOXZag== +"@jest/globals@^29.0.1": + version "29.0.1" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.0.1.tgz#764135ad31408fb632b3126793ab3aaed933095f" + integrity sha512-BtZWrVrKRKNUt7T1H2S8Mz31PN7ItROCmH+V5pn10hJDUfjOCTIUwb0WtLZzm0f1tJ3Uvx+5lVZrF/VTKqNaFg== dependencies: - "@jest/environment" "^29.0.0" - "@jest/expect" "^29.0.0" - "@jest/types" "^29.0.0" - jest-mock "^29.0.0" + "@jest/environment" "^29.0.1" + "@jest/expect" "^29.0.1" + "@jest/types" "^29.0.1" + jest-mock "^29.0.1" -"@jest/reporters@^29.0.0": - version "29.0.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.0.0.tgz#2bcdee6c8a347acdc93421fffc441a2c282a8b0f" - integrity sha512-6ZFLlHQwncULTucAKWeGJLGPvzjgC/0gFmxJi/LgU9G1v498r/RcWQiZBPqhJcSvpWGTCaqjvUGmPCLtrUpubw== +"@jest/reporters@^29.0.1": + version "29.0.1" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.0.1.tgz#82a491657031c1cc278bf659905e5094973309ad" + integrity sha512-dM3L8JmYYOsdeXUUVZClQy67Tz/v1sMo9h4AQv2U+716VLHV0zdA6Hh4FQNAHMhYw/95dbZbPX8Q+TRR7Rw+wA== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.0.0" - "@jest/test-result" "^29.0.0" - "@jest/transform" "^29.0.0" - "@jest/types" "^29.0.0" + "@jest/console" "^29.0.1" + "@jest/test-result" "^29.0.1" + "@jest/transform" "^29.0.1" + "@jest/types" "^29.0.1" "@jridgewell/trace-mapping" "^0.3.15" "@types/node" "*" chalk "^4.0.0" @@ -463,9 +463,9 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^29.0.0" - jest-util "^29.0.0" - jest-worker "^29.0.0" + jest-message-util "^29.0.1" + jest-util "^29.0.1" + jest-worker "^29.0.1" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" @@ -488,51 +488,51 @@ callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^29.0.0": - version "29.0.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.0.0.tgz#592f556b94a9d9aed951dd43c310370239c9cb56" - integrity sha512-mv76j8ILaqOuZAWBGR1/ZSRinN5Q/eEji7kMcvADjd+gQGfn/Py+91nUrVakJT69idC66bvQ7yF24frQpzFKUg== +"@jest/test-result@^29.0.1": + version "29.0.1" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.0.1.tgz#97ac334e4c6f7d016c341cdd500aa423a38e4cdd" + integrity sha512-XCA4whh/igxjBaR/Hg8qwFd/uTsauoD7QAdAYUjV2CSGx0+iunhjoCRRWTwqjQrETRqOJABx6kNfw0+C0vMSgQ== dependencies: - "@jest/console" "^29.0.0" - "@jest/types" "^29.0.0" + "@jest/console" "^29.0.1" + "@jest/types" "^29.0.1" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.0.0": - version "29.0.0" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.0.0.tgz#32da68bec6f83f5f2c7936946eac54d80ba96d0e" - integrity sha512-uL6yX//SUME1c/ucbY365obdsrPjvSoNBwB80WTe+drYL4jf7A87vA2+w4hYwXJEIGQspv5skg3iB/sJSys7ew== +"@jest/test-sequencer@^29.0.1": + version "29.0.1" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.0.1.tgz#7074b5f89ce30941b5b0fb493a19308d441a30b8" + integrity sha512-3GhSBMCRcWXGluP2Dw7CLP6mNke/t+EcftF5YjzhX1BJmqcatMbtZVwjuCfZy0TCME1GevXy3qTyV5PLpwIFKQ== dependencies: - "@jest/test-result" "^29.0.0" + "@jest/test-result" "^29.0.1" graceful-fs "^4.2.9" - jest-haste-map "^29.0.0" + jest-haste-map "^29.0.1" slash "^3.0.0" -"@jest/transform@^29.0.0": - version "29.0.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.0.0.tgz#a19c6af7724786ac286dde2037d077372ce8c76e" - integrity sha512-hwyBt8UR5o8GGaphmRqNQwVCctiOR8ncugCp/RlInEZvQ+ysKkS5TFfe5RgeQ0KtKdWByQqn5yA574LLOp3OWw== +"@jest/transform@^29.0.1": + version "29.0.1" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.0.1.tgz#fdaa5d9e135c9bd7addbe65bedd1f15ad028cc7e" + integrity sha512-6UxXtqrPScFdDhoip8ys60dQAIYppQinyR87n9nlasR/ZnFfJohKToqzM29KK4gb9gHRv5oDFChdqZKE0SIhsg== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^29.0.0" + "@jest/types" "^29.0.1" "@jridgewell/trace-mapping" "^0.3.15" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.0.0" + jest-haste-map "^29.0.1" jest-regex-util "^29.0.0" - jest-util "^29.0.0" + jest-util "^29.0.1" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" write-file-atomic "^4.0.1" -"@jest/types@^29.0.0": - version "29.0.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.0.0.tgz#16bef8898fec32c2c5c17a6eb770539986322587" - integrity sha512-ErShruvByUF7vphEtPugMAphCtDIDdfWh3DxpBLxPEtHhL/H5MaidHsOutnOUhKpPL7QA6/7GitjFgLOLeGa1A== +"@jest/types@^29.0.1": + version "29.0.1" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.0.1.tgz#1985650acf137bdb81710ff39a4689ec071dd86a" + integrity sha512-ft01rxzVsbh9qZPJ6EFgAIj3PT9FCRfBF9Xljo2/33VDOUjLZr0ZJ2oKANqh9S/K0/GERCsHDAQlBwj7RxA+9g== dependencies: "@jest/schemas" "^29.0.0" "@types/istanbul-lib-coverage" "^2.0.0" @@ -805,12 +805,12 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.0.0.tgz#abf783ce6eb999cfb6764915bd86d3055a8ae3be" - integrity sha512-EJM2dqxz9+uWJLLucZLPYAmRsHHt1IMkitAHGqjDlIP2IQXzkIMO3ATbBWk0lU6VwX4rNeVN04t/DDB8U5C2rg== +babel-jest@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.0.1.tgz#db50de501fc8727e768f5aa417496cb871ee1ba0" + integrity sha512-wyI9r8tqwsZEMWiIaYjdUJ6ztZIO4DMWpGq7laW34wR71WtRS+D/iBEtXOP5W2aSYCVUQMsypRl/xiJYZznnTg== dependencies: - "@jest/transform" "^29.0.0" + "@jest/transform" "^29.0.1" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" babel-preset-jest "^29.0.0" @@ -1275,16 +1275,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.0.0.tgz#e4af58cf4343683ffeca875d75d5c790f2712565" - integrity sha512-OKAHGwaBqZ6I7bas0cnrrvomEL2d0yp2XXYQhhnVHfaqDaKStUBxjWtlGu/uI2tBqwb9sBMvaS41DSJFsRRJHQ== +expect@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.0.1.tgz#a2fa64a59cffe4b4007877e730bc82be3d1742bb" + integrity sha512-yQgemsjLU+1S8t2A7pXT3Sn/v5/37LY8J+tocWtKEA0iEYYc6gfKbbJJX2fxHZmd7K9WpdbQqXUpmYkq1aewYg== dependencies: - "@jest/expect-utils" "^29.0.0" + "@jest/expect-utils" "^29.0.1" jest-get-type "^29.0.0" - jest-matcher-utils "^29.0.0" - jest-message-util "^29.0.0" - jest-util "^29.0.0" + jest-matcher-utils "^29.0.1" + jest-message-util "^29.0.1" + jest-util "^29.0.1" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1651,86 +1651,86 @@ jest-changed-files@^29.0.0: execa "^5.0.0" p-limit "^3.1.0" -jest-circus@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.0.0.tgz#086e825159edf711c504cfc0ca0816bc756e5494" - integrity sha512-6EX70/+ZdzPLShBeokMVIpUaq5cQpOsO4OCDiV1drKUHht0hmUOWvY6LE4pBSFdepB0Sukw4Y0ajRqtvLBO9/A== +jest-circus@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.0.1.tgz#7ecb4913e134fb4addc03655fb36c9398014fa07" + integrity sha512-I5J4LyK3qPo8EnqPmxsMAVR+2SFx7JOaZsbqW9xQmk4UDmTCD92EQgS162Ey3Jq6CfpKJKFDhzhG3QqiE0fRbw== dependencies: - "@jest/environment" "^29.0.0" - "@jest/expect" "^29.0.0" - "@jest/test-result" "^29.0.0" - "@jest/types" "^29.0.0" + "@jest/environment" "^29.0.1" + "@jest/expect" "^29.0.1" + "@jest/test-result" "^29.0.1" + "@jest/types" "^29.0.1" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" is-generator-fn "^2.0.0" - jest-each "^29.0.0" - jest-matcher-utils "^29.0.0" - jest-message-util "^29.0.0" - jest-runtime "^29.0.0" - jest-snapshot "^29.0.0" - jest-util "^29.0.0" + jest-each "^29.0.1" + jest-matcher-utils "^29.0.1" + jest-message-util "^29.0.1" + jest-runtime "^29.0.1" + jest-snapshot "^29.0.1" + jest-util "^29.0.1" p-limit "^3.1.0" - pretty-format "^29.0.0" + pretty-format "^29.0.1" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.0.0.tgz#ea38f017f5ad8f435f9b2910a7e8e18607ebc644" - integrity sha512-VZUPQjWJKL8QABFiBk1tHeJ3czBodjU9r22ceQmeL7X8/M73FYxTte0RkYPHI2SiLPWy99GZNWA+oOu9x0xKOA== +jest-cli@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.0.1.tgz#6633c2ab97337ac5207910bd6b0aba2ef0900110" + integrity sha512-XozBHtoJCS6mnjCxNESyGm47Y4xSWzNlBJj4tix9nGrG6m068B83lrTWKtjYAenYSfOqyYVpQCkyqUp35IT+qA== dependencies: - "@jest/core" "^29.0.0" - "@jest/test-result" "^29.0.0" - "@jest/types" "^29.0.0" + "@jest/core" "^29.0.1" + "@jest/test-result" "^29.0.1" + "@jest/types" "^29.0.1" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.0.0" - jest-util "^29.0.0" - jest-validate "^29.0.0" + jest-config "^29.0.1" + jest-util "^29.0.1" + jest-validate "^29.0.1" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.0.0.tgz#fb2408b447ff9479a2aed7f0ee6f1888665ff8ca" - integrity sha512-RbcUgQBJDS0O8OThWUwm5UCfzo0zOymUX/cJzUNlYB1ZWqe3M8MFEcgwqgZSifYuYTi46xWu5cmkMiyRQAdnMw== +jest-config@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.0.1.tgz#bccc2aedc3bafb6cb08bad23e5f0fcc3b1959268" + integrity sha512-3duIx5ucEPIsUOESDTuasMfqHonD0oZRjqHycIMHSC4JwbvHDjAWNKN/NiM0ZxHXjAYrMTLt2QxSQ+IqlbYE5A== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.0.0" - "@jest/types" "^29.0.0" - babel-jest "^29.0.0" + "@jest/test-sequencer" "^29.0.1" + "@jest/types" "^29.0.1" + babel-jest "^29.0.1" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^29.0.0" - jest-environment-node "^29.0.0" + jest-circus "^29.0.1" + jest-environment-node "^29.0.1" jest-get-type "^29.0.0" jest-regex-util "^29.0.0" - jest-resolve "^29.0.0" - jest-runner "^29.0.0" - jest-util "^29.0.0" - jest-validate "^29.0.0" + jest-resolve "^29.0.1" + jest-runner "^29.0.1" + jest-util "^29.0.1" + jest-validate "^29.0.1" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^29.0.0" + pretty-format "^29.0.1" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.0.0.tgz#24a3dd5846ae0e48cba0194b1397178b06b123ad" - integrity sha512-erkuYf1dQBHow3XJmS+bH6t9TZ0GwrSdQGauN8sTqyZlFByOjRadmHgTTcAHINeeSwxzGHN2ob3PXVvZphD7XQ== +jest-diff@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.0.1.tgz#d14e900a38ee4798d42feaaf0c61cb5b98e4c028" + integrity sha512-l8PYeq2VhcdxG9tl5cU78ClAlg/N7RtVSp0v3MlXURR0Y99i6eFnegmasOandyTmO6uEdo20+FByAjBFEO9nuw== dependencies: chalk "^4.0.0" diff-sequences "^29.0.0" jest-get-type "^29.0.0" - pretty-format "^29.0.0" + pretty-format "^29.0.1" jest-docblock@^29.0.0: version "29.0.0" @@ -1739,92 +1739,92 @@ jest-docblock@^29.0.0: dependencies: detect-newline "^3.0.0" -jest-each@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.0.0.tgz#1aff8fae85ed2094ca3b64ae9ab61225dbf20c6a" - integrity sha512-ACKRvqdo7Bc0YrjQbrQtokpQ2NZxdXA63OklJht7a9UarCJXlZeWh51wEUe0ORqbnu15nAnX1YFQHmVpS1+ZXA== +jest-each@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.0.1.tgz#c17da68a7073440122dbd47dca3941351ee0cbe5" + integrity sha512-UmCZYU9LPvRfSDoCrKJqrCNmgTYGGb3Ga6IVsnnVjedBTRRR9GJMca7UmDKRrJ1s+U632xrVtiRD27BxaG1aaQ== dependencies: - "@jest/types" "^29.0.0" + "@jest/types" "^29.0.1" chalk "^4.0.0" jest-get-type "^29.0.0" - jest-util "^29.0.0" - pretty-format "^29.0.0" + jest-util "^29.0.1" + pretty-format "^29.0.1" -jest-environment-node@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.0.0.tgz#849fc1c0b149cf7e6f9513715a0ec6b775ee3506" - integrity sha512-Cns21Vgu0z7LjtssL0SWkxmjclHdwXeECFAP3ONit5NPnGCbv+0Rqby8w9vK7NpFlUaFgMmLYYBsUjSmIhwpvg== +jest-environment-node@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.0.1.tgz#b09db2a1b8439aace11a6805719d92498a64987e" + integrity sha512-PcIRBrEBFAPBqkbL53ZpEvTptcAnOW6/lDfqBfACMm3vkVT0N7DcfkH/hqNSbDmSxzGr0FtJI6Ej3TPhveWCMA== dependencies: - "@jest/environment" "^29.0.0" - "@jest/fake-timers" "^29.0.0" - "@jest/types" "^29.0.0" + "@jest/environment" "^29.0.1" + "@jest/fake-timers" "^29.0.1" + "@jest/types" "^29.0.1" "@types/node" "*" - jest-mock "^29.0.0" - jest-util "^29.0.0" + jest-mock "^29.0.1" + jest-util "^29.0.1" jest-get-type@^29.0.0: version "29.0.0" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.0.0.tgz#843f6c50a1b778f7325df1129a0fd7aa713aef80" integrity sha512-83X19z/HuLKYXYHskZlBAShO7UfLFXu/vWajw9ZNJASN32li8yHMaVGAQqxFW1RCFOkB7cubaL6FaJVQqqJLSw== -jest-haste-map@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.0.0.tgz#52078a615aaa8a3ef017903e43cd413894fca768" - integrity sha512-mLyDt2WyNU0DZ64s7kRFkFJzrHEuXIxG+OKOs9/P5s1W7NzXE+P7SvLbxjz2Cg63cJjuglYRrD6fZcYf19T8Lw== +jest-haste-map@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.0.1.tgz#472212f93ef44309bf97d191f93ddd2e41169615" + integrity sha512-gcKOAydafpGoSBvcj/mGCfhOKO8fRLkAeee1KXGdcJ1Pb9O2nnOl4I8bQSIID2MaZeMHtLLgNboukh/pUGkBtg== dependencies: - "@jest/types" "^29.0.0" + "@jest/types" "^29.0.1" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" jest-regex-util "^29.0.0" - jest-util "^29.0.0" - jest-worker "^29.0.0" + jest-util "^29.0.1" + jest-worker "^29.0.1" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.0.0.tgz#7a6791cf61513550a8fc4a95f907f77db899204f" - integrity sha512-kBjNS0/z2+ZV/3N7R+ot5fKD2W1fHkoxC3kH/fkb2z24YSPfR9RGwiNX+YLRG9r0gWsxQx16boxzHT23G6rFBw== +jest-leak-detector@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.0.1.tgz#1a7cf8475d85e7b2bd53efa5adc5195828a12c33" + integrity sha512-5tISHJphB+sCmKXtVHJGQGltj7ksrLLb9vkuNWwFR86Of1tfzjskvrrrZU1gSzEfWC+qXIn4tuh8noKHYGMIPA== dependencies: jest-get-type "^29.0.0" - pretty-format "^29.0.0" + pretty-format "^29.0.1" -jest-matcher-utils@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.0.0.tgz#7e79d5d43ccbe4fe2b27f812986f196e7a98746c" - integrity sha512-HtCxFHI8lQSbN1RppFjtl6DIrS+x4d3lOhpJljVxFEXob4lxlKon3FunW0XoGxNSvIoD00AfTFspnufpOqszrg== +jest-matcher-utils@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.0.1.tgz#eaa92dd5405c2df9d31d45ec4486361d219de3e9" + integrity sha512-/e6UbCDmprRQFnl7+uBKqn4G22c/OmwriE5KCMVqxhElKCQUDcFnq5XM9iJeKtzy4DUjxT27y9VHmKPD8BQPaw== dependencies: chalk "^4.0.0" - jest-diff "^29.0.0" + jest-diff "^29.0.1" jest-get-type "^29.0.0" - pretty-format "^29.0.0" + pretty-format "^29.0.1" -jest-message-util@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.0.0.tgz#7995991fca9b41dc8410d0952894bbd4c5052ba8" - integrity sha512-4U0RdNV0TBTgVGzEchjryEpq4sqLO3gUQT7TEIbO5+q0K5MuiofOPcXk4GLpWviWByMRJjliQNMuzJ4YGT+oGQ== +jest-message-util@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.0.1.tgz#85c4b5b90296c228da158e168eaa5b079f2ab879" + integrity sha512-wRMAQt3HrLpxSubdnzOo68QoTfQ+NLXFzU0Heb18ZUzO2S9GgaXNEdQ4rpd0fI9dq2NXkpCk1IUWSqzYKji64A== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.0.0" + "@jest/types" "^29.0.1" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^29.0.0" + pretty-format "^29.0.1" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.0.0.tgz#dff9e2a9caa9c813115db24e78d00a0cba9f0019" - integrity sha512-0AWznVt415KMCxcJPaE2+tWaruw0w8aRrKH1Y/NZUx3+Pd9f20jQjUR82iHqGSuYS4EOHL9uI8SjAhJk+ET91g== +jest-mock@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.0.1.tgz#12e1b137035365b022ccdb8fd67d476cd4d4bfad" + integrity sha512-i1yTceg2GKJwUNZFjIzrH7Y74fN1SKJWxQX/Vu3LT4TiJerFARH5l+4URNyapZ+DNpchHYrGOP2deVbn3ma8JA== dependencies: - "@jest/types" "^29.0.0" + "@jest/types" "^29.0.1" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -1837,88 +1837,88 @@ jest-regex-util@^29.0.0: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.0.0.tgz#b442987f688289df8eb6c16fa8df488b4cd007de" integrity sha512-BV7VW7Sy0fInHWN93MMPtlClweYv2qrSCwfeFWmpribGZtQPWNvRSq9XOVgOEjU1iBGRKXUZil0o2AH7Iy9Lug== -jest-resolve-dependencies@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.0.0.tgz#6c7886caa63838acb207f2caa7eb8f64930fb1e7" - integrity sha512-1TYUMcLZcUqa2fdUQ3leYtiXWXfNmimPvnJ34YDLLf0nyJ/aEeqlHJM9Ji2jw9Qxdh7nUypanjUlUV87yRHBFQ== +jest-resolve-dependencies@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.0.1.tgz#c41b88380c8ea178ce72a750029b5f3d5f65cb94" + integrity sha512-fUGcYlSc1NzNz+tsHDjjG0rclw6blJcFZsLEsezxm/n54bAm9HFvJxgBuCV1CJQoPtIx6AfR+tXkR9lpWJs2LQ== dependencies: jest-regex-util "^29.0.0" - jest-snapshot "^29.0.0" + jest-snapshot "^29.0.1" -jest-resolve@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.0.0.tgz#63d8e0b5cae115203da65cc8331722a315069351" - integrity sha512-MN19maPUXzibBshYg/cSrDWqiJwEBur6gbQb2lwOL4+6k14wdNW8Xh0uNPPxUntb7cpTi07uql/bUO5TVwiJbA== +jest-resolve@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.0.1.tgz#4f1338eee2ccc7319ffce850e13eb118a9e93ce5" + integrity sha512-dwb5Z0lLZbptlBtPExqsHfdDamXeiRLv4vdkfPrN84vBwLSWHWcXjlM2JXD/KLSQfljBcXbzI/PDvUJuTQ84Nw== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^29.0.0" + jest-haste-map "^29.0.1" jest-pnp-resolver "^1.2.2" - jest-util "^29.0.0" - jest-validate "^29.0.0" + jest-util "^29.0.1" + jest-validate "^29.0.1" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.0.0.tgz#8fff8a248b912e8be033a0b61d477a323b349397" - integrity sha512-OpTpRIBOIn9RXuMMrpS+h9ZoK+nZHaOuNOceUiDbDoOJ6pmeGu0zst7VR22xXT3fOCwWqg5qe0fZ23G+ve5P0Q== - dependencies: - "@jest/console" "^29.0.0" - "@jest/environment" "^29.0.0" - "@jest/test-result" "^29.0.0" - "@jest/transform" "^29.0.0" - "@jest/types" "^29.0.0" +jest-runner@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.0.1.tgz#15bacd13170f3d786168ef8548fdeb96933ea643" + integrity sha512-XeFfPmHtO7HyZyD1uJeO4Oqa8PyTbDHzS1YdGrvsFXk/A5eXinbqA5a42VUEqvsKQgNnKTl5NJD0UtDWg7cQ2A== + dependencies: + "@jest/console" "^29.0.1" + "@jest/environment" "^29.0.1" + "@jest/test-result" "^29.0.1" + "@jest/transform" "^29.0.1" + "@jest/types" "^29.0.1" "@types/node" "*" chalk "^4.0.0" emittery "^0.10.2" graceful-fs "^4.2.9" jest-docblock "^29.0.0" - jest-environment-node "^29.0.0" - jest-haste-map "^29.0.0" - jest-leak-detector "^29.0.0" - jest-message-util "^29.0.0" - jest-resolve "^29.0.0" - jest-runtime "^29.0.0" - jest-util "^29.0.0" - jest-watcher "^29.0.0" - jest-worker "^29.0.0" + jest-environment-node "^29.0.1" + jest-haste-map "^29.0.1" + jest-leak-detector "^29.0.1" + jest-message-util "^29.0.1" + jest-resolve "^29.0.1" + jest-runtime "^29.0.1" + jest-util "^29.0.1" + jest-watcher "^29.0.1" + jest-worker "^29.0.1" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.0.0.tgz#544e610ca0e55748819a31c18e3166abff7302f4" - integrity sha512-dU0qFpTRWZY7Rur7yBgpz4g67mITSozBZ1jlhoG4ER/P/NiTFyZ/W8nMd5floeAMafmbrOc/5A9SlCu7SQCoBA== +jest-runtime@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.0.1.tgz#cafdc10834c45c50105eecb0ded8677ce741e2af" + integrity sha512-yDgz5OE0Rm44PUAfTqwA6cDFnTYnVcYbRpPECsokSASQ0I5RXpnKPVr2g0CYZWKzbsXqqtmM7TIk7CAutZJ7gQ== dependencies: - "@jest/environment" "^29.0.0" - "@jest/fake-timers" "^29.0.0" - "@jest/globals" "^29.0.0" + "@jest/environment" "^29.0.1" + "@jest/fake-timers" "^29.0.1" + "@jest/globals" "^29.0.1" "@jest/source-map" "^29.0.0" - "@jest/test-result" "^29.0.0" - "@jest/transform" "^29.0.0" - "@jest/types" "^29.0.0" + "@jest/test-result" "^29.0.1" + "@jest/transform" "^29.0.1" + "@jest/types" "^29.0.1" "@types/node" "*" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^29.0.0" - jest-message-util "^29.0.0" - jest-mock "^29.0.0" + jest-haste-map "^29.0.1" + jest-message-util "^29.0.1" + jest-mock "^29.0.1" jest-regex-util "^29.0.0" - jest-resolve "^29.0.0" - jest-snapshot "^29.0.0" - jest-util "^29.0.0" + jest-resolve "^29.0.1" + jest-snapshot "^29.0.1" + jest-util "^29.0.1" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.0.0.tgz#5a349608cb7fa12dbdafad999cd5a3ed571bfd90" - integrity sha512-rR3B8GInk/IibF0M/sQCukSM8xX8bPI3Q0kjoAw4HT9Mx0Q3bS0MmF74rsreBOnVJgzN0Iwrc7YY56Yp8KQ7kA== +jest-snapshot@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.0.1.tgz#ed455cb7e56fb43e2d451edd902d622349d6afed" + integrity sha512-OuYGp+lsh7RhB3DDX36z/pzrGm2F740e5ERG9PQpJyDknCRtWdhaehBQyMqDnsQdKkvC2zOcetcxskiHjO7e8Q== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" @@ -1926,81 +1926,81 @@ jest-snapshot@^29.0.0: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.0.0" - "@jest/transform" "^29.0.0" - "@jest/types" "^29.0.0" + "@jest/expect-utils" "^29.0.1" + "@jest/transform" "^29.0.1" + "@jest/types" "^29.0.1" "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.0.0" + expect "^29.0.1" graceful-fs "^4.2.9" - jest-diff "^29.0.0" + jest-diff "^29.0.1" jest-get-type "^29.0.0" - jest-haste-map "^29.0.0" - jest-matcher-utils "^29.0.0" - jest-message-util "^29.0.0" - jest-util "^29.0.0" + jest-haste-map "^29.0.1" + jest-matcher-utils "^29.0.1" + jest-message-util "^29.0.1" + jest-util "^29.0.1" natural-compare "^1.4.0" - pretty-format "^29.0.0" + pretty-format "^29.0.1" semver "^7.3.5" -jest-util@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.0.0.tgz#54dfddf25fb011a2ff93fe8d11738dee8ff7f663" - integrity sha512-HMjW/pkFgi34LGKumjNDK03DYonV+nPMNUZ63rZX8PFdBkdIWUtOCEiaa7sAJkWrw5MyMVzSpa22NcOJjoQ3JQ== +jest-util@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.0.1.tgz#f854a4a8877c7817316c4afbc2a851ceb2e71598" + integrity sha512-GIWkgNfkeA9d84rORDHPGGTFBrRD13A38QVSKE0bVrGSnoR1KDn8Kqz+0yI5kezMgbT/7zrWaruWP1Kbghlb2A== dependencies: - "@jest/types" "^29.0.0" + "@jest/types" "^29.0.1" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.0.0.tgz#714f9f013e7dc4cb3a20b098170fbed3fbad4252" - integrity sha512-UhgDKmahJnv5s5MK6a8kQ397YNS9euvL7gWTvUf7y0OO7vZeafUItlq3tguvfFVazQJ+kBGUm/XCJes7V61l8g== +jest-validate@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.0.1.tgz#8de8ff9d65507c0477964fd39c5b0a1778e3103d" + integrity sha512-mS4q7F738YXZFWBPqE+NjHU/gEOs7IBIFQ8i9zq5EO691cLrUbLhFq4larf8/lNcmauRO71tn/+DTW2y+MrLow== dependencies: - "@jest/types" "^29.0.0" + "@jest/types" "^29.0.1" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^29.0.0" leven "^3.1.0" - pretty-format "^29.0.0" + pretty-format "^29.0.1" -jest-watcher@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.0.0.tgz#7ecdf96acaafa0d1afe4be9695f3c81978afd20d" - integrity sha512-GoRq5QJt5/dv3keK7rIzg9R0e/HpTnjyMNYtCTTDZgGIj6QUDMpiJqt7Mwfyyaxwg5PS8gVyQvRQn6Lril4cuQ== +jest-watcher@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.0.1.tgz#63adeb8887a0562ed8f990f413b830ef48a8db94" + integrity sha512-0LBWDL3sZ+vyHRYxjqm2irhfwhUXHonjLSbd0oDeGq44U1e1uUh3icWNXYF8HO/UEnOoa6+OJDncLUXP2Hdg9A== dependencies: - "@jest/test-result" "^29.0.0" - "@jest/types" "^29.0.0" + "@jest/test-result" "^29.0.1" + "@jest/types" "^29.0.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.10.2" - jest-util "^29.0.0" + jest-util "^29.0.1" string-length "^4.0.1" -jest-worker@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.0.0.tgz#a1c7b67b2d9ce057383999b32d8b71794efcd0b9" - integrity sha512-2t9Panx3F9N1wAvRuZT7xLEptRFc1C5G90DOHniIGz1JIgF9uhd5u8jNBsc7wN63lhnaiLeVLnNx21wT7OVFEQ== +jest-worker@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.0.1.tgz#fb42ff7e05e0573f330ec0cf781fc545dcd11a31" + integrity sha512-+B/2/8WW7goit7qVezG9vnI1QP3dlmuzi2W0zxazAQQ8dcDIA63dDn6j4pjOGBARha/ZevcwYQtNIzCySbS7fQ== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.0.0.tgz#0614bce40ffd3a1a19a30c8a2c66d19103712001" - integrity sha512-9uz4Tclskb8WrfRXqu66FsFCFoyYctwWXpruKwnD95FZqkyoEAA1oGH53HUn7nQx7uEgZTKdNl/Yo6DqqU+XMg== + version "29.0.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.0.1.tgz#4a1c48d79fada0a47c686a111ed9411fd41cd584" + integrity sha512-liHkwzaW6iwQyhRBFj0A4ZYKcsQ7ers1s62CCT95fPeNzoxT/vQRWwjTT4e7jpSCwrvPP2t1VESuy7GrXcr2ug== dependencies: - "@jest/core" "^29.0.0" - "@jest/types" "^29.0.0" + "@jest/core" "^29.0.1" + "@jest/types" "^29.0.1" import-local "^3.0.2" - jest-cli "^29.0.0" + jest-cli "^29.0.1" js-tokens@^4.0.0: version "4.0.0" @@ -2321,10 +2321,10 @@ prettier@>=2.3.0: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== -pretty-format@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.0.0.tgz#a9a604ca71678f803f34f6563a25a638fce267ba" - integrity sha512-tMkFRn1vxRwZdiDETcveuNeonRKDg4doOvI+iyb1sOAtxYioGzRicqnsr+d3C/lLv9hBiM/2lDBi5ilR81h2bQ== +pretty-format@^29.0.1: + version "29.0.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.0.1.tgz#2f8077114cdac92a59b464292972a106410c7ad0" + integrity sha512-iTHy3QZMzuL484mSTYbQIM1AHhEQsH8mXWS2/vd2yFBYnG3EBqGiMONo28PlPgrW7P/8s/1ISv+y7WH306l8cw== dependencies: "@jest/schemas" "^29.0.0" ansi-styles "^5.0.0" From d8e36e335ba735bea97c4e24cd45a76d7bf992d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Sep 2022 15:55:49 +0000 Subject: [PATCH 634/785] Bump jest from 29.0.1 to 29.0.2 Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.0.1 to 29.0.2. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.0.2/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 598 +++++++++++++++++++++++++++--------------------------- 1 file changed, 299 insertions(+), 299 deletions(-) diff --git a/yarn.lock b/yarn.lock index cc38824c..a851f3cd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -353,28 +353,28 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^29.0.1": - version "29.0.1" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.0.1.tgz#e0e429cfc89900e3a46ce27f493bf488395ade39" - integrity sha512-SxLvSKf9gk4Rvt3p2KRQWVQ3sVj7S37rjlCHwp2+xNcRO/X+Uw0idbkfOtciUpjghHIxyggqcrrKhThQ+vClLQ== +"@jest/console@^29.0.2": + version "29.0.2" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.0.2.tgz#3a02dccad4dd37c25fd30013df67ec50998402ce" + integrity sha512-Fv02ijyhF4D/Wb3DvZO3iBJQz5DnzpJEIDBDbvje8Em099N889tNMUnBw7SalmSuOI+NflNG40RA1iK71kImPw== dependencies: - "@jest/types" "^29.0.1" + "@jest/types" "^29.0.2" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^29.0.1" - jest-util "^29.0.1" + jest-message-util "^29.0.2" + jest-util "^29.0.2" slash "^3.0.0" -"@jest/core@^29.0.1": - version "29.0.1" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.0.1.tgz#a49517795f692a510b6fae55a9c09e659826c472" - integrity sha512-EcFrXkYh8I1GYHRH9V4TU7jr4P6ckaPqGo/z4AIJjHDZxicjYgWB6fx1xFb5bhEM87eUjCF4FAY5t+RamLWQmA== +"@jest/core@^29.0.2": + version "29.0.2" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.0.2.tgz#7bf47ff6cd882678c47fbdea562bdf1ff03b6d33" + integrity sha512-imP5M6cdpHEOkmcuFYZuM5cTG1DAF7ZlVNCq1+F7kbqme2Jcl+Kh4M78hihM76DJHNkurbv4UVOnejGxBKEmww== dependencies: - "@jest/console" "^29.0.1" - "@jest/reporters" "^29.0.1" - "@jest/test-result" "^29.0.1" - "@jest/transform" "^29.0.1" - "@jest/types" "^29.0.1" + "@jest/console" "^29.0.2" + "@jest/reporters" "^29.0.2" + "@jest/test-result" "^29.0.2" + "@jest/transform" "^29.0.2" + "@jest/types" "^29.0.2" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" @@ -382,80 +382,80 @@ exit "^0.1.2" graceful-fs "^4.2.9" jest-changed-files "^29.0.0" - jest-config "^29.0.1" - jest-haste-map "^29.0.1" - jest-message-util "^29.0.1" + jest-config "^29.0.2" + jest-haste-map "^29.0.2" + jest-message-util "^29.0.2" jest-regex-util "^29.0.0" - jest-resolve "^29.0.1" - jest-resolve-dependencies "^29.0.1" - jest-runner "^29.0.1" - jest-runtime "^29.0.1" - jest-snapshot "^29.0.1" - jest-util "^29.0.1" - jest-validate "^29.0.1" - jest-watcher "^29.0.1" + jest-resolve "^29.0.2" + jest-resolve-dependencies "^29.0.2" + jest-runner "^29.0.2" + jest-runtime "^29.0.2" + jest-snapshot "^29.0.2" + jest-util "^29.0.2" + jest-validate "^29.0.2" + jest-watcher "^29.0.2" micromatch "^4.0.4" - pretty-format "^29.0.1" + pretty-format "^29.0.2" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.0.1": - version "29.0.1" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.0.1.tgz#d236ce9e906744ac58bfc59ae6f7c9882ace7927" - integrity sha512-iLcFfoq2K6DAB+Mc+2VNLzZVmHdwQFeSqvoM/X8SMON6s/+yEi1iuRX3snx/JfwSnvmiMXjSr0lktxNxOcqXYA== +"@jest/environment@^29.0.2": + version "29.0.2" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.0.2.tgz#9e4b6d4c9bce5bfced6f63945d8c8e571394f572" + integrity sha512-Yf+EYaLOrVCgts/aTS5nGznU4prZUPa5k9S63Yct8YSOKj2jkdS17hHSUKhk5jxDFMyCy1PXknypDw7vfgc/mA== dependencies: - "@jest/fake-timers" "^29.0.1" - "@jest/types" "^29.0.1" + "@jest/fake-timers" "^29.0.2" + "@jest/types" "^29.0.2" "@types/node" "*" - jest-mock "^29.0.1" + jest-mock "^29.0.2" -"@jest/expect-utils@^29.0.1": - version "29.0.1" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.0.1.tgz#c1a84ee66caaef537f351dd82f7c63d559cf78d5" - integrity sha512-Tw5kUUOKmXGQDmQ9TSgTraFFS7HMC1HG/B7y0AN2G2UzjdAXz9BzK2rmNpCSDl7g7y0Gf/VLBm//blonvhtOTQ== +"@jest/expect-utils@^29.0.2": + version "29.0.2" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.0.2.tgz#00dfcb9e6fe99160c326ba39f7734b984543dea8" + integrity sha512-+wcQF9khXKvAEi8VwROnCWWmHfsJYCZAs5dmuMlJBKk57S6ZN2/FQMIlo01F29fJyT8kV/xblE7g3vkIdTLOjw== dependencies: jest-get-type "^29.0.0" -"@jest/expect@^29.0.1": - version "29.0.1" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.0.1.tgz#0ffde7f5b4c87f1dd6f8664726bd53f6cd1f7014" - integrity sha512-qKB3q52XDV8VUEiqKKLgLrJx7puQ8sYVqIDlul6n7SIXWS97DOK3KqbR2rDDaMtmenRHqEUl2fI+aFzx0oSemA== +"@jest/expect@^29.0.2": + version "29.0.2" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.0.2.tgz#641d151e1062ceb976c5ad1c23eba3bb1e188896" + integrity sha512-y/3geZ92p2/zovBm/F+ZjXUJ3thvT9IRzD6igqaWskFE2aR0idD+N/p5Lj/ZautEox/9RwEc6nqergebeh72uQ== dependencies: - expect "^29.0.1" - jest-snapshot "^29.0.1" + expect "^29.0.2" + jest-snapshot "^29.0.2" -"@jest/fake-timers@^29.0.1": - version "29.0.1" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.0.1.tgz#51ba7a82431db479d4b828576c139c4c0dc5e409" - integrity sha512-XZ+kAhLChVQ+KJNa5034p7O1Mz3vtWrelxDcMoxhZkgqmWDaEQAW9qJeutaeCfPvwaEwKYVyKDYfWpcyT8RiMw== +"@jest/fake-timers@^29.0.2": + version "29.0.2" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.0.2.tgz#6f15f4d8eb1089d445e3f73473ddc434faa2f798" + integrity sha512-2JhQeWU28fvmM5r33lxg6BxxkTKaVXs6KMaJ6eXSM8ml/MaWkt2BvbIO8G9KWAJFMdBXWbn+2h9OK1/s5urKZA== dependencies: - "@jest/types" "^29.0.1" + "@jest/types" "^29.0.2" "@sinonjs/fake-timers" "^9.1.2" "@types/node" "*" - jest-message-util "^29.0.1" - jest-mock "^29.0.1" - jest-util "^29.0.1" + jest-message-util "^29.0.2" + jest-mock "^29.0.2" + jest-util "^29.0.2" -"@jest/globals@^29.0.1": - version "29.0.1" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.0.1.tgz#764135ad31408fb632b3126793ab3aaed933095f" - integrity sha512-BtZWrVrKRKNUt7T1H2S8Mz31PN7ItROCmH+V5pn10hJDUfjOCTIUwb0WtLZzm0f1tJ3Uvx+5lVZrF/VTKqNaFg== +"@jest/globals@^29.0.2": + version "29.0.2" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.0.2.tgz#605d3389ad0c6bfe17ad3e1359b5bc39aefd8b65" + integrity sha512-4hcooSNJCVXuTu07/VJwCWW6HTnjLtQdqlcGisK6JST7z2ixa8emw4SkYsOk7j36WRc2ZUEydlUePnOIOTCNXg== dependencies: - "@jest/environment" "^29.0.1" - "@jest/expect" "^29.0.1" - "@jest/types" "^29.0.1" - jest-mock "^29.0.1" + "@jest/environment" "^29.0.2" + "@jest/expect" "^29.0.2" + "@jest/types" "^29.0.2" + jest-mock "^29.0.2" -"@jest/reporters@^29.0.1": - version "29.0.1" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.0.1.tgz#82a491657031c1cc278bf659905e5094973309ad" - integrity sha512-dM3L8JmYYOsdeXUUVZClQy67Tz/v1sMo9h4AQv2U+716VLHV0zdA6Hh4FQNAHMhYw/95dbZbPX8Q+TRR7Rw+wA== +"@jest/reporters@^29.0.2": + version "29.0.2" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.0.2.tgz#5f927646b6f01029525c05ac108324eac7d7ad5c" + integrity sha512-Kr41qejRQHHkCgWHC9YwSe7D5xivqP4XML+PvgwsnRFaykKdNflDUb4+xLXySOU+O/bPkVdFpGzUpVNSJChCrw== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.0.1" - "@jest/test-result" "^29.0.1" - "@jest/transform" "^29.0.1" - "@jest/types" "^29.0.1" + "@jest/console" "^29.0.2" + "@jest/test-result" "^29.0.2" + "@jest/transform" "^29.0.2" + "@jest/types" "^29.0.2" "@jridgewell/trace-mapping" "^0.3.15" "@types/node" "*" chalk "^4.0.0" @@ -468,9 +468,9 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^29.0.1" - jest-util "^29.0.1" - jest-worker "^29.0.1" + jest-message-util "^29.0.2" + jest-util "^29.0.2" + jest-worker "^29.0.2" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" @@ -493,51 +493,51 @@ callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^29.0.1": - version "29.0.1" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.0.1.tgz#97ac334e4c6f7d016c341cdd500aa423a38e4cdd" - integrity sha512-XCA4whh/igxjBaR/Hg8qwFd/uTsauoD7QAdAYUjV2CSGx0+iunhjoCRRWTwqjQrETRqOJABx6kNfw0+C0vMSgQ== +"@jest/test-result@^29.0.2": + version "29.0.2" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.0.2.tgz#dde4922e6234dd311c85ddf1ec2b7f600a90295d" + integrity sha512-b5rDc0lLL6Kx73LyCx6370k9uZ8o5UKdCpMS6Za3ke7H9y8PtAU305y6TeghpBmf2In8p/qqi3GpftgzijSsNw== dependencies: - "@jest/console" "^29.0.1" - "@jest/types" "^29.0.1" + "@jest/console" "^29.0.2" + "@jest/types" "^29.0.2" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.0.1": - version "29.0.1" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.0.1.tgz#7074b5f89ce30941b5b0fb493a19308d441a30b8" - integrity sha512-3GhSBMCRcWXGluP2Dw7CLP6mNke/t+EcftF5YjzhX1BJmqcatMbtZVwjuCfZy0TCME1GevXy3qTyV5PLpwIFKQ== +"@jest/test-sequencer@^29.0.2": + version "29.0.2" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.0.2.tgz#ae9b2d2c1694c7aa1a407713100e14dbfa79293e" + integrity sha512-fsyZqHBlXNMv5ZqjQwCuYa2pskXCO0DVxh5aaVCuAtwzHuYEGrhordyEncBLQNuCGQSYgElrEEmS+7wwFnnMKw== dependencies: - "@jest/test-result" "^29.0.1" + "@jest/test-result" "^29.0.2" graceful-fs "^4.2.9" - jest-haste-map "^29.0.1" + jest-haste-map "^29.0.2" slash "^3.0.0" -"@jest/transform@^29.0.1": - version "29.0.1" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.0.1.tgz#fdaa5d9e135c9bd7addbe65bedd1f15ad028cc7e" - integrity sha512-6UxXtqrPScFdDhoip8ys60dQAIYppQinyR87n9nlasR/ZnFfJohKToqzM29KK4gb9gHRv5oDFChdqZKE0SIhsg== +"@jest/transform@^29.0.2": + version "29.0.2" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.0.2.tgz#eef90ebd939b68bf2c2508d9e914377871869146" + integrity sha512-lajVQx2AnsR+Pa17q2zR7eikz2PkPs1+g/qPbZkqQATeS/s6eT55H+yHcsLfuI/0YQ/4VSBepSu3bOX+44q0aA== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^29.0.1" + "@jest/types" "^29.0.2" "@jridgewell/trace-mapping" "^0.3.15" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.0.1" + jest-haste-map "^29.0.2" jest-regex-util "^29.0.0" - jest-util "^29.0.1" + jest-util "^29.0.2" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" write-file-atomic "^4.0.1" -"@jest/types@^29.0.1": - version "29.0.1" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.0.1.tgz#1985650acf137bdb81710ff39a4689ec071dd86a" - integrity sha512-ft01rxzVsbh9qZPJ6EFgAIj3PT9FCRfBF9Xljo2/33VDOUjLZr0ZJ2oKANqh9S/K0/GERCsHDAQlBwj7RxA+9g== +"@jest/types@^29.0.2": + version "29.0.2" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.0.2.tgz#5a5391fa7f7f41bf4b201d6d2da30e874f95b6c1" + integrity sha512-5WNMesBLmlkt1+fVkoCjHa0X3i3q8zc4QLTDkdHgCa2gyPZc7rdlZBWgVLqwS1860ZW5xJuCDwAzqbGaXIr/ew== dependencies: "@jest/schemas" "^29.0.0" "@types/istanbul-lib-coverage" "^2.0.0" @@ -810,15 +810,15 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.0.1.tgz#db50de501fc8727e768f5aa417496cb871ee1ba0" - integrity sha512-wyI9r8tqwsZEMWiIaYjdUJ6ztZIO4DMWpGq7laW34wR71WtRS+D/iBEtXOP5W2aSYCVUQMsypRl/xiJYZznnTg== +babel-jest@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.0.2.tgz#7efde496c07607949e9be499bf277aa1543ded95" + integrity sha512-yTu4/WSi/HzarjQtrJSwV+/0maoNt+iP0DmpvFJdv9yY+5BuNle8TbheHzzcSWj5gIHfuhpbLYHWRDYhWKyeKQ== dependencies: - "@jest/transform" "^29.0.1" + "@jest/transform" "^29.0.2" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^29.0.0" + babel-preset-jest "^29.0.2" chalk "^4.0.0" graceful-fs "^4.2.9" slash "^3.0.0" @@ -834,10 +834,10 @@ babel-plugin-istanbul@^6.1.1: istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.0.0.tgz#ae4873399a199ede93697a15919d3d0f614a2eb1" - integrity sha512-B9oaXrlxXHFWeWqhDPg03iqQd2UN/mg/VdZOsLaqAVBkztru3ctTryAI4zisxLEEgmcUnLTKewqx0gGifoXD3A== +babel-plugin-jest-hoist@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.0.2.tgz#ae61483a829a021b146c016c6ad39b8bcc37c2c8" + integrity sha512-eBr2ynAEFjcebVvu8Ktx580BD1QKCrBG1XwEUTXJe285p9HA/4hOhfWCFRQhTKSyBV0VzjhG7H91Eifz9s29hg== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -862,12 +862,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.0.0.tgz#52d7f1afe3a15d14a3c5ab4349cbd388d98d330b" - integrity sha512-B5Ke47Xcs8rDF3p1korT3LoilpADCwbG93ALqtvqu6Xpf4d8alKkrCBTExbNzdHJcIuEPpfYvEaFFRGee2kUgQ== +babel-preset-jest@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.0.2.tgz#e14a7124e22b161551818d89e5bdcfb3b2b0eac7" + integrity sha512-BeVXp7rH5TK96ofyEnHjznjLMQ2nAeDJ+QzxKnHAAMs0RgrQsCywjAN8m4mOm5Di0pxU//3AoEeJJrerMH5UeA== dependencies: - babel-plugin-jest-hoist "^29.0.0" + babel-plugin-jest-hoist "^29.0.2" babel-preset-current-node-syntax "^1.0.0" balanced-match@^1.0.0: @@ -1280,16 +1280,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.0.1.tgz#a2fa64a59cffe4b4007877e730bc82be3d1742bb" - integrity sha512-yQgemsjLU+1S8t2A7pXT3Sn/v5/37LY8J+tocWtKEA0iEYYc6gfKbbJJX2fxHZmd7K9WpdbQqXUpmYkq1aewYg== +expect@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.0.2.tgz#22c7132400f60444b427211f1d6bb604a9ab2420" + integrity sha512-JeJlAiLKn4aApT4pzUXBVxl3NaZidWIOdg//smaIlP9ZMBDkHZGFd9ubphUZP9pUyDEo7bC6M0IIZR51o75qQw== dependencies: - "@jest/expect-utils" "^29.0.1" + "@jest/expect-utils" "^29.0.2" jest-get-type "^29.0.0" - jest-matcher-utils "^29.0.1" - jest-message-util "^29.0.1" - jest-util "^29.0.1" + jest-matcher-utils "^29.0.2" + jest-message-util "^29.0.2" + jest-util "^29.0.2" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1656,86 +1656,86 @@ jest-changed-files@^29.0.0: execa "^5.0.0" p-limit "^3.1.0" -jest-circus@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.0.1.tgz#7ecb4913e134fb4addc03655fb36c9398014fa07" - integrity sha512-I5J4LyK3qPo8EnqPmxsMAVR+2SFx7JOaZsbqW9xQmk4UDmTCD92EQgS162Ey3Jq6CfpKJKFDhzhG3QqiE0fRbw== +jest-circus@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.0.2.tgz#7dda94888a8d47edb58e85a8e5f688f9da6657a3" + integrity sha512-YTPEsoE1P1X0bcyDQi3QIkpt2Wl9om9k2DQRuLFdS5x8VvAKSdYAVJufgvudhnKgM8WHvvAzhBE+1DRQB8x1CQ== dependencies: - "@jest/environment" "^29.0.1" - "@jest/expect" "^29.0.1" - "@jest/test-result" "^29.0.1" - "@jest/types" "^29.0.1" + "@jest/environment" "^29.0.2" + "@jest/expect" "^29.0.2" + "@jest/test-result" "^29.0.2" + "@jest/types" "^29.0.2" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" is-generator-fn "^2.0.0" - jest-each "^29.0.1" - jest-matcher-utils "^29.0.1" - jest-message-util "^29.0.1" - jest-runtime "^29.0.1" - jest-snapshot "^29.0.1" - jest-util "^29.0.1" + jest-each "^29.0.2" + jest-matcher-utils "^29.0.2" + jest-message-util "^29.0.2" + jest-runtime "^29.0.2" + jest-snapshot "^29.0.2" + jest-util "^29.0.2" p-limit "^3.1.0" - pretty-format "^29.0.1" + pretty-format "^29.0.2" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.0.1.tgz#6633c2ab97337ac5207910bd6b0aba2ef0900110" - integrity sha512-XozBHtoJCS6mnjCxNESyGm47Y4xSWzNlBJj4tix9nGrG6m068B83lrTWKtjYAenYSfOqyYVpQCkyqUp35IT+qA== +jest-cli@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.0.2.tgz#adf341ee3a4fd6ad1f23e3c0eb4e466847407021" + integrity sha512-tlf8b+4KcUbBGr25cywIi3+rbZ4+G+SiG8SvY552m9sRZbXPafdmQRyeVE/C/R8K+TiBAMrTIUmV2SlStRJ40g== dependencies: - "@jest/core" "^29.0.1" - "@jest/test-result" "^29.0.1" - "@jest/types" "^29.0.1" + "@jest/core" "^29.0.2" + "@jest/test-result" "^29.0.2" + "@jest/types" "^29.0.2" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.0.1" - jest-util "^29.0.1" - jest-validate "^29.0.1" + jest-config "^29.0.2" + jest-util "^29.0.2" + jest-validate "^29.0.2" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.0.1.tgz#bccc2aedc3bafb6cb08bad23e5f0fcc3b1959268" - integrity sha512-3duIx5ucEPIsUOESDTuasMfqHonD0oZRjqHycIMHSC4JwbvHDjAWNKN/NiM0ZxHXjAYrMTLt2QxSQ+IqlbYE5A== +jest-config@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.0.2.tgz#0ce168e1f74ca46c27285a7182ecb06c2d8ce7d9" + integrity sha512-RU4gzeUNZAFktYVzDGimDxeYoaiTnH100jkYYZgldqFamaZukF0IqmFx8+QrzVeEWccYg10EEJT3ox1Dq5b74w== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.0.1" - "@jest/types" "^29.0.1" - babel-jest "^29.0.1" + "@jest/test-sequencer" "^29.0.2" + "@jest/types" "^29.0.2" + babel-jest "^29.0.2" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^29.0.1" - jest-environment-node "^29.0.1" + jest-circus "^29.0.2" + jest-environment-node "^29.0.2" jest-get-type "^29.0.0" jest-regex-util "^29.0.0" - jest-resolve "^29.0.1" - jest-runner "^29.0.1" - jest-util "^29.0.1" - jest-validate "^29.0.1" + jest-resolve "^29.0.2" + jest-runner "^29.0.2" + jest-util "^29.0.2" + jest-validate "^29.0.2" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^29.0.1" + pretty-format "^29.0.2" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.0.1.tgz#d14e900a38ee4798d42feaaf0c61cb5b98e4c028" - integrity sha512-l8PYeq2VhcdxG9tl5cU78ClAlg/N7RtVSp0v3MlXURR0Y99i6eFnegmasOandyTmO6uEdo20+FByAjBFEO9nuw== +jest-diff@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.0.2.tgz#1a99419efda66f9ee72f91e580e774df95de5ddc" + integrity sha512-b9l9970sa1rMXH1owp2Woprmy42qIwwll/htsw4Gf7+WuSp5bZxNhkKHDuCGKL+HoHn1KhcC+tNEeAPYBkD2Jg== dependencies: chalk "^4.0.0" diff-sequences "^29.0.0" jest-get-type "^29.0.0" - pretty-format "^29.0.1" + pretty-format "^29.0.2" jest-docblock@^29.0.0: version "29.0.0" @@ -1744,92 +1744,92 @@ jest-docblock@^29.0.0: dependencies: detect-newline "^3.0.0" -jest-each@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.0.1.tgz#c17da68a7073440122dbd47dca3941351ee0cbe5" - integrity sha512-UmCZYU9LPvRfSDoCrKJqrCNmgTYGGb3Ga6IVsnnVjedBTRRR9GJMca7UmDKRrJ1s+U632xrVtiRD27BxaG1aaQ== +jest-each@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.0.2.tgz#f98375a79a37761137e11d458502dfe1f00ba5b0" + integrity sha512-+sA9YjrJl35iCg0W0VCrgCVj+wGhDrrKQ+YAqJ/DHBC4gcDFAeePtRRhpJnX9gvOZ63G7gt52pwp2PesuSEx0Q== dependencies: - "@jest/types" "^29.0.1" + "@jest/types" "^29.0.2" chalk "^4.0.0" jest-get-type "^29.0.0" - jest-util "^29.0.1" - pretty-format "^29.0.1" + jest-util "^29.0.2" + pretty-format "^29.0.2" -jest-environment-node@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.0.1.tgz#b09db2a1b8439aace11a6805719d92498a64987e" - integrity sha512-PcIRBrEBFAPBqkbL53ZpEvTptcAnOW6/lDfqBfACMm3vkVT0N7DcfkH/hqNSbDmSxzGr0FtJI6Ej3TPhveWCMA== +jest-environment-node@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.0.2.tgz#8196268c9f740f1d2e7ecccf212b4c1c5b0167e4" + integrity sha512-4Fv8GXVCToRlMzDO94gvA8iOzKxQ7rhAbs8L+j8GPyTxGuUiYkV+63LecGeVdVhsL2KXih1sKnoqmH6tp89J7Q== dependencies: - "@jest/environment" "^29.0.1" - "@jest/fake-timers" "^29.0.1" - "@jest/types" "^29.0.1" + "@jest/environment" "^29.0.2" + "@jest/fake-timers" "^29.0.2" + "@jest/types" "^29.0.2" "@types/node" "*" - jest-mock "^29.0.1" - jest-util "^29.0.1" + jest-mock "^29.0.2" + jest-util "^29.0.2" jest-get-type@^29.0.0: version "29.0.0" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.0.0.tgz#843f6c50a1b778f7325df1129a0fd7aa713aef80" integrity sha512-83X19z/HuLKYXYHskZlBAShO7UfLFXu/vWajw9ZNJASN32li8yHMaVGAQqxFW1RCFOkB7cubaL6FaJVQqqJLSw== -jest-haste-map@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.0.1.tgz#472212f93ef44309bf97d191f93ddd2e41169615" - integrity sha512-gcKOAydafpGoSBvcj/mGCfhOKO8fRLkAeee1KXGdcJ1Pb9O2nnOl4I8bQSIID2MaZeMHtLLgNboukh/pUGkBtg== +jest-haste-map@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.0.2.tgz#cac403a595e6e43982c9776b5c4dae63e38b22c5" + integrity sha512-SOorh2ysQ0fe8gsF4gaUDhoMIWAvi2hXOkwThEO48qT3JqA8GLAUieQcIvdSEd6M0scRDe1PVmKc5tXR3Z0U0A== dependencies: - "@jest/types" "^29.0.1" + "@jest/types" "^29.0.2" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" jest-regex-util "^29.0.0" - jest-util "^29.0.1" - jest-worker "^29.0.1" + jest-util "^29.0.2" + jest-worker "^29.0.2" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.0.1.tgz#1a7cf8475d85e7b2bd53efa5adc5195828a12c33" - integrity sha512-5tISHJphB+sCmKXtVHJGQGltj7ksrLLb9vkuNWwFR86Of1tfzjskvrrrZU1gSzEfWC+qXIn4tuh8noKHYGMIPA== +jest-leak-detector@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.0.2.tgz#f88fd08e352b5fad3d33e48ecab39e97077ed8a8" + integrity sha512-5f0493qDeAxjUldkBSQg5D1cLadRgZVyWpTQvfJeQwQUpHQInE21AyVHVv64M7P2Ue8Z5EZ4BAcoDS/dSPPgMw== dependencies: jest-get-type "^29.0.0" - pretty-format "^29.0.1" + pretty-format "^29.0.2" -jest-matcher-utils@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.0.1.tgz#eaa92dd5405c2df9d31d45ec4486361d219de3e9" - integrity sha512-/e6UbCDmprRQFnl7+uBKqn4G22c/OmwriE5KCMVqxhElKCQUDcFnq5XM9iJeKtzy4DUjxT27y9VHmKPD8BQPaw== +jest-matcher-utils@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.0.2.tgz#0ffdcaec340a9810caee6c73ff90fb029b446e10" + integrity sha512-s62YkHFBfAx0JLA2QX1BlnCRFwHRobwAv2KP1+YhjzF6ZCbCVrf1sG8UJyn62ZUsDaQKpoo86XMTjkUyO5aWmQ== dependencies: chalk "^4.0.0" - jest-diff "^29.0.1" + jest-diff "^29.0.2" jest-get-type "^29.0.0" - pretty-format "^29.0.1" + pretty-format "^29.0.2" -jest-message-util@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.0.1.tgz#85c4b5b90296c228da158e168eaa5b079f2ab879" - integrity sha512-wRMAQt3HrLpxSubdnzOo68QoTfQ+NLXFzU0Heb18ZUzO2S9GgaXNEdQ4rpd0fI9dq2NXkpCk1IUWSqzYKji64A== +jest-message-util@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.0.2.tgz#b2781dfb6a2d1c63830d9684c5148ae3155c6154" + integrity sha512-kcJAgms3ckJV0wUoLsAM40xAhY+pb9FVSZwicjFU9PFkaTNmqh9xd99/CzKse48wPM1ANUQKmp03/DpkY+lGrA== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.0.1" + "@jest/types" "^29.0.2" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^29.0.1" + pretty-format "^29.0.2" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.0.1.tgz#12e1b137035365b022ccdb8fd67d476cd4d4bfad" - integrity sha512-i1yTceg2GKJwUNZFjIzrH7Y74fN1SKJWxQX/Vu3LT4TiJerFARH5l+4URNyapZ+DNpchHYrGOP2deVbn3ma8JA== +jest-mock@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.0.2.tgz#d7810966a6338aca6a440c3cd9f19276477840ad" + integrity sha512-giWXOIT23UCxHCN2VUfUJ0Q7SmiqQwfSFXlCaIhW5anITpNQ+3vuLPQdKt5wkuwM37GrbFyHIClce8AAK9ft9g== dependencies: - "@jest/types" "^29.0.1" + "@jest/types" "^29.0.2" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -1842,88 +1842,88 @@ jest-regex-util@^29.0.0: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.0.0.tgz#b442987f688289df8eb6c16fa8df488b4cd007de" integrity sha512-BV7VW7Sy0fInHWN93MMPtlClweYv2qrSCwfeFWmpribGZtQPWNvRSq9XOVgOEjU1iBGRKXUZil0o2AH7Iy9Lug== -jest-resolve-dependencies@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.0.1.tgz#c41b88380c8ea178ce72a750029b5f3d5f65cb94" - integrity sha512-fUGcYlSc1NzNz+tsHDjjG0rclw6blJcFZsLEsezxm/n54bAm9HFvJxgBuCV1CJQoPtIx6AfR+tXkR9lpWJs2LQ== +jest-resolve-dependencies@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.0.2.tgz#2d30199ed0059ff97712f4fa6320c590bfcd2061" + integrity sha512-fSAu6eIG7wtGdnPJUkVVdILGzYAP9Dj/4+zvC8BrGe8msaUMJ9JeygU0Hf9+Uor6/icbuuzQn5See1uajLnAqg== dependencies: jest-regex-util "^29.0.0" - jest-snapshot "^29.0.1" + jest-snapshot "^29.0.2" -jest-resolve@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.0.1.tgz#4f1338eee2ccc7319ffce850e13eb118a9e93ce5" - integrity sha512-dwb5Z0lLZbptlBtPExqsHfdDamXeiRLv4vdkfPrN84vBwLSWHWcXjlM2JXD/KLSQfljBcXbzI/PDvUJuTQ84Nw== +jest-resolve@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.0.2.tgz#dd097e1c8020fbed4a8c1e1889ccb56022288697" + integrity sha512-V3uLjSA+EHxLtjIDKTBXnY71hyx+8lusCqPXvqzkFO1uCGvVpjBfuOyp+KOLBNSuY61kM2jhepiMwt4eiJS+Vw== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^29.0.1" + jest-haste-map "^29.0.2" jest-pnp-resolver "^1.2.2" - jest-util "^29.0.1" - jest-validate "^29.0.1" + jest-util "^29.0.2" + jest-validate "^29.0.2" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.0.1.tgz#15bacd13170f3d786168ef8548fdeb96933ea643" - integrity sha512-XeFfPmHtO7HyZyD1uJeO4Oqa8PyTbDHzS1YdGrvsFXk/A5eXinbqA5a42VUEqvsKQgNnKTl5NJD0UtDWg7cQ2A== +jest-runner@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.0.2.tgz#64e4e6c88f74387307687b73a4688f93369d8d99" + integrity sha512-+D82iPZejI8t+SfduOO1deahC/QgLFf8aJBO++Znz3l2ETtOMdM7K4ATsGWzCFnTGio5yHaRifg1Su5Ybza5Nw== dependencies: - "@jest/console" "^29.0.1" - "@jest/environment" "^29.0.1" - "@jest/test-result" "^29.0.1" - "@jest/transform" "^29.0.1" - "@jest/types" "^29.0.1" + "@jest/console" "^29.0.2" + "@jest/environment" "^29.0.2" + "@jest/test-result" "^29.0.2" + "@jest/transform" "^29.0.2" + "@jest/types" "^29.0.2" "@types/node" "*" chalk "^4.0.0" emittery "^0.10.2" graceful-fs "^4.2.9" jest-docblock "^29.0.0" - jest-environment-node "^29.0.1" - jest-haste-map "^29.0.1" - jest-leak-detector "^29.0.1" - jest-message-util "^29.0.1" - jest-resolve "^29.0.1" - jest-runtime "^29.0.1" - jest-util "^29.0.1" - jest-watcher "^29.0.1" - jest-worker "^29.0.1" + jest-environment-node "^29.0.2" + jest-haste-map "^29.0.2" + jest-leak-detector "^29.0.2" + jest-message-util "^29.0.2" + jest-resolve "^29.0.2" + jest-runtime "^29.0.2" + jest-util "^29.0.2" + jest-watcher "^29.0.2" + jest-worker "^29.0.2" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.0.1.tgz#cafdc10834c45c50105eecb0ded8677ce741e2af" - integrity sha512-yDgz5OE0Rm44PUAfTqwA6cDFnTYnVcYbRpPECsokSASQ0I5RXpnKPVr2g0CYZWKzbsXqqtmM7TIk7CAutZJ7gQ== +jest-runtime@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.0.2.tgz#dc3de788b8d75af346ae163d59c585027a9d809c" + integrity sha512-DO6F81LX4okOgjJLkLySv10E5YcV5NHUbY1ZqAUtofxdQE+q4hjH0P2gNsY8x3z3sqgw7O/+919SU4r18Fcuig== dependencies: - "@jest/environment" "^29.0.1" - "@jest/fake-timers" "^29.0.1" - "@jest/globals" "^29.0.1" + "@jest/environment" "^29.0.2" + "@jest/fake-timers" "^29.0.2" + "@jest/globals" "^29.0.2" "@jest/source-map" "^29.0.0" - "@jest/test-result" "^29.0.1" - "@jest/transform" "^29.0.1" - "@jest/types" "^29.0.1" + "@jest/test-result" "^29.0.2" + "@jest/transform" "^29.0.2" + "@jest/types" "^29.0.2" "@types/node" "*" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^29.0.1" - jest-message-util "^29.0.1" - jest-mock "^29.0.1" + jest-haste-map "^29.0.2" + jest-message-util "^29.0.2" + jest-mock "^29.0.2" jest-regex-util "^29.0.0" - jest-resolve "^29.0.1" - jest-snapshot "^29.0.1" - jest-util "^29.0.1" + jest-resolve "^29.0.2" + jest-snapshot "^29.0.2" + jest-util "^29.0.2" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.0.1.tgz#ed455cb7e56fb43e2d451edd902d622349d6afed" - integrity sha512-OuYGp+lsh7RhB3DDX36z/pzrGm2F740e5ERG9PQpJyDknCRtWdhaehBQyMqDnsQdKkvC2zOcetcxskiHjO7e8Q== +jest-snapshot@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.0.2.tgz#5017d54db8369f01900d11e179513fa5839fb5ac" + integrity sha512-26C4PzGKaX5gkoKg8UzYGVy2HPVcTaROSkf0gwnHu3lGeTB7bAIJBovvVPZoiJ20IximJELQs/r8WSDRCuGX2A== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" @@ -1931,81 +1931,81 @@ jest-snapshot@^29.0.1: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.0.1" - "@jest/transform" "^29.0.1" - "@jest/types" "^29.0.1" + "@jest/expect-utils" "^29.0.2" + "@jest/transform" "^29.0.2" + "@jest/types" "^29.0.2" "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.0.1" + expect "^29.0.2" graceful-fs "^4.2.9" - jest-diff "^29.0.1" + jest-diff "^29.0.2" jest-get-type "^29.0.0" - jest-haste-map "^29.0.1" - jest-matcher-utils "^29.0.1" - jest-message-util "^29.0.1" - jest-util "^29.0.1" + jest-haste-map "^29.0.2" + jest-matcher-utils "^29.0.2" + jest-message-util "^29.0.2" + jest-util "^29.0.2" natural-compare "^1.4.0" - pretty-format "^29.0.1" + pretty-format "^29.0.2" semver "^7.3.5" -jest-util@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.0.1.tgz#f854a4a8877c7817316c4afbc2a851ceb2e71598" - integrity sha512-GIWkgNfkeA9d84rORDHPGGTFBrRD13A38QVSKE0bVrGSnoR1KDn8Kqz+0yI5kezMgbT/7zrWaruWP1Kbghlb2A== +jest-util@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.0.2.tgz#c75c5cab7f3b410782f9570a60c5558b5dfb6e3a" + integrity sha512-ozk8ruEEEACxqpz0hN9UOgtPZS0aN+NffwQduR5dVlhN+eN47vxurtvgZkYZYMpYrsmlAEx1XabkB3BnN0GfKQ== dependencies: - "@jest/types" "^29.0.1" + "@jest/types" "^29.0.2" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.0.1.tgz#8de8ff9d65507c0477964fd39c5b0a1778e3103d" - integrity sha512-mS4q7F738YXZFWBPqE+NjHU/gEOs7IBIFQ8i9zq5EO691cLrUbLhFq4larf8/lNcmauRO71tn/+DTW2y+MrLow== +jest-validate@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.0.2.tgz#ad86e157cc1735a3a3ea88995a611ebf8544bd67" + integrity sha512-AeRKm7cEucSy7tr54r3LhiGIXYvOILUwBM1S7jQkKs6YelwAlWKsmZGVrQR7uwsd31rBTnR5NQkODi1Z+6TKIQ== dependencies: - "@jest/types" "^29.0.1" + "@jest/types" "^29.0.2" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^29.0.0" leven "^3.1.0" - pretty-format "^29.0.1" + pretty-format "^29.0.2" -jest-watcher@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.0.1.tgz#63adeb8887a0562ed8f990f413b830ef48a8db94" - integrity sha512-0LBWDL3sZ+vyHRYxjqm2irhfwhUXHonjLSbd0oDeGq44U1e1uUh3icWNXYF8HO/UEnOoa6+OJDncLUXP2Hdg9A== +jest-watcher@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.0.2.tgz#093c044e0d7462e691ec64ca6d977014272c9bca" + integrity sha512-ds2bV0oyUdYoyrUTv4Ga5uptz4cEvmmP/JzqDyzZZanvrIn8ipxg5l3SDOAIiyuAx1VdHd2FBzeXPFO5KPH8vQ== dependencies: - "@jest/test-result" "^29.0.1" - "@jest/types" "^29.0.1" + "@jest/test-result" "^29.0.2" + "@jest/types" "^29.0.2" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.10.2" - jest-util "^29.0.1" + jest-util "^29.0.2" string-length "^4.0.1" -jest-worker@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.0.1.tgz#fb42ff7e05e0573f330ec0cf781fc545dcd11a31" - integrity sha512-+B/2/8WW7goit7qVezG9vnI1QP3dlmuzi2W0zxazAQQ8dcDIA63dDn6j4pjOGBARha/ZevcwYQtNIzCySbS7fQ== +jest-worker@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.0.2.tgz#46c9f2cb9a19663d22babbacf998e4b5d7c46574" + integrity sha512-EyvBlYcvd2pg28yg5A3OODQnqK9LI1kitnGUZUG5/NYIeaRgewtYBKB5wlr7oXj8zPCkzev7EmnTCsrXK7V+Xw== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^29.0.0: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.0.1.tgz#4a1c48d79fada0a47c686a111ed9411fd41cd584" - integrity sha512-liHkwzaW6iwQyhRBFj0A4ZYKcsQ7ers1s62CCT95fPeNzoxT/vQRWwjTT4e7jpSCwrvPP2t1VESuy7GrXcr2ug== + version "29.0.2" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.0.2.tgz#16e20003dbf8fb9ed7e6ab801579a77084e13fba" + integrity sha512-enziNbNUmXTcTaTP/Uq5rV91r0Yqy2UKzLUIabxMpGm9YHz8qpbJhiRnNVNvm6vzWfzt/0o97NEHH8/3udoClA== dependencies: - "@jest/core" "^29.0.1" - "@jest/types" "^29.0.1" + "@jest/core" "^29.0.2" + "@jest/types" "^29.0.2" import-local "^3.0.2" - jest-cli "^29.0.1" + jest-cli "^29.0.2" js-tokens@^4.0.0: version "4.0.0" @@ -2326,10 +2326,10 @@ prettier@>=2.3.0: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== -pretty-format@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.0.1.tgz#2f8077114cdac92a59b464292972a106410c7ad0" - integrity sha512-iTHy3QZMzuL484mSTYbQIM1AHhEQsH8mXWS2/vd2yFBYnG3EBqGiMONo28PlPgrW7P/8s/1ISv+y7WH306l8cw== +pretty-format@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.0.2.tgz#7f7666a7bf05ba2bcacde61be81c6db64f6f3be6" + integrity sha512-wp3CdtUa3cSJVFn3Miu5a1+pxc1iPIQTenOAn+x5erXeN1+ryTcLesV5pbK/rlW5EKwp27x38MoYfNGaNXDDhg== dependencies: "@jest/schemas" "^29.0.0" ansi-styles "^5.0.0" From d40d6a982228890dc661937d2d6dbfca18a545ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Sep 2022 12:01:47 +0000 Subject: [PATCH 635/785] Bump eslint from 8.23.0 to 8.23.1 Bumps [eslint](https://github.com/eslint/eslint) from 8.23.0 to 8.23.1. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.23.0...v8.23.1) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/yarn.lock b/yarn.lock index a851f3cd..dd6a30a0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -298,10 +298,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@eslint/eslintrc@^1.3.1": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.1.tgz#de0807bfeffc37b964a7d0400e0c348ce5a2543d" - integrity sha512-OhSY22oQQdw3zgPOOwdoj01l/Dzl1Z+xyUP33tkSN+aqyEhymJCcPHyXt+ylW8FSe0TfRC2VG+ROQOapD0aZSQ== +"@eslint/eslintrc@^1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.2.tgz#58b69582f3b7271d8fa67fe5251767a5b38ea356" + integrity sha512-AXYd23w1S/bv3fTs3Lz0vjiYemS08jWkI3hYyS9I1ry+0f+Yjs1wm+sU0BS8qDOPrBIkp4qHYC16I8uVtpLajQ== dependencies: ajv "^6.12.4" debug "^4.3.2" @@ -1163,11 +1163,11 @@ eslint-visitor-keys@^3.3.0: integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.15.0: - version "8.23.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.23.0.tgz#a184918d288820179c6041bb3ddcc99ce6eea040" - integrity sha512-pBG/XOn0MsJcKcTRLr27S5HpzQo4kLr+HjLQIyK4EiCsijDl/TB+h5uEuJU6bQ8Edvwz1XWOjpaP2qgnXGpTcA== + version "8.23.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.23.1.tgz#cfd7b3f7fdd07db8d16b4ac0516a29c8d8dca5dc" + integrity sha512-w7C1IXCc6fNqjpuYd0yPlcTKKmHlHHktRkzmBPZ+7cvNBQuiNjx0xaMTjAJGCafJhQkrFJooREv0CtrVzmHwqg== dependencies: - "@eslint/eslintrc" "^1.3.1" + "@eslint/eslintrc" "^1.3.2" "@humanwhocodes/config-array" "^0.10.4" "@humanwhocodes/gitignore-to-minimatch" "^1.0.2" "@humanwhocodes/module-importer" "^1.0.1" @@ -1186,7 +1186,6 @@ eslint@^8.15.0: fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" find-up "^5.0.0" - functional-red-black-tree "^1.0.1" glob-parent "^6.0.1" globals "^13.15.0" globby "^11.1.0" @@ -1195,6 +1194,7 @@ eslint@^8.15.0: import-fresh "^3.0.0" imurmurhash "^0.1.4" is-glob "^4.0.0" + js-sdsl "^4.1.4" js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" @@ -1389,11 +1389,6 @@ function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= - gensync@^1.0.0-beta.2: version "1.0.0-beta.2" resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" @@ -2007,6 +2002,11 @@ jest@^29.0.0: import-local "^3.0.2" jest-cli "^29.0.2" +js-sdsl@^4.1.4: + version "4.1.4" + resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.1.4.tgz#78793c90f80e8430b7d8dc94515b6c77d98a26a6" + integrity sha512-Y2/yD55y5jteOAmY50JbUZYwk3CP3wnLPEZnlR1w9oKhITrBEtAxwuWKebFf8hMrPMgbYwFoWK/lH2sBkErELw== + js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" From 5adf30c9740a868a81855c2fbd5891787e6b4d36 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Sep 2022 12:09:53 +0000 Subject: [PATCH 636/785] Bump jest from 29.0.2 to 29.0.3 Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.0.2 to 29.0.3. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.0.3/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 582 +++++++++++++++++++++++++++--------------------------- 1 file changed, 291 insertions(+), 291 deletions(-) diff --git a/yarn.lock b/yarn.lock index dd6a30a0..e39a00aa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -353,28 +353,28 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^29.0.2": - version "29.0.2" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.0.2.tgz#3a02dccad4dd37c25fd30013df67ec50998402ce" - integrity sha512-Fv02ijyhF4D/Wb3DvZO3iBJQz5DnzpJEIDBDbvje8Em099N889tNMUnBw7SalmSuOI+NflNG40RA1iK71kImPw== +"@jest/console@^29.0.3": + version "29.0.3" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.0.3.tgz#a222ab87e399317a89db88a58eaec289519e807a" + integrity sha512-cGg0r+klVHSYnfE977S9wmpuQ9L+iYuYgL+5bPXiUlUynLLYunRxswEmhBzvrSKGof5AKiHuTTmUKAqRcDY9dg== dependencies: - "@jest/types" "^29.0.2" + "@jest/types" "^29.0.3" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^29.0.2" - jest-util "^29.0.2" + jest-message-util "^29.0.3" + jest-util "^29.0.3" slash "^3.0.0" -"@jest/core@^29.0.2": - version "29.0.2" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.0.2.tgz#7bf47ff6cd882678c47fbdea562bdf1ff03b6d33" - integrity sha512-imP5M6cdpHEOkmcuFYZuM5cTG1DAF7ZlVNCq1+F7kbqme2Jcl+Kh4M78hihM76DJHNkurbv4UVOnejGxBKEmww== - dependencies: - "@jest/console" "^29.0.2" - "@jest/reporters" "^29.0.2" - "@jest/test-result" "^29.0.2" - "@jest/transform" "^29.0.2" - "@jest/types" "^29.0.2" +"@jest/core@^29.0.3": + version "29.0.3" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.0.3.tgz#ba22a9cbd0c7ba36e04292e2093c547bf53ec1fd" + integrity sha512-1d0hLbOrM1qQE3eP3DtakeMbKTcXiXP3afWxqz103xPyddS2NhnNghS7MaXx1dcDt4/6p4nlhmeILo2ofgi8cQ== + dependencies: + "@jest/console" "^29.0.3" + "@jest/reporters" "^29.0.3" + "@jest/test-result" "^29.0.3" + "@jest/transform" "^29.0.3" + "@jest/types" "^29.0.3" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" @@ -382,80 +382,80 @@ exit "^0.1.2" graceful-fs "^4.2.9" jest-changed-files "^29.0.0" - jest-config "^29.0.2" - jest-haste-map "^29.0.2" - jest-message-util "^29.0.2" + jest-config "^29.0.3" + jest-haste-map "^29.0.3" + jest-message-util "^29.0.3" jest-regex-util "^29.0.0" - jest-resolve "^29.0.2" - jest-resolve-dependencies "^29.0.2" - jest-runner "^29.0.2" - jest-runtime "^29.0.2" - jest-snapshot "^29.0.2" - jest-util "^29.0.2" - jest-validate "^29.0.2" - jest-watcher "^29.0.2" + jest-resolve "^29.0.3" + jest-resolve-dependencies "^29.0.3" + jest-runner "^29.0.3" + jest-runtime "^29.0.3" + jest-snapshot "^29.0.3" + jest-util "^29.0.3" + jest-validate "^29.0.3" + jest-watcher "^29.0.3" micromatch "^4.0.4" - pretty-format "^29.0.2" + pretty-format "^29.0.3" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.0.2": - version "29.0.2" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.0.2.tgz#9e4b6d4c9bce5bfced6f63945d8c8e571394f572" - integrity sha512-Yf+EYaLOrVCgts/aTS5nGznU4prZUPa5k9S63Yct8YSOKj2jkdS17hHSUKhk5jxDFMyCy1PXknypDw7vfgc/mA== +"@jest/environment@^29.0.3": + version "29.0.3" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.0.3.tgz#7745ec30a954e828e8cc6df6a13280d3b51d8f35" + integrity sha512-iKl272NKxYNQNqXMQandAIwjhQaGw5uJfGXduu8dS9llHi8jV2ChWrtOAVPnMbaaoDhnI3wgUGNDvZgHeEJQCA== dependencies: - "@jest/fake-timers" "^29.0.2" - "@jest/types" "^29.0.2" + "@jest/fake-timers" "^29.0.3" + "@jest/types" "^29.0.3" "@types/node" "*" - jest-mock "^29.0.2" + jest-mock "^29.0.3" -"@jest/expect-utils@^29.0.2": - version "29.0.2" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.0.2.tgz#00dfcb9e6fe99160c326ba39f7734b984543dea8" - integrity sha512-+wcQF9khXKvAEi8VwROnCWWmHfsJYCZAs5dmuMlJBKk57S6ZN2/FQMIlo01F29fJyT8kV/xblE7g3vkIdTLOjw== +"@jest/expect-utils@^29.0.3": + version "29.0.3" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.0.3.tgz#f5bb86f5565bf2dacfca31ccbd887684936045b2" + integrity sha512-i1xUkau7K/63MpdwiRqaxgZOjxYs4f0WMTGJnYwUKubsNRZSeQbLorS7+I4uXVF9KQ5r61BUPAUMZ7Lf66l64Q== dependencies: jest-get-type "^29.0.0" -"@jest/expect@^29.0.2": - version "29.0.2" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.0.2.tgz#641d151e1062ceb976c5ad1c23eba3bb1e188896" - integrity sha512-y/3geZ92p2/zovBm/F+ZjXUJ3thvT9IRzD6igqaWskFE2aR0idD+N/p5Lj/ZautEox/9RwEc6nqergebeh72uQ== +"@jest/expect@^29.0.3": + version "29.0.3" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.0.3.tgz#9dc7c46354eeb7a348d73881fba6402f5fdb2c30" + integrity sha512-6W7K+fsI23FQ01H/BWccPyDZFrnU9QlzDcKOjrNVU5L8yUORFAJJIpmyxWPW70+X624KUNqzZwPThPMX28aXEQ== dependencies: - expect "^29.0.2" - jest-snapshot "^29.0.2" + expect "^29.0.3" + jest-snapshot "^29.0.3" -"@jest/fake-timers@^29.0.2": - version "29.0.2" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.0.2.tgz#6f15f4d8eb1089d445e3f73473ddc434faa2f798" - integrity sha512-2JhQeWU28fvmM5r33lxg6BxxkTKaVXs6KMaJ6eXSM8ml/MaWkt2BvbIO8G9KWAJFMdBXWbn+2h9OK1/s5urKZA== +"@jest/fake-timers@^29.0.3": + version "29.0.3" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.0.3.tgz#ad5432639b715d45a86a75c47fd75019bc36b22c" + integrity sha512-tmbUIo03x0TdtcZCESQ0oQSakPCpo7+s6+9mU19dd71MptkP4zCwoeZqna23//pgbhtT1Wq02VmA9Z9cNtvtCQ== dependencies: - "@jest/types" "^29.0.2" + "@jest/types" "^29.0.3" "@sinonjs/fake-timers" "^9.1.2" "@types/node" "*" - jest-message-util "^29.0.2" - jest-mock "^29.0.2" - jest-util "^29.0.2" + jest-message-util "^29.0.3" + jest-mock "^29.0.3" + jest-util "^29.0.3" -"@jest/globals@^29.0.2": - version "29.0.2" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.0.2.tgz#605d3389ad0c6bfe17ad3e1359b5bc39aefd8b65" - integrity sha512-4hcooSNJCVXuTu07/VJwCWW6HTnjLtQdqlcGisK6JST7z2ixa8emw4SkYsOk7j36WRc2ZUEydlUePnOIOTCNXg== +"@jest/globals@^29.0.3": + version "29.0.3" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.0.3.tgz#681950c430fdc13ff9aa89b2d8d572ac0e4a1bf5" + integrity sha512-YqGHT65rFY2siPIHHFjuCGUsbzRjdqkwbat+Of6DmYRg5shIXXrLdZoVE/+TJ9O1dsKsFmYhU58JvIbZRU1Z9w== dependencies: - "@jest/environment" "^29.0.2" - "@jest/expect" "^29.0.2" - "@jest/types" "^29.0.2" - jest-mock "^29.0.2" + "@jest/environment" "^29.0.3" + "@jest/expect" "^29.0.3" + "@jest/types" "^29.0.3" + jest-mock "^29.0.3" -"@jest/reporters@^29.0.2": - version "29.0.2" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.0.2.tgz#5f927646b6f01029525c05ac108324eac7d7ad5c" - integrity sha512-Kr41qejRQHHkCgWHC9YwSe7D5xivqP4XML+PvgwsnRFaykKdNflDUb4+xLXySOU+O/bPkVdFpGzUpVNSJChCrw== +"@jest/reporters@^29.0.3": + version "29.0.3" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.0.3.tgz#735f110e08b44b38729d8dbbb74063bdf5aba8a5" + integrity sha512-3+QU3d4aiyOWfmk1obDerie4XNCaD5Xo1IlKNde2yGEi02WQD+ZQD0i5Hgqm1e73sMV7kw6pMlCnprtEwEVwxw== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.0.2" - "@jest/test-result" "^29.0.2" - "@jest/transform" "^29.0.2" - "@jest/types" "^29.0.2" + "@jest/console" "^29.0.3" + "@jest/test-result" "^29.0.3" + "@jest/transform" "^29.0.3" + "@jest/types" "^29.0.3" "@jridgewell/trace-mapping" "^0.3.15" "@types/node" "*" chalk "^4.0.0" @@ -468,9 +468,9 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^29.0.2" - jest-util "^29.0.2" - jest-worker "^29.0.2" + jest-message-util "^29.0.3" + jest-util "^29.0.3" + jest-worker "^29.0.3" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" @@ -493,51 +493,51 @@ callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^29.0.2": - version "29.0.2" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.0.2.tgz#dde4922e6234dd311c85ddf1ec2b7f600a90295d" - integrity sha512-b5rDc0lLL6Kx73LyCx6370k9uZ8o5UKdCpMS6Za3ke7H9y8PtAU305y6TeghpBmf2In8p/qqi3GpftgzijSsNw== +"@jest/test-result@^29.0.3": + version "29.0.3" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.0.3.tgz#b03d8ef4c58be84cd5d5d3b24d4b4c8cabbf2746" + integrity sha512-vViVnQjCgTmbhDKEonKJPtcFe9G/CJO4/Np4XwYJah+lF2oI7KKeRp8t1dFvv44wN2NdbDb/qC6pi++Vpp0Dlg== dependencies: - "@jest/console" "^29.0.2" - "@jest/types" "^29.0.2" + "@jest/console" "^29.0.3" + "@jest/types" "^29.0.3" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.0.2": - version "29.0.2" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.0.2.tgz#ae9b2d2c1694c7aa1a407713100e14dbfa79293e" - integrity sha512-fsyZqHBlXNMv5ZqjQwCuYa2pskXCO0DVxh5aaVCuAtwzHuYEGrhordyEncBLQNuCGQSYgElrEEmS+7wwFnnMKw== +"@jest/test-sequencer@^29.0.3": + version "29.0.3" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.0.3.tgz#0681061ad21fb8e293b49c4fdf7e631ca79240ba" + integrity sha512-Hf4+xYSWZdxTNnhDykr8JBs0yBN/nxOXyUQWfotBUqqy0LF9vzcFB0jm/EDNZCx587znLWTIgxcokW7WeZMobQ== dependencies: - "@jest/test-result" "^29.0.2" + "@jest/test-result" "^29.0.3" graceful-fs "^4.2.9" - jest-haste-map "^29.0.2" + jest-haste-map "^29.0.3" slash "^3.0.0" -"@jest/transform@^29.0.2": - version "29.0.2" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.0.2.tgz#eef90ebd939b68bf2c2508d9e914377871869146" - integrity sha512-lajVQx2AnsR+Pa17q2zR7eikz2PkPs1+g/qPbZkqQATeS/s6eT55H+yHcsLfuI/0YQ/4VSBepSu3bOX+44q0aA== +"@jest/transform@^29.0.3": + version "29.0.3" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.0.3.tgz#9eb1fed2072a0354f190569807d1250572fb0970" + integrity sha512-C5ihFTRYaGDbi/xbRQRdbo5ddGtI4VSpmL6AIcZxdhwLbXMa7PcXxxqyI91vGOFHnn5aVM3WYnYKCHEqmLVGzg== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^29.0.2" + "@jest/types" "^29.0.3" "@jridgewell/trace-mapping" "^0.3.15" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.0.2" + jest-haste-map "^29.0.3" jest-regex-util "^29.0.0" - jest-util "^29.0.2" + jest-util "^29.0.3" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" write-file-atomic "^4.0.1" -"@jest/types@^29.0.2": - version "29.0.2" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.0.2.tgz#5a5391fa7f7f41bf4b201d6d2da30e874f95b6c1" - integrity sha512-5WNMesBLmlkt1+fVkoCjHa0X3i3q8zc4QLTDkdHgCa2gyPZc7rdlZBWgVLqwS1860ZW5xJuCDwAzqbGaXIr/ew== +"@jest/types@^29.0.3": + version "29.0.3" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.0.3.tgz#0be78fdddb1a35aeb2041074e55b860561c8ef63" + integrity sha512-coBJmOQvurXjN1Hh5PzF7cmsod0zLIOXpP8KD161mqNlroMhLcwpODiEzi7ZsRl5Z/AIuxpeNm8DCl43F4kz8A== dependencies: "@jest/schemas" "^29.0.0" "@types/istanbul-lib-coverage" "^2.0.0" @@ -810,12 +810,12 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.0.2.tgz#7efde496c07607949e9be499bf277aa1543ded95" - integrity sha512-yTu4/WSi/HzarjQtrJSwV+/0maoNt+iP0DmpvFJdv9yY+5BuNle8TbheHzzcSWj5gIHfuhpbLYHWRDYhWKyeKQ== +babel-jest@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.0.3.tgz#64e156a47a77588db6a669a88dedff27ed6e260f" + integrity sha512-ApPyHSOhS/sVzwUOQIWJmdvDhBsMG01HX9z7ogtkp1TToHGGUWFlnXJUIzCgKPSfiYLn3ibipCYzsKSURHEwLg== dependencies: - "@jest/transform" "^29.0.2" + "@jest/transform" "^29.0.3" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" babel-preset-jest "^29.0.2" @@ -1280,16 +1280,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.0.2.tgz#22c7132400f60444b427211f1d6bb604a9ab2420" - integrity sha512-JeJlAiLKn4aApT4pzUXBVxl3NaZidWIOdg//smaIlP9ZMBDkHZGFd9ubphUZP9pUyDEo7bC6M0IIZR51o75qQw== +expect@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.0.3.tgz#6be65ddb945202f143c4e07c083f4f39f3bd326f" + integrity sha512-t8l5DTws3212VbmPL+tBFXhjRHLmctHB0oQbL8eUc6S7NzZtYUhycrFO9mkxA0ZUC6FAWdNi7JchJSkODtcu1Q== dependencies: - "@jest/expect-utils" "^29.0.2" + "@jest/expect-utils" "^29.0.3" jest-get-type "^29.0.0" - jest-matcher-utils "^29.0.2" - jest-message-util "^29.0.2" - jest-util "^29.0.2" + jest-matcher-utils "^29.0.3" + jest-message-util "^29.0.3" + jest-util "^29.0.3" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1651,86 +1651,86 @@ jest-changed-files@^29.0.0: execa "^5.0.0" p-limit "^3.1.0" -jest-circus@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.0.2.tgz#7dda94888a8d47edb58e85a8e5f688f9da6657a3" - integrity sha512-YTPEsoE1P1X0bcyDQi3QIkpt2Wl9om9k2DQRuLFdS5x8VvAKSdYAVJufgvudhnKgM8WHvvAzhBE+1DRQB8x1CQ== +jest-circus@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.0.3.tgz#90faebc90295291cfc636b27dbd82e3bfb9e7a48" + integrity sha512-QeGzagC6Hw5pP+df1+aoF8+FBSgkPmraC1UdkeunWh0jmrp7wC0Hr6umdUAOELBQmxtKAOMNC3KAdjmCds92Zg== dependencies: - "@jest/environment" "^29.0.2" - "@jest/expect" "^29.0.2" - "@jest/test-result" "^29.0.2" - "@jest/types" "^29.0.2" + "@jest/environment" "^29.0.3" + "@jest/expect" "^29.0.3" + "@jest/test-result" "^29.0.3" + "@jest/types" "^29.0.3" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" is-generator-fn "^2.0.0" - jest-each "^29.0.2" - jest-matcher-utils "^29.0.2" - jest-message-util "^29.0.2" - jest-runtime "^29.0.2" - jest-snapshot "^29.0.2" - jest-util "^29.0.2" + jest-each "^29.0.3" + jest-matcher-utils "^29.0.3" + jest-message-util "^29.0.3" + jest-runtime "^29.0.3" + jest-snapshot "^29.0.3" + jest-util "^29.0.3" p-limit "^3.1.0" - pretty-format "^29.0.2" + pretty-format "^29.0.3" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.0.2.tgz#adf341ee3a4fd6ad1f23e3c0eb4e466847407021" - integrity sha512-tlf8b+4KcUbBGr25cywIi3+rbZ4+G+SiG8SvY552m9sRZbXPafdmQRyeVE/C/R8K+TiBAMrTIUmV2SlStRJ40g== +jest-cli@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.0.3.tgz#fd8f0ef363a7a3d9c53ef62e0651f18eeffa77b9" + integrity sha512-aUy9Gd/Kut1z80eBzG10jAn6BgS3BoBbXyv+uXEqBJ8wnnuZ5RpNfARoskSrTIy1GY4a8f32YGuCMwibtkl9CQ== dependencies: - "@jest/core" "^29.0.2" - "@jest/test-result" "^29.0.2" - "@jest/types" "^29.0.2" + "@jest/core" "^29.0.3" + "@jest/test-result" "^29.0.3" + "@jest/types" "^29.0.3" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.0.2" - jest-util "^29.0.2" - jest-validate "^29.0.2" + jest-config "^29.0.3" + jest-util "^29.0.3" + jest-validate "^29.0.3" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.0.2.tgz#0ce168e1f74ca46c27285a7182ecb06c2d8ce7d9" - integrity sha512-RU4gzeUNZAFktYVzDGimDxeYoaiTnH100jkYYZgldqFamaZukF0IqmFx8+QrzVeEWccYg10EEJT3ox1Dq5b74w== +jest-config@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.0.3.tgz#c2e52a8f5adbd18de79f99532d8332a19e232f13" + integrity sha512-U5qkc82HHVYe3fNu2CRXLN4g761Na26rWKf7CjM8LlZB3In1jadEkZdMwsE37rd9RSPV0NfYaCjHdk/gu3v+Ew== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.0.2" - "@jest/types" "^29.0.2" - babel-jest "^29.0.2" + "@jest/test-sequencer" "^29.0.3" + "@jest/types" "^29.0.3" + babel-jest "^29.0.3" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^29.0.2" - jest-environment-node "^29.0.2" + jest-circus "^29.0.3" + jest-environment-node "^29.0.3" jest-get-type "^29.0.0" jest-regex-util "^29.0.0" - jest-resolve "^29.0.2" - jest-runner "^29.0.2" - jest-util "^29.0.2" - jest-validate "^29.0.2" + jest-resolve "^29.0.3" + jest-runner "^29.0.3" + jest-util "^29.0.3" + jest-validate "^29.0.3" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^29.0.2" + pretty-format "^29.0.3" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.0.2.tgz#1a99419efda66f9ee72f91e580e774df95de5ddc" - integrity sha512-b9l9970sa1rMXH1owp2Woprmy42qIwwll/htsw4Gf7+WuSp5bZxNhkKHDuCGKL+HoHn1KhcC+tNEeAPYBkD2Jg== +jest-diff@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.0.3.tgz#41cc02409ad1458ae1bf7684129a3da2856341ac" + integrity sha512-+X/AIF5G/vX9fWK+Db9bi9BQas7M9oBME7egU7psbn4jlszLFCu0dW63UgeE6cs/GANq4fLaT+8sGHQQ0eCUfg== dependencies: chalk "^4.0.0" diff-sequences "^29.0.0" jest-get-type "^29.0.0" - pretty-format "^29.0.2" + pretty-format "^29.0.3" jest-docblock@^29.0.0: version "29.0.0" @@ -1739,92 +1739,92 @@ jest-docblock@^29.0.0: dependencies: detect-newline "^3.0.0" -jest-each@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.0.2.tgz#f98375a79a37761137e11d458502dfe1f00ba5b0" - integrity sha512-+sA9YjrJl35iCg0W0VCrgCVj+wGhDrrKQ+YAqJ/DHBC4gcDFAeePtRRhpJnX9gvOZ63G7gt52pwp2PesuSEx0Q== +jest-each@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.0.3.tgz#7ef3157580b15a609d7ef663dd4fc9b07f4e1299" + integrity sha512-wILhZfESURHHBNvPMJ0lZlYZrvOQJxAo3wNHi+ycr90V7M+uGR9Gh4+4a/BmaZF0XTyZsk4OiYEf3GJN7Ltqzg== dependencies: - "@jest/types" "^29.0.2" + "@jest/types" "^29.0.3" chalk "^4.0.0" jest-get-type "^29.0.0" - jest-util "^29.0.2" - pretty-format "^29.0.2" + jest-util "^29.0.3" + pretty-format "^29.0.3" -jest-environment-node@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.0.2.tgz#8196268c9f740f1d2e7ecccf212b4c1c5b0167e4" - integrity sha512-4Fv8GXVCToRlMzDO94gvA8iOzKxQ7rhAbs8L+j8GPyTxGuUiYkV+63LecGeVdVhsL2KXih1sKnoqmH6tp89J7Q== +jest-environment-node@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.0.3.tgz#293804b1e0fa5f0e354dacbe510655caa478a3b2" + integrity sha512-cdZqRCnmIlTXC+9vtvmfiY/40Cj6s2T0czXuq1whvQdmpzAnj4sbqVYuZ4zFHk766xTTJ+Ij3uUqkk8KCfXoyg== dependencies: - "@jest/environment" "^29.0.2" - "@jest/fake-timers" "^29.0.2" - "@jest/types" "^29.0.2" + "@jest/environment" "^29.0.3" + "@jest/fake-timers" "^29.0.3" + "@jest/types" "^29.0.3" "@types/node" "*" - jest-mock "^29.0.2" - jest-util "^29.0.2" + jest-mock "^29.0.3" + jest-util "^29.0.3" jest-get-type@^29.0.0: version "29.0.0" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.0.0.tgz#843f6c50a1b778f7325df1129a0fd7aa713aef80" integrity sha512-83X19z/HuLKYXYHskZlBAShO7UfLFXu/vWajw9ZNJASN32li8yHMaVGAQqxFW1RCFOkB7cubaL6FaJVQqqJLSw== -jest-haste-map@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.0.2.tgz#cac403a595e6e43982c9776b5c4dae63e38b22c5" - integrity sha512-SOorh2ysQ0fe8gsF4gaUDhoMIWAvi2hXOkwThEO48qT3JqA8GLAUieQcIvdSEd6M0scRDe1PVmKc5tXR3Z0U0A== +jest-haste-map@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.0.3.tgz#d7f3f7180f558d760eacc5184aac5a67f20ef939" + integrity sha512-uMqR99+GuBHo0RjRhOE4iA6LmsxEwRdgiIAQgMU/wdT2XebsLDz5obIwLZm/Psj+GwSEQhw9AfAVKGYbh2G55A== dependencies: - "@jest/types" "^29.0.2" + "@jest/types" "^29.0.3" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" jest-regex-util "^29.0.0" - jest-util "^29.0.2" - jest-worker "^29.0.2" + jest-util "^29.0.3" + jest-worker "^29.0.3" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.0.2.tgz#f88fd08e352b5fad3d33e48ecab39e97077ed8a8" - integrity sha512-5f0493qDeAxjUldkBSQg5D1cLadRgZVyWpTQvfJeQwQUpHQInE21AyVHVv64M7P2Ue8Z5EZ4BAcoDS/dSPPgMw== +jest-leak-detector@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.0.3.tgz#e85cf3391106a7a250850b6766b508bfe9c7bc6f" + integrity sha512-YfW/G63dAuiuQ3QmQlh8hnqLDe25WFY3eQhuc/Ev1AGmkw5zREblTh7TCSKLoheyggu6G9gxO2hY8p9o6xbaRQ== dependencies: jest-get-type "^29.0.0" - pretty-format "^29.0.2" + pretty-format "^29.0.3" -jest-matcher-utils@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.0.2.tgz#0ffdcaec340a9810caee6c73ff90fb029b446e10" - integrity sha512-s62YkHFBfAx0JLA2QX1BlnCRFwHRobwAv2KP1+YhjzF6ZCbCVrf1sG8UJyn62ZUsDaQKpoo86XMTjkUyO5aWmQ== +jest-matcher-utils@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.0.3.tgz#b8305fd3f9e27cdbc210b21fc7dbba92d4e54560" + integrity sha512-RsR1+cZ6p1hDV4GSCQTg+9qjeotQCgkaleIKLK7dm+U4V/H2bWedU3RAtLm8+mANzZ7eDV33dMar4pejd7047w== dependencies: chalk "^4.0.0" - jest-diff "^29.0.2" + jest-diff "^29.0.3" jest-get-type "^29.0.0" - pretty-format "^29.0.2" + pretty-format "^29.0.3" -jest-message-util@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.0.2.tgz#b2781dfb6a2d1c63830d9684c5148ae3155c6154" - integrity sha512-kcJAgms3ckJV0wUoLsAM40xAhY+pb9FVSZwicjFU9PFkaTNmqh9xd99/CzKse48wPM1ANUQKmp03/DpkY+lGrA== +jest-message-util@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.0.3.tgz#f0254e1ffad21890c78355726202cc91d0a40ea8" + integrity sha512-7T8JiUTtDfppojosORAflABfLsLKMLkBHSWkjNQrjIltGoDzNGn7wEPOSfjqYAGTYME65esQzMJxGDjuLBKdOg== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.0.2" + "@jest/types" "^29.0.3" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^29.0.2" + pretty-format "^29.0.3" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.0.2.tgz#d7810966a6338aca6a440c3cd9f19276477840ad" - integrity sha512-giWXOIT23UCxHCN2VUfUJ0Q7SmiqQwfSFXlCaIhW5anITpNQ+3vuLPQdKt5wkuwM37GrbFyHIClce8AAK9ft9g== +jest-mock@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.0.3.tgz#4f0093f6a9cb2ffdb9c44a07a3912f0c098c8de9" + integrity sha512-ort9pYowltbcrCVR43wdlqfAiFJXBx8l4uJDsD8U72LgBcetvEp+Qxj1W9ZYgMRoeAo+ov5cnAGF2B6+Oth+ww== dependencies: - "@jest/types" "^29.0.2" + "@jest/types" "^29.0.3" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -1837,88 +1837,88 @@ jest-regex-util@^29.0.0: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.0.0.tgz#b442987f688289df8eb6c16fa8df488b4cd007de" integrity sha512-BV7VW7Sy0fInHWN93MMPtlClweYv2qrSCwfeFWmpribGZtQPWNvRSq9XOVgOEjU1iBGRKXUZil0o2AH7Iy9Lug== -jest-resolve-dependencies@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.0.2.tgz#2d30199ed0059ff97712f4fa6320c590bfcd2061" - integrity sha512-fSAu6eIG7wtGdnPJUkVVdILGzYAP9Dj/4+zvC8BrGe8msaUMJ9JeygU0Hf9+Uor6/icbuuzQn5See1uajLnAqg== +jest-resolve-dependencies@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.0.3.tgz#f23a54295efc6374b86b198cf8efed5606d6b762" + integrity sha512-KzuBnXqNvbuCdoJpv8EanbIGObk7vUBNt/PwQPPx2aMhlv/jaXpUJsqWYRpP/0a50faMBY7WFFP8S3/CCzwfDw== dependencies: jest-regex-util "^29.0.0" - jest-snapshot "^29.0.2" + jest-snapshot "^29.0.3" -jest-resolve@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.0.2.tgz#dd097e1c8020fbed4a8c1e1889ccb56022288697" - integrity sha512-V3uLjSA+EHxLtjIDKTBXnY71hyx+8lusCqPXvqzkFO1uCGvVpjBfuOyp+KOLBNSuY61kM2jhepiMwt4eiJS+Vw== +jest-resolve@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.0.3.tgz#329a3431e3b9eb6629a2cd483e9bed95b26827b9" + integrity sha512-toVkia85Y/BPAjJasTC9zIPY6MmVXQPtrCk8SmiheC4MwVFE/CMFlOtMN6jrwPMC6TtNh8+sTMllasFeu1wMPg== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^29.0.2" + jest-haste-map "^29.0.3" jest-pnp-resolver "^1.2.2" - jest-util "^29.0.2" - jest-validate "^29.0.2" + jest-util "^29.0.3" + jest-validate "^29.0.3" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.0.2.tgz#64e4e6c88f74387307687b73a4688f93369d8d99" - integrity sha512-+D82iPZejI8t+SfduOO1deahC/QgLFf8aJBO++Znz3l2ETtOMdM7K4ATsGWzCFnTGio5yHaRifg1Su5Ybza5Nw== - dependencies: - "@jest/console" "^29.0.2" - "@jest/environment" "^29.0.2" - "@jest/test-result" "^29.0.2" - "@jest/transform" "^29.0.2" - "@jest/types" "^29.0.2" +jest-runner@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.0.3.tgz#2e47fe1e8777aea9b8970f37e8f83630b508fb87" + integrity sha512-Usu6VlTOZlCZoNuh3b2Tv/yzDpKqtiNAetG9t3kJuHfUyVMNW7ipCCJOUojzKkjPoaN7Bl1f7Buu6PE0sGpQxw== + dependencies: + "@jest/console" "^29.0.3" + "@jest/environment" "^29.0.3" + "@jest/test-result" "^29.0.3" + "@jest/transform" "^29.0.3" + "@jest/types" "^29.0.3" "@types/node" "*" chalk "^4.0.0" emittery "^0.10.2" graceful-fs "^4.2.9" jest-docblock "^29.0.0" - jest-environment-node "^29.0.2" - jest-haste-map "^29.0.2" - jest-leak-detector "^29.0.2" - jest-message-util "^29.0.2" - jest-resolve "^29.0.2" - jest-runtime "^29.0.2" - jest-util "^29.0.2" - jest-watcher "^29.0.2" - jest-worker "^29.0.2" + jest-environment-node "^29.0.3" + jest-haste-map "^29.0.3" + jest-leak-detector "^29.0.3" + jest-message-util "^29.0.3" + jest-resolve "^29.0.3" + jest-runtime "^29.0.3" + jest-util "^29.0.3" + jest-watcher "^29.0.3" + jest-worker "^29.0.3" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.0.2.tgz#dc3de788b8d75af346ae163d59c585027a9d809c" - integrity sha512-DO6F81LX4okOgjJLkLySv10E5YcV5NHUbY1ZqAUtofxdQE+q4hjH0P2gNsY8x3z3sqgw7O/+919SU4r18Fcuig== +jest-runtime@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.0.3.tgz#5a823ec5902257519556a4e5a71a868e8fd788aa" + integrity sha512-12gZXRQ7ozEeEHKTY45a+YLqzNDR/x4c//X6AqwKwKJPpWM8FY4vwn4VQJOcLRS3Nd1fWwgP7LU4SoynhuUMHQ== dependencies: - "@jest/environment" "^29.0.2" - "@jest/fake-timers" "^29.0.2" - "@jest/globals" "^29.0.2" + "@jest/environment" "^29.0.3" + "@jest/fake-timers" "^29.0.3" + "@jest/globals" "^29.0.3" "@jest/source-map" "^29.0.0" - "@jest/test-result" "^29.0.2" - "@jest/transform" "^29.0.2" - "@jest/types" "^29.0.2" + "@jest/test-result" "^29.0.3" + "@jest/transform" "^29.0.3" + "@jest/types" "^29.0.3" "@types/node" "*" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^29.0.2" - jest-message-util "^29.0.2" - jest-mock "^29.0.2" + jest-haste-map "^29.0.3" + jest-message-util "^29.0.3" + jest-mock "^29.0.3" jest-regex-util "^29.0.0" - jest-resolve "^29.0.2" - jest-snapshot "^29.0.2" - jest-util "^29.0.2" + jest-resolve "^29.0.3" + jest-snapshot "^29.0.3" + jest-util "^29.0.3" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.0.2.tgz#5017d54db8369f01900d11e179513fa5839fb5ac" - integrity sha512-26C4PzGKaX5gkoKg8UzYGVy2HPVcTaROSkf0gwnHu3lGeTB7bAIJBovvVPZoiJ20IximJELQs/r8WSDRCuGX2A== +jest-snapshot@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.0.3.tgz#0a024706986a915a6eefae74d7343069d2fc8eef" + integrity sha512-52q6JChm04U3deq+mkQ7R/7uy7YyfVIrebMi6ZkBoDJ85yEjm/sJwdr1P0LOIEHmpyLlXrxy3QP0Zf5J2kj0ew== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" @@ -1926,81 +1926,81 @@ jest-snapshot@^29.0.2: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.0.2" - "@jest/transform" "^29.0.2" - "@jest/types" "^29.0.2" + "@jest/expect-utils" "^29.0.3" + "@jest/transform" "^29.0.3" + "@jest/types" "^29.0.3" "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.0.2" + expect "^29.0.3" graceful-fs "^4.2.9" - jest-diff "^29.0.2" + jest-diff "^29.0.3" jest-get-type "^29.0.0" - jest-haste-map "^29.0.2" - jest-matcher-utils "^29.0.2" - jest-message-util "^29.0.2" - jest-util "^29.0.2" + jest-haste-map "^29.0.3" + jest-matcher-utils "^29.0.3" + jest-message-util "^29.0.3" + jest-util "^29.0.3" natural-compare "^1.4.0" - pretty-format "^29.0.2" + pretty-format "^29.0.3" semver "^7.3.5" -jest-util@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.0.2.tgz#c75c5cab7f3b410782f9570a60c5558b5dfb6e3a" - integrity sha512-ozk8ruEEEACxqpz0hN9UOgtPZS0aN+NffwQduR5dVlhN+eN47vxurtvgZkYZYMpYrsmlAEx1XabkB3BnN0GfKQ== +jest-util@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.0.3.tgz#06d1d77f9a1bea380f121897d78695902959fbc0" + integrity sha512-Q0xaG3YRG8QiTC4R6fHjHQPaPpz9pJBEi0AeOE4mQh/FuWOijFjGXMMOfQEaU9i3z76cNR7FobZZUQnL6IyfdQ== dependencies: - "@jest/types" "^29.0.2" + "@jest/types" "^29.0.3" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.0.2.tgz#ad86e157cc1735a3a3ea88995a611ebf8544bd67" - integrity sha512-AeRKm7cEucSy7tr54r3LhiGIXYvOILUwBM1S7jQkKs6YelwAlWKsmZGVrQR7uwsd31rBTnR5NQkODi1Z+6TKIQ== +jest-validate@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.0.3.tgz#f9521581d7344685428afa0a4d110e9c519aeeb6" + integrity sha512-OebiqqT6lK8cbMPtrSoS3aZP4juID762lZvpf1u+smZnwTEBCBInan0GAIIhv36MxGaJvmq5uJm7dl5gVt+Zrw== dependencies: - "@jest/types" "^29.0.2" + "@jest/types" "^29.0.3" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^29.0.0" leven "^3.1.0" - pretty-format "^29.0.2" + pretty-format "^29.0.3" -jest-watcher@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.0.2.tgz#093c044e0d7462e691ec64ca6d977014272c9bca" - integrity sha512-ds2bV0oyUdYoyrUTv4Ga5uptz4cEvmmP/JzqDyzZZanvrIn8ipxg5l3SDOAIiyuAx1VdHd2FBzeXPFO5KPH8vQ== +jest-watcher@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.0.3.tgz#8e220d1cc4f8029875e82015d084cab20f33d57f" + integrity sha512-tQX9lU91A+9tyUQKUMp0Ns8xAcdhC9fo73eqA3LFxP2bSgiF49TNcc+vf3qgGYYK9qRjFpXW9+4RgF/mbxyOOw== dependencies: - "@jest/test-result" "^29.0.2" - "@jest/types" "^29.0.2" + "@jest/test-result" "^29.0.3" + "@jest/types" "^29.0.3" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.10.2" - jest-util "^29.0.2" + jest-util "^29.0.3" string-length "^4.0.1" -jest-worker@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.0.2.tgz#46c9f2cb9a19663d22babbacf998e4b5d7c46574" - integrity sha512-EyvBlYcvd2pg28yg5A3OODQnqK9LI1kitnGUZUG5/NYIeaRgewtYBKB5wlr7oXj8zPCkzev7EmnTCsrXK7V+Xw== +jest-worker@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.0.3.tgz#c2ba0aa7e41eec9eb0be8e8a322ae6518df72647" + integrity sha512-Tl/YWUugQOjoTYwjKdfJWkSOfhufJHO5LhXTSZC3TRoQKO+fuXnZAdoXXBlpLXKGODBL3OvdUasfDD4PcMe6ng== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^29.0.0: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.0.2.tgz#16e20003dbf8fb9ed7e6ab801579a77084e13fba" - integrity sha512-enziNbNUmXTcTaTP/Uq5rV91r0Yqy2UKzLUIabxMpGm9YHz8qpbJhiRnNVNvm6vzWfzt/0o97NEHH8/3udoClA== + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.0.3.tgz#5227a0596d30791b2649eea347e4aa97f734944d" + integrity sha512-ElgUtJBLgXM1E8L6K1RW1T96R897YY/3lRYqq9uVcPWtP2AAl/nQ16IYDh/FzQOOQ12VEuLdcPU83mbhG2C3PQ== dependencies: - "@jest/core" "^29.0.2" - "@jest/types" "^29.0.2" + "@jest/core" "^29.0.3" + "@jest/types" "^29.0.3" import-local "^3.0.2" - jest-cli "^29.0.2" + jest-cli "^29.0.3" js-sdsl@^4.1.4: version "4.1.4" @@ -2326,10 +2326,10 @@ prettier@>=2.3.0: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== -pretty-format@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.0.2.tgz#7f7666a7bf05ba2bcacde61be81c6db64f6f3be6" - integrity sha512-wp3CdtUa3cSJVFn3Miu5a1+pxc1iPIQTenOAn+x5erXeN1+ryTcLesV5pbK/rlW5EKwp27x38MoYfNGaNXDDhg== +pretty-format@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.0.3.tgz#23d5f8cabc9cbf209a77d49409d093d61166a811" + integrity sha512-cHudsvQr1K5vNVLbvYF/nv3Qy/F/BcEKxGuIeMiVMRHxPOO1RxXooP8g/ZrwAp7Dx+KdMZoOc7NxLHhMrP2f9Q== dependencies: "@jest/schemas" "^29.0.0" ansi-styles "^5.0.0" From 9cd2f07f9f7963e0614646d4dbbc71d8900a0904 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 19 Sep 2022 14:10:41 -0400 Subject: [PATCH 637/785] Support the next syntax_tree-haml version --- src/server.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/server.rb b/src/server.rb index 57d3232a..e9d2ec25 100644 --- a/src/server.rb +++ b/src/server.rb @@ -122,7 +122,14 @@ formatter.flush formatter.output.join when "haml" - formatter = PrettierPrint.new(+"", maxwidth, "\n", &genspace) + formatter_class = + if defined?(SyntaxTree::Haml::Format::Formatter) + SyntaxTree::Haml::Format::Formatter + else + PrettierPrint + end + + formatter = formatter_class.new(+"", maxwidth, "\n", &genspace) SyntaxTree::Haml.parse(source).format(formatter) formatter.flush formatter.output From 117480181e28e2ac7959083a13adcea5b5ba0cbb Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 19 Sep 2022 14:25:25 -0400 Subject: [PATCH 638/785] Bump to v3.2.1 --- CHANGELOG.md | 10 +++++++++- package.json | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21d15d2b..832cf30d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [3.2.1] - 2022-09-19 + +### Changed + +- [#1274](https://github.com/prettier/plugin-ruby/pull/1274) - kddnewton - Support the next version of `syntax_tree-haml`. + ## [3.2.0] - 2022-07-22 ### Added @@ -1255,7 +1261,9 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v3.1.2...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v3.2.1...HEAD +[3.2.1]: https://github.com/prettier/plugin-ruby/compare/v3.2.0...v3.2.1 +[3.2.0]: https://github.com/prettier/plugin-ruby/compare/v3.1.2...v3.2.0 [3.1.2]: https://github.com/prettier/plugin-ruby/compare/v3.1.1...v3.1.2 [3.1.1]: https://github.com/prettier/plugin-ruby/compare/v3.1.0...v3.1.1 [3.1.0]: https://github.com/prettier/plugin-ruby/compare/v3.0.0...v3.1.0 diff --git a/package.json b/package.json index 15dd8fdd..203b904c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "3.2.0", + "version": "3.2.1", "description": "prettier plugin for the Ruby programming language", "main": "src/plugin.js", "scripts": { From bd3b72dcd95783261d60a3af807e3289590a6c3c Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 20 Sep 2022 10:54:58 -0400 Subject: [PATCH 639/785] Fix plugins options parsing --- src/parseSync.js | 33 +++++++++++++++++++++------------ src/server.rb | 4 +++- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/parseSync.js b/src/parseSync.js index a9a7c543..9d89db6b 100644 --- a/src/parseSync.js +++ b/src/parseSync.js @@ -59,6 +59,26 @@ function getInfoFilepath() { return path.join(os.tmpdir(), `prettier-ruby-parser-${process.pid}.info`); } +// Return the list of plugins that should be passed to the server process. +function getPlugins(opts) { + const plugins = new Set(); + + const rubyPlugins = opts.rubyPlugins.trim(); + if (rubyPlugins.length > 0) { + rubyPlugins.split(",").forEach((plugin) => plugins.add(plugin.trim())); + } + + if (opts.singleQuote) { + plugins.add("plugin/single_quotes"); + } + + if (opts.trailingComma !== "none") { + plugins.add("plugin/trailing_comma"); + } + + return Array.from(plugins); +} + // Create a file that will act as a communication mechanism, spawn a parser // server with that filepath as an argument, then spawn another process that // will read that information in order to enable us to connect to it in the @@ -114,20 +134,9 @@ function spawnServer(opts) { }; } - const plugins = new Set(opts.rubyPlugins.split(",")); - if (opts.singleQuote) { - plugins.add("plugin/single_quotes"); - } - - if (opts.trailingComma !== "none") { - plugins.add("plugin/trailing_comma"); - } - - const rubyPlugins = Array.from(plugins).join(","); - const server = spawn( "ruby", - [serverRbPath, `--plugins=${rubyPlugins}`, filepath], + [serverRbPath, `--plugins=${getPlugins(opts).join(",")}`, filepath], { env: Object.assign({}, process.env, { LANG: getLang() }), detached: true, diff --git a/src/server.rb b/src/server.rb index e9d2ec25..86741a76 100644 --- a/src/server.rb +++ b/src/server.rb @@ -129,7 +129,9 @@ PrettierPrint end - formatter = formatter_class.new(+"", maxwidth, "\n", &genspace) + formatter = + formatter_class.new(source, +"", maxwidth, "\n", &genspace) + SyntaxTree::Haml.parse(source).format(formatter) formatter.flush formatter.output From 4a7191b95120125041adbd078693505577f268e8 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 20 Sep 2022 11:27:35 -0400 Subject: [PATCH 640/785] Bump to v3.2.2 --- CHANGELOG.md | 9 ++++++++- package.json | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 832cf30d..10ec685b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [3.2.2] - 2022-09-20 + +### Changed + +- [#1276](https://github.com/prettier/plugin-ruby/pull/1276) - kddnewton - Fix the parsing for options being passed to the server process. + ## [3.2.1] - 2022-09-19 ### Changed @@ -1261,7 +1267,8 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v3.2.1...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v3.2.2...HEAD +[3.2.2]: https://github.com/prettier/plugin-ruby/compare/v3.2.1...v3.2.2 [3.2.1]: https://github.com/prettier/plugin-ruby/compare/v3.2.0...v3.2.1 [3.2.0]: https://github.com/prettier/plugin-ruby/compare/v3.1.2...v3.2.0 [3.1.2]: https://github.com/prettier/plugin-ruby/compare/v3.1.1...v3.1.2 diff --git a/package.json b/package.json index 203b904c..b98dd011 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "3.2.1", + "version": "3.2.2", "description": "prettier plugin for the Ruby programming language", "main": "src/plugin.js", "scripts": { From ca8300fa7ea134b68f140b94fe8bf04872035ed2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 12:02:26 +0000 Subject: [PATCH 641/785] Bump eslint from 8.23.1 to 8.24.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.23.1 to 8.24.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.23.1...v8.24.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index e39a00aa..a26b39a6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -313,10 +313,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@humanwhocodes/config-array@^0.10.4": - version "0.10.4" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.10.4.tgz#01e7366e57d2ad104feea63e72248f22015c520c" - integrity sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw== +"@humanwhocodes/config-array@^0.10.5": + version "0.10.5" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.10.5.tgz#bb679745224745fff1e9a41961c1d45a49f81c04" + integrity sha512-XVVDtp+dVvRxMoxSiSfasYaG02VEe1qH5cKgMQJWhol6HwzbcqoCMJi8dAGoYAO57jhUyhI6cWuRiTcRaDaYug== dependencies: "@humanwhocodes/object-schema" "^1.2.1" debug "^4.1.1" @@ -1163,12 +1163,12 @@ eslint-visitor-keys@^3.3.0: integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.15.0: - version "8.23.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.23.1.tgz#cfd7b3f7fdd07db8d16b4ac0516a29c8d8dca5dc" - integrity sha512-w7C1IXCc6fNqjpuYd0yPlcTKKmHlHHktRkzmBPZ+7cvNBQuiNjx0xaMTjAJGCafJhQkrFJooREv0CtrVzmHwqg== + version "8.24.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.24.0.tgz#489516c927a5da11b3979dbfb2679394523383c8" + integrity sha512-dWFaPhGhTAiPcCgm3f6LI2MBWbogMnTJzFBbhXVRQDJPkr9pGZvVjlVfXd+vyDcWPA2Ic9L2AXPIQM0+vk/cSQ== dependencies: "@eslint/eslintrc" "^1.3.2" - "@humanwhocodes/config-array" "^0.10.4" + "@humanwhocodes/config-array" "^0.10.5" "@humanwhocodes/gitignore-to-minimatch" "^1.0.2" "@humanwhocodes/module-importer" "^1.0.1" ajv "^6.10.0" From 6c2e005002297591ecf4068b28ca1a84b31222a0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Sep 2022 12:01:15 +0000 Subject: [PATCH 642/785] Bump jest from 29.0.3 to 29.1.1 Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.0.3 to 29.1.1. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.1.1/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 579 +++++++++++++++++++++++++++--------------------------- 1 file changed, 290 insertions(+), 289 deletions(-) diff --git a/yarn.lock b/yarn.lock index a26b39a6..3731ba66 100644 --- a/yarn.lock +++ b/yarn.lock @@ -353,28 +353,28 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^29.0.3": - version "29.0.3" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.0.3.tgz#a222ab87e399317a89db88a58eaec289519e807a" - integrity sha512-cGg0r+klVHSYnfE977S9wmpuQ9L+iYuYgL+5bPXiUlUynLLYunRxswEmhBzvrSKGof5AKiHuTTmUKAqRcDY9dg== +"@jest/console@^29.1.0": + version "29.1.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.1.0.tgz#3b8e9e86aef28af15fcadfd8df7321ed1327c3e7" + integrity sha512-yNoFMuAsXTP8OyweaMaIoa6Px6rJkbbG7HtgYKGP3CY7lE7ADRA0Fn5ad9O+KefKcaf6W9rywKpCWOw21WMsAw== dependencies: - "@jest/types" "^29.0.3" + "@jest/types" "^29.1.0" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^29.0.3" - jest-util "^29.0.3" + jest-message-util "^29.1.0" + jest-util "^29.1.0" slash "^3.0.0" -"@jest/core@^29.0.3": - version "29.0.3" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.0.3.tgz#ba22a9cbd0c7ba36e04292e2093c547bf53ec1fd" - integrity sha512-1d0hLbOrM1qQE3eP3DtakeMbKTcXiXP3afWxqz103xPyddS2NhnNghS7MaXx1dcDt4/6p4nlhmeILo2ofgi8cQ== +"@jest/core@^29.1.1": + version "29.1.1" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.1.1.tgz#a7e5f86dd29fa9da1ca84752237735dc7bcda3d8" + integrity sha512-ppym+PLiuSmvU9ufXVb/8OtHUPcjW+bBlb8CLh6oMATgJtCE3fjDYrzJi5u1uX8q9jbmtQ7VADKJKIlp68zi3A== dependencies: - "@jest/console" "^29.0.3" - "@jest/reporters" "^29.0.3" - "@jest/test-result" "^29.0.3" - "@jest/transform" "^29.0.3" - "@jest/types" "^29.0.3" + "@jest/console" "^29.1.0" + "@jest/reporters" "^29.1.0" + "@jest/test-result" "^29.1.0" + "@jest/transform" "^29.1.0" + "@jest/types" "^29.1.0" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" @@ -382,80 +382,80 @@ exit "^0.1.2" graceful-fs "^4.2.9" jest-changed-files "^29.0.0" - jest-config "^29.0.3" - jest-haste-map "^29.0.3" - jest-message-util "^29.0.3" + jest-config "^29.1.1" + jest-haste-map "^29.1.0" + jest-message-util "^29.1.0" jest-regex-util "^29.0.0" - jest-resolve "^29.0.3" - jest-resolve-dependencies "^29.0.3" - jest-runner "^29.0.3" - jest-runtime "^29.0.3" - jest-snapshot "^29.0.3" - jest-util "^29.0.3" - jest-validate "^29.0.3" - jest-watcher "^29.0.3" + jest-resolve "^29.1.0" + jest-resolve-dependencies "^29.1.1" + jest-runner "^29.1.1" + jest-runtime "^29.1.1" + jest-snapshot "^29.1.0" + jest-util "^29.1.0" + jest-validate "^29.1.0" + jest-watcher "^29.1.0" micromatch "^4.0.4" - pretty-format "^29.0.3" + pretty-format "^29.1.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.0.3": - version "29.0.3" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.0.3.tgz#7745ec30a954e828e8cc6df6a13280d3b51d8f35" - integrity sha512-iKl272NKxYNQNqXMQandAIwjhQaGw5uJfGXduu8dS9llHi8jV2ChWrtOAVPnMbaaoDhnI3wgUGNDvZgHeEJQCA== +"@jest/environment@^29.1.1": + version "29.1.1" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.1.1.tgz#afeb66563d8d366a329908087b6697c3bfaed3cb" + integrity sha512-69WULhTD38UcjvLGRAnnwC5hDt35ZC91ZwnvWipNOAOSaQNT32uKYL/TVCT3tncB9L1D++LOmBbYhTYP4TLuuQ== dependencies: - "@jest/fake-timers" "^29.0.3" - "@jest/types" "^29.0.3" + "@jest/fake-timers" "^29.1.1" + "@jest/types" "^29.1.0" "@types/node" "*" - jest-mock "^29.0.3" + jest-mock "^29.1.1" -"@jest/expect-utils@^29.0.3": - version "29.0.3" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.0.3.tgz#f5bb86f5565bf2dacfca31ccbd887684936045b2" - integrity sha512-i1xUkau7K/63MpdwiRqaxgZOjxYs4f0WMTGJnYwUKubsNRZSeQbLorS7+I4uXVF9KQ5r61BUPAUMZ7Lf66l64Q== +"@jest/expect-utils@^29.1.0": + version "29.1.0" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.1.0.tgz#598cc7fea83b1bf84249b3b98683575cee888894" + integrity sha512-YcD5CF2beqfoB07WqejPzWq1/l+zT3SgGwcqqIaPPG1DHFn/ea8MWWXeqV3KKMhTaOM1rZjlYplj1GQxR0XxKA== dependencies: jest-get-type "^29.0.0" -"@jest/expect@^29.0.3": - version "29.0.3" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.0.3.tgz#9dc7c46354eeb7a348d73881fba6402f5fdb2c30" - integrity sha512-6W7K+fsI23FQ01H/BWccPyDZFrnU9QlzDcKOjrNVU5L8yUORFAJJIpmyxWPW70+X624KUNqzZwPThPMX28aXEQ== +"@jest/expect@^29.1.0": + version "29.1.0" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.1.0.tgz#58956d38c22f42a2ec7ecf7adb9e0ddd9a9082a3" + integrity sha512-qWQttxE5rEwzvDW9G3f0o8chu1EKvIfsMQDeRlXMLCtsDS94ckcqEMNgbKKz0NYlZ45xrIoy+/pngt3ZFr/2zw== dependencies: - expect "^29.0.3" - jest-snapshot "^29.0.3" + expect "^29.1.0" + jest-snapshot "^29.1.0" -"@jest/fake-timers@^29.0.3": - version "29.0.3" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.0.3.tgz#ad5432639b715d45a86a75c47fd75019bc36b22c" - integrity sha512-tmbUIo03x0TdtcZCESQ0oQSakPCpo7+s6+9mU19dd71MptkP4zCwoeZqna23//pgbhtT1Wq02VmA9Z9cNtvtCQ== +"@jest/fake-timers@^29.1.1": + version "29.1.1" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.1.1.tgz#ae345e5ca51e9f72e0d861e17c65d9cb558f407b" + integrity sha512-5wTGObRfL/OjzEz0v2ShXlzeJFJw8mO6ByMBwmPLd6+vkdPcmIpCvASG/PR/g8DpchSIEeDXCxQADojHxuhX8g== dependencies: - "@jest/types" "^29.0.3" + "@jest/types" "^29.1.0" "@sinonjs/fake-timers" "^9.1.2" "@types/node" "*" - jest-message-util "^29.0.3" - jest-mock "^29.0.3" - jest-util "^29.0.3" + jest-message-util "^29.1.0" + jest-mock "^29.1.1" + jest-util "^29.1.0" -"@jest/globals@^29.0.3": - version "29.0.3" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.0.3.tgz#681950c430fdc13ff9aa89b2d8d572ac0e4a1bf5" - integrity sha512-YqGHT65rFY2siPIHHFjuCGUsbzRjdqkwbat+Of6DmYRg5shIXXrLdZoVE/+TJ9O1dsKsFmYhU58JvIbZRU1Z9w== +"@jest/globals@^29.1.1": + version "29.1.1" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.1.1.tgz#017cffa0e79b35e7197b229d852c9ad35ed4be5c" + integrity sha512-yTiusxeEHjXwmo3guWlN31a1harU8zekLBMlZpOZ+84rfO3HDrkNZLTfd/YaHF8CrwlNCFpDGNSQCH8WkklH/Q== dependencies: - "@jest/environment" "^29.0.3" - "@jest/expect" "^29.0.3" - "@jest/types" "^29.0.3" - jest-mock "^29.0.3" + "@jest/environment" "^29.1.1" + "@jest/expect" "^29.1.0" + "@jest/types" "^29.1.0" + jest-mock "^29.1.1" -"@jest/reporters@^29.0.3": - version "29.0.3" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.0.3.tgz#735f110e08b44b38729d8dbbb74063bdf5aba8a5" - integrity sha512-3+QU3d4aiyOWfmk1obDerie4XNCaD5Xo1IlKNde2yGEi02WQD+ZQD0i5Hgqm1e73sMV7kw6pMlCnprtEwEVwxw== +"@jest/reporters@^29.1.0": + version "29.1.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.1.0.tgz#da488ddfb39a4cfb86abdc29fd94f84031acfd02" + integrity sha512-szSjHjVuBQ7aZUdBzTicCoQAAQsQFLk+/PtMfO0RQxL5mQ1iw+PSKOpyvMZcA5T6bH9pIapue5U9UCrxfOtL3w== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.0.3" - "@jest/test-result" "^29.0.3" - "@jest/transform" "^29.0.3" - "@jest/types" "^29.0.3" + "@jest/console" "^29.1.0" + "@jest/test-result" "^29.1.0" + "@jest/transform" "^29.1.0" + "@jest/types" "^29.1.0" "@jridgewell/trace-mapping" "^0.3.15" "@types/node" "*" chalk "^4.0.0" @@ -468,9 +468,9 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^29.0.3" - jest-util "^29.0.3" - jest-worker "^29.0.3" + jest-message-util "^29.1.0" + jest-util "^29.1.0" + jest-worker "^29.1.0" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" @@ -493,51 +493,51 @@ callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^29.0.3": - version "29.0.3" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.0.3.tgz#b03d8ef4c58be84cd5d5d3b24d4b4c8cabbf2746" - integrity sha512-vViVnQjCgTmbhDKEonKJPtcFe9G/CJO4/Np4XwYJah+lF2oI7KKeRp8t1dFvv44wN2NdbDb/qC6pi++Vpp0Dlg== +"@jest/test-result@^29.1.0": + version "29.1.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.1.0.tgz#da6b0062325a780c9e3c7262b6b89da57fba2dca" + integrity sha512-RMBhPlw1Qfc2bKSf3RFPCyFSN7cfWVSTxRD8JrnvqdqgaDgrq4aGJT1A/V2+5Vq9bqBd187FpaxGTQ4zLrt08g== dependencies: - "@jest/console" "^29.0.3" - "@jest/types" "^29.0.3" + "@jest/console" "^29.1.0" + "@jest/types" "^29.1.0" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.0.3": - version "29.0.3" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.0.3.tgz#0681061ad21fb8e293b49c4fdf7e631ca79240ba" - integrity sha512-Hf4+xYSWZdxTNnhDykr8JBs0yBN/nxOXyUQWfotBUqqy0LF9vzcFB0jm/EDNZCx587znLWTIgxcokW7WeZMobQ== +"@jest/test-sequencer@^29.1.0": + version "29.1.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.1.0.tgz#d3d34497e860a44f3f80e94958651f58d3ce64f8" + integrity sha512-1diQfwNhBAte+x3TmyfWloxT1C8GcPEPEZ4BZjmELBK2j3cdqi0DofoJUxBDDUBBnakbv8ce0B7CIzprsupPSA== dependencies: - "@jest/test-result" "^29.0.3" + "@jest/test-result" "^29.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.0.3" + jest-haste-map "^29.1.0" slash "^3.0.0" -"@jest/transform@^29.0.3": - version "29.0.3" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.0.3.tgz#9eb1fed2072a0354f190569807d1250572fb0970" - integrity sha512-C5ihFTRYaGDbi/xbRQRdbo5ddGtI4VSpmL6AIcZxdhwLbXMa7PcXxxqyI91vGOFHnn5aVM3WYnYKCHEqmLVGzg== +"@jest/transform@^29.1.0": + version "29.1.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.1.0.tgz#1b3e597681362f6164e786e6bc2826c34ecbf74f" + integrity sha512-NI1zd62KgM0lW6rWMIZDx52dfTIDd+cnLQNahH0YhH7TVmQVigumJ6jszuhAzvKHGm55P2Fozcglb5sGMfFp3Q== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^29.0.3" + "@jest/types" "^29.1.0" "@jridgewell/trace-mapping" "^0.3.15" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.0.3" + jest-haste-map "^29.1.0" jest-regex-util "^29.0.0" - jest-util "^29.0.3" + jest-util "^29.1.0" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" write-file-atomic "^4.0.1" -"@jest/types@^29.0.3": - version "29.0.3" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.0.3.tgz#0be78fdddb1a35aeb2041074e55b860561c8ef63" - integrity sha512-coBJmOQvurXjN1Hh5PzF7cmsod0zLIOXpP8KD161mqNlroMhLcwpODiEzi7ZsRl5Z/AIuxpeNm8DCl43F4kz8A== +"@jest/types@^29.1.0": + version "29.1.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.1.0.tgz#db23d727ce0a95500749551d8724fb3526d1e903" + integrity sha512-lE30u3z4lbTOqf5D7fDdoco3Qd8H6F/t73nLOswU4x+7VhgDQMX5y007IMqrKjFHdnpslaYymVFhWX+ttXNARQ== dependencies: "@jest/schemas" "^29.0.0" "@types/istanbul-lib-coverage" "^2.0.0" @@ -810,12 +810,12 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^29.0.3: - version "29.0.3" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.0.3.tgz#64e156a47a77588db6a669a88dedff27ed6e260f" - integrity sha512-ApPyHSOhS/sVzwUOQIWJmdvDhBsMG01HX9z7ogtkp1TToHGGUWFlnXJUIzCgKPSfiYLn3ibipCYzsKSURHEwLg== +babel-jest@^29.1.0: + version "29.1.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.1.0.tgz#945e45eb8a33e8ad8cb334f2b0f040d7306cffbf" + integrity sha512-0XiBgPRhMSng+ThuXz0M/WpOeml/q5S4BFIaDS5uQb+lCjOzd0OfYEN4hWte5fDy7SZ6rNmEi16UpWGurSg2nQ== dependencies: - "@jest/transform" "^29.0.3" + "@jest/transform" "^29.1.0" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" babel-preset-jest "^29.0.2" @@ -1280,16 +1280,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^29.0.3: - version "29.0.3" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.0.3.tgz#6be65ddb945202f143c4e07c083f4f39f3bd326f" - integrity sha512-t8l5DTws3212VbmPL+tBFXhjRHLmctHB0oQbL8eUc6S7NzZtYUhycrFO9mkxA0ZUC6FAWdNi7JchJSkODtcu1Q== +expect@^29.1.0: + version "29.1.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.1.0.tgz#0e20a72cf4b2cfb8ca5e2ab138c23c5078c37460" + integrity sha512-1NCfR0FEArn9Vq1KEjhPd1rggRLiWgo87gfMK4iKn6DcVzJBRMyDNX22hyND5KiSRPIPQ5KtsY6HLxsQ0MU86w== dependencies: - "@jest/expect-utils" "^29.0.3" + "@jest/expect-utils" "^29.1.0" jest-get-type "^29.0.0" - jest-matcher-utils "^29.0.3" - jest-message-util "^29.0.3" - jest-util "^29.0.3" + jest-matcher-utils "^29.1.0" + jest-message-util "^29.1.0" + jest-util "^29.1.0" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1651,86 +1651,86 @@ jest-changed-files@^29.0.0: execa "^5.0.0" p-limit "^3.1.0" -jest-circus@^29.0.3: - version "29.0.3" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.0.3.tgz#90faebc90295291cfc636b27dbd82e3bfb9e7a48" - integrity sha512-QeGzagC6Hw5pP+df1+aoF8+FBSgkPmraC1UdkeunWh0jmrp7wC0Hr6umdUAOELBQmxtKAOMNC3KAdjmCds92Zg== +jest-circus@^29.1.1: + version "29.1.1" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.1.1.tgz#696e0b58351316f5fdb39d3480b4fffe8dbf0100" + integrity sha512-Ii+3JIeLF3z8j2E7fPSjPjXJLBdbAcZyfEiALRQ1Fk+FWTIfuEfZrZcjSaBdz/k/waoq+bPf9x/vBCXIAyLLEQ== dependencies: - "@jest/environment" "^29.0.3" - "@jest/expect" "^29.0.3" - "@jest/test-result" "^29.0.3" - "@jest/types" "^29.0.3" + "@jest/environment" "^29.1.1" + "@jest/expect" "^29.1.0" + "@jest/test-result" "^29.1.0" + "@jest/types" "^29.1.0" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" is-generator-fn "^2.0.0" - jest-each "^29.0.3" - jest-matcher-utils "^29.0.3" - jest-message-util "^29.0.3" - jest-runtime "^29.0.3" - jest-snapshot "^29.0.3" - jest-util "^29.0.3" + jest-each "^29.1.0" + jest-matcher-utils "^29.1.0" + jest-message-util "^29.1.0" + jest-runtime "^29.1.1" + jest-snapshot "^29.1.0" + jest-util "^29.1.0" p-limit "^3.1.0" - pretty-format "^29.0.3" + pretty-format "^29.1.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.0.3: - version "29.0.3" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.0.3.tgz#fd8f0ef363a7a3d9c53ef62e0651f18eeffa77b9" - integrity sha512-aUy9Gd/Kut1z80eBzG10jAn6BgS3BoBbXyv+uXEqBJ8wnnuZ5RpNfARoskSrTIy1GY4a8f32YGuCMwibtkl9CQ== +jest-cli@^29.1.1: + version "29.1.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.1.1.tgz#6ff79c0b2d1d062f24216d2bcbf6c01a1e41db21" + integrity sha512-nz/JNtqDFf49R2KgeZ9+6Zl1uxSuRsg/tICC+DHMh+bQ0co6QqBPWKg3FtW4534bs8/J2YqFC2Lct9DZR24z0Q== dependencies: - "@jest/core" "^29.0.3" - "@jest/test-result" "^29.0.3" - "@jest/types" "^29.0.3" + "@jest/core" "^29.1.1" + "@jest/test-result" "^29.1.0" + "@jest/types" "^29.1.0" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.0.3" - jest-util "^29.0.3" - jest-validate "^29.0.3" + jest-config "^29.1.1" + jest-util "^29.1.0" + jest-validate "^29.1.0" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^29.0.3: - version "29.0.3" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.0.3.tgz#c2e52a8f5adbd18de79f99532d8332a19e232f13" - integrity sha512-U5qkc82HHVYe3fNu2CRXLN4g761Na26rWKf7CjM8LlZB3In1jadEkZdMwsE37rd9RSPV0NfYaCjHdk/gu3v+Ew== +jest-config@^29.1.1: + version "29.1.1" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.1.1.tgz#52aaa6237a7b3eea5c640aad6a53b390dc76f49f" + integrity sha512-o2iZrQMOiF54zOw1kOcJGmfKzAW+V2ajZVWxbt+Ex+g0fVaTkk215BD/GFhrviuic+Xk7DpzUmdTT9c1QfsPqg== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.0.3" - "@jest/types" "^29.0.3" - babel-jest "^29.0.3" + "@jest/test-sequencer" "^29.1.0" + "@jest/types" "^29.1.0" + babel-jest "^29.1.0" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^29.0.3" - jest-environment-node "^29.0.3" + jest-circus "^29.1.1" + jest-environment-node "^29.1.1" jest-get-type "^29.0.0" jest-regex-util "^29.0.0" - jest-resolve "^29.0.3" - jest-runner "^29.0.3" - jest-util "^29.0.3" - jest-validate "^29.0.3" + jest-resolve "^29.1.0" + jest-runner "^29.1.1" + jest-util "^29.1.0" + jest-validate "^29.1.0" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^29.0.3" + pretty-format "^29.1.0" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^29.0.3: - version "29.0.3" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.0.3.tgz#41cc02409ad1458ae1bf7684129a3da2856341ac" - integrity sha512-+X/AIF5G/vX9fWK+Db9bi9BQas7M9oBME7egU7psbn4jlszLFCu0dW63UgeE6cs/GANq4fLaT+8sGHQQ0eCUfg== +jest-diff@^29.1.0: + version "29.1.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.1.0.tgz#952639cd73fcf4d34173e2d98a0cd1c20c71ba88" + integrity sha512-ZJyWG30jpVHwxLs8xxR1so4tz6lFARNztnFlxssFpQdakaW0isSx9rAKs/6aQUKQDZ/DgSpY6HjUGLO9xkNdRw== dependencies: chalk "^4.0.0" diff-sequences "^29.0.0" jest-get-type "^29.0.0" - pretty-format "^29.0.3" + pretty-format "^29.1.0" jest-docblock@^29.0.0: version "29.0.0" @@ -1739,93 +1739,94 @@ jest-docblock@^29.0.0: dependencies: detect-newline "^3.0.0" -jest-each@^29.0.3: - version "29.0.3" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.0.3.tgz#7ef3157580b15a609d7ef663dd4fc9b07f4e1299" - integrity sha512-wILhZfESURHHBNvPMJ0lZlYZrvOQJxAo3wNHi+ycr90V7M+uGR9Gh4+4a/BmaZF0XTyZsk4OiYEf3GJN7Ltqzg== +jest-each@^29.1.0: + version "29.1.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.1.0.tgz#d0962d04f4a28f5f048c2ff50965cab9ae2f524d" + integrity sha512-ELSZV/L4yjqKU2O0bnDTNHlizD4IRS9DX94iAB6QpiPIJsR453dJW7Ka7TXSmxQdc66HNNOhUcQ5utIeVCKGyA== dependencies: - "@jest/types" "^29.0.3" + "@jest/types" "^29.1.0" chalk "^4.0.0" jest-get-type "^29.0.0" - jest-util "^29.0.3" - pretty-format "^29.0.3" + jest-util "^29.1.0" + pretty-format "^29.1.0" -jest-environment-node@^29.0.3: - version "29.0.3" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.0.3.tgz#293804b1e0fa5f0e354dacbe510655caa478a3b2" - integrity sha512-cdZqRCnmIlTXC+9vtvmfiY/40Cj6s2T0czXuq1whvQdmpzAnj4sbqVYuZ4zFHk766xTTJ+Ij3uUqkk8KCfXoyg== +jest-environment-node@^29.1.1: + version "29.1.1" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.1.1.tgz#10f1782b74e17fcf782ff51df79f2b0cee135851" + integrity sha512-0nwTca4L2N8iM33A+JMfBdygR6B3N/bcPoLe1hEd9o87KLxDZwKGvpTGSfXpjtyqNQXiaL/3G+YOcSoeq/syPw== dependencies: - "@jest/environment" "^29.0.3" - "@jest/fake-timers" "^29.0.3" - "@jest/types" "^29.0.3" + "@jest/environment" "^29.1.1" + "@jest/fake-timers" "^29.1.1" + "@jest/types" "^29.1.0" "@types/node" "*" - jest-mock "^29.0.3" - jest-util "^29.0.3" + jest-mock "^29.1.1" + jest-util "^29.1.0" jest-get-type@^29.0.0: version "29.0.0" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.0.0.tgz#843f6c50a1b778f7325df1129a0fd7aa713aef80" integrity sha512-83X19z/HuLKYXYHskZlBAShO7UfLFXu/vWajw9ZNJASN32li8yHMaVGAQqxFW1RCFOkB7cubaL6FaJVQqqJLSw== -jest-haste-map@^29.0.3: - version "29.0.3" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.0.3.tgz#d7f3f7180f558d760eacc5184aac5a67f20ef939" - integrity sha512-uMqR99+GuBHo0RjRhOE4iA6LmsxEwRdgiIAQgMU/wdT2XebsLDz5obIwLZm/Psj+GwSEQhw9AfAVKGYbh2G55A== +jest-haste-map@^29.1.0: + version "29.1.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.1.0.tgz#1cbdd30528b7b215523166cec3718600a3328ad1" + integrity sha512-qn+QVZ6JHzzx6g8XrMrNNvvIWrgVT6FzOoxTP5hQ1vEu6r9use2gOb0sSeC3Xle7eaDLN4DdAazSKnWskK3B/g== dependencies: - "@jest/types" "^29.0.3" + "@jest/types" "^29.1.0" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" jest-regex-util "^29.0.0" - jest-util "^29.0.3" - jest-worker "^29.0.3" + jest-util "^29.1.0" + jest-worker "^29.1.0" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^29.0.3: - version "29.0.3" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.0.3.tgz#e85cf3391106a7a250850b6766b508bfe9c7bc6f" - integrity sha512-YfW/G63dAuiuQ3QmQlh8hnqLDe25WFY3eQhuc/Ev1AGmkw5zREblTh7TCSKLoheyggu6G9gxO2hY8p9o6xbaRQ== +jest-leak-detector@^29.1.0: + version "29.1.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.1.0.tgz#6b7067d383dbf0804f21e16426d8562d84f19340" + integrity sha512-7ZdlIA2UXBIzXBNadta7pohrrvbD/Jp5T55Ux2DE1BSGul4RglIPHt7cZ0V3ll+ppBC1pGaBiWPBfLcQ2dDc3Q== dependencies: jest-get-type "^29.0.0" - pretty-format "^29.0.3" + pretty-format "^29.1.0" -jest-matcher-utils@^29.0.3: - version "29.0.3" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.0.3.tgz#b8305fd3f9e27cdbc210b21fc7dbba92d4e54560" - integrity sha512-RsR1+cZ6p1hDV4GSCQTg+9qjeotQCgkaleIKLK7dm+U4V/H2bWedU3RAtLm8+mANzZ7eDV33dMar4pejd7047w== +jest-matcher-utils@^29.1.0: + version "29.1.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.1.0.tgz#60f53cc199921ece9170d3d20500ae0b93294928" + integrity sha512-pfthsLu27kZg+T1XTUGvox0r3gP3KtqdMPliVd/bs6iDrZ9Z6yJgLbw6zNc4DHtCcyzq9UW0jmszCX8DdFU/wA== dependencies: chalk "^4.0.0" - jest-diff "^29.0.3" + jest-diff "^29.1.0" jest-get-type "^29.0.0" - pretty-format "^29.0.3" + pretty-format "^29.1.0" -jest-message-util@^29.0.3: - version "29.0.3" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.0.3.tgz#f0254e1ffad21890c78355726202cc91d0a40ea8" - integrity sha512-7T8JiUTtDfppojosORAflABfLsLKMLkBHSWkjNQrjIltGoDzNGn7wEPOSfjqYAGTYME65esQzMJxGDjuLBKdOg== +jest-message-util@^29.1.0: + version "29.1.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.1.0.tgz#0bb50a8064aa49999a6c313827e43bf51bd71dd1" + integrity sha512-NzGXD9wgCxUy20sIvyOsSA/KzQmkmagOVGE5LnT2juWn+hB88gCQr8N/jpu34CXRIXmV7INwrQVVwhnh72pY5A== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.0.3" + "@jest/types" "^29.1.0" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^29.0.3" + pretty-format "^29.1.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^29.0.3: - version "29.0.3" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.0.3.tgz#4f0093f6a9cb2ffdb9c44a07a3912f0c098c8de9" - integrity sha512-ort9pYowltbcrCVR43wdlqfAiFJXBx8l4uJDsD8U72LgBcetvEp+Qxj1W9ZYgMRoeAo+ov5cnAGF2B6+Oth+ww== +jest-mock@^29.1.1: + version "29.1.1" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.1.1.tgz#b5475d07a8db6d39fe73e960ca94a3ac761afe0d" + integrity sha512-vDe56JmImqt3j8pHcEIkahQbSCnBS49wda0spIl0bkrIM7VDZXjKaes6W28vKZye0atNAcFaj3dxXh0XWjBW4Q== dependencies: - "@jest/types" "^29.0.3" + "@jest/types" "^29.1.0" "@types/node" "*" + jest-util "^29.1.0" jest-pnp-resolver@^1.2.2: version "1.2.2" @@ -1837,88 +1838,88 @@ jest-regex-util@^29.0.0: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.0.0.tgz#b442987f688289df8eb6c16fa8df488b4cd007de" integrity sha512-BV7VW7Sy0fInHWN93MMPtlClweYv2qrSCwfeFWmpribGZtQPWNvRSq9XOVgOEjU1iBGRKXUZil0o2AH7Iy9Lug== -jest-resolve-dependencies@^29.0.3: - version "29.0.3" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.0.3.tgz#f23a54295efc6374b86b198cf8efed5606d6b762" - integrity sha512-KzuBnXqNvbuCdoJpv8EanbIGObk7vUBNt/PwQPPx2aMhlv/jaXpUJsqWYRpP/0a50faMBY7WFFP8S3/CCzwfDw== +jest-resolve-dependencies@^29.1.1: + version "29.1.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.1.1.tgz#03104a866fb133cffd8a6fe7fc198b0de9a17232" + integrity sha512-AMRTJyiK8caRXq3pa9i4oXX6yH+am5v0HwCUq1yk9lxI3ARihyT2OfEySJJo3ER7xpxf3b6isfp1sO6PQY3N0Q== dependencies: jest-regex-util "^29.0.0" - jest-snapshot "^29.0.3" + jest-snapshot "^29.1.0" -jest-resolve@^29.0.3: - version "29.0.3" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.0.3.tgz#329a3431e3b9eb6629a2cd483e9bed95b26827b9" - integrity sha512-toVkia85Y/BPAjJasTC9zIPY6MmVXQPtrCk8SmiheC4MwVFE/CMFlOtMN6jrwPMC6TtNh8+sTMllasFeu1wMPg== +jest-resolve@^29.1.0: + version "29.1.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.1.0.tgz#114d2a86f6ff07e1cc56dbe84deb9d6e058b4399" + integrity sha512-0IETuMI58nbAWwCrtX1QQmenstlWOEdwNS5FXxpEMAs6S5tttFiEoXUwGTAiI152nqoWRUckAgt21FP4wqeZWA== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^29.0.3" + jest-haste-map "^29.1.0" jest-pnp-resolver "^1.2.2" - jest-util "^29.0.3" - jest-validate "^29.0.3" + jest-util "^29.1.0" + jest-validate "^29.1.0" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^29.0.3: - version "29.0.3" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.0.3.tgz#2e47fe1e8777aea9b8970f37e8f83630b508fb87" - integrity sha512-Usu6VlTOZlCZoNuh3b2Tv/yzDpKqtiNAetG9t3kJuHfUyVMNW7ipCCJOUojzKkjPoaN7Bl1f7Buu6PE0sGpQxw== +jest-runner@^29.1.1: + version "29.1.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.1.1.tgz#4ababc79ec3ec654de33db093ca2ec78599fa7ad" + integrity sha512-HqazsMPXB62Zi2oJEl+Ta9aUWAaR4WdT7ow25pcS99PkOsWQoYH+yyaKbAHBUf8NOqPbZ8T4Q8gt8ZBFEJJdVQ== dependencies: - "@jest/console" "^29.0.3" - "@jest/environment" "^29.0.3" - "@jest/test-result" "^29.0.3" - "@jest/transform" "^29.0.3" - "@jest/types" "^29.0.3" + "@jest/console" "^29.1.0" + "@jest/environment" "^29.1.1" + "@jest/test-result" "^29.1.0" + "@jest/transform" "^29.1.0" + "@jest/types" "^29.1.0" "@types/node" "*" chalk "^4.0.0" emittery "^0.10.2" graceful-fs "^4.2.9" jest-docblock "^29.0.0" - jest-environment-node "^29.0.3" - jest-haste-map "^29.0.3" - jest-leak-detector "^29.0.3" - jest-message-util "^29.0.3" - jest-resolve "^29.0.3" - jest-runtime "^29.0.3" - jest-util "^29.0.3" - jest-watcher "^29.0.3" - jest-worker "^29.0.3" + jest-environment-node "^29.1.1" + jest-haste-map "^29.1.0" + jest-leak-detector "^29.1.0" + jest-message-util "^29.1.0" + jest-resolve "^29.1.0" + jest-runtime "^29.1.1" + jest-util "^29.1.0" + jest-watcher "^29.1.0" + jest-worker "^29.1.0" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^29.0.3: - version "29.0.3" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.0.3.tgz#5a823ec5902257519556a4e5a71a868e8fd788aa" - integrity sha512-12gZXRQ7ozEeEHKTY45a+YLqzNDR/x4c//X6AqwKwKJPpWM8FY4vwn4VQJOcLRS3Nd1fWwgP7LU4SoynhuUMHQ== +jest-runtime@^29.1.1: + version "29.1.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.1.1.tgz#54a4cc4665d5c86f072f3f8fe3f9ec83d3802c8b" + integrity sha512-DA2nW5GUAEFUOFztVqX6BOHbb1tUO1iDzlx+bOVdw870UIkv09u3P5nTfK3N+xtqy/fGlLsg7UCzhpEJnwKilg== dependencies: - "@jest/environment" "^29.0.3" - "@jest/fake-timers" "^29.0.3" - "@jest/globals" "^29.0.3" + "@jest/environment" "^29.1.1" + "@jest/fake-timers" "^29.1.1" + "@jest/globals" "^29.1.1" "@jest/source-map" "^29.0.0" - "@jest/test-result" "^29.0.3" - "@jest/transform" "^29.0.3" - "@jest/types" "^29.0.3" + "@jest/test-result" "^29.1.0" + "@jest/transform" "^29.1.0" + "@jest/types" "^29.1.0" "@types/node" "*" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^29.0.3" - jest-message-util "^29.0.3" - jest-mock "^29.0.3" + jest-haste-map "^29.1.0" + jest-message-util "^29.1.0" + jest-mock "^29.1.1" jest-regex-util "^29.0.0" - jest-resolve "^29.0.3" - jest-snapshot "^29.0.3" - jest-util "^29.0.3" + jest-resolve "^29.1.0" + jest-snapshot "^29.1.0" + jest-util "^29.1.0" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.0.3: - version "29.0.3" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.0.3.tgz#0a024706986a915a6eefae74d7343069d2fc8eef" - integrity sha512-52q6JChm04U3deq+mkQ7R/7uy7YyfVIrebMi6ZkBoDJ85yEjm/sJwdr1P0LOIEHmpyLlXrxy3QP0Zf5J2kj0ew== +jest-snapshot@^29.1.0: + version "29.1.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.1.0.tgz#9da20c1c504a41e79abcbfecced090325b3cdba1" + integrity sha512-nHZoA+hpbFlkyV8uLoLJQ/80DLi3c6a5zeELgfSZ5bZj+eljqULr79KBQakp5xyH3onezf4k+K+2/Blk5/1O+g== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" @@ -1926,81 +1927,81 @@ jest-snapshot@^29.0.3: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.0.3" - "@jest/transform" "^29.0.3" - "@jest/types" "^29.0.3" + "@jest/expect-utils" "^29.1.0" + "@jest/transform" "^29.1.0" + "@jest/types" "^29.1.0" "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.0.3" + expect "^29.1.0" graceful-fs "^4.2.9" - jest-diff "^29.0.3" + jest-diff "^29.1.0" jest-get-type "^29.0.0" - jest-haste-map "^29.0.3" - jest-matcher-utils "^29.0.3" - jest-message-util "^29.0.3" - jest-util "^29.0.3" + jest-haste-map "^29.1.0" + jest-matcher-utils "^29.1.0" + jest-message-util "^29.1.0" + jest-util "^29.1.0" natural-compare "^1.4.0" - pretty-format "^29.0.3" + pretty-format "^29.1.0" semver "^7.3.5" -jest-util@^29.0.3: - version "29.0.3" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.0.3.tgz#06d1d77f9a1bea380f121897d78695902959fbc0" - integrity sha512-Q0xaG3YRG8QiTC4R6fHjHQPaPpz9pJBEi0AeOE4mQh/FuWOijFjGXMMOfQEaU9i3z76cNR7FobZZUQnL6IyfdQ== +jest-util@^29.1.0: + version "29.1.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.1.0.tgz#e8a971dfb900bb85f090c752aa321b6912e81002" + integrity sha512-5haD8egMAEAq/e8ritN2Gr1WjLYtXi4udAIZB22GnKlv/2MHkbCjcyjgDBmyezAMMeQKGfoaaDsWCmVlnHZ1WQ== dependencies: - "@jest/types" "^29.0.3" + "@jest/types" "^29.1.0" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^29.0.3: - version "29.0.3" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.0.3.tgz#f9521581d7344685428afa0a4d110e9c519aeeb6" - integrity sha512-OebiqqT6lK8cbMPtrSoS3aZP4juID762lZvpf1u+smZnwTEBCBInan0GAIIhv36MxGaJvmq5uJm7dl5gVt+Zrw== +jest-validate@^29.1.0: + version "29.1.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.1.0.tgz#5e2ba89d7d6b3e4d3ece34024f317e956a5c85c0" + integrity sha512-EQKRweSxmIJelCdirpuVkeCS1rSNXJFtSGEeSRFwH39QGioy7qKRSY8XBB4qFiappbsvgHnH0V6Iq5ASs11knA== dependencies: - "@jest/types" "^29.0.3" + "@jest/types" "^29.1.0" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^29.0.0" leven "^3.1.0" - pretty-format "^29.0.3" + pretty-format "^29.1.0" -jest-watcher@^29.0.3: - version "29.0.3" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.0.3.tgz#8e220d1cc4f8029875e82015d084cab20f33d57f" - integrity sha512-tQX9lU91A+9tyUQKUMp0Ns8xAcdhC9fo73eqA3LFxP2bSgiF49TNcc+vf3qgGYYK9qRjFpXW9+4RgF/mbxyOOw== +jest-watcher@^29.1.0: + version "29.1.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.1.0.tgz#4a9f9d2c9bb9115f7b543c26f468d2c0c0202506" + integrity sha512-JXw7+VpLSf+2yfXlux1/xR65fMn//0pmiXd6EtQWySS9233aA+eGS+8Y5o2imiJ25JBKdG8T45+s78CNQ71Fbg== dependencies: - "@jest/test-result" "^29.0.3" - "@jest/types" "^29.0.3" + "@jest/test-result" "^29.1.0" + "@jest/types" "^29.1.0" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.10.2" - jest-util "^29.0.3" + jest-util "^29.1.0" string-length "^4.0.1" -jest-worker@^29.0.3: - version "29.0.3" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.0.3.tgz#c2ba0aa7e41eec9eb0be8e8a322ae6518df72647" - integrity sha512-Tl/YWUugQOjoTYwjKdfJWkSOfhufJHO5LhXTSZC3TRoQKO+fuXnZAdoXXBlpLXKGODBL3OvdUasfDD4PcMe6ng== +jest-worker@^29.1.0: + version "29.1.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.1.0.tgz#374d741b976a868e39141d63fb401abacc07a8c9" + integrity sha512-yr7RFRAxI+vhL/cGB9B0FhD+QfaWh1qSxurx7gLP16dfmqhG8w75D/CQFU8ZetvhiQqLZh8X0C4rxwsZy6HITQ== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^29.0.0: - version "29.0.3" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.0.3.tgz#5227a0596d30791b2649eea347e4aa97f734944d" - integrity sha512-ElgUtJBLgXM1E8L6K1RW1T96R897YY/3lRYqq9uVcPWtP2AAl/nQ16IYDh/FzQOOQ12VEuLdcPU83mbhG2C3PQ== + version "29.1.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.1.1.tgz#22d9d828f01335ec17225bcb267fe669319983be" + integrity sha512-Doe41PZ8MvGLtOZIW2RIVu94wa7jm/N775BBloVXk/G/vV6VYnDCOxBwrqekEgrd3Pn/bv8b5UdB2x0pAoQpwQ== dependencies: - "@jest/core" "^29.0.3" - "@jest/types" "^29.0.3" + "@jest/core" "^29.1.1" + "@jest/types" "^29.1.0" import-local "^3.0.2" - jest-cli "^29.0.3" + jest-cli "^29.1.1" js-sdsl@^4.1.4: version "4.1.4" @@ -2326,10 +2327,10 @@ prettier@>=2.3.0: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== -pretty-format@^29.0.3: - version "29.0.3" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.0.3.tgz#23d5f8cabc9cbf209a77d49409d093d61166a811" - integrity sha512-cHudsvQr1K5vNVLbvYF/nv3Qy/F/BcEKxGuIeMiVMRHxPOO1RxXooP8g/ZrwAp7Dx+KdMZoOc7NxLHhMrP2f9Q== +pretty-format@^29.1.0: + version "29.1.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.1.0.tgz#ea3de2feed5b8d19c537a12fe478ddc8b45da6b8" + integrity sha512-dZ21z0UjKVSiEkrPAt2nJnGfrtYMFBlNW4wTkJsIp9oB5A8SUQ8DuJ9EUgAvYyNfMeoGmKiDnpJvM489jkzdSQ== dependencies: "@jest/schemas" "^29.0.0" ansi-styles "^5.0.0" From 0995074730abb2c8a4e5d8e841bad432a36c3b3d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Sep 2022 12:05:30 +0000 Subject: [PATCH 643/785] Bump jest from 29.1.1 to 29.1.2 Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.1.1 to 29.1.2. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.1.2/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 581 +++++++++++++++++++++++++++--------------------------- 1 file changed, 291 insertions(+), 290 deletions(-) diff --git a/yarn.lock b/yarn.lock index 3731ba66..5cda0ff1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -353,28 +353,28 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^29.1.0": - version "29.1.0" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.1.0.tgz#3b8e9e86aef28af15fcadfd8df7321ed1327c3e7" - integrity sha512-yNoFMuAsXTP8OyweaMaIoa6Px6rJkbbG7HtgYKGP3CY7lE7ADRA0Fn5ad9O+KefKcaf6W9rywKpCWOw21WMsAw== +"@jest/console@^29.1.2": + version "29.1.2" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.1.2.tgz#0ae975a70004696f8320490fcaa1a4152f7b62e4" + integrity sha512-ujEBCcYs82BTmRxqfHMQggSlkUZP63AE5YEaTPj7eFyJOzukkTorstOUC7L6nE3w5SYadGVAnTsQ/ZjTGL0qYQ== dependencies: - "@jest/types" "^29.1.0" + "@jest/types" "^29.1.2" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^29.1.0" - jest-util "^29.1.0" + jest-message-util "^29.1.2" + jest-util "^29.1.2" slash "^3.0.0" -"@jest/core@^29.1.1": - version "29.1.1" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.1.1.tgz#a7e5f86dd29fa9da1ca84752237735dc7bcda3d8" - integrity sha512-ppym+PLiuSmvU9ufXVb/8OtHUPcjW+bBlb8CLh6oMATgJtCE3fjDYrzJi5u1uX8q9jbmtQ7VADKJKIlp68zi3A== +"@jest/core@^29.1.2": + version "29.1.2" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.1.2.tgz#e5ce7a71e7da45156a96fb5eeed11d18b67bd112" + integrity sha512-sCO2Va1gikvQU2ynDN8V4+6wB7iVrD2CvT0zaRst4rglf56yLly0NQ9nuRRAWFeimRf+tCdFsb1Vk1N9LrrMPA== dependencies: - "@jest/console" "^29.1.0" - "@jest/reporters" "^29.1.0" - "@jest/test-result" "^29.1.0" - "@jest/transform" "^29.1.0" - "@jest/types" "^29.1.0" + "@jest/console" "^29.1.2" + "@jest/reporters" "^29.1.2" + "@jest/test-result" "^29.1.2" + "@jest/transform" "^29.1.2" + "@jest/types" "^29.1.2" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" @@ -382,80 +382,80 @@ exit "^0.1.2" graceful-fs "^4.2.9" jest-changed-files "^29.0.0" - jest-config "^29.1.1" - jest-haste-map "^29.1.0" - jest-message-util "^29.1.0" + jest-config "^29.1.2" + jest-haste-map "^29.1.2" + jest-message-util "^29.1.2" jest-regex-util "^29.0.0" - jest-resolve "^29.1.0" - jest-resolve-dependencies "^29.1.1" - jest-runner "^29.1.1" - jest-runtime "^29.1.1" - jest-snapshot "^29.1.0" - jest-util "^29.1.0" - jest-validate "^29.1.0" - jest-watcher "^29.1.0" + jest-resolve "^29.1.2" + jest-resolve-dependencies "^29.1.2" + jest-runner "^29.1.2" + jest-runtime "^29.1.2" + jest-snapshot "^29.1.2" + jest-util "^29.1.2" + jest-validate "^29.1.2" + jest-watcher "^29.1.2" micromatch "^4.0.4" - pretty-format "^29.1.0" + pretty-format "^29.1.2" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.1.1": - version "29.1.1" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.1.1.tgz#afeb66563d8d366a329908087b6697c3bfaed3cb" - integrity sha512-69WULhTD38UcjvLGRAnnwC5hDt35ZC91ZwnvWipNOAOSaQNT32uKYL/TVCT3tncB9L1D++LOmBbYhTYP4TLuuQ== +"@jest/environment@^29.1.2": + version "29.1.2" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.1.2.tgz#bb51a43fce9f960ba9a48f0b5b556f30618ebc0a" + integrity sha512-rG7xZ2UeOfvOVzoLIJ0ZmvPl4tBEQ2n73CZJSlzUjPw4or1oSWC0s0Rk0ZX+pIBJ04aVr6hLWFn1DFtrnf8MhQ== dependencies: - "@jest/fake-timers" "^29.1.1" - "@jest/types" "^29.1.0" + "@jest/fake-timers" "^29.1.2" + "@jest/types" "^29.1.2" "@types/node" "*" - jest-mock "^29.1.1" + jest-mock "^29.1.2" -"@jest/expect-utils@^29.1.0": - version "29.1.0" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.1.0.tgz#598cc7fea83b1bf84249b3b98683575cee888894" - integrity sha512-YcD5CF2beqfoB07WqejPzWq1/l+zT3SgGwcqqIaPPG1DHFn/ea8MWWXeqV3KKMhTaOM1rZjlYplj1GQxR0XxKA== +"@jest/expect-utils@^29.1.2": + version "29.1.2" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.1.2.tgz#66dbb514d38f7d21456bc774419c9ae5cca3f88d" + integrity sha512-4a48bhKfGj/KAH39u0ppzNTABXQ8QPccWAFUFobWBaEMSMp+sB31Z2fK/l47c4a/Mu1po2ffmfAIPxXbVTXdtg== dependencies: jest-get-type "^29.0.0" -"@jest/expect@^29.1.0": - version "29.1.0" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.1.0.tgz#58956d38c22f42a2ec7ecf7adb9e0ddd9a9082a3" - integrity sha512-qWQttxE5rEwzvDW9G3f0o8chu1EKvIfsMQDeRlXMLCtsDS94ckcqEMNgbKKz0NYlZ45xrIoy+/pngt3ZFr/2zw== +"@jest/expect@^29.1.2": + version "29.1.2" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.1.2.tgz#334a86395f621f1ab63ad95b06a588b9114d7b7a" + integrity sha512-FXw/UmaZsyfRyvZw3M6POgSNqwmuOXJuzdNiMWW9LCYo0GRoRDhg+R5iq5higmRTHQY7hx32+j7WHwinRmoILQ== dependencies: - expect "^29.1.0" - jest-snapshot "^29.1.0" + expect "^29.1.2" + jest-snapshot "^29.1.2" -"@jest/fake-timers@^29.1.1": - version "29.1.1" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.1.1.tgz#ae345e5ca51e9f72e0d861e17c65d9cb558f407b" - integrity sha512-5wTGObRfL/OjzEz0v2ShXlzeJFJw8mO6ByMBwmPLd6+vkdPcmIpCvASG/PR/g8DpchSIEeDXCxQADojHxuhX8g== +"@jest/fake-timers@^29.1.2": + version "29.1.2" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.1.2.tgz#f157cdf23b4da48ce46cb00fea28ed1b57fc271a" + integrity sha512-GppaEqS+QQYegedxVMpCe2xCXxxeYwQ7RsNx55zc8f+1q1qevkZGKequfTASI7ejmg9WwI+SJCrHe9X11bLL9Q== dependencies: - "@jest/types" "^29.1.0" + "@jest/types" "^29.1.2" "@sinonjs/fake-timers" "^9.1.2" "@types/node" "*" - jest-message-util "^29.1.0" - jest-mock "^29.1.1" - jest-util "^29.1.0" + jest-message-util "^29.1.2" + jest-mock "^29.1.2" + jest-util "^29.1.2" -"@jest/globals@^29.1.1": - version "29.1.1" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.1.1.tgz#017cffa0e79b35e7197b229d852c9ad35ed4be5c" - integrity sha512-yTiusxeEHjXwmo3guWlN31a1harU8zekLBMlZpOZ+84rfO3HDrkNZLTfd/YaHF8CrwlNCFpDGNSQCH8WkklH/Q== +"@jest/globals@^29.1.2": + version "29.1.2" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.1.2.tgz#826ede84bc280ae7f789cb72d325c48cd048b9d3" + integrity sha512-uMgfERpJYoQmykAd0ffyMq8wignN4SvLUG6orJQRe9WAlTRc9cdpCaE/29qurXixYJVZWUqIBXhSk8v5xN1V9g== dependencies: - "@jest/environment" "^29.1.1" - "@jest/expect" "^29.1.0" - "@jest/types" "^29.1.0" - jest-mock "^29.1.1" + "@jest/environment" "^29.1.2" + "@jest/expect" "^29.1.2" + "@jest/types" "^29.1.2" + jest-mock "^29.1.2" -"@jest/reporters@^29.1.0": - version "29.1.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.1.0.tgz#da488ddfb39a4cfb86abdc29fd94f84031acfd02" - integrity sha512-szSjHjVuBQ7aZUdBzTicCoQAAQsQFLk+/PtMfO0RQxL5mQ1iw+PSKOpyvMZcA5T6bH9pIapue5U9UCrxfOtL3w== +"@jest/reporters@^29.1.2": + version "29.1.2" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.1.2.tgz#5520898ed0a4ecf69d8b671e1dc8465d0acdfa6e" + integrity sha512-X4fiwwyxy9mnfpxL0g9DD0KcTmEIqP0jUdnc2cfa9riHy+I6Gwwp5vOZiwyg0vZxfSDxrOlK9S4+340W4d+DAA== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.1.0" - "@jest/test-result" "^29.1.0" - "@jest/transform" "^29.1.0" - "@jest/types" "^29.1.0" + "@jest/console" "^29.1.2" + "@jest/test-result" "^29.1.2" + "@jest/transform" "^29.1.2" + "@jest/types" "^29.1.2" "@jridgewell/trace-mapping" "^0.3.15" "@types/node" "*" chalk "^4.0.0" @@ -468,9 +468,9 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^29.1.0" - jest-util "^29.1.0" - jest-worker "^29.1.0" + jest-message-util "^29.1.2" + jest-util "^29.1.2" + jest-worker "^29.1.2" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" @@ -493,51 +493,51 @@ callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^29.1.0": - version "29.1.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.1.0.tgz#da6b0062325a780c9e3c7262b6b89da57fba2dca" - integrity sha512-RMBhPlw1Qfc2bKSf3RFPCyFSN7cfWVSTxRD8JrnvqdqgaDgrq4aGJT1A/V2+5Vq9bqBd187FpaxGTQ4zLrt08g== +"@jest/test-result@^29.1.2": + version "29.1.2" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.1.2.tgz#6a8d006eb2b31ce0287d1fc10d12b8ff8504f3c8" + integrity sha512-jjYYjjumCJjH9hHCoMhA8PCl1OxNeGgAoZ7yuGYILRJX9NjgzTN0pCT5qAoYR4jfOP8htIByvAlz9vfNSSBoVg== dependencies: - "@jest/console" "^29.1.0" - "@jest/types" "^29.1.0" + "@jest/console" "^29.1.2" + "@jest/types" "^29.1.2" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.1.0": - version "29.1.0" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.1.0.tgz#d3d34497e860a44f3f80e94958651f58d3ce64f8" - integrity sha512-1diQfwNhBAte+x3TmyfWloxT1C8GcPEPEZ4BZjmELBK2j3cdqi0DofoJUxBDDUBBnakbv8ce0B7CIzprsupPSA== +"@jest/test-sequencer@^29.1.2": + version "29.1.2" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.1.2.tgz#10bfd89c08bfdba382eb05cc79c1d23a01238a93" + integrity sha512-fU6dsUqqm8sA+cd85BmeF7Gu9DsXVWFdGn9taxM6xN1cKdcP/ivSgXh5QucFRFz1oZxKv3/9DYYbq0ULly3P/Q== dependencies: - "@jest/test-result" "^29.1.0" + "@jest/test-result" "^29.1.2" graceful-fs "^4.2.9" - jest-haste-map "^29.1.0" + jest-haste-map "^29.1.2" slash "^3.0.0" -"@jest/transform@^29.1.0": - version "29.1.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.1.0.tgz#1b3e597681362f6164e786e6bc2826c34ecbf74f" - integrity sha512-NI1zd62KgM0lW6rWMIZDx52dfTIDd+cnLQNahH0YhH7TVmQVigumJ6jszuhAzvKHGm55P2Fozcglb5sGMfFp3Q== +"@jest/transform@^29.1.2": + version "29.1.2" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.1.2.tgz#20f814696e04f090421f6d505c14bbfe0157062a" + integrity sha512-2uaUuVHTitmkx1tHF+eBjb4p7UuzBG7SXIaA/hNIkaMP6K+gXYGxP38ZcrofzqN0HeZ7A90oqsOa97WU7WZkSw== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^29.1.0" + "@jest/types" "^29.1.2" "@jridgewell/trace-mapping" "^0.3.15" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.1.0" + jest-haste-map "^29.1.2" jest-regex-util "^29.0.0" - jest-util "^29.1.0" + jest-util "^29.1.2" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" write-file-atomic "^4.0.1" -"@jest/types@^29.1.0": - version "29.1.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.1.0.tgz#db23d727ce0a95500749551d8724fb3526d1e903" - integrity sha512-lE30u3z4lbTOqf5D7fDdoco3Qd8H6F/t73nLOswU4x+7VhgDQMX5y007IMqrKjFHdnpslaYymVFhWX+ttXNARQ== +"@jest/types@^29.1.2": + version "29.1.2" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.1.2.tgz#7442d32b16bcd7592d9614173078b8c334ec730a" + integrity sha512-DcXGtoTykQB5jiwCmVr8H4vdg2OJhQex3qPkG+ISyDO7xQXbt/4R6dowcRyPemRnkH7JoHvZuxPBdlq+9JxFCg== dependencies: "@jest/schemas" "^29.0.0" "@types/istanbul-lib-coverage" "^2.0.0" @@ -810,12 +810,12 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^29.1.0: - version "29.1.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.1.0.tgz#945e45eb8a33e8ad8cb334f2b0f040d7306cffbf" - integrity sha512-0XiBgPRhMSng+ThuXz0M/WpOeml/q5S4BFIaDS5uQb+lCjOzd0OfYEN4hWte5fDy7SZ6rNmEi16UpWGurSg2nQ== +babel-jest@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.1.2.tgz#540d3241925c55240fb0c742e3ffc5f33a501978" + integrity sha512-IuG+F3HTHryJb7gacC7SQ59A9kO56BctUsT67uJHp1mMCHUOMXpDwOHWGifWqdWVknN2WNkCVQELPjXx0aLJ9Q== dependencies: - "@jest/transform" "^29.1.0" + "@jest/transform" "^29.1.2" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" babel-preset-jest "^29.0.2" @@ -1280,16 +1280,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^29.1.0: - version "29.1.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.1.0.tgz#0e20a72cf4b2cfb8ca5e2ab138c23c5078c37460" - integrity sha512-1NCfR0FEArn9Vq1KEjhPd1rggRLiWgo87gfMK4iKn6DcVzJBRMyDNX22hyND5KiSRPIPQ5KtsY6HLxsQ0MU86w== +expect@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.1.2.tgz#82f8f28d7d408c7c68da3a386a490ee683e1eced" + integrity sha512-AuAGn1uxva5YBbBlXb+2JPxJRuemZsmlGcapPXWNSBNsQtAULfjioREGBWuI0EOvYUKjDnrCy8PW5Zlr1md5mw== dependencies: - "@jest/expect-utils" "^29.1.0" + "@jest/expect-utils" "^29.1.2" jest-get-type "^29.0.0" - jest-matcher-utils "^29.1.0" - jest-message-util "^29.1.0" - jest-util "^29.1.0" + jest-matcher-utils "^29.1.2" + jest-message-util "^29.1.2" + jest-util "^29.1.2" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1651,86 +1651,86 @@ jest-changed-files@^29.0.0: execa "^5.0.0" p-limit "^3.1.0" -jest-circus@^29.1.1: - version "29.1.1" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.1.1.tgz#696e0b58351316f5fdb39d3480b4fffe8dbf0100" - integrity sha512-Ii+3JIeLF3z8j2E7fPSjPjXJLBdbAcZyfEiALRQ1Fk+FWTIfuEfZrZcjSaBdz/k/waoq+bPf9x/vBCXIAyLLEQ== +jest-circus@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.1.2.tgz#4551068e432f169a53167fe1aef420cf51c8a735" + integrity sha512-ajQOdxY6mT9GtnfJRZBRYS7toNIJayiiyjDyoZcnvPRUPwJ58JX0ci0PKAKUo2C1RyzlHw0jabjLGKksO42JGA== dependencies: - "@jest/environment" "^29.1.1" - "@jest/expect" "^29.1.0" - "@jest/test-result" "^29.1.0" - "@jest/types" "^29.1.0" + "@jest/environment" "^29.1.2" + "@jest/expect" "^29.1.2" + "@jest/test-result" "^29.1.2" + "@jest/types" "^29.1.2" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" is-generator-fn "^2.0.0" - jest-each "^29.1.0" - jest-matcher-utils "^29.1.0" - jest-message-util "^29.1.0" - jest-runtime "^29.1.1" - jest-snapshot "^29.1.0" - jest-util "^29.1.0" + jest-each "^29.1.2" + jest-matcher-utils "^29.1.2" + jest-message-util "^29.1.2" + jest-runtime "^29.1.2" + jest-snapshot "^29.1.2" + jest-util "^29.1.2" p-limit "^3.1.0" - pretty-format "^29.1.0" + pretty-format "^29.1.2" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.1.1: - version "29.1.1" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.1.1.tgz#6ff79c0b2d1d062f24216d2bcbf6c01a1e41db21" - integrity sha512-nz/JNtqDFf49R2KgeZ9+6Zl1uxSuRsg/tICC+DHMh+bQ0co6QqBPWKg3FtW4534bs8/J2YqFC2Lct9DZR24z0Q== +jest-cli@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.1.2.tgz#423b9c5d3ea20a50b1354b8bf3f2a20e72110e89" + integrity sha512-vsvBfQ7oS2o4MJdAH+4u9z76Vw5Q8WBQF5MchDbkylNknZdrPTX1Ix7YRJyTlOWqRaS7ue/cEAn+E4V1MWyMzw== dependencies: - "@jest/core" "^29.1.1" - "@jest/test-result" "^29.1.0" - "@jest/types" "^29.1.0" + "@jest/core" "^29.1.2" + "@jest/test-result" "^29.1.2" + "@jest/types" "^29.1.2" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.1.1" - jest-util "^29.1.0" - jest-validate "^29.1.0" + jest-config "^29.1.2" + jest-util "^29.1.2" + jest-validate "^29.1.2" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^29.1.1: - version "29.1.1" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.1.1.tgz#52aaa6237a7b3eea5c640aad6a53b390dc76f49f" - integrity sha512-o2iZrQMOiF54zOw1kOcJGmfKzAW+V2ajZVWxbt+Ex+g0fVaTkk215BD/GFhrviuic+Xk7DpzUmdTT9c1QfsPqg== +jest-config@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.1.2.tgz#7d004345ca4c09f5d8f802355f54494e90842f4d" + integrity sha512-EC3Zi86HJUOz+2YWQcJYQXlf0zuBhJoeyxLM6vb6qJsVmpP7KcCP1JnyF0iaqTaXdBP8Rlwsvs7hnKWQWWLwwA== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.1.0" - "@jest/types" "^29.1.0" - babel-jest "^29.1.0" + "@jest/test-sequencer" "^29.1.2" + "@jest/types" "^29.1.2" + babel-jest "^29.1.2" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^29.1.1" - jest-environment-node "^29.1.1" + jest-circus "^29.1.2" + jest-environment-node "^29.1.2" jest-get-type "^29.0.0" jest-regex-util "^29.0.0" - jest-resolve "^29.1.0" - jest-runner "^29.1.1" - jest-util "^29.1.0" - jest-validate "^29.1.0" + jest-resolve "^29.1.2" + jest-runner "^29.1.2" + jest-util "^29.1.2" + jest-validate "^29.1.2" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^29.1.0" + pretty-format "^29.1.2" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^29.1.0: - version "29.1.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.1.0.tgz#952639cd73fcf4d34173e2d98a0cd1c20c71ba88" - integrity sha512-ZJyWG30jpVHwxLs8xxR1so4tz6lFARNztnFlxssFpQdakaW0isSx9rAKs/6aQUKQDZ/DgSpY6HjUGLO9xkNdRw== +jest-diff@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.1.2.tgz#bb7aaf5353227d6f4f96c5e7e8713ce576a607dc" + integrity sha512-4GQts0aUopVvecIT4IwD/7xsBaMhKTYoM4/njE/aVw9wpw+pIUVp8Vab/KnSzSilr84GnLBkaP3JLDnQYCKqVQ== dependencies: chalk "^4.0.0" diff-sequences "^29.0.0" jest-get-type "^29.0.0" - pretty-format "^29.1.0" + pretty-format "^29.1.2" jest-docblock@^29.0.0: version "29.0.0" @@ -1739,94 +1739,94 @@ jest-docblock@^29.0.0: dependencies: detect-newline "^3.0.0" -jest-each@^29.1.0: - version "29.1.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.1.0.tgz#d0962d04f4a28f5f048c2ff50965cab9ae2f524d" - integrity sha512-ELSZV/L4yjqKU2O0bnDTNHlizD4IRS9DX94iAB6QpiPIJsR453dJW7Ka7TXSmxQdc66HNNOhUcQ5utIeVCKGyA== +jest-each@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.1.2.tgz#d4c8532c07a846e79f194f7007ce7cb1987d1cd0" + integrity sha512-AmTQp9b2etNeEwMyr4jc0Ql/LIX/dhbgP21gHAizya2X6rUspHn2gysMXaj6iwWuOJ2sYRgP8c1P4cXswgvS1A== dependencies: - "@jest/types" "^29.1.0" + "@jest/types" "^29.1.2" chalk "^4.0.0" jest-get-type "^29.0.0" - jest-util "^29.1.0" - pretty-format "^29.1.0" + jest-util "^29.1.2" + pretty-format "^29.1.2" -jest-environment-node@^29.1.1: - version "29.1.1" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.1.1.tgz#10f1782b74e17fcf782ff51df79f2b0cee135851" - integrity sha512-0nwTca4L2N8iM33A+JMfBdygR6B3N/bcPoLe1hEd9o87KLxDZwKGvpTGSfXpjtyqNQXiaL/3G+YOcSoeq/syPw== +jest-environment-node@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.1.2.tgz#005e05cc6ea4b9b5ba55906ab1ce53c82f6907a7" + integrity sha512-C59yVbdpY8682u6k/lh8SUMDJPbOyCHOTgLVVi1USWFxtNV+J8fyIwzkg+RJIVI30EKhKiAGNxYaFr3z6eyNhQ== dependencies: - "@jest/environment" "^29.1.1" - "@jest/fake-timers" "^29.1.1" - "@jest/types" "^29.1.0" + "@jest/environment" "^29.1.2" + "@jest/fake-timers" "^29.1.2" + "@jest/types" "^29.1.2" "@types/node" "*" - jest-mock "^29.1.1" - jest-util "^29.1.0" + jest-mock "^29.1.2" + jest-util "^29.1.2" jest-get-type@^29.0.0: version "29.0.0" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.0.0.tgz#843f6c50a1b778f7325df1129a0fd7aa713aef80" integrity sha512-83X19z/HuLKYXYHskZlBAShO7UfLFXu/vWajw9ZNJASN32li8yHMaVGAQqxFW1RCFOkB7cubaL6FaJVQqqJLSw== -jest-haste-map@^29.1.0: - version "29.1.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.1.0.tgz#1cbdd30528b7b215523166cec3718600a3328ad1" - integrity sha512-qn+QVZ6JHzzx6g8XrMrNNvvIWrgVT6FzOoxTP5hQ1vEu6r9use2gOb0sSeC3Xle7eaDLN4DdAazSKnWskK3B/g== +jest-haste-map@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.1.2.tgz#93f3634aa921b6b654e7c94137b24e02e7ca6ac9" + integrity sha512-xSjbY8/BF11Jh3hGSPfYTa/qBFrm3TPM7WU8pU93m2gqzORVLkHFWvuZmFsTEBPRKndfewXhMOuzJNHyJIZGsw== dependencies: - "@jest/types" "^29.1.0" + "@jest/types" "^29.1.2" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" jest-regex-util "^29.0.0" - jest-util "^29.1.0" - jest-worker "^29.1.0" + jest-util "^29.1.2" + jest-worker "^29.1.2" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^29.1.0: - version "29.1.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.1.0.tgz#6b7067d383dbf0804f21e16426d8562d84f19340" - integrity sha512-7ZdlIA2UXBIzXBNadta7pohrrvbD/Jp5T55Ux2DE1BSGul4RglIPHt7cZ0V3ll+ppBC1pGaBiWPBfLcQ2dDc3Q== +jest-leak-detector@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.1.2.tgz#4c846db14c58219430ccbc4f01a1ec52ebee4fc2" + integrity sha512-TG5gAZJpgmZtjb6oWxBLf2N6CfQ73iwCe6cofu/Uqv9iiAm6g502CAnGtxQaTfpHECBdVEMRBhomSXeLnoKjiQ== dependencies: jest-get-type "^29.0.0" - pretty-format "^29.1.0" + pretty-format "^29.1.2" -jest-matcher-utils@^29.1.0: - version "29.1.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.1.0.tgz#60f53cc199921ece9170d3d20500ae0b93294928" - integrity sha512-pfthsLu27kZg+T1XTUGvox0r3gP3KtqdMPliVd/bs6iDrZ9Z6yJgLbw6zNc4DHtCcyzq9UW0jmszCX8DdFU/wA== +jest-matcher-utils@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.1.2.tgz#e68c4bcc0266e70aa1a5c13fb7b8cd4695e318a1" + integrity sha512-MV5XrD3qYSW2zZSHRRceFzqJ39B2z11Qv0KPyZYxnzDHFeYZGJlgGi0SW+IXSJfOewgJp/Km/7lpcFT+cgZypw== dependencies: chalk "^4.0.0" - jest-diff "^29.1.0" + jest-diff "^29.1.2" jest-get-type "^29.0.0" - pretty-format "^29.1.0" + pretty-format "^29.1.2" -jest-message-util@^29.1.0: - version "29.1.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.1.0.tgz#0bb50a8064aa49999a6c313827e43bf51bd71dd1" - integrity sha512-NzGXD9wgCxUy20sIvyOsSA/KzQmkmagOVGE5LnT2juWn+hB88gCQr8N/jpu34CXRIXmV7INwrQVVwhnh72pY5A== +jest-message-util@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.1.2.tgz#c21a33c25f9dc1ebfcd0f921d89438847a09a501" + integrity sha512-9oJ2Os+Qh6IlxLpmvshVbGUiSkZVc2FK+uGOm6tghafnB2RyjKAxMZhtxThRMxfX1J1SOMhTn9oK3/MutRWQJQ== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.1.0" + "@jest/types" "^29.1.2" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^29.1.0" + pretty-format "^29.1.2" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^29.1.1: - version "29.1.1" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.1.1.tgz#b5475d07a8db6d39fe73e960ca94a3ac761afe0d" - integrity sha512-vDe56JmImqt3j8pHcEIkahQbSCnBS49wda0spIl0bkrIM7VDZXjKaes6W28vKZye0atNAcFaj3dxXh0XWjBW4Q== +jest-mock@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.1.2.tgz#de47807edbb9d4abf8423f1d8d308d670105678c" + integrity sha512-PFDAdjjWbjPUtQPkQufvniXIS3N9Tv7tbibePEjIIprzjgo0qQlyUiVMrT4vL8FaSJo1QXifQUOuPH3HQC/aMA== dependencies: - "@jest/types" "^29.1.0" + "@jest/types" "^29.1.2" "@types/node" "*" - jest-util "^29.1.0" + jest-util "^29.1.2" jest-pnp-resolver@^1.2.2: version "1.2.2" @@ -1838,88 +1838,88 @@ jest-regex-util@^29.0.0: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.0.0.tgz#b442987f688289df8eb6c16fa8df488b4cd007de" integrity sha512-BV7VW7Sy0fInHWN93MMPtlClweYv2qrSCwfeFWmpribGZtQPWNvRSq9XOVgOEjU1iBGRKXUZil0o2AH7Iy9Lug== -jest-resolve-dependencies@^29.1.1: - version "29.1.1" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.1.1.tgz#03104a866fb133cffd8a6fe7fc198b0de9a17232" - integrity sha512-AMRTJyiK8caRXq3pa9i4oXX6yH+am5v0HwCUq1yk9lxI3ARihyT2OfEySJJo3ER7xpxf3b6isfp1sO6PQY3N0Q== +jest-resolve-dependencies@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.1.2.tgz#a6919e58a0c7465582cb8ec2d745b4e64ae8647f" + integrity sha512-44yYi+yHqNmH3OoWZvPgmeeiwKxhKV/0CfrzaKLSkZG9gT973PX8i+m8j6pDrTYhhHoiKfF3YUFg/6AeuHw4HQ== dependencies: jest-regex-util "^29.0.0" - jest-snapshot "^29.1.0" + jest-snapshot "^29.1.2" -jest-resolve@^29.1.0: - version "29.1.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.1.0.tgz#114d2a86f6ff07e1cc56dbe84deb9d6e058b4399" - integrity sha512-0IETuMI58nbAWwCrtX1QQmenstlWOEdwNS5FXxpEMAs6S5tttFiEoXUwGTAiI152nqoWRUckAgt21FP4wqeZWA== +jest-resolve@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.1.2.tgz#9dd8c2fc83e59ee7d676b14bd45a5f89e877741d" + integrity sha512-7fcOr+k7UYSVRJYhSmJHIid3AnDBcLQX3VmT9OSbPWsWz1MfT7bcoerMhADKGvKCoMpOHUQaDHtQoNp/P9JMGg== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^29.1.0" + jest-haste-map "^29.1.2" jest-pnp-resolver "^1.2.2" - jest-util "^29.1.0" - jest-validate "^29.1.0" + jest-util "^29.1.2" + jest-validate "^29.1.2" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^29.1.1: - version "29.1.1" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.1.1.tgz#4ababc79ec3ec654de33db093ca2ec78599fa7ad" - integrity sha512-HqazsMPXB62Zi2oJEl+Ta9aUWAaR4WdT7ow25pcS99PkOsWQoYH+yyaKbAHBUf8NOqPbZ8T4Q8gt8ZBFEJJdVQ== +jest-runner@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.1.2.tgz#f18b2b86101341e047de8c2f51a5fdc4e97d053a" + integrity sha512-yy3LEWw8KuBCmg7sCGDIqKwJlULBuNIQa2eFSVgVASWdXbMYZ9H/X0tnXt70XFoGf92W2sOQDOIFAA6f2BG04Q== dependencies: - "@jest/console" "^29.1.0" - "@jest/environment" "^29.1.1" - "@jest/test-result" "^29.1.0" - "@jest/transform" "^29.1.0" - "@jest/types" "^29.1.0" + "@jest/console" "^29.1.2" + "@jest/environment" "^29.1.2" + "@jest/test-result" "^29.1.2" + "@jest/transform" "^29.1.2" + "@jest/types" "^29.1.2" "@types/node" "*" chalk "^4.0.0" emittery "^0.10.2" graceful-fs "^4.2.9" jest-docblock "^29.0.0" - jest-environment-node "^29.1.1" - jest-haste-map "^29.1.0" - jest-leak-detector "^29.1.0" - jest-message-util "^29.1.0" - jest-resolve "^29.1.0" - jest-runtime "^29.1.1" - jest-util "^29.1.0" - jest-watcher "^29.1.0" - jest-worker "^29.1.0" + jest-environment-node "^29.1.2" + jest-haste-map "^29.1.2" + jest-leak-detector "^29.1.2" + jest-message-util "^29.1.2" + jest-resolve "^29.1.2" + jest-runtime "^29.1.2" + jest-util "^29.1.2" + jest-watcher "^29.1.2" + jest-worker "^29.1.2" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^29.1.1: - version "29.1.1" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.1.1.tgz#54a4cc4665d5c86f072f3f8fe3f9ec83d3802c8b" - integrity sha512-DA2nW5GUAEFUOFztVqX6BOHbb1tUO1iDzlx+bOVdw870UIkv09u3P5nTfK3N+xtqy/fGlLsg7UCzhpEJnwKilg== +jest-runtime@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.1.2.tgz#dbcd57103d61115479108d5864bdcd661d9c6783" + integrity sha512-jr8VJLIf+cYc+8hbrpt412n5jX3tiXmpPSYTGnwcvNemY+EOuLNiYnHJ3Kp25rkaAcTWOEI4ZdOIQcwYcXIAZw== dependencies: - "@jest/environment" "^29.1.1" - "@jest/fake-timers" "^29.1.1" - "@jest/globals" "^29.1.1" + "@jest/environment" "^29.1.2" + "@jest/fake-timers" "^29.1.2" + "@jest/globals" "^29.1.2" "@jest/source-map" "^29.0.0" - "@jest/test-result" "^29.1.0" - "@jest/transform" "^29.1.0" - "@jest/types" "^29.1.0" + "@jest/test-result" "^29.1.2" + "@jest/transform" "^29.1.2" + "@jest/types" "^29.1.2" "@types/node" "*" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^29.1.0" - jest-message-util "^29.1.0" - jest-mock "^29.1.1" + jest-haste-map "^29.1.2" + jest-message-util "^29.1.2" + jest-mock "^29.1.2" jest-regex-util "^29.0.0" - jest-resolve "^29.1.0" - jest-snapshot "^29.1.0" - jest-util "^29.1.0" + jest-resolve "^29.1.2" + jest-snapshot "^29.1.2" + jest-util "^29.1.2" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.1.0: - version "29.1.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.1.0.tgz#9da20c1c504a41e79abcbfecced090325b3cdba1" - integrity sha512-nHZoA+hpbFlkyV8uLoLJQ/80DLi3c6a5zeELgfSZ5bZj+eljqULr79KBQakp5xyH3onezf4k+K+2/Blk5/1O+g== +jest-snapshot@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.1.2.tgz#7dd277e88c45f2d2ff5888de1612e63c7ceb575b" + integrity sha512-rYFomGpVMdBlfwTYxkUp3sjD6usptvZcONFYNqVlaz4EpHPnDvlWjvmOQ9OCSNKqYZqLM2aS3wq01tWujLg7gg== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" @@ -1927,81 +1927,82 @@ jest-snapshot@^29.1.0: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.1.0" - "@jest/transform" "^29.1.0" - "@jest/types" "^29.1.0" + "@jest/expect-utils" "^29.1.2" + "@jest/transform" "^29.1.2" + "@jest/types" "^29.1.2" "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.1.0" + expect "^29.1.2" graceful-fs "^4.2.9" - jest-diff "^29.1.0" + jest-diff "^29.1.2" jest-get-type "^29.0.0" - jest-haste-map "^29.1.0" - jest-matcher-utils "^29.1.0" - jest-message-util "^29.1.0" - jest-util "^29.1.0" + jest-haste-map "^29.1.2" + jest-matcher-utils "^29.1.2" + jest-message-util "^29.1.2" + jest-util "^29.1.2" natural-compare "^1.4.0" - pretty-format "^29.1.0" + pretty-format "^29.1.2" semver "^7.3.5" -jest-util@^29.1.0: - version "29.1.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.1.0.tgz#e8a971dfb900bb85f090c752aa321b6912e81002" - integrity sha512-5haD8egMAEAq/e8ritN2Gr1WjLYtXi4udAIZB22GnKlv/2MHkbCjcyjgDBmyezAMMeQKGfoaaDsWCmVlnHZ1WQ== +jest-util@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.1.2.tgz#ac5798e93cb6a6703084e194cfa0898d66126df1" + integrity sha512-vPCk9F353i0Ymx3WQq3+a4lZ07NXu9Ca8wya6o4Fe4/aO1e1awMMprZ3woPFpKwghEOW+UXgd15vVotuNN9ONQ== dependencies: - "@jest/types" "^29.1.0" + "@jest/types" "^29.1.2" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^29.1.0: - version "29.1.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.1.0.tgz#5e2ba89d7d6b3e4d3ece34024f317e956a5c85c0" - integrity sha512-EQKRweSxmIJelCdirpuVkeCS1rSNXJFtSGEeSRFwH39QGioy7qKRSY8XBB4qFiappbsvgHnH0V6Iq5ASs11knA== +jest-validate@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.1.2.tgz#83a728b8f6354da2e52346878c8bc7383516ca51" + integrity sha512-k71pOslNlV8fVyI+mEySy2pq9KdXdgZtm7NHrBX8LghJayc3wWZH0Yr0mtYNGaCU4F1OLPXRkwZR0dBm/ClshA== dependencies: - "@jest/types" "^29.1.0" + "@jest/types" "^29.1.2" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^29.0.0" leven "^3.1.0" - pretty-format "^29.1.0" + pretty-format "^29.1.2" -jest-watcher@^29.1.0: - version "29.1.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.1.0.tgz#4a9f9d2c9bb9115f7b543c26f468d2c0c0202506" - integrity sha512-JXw7+VpLSf+2yfXlux1/xR65fMn//0pmiXd6EtQWySS9233aA+eGS+8Y5o2imiJ25JBKdG8T45+s78CNQ71Fbg== +jest-watcher@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.1.2.tgz#de21439b7d889e2fcf62cc2a4779ef1a3f1f3c62" + integrity sha512-6JUIUKVdAvcxC6bM8/dMgqY2N4lbT+jZVsxh0hCJRbwkIEnbr/aPjMQ28fNDI5lB51Klh00MWZZeVf27KBUj5w== dependencies: - "@jest/test-result" "^29.1.0" - "@jest/types" "^29.1.0" + "@jest/test-result" "^29.1.2" + "@jest/types" "^29.1.2" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.10.2" - jest-util "^29.1.0" + jest-util "^29.1.2" string-length "^4.0.1" -jest-worker@^29.1.0: - version "29.1.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.1.0.tgz#374d741b976a868e39141d63fb401abacc07a8c9" - integrity sha512-yr7RFRAxI+vhL/cGB9B0FhD+QfaWh1qSxurx7gLP16dfmqhG8w75D/CQFU8ZetvhiQqLZh8X0C4rxwsZy6HITQ== +jest-worker@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.1.2.tgz#a68302af61bce82b42a9a57285ca7499d29b2afc" + integrity sha512-AdTZJxKjTSPHbXT/AIOjQVmoFx0LHFcVabWu0sxI7PAy7rFf8c0upyvgBKgguVXdM4vY74JdwkyD4hSmpTW8jA== dependencies: "@types/node" "*" + jest-util "^29.1.2" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^29.0.0: - version "29.1.1" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.1.1.tgz#22d9d828f01335ec17225bcb267fe669319983be" - integrity sha512-Doe41PZ8MvGLtOZIW2RIVu94wa7jm/N775BBloVXk/G/vV6VYnDCOxBwrqekEgrd3Pn/bv8b5UdB2x0pAoQpwQ== + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.1.2.tgz#f821a1695ffd6cd0efc3b59d2dfcc70a98582499" + integrity sha512-5wEIPpCezgORnqf+rCaYD1SK+mNN7NsstWzIsuvsnrhR/hSxXWd82oI7DkrbJ+XTD28/eG8SmxdGvukrGGK6Tw== dependencies: - "@jest/core" "^29.1.1" - "@jest/types" "^29.1.0" + "@jest/core" "^29.1.2" + "@jest/types" "^29.1.2" import-local "^3.0.2" - jest-cli "^29.1.1" + jest-cli "^29.1.2" js-sdsl@^4.1.4: version "4.1.4" @@ -2327,10 +2328,10 @@ prettier@>=2.3.0: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== -pretty-format@^29.1.0: - version "29.1.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.1.0.tgz#ea3de2feed5b8d19c537a12fe478ddc8b45da6b8" - integrity sha512-dZ21z0UjKVSiEkrPAt2nJnGfrtYMFBlNW4wTkJsIp9oB5A8SUQ8DuJ9EUgAvYyNfMeoGmKiDnpJvM489jkzdSQ== +pretty-format@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.1.2.tgz#b1f6b75be7d699be1a051f5da36e8ae9e76a8e6a" + integrity sha512-CGJ6VVGXVRP2o2Dorl4mAwwvDWT25luIsYhkyVQW32E4nL+TgW939J7LlKT/npq5Cpq6j3s+sy+13yk7xYpBmg== dependencies: "@jest/schemas" "^29.0.0" ansi-styles "^5.0.0" From 6c781dd3f0d7c4afe3431a2de219f46babc76032 Mon Sep 17 00:00:00 2001 From: Oriol Gual Date: Wed, 5 Oct 2022 11:53:49 +0200 Subject: [PATCH 644/785] Use process.execPath instead of "node" When using nvm it seems that `spawnSync` can't find the node binary and the commands just fail awkwardly (spawnSync doesn't let us know it couldn't find the command). Related to https://github.com/prettier/plugin-ruby/issues/113 --- src/parseSync.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/parseSync.js b/src/parseSync.js index 9d89db6b..7d3dc59b 100644 --- a/src/parseSync.js +++ b/src/parseSync.js @@ -169,7 +169,7 @@ function spawnServer(opts) { } }); - const info = spawnSync("node", [getInfoJsPath, filepath]); + const info = spawnSync(process.execPath, [getInfoJsPath, filepath]); if (info.status !== 0) { throw new Error(` @@ -200,7 +200,8 @@ function parseSync(parser, source, opts) { parserArgs = spawnServer(opts); } - const response = spawnSync(parserArgs.cmd, parserArgs.args, { + const command = parserArgs.cmd === "node" ? process.execPath : parserArgs.cmd; + const response = spawnSync(command, parserArgs.args, { input: `${parser}|${opts.printWidth}|${opts.tabWidth}|${source}`, maxBuffer: 15 * 1024 * 1024 }); From 4b4375043b1260569400f11db1f4a86f41bf5605 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Oct 2022 12:01:10 +0000 Subject: [PATCH 645/785] Bump eslint from 8.24.0 to 8.25.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.24.0 to 8.25.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.24.0...v8.25.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5cda0ff1..9b17d2a6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -298,10 +298,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@eslint/eslintrc@^1.3.2": - version "1.3.2" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.2.tgz#58b69582f3b7271d8fa67fe5251767a5b38ea356" - integrity sha512-AXYd23w1S/bv3fTs3Lz0vjiYemS08jWkI3hYyS9I1ry+0f+Yjs1wm+sU0BS8qDOPrBIkp4qHYC16I8uVtpLajQ== +"@eslint/eslintrc@^1.3.3": + version "1.3.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.3.tgz#2b044ab39fdfa75b4688184f9e573ce3c5b0ff95" + integrity sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg== dependencies: ajv "^6.12.4" debug "^4.3.2" @@ -322,11 +322,6 @@ debug "^4.1.1" minimatch "^3.0.4" -"@humanwhocodes/gitignore-to-minimatch@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz#316b0a63b91c10e53f242efb4ace5c3b34e8728d" - integrity sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA== - "@humanwhocodes/module-importer@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" @@ -1163,13 +1158,12 @@ eslint-visitor-keys@^3.3.0: integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.15.0: - version "8.24.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.24.0.tgz#489516c927a5da11b3979dbfb2679394523383c8" - integrity sha512-dWFaPhGhTAiPcCgm3f6LI2MBWbogMnTJzFBbhXVRQDJPkr9pGZvVjlVfXd+vyDcWPA2Ic9L2AXPIQM0+vk/cSQ== + version "8.25.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.25.0.tgz#00eb962f50962165d0c4ee3327708315eaa8058b" + integrity sha512-DVlJOZ4Pn50zcKW5bYH7GQK/9MsoQG2d5eDH0ebEkE8PbgzTTmtt/VTH9GGJ4BfeZCpBLqFfvsjX35UacUL83A== dependencies: - "@eslint/eslintrc" "^1.3.2" + "@eslint/eslintrc" "^1.3.3" "@humanwhocodes/config-array" "^0.10.5" - "@humanwhocodes/gitignore-to-minimatch" "^1.0.2" "@humanwhocodes/module-importer" "^1.0.1" ajv "^6.10.0" chalk "^4.0.0" From a2f259edfd92e5c8ebe0e758ff340fd872b44d88 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Oct 2022 12:01:29 +0000 Subject: [PATCH 646/785] Bump jest from 29.1.2 to 29.2.0 Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.1.2 to 29.2.0. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.2.0/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 713 ++++++++++++++++++++++++++---------------------------- 1 file changed, 348 insertions(+), 365 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9b17d2a6..2c8220c5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -348,109 +348,109 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^29.1.2": - version "29.1.2" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.1.2.tgz#0ae975a70004696f8320490fcaa1a4152f7b62e4" - integrity sha512-ujEBCcYs82BTmRxqfHMQggSlkUZP63AE5YEaTPj7eFyJOzukkTorstOUC7L6nE3w5SYadGVAnTsQ/ZjTGL0qYQ== +"@jest/console@^29.2.0": + version "29.2.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.2.0.tgz#e906bdbfc83baf79590f05b515dad900b3b71fed" + integrity sha512-Xz1Wu+ZZxcB3RS8U3HdkFxlRJ7kLXI/by9X7d2/gvseIWPwYu/c1EsYy77cB5iyyHGOy3whS2HycjcuzIF4Jow== dependencies: - "@jest/types" "^29.1.2" + "@jest/types" "^29.2.0" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^29.1.2" - jest-util "^29.1.2" + jest-message-util "^29.2.0" + jest-util "^29.2.0" slash "^3.0.0" -"@jest/core@^29.1.2": - version "29.1.2" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.1.2.tgz#e5ce7a71e7da45156a96fb5eeed11d18b67bd112" - integrity sha512-sCO2Va1gikvQU2ynDN8V4+6wB7iVrD2CvT0zaRst4rglf56yLly0NQ9nuRRAWFeimRf+tCdFsb1Vk1N9LrrMPA== +"@jest/core@^29.2.0": + version "29.2.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.2.0.tgz#beed57c552be65d4e4ab2f4161d0abe8ea6bf3a8" + integrity sha512-+gyJ3bX+kGEW/eqt/0kI7fLjqiFr3AN8O+rlEl1fYRf7D8h4Sj4tBGo9YOSirvWgvemoH2EPRya35bgvcPFzHQ== dependencies: - "@jest/console" "^29.1.2" - "@jest/reporters" "^29.1.2" - "@jest/test-result" "^29.1.2" - "@jest/transform" "^29.1.2" - "@jest/types" "^29.1.2" + "@jest/console" "^29.2.0" + "@jest/reporters" "^29.2.0" + "@jest/test-result" "^29.2.0" + "@jest/transform" "^29.2.0" + "@jest/types" "^29.2.0" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" ci-info "^3.2.0" exit "^0.1.2" graceful-fs "^4.2.9" - jest-changed-files "^29.0.0" - jest-config "^29.1.2" - jest-haste-map "^29.1.2" - jest-message-util "^29.1.2" - jest-regex-util "^29.0.0" - jest-resolve "^29.1.2" - jest-resolve-dependencies "^29.1.2" - jest-runner "^29.1.2" - jest-runtime "^29.1.2" - jest-snapshot "^29.1.2" - jest-util "^29.1.2" - jest-validate "^29.1.2" - jest-watcher "^29.1.2" + jest-changed-files "^29.2.0" + jest-config "^29.2.0" + jest-haste-map "^29.2.0" + jest-message-util "^29.2.0" + jest-regex-util "^29.2.0" + jest-resolve "^29.2.0" + jest-resolve-dependencies "^29.2.0" + jest-runner "^29.2.0" + jest-runtime "^29.2.0" + jest-snapshot "^29.2.0" + jest-util "^29.2.0" + jest-validate "^29.2.0" + jest-watcher "^29.2.0" micromatch "^4.0.4" - pretty-format "^29.1.2" + pretty-format "^29.2.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.1.2": - version "29.1.2" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.1.2.tgz#bb51a43fce9f960ba9a48f0b5b556f30618ebc0a" - integrity sha512-rG7xZ2UeOfvOVzoLIJ0ZmvPl4tBEQ2n73CZJSlzUjPw4or1oSWC0s0Rk0ZX+pIBJ04aVr6hLWFn1DFtrnf8MhQ== +"@jest/environment@^29.2.0": + version "29.2.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.2.0.tgz#7e5604e4ead098572056a962a970f3d79379fbd8" + integrity sha512-foaVv1QVPB31Mno3LlL58PxEQQOLZd9zQfCpyQQCQIpUAtdFP1INBjkphxrCfKT13VxpA0z5jFGIkmZk0DAg2Q== dependencies: - "@jest/fake-timers" "^29.1.2" - "@jest/types" "^29.1.2" + "@jest/fake-timers" "^29.2.0" + "@jest/types" "^29.2.0" "@types/node" "*" - jest-mock "^29.1.2" + jest-mock "^29.2.0" -"@jest/expect-utils@^29.1.2": - version "29.1.2" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.1.2.tgz#66dbb514d38f7d21456bc774419c9ae5cca3f88d" - integrity sha512-4a48bhKfGj/KAH39u0ppzNTABXQ8QPccWAFUFobWBaEMSMp+sB31Z2fK/l47c4a/Mu1po2ffmfAIPxXbVTXdtg== +"@jest/expect-utils@^29.2.0": + version "29.2.0" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.2.0.tgz#3c0c472115d98211e7e0a0a8fa00719bf081987f" + integrity sha512-nz2IDF7nb1qmj9hx8Ja3MFab2q9Ml8QbOaaeJNyX5JQJHU8QUvEDiMctmhGEkk3Kzr8w8vAqz4hPk/ogJSrUhg== dependencies: - jest-get-type "^29.0.0" + jest-get-type "^29.2.0" -"@jest/expect@^29.1.2": - version "29.1.2" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.1.2.tgz#334a86395f621f1ab63ad95b06a588b9114d7b7a" - integrity sha512-FXw/UmaZsyfRyvZw3M6POgSNqwmuOXJuzdNiMWW9LCYo0GRoRDhg+R5iq5higmRTHQY7hx32+j7WHwinRmoILQ== +"@jest/expect@^29.2.0": + version "29.2.0" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.2.0.tgz#25316d2ae930e7bb9df96cce7521053d377c4c0d" + integrity sha512-+3lxcYL9e0xPJGOR33utxxejn+Mulz40kY0oy0FVsmIESW87NZDJ7B1ovaIqeX0xIgPX4laS5SGlqD2uSoBMcw== dependencies: - expect "^29.1.2" - jest-snapshot "^29.1.2" + expect "^29.2.0" + jest-snapshot "^29.2.0" -"@jest/fake-timers@^29.1.2": - version "29.1.2" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.1.2.tgz#f157cdf23b4da48ce46cb00fea28ed1b57fc271a" - integrity sha512-GppaEqS+QQYegedxVMpCe2xCXxxeYwQ7RsNx55zc8f+1q1qevkZGKequfTASI7ejmg9WwI+SJCrHe9X11bLL9Q== +"@jest/fake-timers@^29.2.0": + version "29.2.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.2.0.tgz#e43635c1bd73b23886e80ca12307092ef2ee1929" + integrity sha512-mX0V0uQsgeSLTt0yTqanAhhpeUKMGd2uq+PSLAfO40h72bvfNNQ7pIEl9vIwNMFxRih1ENveEjSBsLjxGGDPSw== dependencies: - "@jest/types" "^29.1.2" + "@jest/types" "^29.2.0" "@sinonjs/fake-timers" "^9.1.2" "@types/node" "*" - jest-message-util "^29.1.2" - jest-mock "^29.1.2" - jest-util "^29.1.2" + jest-message-util "^29.2.0" + jest-mock "^29.2.0" + jest-util "^29.2.0" -"@jest/globals@^29.1.2": - version "29.1.2" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.1.2.tgz#826ede84bc280ae7f789cb72d325c48cd048b9d3" - integrity sha512-uMgfERpJYoQmykAd0ffyMq8wignN4SvLUG6orJQRe9WAlTRc9cdpCaE/29qurXixYJVZWUqIBXhSk8v5xN1V9g== +"@jest/globals@^29.2.0": + version "29.2.0" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.2.0.tgz#5cfc41c028efaf511624ba086d64113d5a8a92b3" + integrity sha512-JQxtEVNWiai1p3PIzAJZSyEqQdAJGvNKvinZDPfu0mhiYEVx6E+PiBuDWj1sVUW8hzu+R3DVqaWC9K2xcLRIAA== dependencies: - "@jest/environment" "^29.1.2" - "@jest/expect" "^29.1.2" - "@jest/types" "^29.1.2" - jest-mock "^29.1.2" + "@jest/environment" "^29.2.0" + "@jest/expect" "^29.2.0" + "@jest/types" "^29.2.0" + jest-mock "^29.2.0" -"@jest/reporters@^29.1.2": - version "29.1.2" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.1.2.tgz#5520898ed0a4ecf69d8b671e1dc8465d0acdfa6e" - integrity sha512-X4fiwwyxy9mnfpxL0g9DD0KcTmEIqP0jUdnc2cfa9riHy+I6Gwwp5vOZiwyg0vZxfSDxrOlK9S4+340W4d+DAA== +"@jest/reporters@^29.2.0": + version "29.2.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.2.0.tgz#24cac16d997ec91a9c615db2621805ee485689e0" + integrity sha512-BXoAJatxTZ18U0cwD7C8qBo8V6vef8AXYRBZdhqE5DF9CmpqmhMfw9c7OUvYqMTnBBK9A0NgXGO4Lc9EJzdHvw== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.1.2" - "@jest/test-result" "^29.1.2" - "@jest/transform" "^29.1.2" - "@jest/types" "^29.1.2" + "@jest/console" "^29.2.0" + "@jest/test-result" "^29.2.0" + "@jest/transform" "^29.2.0" + "@jest/types" "^29.2.0" "@jridgewell/trace-mapping" "^0.3.15" "@types/node" "*" chalk "^4.0.0" @@ -463,13 +463,12 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^29.1.2" - jest-util "^29.1.2" - jest-worker "^29.1.2" + jest-message-util "^29.2.0" + jest-util "^29.2.0" + jest-worker "^29.2.0" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" - terminal-link "^2.0.0" v8-to-istanbul "^9.0.1" "@jest/schemas@^29.0.0": @@ -479,60 +478,60 @@ dependencies: "@sinclair/typebox" "^0.24.1" -"@jest/source-map@^29.0.0": - version "29.0.0" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.0.0.tgz#f8d1518298089f8ae624e442bbb6eb870ee7783c" - integrity sha512-nOr+0EM8GiHf34mq2GcJyz/gYFyLQ2INDhAylrZJ9mMWoW21mLBfZa0BUVPPMxVYrLjeiRe2Z7kWXOGnS0TFhQ== +"@jest/source-map@^29.2.0": + version "29.2.0" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.2.0.tgz#ab3420c46d42508dcc3dc1c6deee0b613c235744" + integrity sha512-1NX9/7zzI0nqa6+kgpSdKPK+WU1p+SJk3TloWZf5MzPbxri9UEeXX5bWZAPCzbQcyuAzubcdUHA7hcNznmRqWQ== dependencies: "@jridgewell/trace-mapping" "^0.3.15" callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^29.1.2": - version "29.1.2" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.1.2.tgz#6a8d006eb2b31ce0287d1fc10d12b8ff8504f3c8" - integrity sha512-jjYYjjumCJjH9hHCoMhA8PCl1OxNeGgAoZ7yuGYILRJX9NjgzTN0pCT5qAoYR4jfOP8htIByvAlz9vfNSSBoVg== +"@jest/test-result@^29.2.0": + version "29.2.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.2.0.tgz#3dcc7123b8f0fb5ba1f650ce17af45cce91a0323" + integrity sha512-l76EPJ6QqtzsCLS4aimJqWO53pxZ82o3aE+Brcmo1HJ/phb9+MR7gPhyDdN6VSGaLJCRVJBZgWEhAEz+qON0Fw== dependencies: - "@jest/console" "^29.1.2" - "@jest/types" "^29.1.2" + "@jest/console" "^29.2.0" + "@jest/types" "^29.2.0" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.1.2": - version "29.1.2" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.1.2.tgz#10bfd89c08bfdba382eb05cc79c1d23a01238a93" - integrity sha512-fU6dsUqqm8sA+cd85BmeF7Gu9DsXVWFdGn9taxM6xN1cKdcP/ivSgXh5QucFRFz1oZxKv3/9DYYbq0ULly3P/Q== +"@jest/test-sequencer@^29.2.0": + version "29.2.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.2.0.tgz#acd875533f7ad01cb22da59ff4047de18e9d64da" + integrity sha512-NCnjZcGnVdva6IDqF7TCuFsXs2F1tohiNF9sasSJNzD7VfN5ic9XgcS/oPDalGiPLxCmGKj4kewqqrKAqBACcQ== dependencies: - "@jest/test-result" "^29.1.2" + "@jest/test-result" "^29.2.0" graceful-fs "^4.2.9" - jest-haste-map "^29.1.2" + jest-haste-map "^29.2.0" slash "^3.0.0" -"@jest/transform@^29.1.2": - version "29.1.2" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.1.2.tgz#20f814696e04f090421f6d505c14bbfe0157062a" - integrity sha512-2uaUuVHTitmkx1tHF+eBjb4p7UuzBG7SXIaA/hNIkaMP6K+gXYGxP38ZcrofzqN0HeZ7A90oqsOa97WU7WZkSw== +"@jest/transform@^29.2.0": + version "29.2.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.2.0.tgz#1c55ca549f64810351df999265a29f8ead51be15" + integrity sha512-NXMujGHy+B4DAj4dGnVPD0SIXlR2Z/N8Gp9h3mF66kcIRult1WWqY3/CEIrJcKviNWaFPYhZjCG2L3fteWzcUw== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^29.1.2" + "@jest/types" "^29.2.0" "@jridgewell/trace-mapping" "^0.3.15" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.1.2" - jest-regex-util "^29.0.0" - jest-util "^29.1.2" + jest-haste-map "^29.2.0" + jest-regex-util "^29.2.0" + jest-util "^29.2.0" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" write-file-atomic "^4.0.1" -"@jest/types@^29.1.2": - version "29.1.2" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.1.2.tgz#7442d32b16bcd7592d9614173078b8c334ec730a" - integrity sha512-DcXGtoTykQB5jiwCmVr8H4vdg2OJhQex3qPkG+ISyDO7xQXbt/4R6dowcRyPemRnkH7JoHvZuxPBdlq+9JxFCg== +"@jest/types@^29.2.0": + version "29.2.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.2.0.tgz#c0d1ef8bc1e4f4b358e7877e34157371e7881b0b" + integrity sha512-mfgpQz4Z2xGo37m6KD8xEpKelaVzvYVRijmLPePn9pxgaPEtX+SqIyPNzzoeCPXKYbB4L/wYSgXDL8o3Gop78Q== dependencies: "@jest/schemas" "^29.0.0" "@types/istanbul-lib-coverage" "^2.0.0" @@ -805,15 +804,15 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^29.1.2: - version "29.1.2" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.1.2.tgz#540d3241925c55240fb0c742e3ffc5f33a501978" - integrity sha512-IuG+F3HTHryJb7gacC7SQ59A9kO56BctUsT67uJHp1mMCHUOMXpDwOHWGifWqdWVknN2WNkCVQELPjXx0aLJ9Q== +babel-jest@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.2.0.tgz#088624f037da90e69a06073305276cbd111d68a8" + integrity sha512-c8FkrW1chgcbyBqOo7jFGpQYfVnb43JqjQGV+C2r94k2rZJOukYOZ6+csAqKE4ms+PHc+yevnONxs27jQIxylw== dependencies: - "@jest/transform" "^29.1.2" + "@jest/transform" "^29.2.0" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^29.0.2" + babel-preset-jest "^29.2.0" chalk "^4.0.0" graceful-fs "^4.2.9" slash "^3.0.0" @@ -829,10 +828,10 @@ babel-plugin-istanbul@^6.1.1: istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.0.2.tgz#ae61483a829a021b146c016c6ad39b8bcc37c2c8" - integrity sha512-eBr2ynAEFjcebVvu8Ktx580BD1QKCrBG1XwEUTXJe285p9HA/4hOhfWCFRQhTKSyBV0VzjhG7H91Eifz9s29hg== +babel-plugin-jest-hoist@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.2.0.tgz#23ee99c37390a98cfddf3ef4a78674180d823094" + integrity sha512-TnspP2WNiR3GLfCsUNHqeXw0RoQ2f9U5hQ5L3XFpwuO8htQmSrhh8qsB6vi5Yi8+kuynN1yjDjQsPfkebmB6ZA== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -857,12 +856,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.0.2.tgz#e14a7124e22b161551818d89e5bdcfb3b2b0eac7" - integrity sha512-BeVXp7rH5TK96ofyEnHjznjLMQ2nAeDJ+QzxKnHAAMs0RgrQsCywjAN8m4mOm5Di0pxU//3AoEeJJrerMH5UeA== +babel-preset-jest@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.2.0.tgz#3048bea3a1af222e3505e4a767a974c95a7620dc" + integrity sha512-z9JmMJppMxNv8N7fNRHvhMg9cvIkMxQBXgFkane3yKVEvEOP+kB50lk8DFRvF9PGqbyXxlmebKWhuDORO8RgdA== dependencies: - babel-plugin-jest-hoist "^29.0.2" + babel-plugin-jest-hoist "^29.2.0" babel-preset-current-node-syntax "^1.0.0" balanced-match@^1.0.0: @@ -1059,10 +1058,10 @@ detect-newline@^3.0.0: resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== -diff-sequences@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.0.0.tgz#bae49972ef3933556bcb0800b72e8579d19d9e4f" - integrity sha512-7Qe/zd1wxSDL4D/X/FPjOMB+ZMDt71W94KYaq05I2l0oQqgXgs7s4ftYYmV38gBSrPz2vcygxfs1xn0FT+rKNA== +diff-sequences@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.2.0.tgz#4c55b5b40706c7b5d2c5c75999a50c56d214e8f6" + integrity sha512-413SY5JpYeSBZxmenGEmCVQ8mCgtFJF0w9PROdaS6z987XC2Pd2GOKqOITLtMftmyFZqgtCOb/QA7/Z3ZXfzIw== dir-glob@^3.0.1: version "3.0.1" @@ -1274,16 +1273,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^29.1.2: - version "29.1.2" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.1.2.tgz#82f8f28d7d408c7c68da3a386a490ee683e1eced" - integrity sha512-AuAGn1uxva5YBbBlXb+2JPxJRuemZsmlGcapPXWNSBNsQtAULfjioREGBWuI0EOvYUKjDnrCy8PW5Zlr1md5mw== +expect@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.2.0.tgz#b90c6df52be7abfd9f206f273fbcf8b33d8f332d" + integrity sha512-03ClF3GWwUqd9Grgkr9ZSdaCJGMRA69PQ8jT7o+Bx100VlGiAFf9/8oIm9Qve7ZVJhuJxFftqFhviZJRxxNfvg== dependencies: - "@jest/expect-utils" "^29.1.2" - jest-get-type "^29.0.0" - jest-matcher-utils "^29.1.2" - jest-message-util "^29.1.2" - jest-util "^29.1.2" + "@jest/expect-utils" "^29.2.0" + jest-get-type "^29.2.0" + jest-matcher-utils "^29.2.0" + jest-message-util "^29.2.0" + jest-util "^29.2.0" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1637,283 +1636,283 @@ istanbul-reports@^3.1.3: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.0.0.tgz#aa238eae42d9372a413dd9a8dadc91ca1806dce0" - integrity sha512-28/iDMDrUpGoCitTURuDqUzWQoWmOmOKOFST1mi2lwh62X4BFf6khgH3uSuo1e49X/UDjuApAj3w0wLOex4VPQ== +jest-changed-files@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.2.0.tgz#b6598daa9803ea6a4dce7968e20ab380ddbee289" + integrity sha512-qPVmLLyBmvF5HJrY7krDisx6Voi8DmlV3GZYX0aFNbaQsZeoz1hfxcCMbqDGuQCxU1dJy9eYc2xscE8QrCCYaA== dependencies: execa "^5.0.0" p-limit "^3.1.0" -jest-circus@^29.1.2: - version "29.1.2" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.1.2.tgz#4551068e432f169a53167fe1aef420cf51c8a735" - integrity sha512-ajQOdxY6mT9GtnfJRZBRYS7toNIJayiiyjDyoZcnvPRUPwJ58JX0ci0PKAKUo2C1RyzlHw0jabjLGKksO42JGA== +jest-circus@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.2.0.tgz#692ddf3b12a5ae6326f2f37b9d176c68777fcf4c" + integrity sha512-bpJRMe+VtvYlF3q8JNx+/cAo4FYvNCiR5s7Z0Scf8aC+KJ2ineSjZKtw1cIZbythlplkiro0My8nc65pfCqJ3A== dependencies: - "@jest/environment" "^29.1.2" - "@jest/expect" "^29.1.2" - "@jest/test-result" "^29.1.2" - "@jest/types" "^29.1.2" + "@jest/environment" "^29.2.0" + "@jest/expect" "^29.2.0" + "@jest/test-result" "^29.2.0" + "@jest/types" "^29.2.0" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" is-generator-fn "^2.0.0" - jest-each "^29.1.2" - jest-matcher-utils "^29.1.2" - jest-message-util "^29.1.2" - jest-runtime "^29.1.2" - jest-snapshot "^29.1.2" - jest-util "^29.1.2" + jest-each "^29.2.0" + jest-matcher-utils "^29.2.0" + jest-message-util "^29.2.0" + jest-runtime "^29.2.0" + jest-snapshot "^29.2.0" + jest-util "^29.2.0" p-limit "^3.1.0" - pretty-format "^29.1.2" + pretty-format "^29.2.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.1.2: - version "29.1.2" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.1.2.tgz#423b9c5d3ea20a50b1354b8bf3f2a20e72110e89" - integrity sha512-vsvBfQ7oS2o4MJdAH+4u9z76Vw5Q8WBQF5MchDbkylNknZdrPTX1Ix7YRJyTlOWqRaS7ue/cEAn+E4V1MWyMzw== +jest-cli@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.2.0.tgz#c6ca40889d6671c38b1cf9119d3b653809f31a3a" + integrity sha512-/581TzbXeO+5kbtSlhXEthGiVJCC8AP0jgT0iZINAAMW+tTFj2uWU7z+HNUH5yIYdHV7AvRr0fWLrmHJGIruHg== dependencies: - "@jest/core" "^29.1.2" - "@jest/test-result" "^29.1.2" - "@jest/types" "^29.1.2" + "@jest/core" "^29.2.0" + "@jest/test-result" "^29.2.0" + "@jest/types" "^29.2.0" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.1.2" - jest-util "^29.1.2" - jest-validate "^29.1.2" + jest-config "^29.2.0" + jest-util "^29.2.0" + jest-validate "^29.2.0" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^29.1.2: - version "29.1.2" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.1.2.tgz#7d004345ca4c09f5d8f802355f54494e90842f4d" - integrity sha512-EC3Zi86HJUOz+2YWQcJYQXlf0zuBhJoeyxLM6vb6qJsVmpP7KcCP1JnyF0iaqTaXdBP8Rlwsvs7hnKWQWWLwwA== +jest-config@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.2.0.tgz#8823f35255f696444a882721e624d7ad352e208b" + integrity sha512-IkdCsrHIoxDPZAyFcdtQrCQ3uftLqns6Joj0tlbxiAQW4k/zTXmIygqWBmPNxO9FbFkDrhtYZiLHXjaJh9rS+Q== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.1.2" - "@jest/types" "^29.1.2" - babel-jest "^29.1.2" + "@jest/test-sequencer" "^29.2.0" + "@jest/types" "^29.2.0" + babel-jest "^29.2.0" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^29.1.2" - jest-environment-node "^29.1.2" - jest-get-type "^29.0.0" - jest-regex-util "^29.0.0" - jest-resolve "^29.1.2" - jest-runner "^29.1.2" - jest-util "^29.1.2" - jest-validate "^29.1.2" + jest-circus "^29.2.0" + jest-environment-node "^29.2.0" + jest-get-type "^29.2.0" + jest-regex-util "^29.2.0" + jest-resolve "^29.2.0" + jest-runner "^29.2.0" + jest-util "^29.2.0" + jest-validate "^29.2.0" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^29.1.2" + pretty-format "^29.2.0" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^29.1.2: - version "29.1.2" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.1.2.tgz#bb7aaf5353227d6f4f96c5e7e8713ce576a607dc" - integrity sha512-4GQts0aUopVvecIT4IwD/7xsBaMhKTYoM4/njE/aVw9wpw+pIUVp8Vab/KnSzSilr84GnLBkaP3JLDnQYCKqVQ== +jest-diff@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.2.0.tgz#b1e11ac1a1401fc4792ef8ba406b48f1ae7d2bc5" + integrity sha512-GsH07qQL+/D/GxlnU+sSg9GL3fBOcuTlmtr3qr2pnkiODCwubNN2/7slW4m3CvxDsEus/VEOfQKRFLyXsUlnZw== dependencies: chalk "^4.0.0" - diff-sequences "^29.0.0" - jest-get-type "^29.0.0" - pretty-format "^29.1.2" + diff-sequences "^29.2.0" + jest-get-type "^29.2.0" + pretty-format "^29.2.0" -jest-docblock@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.0.0.tgz#3151bcc45ed7f5a8af4884dcc049aee699b4ceae" - integrity sha512-s5Kpra/kLzbqu9dEjov30kj1n4tfu3e7Pl8v+f8jOkeWNqM6Ds8jRaJfZow3ducoQUrf2Z4rs2N5S3zXnb83gw== +jest-docblock@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.2.0.tgz#307203e20b637d97cee04809efc1d43afc641e82" + integrity sha512-bkxUsxTgWQGbXV5IENmfiIuqZhJcyvF7tU4zJ/7ioTutdz4ToB5Yx6JOFBpgI+TphRY4lhOyCWGNH/QFQh5T6A== dependencies: detect-newline "^3.0.0" -jest-each@^29.1.2: - version "29.1.2" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.1.2.tgz#d4c8532c07a846e79f194f7007ce7cb1987d1cd0" - integrity sha512-AmTQp9b2etNeEwMyr4jc0Ql/LIX/dhbgP21gHAizya2X6rUspHn2gysMXaj6iwWuOJ2sYRgP8c1P4cXswgvS1A== +jest-each@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.2.0.tgz#0f89c1233d65f22c7dba265ccd319611f1d662de" + integrity sha512-h4LeC3L/R7jIMfTdYowevPIssvcPYQ7Qzs+pCSYsJgPztIizXwKmnfhZXBA4WVqdmvMcpmseYEXb67JT7IJ2eg== dependencies: - "@jest/types" "^29.1.2" + "@jest/types" "^29.2.0" chalk "^4.0.0" - jest-get-type "^29.0.0" - jest-util "^29.1.2" - pretty-format "^29.1.2" - -jest-environment-node@^29.1.2: - version "29.1.2" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.1.2.tgz#005e05cc6ea4b9b5ba55906ab1ce53c82f6907a7" - integrity sha512-C59yVbdpY8682u6k/lh8SUMDJPbOyCHOTgLVVi1USWFxtNV+J8fyIwzkg+RJIVI30EKhKiAGNxYaFr3z6eyNhQ== - dependencies: - "@jest/environment" "^29.1.2" - "@jest/fake-timers" "^29.1.2" - "@jest/types" "^29.1.2" + jest-get-type "^29.2.0" + jest-util "^29.2.0" + pretty-format "^29.2.0" + +jest-environment-node@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.2.0.tgz#49c39d4f9df64fc74da3725cbcaeee6da01a6dd6" + integrity sha512-b4qQGVStPMvtZG97Ac0rvnmSIjCZturFU7MQRMp4JDFl7zoaDLTtXmFjFP1tNmi9te6kR8d+Htbv3nYeoaIz6g== + dependencies: + "@jest/environment" "^29.2.0" + "@jest/fake-timers" "^29.2.0" + "@jest/types" "^29.2.0" "@types/node" "*" - jest-mock "^29.1.2" - jest-util "^29.1.2" + jest-mock "^29.2.0" + jest-util "^29.2.0" -jest-get-type@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.0.0.tgz#843f6c50a1b778f7325df1129a0fd7aa713aef80" - integrity sha512-83X19z/HuLKYXYHskZlBAShO7UfLFXu/vWajw9ZNJASN32li8yHMaVGAQqxFW1RCFOkB7cubaL6FaJVQqqJLSw== +jest-get-type@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.2.0.tgz#726646f927ef61d583a3b3adb1ab13f3a5036408" + integrity sha512-uXNJlg8hKFEnDgFsrCjznB+sTxdkuqiCL6zMgA75qEbAJjJYTs9XPrvDctrEig2GDow22T/LvHgO57iJhXB/UA== -jest-haste-map@^29.1.2: - version "29.1.2" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.1.2.tgz#93f3634aa921b6b654e7c94137b24e02e7ca6ac9" - integrity sha512-xSjbY8/BF11Jh3hGSPfYTa/qBFrm3TPM7WU8pU93m2gqzORVLkHFWvuZmFsTEBPRKndfewXhMOuzJNHyJIZGsw== +jest-haste-map@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.2.0.tgz#2410f2ec93958e0bd894818de6c8056eb1b4d6fc" + integrity sha512-qu9lGFi7qJ8v37egS1phZZUJYiMyWnKwu83NlNT1qs50TbedIX2hFl+9ztsJ7U/ENaHwk1/Bs8fqOIQsScIRwg== dependencies: - "@jest/types" "^29.1.2" + "@jest/types" "^29.2.0" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" - jest-regex-util "^29.0.0" - jest-util "^29.1.2" - jest-worker "^29.1.2" + jest-regex-util "^29.2.0" + jest-util "^29.2.0" + jest-worker "^29.2.0" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^29.1.2: - version "29.1.2" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.1.2.tgz#4c846db14c58219430ccbc4f01a1ec52ebee4fc2" - integrity sha512-TG5gAZJpgmZtjb6oWxBLf2N6CfQ73iwCe6cofu/Uqv9iiAm6g502CAnGtxQaTfpHECBdVEMRBhomSXeLnoKjiQ== +jest-leak-detector@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.2.0.tgz#7c0eace293cf05a130a09beb1b9318ecc2f77692" + integrity sha512-FXT9sCFdct42+oOqGIr/9kmUw3RbhvpkwidCBT5ySHHoWNGd3c9n7HXpFKjEz9UnUITRCGdn0q2s6Sxrq36kwg== dependencies: - jest-get-type "^29.0.0" - pretty-format "^29.1.2" + jest-get-type "^29.2.0" + pretty-format "^29.2.0" -jest-matcher-utils@^29.1.2: - version "29.1.2" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.1.2.tgz#e68c4bcc0266e70aa1a5c13fb7b8cd4695e318a1" - integrity sha512-MV5XrD3qYSW2zZSHRRceFzqJ39B2z11Qv0KPyZYxnzDHFeYZGJlgGi0SW+IXSJfOewgJp/Km/7lpcFT+cgZypw== +jest-matcher-utils@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.2.0.tgz#d1d73add0e0efb0e316a50f296977505dc053e02" + integrity sha512-FcEfKZ4vm28yCdBsvC69EkrEhcfex+IYlRctNJXsRG9+WC3WxgBNORnECIgqUtj7o/h1d8o7xB/dFUiLi4bqtw== dependencies: chalk "^4.0.0" - jest-diff "^29.1.2" - jest-get-type "^29.0.0" - pretty-format "^29.1.2" + jest-diff "^29.2.0" + jest-get-type "^29.2.0" + pretty-format "^29.2.0" -jest-message-util@^29.1.2: - version "29.1.2" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.1.2.tgz#c21a33c25f9dc1ebfcd0f921d89438847a09a501" - integrity sha512-9oJ2Os+Qh6IlxLpmvshVbGUiSkZVc2FK+uGOm6tghafnB2RyjKAxMZhtxThRMxfX1J1SOMhTn9oK3/MutRWQJQ== +jest-message-util@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.2.0.tgz#cbd43fd9a20a8facd4267ac37556bc5c9a525ec0" + integrity sha512-arBfk5yMFMTnMB22GyG601xGSGthA02vWSewPaxoFo0F9wBqDOyxccPbCcYu8uibw3kduSHXdCOd1PsLSgdomg== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.1.2" + "@jest/types" "^29.2.0" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^29.1.2" + pretty-format "^29.2.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^29.1.2: - version "29.1.2" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.1.2.tgz#de47807edbb9d4abf8423f1d8d308d670105678c" - integrity sha512-PFDAdjjWbjPUtQPkQufvniXIS3N9Tv7tbibePEjIIprzjgo0qQlyUiVMrT4vL8FaSJo1QXifQUOuPH3HQC/aMA== +jest-mock@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.2.0.tgz#3531012881178f59f4b5fd1e243acc329d08d6a1" + integrity sha512-aiWGR0P8ivssIO17xkehLGFtCcef2ZwQFNPwEer1jQLHxPctDlIg3Hs6QMq1KpPz5dkCcgM7mwGif4a9IPznlg== dependencies: - "@jest/types" "^29.1.2" + "@jest/types" "^29.2.0" "@types/node" "*" - jest-util "^29.1.2" + jest-util "^29.2.0" jest-pnp-resolver@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== -jest-regex-util@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.0.0.tgz#b442987f688289df8eb6c16fa8df488b4cd007de" - integrity sha512-BV7VW7Sy0fInHWN93MMPtlClweYv2qrSCwfeFWmpribGZtQPWNvRSq9XOVgOEjU1iBGRKXUZil0o2AH7Iy9Lug== +jest-regex-util@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.2.0.tgz#82ef3b587e8c303357728d0322d48bbfd2971f7b" + integrity sha512-6yXn0kg2JXzH30cr2NlThF+70iuO/3irbaB4mh5WyqNIvLLP+B6sFdluO1/1RJmslyh/f9osnefECflHvTbwVA== -jest-resolve-dependencies@^29.1.2: - version "29.1.2" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.1.2.tgz#a6919e58a0c7465582cb8ec2d745b4e64ae8647f" - integrity sha512-44yYi+yHqNmH3OoWZvPgmeeiwKxhKV/0CfrzaKLSkZG9gT973PX8i+m8j6pDrTYhhHoiKfF3YUFg/6AeuHw4HQ== +jest-resolve-dependencies@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.2.0.tgz#a127b7d6b7df69d4eaf2c7c99f652f17ba0fed71" + integrity sha512-Cd0Z39sDntEnfR9PoUdFHUAGDvtKI0/7Wt73l3lt03A3yQ+A6Qi3XmBuqGjdFl2QbXaPa937oLhilG612P8HGQ== dependencies: - jest-regex-util "^29.0.0" - jest-snapshot "^29.1.2" + jest-regex-util "^29.2.0" + jest-snapshot "^29.2.0" -jest-resolve@^29.1.2: - version "29.1.2" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.1.2.tgz#9dd8c2fc83e59ee7d676b14bd45a5f89e877741d" - integrity sha512-7fcOr+k7UYSVRJYhSmJHIid3AnDBcLQX3VmT9OSbPWsWz1MfT7bcoerMhADKGvKCoMpOHUQaDHtQoNp/P9JMGg== +jest-resolve@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.2.0.tgz#cb9f9770164382785cd68598a9fb0b7e4bb95a9f" + integrity sha512-f5c0ljNg2guDBCC7wi92vAhNuA0BtAG5vkY7Fob0c7sUMU1g87mTXqRmjrVFe2XvdwP5m5T/e5KJsCKu9hRvBA== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^29.1.2" + jest-haste-map "^29.2.0" jest-pnp-resolver "^1.2.2" - jest-util "^29.1.2" - jest-validate "^29.1.2" + jest-util "^29.2.0" + jest-validate "^29.2.0" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^29.1.2: - version "29.1.2" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.1.2.tgz#f18b2b86101341e047de8c2f51a5fdc4e97d053a" - integrity sha512-yy3LEWw8KuBCmg7sCGDIqKwJlULBuNIQa2eFSVgVASWdXbMYZ9H/X0tnXt70XFoGf92W2sOQDOIFAA6f2BG04Q== +jest-runner@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.2.0.tgz#d621e67a2d59d5bc302eca1f5348615ce166712c" + integrity sha512-VPBrCwl9fM2mc5yk6yZhNrgXzRJMD5jfLmntkMLlrVq4hQPWbRK998iJlR+DOGCO04TC9PPYLntOJ001Vnf28g== dependencies: - "@jest/console" "^29.1.2" - "@jest/environment" "^29.1.2" - "@jest/test-result" "^29.1.2" - "@jest/transform" "^29.1.2" - "@jest/types" "^29.1.2" + "@jest/console" "^29.2.0" + "@jest/environment" "^29.2.0" + "@jest/test-result" "^29.2.0" + "@jest/transform" "^29.2.0" + "@jest/types" "^29.2.0" "@types/node" "*" chalk "^4.0.0" emittery "^0.10.2" graceful-fs "^4.2.9" - jest-docblock "^29.0.0" - jest-environment-node "^29.1.2" - jest-haste-map "^29.1.2" - jest-leak-detector "^29.1.2" - jest-message-util "^29.1.2" - jest-resolve "^29.1.2" - jest-runtime "^29.1.2" - jest-util "^29.1.2" - jest-watcher "^29.1.2" - jest-worker "^29.1.2" + jest-docblock "^29.2.0" + jest-environment-node "^29.2.0" + jest-haste-map "^29.2.0" + jest-leak-detector "^29.2.0" + jest-message-util "^29.2.0" + jest-resolve "^29.2.0" + jest-runtime "^29.2.0" + jest-util "^29.2.0" + jest-watcher "^29.2.0" + jest-worker "^29.2.0" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^29.1.2: - version "29.1.2" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.1.2.tgz#dbcd57103d61115479108d5864bdcd661d9c6783" - integrity sha512-jr8VJLIf+cYc+8hbrpt412n5jX3tiXmpPSYTGnwcvNemY+EOuLNiYnHJ3Kp25rkaAcTWOEI4ZdOIQcwYcXIAZw== - dependencies: - "@jest/environment" "^29.1.2" - "@jest/fake-timers" "^29.1.2" - "@jest/globals" "^29.1.2" - "@jest/source-map" "^29.0.0" - "@jest/test-result" "^29.1.2" - "@jest/transform" "^29.1.2" - "@jest/types" "^29.1.2" +jest-runtime@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.2.0.tgz#6b10d9539c1f7af32d06fccd7d16b6c9996c9cb2" + integrity sha512-+GDmzCrswQF+mvI0upTYMe/OPYnlRRNLLDHM9AFLp2y7zxWoDoYgb8DL3WwJ8d9m743AzrnvBV9JQHi/0ed7dg== + dependencies: + "@jest/environment" "^29.2.0" + "@jest/fake-timers" "^29.2.0" + "@jest/globals" "^29.2.0" + "@jest/source-map" "^29.2.0" + "@jest/test-result" "^29.2.0" + "@jest/transform" "^29.2.0" + "@jest/types" "^29.2.0" "@types/node" "*" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^29.1.2" - jest-message-util "^29.1.2" - jest-mock "^29.1.2" - jest-regex-util "^29.0.0" - jest-resolve "^29.1.2" - jest-snapshot "^29.1.2" - jest-util "^29.1.2" + jest-haste-map "^29.2.0" + jest-message-util "^29.2.0" + jest-mock "^29.2.0" + jest-regex-util "^29.2.0" + jest-resolve "^29.2.0" + jest-snapshot "^29.2.0" + jest-util "^29.2.0" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.1.2: - version "29.1.2" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.1.2.tgz#7dd277e88c45f2d2ff5888de1612e63c7ceb575b" - integrity sha512-rYFomGpVMdBlfwTYxkUp3sjD6usptvZcONFYNqVlaz4EpHPnDvlWjvmOQ9OCSNKqYZqLM2aS3wq01tWujLg7gg== +jest-snapshot@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.2.0.tgz#fb3d4e1d9df579f37d7c60072877ee99376b6090" + integrity sha512-YCKrOR0PLRXROmww73fHO9oeY4tL+LPQXWR3yml1+hKbQDR8j1VUrVzB65hKSJJgxBOr1vWx+hmz2by8JjAU5w== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" @@ -1921,82 +1920,82 @@ jest-snapshot@^29.1.2: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.1.2" - "@jest/transform" "^29.1.2" - "@jest/types" "^29.1.2" + "@jest/expect-utils" "^29.2.0" + "@jest/transform" "^29.2.0" + "@jest/types" "^29.2.0" "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.1.2" + expect "^29.2.0" graceful-fs "^4.2.9" - jest-diff "^29.1.2" - jest-get-type "^29.0.0" - jest-haste-map "^29.1.2" - jest-matcher-utils "^29.1.2" - jest-message-util "^29.1.2" - jest-util "^29.1.2" + jest-diff "^29.2.0" + jest-get-type "^29.2.0" + jest-haste-map "^29.2.0" + jest-matcher-utils "^29.2.0" + jest-message-util "^29.2.0" + jest-util "^29.2.0" natural-compare "^1.4.0" - pretty-format "^29.1.2" + pretty-format "^29.2.0" semver "^7.3.5" -jest-util@^29.1.2: - version "29.1.2" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.1.2.tgz#ac5798e93cb6a6703084e194cfa0898d66126df1" - integrity sha512-vPCk9F353i0Ymx3WQq3+a4lZ07NXu9Ca8wya6o4Fe4/aO1e1awMMprZ3woPFpKwghEOW+UXgd15vVotuNN9ONQ== +jest-util@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.2.0.tgz#797935697e83a5722aeba401ed6cd01264295566" + integrity sha512-8M1dx12ujkBbnhwytrezWY0Ut79hbflwodE+qZKjxSRz5qt4xDp6dQQJaOCFvCmE0QJqp9KyEK33lpPNjnhevw== dependencies: - "@jest/types" "^29.1.2" + "@jest/types" "^29.2.0" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^29.1.2: - version "29.1.2" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.1.2.tgz#83a728b8f6354da2e52346878c8bc7383516ca51" - integrity sha512-k71pOslNlV8fVyI+mEySy2pq9KdXdgZtm7NHrBX8LghJayc3wWZH0Yr0mtYNGaCU4F1OLPXRkwZR0dBm/ClshA== +jest-validate@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.2.0.tgz#e40faf33759365c12ead6a45165349d660d09ba4" + integrity sha512-4Vl51bPNeFeDok9aJiOnrC6tqJbOp4iMCYlewoC2ZzYJZ5+6pfr3KObAdx5wP8auHcg2MRaguiqj5OdScZa72g== dependencies: - "@jest/types" "^29.1.2" + "@jest/types" "^29.2.0" camelcase "^6.2.0" chalk "^4.0.0" - jest-get-type "^29.0.0" + jest-get-type "^29.2.0" leven "^3.1.0" - pretty-format "^29.1.2" + pretty-format "^29.2.0" -jest-watcher@^29.1.2: - version "29.1.2" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.1.2.tgz#de21439b7d889e2fcf62cc2a4779ef1a3f1f3c62" - integrity sha512-6JUIUKVdAvcxC6bM8/dMgqY2N4lbT+jZVsxh0hCJRbwkIEnbr/aPjMQ28fNDI5lB51Klh00MWZZeVf27KBUj5w== +jest-watcher@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.2.0.tgz#d0c58ff76d3dd22fff79f3f9cbeadaa749d2ca6e" + integrity sha512-bRh0JdUeN+cl9XfK7tMnXLm4Mv70hG2SZlqbkFe5CTs7oeCkbwlGBk/mEfEJ63mrxZ8LPbnfaMpfSmkhEQBEGA== dependencies: - "@jest/test-result" "^29.1.2" - "@jest/types" "^29.1.2" + "@jest/test-result" "^29.2.0" + "@jest/types" "^29.2.0" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.10.2" - jest-util "^29.1.2" + jest-util "^29.2.0" string-length "^4.0.1" -jest-worker@^29.1.2: - version "29.1.2" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.1.2.tgz#a68302af61bce82b42a9a57285ca7499d29b2afc" - integrity sha512-AdTZJxKjTSPHbXT/AIOjQVmoFx0LHFcVabWu0sxI7PAy7rFf8c0upyvgBKgguVXdM4vY74JdwkyD4hSmpTW8jA== +jest-worker@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.2.0.tgz#b2bd1a81fc7a1ae79a500b05f5feb0d1c0b1a19e" + integrity sha512-mluOlMbRX1H59vGVzPcVg2ALfCausbBpxC8a2KWOzInhYHZibbHH8CB0C1JkmkpfurrkOYgF7FPmypuom1OM9A== dependencies: "@types/node" "*" - jest-util "^29.1.2" + jest-util "^29.2.0" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^29.0.0: - version "29.1.2" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.1.2.tgz#f821a1695ffd6cd0efc3b59d2dfcc70a98582499" - integrity sha512-5wEIPpCezgORnqf+rCaYD1SK+mNN7NsstWzIsuvsnrhR/hSxXWd82oI7DkrbJ+XTD28/eG8SmxdGvukrGGK6Tw== + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.2.0.tgz#e7997bc603f31e04edbbe87dd24cf6e7c432abac" + integrity sha512-6krPemKUXCEu5Fh3j6ZVoLMjpTQVm0OCU+7f3K/9gllX8wNIE6NSCQ6s0q2RDoiKLRaQlVRHyscjSPRPqCI0Fg== dependencies: - "@jest/core" "^29.1.2" - "@jest/types" "^29.1.2" + "@jest/core" "^29.2.0" + "@jest/types" "^29.2.0" import-local "^3.0.2" - jest-cli "^29.1.2" + jest-cli "^29.2.0" js-sdsl@^4.1.4: version "4.1.4" @@ -2322,10 +2321,10 @@ prettier@>=2.3.0: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== -pretty-format@^29.1.2: - version "29.1.2" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.1.2.tgz#b1f6b75be7d699be1a051f5da36e8ae9e76a8e6a" - integrity sha512-CGJ6VVGXVRP2o2Dorl4mAwwvDWT25luIsYhkyVQW32E4nL+TgW939J7LlKT/npq5Cpq6j3s+sy+13yk7xYpBmg== +pretty-format@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.2.0.tgz#1d4ea56fb46079b44efd9ed59c14f70f2950a61b" + integrity sha512-QCSUFdwOi924g24czhOH5eTkXxUCqlLGZBRCySlwDYHIXRJkdGyjJc9nZaqhlFBZws8dq5Dvk0lCilsmlfsPxw== dependencies: "@jest/schemas" "^29.0.0" ansi-styles "^5.0.0" @@ -2549,7 +2548,7 @@ supports-color@^5.3.0: dependencies: has-flag "^3.0.0" -supports-color@^7.0.0, supports-color@^7.1.0: +supports-color@^7.1.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== @@ -2563,27 +2562,11 @@ supports-color@^8.0.0: dependencies: has-flag "^4.0.0" -supports-hyperlinks@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz#4f77b42488765891774b70c79babd87f9bd594bb" - integrity sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ== - dependencies: - has-flag "^4.0.0" - supports-color "^7.0.0" - supports-preserve-symlinks-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== -terminal-link@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/terminal-link/-/terminal-link-2.1.1.tgz#14a64a27ab3c0df933ea546fba55f2d078edc994" - integrity sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ== - dependencies: - ansi-escapes "^4.2.1" - supports-hyperlinks "^2.0.0" - test-exclude@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" From 6bfc794bc0b777cc50424c6259241f1a557480ed Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 18 Oct 2022 12:47:21 -0400 Subject: [PATCH 647/785] Document ignoring code comment --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 76454ed5..bcadfb70 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,10 @@ Or, they can be passed to `prettier` as arguments: bundle exec rbprettier --tab-width 4 --write '**/*' ``` +### Ignoring code + +Sometimes you want to leave your formatting in place and have `prettier` not format it, but continue to format the rest of the file. `prettier` has the ability to do this with `prettier-ignore` comments, but because the underlying formatter for this plugin is [Syntax Tree](https://github.com/ruby-syntax-tree/syntax_tree), you instead would use a `stree-ignore` comment. + ### Usage with RuboCop RuboCop and Prettier for Ruby serve different purposes, but there is overlap From 0f1892f3544e03f3f84d2b1cec83a0d26cde01ea Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 18 Oct 2022 12:53:39 -0400 Subject: [PATCH 648/785] Add back rubySingleQuote option --- README.md | 16 ++++++++-------- src/parseSync.js | 2 +- src/plugin.js | 8 ++++++++ 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index bcadfb70..4d3d8b51 100644 --- a/README.md +++ b/README.md @@ -134,14 +134,14 @@ The `prettier` executable is now installed and ready for use: Below are the options (from [`src/plugin.js`](src/plugin.js)) that `@prettier/plugin-ruby` currently supports: -| API Option | CLI Option | Default | Description | -| --------------- | ------------------ | :-----: | --------------------------------------------------------------------------------------------------------------------------------------------------- | -| `printWidth` | `--print-width` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)). | -| `requirePragma` | `--require-pragma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#require-pragma)). | -| `rubyPlugins` | `--ruby-plugins` | `""` | The comma-separated list of plugins to require. See [Syntax Tree](https://github.com/ruby-syntax-tree/syntax_tree#plugins). | -| `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). | -| `singleQuote` | `--single-quote` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#quotes)). | -| `trailingComma` | `--trailing-comma` | `es5` | Almost same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#trailing-commas)). Will be on for any value except `none`. | +| API Option | CLI Option | Default | Description | +| ----------------- | --------------------- | :-----: | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| `printWidth` | `--print-width` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)). | +| `requirePragma` | `--require-pragma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#require-pragma)). | +| `rubyPlugins` | `--ruby-plugins` | `""` | The comma-separated list of plugins to require. See [Syntax Tree](https://github.com/ruby-syntax-tree/syntax_tree#plugins). | +| `rubySingleQuote` | `--ruby-single-quote` | `false` | Whether or not to default to single quotes for Ruby code. See [Syntax Tree](https://github.com/ruby-syntax-tree/syntax_tree#plugins). | +| `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). | +| `trailingComma` | `--trailing-comma` | `es5` | Almost same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#trailing-commas)). Will be on for any value except `none`. | Any of these can be added to your existing [prettier configuration file](https://prettier.io/docs/en/configuration.html). For example: diff --git a/src/parseSync.js b/src/parseSync.js index 7d3dc59b..43b8cc4d 100644 --- a/src/parseSync.js +++ b/src/parseSync.js @@ -68,7 +68,7 @@ function getPlugins(opts) { rubyPlugins.split(",").forEach((plugin) => plugins.add(plugin.trim())); } - if (opts.singleQuote) { + if (opts.rubySingleQuote) { plugins.add("plugin/single_quotes"); } diff --git a/src/plugin.js b/src/plugin.js index 45c3f95c..da98f900 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -159,6 +159,14 @@ const plugin = { default: "", description: "The comma-separated list of plugins to require", since: "3.1.0" + }, + rubySingleQuote: { + type: "boolean", + category: "Ruby", + default: false, + description: + "When double quotes are not necessary for interpolation, prefers the use of single quotes for string literals.", + since: "1.0.0" } }, defaultOptions: { From cdde61cccb666ecae7e6f2124f11e197132a87a3 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 18 Oct 2022 13:15:49 -0400 Subject: [PATCH 649/785] Lower Ruby version requirement, increase syntax_tree requirement --- prettier.gemspec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/prettier.gemspec b/prettier.gemspec index e5ad4985..abe4f9e4 100644 --- a/prettier.gemspec +++ b/prettier.gemspec @@ -20,14 +20,14 @@ Gem::Specification.new do |spec| ] end - spec.required_ruby_version = ">= 2.7.3" + spec.required_ruby_version = ">= 2.7.0" spec.bindir = "exe" spec.executables = "rbprettier" spec.require_paths = %w[lib] - spec.add_dependency "syntax_tree", ">= 2.7.1" - spec.add_dependency "syntax_tree-haml", ">= 1.1.0" + spec.add_dependency "syntax_tree", ">= 4.0.1" + spec.add_dependency "syntax_tree-haml", ">= 2.0.0" spec.add_dependency "syntax_tree-rbs", ">= 0.2.0" spec.add_development_dependency "bundler" From d2d1ac4ae52f4e10d0fb59570a94e95a4ec33813 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 18 Oct 2022 13:08:59 -0400 Subject: [PATCH 650/785] Migrate to ES modules --- CONTRIBUTING.md | 8 +++--- bin/doc | 14 ---------- bin/doc.js | 12 +++++++++ bin/pragma | 6 ----- bin/{print => print.js} | 14 +++++----- package.json | 6 +++-- src/getInfo.js | 2 +- src/netcat.js | 2 +- src/parseSync.js | 36 +++++++++++-------------- src/plugin.js | 4 +-- test/js/files.test.js | 16 +++++------ test/js/globalSetup.js | 15 +++++------ test/js/globalTeardown.js | 2 +- test/js/haml/comment.test.js | 2 +- test/js/haml/doctype.test.js | 2 +- test/js/haml/filter.test.js | 2 +- test/js/haml/hamlComment.test.js | 2 +- test/js/haml/plain.test.js | 2 +- test/js/haml/script.test.js | 2 +- test/js/haml/silentScript.test.js | 2 +- test/js/haml/tag.test.js | 2 +- test/js/rbs/rbs.test.js | 12 ++++----- test/js/ruby/comments.test.js | 2 +- test/js/ruby/errors.test.js | 7 ++--- test/js/ruby/ignore.test.js | 2 +- test/js/ruby/layout.test.js | 2 +- test/js/ruby/nodes/alias.test.js | 2 +- test/js/ruby/nodes/aref.test.js | 2 +- test/js/ruby/nodes/arrays.test.js | 2 +- test/js/ruby/nodes/assign.test.js | 2 +- test/js/ruby/nodes/binary.test.js | 2 +- test/js/ruby/nodes/blocks.test.js | 2 +- test/js/ruby/nodes/break.test.js | 2 +- test/js/ruby/nodes/calls.test.js | 2 +- test/js/ruby/nodes/case.test.js | 2 +- test/js/ruby/nodes/class.test.js | 2 +- test/js/ruby/nodes/conditionals.test.js | 2 +- test/js/ruby/nodes/defined.test.js | 2 +- test/js/ruby/nodes/embdoc.test.js | 2 +- test/js/ruby/nodes/hashes.test.js | 2 +- test/js/ruby/nodes/heredocs.test.js | 2 +- test/js/ruby/nodes/hooks.test.js | 2 +- test/js/ruby/nodes/lambda.test.js | 2 +- test/js/ruby/nodes/loops.test.js | 2 +- test/js/ruby/nodes/method.test.js | 2 +- test/js/ruby/nodes/next.test.js | 2 +- test/js/ruby/nodes/patterns.test.js | 2 +- test/js/ruby/nodes/ranges.test.js | 2 +- test/js/ruby/nodes/regexp.test.js | 2 +- test/js/ruby/nodes/rescue.test.js | 2 +- test/js/ruby/nodes/return.test.js | 2 +- test/js/ruby/nodes/strings.test.js | 2 +- test/js/ruby/nodes/super.test.js | 2 +- test/js/ruby/nodes/undef.test.js | 2 +- test/js/setupTests.js | 7 +++-- test/js/utils.js | 21 +++++---------- 56 files changed, 116 insertions(+), 146 deletions(-) delete mode 100755 bin/doc create mode 100755 bin/doc.js delete mode 100755 bin/pragma rename bin/{print => print.js} (57%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8994fa43..64f0fade 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -78,7 +78,8 @@ Effectively, it walks the AST in the reverse direction from the way `Ripper` bui As the nodes are printing themselves and their children, they're additionally building up a second AST. That AST is built using the `builder` commands from prettier core, described [here](https://github.com/prettier/prettier/blob/main/commands.md). As an example, below is how a `binary` node (like the one representing the `1 + 1` above) would handle printing itself: ```javascript -const { group, indent, line } = require("prettier").doc.builders; +import prettier from "prettier"; +const { group, indent, line } = prettier.doc.builders; const printBinary = (path, opts, print) => group([ @@ -163,10 +164,7 @@ Links relating to `prettier` and its plugins. While developing, we've built a couple of small utilities for debugging the `prettier` printing process. To use them, first run `yarn` and `bundle` to install dependencies. -- `bin/lex [file|source]` - outputs the tokens as ripper sees them -- `bin/sexp [file|source]` - outputs the AST that ripper builds before it gets passed back to `prettier` -- `bin/pragma [file]` - runs the `hasPragma` function against the given input file -- `bin/print [file|source]` - outputs the printed source of a Ruby file after running it through `prettier` +- `bin/print.js [file|source]` - outputs the printed source of a Ruby file after running it through `prettier` ## Testing diff --git a/bin/doc b/bin/doc deleted file mode 100755 index 7022b8c6..00000000 --- a/bin/doc +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env node - -const fs = require("fs"); -const prettier = require("prettier"); -const plugin = require("../src/plugin"); - -const debug = prettier.__debug; - -const code = fs.existsSync(process.argv[2]) - ? fs.readFileSync(process.argv[2], "utf-8") - : process.argv.slice(2).join(" ").replace(/\\n/g, "\n"); - -const doc = debug.printToDoc(code, { parser: "ruby", plugins: [plugin] }); -console.log(debug.formatDoc(doc)); diff --git a/bin/doc.js b/bin/doc.js new file mode 100755 index 00000000..857147f5 --- /dev/null +++ b/bin/doc.js @@ -0,0 +1,12 @@ +#!/usr/bin/env node + +import { existsSync, readFileSync } from "fs"; +import { __debug } from "prettier"; +import plugin from "../src/plugin.js"; + +const code = existsSync(process.argv[2]) + ? readFileSync(process.argv[2], "utf-8") + : process.argv.slice(2).join(" ").replace(/\\n/g, "\n"); + +const doc = __debug.printToDoc(code, { parser: "ruby", plugins: [plugin] }); +console.log(__debug.formatDoc(doc)); diff --git a/bin/pragma b/bin/pragma deleted file mode 100755 index c47b52a4..00000000 --- a/bin/pragma +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env node - -const fs = require("fs"); -const parser = require("../src/ruby/parser"); - -console.log(parser.hasPragma(fs.readFileSync(process.argv[2], "utf-8"))); diff --git a/bin/print b/bin/print.js similarity index 57% rename from bin/print rename to bin/print.js index 08391d50..d05fe059 100755 --- a/bin/print +++ b/bin/print.js @@ -1,9 +1,9 @@ #!/usr/bin/env node -const fs = require("fs"); -const prettier = require("prettier"); +import { existsSync, readFileSync } from "fs"; +import { formatWithCursor } from "prettier"; -const plugin = require("../src/plugin"); +import plugin from "../src/plugin.js"; let parser = "ruby"; let contentIdx = 2; @@ -15,16 +15,16 @@ if (["rbs", "haml"].includes(process.argv[contentIdx])) { let content; -if (fs.existsSync(process.argv[contentIdx])) { - content = fs.readFileSync(process.argv[contentIdx], "utf-8"); +if (existsSync(process.argv[contentIdx])) { + content = readFileSync(process.argv[contentIdx], "utf-8"); } else if (process.argv.length === contentIdx) { const extension = parser === "ruby" ? "rb" : parser; - content = fs.readFileSync(`test.${extension}`, "utf-8"); + content = readFileSync(`test.${extension}`, "utf-8"); } else { content = process.argv.slice(contentIdx).join(" ").replace(/\\n/g, "\n"); } -const { formatted } = prettier.formatWithCursor(content, { +const { formatted } = formatWithCursor(content, { parser, plugins: [plugin], cursorOffset: 1 diff --git a/package.json b/package.json index b98dd011..fa38038b 100644 --- a/package.json +++ b/package.json @@ -2,11 +2,12 @@ "name": "@prettier/plugin-ruby", "version": "3.2.2", "description": "prettier plugin for the Ruby programming language", + "type": "module", "main": "src/plugin.js", "scripts": { "checkFormat": "prettier --check '**/*'", "lint": "eslint --cache .", - "test": "jest" + "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js" }, "repository": { "type": "git", @@ -48,7 +49,8 @@ "setupFilesAfterEnv": [ "./test/js/setupTests.js" ], - "testRegex": ".test.js$" + "testRegex": ".test.js$", + "transform": {} }, "husky": { "hooks": { diff --git a/src/getInfo.js b/src/getInfo.js index f4c854af..9aaf353e 100644 --- a/src/getInfo.js +++ b/src/getInfo.js @@ -1,4 +1,4 @@ -const { existsSync, readFileSync } = require("fs"); +import { existsSync, readFileSync } from "fs"; // This is how long to wait for the parser to spin up. For the most part, 5 // seconds is plenty of time. But in some environments, it may be necessary to diff --git a/src/netcat.js b/src/netcat.js index c36e465a..df100d5a 100644 --- a/src/netcat.js +++ b/src/netcat.js @@ -2,7 +2,7 @@ // On average, this is 2-3x slower than netcat, but still much faster than // spawning a new Ruby process. -const { createConnection } = require("net"); +import { createConnection } from "net"; const sock = process.argv[process.argv.length - 1]; const client = createConnection(sock, () => process.stdin.pipe(client)); diff --git a/src/parseSync.js b/src/parseSync.js index 43b8cc4d..623d5c5a 100644 --- a/src/parseSync.js +++ b/src/parseSync.js @@ -1,15 +1,16 @@ -const { spawn, spawnSync } = require("child_process"); -const { +import { spawn, spawnSync } from "child_process"; +import { existsSync, unlinkSync, mkdtempSync, copyFileSync, mkdirSync, rmdirSync -} = require("fs"); -const os = require("os"); -const path = require("path"); -const process = require("process"); +} from "fs"; +import { tmpdir } from "os"; +import path from "path"; +import process from "process"; +import url from "url"; let parserArgs; @@ -22,7 +23,7 @@ if (process.env.PRETTIER_RUBY_HOST) { // parse using UTF-8. Unfortunately, the way that you accomplish this looks // differently depending on your platform. /* istanbul ignore next */ -function getLang() { +export function getLang() { const { env, platform } = process; const envValue = env.LC_ALL || env.LC_CTYPE || env.LANG; @@ -55,8 +56,8 @@ function getLang() { // Generate the filepath that should be used to communicate the connection // information between this process and the parser server. -function getInfoFilepath() { - return path.join(os.tmpdir(), `prettier-ruby-parser-${process.pid}.info`); +export function getInfoFilepath() { + return path.join(tmpdir(), `prettier-ruby-parser-${process.pid}.info`); } // Return the list of plugins that should be passed to the server process. @@ -84,11 +85,11 @@ function getPlugins(opts) { // will read that information in order to enable us to connect to it in the // spawnSync function. function spawnServer(opts) { - const tempDir = mkdtempSync(path.join(os.tmpdir(), "prettier-plugin-ruby-")); + const tempDir = mkdtempSync(path.join(tmpdir(), "prettier-plugin-ruby-")); const filepath = getInfoFilepath(); - let serverRbPath = path.join(__dirname, "./server.rb"); - let getInfoJsPath = path.join(__dirname, "./getInfo.js"); + let serverRbPath = url.fileURLToPath(new URL("./server.rb", import.meta.url)); + let getInfoJsPath = url.fileURLToPath(new URL("./getInfo.js", import.meta.url)); let cleanupTempFiles; if (runningInPnPZip()) { @@ -106,7 +107,7 @@ function spawnServer(opts) { mkdirSync(destDir); } copyFileSync( - path.join(__dirname, "..", "src", rubyFile), + url.fileURLToPath(new URL(`../src/${rubyFile}`, import.meta.url)), path.join(tempDir, rubyFile) ); }); @@ -188,6 +189,7 @@ function spawnServer(opts) { // used by the parser server and the various scripts used to communicate // therein are not going to work with its virtual file system. function runningInPnPZip() { + const __dirname = url.fileURLToPath(new URL(".", import.meta.url)); return process.versions.pnp && __dirname.includes(".zip"); } @@ -195,7 +197,7 @@ function runningInPnPZip() { // like it) here since Prettier requires the results of `parse` to be // synchronous and Node.js does not offer a mechanism for synchronous socket // requests. -function parseSync(parser, source, opts) { +export function parseSync(parser, source, opts) { if (!parserArgs) { parserArgs = spawnServer(opts); } @@ -229,9 +231,3 @@ function parseSync(parser, source, opts) { return parsed; } - -module.exports = { - getLang, - getInfoFilepath, - parseSync -}; diff --git a/src/plugin.js b/src/plugin.js index da98f900..a73392f3 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -1,4 +1,4 @@ -const { parseSync } = require("./parseSync"); +import { parseSync } from "./parseSync.js"; /* * metadata mostly pulled from linguist and rubocop: @@ -177,4 +177,4 @@ const plugin = { } }; -module.exports = plugin; +export default plugin; diff --git a/test/js/files.test.js b/test/js/files.test.js index 90bc1121..35e0f96a 100644 --- a/test/js/files.test.js +++ b/test/js/files.test.js @@ -1,15 +1,13 @@ -const path = require("path"); -const prettier = require("prettier"); +import prettier from "prettier"; +import url from "url"; +import plugin from "../../src/plugin.js"; -const plugin = require("../../src/plugin"); - -function getInferredParser(filename) { - const filepath = path.join(__dirname, filename); +async function getInferredParser(filename) { + const filepath = url.fileURLToPath(new URL(filename, import.meta.url)); const fileInfoOptions = { plugins: [plugin] }; - return prettier - .getFileInfo(filepath, fileInfoOptions) - .then(({ inferredParser }) => inferredParser); + const { inferredParser } = await prettier.getFileInfo(filepath, fileInfoOptions); + return inferredParser; } describe("files", () => { diff --git a/test/js/globalSetup.js b/test/js/globalSetup.js index 6e316c5b..2a80c480 100644 --- a/test/js/globalSetup.js +++ b/test/js/globalSetup.js @@ -1,8 +1,7 @@ -const { spawn, spawnSync } = require("child_process"); -const { unlinkSync } = require("fs"); -const path = require("path"); - -const { getLang, getInfoFilepath } = require("../../src/parseSync"); +import { spawn, spawnSync } from "child_process"; +import { unlinkSync } from "fs"; +import url from "url"; +import { getLang, getInfoFilepath } from "../../src/parseSync.js"; // This is somewhat similar to the spawnServer function in parseSync but // slightly different in that it logs its information into environment variables @@ -17,7 +16,7 @@ function globalSetup() { const filepath = getInfoFilepath(); const server = spawn( "ruby", - [path.join(__dirname, "../../src/server.rb"), "--plugins=", filepath], + [url.fileURLToPath(new URL("../../src/server.rb", import.meta.url)), "--plugins=", filepath], { env: Object.assign({}, process.env, { LANG: getLang() }), detached: true, @@ -27,7 +26,7 @@ function globalSetup() { // Get the connection information from the parsing server. const information = spawnSync("node", [ - path.join(__dirname, "../../src/getInfo.js"), + url.fileURLToPath(new URL("../../src/getInfo.js", import.meta.url)), filepath ]); @@ -42,4 +41,4 @@ function globalSetup() { server.unref(); } -module.exports = globalSetup; +export default globalSetup; diff --git a/test/js/globalTeardown.js b/test/js/globalTeardown.js index 35320778..b4b20e9a 100644 --- a/test/js/globalTeardown.js +++ b/test/js/globalTeardown.js @@ -13,4 +13,4 @@ function globalTeardown() { } } -module.exports = globalTeardown; +export default globalTeardown; diff --git a/test/js/haml/comment.test.js b/test/js/haml/comment.test.js index 4342cdeb..0b29db72 100644 --- a/test/js/haml/comment.test.js +++ b/test/js/haml/comment.test.js @@ -1,4 +1,4 @@ -const { haml } = require("../utils"); +import { haml } from "../utils"; describe("comment", () => { test("single line", () => { diff --git a/test/js/haml/doctype.test.js b/test/js/haml/doctype.test.js index a6ebfcf0..bd1ffe58 100644 --- a/test/js/haml/doctype.test.js +++ b/test/js/haml/doctype.test.js @@ -1,4 +1,4 @@ -const { haml } = require("../utils"); +import { haml } from "../utils"; describe("doctype", () => { test("basic", () => { diff --git a/test/js/haml/filter.test.js b/test/js/haml/filter.test.js index ba01a0e5..711ba4c2 100644 --- a/test/js/haml/filter.test.js +++ b/test/js/haml/filter.test.js @@ -1,4 +1,4 @@ -const { haml } = require("../utils"); +import { haml } from "../utils"; describe("filter", () => { test("self", () => { diff --git a/test/js/haml/hamlComment.test.js b/test/js/haml/hamlComment.test.js index edffe41b..de38dfae 100644 --- a/test/js/haml/hamlComment.test.js +++ b/test/js/haml/hamlComment.test.js @@ -1,4 +1,4 @@ -const { haml } = require("../utils"); +import { haml } from "../utils"; describe("haml comment", () => { test("empty", () => { diff --git a/test/js/haml/plain.test.js b/test/js/haml/plain.test.js index 0058b262..4f824053 100644 --- a/test/js/haml/plain.test.js +++ b/test/js/haml/plain.test.js @@ -1,4 +1,4 @@ -const { haml } = require("../utils"); +import { haml } from "../utils"; describe("plain", () => { const specialChars = ["%", ".", "#", "/", "!", "=", "&", "~", "-", "\\", ":"]; diff --git a/test/js/haml/script.test.js b/test/js/haml/script.test.js index 510c30c0..440d6a1e 100644 --- a/test/js/haml/script.test.js +++ b/test/js/haml/script.test.js @@ -1,4 +1,4 @@ -const { haml } = require("../utils"); +import { haml } from "../utils"; describe("script", () => { test("single line", () => { diff --git a/test/js/haml/silentScript.test.js b/test/js/haml/silentScript.test.js index af626f38..d263bd14 100644 --- a/test/js/haml/silentScript.test.js +++ b/test/js/haml/silentScript.test.js @@ -1,4 +1,4 @@ -const { haml } = require("../utils"); +import { haml } from "../utils"; describe("silent script", () => { test("single line", () => { diff --git a/test/js/haml/tag.test.js b/test/js/haml/tag.test.js index 978837d8..59749792 100644 --- a/test/js/haml/tag.test.js +++ b/test/js/haml/tag.test.js @@ -1,4 +1,4 @@ -const { long, haml } = require("../utils"); +import { long, haml } from "../utils"; describe("tag", () => { test("class", () => { diff --git a/test/js/rbs/rbs.test.js b/test/js/rbs/rbs.test.js index 8ac2f838..7cd9852b 100644 --- a/test/js/rbs/rbs.test.js +++ b/test/js/rbs/rbs.test.js @@ -1,11 +1,9 @@ -const fs = require("fs"); -const os = require("os"); -const path = require("path"); - -const { atLeastVersion, rbs } = require("../utils"); +import { readFileSync } from "fs"; +import { platform } from "os"; +import { atLeastVersion, rbs } from "../utils"; function testCases(name, transform) { - const buffer = fs.readFileSync(path.resolve(__dirname, `${name}.txt`)); + const buffer = readFileSync(new URL(`${name}.txt`, import.meta.url)); const sources = buffer.toString().slice(0, -1).split(/\r?\n/); sources.forEach((source) => { @@ -301,7 +299,7 @@ describe("rbs", () => { // For some reason these tests are failing on windows on Ruby < 3.0. I'm not // sure why, but I'm leaving it here for now. - if (os.platform() !== "win32" || atLeastVersion("3.0")) { + if (platform() !== "win32" || atLeastVersion("3.0")) { describe("non-ASCII", () => { test("emoji", () => { expect(rbs(`T: { "🌼" => Integer }`)).toMatchFormat(); diff --git a/test/js/ruby/comments.test.js b/test/js/ruby/comments.test.js index d361880a..789747a6 100644 --- a/test/js/ruby/comments.test.js +++ b/test/js/ruby/comments.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("../utils"); +import { ruby } from "../utils.js"; describe("comments", () => { describe("on their own line", () => { diff --git a/test/js/ruby/errors.test.js b/test/js/ruby/errors.test.js index 4f90e2cd..124fd8cf 100644 --- a/test/js/ruby/errors.test.js +++ b/test/js/ruby/errors.test.js @@ -1,4 +1,4 @@ -const prettier = require("prettier"); +import prettier from "prettier"; describe("errors", () => { const cases = [ @@ -14,9 +14,6 @@ describe("errors", () => { ]; test.each(cases)("fails for %s", (content) => { - const format = () => - prettier.format(content, { parser: "ruby", plugins: ["."] }); - - expect(format).toThrow(); + expect(() => prettier.format(content, { parser: "ruby", plugins: ["."] })).toThrow(); }); }); diff --git a/test/js/ruby/ignore.test.js b/test/js/ruby/ignore.test.js index e1855482..43578683 100644 --- a/test/js/ruby/ignore.test.js +++ b/test/js/ruby/ignore.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("../utils"); +import { ruby } from "../utils.js"; describe("ignore", () => { test("you can ignore code blocks", () => { diff --git a/test/js/ruby/layout.test.js b/test/js/ruby/layout.test.js index b94fa48d..8c1716a3 100644 --- a/test/js/ruby/layout.test.js +++ b/test/js/ruby/layout.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("../utils"); +import { ruby } from "../utils.js"; describe("layout", () => { test("turns multiple blank lines into just one blank line", () => { diff --git a/test/js/ruby/nodes/alias.test.js b/test/js/ruby/nodes/alias.test.js index f29c6c01..226cdfb2 100644 --- a/test/js/ruby/nodes/alias.test.js +++ b/test/js/ruby/nodes/alias.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils.js"; describe("alias", () => { test("bare word aliases", () => { diff --git a/test/js/ruby/nodes/aref.test.js b/test/js/ruby/nodes/aref.test.js index d18d7230..738d2e68 100644 --- a/test/js/ruby/nodes/aref.test.js +++ b/test/js/ruby/nodes/aref.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("../../utils"); +import { ruby } from "../../utils.js"; describe("aref", () => { test("literal reference", () => { diff --git a/test/js/ruby/nodes/arrays.test.js b/test/js/ruby/nodes/arrays.test.js index 72c55465..8e632912 100644 --- a/test/js/ruby/nodes/arrays.test.js +++ b/test/js/ruby/nodes/arrays.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils.js"; describe("array", () => { test("empty arrays", () => { diff --git a/test/js/ruby/nodes/assign.test.js b/test/js/ruby/nodes/assign.test.js index 44eca0a0..032cf7a3 100644 --- a/test/js/ruby/nodes/assign.test.js +++ b/test/js/ruby/nodes/assign.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils.js"; describe("assign", () => { describe("single assignment", () => { diff --git a/test/js/ruby/nodes/binary.test.js b/test/js/ruby/nodes/binary.test.js index e02693bd..6589b508 100644 --- a/test/js/ruby/nodes/binary.test.js +++ b/test/js/ruby/nodes/binary.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils.js"; describe("binary", () => { test("single line", () => { diff --git a/test/js/ruby/nodes/blocks.test.js b/test/js/ruby/nodes/blocks.test.js index 74b45120..151d7c4f 100644 --- a/test/js/ruby/nodes/blocks.test.js +++ b/test/js/ruby/nodes/blocks.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils.js"; describe("blocks", () => { test("empty", () => { diff --git a/test/js/ruby/nodes/break.test.js b/test/js/ruby/nodes/break.test.js index 8842d5f6..14816781 100644 --- a/test/js/ruby/nodes/break.test.js +++ b/test/js/ruby/nodes/break.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("../../utils"); +import { ruby } from "../../utils.js"; describe("break", () => { test("empty break", () => { diff --git a/test/js/ruby/nodes/calls.test.js b/test/js/ruby/nodes/calls.test.js index bab58d43..a7a89343 100644 --- a/test/js/ruby/nodes/calls.test.js +++ b/test/js/ruby/nodes/calls.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils.js"; describe("calls", () => { test("simple calls", () => { diff --git a/test/js/ruby/nodes/case.test.js b/test/js/ruby/nodes/case.test.js index 1be33ef4..5c2c4b19 100644 --- a/test/js/ruby/nodes/case.test.js +++ b/test/js/ruby/nodes/case.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils.js"; describe("case", () => { test("empty case", () => { diff --git a/test/js/ruby/nodes/class.test.js b/test/js/ruby/nodes/class.test.js index e2c82bf6..81c4be6e 100644 --- a/test/js/ruby/nodes/class.test.js +++ b/test/js/ruby/nodes/class.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils.js"; describe("class", () => { test("basic nesting", () => { diff --git a/test/js/ruby/nodes/conditionals.test.js b/test/js/ruby/nodes/conditionals.test.js index 89506951..1f6af635 100644 --- a/test/js/ruby/nodes/conditionals.test.js +++ b/test/js/ruby/nodes/conditionals.test.js @@ -1,4 +1,4 @@ -const { long, ruby, atLeastVersion } = require("../../utils"); +import { long, ruby, atLeastVersion } from "../../utils.js"; describe("conditionals", () => { describe("not operator", () => { diff --git a/test/js/ruby/nodes/defined.test.js b/test/js/ruby/nodes/defined.test.js index d1503a03..5a7154f9 100644 --- a/test/js/ruby/nodes/defined.test.js +++ b/test/js/ruby/nodes/defined.test.js @@ -1,4 +1,4 @@ -const { long } = require("../../utils"); +import { long } from "../../utils.js"; describe("defined", () => { test("no parens", () => { diff --git a/test/js/ruby/nodes/embdoc.test.js b/test/js/ruby/nodes/embdoc.test.js index e6e9b6f1..b531f650 100644 --- a/test/js/ruby/nodes/embdoc.test.js +++ b/test/js/ruby/nodes/embdoc.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("../../utils"); +import { ruby } from "../../utils.js"; describe("embdoc", () => { test("basic embdocs", () => { diff --git a/test/js/ruby/nodes/hashes.test.js b/test/js/ruby/nodes/hashes.test.js index 7e8478a5..4cf71034 100644 --- a/test/js/ruby/nodes/hashes.test.js +++ b/test/js/ruby/nodes/hashes.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils.js"; describe("hash", () => { test("empty", () => { diff --git a/test/js/ruby/nodes/heredocs.test.js b/test/js/ruby/nodes/heredocs.test.js index a348b3bd..1a1a92c1 100644 --- a/test/js/ruby/nodes/heredocs.test.js +++ b/test/js/ruby/nodes/heredocs.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils.js"; describe("heredocs", () => { describe("straight", () => { diff --git a/test/js/ruby/nodes/hooks.test.js b/test/js/ruby/nodes/hooks.test.js index 2d7b0cb1..34a81842 100644 --- a/test/js/ruby/nodes/hooks.test.js +++ b/test/js/ruby/nodes/hooks.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils.js"; describe.each(["BEGIN", "END"])("%s hook", (hook) => { test("shortens to one line", () => { diff --git a/test/js/ruby/nodes/lambda.test.js b/test/js/ruby/nodes/lambda.test.js index 8a9588f7..f8abd31f 100644 --- a/test/js/ruby/nodes/lambda.test.js +++ b/test/js/ruby/nodes/lambda.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils.js"; describe("lambda", () => { test("plain stabby lambda literal", () => { diff --git a/test/js/ruby/nodes/loops.test.js b/test/js/ruby/nodes/loops.test.js index d08dfcf6..f68fcff6 100644 --- a/test/js/ruby/nodes/loops.test.js +++ b/test/js/ruby/nodes/loops.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils.js"; describe.each(["while", "until"])("%s", (keyword) => { test("aligns predicates", () => { diff --git a/test/js/ruby/nodes/method.test.js b/test/js/ruby/nodes/method.test.js index 288885ba..8c88e475 100644 --- a/test/js/ruby/nodes/method.test.js +++ b/test/js/ruby/nodes/method.test.js @@ -1,4 +1,4 @@ -const { atLeastVersion, long, ruby } = require("../../utils"); +import { atLeastVersion, long, ruby } from "../../utils.js"; describe("method", () => { describe("definitions", () => { diff --git a/test/js/ruby/nodes/next.test.js b/test/js/ruby/nodes/next.test.js index 53d2629b..d1a5690d 100644 --- a/test/js/ruby/nodes/next.test.js +++ b/test/js/ruby/nodes/next.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("../../utils"); +import { ruby } from "../../utils.js"; describe("next", () => { test("bare", () => { diff --git a/test/js/ruby/nodes/patterns.test.js b/test/js/ruby/nodes/patterns.test.js index 6e5117fc..dcd17838 100644 --- a/test/js/ruby/nodes/patterns.test.js +++ b/test/js/ruby/nodes/patterns.test.js @@ -1,4 +1,4 @@ -const { atLeastVersion, atMostVersion, ruby } = require("../../utils"); +import { atLeastVersion, atMostVersion, ruby } from "../../utils.js"; describe("patterns", () => { if (atMostVersion("2.7")) { diff --git a/test/js/ruby/nodes/ranges.test.js b/test/js/ruby/nodes/ranges.test.js index 62d6a8cb..dd755db9 100644 --- a/test/js/ruby/nodes/ranges.test.js +++ b/test/js/ruby/nodes/ranges.test.js @@ -1,4 +1,4 @@ -const { atLeastVersion } = require("../../utils"); +import { atLeastVersion } from "../../utils.js"; describe("ranges", () => { test("two dot", () => { diff --git a/test/js/ruby/nodes/regexp.test.js b/test/js/ruby/nodes/regexp.test.js index 5ff7983e..825a827b 100644 --- a/test/js/ruby/nodes/regexp.test.js +++ b/test/js/ruby/nodes/regexp.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("../../utils"); +import { ruby } from "../../utils.js"; describe("regexp", () => { test("basic", () => { diff --git a/test/js/ruby/nodes/rescue.test.js b/test/js/ruby/nodes/rescue.test.js index 30e4c9b4..ae75bb78 100644 --- a/test/js/ruby/nodes/rescue.test.js +++ b/test/js/ruby/nodes/rescue.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("../../utils"); +import { ruby } from "../../utils.js"; describe("rescue", () => { test("inline", () => { diff --git a/test/js/ruby/nodes/return.test.js b/test/js/ruby/nodes/return.test.js index 94f3c842..f99ab392 100644 --- a/test/js/ruby/nodes/return.test.js +++ b/test/js/ruby/nodes/return.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils.js"; describe("return", () => { test("bare", () => { diff --git a/test/js/ruby/nodes/strings.test.js b/test/js/ruby/nodes/strings.test.js index e085a62b..7ad47f9d 100644 --- a/test/js/ruby/nodes/strings.test.js +++ b/test/js/ruby/nodes/strings.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils.js"; describe("strings", () => { describe("%-literals with escape sequences in the middle", () => { diff --git a/test/js/ruby/nodes/super.test.js b/test/js/ruby/nodes/super.test.js index 0ed4b73c..ae08bf5e 100644 --- a/test/js/ruby/nodes/super.test.js +++ b/test/js/ruby/nodes/super.test.js @@ -1,4 +1,4 @@ -const { ruby } = require("../../utils"); +import { ruby } from "../../utils.js"; describe("super", () => { test("bare", () => { diff --git a/test/js/ruby/nodes/undef.test.js b/test/js/ruby/nodes/undef.test.js index cdef0e48..fb052469 100644 --- a/test/js/ruby/nodes/undef.test.js +++ b/test/js/ruby/nodes/undef.test.js @@ -1,4 +1,4 @@ -const { long, ruby } = require("../../utils"); +import { long, ruby } from "../../utils.js"; describe("undef", () => { test("single inline", () => { diff --git a/test/js/setupTests.js b/test/js/setupTests.js index 266cf2df..32e9fd71 100644 --- a/test/js/setupTests.js +++ b/test/js/setupTests.js @@ -1,6 +1,5 @@ -const prettier = require("prettier"); - -const plugin = require("../../src/plugin"); +import { format } from "prettier"; +import plugin from "../../src/plugin.js"; function normalize(code) { const string = typeof code === "string" ? code : code.code; @@ -9,7 +8,7 @@ function normalize(code) { function checkFormat(before, after) { const originalText = typeof before === "string" ? before : before.code; - const formatted = prettier.format(originalText, { + const formatted = format(originalText, { parser: typeof before === "string" ? "ruby" : before.parser, plugins: [plugin] }); diff --git a/test/js/utils.js b/test/js/utils.js index ae0584f6..8ca50d04 100644 --- a/test/js/utils.js +++ b/test/js/utils.js @@ -1,4 +1,4 @@ -const long = Array(80).fill("a").join(""); +export const long = Array(80).fill("a").join(""); function stripLeadingWhitespace(code) { if (!code.includes("\n")) { @@ -13,15 +13,15 @@ function stripLeadingWhitespace(code) { return content.map((line) => line.slice(indent)).join("\n"); } -function ruby(code) { +export function ruby(code) { return stripLeadingWhitespace(code); } -function rbs(code) { +export function rbs(code) { return { code: stripLeadingWhitespace(code), parser: "rbs" }; } -function haml(code) { +export function haml(code) { return { code: stripLeadingWhitespace(code), parser: "haml" }; } @@ -30,19 +30,10 @@ function haml(code) { // should be always available. TypeScript doesn't know that though, so we // explicitly allow it to be undefined by coalescing with the empty string. -function atLeastVersion(version) { +export function atLeastVersion(version) { return (process.env.RUBY_VERSION || "") >= version; } -function atMostVersion(version) { +export function atMostVersion(version) { return (process.env.RUBY_VERSION || "") < version; } - -module.exports = { - long, - ruby, - rbs, - haml, - atLeastVersion, - atMostVersion -}; From 0747bf50ede4282c33587846960738fe62ee13a5 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 18 Oct 2022 13:40:40 -0400 Subject: [PATCH 651/785] Increment prettier version --- package.json | 2 +- src/plugin.js | 6 +++--- src/server.rb | 9 +++------ test/js/files.test.js | 4 ++-- test/js/ruby/errors.test.js | 6 +++--- test/js/setupTests.js | 4 ++-- yarn.lock | 8 ++++---- 7 files changed, 18 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index fa38038b..badce11e 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ }, "homepage": "https://github.com/prettier/plugin-ruby#readme", "dependencies": { - "prettier": ">=2.3.0" + "prettier": ">=3.0.0-alpha.2" }, "devDependencies": { "eslint": "^8.15.0", diff --git a/src/plugin.js b/src/plugin.js index a73392f3..6fa3f1da 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -81,7 +81,7 @@ const plugin = { ], parsers: { ruby: { - parse(text, _parsers, opts) { + parse(text, opts) { return parseSync("ruby", text, opts); }, astFormat: "ruby", @@ -96,7 +96,7 @@ const plugin = { } }, rbs: { - parse(text, _parsers, opts) { + parse(text, opts) { return parseSync("rbs", text, opts); }, astFormat: "rbs", @@ -111,7 +111,7 @@ const plugin = { } }, haml: { - parse(text, _parsers, opts) { + parse(text, opts) { return parseSync("haml", text, opts); }, astFormat: "haml", diff --git a/src/server.rb b/src/server.rb index 86741a76..7aa860eb 100644 --- a/src/server.rb +++ b/src/server.rb @@ -122,16 +122,13 @@ formatter.flush formatter.output.join when "haml" - formatter_class = + formatter = if defined?(SyntaxTree::Haml::Format::Formatter) - SyntaxTree::Haml::Format::Formatter + SyntaxTree::Haml::Format::Formatter.new(source, +"", maxwidth, "\n", &genspace) else - PrettierPrint + PrettierPrint.new(+"", maxwidth, "\n", &genspace) end - formatter = - formatter_class.new(source, +"", maxwidth, "\n", &genspace) - SyntaxTree::Haml.parse(source).format(formatter) formatter.flush formatter.output diff --git a/test/js/files.test.js b/test/js/files.test.js index 35e0f96a..f3cbec0e 100644 --- a/test/js/files.test.js +++ b/test/js/files.test.js @@ -1,4 +1,4 @@ -import prettier from "prettier"; +import { getFileInfo } from "prettier"; import url from "url"; import plugin from "../../src/plugin.js"; @@ -6,7 +6,7 @@ async function getInferredParser(filename) { const filepath = url.fileURLToPath(new URL(filename, import.meta.url)); const fileInfoOptions = { plugins: [plugin] }; - const { inferredParser } = await prettier.getFileInfo(filepath, fileInfoOptions); + const { inferredParser } = await getFileInfo(filepath, fileInfoOptions); return inferredParser; } diff --git a/test/js/ruby/errors.test.js b/test/js/ruby/errors.test.js index 124fd8cf..f2655f6a 100644 --- a/test/js/ruby/errors.test.js +++ b/test/js/ruby/errors.test.js @@ -1,6 +1,6 @@ -import prettier from "prettier"; +import { format } from "prettier"; -describe("errors", () => { +describe.skip("errors", () => { const cases = [ "alias $a $1", "self = 1", @@ -14,6 +14,6 @@ describe("errors", () => { ]; test.each(cases)("fails for %s", (content) => { - expect(() => prettier.format(content, { parser: "ruby", plugins: ["."] })).toThrow(); + expect(() => format(content, { parser: "ruby", plugins: ["."] })).toThrow(); }); }); diff --git a/test/js/setupTests.js b/test/js/setupTests.js index 32e9fd71..c0459fb0 100644 --- a/test/js/setupTests.js +++ b/test/js/setupTests.js @@ -6,9 +6,9 @@ function normalize(code) { return string.replace(/\r?\n/g, "\n").trim(); } -function checkFormat(before, after) { +async function checkFormat(before, after) { const originalText = typeof before === "string" ? before : before.code; - const formatted = format(originalText, { + const formatted = await format(originalText, { parser: typeof before === "string" ? "ruby" : before.parser, plugins: [plugin] }); diff --git a/yarn.lock b/yarn.lock index 2c8220c5..203b4121 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2316,10 +2316,10 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prettier@>=2.3.0: - version "2.7.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" - integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== +prettier@>=3.0.0-alpha.2: + version "3.0.0-alpha.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0-alpha.2.tgz#b2e7698f8feb420e2e4347e19e9b7535d8188977" + integrity sha512-GTYhS1pykp0vIoV8ySOvBxc/SFAoot2rOir/QCh1KQXWYdrS9q/k73uKbwXPuUDMlcwZAasuyI0Mg7PZ1p/qRQ== pretty-format@^29.2.0: version "29.2.0" From c64944d60e7350a762add8eb4f0c7ed267095975 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 18 Oct 2022 17:52:46 -0400 Subject: [PATCH 652/785] Update tests and lint to match --- .github/workflows/main.yml | 2 +- bin/print.js | 6 +- package.json | 9 +- src/getInfo.js | 23 --- src/netcat.js | 13 -- src/parse.js | 211 +++++++++++++++++++++ src/parseSync.js | 233 ------------------------ src/plugin.js | 8 +- src/server.rb | 91 ++++----- test/js/files.test.js | 18 +- test/js/globalSetup.js | 50 ++--- test/js/globalTeardown.js | 6 +- test/js/haml/comment.test.js | 10 +- test/js/haml/doctype.test.js | 20 +- test/js/haml/filter.test.js | 6 +- test/js/haml/hamlComment.test.js | 8 +- test/js/haml/plain.test.js | 4 +- test/js/haml/script.test.js | 10 +- test/js/haml/silentScript.test.js | 12 +- test/js/haml/tag.test.js | 52 +++--- test/js/rbs/rbs.test.js | 66 +++---- test/js/ruby/comments.test.js | 40 ++-- test/js/ruby/encoding.test.js | 8 +- test/js/ruby/errors.test.js | 11 +- test/js/ruby/ignore.test.js | 2 +- test/js/ruby/layout.test.js | 10 +- test/js/ruby/nodes/alias.test.js | 24 +-- test/js/ruby/nodes/aref.test.js | 12 +- test/js/ruby/nodes/arrays.test.js | 48 ++--- test/js/ruby/nodes/assign.test.js | 30 +-- test/js/ruby/nodes/binary.test.js | 10 +- test/js/ruby/nodes/blocks.test.js | 60 +++--- test/js/ruby/nodes/break.test.js | 14 +- test/js/ruby/nodes/calls.test.js | 38 ++-- test/js/ruby/nodes/case.test.js | 16 +- test/js/ruby/nodes/class.test.js | 24 +-- test/js/ruby/nodes/conditionals.test.js | 126 ++++++------- test/js/ruby/nodes/defined.test.js | 14 +- test/js/ruby/nodes/embdoc.test.js | 6 +- test/js/ruby/nodes/field.test.js | 6 +- test/js/ruby/nodes/hashes.test.js | 56 +++--- test/js/ruby/nodes/heredocs.test.js | 88 ++++----- test/js/ruby/nodes/hooks.test.js | 16 +- test/js/ruby/nodes/kwargs.test.js | 6 +- test/js/ruby/nodes/lambda.test.js | 28 +-- test/js/ruby/nodes/loops.test.js | 36 ++-- test/js/ruby/nodes/massign.test.js | 32 ++-- test/js/ruby/nodes/method.test.js | 116 ++++++------ test/js/ruby/nodes/next.test.js | 12 +- test/js/ruby/nodes/numbers.test.js | 24 +-- test/js/ruby/nodes/patterns.test.js | 22 +-- test/js/ruby/nodes/ranges.test.js | 16 +- test/js/ruby/nodes/regexp.test.js | 34 ++-- test/js/ruby/nodes/rescue.test.js | 22 +-- test/js/ruby/nodes/return.test.js | 38 ++-- test/js/ruby/nodes/strings.test.js | 102 +++++------ test/js/ruby/nodes/super.test.js | 28 +-- test/js/ruby/nodes/unary.test.js | 4 +- test/js/ruby/nodes/undef.test.js | 16 +- test/js/ruby/nodes/yield.test.js | 10 +- 60 files changed, 997 insertions(+), 1066 deletions(-) delete mode 100644 src/getInfo.js delete mode 100644 src/netcat.js create mode 100644 src/parse.js delete mode 100644 src/parseSync.js diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bcc38d69..4d69a776 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,7 @@ jobs: ruby-version: ${{ matrix.ruby }} - uses: actions/setup-node@v2 with: - node-version: 16.x + node-version: 18.x cache: yarn - run: yarn install --frozen-lockfile - run: yarn test diff --git a/bin/print.js b/bin/print.js index d05fe059..51a3d1e9 100755 --- a/bin/print.js +++ b/bin/print.js @@ -24,10 +24,8 @@ if (existsSync(process.argv[contentIdx])) { content = process.argv.slice(contentIdx).join(" ").replace(/\\n/g, "\n"); } -const { formatted } = formatWithCursor(content, { +formatWithCursor(content, { parser, plugins: [plugin], cursorOffset: 1 -}); - -console.log(formatted); +}).then(({ formatted }) => console.log(formatted)); diff --git a/package.json b/package.json index badce11e..d2f552f3 100644 --- a/package.json +++ b/package.json @@ -35,12 +35,15 @@ "prettier" ], "env": { - "es6": true, "jest": true, "node": true }, + "parserOptions": { + "ecmaVersion": 2020, + "sourceType": "module" + }, "rules": { - "no-unused-vars": "off" + "no-undef": "off" } }, "jest": { @@ -60,7 +63,7 @@ "prettier": { "trailingComma": "none", "plugins": [ - "." + "./src/plugin.js" ] } } diff --git a/src/getInfo.js b/src/getInfo.js deleted file mode 100644 index 9aaf353e..00000000 --- a/src/getInfo.js +++ /dev/null @@ -1,23 +0,0 @@ -import { existsSync, readFileSync } from "fs"; - -// This is how long to wait for the parser to spin up. For the most part, 5 -// seconds is plenty of time. But in some environments, it may be necessary to -// increase this value. -const timeoutMs = parseInt(process.env.PRETTIER_RUBY_TIMEOUT_MS || "5000", 10); - -const filepath = process.argv[process.argv.length - 1]; - -const timeout = setTimeout(() => { - clearInterval(interval); - throw new Error(`Failed to get information from parse server in time. If this - happens repeatedly, try increasing the PRETTIER_RUBY_TIMEOUT_MS environment - variable beyond 5000.`); -}, timeoutMs); - -const interval = setInterval(() => { - if (existsSync(filepath)) { - process.stdout.write(readFileSync(filepath).toString("utf8")); - clearTimeout(timeout); - clearInterval(interval); - } -}, 100); diff --git a/src/netcat.js b/src/netcat.js deleted file mode 100644 index df100d5a..00000000 --- a/src/netcat.js +++ /dev/null @@ -1,13 +0,0 @@ -// A simple fallback when no netcat-compatible adapter is found on the system. -// On average, this is 2-3x slower than netcat, but still much faster than -// spawning a new Ruby process. - -import { createConnection } from "net"; - -const sock = process.argv[process.argv.length - 1]; -const client = createConnection(sock, () => process.stdin.pipe(client)); - -client.on("data", (data) => process.stdout.write(data)); -client.on("error", (error) => { - console.error(error); -}); diff --git a/src/parse.js b/src/parse.js new file mode 100644 index 00000000..1e6f536a --- /dev/null +++ b/src/parse.js @@ -0,0 +1,211 @@ +import { spawn } from "child_process"; +import fs from "fs"; +import net from "net"; +import os from "os"; +import path from "path"; +import process from "process"; +import url from "url"; + +// In order to properly parse ruby code, we need to tell the ruby process to +// parse using UTF-8. Unfortunately, the way that you accomplish this looks +// differently depending on your platform. +/* istanbul ignore next */ +function getLang() { + const { env, platform } = process; + const envValue = env.LC_ALL || env.LC_CTYPE || env.LANG; + + // If an env var is set for the locale that already includes UTF-8 in the + // name, then assume we can go with that. + if (envValue && envValue.includes("UTF-8")) { + return envValue; + } + + // Otherwise, we're going to guess which encoding to use based on the system. + // This is probably not the best approach in the world, as you could be on + // linux and not have C.UTF-8, but in that case you're probably passing an env + // var for it. This object below represents all of the possible values of + // process.platform per: + // https://nodejs.org/api/process.html#process_process_platform + return { + aix: "C.UTF-8", + android: "C.UTF-8", + cygwin: "C.UTF-8", + darwin: "en_US.UTF-8", + freebsd: "C.UTF-8", + haiku: "C.UTF-8", + linux: "C.UTF-8", + netbsd: "C.UTF-8", + openbsd: "C.UTF-8", + sunos: "C.UTF-8", + win32: ".UTF-8" + }[platform]; +} + +// Return the list of plugins that should be passed to the server process. +function getPlugins(opts) { + const plugins = new Set(); + + const rubyPlugins = opts.rubyPlugins.trim(); + if (rubyPlugins.length > 0) { + rubyPlugins.split(",").forEach((plugin) => plugins.add(plugin.trim())); + } + + if (opts.rubySingleQuote) { + plugins.add("plugin/single_quotes"); + } + + if (opts.trailingComma !== "none") { + plugins.add("plugin/trailing_comma"); + } + + return Array.from(plugins); +} + +// Create a file that will act as a communication mechanism, spawn a parser +// server with that filepath as an argument, then wait for the file to be +// created that will contain the connection information. +export async function spawnServer(opts) { + const tmpdir = os.tmpdir(); + let serverFilepath = url.fileURLToPath( + new URL("./server.rb", import.meta.url) + ); + + // If we're in a yarn Plug'n'Play environment, then the relative paths being + // used by the parser server are not going to work with its virtual file + // system. + if (process.versions.pnp) { + if (url.fileURLToPath(new URL(".", import.meta.url)).includes(".zip")) { + // serverRbPath = path.join(tmpdir, "server.rb"); + // const rubyFile = "server.rb"; + // const destDir = path.join(tmpdir, path.dirname(rubyFile)); + // if (!existsSync(destDir)) { + // mkdirSync(destDir); + // } + // copyFileSync( + // url.fileURLToPath(new URL(`../src/${rubyFile}`, import.meta.url)), + // path.join(tmpdir, rubyFile) + // ); + // cleanupTempFiles = () => { + // const tmpFilePath = path.join(tmpdir, "server.rb"); + // if (existsSync(tmpFilePath)) { + // unlinkSync(tmpFilePath); + // } + // const tempSubdir = path.join(tmpdir, path.dirname("server.rb")); + // if (existsSync(tempSubdir)) { + // rmdirSync(tempSubdir); + // } + // }; + } + } + + const filepath = path.join( + tmpdir, + `prettier-ruby-parser-${process.pid}.info` + ); + const server = spawn( + "ruby", + [serverFilepath, `--plugins=${getPlugins(opts).join(",")}`, filepath], + { + env: Object.assign({}, process.env, { LANG: getLang() }), + stdio: "ignore", + detached: true + } + ); + + server.unref(); + + process.on("exit", () => { + if (fs.existsSync(filepath)) { + fs.unlinkSync(filepath); + } + + try { + if (server.pid) { + // Kill the server process if it's still running. If we're on windows + // we're going to use the process ID number. If we're not, we're going + // to use the negative process ID to indicate the group. + const pid = process.platform === "win32" ? server.pid : -server.pid; + process.kill(pid); + } + } catch (error) { + if (process.env.PLUGIN_RUBY_CI) { + throw new Error(`Failed to kill the parser server: ${error}`); + } + } + }); + + return new Promise((resolve, reject) => { + const timeout = setTimeout( + () => { + clearInterval(interval); + reject( + new Error( + "Failed to get connection options from parse server in time. If this happens repeatedly, try increasing the PRETTIER_RUBY_TIMEOUT_MS environment variable beyond 5000." + ) + ); + }, + parseInt(process.env.PRETTIER_RUBY_TIMEOUT_MS || "5000", 10) + ); + + const interval = setInterval(() => { + if (fs.existsSync(filepath)) { + resolve({ + serverPID: server.pid, + connectionOptions: JSON.parse( + fs.readFileSync(filepath).toString("utf-8") + ) + }); + + clearTimeout(timeout); + clearInterval(interval); + } + }, 100); + }); +} + +let connectionOptions; +if (process.env.PRETTIER_RUBY_HOST) { + connectionOptions = JSON.parse(process.env.PRETTIER_RUBY_HOST); +} + +// Formats and sends a request to the parser server. We use netcat (or something +// like it) here since Prettier requires the results of `parse` to be +// synchronous and Node.js does not offer a mechanism for synchronous socket +// requests. +export async function parse(parser, source, opts) { + if (!connectionOptions) { + const spawnedServer = await spawnServer(opts); + connectionOptions = spawnedServer.connectionOptions; + } + + return new Promise((resolve, reject) => { + const socket = new net.Socket(); + + socket.on("error", reject); + socket.on("data", (data) => { + const response = JSON.parse(data.toString("utf-8")); + + if (response.error) { + const error = new Error(response.error); + if (response.loc) { + error.loc = response.loc; + } + + reject(error); + } + + resolve(response); + }); + + socket.connect(connectionOptions, () => { + socket.end( + JSON.stringify({ + parser, + source, + maxwidth: opts.printWidth, + tabwidth: opts.tabWidth + }) + ); + }); + }); +} diff --git a/src/parseSync.js b/src/parseSync.js deleted file mode 100644 index 623d5c5a..00000000 --- a/src/parseSync.js +++ /dev/null @@ -1,233 +0,0 @@ -import { spawn, spawnSync } from "child_process"; -import { - existsSync, - unlinkSync, - mkdtempSync, - copyFileSync, - mkdirSync, - rmdirSync -} from "fs"; -import { tmpdir } from "os"; -import path from "path"; -import process from "process"; -import url from "url"; - -let parserArgs; - -if (process.env.PRETTIER_RUBY_HOST) { - const [cmd, ...args] = process.env.PRETTIER_RUBY_HOST.split(" "); - parserArgs = { cmd, args }; -} - -// In order to properly parse ruby code, we need to tell the ruby process to -// parse using UTF-8. Unfortunately, the way that you accomplish this looks -// differently depending on your platform. -/* istanbul ignore next */ -export function getLang() { - const { env, platform } = process; - const envValue = env.LC_ALL || env.LC_CTYPE || env.LANG; - - // If an env var is set for the locale that already includes UTF-8 in the - // name, then assume we can go with that. - if (envValue && envValue.includes("UTF-8")) { - return envValue; - } - - // Otherwise, we're going to guess which encoding to use based on the system. - // This is probably not the best approach in the world, as you could be on - // linux and not have C.UTF-8, but in that case you're probably passing an env - // var for it. This object below represents all of the possible values of - // process.platform per: - // https://nodejs.org/api/process.html#process_process_platform - return { - aix: "C.UTF-8", - android: "C.UTF-8", - cygwin: "C.UTF-8", - darwin: "en_US.UTF-8", - freebsd: "C.UTF-8", - haiku: "C.UTF-8", - linux: "C.UTF-8", - netbsd: "C.UTF-8", - openbsd: "C.UTF-8", - sunos: "C.UTF-8", - win32: ".UTF-8" - }[platform]; -} - -// Generate the filepath that should be used to communicate the connection -// information between this process and the parser server. -export function getInfoFilepath() { - return path.join(tmpdir(), `prettier-ruby-parser-${process.pid}.info`); -} - -// Return the list of plugins that should be passed to the server process. -function getPlugins(opts) { - const plugins = new Set(); - - const rubyPlugins = opts.rubyPlugins.trim(); - if (rubyPlugins.length > 0) { - rubyPlugins.split(",").forEach((plugin) => plugins.add(plugin.trim())); - } - - if (opts.rubySingleQuote) { - plugins.add("plugin/single_quotes"); - } - - if (opts.trailingComma !== "none") { - plugins.add("plugin/trailing_comma"); - } - - return Array.from(plugins); -} - -// Create a file that will act as a communication mechanism, spawn a parser -// server with that filepath as an argument, then spawn another process that -// will read that information in order to enable us to connect to it in the -// spawnSync function. -function spawnServer(opts) { - const tempDir = mkdtempSync(path.join(tmpdir(), "prettier-plugin-ruby-")); - const filepath = getInfoFilepath(); - - let serverRbPath = url.fileURLToPath(new URL("./server.rb", import.meta.url)); - let getInfoJsPath = url.fileURLToPath(new URL("./getInfo.js", import.meta.url)); - let cleanupTempFiles; - - if (runningInPnPZip()) { - // If we're running in a Yarn PnP environment inside a ZIP file, it's not possible to run - // the Ruby server or the getInfo.js script directly. Instead, we need to copy them and all - // the files they depend on to a temporary directory. - - const sourceFiles = ["server.rb", "getInfo.js", "netcat.js"]; - serverRbPath = path.join(tempDir, "server.rb"); - getInfoJsPath = path.join(tempDir, "getInfo.js"); - - sourceFiles.forEach((rubyFile) => { - const destDir = path.join(tempDir, path.dirname(rubyFile)); - if (!existsSync(destDir)) { - mkdirSync(destDir); - } - copyFileSync( - url.fileURLToPath(new URL(`../src/${rubyFile}`, import.meta.url)), - path.join(tempDir, rubyFile) - ); - }); - - cleanupTempFiles = () => { - [ - getInfoJsPath, - ...sourceFiles.map((rubyFile) => path.join(tempDir, rubyFile)) - ].forEach((tmpFilePath) => { - if (existsSync(tmpFilePath)) { - unlinkSync(tmpFilePath); - } - }); - - sourceFiles.forEach((rubyFile) => { - const tempSubdir = path.join(tempDir, path.dirname(rubyFile)); - if (existsSync(tempSubdir)) { - rmdirSync(tempSubdir); - } - }); - - if (existsSync(tempDir)) { - rmdirSync(tempDir); - } - }; - } - - const server = spawn( - "ruby", - [serverRbPath, `--plugins=${getPlugins(opts).join(",")}`, filepath], - { - env: Object.assign({}, process.env, { LANG: getLang() }), - detached: true, - stdio: "inherit" - } - ); - - server.unref(); - process.on("exit", () => { - if (existsSync(filepath)) { - unlinkSync(filepath); - } - - if (cleanupTempFiles != null) { - cleanupTempFiles(); - } - - try { - if (server.pid) { - // Kill the server process if it's still running. If we're on windows - // we're going to use the process ID number. If we're not, we're going - // to use the negative process ID to indicate the group. - const pid = process.platform === "win32" ? server.pid : -server.pid; - process.kill(pid); - } - } catch (e) { - if (process.env.PLUGIN_RUBY_CI) { - throw new Error(`Failed to kill the parser server: ${e}`); - } - } - }); - - const info = spawnSync(process.execPath, [getInfoJsPath, filepath]); - - if (info.status !== 0) { - throw new Error(` - We failed to spawn our parser server. Please report this error on GitHub - at https://github.com/prettier/plugin-ruby. The error message was: - - ${info.stderr.toString()}. - `); - } - - const [cmd, ...args] = info.stdout.toString().split(" "); - return { cmd, args }; -} - -// If we're in a yarn Plug'n'Play environment, then the relative paths being -// used by the parser server and the various scripts used to communicate -// therein are not going to work with its virtual file system. -function runningInPnPZip() { - const __dirname = url.fileURLToPath(new URL(".", import.meta.url)); - return process.versions.pnp && __dirname.includes(".zip"); -} - -// Formats and sends a request to the parser server. We use netcat (or something -// like it) here since Prettier requires the results of `parse` to be -// synchronous and Node.js does not offer a mechanism for synchronous socket -// requests. -export function parseSync(parser, source, opts) { - if (!parserArgs) { - parserArgs = spawnServer(opts); - } - - const command = parserArgs.cmd === "node" ? process.execPath : parserArgs.cmd; - const response = spawnSync(command, parserArgs.args, { - input: `${parser}|${opts.printWidth}|${opts.tabWidth}|${source}`, - maxBuffer: 15 * 1024 * 1024 - }); - - const stdout = response.stdout.toString(); - const stderr = response.stderr.toString(); - const { status } = response; - - // If we didn't receive anything over stdout or we have a bad exit status, - // then throw whatever we can. - if (stdout.length === 0 || (status !== null && status !== 0)) { - throw new Error(stderr || "An unknown error occurred"); - } - - const parsed = JSON.parse(stdout); - - if (parsed.error) { - const error = new Error(parsed.error); - if (parsed.loc) { - error.loc = parsed.loc; - } - - throw error; - } - - return parsed; -} diff --git a/src/plugin.js b/src/plugin.js index 6fa3f1da..5e368171 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -1,4 +1,4 @@ -import { parseSync } from "./parseSync.js"; +import { parse } from "./parse.js"; /* * metadata mostly pulled from linguist and rubocop: @@ -82,7 +82,7 @@ const plugin = { parsers: { ruby: { parse(text, opts) { - return parseSync("ruby", text, opts); + return parse("ruby", text, opts); }, astFormat: "ruby", hasPragma(text) { @@ -97,7 +97,7 @@ const plugin = { }, rbs: { parse(text, opts) { - return parseSync("rbs", text, opts); + return parse("rbs", text, opts); }, astFormat: "rbs", hasPragma(text) { @@ -112,7 +112,7 @@ const plugin = { }, haml: { parse(text, opts) { - return parseSync("haml", text, opts); + return parse("haml", text, opts); }, astFormat: "haml", hasPragma(text) { diff --git a/src/server.rb b/src/server.rb index 7aa860eb..0917ee19 100644 --- a/src/server.rb +++ b/src/server.rb @@ -1,10 +1,8 @@ # frozen_string_literal: true require "bundler/setup" -require "socket" require "json" -require "fileutils" -require "open3" +require "socket" require "prettier_print" require "syntax_tree" @@ -16,6 +14,9 @@ .split(",") .each { |plugin| require "syntax_tree/#{plugin}" } +# Next, get the file where we should write our connection information. +connection_filepath = ARGV.shift + # Make sure we trap these signals to be sure we get the quit command coming from # the parent node process quit = false @@ -26,15 +27,6 @@ trap(:QUIT) { quit = true } end -# The information variable stores the actual connection information, which will -# either be an IP address and port or a path to a unix socket file. -information = "" - -# The candidates array is a list of potential programs that could be used to -# connect to our server. We'll run through them after the server starts to find -# the best one to use. -candidates = [] - if Gem.win_platform? # If we're on windows, we're going to start up a TCP server. The 0 here means # to bind to some available port. @@ -44,8 +36,13 @@ # Ensure that we close the server when this process exits. at_exit { server.close } - information = "#{address.ip_address} #{address.ip_port}" - candidates = %w[nc telnet] + File.write( + connection_filepath, + JSON.fast_generate( + address: server.address.ip_address, + port: server.address.ip_port + ) + ) else # If we're not on windows, then we're going to assume we can use unix socket # files (since they're faster than a TCP server). @@ -59,14 +56,15 @@ File.unlink(filepath) end - information = server.local_address.unix_path - candidates = ["nc -w 3 -U", "ncat -w 3 -U"] + File.write( + connection_filepath, + JSON.fast_generate(path: server.local_address.unix_path) + ) end # This is the actual listening thread that will be acting as our server. We have -# to start it in another thread to begin with so that we can run through our -# candidate connection programs. Eventually we'll just join into this thread -# though and it will act as a daemon. +# to start it in another thread in order to properly trap the signals in this +# parent thread. listener = Thread.new do loop do @@ -74,8 +72,8 @@ # Start up a new thread that will handle each successive connection. Thread.new(server.accept_nonblock) do |socket| - parser, maxwidth_string, tabwidth_string, source = - socket.read.force_encoding("UTF-8").split("|", 4) + request = JSON.parse(socket.read.force_encoding("UTF-8")) + source = request["source"] source.each_line do |line| case line @@ -95,14 +93,12 @@ # At the moment, we're not going to support odd tabwidths. It's going to # have to be a multiple of 2, because of the way that the prettyprint # gem functions. So we're going to just use integer division here. - scalar = tabwidth_string.to_i / 2 + scalar = request["tabwidth"].to_i / 2 genspace = ->(n) { " " * n * scalar } - maxwidth = maxwidth_string.to_i + maxwidth = request["maxwidth"].to_i response = - case parser - when "ping" - "pong" + case request["parser"] when "ruby" formatter = SyntaxTree::Formatter.new(source, [], maxwidth, "\n", &genspace) @@ -124,7 +120,13 @@ when "haml" formatter = if defined?(SyntaxTree::Haml::Format::Formatter) - SyntaxTree::Haml::Format::Formatter.new(source, +"", maxwidth, "\n", &genspace) + SyntaxTree::Haml::Format::Formatter.new( + source, + +"", + maxwidth, + "\n", + &genspace + ) else PrettierPrint.new(+"", maxwidth, "\n", &genspace) end @@ -146,8 +148,8 @@ begin socket.write(JSON.fast_generate(error: error.message)) rescue Errno::EPIPE - # Do nothing, the pipe has been closed by the parent process so we don't - # actually care about writing to it anymore. + # Do nothing, the pipe has been closed by the parent process so we + # don't actually care about writing to it anymore. end ensure socket.close @@ -162,35 +164,4 @@ end end -# Map each candidate connection method to a thread that will check if it works. -candidates.map! do |candidate| - Thread.new do - Thread.current.report_on_exception = false - - # We do not care about stderr here, so throw it away - stdout, _stderr, status = - Open3.capture3("#{candidate} #{information}", stdin_data: "ping") - - candidate if JSON.parse(stdout) == "pong" && status.exitstatus == 0 - rescue StandardError - # We don't actually care if this fails, because we'll just skip that - # connection option. - end -end - -# Find the first one prefix that successfully returned the correct value. -prefix = - candidates.detect do |candidate| - value = candidate.value - break value if value - end - -# Default to running the netcat.js script that we ship with the plugin. It's a -# good fallback as it will always work, but it is slower than the other options. -prefix ||= "node #{File.expand_path("netcat.js", __dir__)}" - -# Write out our connection information to the file given as the first argument -# to this script. -File.write(ARGV[0], "#{prefix} #{information}") - listener.join diff --git a/test/js/files.test.js b/test/js/files.test.js index f3cbec0e..05b239bd 100644 --- a/test/js/files.test.js +++ b/test/js/files.test.js @@ -2,18 +2,14 @@ import { getFileInfo } from "prettier"; import url from "url"; import plugin from "../../src/plugin.js"; -async function getInferredParser(filename) { - const filepath = url.fileURLToPath(new URL(filename, import.meta.url)); - const fileInfoOptions = { plugins: [plugin] }; - - const { inferredParser } = await getFileInfo(filepath, fileInfoOptions); - return inferredParser; -} - describe("files", () => { const cases = ["files/Gemfile", "files/shebang", "files/test.rake"]; - test.each(cases)("infers Ruby parser from %s", (filename) => - expect(getInferredParser(filename)).resolves.toBe("ruby") - ); + test.each(cases)("infers Ruby parser from %s", async (filename) => { + const filepath = url.fileURLToPath(new URL(filename, import.meta.url)); + const fileInfoOptions = { plugins: [plugin] }; + + const { inferredParser } = await getFileInfo(filepath, fileInfoOptions); + expect(inferredParser).toEqual("ruby"); + }); }); diff --git a/test/js/globalSetup.js b/test/js/globalSetup.js index 2a80c480..f9e3dc49 100644 --- a/test/js/globalSetup.js +++ b/test/js/globalSetup.js @@ -1,44 +1,28 @@ -import { spawn, spawnSync } from "child_process"; -import { unlinkSync } from "fs"; -import url from "url"; -import { getLang, getInfoFilepath } from "../../src/parseSync.js"; +import { spawnSync } from "child_process"; +import { spawnServer } from "../../src/parse.js"; // This is somewhat similar to the spawnServer function in parseSync but // slightly different in that it logs its information into environment variables // so that it can be reused across the test suite. -function globalSetup() { +async function globalSetup() { // Set a RUBY_VERSION environment variable because certain tests will only run // for certain versions of Ruby. - const args = ["--disable-gems", "-e", "puts RUBY_VERSION"]; - process.env.RUBY_VERSION = spawnSync("ruby", args).stdout.toString().trim(); + process.env.RUBY_VERSION = spawnSync("ruby", [ + "--disable-gems", + "-e", + "puts RUBY_VERSION" + ]) + .stdout.toString("utf-8") + .trim(); - // Set up just one parsing server for the entirety of the test suite. - const filepath = getInfoFilepath(); - const server = spawn( - "ruby", - [url.fileURLToPath(new URL("../../src/server.rb", import.meta.url)), "--plugins=", filepath], - { - env: Object.assign({}, process.env, { LANG: getLang() }), - detached: true, - stdio: "inherit" - } - ); + const { serverPID, connectionOptions } = await spawnServer({ + rubyPlugins: "", + rubySingleQuote: false, + trailingComma: "none" + }); - // Get the connection information from the parsing server. - const information = spawnSync("node", [ - url.fileURLToPath(new URL("../../src/getInfo.js", import.meta.url)), - filepath - ]); - - if (information.status !== 0) { - throw new Error(information.stderr.toString()); - } - - process.env.PRETTIER_RUBY_HOST = information.stdout.toString(); - process.env.PRETTIER_RUBY_PID = `${server.pid}`; - - unlinkSync(filepath); - server.unref(); + process.env.PRETTIER_RUBY_PID = serverPID; + process.env.PRETTIER_RUBY_HOST = JSON.stringify(connectionOptions); } export default globalSetup; diff --git a/test/js/globalTeardown.js b/test/js/globalTeardown.js index b4b20e9a..bcf486c7 100644 --- a/test/js/globalTeardown.js +++ b/test/js/globalTeardown.js @@ -2,11 +2,11 @@ // the PRETTIER_RUBY_PID environment variable. At the end of the test suite we // should send a kill signal to it. function globalTeardown() { - const prettierRubyPID = process.env.PRETTIER_RUBY_PID; + const serverPID = process.env.PRETTIER_RUBY_PID; - if (prettierRubyPID) { + if (serverPID) { try { - process.kill(parseInt(prettierRubyPID, 10), "SIGINT"); + process.kill(parseInt(serverPID, 10), "SIGINT"); } catch (e) { throw new Error("Failed to kill the parser process in globalTeardown."); } diff --git a/test/js/haml/comment.test.js b/test/js/haml/comment.test.js index 0b29db72..6ceac558 100644 --- a/test/js/haml/comment.test.js +++ b/test/js/haml/comment.test.js @@ -2,7 +2,9 @@ import { haml } from "../utils"; describe("comment", () => { test("single line", () => { - expect(haml("/ This is the peanutbutterjelly element")).toMatchFormat(); + return expect( + haml("/ This is the peanutbutterjelly element") + ).toMatchFormat(); }); test("multi line", () => { @@ -11,7 +13,7 @@ describe("comment", () => { %p This doesn't render, because it's commented out! `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("conditional", () => { @@ -20,7 +22,7 @@ describe("comment", () => { %h1 Get Firefox `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("revealed", () => { @@ -29,6 +31,6 @@ describe("comment", () => { You are not using Internet Explorer, or are using version 10+. `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); diff --git a/test/js/haml/doctype.test.js b/test/js/haml/doctype.test.js index bd1ffe58..5e6f1ba1 100644 --- a/test/js/haml/doctype.test.js +++ b/test/js/haml/doctype.test.js @@ -2,42 +2,42 @@ import { haml } from "../utils"; describe("doctype", () => { test("basic", () => { - expect(haml("!!! Basic")).toMatchFormat(); + return expect(haml("!!! Basic")).toMatchFormat(); }); test("frameset", () => { - expect(haml("!!! Frameset")).toMatchFormat(); + return expect(haml("!!! Frameset")).toMatchFormat(); }); test("mobile", () => { - expect(haml("!!! Mobile")).toMatchFormat(); + return expect(haml("!!! Mobile")).toMatchFormat(); }); test("rdfa", () => { - expect(haml("!!! RDFa")).toMatchFormat(); + return expect(haml("!!! RDFa")).toMatchFormat(); }); test("strict", () => { - expect(haml("!!! Strict")).toMatchFormat(); + return expect(haml("!!! Strict")).toMatchFormat(); }); test("xml", () => { - expect(haml("!!! XML")).toMatchFormat(); + return expect(haml("!!! XML")).toMatchFormat(); }); test("encoding", () => { - expect(haml("!!! XML iso-8859-1")).toMatchFormat(); + return expect(haml("!!! XML iso-8859-1")).toMatchFormat(); }); test("1.1", () => { - expect(haml("!!! 1.1")).toMatchFormat(); + return expect(haml("!!! 1.1")).toMatchFormat(); }); test("5", () => { - expect(haml("!!! 5")).toMatchFormat(); + return expect(haml("!!! 5")).toMatchFormat(); }); test("misc", () => { - expect(haml("!!! foo")).toMatchFormat(); + return expect(haml("!!! foo")).toMatchFormat(); }); }); diff --git a/test/js/haml/filter.test.js b/test/js/haml/filter.test.js index 711ba4c2..14e7e223 100644 --- a/test/js/haml/filter.test.js +++ b/test/js/haml/filter.test.js @@ -7,7 +7,7 @@ describe("filter", () => { -# comment `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("custom", () => { @@ -17,7 +17,7 @@ describe("filter", () => { bar `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("css", () => { @@ -26,6 +26,6 @@ describe("filter", () => { .foo { height: 100px; width: 100px; } `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); diff --git a/test/js/haml/hamlComment.test.js b/test/js/haml/hamlComment.test.js index de38dfae..757f241b 100644 --- a/test/js/haml/hamlComment.test.js +++ b/test/js/haml/hamlComment.test.js @@ -2,11 +2,11 @@ import { haml } from "../utils"; describe("haml comment", () => { test("empty", () => { - expect(haml("-#")).toMatchFormat(); + return expect(haml("-#")).toMatchFormat(); }); test("same line", () => { - expect(haml("-# comment")).toMatchFormat(); + return expect(haml("-# comment")).toMatchFormat(); }); test("multi line", () => { @@ -17,10 +17,10 @@ describe("haml comment", () => { comment `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("weird spacing same line", () => { - expect(haml("-# foobar ")).toChangeFormat("-# foobar"); + return expect(haml("-# foobar ")).toChangeFormat("-# foobar"); }); }); diff --git a/test/js/haml/plain.test.js b/test/js/haml/plain.test.js index 4f824053..87b1e79f 100644 --- a/test/js/haml/plain.test.js +++ b/test/js/haml/plain.test.js @@ -4,10 +4,10 @@ describe("plain", () => { const specialChars = ["%", ".", "#", "/", "!", "=", "&", "~", "-", "\\", ":"]; test.each(specialChars)("escapes starting %s", (specialChar) => { - expect(haml(`\\${specialChar}`)).toMatchFormat(); + return expect(haml(`\\${specialChar}`)).toMatchFormat(); }); test("does not unnecessarily escape other characters", () => { - expect(haml("foo")).toMatchFormat(); + return expect(haml("foo")).toMatchFormat(); }); }); diff --git a/test/js/haml/script.test.js b/test/js/haml/script.test.js index 440d6a1e..f9c56e02 100644 --- a/test/js/haml/script.test.js +++ b/test/js/haml/script.test.js @@ -2,7 +2,7 @@ import { haml } from "../utils"; describe("script", () => { test("single line", () => { - expect(haml('%p= "hello"')).toMatchFormat(); + return expect(haml('%p= "hello"')).toMatchFormat(); }); test("multi line", () => { @@ -12,11 +12,11 @@ describe("script", () => { = "yo" `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("escape with interpolate", () => { - expect(haml(`&= "I like cheese & crackers"`)).toMatchFormat(); + return expect(haml(`&= "I like cheese & crackers"`)).toMatchFormat(); }); test("children", () => { @@ -25,10 +25,10 @@ describe("script", () => { = bar `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("preserve", () => { - expect(haml('~ "Foo\\n
    Bar\\nBaz
    "')).toMatchFormat(); + return expect(haml('~ "Foo\\n
    Bar\\nBaz
    "')).toMatchFormat(); }); }); diff --git a/test/js/haml/silentScript.test.js b/test/js/haml/silentScript.test.js index d263bd14..c7e78177 100644 --- a/test/js/haml/silentScript.test.js +++ b/test/js/haml/silentScript.test.js @@ -2,7 +2,7 @@ import { haml } from "../utils"; describe("silent script", () => { test("single line", () => { - expect(haml('- foo = "hello"')).toMatchFormat(); + return expect(haml('- foo = "hello"')).toMatchFormat(); }); test("multi-line", () => { @@ -11,7 +11,7 @@ describe("silent script", () => { - bar `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("multi line with case", () => { @@ -26,7 +26,7 @@ describe("silent script", () => { = "3" `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("multi line with if/else", () => { @@ -40,7 +40,7 @@ describe("silent script", () => { -# qix `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("multi line with unless/else", () => { @@ -54,7 +54,7 @@ describe("silent script", () => { -# qix `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("multi line with embedded", () => { @@ -67,6 +67,6 @@ describe("silent script", () => { %span baz `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); diff --git a/test/js/haml/tag.test.js b/test/js/haml/tag.test.js index 59749792..70f4c17f 100644 --- a/test/js/haml/tag.test.js +++ b/test/js/haml/tag.test.js @@ -2,31 +2,31 @@ import { long, haml } from "../utils"; describe("tag", () => { test("class", () => { - expect(haml("%p.foo")).toMatchFormat(); + return expect(haml("%p.foo")).toMatchFormat(); }); test("class multiple", () => { - expect(haml("%p.foo.bar.baz")).toMatchFormat(); + return expect(haml("%p.foo.bar.baz")).toMatchFormat(); }); test("id", () => { - expect(haml("%p#foo")).toMatchFormat(); + return expect(haml("%p#foo")).toMatchFormat(); }); test("classes and id", () => { - expect(haml("%p.foo.bar#baz")).toMatchFormat(); + return expect(haml("%p.foo.bar#baz")).toMatchFormat(); }); test("self closing", () => { - expect(haml("%br/")).toMatchFormat(); + return expect(haml("%br/")).toMatchFormat(); }); test("whitespace removal left single line", () => { - expect(haml('%p>= "Foo\\nBar"')).toMatchFormat(); + return expect(haml('%p>= "Foo\\nBar"')).toMatchFormat(); }); test("whitespace removal right single line", () => { - expect(haml('%p<= "Foo\\nBar"')).toMatchFormat(); + return expect(haml('%p<= "Foo\\nBar"')).toMatchFormat(); }); test("whitespace removal right multi line", () => { @@ -36,63 +36,65 @@ describe("tag", () => { Foo! `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("dynamic attribute", () => { - expect(haml("%span{html_attrs('fr-fr')}")).toMatchFormat(); + return expect(haml("%span{html_attrs('fr-fr')}")).toMatchFormat(); }); test("dynamic attributes (ruby hash)", () => { const content = haml(`%div{data: { controller: "lesson-evaluation" }}`); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("dynamic attributes (html-style)", () => { const content = haml("%img(title=@title alt=@alt)/"); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); describe("static attributes", () => { test("basic", () => { - expect(haml("%span(foo)")).toChangeFormat("%span{foo: true}"); + return expect(haml("%span(foo)")).toChangeFormat("%span{foo: true}"); }); test("hash label, single quote", () => { const content = haml(`%section(xml:lang="en" title="title")`); const expected = `%section{"xml:lang": "en", title: "title"}`; - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); test("hash label, double quote", () => { const content = haml(`%section(xml:lang="en" title="title")`); const expected = `%section{"xml:lang": "en", title: "title"}`; - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); test("hash label, single quote, interpolation", () => { const content = haml(`%section{title: "#{title}"}`); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("non-strings", () => { const content = haml(`%section(foo=1 bar=2)`); const expected = `%section(foo=1 bar=2)`; - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); test("attributes prefixed with @", () => { - expect(haml(`%span{"@click": "open = true"}`)).toMatchFormat(); - expect(haml(`%span{"@click.outside": "open = true"}`)).toMatchFormat(); - expect( - haml(`%span{"@keydown.arrow-up.prevent": "open = true"}`) - ).toMatchFormat(); + return Promise.all([ + expect(haml(`%span{"@click": "open = true"}`)).toMatchFormat(), + expect(haml(`%span{"@click.outside": "open = true"}`)).toMatchFormat(), + expect( + haml(`%span{"@keydown.arrow-up.prevent": "open = true"}`) + ).toMatchFormat() + ]); }); }); @@ -103,7 +105,7 @@ describe("tag", () => { Hello! `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("long declaration before text", () => { @@ -117,18 +119,18 @@ describe("tag", () => { foo `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); test("with quotes in string", () => { const content = haml(`%div{title: "escaping quotes, it's annoying"}`); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("with interpolation in the value", () => { const content = haml(`%p hello"#{1 + 2} little pigs"`); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); diff --git a/test/js/rbs/rbs.test.js b/test/js/rbs/rbs.test.js index 7cd9852b..3e6addac 100644 --- a/test/js/rbs/rbs.test.js +++ b/test/js/rbs/rbs.test.js @@ -8,7 +8,7 @@ function testCases(name, transform) { sources.forEach((source) => { test(source, () => { - expect(rbs(transform(source))).toMatchFormat(); + return expect(rbs(transform(source))).toMatchFormat(); }); }); } @@ -33,7 +33,7 @@ describe("rbs", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("interface with type params", () => { @@ -42,7 +42,7 @@ describe("rbs", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); if (atLeastVersion("3.1")) { @@ -52,7 +52,7 @@ describe("rbs", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("interface with fancy bounded type params", () => { @@ -61,7 +61,7 @@ describe("rbs", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); } @@ -71,7 +71,7 @@ describe("rbs", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("class with type params", () => { @@ -80,7 +80,7 @@ describe("rbs", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("class with complicated type params", () => { @@ -89,7 +89,7 @@ describe("rbs", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); if (atLeastVersion("3.1")) { @@ -99,7 +99,7 @@ describe("rbs", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("class with fancy bounded type params", () => { @@ -108,7 +108,7 @@ describe("rbs", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); } @@ -119,7 +119,7 @@ describe("rbs", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("class with annotations that cannot be switched to braces", () => { @@ -129,7 +129,7 @@ describe("rbs", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("class with comments", () => { @@ -139,7 +139,7 @@ describe("rbs", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("class with superclass", () => { @@ -148,7 +148,7 @@ describe("rbs", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("module", () => { @@ -157,7 +157,7 @@ describe("rbs", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("module with type params", () => { @@ -166,7 +166,7 @@ describe("rbs", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("module with self types", () => { @@ -175,7 +175,7 @@ describe("rbs", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("multiple empty lines", () => { @@ -198,7 +198,7 @@ describe("rbs", () => { end `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); }); @@ -217,39 +217,43 @@ describe("rbs", () => { testCases("literal", (source) => `T: ${source}`); test("+1 drops the plus sign", () => { - expect(rbs("T: +1")).toChangeFormat("T: 1"); + return expect(rbs("T: +1")).toChangeFormat("T: 1"); }); test("uses default quotes", () => { - expect(rbs(`T: "foo"`)).toMatchFormat(); + return expect(rbs(`T: "foo"`)).toMatchFormat(); }); test("changes quotes to match", () => { - expect(rbs("T: 'foo'")).toChangeFormat(`T: "foo"`); + return expect(rbs("T: 'foo'")).toChangeFormat(`T: "foo"`); }); test("keeps string the same when there is an escape sequence", () => { - expect(rbs(`T: "super \\a duper"`)).toMatchFormat(); + return expect(rbs(`T: "super \\a duper"`)).toMatchFormat(); }); test("unescapes double quotes when using single quotes", () => { - expect(rbs(`T: "super \\" duper"`)).toChangeFormat( + return expect(rbs(`T: "super \\" duper"`)).toChangeFormat( `T: "super \\" duper"` ); }); test("unescapes single quotes when using double quotes", () => { - expect(rbs(`T: 'super \\' duper'`)).toChangeFormat( + return expect(rbs(`T: 'super \\' duper'`)).toChangeFormat( `T: 'super \\' duper'` ); }); test("maintains escape sequences when using double quotes", () => { - expect(rbs(`T: "escape sequences \\a\\b\\e\\f\\n\\r"`)).toMatchFormat(); + return expect( + rbs(`T: "escape sequences \\a\\b\\e\\f\\n\\r"`) + ).toMatchFormat(); }); test("maintains not escape sequences when using single quotes", () => { - expect(rbs(`T: 'escape sequences \\a\\b\\e\\f\\n\\r'`)).toMatchFormat(); + return expect( + rbs(`T: 'escape sequences \\a\\b\\e\\f\\n\\r'`) + ).toMatchFormat(); }); }); @@ -275,7 +279,7 @@ describe("rbs", () => { testCases("optional", (source) => `T: ${source}`); test("removes optional space before question mark", () => { - expect(rbs("T: :foo ?")).toChangeFormat("T: :foo?"); + return expect(rbs("T: :foo ?")).toChangeFormat("T: :foo?"); }); }); @@ -285,11 +289,11 @@ describe("rbs", () => { testCases("proc", (source) => `T: ${source}`); test("drops optional parentheses when there are no params", () => { - expect(rbs("T: ^() -> void")).toChangeFormat("T: ^-> void"); + return expect(rbs("T: ^() -> void")).toChangeFormat("T: ^-> void"); }); test("drops optional parentheses with block param when there are no params to the block", () => { - expect(rbs("T: ^{ () -> void } -> void")).toChangeFormat( + return expect(rbs("T: ^{ () -> void } -> void")).toChangeFormat( "T: ^{ -> void } -> void" ); }); @@ -302,11 +306,11 @@ describe("rbs", () => { if (platform() !== "win32" || atLeastVersion("3.0")) { describe("non-ASCII", () => { test("emoji", () => { - expect(rbs(`T: { "🌼" => Integer }`)).toMatchFormat(); + return expect(rbs(`T: { "🌼" => Integer }`)).toMatchFormat(); }); test("kanji", () => { - expect(rbs(`T: { "日本語" => Integer }`)).toMatchFormat(); + return expect(rbs(`T: { "日本語" => Integer }`)).toMatchFormat(); }); }); } diff --git a/test/js/ruby/comments.test.js b/test/js/ruby/comments.test.js index 789747a6..1dcea4a3 100644 --- a/test/js/ruby/comments.test.js +++ b/test/js/ruby/comments.test.js @@ -10,7 +10,7 @@ describe("comments", () => { a = 1 `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("at the end of the file", () => { @@ -21,7 +21,7 @@ describe("comments", () => { # the end of the file `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); const commentBlocks = [ @@ -46,7 +46,7 @@ describe("comments", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("as the first statement", () => { @@ -58,7 +58,7 @@ describe("comments", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("as the last statement", () => { @@ -70,7 +70,7 @@ describe("comments", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); @@ -91,7 +91,7 @@ describe("comments", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("case/when/end statements", () => { @@ -110,7 +110,7 @@ describe("comments", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("begin/rescue/ensure/end statements", () => { @@ -130,7 +130,7 @@ describe("comments", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); /* eslint-disable no-useless-escape */ @@ -146,21 +146,25 @@ describe("comments", () => { /_/ /_/ /_/ /____/ /_/ /_/ /_____/ /____/ /_/ /_/ `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); describe("inline", () => { test("basic", () => { - expect("foo # this is an inline comment").toMatchFormat(); + return expect("foo # this is an inline comment").toMatchFormat(); }); test("commands", () => { - expect(`command "foo" # this is an inline comment`).toMatchFormat(); + return expect( + `command "foo" # this is an inline comment` + ).toMatchFormat(); }); test("command calls", () => { - expect(`command.call "foo" # this is an inline comment`).toMatchFormat(); + return expect( + `command.call "foo" # this is an inline comment` + ).toMatchFormat(); }); }); @@ -176,7 +180,7 @@ describe("comments", () => { ] `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); @@ -192,7 +196,7 @@ describe("comments", () => { } `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); @@ -208,7 +212,7 @@ describe("comments", () => { ) `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); @@ -223,7 +227,7 @@ describe("comments", () => { .baz `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); describe("declaration style comments", () => { @@ -242,7 +246,7 @@ describe("comments", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); @@ -254,6 +258,6 @@ describe("comments", () => { ] `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); diff --git a/test/js/ruby/encoding.test.js b/test/js/ruby/encoding.test.js index e097d79a..1d6bb806 100644 --- a/test/js/ruby/encoding.test.js +++ b/test/js/ruby/encoding.test.js @@ -2,18 +2,18 @@ describe("encoding", () => { const header = "# -*- encoding: binary -*-"; test("comments", () => { - expect(`${header}\n# il était`).toMatchFormat(); + return expect(`${header}\n# il était`).toMatchFormat(); }); test("symbol literals", () => { - expect(`${header}\n:il_était`).toMatchFormat(); + return expect(`${header}\n:il_était`).toMatchFormat(); }); test("string literals", () => { - expect(`${header}\n"ひらがな"`).toMatchFormat(); + return expect(`${header}\n"ひらがな"`).toMatchFormat(); }); test("regexp literals", () => { - expect(`${header}\n/ひらがな/`).toMatchFormat(); + return expect(`${header}\n/ひらがな/`).toMatchFormat(); }); }); diff --git a/test/js/ruby/errors.test.js b/test/js/ruby/errors.test.js index f2655f6a..a5e99bbb 100644 --- a/test/js/ruby/errors.test.js +++ b/test/js/ruby/errors.test.js @@ -1,6 +1,6 @@ import { format } from "prettier"; -describe.skip("errors", () => { +describe("errors", () => { const cases = [ "alias $a $1", "self = 1", @@ -13,7 +13,12 @@ describe.skip("errors", () => { "<>" ]; - test.each(cases)("fails for %s", (content) => { - expect(() => format(content, { parser: "ruby", plugins: ["."] })).toThrow(); + test.each(cases)("fails for %s", async (content) => { + try { + await format(content, { parser: "ruby", plugins: ["."] }); + expect(true).toBe(false); + } catch (error) { + expect(error.loc).toBeDefined(); + } }); }); diff --git a/test/js/ruby/ignore.test.js b/test/js/ruby/ignore.test.js index 43578683..f1ce1f95 100644 --- a/test/js/ruby/ignore.test.js +++ b/test/js/ruby/ignore.test.js @@ -7,6 +7,6 @@ describe("ignore", () => { class Foo; def bar; 1+1+1; end; end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); diff --git a/test/js/ruby/layout.test.js b/test/js/ruby/layout.test.js index 8c1716a3..393d5e5d 100644 --- a/test/js/ruby/layout.test.js +++ b/test/js/ruby/layout.test.js @@ -2,19 +2,19 @@ import { ruby } from "../utils.js"; describe("layout", () => { test("turns multiple blank lines into just one blank line", () => { - expect("1\n\n\n\n\n2").toChangeFormat("1\n\n2"); + return expect("1\n\n\n\n\n2").toChangeFormat("1\n\n2"); }); test("turns semicolons into adjacent lines", () => { - expect("1; 2; 3").toChangeFormat("1\n2\n3"); + return expect("1; 2; 3").toChangeFormat("1\n2\n3"); }); test("maintains semicolons from within interpolation", () => { - expect(`"a#{b; c}"`).toMatchFormat(); + return expect(`"a#{b; c}"`).toMatchFormat(); }); test("handles multiple newlines at the end of the file", () => { - expect("foo\n\n\n").toChangeFormat("foo"); + return expect("foo\n\n\n").toChangeFormat("foo"); }); test("keeps comments in their place when nothing to attach to", () => { @@ -36,6 +36,6 @@ describe("layout", () => { # Comment `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/alias.test.js b/test/js/ruby/nodes/alias.test.js index 226cdfb2..df83939f 100644 --- a/test/js/ruby/nodes/alias.test.js +++ b/test/js/ruby/nodes/alias.test.js @@ -2,35 +2,35 @@ import { long, ruby } from "../../utils.js"; describe("alias", () => { test("bare word aliases", () => { - expect("alias foo bar").toMatchFormat(); + return expect("alias foo bar").toMatchFormat(); }); test("bare word operator aliases", () => { - expect("alias << push").toMatchFormat(); + return expect("alias << push").toMatchFormat(); }); test("bare word keyword aliases", () => { - expect("alias in within").toMatchFormat(); + return expect("alias in within").toMatchFormat(); }); test("bare word constant aliases", () => { - expect("alias in IN").toMatchFormat(); + return expect("alias in IN").toMatchFormat(); }); test("symbol aliases become bare word aliases", () => { - expect("alias :foo :bar").toChangeFormat("alias foo bar"); + return expect("alias :foo :bar").toChangeFormat("alias foo bar"); }); test("dynamic symbols do not get transformed (left)", () => { - expect(`alias :"foo" :bar`).toChangeFormat(`alias :"foo" bar`); + return expect(`alias :"foo" :bar`).toChangeFormat(`alias :"foo" bar`); }); test("dynamic symbols do not get transformed (right)", () => { - expect(`alias :foo :"bar"`).toChangeFormat(`alias foo :"bar"`); + return expect(`alias :foo :"bar"`).toChangeFormat(`alias foo :"bar"`); }); test("global aliases", () => { - expect("alias $foo $bar").toMatchFormat(); + return expect("alias $foo $bar").toMatchFormat(); }); test("handles long symbols", () => { @@ -39,11 +39,11 @@ describe("alias", () => { bar `); - expect(`alias ${long} bar`).toChangeFormat(expected); + return expect(`alias ${long} bar`).toChangeFormat(expected); }); test("handles comments on the right node", () => { - expect("alias foo bar # baz").toMatchFormat(); + return expect("alias foo bar # baz").toMatchFormat(); }); test("handles comments on the left node", () => { @@ -52,7 +52,7 @@ describe("alias", () => { bar `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("handles comments on both nodes", () => { @@ -61,6 +61,6 @@ describe("alias", () => { bar # bar `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/aref.test.js b/test/js/ruby/nodes/aref.test.js index 738d2e68..aa7d7cb4 100644 --- a/test/js/ruby/nodes/aref.test.js +++ b/test/js/ruby/nodes/aref.test.js @@ -2,23 +2,23 @@ import { ruby } from "../../utils.js"; describe("aref", () => { test("literal reference", () => { - expect("array[5]").toMatchFormat(); + return expect("array[5]").toMatchFormat(); }); test("dynamic reference", () => { - expect("array[idx]").toMatchFormat(); + return expect("array[idx]").toMatchFormat(); }); test("reference with comment", () => { - expect("array[idx] # foo").toMatchFormat(); + return expect("array[idx] # foo").toMatchFormat(); }); test("literal assignment", () => { - expect("array[5] = 6").toMatchFormat(); + return expect("array[5] = 6").toMatchFormat(); }); test("dynamic assignment", () => { - expect("array[idx] = 6").toMatchFormat(); + return expect("array[idx] = 6").toMatchFormat(); }); test("comments within assignment", () => { @@ -30,6 +30,6 @@ describe("aref", () => { ] `); - expect(contents).toMatchFormat(); + return expect(contents).toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/arrays.test.js b/test/js/ruby/nodes/arrays.test.js index 8e632912..e54d567f 100644 --- a/test/js/ruby/nodes/arrays.test.js +++ b/test/js/ruby/nodes/arrays.test.js @@ -2,63 +2,63 @@ import { long, ruby } from "../../utils.js"; describe("array", () => { test("empty arrays", () => { - expect("[]").toMatchFormat(); + return expect("[]").toMatchFormat(); }); test("basic formatting", () => { - expect("[1, 2, 3]").toMatchFormat(); + return expect("[1, 2, 3]").toMatchFormat(); }); test("does not transform single string arrays", () => { - expect(`["a"]`).toMatchFormat(); + return expect(`["a"]`).toMatchFormat(); }); test("does not transform single symbol arrays", () => { - expect("[:a]").toMatchFormat(); + return expect("[:a]").toMatchFormat(); }); test("transforms basic string arrays", () => { - expect(`["a", "b", "c", "d", "e"]`).toChangeFormat("%w[a b c d e]"); + return expect(`["a", "b", "c", "d", "e"]`).toChangeFormat("%w[a b c d e]"); }); test("does not transform string arrays with interpolation", () => { - expect(`["a", "#{b}", "c"]`).toMatchFormat(); + return expect(`["a", "#{b}", "c"]`).toMatchFormat(); }); test("does not transform string arrays with spaces", () => { - expect(`["a", "b c", "d", "e"]`).toMatchFormat(); + return expect(`["a", "b c", "d", "e"]`).toMatchFormat(); }); test("does not transform string arrays with tabs", () => { - expect(`["a", "b\\tc", "d", "e"]`).toMatchFormat(); + return expect(`["a", "b\\tc", "d", "e"]`).toMatchFormat(); }); test("does not transform string arrays with newlines", () => { - expect(`["a", "b\\nc", "d", "e"]`).toMatchFormat(); + return expect(`["a", "b\\nc", "d", "e"]`).toMatchFormat(); }); test("does not transform string arrays with carriage returns", () => { - expect(`["a", "b\\rc", "d", "e"]`).toMatchFormat(); + return expect(`["a", "b\\rc", "d", "e"]`).toMatchFormat(); }); test("does not transform string arrays with interpolation", () => { - expect(`["a", "b#{c}d", "e"]`).toMatchFormat(); + return expect(`["a", "b#{c}d", "e"]`).toMatchFormat(); }); test("does not transform string arrays with brackets", () => { - expect(`["a [] b", "c [] d"]`).toMatchFormat(); + return expect(`["a [] b", "c [] d"]`).toMatchFormat(); }); test("transforms basic symbol arrays", () => { - expect("[:a, :b, :c]").toChangeFormat("%i[a b c]"); + return expect("[:a, :b, :c]").toChangeFormat("%i[a b c]"); }); test("does not transform symbol arrays with dynamic symbols", () => { - expect(`[:"a + b"]`).toMatchFormat(); + return expect(`[:"a + b"]`).toMatchFormat(); }); test("handles splats", () => { - expect("[1, 2, *[3, 4], 5, 6]").toMatchFormat(); + return expect("[1, 2, *[3, 4], 5, 6]").toMatchFormat(); }); test("breaks appropriately", () => { @@ -74,11 +74,11 @@ describe("array", () => { ] `); - expect(contents).toMatchFormat(); + return expect(contents).toMatchFormat(); }); test("breaking maintains calls on the end", () => { - expect(`[${long}].freeze`).toChangeFormat(`[\n ${long}\n].freeze`); + return expect(`[${long}].freeze`).toChangeFormat(`[\n ${long}\n].freeze`); }); describe("heredocs", () => { @@ -89,7 +89,7 @@ describe("array", () => { HERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("as the last value", () => { @@ -99,7 +99,7 @@ describe("array", () => { HERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("with splats in the array", () => { @@ -109,7 +109,7 @@ describe("array", () => { HERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); @@ -119,7 +119,7 @@ describe("array", () => { [] `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("with leading comments and comments in the body", () => { @@ -131,7 +131,7 @@ describe("array", () => { ] `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("with comments just in the body", () => { @@ -142,7 +142,7 @@ describe("array", () => { ] `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("with comments just outside but attached", () => { @@ -152,7 +152,7 @@ describe("array", () => { ) `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test.each(["%w", "%W", "%i", "%I"])("%s special array literals", (start) => diff --git a/test/js/ruby/nodes/assign.test.js b/test/js/ruby/nodes/assign.test.js index 032cf7a3..f8a1254e 100644 --- a/test/js/ruby/nodes/assign.test.js +++ b/test/js/ruby/nodes/assign.test.js @@ -3,7 +3,7 @@ import { long, ruby } from "../../utils.js"; describe("assign", () => { describe("single assignment", () => { test("basic", () => { - expect("a = 1").toMatchFormat(); + return expect("a = 1").toMatchFormat(); }); test("multiline", () => { @@ -14,11 +14,11 @@ describe("assign", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("other operator", () => { - expect("a ||= b").toMatchFormat(); + return expect("a ||= b").toMatchFormat(); }); }); @@ -29,16 +29,16 @@ describe("assign", () => { TEXT `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); describe("breaking", () => { test("inline becomes multi line", () => { - expect(`${long} = ${long}`).toChangeFormat(`${long} =\n ${long}`); + return expect(`${long} = ${long}`).toChangeFormat(`${long} =\n ${long}`); }); test("arrays don't get force indented", () => { - expect(`a = [${long}, ${long}, ${long}]`).toChangeFormat( + return expect(`a = [${long}, ${long}, ${long}]`).toChangeFormat( ruby(` a = [ ${long}, @@ -50,7 +50,9 @@ describe("assign", () => { }); test("hashes don't get force indented", () => { - expect(`a = { a: ${long}, b: ${long}, c: ${long} }`).toChangeFormat( + return expect( + `a = { a: ${long}, b: ${long}, c: ${long} }` + ).toChangeFormat( ruby(` a = { a: @@ -68,7 +70,7 @@ describe("assign", () => { const cases = ["w", "W", "i", "I"]; test.each(cases)("x = %s[...] is not force-indented", (literal) => { - expect(`a = %${literal}[${long} ${long}]`).toChangeFormat( + return expect(`a = %${literal}[${long} ${long}]`).toChangeFormat( ruby(` a = %${literal}[ ${long} @@ -80,7 +82,7 @@ describe("assign", () => { }); test("chained methods on array literals don't get oddly indented", () => { - expect(`a = [${long}].freeze`).toChangeFormat( + return expect(`a = [${long}].freeze`).toChangeFormat( ruby(` a = [ ${long} @@ -90,7 +92,7 @@ describe("assign", () => { }); test("chained methods on hash literals don't get oddly indented", () => { - expect(`a = { a: ${long} }.freeze`).toChangeFormat( + return expect(`a = { a: ${long} }.freeze`).toChangeFormat( ruby(` a = { a: @@ -105,7 +107,7 @@ describe("assign", () => { const operators = ["||", "&&", "+", "*", "%", "**", "<<"]; test.each(operators)("array %s= [...] is not force-indented", (op) => { - expect(`a ${op}= [${long}, ${long}, ${long}]`).toChangeFormat( + return expect(`a ${op}= [${long}, ${long}, ${long}]`).toChangeFormat( ruby(` a ${op}= [ ${long}, @@ -117,7 +119,7 @@ describe("assign", () => { }); test.each(operators)("hash %s= { ... } is not force-indented", (op) => { - expect( + return expect( `a ${op}= { a: ${long}, b: ${long}, c: ${long} }` ).toChangeFormat( ruby(` @@ -137,11 +139,11 @@ describe("assign", () => { describe("constants", () => { test("assigning to constant", () => { - expect(`Pret::TIER = "config"`).toMatchFormat(); + return expect(`Pret::TIER = "config"`).toMatchFormat(); }); test("assigning to top level constants", () => { - expect(`::PRETTIER = "config"`).toMatchFormat(); + return expect(`::PRETTIER = "config"`).toMatchFormat(); }); }); }); diff --git a/test/js/ruby/nodes/binary.test.js b/test/js/ruby/nodes/binary.test.js index 6589b508..2ce05d6a 100644 --- a/test/js/ruby/nodes/binary.test.js +++ b/test/js/ruby/nodes/binary.test.js @@ -2,11 +2,11 @@ import { long, ruby } from "../../utils.js"; describe("binary", () => { test("single line", () => { - expect("foo && bar && baz").toMatchFormat(); + return expect("foo && bar && baz").toMatchFormat(); }); test("multi line", () => { - expect(`${long} && ${long} && ${long}`).toChangeFormat( + return expect(`${long} && ${long} && ${long}`).toChangeFormat( `${long} &&\n ${long} &&\n ${long}` ); }); @@ -19,7 +19,7 @@ describe("binary", () => { ] `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); test("with heredoc and comment", () => { @@ -29,10 +29,10 @@ describe("binary", () => { HERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("no spaces for **", () => { - expect("a**b").toMatchFormat(); + return expect("a**b").toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/blocks.test.js b/test/js/ruby/nodes/blocks.test.js index 151d7c4f..9eec551a 100644 --- a/test/js/ruby/nodes/blocks.test.js +++ b/test/js/ruby/nodes/blocks.test.js @@ -2,43 +2,43 @@ import { long, ruby } from "../../utils.js"; describe("blocks", () => { test("empty", () => { - expect("loop {}").toMatchFormat(); + return expect("loop {}").toMatchFormat(); }); test("single line non-breaking", () => { - expect("loop { 1 }").toMatchFormat(); + return expect("loop { 1 }").toMatchFormat(); }); test("single line breaking", () => { - expect(`loop { ${long} }`).toChangeFormat(`loop do\n ${long}\nend`); + return expect(`loop { ${long} }`).toChangeFormat(`loop do\n ${long}\nend`); }); test("multi line non-breaking", () => { - expect("loop do\n 1\nend").toChangeFormat("loop { 1 }"); + return expect("loop do\n 1\nend").toChangeFormat("loop { 1 }"); }); test("multi-line breaking", () => { - expect(`loop do\n ${long}\nend`).toMatchFormat(); + return expect(`loop do\n ${long}\nend`).toMatchFormat(); }); test("multi-line with comment", () => { - expect("loop do\n # foobar\nend").toMatchFormat(); + return expect("loop do\n # foobar\nend").toMatchFormat(); }); test("multi-line on command, no body", () => { - expect(`command "foobar" do\nend`).toMatchFormat(); + return expect(`command "foobar" do\nend`).toMatchFormat(); }); test("multi-line on command call, no body", () => { - expect(`command.call "foobar" do\nend`).toMatchFormat(); + return expect(`command.call "foobar" do\nend`).toMatchFormat(); }); test("multi-line on command, with body", () => { - expect(`command "foobar" do\n foo\nend`).toMatchFormat(); + return expect(`command "foobar" do\n foo\nend`).toMatchFormat(); }); test("multi-line on command call, with body", () => { - expect(`command.call "foobar" do\n foo\nend`).toMatchFormat(); + return expect(`command.call "foobar" do\n foo\nend`).toMatchFormat(); }); test("blocks nested inside commands use braces", () => { @@ -48,7 +48,7 @@ describe("blocks", () => { }.bar `); - expect(`foo ${long} { ${long} }.bar`).toChangeFormat(expected); + return expect(`foo ${long} { ${long} }.bar`).toChangeFormat(expected); }); test("breaking maintains calls on the end", () => { @@ -68,7 +68,7 @@ describe("blocks", () => { .to_i `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); test("doesn't do weird things with comments", () => { @@ -80,7 +80,7 @@ describe("blocks", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); describe("for loops", () => { @@ -91,7 +91,7 @@ describe("blocks", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("multiple variables", () => { @@ -101,7 +101,7 @@ describe("blocks", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("optional do keyword", () => { @@ -123,13 +123,13 @@ describe("blocks", () => { end `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); }); // from ruby test/ruby/test_call.rb test("inline do end", () => { - expect(`assert_nil(("a".sub! "b" do end&.foo {}))`).toChangeFormat( + return expect(`assert_nil(("a".sub! "b" do end&.foo {}))`).toChangeFormat( ruby(` assert_nil( ( @@ -143,50 +143,50 @@ describe("blocks", () => { }); test("excessed_comma nodes", () => { - expect("proc { |x,| }").toMatchFormat(); + return expect("proc { |x,| }").toMatchFormat(); }); describe("args", () => { test("no body", () => { - expect("loop { |i| }").toMatchFormat(); + return expect("loop { |i| }").toMatchFormat(); }); test("single line non-breaking", () => { - expect("loop { |i| 1 }").toMatchFormat(); + return expect("loop { |i| 1 }").toMatchFormat(); }); test("single line breaking", () => { - expect(`loop { |i| ${long} }`).toChangeFormat( + return expect(`loop { |i| ${long} }`).toChangeFormat( `loop do |i|\n ${long}\nend` ); }); test("multi-line non-breaking", () => { - expect("loop do |i|\n i\nend").toChangeFormat("loop { |i| i }"); + return expect("loop do |i|\n i\nend").toChangeFormat("loop { |i| i }"); }); test("multi-line breaking", () => { - expect(`loop do |i|\n ${long}\nend`).toMatchFormat(); + return expect(`loop do |i|\n ${long}\nend`).toMatchFormat(); }); test("block-local args", () => { - expect("loop { |i; j| 1 }").toMatchFormat(); + return expect("loop { |i; j| 1 }").toMatchFormat(); }); test("splat", () => { - expect("loop { |*| i }").toMatchFormat(); + return expect("loop { |*| i }").toMatchFormat(); }); test("destructure", () => { - expect("loop { |(a, b)| i }").toMatchFormat(); + return expect("loop { |(a, b)| i }").toMatchFormat(); }); test("lots of args types", () => { - expect("loop { |a, (b, c), d, *e| i }").toMatchFormat(); + return expect("loop { |a, (b, c), d, *e| i }").toMatchFormat(); }); test("does not split up args inside pipes", () => { - expect(`loop do |${long} = 1, a${long} = 2|\nend`).toMatchFormat(); + return expect(`loop do |${long} = 1, a${long} = 2|\nend`).toMatchFormat(); }); }); @@ -198,7 +198,7 @@ describe("blocks", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); // https://github.com/prettier/plugin-ruby/issues/1042 @@ -209,6 +209,6 @@ describe("blocks", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/break.test.js b/test/js/ruby/nodes/break.test.js index 14816781..10ba00f9 100644 --- a/test/js/ruby/nodes/break.test.js +++ b/test/js/ruby/nodes/break.test.js @@ -2,19 +2,19 @@ import { ruby } from "../../utils.js"; describe("break", () => { test("empty break", () => { - expect("break").toMatchFormat(); + return expect("break").toMatchFormat(); }); test("break with one argument, no parens", () => { - expect("break 1").toMatchFormat(); + return expect("break 1").toMatchFormat(); }); test("break with parens drops parens", () => { - expect("break(1)").toChangeFormat("break 1"); + return expect("break(1)").toChangeFormat("break 1"); }); test("break with multiple arguments", () => { - expect("break 1, 2, 3").toMatchFormat(); + return expect("break 1, 2, 3").toMatchFormat(); }); test("keeps parens for multiple statements", () => { @@ -25,14 +25,14 @@ describe("break", () => { ) `); - expect("break(a = 1; a == 1)").toChangeFormat(expected); + return expect("break(a = 1; a == 1)").toChangeFormat(expected); }); test("keeps parens for _mod nodes", () => { - expect("break(1 if true)").toMatchFormat(); + return expect("break(1 if true)").toMatchFormat(); }); test("works with comments", () => { - expect("break # foo").toMatchFormat(); + return expect("break # foo").toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/calls.test.js b/test/js/ruby/nodes/calls.test.js index a7a89343..1b57328e 100644 --- a/test/js/ruby/nodes/calls.test.js +++ b/test/js/ruby/nodes/calls.test.js @@ -4,11 +4,11 @@ describe("calls", () => { test("simple calls", () => { const content = `posts.active.where("created_at > ?", 1.year.ago)`; - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("short chains", () => { - expect("foo.bar.baz qux").toMatchFormat(); + return expect("foo.bar.baz qux").toMatchFormat(); }); test("chain methods", () => { @@ -27,7 +27,7 @@ describe("calls", () => { .hhhhhhhhhh `); - expect(before).toChangeFormat(after); + return expect(before).toChangeFormat(after); }); test("chains of methods with one with arguments right at the top", () => { @@ -38,7 +38,7 @@ describe("calls", () => { ) `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("chains of methods with a block right at the top", () => { @@ -49,13 +49,13 @@ describe("calls", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("tons of calls that fit on one line", () => { const content = "a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z"; - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("chains which contain a .where.not", () => { @@ -68,7 +68,7 @@ describe("calls", () => { .limit(10) `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); describe("within sig blocks", () => { @@ -81,7 +81,7 @@ describe("calls", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("chains with other methods", () => { @@ -93,7 +93,7 @@ describe("calls", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); @@ -110,31 +110,31 @@ describe("calls", () => { .select_all(:table1) `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("no explicit call doesn't add call", () => { - expect("a.(1, 2, 3)").toMatchFormat(); + return expect("a.(1, 2, 3)").toMatchFormat(); }); test("explicit call maintains call", () => { - expect("a.call(1, 2, 3)").toMatchFormat(); + return expect("a.call(1, 2, 3)").toMatchFormat(); }); test("double bang with a special operator on a call", () => { - expect("!!object&.topic_list").toMatchFormat(); + return expect("!!object&.topic_list").toMatchFormat(); }); test("bang with a special operator on a command_call", () => { - expect(`!domain&.include? "@"`).toMatchFormat(); + return expect(`!domain&.include? "@"`).toMatchFormat(); }); test("#call shorthand does not eliminate empty parentheses", () => { - expect("Foo.new.()").toMatchFormat(); + return expect("Foo.new.()").toMatchFormat(); }); test("methods that look like constants do not eliminate empty parens", () => { - expect("Foo()").toMatchFormat(); + return expect("Foo()").toMatchFormat(); }); test("call chains with no indent on the first receiver", () => { @@ -149,7 +149,7 @@ describe("calls", () => { ].map(&:foo?).bbb.ccc `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); test("chained method_add_arg after a block", () => { @@ -158,7 +158,7 @@ describe("calls", () => { end.d e, f `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("comments in a method chain get printed correctly", () => { @@ -201,6 +201,6 @@ describe("calls", () => { end `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); }); diff --git a/test/js/ruby/nodes/case.test.js b/test/js/ruby/nodes/case.test.js index 5c2c4b19..f6efaa5d 100644 --- a/test/js/ruby/nodes/case.test.js +++ b/test/js/ruby/nodes/case.test.js @@ -9,7 +9,7 @@ describe("case", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("single when", () => { @@ -20,7 +20,7 @@ describe("case", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("multiple predicates, one when", () => { @@ -31,7 +31,7 @@ describe("case", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("breaking with multiple predicates, one when", () => { @@ -44,7 +44,7 @@ describe("case", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("breaking with multiple predicates, each one not too long", () => { @@ -63,7 +63,7 @@ describe("case", () => { end `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); test("multiple consecutive whens", () => { @@ -75,7 +75,7 @@ describe("case", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("basic multiple branches", () => { @@ -88,7 +88,7 @@ describe("case", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("else clauses", () => { @@ -101,6 +101,6 @@ describe("case", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/class.test.js b/test/js/ruby/nodes/class.test.js index 81c4be6e..ba917ba9 100644 --- a/test/js/ruby/nodes/class.test.js +++ b/test/js/ruby/nodes/class.test.js @@ -14,7 +14,7 @@ describe("class", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("inheritance", () => { @@ -25,15 +25,17 @@ describe("class", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("breaking class name", () => { - expect(`class P${long}; end`).toChangeFormat(`class P${long}\nend`); + return expect(`class P${long}; end`).toChangeFormat(`class P${long}\nend`); }); test("breaking module name", () => { - expect(`module P${long}; end`).toChangeFormat(`module P${long}\nend`); + return expect(`module P${long}; end`).toChangeFormat( + `module P${long}\nend` + ); }); test("class push blocks", () => { @@ -44,7 +46,7 @@ describe("class", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("multiple access controls", () => { @@ -70,7 +72,7 @@ describe("class", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("method helper", () => { @@ -82,7 +84,7 @@ describe("class", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); describe.each(["public", "protected", "private"])( @@ -99,7 +101,7 @@ describe("class", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("inline", () => { @@ -111,18 +113,18 @@ describe("class", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); } ); describe("constant reference", () => { test("regular", () => { - expect("Pret::Tier::Ruby").toMatchFormat(); + return expect("Pret::Tier::Ruby").toMatchFormat(); }); test("top-level", () => { - expect("::Pret::Tier::Ruby").toMatchFormat(); + return expect("::Pret::Tier::Ruby").toMatchFormat(); }); }); }); diff --git a/test/js/ruby/nodes/conditionals.test.js b/test/js/ruby/nodes/conditionals.test.js index 1f6af635..dc8db071 100644 --- a/test/js/ruby/nodes/conditionals.test.js +++ b/test/js/ruby/nodes/conditionals.test.js @@ -4,11 +4,11 @@ describe("conditionals", () => { describe("not operator", () => { // from ruby test/ruby/test_not.rb test("not operator, empty parens", () => { - expect("assert_equal(true, (not ()))").toMatchFormat(); + return expect("assert_equal(true, (not ()))").toMatchFormat(); }); test("not operator from within a ternary adds parens", () => { - expect("a ? not(b) : c").toMatchFormat(); + return expect("a ? not(b) : c").toMatchFormat(); }); test("not operator from within an if/else adds parens", () => { @@ -20,7 +20,7 @@ describe("conditionals", () => { end `); - expect(content).toChangeFormat("a ? not(b) : c"); + return expect(content).toChangeFormat("a ? not(b) : c"); }); }); @@ -33,7 +33,7 @@ describe("conditionals", () => { "${long}" ${keyword} text `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); test("when modifying an abbreviated assignment expression", () => { @@ -43,7 +43,7 @@ describe("conditionals", () => { "${long}" ${keyword} text `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); test("when modifying an expression with an assignment descendant", () => { @@ -56,7 +56,7 @@ describe("conditionals", () => { ) ${keyword} text `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); }); @@ -72,7 +72,7 @@ describe("conditionals", () => { end `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); test("does not insert double modifiers on a single line for nested conditionals", () => { @@ -89,32 +89,34 @@ describe("conditionals", () => { end `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); }); describe("when inline allowed", () => { describe.each(["if", "unless"])("%s keyword", (keyword) => { test("inline stays", () => { - expect(`1 ${keyword} a`).toMatchFormat(); + return expect(`1 ${keyword} a`).toMatchFormat(); }); test("multi line changes", () => { - expect(`${keyword} a\n 1\nend`).toChangeFormat(`1 ${keyword} a`); + return expect(`${keyword} a\n 1\nend`).toChangeFormat( + `1 ${keyword} a` + ); }); test("inline breaking changes", () => { - expect(`${long} ${keyword} ${long}`).toChangeFormat( + return expect(`${long} ${keyword} ${long}`).toChangeFormat( `${keyword} ${long}\n ${long}\nend` ); }); test("multi line breaking stays", () => { - expect(`${keyword} ${long}\n ${long}\nend`).toMatchFormat(); + return expect(`${keyword} ${long}\n ${long}\nend`).toMatchFormat(); }); test("not operator", () => { - expect(`b ${keyword} not a`).toMatchFormat(); + return expect(`b ${keyword} not a`).toMatchFormat(); }); test("empty first body", () => { @@ -123,7 +125,7 @@ describe("conditionals", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("empty first body with present second body", () => { @@ -134,7 +136,7 @@ describe("conditionals", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("comment in body", () => { @@ -144,7 +146,7 @@ describe("conditionals", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("comment in body with question mark method", () => { @@ -154,7 +156,7 @@ describe("conditionals", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("comment on node in body", () => { @@ -164,7 +166,7 @@ describe("conditionals", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("breaks if the predicate is an assignment", () => { @@ -176,7 +178,7 @@ describe("conditionals", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("breaks if the predicate is an op assignment", () => { @@ -188,11 +190,11 @@ describe("conditionals", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("align long predicates", () => { - expect(`foo ${keyword} ${long} || ${long}a`).toChangeFormat( + return expect(`foo ${keyword} ${long} || ${long}a`).toChangeFormat( ruby(` ${keyword} ${long} || ${Array(keyword.length).fill("").join(" ")}${long}a @@ -203,9 +205,9 @@ describe("conditionals", () => { }); test("wraps single lines in parens when assigning", () => { - expect(`hash[:key] = ${keyword} false then :value end`).toChangeFormat( - `hash[:key] = (:value ${keyword} false)` - ); + return expect( + `hash[:key] = ${keyword} false then :value end` + ).toChangeFormat(`hash[:key] = (:value ${keyword} false)`); }); test("wraps inline version with calls", () => { @@ -215,7 +217,7 @@ describe("conditionals", () => { end.to_s `); - expect(content).toChangeFormat("(false if true).to_s"); + return expect(content).toChangeFormat("(false if true).to_s"); }); test("wraps inline version within binary", () => { @@ -225,18 +227,18 @@ describe("conditionals", () => { end || baz `); - expect(content).toChangeFormat("(bar if foo) || baz"); + return expect(content).toChangeFormat("(bar if foo) || baz"); }); }); }); describe("ternaries", () => { test("non-breaking", () => { - expect("a ? 1 : 2").toMatchFormat(); + return expect("a ? 1 : 2").toMatchFormat(); }); test("breaking", () => { - expect(`a ? ${long} : ${long}`).toChangeFormat( + return expect(`a ? ${long} : ${long}`).toChangeFormat( ruby(` if a ${long} @@ -256,7 +258,7 @@ describe("conditionals", () => { end `); - expect(content).toChangeFormat("a ? 1 : 2"); + return expect(content).toChangeFormat("a ? 1 : 2"); }); test("transform for unless/else", () => { @@ -268,7 +270,7 @@ describe("conditionals", () => { end `); - expect(content).toChangeFormat("a ? 2 : 1"); + return expect(content).toChangeFormat("a ? 2 : 1"); }); test("adds parens if inside of a call", () => { @@ -280,7 +282,7 @@ describe("conditionals", () => { end.to_s `); - expect(content).toChangeFormat("(a ? 1 : 2).to_s"); + return expect(content).toChangeFormat("(a ? 1 : 2).to_s"); }); test("does not add parens if it breaks", () => { @@ -292,7 +294,7 @@ describe("conditionals", () => { end.to_s `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("adds parens if inside of a binary", () => { @@ -304,7 +306,7 @@ describe("conditionals", () => { end + 1 `); - expect(content).toChangeFormat("(a ? 1 : 2) + 1"); + return expect(content).toChangeFormat("(a ? 1 : 2) + 1"); }); test("adds parens if within a command", () => { @@ -319,11 +321,11 @@ describe("conditionals", () => { ) `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); test("does not add parens if within a command_call non-breaking", () => { - expect("foo.bar baz ? foo : bar").toMatchFormat(); + return expect("foo.bar baz ? foo : bar").toMatchFormat(); }); test("adds parens if within a command_call", () => { @@ -338,7 +340,7 @@ describe("conditionals", () => { ) `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); describe("unable to transform", () => { @@ -351,7 +353,7 @@ describe("conditionals", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("command in if body", () => { @@ -363,7 +365,7 @@ describe("conditionals", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("command in else body", () => { @@ -375,7 +377,7 @@ describe("conditionals", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("command call in if body", () => { @@ -387,7 +389,7 @@ describe("conditionals", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("command call in else body", () => { @@ -399,7 +401,7 @@ describe("conditionals", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("heredoc in if body", () => { @@ -414,7 +416,7 @@ describe("conditionals", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("heredoc in else body", () => { @@ -429,7 +431,7 @@ describe("conditionals", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("nested conditional in if body", () => { @@ -453,7 +455,7 @@ describe("conditionals", () => { end `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); test("nested conditional in else body", () => { @@ -476,7 +478,7 @@ describe("conditionals", () => { end `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); test("nested ternary in if body", () => { @@ -486,7 +488,7 @@ describe("conditionals", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("nested ternary in else body", () => { @@ -498,7 +500,7 @@ describe("conditionals", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("command with argument predicate", () => { @@ -510,7 +512,7 @@ describe("conditionals", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("command call with argument predicate", () => { @@ -522,11 +524,11 @@ describe("conditionals", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("align long predicates", () => { - expect(`${long} || ${long}a ? foo : bar`).toChangeFormat( + return expect(`${long} || ${long}a ? foo : bar`).toChangeFormat( ruby(` if ${long} || ${long}a @@ -547,7 +549,7 @@ describe("conditionals", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("assign nodes in predicate", () => { @@ -559,7 +561,7 @@ describe("conditionals", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("opassign nodes in predicate", () => { @@ -571,7 +573,7 @@ describe("conditionals", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("cannot transform with multiple statements", () => { @@ -584,7 +586,7 @@ describe("conditionals", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); }); @@ -599,7 +601,7 @@ describe("conditionals", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("multiple clauses", () => { @@ -615,37 +617,37 @@ describe("conditionals", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); describe.each(["if", "unless"])("add parens when necessary %s", (keyword) => { test("args", () => { - expect(`[${keyword} foo? then bar end]`).toChangeFormat( + return expect(`[${keyword} foo? then bar end]`).toChangeFormat( `[(bar ${keyword} foo?)]` ); }); test("assign", () => { - expect(`foo = ${keyword} bar? then baz end`).toChangeFormat( + return expect(`foo = ${keyword} bar? then baz end`).toChangeFormat( `foo = (baz ${keyword} bar?)` ); }); test("assoc", () => { - expect(`{ foo: ${keyword} bar? then baz end }`).toChangeFormat( + return expect(`{ foo: ${keyword} bar? then baz end }`).toChangeFormat( `{ foo: (baz ${keyword} bar?) }` ); }); test("massign", () => { - expect(`f, o, o = ${keyword} bar? then baz end`).toChangeFormat( + return expect(`f, o, o = ${keyword} bar? then baz end`).toChangeFormat( `f, o, o = (baz ${keyword} bar?)` ); }); test("opassign", () => { - expect(`foo ||= ${keyword} bar? then baz end`).toChangeFormat( + return expect(`foo ||= ${keyword} bar? then baz end`).toChangeFormat( `foo ||= (baz ${keyword} bar?)` ); }); @@ -658,7 +660,7 @@ describe("conditionals", () => { puts "admin: #{name}" ${keyword} user in { role: "admin", name: } `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); } }); diff --git a/test/js/ruby/nodes/defined.test.js b/test/js/ruby/nodes/defined.test.js index 5a7154f9..3faf4b8b 100644 --- a/test/js/ruby/nodes/defined.test.js +++ b/test/js/ruby/nodes/defined.test.js @@ -2,26 +2,28 @@ import { long } from "../../utils.js"; describe("defined", () => { test("no parens", () => { - expect("defined? a").toChangeFormat("defined?(a)"); + return expect("defined? a").toChangeFormat("defined?(a)"); }); test("parens", () => { - expect("defined?(a)").toMatchFormat(); + return expect("defined?(a)").toMatchFormat(); }); test("breaks on long identifier, no parens", () => { - expect(`defined? ${long}`).toChangeFormat(`defined?(\n ${long}\n)`); + return expect(`defined? ${long}`).toChangeFormat(`defined?(\n ${long}\n)`); }); test("breaks on long identifier, with parens", () => { - expect(`defined?(${long})`).toChangeFormat(`defined?(\n ${long}\n)`); + return expect(`defined?(${long})`).toChangeFormat( + `defined?(\n ${long}\n)` + ); }); test("breaking keeps breaking", () => { - expect(`defined?(\n ${long}\n)`).toMatchFormat(); + return expect(`defined?(\n ${long}\n)`).toMatchFormat(); }); test("unnecessary breaking reverts to inline", () => { - expect("defined?(\n a\n)").toChangeFormat("defined?(a)"); + return expect("defined?(\n a\n)").toChangeFormat("defined?(a)"); }); }); diff --git a/test/js/ruby/nodes/embdoc.test.js b/test/js/ruby/nodes/embdoc.test.js index b531f650..9d3e1d2a 100644 --- a/test/js/ruby/nodes/embdoc.test.js +++ b/test/js/ruby/nodes/embdoc.test.js @@ -14,7 +14,7 @@ describe("embdoc", () => { =end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("within a class", () => { @@ -26,7 +26,7 @@ describe("embdoc", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("within a nested class", () => { @@ -40,6 +40,6 @@ describe("embdoc", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/field.test.js b/test/js/ruby/nodes/field.test.js index daabe636..2492c093 100644 --- a/test/js/ruby/nodes/field.test.js +++ b/test/js/ruby/nodes/field.test.js @@ -1,13 +1,13 @@ describe("field", () => { test("basic", () => { - expect("foo.x = 1").toMatchFormat(); + return expect("foo.x = 1").toMatchFormat(); }); test("replaces :: with .", () => { - expect("foo::x = 1").toChangeFormat("foo.x = 1"); + return expect("foo::x = 1").toChangeFormat("foo.x = 1"); }); test("with lonely operator", () => { - expect("foo&.x = 1").toMatchFormat(); + return expect("foo&.x = 1").toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/hashes.test.js b/test/js/ruby/nodes/hashes.test.js index 4cf71034..a9ecdc85 100644 --- a/test/js/ruby/nodes/hashes.test.js +++ b/test/js/ruby/nodes/hashes.test.js @@ -2,7 +2,7 @@ import { long, ruby } from "../../utils.js"; describe("hash", () => { test("empty", () => { - expect("{}").toMatchFormat(); + return expect("{}").toMatchFormat(); }); test("empty with comments", () => { @@ -13,7 +13,7 @@ describe("hash", () => { } `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("breaking", () => { @@ -28,11 +28,11 @@ describe("hash", () => { } `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("breaking maintains calls on the end", () => { - expect(`{ a: ${long} }.freeze`).toChangeFormat( + return expect(`{ a: ${long} }.freeze`).toChangeFormat( `{\n a:\n ${long}\n}.freeze` ); }); @@ -45,7 +45,7 @@ describe("hash", () => { HERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("as the last value", () => { @@ -55,7 +55,7 @@ describe("hash", () => { HERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("when exceeding line length", () => { @@ -75,31 +75,31 @@ describe("hash", () => { } `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); }); describe("dynamic string keys", () => { test("basic", () => { - expect(`{ "foo": "bar" }`).toChangeFormat(`{ foo: "bar" }`); + return expect(`{ "foo": "bar" }`).toChangeFormat(`{ foo: "bar" }`); }); test("with interpolation", () => { - expect(`{ "#{1 + 1}": 2 }`).toMatchFormat(); + return expect(`{ "#{1 + 1}": 2 }`).toMatchFormat(); }); }); describe("bare assoc hash", () => { test("commands", () => { - expect("foobar alpha: alpha, beta: beta").toMatchFormat(); + return expect("foobar alpha: alpha, beta: beta").toMatchFormat(); }); test("command calls", () => { - expect("foo.bar alpha: alpha, beta: beta").toMatchFormat(); + return expect("foo.bar alpha: alpha, beta: beta").toMatchFormat(); }); test("calls", () => { - expect("foobar(alpha: alpha, beta: beta)").toMatchFormat(); + return expect("foobar(alpha: alpha, beta: beta)").toMatchFormat(); }); test("breaks contents and parens together", () => { @@ -114,40 +114,42 @@ describe("hash", () => { ) `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); }); describe("when hash labels allowed", () => { test("hash labels stay", () => { - expect(`{ a: "a", b: "b", c: "c" }`).toMatchFormat(); + return expect(`{ a: "a", b: "b", c: "c" }`).toMatchFormat(); }); test("hash rockets get replaced", () => { - expect(`{ :a => "a", :b => "b", :c => "c" }`).toChangeFormat( + return expect(`{ :a => "a", :b => "b", :c => "c" }`).toChangeFormat( `{ a: "a", b: "b", c: "c" }` ); }); test("hash rockets stay when needed", () => { - expect("{ Foo => 1, Bar => 2 }").toMatchFormat(); + return expect("{ Foo => 1, Bar => 2 }").toMatchFormat(); }); test("ending in equals stays", () => { - expect(`{ :foo= => "bar" }`).toMatchFormat(); + return expect(`{ :foo= => "bar" }`).toMatchFormat(); }); test("starting with non-letter/non-underscore stays", () => { - expect(`{ :@foo => "bar" }`).toMatchFormat(); + return expect(`{ :@foo => "bar" }`).toMatchFormat(); }); test("starting with underscore converts", () => { - expect(`{ :_foo => "bar" }`).toChangeFormat(`{ _foo: "bar" }`); + return expect(`{ :_foo => "bar" }`).toChangeFormat(`{ _foo: "bar" }`); }); }); test("prints hashes with consistent keys", () => { - expect(`{ a: "a", b => "b" }`).toChangeFormat(`{ :a => "a", b => "b" }`); + return expect(`{ a: "a", b => "b" }`).toChangeFormat( + `{ :a => "a", b => "b" }` + ); }); test("print hashes with correct braces when contents fits", () => { @@ -158,7 +160,7 @@ describe("hash", () => { } `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("with leading comments but none in body", () => { @@ -167,7 +169,7 @@ describe("hash", () => { {} `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("with leading comments and comments in the body", () => { @@ -179,7 +181,7 @@ describe("hash", () => { } `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("with comments just in the body", () => { @@ -190,7 +192,7 @@ describe("hash", () => { } `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); // https://github.com/prettier/plugin-ruby/issues/758 @@ -209,7 +211,7 @@ describe("hash", () => { } `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); test("child hashes break assoc_news if their parents break", () => { @@ -227,7 +229,7 @@ describe("hash", () => { } `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); test("child hashes break hashes if their parents break", () => { @@ -250,6 +252,6 @@ describe("hash", () => { } `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); }); diff --git a/test/js/ruby/nodes/heredocs.test.js b/test/js/ruby/nodes/heredocs.test.js index 1a1a92c1..77e5e8fb 100644 --- a/test/js/ruby/nodes/heredocs.test.js +++ b/test/js/ruby/nodes/heredocs.test.js @@ -9,7 +9,7 @@ describe("heredocs", () => { HERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("with interpolation", () => { @@ -21,7 +21,7 @@ describe("heredocs", () => { HERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("on an assignment", () => { @@ -31,7 +31,7 @@ describe("heredocs", () => { HERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("nested within another", () => { @@ -44,7 +44,7 @@ describe("heredocs", () => { PARENT `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("with embedded expressions", () => { @@ -58,7 +58,7 @@ describe("heredocs", () => { HERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("with a call and indented", () => { @@ -70,7 +70,7 @@ describe("heredocs", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); @@ -82,7 +82,7 @@ describe("heredocs", () => { HERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("with interpolation", () => { @@ -94,7 +94,7 @@ describe("heredocs", () => { HERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("on an assignment", () => { @@ -104,7 +104,7 @@ describe("heredocs", () => { HERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("nested within another", () => { @@ -117,7 +117,7 @@ describe("heredocs", () => { PARENT `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("with a call and indented", () => { @@ -129,7 +129,7 @@ describe("heredocs", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); @@ -141,7 +141,7 @@ describe("heredocs", () => { HERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("on calls with multiple", () => { @@ -153,7 +153,7 @@ describe("heredocs", () => { THERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("on commands", () => { @@ -163,7 +163,7 @@ describe("heredocs", () => { HERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("on commands with multiple", () => { @@ -175,7 +175,7 @@ describe("heredocs", () => { THERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("on command calls", () => { @@ -185,7 +185,7 @@ describe("heredocs", () => { HERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("on command calls with multiple", () => { @@ -197,7 +197,7 @@ describe("heredocs", () => { THERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); @@ -209,7 +209,7 @@ describe("heredocs", () => { TEXT `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("squiggly indent", () => { @@ -219,7 +219,7 @@ describe("heredocs", () => { TEXT `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("straight no indent", () => { @@ -229,7 +229,7 @@ describe("heredocs", () => { TEXT `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); @@ -244,7 +244,7 @@ describe("heredocs", () => { ) `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("arg w/ block", () => { @@ -261,7 +261,7 @@ describe("heredocs", () => { TEXT `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); test("in an activerecord scope arg w/ chaining", () => { @@ -284,7 +284,7 @@ describe("heredocs", () => { EOS `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); test("long breakable arg after heredoc literal", () => { @@ -303,7 +303,7 @@ describe("heredocs", () => { ] `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); test("call w/ short breakable arg after heredoc literal", () => { @@ -313,7 +313,7 @@ describe("heredocs", () => { BAR `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("on calls", () => { @@ -331,7 +331,7 @@ describe("heredocs", () => { HERE `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); test("on calls with trailing arguments", () => { @@ -341,7 +341,7 @@ describe("heredocs", () => { HERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("in parens args with trailing args after", () => { @@ -352,7 +352,7 @@ describe("heredocs", () => { ARG1 `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("in paren args with a call", () => { @@ -363,7 +363,7 @@ describe("heredocs", () => { ARG1 `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("on calls with multiple", () => { @@ -375,7 +375,7 @@ describe("heredocs", () => { THERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("on commands", () => { @@ -385,7 +385,7 @@ describe("heredocs", () => { HERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("on commands with multiple", () => { @@ -397,7 +397,7 @@ describe("heredocs", () => { THERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("on command calls with trailing arg", () => { @@ -407,7 +407,7 @@ describe("heredocs", () => { HERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("on command calls with multiple", () => { @@ -419,7 +419,7 @@ describe("heredocs", () => { THERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("assign with call", () => { @@ -429,7 +429,7 @@ describe("heredocs", () => { TEXT `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("assign with squiggly indent", () => { @@ -440,7 +440,7 @@ describe("heredocs", () => { ).strip `); - expect(content).toChangeFormat( + return expect(content).toChangeFormat( ruby(` foo = (<<~TEXT).strip bar @@ -456,7 +456,7 @@ describe("heredocs", () => { TEXT `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("with a call and indented", () => { @@ -468,7 +468,7 @@ describe("heredocs", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("with a method call", () => { @@ -479,7 +479,7 @@ describe("heredocs", () => { HERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("with two calls and indented", () => { @@ -491,7 +491,7 @@ describe("heredocs", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("xstring", () => { @@ -501,7 +501,7 @@ describe("heredocs", () => { SHELL `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("with a comment after the declaration", () => { @@ -511,7 +511,7 @@ describe("heredocs", () => { HERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("with a comment after the declaration in a call", () => { @@ -521,7 +521,7 @@ describe("heredocs", () => { HERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("spilling out from another node keeps subsequent formatting", () => { @@ -532,6 +532,6 @@ describe("heredocs", () => { qaz `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/hooks.test.js b/test/js/ruby/nodes/hooks.test.js index 34a81842..a5d94a65 100644 --- a/test/js/ruby/nodes/hooks.test.js +++ b/test/js/ruby/nodes/hooks.test.js @@ -2,19 +2,23 @@ import { long, ruby } from "../../utils.js"; describe.each(["BEGIN", "END"])("%s hook", (hook) => { test("shortens to one line", () => { - expect(`${hook} {\n p "hook"\n}`).toChangeFormat(`${hook} { p "hook" }`); + return expect(`${hook} {\n p "hook"\n}`).toChangeFormat( + `${hook} { p "hook" }` + ); }); test("maintains single lines", () => { - expect(`${hook} { p "hook" }`).toMatchFormat(); + return expect(`${hook} { p "hook" }`).toMatchFormat(); }); test("maintains multi line", () => { - expect(`${hook} {\n ${long}\n}`).toMatchFormat(); + return expect(`${hook} {\n ${long}\n}`).toMatchFormat(); }); test("expands to multi line", () => { - expect(`${hook} { ${long} }`).toChangeFormat(`${hook} {\n ${long}\n}`); + return expect(`${hook} { ${long} }`).toChangeFormat( + `${hook} {\n ${long}\n}` + ); }); test("does not move comments on the declaration", () => { @@ -24,7 +28,7 @@ describe.each(["BEGIN", "END"])("%s hook", (hook) => { } `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("works for comments in the body", () => { @@ -34,6 +38,6 @@ describe.each(["BEGIN", "END"])("%s hook", (hook) => { } `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/kwargs.test.js b/test/js/ruby/nodes/kwargs.test.js index c7a4dfc7..4aa5d4f5 100644 --- a/test/js/ruby/nodes/kwargs.test.js +++ b/test/js/ruby/nodes/kwargs.test.js @@ -1,13 +1,13 @@ describe("kwargs", () => { test("basic", () => { - expect("def foo(bar: baz)\nend").toMatchFormat(); + return expect("def foo(bar: baz)\nend").toMatchFormat(); }); test("optional", () => { - expect("def foo(bar:)\nend").toMatchFormat(); + return expect("def foo(bar:)\nend").toMatchFormat(); }); test("double splat", () => { - expect("def foo(bar:, **baz)\nend").toMatchFormat(); + return expect("def foo(bar:, **baz)\nend").toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/lambda.test.js b/test/js/ruby/nodes/lambda.test.js index f8abd31f..c42e34b6 100644 --- a/test/js/ruby/nodes/lambda.test.js +++ b/test/js/ruby/nodes/lambda.test.js @@ -2,38 +2,38 @@ import { long, ruby } from "../../utils.js"; describe("lambda", () => { test("plain stabby lambda literal", () => { - expect("-> { 1 }").toMatchFormat(); + return expect("-> { 1 }").toMatchFormat(); }); test("stabby lambda literal with args", () => { - expect("->(a, b, c) { a + b + c }").toMatchFormat(); + return expect("->(a, b, c) { a + b + c }").toMatchFormat(); }); test("stabby lambda literal with arg, no parens", () => { - expect("-> a { a }").toChangeFormat("->(a) { a }"); + return expect("-> a { a }").toChangeFormat("->(a) { a }"); }); test("stabby lambda with parens, no args", () => { - expect("-> () { 1 }").toChangeFormat("-> { 1 }"); + return expect("-> () { 1 }").toChangeFormat("-> { 1 }"); }); test("breaking stabby lambda literal", () => { - expect(`-> { ${long} }`).toChangeFormat(`-> do\n ${long}\nend`); + return expect(`-> { ${long} }`).toChangeFormat(`-> do\n ${long}\nend`); }); test("breaking stabby lambda literal with args", () => { const content = `->(a) { a + ${long} }`; const expected = `->(a) do\n a +\n ${long}\nend`; - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); test("stabby lambda literal within a command node", () => { - expect("command :foo, ->(arg) { arg + arg }").toMatchFormat(); + return expect("command :foo, ->(arg) { arg + arg }").toMatchFormat(); }); test("stabby lambda literal that breaks within a command node", () => { - expect(`command :foo, -> { ${long} }`).toChangeFormat( + return expect(`command :foo, -> { ${long} }`).toChangeFormat( ruby(` command :foo, -> { @@ -44,11 +44,11 @@ describe("lambda", () => { }); test("stabby lambda literal with a command call node", () => { - expect("command.call :foo, ->(arg) { arg + arg }").toMatchFormat(); + return expect("command.call :foo, ->(arg) { arg + arg }").toMatchFormat(); }); test("stabby lambda literal that breaks with a command call node", () => { - expect(`command.call :foo, -> { ${long} }`).toChangeFormat( + return expect(`command.call :foo, -> { ${long} }`).toChangeFormat( ruby(` command.call :foo, -> { @@ -59,7 +59,7 @@ describe("lambda", () => { }); test("stabby lambda literal that breaks deeply within a command node", () => { - expect(`command :foo, bar: -> { ${long} }`).toChangeFormat( + return expect(`command :foo, bar: -> { ${long} }`).toChangeFormat( ruby(` command :foo, bar: -> { @@ -72,7 +72,7 @@ describe("lambda", () => { test("very long arguments list doesn't break within pipes", () => { const content = `command :foo, ->(${long}, a${long}, aa${long}) { true }`; - expect(content).toChangeFormat( + return expect(content).toChangeFormat( ruby(` command :foo, ->( @@ -87,10 +87,10 @@ describe("lambda", () => { }); test("empty brackets", () => { - expect("a[]").toMatchFormat(); + return expect("a[]").toMatchFormat(); }); test("brackets with multiple args", () => { - expect("a[1, 2, 3]").toMatchFormat(); + return expect("a[1, 2, 3]").toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/loops.test.js b/test/js/ruby/nodes/loops.test.js index f68fcff6..fb1bc9bc 100644 --- a/test/js/ruby/nodes/loops.test.js +++ b/test/js/ruby/nodes/loops.test.js @@ -2,7 +2,7 @@ import { long, ruby } from "../../utils.js"; describe.each(["while", "until"])("%s", (keyword) => { test("aligns predicates", () => { - expect(`foo ${keyword} ${long} || ${long}`).toChangeFormat( + return expect(`foo ${keyword} ${long} || ${long}`).toChangeFormat( ruby(` ${keyword} ${long} || ${Array(keyword.length).fill("").join(" ")}${long} @@ -14,19 +14,19 @@ describe.each(["while", "until"])("%s", (keyword) => { describe("inlines allowed", () => { test("transforms to inline", () => { - expect(`${keyword} a\n 1\nend`).toChangeFormat(`1 ${keyword} a`); + return expect(`${keyword} a\n 1\nend`).toChangeFormat(`1 ${keyword} a`); }); test("maintains inlines", () => { - expect(`1 ${keyword} a`).toMatchFormat(); + return expect(`1 ${keyword} a`).toMatchFormat(); }); test("breaks on large predicates", () => { - expect(`${keyword} ${long}\n 1\nend`).toMatchFormat(); + return expect(`${keyword} ${long}\n 1\nend`).toMatchFormat(); }); test("breaks inlines on large predicates", () => { - expect(`1 ${keyword} ${long}`).toChangeFormat( + return expect(`1 ${keyword} ${long}`).toChangeFormat( `${keyword} ${long}\n 1\nend` ); }); @@ -38,7 +38,7 @@ describe.each(["while", "until"])("%s", (keyword) => { end ${keyword} bar `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("breaks when an assignment is in the predicate", () => { @@ -48,7 +48,7 @@ describe.each(["while", "until"])("%s", (keyword) => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("breaks when a multi assignment is in the predicate", () => { @@ -58,7 +58,7 @@ describe.each(["while", "until"])("%s", (keyword) => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("breaks the parent when there is an assignment", () => { @@ -70,11 +70,11 @@ describe.each(["while", "until"])("%s", (keyword) => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("wraps single lines in parens when assigning", () => { - expect( + return expect( `hash[:key] = ${keyword} false do break :value end` ).toChangeFormat(`hash[:key] = (break :value ${keyword} false)`); }); @@ -85,7 +85,7 @@ describe.each(["while", "until"])("%s", (keyword) => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("empty body, long predicate", () => { @@ -94,7 +94,7 @@ describe.each(["while", "until"])("%s", (keyword) => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); @@ -102,31 +102,31 @@ describe.each(["while", "until"])("%s", (keyword) => { "add parens when necessary %s", (keyword) => { test("args", () => { - expect(`[${keyword} foo? do bar end]`).toChangeFormat( + return expect(`[${keyword} foo? do bar end]`).toChangeFormat( `[(bar ${keyword} foo?)]` ); }); test("assign", () => { - expect(`foo = ${keyword} bar? do baz end`).toChangeFormat( + return expect(`foo = ${keyword} bar? do baz end`).toChangeFormat( `foo = (baz ${keyword} bar?)` ); }); test("assoc", () => { - expect(`{ foo: ${keyword} bar? do baz end }`).toChangeFormat( + return expect(`{ foo: ${keyword} bar? do baz end }`).toChangeFormat( `{ foo: (baz ${keyword} bar?) }` ); }); test("massign", () => { - expect(`f, o, o = ${keyword} bar? do baz end`).toChangeFormat( + return expect(`f, o, o = ${keyword} bar? do baz end`).toChangeFormat( `f, o, o = (baz ${keyword} bar?)` ); }); test("opassign", () => { - expect(`foo ||= ${keyword} bar? do baz end`).toChangeFormat( + return expect(`foo ||= ${keyword} bar? do baz end`).toChangeFormat( `foo ||= (baz ${keyword} bar?)` ); }); @@ -155,6 +155,6 @@ describe.each(["while", "until"])("%s", (keyword) => { end `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); }); diff --git a/test/js/ruby/nodes/massign.test.js b/test/js/ruby/nodes/massign.test.js index 5ff61845..5c0ac339 100644 --- a/test/js/ruby/nodes/massign.test.js +++ b/test/js/ruby/nodes/massign.test.js @@ -1,67 +1,67 @@ describe("massign", () => { test("multi on left, multi on right", () => { - expect("a, b, c = 1, 2, 3").toMatchFormat(); + return expect("a, b, c = 1, 2, 3").toMatchFormat(); }); test("single on left, multi on right", () => { - expect("a = 1, 2, 3").toMatchFormat(); + return expect("a = 1, 2, 3").toMatchFormat(); }); test("multi on left, array on right", () => { - expect("a, b, c = [1, 2, 3]").toMatchFormat(); + return expect("a, b, c = [1, 2, 3]").toMatchFormat(); }); test("parens on left, multi on right", () => { - expect("(a, b, c) = 1, 2, 3").toChangeFormat("a, b, c = 1, 2, 3"); + return expect("(a, b, c) = 1, 2, 3").toChangeFormat("a, b, c = 1, 2, 3"); }); test("double parens on left, multi on right", () => { - expect("((a, b, c)) = 1, 2, 3").toChangeFormat("a, b, c = 1, 2, 3"); + return expect("((a, b, c)) = 1, 2, 3").toChangeFormat("a, b, c = 1, 2, 3"); }); test("parens on some of left, multi on right", () => { - expect("(a, b), c = [1, 2], 3").toMatchFormat(); + return expect("(a, b), c = [1, 2], 3").toMatchFormat(); }); test("extra commas at the end", () => { - expect("a, = 1").toMatchFormat(); + return expect("a, = 1").toMatchFormat(); }); test("extra commas at the end with multiple", () => { - expect("a, b, c, = 1").toMatchFormat(); + return expect("a, b, c, = 1").toMatchFormat(); }); test("extra commas with parens", () => { - expect("(a, b,), c, = 1").toMatchFormat(); + return expect("(a, b,), c, = 1").toMatchFormat(); }); test("extra commas with doubled parens", () => { - expect("((a, b,), c,), = 1").toMatchFormat(); + return expect("((a, b,), c,), = 1").toMatchFormat(); }); describe("splat", () => { test("after ident", () => { - expect("a, *b = 1, 2, 3").toMatchFormat(); + return expect("a, *b = 1, 2, 3").toMatchFormat(); }); test("between idents", () => { - expect("a, *b, c, d = 1, 2, 3").toMatchFormat(); + return expect("a, *b, c, d = 1, 2, 3").toMatchFormat(); }); test("with no name", () => { - expect("a, * = 1, 2, 3").toMatchFormat(); + return expect("a, * = 1, 2, 3").toMatchFormat(); }); test("on right side", () => { - expect("a = *a").toMatchFormat(); + return expect("a = *a").toMatchFormat(); }); test("only on left side", () => { - expect("* = [1, 2, 3]").toMatchFormat(); + return expect("* = [1, 2, 3]").toMatchFormat(); }); test("and then ident on left side", () => { - expect("*, a = [1, 2, 3]").toMatchFormat(); + return expect("*, a = [1, 2, 3]").toMatchFormat(); }); }); }); diff --git a/test/js/ruby/nodes/method.test.js b/test/js/ruby/nodes/method.test.js index 8c88e475..9651ac3e 100644 --- a/test/js/ruby/nodes/method.test.js +++ b/test/js/ruby/nodes/method.test.js @@ -3,49 +3,53 @@ import { atLeastVersion, long, ruby } from "../../utils.js"; describe("method", () => { describe("definitions", () => { test("shorthand for empty methods", () => { - expect("def foo; end").toChangeFormat("def foo\nend"); + return expect("def foo; end").toChangeFormat("def foo\nend"); }); test("shorthand for empty methods with parens", () => { - expect("def foo(); end").toChangeFormat("def foo()\nend"); + return expect("def foo(); end").toChangeFormat("def foo()\nend"); }); test("single arg, no parens", () => { - expect("def foo bar\nend").toChangeFormat("def foo(bar)\nend"); + return expect("def foo bar\nend").toChangeFormat("def foo(bar)\nend"); }); test("single arg, with parens", () => { - expect("def foo(bar)\nend").toMatchFormat(); + return expect("def foo(bar)\nend").toMatchFormat(); }); test("shorthand for empty singleton methods", () => { - expect("def self.foo; end").toChangeFormat("def self.foo\nend"); + return expect("def self.foo; end").toChangeFormat("def self.foo\nend"); }); test("shorthand for empty singleton methods with parens", () => { - expect("def self.foo(); end").toChangeFormat("def self.foo()\nend"); + return expect("def self.foo(); end").toChangeFormat( + "def self.foo()\nend" + ); }); test("singleton, single arg, no parens", () => { - expect("def self.foo bar\nend").toChangeFormat("def self.foo(bar)\nend"); + return expect("def self.foo bar\nend").toChangeFormat( + "def self.foo(bar)\nend" + ); }); test("singleton, single arg, with parens", () => { - expect("def self.foo(bar)\nend").toMatchFormat(); + return expect("def self.foo(bar)\nend").toMatchFormat(); }); test("shorthand with a body", () => { - expect("def foo(alpha); 1; end").toChangeFormat( + return expect("def foo(alpha); 1; end").toChangeFormat( "def foo(alpha)\n 1\nend" ); }); test("single splat arg with no name", () => { - expect("def foo(*); end").toChangeFormat("def foo(*)\nend"); + return expect("def foo(*); end").toChangeFormat("def foo(*)\nend"); }); test("double splat arg with no name", () => { - expect("def foo(**); end").toChangeFormat("def foo(**)\nend"); + return expect("def foo(**); end").toChangeFormat("def foo(**)\nend"); }); test("with helper method", () => { @@ -55,7 +59,7 @@ describe("method", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("with helper method on defs", () => { @@ -65,7 +69,7 @@ describe("method", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("every single arg type", () => { @@ -75,7 +79,7 @@ describe("method", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("breaking", () => { @@ -88,7 +92,7 @@ describe("method", () => { end `); - expect(content).toChangeFormat(expected); + return expect(content).toChangeFormat(expected); }); test("with comments on method definition", () => { @@ -100,7 +104,7 @@ describe("method", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("with comments on params", () => { @@ -118,7 +122,7 @@ describe("method", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("with comments on optional params", () => { @@ -130,12 +134,14 @@ describe("method", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); if (atLeastVersion("2.7")) { test("nokw_param", () => { - expect("def foo(**nil); end").toChangeFormat("def foo(**nil)\nend"); + return expect("def foo(**nil); end").toChangeFormat( + "def foo(**nil)\nend" + ); }); test("args_forward", () => { @@ -145,7 +151,7 @@ describe("method", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); } @@ -157,19 +163,19 @@ describe("method", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("single-line methods", () => { - expect("def foo = bar").toMatchFormat(); + return expect("def foo = bar").toMatchFormat(); }); test("single-line methods with empty params", () => { - expect("def foo() = bar").toChangeFormat("def foo = bar"); + return expect("def foo() = bar").toChangeFormat("def foo = bar"); }); test("single-line methods with params", () => { - expect("def foo(name) = bar").toMatchFormat(); + return expect("def foo(name) = bar").toMatchFormat(); }); } @@ -183,25 +189,25 @@ describe("method", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); describe("method calls", () => { test("empty parens", () => { - expect("foo()").toChangeFormat("foo"); + return expect("foo()").toChangeFormat("foo"); }); test("single args", () => { - expect("foo(1)").toMatchFormat(); + return expect("foo(1)").toMatchFormat(); }); test("multi arg", () => { - expect("foo(1, 2)").toMatchFormat(); + return expect("foo(1, 2)").toMatchFormat(); }); test("just block", () => { - expect("foo(&block)").toMatchFormat(); + return expect("foo(&block)").toMatchFormat(); }); describe("commands", () => { @@ -212,7 +218,7 @@ describe("method", () => { ) `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("alignment for `to`", () => { @@ -222,7 +228,7 @@ describe("method", () => { ) `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("alignment for `not_to`", () => { @@ -232,7 +238,7 @@ describe("method", () => { ) `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("alignment for `to_not`", () => { @@ -242,7 +248,7 @@ describe("method", () => { ) `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("just block", () => { @@ -252,21 +258,21 @@ describe("method", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); describe("single splat", () => { test("plain", () => { - expect("foo(*bar)").toMatchFormat(); + return expect("foo(*bar)").toMatchFormat(); }); test("with multi args", () => { - expect("foo(1, 2, *abc)").toMatchFormat(); + return expect("foo(1, 2, *abc)").toMatchFormat(); }); test("between multi args", () => { - expect("foo(1, 2, *abc, 3, 4)").toMatchFormat(); + return expect("foo(1, 2, *abc, 3, 4)").toMatchFormat(); }); test("with comments", () => { @@ -279,7 +285,7 @@ describe("method", () => { ) `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("with trailing comments", () => { @@ -292,11 +298,11 @@ describe("method", () => { ) `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("with block", () => { - expect("foo(*bar, &block)").toMatchFormat(); + return expect("foo(*bar, &block)").toMatchFormat(); }); test("with comments and block", () => { @@ -307,74 +313,74 @@ describe("method", () => { ) `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); describe("double splat", () => { test("plain", () => { - expect("foo(**bar)").toMatchFormat(); + return expect("foo(**bar)").toMatchFormat(); }); test("with block", () => { - expect("foo(**bar, &block)").toMatchFormat(); + return expect("foo(**bar, &block)").toMatchFormat(); }); test("with splat and block", () => { - expect("foo(*bar, **baz, &block)").toMatchFormat(); + return expect("foo(*bar, **baz, &block)").toMatchFormat(); }); test("after kwarg", () => { - expect("foo(kwarg: 1, **splat)").toMatchFormat(); + return expect("foo(kwarg: 1, **splat)").toMatchFormat(); }); test("before kwarg", () => { - expect("foo(**splat, kwarg: 1)").toMatchFormat(); + return expect("foo(**splat, kwarg: 1)").toMatchFormat(); }); test("before kwargs", () => { - expect("foo(before: 1, **splat, after: 1)").toMatchFormat(); + return expect("foo(before: 1, **splat, after: 1)").toMatchFormat(); }); }); describe("different operators", () => { test("double colon gets changed", () => { - expect("Foo::foo").toChangeFormat("Foo.foo"); + return expect("Foo::foo").toChangeFormat("Foo.foo"); }); test("lonely operator", () => { - expect("foo&.foo").toMatchFormat(); + return expect("foo&.foo").toMatchFormat(); }); }); describe("breaking", () => { describe("without trailing commas", () => { test("starting with no trailing comma stays", () => { - expect(`foo(${long}, a${long})`).toChangeFormat( + return expect(`foo(${long}, a${long})`).toChangeFormat( `foo(\n ${long},\n a${long}\n)` ); }); test("with breaking ternary as first argument", () => { - expect(`foo bar ? ${long} : a${long}`).toChangeFormat( + return expect(`foo bar ? ${long} : a${long}`).toChangeFormat( `foo(\n if bar\n ${long}\n else\n a${long}\n end\n)` ); }); test("starting with trailing comma changes", () => { - expect(`foo(${long}, a${long},)`).toChangeFormat( + return expect(`foo(${long}, a${long},)`).toChangeFormat( `foo(\n ${long},\n a${long}\n)` ); }); test("with block on the end", () => { - expect(`foo(${long}, &block)`).toChangeFormat( + return expect(`foo(${long}, &block)`).toChangeFormat( `foo(\n ${long},\n &block\n)` ); }); test("on commands", () => { - expect(`command ${long}, a${long}`).toChangeFormat( + return expect(`command ${long}, a${long}`).toChangeFormat( ruby(` command ${long}, a${long} @@ -383,7 +389,7 @@ describe("method", () => { }); test("on command calls", () => { - expect(`command.call ${long}, a${long}`).toChangeFormat( + return expect(`command.call ${long}, a${long}`).toChangeFormat( ruby(` command.call ${long}, a${long} diff --git a/test/js/ruby/nodes/next.test.js b/test/js/ruby/nodes/next.test.js index d1a5690d..b1a9fb54 100644 --- a/test/js/ruby/nodes/next.test.js +++ b/test/js/ruby/nodes/next.test.js @@ -2,19 +2,19 @@ import { ruby } from "../../utils.js"; describe("next", () => { test("bare", () => { - expect("next").toMatchFormat(); + return expect("next").toMatchFormat(); }); test("one arg, no parens", () => { - expect("next 1").toMatchFormat(); + return expect("next 1").toMatchFormat(); }); test("one arg, with parens", () => { - expect("next(1)").toChangeFormat("next 1"); + return expect("next(1)").toChangeFormat("next 1"); }); test("multiple args", () => { - expect("next 1, 2").toMatchFormat(); + return expect("next 1, 2").toMatchFormat(); }); test("keeps parens for multiple statements", () => { @@ -25,10 +25,10 @@ describe("next", () => { ) `); - expect("next(a = 1; a == 1)").toChangeFormat(expected); + return expect("next(a = 1; a == 1)").toChangeFormat(expected); }); test("keeps parens for _mod nodes", () => { - expect("next(1 if true)").toMatchFormat(); + return expect("next(1 if true)").toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/numbers.test.js b/test/js/ruby/nodes/numbers.test.js index 82266637..a1edd35b 100644 --- a/test/js/ruby/nodes/numbers.test.js +++ b/test/js/ruby/nodes/numbers.test.js @@ -1,49 +1,49 @@ describe("numbers", () => { test("basic", () => { - expect("123").toMatchFormat(); + return expect("123").toMatchFormat(); }); test("preserves sign", () => { - expect("-123").toMatchFormat(); + return expect("-123").toMatchFormat(); }); test("respects no o for octal numbers", () => { - expect("0123").toChangeFormat("0123"); + return expect("0123").toChangeFormat("0123"); }); test("respects o for octal numbers", () => { - expect("0o123").toChangeFormat("0o123"); + return expect("0o123").toChangeFormat("0o123"); }); test("does not consider numbers large until they have more than 4 digits", () => { - expect("1234").toMatchFormat(); + return expect("1234").toMatchFormat(); }); test("for large numbers adds underscores (mod 3 ==== 0)", () => { - expect("123456").toChangeFormat("123_456"); + return expect("123456").toChangeFormat("123_456"); }); test("for large numbers adds underscores (mod 3 === 1)", () => { - expect("1234567").toChangeFormat("1_234_567"); + return expect("1234567").toChangeFormat("1_234_567"); }); test("for large numbers add underscores (mod 3 ==== 2)", () => { - expect("12345678").toChangeFormat("12_345_678"); + return expect("12345678").toChangeFormat("12_345_678"); }); test("ignores numbers that already have underscores", () => { - expect("2019_04_17_17_09_00").toMatchFormat(); + return expect("2019_04_17_17_09_00").toMatchFormat(); }); test("ignores formatting on binary numbers", () => { - expect("0b01101001").toMatchFormat(); + return expect("0b01101001").toMatchFormat(); }); test("ignores formatting on octal numbers", () => { - expect("0o123401234").toMatchFormat(); + return expect("0o123401234").toMatchFormat(); }); test("ignores formatting on hex numbers", () => { - expect("0x123401234").toMatchFormat(); + return expect("0x123401234").toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/patterns.test.js b/test/js/ruby/nodes/patterns.test.js index dcd17838..19e0793f 100644 --- a/test/js/ruby/nodes/patterns.test.js +++ b/test/js/ruby/nodes/patterns.test.js @@ -30,13 +30,13 @@ describe("patterns", () => { test("rassign", () => { const content = `{ db: { user: "John" } } => { db: { user: } }`; - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("rassign with fndptn", () => { const content = "(1..10).to_a.shuffle => [*bef, 2..4 => thresh, *aft]"; - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); } @@ -48,7 +48,7 @@ describe("patterns", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("a, b, *c, d, e", () => { @@ -66,7 +66,7 @@ describe("patterns", () => { end `); - expect(content).toChangeFormat(expectedContent); + return expect(content).toChangeFormat(expectedContent); }); test("0, [1, _] => bar", () => { @@ -84,7 +84,7 @@ describe("patterns", () => { end `); - expect(content).toChangeFormat(expectedContent); + return expect(content).toChangeFormat(expectedContent); }); test("*c, d, e", () => { @@ -102,7 +102,7 @@ describe("patterns", () => { end `); - expect(content).toChangeFormat(expectedContent); + return expect(content).toChangeFormat(expectedContent); }); test("_, _", () => { @@ -120,7 +120,7 @@ describe("patterns", () => { end `); - expect(content).toChangeFormat(expectedContent); + return expect(content).toChangeFormat(expectedContent); }); test("a, b if b == a * 2", () => { @@ -138,7 +138,7 @@ describe("patterns", () => { end `); - expect(content).toChangeFormat(expectedContent); + return expect(content).toChangeFormat(expectedContent); }); test("with a single array element", () => { @@ -149,7 +149,7 @@ describe("patterns", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("with comments in an array pattern", () => { @@ -171,7 +171,7 @@ describe("patterns", () => { end `); - expect(content).toChangeFormat(expectedContent); + return expect(content).toChangeFormat(expectedContent); }); test("multiple clauses", () => { @@ -184,6 +184,6 @@ describe("patterns", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/ranges.test.js b/test/js/ruby/nodes/ranges.test.js index dd755db9..1f92ba36 100644 --- a/test/js/ruby/nodes/ranges.test.js +++ b/test/js/ruby/nodes/ranges.test.js @@ -2,38 +2,38 @@ import { atLeastVersion } from "../../utils.js"; describe("ranges", () => { test("two dot", () => { - expect("1..2").toMatchFormat(); + return expect("1..2").toMatchFormat(); }); test("negative two dot", () => { - expect("-2..-1").toMatchFormat(); + return expect("-2..-1").toMatchFormat(); }); test("three dot", () => { - expect("3...4").toMatchFormat(); + return expect("3...4").toMatchFormat(); }); test("negative three dot", () => { - expect("-4...-3").toMatchFormat(); + return expect("-4...-3").toMatchFormat(); }); if (atLeastVersion("2.6")) { test("two dot with no ending", () => { - expect("1..").toMatchFormat(); + return expect("1..").toMatchFormat(); }); test("three dot with no ending", () => { - expect("1...").toMatchFormat(); + return expect("1...").toMatchFormat(); }); } if (atLeastVersion("2.7")) { test("two dot with no beginning", () => { - expect("..2").toMatchFormat(); + return expect("..2").toMatchFormat(); }); test("three dot with no beginning", () => { - expect("...2").toMatchFormat(); + return expect("...2").toMatchFormat(); }); } }); diff --git a/test/js/ruby/nodes/regexp.test.js b/test/js/ruby/nodes/regexp.test.js index 825a827b..327e6e2b 100644 --- a/test/js/ruby/nodes/regexp.test.js +++ b/test/js/ruby/nodes/regexp.test.js @@ -2,55 +2,55 @@ import { ruby } from "../../utils.js"; describe("regexp", () => { test("basic", () => { - expect("/abc/").toMatchFormat(); + return expect("/abc/").toMatchFormat(); }); test("unnecessary braces", () => { - expect("%r{abc}").toChangeFormat("/abc/"); + return expect("%r{abc}").toChangeFormat("/abc/"); }); test("unnecessary slashes", () => { - expect("%r/abc/").toChangeFormat("/abc/"); + return expect("%r/abc/").toChangeFormat("/abc/"); }); test("unnecessary brackets", () => { - expect("%r[abc]").toChangeFormat("/abc/"); + return expect("%r[abc]").toChangeFormat("/abc/"); }); test("unnecessary parens", () => { - expect("%r(abc)").toChangeFormat("/abc/"); + return expect("%r(abc)").toChangeFormat("/abc/"); }); test("necessary braces", () => { - expect("%r{a/b/c}").toMatchFormat(); + return expect("%r{a/b/c}").toMatchFormat(); }); test("interpolation", () => { - expect("/a#{inter}c/").toMatchFormat(); + return expect("/a#{inter}c/").toMatchFormat(); }); test("modifiers", () => { - expect("/abc/i").toMatchFormat(); + return expect("/abc/i").toMatchFormat(); }); test("braces and modifiers", () => { - expect("%r{a/b/c}mi").toMatchFormat(); + return expect("%r{a/b/c}mi").toMatchFormat(); }); test("global interpolation", () => { - expect("/#$&/").toChangeFormat("/#{$&}/"); + return expect("/#$&/").toChangeFormat("/#{$&}/"); }); test("do not change if { and / in regexp literal", () => { - expect("%r(a{b/c)").toMatchFormat(); + return expect("%r(a{b/c)").toMatchFormat(); }); test("do not change if } and / in regexp literal", () => { - expect("%r[a}b/c]").toMatchFormat(); + return expect("%r[a}b/c]").toMatchFormat(); }); test("parens with }", () => { - expect("%r(a}bc)").toChangeFormat("/a}bc/"); + return expect("%r(a}bc)").toChangeFormat("/a}bc/"); }); test("comments in regex", () => { @@ -63,18 +63,18 @@ describe("regexp", () => { \\Z/x `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("forces braces if could be ambiguous with space in command", () => { - expect("foo %r{ bar}").toMatchFormat(); + return expect("foo %r{ bar}").toMatchFormat(); }); test("forces braces if could be ambiguous with equals in command", () => { - expect("foo %r{= bar}").toMatchFormat(); + return expect("foo %r{= bar}").toMatchFormat(); }); test("do not force braces if space is in parens", () => { - expect("foo(/ bar/)").toMatchFormat(); + return expect("foo(/ bar/)").toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/rescue.test.js b/test/js/ruby/nodes/rescue.test.js index ae75bb78..4a10d7b1 100644 --- a/test/js/ruby/nodes/rescue.test.js +++ b/test/js/ruby/nodes/rescue.test.js @@ -10,7 +10,7 @@ describe("rescue", () => { end `); - expect("a rescue nil").toChangeFormat(expected); + return expect("a rescue nil").toChangeFormat(expected); }); test("rescue just variable", () => { @@ -22,7 +22,7 @@ describe("rescue", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); // from ruby spec/ruby/language/rescue_spec.rb @@ -35,7 +35,7 @@ describe("rescue", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); // https://github.com/prettier/plugin-ruby/pull/1000 @@ -48,7 +48,7 @@ describe("rescue", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test.each(["begin", "def foo"])("%s with every clause", (declaration) => { @@ -74,7 +74,7 @@ describe("rescue", () => { end `); - expect(content).toChangeFormat( + return expect(content).toChangeFormat( ruby(` ${declaration} 1 @@ -108,7 +108,7 @@ describe("rescue", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("comment inline", () => { @@ -120,7 +120,7 @@ describe("rescue", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("comment inline with multiple", () => { @@ -132,7 +132,7 @@ describe("rescue", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("comment inline with splat", () => { @@ -144,7 +144,7 @@ describe("rescue", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("one error with a comment", () => { @@ -156,7 +156,7 @@ describe("rescue", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("two errors with a comment", () => { @@ -168,6 +168,6 @@ describe("rescue", () => { end `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/return.test.js b/test/js/ruby/nodes/return.test.js index f99ab392..0121128c 100644 --- a/test/js/ruby/nodes/return.test.js +++ b/test/js/ruby/nodes/return.test.js @@ -2,73 +2,73 @@ import { long, ruby } from "../../utils.js"; describe("return", () => { test("bare", () => { - expect("return").toMatchFormat(); + return expect("return").toMatchFormat(); }); test("one arg, no parens", () => { - expect("return 1").toMatchFormat(); + return expect("return 1").toMatchFormat(); }); test("one arg, with parens", () => { - expect("return(1)").toChangeFormat("return 1"); + return expect("return(1)").toChangeFormat("return 1"); }); test("multiple args", () => { - expect("return 1, 2").toMatchFormat(); + return expect("return 1, 2").toMatchFormat(); }); test("return method call", () => { - expect("return foo :bar").toMatchFormat(); + return expect("return foo :bar").toMatchFormat(); }); test("return with breaking", () => { - expect(`return ${long}`).toChangeFormat(`return(\n ${long}\n)`); + return expect(`return ${long}`).toChangeFormat(`return(\n ${long}\n)`); }); test("returning an array", () => { - expect("return [1, 2, 3]").toChangeFormat("return 1, 2, 3"); + return expect("return [1, 2, 3]").toChangeFormat("return 1, 2, 3"); }); test("returning an empty array", () => { - expect("return []").toMatchFormat(); + return expect("return []").toMatchFormat(); }); test("returning a single element array", () => { - expect("return [1]").toMatchFormat(); + return expect("return [1]").toMatchFormat(); }); test("returning a list that breaks", () => { - expect(`return ${long}, ${long}`).toChangeFormat( + return expect(`return ${long}, ${long}`).toChangeFormat( `return [\n ${long},\n ${long}\n]` ); }); test("returning an array within parens", () => { - expect("return([1, 2, 3])").toChangeFormat("return 1, 2, 3"); + return expect("return([1, 2, 3])").toChangeFormat("return 1, 2, 3"); }); test("returning a long special array", () => { - expect(`return %w[${long}]`).toChangeFormat( + return expect(`return %w[${long}]`).toChangeFormat( `return(\n %w[\n ${long}\n ]\n)` ); }); test("returning two arguments, one that breaks", () => { - expect(`return foo, ${long}`).toChangeFormat( + return expect(`return foo, ${long}`).toChangeFormat( `return [\n foo,\n ${long}\n]` ); }); test("returning two arguments, the first with parentheses", () => { - expect("return (1), 2").toMatchFormat(); + return expect("return (1), 2").toMatchFormat(); }); test("returning with the or keyword", () => { - expect("return(a or b)").toMatchFormat(); + return expect("return(a or b)").toMatchFormat(); }); test("returning with the not keyword", () => { - expect("return(not a)").toMatchFormat(); + return expect("return(not a)").toMatchFormat(); }); test("comment inside of return parentheses", () => { @@ -79,7 +79,7 @@ describe("return", () => { ) `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("returning multiple statements", () => { @@ -90,7 +90,7 @@ describe("return", () => { ) `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("returning a value with a modifier if", () => { @@ -98,6 +98,6 @@ describe("return", () => { return :inactive if given_date.before?(first_event_date) `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/strings.test.js b/test/js/ruby/nodes/strings.test.js index 7ad47f9d..3970ad51 100644 --- a/test/js/ruby/nodes/strings.test.js +++ b/test/js/ruby/nodes/strings.test.js @@ -25,117 +25,117 @@ describe("strings", () => { describe("with single quotes", () => { test("empty single quote strings stay", () => { - expect("''").toChangeFormat(`""`); + return expect("''").toChangeFormat(`""`); }); test("empty double quote strings change", () => { - expect(`""`).toMatchFormat(); + return expect(`""`).toMatchFormat(); }); test("basic strings with single quotes stay", () => { - expect("'abc'").toChangeFormat(`"abc"`); + return expect("'abc'").toChangeFormat(`"abc"`); }); test("basic strings with double quotes change", () => { - expect(`"abc"`).toMatchFormat(); + return expect(`"abc"`).toMatchFormat(); }); test("double quotes with inner single quotes stay", () => { - expect(`"abc's"`).toMatchFormat(); + return expect(`"abc's"`).toMatchFormat(); }); describe("escape sequences", () => { test("single quotes stay", () => { - expect("'abc\\n'").toMatchFormat(); + return expect("'abc\\n'").toMatchFormat(); }); test("double quotes stay", () => { - expect(`"abc\\n"`).toMatchFormat(); + return expect(`"abc\\n"`).toMatchFormat(); }); test("interpolation within single quotes stay", () => { - expect(`'#{"\\n"}'`).toMatchFormat(); + return expect(`'#{"\\n"}'`).toMatchFormat(); }); test("interpolation within double quotes stay", () => { - expect(`"#{"\\n"}"`).toMatchFormat(); + return expect(`"#{"\\n"}"`).toMatchFormat(); }); test("escaped double quotes are not unquoted", () => { - expect("'abc \\\"def\\\" ghi'").toMatchFormat(); + return expect("'abc \\\"def\\\" ghi'").toMatchFormat(); }); }); }); describe("with double quotes", () => { test("empty single quote strings change", () => { - expect("''").toChangeFormat(`""`); + return expect("''").toChangeFormat(`""`); }); test("empty double quote strings stay", () => { - expect(`""`).toMatchFormat(); + return expect(`""`).toMatchFormat(); }); test("basic strings with single quotes change", () => { - expect("'abc'").toChangeFormat(`"abc"`); + return expect("'abc'").toChangeFormat(`"abc"`); }); test("basic strings with double quotes stay", () => { - expect(`"abc"`).toMatchFormat(); + return expect(`"abc"`).toMatchFormat(); }); test("double quotes with inner single quotes stay", () => { - expect(`"abc's"`).toMatchFormat(); + return expect(`"abc's"`).toMatchFormat(); }); test("double quotes do not get escaped if it results in more quotes", () => { - expect(`'"foo"'`).toMatchFormat(); + return expect(`'"foo"'`).toMatchFormat(); }); describe("escape sequences", () => { test("single quotes stay", () => { - expect("'abc\\n'").toMatchFormat(); + return expect("'abc\\n'").toMatchFormat(); }); test("double quotes stay", () => { - expect(`"abc\\n"`).toMatchFormat(); + return expect(`"abc\\n"`).toMatchFormat(); }); test("interpolation within single quotes stay", () => { - expect(`'#{"\\n"}'`).toMatchFormat(); + return expect(`'#{"\\n"}'`).toMatchFormat(); }); test("interpolation within double quotes stay", () => { - expect(`"#{"\\n"}"`).toMatchFormat(); + return expect(`"#{"\\n"}"`).toMatchFormat(); }); }); }); describe("with %{} quotes", () => { test("matches correctly", () => { - expect("%{foo\\n#{bar}\\nbaz}").toMatchFormat(); + return expect("%{foo\\n#{bar}\\nbaz}").toMatchFormat(); }); }); test("concatenation", () => { - expect(`"abc" \\\n "def" \\\n "ghi"`).toMatchFormat(); + return expect(`"abc" \\\n "def" \\\n "ghi"`).toMatchFormat(); }); describe("interpolation", () => { test("with keywords", () => { - expect(`"abc #{super} abc"`).toMatchFormat(); + return expect(`"abc #{super} abc"`).toMatchFormat(); }); test("at the beginning of the string", () => { - expect(`"#{abc} abc"`).toMatchFormat(); + return expect(`"#{abc} abc"`).toMatchFormat(); }); test("very interpolated", () => { - expect(`"abc #{"abc #{abc} abc"} abc"`).toMatchFormat(); + return expect(`"abc #{"abc #{abc} abc"} abc"`).toMatchFormat(); }); test("long strings with interpolation do not break", () => { - expect(`"${long} #{foo[:bar]} ${long}"`).toMatchFormat(); + return expect(`"${long} #{foo[:bar]} ${long}"`).toMatchFormat(); }); test("long strings with interpolation that were broken do break", () => { @@ -147,7 +147,7 @@ describe("strings", () => { HERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("within a heredoc there is no indentation", () => { @@ -157,93 +157,93 @@ describe("strings", () => { HERE `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); describe("char literals", () => { test("single chars get changed", () => { - expect("?a").toChangeFormat(`"a"`); + return expect("?a").toChangeFormat(`"a"`); }); test("single chars get changed with double quotes", () => { - expect("?a").toChangeFormat(`"a"`); + return expect("?a").toChangeFormat(`"a"`); }); test("control escape sequences stay", () => { - expect("?\\C-a").toMatchFormat(); + return expect("?\\C-a").toMatchFormat(); }); test("meta escape sequences stay", () => { - expect("?\\M-a").toMatchFormat(); + return expect("?\\M-a").toMatchFormat(); }); test("meta and control sequences stay", () => { - expect("?\\M-\\C-a").toMatchFormat(); + return expect("?\\M-\\C-a").toMatchFormat(); }); }); describe("xstrings", () => { test("backtick literals", () => { - expect("`abc`").toMatchFormat(); + return expect("`abc`").toMatchFormat(); }); test("breaking backtick literals", () => { - expect(`\`${long}\``).toMatchFormat(); + return expect(`\`${long}\``).toMatchFormat(); }); test("breaking backtick literals with method chains", () => { - expect(`\`${long}\`.to_s`).toMatchFormat(); + return expect(`\`${long}\`.to_s`).toMatchFormat(); }); test("%x literals", () => { - expect("%x[abc]").toChangeFormat("`abc`"); + return expect("%x[abc]").toChangeFormat("`abc`"); }); test("breaking %x literals", () => { - expect(`%x[${long}]`).toChangeFormat(`\`${long}\``); + return expect(`%x[${long}]`).toChangeFormat(`\`${long}\``); }); test("breaking %x literals with method chains", () => { - expect(`%x[${long}].to_s`).toChangeFormat(`\`${long}\`.to_s`); + return expect(`%x[${long}].to_s`).toChangeFormat(`\`${long}\`.to_s`); }); }); describe("symbols", () => { test("basic", () => { - expect(":abc").toMatchFormat(); + return expect(":abc").toMatchFormat(); }); test("with single quotes", () => { - expect(":'abc'").toChangeFormat(`:"abc"`); + return expect(":'abc'").toChangeFormat(`:"abc"`); }); test("with double quotes", () => { - expect(`:"abc"`).toMatchFormat(); + return expect(`:"abc"`).toMatchFormat(); }); test("with double quotes with double quotes desired", () => { - expect(`:"abc"`).toMatchFormat(); + return expect(`:"abc"`).toMatchFormat(); }); test("with real interpolation and double quotes", () => { - expect(`:"abc#{foo}abc"`).toMatchFormat(); + return expect(`:"abc#{foo}abc"`).toMatchFormat(); }); test("%s literal", () => { - expect("%s[abc]").toChangeFormat(`:"abc"`); + return expect("%s[abc]").toChangeFormat(`:"abc"`); }); test("%s literal with false interpolation", () => { - expect("%s[abc#{d}]").toChangeFormat(`:'abc#{d}'`); + return expect("%s[abc#{d}]").toChangeFormat(`:'abc#{d}'`); }); test("%s literal as hash key", () => { - expect("{ %s[abc] => d }").toChangeFormat(`{ abc: d }`); + return expect("{ %s[abc] => d }").toChangeFormat(`{ abc: d }`); }); test("symbol literal as a hash key", () => { - expect("{ '\\d' => 1 }").toMatchFormat(); + return expect("{ '\\d' => 1 }").toMatchFormat(); }); test("%s literal with newlines", () => { @@ -253,17 +253,17 @@ describe("strings", () => { ] `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("gets correct quotes", () => { const content = `where("lint_tool_configs.plugin": plugins + %w[core])`; - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); test.each(["@v", "@@v", "$v"])("%s dvar", (interp) => { - expect(`"#${interp}"`).toChangeFormat(`"#{${interp}}"`); + return expect(`"#${interp}"`).toChangeFormat(`"#{${interp}}"`); }); }); diff --git a/test/js/ruby/nodes/super.test.js b/test/js/ruby/nodes/super.test.js index ae08bf5e..1b66b025 100644 --- a/test/js/ruby/nodes/super.test.js +++ b/test/js/ruby/nodes/super.test.js @@ -2,48 +2,48 @@ import { ruby } from "../../utils.js"; describe("super", () => { test("bare", () => { - expect("super").toMatchFormat(); + return expect("super").toMatchFormat(); }); test("empty parens", () => { - expect("super()").toMatchFormat(); + return expect("super()").toMatchFormat(); }); test("one arg, no parens", () => { - expect("super 1").toMatchFormat(); + return expect("super 1").toMatchFormat(); }); test("one arg, with parens", () => { - expect("super(1)").toMatchFormat(); + return expect("super(1)").toMatchFormat(); }); test("multiple args, no parens", () => { - expect("super 1, 2").toMatchFormat(); + return expect("super 1, 2").toMatchFormat(); }); test("multiple args, with parens", () => { - expect("super(1, 2)").toMatchFormat(); + return expect("super(1, 2)").toMatchFormat(); }); describe("with comments", () => { test("bare", () => { - expect("super # comment").toMatchFormat(); + return expect("super # comment").toMatchFormat(); }); test("empty parens", () => { - expect("super() # comment").toMatchFormat(); + return expect("super() # comment").toMatchFormat(); }); test("one arg, no parens", () => { - expect("super 1 # comment").toMatchFormat(); + return expect("super 1 # comment").toMatchFormat(); }); test("one arg, with parens", () => { - expect("super(1) # comment").toMatchFormat(); + return expect("super(1) # comment").toMatchFormat(); }); test("multiple args, no parens", () => { - expect("super 1, 2 # comment").toMatchFormat(); + return expect("super 1, 2 # comment").toMatchFormat(); }); test("multiple args, multiple lines, no parens", () => { @@ -52,11 +52,11 @@ describe("super", () => { 2 # second comment `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("multiple args, with parens", () => { - expect("super(1, 2) # comment").toMatchFormat(); + return expect("super(1, 2) # comment").toMatchFormat(); }); test("multiple args, multiple lines, no parens", () => { @@ -67,7 +67,7 @@ describe("super", () => { ) `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); }); }); diff --git a/test/js/ruby/nodes/unary.test.js b/test/js/ruby/nodes/unary.test.js index cebf7b98..8f619b74 100644 --- a/test/js/ruby/nodes/unary.test.js +++ b/test/js/ruby/nodes/unary.test.js @@ -1,10 +1,10 @@ describe("unary", () => { test("regular", () => { - expect("!foo").toMatchFormat(); + return expect("!foo").toMatchFormat(); }); // https://github.com/prettier/plugin-ruby/issues/764 test("with other operator", () => { - expect("!(x&.>(0))").toMatchFormat(); + return expect("!(x&.>(0))").toMatchFormat(); }); }); diff --git a/test/js/ruby/nodes/undef.test.js b/test/js/ruby/nodes/undef.test.js index fb052469..3716cab6 100644 --- a/test/js/ruby/nodes/undef.test.js +++ b/test/js/ruby/nodes/undef.test.js @@ -2,11 +2,11 @@ import { long, ruby } from "../../utils.js"; describe("undef", () => { test("single inline", () => { - expect("undef foo").toMatchFormat(); + return expect("undef foo").toMatchFormat(); }); test("multiple inline", () => { - expect("undef foo, bar").toMatchFormat(); + return expect("undef foo, bar").toMatchFormat(); }); test("multiple breaking", () => { @@ -15,15 +15,15 @@ describe("undef", () => { a${long} `); - expect(`undef ${long}, a${long}`).toChangeFormat(expected); + return expect(`undef ${long}, a${long}`).toChangeFormat(expected); }); test("single with comment", () => { - expect("undef foo # bar").toMatchFormat(); + return expect("undef foo # bar").toMatchFormat(); }); test("multiple inline with comment", () => { - expect("undef foo, bar # baz").toMatchFormat(); + return expect("undef foo, bar # baz").toMatchFormat(); }); test("multiple lines comment on first", () => { @@ -32,7 +32,7 @@ describe("undef", () => { bar `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("multiple lines comment on each", () => { @@ -41,7 +41,7 @@ describe("undef", () => { bar # bam `); - expect(content).toMatchFormat(); + return expect(content).toMatchFormat(); }); test("multiple breaking with comment", () => { @@ -50,6 +50,6 @@ describe("undef", () => { a${long} # foo `); - expect(`undef ${long}, a${long} # foo`).toChangeFormat(expected); + return expect(`undef ${long}, a${long} # foo`).toChangeFormat(expected); }); }); diff --git a/test/js/ruby/nodes/yield.test.js b/test/js/ruby/nodes/yield.test.js index f6bafbeb..5ac27496 100644 --- a/test/js/ruby/nodes/yield.test.js +++ b/test/js/ruby/nodes/yield.test.js @@ -1,21 +1,21 @@ describe("yield", () => { test("bare yield", () => { - expect("yield").toMatchFormat(); + return expect("yield").toMatchFormat(); }); test("yield with one argument, no parens", () => { - expect("yield i").toMatchFormat(); + return expect("yield i").toMatchFormat(); }); test("yield with one argument, with parens", () => { - expect("yield(i)").toMatchFormat(); + return expect("yield(i)").toMatchFormat(); }); test("yield with multiple arguments, no parens", () => { - expect("yield i, 2").toMatchFormat(); + return expect("yield i, 2").toMatchFormat(); }); test("yield with multiple arguments, with parens", () => { - expect("yield(i, 2)").toMatchFormat(); + return expect("yield(i, 2)").toMatchFormat(); }); }); From 44ab439243f331c7f7259e57490df9b1d8a20fb7 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 18 Oct 2022 18:06:47 -0400 Subject: [PATCH 653/785] Make relative paths work for gem --- lib/prettier.rb | 12 +++++++----- prettier.gemspec | 4 +--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/prettier.rb b/lib/prettier.rb index 963c6182..fa68dceb 100644 --- a/lib/prettier.rb +++ b/lib/prettier.rb @@ -4,17 +4,19 @@ require "open3" module Prettier - PLUGIN = -File.expand_path("..", __dir__) - BINARY = -File.join(PLUGIN, "node_modules", "prettier", "bin-prettier.js") - VERSION = -JSON.parse(File.read(File.join(PLUGIN, "package.json")))["version"] + directory = -File.expand_path("..", __dir__) + package = File.read(File.join(directory, "package.json")) + + PLUGIN = -File.join(directory, "src/plugin.js") + BINARY = -File.join(directory, "node_modules/prettier/bin/prettier.cjs") + VERSION = -JSON.parse(package)["version"] def self.run(args) quoted = args.map { |arg| arg.start_with?("-") ? arg : "\"#{arg}\"" } command = "node #{BINARY} --plugin \"#{PLUGIN}\" #{quoted.join(" ")}" opts = STDIN.tty? ? {} : { stdin_data: STDIN } - stdout, stderr, status = - Open3.capture3({ "RBPRETTIER" => "1" }, command, opts) + stdout, stderr, status = Open3.capture3({}, command, opts) STDOUT.puts(stdout) # If we completed successfully, then just exit out. diff --git a/prettier.gemspec b/prettier.gemspec index abe4f9e4..bae2dabf 100644 --- a/prettier.gemspec +++ b/prettier.gemspec @@ -15,9 +15,7 @@ Gem::Specification.new do |spec| spec.files = Dir.chdir(__dir__) do %w[LICENSE package.json rubocop.yml] + Dir["{{exe,lib,src}/**/*,*.md}"] + - Dir[ - "node_modules/prettier/{package.json,index.js,cli.js,doc.js,bin-prettier.js,third-party.js,parser-*.js}" - ] + Dir["node_modules/prettier/**/*"] end spec.required_ruby_version = ">= 2.7.0" From 07747975d4cd14182543087e01ce23449c795829 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 18 Oct 2022 20:39:34 -0400 Subject: [PATCH 654/785] Fix up windows server --- src/server.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/server.rb b/src/server.rb index 0917ee19..0ee42d51 100644 --- a/src/server.rb +++ b/src/server.rb @@ -38,10 +38,7 @@ File.write( connection_filepath, - JSON.fast_generate( - address: server.address.ip_address, - port: server.address.ip_port - ) + JSON.fast_generate(address: address.ip_address, port: address.ip_port) ) else # If we're not on windows, then we're going to assume we can use unix socket From a45652ed724739d8dcc676c8b5159a87c3046edf Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 18 Oct 2022 20:41:01 -0400 Subject: [PATCH 655/785] Fix up yarn plug-n-play tests --- .github/workflows/main.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4d69a776..52484688 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -76,7 +76,7 @@ jobs: - run: gem install syntax_tree syntax_tree-haml syntax_tree-rbs - uses: actions/setup-node@v2 with: - node-version: 16.x + node-version: 18.x cache: yarn - run: yarn install --frozen-lockfile - run: yarn pack @@ -87,15 +87,14 @@ jobs: - name: Smoke test run: | cd /tmp/smoketest - echo '{ "name": "smoketest" }' > package.json + echo '{ "name": "smoketest", "type": "module", "license": "MIT" }' > package.json yarn set version berry # workaround for https://github.com/yarnpkg/berry/issues/3180 yarn set version ${{ matrix.yarn }} - yarn add prettier @prettier/plugin-ruby@file:/tmp/prettier-plugin-ruby.tgz + yarn add prettier@next @prettier/plugin-ruby@file:/tmp/prettier-plugin-ruby.tgz npx rimraf .yarn/unplugged # Make sure Yarn didn't unplug anything; this will deliberately break if it did - echo '{ "plugins": ["@prettier/plugin-ruby"] }' >.prettierrc.json - echo 'def add(a, b) ; a + b ; end' >smoketest.rb - yarn run prettier -w smoketest.rb - ruby -c smoketest.rb + echo '{ "plugins": ["@prettier/plugin-ruby"] }' > .prettierrc.json + echo 'def add(a, b) ; a + b ; end' > smoketest.rb + yarn run prettier -w smoketest.rb && ruby -c smoketest.rb gem: name: Gem From 5c6448611ed4f9c842eab5b1b33ebb61103869d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Oct 2022 12:01:11 +0000 Subject: [PATCH 656/785] Bump jest from 29.2.0 to 29.2.1 Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.2.0 to 29.2.1. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.2.1/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 586 +++++++++++++++++++++++++++--------------------------- 1 file changed, 293 insertions(+), 293 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2c8220c5..9fcfbf7d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -348,28 +348,28 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.2.0.tgz#e906bdbfc83baf79590f05b515dad900b3b71fed" - integrity sha512-Xz1Wu+ZZxcB3RS8U3HdkFxlRJ7kLXI/by9X7d2/gvseIWPwYu/c1EsYy77cB5iyyHGOy3whS2HycjcuzIF4Jow== +"@jest/console@^29.2.1": + version "29.2.1" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.2.1.tgz#5f2c62dcdd5ce66e94b6d6729e021758bceea090" + integrity sha512-MF8Adcw+WPLZGBiNxn76DOuczG3BhODTcMlDCA4+cFi41OkaY/lyI0XUUhi73F88Y+7IHoGmD80pN5CtxQUdSw== dependencies: - "@jest/types" "^29.2.0" + "@jest/types" "^29.2.1" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^29.2.0" - jest-util "^29.2.0" + jest-message-util "^29.2.1" + jest-util "^29.2.1" slash "^3.0.0" -"@jest/core@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.2.0.tgz#beed57c552be65d4e4ab2f4161d0abe8ea6bf3a8" - integrity sha512-+gyJ3bX+kGEW/eqt/0kI7fLjqiFr3AN8O+rlEl1fYRf7D8h4Sj4tBGo9YOSirvWgvemoH2EPRya35bgvcPFzHQ== - dependencies: - "@jest/console" "^29.2.0" - "@jest/reporters" "^29.2.0" - "@jest/test-result" "^29.2.0" - "@jest/transform" "^29.2.0" - "@jest/types" "^29.2.0" +"@jest/core@^29.2.1": + version "29.2.1" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.2.1.tgz#30af794ebd73bfb87cd8ba36718738dfe38b772e" + integrity sha512-kuLKYqnqgerXkBUwlHVxeSuhSnd+JMnMCLfU98bpacBSfWEJPegytDh3P2m15/JHzet32hGGld4KR4OzMb6/Tg== + dependencies: + "@jest/console" "^29.2.1" + "@jest/reporters" "^29.2.1" + "@jest/test-result" "^29.2.1" + "@jest/transform" "^29.2.1" + "@jest/types" "^29.2.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" @@ -377,80 +377,80 @@ exit "^0.1.2" graceful-fs "^4.2.9" jest-changed-files "^29.2.0" - jest-config "^29.2.0" - jest-haste-map "^29.2.0" - jest-message-util "^29.2.0" + jest-config "^29.2.1" + jest-haste-map "^29.2.1" + jest-message-util "^29.2.1" jest-regex-util "^29.2.0" - jest-resolve "^29.2.0" - jest-resolve-dependencies "^29.2.0" - jest-runner "^29.2.0" - jest-runtime "^29.2.0" - jest-snapshot "^29.2.0" - jest-util "^29.2.0" - jest-validate "^29.2.0" - jest-watcher "^29.2.0" + jest-resolve "^29.2.1" + jest-resolve-dependencies "^29.2.1" + jest-runner "^29.2.1" + jest-runtime "^29.2.1" + jest-snapshot "^29.2.1" + jest-util "^29.2.1" + jest-validate "^29.2.1" + jest-watcher "^29.2.1" micromatch "^4.0.4" - pretty-format "^29.2.0" + pretty-format "^29.2.1" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.2.0.tgz#7e5604e4ead098572056a962a970f3d79379fbd8" - integrity sha512-foaVv1QVPB31Mno3LlL58PxEQQOLZd9zQfCpyQQCQIpUAtdFP1INBjkphxrCfKT13VxpA0z5jFGIkmZk0DAg2Q== +"@jest/environment@^29.2.1": + version "29.2.1" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.2.1.tgz#acb1994fbd5ad02819a1a34a923c531e6923b665" + integrity sha512-EutqA7T/X6zFjw6mAWRHND+ZkTPklmIEWCNbmwX6uCmOrFrWaLbDZjA+gePHJx6fFMMRvNfjXcvzXEtz54KPlg== dependencies: - "@jest/fake-timers" "^29.2.0" - "@jest/types" "^29.2.0" + "@jest/fake-timers" "^29.2.1" + "@jest/types" "^29.2.1" "@types/node" "*" - jest-mock "^29.2.0" + jest-mock "^29.2.1" -"@jest/expect-utils@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.2.0.tgz#3c0c472115d98211e7e0a0a8fa00719bf081987f" - integrity sha512-nz2IDF7nb1qmj9hx8Ja3MFab2q9Ml8QbOaaeJNyX5JQJHU8QUvEDiMctmhGEkk3Kzr8w8vAqz4hPk/ogJSrUhg== +"@jest/expect-utils@^29.2.1": + version "29.2.1" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.2.1.tgz#eae61c90f2066540f60d23b8f254f03b7869b22f" + integrity sha512-yr4aHNg5Z1CjKby5ozm7sKjgBlCOorlAoFcvrOQ/4rbZRfgZQdnmh7cth192PYIgiPZo2bBXvqdOApnAMWFJZg== dependencies: jest-get-type "^29.2.0" -"@jest/expect@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.2.0.tgz#25316d2ae930e7bb9df96cce7521053d377c4c0d" - integrity sha512-+3lxcYL9e0xPJGOR33utxxejn+Mulz40kY0oy0FVsmIESW87NZDJ7B1ovaIqeX0xIgPX4laS5SGlqD2uSoBMcw== +"@jest/expect@^29.2.1": + version "29.2.1" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.2.1.tgz#8d99be3886ebfcffd6cabb2b46602a301b976ffe" + integrity sha512-o14R2t2tHHHudwji43UKkzmmH49xfF5T++FQBK2tl88qwuBWQOcx7fNUYl+mA/9TPNAN0FkQ3usnpyS8FUwsvQ== dependencies: - expect "^29.2.0" - jest-snapshot "^29.2.0" + expect "^29.2.1" + jest-snapshot "^29.2.1" -"@jest/fake-timers@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.2.0.tgz#e43635c1bd73b23886e80ca12307092ef2ee1929" - integrity sha512-mX0V0uQsgeSLTt0yTqanAhhpeUKMGd2uq+PSLAfO40h72bvfNNQ7pIEl9vIwNMFxRih1ENveEjSBsLjxGGDPSw== +"@jest/fake-timers@^29.2.1": + version "29.2.1" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.2.1.tgz#786d60e8cb60ca70c9f913cb49fcc77610c072bb" + integrity sha512-KWil+8fef7Uj/P/PTZlPKk1Pw117wAmr71VWFV8ZDtRtkwmTG8oY4IRf0Ss44J2y5CYRy8d/zLOhxyoGRENjvA== dependencies: - "@jest/types" "^29.2.0" + "@jest/types" "^29.2.1" "@sinonjs/fake-timers" "^9.1.2" "@types/node" "*" - jest-message-util "^29.2.0" - jest-mock "^29.2.0" - jest-util "^29.2.0" + jest-message-util "^29.2.1" + jest-mock "^29.2.1" + jest-util "^29.2.1" -"@jest/globals@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.2.0.tgz#5cfc41c028efaf511624ba086d64113d5a8a92b3" - integrity sha512-JQxtEVNWiai1p3PIzAJZSyEqQdAJGvNKvinZDPfu0mhiYEVx6E+PiBuDWj1sVUW8hzu+R3DVqaWC9K2xcLRIAA== +"@jest/globals@^29.2.1": + version "29.2.1" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.2.1.tgz#6933beb8b4e43b990409a19c462fde7b71210e63" + integrity sha512-Z4EejYPP1OPVq2abk1+9urAwJqkgw5jB2UJGlPjb5ZwzPQF8WLMcigKEfFzZb2OHhEVPP0RZD0/DbVTY1R6iQA== dependencies: - "@jest/environment" "^29.2.0" - "@jest/expect" "^29.2.0" - "@jest/types" "^29.2.0" - jest-mock "^29.2.0" + "@jest/environment" "^29.2.1" + "@jest/expect" "^29.2.1" + "@jest/types" "^29.2.1" + jest-mock "^29.2.1" -"@jest/reporters@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.2.0.tgz#24cac16d997ec91a9c615db2621805ee485689e0" - integrity sha512-BXoAJatxTZ18U0cwD7C8qBo8V6vef8AXYRBZdhqE5DF9CmpqmhMfw9c7OUvYqMTnBBK9A0NgXGO4Lc9EJzdHvw== +"@jest/reporters@^29.2.1": + version "29.2.1" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.2.1.tgz#599e4376823751fdda50f2ca97243e013da10c4d" + integrity sha512-sCsfUKM/yIF4nNed3e/rIgVIS58EiASGMDEPWqItfLZ9UO1ALW2ASDNJzdWkxEt0T8o2Ztj619G0KKrvK+McAw== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.2.0" - "@jest/test-result" "^29.2.0" - "@jest/transform" "^29.2.0" - "@jest/types" "^29.2.0" + "@jest/console" "^29.2.1" + "@jest/test-result" "^29.2.1" + "@jest/transform" "^29.2.1" + "@jest/types" "^29.2.1" "@jridgewell/trace-mapping" "^0.3.15" "@types/node" "*" chalk "^4.0.0" @@ -463,9 +463,9 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^29.2.0" - jest-util "^29.2.0" - jest-worker "^29.2.0" + jest-message-util "^29.2.1" + jest-util "^29.2.1" + jest-worker "^29.2.1" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" @@ -487,51 +487,51 @@ callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.2.0.tgz#3dcc7123b8f0fb5ba1f650ce17af45cce91a0323" - integrity sha512-l76EPJ6QqtzsCLS4aimJqWO53pxZ82o3aE+Brcmo1HJ/phb9+MR7gPhyDdN6VSGaLJCRVJBZgWEhAEz+qON0Fw== +"@jest/test-result@^29.2.1": + version "29.2.1" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.2.1.tgz#f42dbf7b9ae465d0a93eee6131473b8bb3bd2edb" + integrity sha512-lS4+H+VkhbX6z64tZP7PAUwPqhwj3kbuEHcaLuaBuB+riyaX7oa1txe0tXgrFj5hRWvZKvqO7LZDlNWeJ7VTPA== dependencies: - "@jest/console" "^29.2.0" - "@jest/types" "^29.2.0" + "@jest/console" "^29.2.1" + "@jest/types" "^29.2.1" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.2.0.tgz#acd875533f7ad01cb22da59ff4047de18e9d64da" - integrity sha512-NCnjZcGnVdva6IDqF7TCuFsXs2F1tohiNF9sasSJNzD7VfN5ic9XgcS/oPDalGiPLxCmGKj4kewqqrKAqBACcQ== +"@jest/test-sequencer@^29.2.1": + version "29.2.1" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.2.1.tgz#cafd2c5f3528c70bd4cc243800459ac366e480cc" + integrity sha512-O/pnk0/xGj3lxPVNwB6HREJ7AYvUdyP2xo/s14/9Dtf091HoOeyIhWLKQE/4HzB8lNQBMo6J5mg0bHz/uCWK7w== dependencies: - "@jest/test-result" "^29.2.0" + "@jest/test-result" "^29.2.1" graceful-fs "^4.2.9" - jest-haste-map "^29.2.0" + jest-haste-map "^29.2.1" slash "^3.0.0" -"@jest/transform@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.2.0.tgz#1c55ca549f64810351df999265a29f8ead51be15" - integrity sha512-NXMujGHy+B4DAj4dGnVPD0SIXlR2Z/N8Gp9h3mF66kcIRult1WWqY3/CEIrJcKviNWaFPYhZjCG2L3fteWzcUw== +"@jest/transform@^29.2.1": + version "29.2.1" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.2.1.tgz#f3d8154edd19cdbcaf1d6646bd8f4ff7812318a2" + integrity sha512-xup+iEuaIRSQabQaeqxaQyN0vg1Dctrp9oTObQsNf3sZEowTIa5cANYuoyi8Tqhg4GCqEVLTf18KW7ii0UeFVA== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^29.2.0" + "@jest/types" "^29.2.1" "@jridgewell/trace-mapping" "^0.3.15" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.2.0" + jest-haste-map "^29.2.1" jest-regex-util "^29.2.0" - jest-util "^29.2.0" + jest-util "^29.2.1" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" write-file-atomic "^4.0.1" -"@jest/types@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.2.0.tgz#c0d1ef8bc1e4f4b358e7877e34157371e7881b0b" - integrity sha512-mfgpQz4Z2xGo37m6KD8xEpKelaVzvYVRijmLPePn9pxgaPEtX+SqIyPNzzoeCPXKYbB4L/wYSgXDL8o3Gop78Q== +"@jest/types@^29.2.1": + version "29.2.1" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.2.1.tgz#ec9c683094d4eb754e41e2119d8bdaef01cf6da0" + integrity sha512-O/QNDQODLnINEPAI0cl9U6zUIDXEWXt6IC1o2N2QENuos7hlGUIthlKyV4p6ki3TvXFX071blj8HUhgLGquPjw== dependencies: "@jest/schemas" "^29.0.0" "@types/istanbul-lib-coverage" "^2.0.0" @@ -804,12 +804,12 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.2.0.tgz#088624f037da90e69a06073305276cbd111d68a8" - integrity sha512-c8FkrW1chgcbyBqOo7jFGpQYfVnb43JqjQGV+C2r94k2rZJOukYOZ6+csAqKE4ms+PHc+yevnONxs27jQIxylw== +babel-jest@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.2.1.tgz#213c47e28072de11bdb98c9d29b89f2ab99664f1" + integrity sha512-gQJwArok0mqoREiCYhXKWOgUhElJj9DpnssW6GL8dG7ARYqHEhrM9fmPHTjdqEGRVXZAd6+imo3/Vwa8TjLcsw== dependencies: - "@jest/transform" "^29.2.0" + "@jest/transform" "^29.2.1" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" babel-preset-jest "^29.2.0" @@ -1273,16 +1273,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.2.0.tgz#b90c6df52be7abfd9f206f273fbcf8b33d8f332d" - integrity sha512-03ClF3GWwUqd9Grgkr9ZSdaCJGMRA69PQ8jT7o+Bx100VlGiAFf9/8oIm9Qve7ZVJhuJxFftqFhviZJRxxNfvg== +expect@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.2.1.tgz#25752d0df92d3daa5188dc8804de1f30759658cf" + integrity sha512-BJtA754Fba0YWRWHgjKUMTA3ltWarKgITXHQnbZ2mTxTXC4yMQlR0FI7HkB3fJYkhWBf4qjNiqvg3LDtXCcVRQ== dependencies: - "@jest/expect-utils" "^29.2.0" + "@jest/expect-utils" "^29.2.1" jest-get-type "^29.2.0" - jest-matcher-utils "^29.2.0" - jest-message-util "^29.2.0" - jest-util "^29.2.0" + jest-matcher-utils "^29.2.1" + jest-message-util "^29.2.1" + jest-util "^29.2.1" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1644,86 +1644,86 @@ jest-changed-files@^29.2.0: execa "^5.0.0" p-limit "^3.1.0" -jest-circus@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.2.0.tgz#692ddf3b12a5ae6326f2f37b9d176c68777fcf4c" - integrity sha512-bpJRMe+VtvYlF3q8JNx+/cAo4FYvNCiR5s7Z0Scf8aC+KJ2ineSjZKtw1cIZbythlplkiro0My8nc65pfCqJ3A== +jest-circus@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.2.1.tgz#1385353d9bca6acf58f916068bbeffcfc95bef02" + integrity sha512-W+ZQQ5ln4Db2UZNM4NJIeasnhCdDhSuYW4eLgNAUi0XiSSpF634Kc5wiPvGiHvTgXMFVn1ZgWIijqhi9+kLNLg== dependencies: - "@jest/environment" "^29.2.0" - "@jest/expect" "^29.2.0" - "@jest/test-result" "^29.2.0" - "@jest/types" "^29.2.0" + "@jest/environment" "^29.2.1" + "@jest/expect" "^29.2.1" + "@jest/test-result" "^29.2.1" + "@jest/types" "^29.2.1" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" is-generator-fn "^2.0.0" - jest-each "^29.2.0" - jest-matcher-utils "^29.2.0" - jest-message-util "^29.2.0" - jest-runtime "^29.2.0" - jest-snapshot "^29.2.0" - jest-util "^29.2.0" + jest-each "^29.2.1" + jest-matcher-utils "^29.2.1" + jest-message-util "^29.2.1" + jest-runtime "^29.2.1" + jest-snapshot "^29.2.1" + jest-util "^29.2.1" p-limit "^3.1.0" - pretty-format "^29.2.0" + pretty-format "^29.2.1" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.2.0.tgz#c6ca40889d6671c38b1cf9119d3b653809f31a3a" - integrity sha512-/581TzbXeO+5kbtSlhXEthGiVJCC8AP0jgT0iZINAAMW+tTFj2uWU7z+HNUH5yIYdHV7AvRr0fWLrmHJGIruHg== +jest-cli@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.2.1.tgz#fbfa90b87b27a04e1041cc9d33ee80f32e2f2528" + integrity sha512-UIMD5aNqvPKpdlJSaeUAoLfxsh9TZvOkaMETx5qXnkboc317bcbb0eLHbIj8sFBHdcJAIAM+IRKnIU7Wi61MBw== dependencies: - "@jest/core" "^29.2.0" - "@jest/test-result" "^29.2.0" - "@jest/types" "^29.2.0" + "@jest/core" "^29.2.1" + "@jest/test-result" "^29.2.1" + "@jest/types" "^29.2.1" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.2.0" - jest-util "^29.2.0" - jest-validate "^29.2.0" + jest-config "^29.2.1" + jest-util "^29.2.1" + jest-validate "^29.2.1" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.2.0.tgz#8823f35255f696444a882721e624d7ad352e208b" - integrity sha512-IkdCsrHIoxDPZAyFcdtQrCQ3uftLqns6Joj0tlbxiAQW4k/zTXmIygqWBmPNxO9FbFkDrhtYZiLHXjaJh9rS+Q== +jest-config@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.2.1.tgz#2182af014d6c73978208626335db5134803dd183" + integrity sha512-EV5F1tQYW/quZV2br2o88hnYEeRzG53Dfi6rSG3TZBuzGQ6luhQBux/RLlU5QrJjCdq3LXxRRM8F1LP6DN1ycA== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.2.0" - "@jest/types" "^29.2.0" - babel-jest "^29.2.0" + "@jest/test-sequencer" "^29.2.1" + "@jest/types" "^29.2.1" + babel-jest "^29.2.1" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^29.2.0" - jest-environment-node "^29.2.0" + jest-circus "^29.2.1" + jest-environment-node "^29.2.1" jest-get-type "^29.2.0" jest-regex-util "^29.2.0" - jest-resolve "^29.2.0" - jest-runner "^29.2.0" - jest-util "^29.2.0" - jest-validate "^29.2.0" + jest-resolve "^29.2.1" + jest-runner "^29.2.1" + jest-util "^29.2.1" + jest-validate "^29.2.1" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^29.2.0" + pretty-format "^29.2.1" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.2.0.tgz#b1e11ac1a1401fc4792ef8ba406b48f1ae7d2bc5" - integrity sha512-GsH07qQL+/D/GxlnU+sSg9GL3fBOcuTlmtr3qr2pnkiODCwubNN2/7slW4m3CvxDsEus/VEOfQKRFLyXsUlnZw== +jest-diff@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.2.1.tgz#027e42f5a18b693fb2e88f81b0ccab533c08faee" + integrity sha512-gfh/SMNlQmP3MOUgdzxPOd4XETDJifADpT937fN1iUGz+9DgOu2eUPHH25JDkLVcLwwqxv3GzVyK4VBUr9fjfA== dependencies: chalk "^4.0.0" diff-sequences "^29.2.0" jest-get-type "^29.2.0" - pretty-format "^29.2.0" + pretty-format "^29.2.1" jest-docblock@^29.2.0: version "29.2.0" @@ -1732,94 +1732,94 @@ jest-docblock@^29.2.0: dependencies: detect-newline "^3.0.0" -jest-each@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.2.0.tgz#0f89c1233d65f22c7dba265ccd319611f1d662de" - integrity sha512-h4LeC3L/R7jIMfTdYowevPIssvcPYQ7Qzs+pCSYsJgPztIizXwKmnfhZXBA4WVqdmvMcpmseYEXb67JT7IJ2eg== +jest-each@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.2.1.tgz#6b0a88ee85c2ba27b571a6010c2e0c674f5c9b29" + integrity sha512-sGP86H/CpWHMyK3qGIGFCgP6mt+o5tu9qG4+tobl0LNdgny0aitLXs9/EBacLy3Bwqy+v4uXClqJgASJWcruYw== dependencies: - "@jest/types" "^29.2.0" + "@jest/types" "^29.2.1" chalk "^4.0.0" jest-get-type "^29.2.0" - jest-util "^29.2.0" - pretty-format "^29.2.0" + jest-util "^29.2.1" + pretty-format "^29.2.1" -jest-environment-node@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.2.0.tgz#49c39d4f9df64fc74da3725cbcaeee6da01a6dd6" - integrity sha512-b4qQGVStPMvtZG97Ac0rvnmSIjCZturFU7MQRMp4JDFl7zoaDLTtXmFjFP1tNmi9te6kR8d+Htbv3nYeoaIz6g== +jest-environment-node@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.2.1.tgz#f90311d0f0e8ef720349f83c97a076e403f90665" + integrity sha512-PulFKwEMz6nTAdLUwglFKei3b/LixwlRiqTN6nvPE1JtrLtlnpd6LXnFI1NFHYJGlTmIWilMP2n9jEtPPKX50g== dependencies: - "@jest/environment" "^29.2.0" - "@jest/fake-timers" "^29.2.0" - "@jest/types" "^29.2.0" + "@jest/environment" "^29.2.1" + "@jest/fake-timers" "^29.2.1" + "@jest/types" "^29.2.1" "@types/node" "*" - jest-mock "^29.2.0" - jest-util "^29.2.0" + jest-mock "^29.2.1" + jest-util "^29.2.1" jest-get-type@^29.2.0: version "29.2.0" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.2.0.tgz#726646f927ef61d583a3b3adb1ab13f3a5036408" integrity sha512-uXNJlg8hKFEnDgFsrCjznB+sTxdkuqiCL6zMgA75qEbAJjJYTs9XPrvDctrEig2GDow22T/LvHgO57iJhXB/UA== -jest-haste-map@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.2.0.tgz#2410f2ec93958e0bd894818de6c8056eb1b4d6fc" - integrity sha512-qu9lGFi7qJ8v37egS1phZZUJYiMyWnKwu83NlNT1qs50TbedIX2hFl+9ztsJ7U/ENaHwk1/Bs8fqOIQsScIRwg== +jest-haste-map@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.2.1.tgz#f803fec57f8075e6c55fb5cd551f99a72471c699" + integrity sha512-wF460rAFmYc6ARcCFNw4MbGYQjYkvjovb9GBT+W10Um8q5nHq98jD6fHZMDMO3tA56S8XnmNkM8GcA8diSZfnA== dependencies: - "@jest/types" "^29.2.0" + "@jest/types" "^29.2.1" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" jest-regex-util "^29.2.0" - jest-util "^29.2.0" - jest-worker "^29.2.0" + jest-util "^29.2.1" + jest-worker "^29.2.1" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.2.0.tgz#7c0eace293cf05a130a09beb1b9318ecc2f77692" - integrity sha512-FXT9sCFdct42+oOqGIr/9kmUw3RbhvpkwidCBT5ySHHoWNGd3c9n7HXpFKjEz9UnUITRCGdn0q2s6Sxrq36kwg== +jest-leak-detector@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.2.1.tgz#ec551686b7d512ec875616c2c3534298b1ffe2fc" + integrity sha512-1YvSqYoiurxKOJtySc+CGVmw/e1v4yNY27BjWTVzp0aTduQeA7pdieLiW05wTYG/twlKOp2xS/pWuikQEmklug== dependencies: jest-get-type "^29.2.0" - pretty-format "^29.2.0" + pretty-format "^29.2.1" -jest-matcher-utils@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.2.0.tgz#d1d73add0e0efb0e316a50f296977505dc053e02" - integrity sha512-FcEfKZ4vm28yCdBsvC69EkrEhcfex+IYlRctNJXsRG9+WC3WxgBNORnECIgqUtj7o/h1d8o7xB/dFUiLi4bqtw== +jest-matcher-utils@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.2.1.tgz#2bf876c5f891b33786aadf5d65d5da5970744122" + integrity sha512-hUTBh7H/Mnb6GTpihbLh8uF5rjAMdekfW/oZNXUMAXi7bbmym2HiRpzgqf/zzkjgejMrVAkPdVSQj+32enlUww== dependencies: chalk "^4.0.0" - jest-diff "^29.2.0" + jest-diff "^29.2.1" jest-get-type "^29.2.0" - pretty-format "^29.2.0" + pretty-format "^29.2.1" -jest-message-util@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.2.0.tgz#cbd43fd9a20a8facd4267ac37556bc5c9a525ec0" - integrity sha512-arBfk5yMFMTnMB22GyG601xGSGthA02vWSewPaxoFo0F9wBqDOyxccPbCcYu8uibw3kduSHXdCOd1PsLSgdomg== +jest-message-util@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.2.1.tgz#3a51357fbbe0cc34236f17a90d772746cf8d9193" + integrity sha512-Dx5nEjw9V8C1/Yj10S/8ivA8F439VS8vTq1L7hEgwHFn9ovSKNpYW/kwNh7UglaEgXO42XxzKJB+2x0nSglFVw== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.2.0" + "@jest/types" "^29.2.1" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^29.2.0" + pretty-format "^29.2.1" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.2.0.tgz#3531012881178f59f4b5fd1e243acc329d08d6a1" - integrity sha512-aiWGR0P8ivssIO17xkehLGFtCcef2ZwQFNPwEer1jQLHxPctDlIg3Hs6QMq1KpPz5dkCcgM7mwGif4a9IPznlg== +jest-mock@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.2.1.tgz#a0d361cffcb28184fa9c5443adbf591fa5759775" + integrity sha512-NDphaY/GqyQpTfnTZiTqqpMaw4Z0I7XnB7yBgrT6IwYrLGxpOhrejYr4ANY4YvO2sEGdd8Tx/6D0+WLQy7/qDA== dependencies: - "@jest/types" "^29.2.0" + "@jest/types" "^29.2.1" "@types/node" "*" - jest-util "^29.2.0" + jest-util "^29.2.1" jest-pnp-resolver@^1.2.2: version "1.2.2" @@ -1831,88 +1831,88 @@ jest-regex-util@^29.2.0: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.2.0.tgz#82ef3b587e8c303357728d0322d48bbfd2971f7b" integrity sha512-6yXn0kg2JXzH30cr2NlThF+70iuO/3irbaB4mh5WyqNIvLLP+B6sFdluO1/1RJmslyh/f9osnefECflHvTbwVA== -jest-resolve-dependencies@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.2.0.tgz#a127b7d6b7df69d4eaf2c7c99f652f17ba0fed71" - integrity sha512-Cd0Z39sDntEnfR9PoUdFHUAGDvtKI0/7Wt73l3lt03A3yQ+A6Qi3XmBuqGjdFl2QbXaPa937oLhilG612P8HGQ== +jest-resolve-dependencies@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.2.1.tgz#8d717dd41dc615fef1d412d395ea3deccfb1b9fa" + integrity sha512-o3mUGX2j08usj1jIAIE8KmUVpqVAn54k80kI27ldbZf2oJn6eghhB6DvJxjrcH40va9CQgWTfU5f2Ag/MoUqgQ== dependencies: jest-regex-util "^29.2.0" - jest-snapshot "^29.2.0" + jest-snapshot "^29.2.1" -jest-resolve@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.2.0.tgz#cb9f9770164382785cd68598a9fb0b7e4bb95a9f" - integrity sha512-f5c0ljNg2guDBCC7wi92vAhNuA0BtAG5vkY7Fob0c7sUMU1g87mTXqRmjrVFe2XvdwP5m5T/e5KJsCKu9hRvBA== +jest-resolve@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.2.1.tgz#a4d2f76db88aeb6ec5f5453c9a40b52483d17799" + integrity sha512-1dJTW76Z9622Viq4yRcwBuEXuzGtE9B2kdl05RC8Om/lAzac9uEgC+M8Q5osVidbuBPmxm8wSrcItYhca2ZAtQ== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^29.2.0" + jest-haste-map "^29.2.1" jest-pnp-resolver "^1.2.2" - jest-util "^29.2.0" - jest-validate "^29.2.0" + jest-util "^29.2.1" + jest-validate "^29.2.1" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.2.0.tgz#d621e67a2d59d5bc302eca1f5348615ce166712c" - integrity sha512-VPBrCwl9fM2mc5yk6yZhNrgXzRJMD5jfLmntkMLlrVq4hQPWbRK998iJlR+DOGCO04TC9PPYLntOJ001Vnf28g== - dependencies: - "@jest/console" "^29.2.0" - "@jest/environment" "^29.2.0" - "@jest/test-result" "^29.2.0" - "@jest/transform" "^29.2.0" - "@jest/types" "^29.2.0" +jest-runner@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.2.1.tgz#885afe64661cb2f51f84c1b97afb713d1093c124" + integrity sha512-PojFI+uVhQ4u4YZKCN/a3yU0/l/pJJXhq1sW3JpCp8CyvGBYGddRFPKZ1WihApusxqWRTHjBJmGyPWv6Av2lWA== + dependencies: + "@jest/console" "^29.2.1" + "@jest/environment" "^29.2.1" + "@jest/test-result" "^29.2.1" + "@jest/transform" "^29.2.1" + "@jest/types" "^29.2.1" "@types/node" "*" chalk "^4.0.0" emittery "^0.10.2" graceful-fs "^4.2.9" jest-docblock "^29.2.0" - jest-environment-node "^29.2.0" - jest-haste-map "^29.2.0" - jest-leak-detector "^29.2.0" - jest-message-util "^29.2.0" - jest-resolve "^29.2.0" - jest-runtime "^29.2.0" - jest-util "^29.2.0" - jest-watcher "^29.2.0" - jest-worker "^29.2.0" + jest-environment-node "^29.2.1" + jest-haste-map "^29.2.1" + jest-leak-detector "^29.2.1" + jest-message-util "^29.2.1" + jest-resolve "^29.2.1" + jest-runtime "^29.2.1" + jest-util "^29.2.1" + jest-watcher "^29.2.1" + jest-worker "^29.2.1" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.2.0.tgz#6b10d9539c1f7af32d06fccd7d16b6c9996c9cb2" - integrity sha512-+GDmzCrswQF+mvI0upTYMe/OPYnlRRNLLDHM9AFLp2y7zxWoDoYgb8DL3WwJ8d9m743AzrnvBV9JQHi/0ed7dg== +jest-runtime@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.2.1.tgz#62e3a23c33710ae4d9c3304dda851a5fb225b574" + integrity sha512-PSQ880OoIW9y8E6/jjhGn3eQNgNc6ndMzCZaKqy357bv7FqCfSyYepu3yDC6Sp1Vkt+GhP2M/PVgldS2uZSFZg== dependencies: - "@jest/environment" "^29.2.0" - "@jest/fake-timers" "^29.2.0" - "@jest/globals" "^29.2.0" + "@jest/environment" "^29.2.1" + "@jest/fake-timers" "^29.2.1" + "@jest/globals" "^29.2.1" "@jest/source-map" "^29.2.0" - "@jest/test-result" "^29.2.0" - "@jest/transform" "^29.2.0" - "@jest/types" "^29.2.0" + "@jest/test-result" "^29.2.1" + "@jest/transform" "^29.2.1" + "@jest/types" "^29.2.1" "@types/node" "*" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^29.2.0" - jest-message-util "^29.2.0" - jest-mock "^29.2.0" + jest-haste-map "^29.2.1" + jest-message-util "^29.2.1" + jest-mock "^29.2.1" jest-regex-util "^29.2.0" - jest-resolve "^29.2.0" - jest-snapshot "^29.2.0" - jest-util "^29.2.0" + jest-resolve "^29.2.1" + jest-snapshot "^29.2.1" + jest-util "^29.2.1" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.2.0.tgz#fb3d4e1d9df579f37d7c60072877ee99376b6090" - integrity sha512-YCKrOR0PLRXROmww73fHO9oeY4tL+LPQXWR3yml1+hKbQDR8j1VUrVzB65hKSJJgxBOr1vWx+hmz2by8JjAU5w== +jest-snapshot@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.2.1.tgz#f3843b3099c8fec7e6218dea18cc506f10ea5d30" + integrity sha512-KZdLD7iEz5M4ZYd+ezZ/kk73z+DtNbk/yJ4Qx7408Vb0CCuclJIZPa/HmIwSsCfIlOBNcYTKufr7x/Yv47oYlg== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" @@ -1920,82 +1920,82 @@ jest-snapshot@^29.2.0: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.2.0" - "@jest/transform" "^29.2.0" - "@jest/types" "^29.2.0" + "@jest/expect-utils" "^29.2.1" + "@jest/transform" "^29.2.1" + "@jest/types" "^29.2.1" "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.2.0" + expect "^29.2.1" graceful-fs "^4.2.9" - jest-diff "^29.2.0" + jest-diff "^29.2.1" jest-get-type "^29.2.0" - jest-haste-map "^29.2.0" - jest-matcher-utils "^29.2.0" - jest-message-util "^29.2.0" - jest-util "^29.2.0" + jest-haste-map "^29.2.1" + jest-matcher-utils "^29.2.1" + jest-message-util "^29.2.1" + jest-util "^29.2.1" natural-compare "^1.4.0" - pretty-format "^29.2.0" + pretty-format "^29.2.1" semver "^7.3.5" -jest-util@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.2.0.tgz#797935697e83a5722aeba401ed6cd01264295566" - integrity sha512-8M1dx12ujkBbnhwytrezWY0Ut79hbflwodE+qZKjxSRz5qt4xDp6dQQJaOCFvCmE0QJqp9KyEK33lpPNjnhevw== +jest-util@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.2.1.tgz#f26872ba0dc8cbefaba32c34f98935f6cf5fc747" + integrity sha512-P5VWDj25r7kj7kl4pN2rG/RN2c1TLfYYYZYULnS/35nFDjBai+hBeo3MDrYZS7p6IoY3YHZnt2vq4L6mKnLk0g== dependencies: - "@jest/types" "^29.2.0" + "@jest/types" "^29.2.1" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.2.0.tgz#e40faf33759365c12ead6a45165349d660d09ba4" - integrity sha512-4Vl51bPNeFeDok9aJiOnrC6tqJbOp4iMCYlewoC2ZzYJZ5+6pfr3KObAdx5wP8auHcg2MRaguiqj5OdScZa72g== +jest-validate@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.2.1.tgz#db814ce12c4c7e4746044922762e56eb177d066c" + integrity sha512-DZVX5msG6J6DL5vUUw+++6LEkXUsPwB5R7fsfM7BXdz2Ipr0Ib046ak+8egrwAR++pvSM/5laxLK977ieIGxkQ== dependencies: - "@jest/types" "^29.2.0" + "@jest/types" "^29.2.1" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^29.2.0" leven "^3.1.0" - pretty-format "^29.2.0" + pretty-format "^29.2.1" -jest-watcher@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.2.0.tgz#d0c58ff76d3dd22fff79f3f9cbeadaa749d2ca6e" - integrity sha512-bRh0JdUeN+cl9XfK7tMnXLm4Mv70hG2SZlqbkFe5CTs7oeCkbwlGBk/mEfEJ63mrxZ8LPbnfaMpfSmkhEQBEGA== +jest-watcher@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.2.1.tgz#1cb91f8aa9e77b1332af139944ad65e51430d7c3" + integrity sha512-7jFaHUaRq50l4w/f6RuY713bvI5XskMmjWCE54NGYcY74fLkShS8LucXJke1QfGnwDSCoIqGnGGGKPwdaBYz2Q== dependencies: - "@jest/test-result" "^29.2.0" - "@jest/types" "^29.2.0" + "@jest/test-result" "^29.2.1" + "@jest/types" "^29.2.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.10.2" - jest-util "^29.2.0" + jest-util "^29.2.1" string-length "^4.0.1" -jest-worker@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.2.0.tgz#b2bd1a81fc7a1ae79a500b05f5feb0d1c0b1a19e" - integrity sha512-mluOlMbRX1H59vGVzPcVg2ALfCausbBpxC8a2KWOzInhYHZibbHH8CB0C1JkmkpfurrkOYgF7FPmypuom1OM9A== +jest-worker@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.2.1.tgz#8ba68255438252e1674f990f0180c54dfa26a3b1" + integrity sha512-ROHTZ+oj7sBrgtv46zZ84uWky71AoYi0vEV9CdEtc1FQunsoAGe5HbQmW76nI5QWdvECVPrSi1MCVUmizSavMg== dependencies: "@types/node" "*" - jest-util "^29.2.0" + jest-util "^29.2.1" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^29.0.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.2.0.tgz#e7997bc603f31e04edbbe87dd24cf6e7c432abac" - integrity sha512-6krPemKUXCEu5Fh3j6ZVoLMjpTQVm0OCU+7f3K/9gllX8wNIE6NSCQ6s0q2RDoiKLRaQlVRHyscjSPRPqCI0Fg== + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.2.1.tgz#352ec0b81a0e436691d546d984cd7d8f72ffd26a" + integrity sha512-K0N+7rx+fv3Us3KhuwRSJt55MMpZPs9Q3WSO/spRZSnsalX8yEYOTQ1PiSN7OvqzoRX4JEUXCbOJRlP4n8m5LA== dependencies: - "@jest/core" "^29.2.0" - "@jest/types" "^29.2.0" + "@jest/core" "^29.2.1" + "@jest/types" "^29.2.1" import-local "^3.0.2" - jest-cli "^29.2.0" + jest-cli "^29.2.1" js-sdsl@^4.1.4: version "4.1.4" @@ -2321,10 +2321,10 @@ prettier@>=2.3.0: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== -pretty-format@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.2.0.tgz#1d4ea56fb46079b44efd9ed59c14f70f2950a61b" - integrity sha512-QCSUFdwOi924g24czhOH5eTkXxUCqlLGZBRCySlwDYHIXRJkdGyjJc9nZaqhlFBZws8dq5Dvk0lCilsmlfsPxw== +pretty-format@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.2.1.tgz#86e7748fe8bbc96a6a4e04fa99172630907a9611" + integrity sha512-Y41Sa4aLCtKAXvwuIpTvcFBkyeYp2gdFWzXGA+ZNES3VwURIB165XO/z7CjETwzCCS53MjW/rLMyyqEnTtaOfA== dependencies: "@jest/schemas" "^29.0.0" ansi-styles "^5.0.0" From 9b61d480155237d0b1713597ee746d00674126e6 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 19 Oct 2022 10:37:20 -0400 Subject: [PATCH 657/785] Attempt to fix windows CI --- .github/workflows/main.yml | 100 +-- src/parse.js | 21 +- src/server.rb | 58 +- yarn.lock | 1206 ++++++++++++++++++------------------ 4 files changed, 685 insertions(+), 700 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 52484688..19603cab 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,9 +33,9 @@ jobs: - run: yarn test - run: bundle exec rake test - lint: - name: Lint - runs-on: ubuntu-latest + windows: + name: Windows + runs-on: windows-latest env: PLUGIN_RUBY_CI: true steps: @@ -43,28 +43,13 @@ jobs: - uses: ruby/setup-ruby@v1 with: bundler-cache: true - ruby-version: "3.0" - - uses: actions/setup-node@v2 - with: - node-version: 16.x - cache: yarn - - run: yarn install --frozen-lockfile - - run: yarn checkFormat - - run: yarn lint + ruby-version: '3.1' + - run: timeout -k 2 2 bundle exec ruby src/server.rb --plugins= file.txt || ls + - run: cat file.txt - smoketest: - name: Yarn PnP smoke test - strategy: - fail-fast: false - matrix: - platform: - - macos-latest - - ubuntu-latest - - windows-latest - yarn: - - 2.x - - 3.x - runs-on: ${{ matrix.platform }} + lint: + name: Lint + runs-on: ubuntu-latest env: PLUGIN_RUBY_CI: true steps: @@ -72,29 +57,58 @@ jobs: - uses: ruby/setup-ruby@v1 with: bundler-cache: true - ruby-version: "3.1" - - run: gem install syntax_tree syntax_tree-haml syntax_tree-rbs + ruby-version: "3.0" - uses: actions/setup-node@v2 with: - node-version: 18.x + node-version: 16.x cache: yarn - run: yarn install --frozen-lockfile - - run: yarn pack - # Windows runners don't have /tmp, let's make sure it exists - - run: mkdir -p /tmp - - run: mv prettier-plugin-ruby-*.tgz /tmp/prettier-plugin-ruby.tgz - - run: mkdir /tmp/smoketest - - name: Smoke test - run: | - cd /tmp/smoketest - echo '{ "name": "smoketest", "type": "module", "license": "MIT" }' > package.json - yarn set version berry # workaround for https://github.com/yarnpkg/berry/issues/3180 - yarn set version ${{ matrix.yarn }} - yarn add prettier@next @prettier/plugin-ruby@file:/tmp/prettier-plugin-ruby.tgz - npx rimraf .yarn/unplugged # Make sure Yarn didn't unplug anything; this will deliberately break if it did - echo '{ "plugins": ["@prettier/plugin-ruby"] }' > .prettierrc.json - echo 'def add(a, b) ; a + b ; end' > smoketest.rb - yarn run prettier -w smoketest.rb && ruby -c smoketest.rb + - run: yarn checkFormat + - run: yarn lint + + # smoketest: + # name: Yarn PnP smoke test + # strategy: + # fail-fast: false + # matrix: + # platform: + # - macos-latest + # - ubuntu-latest + # - windows-latest + # yarn: + # - 2.x + # - 3.x + # runs-on: ${{ matrix.platform }} + # env: + # PLUGIN_RUBY_CI: true + # steps: + # - uses: actions/checkout@main + # - uses: ruby/setup-ruby@v1 + # with: + # bundler-cache: true + # ruby-version: "3.1" + # - run: gem install syntax_tree syntax_tree-haml syntax_tree-rbs + # - uses: actions/setup-node@v2 + # with: + # node-version: 18.x + # cache: yarn + # - run: yarn install --frozen-lockfile + # - run: yarn pack + # # Windows runners don't have /tmp, let's make sure it exists + # - run: mkdir -p /tmp + # - run: mv prettier-plugin-ruby-*.tgz /tmp/prettier-plugin-ruby.tgz + # - run: mkdir /tmp/smoketest + # - name: Smoke test + # run: | + # cd /tmp/smoketest + # echo '{ "name": "smoketest", "type": "module", "license": "MIT" }' > package.json + # yarn set version berry # workaround for https://github.com/yarnpkg/berry/issues/3180 + # yarn set version ${{ matrix.yarn }} + # yarn add prettier@next @prettier/plugin-ruby@file:/tmp/prettier-plugin-ruby.tgz + # npx rimraf .yarn/unplugged # Make sure Yarn didn't unplug anything; this will deliberately break if it did + # echo '{ "plugins": ["@prettier/plugin-ruby"] }' > .prettierrc.json + # echo 'def add(a, b) ; a + b ; end' > smoketest.rb + # yarn run prettier -w smoketest.rb && ruby -c smoketest.rb gem: name: Gem diff --git a/src/parse.js b/src/parse.js index 1e6f536a..97543038 100644 --- a/src/parse.js +++ b/src/parse.js @@ -75,26 +75,7 @@ export async function spawnServer(opts) { // system. if (process.versions.pnp) { if (url.fileURLToPath(new URL(".", import.meta.url)).includes(".zip")) { - // serverRbPath = path.join(tmpdir, "server.rb"); - // const rubyFile = "server.rb"; - // const destDir = path.join(tmpdir, path.dirname(rubyFile)); - // if (!existsSync(destDir)) { - // mkdirSync(destDir); - // } - // copyFileSync( - // url.fileURLToPath(new URL(`../src/${rubyFile}`, import.meta.url)), - // path.join(tmpdir, rubyFile) - // ); - // cleanupTempFiles = () => { - // const tmpFilePath = path.join(tmpdir, "server.rb"); - // if (existsSync(tmpFilePath)) { - // unlinkSync(tmpFilePath); - // } - // const tempSubdir = path.join(tmpdir, path.dirname("server.rb")); - // if (existsSync(tempSubdir)) { - // rmdirSync(tempSubdir); - // } - // }; + // TODO: wait for prettier to get support back for pnp } } diff --git a/src/server.rb b/src/server.rb index 0ee42d51..f3c1336e 100644 --- a/src/server.rb +++ b/src/server.rb @@ -27,37 +27,34 @@ trap(:QUIT) { quit = true } end -if Gem.win_platform? - # If we're on windows, we're going to start up a TCP server. The 0 here means - # to bind to some available port. - server = TCPServer.new("127.0.0.1", 0) - address = server.local_address - - # Ensure that we close the server when this process exits. - at_exit { server.close } - - File.write( - connection_filepath, - JSON.fast_generate(address: address.ip_address, port: address.ip_port) - ) -else - # If we're not on windows, then we're going to assume we can use unix socket - # files (since they're faster than a TCP server). - filepath = "/tmp/prettier-ruby-parser-#{Process.pid}.sock" - server = UNIXServer.new(filepath) - - # Ensure that we close the server and delete the socket file when this - # process exits. - at_exit do - server.close - File.unlink(filepath) - end +connection_information = + if Gem.win_platform? + # If we're on windows, we're going to start up a TCP server. The 0 here means + # to bind to some available port. + server = TCPServer.new("0.0.0.0", 0) + address = server.local_address + + # Ensure that we close the server when this process exits. + at_exit { server.close } + + # Return the connection information. + { address: address.ip_address, port: address.ip_port } + else + # If we're not on windows, then we're going to assume we can use unix socket + # files (since they're faster than a TCP server). + filepath = "/tmp/prettier-ruby-parser-#{Process.pid}.sock" + server = UNIXServer.new(filepath) + + # Ensure that we close the server and delete the socket file when this + # process exits. + at_exit do + server.close + File.unlink(filepath) + end - File.write( - connection_filepath, - JSON.fast_generate(path: server.local_address.unix_path) - ) -end + # Return the connection information. + { path: server.local_address.unix_path } + end # This is the actual listening thread that will be acting as our server. We have # to start it in another thread in order to properly trap the signals in this @@ -161,4 +158,5 @@ end end +File.write(connection_filepath, JSON.fast_generate(connection_information)) listener.join diff --git a/yarn.lock b/yarn.lock index 203b4121..4fb99fc8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10,157 +10,155 @@ "@jridgewell/gen-mapping" "^0.1.0" "@jridgewell/trace-mapping" "^0.3.9" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" - integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" + integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== dependencies: - "@babel/highlight" "^7.16.7" + "@babel/highlight" "^7.18.6" -"@babel/compat-data@^7.17.10": - version "7.17.10" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.17.10.tgz#711dc726a492dfc8be8220028b1b92482362baab" - integrity sha512-GZt/TCsG70Ms19gfZO1tM4CVnXsPgEPBCpJu+Qz3L0LUDsY5nZqFZglIoPC1kIYOtNBZlrnFT+klg12vFGZXrw== +"@babel/compat-data@^7.19.3": + version "7.19.4" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.19.4.tgz#95c86de137bf0317f3a570e1b6e996b427299747" + integrity sha512-CHIGpJcUQ5lU9KrPHTjBMhVwQG6CQjxfg36fGXl3qk/Gik1WwWachaXFuo0uCWJT/mStOKtcbFJCaVLihC1CMw== "@babel/core@^7.11.6", "@babel/core@^7.12.3": - version "7.17.10" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.10.tgz#74ef0fbf56b7dfc3f198fc2d927f4f03e12f4b05" - integrity sha512-liKoppandF3ZcBnIYFjfSDHZLKdLHGJRkoWtG8zQyGJBQfIYobpnVGI5+pLBNtS6psFLDzyq8+h5HiVljW9PNA== + version "7.19.3" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.19.3.tgz#2519f62a51458f43b682d61583c3810e7dcee64c" + integrity sha512-WneDJxdsjEvyKtXKsaBGbDeiyOjR5vYq4HcShxnIbG0qixpoHjI3MqeZM9NDvsojNCEBItQE4juOo/bU6e72gQ== dependencies: "@ampproject/remapping" "^2.1.0" - "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.17.10" - "@babel/helper-compilation-targets" "^7.17.10" - "@babel/helper-module-transforms" "^7.17.7" - "@babel/helpers" "^7.17.9" - "@babel/parser" "^7.17.10" - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.17.10" - "@babel/types" "^7.17.10" + "@babel/code-frame" "^7.18.6" + "@babel/generator" "^7.19.3" + "@babel/helper-compilation-targets" "^7.19.3" + "@babel/helper-module-transforms" "^7.19.0" + "@babel/helpers" "^7.19.0" + "@babel/parser" "^7.19.3" + "@babel/template" "^7.18.10" + "@babel/traverse" "^7.19.3" + "@babel/types" "^7.19.3" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.1" semver "^6.3.0" -"@babel/generator@^7.17.10", "@babel/generator@^7.7.2": - version "7.17.10" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.17.10.tgz#c281fa35b0c349bbe9d02916f4ae08fc85ed7189" - integrity sha512-46MJZZo9y3o4kmhBVc7zW7i8dtR1oIK/sdO5NcfcZRhTGYi+KKJRtHNgsU6c4VUcJmUNV/LQdebD/9Dlv4K+Tg== +"@babel/generator@^7.19.3", "@babel/generator@^7.19.4", "@babel/generator@^7.7.2": + version "7.19.5" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.19.5.tgz#da3f4b301c8086717eee9cab14da91b1fa5dcca7" + integrity sha512-DxbNz9Lz4aMZ99qPpO1raTbcrI1ZeYh+9NR9qhfkQIbFtVEqotHojEBxHzmxhVONkGt6VyrqVQcgpefMy9pqcg== dependencies: - "@babel/types" "^7.17.10" - "@jridgewell/gen-mapping" "^0.1.0" + "@babel/types" "^7.19.4" + "@jridgewell/gen-mapping" "^0.3.2" jsesc "^2.5.1" -"@babel/helper-compilation-targets@^7.17.10": - version "7.17.10" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.10.tgz#09c63106d47af93cf31803db6bc49fef354e2ebe" - integrity sha512-gh3RxjWbauw/dFiU/7whjd0qN9K6nPJMqe6+Er7rOavFh0CQUSwhAE3IcTho2rywPJFxej6TUUHDkWcYI6gGqQ== +"@babel/helper-compilation-targets@^7.19.3": + version "7.19.3" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.19.3.tgz#a10a04588125675d7c7ae299af86fa1b2ee038ca" + integrity sha512-65ESqLGyGmLvgR0mst5AdW1FkNlj9rQsCKduzEoEPhBCDFGXvz2jW6bXFG6i0/MrV2s7hhXjjb2yAzcPuQlLwg== dependencies: - "@babel/compat-data" "^7.17.10" - "@babel/helper-validator-option" "^7.16.7" - browserslist "^4.20.2" + "@babel/compat-data" "^7.19.3" + "@babel/helper-validator-option" "^7.18.6" + browserslist "^4.21.3" semver "^6.3.0" -"@babel/helper-environment-visitor@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz#ff484094a839bde9d89cd63cba017d7aae80ecd7" - integrity sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag== - dependencies: - "@babel/types" "^7.16.7" - -"@babel/helper-function-name@^7.17.9": - version "7.17.9" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz#136fcd54bc1da82fcb47565cf16fd8e444b1ff12" - integrity sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg== - dependencies: - "@babel/template" "^7.16.7" - "@babel/types" "^7.17.0" - -"@babel/helper-hoist-variables@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz#86bcb19a77a509c7b77d0e22323ef588fa58c246" - integrity sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg== - dependencies: - "@babel/types" "^7.16.7" +"@babel/helper-environment-visitor@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be" + integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg== -"@babel/helper-module-imports@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz#25612a8091a999704461c8a222d0efec5d091437" - integrity sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg== +"@babel/helper-function-name@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz#941574ed5390682e872e52d3f38ce9d1bef4648c" + integrity sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w== dependencies: - "@babel/types" "^7.16.7" + "@babel/template" "^7.18.10" + "@babel/types" "^7.19.0" -"@babel/helper-module-transforms@^7.17.7": - version "7.17.7" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.17.7.tgz#3943c7f777139e7954a5355c815263741a9c1cbd" - integrity sha512-VmZD99F3gNTYB7fJRDTi+u6l/zxY0BE6OIxPSU7a50s6ZUQkHwSDmV92FfM+oCG0pZRVojGYhkR8I0OGeCVREw== +"@babel/helper-hoist-variables@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678" + integrity sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q== dependencies: - "@babel/helper-environment-visitor" "^7.16.7" - "@babel/helper-module-imports" "^7.16.7" - "@babel/helper-simple-access" "^7.17.7" - "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/helper-validator-identifier" "^7.16.7" - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.17.3" - "@babel/types" "^7.17.0" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.8.0": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz#aa3a8ab4c3cceff8e65eb9e73d87dc4ff320b2f5" - integrity sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA== - -"@babel/helper-plugin-utils@^7.18.6": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.18.9.tgz#4b8aea3b069d8cb8a72cdfe28ddf5ceca695ef2f" - integrity sha512-aBXPT3bmtLryXaoJLyYPXPlSD4p1ld9aYeR+sJNOZjJJGiOpb+fKfh3NkcCu7J54nUJwCERPBExCCpyCOHnu/w== + "@babel/types" "^7.18.6" -"@babel/helper-simple-access@^7.17.7": - version "7.17.7" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz#aaa473de92b7987c6dfa7ce9a7d9674724823367" - integrity sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA== +"@babel/helper-module-imports@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz#1e3ebdbbd08aad1437b428c50204db13c5a3ca6e" + integrity sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-module-transforms@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.19.0.tgz#309b230f04e22c58c6a2c0c0c7e50b216d350c30" + integrity sha512-3HBZ377Fe14RbLIA+ac3sY4PTgpxHVkFrESaWhoI5PuyXPBBX8+C34qblV9G89ZtycGJCmCI/Ut+VUDK4bltNQ== + dependencies: + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-module-imports" "^7.18.6" + "@babel/helper-simple-access" "^7.18.6" + "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/helper-validator-identifier" "^7.18.6" + "@babel/template" "^7.18.10" + "@babel/traverse" "^7.19.0" + "@babel/types" "^7.19.0" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.8.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.19.0.tgz#4796bb14961521f0f8715990bee2fb6e51ce21bf" + integrity sha512-40Ryx7I8mT+0gaNxm8JGTZFUITNqdLAgdg0hXzeVZxVD6nFsdhQvip6v8dqkRHzsz1VFpFAaOCHNn0vKBL7Czw== + +"@babel/helper-simple-access@^7.18.6": + version "7.19.4" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.19.4.tgz#be553f4951ac6352df2567f7daa19a0ee15668e7" + integrity sha512-f9Xq6WqBFqaDfbCzn2w85hwklswz5qsKlh7f08w4Y9yhJHpnNC0QemtSkK5YyOY8kPGvyiwdzZksGUhnGdaUIg== + dependencies: + "@babel/types" "^7.19.4" + +"@babel/helper-split-export-declaration@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz#7367949bc75b20c6d5a5d4a97bba2824ae8ef075" + integrity sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA== dependencies: - "@babel/types" "^7.17.0" + "@babel/types" "^7.18.6" -"@babel/helper-split-export-declaration@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz#0b648c0c42da9d3920d85ad585f2778620b8726b" - integrity sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw== - dependencies: - "@babel/types" "^7.16.7" +"@babel/helper-string-parser@^7.19.4": + version "7.19.4" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63" + integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw== -"@babel/helper-validator-identifier@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz#e8c602438c4a8195751243da9031d1607d247cad" - integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw== +"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1": + version "7.19.1" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" + integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== -"@babel/helper-validator-option@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz#b203ce62ce5fe153899b617c08957de860de4d23" - integrity sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ== +"@babel/helper-validator-option@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz#bf0d2b5a509b1f336099e4ff36e1a63aa5db4db8" + integrity sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw== -"@babel/helpers@^7.17.9": - version "7.17.9" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.17.9.tgz#b2af120821bfbe44f9907b1826e168e819375a1a" - integrity sha512-cPCt915ShDWUEzEp3+UNRktO2n6v49l5RSnG9M5pS24hA+2FAc5si+Pn1i4VVbQQ+jh+bIZhPFQOJOzbrOYY1Q== +"@babel/helpers@^7.19.0": + version "7.19.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.19.4.tgz#42154945f87b8148df7203a25c31ba9a73be46c5" + integrity sha512-G+z3aOx2nfDHwX/kyVii5fJq+bgscg89/dJNWpYeKeBv3v9xX8EIabmx1k6u9LS04H7nROFVRVK+e3k0VHp+sw== dependencies: - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.17.9" - "@babel/types" "^7.17.0" + "@babel/template" "^7.18.10" + "@babel/traverse" "^7.19.4" + "@babel/types" "^7.19.4" -"@babel/highlight@^7.16.7": - version "7.17.9" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.17.9.tgz#61b2ee7f32ea0454612def4fccdae0de232b73e3" - integrity sha512-J9PfEKCbFIv2X5bjTMiZu6Vf341N05QIY+d6FvVKynkG1S7G0j3I0QoRtWIrXhZ+/Nlb5Q0MzqL7TokEJ5BNHg== +"@babel/highlight@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" + integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== dependencies: - "@babel/helper-validator-identifier" "^7.16.7" + "@babel/helper-validator-identifier" "^7.18.6" chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.17.10": - version "7.17.10" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.10.tgz#873b16db82a8909e0fbd7f115772f4b739f6ce78" - integrity sha512-n2Q6i+fnJqzOaq2VkdXxy2TCPCWQZHiCo0XqmrCvDWcZQKRyZzYi4Z0yxlBuN0w+r2ZHmre+Q087DSrw3pbJDQ== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.18.10", "@babel/parser@^7.19.3", "@babel/parser@^7.19.4": + version "7.19.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.19.4.tgz#03c4339d2b8971eb3beca5252bafd9b9f79db3dc" + integrity sha512-qpVT7gtuOLjWeDTKLkJ6sryqLliBaFpAtGeqw5cs5giLldvh+Ch0plqnUMKoVAUS6ZEueQQiZV+p5pxtPitEsA== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -254,43 +252,44 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-typescript@^7.7.2": - version "7.17.10" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.17.10.tgz#80031e6042cad6a95ed753f672ebd23c30933195" - integrity sha512-xJefea1DWXW09pW4Tm9bjwVlPDyYA2it3fWlmEjpYz6alPvTUjL0EOzNzI/FEOyI3r4/J7uVH5UqKgl1TQ5hqQ== - dependencies: - "@babel/helper-plugin-utils" "^7.16.7" - -"@babel/template@^7.16.7", "@babel/template@^7.3.3": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.7.tgz#8d126c8701fde4d66b264b3eba3d96f07666d155" - integrity sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w== - dependencies: - "@babel/code-frame" "^7.16.7" - "@babel/parser" "^7.16.7" - "@babel/types" "^7.16.7" - -"@babel/traverse@^7.17.10", "@babel/traverse@^7.17.3", "@babel/traverse@^7.17.9", "@babel/traverse@^7.7.2": - version "7.17.10" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.17.10.tgz#1ee1a5ac39f4eac844e6cf855b35520e5eb6f8b5" - integrity sha512-VmbrTHQteIdUUQNTb+zE12SHS/xQVIShmBPhlNP12hD5poF2pbITW1Z4172d03HegaQWhLffdkRJYtAzp0AGcw== - dependencies: - "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.17.10" - "@babel/helper-environment-visitor" "^7.16.7" - "@babel/helper-function-name" "^7.17.9" - "@babel/helper-hoist-variables" "^7.16.7" - "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/parser" "^7.17.10" - "@babel/types" "^7.17.10" + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.18.6.tgz#1c09cd25795c7c2b8a4ba9ae49394576d4133285" + integrity sha512-mAWAuq4rvOepWCBid55JuRNvpTNf2UGVgoz4JV0fXEKolsVZDzsa4NqCef758WZJj/GDu0gVGItjKFiClTAmZA== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/template@^7.18.10", "@babel/template@^7.3.3": + version "7.18.10" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.18.10.tgz#6f9134835970d1dbf0835c0d100c9f38de0c5e71" + integrity sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA== + dependencies: + "@babel/code-frame" "^7.18.6" + "@babel/parser" "^7.18.10" + "@babel/types" "^7.18.10" + +"@babel/traverse@^7.19.0", "@babel/traverse@^7.19.3", "@babel/traverse@^7.19.4", "@babel/traverse@^7.7.2": + version "7.19.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.19.4.tgz#f117820e18b1e59448a6c1fa9d0ff08f7ac459a8" + integrity sha512-w3K1i+V5u2aJUOXBFFC5pveFLmtq1s3qcdDNC2qRI6WPBQIDaKFqXxDEqDO/h1dQ3HjsZoZMyIy6jGLq0xtw+g== + dependencies: + "@babel/code-frame" "^7.18.6" + "@babel/generator" "^7.19.4" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-function-name" "^7.19.0" + "@babel/helper-hoist-variables" "^7.18.6" + "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/parser" "^7.19.4" + "@babel/types" "^7.19.4" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.16.7", "@babel/types@^7.17.0", "@babel/types@^7.17.10", "@babel/types@^7.3.0", "@babel/types@^7.3.3": - version "7.17.10" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.17.10.tgz#d35d7b4467e439fcf06d195f8100e0fea7fc82c4" - integrity sha512-9O26jG0mBYfGkUYCYZRnBwbVLd1UZOICEr2Em6InB6jVfsAv1GKgwXHmrSg+WFWDmeKTA6vyTZiN8tCSM5Oo3A== +"@babel/types@^7.0.0", "@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.19.0", "@babel/types@^7.19.3", "@babel/types@^7.19.4", "@babel/types@^7.3.0", "@babel/types@^7.3.3": + version "7.19.4" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.19.4.tgz#0dd5c91c573a202d600490a35b33246fed8a41c7" + integrity sha512-M5LK7nAeS6+9j7hAq+b3fQs+pNfUtTGq+yFFfHnauFA8zQtLRfmuipmsKDKKLuyG+wC8ABW43A153YNawNTEtw== dependencies: - "@babel/helper-validator-identifier" "^7.16.7" + "@babel/helper-string-parser" "^7.19.4" + "@babel/helper-validator-identifier" "^7.19.1" to-fast-properties "^2.0.0" "@bcoe/v8-coverage@^0.2.3": @@ -314,9 +313,9 @@ strip-json-comments "^3.1.1" "@humanwhocodes/config-array@^0.10.5": - version "0.10.5" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.10.5.tgz#bb679745224745fff1e9a41961c1d45a49f81c04" - integrity sha512-XVVDtp+dVvRxMoxSiSfasYaG02VEe1qH5cKgMQJWhol6HwzbcqoCMJi8dAGoYAO57jhUyhI6cWuRiTcRaDaYug== + version "0.10.7" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.10.7.tgz#6d53769fd0c222767e6452e8ebda825c22e9f0dc" + integrity sha512-MDl6D6sBsaV452/QSdX+4CXIjZhIcI0PELsxUjk4U828yd58vk3bTIvk/6w5FY+4hIy9sLW0sfrV7K7Kc++j/w== dependencies: "@humanwhocodes/object-schema" "^1.2.1" debug "^4.1.1" @@ -348,28 +347,28 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.2.0.tgz#e906bdbfc83baf79590f05b515dad900b3b71fed" - integrity sha512-Xz1Wu+ZZxcB3RS8U3HdkFxlRJ7kLXI/by9X7d2/gvseIWPwYu/c1EsYy77cB5iyyHGOy3whS2HycjcuzIF4Jow== +"@jest/console@^29.2.1": + version "29.2.1" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.2.1.tgz#5f2c62dcdd5ce66e94b6d6729e021758bceea090" + integrity sha512-MF8Adcw+WPLZGBiNxn76DOuczG3BhODTcMlDCA4+cFi41OkaY/lyI0XUUhi73F88Y+7IHoGmD80pN5CtxQUdSw== dependencies: - "@jest/types" "^29.2.0" + "@jest/types" "^29.2.1" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^29.2.0" - jest-util "^29.2.0" + jest-message-util "^29.2.1" + jest-util "^29.2.1" slash "^3.0.0" -"@jest/core@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.2.0.tgz#beed57c552be65d4e4ab2f4161d0abe8ea6bf3a8" - integrity sha512-+gyJ3bX+kGEW/eqt/0kI7fLjqiFr3AN8O+rlEl1fYRf7D8h4Sj4tBGo9YOSirvWgvemoH2EPRya35bgvcPFzHQ== - dependencies: - "@jest/console" "^29.2.0" - "@jest/reporters" "^29.2.0" - "@jest/test-result" "^29.2.0" - "@jest/transform" "^29.2.0" - "@jest/types" "^29.2.0" +"@jest/core@^29.2.1": + version "29.2.1" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.2.1.tgz#30af794ebd73bfb87cd8ba36718738dfe38b772e" + integrity sha512-kuLKYqnqgerXkBUwlHVxeSuhSnd+JMnMCLfU98bpacBSfWEJPegytDh3P2m15/JHzet32hGGld4KR4OzMb6/Tg== + dependencies: + "@jest/console" "^29.2.1" + "@jest/reporters" "^29.2.1" + "@jest/test-result" "^29.2.1" + "@jest/transform" "^29.2.1" + "@jest/types" "^29.2.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" @@ -377,80 +376,80 @@ exit "^0.1.2" graceful-fs "^4.2.9" jest-changed-files "^29.2.0" - jest-config "^29.2.0" - jest-haste-map "^29.2.0" - jest-message-util "^29.2.0" + jest-config "^29.2.1" + jest-haste-map "^29.2.1" + jest-message-util "^29.2.1" jest-regex-util "^29.2.0" - jest-resolve "^29.2.0" - jest-resolve-dependencies "^29.2.0" - jest-runner "^29.2.0" - jest-runtime "^29.2.0" - jest-snapshot "^29.2.0" - jest-util "^29.2.0" - jest-validate "^29.2.0" - jest-watcher "^29.2.0" + jest-resolve "^29.2.1" + jest-resolve-dependencies "^29.2.1" + jest-runner "^29.2.1" + jest-runtime "^29.2.1" + jest-snapshot "^29.2.1" + jest-util "^29.2.1" + jest-validate "^29.2.1" + jest-watcher "^29.2.1" micromatch "^4.0.4" - pretty-format "^29.2.0" + pretty-format "^29.2.1" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.2.0.tgz#7e5604e4ead098572056a962a970f3d79379fbd8" - integrity sha512-foaVv1QVPB31Mno3LlL58PxEQQOLZd9zQfCpyQQCQIpUAtdFP1INBjkphxrCfKT13VxpA0z5jFGIkmZk0DAg2Q== +"@jest/environment@^29.2.1": + version "29.2.1" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.2.1.tgz#acb1994fbd5ad02819a1a34a923c531e6923b665" + integrity sha512-EutqA7T/X6zFjw6mAWRHND+ZkTPklmIEWCNbmwX6uCmOrFrWaLbDZjA+gePHJx6fFMMRvNfjXcvzXEtz54KPlg== dependencies: - "@jest/fake-timers" "^29.2.0" - "@jest/types" "^29.2.0" + "@jest/fake-timers" "^29.2.1" + "@jest/types" "^29.2.1" "@types/node" "*" - jest-mock "^29.2.0" + jest-mock "^29.2.1" -"@jest/expect-utils@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.2.0.tgz#3c0c472115d98211e7e0a0a8fa00719bf081987f" - integrity sha512-nz2IDF7nb1qmj9hx8Ja3MFab2q9Ml8QbOaaeJNyX5JQJHU8QUvEDiMctmhGEkk3Kzr8w8vAqz4hPk/ogJSrUhg== +"@jest/expect-utils@^29.2.1": + version "29.2.1" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.2.1.tgz#eae61c90f2066540f60d23b8f254f03b7869b22f" + integrity sha512-yr4aHNg5Z1CjKby5ozm7sKjgBlCOorlAoFcvrOQ/4rbZRfgZQdnmh7cth192PYIgiPZo2bBXvqdOApnAMWFJZg== dependencies: jest-get-type "^29.2.0" -"@jest/expect@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.2.0.tgz#25316d2ae930e7bb9df96cce7521053d377c4c0d" - integrity sha512-+3lxcYL9e0xPJGOR33utxxejn+Mulz40kY0oy0FVsmIESW87NZDJ7B1ovaIqeX0xIgPX4laS5SGlqD2uSoBMcw== +"@jest/expect@^29.2.1": + version "29.2.1" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.2.1.tgz#8d99be3886ebfcffd6cabb2b46602a301b976ffe" + integrity sha512-o14R2t2tHHHudwji43UKkzmmH49xfF5T++FQBK2tl88qwuBWQOcx7fNUYl+mA/9TPNAN0FkQ3usnpyS8FUwsvQ== dependencies: - expect "^29.2.0" - jest-snapshot "^29.2.0" + expect "^29.2.1" + jest-snapshot "^29.2.1" -"@jest/fake-timers@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.2.0.tgz#e43635c1bd73b23886e80ca12307092ef2ee1929" - integrity sha512-mX0V0uQsgeSLTt0yTqanAhhpeUKMGd2uq+PSLAfO40h72bvfNNQ7pIEl9vIwNMFxRih1ENveEjSBsLjxGGDPSw== +"@jest/fake-timers@^29.2.1": + version "29.2.1" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.2.1.tgz#786d60e8cb60ca70c9f913cb49fcc77610c072bb" + integrity sha512-KWil+8fef7Uj/P/PTZlPKk1Pw117wAmr71VWFV8ZDtRtkwmTG8oY4IRf0Ss44J2y5CYRy8d/zLOhxyoGRENjvA== dependencies: - "@jest/types" "^29.2.0" + "@jest/types" "^29.2.1" "@sinonjs/fake-timers" "^9.1.2" "@types/node" "*" - jest-message-util "^29.2.0" - jest-mock "^29.2.0" - jest-util "^29.2.0" + jest-message-util "^29.2.1" + jest-mock "^29.2.1" + jest-util "^29.2.1" -"@jest/globals@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.2.0.tgz#5cfc41c028efaf511624ba086d64113d5a8a92b3" - integrity sha512-JQxtEVNWiai1p3PIzAJZSyEqQdAJGvNKvinZDPfu0mhiYEVx6E+PiBuDWj1sVUW8hzu+R3DVqaWC9K2xcLRIAA== +"@jest/globals@^29.2.1": + version "29.2.1" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.2.1.tgz#6933beb8b4e43b990409a19c462fde7b71210e63" + integrity sha512-Z4EejYPP1OPVq2abk1+9urAwJqkgw5jB2UJGlPjb5ZwzPQF8WLMcigKEfFzZb2OHhEVPP0RZD0/DbVTY1R6iQA== dependencies: - "@jest/environment" "^29.2.0" - "@jest/expect" "^29.2.0" - "@jest/types" "^29.2.0" - jest-mock "^29.2.0" + "@jest/environment" "^29.2.1" + "@jest/expect" "^29.2.1" + "@jest/types" "^29.2.1" + jest-mock "^29.2.1" -"@jest/reporters@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.2.0.tgz#24cac16d997ec91a9c615db2621805ee485689e0" - integrity sha512-BXoAJatxTZ18U0cwD7C8qBo8V6vef8AXYRBZdhqE5DF9CmpqmhMfw9c7OUvYqMTnBBK9A0NgXGO4Lc9EJzdHvw== +"@jest/reporters@^29.2.1": + version "29.2.1" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.2.1.tgz#599e4376823751fdda50f2ca97243e013da10c4d" + integrity sha512-sCsfUKM/yIF4nNed3e/rIgVIS58EiASGMDEPWqItfLZ9UO1ALW2ASDNJzdWkxEt0T8o2Ztj619G0KKrvK+McAw== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.2.0" - "@jest/test-result" "^29.2.0" - "@jest/transform" "^29.2.0" - "@jest/types" "^29.2.0" + "@jest/console" "^29.2.1" + "@jest/test-result" "^29.2.1" + "@jest/transform" "^29.2.1" + "@jest/types" "^29.2.1" "@jridgewell/trace-mapping" "^0.3.15" "@types/node" "*" chalk "^4.0.0" @@ -463,9 +462,9 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^29.2.0" - jest-util "^29.2.0" - jest-worker "^29.2.0" + jest-message-util "^29.2.1" + jest-util "^29.2.1" + jest-worker "^29.2.1" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" @@ -487,51 +486,51 @@ callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.2.0.tgz#3dcc7123b8f0fb5ba1f650ce17af45cce91a0323" - integrity sha512-l76EPJ6QqtzsCLS4aimJqWO53pxZ82o3aE+Brcmo1HJ/phb9+MR7gPhyDdN6VSGaLJCRVJBZgWEhAEz+qON0Fw== +"@jest/test-result@^29.2.1": + version "29.2.1" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.2.1.tgz#f42dbf7b9ae465d0a93eee6131473b8bb3bd2edb" + integrity sha512-lS4+H+VkhbX6z64tZP7PAUwPqhwj3kbuEHcaLuaBuB+riyaX7oa1txe0tXgrFj5hRWvZKvqO7LZDlNWeJ7VTPA== dependencies: - "@jest/console" "^29.2.0" - "@jest/types" "^29.2.0" + "@jest/console" "^29.2.1" + "@jest/types" "^29.2.1" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.2.0.tgz#acd875533f7ad01cb22da59ff4047de18e9d64da" - integrity sha512-NCnjZcGnVdva6IDqF7TCuFsXs2F1tohiNF9sasSJNzD7VfN5ic9XgcS/oPDalGiPLxCmGKj4kewqqrKAqBACcQ== +"@jest/test-sequencer@^29.2.1": + version "29.2.1" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.2.1.tgz#cafd2c5f3528c70bd4cc243800459ac366e480cc" + integrity sha512-O/pnk0/xGj3lxPVNwB6HREJ7AYvUdyP2xo/s14/9Dtf091HoOeyIhWLKQE/4HzB8lNQBMo6J5mg0bHz/uCWK7w== dependencies: - "@jest/test-result" "^29.2.0" + "@jest/test-result" "^29.2.1" graceful-fs "^4.2.9" - jest-haste-map "^29.2.0" + jest-haste-map "^29.2.1" slash "^3.0.0" -"@jest/transform@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.2.0.tgz#1c55ca549f64810351df999265a29f8ead51be15" - integrity sha512-NXMujGHy+B4DAj4dGnVPD0SIXlR2Z/N8Gp9h3mF66kcIRult1WWqY3/CEIrJcKviNWaFPYhZjCG2L3fteWzcUw== +"@jest/transform@^29.2.1": + version "29.2.1" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.2.1.tgz#f3d8154edd19cdbcaf1d6646bd8f4ff7812318a2" + integrity sha512-xup+iEuaIRSQabQaeqxaQyN0vg1Dctrp9oTObQsNf3sZEowTIa5cANYuoyi8Tqhg4GCqEVLTf18KW7ii0UeFVA== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^29.2.0" + "@jest/types" "^29.2.1" "@jridgewell/trace-mapping" "^0.3.15" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.2.0" + jest-haste-map "^29.2.1" jest-regex-util "^29.2.0" - jest-util "^29.2.0" + jest-util "^29.2.1" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" write-file-atomic "^4.0.1" -"@jest/types@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.2.0.tgz#c0d1ef8bc1e4f4b358e7877e34157371e7881b0b" - integrity sha512-mfgpQz4Z2xGo37m6KD8xEpKelaVzvYVRijmLPePn9pxgaPEtX+SqIyPNzzoeCPXKYbB4L/wYSgXDL8o3Gop78Q== +"@jest/types@^29.2.1": + version "29.2.1" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.2.1.tgz#ec9c683094d4eb754e41e2119d8bdaef01cf6da0" + integrity sha512-O/QNDQODLnINEPAI0cl9U6zUIDXEWXt6IC1o2N2QENuos7hlGUIthlKyV4p6ki3TvXFX071blj8HUhgLGquPjw== dependencies: "@jest/schemas" "^29.0.0" "@types/istanbul-lib-coverage" "^2.0.0" @@ -548,44 +547,37 @@ "@jridgewell/set-array" "^1.0.0" "@jridgewell/sourcemap-codec" "^1.4.10" -"@jridgewell/resolve-uri@^3.0.3": - version "3.0.7" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz#30cd49820a962aff48c8fffc5cd760151fca61fe" - integrity sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA== - -"@jridgewell/set-array@^1.0.0": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.1.tgz#36a6acc93987adcf0ba50c66908bd0b70de8afea" - integrity sha512-Ct5MqZkLGEXTVmQYbGtx9SVqD2fqwvdubdps5D3djjAkgkKwT918VNOz65pEHFaYTeWcukmJmH5SwsA9Tn2ObQ== - -"@jridgewell/sourcemap-codec@^1.4.10": - version "1.4.13" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz#b6461fb0c2964356c469e115f504c95ad97ab88c" - integrity sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w== - -"@jridgewell/trace-mapping@^0.3.12": - version "0.3.14" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz#b231a081d8f66796e475ad588a1ef473112701ed" - integrity sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ== +"@jridgewell/gen-mapping@^0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" + integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== dependencies: - "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/set-array" "^1.0.1" "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.9" -"@jridgewell/trace-mapping@^0.3.15": - version "0.3.15" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz#aba35c48a38d3fd84b37e66c9c0423f9744f9774" - integrity sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" +"@jridgewell/resolve-uri@3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" + integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== + +"@jridgewell/set-array@^1.0.0", "@jridgewell/set-array@^1.0.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" + integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== -"@jridgewell/trace-mapping@^0.3.9": - version "0.3.13" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.13.tgz#dcfe3e95f224c8fe97a87a5235defec999aa92ea" - integrity sha512-o1xbKhp9qnIAoHJSWd6KlCZfqslL4valSF81H8ImioOAxluWYWOpWkpyktY2vnt4tbrX9XYaxovq6cgowaJp2w== +"@jridgewell/sourcemap-codec@1.4.14", "@jridgewell/sourcemap-codec@^1.4.10": + version "1.4.14" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" + integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== + +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.15", "@jridgewell/trace-mapping@^0.3.9": + version "0.3.17" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985" + integrity sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g== dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/resolve-uri" "3.1.0" + "@jridgewell/sourcemap-codec" "1.4.14" "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -609,9 +601,9 @@ fastq "^1.6.0" "@sinclair/typebox@^0.24.1": - version "0.24.19" - resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.19.tgz#5297278e0d8a1aea084685a3216074910ac6c113" - integrity sha512-gHJu8cdYTD5p4UqmQHrxaWrtb/jkH5imLXzuBypWhKzNkW0qfmgz+w1xaJccWVuJta1YYUdlDiPHXRTR4Ku0MQ== + version "0.24.47" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.47.tgz#530b67163714356f93e82bdb871e7db4b7bc564e" + integrity sha512-J4Xw0xYK4h7eC34MNOPQi6IkNxGRck6n4VJpWDzXIFVTW8I/D43Gf+NfWz/v/7NHlzWOPd3+T4PJ4OqklQ2u7A== "@sinonjs/commons@^1.7.0": version "1.8.3" @@ -654,9 +646,9 @@ "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": - version "7.17.1" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.17.1.tgz#1a0e73e8c28c7e832656db372b779bfd2ef37314" - integrity sha512-kVzjari1s2YVi77D3w1yuvohV2idweYXMCDzqBiVNN63TcDWrIlTVOYpqVrvbbyOE/IyzBoTKF0fdnLPEORFxA== + version "7.18.2" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.18.2.tgz#235bf339d17185bdec25e024ca19cce257cc7309" + integrity sha512-FcFaxOr2V5KZCviw1TnutEMVUVsGt4D2hP1TAfXZAMKuHYW3xQhe3jTxNPWutgCJ3/X1c5yX8ZoGVEItxKbwBg== dependencies: "@babel/types" "^7.3.0" @@ -692,14 +684,14 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*": - version "17.0.32" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.32.tgz#51d59d7a90ef2d0ae961791e0900cad2393a0149" - integrity sha512-eAIcfAvhf/BkHcf4pkLJ7ECpBAhh9kcxRBpip9cTiO+hf+aJrsxYxBeS6OXvOd9WqNAJmavXVpZvY1rBjNsXmw== + version "18.11.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.2.tgz#c59b7641832531264fda3f1ba610362dc9a7dfc8" + integrity sha512-BWN3M23gLO2jVG8g/XHIRFWiiV4/GckeFIqbU/C4V3xpoBBWSMk4OZomouN0wCkfQFPqgZikyLr7DOYDysIkkw== "@types/prettier@^2.1.5": - version "2.6.0" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.6.0.tgz#efcbd41937f9ae7434c714ab698604822d890759" - integrity sha512-G/AdOadiZhnJp0jXCaBQU449W2h716OW/EoXeYkCytxKL06X1WCXB4DZpp8TpZ8eyIJVS1cw4lrlkkSYU21cDw== + version "2.7.1" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.1.tgz#dfd20e2dc35f027cdd6c1908e80a5ddc7499670e" + integrity sha512-ri0UmynRRvZiiUJdiz38MmIblKK+oH30MztdBVR95dv/Ubw6neWSb8u1XpRb72L4qsZOhz+L+z9JD40SJmfWow== "@types/stack-utils@^2.0.0": version "2.0.1" @@ -712,9 +704,9 @@ integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== "@types/yargs@^17.0.8": - version "17.0.10" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.10.tgz#591522fce85d8739bca7b8bb90d048e4478d186a" - integrity sha512-gmEaFwpj/7f/ROdtIlci1R1VYU1J4j95m8T+Tj3iBgiBFKg1foE/PSl93bBd5T9LDXNPo8UlNN6W0qwD8O5OaA== + version "17.0.13" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.13.tgz#34cced675ca1b1d51fcf4d34c3c6f0fa142a5c76" + integrity sha512-9sWaruZk2JGxIQU+IhI1fhPYRcQ0UuTNuKuCW9bR5fp7qi2Llf7WDzNa17Cy7TKnh3cdxDOiyTu6gaLS0eDatg== dependencies: "@types/yargs-parser" "*" @@ -804,12 +796,12 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.2.0.tgz#088624f037da90e69a06073305276cbd111d68a8" - integrity sha512-c8FkrW1chgcbyBqOo7jFGpQYfVnb43JqjQGV+C2r94k2rZJOukYOZ6+csAqKE4ms+PHc+yevnONxs27jQIxylw== +babel-jest@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.2.1.tgz#213c47e28072de11bdb98c9d29b89f2ab99664f1" + integrity sha512-gQJwArok0mqoREiCYhXKWOgUhElJj9DpnssW6GL8dG7ARYqHEhrM9fmPHTjdqEGRVXZAd6+imo3/Vwa8TjLcsw== dependencies: - "@jest/transform" "^29.2.0" + "@jest/transform" "^29.2.1" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" babel-preset-jest "^29.2.0" @@ -884,16 +876,15 @@ braces@^3.0.2: dependencies: fill-range "^7.0.1" -browserslist@^4.20.2: - version "4.20.3" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.20.3.tgz#eb7572f49ec430e054f56d52ff0ebe9be915f8bf" - integrity sha512-NBhymBQl1zM0Y5dQT/O+xiLP9/rzOIQdKM/eMJBAq7yBgaB6krIYLGejrwVYnSHZdqjscB1SPuAjHwxjvN6Wdg== +browserslist@^4.21.3: + version "4.21.4" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.4.tgz#e7496bbc67b9e39dd0f98565feccdcb0d4ff6987" + integrity sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw== dependencies: - caniuse-lite "^1.0.30001332" - electron-to-chromium "^1.4.118" - escalade "^3.1.1" - node-releases "^2.0.3" - picocolors "^1.0.0" + caniuse-lite "^1.0.30001400" + electron-to-chromium "^1.4.251" + node-releases "^2.0.6" + update-browserslist-db "^1.0.9" bser@2.1.1: version "2.1.1" @@ -922,10 +913,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001332: - version "1.0.30001340" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001340.tgz#029a2f8bfc025d4820fafbfaa6259fd7778340c7" - integrity sha512-jUNz+a9blQTQVu4uFcn17uAD8IDizPzQkIKh3LCJfg9BkyIqExYYdyc/ZSlWUSKb8iYiXxKsxbv4zYSvkqjrxw== +caniuse-lite@^1.0.30001400: + version "1.0.30001422" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001422.tgz#f2d7c6202c49a8359e6e35add894d88ef93edba1" + integrity sha512-hSesn02u1QacQHhaxl/kNMZwqVG35Sz/8DgvmgedxSH8z9UUpcDYSPYgsj3x5dQNRcNp6BwpSfQfVzYUTm+fog== chalk@^2.0.0: version "2.4.2" @@ -958,28 +949,28 @@ char-regex@^1.0.2: integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== ci-info@^3.2.0: - version "3.3.1" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.3.1.tgz#58331f6f472a25fe3a50a351ae3052936c2c7f32" - integrity sha512-SXgeMX9VwDe7iFFaEWkA5AstuER9YKqy4EhHqr4DVqkwmD9rpVimkMKWHdjn30Ja45txyjhSn63lVX69eVCckg== + version "3.5.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.5.0.tgz#bfac2a29263de4c829d806b1ab478e35091e171f" + integrity sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw== cjs-module-lexer@^1.0.0: version "1.2.2" resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40" integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA== -cliui@^7.0.2: - version "7.0.4" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" - integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== +cliui@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" + integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== dependencies: string-width "^4.2.0" - strip-ansi "^6.0.0" + strip-ansi "^6.0.1" wrap-ansi "^7.0.0" co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= + integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== collect-v8-coverage@^1.0.0: version "1.0.1" @@ -1003,7 +994,7 @@ color-convert@^2.0.1: color-name@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== color-name@~1.1.4: version "1.1.4" @@ -1013,14 +1004,12 @@ color-name@~1.1.4: concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" - integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== - dependencies: - safe-buffer "~5.1.1" + version "1.9.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" + integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" @@ -1041,7 +1030,7 @@ debug@^4.1.0, debug@^4.1.1, debug@^4.3.2: dedent@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" - integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= + integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA== deep-is@^0.1.3: version "0.1.4" @@ -1077,10 +1066,10 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -electron-to-chromium@^1.4.118: - version "1.4.137" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.137.tgz#186180a45617283f1c012284458510cd99d6787f" - integrity sha512-0Rcpald12O11BUogJagX3HsCN3FE83DSqWjgXoHo5a72KUKMSfI39XBgJpgNNxS9fuGzytaFjE06kZkiVFy2qA== +electron-to-chromium@^1.4.251: + version "1.4.284" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz#61046d1e4cab3a25238f6bf7413795270f125592" + integrity sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA== emittery@^0.10.2: version "0.10.2" @@ -1114,7 +1103,7 @@ escalade@^3.1.1: escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== escape-string-regexp@^2.0.0: version "2.0.0" @@ -1271,18 +1260,18 @@ execa@^5.0.0: exit@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" - integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= + integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== -expect@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.2.0.tgz#b90c6df52be7abfd9f206f273fbcf8b33d8f332d" - integrity sha512-03ClF3GWwUqd9Grgkr9ZSdaCJGMRA69PQ8jT7o+Bx100VlGiAFf9/8oIm9Qve7ZVJhuJxFftqFhviZJRxxNfvg== +expect@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.2.1.tgz#25752d0df92d3daa5188dc8804de1f30759658cf" + integrity sha512-BJtA754Fba0YWRWHgjKUMTA3ltWarKgITXHQnbZ2mTxTXC4yMQlR0FI7HkB3fJYkhWBf4qjNiqvg3LDtXCcVRQ== dependencies: - "@jest/expect-utils" "^29.2.0" + "@jest/expect-utils" "^29.2.1" jest-get-type "^29.2.0" - jest-matcher-utils "^29.2.0" - jest-message-util "^29.2.0" - jest-util "^29.2.0" + jest-matcher-utils "^29.2.1" + jest-message-util "^29.2.1" + jest-util "^29.2.1" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1290,9 +1279,9 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== fast-glob@^3.2.9: - version "3.2.11" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.11.tgz#a1172ad95ceb8a16e20caa5c5e56480e5129c1d9" - integrity sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew== + version "3.2.12" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80" + integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" @@ -1308,7 +1297,7 @@ fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: fast-levenshtein@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== fastq@^1.6.0: version "1.13.0" @@ -1318,9 +1307,9 @@ fastq@^1.6.0: reusify "^1.0.4" fb-watchman@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85" - integrity sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg== + version "2.0.2" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.2.tgz#e9524ee6b5c77e9e5001af0f85f3adbb8623255c" + integrity sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA== dependencies: bser "2.1.1" @@ -1363,14 +1352,14 @@ flat-cache@^3.0.4: rimraf "^3.0.2" flatted@^3.1.0: - version "3.2.5" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.5.tgz#76c8584f4fc843db64702a6bd04ab7a8bd666da3" - integrity sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg== + version "3.2.7" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" + integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== fsevents@^2.3.2: version "2.3.2" @@ -1424,14 +1413,14 @@ glob-parent@^6.0.1: is-glob "^4.0.3" glob@^7.1.3, glob@^7.1.4: - version "7.2.0" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" - integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" inherits "2" - minimatch "^3.0.4" + minimatch "^3.1.1" once "^1.3.0" path-is-absolute "^1.0.0" @@ -1441,9 +1430,9 @@ globals@^11.1.0: integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== globals@^13.15.0: - version "13.15.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.15.0.tgz#38113218c907d2f7e98658af246cef8b77e90bac" - integrity sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog== + version "13.17.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.17.0.tgz#902eb1e680a41da93945adbdcb5a9f361ba69bd4" + integrity sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw== dependencies: type-fest "^0.20.2" @@ -1472,7 +1461,7 @@ grapheme-splitter@^1.0.4: has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== has-flag@^4.0.0: version "4.0.0" @@ -1530,12 +1519,12 @@ import-local@^3.0.2: imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== dependencies: once "^1.3.0" wrappy "1" @@ -1548,19 +1537,19 @@ inherits@2: is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== -is-core-module@^2.8.1: - version "2.9.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.9.0.tgz#e1c34429cd51c6dd9e09e0799e396e27b19a9c69" - integrity sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A== +is-core-module@^2.9.0: + version "2.11.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144" + integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw== dependencies: has "^1.0.3" is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== is-fullwidth-code-point@^3.0.0: version "3.0.0" @@ -1592,7 +1581,7 @@ is-stream@^2.0.0: isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: version "3.2.0" @@ -1600,9 +1589,9 @@ istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.0.tgz#31d18bdd127f825dd02ea7bfdfd906f8ab840e9f" - integrity sha512-6Lthe1hqXHBNsqvgDzGO6l03XNeu3CrG4RqQ1KM9+l5+jNGpEJfIELx1NS3SEHmJQA8np/u+E4EPRKRiu6m19A== + version "5.2.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz#d10c8885c2125574e1c231cacadf955675e1ce3d" + integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg== dependencies: "@babel/core" "^7.12.3" "@babel/parser" "^7.14.7" @@ -1629,9 +1618,9 @@ istanbul-lib-source-maps@^4.0.0: source-map "^0.6.1" istanbul-reports@^3.1.3: - version "3.1.4" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.4.tgz#1b6f068ecbc6c331040aab5741991273e609e40c" - integrity sha512-r1/DshN4KSE7xWEknZLLLLDn5CJybV3nw01VTkp6D5jzLuELlcbudfj/eSQFvrKsJuTVCGnePO7ho82Nw9zzfw== + version "3.1.5" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.5.tgz#cc9a6ab25cb25659810e4785ed9d9fb742578bae" + integrity sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w== dependencies: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" @@ -1644,86 +1633,86 @@ jest-changed-files@^29.2.0: execa "^5.0.0" p-limit "^3.1.0" -jest-circus@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.2.0.tgz#692ddf3b12a5ae6326f2f37b9d176c68777fcf4c" - integrity sha512-bpJRMe+VtvYlF3q8JNx+/cAo4FYvNCiR5s7Z0Scf8aC+KJ2ineSjZKtw1cIZbythlplkiro0My8nc65pfCqJ3A== +jest-circus@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.2.1.tgz#1385353d9bca6acf58f916068bbeffcfc95bef02" + integrity sha512-W+ZQQ5ln4Db2UZNM4NJIeasnhCdDhSuYW4eLgNAUi0XiSSpF634Kc5wiPvGiHvTgXMFVn1ZgWIijqhi9+kLNLg== dependencies: - "@jest/environment" "^29.2.0" - "@jest/expect" "^29.2.0" - "@jest/test-result" "^29.2.0" - "@jest/types" "^29.2.0" + "@jest/environment" "^29.2.1" + "@jest/expect" "^29.2.1" + "@jest/test-result" "^29.2.1" + "@jest/types" "^29.2.1" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" is-generator-fn "^2.0.0" - jest-each "^29.2.0" - jest-matcher-utils "^29.2.0" - jest-message-util "^29.2.0" - jest-runtime "^29.2.0" - jest-snapshot "^29.2.0" - jest-util "^29.2.0" + jest-each "^29.2.1" + jest-matcher-utils "^29.2.1" + jest-message-util "^29.2.1" + jest-runtime "^29.2.1" + jest-snapshot "^29.2.1" + jest-util "^29.2.1" p-limit "^3.1.0" - pretty-format "^29.2.0" + pretty-format "^29.2.1" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.2.0.tgz#c6ca40889d6671c38b1cf9119d3b653809f31a3a" - integrity sha512-/581TzbXeO+5kbtSlhXEthGiVJCC8AP0jgT0iZINAAMW+tTFj2uWU7z+HNUH5yIYdHV7AvRr0fWLrmHJGIruHg== +jest-cli@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.2.1.tgz#fbfa90b87b27a04e1041cc9d33ee80f32e2f2528" + integrity sha512-UIMD5aNqvPKpdlJSaeUAoLfxsh9TZvOkaMETx5qXnkboc317bcbb0eLHbIj8sFBHdcJAIAM+IRKnIU7Wi61MBw== dependencies: - "@jest/core" "^29.2.0" - "@jest/test-result" "^29.2.0" - "@jest/types" "^29.2.0" + "@jest/core" "^29.2.1" + "@jest/test-result" "^29.2.1" + "@jest/types" "^29.2.1" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.2.0" - jest-util "^29.2.0" - jest-validate "^29.2.0" + jest-config "^29.2.1" + jest-util "^29.2.1" + jest-validate "^29.2.1" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.2.0.tgz#8823f35255f696444a882721e624d7ad352e208b" - integrity sha512-IkdCsrHIoxDPZAyFcdtQrCQ3uftLqns6Joj0tlbxiAQW4k/zTXmIygqWBmPNxO9FbFkDrhtYZiLHXjaJh9rS+Q== +jest-config@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.2.1.tgz#2182af014d6c73978208626335db5134803dd183" + integrity sha512-EV5F1tQYW/quZV2br2o88hnYEeRzG53Dfi6rSG3TZBuzGQ6luhQBux/RLlU5QrJjCdq3LXxRRM8F1LP6DN1ycA== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.2.0" - "@jest/types" "^29.2.0" - babel-jest "^29.2.0" + "@jest/test-sequencer" "^29.2.1" + "@jest/types" "^29.2.1" + babel-jest "^29.2.1" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^29.2.0" - jest-environment-node "^29.2.0" + jest-circus "^29.2.1" + jest-environment-node "^29.2.1" jest-get-type "^29.2.0" jest-regex-util "^29.2.0" - jest-resolve "^29.2.0" - jest-runner "^29.2.0" - jest-util "^29.2.0" - jest-validate "^29.2.0" + jest-resolve "^29.2.1" + jest-runner "^29.2.1" + jest-util "^29.2.1" + jest-validate "^29.2.1" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^29.2.0" + pretty-format "^29.2.1" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.2.0.tgz#b1e11ac1a1401fc4792ef8ba406b48f1ae7d2bc5" - integrity sha512-GsH07qQL+/D/GxlnU+sSg9GL3fBOcuTlmtr3qr2pnkiODCwubNN2/7slW4m3CvxDsEus/VEOfQKRFLyXsUlnZw== +jest-diff@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.2.1.tgz#027e42f5a18b693fb2e88f81b0ccab533c08faee" + integrity sha512-gfh/SMNlQmP3MOUgdzxPOd4XETDJifADpT937fN1iUGz+9DgOu2eUPHH25JDkLVcLwwqxv3GzVyK4VBUr9fjfA== dependencies: chalk "^4.0.0" diff-sequences "^29.2.0" jest-get-type "^29.2.0" - pretty-format "^29.2.0" + pretty-format "^29.2.1" jest-docblock@^29.2.0: version "29.2.0" @@ -1732,94 +1721,94 @@ jest-docblock@^29.2.0: dependencies: detect-newline "^3.0.0" -jest-each@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.2.0.tgz#0f89c1233d65f22c7dba265ccd319611f1d662de" - integrity sha512-h4LeC3L/R7jIMfTdYowevPIssvcPYQ7Qzs+pCSYsJgPztIizXwKmnfhZXBA4WVqdmvMcpmseYEXb67JT7IJ2eg== +jest-each@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.2.1.tgz#6b0a88ee85c2ba27b571a6010c2e0c674f5c9b29" + integrity sha512-sGP86H/CpWHMyK3qGIGFCgP6mt+o5tu9qG4+tobl0LNdgny0aitLXs9/EBacLy3Bwqy+v4uXClqJgASJWcruYw== dependencies: - "@jest/types" "^29.2.0" + "@jest/types" "^29.2.1" chalk "^4.0.0" jest-get-type "^29.2.0" - jest-util "^29.2.0" - pretty-format "^29.2.0" + jest-util "^29.2.1" + pretty-format "^29.2.1" -jest-environment-node@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.2.0.tgz#49c39d4f9df64fc74da3725cbcaeee6da01a6dd6" - integrity sha512-b4qQGVStPMvtZG97Ac0rvnmSIjCZturFU7MQRMp4JDFl7zoaDLTtXmFjFP1tNmi9te6kR8d+Htbv3nYeoaIz6g== +jest-environment-node@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.2.1.tgz#f90311d0f0e8ef720349f83c97a076e403f90665" + integrity sha512-PulFKwEMz6nTAdLUwglFKei3b/LixwlRiqTN6nvPE1JtrLtlnpd6LXnFI1NFHYJGlTmIWilMP2n9jEtPPKX50g== dependencies: - "@jest/environment" "^29.2.0" - "@jest/fake-timers" "^29.2.0" - "@jest/types" "^29.2.0" + "@jest/environment" "^29.2.1" + "@jest/fake-timers" "^29.2.1" + "@jest/types" "^29.2.1" "@types/node" "*" - jest-mock "^29.2.0" - jest-util "^29.2.0" + jest-mock "^29.2.1" + jest-util "^29.2.1" jest-get-type@^29.2.0: version "29.2.0" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.2.0.tgz#726646f927ef61d583a3b3adb1ab13f3a5036408" integrity sha512-uXNJlg8hKFEnDgFsrCjznB+sTxdkuqiCL6zMgA75qEbAJjJYTs9XPrvDctrEig2GDow22T/LvHgO57iJhXB/UA== -jest-haste-map@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.2.0.tgz#2410f2ec93958e0bd894818de6c8056eb1b4d6fc" - integrity sha512-qu9lGFi7qJ8v37egS1phZZUJYiMyWnKwu83NlNT1qs50TbedIX2hFl+9ztsJ7U/ENaHwk1/Bs8fqOIQsScIRwg== +jest-haste-map@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.2.1.tgz#f803fec57f8075e6c55fb5cd551f99a72471c699" + integrity sha512-wF460rAFmYc6ARcCFNw4MbGYQjYkvjovb9GBT+W10Um8q5nHq98jD6fHZMDMO3tA56S8XnmNkM8GcA8diSZfnA== dependencies: - "@jest/types" "^29.2.0" + "@jest/types" "^29.2.1" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" jest-regex-util "^29.2.0" - jest-util "^29.2.0" - jest-worker "^29.2.0" + jest-util "^29.2.1" + jest-worker "^29.2.1" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.2.0.tgz#7c0eace293cf05a130a09beb1b9318ecc2f77692" - integrity sha512-FXT9sCFdct42+oOqGIr/9kmUw3RbhvpkwidCBT5ySHHoWNGd3c9n7HXpFKjEz9UnUITRCGdn0q2s6Sxrq36kwg== +jest-leak-detector@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.2.1.tgz#ec551686b7d512ec875616c2c3534298b1ffe2fc" + integrity sha512-1YvSqYoiurxKOJtySc+CGVmw/e1v4yNY27BjWTVzp0aTduQeA7pdieLiW05wTYG/twlKOp2xS/pWuikQEmklug== dependencies: jest-get-type "^29.2.0" - pretty-format "^29.2.0" + pretty-format "^29.2.1" -jest-matcher-utils@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.2.0.tgz#d1d73add0e0efb0e316a50f296977505dc053e02" - integrity sha512-FcEfKZ4vm28yCdBsvC69EkrEhcfex+IYlRctNJXsRG9+WC3WxgBNORnECIgqUtj7o/h1d8o7xB/dFUiLi4bqtw== +jest-matcher-utils@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.2.1.tgz#2bf876c5f891b33786aadf5d65d5da5970744122" + integrity sha512-hUTBh7H/Mnb6GTpihbLh8uF5rjAMdekfW/oZNXUMAXi7bbmym2HiRpzgqf/zzkjgejMrVAkPdVSQj+32enlUww== dependencies: chalk "^4.0.0" - jest-diff "^29.2.0" + jest-diff "^29.2.1" jest-get-type "^29.2.0" - pretty-format "^29.2.0" + pretty-format "^29.2.1" -jest-message-util@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.2.0.tgz#cbd43fd9a20a8facd4267ac37556bc5c9a525ec0" - integrity sha512-arBfk5yMFMTnMB22GyG601xGSGthA02vWSewPaxoFo0F9wBqDOyxccPbCcYu8uibw3kduSHXdCOd1PsLSgdomg== +jest-message-util@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.2.1.tgz#3a51357fbbe0cc34236f17a90d772746cf8d9193" + integrity sha512-Dx5nEjw9V8C1/Yj10S/8ivA8F439VS8vTq1L7hEgwHFn9ovSKNpYW/kwNh7UglaEgXO42XxzKJB+2x0nSglFVw== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.2.0" + "@jest/types" "^29.2.1" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^29.2.0" + pretty-format "^29.2.1" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.2.0.tgz#3531012881178f59f4b5fd1e243acc329d08d6a1" - integrity sha512-aiWGR0P8ivssIO17xkehLGFtCcef2ZwQFNPwEer1jQLHxPctDlIg3Hs6QMq1KpPz5dkCcgM7mwGif4a9IPznlg== +jest-mock@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.2.1.tgz#a0d361cffcb28184fa9c5443adbf591fa5759775" + integrity sha512-NDphaY/GqyQpTfnTZiTqqpMaw4Z0I7XnB7yBgrT6IwYrLGxpOhrejYr4ANY4YvO2sEGdd8Tx/6D0+WLQy7/qDA== dependencies: - "@jest/types" "^29.2.0" + "@jest/types" "^29.2.1" "@types/node" "*" - jest-util "^29.2.0" + jest-util "^29.2.1" jest-pnp-resolver@^1.2.2: version "1.2.2" @@ -1831,88 +1820,88 @@ jest-regex-util@^29.2.0: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.2.0.tgz#82ef3b587e8c303357728d0322d48bbfd2971f7b" integrity sha512-6yXn0kg2JXzH30cr2NlThF+70iuO/3irbaB4mh5WyqNIvLLP+B6sFdluO1/1RJmslyh/f9osnefECflHvTbwVA== -jest-resolve-dependencies@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.2.0.tgz#a127b7d6b7df69d4eaf2c7c99f652f17ba0fed71" - integrity sha512-Cd0Z39sDntEnfR9PoUdFHUAGDvtKI0/7Wt73l3lt03A3yQ+A6Qi3XmBuqGjdFl2QbXaPa937oLhilG612P8HGQ== +jest-resolve-dependencies@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.2.1.tgz#8d717dd41dc615fef1d412d395ea3deccfb1b9fa" + integrity sha512-o3mUGX2j08usj1jIAIE8KmUVpqVAn54k80kI27ldbZf2oJn6eghhB6DvJxjrcH40va9CQgWTfU5f2Ag/MoUqgQ== dependencies: jest-regex-util "^29.2.0" - jest-snapshot "^29.2.0" + jest-snapshot "^29.2.1" -jest-resolve@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.2.0.tgz#cb9f9770164382785cd68598a9fb0b7e4bb95a9f" - integrity sha512-f5c0ljNg2guDBCC7wi92vAhNuA0BtAG5vkY7Fob0c7sUMU1g87mTXqRmjrVFe2XvdwP5m5T/e5KJsCKu9hRvBA== +jest-resolve@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.2.1.tgz#a4d2f76db88aeb6ec5f5453c9a40b52483d17799" + integrity sha512-1dJTW76Z9622Viq4yRcwBuEXuzGtE9B2kdl05RC8Om/lAzac9uEgC+M8Q5osVidbuBPmxm8wSrcItYhca2ZAtQ== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^29.2.0" + jest-haste-map "^29.2.1" jest-pnp-resolver "^1.2.2" - jest-util "^29.2.0" - jest-validate "^29.2.0" + jest-util "^29.2.1" + jest-validate "^29.2.1" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.2.0.tgz#d621e67a2d59d5bc302eca1f5348615ce166712c" - integrity sha512-VPBrCwl9fM2mc5yk6yZhNrgXzRJMD5jfLmntkMLlrVq4hQPWbRK998iJlR+DOGCO04TC9PPYLntOJ001Vnf28g== - dependencies: - "@jest/console" "^29.2.0" - "@jest/environment" "^29.2.0" - "@jest/test-result" "^29.2.0" - "@jest/transform" "^29.2.0" - "@jest/types" "^29.2.0" +jest-runner@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.2.1.tgz#885afe64661cb2f51f84c1b97afb713d1093c124" + integrity sha512-PojFI+uVhQ4u4YZKCN/a3yU0/l/pJJXhq1sW3JpCp8CyvGBYGddRFPKZ1WihApusxqWRTHjBJmGyPWv6Av2lWA== + dependencies: + "@jest/console" "^29.2.1" + "@jest/environment" "^29.2.1" + "@jest/test-result" "^29.2.1" + "@jest/transform" "^29.2.1" + "@jest/types" "^29.2.1" "@types/node" "*" chalk "^4.0.0" emittery "^0.10.2" graceful-fs "^4.2.9" jest-docblock "^29.2.0" - jest-environment-node "^29.2.0" - jest-haste-map "^29.2.0" - jest-leak-detector "^29.2.0" - jest-message-util "^29.2.0" - jest-resolve "^29.2.0" - jest-runtime "^29.2.0" - jest-util "^29.2.0" - jest-watcher "^29.2.0" - jest-worker "^29.2.0" + jest-environment-node "^29.2.1" + jest-haste-map "^29.2.1" + jest-leak-detector "^29.2.1" + jest-message-util "^29.2.1" + jest-resolve "^29.2.1" + jest-runtime "^29.2.1" + jest-util "^29.2.1" + jest-watcher "^29.2.1" + jest-worker "^29.2.1" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.2.0.tgz#6b10d9539c1f7af32d06fccd7d16b6c9996c9cb2" - integrity sha512-+GDmzCrswQF+mvI0upTYMe/OPYnlRRNLLDHM9AFLp2y7zxWoDoYgb8DL3WwJ8d9m743AzrnvBV9JQHi/0ed7dg== +jest-runtime@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.2.1.tgz#62e3a23c33710ae4d9c3304dda851a5fb225b574" + integrity sha512-PSQ880OoIW9y8E6/jjhGn3eQNgNc6ndMzCZaKqy357bv7FqCfSyYepu3yDC6Sp1Vkt+GhP2M/PVgldS2uZSFZg== dependencies: - "@jest/environment" "^29.2.0" - "@jest/fake-timers" "^29.2.0" - "@jest/globals" "^29.2.0" + "@jest/environment" "^29.2.1" + "@jest/fake-timers" "^29.2.1" + "@jest/globals" "^29.2.1" "@jest/source-map" "^29.2.0" - "@jest/test-result" "^29.2.0" - "@jest/transform" "^29.2.0" - "@jest/types" "^29.2.0" + "@jest/test-result" "^29.2.1" + "@jest/transform" "^29.2.1" + "@jest/types" "^29.2.1" "@types/node" "*" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^29.2.0" - jest-message-util "^29.2.0" - jest-mock "^29.2.0" + jest-haste-map "^29.2.1" + jest-message-util "^29.2.1" + jest-mock "^29.2.1" jest-regex-util "^29.2.0" - jest-resolve "^29.2.0" - jest-snapshot "^29.2.0" - jest-util "^29.2.0" + jest-resolve "^29.2.1" + jest-snapshot "^29.2.1" + jest-util "^29.2.1" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.2.0.tgz#fb3d4e1d9df579f37d7c60072877ee99376b6090" - integrity sha512-YCKrOR0PLRXROmww73fHO9oeY4tL+LPQXWR3yml1+hKbQDR8j1VUrVzB65hKSJJgxBOr1vWx+hmz2by8JjAU5w== +jest-snapshot@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.2.1.tgz#f3843b3099c8fec7e6218dea18cc506f10ea5d30" + integrity sha512-KZdLD7iEz5M4ZYd+ezZ/kk73z+DtNbk/yJ4Qx7408Vb0CCuclJIZPa/HmIwSsCfIlOBNcYTKufr7x/Yv47oYlg== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" @@ -1920,87 +1909,87 @@ jest-snapshot@^29.2.0: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.2.0" - "@jest/transform" "^29.2.0" - "@jest/types" "^29.2.0" + "@jest/expect-utils" "^29.2.1" + "@jest/transform" "^29.2.1" + "@jest/types" "^29.2.1" "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.2.0" + expect "^29.2.1" graceful-fs "^4.2.9" - jest-diff "^29.2.0" + jest-diff "^29.2.1" jest-get-type "^29.2.0" - jest-haste-map "^29.2.0" - jest-matcher-utils "^29.2.0" - jest-message-util "^29.2.0" - jest-util "^29.2.0" + jest-haste-map "^29.2.1" + jest-matcher-utils "^29.2.1" + jest-message-util "^29.2.1" + jest-util "^29.2.1" natural-compare "^1.4.0" - pretty-format "^29.2.0" + pretty-format "^29.2.1" semver "^7.3.5" -jest-util@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.2.0.tgz#797935697e83a5722aeba401ed6cd01264295566" - integrity sha512-8M1dx12ujkBbnhwytrezWY0Ut79hbflwodE+qZKjxSRz5qt4xDp6dQQJaOCFvCmE0QJqp9KyEK33lpPNjnhevw== +jest-util@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.2.1.tgz#f26872ba0dc8cbefaba32c34f98935f6cf5fc747" + integrity sha512-P5VWDj25r7kj7kl4pN2rG/RN2c1TLfYYYZYULnS/35nFDjBai+hBeo3MDrYZS7p6IoY3YHZnt2vq4L6mKnLk0g== dependencies: - "@jest/types" "^29.2.0" + "@jest/types" "^29.2.1" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.2.0.tgz#e40faf33759365c12ead6a45165349d660d09ba4" - integrity sha512-4Vl51bPNeFeDok9aJiOnrC6tqJbOp4iMCYlewoC2ZzYJZ5+6pfr3KObAdx5wP8auHcg2MRaguiqj5OdScZa72g== +jest-validate@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.2.1.tgz#db814ce12c4c7e4746044922762e56eb177d066c" + integrity sha512-DZVX5msG6J6DL5vUUw+++6LEkXUsPwB5R7fsfM7BXdz2Ipr0Ib046ak+8egrwAR++pvSM/5laxLK977ieIGxkQ== dependencies: - "@jest/types" "^29.2.0" + "@jest/types" "^29.2.1" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^29.2.0" leven "^3.1.0" - pretty-format "^29.2.0" + pretty-format "^29.2.1" -jest-watcher@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.2.0.tgz#d0c58ff76d3dd22fff79f3f9cbeadaa749d2ca6e" - integrity sha512-bRh0JdUeN+cl9XfK7tMnXLm4Mv70hG2SZlqbkFe5CTs7oeCkbwlGBk/mEfEJ63mrxZ8LPbnfaMpfSmkhEQBEGA== +jest-watcher@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.2.1.tgz#1cb91f8aa9e77b1332af139944ad65e51430d7c3" + integrity sha512-7jFaHUaRq50l4w/f6RuY713bvI5XskMmjWCE54NGYcY74fLkShS8LucXJke1QfGnwDSCoIqGnGGGKPwdaBYz2Q== dependencies: - "@jest/test-result" "^29.2.0" - "@jest/types" "^29.2.0" + "@jest/test-result" "^29.2.1" + "@jest/types" "^29.2.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.10.2" - jest-util "^29.2.0" + jest-util "^29.2.1" string-length "^4.0.1" -jest-worker@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.2.0.tgz#b2bd1a81fc7a1ae79a500b05f5feb0d1c0b1a19e" - integrity sha512-mluOlMbRX1H59vGVzPcVg2ALfCausbBpxC8a2KWOzInhYHZibbHH8CB0C1JkmkpfurrkOYgF7FPmypuom1OM9A== +jest-worker@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.2.1.tgz#8ba68255438252e1674f990f0180c54dfa26a3b1" + integrity sha512-ROHTZ+oj7sBrgtv46zZ84uWky71AoYi0vEV9CdEtc1FQunsoAGe5HbQmW76nI5QWdvECVPrSi1MCVUmizSavMg== dependencies: "@types/node" "*" - jest-util "^29.2.0" + jest-util "^29.2.1" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^29.0.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.2.0.tgz#e7997bc603f31e04edbbe87dd24cf6e7c432abac" - integrity sha512-6krPemKUXCEu5Fh3j6ZVoLMjpTQVm0OCU+7f3K/9gllX8wNIE6NSCQ6s0q2RDoiKLRaQlVRHyscjSPRPqCI0Fg== + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.2.1.tgz#352ec0b81a0e436691d546d984cd7d8f72ffd26a" + integrity sha512-K0N+7rx+fv3Us3KhuwRSJt55MMpZPs9Q3WSO/spRZSnsalX8yEYOTQ1PiSN7OvqzoRX4JEUXCbOJRlP4n8m5LA== dependencies: - "@jest/core" "^29.2.0" - "@jest/types" "^29.2.0" + "@jest/core" "^29.2.1" + "@jest/types" "^29.2.1" import-local "^3.0.2" - jest-cli "^29.2.0" + jest-cli "^29.2.1" js-sdsl@^4.1.4: - version "4.1.4" - resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.1.4.tgz#78793c90f80e8430b7d8dc94515b6c77d98a26a6" - integrity sha512-Y2/yD55y5jteOAmY50JbUZYwk3CP3wnLPEZnlR1w9oKhITrBEtAxwuWKebFf8hMrPMgbYwFoWK/lH2sBkErELw== + version "4.1.5" + resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.1.5.tgz#1ff1645e6b4d1b028cd3f862db88c9d887f26e2a" + integrity sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q== js-tokens@^4.0.0: version "4.0.0" @@ -2040,7 +2029,7 @@ json-schema-traverse@^0.4.1: json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== json5@^2.2.1: version "2.2.1" @@ -2133,7 +2122,7 @@ mimic-fn@^2.1.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== -minimatch@^3.0.4, minimatch@^3.1.2: +minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -2164,17 +2153,17 @@ multimatch@^4.0.0: natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" - integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= + integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== -node-releases@^2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.4.tgz#f38252370c43854dc48aa431c766c6c398f40476" - integrity sha512-gbMzqQtTtDz/00jQzZ21PQzdI9PyLYqUSvD0p3naOhX4odFji0ZxYdnVwPTxmSwkmxhcFImpozceidSG+AgoPQ== +node-releases@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.6.tgz#8a7088c63a55e493845683ebf3c828d8c51c5503" + integrity sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg== normalize-path@^3.0.0: version "3.0.0" @@ -2191,7 +2180,7 @@ npm-run-path@^4.0.0, npm-run-path@^4.0.1: once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== dependencies: wrappy "1" @@ -2272,7 +2261,7 @@ path-exists@^4.0.0: path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== path-key@^3.0.0, path-key@^3.1.0: version "3.1.1" @@ -2321,10 +2310,10 @@ prettier@>=3.0.0-alpha.2: resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0-alpha.2.tgz#b2e7698f8feb420e2e4347e19e9b7535d8188977" integrity sha512-GTYhS1pykp0vIoV8ySOvBxc/SFAoot2rOir/QCh1KQXWYdrS9q/k73uKbwXPuUDMlcwZAasuyI0Mg7PZ1p/qRQ== -pretty-format@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.2.0.tgz#1d4ea56fb46079b44efd9ed59c14f70f2950a61b" - integrity sha512-QCSUFdwOi924g24czhOH5eTkXxUCqlLGZBRCySlwDYHIXRJkdGyjJc9nZaqhlFBZws8dq5Dvk0lCilsmlfsPxw== +pretty-format@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.2.1.tgz#86e7748fe8bbc96a6a4e04fa99172630907a9611" + integrity sha512-Y41Sa4aLCtKAXvwuIpTvcFBkyeYp2gdFWzXGA+ZNES3VwURIB165XO/z7CjETwzCCS53MjW/rLMyyqEnTtaOfA== dependencies: "@jest/schemas" "^29.0.0" ansi-styles "^5.0.0" @@ -2369,9 +2358,9 @@ queue-microtask@^1.2.2: integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== react-is@^18.0.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.1.0.tgz#61aaed3096d30eacf2a2127118b5b41387d32a67" - integrity sha512-Fl7FuabXsJnV5Q1qIOQwx/sagGF18kogb4gpfcG4gjLBWO0WDiiz1ko/ExayuxE7InyQkBLkxRFG5oxY6Uu3Kg== + version "18.2.0" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" + integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== regexpp@^3.2.0: version "3.2.0" @@ -2381,7 +2370,7 @@ regexpp@^3.2.0: require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== resolve-cwd@^3.0.0: version "3.0.0" @@ -2406,11 +2395,11 @@ resolve.exports@^1.1.0: integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== resolve@^1.20.0: - version "1.22.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198" - integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== + version "1.22.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" + integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== dependencies: - is-core-module "^2.8.1" + is-core-module "^2.9.0" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" @@ -2433,20 +2422,15 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - semver@^6.0.0, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== semver@^7.3.5: - version "7.3.7" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" - integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== + version "7.3.8" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" + integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== dependencies: lru-cache "^6.0.0" @@ -2493,7 +2477,7 @@ source-map@^0.6.0, source-map@^0.6.1: sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== stack-utils@^2.0.3: version "2.0.5" @@ -2579,7 +2563,7 @@ test-exclude@^6.0.0: text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= + integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== tmpl@1.0.5: version "1.0.5" @@ -2589,7 +2573,7 @@ tmpl@1.0.5: to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= + integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== to-regex-range@^5.0.1: version "5.0.1" @@ -2620,6 +2604,14 @@ type-fest@^0.21.3: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== +update-browserslist-db@^1.0.9: + version "1.0.10" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz#0f54b876545726f17d00cd9a2561e6dade943ff3" + integrity sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ== + dependencies: + escalade "^3.1.1" + picocolors "^1.0.0" + uri-js@^4.2.2: version "4.4.1" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" @@ -2667,12 +2659,12 @@ wrap-ansi@^7.0.0: wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== write-file-atomic@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-4.0.1.tgz#9faa33a964c1c85ff6f849b80b42a88c2c537c8f" - integrity sha512-nSKUxgAbyioruk6hU87QzVbY279oYT6uiwgDoujth2ju4mJ+TZau7SQBhtbTmUyuNYTuXnSyRn66FV0+eCgcrQ== + version "4.0.2" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-4.0.2.tgz#a9df01ae5b77858a027fd2e80768ee433555fcfd" + integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg== dependencies: imurmurhash "^0.1.4" signal-exit "^3.0.7" @@ -2688,16 +2680,16 @@ yallist@^4.0.0: integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== yargs-parser@^21.0.0: - version "21.0.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.0.1.tgz#0267f286c877a4f0f728fceb6f8a3e4cb95c6e35" - integrity sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg== + version "21.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" + integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== yargs@^17.3.1: - version "17.5.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.5.0.tgz#2706c5431f8c119002a2b106fc9f58b9bb9097a3" - integrity sha512-3sLxVhbAB5OC8qvVRebCLWuouhwh/rswsiDYx3WGxajUk/l4G20SKfrKKFeNIHboUFt2JFgv2yfn+5cgOr/t5A== + version "17.6.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.6.0.tgz#e134900fc1f218bc230192bdec06a0a5f973e46c" + integrity sha512-8H/wTDqlSwoSnScvV2N/JHfLWOKuh5MVla9hqLjK3nsfyy6Y4kDSYSvkU5YCUEPOSnRXfIyx3Sq+B/IWudTo4g== dependencies: - cliui "^7.0.2" + cliui "^8.0.1" escalade "^3.1.1" get-caller-file "^2.0.5" require-directory "^2.1.1" From 123b7aea59d3502707bdbfcd9598ac7fbe28fd2b Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 19 Oct 2022 13:17:37 -0400 Subject: [PATCH 658/785] Do not kill the process when the test runner exits --- .github/workflows/main.yml | 27 ++++----------------------- src/parse.js | 37 +++++++++++++++++++------------------ src/server.rb | 6 +++--- test/js/globalSetup.js | 22 ++++++++++++---------- test/js/globalTeardown.js | 15 ++++++++++++--- 5 files changed, 50 insertions(+), 57 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 19603cab..34c59f58 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,6 +2,7 @@ name: Main on: - push - pull_request + jobs: ci: name: CI @@ -17,15 +18,13 @@ jobs: - "3.0" - "3.1" runs-on: ${{ matrix.platform }} - env: - PLUGIN_RUBY_CI: true steps: - uses: actions/checkout@main - uses: ruby/setup-ruby@v1 with: bundler-cache: true ruby-version: ${{ matrix.ruby }} - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v3 with: node-version: 18.x cache: yarn @@ -33,34 +32,18 @@ jobs: - run: yarn test - run: bundle exec rake test - windows: - name: Windows - runs-on: windows-latest - env: - PLUGIN_RUBY_CI: true - steps: - - uses: actions/checkout@main - - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true - ruby-version: '3.1' - - run: timeout -k 2 2 bundle exec ruby src/server.rb --plugins= file.txt || ls - - run: cat file.txt - lint: name: Lint runs-on: ubuntu-latest - env: - PLUGIN_RUBY_CI: true steps: - uses: actions/checkout@main - uses: ruby/setup-ruby@v1 with: bundler-cache: true ruby-version: "3.0" - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: 18.x cache: yarn - run: yarn install --frozen-lockfile - run: yarn checkFormat @@ -79,8 +62,6 @@ jobs: # - 2.x # - 3.x # runs-on: ${{ matrix.platform }} - # env: - # PLUGIN_RUBY_CI: true # steps: # - uses: actions/checkout@main # - uses: ruby/setup-ruby@v1 diff --git a/src/parse.js b/src/parse.js index 97543038..b829186a 100644 --- a/src/parse.js +++ b/src/parse.js @@ -64,7 +64,7 @@ function getPlugins(opts) { // Create a file that will act as a communication mechanism, spawn a parser // server with that filepath as an argument, then wait for the file to be // created that will contain the connection information. -export async function spawnServer(opts) { +export async function spawnServer(opts, killOnExit = true) { const tmpdir = os.tmpdir(); let serverFilepath = url.fileURLToPath( new URL("./server.rb", import.meta.url) @@ -95,25 +95,25 @@ export async function spawnServer(opts) { server.unref(); - process.on("exit", () => { - if (fs.existsSync(filepath)) { - fs.unlinkSync(filepath); - } - - try { - if (server.pid) { - // Kill the server process if it's still running. If we're on windows - // we're going to use the process ID number. If we're not, we're going - // to use the negative process ID to indicate the group. - const pid = process.platform === "win32" ? server.pid : -server.pid; - process.kill(pid); + if (killOnExit) { + process.on("exit", () => { + if (fs.existsSync(filepath)) { + fs.unlinkSync(filepath); } - } catch (error) { - if (process.env.PLUGIN_RUBY_CI) { - throw new Error(`Failed to kill the parser server: ${error}`); + + try { + if (server.pid) { + // Kill the server process if it's still running. If we're on windows + // we're going to use the process ID number. If we're not, we're going + // to use the negative process ID to indicate the group. + const pid = process.platform === "win32" ? server.pid : -server.pid; + process.kill(pid); + } + } catch (error) { + // If there's an error killing the process, we're going to ignore it. } - } - }); + }); + } return new Promise((resolve, reject) => { const timeout = setTimeout( @@ -132,6 +132,7 @@ export async function spawnServer(opts) { if (fs.existsSync(filepath)) { resolve({ serverPID: server.pid, + connectionFilepath: filepath, connectionOptions: JSON.parse( fs.readFileSync(filepath).toString("utf-8") ) diff --git a/src/server.rb b/src/server.rb index f3c1336e..e0191853 100644 --- a/src/server.rb +++ b/src/server.rb @@ -29,9 +29,9 @@ connection_information = if Gem.win_platform? - # If we're on windows, we're going to start up a TCP server. The 0 here means - # to bind to some available port. - server = TCPServer.new("0.0.0.0", 0) + # If we're on windows, we're going to start up a TCP server. The 0 here + # means to bind to some available port. + server = TCPServer.new(0) address = server.local_address # Ensure that we close the server when this process exits. diff --git a/test/js/globalSetup.js b/test/js/globalSetup.js index f9e3dc49..768f2d82 100644 --- a/test/js/globalSetup.js +++ b/test/js/globalSetup.js @@ -7,21 +7,23 @@ import { spawnServer } from "../../src/parse.js"; async function globalSetup() { // Set a RUBY_VERSION environment variable because certain tests will only run // for certain versions of Ruby. - process.env.RUBY_VERSION = spawnSync("ruby", [ - "--disable-gems", - "-e", - "puts RUBY_VERSION" - ]) + const args = ["--disable-gems", "-e", "puts RUBY_VERSION"]; + process.env.RUBY_VERSION = spawnSync("ruby", args) .stdout.toString("utf-8") .trim(); - const { serverPID, connectionOptions } = await spawnServer({ - rubyPlugins: "", - rubySingleQuote: false, - trailingComma: "none" - }); + const { serverPID, connectionFilepath, connectionOptions } = + await spawnServer( + { + rubyPlugins: "", + rubySingleQuote: false, + trailingComma: "none" + }, + false + ); process.env.PRETTIER_RUBY_PID = serverPID; + process.env.PRETTIER_RUBY_FILE = connectionFilepath; process.env.PRETTIER_RUBY_HOST = JSON.stringify(connectionOptions); } diff --git a/test/js/globalTeardown.js b/test/js/globalTeardown.js index bcf486c7..c51948b9 100644 --- a/test/js/globalTeardown.js +++ b/test/js/globalTeardown.js @@ -1,16 +1,25 @@ +import fs from "fs"; + // If a parse server was successfully spawned, then its process ID will be in // the PRETTIER_RUBY_PID environment variable. At the end of the test suite we // should send a kill signal to it. function globalTeardown() { const serverPID = process.env.PRETTIER_RUBY_PID; + const connectionFilepath = process.env.PRETTIER_RUBY_FILE; if (serverPID) { try { - process.kill(parseInt(serverPID, 10), "SIGINT"); - } catch (e) { - throw new Error("Failed to kill the parser process in globalTeardown."); + const pid = process.platform === "win32" ? serverPID : -serverPID; + process.kill(pid, "SIGINT"); + } catch (error) { + console.error("Failed to kill the parser process in globalTeardown."); + throw error; } } + + if (fs.existsSync(connectionFilepath)) { + fs.unlinkSync(connectionFilepath); + } } export default globalTeardown; From ee5c084f3e19a38d760bcee274923592ffb89941 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 19 Oct 2022 14:25:32 -0400 Subject: [PATCH 659/785] Increase default timeout --- src/parse.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parse.js b/src/parse.js index b829186a..1f02abdd 100644 --- a/src/parse.js +++ b/src/parse.js @@ -121,11 +121,11 @@ export async function spawnServer(opts, killOnExit = true) { clearInterval(interval); reject( new Error( - "Failed to get connection options from parse server in time. If this happens repeatedly, try increasing the PRETTIER_RUBY_TIMEOUT_MS environment variable beyond 5000." + "Failed to get connection options from parse server in time. If this happens repeatedly, try increasing the PRETTIER_RUBY_TIMEOUT_MS environment variable beyond 10000." ) ); }, - parseInt(process.env.PRETTIER_RUBY_TIMEOUT_MS || "5000", 10) + parseInt(process.env.PRETTIER_RUBY_TIMEOUT_MS || "10000", 10) ); const interval = setInterval(() => { From 984ec59b8aad9b528738c99e71172d3f25b06f7a Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 19 Oct 2022 14:26:37 -0400 Subject: [PATCH 660/785] Simplify github actions workflow --- .github/workflows/auto-merge.yml | 22 +++++++++++++ .github/workflows/automerge.yml | 54 -------------------------------- .github/workflows/main.yml | 19 ----------- 3 files changed, 22 insertions(+), 73 deletions(-) create mode 100644 .github/workflows/auto-merge.yml delete mode 100644 .github/workflows/automerge.yml diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml new file mode 100644 index 00000000..9b28abf4 --- /dev/null +++ b/.github/workflows/auto-merge.yml @@ -0,0 +1,22 @@ +name: Dependabot auto-merge +on: pull_request + +permissions: + contents: write + pull-requests: write + +jobs: + dependabot: + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' }} + steps: + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v1.3.3 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - name: Enable auto-merge for Dependabot PRs + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml deleted file mode 100644 index c18c8ca4..00000000 --- a/.github/workflows/automerge.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Auto Merge pull requests - -# read-write repo token -# access to secrets -on: - workflow_run: - workflows: ["Main"] - types: - - completed - -jobs: - automerge: - runs-on: ubuntu-latest - # Only run if workflow completed successfully in a pull request made by dependabot - if: > - github.event.workflow_run.event == 'pull_request' && - github.event.workflow_run.conclusion == 'success' && - github.event.sender.login == 'dependabot[bot]' - steps: - - name: "Download artifact" - uses: actions/github-script@v3 - with: - # Artifact unzip code based on code in - # https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ - script: | - var artifacts = await github.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: ${{github.event.workflow_run.id }}, - }); - var matchArtifact = artifacts.data.artifacts.filter((artifact) => { - return artifact.name == "save-pr-info" - })[0]; - var download = await github.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, - archive_format: 'zip', - }); - var fs = require('fs'); - fs.writeFileSync('${{github.workspace}}/save-pr-info.zip', Buffer.from(download.data)); - - run: unzip save-pr-info.zip - - name: "Merge pull request" - uses: actions/github-script@v3 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - var fs = require('fs'); - var issue_number = Number(fs.readFileSync('./PULL_REQUEST_NUMBER')); - await github.pulls.merge({ - owner: context.payload.repository.owner.login, - repo: context.payload.repository.name, - pull_number: issue_number - }) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 34c59f58..d3d95106 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -108,22 +108,3 @@ jobs: - run: gem build -o prettier.gem - run: gem unpack prettier.gem - run: prettier/exe/rbprettier --help - - # Saves pull request details for later workflow runs which can run in - # a privileged environment - save-pr-info: - name: Save PR info - needs: - - ci - - lint - runs-on: ubuntu-latest - if: github.event_name == 'pull_request' - steps: - - name: Save PR number - run: | - mkdir -p ./save-pr-info - echo ${{ github.event.number }} > ./save-pr-info/PULL_REQUEST_NUMBER - - uses: actions/upload-artifact@v2 - with: - name: save-pr-info - path: save-pr-info/ From 2a1e2c8c08ff520d5fa844c80a3317d06b787eb3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Oct 2022 12:02:58 +0000 Subject: [PATCH 661/785] Bump prettier from 3.0.0-alpha.2 to 3.0.0-alpha.3 Bumps [prettier](https://github.com/prettier/prettier) from 3.0.0-alpha.2 to 3.0.0-alpha.3. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/3.0.0-alpha.2...3.0.0-alpha.3) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4fb99fc8..4704e388 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2306,9 +2306,9 @@ prelude-ls@^1.2.1: integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== prettier@>=3.0.0-alpha.2: - version "3.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0-alpha.2.tgz#b2e7698f8feb420e2e4347e19e9b7535d8188977" - integrity sha512-GTYhS1pykp0vIoV8ySOvBxc/SFAoot2rOir/QCh1KQXWYdrS9q/k73uKbwXPuUDMlcwZAasuyI0Mg7PZ1p/qRQ== + version "3.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0-alpha.3.tgz#21c35c12792dc0e1d04dd00efe0976f383928f58" + integrity sha512-gYWrMcU3iMwG+PSPU2KnprIKslFDW+mslyA8DCrCASO9z1+rEog82WzoYtP7Kh7QglVepKjl94iJFfRPTens2A== pretty-format@^29.2.1: version "29.2.1" From 714d55972f1c1f1e644868fe77e210fb6d4be77e Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 20 Oct 2022 09:40:46 -0400 Subject: [PATCH 662/785] Remove no longer relevant doc script --- bin/doc.js | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100755 bin/doc.js diff --git a/bin/doc.js b/bin/doc.js deleted file mode 100755 index 857147f5..00000000 --- a/bin/doc.js +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env node - -import { existsSync, readFileSync } from "fs"; -import { __debug } from "prettier"; -import plugin from "../src/plugin.js"; - -const code = existsSync(process.argv[2]) - ? readFileSync(process.argv[2], "utf-8") - : process.argv.slice(2).join(" ").replace(/\\n/g, "\n"); - -const doc = __debug.printToDoc(code, { parser: "ruby", plugins: [plugin] }); -console.log(__debug.formatDoc(doc)); From 0634e566fe67d7770e50544b19ca79a434213f92 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 20 Oct 2022 09:48:32 -0400 Subject: [PATCH 663/785] A couple of stylistic fixes, consolidate parse.js and plugin.js --- src/parse.js | 193 --------------------------------------- src/plugin.js | 200 +++++++++++++++++++++++++++++++++++++++-- test/js/globalSetup.js | 2 +- 3 files changed, 195 insertions(+), 200 deletions(-) delete mode 100644 src/parse.js diff --git a/src/parse.js b/src/parse.js deleted file mode 100644 index 1f02abdd..00000000 --- a/src/parse.js +++ /dev/null @@ -1,193 +0,0 @@ -import { spawn } from "child_process"; -import fs from "fs"; -import net from "net"; -import os from "os"; -import path from "path"; -import process from "process"; -import url from "url"; - -// In order to properly parse ruby code, we need to tell the ruby process to -// parse using UTF-8. Unfortunately, the way that you accomplish this looks -// differently depending on your platform. -/* istanbul ignore next */ -function getLang() { - const { env, platform } = process; - const envValue = env.LC_ALL || env.LC_CTYPE || env.LANG; - - // If an env var is set for the locale that already includes UTF-8 in the - // name, then assume we can go with that. - if (envValue && envValue.includes("UTF-8")) { - return envValue; - } - - // Otherwise, we're going to guess which encoding to use based on the system. - // This is probably not the best approach in the world, as you could be on - // linux and not have C.UTF-8, but in that case you're probably passing an env - // var for it. This object below represents all of the possible values of - // process.platform per: - // https://nodejs.org/api/process.html#process_process_platform - return { - aix: "C.UTF-8", - android: "C.UTF-8", - cygwin: "C.UTF-8", - darwin: "en_US.UTF-8", - freebsd: "C.UTF-8", - haiku: "C.UTF-8", - linux: "C.UTF-8", - netbsd: "C.UTF-8", - openbsd: "C.UTF-8", - sunos: "C.UTF-8", - win32: ".UTF-8" - }[platform]; -} - -// Return the list of plugins that should be passed to the server process. -function getPlugins(opts) { - const plugins = new Set(); - - const rubyPlugins = opts.rubyPlugins.trim(); - if (rubyPlugins.length > 0) { - rubyPlugins.split(",").forEach((plugin) => plugins.add(plugin.trim())); - } - - if (opts.rubySingleQuote) { - plugins.add("plugin/single_quotes"); - } - - if (opts.trailingComma !== "none") { - plugins.add("plugin/trailing_comma"); - } - - return Array.from(plugins); -} - -// Create a file that will act as a communication mechanism, spawn a parser -// server with that filepath as an argument, then wait for the file to be -// created that will contain the connection information. -export async function spawnServer(opts, killOnExit = true) { - const tmpdir = os.tmpdir(); - let serverFilepath = url.fileURLToPath( - new URL("./server.rb", import.meta.url) - ); - - // If we're in a yarn Plug'n'Play environment, then the relative paths being - // used by the parser server are not going to work with its virtual file - // system. - if (process.versions.pnp) { - if (url.fileURLToPath(new URL(".", import.meta.url)).includes(".zip")) { - // TODO: wait for prettier to get support back for pnp - } - } - - const filepath = path.join( - tmpdir, - `prettier-ruby-parser-${process.pid}.info` - ); - const server = spawn( - "ruby", - [serverFilepath, `--plugins=${getPlugins(opts).join(",")}`, filepath], - { - env: Object.assign({}, process.env, { LANG: getLang() }), - stdio: "ignore", - detached: true - } - ); - - server.unref(); - - if (killOnExit) { - process.on("exit", () => { - if (fs.existsSync(filepath)) { - fs.unlinkSync(filepath); - } - - try { - if (server.pid) { - // Kill the server process if it's still running. If we're on windows - // we're going to use the process ID number. If we're not, we're going - // to use the negative process ID to indicate the group. - const pid = process.platform === "win32" ? server.pid : -server.pid; - process.kill(pid); - } - } catch (error) { - // If there's an error killing the process, we're going to ignore it. - } - }); - } - - return new Promise((resolve, reject) => { - const timeout = setTimeout( - () => { - clearInterval(interval); - reject( - new Error( - "Failed to get connection options from parse server in time. If this happens repeatedly, try increasing the PRETTIER_RUBY_TIMEOUT_MS environment variable beyond 10000." - ) - ); - }, - parseInt(process.env.PRETTIER_RUBY_TIMEOUT_MS || "10000", 10) - ); - - const interval = setInterval(() => { - if (fs.existsSync(filepath)) { - resolve({ - serverPID: server.pid, - connectionFilepath: filepath, - connectionOptions: JSON.parse( - fs.readFileSync(filepath).toString("utf-8") - ) - }); - - clearTimeout(timeout); - clearInterval(interval); - } - }, 100); - }); -} - -let connectionOptions; -if (process.env.PRETTIER_RUBY_HOST) { - connectionOptions = JSON.parse(process.env.PRETTIER_RUBY_HOST); -} - -// Formats and sends a request to the parser server. We use netcat (or something -// like it) here since Prettier requires the results of `parse` to be -// synchronous and Node.js does not offer a mechanism for synchronous socket -// requests. -export async function parse(parser, source, opts) { - if (!connectionOptions) { - const spawnedServer = await spawnServer(opts); - connectionOptions = spawnedServer.connectionOptions; - } - - return new Promise((resolve, reject) => { - const socket = new net.Socket(); - - socket.on("error", reject); - socket.on("data", (data) => { - const response = JSON.parse(data.toString("utf-8")); - - if (response.error) { - const error = new Error(response.error); - if (response.loc) { - error.loc = response.loc; - } - - reject(error); - } - - resolve(response); - }); - - socket.connect(connectionOptions, () => { - socket.end( - JSON.stringify({ - parser, - source, - maxwidth: opts.printWidth, - tabwidth: opts.tabWidth - }) - ); - }); - }); -} diff --git a/src/plugin.js b/src/plugin.js index 5e368171..0fbb7dbb 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -1,10 +1,198 @@ -import { parse } from "./parse.js"; +import { spawn } from "child_process"; +import fs from "fs"; +import net from "net"; +import os from "os"; +import path from "path"; +import process from "process"; +import url from "url"; -/* - * metadata mostly pulled from linguist and rubocop: - * https://github.com/github/linguist/blob/master/lib/linguist/languages.yml - * https://github.com/rubocop/rubocop/blob/master/spec/rubocop/target_finder_spec.rb - */ +// In order to properly parse ruby code, we need to tell the ruby process to +// parse using UTF-8. Unfortunately, the way that you accomplish this looks +// differently depending on your platform. +function getLang() { + const { env, platform } = process; + const envValue = env.LC_ALL || env.LC_CTYPE || env.LANG; + + // If an env var is set for the locale that already includes UTF-8 in the + // name, then assume we can go with that. + if (envValue && envValue.includes("UTF-8")) { + return envValue; + } + + // Otherwise, we're going to guess which encoding to use based on the system. + // This is probably not the best approach in the world, as you could be on + // linux and not have C.UTF-8, but in that case you're probably passing an env + // var for it. This object below represents all of the possible values of + // process.platform per: + // https://nodejs.org/api/process.html#process_process_platform + return { + aix: "C.UTF-8", + android: "C.UTF-8", + cygwin: "C.UTF-8", + darwin: "en_US.UTF-8", + freebsd: "C.UTF-8", + haiku: "C.UTF-8", + linux: "C.UTF-8", + netbsd: "C.UTF-8", + openbsd: "C.UTF-8", + sunos: "C.UTF-8", + win32: ".UTF-8" + }[platform]; +} + +// Return the list of plugins that should be passed to the server process. +function getPlugins(opts) { + const plugins = new Set(); + + const rubyPlugins = opts.rubyPlugins.trim(); + if (rubyPlugins.length > 0) { + rubyPlugins.split(",").forEach((plugin) => plugins.add(plugin.trim())); + } + + if (opts.rubySingleQuote) { + plugins.add("plugin/single_quotes"); + } + + if (opts.trailingComma !== "none") { + plugins.add("plugin/trailing_comma"); + } + + return Array.from(plugins); +} + +// Create a file that will act as a communication mechanism, spawn a parser +// server with that filepath as an argument, then wait for the file to be +// created that will contain the connection information. +export async function spawnServer(opts, killOnExit = true) { + const tmpdir = os.tmpdir(); + + // First, get a filepath that points to the server script. If we're running + // under normal circumstances, we can just use a path relative to the + // import.meta.url value. + const serverURL = new URL("./server.rb", import.meta.url); + let serverFilepath = url.fileURLToPath(serverURL); + + // If we're in a yarn Plug'n'Play environment, then the relative paths being + // used by the parser server are not going to work with its virtual file + // system. So instead we need to copy the server script to a temporary + // directory. + if (process.versions.pnp) { + if (url.fileURLToPath(new URL(".", import.meta.url)).includes(".zip")) { + // TODO: wait for prettier to get support back for pnp + } + } + + const filepath = path.join(tmpdir, `prettier-ruby-parser-${process.pid}.txt`); + const server = spawn( + "ruby", + [serverFilepath, `--plugins=${getPlugins(opts).join(",")}`, filepath], + { + env: Object.assign({}, process.env, { LANG: getLang() }), + stdio: "ignore", + detached: true + } + ); + + server.unref(); + + if (killOnExit) { + process.on("exit", () => { + if (fs.existsSync(filepath)) { + fs.unlinkSync(filepath); + } + + try { + if (server.pid) { + // Kill the server process if it's still running. If we're on windows + // we're going to use the process ID number. If we're not, we're going + // to use the negative process ID to indicate the group. + const pid = process.platform === "win32" ? server.pid : -server.pid; + process.kill(pid); + } + } catch (error) { + // If there's an error killing the process, we're going to ignore it. + } + }); + } + + return new Promise((resolve, reject) => { + const timeout = setTimeout( + () => { + const message = + "Failed to get connection options from parse server in time. If this happens repeatedly, try increasing the PRETTIER_RUBY_TIMEOUT_MS environment variable beyond 10000."; + + clearInterval(interval); + reject(new Error(message)); + }, + parseInt(process.env.PRETTIER_RUBY_TIMEOUT_MS || "10000", 10) + ); + + const interval = setInterval(() => { + if (fs.existsSync(filepath)) { + const connectionJSON = fs.readFileSync(filepath).toString("utf-8"); + resolve({ + serverPID: server.pid, + connectionFilepath: filepath, + connectionOptions: JSON.parse(connectionJSON) + }); + + clearTimeout(timeout); + clearInterval(interval); + } + }, 100); + }); +} + +let connectionOptions; +if (process.env.PRETTIER_RUBY_HOST) { + connectionOptions = JSON.parse(process.env.PRETTIER_RUBY_HOST); +} + +// Formats and sends a request to the parser server. We use netcat (or something +// like it) here since Prettier requires the results of `parse` to be +// synchronous and Node.js does not offer a mechanism for synchronous socket +// requests. +async function parse(parser, source, opts) { + if (!connectionOptions) { + const spawnedServer = await spawnServer(opts); + connectionOptions = spawnedServer.connectionOptions; + } + + return new Promise((resolve, reject) => { + const socket = new net.Socket(); + + socket.on("error", reject); + socket.on("data", (data) => { + const response = JSON.parse(data.toString("utf-8")); + + if (response.error) { + const error = new Error(response.error); + if (response.loc) { + error.loc = response.loc; + } + + reject(error); + } + + resolve(response); + }); + + socket.connect(connectionOptions, () => { + socket.end( + JSON.stringify({ + parser, + source, + maxwidth: opts.printWidth, + tabwidth: opts.tabWidth + }) + ); + }); + }); +} + +// Metadata mostly pulled from linguist and rubocop: +// https://github.com/github/linguist/blob/master/lib/linguist/languages.yml +// https://github.com/rubocop/rubocop/blob/master/spec/rubocop/target_finder_spec.rb const plugin = { languages: [ { diff --git a/test/js/globalSetup.js b/test/js/globalSetup.js index 768f2d82..72c9be34 100644 --- a/test/js/globalSetup.js +++ b/test/js/globalSetup.js @@ -1,5 +1,5 @@ import { spawnSync } from "child_process"; -import { spawnServer } from "../../src/parse.js"; +import { spawnServer } from "../../src/plugin.js"; // This is somewhat similar to the spawnServer function in parseSync but // slightly different in that it logs its information into environment variables From ec41304be517291b2d44752da849e1389aad673e Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 20 Oct 2022 09:49:44 -0400 Subject: [PATCH 664/785] Ignore .gem files in npmignore --- .npmignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.npmignore b/.npmignore index bd042760..7a1a86d7 100644 --- a/.npmignore +++ b/.npmignore @@ -5,9 +5,9 @@ /node_modules/ /lib/ /pkg/ -/playground/ /test/ /vendor/ +/*.gem /.* /Gemfile* From cea3932d29d699ee79786bd3aa432e9a6d518e3f Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 20 Oct 2022 09:54:12 -0400 Subject: [PATCH 665/785] Update various community docs --- .github/ISSUE_TEMPLATE/bug.md | 18 --- .github/ISSUE_TEMPLATE/formatting.md | 30 ----- CONTRIBUTING.md | 183 --------------------------- README.md | 6 +- prettier.gemspec | 10 +- 5 files changed, 9 insertions(+), 238 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug.md delete mode 100644 .github/ISSUE_TEMPLATE/formatting.md delete mode 100644 CONTRIBUTING.md diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md deleted file mode 100644 index 6b958779..00000000 --- a/.github/ISSUE_TEMPLATE/bug.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: 🐛 Bug -about: Issues with prettier crashing ---- - -## Metadata - -- Operating system: Ubuntu -- Ruby version: latest -- Node version: latest -- `@prettier/plugin-ruby` or `prettier` gem version: latest -- `syntax_tree` version: latest - -## Input - -```ruby -# Code snippet -``` diff --git a/.github/ISSUE_TEMPLATE/formatting.md b/.github/ISSUE_TEMPLATE/formatting.md deleted file mode 100644 index 45318417..00000000 --- a/.github/ISSUE_TEMPLATE/formatting.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -name: ✨ Formatting -about: Issues for ugly or incorrect code ---- - -## Metadata - -- Operating system: Ubuntu -- Ruby version: latest -- Node version: latest -- `@prettier/plugin-ruby` or `prettier` gem version: latest -- `syntax_tree` version: latest - -## Input - -```ruby -# Code snippet -``` - -## Current output - -```ruby -# Code snippet -``` - -## Expected output - -```ruby -# Code snippet -``` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 64f0fade..00000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,183 +0,0 @@ -# Contributing - -Thanks so much for your interest in contributing! This page provides background on how prettier and this plugin work, links for understanding each step that prettier executes, various helpful utilities for analyzing the tree structures being manipulated, and frequently asked questions. - -Armed with the knowledge below, we would love to see your contribution! Please open an issue or a pull request at https://github.com/prettier/plugin-ruby. - -- [How it works](#how-it-works) - - [Text to AST](#text-to-ast) - - [AST to Doc](#ast-to-doc) - - [Doc to text](#doc-to-text) -- [FAQ](#faq) -- [Useful links](#useful-links) - - [Ruby](#ruby) - - [Ripper](#ripper) - - [Prettier](#prettier) -- [Useful commands](#useful-commands) -- [Testing](#testing) - -## How it works - -In order to get printed, the code goes through a couple of transformations. The first is taking the entire file as text and parsing it into an abstract syntax tree (AST). The second is taking the AST and transforming it into prettier's intermediate representation, internally referred to as Docs. The final is taking the Doc nodes and converting them back into plain text, taking into account printing rules like max line length. Each of those steps is details below. - -### Text to AST - -When the prettier process first spins up, it examines which files it's going to print and selects an appropriate plugin for each one. Once selected, it runs that plugin's `parse` function, seen [here](src/ruby/parser.js). For the case of the Ruby plugin, that entails spawning a Ruby process that runs [parser.rb](src/ruby/parser.rb) with the input code preloaded on stdin. - -`parser.rb` will read the text off of stdin and then feed it to a new `Ripper` instance, which is a Ruby standard library recursive-descent parser. Briefly, the way that `Ripper` works is by tokenizing the input and then matching those tokens against a grammar to form s-expressions. To extend `Ripper`, you overwrite the methods that control how those s-expressions are formed, e.g., to modify the s-expression that is formed when `Ripper` encounters a string literal, you would override the `#on_string_literal` method. Below is an example for seeing that in action. - -Let's assume you have the following code: - -```ruby -1 + 1 -``` - -First, `Ripper` will tokenize: - - -```ruby -require 'ripper' - -pp Ripper.lex('1 + 1') - -=begin -[[[1, 0], :on_int, "1", EXPR_END], - [[1, 1], :on_sp, " ", EXPR_END], - [[1, 2], :on_op, "+", EXPR_BEG], - [[1, 3], :on_sp, " ", EXPR_BEG], - [[1, 4], :on_int, "1", EXPR_END]] -=end -``` - -You can see it has location metadata (row and column), the token type, the value associated with that token type, and the lexer state when that token was encountered. Then, it will convert those tokens into s-expressions: - - -```ruby -require 'ripper' - -pp Ripper.sexp_raw('1 + 1') - -=begin -[:program, - [:stmts_add, - [:stmts_new], - [:binary, [:@int, "1", [1, 0]], :+, [:@int, "1", [1, 4]]]]] -=end -``` - -As you can see above, the resulting s-expressions will call the following methods in order on the instantiated `Ripper` instance: `on_int`, `on_int`, `on_stmts_new`, `on_binary`, `on_stmts_add`, `on_program`. You can hook into any part of this process by overriding any of those methods (we override all of them). - -Now that the text has been transformed into an AST that we can work with, `parser.rb` will serialize the result to JSON, write it back to stdout, and exit. The `parse` function will then parse that JSON by reading off the child process once it has exited, and return that value back to prettier. - -### AST to Doc - -Once prettier has a working AST, it will take it and call the selected plugin's [`printNode` function](src/ruby/printer.js), whose purpose is to convert that AST into prettier's intermediate representation called Docs. It does this by handing the print function a `FastPath` object that keeps track of the state of the printing as it goes, and allows accessing various parts of the AST quickly. - -Effectively, it walks the AST in the reverse direction from the way `Ripper` built it (top-down instead of bottom-up). The first node that gets passed into the `print` function is the `program` node as that's always on top. Then it is the `program` node's responsibility to recursively call print on its child nodes as it best sees fit. - -As the nodes are printing themselves and their children, they're additionally building up a second AST. That AST is built using the `builder` commands from prettier core, described [here](https://github.com/prettier/prettier/blob/main/commands.md). As an example, below is how a `binary` node (like the one representing the `1 + 1` above) would handle printing itself: - -```javascript -import prettier from "prettier"; -const { group, indent, line } = prettier.doc.builders; - -const printBinary = (path, opts, print) => - group([ - [path.call(print, "body", 0), " "], - path.getValue().body[1], - indent([line, path.call(print, "body", 2)]) - ]); -``` - -Recall that the `binary` node looks like this: - -``` -[:binary, [:@int, "1", [1, 0]], :+, [:@int, "1", [1, 4]]] -``` - -This means that there is a node in the `0` position of the array that represents the left-hand operand, and a node in the `2` position of the array that represents the right-hand operand. The operator is represented as a string literal in the `1` position of the array. - -So, the `printBinary` function is going to use the following `prettier` builders to build up the intermediate represention: - -- `group` - marks places where `prettier` could split text if the line gets too long; if the max line length is hit, `prettier` will break apart the outermost `group` node first -- `indent` - increases the current print indent for the contents of the node if the parent node is broken, e.g., if the `binary` node is too long to fit on one line, it will indent the right-hand operand -- `line` - puts a space if the group is not broken, otherwise puts a newline - -Once every node has been printed like the `binary` node above, the `print` node returns the intermediate representation to `prettier`. - -### Doc to text - -At this point, this is where `prettier`'s printer takes over. Because the remainder of the process is language-agnostic and `prettier` knows how to handle its own `Doc` representation, the Ruby plugin no longer has a job to do. `prettier` will walk its own `Doc` nodes and print them out according to the rules established by the structure. - -## FAQ - -Below are a couple of questions frequently asked about the prettier Ruby plugin. - -### Why Ripper over the other available Ruby parsers? - -I've been asked this question a lot, and there are a lot of reasons for this: - -1. Ripper is stdlib, and when the node process running prettier spawns the Ruby process performing the parsing, it's a lot easier to just require ripper than to worry about inconsistent environments having gems installed in myriad places. -2. Ripper is fast, which is nice as we need that to give the developer a good experience. -3. It was originally written in Ripper. Changing the parser at this point would entail an entire rewrite of the system, as the project is inextricably tied to the AST. - -### Why are the Ruby options distinct from the JavaScript options? - -In order to support all preferences, the Ruby options need to be distinct from the JavaScript options, otherwise you would not be able to, for example, have single quotes in Ruby and double quotes in JavaScript. They also indicate somewhat different things. In JavaScript, nothing changes when you use single versus double quotes, whereas in Ruby single and doubles quotes change interpolation behavior. - -### What versions of Ruby are supported? - -We support all Ruby versions that are under security maintenance or better (https://www.ruby-lang.org/en/downloads/branches/). This means at the moment we support back to Ruby 2.5. This is not to say that prettier can't parse and print code that was written while running earlier versions of Ruby, it's just that the Ruby process running prettier (whatever `ruby` resolves to when the process runs) must be >= 2.5. - -### Do you support ERB files (.html.erb, .js.erb, etc.)? - -At the moment, prettier doesn't have baked-in support for template languages. The way it is accomplished in prettier core is to extend each of the individual parsers to have special placeholder AST nodes that then switch the printer over to the necessarily language. This is certainly possible to support ERB, but the work is still being investigated. See [this issue](https://github.com/prettier/plugin-ruby/issues/371) for more detail. - -## Useful links - -For further understanding, below is a list of helpful resources. - -### Ruby - -Links contained within the Ruby source that are relevant to this plugin. - -- [parse.y](https://github.com/ruby/ruby/blob/trunk/parse.y) - the parser generator within Ruby that gives you the names of the nodes as well as their structure -- [test_parser_events.rb](https://github.com/ruby/ruby/blob/trunk/test/ripper/test_parser_events.rb) - the parser test file that gives you code examples of each kind of node - -### Ripper - -Links relating to `ripper` and how it parses Ruby source. - -- [Ripper preview](https://ripper-preview.herokuapp.com) - a visualization of `ripper` and how it parses Ruby source -- [How ripper parses variables](https://rmosolgo.github.io/blog/2018/05/21/how-ripper-parses-variables/) - blog post neatly explaining how `ripper` parses variables -- [Ripper events](https://rmosolgo.github.io/ripper_events/) - documentation for each type of `ripper` node - -### Prettier - -Links relating to `prettier` and its plugins. - -- [Prettier plugin documentation](https://prettier.io/docs/en/plugins.html) - documentation around `prettier`'s plugin system -- [Builder commands](https://github.com/prettier/prettier/blob/main/commands.md) - the functions used to build the `prettier` IR -- [Writing a Prettier plugin](https://medium.com/@fvictorio/how-to-write-a-plugin-for-prettier-a0d98c845e70) - a nice tutorial on how to build a `prettier` plugin - -## Useful commands - -While developing, we've built a couple of small utilities for debugging the `prettier` printing process. To use them, first run `yarn` and `bundle` to install dependencies. - -- `bin/print.js [file|source]` - outputs the printed source of a Ruby file after running it through `prettier` - -## Testing - -There are two kinds of tests contained within this repository. - -The first are JavaScript tests (run with `jest`) that test the formatting against preconfigured fixtures to protect against regressions. They live in [test/js](test/js). To run them, run: - -``` -$ yarn test -``` - -The second are Ruby tests (run with `minitest`) that test the gem the wraps the `prettier` plugin as well as testing the various metadata attached to the AST nodes that `ripper` generates. They live in [test/rb](test/rb). To run them, run: - -``` -$ bundle exec rake -``` diff --git a/README.md b/README.md index 4d3d8b51..6d71f2d1 100644 --- a/README.md +++ b/README.md @@ -205,9 +205,11 @@ Refer to [this issue](https://github.com/prettier/plugin-ruby/issues/113#issueco ## Contributing -Check out our [contributing guide](CONTRIBUTING.md). Bug reports and pull requests are welcome on GitHub at https://github.com/prettier/plugin-ruby. +Thanks so much for your interest in contributing! You can contribute in many ways, including: -You can support `prettier/plugin-ruby` [on OpenCollective](https://opencollective.com/prettier-ruby/contribute). Your organization's logo will show up here with a link to your website. +* Contributing code to fix any bugs on [GitHub](https://github.com/prettier/plugin-ruby). +* Reporting issues on [GitHub](https://github.com/prettier/plugin-ruby/issues/new). +* Supporting `prettier/plugin-ruby` on [OpenCollective](https://opencollective.com/prettier-ruby/contribute). Your organization's logo will show up here with a link to your website. diff --git a/prettier.gemspec b/prettier.gemspec index bae2dabf..5cc3cf5a 100644 --- a/prettier.gemspec +++ b/prettier.gemspec @@ -5,12 +5,12 @@ package = JSON.parse(File.read(File.join(__dir__, "package.json"))) Gem::Specification.new do |spec| spec.name = "prettier" - spec.version = package["version"] - spec.authors = [package["author"]] + spec.version = package.fetch("version") + spec.authors = [package.fetch("author")] - spec.summary = package["description"] - spec.homepage = package["homepage"] - spec.license = package["license"] + spec.summary = package.fetch("description") + spec.homepage = package.fetch("homepage") + spec.license = package.fetch("license") spec.files = Dir.chdir(__dir__) do From cbbd3ff3dc5fee26bd55c53d3d2159978d48ed38 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 20 Oct 2022 10:03:29 -0400 Subject: [PATCH 666/785] Update README --- README.md | 55 ++++++------------------------------------------------- 1 file changed, 6 insertions(+), 49 deletions(-) diff --git a/README.md b/README.md index 6d71f2d1..28ddd8a3 100644 --- a/README.md +++ b/README.md @@ -68,43 +68,13 @@ end ## Getting started -To run `prettier` with the Ruby plugin, you're going to need [`ruby`](https://www.ruby-lang.org/en/documentation/installation/) (version `2.7.3` or newer) and [`node`](https://nodejs.org/en/download/) (version `8.3` or newer). If you're integrating with a project that is not already using `prettier`, you should use the Ruby gem. Otherwise you can use the `npm` package directly. +The `@prettier/plugin-ruby` plugin for `prettier` is a small wrapper around the [Syntax Tree](https://github.com/ruby-syntax-tree/syntax_tree) gem that provides a Ruby formatter for `prettier`. It does this by keeping a Ruby server running in that background that `prettier` can communicate with when it needs to format a Ruby file. This means that in order to function, you will need to have both the requisite `node` and `ruby` dependencies installed. Because of this configuration, there are a couple of ways that you can get setup to use this plugin. -Note that currently the editor integrations work best with the `npm` package, as most of the major editor plugins expect a `node_modules` directory. You can get them to work with the Ruby gem, but it requires manually configuring the paths. +* If you're already using `prettier` in your project to format other files in your project and want to install this as a plugin, you can install it using `npm`. +* If you're not using `prettier` yet in your project, then we recommend using the [Syntax Tree](https://github.com/ruby-syntax-tree/syntax_tree) gem directly instead of using this plugin. +* Note that this plugin also ships a gem named `prettier` which is a wrapper around the `prettier` CLI and includes this plugin by default, but _we no longer recommend its use_. If you're using that gem, you should migrate to using [Syntax Tree](https://github.com/ruby-syntax-tree/syntax_tree) instead. -This plugin currently supports formatting the following kinds of files: - -- All varieties of Ruby source files (e.g., `*.rb`, `*.gemspec`, `Gemfile`, etc.) -- [RBS type language](https://github.com/ruby/rbs) files - requires having the `rbs` gem in your gem path -- [HAML template language](https://haml.info/) files - requires having the `haml` gem in your gem path - -### Ruby gem - -Add this line to your application's Gemfile: - -```ruby -gem "prettier" -``` - -And then execute: - -```bash -bundle -``` - -Or install it yourself as: - -```bash -gem install prettier -``` - -The `rbprettier` executable is now installed and ready for use: - -```bash -bundle exec rbprettier --write '**/*' -``` - -### `npm` package +To run `prettier` with the Ruby plugin as an `npm` package, you're going to need [`ruby`](https://www.ruby-lang.org/en/documentation/installation/) (version `2.7` or newer) and [`node`](https://nodejs.org/en/download/) (version `16` or newer). If you're using the `npm` CLI, then add the plugin by: @@ -164,20 +134,7 @@ Sometimes you want to leave your formatting in place and have `prettier` not for ### Usage with RuboCop -RuboCop and Prettier for Ruby serve different purposes, but there is overlap -with some of RuboCop's functionality. - -Prettier provides a RuboCop configuration file to disable the rules which clash. -To enable, add the following config at the top of your project's `.rubocop.yml`: - -#### Ruby gem - -```yaml -inherit_gem: - prettier: rubocop.yml -``` - -#### `npm` package +RuboCop and Prettier for Ruby serve different purposes, but there is overlap with some of RuboCop's functionality. Prettier provides a RuboCop configuration file to disable the rules which would clash. To enable this file, add the following configuration at the top of your project's `.rubocop.yml`: ```yaml inherit_from: From 26a362c61ef6ecb23193c673b26beacac56c27a0 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sat, 22 Oct 2022 15:31:14 -0400 Subject: [PATCH 667/785] Formatting for README --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 28ddd8a3..483a13c9 100644 --- a/README.md +++ b/README.md @@ -70,9 +70,9 @@ end The `@prettier/plugin-ruby` plugin for `prettier` is a small wrapper around the [Syntax Tree](https://github.com/ruby-syntax-tree/syntax_tree) gem that provides a Ruby formatter for `prettier`. It does this by keeping a Ruby server running in that background that `prettier` can communicate with when it needs to format a Ruby file. This means that in order to function, you will need to have both the requisite `node` and `ruby` dependencies installed. Because of this configuration, there are a couple of ways that you can get setup to use this plugin. -* If you're already using `prettier` in your project to format other files in your project and want to install this as a plugin, you can install it using `npm`. -* If you're not using `prettier` yet in your project, then we recommend using the [Syntax Tree](https://github.com/ruby-syntax-tree/syntax_tree) gem directly instead of using this plugin. -* Note that this plugin also ships a gem named `prettier` which is a wrapper around the `prettier` CLI and includes this plugin by default, but _we no longer recommend its use_. If you're using that gem, you should migrate to using [Syntax Tree](https://github.com/ruby-syntax-tree/syntax_tree) instead. +- If you're already using `prettier` in your project to format other files in your project and want to install this as a plugin, you can install it using `npm`. +- If you're not using `prettier` yet in your project, then we recommend using the [Syntax Tree](https://github.com/ruby-syntax-tree/syntax_tree) gem directly instead of using this plugin. +- Note that this plugin also ships a gem named `prettier` which is a wrapper around the `prettier` CLI and includes this plugin by default, but _we no longer recommend its use_. If you're using that gem, you should migrate to using [Syntax Tree](https://github.com/ruby-syntax-tree/syntax_tree) instead. To run `prettier` with the Ruby plugin as an `npm` package, you're going to need [`ruby`](https://www.ruby-lang.org/en/documentation/installation/) (version `2.7` or newer) and [`node`](https://nodejs.org/en/download/) (version `16` or newer). @@ -164,9 +164,9 @@ Refer to [this issue](https://github.com/prettier/plugin-ruby/issues/113#issueco Thanks so much for your interest in contributing! You can contribute in many ways, including: -* Contributing code to fix any bugs on [GitHub](https://github.com/prettier/plugin-ruby). -* Reporting issues on [GitHub](https://github.com/prettier/plugin-ruby/issues/new). -* Supporting `prettier/plugin-ruby` on [OpenCollective](https://opencollective.com/prettier-ruby/contribute). Your organization's logo will show up here with a link to your website. +- Contributing code to fix any bugs on [GitHub](https://github.com/prettier/plugin-ruby). +- Reporting issues on [GitHub](https://github.com/prettier/plugin-ruby/issues/new). +- Supporting `prettier/plugin-ruby` on [OpenCollective](https://opencollective.com/prettier-ruby/contribute). Your organization's logo will show up here with a link to your website. From d924bf389850573bf11f99af96180e3d180ef903 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Oct 2022 12:01:10 +0000 Subject: [PATCH 668/785] Bump eslint from 8.25.0 to 8.26.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.25.0 to 8.26.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.25.0...v8.26.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 81 ++++++++++++++----------------------------------------- 1 file changed, 20 insertions(+), 61 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4704e388..187857f0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -312,10 +312,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@humanwhocodes/config-array@^0.10.5": - version "0.10.7" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.10.7.tgz#6d53769fd0c222767e6452e8ebda825c22e9f0dc" - integrity sha512-MDl6D6sBsaV452/QSdX+4CXIjZhIcI0PELsxUjk4U828yd58vk3bTIvk/6w5FY+4hIy9sLW0sfrV7K7Kc++j/w== +"@humanwhocodes/config-array@^0.11.6": + version "0.11.6" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.6.tgz#6a51d603a3aaf8d4cf45b42b3f2ac9318a4adc4b" + integrity sha512-jJr+hPTJYKyDILJfhNSHsjiwXYf26Flsz8DvNndOsHs5pwSnpGUEy8yzF0JYhCEvTDdV2vuOK5tt8BVhwO5/hg== dependencies: "@humanwhocodes/object-schema" "^1.2.1" debug "^4.1.1" @@ -587,12 +587,12 @@ "@nodelib/fs.stat" "2.0.5" run-parallel "^1.1.9" -"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": +"@nodelib/fs.stat@2.0.5": version "2.0.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== -"@nodelib/fs.walk@^1.2.3": +"@nodelib/fs.walk@^1.2.8": version "1.2.8" resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== @@ -1052,13 +1052,6 @@ diff-sequences@^29.2.0: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.2.0.tgz#4c55b5b40706c7b5d2c5c75999a50c56d214e8f6" integrity sha512-413SY5JpYeSBZxmenGEmCVQ8mCgtFJF0w9PROdaS6z987XC2Pd2GOKqOITLtMftmyFZqgtCOb/QA7/Z3ZXfzIw== -dir-glob@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" - integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== - dependencies: - path-type "^4.0.0" - doctrine@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" @@ -1146,13 +1139,14 @@ eslint-visitor-keys@^3.3.0: integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.15.0: - version "8.25.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.25.0.tgz#00eb962f50962165d0c4ee3327708315eaa8058b" - integrity sha512-DVlJOZ4Pn50zcKW5bYH7GQK/9MsoQG2d5eDH0ebEkE8PbgzTTmtt/VTH9GGJ4BfeZCpBLqFfvsjX35UacUL83A== + version "8.26.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.26.0.tgz#2bcc8836e6c424c4ac26a5674a70d44d84f2181d" + integrity sha512-kzJkpaw1Bfwheq4VXUezFriD1GxszX6dUekM7Z3aC2o4hju+tsR/XyTC3RcoSD7jmy9VkPU3+N6YjVU2e96Oyg== dependencies: "@eslint/eslintrc" "^1.3.3" - "@humanwhocodes/config-array" "^0.10.5" + "@humanwhocodes/config-array" "^0.11.6" "@humanwhocodes/module-importer" "^1.0.1" + "@nodelib/fs.walk" "^1.2.8" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" @@ -1168,14 +1162,14 @@ eslint@^8.15.0: fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" find-up "^5.0.0" - glob-parent "^6.0.1" + glob-parent "^6.0.2" globals "^13.15.0" - globby "^11.1.0" grapheme-splitter "^1.0.4" ignore "^5.2.0" import-fresh "^3.0.0" imurmurhash "^0.1.4" is-glob "^4.0.0" + is-path-inside "^3.0.3" js-sdsl "^4.1.4" js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" @@ -1278,17 +1272,6 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== -fast-glob@^3.2.9: - version "3.2.12" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80" - integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.4" - fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" @@ -1398,14 +1381,7 @@ get-stream@^6.0.0: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== -glob-parent@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -glob-parent@^6.0.1: +glob-parent@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== @@ -1436,18 +1412,6 @@ globals@^13.15.0: dependencies: type-fest "^0.20.2" -globby@^11.1.0: - version "11.1.0" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" - integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== - dependencies: - array-union "^2.1.0" - dir-glob "^3.0.1" - fast-glob "^3.2.9" - ignore "^5.2.0" - merge2 "^1.4.1" - slash "^3.0.0" - graceful-fs@^4.2.9: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" @@ -1561,7 +1525,7 @@ is-generator-fn@^2.0.0: resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: +is-glob@^4.0.0, is-glob@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== @@ -1573,6 +1537,11 @@ is-number@^7.0.0: resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== +is-path-inside@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" + integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== + is-stream@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" @@ -2104,11 +2073,6 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -merge2@^1.3.0, merge2@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" - integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== - micromatch@^4.0.4: version "4.0.5" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" @@ -2273,11 +2237,6 @@ path-parse@^1.0.7: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== -path-type@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" - integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== - picocolors@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" From c2be0f89d18a299d93f6f40e74883af95fc46907 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Oct 2022 12:01:09 +0000 Subject: [PATCH 669/785] Bump jest from 29.2.1 to 29.2.2 Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.2.1 to 29.2.2. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.2.2/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 332 +++++++++++++++++++++++++++--------------------------- 1 file changed, 166 insertions(+), 166 deletions(-) diff --git a/yarn.lock b/yarn.lock index 187857f0..444b8ede 100644 --- a/yarn.lock +++ b/yarn.lock @@ -359,15 +359,15 @@ jest-util "^29.2.1" slash "^3.0.0" -"@jest/core@^29.2.1": - version "29.2.1" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.2.1.tgz#30af794ebd73bfb87cd8ba36718738dfe38b772e" - integrity sha512-kuLKYqnqgerXkBUwlHVxeSuhSnd+JMnMCLfU98bpacBSfWEJPegytDh3P2m15/JHzet32hGGld4KR4OzMb6/Tg== +"@jest/core@^29.2.2": + version "29.2.2" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.2.2.tgz#207aa8973d9de8769f9518732bc5f781efc3ffa7" + integrity sha512-susVl8o2KYLcZhhkvSB+b7xX575CX3TmSvxfeDjpRko7KmT89rHkXj6XkDkNpSeFMBzIENw5qIchO9HC9Sem+A== dependencies: "@jest/console" "^29.2.1" - "@jest/reporters" "^29.2.1" + "@jest/reporters" "^29.2.2" "@jest/test-result" "^29.2.1" - "@jest/transform" "^29.2.1" + "@jest/transform" "^29.2.2" "@jest/types" "^29.2.1" "@types/node" "*" ansi-escapes "^4.2.1" @@ -376,79 +376,79 @@ exit "^0.1.2" graceful-fs "^4.2.9" jest-changed-files "^29.2.0" - jest-config "^29.2.1" + jest-config "^29.2.2" jest-haste-map "^29.2.1" jest-message-util "^29.2.1" jest-regex-util "^29.2.0" - jest-resolve "^29.2.1" - jest-resolve-dependencies "^29.2.1" - jest-runner "^29.2.1" - jest-runtime "^29.2.1" - jest-snapshot "^29.2.1" + jest-resolve "^29.2.2" + jest-resolve-dependencies "^29.2.2" + jest-runner "^29.2.2" + jest-runtime "^29.2.2" + jest-snapshot "^29.2.2" jest-util "^29.2.1" - jest-validate "^29.2.1" - jest-watcher "^29.2.1" + jest-validate "^29.2.2" + jest-watcher "^29.2.2" micromatch "^4.0.4" pretty-format "^29.2.1" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.2.1": - version "29.2.1" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.2.1.tgz#acb1994fbd5ad02819a1a34a923c531e6923b665" - integrity sha512-EutqA7T/X6zFjw6mAWRHND+ZkTPklmIEWCNbmwX6uCmOrFrWaLbDZjA+gePHJx6fFMMRvNfjXcvzXEtz54KPlg== +"@jest/environment@^29.2.2": + version "29.2.2" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.2.2.tgz#481e729048d42e87d04842c38aa4d09c507f53b0" + integrity sha512-OWn+Vhu0I1yxuGBJEFFekMYc8aGBGrY4rt47SOh/IFaI+D7ZHCk7pKRiSoZ2/Ml7b0Ony3ydmEHRx/tEOC7H1A== dependencies: - "@jest/fake-timers" "^29.2.1" + "@jest/fake-timers" "^29.2.2" "@jest/types" "^29.2.1" "@types/node" "*" - jest-mock "^29.2.1" + jest-mock "^29.2.2" -"@jest/expect-utils@^29.2.1": - version "29.2.1" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.2.1.tgz#eae61c90f2066540f60d23b8f254f03b7869b22f" - integrity sha512-yr4aHNg5Z1CjKby5ozm7sKjgBlCOorlAoFcvrOQ/4rbZRfgZQdnmh7cth192PYIgiPZo2bBXvqdOApnAMWFJZg== +"@jest/expect-utils@^29.2.2": + version "29.2.2" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.2.2.tgz#460a5b5a3caf84d4feb2668677393dd66ff98665" + integrity sha512-vwnVmrVhTmGgQzyvcpze08br91OL61t9O0lJMDyb6Y/D8EKQ9V7rGUb/p7PDt0GPzK0zFYqXWFo4EO2legXmkg== dependencies: jest-get-type "^29.2.0" -"@jest/expect@^29.2.1": - version "29.2.1" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.2.1.tgz#8d99be3886ebfcffd6cabb2b46602a301b976ffe" - integrity sha512-o14R2t2tHHHudwji43UKkzmmH49xfF5T++FQBK2tl88qwuBWQOcx7fNUYl+mA/9TPNAN0FkQ3usnpyS8FUwsvQ== +"@jest/expect@^29.2.2": + version "29.2.2" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.2.2.tgz#81edbd33afbde7795ca07ff6b4753d15205032e4" + integrity sha512-zwblIZnrIVt8z/SiEeJ7Q9wKKuB+/GS4yZe9zw7gMqfGf4C5hBLGrVyxu1SzDbVSqyMSlprKl3WL1r80cBNkgg== dependencies: - expect "^29.2.1" - jest-snapshot "^29.2.1" + expect "^29.2.2" + jest-snapshot "^29.2.2" -"@jest/fake-timers@^29.2.1": - version "29.2.1" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.2.1.tgz#786d60e8cb60ca70c9f913cb49fcc77610c072bb" - integrity sha512-KWil+8fef7Uj/P/PTZlPKk1Pw117wAmr71VWFV8ZDtRtkwmTG8oY4IRf0Ss44J2y5CYRy8d/zLOhxyoGRENjvA== +"@jest/fake-timers@^29.2.2": + version "29.2.2" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.2.2.tgz#d8332e6e3cfa99cde4bc87d04a17d6b699deb340" + integrity sha512-nqaW3y2aSyZDl7zQ7t1XogsxeavNpH6kkdq+EpXncIDvAkjvFD7hmhcIs1nWloengEWUoWqkqSA6MSbf9w6DgA== dependencies: "@jest/types" "^29.2.1" "@sinonjs/fake-timers" "^9.1.2" "@types/node" "*" jest-message-util "^29.2.1" - jest-mock "^29.2.1" + jest-mock "^29.2.2" jest-util "^29.2.1" -"@jest/globals@^29.2.1": - version "29.2.1" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.2.1.tgz#6933beb8b4e43b990409a19c462fde7b71210e63" - integrity sha512-Z4EejYPP1OPVq2abk1+9urAwJqkgw5jB2UJGlPjb5ZwzPQF8WLMcigKEfFzZb2OHhEVPP0RZD0/DbVTY1R6iQA== +"@jest/globals@^29.2.2": + version "29.2.2" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.2.2.tgz#205ff1e795aa774301c2c0ba0be182558471b845" + integrity sha512-/nt+5YMh65kYcfBhj38B3Hm0Trk4IsuMXNDGKE/swp36yydBWfz3OXkLqkSvoAtPW8IJMSJDFCbTM2oj5SNprw== dependencies: - "@jest/environment" "^29.2.1" - "@jest/expect" "^29.2.1" + "@jest/environment" "^29.2.2" + "@jest/expect" "^29.2.2" "@jest/types" "^29.2.1" - jest-mock "^29.2.1" + jest-mock "^29.2.2" -"@jest/reporters@^29.2.1": - version "29.2.1" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.2.1.tgz#599e4376823751fdda50f2ca97243e013da10c4d" - integrity sha512-sCsfUKM/yIF4nNed3e/rIgVIS58EiASGMDEPWqItfLZ9UO1ALW2ASDNJzdWkxEt0T8o2Ztj619G0KKrvK+McAw== +"@jest/reporters@^29.2.2": + version "29.2.2" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.2.2.tgz#69b395f79c3a97ce969ce05ccf1a482e5d6de290" + integrity sha512-AzjL2rl2zJC0njIzcooBvjA4sJjvdoq98sDuuNs4aNugtLPSQ+91nysGKRF0uY1to5k0MdGMdOBggUsPqvBcpA== dependencies: "@bcoe/v8-coverage" "^0.2.3" "@jest/console" "^29.2.1" "@jest/test-result" "^29.2.1" - "@jest/transform" "^29.2.1" + "@jest/transform" "^29.2.2" "@jest/types" "^29.2.1" "@jridgewell/trace-mapping" "^0.3.15" "@types/node" "*" @@ -496,20 +496,20 @@ "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.2.1": - version "29.2.1" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.2.1.tgz#cafd2c5f3528c70bd4cc243800459ac366e480cc" - integrity sha512-O/pnk0/xGj3lxPVNwB6HREJ7AYvUdyP2xo/s14/9Dtf091HoOeyIhWLKQE/4HzB8lNQBMo6J5mg0bHz/uCWK7w== +"@jest/test-sequencer@^29.2.2": + version "29.2.2" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.2.2.tgz#4ac7487b237e517a1f55e7866fb5553f6e0168b9" + integrity sha512-Cuc1znc1pl4v9REgmmLf0jBd3Y65UXJpioGYtMr/JNpQEIGEzkmHhy6W6DLbSsXeUA13TDzymPv0ZGZ9jH3eIw== dependencies: "@jest/test-result" "^29.2.1" graceful-fs "^4.2.9" jest-haste-map "^29.2.1" slash "^3.0.0" -"@jest/transform@^29.2.1": - version "29.2.1" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.2.1.tgz#f3d8154edd19cdbcaf1d6646bd8f4ff7812318a2" - integrity sha512-xup+iEuaIRSQabQaeqxaQyN0vg1Dctrp9oTObQsNf3sZEowTIa5cANYuoyi8Tqhg4GCqEVLTf18KW7ii0UeFVA== +"@jest/transform@^29.2.2": + version "29.2.2" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.2.2.tgz#dfc03fc092b31ffea0c55917728e75bfcf8b5de6" + integrity sha512-aPe6rrletyuEIt2axxgdtxljmzH8O/nrov4byy6pDw9S8inIrTV+2PnjyP/oFHMSynzGxJ2s6OHowBNMXp/Jzg== dependencies: "@babel/core" "^7.11.6" "@jest/types" "^29.2.1" @@ -796,12 +796,12 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.2.1.tgz#213c47e28072de11bdb98c9d29b89f2ab99664f1" - integrity sha512-gQJwArok0mqoREiCYhXKWOgUhElJj9DpnssW6GL8dG7ARYqHEhrM9fmPHTjdqEGRVXZAd6+imo3/Vwa8TjLcsw== +babel-jest@^29.2.2: + version "29.2.2" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.2.2.tgz#2c15abd8c2081293c9c3f4f80a4ed1d51542fee5" + integrity sha512-kkq2QSDIuvpgfoac3WZ1OOcHsQQDU5xYk2Ql7tLdJ8BVAYbefEXal+NfS45Y5LVZA7cxC8KYcQMObpCt1J025w== dependencies: - "@jest/transform" "^29.2.1" + "@jest/transform" "^29.2.2" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" babel-preset-jest "^29.2.0" @@ -1064,10 +1064,10 @@ electron-to-chromium@^1.4.251: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz#61046d1e4cab3a25238f6bf7413795270f125592" integrity sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA== -emittery@^0.10.2: - version "0.10.2" - resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.10.2.tgz#902eec8aedb8c41938c46e9385e9db7e03182933" - integrity sha512-aITqOwnLanpHLNXZJENbOgjUBeHocD+xsSJmNrjovKBW5HbSpW3d1pEls7GFQPUWXiwG9+0P4GtHfEqC/4M0Iw== +emittery@^0.13.1: + version "0.13.1" + resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.13.1.tgz#c04b8c3457490e0847ae51fced3af52d338e3dad" + integrity sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ== emoji-regex@^8.0.0: version "8.0.0" @@ -1256,14 +1256,14 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== -expect@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.2.1.tgz#25752d0df92d3daa5188dc8804de1f30759658cf" - integrity sha512-BJtA754Fba0YWRWHgjKUMTA3ltWarKgITXHQnbZ2mTxTXC4yMQlR0FI7HkB3fJYkhWBf4qjNiqvg3LDtXCcVRQ== +expect@^29.2.2: + version "29.2.2" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.2.2.tgz#ba2dd0d7e818727710324a6e7f13dd0e6d086106" + integrity sha512-hE09QerxZ5wXiOhqkXy5d2G9ar+EqOyifnCXCpMNu+vZ6DG9TJ6CO2c2kPDSLqERTTWrO7OZj8EkYHQqSd78Yw== dependencies: - "@jest/expect-utils" "^29.2.1" + "@jest/expect-utils" "^29.2.2" jest-get-type "^29.2.0" - jest-matcher-utils "^29.2.1" + jest-matcher-utils "^29.2.2" jest-message-util "^29.2.1" jest-util "^29.2.1" @@ -1602,13 +1602,13 @@ jest-changed-files@^29.2.0: execa "^5.0.0" p-limit "^3.1.0" -jest-circus@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.2.1.tgz#1385353d9bca6acf58f916068bbeffcfc95bef02" - integrity sha512-W+ZQQ5ln4Db2UZNM4NJIeasnhCdDhSuYW4eLgNAUi0XiSSpF634Kc5wiPvGiHvTgXMFVn1ZgWIijqhi9+kLNLg== +jest-circus@^29.2.2: + version "29.2.2" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.2.2.tgz#1dc4d35fd49bf5e64d3cc505fb2db396237a6dfa" + integrity sha512-upSdWxx+Mh4DV7oueuZndJ1NVdgtTsqM4YgywHEx05UMH5nxxA2Qu9T9T9XVuR021XxqSoaKvSmmpAbjwwwxMw== dependencies: - "@jest/environment" "^29.2.1" - "@jest/expect" "^29.2.1" + "@jest/environment" "^29.2.2" + "@jest/expect" "^29.2.2" "@jest/test-result" "^29.2.1" "@jest/types" "^29.2.1" "@types/node" "*" @@ -1617,56 +1617,56 @@ jest-circus@^29.2.1: dedent "^0.7.0" is-generator-fn "^2.0.0" jest-each "^29.2.1" - jest-matcher-utils "^29.2.1" + jest-matcher-utils "^29.2.2" jest-message-util "^29.2.1" - jest-runtime "^29.2.1" - jest-snapshot "^29.2.1" + jest-runtime "^29.2.2" + jest-snapshot "^29.2.2" jest-util "^29.2.1" p-limit "^3.1.0" pretty-format "^29.2.1" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.2.1.tgz#fbfa90b87b27a04e1041cc9d33ee80f32e2f2528" - integrity sha512-UIMD5aNqvPKpdlJSaeUAoLfxsh9TZvOkaMETx5qXnkboc317bcbb0eLHbIj8sFBHdcJAIAM+IRKnIU7Wi61MBw== +jest-cli@^29.2.2: + version "29.2.2" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.2.2.tgz#feaf0aa57d327e80d4f2f18d5f8cd2e77cac5371" + integrity sha512-R45ygnnb2CQOfd8rTPFR+/fls0d+1zXS6JPYTBBrnLPrhr58SSuPTiA5Tplv8/PXpz4zXR/AYNxmwIj6J6nrvg== dependencies: - "@jest/core" "^29.2.1" + "@jest/core" "^29.2.2" "@jest/test-result" "^29.2.1" "@jest/types" "^29.2.1" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.2.1" + jest-config "^29.2.2" jest-util "^29.2.1" - jest-validate "^29.2.1" + jest-validate "^29.2.2" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.2.1.tgz#2182af014d6c73978208626335db5134803dd183" - integrity sha512-EV5F1tQYW/quZV2br2o88hnYEeRzG53Dfi6rSG3TZBuzGQ6luhQBux/RLlU5QrJjCdq3LXxRRM8F1LP6DN1ycA== +jest-config@^29.2.2: + version "29.2.2" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.2.2.tgz#bf98623a46454d644630c1f0de8bba3f495c2d59" + integrity sha512-Q0JX54a5g1lP63keRfKR8EuC7n7wwny2HoTRDb8cx78IwQOiaYUVZAdjViY3WcTxpR02rPUpvNVmZ1fkIlZPcw== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.2.1" + "@jest/test-sequencer" "^29.2.2" "@jest/types" "^29.2.1" - babel-jest "^29.2.1" + babel-jest "^29.2.2" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^29.2.1" - jest-environment-node "^29.2.1" + jest-circus "^29.2.2" + jest-environment-node "^29.2.2" jest-get-type "^29.2.0" jest-regex-util "^29.2.0" - jest-resolve "^29.2.1" - jest-runner "^29.2.1" + jest-resolve "^29.2.2" + jest-runner "^29.2.2" jest-util "^29.2.1" - jest-validate "^29.2.1" + jest-validate "^29.2.2" micromatch "^4.0.4" parse-json "^5.2.0" pretty-format "^29.2.1" @@ -1701,16 +1701,16 @@ jest-each@^29.2.1: jest-util "^29.2.1" pretty-format "^29.2.1" -jest-environment-node@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.2.1.tgz#f90311d0f0e8ef720349f83c97a076e403f90665" - integrity sha512-PulFKwEMz6nTAdLUwglFKei3b/LixwlRiqTN6nvPE1JtrLtlnpd6LXnFI1NFHYJGlTmIWilMP2n9jEtPPKX50g== +jest-environment-node@^29.2.2: + version "29.2.2" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.2.2.tgz#a64b272773870c3a947cd338c25fd34938390bc2" + integrity sha512-B7qDxQjkIakQf+YyrqV5dICNs7tlCO55WJ4OMSXsqz1lpI/0PmeuXdx2F7eU8rnPbRkUR/fItSSUh0jvE2y/tw== dependencies: - "@jest/environment" "^29.2.1" - "@jest/fake-timers" "^29.2.1" + "@jest/environment" "^29.2.2" + "@jest/fake-timers" "^29.2.2" "@jest/types" "^29.2.1" "@types/node" "*" - jest-mock "^29.2.1" + jest-mock "^29.2.2" jest-util "^29.2.1" jest-get-type@^29.2.0: @@ -1745,10 +1745,10 @@ jest-leak-detector@^29.2.1: jest-get-type "^29.2.0" pretty-format "^29.2.1" -jest-matcher-utils@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.2.1.tgz#2bf876c5f891b33786aadf5d65d5da5970744122" - integrity sha512-hUTBh7H/Mnb6GTpihbLh8uF5rjAMdekfW/oZNXUMAXi7bbmym2HiRpzgqf/zzkjgejMrVAkPdVSQj+32enlUww== +jest-matcher-utils@^29.2.2: + version "29.2.2" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.2.2.tgz#9202f8e8d3a54733266784ce7763e9a08688269c" + integrity sha512-4DkJ1sDPT+UX2MR7Y3od6KtvRi9Im1ZGLGgdLFLm4lPexbTaCgJW5NN3IOXlQHF7NSHY/VHhflQ+WoKtD/vyCw== dependencies: chalk "^4.0.0" jest-diff "^29.2.1" @@ -1770,10 +1770,10 @@ jest-message-util@^29.2.1: slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.2.1.tgz#a0d361cffcb28184fa9c5443adbf591fa5759775" - integrity sha512-NDphaY/GqyQpTfnTZiTqqpMaw4Z0I7XnB7yBgrT6IwYrLGxpOhrejYr4ANY4YvO2sEGdd8Tx/6D0+WLQy7/qDA== +jest-mock@^29.2.2: + version "29.2.2" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.2.2.tgz#9045618b3f9d27074bbcf2d55bdca6a5e2e8bca7" + integrity sha512-1leySQxNAnivvbcx0sCB37itu8f4OX2S/+gxLAV4Z62shT4r4dTG9tACDywUAEZoLSr36aYUTsVp3WKwWt4PMQ== dependencies: "@jest/types" "^29.2.1" "@types/node" "*" @@ -1789,67 +1789,67 @@ jest-regex-util@^29.2.0: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.2.0.tgz#82ef3b587e8c303357728d0322d48bbfd2971f7b" integrity sha512-6yXn0kg2JXzH30cr2NlThF+70iuO/3irbaB4mh5WyqNIvLLP+B6sFdluO1/1RJmslyh/f9osnefECflHvTbwVA== -jest-resolve-dependencies@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.2.1.tgz#8d717dd41dc615fef1d412d395ea3deccfb1b9fa" - integrity sha512-o3mUGX2j08usj1jIAIE8KmUVpqVAn54k80kI27ldbZf2oJn6eghhB6DvJxjrcH40va9CQgWTfU5f2Ag/MoUqgQ== +jest-resolve-dependencies@^29.2.2: + version "29.2.2" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.2.2.tgz#1f444766f37a25f1490b5137408b6ff746a05d64" + integrity sha512-wWOmgbkbIC2NmFsq8Lb+3EkHuW5oZfctffTGvwsA4JcJ1IRk8b2tg+hz44f0lngvRTeHvp3Kyix9ACgudHH9aQ== dependencies: jest-regex-util "^29.2.0" - jest-snapshot "^29.2.1" + jest-snapshot "^29.2.2" -jest-resolve@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.2.1.tgz#a4d2f76db88aeb6ec5f5453c9a40b52483d17799" - integrity sha512-1dJTW76Z9622Viq4yRcwBuEXuzGtE9B2kdl05RC8Om/lAzac9uEgC+M8Q5osVidbuBPmxm8wSrcItYhca2ZAtQ== +jest-resolve@^29.2.2: + version "29.2.2" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.2.2.tgz#ad6436053b0638b41e12bbddde2b66e1397b35b5" + integrity sha512-3gaLpiC3kr14rJR3w7vWh0CBX2QAhfpfiQTwrFPvVrcHe5VUBtIXaR004aWE/X9B2CFrITOQAp5gxLONGrk6GA== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" jest-haste-map "^29.2.1" jest-pnp-resolver "^1.2.2" jest-util "^29.2.1" - jest-validate "^29.2.1" + jest-validate "^29.2.2" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.2.1.tgz#885afe64661cb2f51f84c1b97afb713d1093c124" - integrity sha512-PojFI+uVhQ4u4YZKCN/a3yU0/l/pJJXhq1sW3JpCp8CyvGBYGddRFPKZ1WihApusxqWRTHjBJmGyPWv6Av2lWA== +jest-runner@^29.2.2: + version "29.2.2" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.2.2.tgz#6b5302ed15eba8bf05e6b14d40f1e8d469564da3" + integrity sha512-1CpUxXDrbsfy9Hr9/1zCUUhT813kGGK//58HeIw/t8fa/DmkecEwZSWlb1N/xDKXg3uCFHQp1GCvlSClfImMxg== dependencies: "@jest/console" "^29.2.1" - "@jest/environment" "^29.2.1" + "@jest/environment" "^29.2.2" "@jest/test-result" "^29.2.1" - "@jest/transform" "^29.2.1" + "@jest/transform" "^29.2.2" "@jest/types" "^29.2.1" "@types/node" "*" chalk "^4.0.0" - emittery "^0.10.2" + emittery "^0.13.1" graceful-fs "^4.2.9" jest-docblock "^29.2.0" - jest-environment-node "^29.2.1" + jest-environment-node "^29.2.2" jest-haste-map "^29.2.1" jest-leak-detector "^29.2.1" jest-message-util "^29.2.1" - jest-resolve "^29.2.1" - jest-runtime "^29.2.1" + jest-resolve "^29.2.2" + jest-runtime "^29.2.2" jest-util "^29.2.1" - jest-watcher "^29.2.1" + jest-watcher "^29.2.2" jest-worker "^29.2.1" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.2.1.tgz#62e3a23c33710ae4d9c3304dda851a5fb225b574" - integrity sha512-PSQ880OoIW9y8E6/jjhGn3eQNgNc6ndMzCZaKqy357bv7FqCfSyYepu3yDC6Sp1Vkt+GhP2M/PVgldS2uZSFZg== +jest-runtime@^29.2.2: + version "29.2.2" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.2.2.tgz#4068ee82423769a481460efd21d45a8efaa5c179" + integrity sha512-TpR1V6zRdLynckKDIQaY41od4o0xWL+KOPUCZvJK2bu5P1UXhjobt5nJ2ICNeIxgyj9NGkO0aWgDqYPVhDNKjA== dependencies: - "@jest/environment" "^29.2.1" - "@jest/fake-timers" "^29.2.1" - "@jest/globals" "^29.2.1" + "@jest/environment" "^29.2.2" + "@jest/fake-timers" "^29.2.2" + "@jest/globals" "^29.2.2" "@jest/source-map" "^29.2.0" "@jest/test-result" "^29.2.1" - "@jest/transform" "^29.2.1" + "@jest/transform" "^29.2.2" "@jest/types" "^29.2.1" "@types/node" "*" chalk "^4.0.0" @@ -1859,18 +1859,18 @@ jest-runtime@^29.2.1: graceful-fs "^4.2.9" jest-haste-map "^29.2.1" jest-message-util "^29.2.1" - jest-mock "^29.2.1" + jest-mock "^29.2.2" jest-regex-util "^29.2.0" - jest-resolve "^29.2.1" - jest-snapshot "^29.2.1" + jest-resolve "^29.2.2" + jest-snapshot "^29.2.2" jest-util "^29.2.1" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.2.1.tgz#f3843b3099c8fec7e6218dea18cc506f10ea5d30" - integrity sha512-KZdLD7iEz5M4ZYd+ezZ/kk73z+DtNbk/yJ4Qx7408Vb0CCuclJIZPa/HmIwSsCfIlOBNcYTKufr7x/Yv47oYlg== +jest-snapshot@^29.2.2: + version "29.2.2" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.2.2.tgz#1016ce60297b77382386bad561107174604690c2" + integrity sha512-GfKJrpZ5SMqhli3NJ+mOspDqtZfJBryGA8RIBxF+G+WbDoC7HCqKaeAss4Z/Sab6bAW11ffasx8/vGsj83jyjA== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" @@ -1878,19 +1878,19 @@ jest-snapshot@^29.2.1: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.2.1" - "@jest/transform" "^29.2.1" + "@jest/expect-utils" "^29.2.2" + "@jest/transform" "^29.2.2" "@jest/types" "^29.2.1" "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.2.1" + expect "^29.2.2" graceful-fs "^4.2.9" jest-diff "^29.2.1" jest-get-type "^29.2.0" jest-haste-map "^29.2.1" - jest-matcher-utils "^29.2.1" + jest-matcher-utils "^29.2.2" jest-message-util "^29.2.1" jest-util "^29.2.1" natural-compare "^1.4.0" @@ -1909,10 +1909,10 @@ jest-util@^29.2.1: graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.2.1.tgz#db814ce12c4c7e4746044922762e56eb177d066c" - integrity sha512-DZVX5msG6J6DL5vUUw+++6LEkXUsPwB5R7fsfM7BXdz2Ipr0Ib046ak+8egrwAR++pvSM/5laxLK977ieIGxkQ== +jest-validate@^29.2.2: + version "29.2.2" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.2.2.tgz#e43ce1931292dfc052562a11bc681af3805eadce" + integrity sha512-eJXATaKaSnOuxNfs8CLHgdABFgUrd0TtWS8QckiJ4L/QVDF4KVbZFBBOwCBZHOS0Rc5fOxqngXeGXE3nGQkpQA== dependencies: "@jest/types" "^29.2.1" camelcase "^6.2.0" @@ -1921,17 +1921,17 @@ jest-validate@^29.2.1: leven "^3.1.0" pretty-format "^29.2.1" -jest-watcher@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.2.1.tgz#1cb91f8aa9e77b1332af139944ad65e51430d7c3" - integrity sha512-7jFaHUaRq50l4w/f6RuY713bvI5XskMmjWCE54NGYcY74fLkShS8LucXJke1QfGnwDSCoIqGnGGGKPwdaBYz2Q== +jest-watcher@^29.2.2: + version "29.2.2" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.2.2.tgz#7093d4ea8177e0a0da87681a9e7b09a258b9daf7" + integrity sha512-j2otfqh7mOvMgN2WlJ0n7gIx9XCMWntheYGlBK7+5g3b1Su13/UAK7pdKGyd4kDlrLwtH2QPvRv5oNIxWvsJ1w== dependencies: "@jest/test-result" "^29.2.1" "@jest/types" "^29.2.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - emittery "^0.10.2" + emittery "^0.13.1" jest-util "^29.2.1" string-length "^4.0.1" @@ -1946,14 +1946,14 @@ jest-worker@^29.2.1: supports-color "^8.0.0" jest@^29.0.0: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.2.1.tgz#352ec0b81a0e436691d546d984cd7d8f72ffd26a" - integrity sha512-K0N+7rx+fv3Us3KhuwRSJt55MMpZPs9Q3WSO/spRZSnsalX8yEYOTQ1PiSN7OvqzoRX4JEUXCbOJRlP4n8m5LA== + version "29.2.2" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.2.2.tgz#24da83cbbce514718acd698926b7679109630476" + integrity sha512-r+0zCN9kUqoON6IjDdjbrsWobXM/09Nd45kIPRD8kloaRh1z5ZCMdVsgLXGxmlL7UpAJsvCYOQNO+NjvG/gqiQ== dependencies: - "@jest/core" "^29.2.1" + "@jest/core" "^29.2.2" "@jest/types" "^29.2.1" import-local "^3.0.2" - jest-cli "^29.2.1" + jest-cli "^29.2.2" js-sdsl@^4.1.4: version "4.1.5" From 7cc3ca879baaa5b822c4510a231a990bfcf26c1e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Oct 2022 12:01:34 +0000 Subject: [PATCH 670/785] Bump prettier from 3.0.0-alpha.3 to 3.0.0-alpha.4 Bumps [prettier](https://github.com/prettier/prettier) from 3.0.0-alpha.3 to 3.0.0-alpha.4. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/3.0.0-alpha.3...3.0.0-alpha.4) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 444b8ede..ad2c5cf6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2265,9 +2265,9 @@ prelude-ls@^1.2.1: integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== prettier@>=3.0.0-alpha.2: - version "3.0.0-alpha.3" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0-alpha.3.tgz#21c35c12792dc0e1d04dd00efe0976f383928f58" - integrity sha512-gYWrMcU3iMwG+PSPU2KnprIKslFDW+mslyA8DCrCASO9z1+rEog82WzoYtP7Kh7QglVepKjl94iJFfRPTens2A== + version "3.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0-alpha.4.tgz#eee71d6b520b970f44e4045f2dc772bf6f80815f" + integrity sha512-+KeqJv4E5kaRsDRgSx9IeVygLKGHRmcoPvRJvPFp3bC1mw8opsva555gGb8TaJzUiHXoLZcus1EX+nlHPda7Pw== pretty-format@^29.2.1: version "29.2.1" From 715747fd45741da72b1a727538263703d35e18fb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Nov 2022 12:01:11 +0000 Subject: [PATCH 671/785] Bump eslint from 8.26.0 to 8.27.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.26.0 to 8.27.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.26.0...v8.27.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index ad2c5cf6..9aa6beeb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1139,9 +1139,9 @@ eslint-visitor-keys@^3.3.0: integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.15.0: - version "8.26.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.26.0.tgz#2bcc8836e6c424c4ac26a5674a70d44d84f2181d" - integrity sha512-kzJkpaw1Bfwheq4VXUezFriD1GxszX6dUekM7Z3aC2o4hju+tsR/XyTC3RcoSD7jmy9VkPU3+N6YjVU2e96Oyg== + version "8.27.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.27.0.tgz#d547e2f7239994ad1faa4bb5d84e5d809db7cf64" + integrity sha512-0y1bfG2ho7mty+SiILVf9PfuRA49ek4Nc60Wmmu62QlobNR+CeXa4xXIJgcuwSQgZiWaPH+5BDsctpIW0PR/wQ== dependencies: "@eslint/eslintrc" "^1.3.3" "@humanwhocodes/config-array" "^0.11.6" From bb09b33c0d8150670b4bdf084a30be8f75d3dc9a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Nov 2022 12:04:22 +0000 Subject: [PATCH 672/785] Bump husky from 8.0.1 to 8.0.2 Bumps [husky](https://github.com/typicode/husky) from 8.0.1 to 8.0.2. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v8.0.1...v8.0.2) --- updated-dependencies: - dependency-name: husky dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9aa6beeb..aeb4010e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1455,9 +1455,9 @@ human-signals@^2.1.0: integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== husky@^8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.1.tgz#511cb3e57de3e3190514ae49ed50f6bc3f50b3e9" - integrity sha512-xs7/chUH/CKdOCs7Zy0Aev9e/dKOMZf3K1Az1nar3tzlv0jfqnYtu235bstsWTmXOR0EfINrPa97yy4Lz6RiKw== + version "8.0.2" + resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.2.tgz#5816a60db02650f1f22c8b69b928fd6bcd77a236" + integrity sha512-Tkv80jtvbnkK3mYWxPZePGFpQ/tT3HNSs/sasF9P2YfkMezDl3ON37YN6jUUI4eTg5LcyVynlb6r4eyvOmspvg== ignore@^5.1.4, ignore@^5.2.0: version "5.2.0" From 87d4b37d42c3433f61f02991f1e6a44fe123cb07 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Nov 2022 12:05:38 +0000 Subject: [PATCH 673/785] Bump jest from 29.2.2 to 29.3.0 Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.2.2 to 29.3.0. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.3.0/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 311 +++++++++++++++++++++++++++--------------------------- 1 file changed, 158 insertions(+), 153 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9aa6beeb..996d2df6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -359,15 +359,15 @@ jest-util "^29.2.1" slash "^3.0.0" -"@jest/core@^29.2.2": - version "29.2.2" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.2.2.tgz#207aa8973d9de8769f9518732bc5f781efc3ffa7" - integrity sha512-susVl8o2KYLcZhhkvSB+b7xX575CX3TmSvxfeDjpRko7KmT89rHkXj6XkDkNpSeFMBzIENw5qIchO9HC9Sem+A== +"@jest/core@^29.3.0": + version "29.3.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.3.0.tgz#7042d3fd673b51d89d6f6bf8b9f85fb65573629e" + integrity sha512-5DyNvV8452bwqcYyXHCYaAD8UrTiWosrhBY+rc0MBMyXyDzcIL+w5gdlCYhlHbNsHoWnf4nUbRmg++LWfWVtMQ== dependencies: "@jest/console" "^29.2.1" - "@jest/reporters" "^29.2.2" + "@jest/reporters" "^29.3.0" "@jest/test-result" "^29.2.1" - "@jest/transform" "^29.2.2" + "@jest/transform" "^29.3.0" "@jest/types" "^29.2.1" "@types/node" "*" ansi-escapes "^4.2.1" @@ -376,15 +376,15 @@ exit "^0.1.2" graceful-fs "^4.2.9" jest-changed-files "^29.2.0" - jest-config "^29.2.2" - jest-haste-map "^29.2.1" + jest-config "^29.3.0" + jest-haste-map "^29.3.0" jest-message-util "^29.2.1" jest-regex-util "^29.2.0" - jest-resolve "^29.2.2" - jest-resolve-dependencies "^29.2.2" - jest-runner "^29.2.2" - jest-runtime "^29.2.2" - jest-snapshot "^29.2.2" + jest-resolve "^29.3.0" + jest-resolve-dependencies "^29.3.0" + jest-runner "^29.3.0" + jest-runtime "^29.3.0" + jest-snapshot "^29.3.0" jest-util "^29.2.1" jest-validate "^29.2.2" jest-watcher "^29.2.2" @@ -393,15 +393,15 @@ slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.2.2": - version "29.2.2" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.2.2.tgz#481e729048d42e87d04842c38aa4d09c507f53b0" - integrity sha512-OWn+Vhu0I1yxuGBJEFFekMYc8aGBGrY4rt47SOh/IFaI+D7ZHCk7pKRiSoZ2/Ml7b0Ony3ydmEHRx/tEOC7H1A== +"@jest/environment@^29.3.0": + version "29.3.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.3.0.tgz#e7bfe22531813f86040feb75c046faab32fd534d" + integrity sha512-8wgn3br51bx+7rgC8FOKmAD62Q39iswdiy5/p6acoekp/9Bb/IQbh3zydOrnGp74LwStSrKgpQSKBlOKlAQq0g== dependencies: - "@jest/fake-timers" "^29.2.2" + "@jest/fake-timers" "^29.3.0" "@jest/types" "^29.2.1" "@types/node" "*" - jest-mock "^29.2.2" + jest-mock "^29.3.0" "@jest/expect-utils@^29.2.2": version "29.2.2" @@ -410,45 +410,45 @@ dependencies: jest-get-type "^29.2.0" -"@jest/expect@^29.2.2": - version "29.2.2" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.2.2.tgz#81edbd33afbde7795ca07ff6b4753d15205032e4" - integrity sha512-zwblIZnrIVt8z/SiEeJ7Q9wKKuB+/GS4yZe9zw7gMqfGf4C5hBLGrVyxu1SzDbVSqyMSlprKl3WL1r80cBNkgg== +"@jest/expect@^29.3.0": + version "29.3.0" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.3.0.tgz#06907ffc02541c8d5186e8324765a72f391f3125" + integrity sha512-Lz/3x4Se5g6nBuLjTO+xE8D4OXY9fFmosZPwkXXZUJUsp9r9seN81cJa54wOGr1QjCQnhngMqclblhM4X/hcCg== dependencies: - expect "^29.2.2" - jest-snapshot "^29.2.2" + expect "^29.3.0" + jest-snapshot "^29.3.0" -"@jest/fake-timers@^29.2.2": - version "29.2.2" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.2.2.tgz#d8332e6e3cfa99cde4bc87d04a17d6b699deb340" - integrity sha512-nqaW3y2aSyZDl7zQ7t1XogsxeavNpH6kkdq+EpXncIDvAkjvFD7hmhcIs1nWloengEWUoWqkqSA6MSbf9w6DgA== +"@jest/fake-timers@^29.3.0": + version "29.3.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.3.0.tgz#ffa74e5b2937676849866cac79cac6a742697f00" + integrity sha512-SzmWtN6Rld+xebMRGuWeMGhytc7qHnYfFk1Zd/1QavQWsFOmA9SgtvGHCBue1wXQhdDMaSIm1aPGj2Zmyrr1Zg== dependencies: "@jest/types" "^29.2.1" "@sinonjs/fake-timers" "^9.1.2" "@types/node" "*" jest-message-util "^29.2.1" - jest-mock "^29.2.2" + jest-mock "^29.3.0" jest-util "^29.2.1" -"@jest/globals@^29.2.2": - version "29.2.2" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.2.2.tgz#205ff1e795aa774301c2c0ba0be182558471b845" - integrity sha512-/nt+5YMh65kYcfBhj38B3Hm0Trk4IsuMXNDGKE/swp36yydBWfz3OXkLqkSvoAtPW8IJMSJDFCbTM2oj5SNprw== +"@jest/globals@^29.3.0": + version "29.3.0" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.3.0.tgz#f58c14d727fd7d02d7851bc03fc0445eefa2dbe2" + integrity sha512-okYDVzYNrt/4ysR8XnX6u0I1bGG4kmfdXtUu7kwWHZ9OP13RCjmphgve0tfOrNluwksWvOPYS1f/HOrFTHLygQ== dependencies: - "@jest/environment" "^29.2.2" - "@jest/expect" "^29.2.2" + "@jest/environment" "^29.3.0" + "@jest/expect" "^29.3.0" "@jest/types" "^29.2.1" - jest-mock "^29.2.2" + jest-mock "^29.3.0" -"@jest/reporters@^29.2.2": - version "29.2.2" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.2.2.tgz#69b395f79c3a97ce969ce05ccf1a482e5d6de290" - integrity sha512-AzjL2rl2zJC0njIzcooBvjA4sJjvdoq98sDuuNs4aNugtLPSQ+91nysGKRF0uY1to5k0MdGMdOBggUsPqvBcpA== +"@jest/reporters@^29.3.0": + version "29.3.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.3.0.tgz#e5e2af97d7754510393d7c04084744841cce2eaf" + integrity sha512-MV76tB3Kd80vcv2yMDZfQpMkwkHaY9hlvVhCtHXkVRCWwN+SX3EOmCdX8pT/X4Xh+NusA7l2Rc3yhx4q5p3+Fg== dependencies: "@bcoe/v8-coverage" "^0.2.3" "@jest/console" "^29.2.1" "@jest/test-result" "^29.2.1" - "@jest/transform" "^29.2.2" + "@jest/transform" "^29.3.0" "@jest/types" "^29.2.1" "@jridgewell/trace-mapping" "^0.3.15" "@types/node" "*" @@ -464,7 +464,7 @@ istanbul-reports "^3.1.3" jest-message-util "^29.2.1" jest-util "^29.2.1" - jest-worker "^29.2.1" + jest-worker "^29.3.0" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" @@ -496,30 +496,30 @@ "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.2.2": - version "29.2.2" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.2.2.tgz#4ac7487b237e517a1f55e7866fb5553f6e0168b9" - integrity sha512-Cuc1znc1pl4v9REgmmLf0jBd3Y65UXJpioGYtMr/JNpQEIGEzkmHhy6W6DLbSsXeUA13TDzymPv0ZGZ9jH3eIw== +"@jest/test-sequencer@^29.3.0": + version "29.3.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.3.0.tgz#0c2198fe482c26d763abbcb183992ae769bb7978" + integrity sha512-XQlTP/S6Yf6NKV0Mt4oopFKyDxiEkDMD7hIFcCTeltKQszE0Z+LI5KLukwNW6Qxr1YzaZ/s6PlKJusiCLJNTcw== dependencies: "@jest/test-result" "^29.2.1" graceful-fs "^4.2.9" - jest-haste-map "^29.2.1" + jest-haste-map "^29.3.0" slash "^3.0.0" -"@jest/transform@^29.2.2": - version "29.2.2" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.2.2.tgz#dfc03fc092b31ffea0c55917728e75bfcf8b5de6" - integrity sha512-aPe6rrletyuEIt2axxgdtxljmzH8O/nrov4byy6pDw9S8inIrTV+2PnjyP/oFHMSynzGxJ2s6OHowBNMXp/Jzg== +"@jest/transform@^29.3.0": + version "29.3.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.3.0.tgz#7f71c9596d5bad1613a3a5eb26729dd84fc71a5a" + integrity sha512-4T8h61ItCakAlJkdYa7XVWP3r39QldlCeOSNmRpiJisi5PrrlzwZdpJDIH13ZZjh+MlSPQ2cq8YbUs3TuH+tRA== dependencies: "@babel/core" "^7.11.6" "@jest/types" "^29.2.1" "@jridgewell/trace-mapping" "^0.3.15" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" - convert-source-map "^1.4.0" + convert-source-map "^2.0.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.2.1" + jest-haste-map "^29.3.0" jest-regex-util "^29.2.0" jest-util "^29.2.1" micromatch "^4.0.4" @@ -796,12 +796,12 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^29.2.2: - version "29.2.2" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.2.2.tgz#2c15abd8c2081293c9c3f4f80a4ed1d51542fee5" - integrity sha512-kkq2QSDIuvpgfoac3WZ1OOcHsQQDU5xYk2Ql7tLdJ8BVAYbefEXal+NfS45Y5LVZA7cxC8KYcQMObpCt1J025w== +babel-jest@^29.3.0: + version "29.3.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.3.0.tgz#31fd7ef97dd6a77ddd1b4ab1f8cf77c29e20bb5c" + integrity sha512-LzQWdGm6hUugVeyGpIKI/T4SVT+PgAA5WFPqBDbneK7C/PqfckNb0tc4KvcKXq/PLA1yY6wTvB8Bc/REQdUxFg== dependencies: - "@jest/transform" "^29.2.2" + "@jest/transform" "^29.3.0" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" babel-preset-jest "^29.2.0" @@ -1006,11 +1006,16 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== -convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: +convert-source-map@^1.6.0, convert-source-map@^1.7.0: version "1.9.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== +convert-source-map@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" + integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== + cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -1256,10 +1261,10 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== -expect@^29.2.2: - version "29.2.2" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.2.2.tgz#ba2dd0d7e818727710324a6e7f13dd0e6d086106" - integrity sha512-hE09QerxZ5wXiOhqkXy5d2G9ar+EqOyifnCXCpMNu+vZ6DG9TJ6CO2c2kPDSLqERTTWrO7OZj8EkYHQqSd78Yw== +expect@^29.3.0: + version "29.3.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.3.0.tgz#2dad3a73ac837dd8074ff91d25cf1614c3e91504" + integrity sha512-bms139btnQNZh4uxCPmzbWz46YOjtEpYIZ847OfY9GCeSBEfzedHWH0CkdR20Sy+XBs8/FI2lFJPZiuH0NGv+w== dependencies: "@jest/expect-utils" "^29.2.2" jest-get-type "^29.2.0" @@ -1602,13 +1607,13 @@ jest-changed-files@^29.2.0: execa "^5.0.0" p-limit "^3.1.0" -jest-circus@^29.2.2: - version "29.2.2" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.2.2.tgz#1dc4d35fd49bf5e64d3cc505fb2db396237a6dfa" - integrity sha512-upSdWxx+Mh4DV7oueuZndJ1NVdgtTsqM4YgywHEx05UMH5nxxA2Qu9T9T9XVuR021XxqSoaKvSmmpAbjwwwxMw== +jest-circus@^29.3.0: + version "29.3.0" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.3.0.tgz#997354276d24706e14549cab98ac2995d63c92fd" + integrity sha512-xL1cmbUGBGy923KBZpZ2LRKspHlIhrltrwGaefJ677HXCPY5rTF758BtweamBype2ogcSEK/oqcp1SmYZ/ATig== dependencies: - "@jest/environment" "^29.2.2" - "@jest/expect" "^29.2.2" + "@jest/environment" "^29.3.0" + "@jest/expect" "^29.3.0" "@jest/test-result" "^29.2.1" "@jest/types" "^29.2.1" "@types/node" "*" @@ -1619,52 +1624,52 @@ jest-circus@^29.2.2: jest-each "^29.2.1" jest-matcher-utils "^29.2.2" jest-message-util "^29.2.1" - jest-runtime "^29.2.2" - jest-snapshot "^29.2.2" + jest-runtime "^29.3.0" + jest-snapshot "^29.3.0" jest-util "^29.2.1" p-limit "^3.1.0" pretty-format "^29.2.1" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.2.2: - version "29.2.2" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.2.2.tgz#feaf0aa57d327e80d4f2f18d5f8cd2e77cac5371" - integrity sha512-R45ygnnb2CQOfd8rTPFR+/fls0d+1zXS6JPYTBBrnLPrhr58SSuPTiA5Tplv8/PXpz4zXR/AYNxmwIj6J6nrvg== +jest-cli@^29.3.0: + version "29.3.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.3.0.tgz#7ca1913f6088570ae58bbb312d70500e00120d41" + integrity sha512-rDb9iasZvqTkgrlwzVGemR5i20T0/XN1ug46Ch2vxTRa0zS5PHaVXQXYzYbuLFHs1xpc+XsB9xPfEkkwbnLJBg== dependencies: - "@jest/core" "^29.2.2" + "@jest/core" "^29.3.0" "@jest/test-result" "^29.2.1" "@jest/types" "^29.2.1" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.2.2" + jest-config "^29.3.0" jest-util "^29.2.1" jest-validate "^29.2.2" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^29.2.2: - version "29.2.2" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.2.2.tgz#bf98623a46454d644630c1f0de8bba3f495c2d59" - integrity sha512-Q0JX54a5g1lP63keRfKR8EuC7n7wwny2HoTRDb8cx78IwQOiaYUVZAdjViY3WcTxpR02rPUpvNVmZ1fkIlZPcw== +jest-config@^29.3.0: + version "29.3.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.3.0.tgz#4b30188390636106414ea6b43aa6b2fb30d1a54d" + integrity sha512-sTSDs/M+//njznsytxiBxwfDnSWRb6OqiNSlO/B2iw1HUaa1YLsdWmV4AWLXss1XKzv1F0yVK+kA4XOhZ0I1qQ== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.2.2" + "@jest/test-sequencer" "^29.3.0" "@jest/types" "^29.2.1" - babel-jest "^29.2.2" + babel-jest "^29.3.0" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^29.2.2" - jest-environment-node "^29.2.2" + jest-circus "^29.3.0" + jest-environment-node "^29.3.0" jest-get-type "^29.2.0" jest-regex-util "^29.2.0" - jest-resolve "^29.2.2" - jest-runner "^29.2.2" + jest-resolve "^29.3.0" + jest-runner "^29.3.0" jest-util "^29.2.1" jest-validate "^29.2.2" micromatch "^4.0.4" @@ -1701,16 +1706,16 @@ jest-each@^29.2.1: jest-util "^29.2.1" pretty-format "^29.2.1" -jest-environment-node@^29.2.2: - version "29.2.2" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.2.2.tgz#a64b272773870c3a947cd338c25fd34938390bc2" - integrity sha512-B7qDxQjkIakQf+YyrqV5dICNs7tlCO55WJ4OMSXsqz1lpI/0PmeuXdx2F7eU8rnPbRkUR/fItSSUh0jvE2y/tw== +jest-environment-node@^29.3.0: + version "29.3.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.3.0.tgz#aed95a8e566d80f9f8564fba01ca5caa9d0aa59a" + integrity sha512-oikVE5pyiBUMrqi7J/kFGd1zeT14+EnJulyqzopDNijLX13ygwjiOF/GVpVKSGyBrrAwSkaj/ohEQJCcjkCtOA== dependencies: - "@jest/environment" "^29.2.2" - "@jest/fake-timers" "^29.2.2" + "@jest/environment" "^29.3.0" + "@jest/fake-timers" "^29.3.0" "@jest/types" "^29.2.1" "@types/node" "*" - jest-mock "^29.2.2" + jest-mock "^29.3.0" jest-util "^29.2.1" jest-get-type@^29.2.0: @@ -1718,10 +1723,10 @@ jest-get-type@^29.2.0: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.2.0.tgz#726646f927ef61d583a3b3adb1ab13f3a5036408" integrity sha512-uXNJlg8hKFEnDgFsrCjznB+sTxdkuqiCL6zMgA75qEbAJjJYTs9XPrvDctrEig2GDow22T/LvHgO57iJhXB/UA== -jest-haste-map@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.2.1.tgz#f803fec57f8075e6c55fb5cd551f99a72471c699" - integrity sha512-wF460rAFmYc6ARcCFNw4MbGYQjYkvjovb9GBT+W10Um8q5nHq98jD6fHZMDMO3tA56S8XnmNkM8GcA8diSZfnA== +jest-haste-map@^29.3.0: + version "29.3.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.3.0.tgz#9786f501ed6ab1c7adc35d3f83c1c21ed4172c77" + integrity sha512-ugdLIreycMRRg3+6AjiExECmuFI2D9PS+BmNU7eGvBt3fzVMKybb9USAZXN6kw4Q6Mn8DSK+7OFCloY2rN820Q== dependencies: "@jest/types" "^29.2.1" "@types/graceful-fs" "^4.1.3" @@ -1731,7 +1736,7 @@ jest-haste-map@^29.2.1: graceful-fs "^4.2.9" jest-regex-util "^29.2.0" jest-util "^29.2.1" - jest-worker "^29.2.1" + jest-worker "^29.3.0" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: @@ -1770,10 +1775,10 @@ jest-message-util@^29.2.1: slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^29.2.2: - version "29.2.2" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.2.2.tgz#9045618b3f9d27074bbcf2d55bdca6a5e2e8bca7" - integrity sha512-1leySQxNAnivvbcx0sCB37itu8f4OX2S/+gxLAV4Z62shT4r4dTG9tACDywUAEZoLSr36aYUTsVp3WKwWt4PMQ== +jest-mock@^29.3.0: + version "29.3.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.3.0.tgz#aa6f1d5118fd4b9d007df782e0624e6efab6d33d" + integrity sha512-BRKfsAaeP3pTWeog+1D0ILeJF96SzB6y3k0JDxY63kssxiUy9nDLHmNUoVkBGILjMbpHULhbzVTsb3harPXuUQ== dependencies: "@jest/types" "^29.2.1" "@types/node" "*" @@ -1789,22 +1794,22 @@ jest-regex-util@^29.2.0: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.2.0.tgz#82ef3b587e8c303357728d0322d48bbfd2971f7b" integrity sha512-6yXn0kg2JXzH30cr2NlThF+70iuO/3irbaB4mh5WyqNIvLLP+B6sFdluO1/1RJmslyh/f9osnefECflHvTbwVA== -jest-resolve-dependencies@^29.2.2: - version "29.2.2" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.2.2.tgz#1f444766f37a25f1490b5137408b6ff746a05d64" - integrity sha512-wWOmgbkbIC2NmFsq8Lb+3EkHuW5oZfctffTGvwsA4JcJ1IRk8b2tg+hz44f0lngvRTeHvp3Kyix9ACgudHH9aQ== +jest-resolve-dependencies@^29.3.0: + version "29.3.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.3.0.tgz#9a2c3389d1a4cce95445f7c34b0b25f44fff9fad" + integrity sha512-ykSbDbWmIaHprOBig57AExw7i6Fj0y69M6baiAd75Ivx1UMQt4wsM6A+SNqIhycV6Zy8XV3L40Ac3HYSrDSq7w== dependencies: jest-regex-util "^29.2.0" - jest-snapshot "^29.2.2" + jest-snapshot "^29.3.0" -jest-resolve@^29.2.2: - version "29.2.2" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.2.2.tgz#ad6436053b0638b41e12bbddde2b66e1397b35b5" - integrity sha512-3gaLpiC3kr14rJR3w7vWh0CBX2QAhfpfiQTwrFPvVrcHe5VUBtIXaR004aWE/X9B2CFrITOQAp5gxLONGrk6GA== +jest-resolve@^29.3.0: + version "29.3.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.3.0.tgz#038711e9af86f4b4f55a407db14310bc57a8beb4" + integrity sha512-xH6C6loDlOWEWHdCgioLDlbpmsolNdNsV/UR35ChuK217x0ttHuhyEPdh5wa6CTQ/Eq4OGW2/EZTlh0ay5aojQ== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^29.2.1" + jest-haste-map "^29.3.0" jest-pnp-resolver "^1.2.2" jest-util "^29.2.1" jest-validate "^29.2.2" @@ -1812,44 +1817,44 @@ jest-resolve@^29.2.2: resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^29.2.2: - version "29.2.2" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.2.2.tgz#6b5302ed15eba8bf05e6b14d40f1e8d469564da3" - integrity sha512-1CpUxXDrbsfy9Hr9/1zCUUhT813kGGK//58HeIw/t8fa/DmkecEwZSWlb1N/xDKXg3uCFHQp1GCvlSClfImMxg== +jest-runner@^29.3.0: + version "29.3.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.3.0.tgz#fc255482594c1536a34e2b41f610355c4f3d2ee6" + integrity sha512-E/ROzAVj7gy44FvIe+Tbz0xGWG1sa8WLkhUg/hsXHewPC0Z48kqWySdfYRtXkB7RmMn4OcWE+hIBfsRAMVV+sQ== dependencies: "@jest/console" "^29.2.1" - "@jest/environment" "^29.2.2" + "@jest/environment" "^29.3.0" "@jest/test-result" "^29.2.1" - "@jest/transform" "^29.2.2" + "@jest/transform" "^29.3.0" "@jest/types" "^29.2.1" "@types/node" "*" chalk "^4.0.0" emittery "^0.13.1" graceful-fs "^4.2.9" jest-docblock "^29.2.0" - jest-environment-node "^29.2.2" - jest-haste-map "^29.2.1" + jest-environment-node "^29.3.0" + jest-haste-map "^29.3.0" jest-leak-detector "^29.2.1" jest-message-util "^29.2.1" - jest-resolve "^29.2.2" - jest-runtime "^29.2.2" + jest-resolve "^29.3.0" + jest-runtime "^29.3.0" jest-util "^29.2.1" jest-watcher "^29.2.2" - jest-worker "^29.2.1" + jest-worker "^29.3.0" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^29.2.2: - version "29.2.2" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.2.2.tgz#4068ee82423769a481460efd21d45a8efaa5c179" - integrity sha512-TpR1V6zRdLynckKDIQaY41od4o0xWL+KOPUCZvJK2bu5P1UXhjobt5nJ2ICNeIxgyj9NGkO0aWgDqYPVhDNKjA== +jest-runtime@^29.3.0: + version "29.3.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.3.0.tgz#e44f838f469ab1f6b524178bae6233697748eb27" + integrity sha512-ufgX/hbpa7MLnjWRW82T5mVF73FBk3W38dGCLPXWtYZ5Zr1ZFh8QnaAtITKJt0p3kGXR8ZqlIjadSiBTk/QJ/A== dependencies: - "@jest/environment" "^29.2.2" - "@jest/fake-timers" "^29.2.2" - "@jest/globals" "^29.2.2" + "@jest/environment" "^29.3.0" + "@jest/fake-timers" "^29.3.0" + "@jest/globals" "^29.3.0" "@jest/source-map" "^29.2.0" "@jest/test-result" "^29.2.1" - "@jest/transform" "^29.2.2" + "@jest/transform" "^29.3.0" "@jest/types" "^29.2.1" "@types/node" "*" chalk "^4.0.0" @@ -1857,20 +1862,20 @@ jest-runtime@^29.2.2: collect-v8-coverage "^1.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^29.2.1" + jest-haste-map "^29.3.0" jest-message-util "^29.2.1" - jest-mock "^29.2.2" + jest-mock "^29.3.0" jest-regex-util "^29.2.0" - jest-resolve "^29.2.2" - jest-snapshot "^29.2.2" + jest-resolve "^29.3.0" + jest-snapshot "^29.3.0" jest-util "^29.2.1" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.2.2: - version "29.2.2" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.2.2.tgz#1016ce60297b77382386bad561107174604690c2" - integrity sha512-GfKJrpZ5SMqhli3NJ+mOspDqtZfJBryGA8RIBxF+G+WbDoC7HCqKaeAss4Z/Sab6bAW11ffasx8/vGsj83jyjA== +jest-snapshot@^29.3.0: + version "29.3.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.3.0.tgz#e319cb98cf36640194717fb37a9bd048a3e448f8" + integrity sha512-+4mX3T8XI3ABbZFzBd/AM74mfwOb6gMpYVFNTc0Cgg2F2fGYvHii8D6jWWka99a3wyNFmni3ov8meEVTF8n13Q== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" @@ -1879,17 +1884,17 @@ jest-snapshot@^29.2.2: "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" "@jest/expect-utils" "^29.2.2" - "@jest/transform" "^29.2.2" + "@jest/transform" "^29.3.0" "@jest/types" "^29.2.1" "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.2.2" + expect "^29.3.0" graceful-fs "^4.2.9" jest-diff "^29.2.1" jest-get-type "^29.2.0" - jest-haste-map "^29.2.1" + jest-haste-map "^29.3.0" jest-matcher-utils "^29.2.2" jest-message-util "^29.2.1" jest-util "^29.2.1" @@ -1935,10 +1940,10 @@ jest-watcher@^29.2.2: jest-util "^29.2.1" string-length "^4.0.1" -jest-worker@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.2.1.tgz#8ba68255438252e1674f990f0180c54dfa26a3b1" - integrity sha512-ROHTZ+oj7sBrgtv46zZ84uWky71AoYi0vEV9CdEtc1FQunsoAGe5HbQmW76nI5QWdvECVPrSi1MCVUmizSavMg== +jest-worker@^29.3.0: + version "29.3.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.3.0.tgz#240a1cd731c7d6645e8bcc37a3d584f122afb44a" + integrity sha512-rP8LYClB5NCWW0p8GdQT9vRmZNrDmjypklEYZuGCIU5iNviVWCZK5MILS3rQwD0FY1u96bY7b+KoU17DdZy6Ww== dependencies: "@types/node" "*" jest-util "^29.2.1" @@ -1946,14 +1951,14 @@ jest-worker@^29.2.1: supports-color "^8.0.0" jest@^29.0.0: - version "29.2.2" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.2.2.tgz#24da83cbbce514718acd698926b7679109630476" - integrity sha512-r+0zCN9kUqoON6IjDdjbrsWobXM/09Nd45kIPRD8kloaRh1z5ZCMdVsgLXGxmlL7UpAJsvCYOQNO+NjvG/gqiQ== + version "29.3.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.3.0.tgz#edb9ef5b308e90e1c717c8accc04b28f133ac66d" + integrity sha512-lWmHtOcJSjR6FYRw+4oo7456QUe6LN73Lw6HLwOWKTPLcyQF60cMh0EoIHi67dV74SY5tw/kL+jYC+Ji43ScUg== dependencies: - "@jest/core" "^29.2.2" + "@jest/core" "^29.3.0" "@jest/types" "^29.2.1" import-local "^3.0.2" - jest-cli "^29.2.2" + jest-cli "^29.3.0" js-sdsl@^4.1.4: version "4.1.5" From 32e3750549c63d8990d6bca318639227f564006c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Nov 2022 12:01:25 +0000 Subject: [PATCH 674/785] Bump jest from 29.3.0 to 29.3.1 Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.3.0 to 29.3.1. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.3.1/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 592 +++++++++++++++++++++++++++--------------------------- 1 file changed, 296 insertions(+), 296 deletions(-) diff --git a/yarn.lock b/yarn.lock index b7f2b6e7..d6f6b9a1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -347,28 +347,28 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^29.2.1": - version "29.2.1" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.2.1.tgz#5f2c62dcdd5ce66e94b6d6729e021758bceea090" - integrity sha512-MF8Adcw+WPLZGBiNxn76DOuczG3BhODTcMlDCA4+cFi41OkaY/lyI0XUUhi73F88Y+7IHoGmD80pN5CtxQUdSw== +"@jest/console@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.3.1.tgz#3e3f876e4e47616ea3b1464b9fbda981872e9583" + integrity sha512-IRE6GD47KwcqA09RIWrabKdHPiKDGgtAL31xDxbi/RjQMsr+lY+ppxmHwY0dUEV3qvvxZzoe5Hl0RXZJOjQNUg== dependencies: - "@jest/types" "^29.2.1" + "@jest/types" "^29.3.1" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^29.2.1" - jest-util "^29.2.1" + jest-message-util "^29.3.1" + jest-util "^29.3.1" slash "^3.0.0" -"@jest/core@^29.3.0": - version "29.3.0" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.3.0.tgz#7042d3fd673b51d89d6f6bf8b9f85fb65573629e" - integrity sha512-5DyNvV8452bwqcYyXHCYaAD8UrTiWosrhBY+rc0MBMyXyDzcIL+w5gdlCYhlHbNsHoWnf4nUbRmg++LWfWVtMQ== +"@jest/core@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.3.1.tgz#bff00f413ff0128f4debec1099ba7dcd649774a1" + integrity sha512-0ohVjjRex985w5MmO5L3u5GR1O30DexhBSpuwx2P+9ftyqHdJXnk7IUWiP80oHMvt7ubHCJHxV0a0vlKVuZirw== dependencies: - "@jest/console" "^29.2.1" - "@jest/reporters" "^29.3.0" - "@jest/test-result" "^29.2.1" - "@jest/transform" "^29.3.0" - "@jest/types" "^29.2.1" + "@jest/console" "^29.3.1" + "@jest/reporters" "^29.3.1" + "@jest/test-result" "^29.3.1" + "@jest/transform" "^29.3.1" + "@jest/types" "^29.3.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" @@ -376,80 +376,80 @@ exit "^0.1.2" graceful-fs "^4.2.9" jest-changed-files "^29.2.0" - jest-config "^29.3.0" - jest-haste-map "^29.3.0" - jest-message-util "^29.2.1" + jest-config "^29.3.1" + jest-haste-map "^29.3.1" + jest-message-util "^29.3.1" jest-regex-util "^29.2.0" - jest-resolve "^29.3.0" - jest-resolve-dependencies "^29.3.0" - jest-runner "^29.3.0" - jest-runtime "^29.3.0" - jest-snapshot "^29.3.0" - jest-util "^29.2.1" - jest-validate "^29.2.2" - jest-watcher "^29.2.2" + jest-resolve "^29.3.1" + jest-resolve-dependencies "^29.3.1" + jest-runner "^29.3.1" + jest-runtime "^29.3.1" + jest-snapshot "^29.3.1" + jest-util "^29.3.1" + jest-validate "^29.3.1" + jest-watcher "^29.3.1" micromatch "^4.0.4" - pretty-format "^29.2.1" + pretty-format "^29.3.1" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.3.0": - version "29.3.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.3.0.tgz#e7bfe22531813f86040feb75c046faab32fd534d" - integrity sha512-8wgn3br51bx+7rgC8FOKmAD62Q39iswdiy5/p6acoekp/9Bb/IQbh3zydOrnGp74LwStSrKgpQSKBlOKlAQq0g== +"@jest/environment@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.3.1.tgz#eb039f726d5fcd14698acd072ac6576d41cfcaa6" + integrity sha512-pMmvfOPmoa1c1QpfFW0nXYtNLpofqo4BrCIk6f2kW4JFeNlHV2t3vd+3iDLf31e2ot2Mec0uqZfmI+U0K2CFag== dependencies: - "@jest/fake-timers" "^29.3.0" - "@jest/types" "^29.2.1" + "@jest/fake-timers" "^29.3.1" + "@jest/types" "^29.3.1" "@types/node" "*" - jest-mock "^29.3.0" + jest-mock "^29.3.1" -"@jest/expect-utils@^29.2.2": - version "29.2.2" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.2.2.tgz#460a5b5a3caf84d4feb2668677393dd66ff98665" - integrity sha512-vwnVmrVhTmGgQzyvcpze08br91OL61t9O0lJMDyb6Y/D8EKQ9V7rGUb/p7PDt0GPzK0zFYqXWFo4EO2legXmkg== +"@jest/expect-utils@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.3.1.tgz#531f737039e9b9e27c42449798acb5bba01935b6" + integrity sha512-wlrznINZI5sMjwvUoLVk617ll/UYfGIZNxmbU+Pa7wmkL4vYzhV9R2pwVqUh4NWWuLQWkI8+8mOkxs//prKQ3g== dependencies: jest-get-type "^29.2.0" -"@jest/expect@^29.3.0": - version "29.3.0" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.3.0.tgz#06907ffc02541c8d5186e8324765a72f391f3125" - integrity sha512-Lz/3x4Se5g6nBuLjTO+xE8D4OXY9fFmosZPwkXXZUJUsp9r9seN81cJa54wOGr1QjCQnhngMqclblhM4X/hcCg== +"@jest/expect@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.3.1.tgz#456385b62894349c1d196f2d183e3716d4c6a6cd" + integrity sha512-QivM7GlSHSsIAWzgfyP8dgeExPRZ9BIe2LsdPyEhCGkZkoyA+kGsoIzbKAfZCvvRzfZioKwPtCZIt5SaoxYCvg== dependencies: - expect "^29.3.0" - jest-snapshot "^29.3.0" + expect "^29.3.1" + jest-snapshot "^29.3.1" -"@jest/fake-timers@^29.3.0": - version "29.3.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.3.0.tgz#ffa74e5b2937676849866cac79cac6a742697f00" - integrity sha512-SzmWtN6Rld+xebMRGuWeMGhytc7qHnYfFk1Zd/1QavQWsFOmA9SgtvGHCBue1wXQhdDMaSIm1aPGj2Zmyrr1Zg== +"@jest/fake-timers@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.3.1.tgz#b140625095b60a44de820876d4c14da1aa963f67" + integrity sha512-iHTL/XpnDlFki9Tq0Q1GGuVeQ8BHZGIYsvCO5eN/O/oJaRzofG9Xndd9HuSDBI/0ZS79pg0iwn07OMTQ7ngF2A== dependencies: - "@jest/types" "^29.2.1" + "@jest/types" "^29.3.1" "@sinonjs/fake-timers" "^9.1.2" "@types/node" "*" - jest-message-util "^29.2.1" - jest-mock "^29.3.0" - jest-util "^29.2.1" + jest-message-util "^29.3.1" + jest-mock "^29.3.1" + jest-util "^29.3.1" -"@jest/globals@^29.3.0": - version "29.3.0" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.3.0.tgz#f58c14d727fd7d02d7851bc03fc0445eefa2dbe2" - integrity sha512-okYDVzYNrt/4ysR8XnX6u0I1bGG4kmfdXtUu7kwWHZ9OP13RCjmphgve0tfOrNluwksWvOPYS1f/HOrFTHLygQ== +"@jest/globals@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.3.1.tgz#92be078228e82d629df40c3656d45328f134a0c6" + integrity sha512-cTicd134vOcwO59OPaB6AmdHQMCtWOe+/DitpTZVxWgMJ+YvXL1HNAmPyiGbSHmF/mXVBkvlm8YYtQhyHPnV6Q== dependencies: - "@jest/environment" "^29.3.0" - "@jest/expect" "^29.3.0" - "@jest/types" "^29.2.1" - jest-mock "^29.3.0" + "@jest/environment" "^29.3.1" + "@jest/expect" "^29.3.1" + "@jest/types" "^29.3.1" + jest-mock "^29.3.1" -"@jest/reporters@^29.3.0": - version "29.3.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.3.0.tgz#e5e2af97d7754510393d7c04084744841cce2eaf" - integrity sha512-MV76tB3Kd80vcv2yMDZfQpMkwkHaY9hlvVhCtHXkVRCWwN+SX3EOmCdX8pT/X4Xh+NusA7l2Rc3yhx4q5p3+Fg== +"@jest/reporters@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.3.1.tgz#9a6d78c109608e677c25ddb34f907b90e07b4310" + integrity sha512-GhBu3YFuDrcAYW/UESz1JphEAbvUjaY2vShRZRoRY1mxpCMB3yGSJ4j9n0GxVlEOdCf7qjvUfBCrTUUqhVfbRA== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.2.1" - "@jest/test-result" "^29.2.1" - "@jest/transform" "^29.3.0" - "@jest/types" "^29.2.1" + "@jest/console" "^29.3.1" + "@jest/test-result" "^29.3.1" + "@jest/transform" "^29.3.1" + "@jest/types" "^29.3.1" "@jridgewell/trace-mapping" "^0.3.15" "@types/node" "*" chalk "^4.0.0" @@ -462,9 +462,9 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^29.2.1" - jest-util "^29.2.1" - jest-worker "^29.3.0" + jest-message-util "^29.3.1" + jest-util "^29.3.1" + jest-worker "^29.3.1" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" @@ -486,51 +486,51 @@ callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^29.2.1": - version "29.2.1" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.2.1.tgz#f42dbf7b9ae465d0a93eee6131473b8bb3bd2edb" - integrity sha512-lS4+H+VkhbX6z64tZP7PAUwPqhwj3kbuEHcaLuaBuB+riyaX7oa1txe0tXgrFj5hRWvZKvqO7LZDlNWeJ7VTPA== +"@jest/test-result@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.3.1.tgz#92cd5099aa94be947560a24610aa76606de78f50" + integrity sha512-qeLa6qc0ddB0kuOZyZIhfN5q0e2htngokyTWsGriedsDhItisW7SDYZ7ceOe57Ii03sL988/03wAcBh3TChMGw== dependencies: - "@jest/console" "^29.2.1" - "@jest/types" "^29.2.1" + "@jest/console" "^29.3.1" + "@jest/types" "^29.3.1" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.3.0": - version "29.3.0" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.3.0.tgz#0c2198fe482c26d763abbcb183992ae769bb7978" - integrity sha512-XQlTP/S6Yf6NKV0Mt4oopFKyDxiEkDMD7hIFcCTeltKQszE0Z+LI5KLukwNW6Qxr1YzaZ/s6PlKJusiCLJNTcw== +"@jest/test-sequencer@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.3.1.tgz#fa24b3b050f7a59d48f7ef9e0b782ab65123090d" + integrity sha512-IqYvLbieTv20ArgKoAMyhLHNrVHJfzO6ARZAbQRlY4UGWfdDnLlZEF0BvKOMd77uIiIjSZRwq3Jb3Fa3I8+2UA== dependencies: - "@jest/test-result" "^29.2.1" + "@jest/test-result" "^29.3.1" graceful-fs "^4.2.9" - jest-haste-map "^29.3.0" + jest-haste-map "^29.3.1" slash "^3.0.0" -"@jest/transform@^29.3.0": - version "29.3.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.3.0.tgz#7f71c9596d5bad1613a3a5eb26729dd84fc71a5a" - integrity sha512-4T8h61ItCakAlJkdYa7XVWP3r39QldlCeOSNmRpiJisi5PrrlzwZdpJDIH13ZZjh+MlSPQ2cq8YbUs3TuH+tRA== +"@jest/transform@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.3.1.tgz#1e6bd3da4af50b5c82a539b7b1f3770568d6e36d" + integrity sha512-8wmCFBTVGYqFNLWfcOWoVuMuKYPUBTnTMDkdvFtAYELwDOl9RGwOsvQWGPFxDJ8AWY9xM/8xCXdqmPK3+Q5Lug== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^29.2.1" + "@jest/types" "^29.3.1" "@jridgewell/trace-mapping" "^0.3.15" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^2.0.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.3.0" + jest-haste-map "^29.3.1" jest-regex-util "^29.2.0" - jest-util "^29.2.1" + jest-util "^29.3.1" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" write-file-atomic "^4.0.1" -"@jest/types@^29.2.1": - version "29.2.1" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.2.1.tgz#ec9c683094d4eb754e41e2119d8bdaef01cf6da0" - integrity sha512-O/QNDQODLnINEPAI0cl9U6zUIDXEWXt6IC1o2N2QENuos7hlGUIthlKyV4p6ki3TvXFX071blj8HUhgLGquPjw== +"@jest/types@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.3.1.tgz#7c5a80777cb13e703aeec6788d044150341147e3" + integrity sha512-d0S0jmmTpjnhCmNpApgX3jrUZgZ22ivKJRvL2lli5hpCRoNnp1f85r2/wpKfXuYu8E7Jjh1hGfhPyup1NM5AmA== dependencies: "@jest/schemas" "^29.0.0" "@types/istanbul-lib-coverage" "^2.0.0" @@ -796,12 +796,12 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.3.0.tgz#31fd7ef97dd6a77ddd1b4ab1f8cf77c29e20bb5c" - integrity sha512-LzQWdGm6hUugVeyGpIKI/T4SVT+PgAA5WFPqBDbneK7C/PqfckNb0tc4KvcKXq/PLA1yY6wTvB8Bc/REQdUxFg== +babel-jest@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.3.1.tgz#05c83e0d128cd48c453eea851482a38782249f44" + integrity sha512-aard+xnMoxgjwV70t0L6wkW/3HQQtV+O0PEimxKgzNqCJnbYmroPojdP2tqKSOAt8QAKV/uSZU8851M7B5+fcA== dependencies: - "@jest/transform" "^29.3.0" + "@jest/transform" "^29.3.1" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" babel-preset-jest "^29.2.0" @@ -1052,10 +1052,10 @@ detect-newline@^3.0.0: resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== -diff-sequences@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.2.0.tgz#4c55b5b40706c7b5d2c5c75999a50c56d214e8f6" - integrity sha512-413SY5JpYeSBZxmenGEmCVQ8mCgtFJF0w9PROdaS6z987XC2Pd2GOKqOITLtMftmyFZqgtCOb/QA7/Z3ZXfzIw== +diff-sequences@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.3.1.tgz#104b5b95fe725932421a9c6e5b4bef84c3f2249e" + integrity sha512-hlM3QR272NXCi4pq+N4Kok4kOp6EsgOM3ZSpJI7Da3UAs+Ttsi8MRmB6trM/lhyzUxGfOgnpkHtgqm5Q/CTcfQ== doctrine@^3.0.0: version "3.0.0" @@ -1261,16 +1261,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== -expect@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.3.0.tgz#2dad3a73ac837dd8074ff91d25cf1614c3e91504" - integrity sha512-bms139btnQNZh4uxCPmzbWz46YOjtEpYIZ847OfY9GCeSBEfzedHWH0CkdR20Sy+XBs8/FI2lFJPZiuH0NGv+w== +expect@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.3.1.tgz#92877aad3f7deefc2e3f6430dd195b92295554a6" + integrity sha512-gGb1yTgU30Q0O/tQq+z30KBWv24ApkMgFUpvKBkyLUBL68Wv8dHdJxTBZFl/iT8K/bqDHvUYRH6IIN3rToopPA== dependencies: - "@jest/expect-utils" "^29.2.2" + "@jest/expect-utils" "^29.3.1" jest-get-type "^29.2.0" - jest-matcher-utils "^29.2.2" - jest-message-util "^29.2.1" - jest-util "^29.2.1" + jest-matcher-utils "^29.3.1" + jest-message-util "^29.3.1" + jest-util "^29.3.1" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1607,86 +1607,86 @@ jest-changed-files@^29.2.0: execa "^5.0.0" p-limit "^3.1.0" -jest-circus@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.3.0.tgz#997354276d24706e14549cab98ac2995d63c92fd" - integrity sha512-xL1cmbUGBGy923KBZpZ2LRKspHlIhrltrwGaefJ677HXCPY5rTF758BtweamBype2ogcSEK/oqcp1SmYZ/ATig== +jest-circus@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.3.1.tgz#177d07c5c0beae8ef2937a67de68f1e17bbf1b4a" + integrity sha512-wpr26sEvwb3qQQbdlmei+gzp6yoSSoSL6GsLPxnuayZSMrSd5Ka7IjAvatpIernBvT2+Ic6RLTg+jSebScmasg== dependencies: - "@jest/environment" "^29.3.0" - "@jest/expect" "^29.3.0" - "@jest/test-result" "^29.2.1" - "@jest/types" "^29.2.1" + "@jest/environment" "^29.3.1" + "@jest/expect" "^29.3.1" + "@jest/test-result" "^29.3.1" + "@jest/types" "^29.3.1" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" is-generator-fn "^2.0.0" - jest-each "^29.2.1" - jest-matcher-utils "^29.2.2" - jest-message-util "^29.2.1" - jest-runtime "^29.3.0" - jest-snapshot "^29.3.0" - jest-util "^29.2.1" + jest-each "^29.3.1" + jest-matcher-utils "^29.3.1" + jest-message-util "^29.3.1" + jest-runtime "^29.3.1" + jest-snapshot "^29.3.1" + jest-util "^29.3.1" p-limit "^3.1.0" - pretty-format "^29.2.1" + pretty-format "^29.3.1" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.3.0.tgz#7ca1913f6088570ae58bbb312d70500e00120d41" - integrity sha512-rDb9iasZvqTkgrlwzVGemR5i20T0/XN1ug46Ch2vxTRa0zS5PHaVXQXYzYbuLFHs1xpc+XsB9xPfEkkwbnLJBg== +jest-cli@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.3.1.tgz#e89dff427db3b1df50cea9a393ebd8640790416d" + integrity sha512-TO/ewvwyvPOiBBuWZ0gm04z3WWP8TIK8acgPzE4IxgsLKQgb377NYGrQLc3Wl/7ndWzIH2CDNNsUjGxwLL43VQ== dependencies: - "@jest/core" "^29.3.0" - "@jest/test-result" "^29.2.1" - "@jest/types" "^29.2.1" + "@jest/core" "^29.3.1" + "@jest/test-result" "^29.3.1" + "@jest/types" "^29.3.1" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.3.0" - jest-util "^29.2.1" - jest-validate "^29.2.2" + jest-config "^29.3.1" + jest-util "^29.3.1" + jest-validate "^29.3.1" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.3.0.tgz#4b30188390636106414ea6b43aa6b2fb30d1a54d" - integrity sha512-sTSDs/M+//njznsytxiBxwfDnSWRb6OqiNSlO/B2iw1HUaa1YLsdWmV4AWLXss1XKzv1F0yVK+kA4XOhZ0I1qQ== +jest-config@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.3.1.tgz#0bc3dcb0959ff8662957f1259947aedaefb7f3c6" + integrity sha512-y0tFHdj2WnTEhxmGUK1T7fgLen7YK4RtfvpLFBXfQkh2eMJAQq24Vx9472lvn5wg0MAO6B+iPfJfzdR9hJYalg== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.3.0" - "@jest/types" "^29.2.1" - babel-jest "^29.3.0" + "@jest/test-sequencer" "^29.3.1" + "@jest/types" "^29.3.1" + babel-jest "^29.3.1" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^29.3.0" - jest-environment-node "^29.3.0" + jest-circus "^29.3.1" + jest-environment-node "^29.3.1" jest-get-type "^29.2.0" jest-regex-util "^29.2.0" - jest-resolve "^29.3.0" - jest-runner "^29.3.0" - jest-util "^29.2.1" - jest-validate "^29.2.2" + jest-resolve "^29.3.1" + jest-runner "^29.3.1" + jest-util "^29.3.1" + jest-validate "^29.3.1" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^29.2.1" + pretty-format "^29.3.1" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.2.1.tgz#027e42f5a18b693fb2e88f81b0ccab533c08faee" - integrity sha512-gfh/SMNlQmP3MOUgdzxPOd4XETDJifADpT937fN1iUGz+9DgOu2eUPHH25JDkLVcLwwqxv3GzVyK4VBUr9fjfA== +jest-diff@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.3.1.tgz#d8215b72fed8f1e647aed2cae6c752a89e757527" + integrity sha512-vU8vyiO7568tmin2lA3r2DP8oRvzhvRcD4DjpXc6uGveQodyk7CKLhQlCSiwgx3g0pFaE88/KLZ0yaTWMc4Uiw== dependencies: chalk "^4.0.0" - diff-sequences "^29.2.0" + diff-sequences "^29.3.1" jest-get-type "^29.2.0" - pretty-format "^29.2.1" + pretty-format "^29.3.1" jest-docblock@^29.2.0: version "29.2.0" @@ -1695,94 +1695,94 @@ jest-docblock@^29.2.0: dependencies: detect-newline "^3.0.0" -jest-each@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.2.1.tgz#6b0a88ee85c2ba27b571a6010c2e0c674f5c9b29" - integrity sha512-sGP86H/CpWHMyK3qGIGFCgP6mt+o5tu9qG4+tobl0LNdgny0aitLXs9/EBacLy3Bwqy+v4uXClqJgASJWcruYw== +jest-each@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.3.1.tgz#bc375c8734f1bb96625d83d1ca03ef508379e132" + integrity sha512-qrZH7PmFB9rEzCSl00BWjZYuS1BSOH8lLuC0azQE9lQrAx3PWGKHTDudQiOSwIy5dGAJh7KA0ScYlCP7JxvFYA== dependencies: - "@jest/types" "^29.2.1" + "@jest/types" "^29.3.1" chalk "^4.0.0" jest-get-type "^29.2.0" - jest-util "^29.2.1" - pretty-format "^29.2.1" + jest-util "^29.3.1" + pretty-format "^29.3.1" -jest-environment-node@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.3.0.tgz#aed95a8e566d80f9f8564fba01ca5caa9d0aa59a" - integrity sha512-oikVE5pyiBUMrqi7J/kFGd1zeT14+EnJulyqzopDNijLX13ygwjiOF/GVpVKSGyBrrAwSkaj/ohEQJCcjkCtOA== +jest-environment-node@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.3.1.tgz#5023b32472b3fba91db5c799a0d5624ad4803e74" + integrity sha512-xm2THL18Xf5sIHoU7OThBPtuH6Lerd+Y1NLYiZJlkE3hbE+7N7r8uvHIl/FkZ5ymKXJe/11SQuf3fv4v6rUMag== dependencies: - "@jest/environment" "^29.3.0" - "@jest/fake-timers" "^29.3.0" - "@jest/types" "^29.2.1" + "@jest/environment" "^29.3.1" + "@jest/fake-timers" "^29.3.1" + "@jest/types" "^29.3.1" "@types/node" "*" - jest-mock "^29.3.0" - jest-util "^29.2.1" + jest-mock "^29.3.1" + jest-util "^29.3.1" jest-get-type@^29.2.0: version "29.2.0" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.2.0.tgz#726646f927ef61d583a3b3adb1ab13f3a5036408" integrity sha512-uXNJlg8hKFEnDgFsrCjznB+sTxdkuqiCL6zMgA75qEbAJjJYTs9XPrvDctrEig2GDow22T/LvHgO57iJhXB/UA== -jest-haste-map@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.3.0.tgz#9786f501ed6ab1c7adc35d3f83c1c21ed4172c77" - integrity sha512-ugdLIreycMRRg3+6AjiExECmuFI2D9PS+BmNU7eGvBt3fzVMKybb9USAZXN6kw4Q6Mn8DSK+7OFCloY2rN820Q== +jest-haste-map@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.3.1.tgz#af83b4347f1dae5ee8c2fb57368dc0bb3e5af843" + integrity sha512-/FFtvoG1xjbbPXQLFef+WSU4yrc0fc0Dds6aRPBojUid7qlPqZvxdUBA03HW0fnVHXVCnCdkuoghYItKNzc/0A== dependencies: - "@jest/types" "^29.2.1" + "@jest/types" "^29.3.1" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" jest-regex-util "^29.2.0" - jest-util "^29.2.1" - jest-worker "^29.3.0" + jest-util "^29.3.1" + jest-worker "^29.3.1" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.2.1.tgz#ec551686b7d512ec875616c2c3534298b1ffe2fc" - integrity sha512-1YvSqYoiurxKOJtySc+CGVmw/e1v4yNY27BjWTVzp0aTduQeA7pdieLiW05wTYG/twlKOp2xS/pWuikQEmklug== +jest-leak-detector@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.3.1.tgz#95336d020170671db0ee166b75cd8ef647265518" + integrity sha512-3DA/VVXj4zFOPagGkuqHnSQf1GZBmmlagpguxEERO6Pla2g84Q1MaVIB3YMxgUaFIaYag8ZnTyQgiZ35YEqAQA== dependencies: jest-get-type "^29.2.0" - pretty-format "^29.2.1" + pretty-format "^29.3.1" -jest-matcher-utils@^29.2.2: - version "29.2.2" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.2.2.tgz#9202f8e8d3a54733266784ce7763e9a08688269c" - integrity sha512-4DkJ1sDPT+UX2MR7Y3od6KtvRi9Im1ZGLGgdLFLm4lPexbTaCgJW5NN3IOXlQHF7NSHY/VHhflQ+WoKtD/vyCw== +jest-matcher-utils@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.3.1.tgz#6e7f53512f80e817dfa148672bd2d5d04914a572" + integrity sha512-fkRMZUAScup3txIKfMe3AIZZmPEjWEdsPJFK3AIy5qRohWqQFg1qrmKfYXR9qEkNc7OdAu2N4KPHibEmy4HPeQ== dependencies: chalk "^4.0.0" - jest-diff "^29.2.1" + jest-diff "^29.3.1" jest-get-type "^29.2.0" - pretty-format "^29.2.1" + pretty-format "^29.3.1" -jest-message-util@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.2.1.tgz#3a51357fbbe0cc34236f17a90d772746cf8d9193" - integrity sha512-Dx5nEjw9V8C1/Yj10S/8ivA8F439VS8vTq1L7hEgwHFn9ovSKNpYW/kwNh7UglaEgXO42XxzKJB+2x0nSglFVw== +jest-message-util@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.3.1.tgz#37bc5c468dfe5120712053dd03faf0f053bd6adb" + integrity sha512-lMJTbgNcDm5z+6KDxWtqOFWlGQxD6XaYwBqHR8kmpkP+WWWG90I35kdtQHY67Ay5CSuydkTBbJG+tH9JShFCyA== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.2.1" + "@jest/types" "^29.3.1" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^29.2.1" + pretty-format "^29.3.1" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.3.0.tgz#aa6f1d5118fd4b9d007df782e0624e6efab6d33d" - integrity sha512-BRKfsAaeP3pTWeog+1D0ILeJF96SzB6y3k0JDxY63kssxiUy9nDLHmNUoVkBGILjMbpHULhbzVTsb3harPXuUQ== +jest-mock@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.3.1.tgz#60287d92e5010979d01f218c6b215b688e0f313e" + integrity sha512-H8/qFDtDVMFvFP4X8NuOT3XRDzOUTz+FeACjufHzsOIBAxivLqkB1PoLCaJx9iPPQ8dZThHPp/G3WRWyMgA3JA== dependencies: - "@jest/types" "^29.2.1" + "@jest/types" "^29.3.1" "@types/node" "*" - jest-util "^29.2.1" + jest-util "^29.3.1" jest-pnp-resolver@^1.2.2: version "1.2.2" @@ -1794,88 +1794,88 @@ jest-regex-util@^29.2.0: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.2.0.tgz#82ef3b587e8c303357728d0322d48bbfd2971f7b" integrity sha512-6yXn0kg2JXzH30cr2NlThF+70iuO/3irbaB4mh5WyqNIvLLP+B6sFdluO1/1RJmslyh/f9osnefECflHvTbwVA== -jest-resolve-dependencies@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.3.0.tgz#9a2c3389d1a4cce95445f7c34b0b25f44fff9fad" - integrity sha512-ykSbDbWmIaHprOBig57AExw7i6Fj0y69M6baiAd75Ivx1UMQt4wsM6A+SNqIhycV6Zy8XV3L40Ac3HYSrDSq7w== +jest-resolve-dependencies@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.3.1.tgz#a6a329708a128e68d67c49f38678a4a4a914c3bf" + integrity sha512-Vk0cYq0byRw2WluNmNWGqPeRnZ3p3hHmjJMp2dyyZeYIfiBskwq4rpiuGFR6QGAdbj58WC7HN4hQHjf2mpvrLA== dependencies: jest-regex-util "^29.2.0" - jest-snapshot "^29.3.0" + jest-snapshot "^29.3.1" -jest-resolve@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.3.0.tgz#038711e9af86f4b4f55a407db14310bc57a8beb4" - integrity sha512-xH6C6loDlOWEWHdCgioLDlbpmsolNdNsV/UR35ChuK217x0ttHuhyEPdh5wa6CTQ/Eq4OGW2/EZTlh0ay5aojQ== +jest-resolve@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.3.1.tgz#9a4b6b65387a3141e4a40815535c7f196f1a68a7" + integrity sha512-amXJgH/Ng712w3Uz5gqzFBBjxV8WFLSmNjoreBGMqxgCz5cH7swmBZzgBaCIOsvb0NbpJ0vgaSFdJqMdT+rADw== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^29.3.0" + jest-haste-map "^29.3.1" jest-pnp-resolver "^1.2.2" - jest-util "^29.2.1" - jest-validate "^29.2.2" + jest-util "^29.3.1" + jest-validate "^29.3.1" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.3.0.tgz#fc255482594c1536a34e2b41f610355c4f3d2ee6" - integrity sha512-E/ROzAVj7gy44FvIe+Tbz0xGWG1sa8WLkhUg/hsXHewPC0Z48kqWySdfYRtXkB7RmMn4OcWE+hIBfsRAMVV+sQ== +jest-runner@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.3.1.tgz#a92a879a47dd096fea46bb1517b0a99418ee9e2d" + integrity sha512-oFvcwRNrKMtE6u9+AQPMATxFcTySyKfLhvso7Sdk/rNpbhg4g2GAGCopiInk1OP4q6gz3n6MajW4+fnHWlU3bA== dependencies: - "@jest/console" "^29.2.1" - "@jest/environment" "^29.3.0" - "@jest/test-result" "^29.2.1" - "@jest/transform" "^29.3.0" - "@jest/types" "^29.2.1" + "@jest/console" "^29.3.1" + "@jest/environment" "^29.3.1" + "@jest/test-result" "^29.3.1" + "@jest/transform" "^29.3.1" + "@jest/types" "^29.3.1" "@types/node" "*" chalk "^4.0.0" emittery "^0.13.1" graceful-fs "^4.2.9" jest-docblock "^29.2.0" - jest-environment-node "^29.3.0" - jest-haste-map "^29.3.0" - jest-leak-detector "^29.2.1" - jest-message-util "^29.2.1" - jest-resolve "^29.3.0" - jest-runtime "^29.3.0" - jest-util "^29.2.1" - jest-watcher "^29.2.2" - jest-worker "^29.3.0" + jest-environment-node "^29.3.1" + jest-haste-map "^29.3.1" + jest-leak-detector "^29.3.1" + jest-message-util "^29.3.1" + jest-resolve "^29.3.1" + jest-runtime "^29.3.1" + jest-util "^29.3.1" + jest-watcher "^29.3.1" + jest-worker "^29.3.1" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.3.0.tgz#e44f838f469ab1f6b524178bae6233697748eb27" - integrity sha512-ufgX/hbpa7MLnjWRW82T5mVF73FBk3W38dGCLPXWtYZ5Zr1ZFh8QnaAtITKJt0p3kGXR8ZqlIjadSiBTk/QJ/A== +jest-runtime@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.3.1.tgz#21efccb1a66911d6d8591276a6182f520b86737a" + integrity sha512-jLzkIxIqXwBEOZx7wx9OO9sxoZmgT2NhmQKzHQm1xwR1kNW/dn0OjxR424VwHHf1SPN6Qwlb5pp1oGCeFTQ62A== dependencies: - "@jest/environment" "^29.3.0" - "@jest/fake-timers" "^29.3.0" - "@jest/globals" "^29.3.0" + "@jest/environment" "^29.3.1" + "@jest/fake-timers" "^29.3.1" + "@jest/globals" "^29.3.1" "@jest/source-map" "^29.2.0" - "@jest/test-result" "^29.2.1" - "@jest/transform" "^29.3.0" - "@jest/types" "^29.2.1" + "@jest/test-result" "^29.3.1" + "@jest/transform" "^29.3.1" + "@jest/types" "^29.3.1" "@types/node" "*" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^29.3.0" - jest-message-util "^29.2.1" - jest-mock "^29.3.0" + jest-haste-map "^29.3.1" + jest-message-util "^29.3.1" + jest-mock "^29.3.1" jest-regex-util "^29.2.0" - jest-resolve "^29.3.0" - jest-snapshot "^29.3.0" - jest-util "^29.2.1" + jest-resolve "^29.3.1" + jest-snapshot "^29.3.1" + jest-util "^29.3.1" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.3.0.tgz#e319cb98cf36640194717fb37a9bd048a3e448f8" - integrity sha512-+4mX3T8XI3ABbZFzBd/AM74mfwOb6gMpYVFNTc0Cgg2F2fGYvHii8D6jWWka99a3wyNFmni3ov8meEVTF8n13Q== +jest-snapshot@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.3.1.tgz#17bcef71a453adc059a18a32ccbd594b8cc4e45e" + integrity sha512-+3JOc+s28upYLI2OJM4PWRGK9AgpsMs/ekNryUV0yMBClT9B1DF2u2qay8YxcQd338PPYSFNb0lsar1B49sLDA== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" @@ -1883,82 +1883,82 @@ jest-snapshot@^29.3.0: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.2.2" - "@jest/transform" "^29.3.0" - "@jest/types" "^29.2.1" + "@jest/expect-utils" "^29.3.1" + "@jest/transform" "^29.3.1" + "@jest/types" "^29.3.1" "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.3.0" + expect "^29.3.1" graceful-fs "^4.2.9" - jest-diff "^29.2.1" + jest-diff "^29.3.1" jest-get-type "^29.2.0" - jest-haste-map "^29.3.0" - jest-matcher-utils "^29.2.2" - jest-message-util "^29.2.1" - jest-util "^29.2.1" + jest-haste-map "^29.3.1" + jest-matcher-utils "^29.3.1" + jest-message-util "^29.3.1" + jest-util "^29.3.1" natural-compare "^1.4.0" - pretty-format "^29.2.1" + pretty-format "^29.3.1" semver "^7.3.5" -jest-util@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.2.1.tgz#f26872ba0dc8cbefaba32c34f98935f6cf5fc747" - integrity sha512-P5VWDj25r7kj7kl4pN2rG/RN2c1TLfYYYZYULnS/35nFDjBai+hBeo3MDrYZS7p6IoY3YHZnt2vq4L6mKnLk0g== +jest-util@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.3.1.tgz#1dda51e378bbcb7e3bc9d8ab651445591ed373e1" + integrity sha512-7YOVZaiX7RJLv76ZfHt4nbNEzzTRiMW/IiOG7ZOKmTXmoGBxUDefgMAxQubu6WPVqP5zSzAdZG0FfLcC7HOIFQ== dependencies: - "@jest/types" "^29.2.1" + "@jest/types" "^29.3.1" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^29.2.2: - version "29.2.2" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.2.2.tgz#e43ce1931292dfc052562a11bc681af3805eadce" - integrity sha512-eJXATaKaSnOuxNfs8CLHgdABFgUrd0TtWS8QckiJ4L/QVDF4KVbZFBBOwCBZHOS0Rc5fOxqngXeGXE3nGQkpQA== +jest-validate@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.3.1.tgz#d56fefaa2e7d1fde3ecdc973c7f7f8f25eea704a" + integrity sha512-N9Lr3oYR2Mpzuelp1F8negJR3YE+L1ebk1rYA5qYo9TTY3f9OWdptLoNSPP9itOCBIRBqjt/S5XHlzYglLN67g== dependencies: - "@jest/types" "^29.2.1" + "@jest/types" "^29.3.1" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^29.2.0" leven "^3.1.0" - pretty-format "^29.2.1" + pretty-format "^29.3.1" -jest-watcher@^29.2.2: - version "29.2.2" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.2.2.tgz#7093d4ea8177e0a0da87681a9e7b09a258b9daf7" - integrity sha512-j2otfqh7mOvMgN2WlJ0n7gIx9XCMWntheYGlBK7+5g3b1Su13/UAK7pdKGyd4kDlrLwtH2QPvRv5oNIxWvsJ1w== +jest-watcher@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.3.1.tgz#3341547e14fe3c0f79f9c3a4c62dbc3fc977fd4a" + integrity sha512-RspXG2BQFDsZSRKGCT/NiNa8RkQ1iKAjrO0//soTMWx/QUt+OcxMqMSBxz23PYGqUuWm2+m2mNNsmj0eIoOaFg== dependencies: - "@jest/test-result" "^29.2.1" - "@jest/types" "^29.2.1" + "@jest/test-result" "^29.3.1" + "@jest/types" "^29.3.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.13.1" - jest-util "^29.2.1" + jest-util "^29.3.1" string-length "^4.0.1" -jest-worker@^29.3.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.3.0.tgz#240a1cd731c7d6645e8bcc37a3d584f122afb44a" - integrity sha512-rP8LYClB5NCWW0p8GdQT9vRmZNrDmjypklEYZuGCIU5iNviVWCZK5MILS3rQwD0FY1u96bY7b+KoU17DdZy6Ww== +jest-worker@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.3.1.tgz#e9462161017a9bb176380d721cab022661da3d6b" + integrity sha512-lY4AnnmsEWeiXirAIA0c9SDPbuCBq8IYuDVL8PMm0MZ2PEs2yPvRA/J64QBXuZp7CYKrDM/rmNrc9/i3KJQncw== dependencies: "@types/node" "*" - jest-util "^29.2.1" + jest-util "^29.3.1" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^29.0.0: - version "29.3.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.3.0.tgz#edb9ef5b308e90e1c717c8accc04b28f133ac66d" - integrity sha512-lWmHtOcJSjR6FYRw+4oo7456QUe6LN73Lw6HLwOWKTPLcyQF60cMh0EoIHi67dV74SY5tw/kL+jYC+Ji43ScUg== + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.3.1.tgz#c130c0d551ae6b5459b8963747fed392ddbde122" + integrity sha512-6iWfL5DTT0Np6UYs/y5Niu7WIfNv/wRTtN5RSXt2DIEft3dx3zPuw/3WJQBCJfmEzvDiEKwoqMbGD9n49+qLSA== dependencies: - "@jest/core" "^29.3.0" - "@jest/types" "^29.2.1" + "@jest/core" "^29.3.1" + "@jest/types" "^29.3.1" import-local "^3.0.2" - jest-cli "^29.3.0" + jest-cli "^29.3.1" js-sdsl@^4.1.4: version "4.1.5" @@ -2274,10 +2274,10 @@ prettier@>=3.0.0-alpha.2: resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0-alpha.4.tgz#eee71d6b520b970f44e4045f2dc772bf6f80815f" integrity sha512-+KeqJv4E5kaRsDRgSx9IeVygLKGHRmcoPvRJvPFp3bC1mw8opsva555gGb8TaJzUiHXoLZcus1EX+nlHPda7Pw== -pretty-format@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.2.1.tgz#86e7748fe8bbc96a6a4e04fa99172630907a9611" - integrity sha512-Y41Sa4aLCtKAXvwuIpTvcFBkyeYp2gdFWzXGA+ZNES3VwURIB165XO/z7CjETwzCCS53MjW/rLMyyqEnTtaOfA== +pretty-format@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.3.1.tgz#1841cac822b02b4da8971dacb03e8a871b4722da" + integrity sha512-FyLnmb1cYJV8biEIiRyzRFvs2lry7PPIvOqKVe1GCUEYg4YGmlx1qG9EJNMxArYm7piII4qb8UV1Pncq5dxmcg== dependencies: "@jest/schemas" "^29.0.0" ansi-styles "^5.0.0" From 1408576a9b221e68cc306c2a7d1fb9a3374c08ee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Nov 2022 12:01:40 +0000 Subject: [PATCH 675/785] Bump eslint from 8.27.0 to 8.28.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.27.0 to 8.28.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.27.0...v8.28.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index d6f6b9a1..3926841d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1144,9 +1144,9 @@ eslint-visitor-keys@^3.3.0: integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.15.0: - version "8.27.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.27.0.tgz#d547e2f7239994ad1faa4bb5d84e5d809db7cf64" - integrity sha512-0y1bfG2ho7mty+SiILVf9PfuRA49ek4Nc60Wmmu62QlobNR+CeXa4xXIJgcuwSQgZiWaPH+5BDsctpIW0PR/wQ== + version "8.28.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.28.0.tgz#81a680732634677cc890134bcdd9fdfea8e63d6e" + integrity sha512-S27Di+EVyMxcHiwDrFzk8dJYAaD+/5SoWKxL1ri/71CRHsnJnRDPNt2Kzj24+MT9FDupf4aqqyqPrvI8MvQ4VQ== dependencies: "@eslint/eslintrc" "^1.3.3" "@humanwhocodes/config-array" "^0.11.6" From 3042501f98be3123671d24d373b040748224076b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Dec 2022 12:00:35 +0000 Subject: [PATCH 676/785] Bump eslint from 8.28.0 to 8.29.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.28.0 to 8.29.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.28.0...v8.29.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 3926841d..94dd2115 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1144,9 +1144,9 @@ eslint-visitor-keys@^3.3.0: integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.15.0: - version "8.28.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.28.0.tgz#81a680732634677cc890134bcdd9fdfea8e63d6e" - integrity sha512-S27Di+EVyMxcHiwDrFzk8dJYAaD+/5SoWKxL1ri/71CRHsnJnRDPNt2Kzj24+MT9FDupf4aqqyqPrvI8MvQ4VQ== + version "8.29.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.29.0.tgz#d74a88a20fb44d59c51851625bc4ee8d0ec43f87" + integrity sha512-isQ4EEiyUjZFbEKvEGJKKGBwXtvXX+zJbkVKCgTuB9t/+jUBcy8avhkEwWJecI15BkRkOYmvIM5ynbhRjEkoeg== dependencies: "@eslint/eslintrc" "^1.3.3" "@humanwhocodes/config-array" "^0.11.6" From 88dc5723b9b38625bd49d06124399a0631d7ed98 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Dec 2022 12:00:35 +0000 Subject: [PATCH 677/785] Bump eslint from 8.29.0 to 8.30.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.29.0 to 8.30.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.29.0...v8.30.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/yarn.lock b/yarn.lock index 94dd2115..9f235e9c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -297,29 +297,29 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@eslint/eslintrc@^1.3.3": - version "1.3.3" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.3.tgz#2b044ab39fdfa75b4688184f9e573ce3c5b0ff95" - integrity sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg== +"@eslint/eslintrc@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.4.0.tgz#8ec64e0df3e7a1971ee1ff5158da87389f167a63" + integrity sha512-7yfvXy6MWLgWSFsLhz5yH3iQ52St8cdUY6FoGieKkRDVxuxmrNuUetIuu6cmjNWwniUHiWXjxCr5tTXDrbYS5A== dependencies: ajv "^6.12.4" debug "^4.3.2" espree "^9.4.0" - globals "^13.15.0" + globals "^13.19.0" ignore "^5.2.0" import-fresh "^3.2.1" js-yaml "^4.1.0" minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@humanwhocodes/config-array@^0.11.6": - version "0.11.6" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.6.tgz#6a51d603a3aaf8d4cf45b42b3f2ac9318a4adc4b" - integrity sha512-jJr+hPTJYKyDILJfhNSHsjiwXYf26Flsz8DvNndOsHs5pwSnpGUEy8yzF0JYhCEvTDdV2vuOK5tt8BVhwO5/hg== +"@humanwhocodes/config-array@^0.11.8": + version "0.11.8" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.8.tgz#03595ac2075a4dc0f191cc2131de14fbd7d410b9" + integrity sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g== dependencies: "@humanwhocodes/object-schema" "^1.2.1" debug "^4.1.1" - minimatch "^3.0.4" + minimatch "^3.0.5" "@humanwhocodes/module-importer@^1.0.1": version "1.0.1" @@ -1144,12 +1144,12 @@ eslint-visitor-keys@^3.3.0: integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.15.0: - version "8.29.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.29.0.tgz#d74a88a20fb44d59c51851625bc4ee8d0ec43f87" - integrity sha512-isQ4EEiyUjZFbEKvEGJKKGBwXtvXX+zJbkVKCgTuB9t/+jUBcy8avhkEwWJecI15BkRkOYmvIM5ynbhRjEkoeg== + version "8.30.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.30.0.tgz#83a506125d089eef7c5b5910eeea824273a33f50" + integrity sha512-MGADB39QqYuzEGov+F/qb18r4i7DohCDOfatHaxI2iGlPuC65bwG2gxgO+7DkyL38dRFaRH7RaRAgU6JKL9rMQ== dependencies: - "@eslint/eslintrc" "^1.3.3" - "@humanwhocodes/config-array" "^0.11.6" + "@eslint/eslintrc" "^1.4.0" + "@humanwhocodes/config-array" "^0.11.8" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" ajv "^6.10.0" @@ -1168,7 +1168,7 @@ eslint@^8.15.0: file-entry-cache "^6.0.1" find-up "^5.0.0" glob-parent "^6.0.2" - globals "^13.15.0" + globals "^13.19.0" grapheme-splitter "^1.0.4" ignore "^5.2.0" import-fresh "^3.0.0" @@ -1410,10 +1410,10 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -globals@^13.15.0: - version "13.17.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.17.0.tgz#902eb1e680a41da93945adbdcb5a9f361ba69bd4" - integrity sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw== +globals@^13.19.0: + version "13.19.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.19.0.tgz#7a42de8e6ad4f7242fbcca27ea5b23aca367b5c8" + integrity sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ== dependencies: type-fest "^0.20.2" @@ -2091,7 +2091,7 @@ mimic-fn@^2.1.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== -minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: +minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== From 8f212a9ccfe3301d386a4d736055d21755033f2a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Jan 2023 12:00:34 +0000 Subject: [PATCH 678/785] Bump eslint from 8.30.0 to 8.31.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.30.0 to 8.31.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.30.0...v8.31.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9f235e9c..bb1647ff 100644 --- a/yarn.lock +++ b/yarn.lock @@ -297,10 +297,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@eslint/eslintrc@^1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.4.0.tgz#8ec64e0df3e7a1971ee1ff5158da87389f167a63" - integrity sha512-7yfvXy6MWLgWSFsLhz5yH3iQ52St8cdUY6FoGieKkRDVxuxmrNuUetIuu6cmjNWwniUHiWXjxCr5tTXDrbYS5A== +"@eslint/eslintrc@^1.4.1": + version "1.4.1" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.4.1.tgz#af58772019a2d271b7e2d4c23ff4ddcba3ccfb3e" + integrity sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA== dependencies: ajv "^6.12.4" debug "^4.3.2" @@ -1144,11 +1144,11 @@ eslint-visitor-keys@^3.3.0: integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.15.0: - version "8.30.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.30.0.tgz#83a506125d089eef7c5b5910eeea824273a33f50" - integrity sha512-MGADB39QqYuzEGov+F/qb18r4i7DohCDOfatHaxI2iGlPuC65bwG2gxgO+7DkyL38dRFaRH7RaRAgU6JKL9rMQ== + version "8.31.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.31.0.tgz#75028e77cbcff102a9feae1d718135931532d524" + integrity sha512-0tQQEVdmPZ1UtUKXjX7EMm9BlgJ08G90IhWh0PKDCb3ZLsgAOHI8fYSIzYVZej92zsgq+ft0FGsxhJ3xo2tbuA== dependencies: - "@eslint/eslintrc" "^1.4.0" + "@eslint/eslintrc" "^1.4.1" "@humanwhocodes/config-array" "^0.11.8" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" From 9b3c42cec2b181b709ed9edc71b142548ea130ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Jan 2023 12:01:30 +0000 Subject: [PATCH 679/785] Bump json5 from 2.2.1 to 2.2.3 Bumps [json5](https://github.com/json5/json5) from 2.2.1 to 2.2.3. - [Release notes](https://github.com/json5/json5/releases) - [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md) - [Commits](https://github.com/json5/json5/compare/v2.2.1...v2.2.3) --- updated-dependencies: - dependency-name: json5 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index bb1647ff..2fb5d460 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2006,9 +2006,9 @@ json-stable-stringify-without-jsonify@^1.0.1: integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== json5@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" - integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== + version "2.2.3" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" + integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== kleur@^3.0.3: version "3.0.3" From 6d0a39114276223bbc9eaa223429b2d7763909b9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Jan 2023 12:00:36 +0000 Subject: [PATCH 680/785] Bump husky from 8.0.2 to 8.0.3 Bumps [husky](https://github.com/typicode/husky) from 8.0.2 to 8.0.3. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v8.0.2...v8.0.3) --- updated-dependencies: - dependency-name: husky dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2fb5d460..5f2afa1f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1460,9 +1460,9 @@ human-signals@^2.1.0: integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== husky@^8.0.1: - version "8.0.2" - resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.2.tgz#5816a60db02650f1f22c8b69b928fd6bcd77a236" - integrity sha512-Tkv80jtvbnkK3mYWxPZePGFpQ/tT3HNSs/sasF9P2YfkMezDl3ON37YN6jUUI4eTg5LcyVynlb6r4eyvOmspvg== + version "8.0.3" + resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.3.tgz#4936d7212e46d1dea28fef29bb3a108872cd9184" + integrity sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg== ignore@^5.1.4, ignore@^5.2.0: version "5.2.0" From 62e1ff038e5095883b2b5605d595b076760e64e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Jan 2023 12:00:43 +0000 Subject: [PATCH 681/785] Bump eslint-config-prettier from 8.5.0 to 8.6.0 Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.5.0 to 8.6.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.5.0...v8.6.0) --- updated-dependencies: - dependency-name: eslint-config-prettier dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2fb5d460..515ab3cb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1114,9 +1114,9 @@ escape-string-regexp@^4.0.0: integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== eslint-config-prettier@^8.0.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== + version "8.6.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz#dec1d29ab728f4fa63061774e1672ac4e363d207" + integrity sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA== eslint-scope@^7.1.1: version "7.1.1" From a28cbd62eca2ffe0e6f06fce42c7231a0ccdc68c Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 3 Jan 2023 22:36:41 -0500 Subject: [PATCH 682/785] Add a workflow for GitHub Actions dependabot --- .github/dependabot.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f7068438..29fe4b24 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,3 +8,7 @@ updates: directory: "/" schedule: interval: "daily" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" From 68633a40fc8203586705ef0452cddd852b25e807 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 3 Jan 2023 22:37:40 -0500 Subject: [PATCH 683/785] Fix up README badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 483a13c9..c27eeee0 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Gitter - GitHub Actions + GitHub Actions NPM Version From 626733e3867c714f47d82fa97e45407881e6514f Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 3 Jan 2023 22:39:43 -0500 Subject: [PATCH 684/785] Remove more tests from stree --- test/js/ruby/nodes/blocks.test.js | 15 --------------- test/js/ruby/nodes/method.test.js | 4 ---- 2 files changed, 19 deletions(-) diff --git a/test/js/ruby/nodes/blocks.test.js b/test/js/ruby/nodes/blocks.test.js index 9eec551a..8d4c9d8f 100644 --- a/test/js/ruby/nodes/blocks.test.js +++ b/test/js/ruby/nodes/blocks.test.js @@ -127,21 +127,6 @@ describe("blocks", () => { }); }); - // from ruby test/ruby/test_call.rb - test("inline do end", () => { - return expect(`assert_nil(("a".sub! "b" do end&.foo {}))`).toChangeFormat( - ruby(` - assert_nil( - ( - "a".sub! "b" do - end&.foo do - end - ) - ) - `) - ); - }); - test("excessed_comma nodes", () => { return expect("proc { |x,| }").toMatchFormat(); }); diff --git a/test/js/ruby/nodes/method.test.js b/test/js/ruby/nodes/method.test.js index 9651ac3e..a011fc70 100644 --- a/test/js/ruby/nodes/method.test.js +++ b/test/js/ruby/nodes/method.test.js @@ -170,10 +170,6 @@ describe("method", () => { return expect("def foo = bar").toMatchFormat(); }); - test("single-line methods with empty params", () => { - return expect("def foo() = bar").toChangeFormat("def foo = bar"); - }); - test("single-line methods with params", () => { return expect("def foo(name) = bar").toMatchFormat(); }); From 5caf2f4dc2707e7c7de6ec33b811cc795e074cc5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Jan 2023 03:40:17 +0000 Subject: [PATCH 685/785] Bump dependabot/fetch-metadata from 1.3.3 to 1.3.5 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.3.3 to 1.3.5. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.3.3...v1.3.5) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/auto-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index 9b28abf4..514ac27a 100644 --- a/.github/workflows/auto-merge.yml +++ b/.github/workflows/auto-merge.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v1.3.3 + uses: dependabot/fetch-metadata@v1.3.5 with: github-token: "${{ secrets.GITHUB_TOKEN }}" - name: Enable auto-merge for Dependabot PRs From 6b5d7d73d2870e3140b50f9616a8cb6a50db728b Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 3 Jan 2023 22:42:00 -0500 Subject: [PATCH 686/785] Update deps --- yarn.lock | 281 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 147 insertions(+), 134 deletions(-) diff --git a/yarn.lock b/yarn.lock index 6ad97077..8df6eb3e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17,49 +17,50 @@ dependencies: "@babel/highlight" "^7.18.6" -"@babel/compat-data@^7.19.3": - version "7.19.4" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.19.4.tgz#95c86de137bf0317f3a570e1b6e996b427299747" - integrity sha512-CHIGpJcUQ5lU9KrPHTjBMhVwQG6CQjxfg36fGXl3qk/Gik1WwWachaXFuo0uCWJT/mStOKtcbFJCaVLihC1CMw== +"@babel/compat-data@^7.20.5": + version "7.20.10" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.20.10.tgz#9d92fa81b87542fff50e848ed585b4212c1d34ec" + integrity sha512-sEnuDPpOJR/fcafHMjpcpGN5M2jbUGUHwmuWKM/YdPzeEDJg8bgmbcWQFUfE32MQjti1koACvoPVsDe8Uq+idg== "@babel/core@^7.11.6", "@babel/core@^7.12.3": - version "7.19.3" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.19.3.tgz#2519f62a51458f43b682d61583c3810e7dcee64c" - integrity sha512-WneDJxdsjEvyKtXKsaBGbDeiyOjR5vYq4HcShxnIbG0qixpoHjI3MqeZM9NDvsojNCEBItQE4juOo/bU6e72gQ== + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.20.7.tgz#37072f951bd4d28315445f66e0ec9f6ae0c8c35f" + integrity sha512-t1ZjCluspe5DW24bn2Rr1CDb2v9rn/hROtg9a2tmd0+QYf4bsloYfLQzjG4qHPNMhWtKdGC33R5AxGR2Af2cBw== dependencies: "@ampproject/remapping" "^2.1.0" "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.19.3" - "@babel/helper-compilation-targets" "^7.19.3" - "@babel/helper-module-transforms" "^7.19.0" - "@babel/helpers" "^7.19.0" - "@babel/parser" "^7.19.3" - "@babel/template" "^7.18.10" - "@babel/traverse" "^7.19.3" - "@babel/types" "^7.19.3" + "@babel/generator" "^7.20.7" + "@babel/helper-compilation-targets" "^7.20.7" + "@babel/helper-module-transforms" "^7.20.7" + "@babel/helpers" "^7.20.7" + "@babel/parser" "^7.20.7" + "@babel/template" "^7.20.7" + "@babel/traverse" "^7.20.7" + "@babel/types" "^7.20.7" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.1" semver "^6.3.0" -"@babel/generator@^7.19.3", "@babel/generator@^7.19.4", "@babel/generator@^7.7.2": - version "7.19.5" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.19.5.tgz#da3f4b301c8086717eee9cab14da91b1fa5dcca7" - integrity sha512-DxbNz9Lz4aMZ99qPpO1raTbcrI1ZeYh+9NR9qhfkQIbFtVEqotHojEBxHzmxhVONkGt6VyrqVQcgpefMy9pqcg== +"@babel/generator@^7.20.7", "@babel/generator@^7.7.2": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.7.tgz#f8ef57c8242665c5929fe2e8d82ba75460187b4a" + integrity sha512-7wqMOJq8doJMZmP4ApXTzLxSr7+oO2jroJURrVEp6XShrQUObV8Tq/D0NCcoYg2uHqUrjzO0zwBjoYzelxK+sw== dependencies: - "@babel/types" "^7.19.4" + "@babel/types" "^7.20.7" "@jridgewell/gen-mapping" "^0.3.2" jsesc "^2.5.1" -"@babel/helper-compilation-targets@^7.19.3": - version "7.19.3" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.19.3.tgz#a10a04588125675d7c7ae299af86fa1b2ee038ca" - integrity sha512-65ESqLGyGmLvgR0mst5AdW1FkNlj9rQsCKduzEoEPhBCDFGXvz2jW6bXFG6i0/MrV2s7hhXjjb2yAzcPuQlLwg== +"@babel/helper-compilation-targets@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz#a6cd33e93629f5eb473b021aac05df62c4cd09bb" + integrity sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ== dependencies: - "@babel/compat-data" "^7.19.3" + "@babel/compat-data" "^7.20.5" "@babel/helper-validator-option" "^7.18.6" browserslist "^4.21.3" + lru-cache "^5.1.1" semver "^6.3.0" "@babel/helper-environment-visitor@^7.18.9": @@ -89,31 +90,31 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-module-transforms@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.19.0.tgz#309b230f04e22c58c6a2c0c0c7e50b216d350c30" - integrity sha512-3HBZ377Fe14RbLIA+ac3sY4PTgpxHVkFrESaWhoI5PuyXPBBX8+C34qblV9G89ZtycGJCmCI/Ut+VUDK4bltNQ== +"@babel/helper-module-transforms@^7.20.7": + version "7.20.11" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.20.11.tgz#df4c7af713c557938c50ea3ad0117a7944b2f1b0" + integrity sha512-uRy78kN4psmji1s2QtbtcCSaj/LILFDp0f/ymhpQH5QY3nljUZCaNWz9X1dEj/8MBdBEFECs7yRhKn8i7NjZgg== dependencies: "@babel/helper-environment-visitor" "^7.18.9" "@babel/helper-module-imports" "^7.18.6" - "@babel/helper-simple-access" "^7.18.6" + "@babel/helper-simple-access" "^7.20.2" "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/helper-validator-identifier" "^7.18.6" - "@babel/template" "^7.18.10" - "@babel/traverse" "^7.19.0" - "@babel/types" "^7.19.0" + "@babel/helper-validator-identifier" "^7.19.1" + "@babel/template" "^7.20.7" + "@babel/traverse" "^7.20.10" + "@babel/types" "^7.20.7" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.8.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.19.0.tgz#4796bb14961521f0f8715990bee2fb6e51ce21bf" - integrity sha512-40Ryx7I8mT+0gaNxm8JGTZFUITNqdLAgdg0hXzeVZxVD6nFsdhQvip6v8dqkRHzsz1VFpFAaOCHNn0vKBL7Czw== +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.8.0": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz#d1b9000752b18d0877cff85a5c376ce5c3121629" + integrity sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ== -"@babel/helper-simple-access@^7.18.6": - version "7.19.4" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.19.4.tgz#be553f4951ac6352df2567f7daa19a0ee15668e7" - integrity sha512-f9Xq6WqBFqaDfbCzn2w85hwklswz5qsKlh7f08w4Y9yhJHpnNC0QemtSkK5YyOY8kPGvyiwdzZksGUhnGdaUIg== +"@babel/helper-simple-access@^7.20.2": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz#0ab452687fe0c2cfb1e2b9e0015de07fc2d62dd9" + integrity sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA== dependencies: - "@babel/types" "^7.19.4" + "@babel/types" "^7.20.2" "@babel/helper-split-export-declaration@^7.18.6": version "7.18.6" @@ -137,14 +138,14 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz#bf0d2b5a509b1f336099e4ff36e1a63aa5db4db8" integrity sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw== -"@babel/helpers@^7.19.0": - version "7.19.4" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.19.4.tgz#42154945f87b8148df7203a25c31ba9a73be46c5" - integrity sha512-G+z3aOx2nfDHwX/kyVii5fJq+bgscg89/dJNWpYeKeBv3v9xX8EIabmx1k6u9LS04H7nROFVRVK+e3k0VHp+sw== +"@babel/helpers@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.20.7.tgz#04502ff0feecc9f20ecfaad120a18f011a8e6dce" + integrity sha512-PBPjs5BppzsGaxHQCDKnZ6Gd9s6xl8bBCluz3vEInLGRJmnZan4F6BYCeqtyXqkk4W5IlPmjK4JlOuZkpJ3xZA== dependencies: - "@babel/template" "^7.18.10" - "@babel/traverse" "^7.19.4" - "@babel/types" "^7.19.4" + "@babel/template" "^7.20.7" + "@babel/traverse" "^7.20.7" + "@babel/types" "^7.20.7" "@babel/highlight@^7.18.6": version "7.18.6" @@ -155,10 +156,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.18.10", "@babel/parser@^7.19.3", "@babel/parser@^7.19.4": - version "7.19.4" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.19.4.tgz#03c4339d2b8971eb3beca5252bafd9b9f79db3dc" - integrity sha512-qpVT7gtuOLjWeDTKLkJ6sryqLliBaFpAtGeqw5cs5giLldvh+Ch0plqnUMKoVAUS6ZEueQQiZV+p5pxtPitEsA== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.7.tgz#66fe23b3c8569220817d5feb8b9dcdc95bb4f71b" + integrity sha512-T3Z9oHybU+0vZlY9CiDSJQTD5ZapcW18ZctFMi0MOAl/4BjFF4ul7NVSARLdbGO5vDqy9eQiGTV0LtKfvCYvcg== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -252,41 +253,41 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-typescript@^7.7.2": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.18.6.tgz#1c09cd25795c7c2b8a4ba9ae49394576d4133285" - integrity sha512-mAWAuq4rvOepWCBid55JuRNvpTNf2UGVgoz4JV0fXEKolsVZDzsa4NqCef758WZJj/GDu0gVGItjKFiClTAmZA== + version "7.20.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.20.0.tgz#4e9a0cfc769c85689b77a2e642d24e9f697fc8c7" + integrity sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.19.0" -"@babel/template@^7.18.10", "@babel/template@^7.3.3": - version "7.18.10" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.18.10.tgz#6f9134835970d1dbf0835c0d100c9f38de0c5e71" - integrity sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA== +"@babel/template@^7.18.10", "@babel/template@^7.20.7", "@babel/template@^7.3.3": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.20.7.tgz#a15090c2839a83b02aa996c0b4994005841fd5a8" + integrity sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw== dependencies: "@babel/code-frame" "^7.18.6" - "@babel/parser" "^7.18.10" - "@babel/types" "^7.18.10" + "@babel/parser" "^7.20.7" + "@babel/types" "^7.20.7" -"@babel/traverse@^7.19.0", "@babel/traverse@^7.19.3", "@babel/traverse@^7.19.4", "@babel/traverse@^7.7.2": - version "7.19.4" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.19.4.tgz#f117820e18b1e59448a6c1fa9d0ff08f7ac459a8" - integrity sha512-w3K1i+V5u2aJUOXBFFC5pveFLmtq1s3qcdDNC2qRI6WPBQIDaKFqXxDEqDO/h1dQ3HjsZoZMyIy6jGLq0xtw+g== +"@babel/traverse@^7.20.10", "@babel/traverse@^7.20.7", "@babel/traverse@^7.7.2": + version "7.20.10" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.10.tgz#2bf98239597fcec12f842756f186a9dde6d09230" + integrity sha512-oSf1juCgymrSez8NI4A2sr4+uB/mFd9MXplYGPEBnfAuWmmyeVcHa6xLPiaRBcXkcb/28bgxmQLTVwFKE1yfsg== dependencies: "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.19.4" + "@babel/generator" "^7.20.7" "@babel/helper-environment-visitor" "^7.18.9" "@babel/helper-function-name" "^7.19.0" "@babel/helper-hoist-variables" "^7.18.6" "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.19.4" - "@babel/types" "^7.19.4" + "@babel/parser" "^7.20.7" + "@babel/types" "^7.20.7" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.19.0", "@babel/types@^7.19.3", "@babel/types@^7.19.4", "@babel/types@^7.3.0", "@babel/types@^7.3.3": - version "7.19.4" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.19.4.tgz#0dd5c91c573a202d600490a35b33246fed8a41c7" - integrity sha512-M5LK7nAeS6+9j7hAq+b3fQs+pNfUtTGq+yFFfHnauFA8zQtLRfmuipmsKDKKLuyG+wC8ABW43A153YNawNTEtw== +"@babel/types@^7.0.0", "@babel/types@^7.18.6", "@babel/types@^7.19.0", "@babel/types@^7.20.2", "@babel/types@^7.20.7", "@babel/types@^7.3.0", "@babel/types@^7.3.3": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.7.tgz#54ec75e252318423fc07fb644dc6a58a64c09b7f" + integrity sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg== dependencies: "@babel/helper-string-parser" "^7.19.4" "@babel/helper-validator-identifier" "^7.19.1" @@ -601,14 +602,14 @@ fastq "^1.6.0" "@sinclair/typebox@^0.24.1": - version "0.24.47" - resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.47.tgz#530b67163714356f93e82bdb871e7db4b7bc564e" - integrity sha512-J4Xw0xYK4h7eC34MNOPQi6IkNxGRck6n4VJpWDzXIFVTW8I/D43Gf+NfWz/v/7NHlzWOPd3+T4PJ4OqklQ2u7A== + version "0.24.51" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.51.tgz#645f33fe4e02defe26f2f5c0410e1c094eac7f5f" + integrity sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA== "@sinonjs/commons@^1.7.0": - version "1.8.3" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" - integrity sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ== + version "1.8.6" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.6.tgz#80c516a4dc264c2a69115e7578d62581ff455ed9" + integrity sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ== dependencies: type-detect "4.0.8" @@ -620,9 +621,9 @@ "@sinonjs/commons" "^1.7.0" "@types/babel__core@^7.1.14": - version "7.1.19" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.19.tgz#7b497495b7d1b4812bdb9d02804d0576f43ee460" - integrity sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw== + version "7.1.20" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.20.tgz#e168cdd612c92a2d335029ed62ac94c95b362359" + integrity sha512-PVb6Bg2QuscZ30FvOU7z4guG6c926D9YRvOxEaelzndpMsvP+YM74Q/dAFASpg2l6+XLalxSGxcq/lrgYWZtyQ== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" @@ -646,9 +647,9 @@ "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": - version "7.18.2" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.18.2.tgz#235bf339d17185bdec25e024ca19cce257cc7309" - integrity sha512-FcFaxOr2V5KZCviw1TnutEMVUVsGt4D2hP1TAfXZAMKuHYW3xQhe3jTxNPWutgCJ3/X1c5yX8ZoGVEItxKbwBg== + version "7.18.3" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.18.3.tgz#dfc508a85781e5698d5b33443416b6268c4b3e8d" + integrity sha512-1kbcJ40lLB7MHsj39U4Sh1uTd2E7rLEa79kmDpI6cy+XiXsteB3POdQomoq4FxszMrO3ZYchkhYJw7A2862b3w== dependencies: "@babel/types" "^7.3.0" @@ -684,14 +685,14 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*": - version "18.11.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.2.tgz#c59b7641832531264fda3f1ba610362dc9a7dfc8" - integrity sha512-BWN3M23gLO2jVG8g/XHIRFWiiV4/GckeFIqbU/C4V3xpoBBWSMk4OZomouN0wCkfQFPqgZikyLr7DOYDysIkkw== + version "18.11.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.18.tgz#8dfb97f0da23c2293e554c5a50d61ef134d7697f" + integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA== "@types/prettier@^2.1.5": - version "2.7.1" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.1.tgz#dfd20e2dc35f027cdd6c1908e80a5ddc7499670e" - integrity sha512-ri0UmynRRvZiiUJdiz38MmIblKK+oH30MztdBVR95dv/Ubw6neWSb8u1XpRb72L4qsZOhz+L+z9JD40SJmfWow== + version "2.7.2" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.2.tgz#6c2324641cc4ba050a8c710b2b251b377581fbf0" + integrity sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg== "@types/stack-utils@^2.0.0": version "2.0.1" @@ -704,9 +705,9 @@ integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== "@types/yargs@^17.0.8": - version "17.0.13" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.13.tgz#34cced675ca1b1d51fcf4d34c3c6f0fa142a5c76" - integrity sha512-9sWaruZk2JGxIQU+IhI1fhPYRcQ0UuTNuKuCW9bR5fp7qi2Llf7WDzNa17Cy7TKnh3cdxDOiyTu6gaLS0eDatg== + version "17.0.19" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.19.tgz#8dbecdc9ab48bee0cb74f6e3327de3fa0d0c98ae" + integrity sha512-cAx3qamwaYX9R0fzOIZAlFpo4A+1uBVCxqpKz9D26uTF4srRXaGTTsikQmaotCtNdbhzyUH7ft6p9ktz9s6UNQ== dependencies: "@types/yargs-parser" "*" @@ -716,9 +717,9 @@ acorn-jsx@^5.3.2: integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== acorn@^8.8.0: - version "8.8.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" - integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== + version "8.8.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.1.tgz#0a3f9cbecc4ec3bea6f0a80b66ae8dd2da250b73" + integrity sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA== ajv@^6.10.0, ajv@^6.12.4: version "6.12.6" @@ -762,9 +763,9 @@ ansi-styles@^5.0.0: integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== anymatch@^3.0.3: - version "3.1.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" - integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== + version "3.1.3" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== dependencies: normalize-path "^3.0.0" picomatch "^2.0.4" @@ -914,9 +915,9 @@ camelcase@^6.2.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001400: - version "1.0.30001422" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001422.tgz#f2d7c6202c49a8359e6e35add894d88ef93edba1" - integrity sha512-hSesn02u1QacQHhaxl/kNMZwqVG35Sz/8DgvmgedxSH8z9UUpcDYSPYgsj3x5dQNRcNp6BwpSfQfVzYUTm+fog== + version "1.0.30001441" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001441.tgz#987437b266260b640a23cd18fbddb509d7f69f3e" + integrity sha512-OyxRR4Vof59I3yGWXws6i908EtGbMzVUi3ganaZQHmydk1iwDhRnvaPG2WaR0KcqrDFKrxVZHULT396LEPhXfg== chalk@^2.0.0: version "2.4.2" @@ -949,9 +950,9 @@ char-regex@^1.0.2: integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== ci-info@^3.2.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.5.0.tgz#bfac2a29263de4c829d806b1ab478e35091e171f" - integrity sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw== + version "3.7.1" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.7.1.tgz#708a6cdae38915d597afdf3b145f2f8e1ff55f3f" + integrity sha512-4jYS4MOAaCIStSRwiuxc4B8MYhIe676yO1sYGzARnjXkWpmzZMMYxY6zu8WYWDhSuth5zhrQ1rhNSibyyvv4/w== cjs-module-lexer@^1.0.0: version "1.2.2" @@ -1189,9 +1190,9 @@ eslint@^8.15.0: text-table "^0.2.0" espree@^9.4.0: - version "9.4.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.4.0.tgz#cd4bc3d6e9336c433265fc0aa016fc1aaf182f8a" - integrity sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw== + version "9.4.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.4.1.tgz#51d6092615567a2c2cff7833445e37c28c0065bd" + integrity sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg== dependencies: acorn "^8.8.0" acorn-jsx "^5.3.2" @@ -1288,9 +1289,9 @@ fast-levenshtein@^2.0.6: integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== fastq@^1.6.0: - version "1.13.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" - integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== + version "1.15.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.15.0.tgz#d04d07c6a2a68fe4599fea8d2e103a937fae6b3a" + integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw== dependencies: reusify "^1.0.4" @@ -1465,9 +1466,9 @@ husky@^8.0.1: integrity sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg== ignore@^5.1.4, ignore@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" - integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== + version "5.2.4" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" + integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== import-fresh@^3.0.0, import-fresh@^3.2.1: version "3.3.0" @@ -1785,9 +1786,9 @@ jest-mock@^29.3.1: jest-util "^29.3.1" jest-pnp-resolver@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" - integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== + version "1.2.3" + resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz#930b1546164d4ad5937d5540e711d4d38d4cad2e" + integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== jest-regex-util@^29.2.0: version "29.2.0" @@ -1961,9 +1962,9 @@ jest@^29.0.0: jest-cli "^29.3.1" js-sdsl@^4.1.4: - version "4.1.5" - resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.1.5.tgz#1ff1645e6b4d1b028cd3f862db88c9d887f26e2a" - integrity sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q== + version "4.2.0" + resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.2.0.tgz#278e98b7bea589b8baaf048c20aeb19eb7ad09d0" + integrity sha512-dyBIzQBDkCqCu+0upx25Y2jGdbTGxE9fshMsCdK0ViOongpV+n5tXRcZY9v7CaVQ79AGS9KA1KHtojxiM7aXSQ== js-tokens@^4.0.0: version "4.0.0" @@ -2052,6 +2053,13 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== +lru-cache@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" + integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== + dependencies: + yallist "^3.0.2" + lru-cache@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" @@ -2130,9 +2138,9 @@ node-int64@^0.4.0: integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== node-releases@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.6.tgz#8a7088c63a55e493845683ebf3c828d8c51c5503" - integrity sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg== + version "2.0.8" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.8.tgz#0f349cdc8fcfa39a92ac0be9bc48b7706292b9ae" + integrity sha512-dFSmB8fFHEH/s81Xi+Y/15DQY6VHW81nXRj86EMSL3lmuTmK1e+aT4wrFCkTbm+gSwkw4KpX+rT/pMM2c1mF+A== normalize-path@^3.0.0: version "3.0.0" @@ -2444,9 +2452,9 @@ sprintf-js@~1.0.2: integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== stack-utils@^2.0.3: - version "2.0.5" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.5.tgz#d25265fca995154659dbbfba3b49254778d2fdd5" - integrity sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA== + version "2.0.6" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.6.tgz#aaf0748169c02fc33c8232abccf933f54a1cc34f" + integrity sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ== dependencies: escape-string-regexp "^2.0.0" @@ -2638,20 +2646,25 @@ y18n@^5.0.5: resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== +yallist@^3.0.2: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" + integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== + yallist@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yargs-parser@^21.0.0: +yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== yargs@^17.3.1: - version "17.6.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.6.0.tgz#e134900fc1f218bc230192bdec06a0a5f973e46c" - integrity sha512-8H/wTDqlSwoSnScvV2N/JHfLWOKuh5MVla9hqLjK3nsfyy6Y4kDSYSvkU5YCUEPOSnRXfIyx3Sq+B/IWudTo4g== + version "17.6.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.6.2.tgz#2e23f2944e976339a1ee00f18c77fedee8332541" + integrity sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw== dependencies: cliui "^8.0.1" escalade "^3.1.1" @@ -2659,7 +2672,7 @@ yargs@^17.3.1: require-directory "^2.1.1" string-width "^4.2.3" y18n "^5.0.5" - yargs-parser "^21.0.0" + yargs-parser "^21.1.1" yocto-queue@^0.1.0: version "0.1.0" From 197801b18bbc1a3cca03df46a7e46c871f4640a2 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 26 Jan 2023 10:41:59 -0500 Subject: [PATCH 687/785] Bump deps --- package.json | 4 +- test/js/ruby/nodes/method.test.js | 4 - yarn.lock | 777 +++++++++++++++--------------- 3 files changed, 391 insertions(+), 394 deletions(-) diff --git a/package.json b/package.json index d2f552f3..17ac6d29 100644 --- a/package.json +++ b/package.json @@ -23,10 +23,10 @@ "prettier": ">=3.0.0-alpha.2" }, "devDependencies": { - "eslint": "^8.15.0", + "eslint": "^8.32.0", "eslint-config-prettier": "^8.0.0", "husky": "^8.0.1", - "jest": "^29.0.0", + "jest": "^29.4.1", "pretty-quick": "^3.1.2" }, "eslintConfig": { diff --git a/test/js/ruby/nodes/method.test.js b/test/js/ruby/nodes/method.test.js index a011fc70..5195e29f 100644 --- a/test/js/ruby/nodes/method.test.js +++ b/test/js/ruby/nodes/method.test.js @@ -190,10 +190,6 @@ describe("method", () => { }); describe("method calls", () => { - test("empty parens", () => { - return expect("foo()").toChangeFormat("foo"); - }); - test("single args", () => { return expect("foo(1)").toMatchFormat(); }); diff --git a/yarn.lock b/yarn.lock index 8df6eb3e..749ade7f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -23,24 +23,24 @@ integrity sha512-sEnuDPpOJR/fcafHMjpcpGN5M2jbUGUHwmuWKM/YdPzeEDJg8bgmbcWQFUfE32MQjti1koACvoPVsDe8Uq+idg== "@babel/core@^7.11.6", "@babel/core@^7.12.3": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.20.7.tgz#37072f951bd4d28315445f66e0ec9f6ae0c8c35f" - integrity sha512-t1ZjCluspe5DW24bn2Rr1CDb2v9rn/hROtg9a2tmd0+QYf4bsloYfLQzjG4qHPNMhWtKdGC33R5AxGR2Af2cBw== + version "7.20.12" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.20.12.tgz#7930db57443c6714ad216953d1356dac0eb8496d" + integrity sha512-XsMfHovsUYHFMdrIHkZphTN/2Hzzi78R08NuHfDBehym2VsPDL6Zn/JAD/JQdnRvbSsbQc4mVaU1m6JgtTEElg== dependencies: "@ampproject/remapping" "^2.1.0" "@babel/code-frame" "^7.18.6" "@babel/generator" "^7.20.7" "@babel/helper-compilation-targets" "^7.20.7" - "@babel/helper-module-transforms" "^7.20.7" + "@babel/helper-module-transforms" "^7.20.11" "@babel/helpers" "^7.20.7" "@babel/parser" "^7.20.7" "@babel/template" "^7.20.7" - "@babel/traverse" "^7.20.7" + "@babel/traverse" "^7.20.12" "@babel/types" "^7.20.7" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" - json5 "^2.2.1" + json5 "^2.2.2" semver "^6.3.0" "@babel/generator@^7.20.7", "@babel/generator@^7.7.2": @@ -90,7 +90,7 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-module-transforms@^7.20.7": +"@babel/helper-module-transforms@^7.20.11": version "7.20.11" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.20.11.tgz#df4c7af713c557938c50ea3ad0117a7944b2f1b0" integrity sha512-uRy78kN4psmji1s2QtbtcCSaj/LILFDp0f/ymhpQH5QY3nljUZCaNWz9X1dEj/8MBdBEFECs7yRhKn8i7NjZgg== @@ -139,12 +139,12 @@ integrity sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw== "@babel/helpers@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.20.7.tgz#04502ff0feecc9f20ecfaad120a18f011a8e6dce" - integrity sha512-PBPjs5BppzsGaxHQCDKnZ6Gd9s6xl8bBCluz3vEInLGRJmnZan4F6BYCeqtyXqkk4W5IlPmjK4JlOuZkpJ3xZA== + version "7.20.13" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.20.13.tgz#e3cb731fb70dc5337134cadc24cbbad31cc87ad2" + integrity sha512-nzJ0DWCL3gB5RCXbUO3KIMMsBY2Eqbx8mBpKGE/02PgyRQFcPQLbkQ1vyy596mZLaP+dAfD+R4ckASzNVmW3jg== dependencies: "@babel/template" "^7.20.7" - "@babel/traverse" "^7.20.7" + "@babel/traverse" "^7.20.13" "@babel/types" "^7.20.7" "@babel/highlight@^7.18.6": @@ -156,10 +156,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.7.tgz#66fe23b3c8569220817d5feb8b9dcdc95bb4f71b" - integrity sha512-T3Z9oHybU+0vZlY9CiDSJQTD5ZapcW18ZctFMi0MOAl/4BjFF4ul7NVSARLdbGO5vDqy9eQiGTV0LtKfvCYvcg== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.13", "@babel/parser@^7.20.7": + version "7.20.13" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.13.tgz#ddf1eb5a813588d2fb1692b70c6fce75b945c088" + integrity sha512-gFDLKMfpiXCsjt4za2JA9oTMn70CeseCehb11kRZgvd7+F67Hih3OHOK24cRrWECJ/ljfPGac6ygXAs/C8kIvw== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -268,10 +268,10 @@ "@babel/parser" "^7.20.7" "@babel/types" "^7.20.7" -"@babel/traverse@^7.20.10", "@babel/traverse@^7.20.7", "@babel/traverse@^7.7.2": - version "7.20.10" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.10.tgz#2bf98239597fcec12f842756f186a9dde6d09230" - integrity sha512-oSf1juCgymrSez8NI4A2sr4+uB/mFd9MXplYGPEBnfAuWmmyeVcHa6xLPiaRBcXkcb/28bgxmQLTVwFKE1yfsg== +"@babel/traverse@^7.20.10", "@babel/traverse@^7.20.12", "@babel/traverse@^7.20.13", "@babel/traverse@^7.7.2": + version "7.20.13" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.13.tgz#817c1ba13d11accca89478bd5481b2d168d07473" + integrity sha512-kMJXfF0T6DIS9E8cgdLCSAL+cuCK+YEZHWiLK0SXpTo8YRj5lpJu3CDNKiIBCne4m9hhTIqUg6SYTAI39tAiVQ== dependencies: "@babel/code-frame" "^7.18.6" "@babel/generator" "^7.20.7" @@ -279,7 +279,7 @@ "@babel/helper-function-name" "^7.19.0" "@babel/helper-hoist-variables" "^7.18.6" "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.20.7" + "@babel/parser" "^7.20.13" "@babel/types" "^7.20.7" debug "^4.1.0" globals "^11.1.0" @@ -348,109 +348,109 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^29.3.1": - version "29.3.1" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.3.1.tgz#3e3f876e4e47616ea3b1464b9fbda981872e9583" - integrity sha512-IRE6GD47KwcqA09RIWrabKdHPiKDGgtAL31xDxbi/RjQMsr+lY+ppxmHwY0dUEV3qvvxZzoe5Hl0RXZJOjQNUg== +"@jest/console@^29.4.1": + version "29.4.1" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.4.1.tgz#cbc31d73f6329f693b3d34b365124de797704fff" + integrity sha512-m+XpwKSi3PPM9znm5NGS8bBReeAJJpSkL1OuFCqaMaJL2YX9YXLkkI+MBchMPwu+ZuM2rynL51sgfkQteQ1CKQ== dependencies: - "@jest/types" "^29.3.1" + "@jest/types" "^29.4.1" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^29.3.1" - jest-util "^29.3.1" + jest-message-util "^29.4.1" + jest-util "^29.4.1" slash "^3.0.0" -"@jest/core@^29.3.1": - version "29.3.1" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.3.1.tgz#bff00f413ff0128f4debec1099ba7dcd649774a1" - integrity sha512-0ohVjjRex985w5MmO5L3u5GR1O30DexhBSpuwx2P+9ftyqHdJXnk7IUWiP80oHMvt7ubHCJHxV0a0vlKVuZirw== - dependencies: - "@jest/console" "^29.3.1" - "@jest/reporters" "^29.3.1" - "@jest/test-result" "^29.3.1" - "@jest/transform" "^29.3.1" - "@jest/types" "^29.3.1" +"@jest/core@^29.4.1": + version "29.4.1" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.4.1.tgz#91371179b5959951e211dfaeea4277a01dcca14f" + integrity sha512-RXFTohpBqpaTebNdg5l3I5yadnKo9zLBajMT0I38D0tDhreVBYv3fA8kywthI00sWxPztWLD3yjiUkewwu/wKA== + dependencies: + "@jest/console" "^29.4.1" + "@jest/reporters" "^29.4.1" + "@jest/test-result" "^29.4.1" + "@jest/transform" "^29.4.1" + "@jest/types" "^29.4.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" ci-info "^3.2.0" exit "^0.1.2" graceful-fs "^4.2.9" - jest-changed-files "^29.2.0" - jest-config "^29.3.1" - jest-haste-map "^29.3.1" - jest-message-util "^29.3.1" + jest-changed-files "^29.4.0" + jest-config "^29.4.1" + jest-haste-map "^29.4.1" + jest-message-util "^29.4.1" jest-regex-util "^29.2.0" - jest-resolve "^29.3.1" - jest-resolve-dependencies "^29.3.1" - jest-runner "^29.3.1" - jest-runtime "^29.3.1" - jest-snapshot "^29.3.1" - jest-util "^29.3.1" - jest-validate "^29.3.1" - jest-watcher "^29.3.1" + jest-resolve "^29.4.1" + jest-resolve-dependencies "^29.4.1" + jest-runner "^29.4.1" + jest-runtime "^29.4.1" + jest-snapshot "^29.4.1" + jest-util "^29.4.1" + jest-validate "^29.4.1" + jest-watcher "^29.4.1" micromatch "^4.0.4" - pretty-format "^29.3.1" + pretty-format "^29.4.1" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.3.1": - version "29.3.1" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.3.1.tgz#eb039f726d5fcd14698acd072ac6576d41cfcaa6" - integrity sha512-pMmvfOPmoa1c1QpfFW0nXYtNLpofqo4BrCIk6f2kW4JFeNlHV2t3vd+3iDLf31e2ot2Mec0uqZfmI+U0K2CFag== +"@jest/environment@^29.4.1": + version "29.4.1" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.4.1.tgz#52d232a85cdc995b407a940c89c86568f5a88ffe" + integrity sha512-pJ14dHGSQke7Q3mkL/UZR9ZtTOxqskZaC91NzamEH4dlKRt42W+maRBXiw/LWkdJe+P0f/zDR37+SPMplMRlPg== dependencies: - "@jest/fake-timers" "^29.3.1" - "@jest/types" "^29.3.1" + "@jest/fake-timers" "^29.4.1" + "@jest/types" "^29.4.1" "@types/node" "*" - jest-mock "^29.3.1" + jest-mock "^29.4.1" -"@jest/expect-utils@^29.3.1": - version "29.3.1" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.3.1.tgz#531f737039e9b9e27c42449798acb5bba01935b6" - integrity sha512-wlrznINZI5sMjwvUoLVk617ll/UYfGIZNxmbU+Pa7wmkL4vYzhV9R2pwVqUh4NWWuLQWkI8+8mOkxs//prKQ3g== +"@jest/expect-utils@^29.4.1": + version "29.4.1" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.4.1.tgz#105b9f3e2c48101f09cae2f0a4d79a1b3a419cbb" + integrity sha512-w6YJMn5DlzmxjO00i9wu2YSozUYRBhIoJ6nQwpMYcBMtiqMGJm1QBzOf6DDgRao8dbtpDoaqLg6iiQTvv0UHhQ== dependencies: jest-get-type "^29.2.0" -"@jest/expect@^29.3.1": - version "29.3.1" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.3.1.tgz#456385b62894349c1d196f2d183e3716d4c6a6cd" - integrity sha512-QivM7GlSHSsIAWzgfyP8dgeExPRZ9BIe2LsdPyEhCGkZkoyA+kGsoIzbKAfZCvvRzfZioKwPtCZIt5SaoxYCvg== +"@jest/expect@^29.4.1": + version "29.4.1" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.4.1.tgz#3338fa20f547bb6e550c4be37d6f82711cc13c38" + integrity sha512-ZxKJP5DTUNF2XkpJeZIzvnzF1KkfrhEF6Rz0HGG69fHl6Bgx5/GoU3XyaeFYEjuuKSOOsbqD/k72wFvFxc3iTw== dependencies: - expect "^29.3.1" - jest-snapshot "^29.3.1" + expect "^29.4.1" + jest-snapshot "^29.4.1" -"@jest/fake-timers@^29.3.1": - version "29.3.1" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.3.1.tgz#b140625095b60a44de820876d4c14da1aa963f67" - integrity sha512-iHTL/XpnDlFki9Tq0Q1GGuVeQ8BHZGIYsvCO5eN/O/oJaRzofG9Xndd9HuSDBI/0ZS79pg0iwn07OMTQ7ngF2A== +"@jest/fake-timers@^29.4.1": + version "29.4.1" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.4.1.tgz#7b673131e8ea2a2045858f08241cace5d518b42b" + integrity sha512-/1joI6rfHFmmm39JxNfmNAO3Nwm6Y0VoL5fJDy7H1AtWrD1CgRtqJbN9Ld6rhAkGO76qqp4cwhhxJ9o9kYjQMw== dependencies: - "@jest/types" "^29.3.1" - "@sinonjs/fake-timers" "^9.1.2" + "@jest/types" "^29.4.1" + "@sinonjs/fake-timers" "^10.0.2" "@types/node" "*" - jest-message-util "^29.3.1" - jest-mock "^29.3.1" - jest-util "^29.3.1" + jest-message-util "^29.4.1" + jest-mock "^29.4.1" + jest-util "^29.4.1" -"@jest/globals@^29.3.1": - version "29.3.1" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.3.1.tgz#92be078228e82d629df40c3656d45328f134a0c6" - integrity sha512-cTicd134vOcwO59OPaB6AmdHQMCtWOe+/DitpTZVxWgMJ+YvXL1HNAmPyiGbSHmF/mXVBkvlm8YYtQhyHPnV6Q== +"@jest/globals@^29.4.1": + version "29.4.1" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.4.1.tgz#3cd78c5567ab0249f09fbd81bf9f37a7328f4713" + integrity sha512-znoK2EuFytbHH0ZSf2mQK2K1xtIgmaw4Da21R2C/NE/+NnItm5mPEFQmn8gmF3f0rfOlmZ3Y3bIf7bFj7DHxAA== dependencies: - "@jest/environment" "^29.3.1" - "@jest/expect" "^29.3.1" - "@jest/types" "^29.3.1" - jest-mock "^29.3.1" + "@jest/environment" "^29.4.1" + "@jest/expect" "^29.4.1" + "@jest/types" "^29.4.1" + jest-mock "^29.4.1" -"@jest/reporters@^29.3.1": - version "29.3.1" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.3.1.tgz#9a6d78c109608e677c25ddb34f907b90e07b4310" - integrity sha512-GhBu3YFuDrcAYW/UESz1JphEAbvUjaY2vShRZRoRY1mxpCMB3yGSJ4j9n0GxVlEOdCf7qjvUfBCrTUUqhVfbRA== +"@jest/reporters@^29.4.1": + version "29.4.1" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.4.1.tgz#50d509c08575c75e3cd2176d72ec3786419d5e04" + integrity sha512-AISY5xpt2Xpxj9R6y0RF1+O6GRy9JsGa8+vK23Lmzdy1AYcpQn5ItX79wJSsTmfzPKSAcsY1LNt/8Y5Xe5LOSg== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.3.1" - "@jest/test-result" "^29.3.1" - "@jest/transform" "^29.3.1" - "@jest/types" "^29.3.1" + "@jest/console" "^29.4.1" + "@jest/test-result" "^29.4.1" + "@jest/transform" "^29.4.1" + "@jest/types" "^29.4.1" "@jridgewell/trace-mapping" "^0.3.15" "@types/node" "*" chalk "^4.0.0" @@ -463,20 +463,20 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^29.3.1" - jest-util "^29.3.1" - jest-worker "^29.3.1" + jest-message-util "^29.4.1" + jest-util "^29.4.1" + jest-worker "^29.4.1" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" v8-to-istanbul "^9.0.1" -"@jest/schemas@^29.0.0": - version "29.0.0" - resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.0.0.tgz#5f47f5994dd4ef067fb7b4188ceac45f77fe952a" - integrity sha512-3Ab5HgYIIAnS0HjqJHQYZS+zXc4tUmTmBH3z83ajI6afXp8X3ZtdLX+nXx+I7LNkJD7uN9LAVhgnjDgZa2z0kA== +"@jest/schemas@^29.4.0": + version "29.4.0" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.4.0.tgz#0d6ad358f295cc1deca0b643e6b4c86ebd539f17" + integrity sha512-0E01f/gOZeNTG76i5eWWSupvSHaIINrTie7vCyjiYFKgzNdyEGd12BUv4oNBFHOqlHDbtoJi3HrQ38KCC90NsQ== dependencies: - "@sinclair/typebox" "^0.24.1" + "@sinclair/typebox" "^0.25.16" "@jest/source-map@^29.2.0": version "29.2.0" @@ -487,53 +487,53 @@ callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^29.3.1": - version "29.3.1" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.3.1.tgz#92cd5099aa94be947560a24610aa76606de78f50" - integrity sha512-qeLa6qc0ddB0kuOZyZIhfN5q0e2htngokyTWsGriedsDhItisW7SDYZ7ceOe57Ii03sL988/03wAcBh3TChMGw== +"@jest/test-result@^29.4.1": + version "29.4.1" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.4.1.tgz#997f19695e13b34779ceb3c288a416bd26c3238d" + integrity sha512-WRt29Lwt+hEgfN8QDrXqXGgCTidq1rLyFqmZ4lmJOpVArC8daXrZWkWjiaijQvgd3aOUj2fM8INclKHsQW9YyQ== dependencies: - "@jest/console" "^29.3.1" - "@jest/types" "^29.3.1" + "@jest/console" "^29.4.1" + "@jest/types" "^29.4.1" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.3.1": - version "29.3.1" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.3.1.tgz#fa24b3b050f7a59d48f7ef9e0b782ab65123090d" - integrity sha512-IqYvLbieTv20ArgKoAMyhLHNrVHJfzO6ARZAbQRlY4UGWfdDnLlZEF0BvKOMd77uIiIjSZRwq3Jb3Fa3I8+2UA== +"@jest/test-sequencer@^29.4.1": + version "29.4.1" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.4.1.tgz#f7a006ec7058b194a10cf833c88282ef86d578fd" + integrity sha512-v5qLBNSsM0eHzWLXsQ5fiB65xi49A3ILPSFQKPXzGL4Vyux0DPZAIN7NAFJa9b4BiTDP9MBF/Zqc/QA1vuiJ0w== dependencies: - "@jest/test-result" "^29.3.1" + "@jest/test-result" "^29.4.1" graceful-fs "^4.2.9" - jest-haste-map "^29.3.1" + jest-haste-map "^29.4.1" slash "^3.0.0" -"@jest/transform@^29.3.1": - version "29.3.1" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.3.1.tgz#1e6bd3da4af50b5c82a539b7b1f3770568d6e36d" - integrity sha512-8wmCFBTVGYqFNLWfcOWoVuMuKYPUBTnTMDkdvFtAYELwDOl9RGwOsvQWGPFxDJ8AWY9xM/8xCXdqmPK3+Q5Lug== +"@jest/transform@^29.4.1": + version "29.4.1" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.4.1.tgz#e4f517841bb795c7dcdee1ba896275e2c2d26d4a" + integrity sha512-5w6YJrVAtiAgr0phzKjYd83UPbCXsBRTeYI4BXokv9Er9CcrH9hfXL/crCvP2d2nGOcovPUnlYiLPFLZrkG5Hg== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^29.3.1" + "@jest/types" "^29.4.1" "@jridgewell/trace-mapping" "^0.3.15" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^2.0.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.3.1" + jest-haste-map "^29.4.1" jest-regex-util "^29.2.0" - jest-util "^29.3.1" + jest-util "^29.4.1" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" - write-file-atomic "^4.0.1" + write-file-atomic "^5.0.0" -"@jest/types@^29.3.1": - version "29.3.1" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.3.1.tgz#7c5a80777cb13e703aeec6788d044150341147e3" - integrity sha512-d0S0jmmTpjnhCmNpApgX3jrUZgZ22ivKJRvL2lli5hpCRoNnp1f85r2/wpKfXuYu8E7Jjh1hGfhPyup1NM5AmA== +"@jest/types@^29.4.1": + version "29.4.1" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.4.1.tgz#f9f83d0916f50696661da72766132729dcb82ecb" + integrity sha512-zbrAXDUOnpJ+FMST2rV7QZOgec8rskg2zv8g2ajeqitp4tvZiyqTCYXANrKsM+ryj5o+LI+ZN2EgU9drrkiwSA== dependencies: - "@jest/schemas" "^29.0.0" + "@jest/schemas" "^29.4.0" "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" "@types/node" "*" @@ -601,32 +601,32 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@sinclair/typebox@^0.24.1": - version "0.24.51" - resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.51.tgz#645f33fe4e02defe26f2f5c0410e1c094eac7f5f" - integrity sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA== +"@sinclair/typebox@^0.25.16": + version "0.25.21" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.25.21.tgz#763b05a4b472c93a8db29b2c3e359d55b29ce272" + integrity sha512-gFukHN4t8K4+wVC+ECqeqwzBDeFeTzBXroBTqE6vcWrQGbEUpHO7LYdG0f4xnvYq4VOEwITSlHlp0JBAIFMS/g== -"@sinonjs/commons@^1.7.0": - version "1.8.6" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.6.tgz#80c516a4dc264c2a69115e7578d62581ff455ed9" - integrity sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ== +"@sinonjs/commons@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-2.0.0.tgz#fd4ca5b063554307e8327b4564bd56d3b73924a3" + integrity sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg== dependencies: type-detect "4.0.8" -"@sinonjs/fake-timers@^9.1.2": - version "9.1.2" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-9.1.2.tgz#4eaab737fab77332ab132d396a3c0d364bd0ea8c" - integrity sha512-BPS4ynJW/o92PUR4wgriz2Ud5gpST5vz6GQfMixEDK0Z8ZCUv2M7SkBLykH56T++Xs+8ln9zTGbOvNGIe02/jw== +"@sinonjs/fake-timers@^10.0.2": + version "10.0.2" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-10.0.2.tgz#d10549ed1f423d80639c528b6c7f5a1017747d0c" + integrity sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw== dependencies: - "@sinonjs/commons" "^1.7.0" + "@sinonjs/commons" "^2.0.0" "@types/babel__core@^7.1.14": - version "7.1.20" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.20.tgz#e168cdd612c92a2d335029ed62ac94c95b362359" - integrity sha512-PVb6Bg2QuscZ30FvOU7z4guG6c926D9YRvOxEaelzndpMsvP+YM74Q/dAFASpg2l6+XLalxSGxcq/lrgYWZtyQ== + version "7.20.0" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.0.tgz#61bc5a4cae505ce98e1e36c5445e4bee060d8891" + integrity sha512-+n8dL/9GWblDO0iU6eZAwEIJVr5DWigtle+Q6HLOrh/pdbXOhOtqzq8VPPE2zvNJzSKY4vH/z3iT3tn0A3ypiQ== dependencies: - "@babel/parser" "^7.1.0" - "@babel/types" "^7.0.0" + "@babel/parser" "^7.20.7" + "@babel/types" "^7.20.7" "@types/babel__generator" "*" "@types/babel__template" "*" "@types/babel__traverse" "*" @@ -654,9 +654,9 @@ "@babel/types" "^7.3.0" "@types/graceful-fs@^4.1.3": - version "4.1.5" - resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15" - integrity sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw== + version "4.1.6" + resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.6.tgz#e14b2576a1c25026b7f02ede1de3b84c3a1efeae" + integrity sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw== dependencies: "@types/node" "*" @@ -705,9 +705,9 @@ integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== "@types/yargs@^17.0.8": - version "17.0.19" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.19.tgz#8dbecdc9ab48bee0cb74f6e3327de3fa0d0c98ae" - integrity sha512-cAx3qamwaYX9R0fzOIZAlFpo4A+1uBVCxqpKz9D26uTF4srRXaGTTsikQmaotCtNdbhzyUH7ft6p9ktz9s6UNQ== + version "17.0.20" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.20.tgz#107f0fcc13bd4a524e352b41c49fe88aab5c54d5" + integrity sha512-eknWrTHofQuPk2iuqDm1waA7V6xPlbgBoaaXEgYkClhLOnB0TtbW+srJaOToAgawPxPlHQzwypFA2bhZaUGP5A== dependencies: "@types/yargs-parser" "*" @@ -717,9 +717,9 @@ acorn-jsx@^5.3.2: integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== acorn@^8.8.0: - version "8.8.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.1.tgz#0a3f9cbecc4ec3bea6f0a80b66ae8dd2da250b73" - integrity sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA== + version "8.8.2" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" + integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== ajv@^6.10.0, ajv@^6.12.4: version "6.12.6" @@ -797,15 +797,15 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.3.1.tgz#05c83e0d128cd48c453eea851482a38782249f44" - integrity sha512-aard+xnMoxgjwV70t0L6wkW/3HQQtV+O0PEimxKgzNqCJnbYmroPojdP2tqKSOAt8QAKV/uSZU8851M7B5+fcA== +babel-jest@^29.4.1: + version "29.4.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.4.1.tgz#01fa167e27470b35c2d4a1b841d9586b1764da19" + integrity sha512-xBZa/pLSsF/1sNpkgsiT3CmY7zV1kAsZ9OxxtrFqYucnOuRftXAfcJqcDVyOPeN4lttWTwhLdu0T9f8uvoPEUg== dependencies: - "@jest/transform" "^29.3.1" + "@jest/transform" "^29.4.1" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^29.2.0" + babel-preset-jest "^29.4.0" chalk "^4.0.0" graceful-fs "^4.2.9" slash "^3.0.0" @@ -821,10 +821,10 @@ babel-plugin-istanbul@^6.1.1: istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.2.0.tgz#23ee99c37390a98cfddf3ef4a78674180d823094" - integrity sha512-TnspP2WNiR3GLfCsUNHqeXw0RoQ2f9U5hQ5L3XFpwuO8htQmSrhh8qsB6vi5Yi8+kuynN1yjDjQsPfkebmB6ZA== +babel-plugin-jest-hoist@^29.4.0: + version "29.4.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.4.0.tgz#3fd3dfcedf645932df6d0c9fc3d9a704dd860248" + integrity sha512-a/sZRLQJEmsmejQ2rPEUe35nO1+C9dc9O1gplH1SXmJxveQSRUYdBk8yGZG/VOUuZs1u2aHZJusEGoRMbhhwCg== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -849,12 +849,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.2.0.tgz#3048bea3a1af222e3505e4a767a974c95a7620dc" - integrity sha512-z9JmMJppMxNv8N7fNRHvhMg9cvIkMxQBXgFkane3yKVEvEOP+kB50lk8DFRvF9PGqbyXxlmebKWhuDORO8RgdA== +babel-preset-jest@^29.4.0: + version "29.4.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.4.0.tgz#c2b03c548b02dea0a18ae21d5759c136f9251ee4" + integrity sha512-fUB9vZflUSM3dO/6M2TCAepTzvA4VkOvl67PjErcrQMGt9Eve7uazaeyCZ2th3UtI7ljpiBJES0F7A1vBRsLZA== dependencies: - babel-plugin-jest-hoist "^29.2.0" + babel-plugin-jest-hoist "^29.4.0" babel-preset-current-node-syntax "^1.0.0" balanced-match@^1.0.0: @@ -915,9 +915,9 @@ camelcase@^6.2.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001400: - version "1.0.30001441" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001441.tgz#987437b266260b640a23cd18fbddb509d7f69f3e" - integrity sha512-OyxRR4Vof59I3yGWXws6i908EtGbMzVUi3ganaZQHmydk1iwDhRnvaPG2WaR0KcqrDFKrxVZHULT396LEPhXfg== + version "1.0.30001448" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001448.tgz#ca7550b1587c92a392a2b377cd9c508b3b4395bf" + integrity sha512-tq2YI+MJnooG96XpbTRYkBxLxklZPOdLmNIOdIhvf7SNJan6u5vCKum8iT7ZfCt70m1GPkuC7P3TtX6UuhupuA== chalk@^2.0.0: version "2.4.2" @@ -1144,10 +1144,10 @@ eslint-visitor-keys@^3.3.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== -eslint@^8.15.0: - version "8.31.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.31.0.tgz#75028e77cbcff102a9feae1d718135931532d524" - integrity sha512-0tQQEVdmPZ1UtUKXjX7EMm9BlgJ08G90IhWh0PKDCb3ZLsgAOHI8fYSIzYVZej92zsgq+ft0FGsxhJ3xo2tbuA== +eslint@^8.32.0: + version "8.32.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.32.0.tgz#d9690056bb6f1a302bd991e7090f5b68fbaea861" + integrity sha512-nETVXpnthqKPFyuY2FNjz/bEd6nbosRgKbkgS/y1C7LJop96gYHWpiguLecMHQ2XCPxn77DS0P+68WzG6vkZSQ== dependencies: "@eslint/eslintrc" "^1.4.1" "@humanwhocodes/config-array" "^0.11.8" @@ -1262,16 +1262,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== -expect@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.3.1.tgz#92877aad3f7deefc2e3f6430dd195b92295554a6" - integrity sha512-gGb1yTgU30Q0O/tQq+z30KBWv24ApkMgFUpvKBkyLUBL68Wv8dHdJxTBZFl/iT8K/bqDHvUYRH6IIN3rToopPA== +expect@^29.4.1: + version "29.4.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.4.1.tgz#58cfeea9cbf479b64ed081fd1e074ac8beb5a1fe" + integrity sha512-OKrGESHOaMxK3b6zxIq9SOW8kEXztKff/Dvg88j4xIJxur1hspEbedVkR3GpHe5LO+WB2Qw7OWN0RMTdp6as5A== dependencies: - "@jest/expect-utils" "^29.3.1" + "@jest/expect-utils" "^29.4.1" jest-get-type "^29.2.0" - jest-matcher-utils "^29.3.1" - jest-message-util "^29.3.1" - jest-util "^29.3.1" + jest-matcher-utils "^29.4.1" + jest-message-util "^29.4.1" + jest-util "^29.4.1" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1600,94 +1600,94 @@ istanbul-reports@^3.1.3: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.2.0.tgz#b6598daa9803ea6a4dce7968e20ab380ddbee289" - integrity sha512-qPVmLLyBmvF5HJrY7krDisx6Voi8DmlV3GZYX0aFNbaQsZeoz1hfxcCMbqDGuQCxU1dJy9eYc2xscE8QrCCYaA== +jest-changed-files@^29.4.0: + version "29.4.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.4.0.tgz#ac2498bcd394228f7eddcadcf928b3583bf2779d" + integrity sha512-rnI1oPxgFghoz32Y8eZsGJMjW54UlqT17ycQeCEktcxxwqqKdlj9afl8LNeO0Pbu+h2JQHThQP0BzS67eTRx4w== dependencies: execa "^5.0.0" p-limit "^3.1.0" -jest-circus@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.3.1.tgz#177d07c5c0beae8ef2937a67de68f1e17bbf1b4a" - integrity sha512-wpr26sEvwb3qQQbdlmei+gzp6yoSSoSL6GsLPxnuayZSMrSd5Ka7IjAvatpIernBvT2+Ic6RLTg+jSebScmasg== +jest-circus@^29.4.1: + version "29.4.1" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.4.1.tgz#ff1b63eb04c3b111cefea9489e8dbadd23ce49bd" + integrity sha512-v02NuL5crMNY4CGPHBEflLzl4v91NFb85a+dH9a1pUNx6Xjggrd8l9pPy4LZ1VYNRXlb+f65+7O/MSIbLir6pA== dependencies: - "@jest/environment" "^29.3.1" - "@jest/expect" "^29.3.1" - "@jest/test-result" "^29.3.1" - "@jest/types" "^29.3.1" + "@jest/environment" "^29.4.1" + "@jest/expect" "^29.4.1" + "@jest/test-result" "^29.4.1" + "@jest/types" "^29.4.1" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" is-generator-fn "^2.0.0" - jest-each "^29.3.1" - jest-matcher-utils "^29.3.1" - jest-message-util "^29.3.1" - jest-runtime "^29.3.1" - jest-snapshot "^29.3.1" - jest-util "^29.3.1" + jest-each "^29.4.1" + jest-matcher-utils "^29.4.1" + jest-message-util "^29.4.1" + jest-runtime "^29.4.1" + jest-snapshot "^29.4.1" + jest-util "^29.4.1" p-limit "^3.1.0" - pretty-format "^29.3.1" + pretty-format "^29.4.1" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.3.1.tgz#e89dff427db3b1df50cea9a393ebd8640790416d" - integrity sha512-TO/ewvwyvPOiBBuWZ0gm04z3WWP8TIK8acgPzE4IxgsLKQgb377NYGrQLc3Wl/7ndWzIH2CDNNsUjGxwLL43VQ== +jest-cli@^29.4.1: + version "29.4.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.4.1.tgz#7abef96944f300feb9b76f68b1eb2d68774fe553" + integrity sha512-jz7GDIhtxQ37M+9dlbv5K+/FVcIo1O/b1sX3cJgzlQUf/3VG25nvuWzlDC4F1FLLzUThJeWLu8I7JF9eWpuURQ== dependencies: - "@jest/core" "^29.3.1" - "@jest/test-result" "^29.3.1" - "@jest/types" "^29.3.1" + "@jest/core" "^29.4.1" + "@jest/test-result" "^29.4.1" + "@jest/types" "^29.4.1" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.3.1" - jest-util "^29.3.1" - jest-validate "^29.3.1" + jest-config "^29.4.1" + jest-util "^29.4.1" + jest-validate "^29.4.1" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.3.1.tgz#0bc3dcb0959ff8662957f1259947aedaefb7f3c6" - integrity sha512-y0tFHdj2WnTEhxmGUK1T7fgLen7YK4RtfvpLFBXfQkh2eMJAQq24Vx9472lvn5wg0MAO6B+iPfJfzdR9hJYalg== +jest-config@^29.4.1: + version "29.4.1" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.4.1.tgz#e62670c6c980ec21d75941806ec4d0c0c6402728" + integrity sha512-g7p3q4NuXiM4hrS4XFATTkd+2z0Ml2RhFmFPM8c3WyKwVDNszbl4E7cV7WIx1YZeqqCtqbtTtZhGZWJlJqngzg== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.3.1" - "@jest/types" "^29.3.1" - babel-jest "^29.3.1" + "@jest/test-sequencer" "^29.4.1" + "@jest/types" "^29.4.1" + babel-jest "^29.4.1" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^29.3.1" - jest-environment-node "^29.3.1" + jest-circus "^29.4.1" + jest-environment-node "^29.4.1" jest-get-type "^29.2.0" jest-regex-util "^29.2.0" - jest-resolve "^29.3.1" - jest-runner "^29.3.1" - jest-util "^29.3.1" - jest-validate "^29.3.1" + jest-resolve "^29.4.1" + jest-runner "^29.4.1" + jest-util "^29.4.1" + jest-validate "^29.4.1" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^29.3.1" + pretty-format "^29.4.1" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.3.1.tgz#d8215b72fed8f1e647aed2cae6c752a89e757527" - integrity sha512-vU8vyiO7568tmin2lA3r2DP8oRvzhvRcD4DjpXc6uGveQodyk7CKLhQlCSiwgx3g0pFaE88/KLZ0yaTWMc4Uiw== +jest-diff@^29.4.1: + version "29.4.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.4.1.tgz#9a6dc715037e1fa7a8a44554e7d272088c4029bd" + integrity sha512-uazdl2g331iY56CEyfbNA0Ut7Mn2ulAG5vUaEHXycf1L6IPyuImIxSz4F0VYBKi7LYIuxOwTZzK3wh5jHzASMw== dependencies: chalk "^4.0.0" diff-sequences "^29.3.1" jest-get-type "^29.2.0" - pretty-format "^29.3.1" + pretty-format "^29.4.1" jest-docblock@^29.2.0: version "29.2.0" @@ -1696,94 +1696,94 @@ jest-docblock@^29.2.0: dependencies: detect-newline "^3.0.0" -jest-each@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.3.1.tgz#bc375c8734f1bb96625d83d1ca03ef508379e132" - integrity sha512-qrZH7PmFB9rEzCSl00BWjZYuS1BSOH8lLuC0azQE9lQrAx3PWGKHTDudQiOSwIy5dGAJh7KA0ScYlCP7JxvFYA== +jest-each@^29.4.1: + version "29.4.1" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.4.1.tgz#05ce9979e7486dbd0f5d41895f49ccfdd0afce01" + integrity sha512-QlYFiX3llJMWUV0BtWht/esGEz9w+0i7BHwODKCze7YzZzizgExB9MOfiivF/vVT0GSQ8wXLhvHXh3x2fVD4QQ== dependencies: - "@jest/types" "^29.3.1" + "@jest/types" "^29.4.1" chalk "^4.0.0" jest-get-type "^29.2.0" - jest-util "^29.3.1" - pretty-format "^29.3.1" + jest-util "^29.4.1" + pretty-format "^29.4.1" -jest-environment-node@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.3.1.tgz#5023b32472b3fba91db5c799a0d5624ad4803e74" - integrity sha512-xm2THL18Xf5sIHoU7OThBPtuH6Lerd+Y1NLYiZJlkE3hbE+7N7r8uvHIl/FkZ5ymKXJe/11SQuf3fv4v6rUMag== +jest-environment-node@^29.4.1: + version "29.4.1" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.4.1.tgz#22550b7d0f8f0b16228639c9f88ca04bbf3c1974" + integrity sha512-x/H2kdVgxSkxWAIlIh9MfMuBa0hZySmfsC5lCsWmWr6tZySP44ediRKDUiNggX/eHLH7Cd5ZN10Rw+XF5tXsqg== dependencies: - "@jest/environment" "^29.3.1" - "@jest/fake-timers" "^29.3.1" - "@jest/types" "^29.3.1" + "@jest/environment" "^29.4.1" + "@jest/fake-timers" "^29.4.1" + "@jest/types" "^29.4.1" "@types/node" "*" - jest-mock "^29.3.1" - jest-util "^29.3.1" + jest-mock "^29.4.1" + jest-util "^29.4.1" jest-get-type@^29.2.0: version "29.2.0" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.2.0.tgz#726646f927ef61d583a3b3adb1ab13f3a5036408" integrity sha512-uXNJlg8hKFEnDgFsrCjznB+sTxdkuqiCL6zMgA75qEbAJjJYTs9XPrvDctrEig2GDow22T/LvHgO57iJhXB/UA== -jest-haste-map@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.3.1.tgz#af83b4347f1dae5ee8c2fb57368dc0bb3e5af843" - integrity sha512-/FFtvoG1xjbbPXQLFef+WSU4yrc0fc0Dds6aRPBojUid7qlPqZvxdUBA03HW0fnVHXVCnCdkuoghYItKNzc/0A== +jest-haste-map@^29.4.1: + version "29.4.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.4.1.tgz#b0579dc82d94b40ed9041af56ad25c2f80bedaeb" + integrity sha512-imTjcgfVVTvg02khXL11NNLTx9ZaofbAWhilrMg/G8dIkp+HYCswhxf0xxJwBkfhWb3e8dwbjuWburvxmcr58w== dependencies: - "@jest/types" "^29.3.1" + "@jest/types" "^29.4.1" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" jest-regex-util "^29.2.0" - jest-util "^29.3.1" - jest-worker "^29.3.1" + jest-util "^29.4.1" + jest-worker "^29.4.1" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.3.1.tgz#95336d020170671db0ee166b75cd8ef647265518" - integrity sha512-3DA/VVXj4zFOPagGkuqHnSQf1GZBmmlagpguxEERO6Pla2g84Q1MaVIB3YMxgUaFIaYag8ZnTyQgiZ35YEqAQA== +jest-leak-detector@^29.4.1: + version "29.4.1" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.4.1.tgz#632186c546e084da2b490b7496fee1a1c9929637" + integrity sha512-akpZv7TPyGMnH2RimOCgy+hPmWZf55EyFUvymQ4LMsQP8xSPlZumCPtXGoDhFNhUE2039RApZkTQDKU79p/FiQ== dependencies: jest-get-type "^29.2.0" - pretty-format "^29.3.1" + pretty-format "^29.4.1" -jest-matcher-utils@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.3.1.tgz#6e7f53512f80e817dfa148672bd2d5d04914a572" - integrity sha512-fkRMZUAScup3txIKfMe3AIZZmPEjWEdsPJFK3AIy5qRohWqQFg1qrmKfYXR9qEkNc7OdAu2N4KPHibEmy4HPeQ== +jest-matcher-utils@^29.4.1: + version "29.4.1" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.4.1.tgz#73d834e305909c3b43285fbc76f78bf0ad7e1954" + integrity sha512-k5h0u8V4nAEy6lSACepxL/rw78FLDkBnXhZVgFneVpnJONhb2DhZj/Gv4eNe+1XqQ5IhgUcqj745UwH0HJmMnA== dependencies: chalk "^4.0.0" - jest-diff "^29.3.1" + jest-diff "^29.4.1" jest-get-type "^29.2.0" - pretty-format "^29.3.1" + pretty-format "^29.4.1" -jest-message-util@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.3.1.tgz#37bc5c468dfe5120712053dd03faf0f053bd6adb" - integrity sha512-lMJTbgNcDm5z+6KDxWtqOFWlGQxD6XaYwBqHR8kmpkP+WWWG90I35kdtQHY67Ay5CSuydkTBbJG+tH9JShFCyA== +jest-message-util@^29.4.1: + version "29.4.1" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.4.1.tgz#522623aa1df9a36ebfdffb06495c7d9d19e8a845" + integrity sha512-H4/I0cXUaLeCw6FM+i4AwCnOwHRgitdaUFOdm49022YD5nfyr8C/DrbXOBEyJaj+w/y0gGJ57klssOaUiLLQGQ== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.3.1" + "@jest/types" "^29.4.1" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^29.3.1" + pretty-format "^29.4.1" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.3.1.tgz#60287d92e5010979d01f218c6b215b688e0f313e" - integrity sha512-H8/qFDtDVMFvFP4X8NuOT3XRDzOUTz+FeACjufHzsOIBAxivLqkB1PoLCaJx9iPPQ8dZThHPp/G3WRWyMgA3JA== +jest-mock@^29.4.1: + version "29.4.1" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.4.1.tgz#a218a2abf45c99c501d4665207748a6b9e29afbd" + integrity sha512-MwA4hQ7zBOcgVCVnsM8TzaFLVUD/pFWTfbkY953Y81L5ret3GFRZtmPmRFAjKQSdCKoJvvqOu6Bvfpqlwwb0dQ== dependencies: - "@jest/types" "^29.3.1" + "@jest/types" "^29.4.1" "@types/node" "*" - jest-util "^29.3.1" + jest-util "^29.4.1" jest-pnp-resolver@^1.2.2: version "1.2.3" @@ -1795,88 +1795,89 @@ jest-regex-util@^29.2.0: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.2.0.tgz#82ef3b587e8c303357728d0322d48bbfd2971f7b" integrity sha512-6yXn0kg2JXzH30cr2NlThF+70iuO/3irbaB4mh5WyqNIvLLP+B6sFdluO1/1RJmslyh/f9osnefECflHvTbwVA== -jest-resolve-dependencies@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.3.1.tgz#a6a329708a128e68d67c49f38678a4a4a914c3bf" - integrity sha512-Vk0cYq0byRw2WluNmNWGqPeRnZ3p3hHmjJMp2dyyZeYIfiBskwq4rpiuGFR6QGAdbj58WC7HN4hQHjf2mpvrLA== +jest-resolve-dependencies@^29.4.1: + version "29.4.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.4.1.tgz#02420a2e055da105e5fca8218c471d8b9553c904" + integrity sha512-Y3QG3M1ncAMxfjbYgtqNXC5B595zmB6e//p/qpA/58JkQXu/IpLDoLeOa8YoYfsSglBKQQzNUqtfGJJT/qLmJg== dependencies: jest-regex-util "^29.2.0" - jest-snapshot "^29.3.1" + jest-snapshot "^29.4.1" -jest-resolve@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.3.1.tgz#9a4b6b65387a3141e4a40815535c7f196f1a68a7" - integrity sha512-amXJgH/Ng712w3Uz5gqzFBBjxV8WFLSmNjoreBGMqxgCz5cH7swmBZzgBaCIOsvb0NbpJ0vgaSFdJqMdT+rADw== +jest-resolve@^29.4.1: + version "29.4.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.4.1.tgz#4c6bf71a07b8f0b79c5fdf4f2a2cf47317694c5e" + integrity sha512-j/ZFNV2lm9IJ2wmlq1uYK0Y/1PiyDq9g4HEGsNTNr3viRbJdV+8Lf1SXIiLZXFvyiisu0qUyIXGBnw+OKWkJwQ== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^29.3.1" + jest-haste-map "^29.4.1" jest-pnp-resolver "^1.2.2" - jest-util "^29.3.1" - jest-validate "^29.3.1" + jest-util "^29.4.1" + jest-validate "^29.4.1" resolve "^1.20.0" - resolve.exports "^1.1.0" + resolve.exports "^2.0.0" slash "^3.0.0" -jest-runner@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.3.1.tgz#a92a879a47dd096fea46bb1517b0a99418ee9e2d" - integrity sha512-oFvcwRNrKMtE6u9+AQPMATxFcTySyKfLhvso7Sdk/rNpbhg4g2GAGCopiInk1OP4q6gz3n6MajW4+fnHWlU3bA== - dependencies: - "@jest/console" "^29.3.1" - "@jest/environment" "^29.3.1" - "@jest/test-result" "^29.3.1" - "@jest/transform" "^29.3.1" - "@jest/types" "^29.3.1" +jest-runner@^29.4.1: + version "29.4.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.4.1.tgz#57460d9ebb0eea2e27eeddca1816cf8537469661" + integrity sha512-8d6XXXi7GtHmsHrnaqBKWxjKb166Eyj/ksSaUYdcBK09VbjPwIgWov1VwSmtupCIz8q1Xv4Qkzt/BTo3ZqiCeg== + dependencies: + "@jest/console" "^29.4.1" + "@jest/environment" "^29.4.1" + "@jest/test-result" "^29.4.1" + "@jest/transform" "^29.4.1" + "@jest/types" "^29.4.1" "@types/node" "*" chalk "^4.0.0" emittery "^0.13.1" graceful-fs "^4.2.9" jest-docblock "^29.2.0" - jest-environment-node "^29.3.1" - jest-haste-map "^29.3.1" - jest-leak-detector "^29.3.1" - jest-message-util "^29.3.1" - jest-resolve "^29.3.1" - jest-runtime "^29.3.1" - jest-util "^29.3.1" - jest-watcher "^29.3.1" - jest-worker "^29.3.1" + jest-environment-node "^29.4.1" + jest-haste-map "^29.4.1" + jest-leak-detector "^29.4.1" + jest-message-util "^29.4.1" + jest-resolve "^29.4.1" + jest-runtime "^29.4.1" + jest-util "^29.4.1" + jest-watcher "^29.4.1" + jest-worker "^29.4.1" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.3.1.tgz#21efccb1a66911d6d8591276a6182f520b86737a" - integrity sha512-jLzkIxIqXwBEOZx7wx9OO9sxoZmgT2NhmQKzHQm1xwR1kNW/dn0OjxR424VwHHf1SPN6Qwlb5pp1oGCeFTQ62A== +jest-runtime@^29.4.1: + version "29.4.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.4.1.tgz#9a50f9c69d3a391690897c01b0bfa8dc5dd45808" + integrity sha512-UXTMU9uKu2GjYwTtoAw5rn4STxWw/nadOfW7v1sx6LaJYa3V/iymdCLQM6xy3+7C6mY8GfX22vKpgxY171UIoA== dependencies: - "@jest/environment" "^29.3.1" - "@jest/fake-timers" "^29.3.1" - "@jest/globals" "^29.3.1" + "@jest/environment" "^29.4.1" + "@jest/fake-timers" "^29.4.1" + "@jest/globals" "^29.4.1" "@jest/source-map" "^29.2.0" - "@jest/test-result" "^29.3.1" - "@jest/transform" "^29.3.1" - "@jest/types" "^29.3.1" + "@jest/test-result" "^29.4.1" + "@jest/transform" "^29.4.1" + "@jest/types" "^29.4.1" "@types/node" "*" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^29.3.1" - jest-message-util "^29.3.1" - jest-mock "^29.3.1" + jest-haste-map "^29.4.1" + jest-message-util "^29.4.1" + jest-mock "^29.4.1" jest-regex-util "^29.2.0" - jest-resolve "^29.3.1" - jest-snapshot "^29.3.1" - jest-util "^29.3.1" + jest-resolve "^29.4.1" + jest-snapshot "^29.4.1" + jest-util "^29.4.1" + semver "^7.3.5" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.3.1.tgz#17bcef71a453adc059a18a32ccbd594b8cc4e45e" - integrity sha512-+3JOc+s28upYLI2OJM4PWRGK9AgpsMs/ekNryUV0yMBClT9B1DF2u2qay8YxcQd338PPYSFNb0lsar1B49sLDA== +jest-snapshot@^29.4.1: + version "29.4.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.4.1.tgz#5692210b3690c94f19317913d4082b123bd83dd9" + integrity sha512-l4iV8EjGgQWVz3ee/LR9sULDk2pCkqb71bjvlqn+qp90lFwpnulHj4ZBT8nm1hA1C5wowXLc7MGnw321u0tsYA== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" @@ -1884,87 +1885,87 @@ jest-snapshot@^29.3.1: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.3.1" - "@jest/transform" "^29.3.1" - "@jest/types" "^29.3.1" + "@jest/expect-utils" "^29.4.1" + "@jest/transform" "^29.4.1" + "@jest/types" "^29.4.1" "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.3.1" + expect "^29.4.1" graceful-fs "^4.2.9" - jest-diff "^29.3.1" + jest-diff "^29.4.1" jest-get-type "^29.2.0" - jest-haste-map "^29.3.1" - jest-matcher-utils "^29.3.1" - jest-message-util "^29.3.1" - jest-util "^29.3.1" + jest-haste-map "^29.4.1" + jest-matcher-utils "^29.4.1" + jest-message-util "^29.4.1" + jest-util "^29.4.1" natural-compare "^1.4.0" - pretty-format "^29.3.1" + pretty-format "^29.4.1" semver "^7.3.5" -jest-util@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.3.1.tgz#1dda51e378bbcb7e3bc9d8ab651445591ed373e1" - integrity sha512-7YOVZaiX7RJLv76ZfHt4nbNEzzTRiMW/IiOG7ZOKmTXmoGBxUDefgMAxQubu6WPVqP5zSzAdZG0FfLcC7HOIFQ== +jest-util@^29.4.1: + version "29.4.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.4.1.tgz#2eeed98ff4563b441b5a656ed1a786e3abc3e4c4" + integrity sha512-bQy9FPGxVutgpN4VRc0hk6w7Hx/m6L53QxpDreTZgJd9gfx/AV2MjyPde9tGyZRINAUrSv57p2inGBu2dRLmkQ== dependencies: - "@jest/types" "^29.3.1" + "@jest/types" "^29.4.1" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.3.1.tgz#d56fefaa2e7d1fde3ecdc973c7f7f8f25eea704a" - integrity sha512-N9Lr3oYR2Mpzuelp1F8negJR3YE+L1ebk1rYA5qYo9TTY3f9OWdptLoNSPP9itOCBIRBqjt/S5XHlzYglLN67g== +jest-validate@^29.4.1: + version "29.4.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.4.1.tgz#0d5174510415083ec329d4f981bf6779211f17e9" + integrity sha512-qNZXcZQdIQx4SfUB/atWnI4/I2HUvhz8ajOSYUu40CSmf9U5emil8EDHgE7M+3j9/pavtk3knlZBDsgFvv/SWw== dependencies: - "@jest/types" "^29.3.1" + "@jest/types" "^29.4.1" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^29.2.0" leven "^3.1.0" - pretty-format "^29.3.1" + pretty-format "^29.4.1" -jest-watcher@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.3.1.tgz#3341547e14fe3c0f79f9c3a4c62dbc3fc977fd4a" - integrity sha512-RspXG2BQFDsZSRKGCT/NiNa8RkQ1iKAjrO0//soTMWx/QUt+OcxMqMSBxz23PYGqUuWm2+m2mNNsmj0eIoOaFg== +jest-watcher@^29.4.1: + version "29.4.1" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.4.1.tgz#6e3e2486918bd778849d4d6e67fd77b814f3e6ed" + integrity sha512-vFOzflGFs27nU6h8dpnVRER3O2rFtL+VMEwnG0H3KLHcllLsU8y9DchSh0AL/Rg5nN1/wSiQ+P4ByMGpuybaVw== dependencies: - "@jest/test-result" "^29.3.1" - "@jest/types" "^29.3.1" + "@jest/test-result" "^29.4.1" + "@jest/types" "^29.4.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.13.1" - jest-util "^29.3.1" + jest-util "^29.4.1" string-length "^4.0.1" -jest-worker@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.3.1.tgz#e9462161017a9bb176380d721cab022661da3d6b" - integrity sha512-lY4AnnmsEWeiXirAIA0c9SDPbuCBq8IYuDVL8PMm0MZ2PEs2yPvRA/J64QBXuZp7CYKrDM/rmNrc9/i3KJQncw== +jest-worker@^29.4.1: + version "29.4.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.4.1.tgz#7cb4a99a38975679600305650f86f4807460aab1" + integrity sha512-O9doU/S1EBe+yp/mstQ0VpPwpv0Clgn68TkNwGxL6/usX/KUW9Arnn4ag8C3jc6qHcXznhsT5Na1liYzAsuAbQ== dependencies: "@types/node" "*" - jest-util "^29.3.1" + jest-util "^29.4.1" merge-stream "^2.0.0" supports-color "^8.0.0" -jest@^29.0.0: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.3.1.tgz#c130c0d551ae6b5459b8963747fed392ddbde122" - integrity sha512-6iWfL5DTT0Np6UYs/y5Niu7WIfNv/wRTtN5RSXt2DIEft3dx3zPuw/3WJQBCJfmEzvDiEKwoqMbGD9n49+qLSA== +jest@^29.4.1: + version "29.4.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.4.1.tgz#bb34baca8e05901b49c02c62f1183a6182ea1785" + integrity sha512-cknimw7gAXPDOmj0QqztlxVtBVCw2lYY9CeIE5N6kD+kET1H4H79HSNISJmijb1HF+qk+G+ploJgiDi5k/fRlg== dependencies: - "@jest/core" "^29.3.1" - "@jest/types" "^29.3.1" + "@jest/core" "^29.4.1" + "@jest/types" "^29.4.1" import-local "^3.0.2" - jest-cli "^29.3.1" + jest-cli "^29.4.1" js-sdsl@^4.1.4: - version "4.2.0" - resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.2.0.tgz#278e98b7bea589b8baaf048c20aeb19eb7ad09d0" - integrity sha512-dyBIzQBDkCqCu+0upx25Y2jGdbTGxE9fshMsCdK0ViOongpV+n5tXRcZY9v7CaVQ79AGS9KA1KHtojxiM7aXSQ== + version "4.3.0" + resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.3.0.tgz#aeefe32a451f7af88425b11fdb5f58c90ae1d711" + integrity sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ== js-tokens@^4.0.0: version "4.0.0" @@ -2006,7 +2007,7 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== -json5@^2.2.1: +json5@^2.2.2: version "2.2.3" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== @@ -2282,12 +2283,12 @@ prettier@>=3.0.0-alpha.2: resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0-alpha.4.tgz#eee71d6b520b970f44e4045f2dc772bf6f80815f" integrity sha512-+KeqJv4E5kaRsDRgSx9IeVygLKGHRmcoPvRJvPFp3bC1mw8opsva555gGb8TaJzUiHXoLZcus1EX+nlHPda7Pw== -pretty-format@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.3.1.tgz#1841cac822b02b4da8971dacb03e8a871b4722da" - integrity sha512-FyLnmb1cYJV8biEIiRyzRFvs2lry7PPIvOqKVe1GCUEYg4YGmlx1qG9EJNMxArYm7piII4qb8UV1Pncq5dxmcg== +pretty-format@^29.4.1: + version "29.4.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.4.1.tgz#0da99b532559097b8254298da7c75a0785b1751c" + integrity sha512-dt/Z761JUVsrIKaY215o1xQJBGlSmTx/h4cSqXqjHLnU1+Kt+mavVE7UgqJJO5ukx5HjSswHfmXz4LjS2oIJfg== dependencies: - "@jest/schemas" "^29.0.0" + "@jest/schemas" "^29.4.0" ansi-styles "^5.0.0" react-is "^18.0.0" @@ -2320,9 +2321,9 @@ pump@^3.0.0: once "^1.3.1" punycode@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + version "2.3.0" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" + integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== queue-microtask@^1.2.2: version "1.2.3" @@ -2361,10 +2362,10 @@ resolve-from@^5.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== -resolve.exports@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.0.tgz#5ce842b94b05146c0e03076985d1d0e7e48c90c9" - integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== +resolve.exports@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.0.tgz#c1a0028c2d166ec2fbf7d0644584927e76e7400e" + integrity sha512-6K/gDlqgQscOlg9fSRpWstA8sYe8rbELsSTNpx+3kTrsVCzvSl0zIvRErM7fdl9ERWDsKnrLnwB+Ne89918XOg== resolve@^1.20.0: version "1.22.1" @@ -2633,10 +2634,10 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== -write-file-atomic@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-4.0.2.tgz#a9df01ae5b77858a027fd2e80768ee433555fcfd" - integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg== +write-file-atomic@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-5.0.0.tgz#54303f117e109bf3d540261125c8ea5a7320fab0" + integrity sha512-R7NYMnHSlV42K54lwY9lvW6MnSm1HSJqZL3xiSgi9E7//FYaI74r2G0rd+/X6VAMkHEdzxQaU5HUOXWUz5kA/w== dependencies: imurmurhash "^0.1.4" signal-exit "^3.0.7" From c4d06f8e10f00cc5f10bf1572cf27598a3b60874 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Jan 2023 15:42:38 +0000 Subject: [PATCH 688/785] Bump dependabot/fetch-metadata from 1.3.5 to 1.3.6 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.3.5 to 1.3.6. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.3.5...v1.3.6) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/auto-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index 514ac27a..e54c9100 100644 --- a/.github/workflows/auto-merge.yml +++ b/.github/workflows/auto-merge.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v1.3.5 + uses: dependabot/fetch-metadata@v1.3.6 with: github-token: "${{ secrets.GITHUB_TOKEN }}" - name: Enable auto-merge for Dependabot PRs From 80fd2d1006064bda0b526ec2603ab6ffcc57a720 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jan 2023 12:00:44 +0000 Subject: [PATCH 689/785] Bump eslint from 8.32.0 to 8.33.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.32.0 to 8.33.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.32.0...v8.33.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 749ade7f..a476d698 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1145,9 +1145,9 @@ eslint-visitor-keys@^3.3.0: integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.32.0: - version "8.32.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.32.0.tgz#d9690056bb6f1a302bd991e7090f5b68fbaea861" - integrity sha512-nETVXpnthqKPFyuY2FNjz/bEd6nbosRgKbkgS/y1C7LJop96gYHWpiguLecMHQ2XCPxn77DS0P+68WzG6vkZSQ== + version "8.33.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.33.0.tgz#02f110f32998cb598c6461f24f4d306e41ca33d7" + integrity sha512-WjOpFQgKK8VrCnAtl8We0SUOy/oVZ5NHykyMiagV1M9r8IFpIJX7DduK6n1mpfhlG7T1NLWm2SuD8QB7KFySaA== dependencies: "@eslint/eslintrc" "^1.4.1" "@humanwhocodes/config-array" "^0.11.8" From 3541a4c80d819a1396a2714279da5674c0278f23 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Feb 2023 12:00:40 +0000 Subject: [PATCH 690/785] Bump jest from 29.4.1 to 29.4.2 Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.4.1 to 29.4.2. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.4.2/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 716 +++++++++++++++++++++++++++--------------------------- 1 file changed, 358 insertions(+), 358 deletions(-) diff --git a/yarn.lock b/yarn.lock index a476d698..cb7e01c0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -348,109 +348,109 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^29.4.1": - version "29.4.1" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.4.1.tgz#cbc31d73f6329f693b3d34b365124de797704fff" - integrity sha512-m+XpwKSi3PPM9znm5NGS8bBReeAJJpSkL1OuFCqaMaJL2YX9YXLkkI+MBchMPwu+ZuM2rynL51sgfkQteQ1CKQ== +"@jest/console@^29.4.2": + version "29.4.2" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.4.2.tgz#f78374905c2454764152904a344a2d5226b0ef09" + integrity sha512-0I/rEJwMpV9iwi9cDEnT71a5nNGK9lj8Z4+1pRAU2x/thVXCDnaTGrvxyK+cAqZTFVFCiR+hfVrP4l2m+dCmQg== dependencies: - "@jest/types" "^29.4.1" + "@jest/types" "^29.4.2" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^29.4.1" - jest-util "^29.4.1" + jest-message-util "^29.4.2" + jest-util "^29.4.2" slash "^3.0.0" -"@jest/core@^29.4.1": - version "29.4.1" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.4.1.tgz#91371179b5959951e211dfaeea4277a01dcca14f" - integrity sha512-RXFTohpBqpaTebNdg5l3I5yadnKo9zLBajMT0I38D0tDhreVBYv3fA8kywthI00sWxPztWLD3yjiUkewwu/wKA== +"@jest/core@^29.4.2": + version "29.4.2" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.4.2.tgz#6e999b67bdc2df9d96ba9b142465bda71ee472c2" + integrity sha512-KGuoQah0P3vGNlaS/l9/wQENZGNKGoWb+OPxh3gz+YzG7/XExvYu34MzikRndQCdM2S0tzExN4+FL37i6gZmCQ== dependencies: - "@jest/console" "^29.4.1" - "@jest/reporters" "^29.4.1" - "@jest/test-result" "^29.4.1" - "@jest/transform" "^29.4.1" - "@jest/types" "^29.4.1" + "@jest/console" "^29.4.2" + "@jest/reporters" "^29.4.2" + "@jest/test-result" "^29.4.2" + "@jest/transform" "^29.4.2" + "@jest/types" "^29.4.2" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" ci-info "^3.2.0" exit "^0.1.2" graceful-fs "^4.2.9" - jest-changed-files "^29.4.0" - jest-config "^29.4.1" - jest-haste-map "^29.4.1" - jest-message-util "^29.4.1" - jest-regex-util "^29.2.0" - jest-resolve "^29.4.1" - jest-resolve-dependencies "^29.4.1" - jest-runner "^29.4.1" - jest-runtime "^29.4.1" - jest-snapshot "^29.4.1" - jest-util "^29.4.1" - jest-validate "^29.4.1" - jest-watcher "^29.4.1" + jest-changed-files "^29.4.2" + jest-config "^29.4.2" + jest-haste-map "^29.4.2" + jest-message-util "^29.4.2" + jest-regex-util "^29.4.2" + jest-resolve "^29.4.2" + jest-resolve-dependencies "^29.4.2" + jest-runner "^29.4.2" + jest-runtime "^29.4.2" + jest-snapshot "^29.4.2" + jest-util "^29.4.2" + jest-validate "^29.4.2" + jest-watcher "^29.4.2" micromatch "^4.0.4" - pretty-format "^29.4.1" + pretty-format "^29.4.2" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.4.1": - version "29.4.1" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.4.1.tgz#52d232a85cdc995b407a940c89c86568f5a88ffe" - integrity sha512-pJ14dHGSQke7Q3mkL/UZR9ZtTOxqskZaC91NzamEH4dlKRt42W+maRBXiw/LWkdJe+P0f/zDR37+SPMplMRlPg== +"@jest/environment@^29.4.2": + version "29.4.2" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.4.2.tgz#ee92c316ee2fbdf0bcd9d2db0ef42d64fea26b56" + integrity sha512-JKs3VUtse0vQfCaFGJRX1bir9yBdtasxziSyu+pIiEllAQOe4oQhdCYIf3+Lx+nGglFktSKToBnRJfD5QKp+NQ== dependencies: - "@jest/fake-timers" "^29.4.1" - "@jest/types" "^29.4.1" + "@jest/fake-timers" "^29.4.2" + "@jest/types" "^29.4.2" "@types/node" "*" - jest-mock "^29.4.1" + jest-mock "^29.4.2" -"@jest/expect-utils@^29.4.1": - version "29.4.1" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.4.1.tgz#105b9f3e2c48101f09cae2f0a4d79a1b3a419cbb" - integrity sha512-w6YJMn5DlzmxjO00i9wu2YSozUYRBhIoJ6nQwpMYcBMtiqMGJm1QBzOf6DDgRao8dbtpDoaqLg6iiQTvv0UHhQ== +"@jest/expect-utils@^29.4.2": + version "29.4.2" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.4.2.tgz#cd0065dfdd8e8a182aa350cc121db97b5eed7b3f" + integrity sha512-Dd3ilDJpBnqa0GiPN7QrudVs0cczMMHtehSo2CSTjm3zdHx0RcpmhFNVEltuEFeqfLIyWKFI224FsMSQ/nsJQA== dependencies: - jest-get-type "^29.2.0" + jest-get-type "^29.4.2" -"@jest/expect@^29.4.1": - version "29.4.1" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.4.1.tgz#3338fa20f547bb6e550c4be37d6f82711cc13c38" - integrity sha512-ZxKJP5DTUNF2XkpJeZIzvnzF1KkfrhEF6Rz0HGG69fHl6Bgx5/GoU3XyaeFYEjuuKSOOsbqD/k72wFvFxc3iTw== +"@jest/expect@^29.4.2": + version "29.4.2" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.4.2.tgz#2d4a6a41b29380957c5094de19259f87f194578b" + integrity sha512-NUAeZVApzyaeLjfWIV/64zXjA2SS+NuUPHpAlO7IwVMGd5Vf9szTl9KEDlxY3B4liwLO31os88tYNHl6cpjtKQ== dependencies: - expect "^29.4.1" - jest-snapshot "^29.4.1" + expect "^29.4.2" + jest-snapshot "^29.4.2" -"@jest/fake-timers@^29.4.1": - version "29.4.1" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.4.1.tgz#7b673131e8ea2a2045858f08241cace5d518b42b" - integrity sha512-/1joI6rfHFmmm39JxNfmNAO3Nwm6Y0VoL5fJDy7H1AtWrD1CgRtqJbN9Ld6rhAkGO76qqp4cwhhxJ9o9kYjQMw== +"@jest/fake-timers@^29.4.2": + version "29.4.2" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.4.2.tgz#af43ee1a5720b987d0348f80df98f2cb17d45cd0" + integrity sha512-Ny1u0Wg6kCsHFWq7A/rW/tMhIedq2siiyHyLpHCmIhP7WmcAmd2cx95P+0xtTZlj5ZbJxIRQi4OPydZZUoiSQQ== dependencies: - "@jest/types" "^29.4.1" + "@jest/types" "^29.4.2" "@sinonjs/fake-timers" "^10.0.2" "@types/node" "*" - jest-message-util "^29.4.1" - jest-mock "^29.4.1" - jest-util "^29.4.1" + jest-message-util "^29.4.2" + jest-mock "^29.4.2" + jest-util "^29.4.2" -"@jest/globals@^29.4.1": - version "29.4.1" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.4.1.tgz#3cd78c5567ab0249f09fbd81bf9f37a7328f4713" - integrity sha512-znoK2EuFytbHH0ZSf2mQK2K1xtIgmaw4Da21R2C/NE/+NnItm5mPEFQmn8gmF3f0rfOlmZ3Y3bIf7bFj7DHxAA== +"@jest/globals@^29.4.2": + version "29.4.2" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.4.2.tgz#73f85f5db0e17642258b25fd0b9fc89ddedb50eb" + integrity sha512-zCk70YGPzKnz/I9BNFDPlK+EuJLk21ur/NozVh6JVM86/YYZtZHqxFFQ62O9MWq7uf3vIZnvNA0BzzrtxD9iyg== dependencies: - "@jest/environment" "^29.4.1" - "@jest/expect" "^29.4.1" - "@jest/types" "^29.4.1" - jest-mock "^29.4.1" + "@jest/environment" "^29.4.2" + "@jest/expect" "^29.4.2" + "@jest/types" "^29.4.2" + jest-mock "^29.4.2" -"@jest/reporters@^29.4.1": - version "29.4.1" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.4.1.tgz#50d509c08575c75e3cd2176d72ec3786419d5e04" - integrity sha512-AISY5xpt2Xpxj9R6y0RF1+O6GRy9JsGa8+vK23Lmzdy1AYcpQn5ItX79wJSsTmfzPKSAcsY1LNt/8Y5Xe5LOSg== +"@jest/reporters@^29.4.2": + version "29.4.2" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.4.2.tgz#6abfa923941daae0acc76a18830ee9e79a22042d" + integrity sha512-10yw6YQe75zCgYcXgEND9kw3UZZH5tJeLzWv4vTk/2mrS1aY50A37F+XT2hPO5OqQFFnUWizXD8k1BMiATNfUw== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.4.1" - "@jest/test-result" "^29.4.1" - "@jest/transform" "^29.4.1" - "@jest/types" "^29.4.1" + "@jest/console" "^29.4.2" + "@jest/test-result" "^29.4.2" + "@jest/transform" "^29.4.2" + "@jest/types" "^29.4.2" "@jridgewell/trace-mapping" "^0.3.15" "@types/node" "*" chalk "^4.0.0" @@ -463,77 +463,77 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^29.4.1" - jest-util "^29.4.1" - jest-worker "^29.4.1" + jest-message-util "^29.4.2" + jest-util "^29.4.2" + jest-worker "^29.4.2" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" v8-to-istanbul "^9.0.1" -"@jest/schemas@^29.4.0": - version "29.4.0" - resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.4.0.tgz#0d6ad358f295cc1deca0b643e6b4c86ebd539f17" - integrity sha512-0E01f/gOZeNTG76i5eWWSupvSHaIINrTie7vCyjiYFKgzNdyEGd12BUv4oNBFHOqlHDbtoJi3HrQ38KCC90NsQ== +"@jest/schemas@^29.4.2": + version "29.4.2" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.4.2.tgz#cf7cfe97c5649f518452b176c47ed07486270fc1" + integrity sha512-ZrGzGfh31NtdVH8tn0mgJw4khQuNHiKqdzJAFbCaERbyCP9tHlxWuL/mnMu8P7e/+k4puWjI1NOzi/sFsjce/g== dependencies: "@sinclair/typebox" "^0.25.16" -"@jest/source-map@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.2.0.tgz#ab3420c46d42508dcc3dc1c6deee0b613c235744" - integrity sha512-1NX9/7zzI0nqa6+kgpSdKPK+WU1p+SJk3TloWZf5MzPbxri9UEeXX5bWZAPCzbQcyuAzubcdUHA7hcNznmRqWQ== +"@jest/source-map@^29.4.2": + version "29.4.2" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.4.2.tgz#f9815d59e25cd3d6828e41489cd239271018d153" + integrity sha512-tIoqV5ZNgYI9XCKXMqbYe5JbumcvyTgNN+V5QW4My033lanijvCD0D4PI9tBw4pRTqWOc00/7X3KVvUh+qnF4Q== dependencies: "@jridgewell/trace-mapping" "^0.3.15" callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^29.4.1": - version "29.4.1" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.4.1.tgz#997f19695e13b34779ceb3c288a416bd26c3238d" - integrity sha512-WRt29Lwt+hEgfN8QDrXqXGgCTidq1rLyFqmZ4lmJOpVArC8daXrZWkWjiaijQvgd3aOUj2fM8INclKHsQW9YyQ== +"@jest/test-result@^29.4.2": + version "29.4.2" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.4.2.tgz#34b0ba069f2e3072261e4884c8fb6bd15ed6fb8d" + integrity sha512-HZsC3shhiHVvMtP+i55MGR5bPcc3obCFbA5bzIOb8pCjwBZf11cZliJncCgaVUbC5yoQNuGqCkC0Q3t6EItxZA== dependencies: - "@jest/console" "^29.4.1" - "@jest/types" "^29.4.1" + "@jest/console" "^29.4.2" + "@jest/types" "^29.4.2" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.4.1": - version "29.4.1" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.4.1.tgz#f7a006ec7058b194a10cf833c88282ef86d578fd" - integrity sha512-v5qLBNSsM0eHzWLXsQ5fiB65xi49A3ILPSFQKPXzGL4Vyux0DPZAIN7NAFJa9b4BiTDP9MBF/Zqc/QA1vuiJ0w== +"@jest/test-sequencer@^29.4.2": + version "29.4.2" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.4.2.tgz#8b48e5bc4af80b42edacaf2a733d4f295edf28fb" + integrity sha512-9Z2cVsD6CcObIVrWigHp2McRJhvCxL27xHtrZFgNC1RwnoSpDx6fZo8QYjJmziFlW9/hr78/3sxF54S8B6v8rg== dependencies: - "@jest/test-result" "^29.4.1" + "@jest/test-result" "^29.4.2" graceful-fs "^4.2.9" - jest-haste-map "^29.4.1" + jest-haste-map "^29.4.2" slash "^3.0.0" -"@jest/transform@^29.4.1": - version "29.4.1" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.4.1.tgz#e4f517841bb795c7dcdee1ba896275e2c2d26d4a" - integrity sha512-5w6YJrVAtiAgr0phzKjYd83UPbCXsBRTeYI4BXokv9Er9CcrH9hfXL/crCvP2d2nGOcovPUnlYiLPFLZrkG5Hg== +"@jest/transform@^29.4.2": + version "29.4.2" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.4.2.tgz#b24b72dbab4c8675433a80e222d6a8ef4656fb81" + integrity sha512-kf1v5iTJHn7p9RbOsBuc/lcwyPtJaZJt5885C98omWz79NIeD3PfoiiaPSu7JyCyFzNOIzKhmMhQLUhlTL9BvQ== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^29.4.1" + "@jest/types" "^29.4.2" "@jridgewell/trace-mapping" "^0.3.15" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^2.0.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.4.1" - jest-regex-util "^29.2.0" - jest-util "^29.4.1" + jest-haste-map "^29.4.2" + jest-regex-util "^29.4.2" + jest-util "^29.4.2" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" - write-file-atomic "^5.0.0" + write-file-atomic "^4.0.2" -"@jest/types@^29.4.1": - version "29.4.1" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.4.1.tgz#f9f83d0916f50696661da72766132729dcb82ecb" - integrity sha512-zbrAXDUOnpJ+FMST2rV7QZOgec8rskg2zv8g2ajeqitp4tvZiyqTCYXANrKsM+ryj5o+LI+ZN2EgU9drrkiwSA== +"@jest/types@^29.4.2": + version "29.4.2" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.4.2.tgz#8f724a414b1246b2bfd56ca5225d9e1f39540d82" + integrity sha512-CKlngyGP0fwlgC1BRUtPZSiWLBhyS9dKwKmyGxk8Z6M82LBEGB2aLQSg+U1MyLsU+M7UjnlLllBM2BLWKVm/Uw== dependencies: - "@jest/schemas" "^29.4.0" + "@jest/schemas" "^29.4.2" "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" "@types/node" "*" @@ -797,15 +797,15 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^29.4.1: - version "29.4.1" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.4.1.tgz#01fa167e27470b35c2d4a1b841d9586b1764da19" - integrity sha512-xBZa/pLSsF/1sNpkgsiT3CmY7zV1kAsZ9OxxtrFqYucnOuRftXAfcJqcDVyOPeN4lttWTwhLdu0T9f8uvoPEUg== +babel-jest@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.4.2.tgz#b17b9f64be288040877cbe2649f91ac3b63b2ba6" + integrity sha512-vcghSqhtowXPG84posYkkkzcZsdayFkubUgbE3/1tuGbX7AQtwCkkNA/wIbB0BMjuCPoqTkiDyKN7Ty7d3uwNQ== dependencies: - "@jest/transform" "^29.4.1" + "@jest/transform" "^29.4.2" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^29.4.0" + babel-preset-jest "^29.4.2" chalk "^4.0.0" graceful-fs "^4.2.9" slash "^3.0.0" @@ -821,10 +821,10 @@ babel-plugin-istanbul@^6.1.1: istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^29.4.0: - version "29.4.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.4.0.tgz#3fd3dfcedf645932df6d0c9fc3d9a704dd860248" - integrity sha512-a/sZRLQJEmsmejQ2rPEUe35nO1+C9dc9O1gplH1SXmJxveQSRUYdBk8yGZG/VOUuZs1u2aHZJusEGoRMbhhwCg== +babel-plugin-jest-hoist@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.4.2.tgz#22aa43e255230f02371ffef1cac7eedef58f60bc" + integrity sha512-5HZRCfMeWypFEonRbEkwWXtNS1sQK159LhRVyRuLzyfVBxDy/34Tr/rg4YVi0SScSJ4fqeaR/OIeceJ/LaQ0pQ== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -849,12 +849,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^29.4.0: - version "29.4.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.4.0.tgz#c2b03c548b02dea0a18ae21d5759c136f9251ee4" - integrity sha512-fUB9vZflUSM3dO/6M2TCAepTzvA4VkOvl67PjErcrQMGt9Eve7uazaeyCZ2th3UtI7ljpiBJES0F7A1vBRsLZA== +babel-preset-jest@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.4.2.tgz#f0b20c6a79a9f155515e72a2d4f537fe002a4e38" + integrity sha512-ecWdaLY/8JyfUDr0oELBMpj3R5I1L6ZqG+kRJmwqfHtLWuPrJStR0LUkvUhfykJWTsXXMnohsayN/twltBbDrQ== dependencies: - babel-plugin-jest-hoist "^29.4.0" + babel-plugin-jest-hoist "^29.4.2" babel-preset-current-node-syntax "^1.0.0" balanced-match@^1.0.0: @@ -1053,10 +1053,10 @@ detect-newline@^3.0.0: resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== -diff-sequences@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.3.1.tgz#104b5b95fe725932421a9c6e5b4bef84c3f2249e" - integrity sha512-hlM3QR272NXCi4pq+N4Kok4kOp6EsgOM3ZSpJI7Da3UAs+Ttsi8MRmB6trM/lhyzUxGfOgnpkHtgqm5Q/CTcfQ== +diff-sequences@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.4.2.tgz#711fe6bd8a5869fe2539cee4a5152425ff671fda" + integrity sha512-R6P0Y6PrsH3n4hUXxL3nns0rbRk6Q33js3ygJBeEpbzLzgcNuJ61+u0RXasFpTKISw99TxUzFnumSnRLsjhLaw== doctrine@^3.0.0: version "3.0.0" @@ -1262,16 +1262,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== -expect@^29.4.1: - version "29.4.1" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.4.1.tgz#58cfeea9cbf479b64ed081fd1e074ac8beb5a1fe" - integrity sha512-OKrGESHOaMxK3b6zxIq9SOW8kEXztKff/Dvg88j4xIJxur1hspEbedVkR3GpHe5LO+WB2Qw7OWN0RMTdp6as5A== +expect@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.4.2.tgz#2ae34eb88de797c64a1541ad0f1e2ea8a7a7b492" + integrity sha512-+JHYg9O3hd3RlICG90OPVjRkPBoiUH7PxvDVMnRiaq1g6JUgZStX514erMl0v2Dc5SkfVbm7ztqbd6qHHPn+mQ== dependencies: - "@jest/expect-utils" "^29.4.1" - jest-get-type "^29.2.0" - jest-matcher-utils "^29.4.1" - jest-message-util "^29.4.1" - jest-util "^29.4.1" + "@jest/expect-utils" "^29.4.2" + jest-get-type "^29.4.2" + jest-matcher-utils "^29.4.2" + jest-message-util "^29.4.2" + jest-util "^29.4.2" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1600,284 +1600,284 @@ istanbul-reports@^3.1.3: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^29.4.0: - version "29.4.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.4.0.tgz#ac2498bcd394228f7eddcadcf928b3583bf2779d" - integrity sha512-rnI1oPxgFghoz32Y8eZsGJMjW54UlqT17ycQeCEktcxxwqqKdlj9afl8LNeO0Pbu+h2JQHThQP0BzS67eTRx4w== +jest-changed-files@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.4.2.tgz#bee1fafc8b620d6251423d1978a0080546bc4376" + integrity sha512-Qdd+AXdqD16PQa+VsWJpxR3kN0JyOCX1iugQfx5nUgAsI4gwsKviXkpclxOK9ZnwaY2IQVHz+771eAvqeOlfuw== dependencies: execa "^5.0.0" p-limit "^3.1.0" -jest-circus@^29.4.1: - version "29.4.1" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.4.1.tgz#ff1b63eb04c3b111cefea9489e8dbadd23ce49bd" - integrity sha512-v02NuL5crMNY4CGPHBEflLzl4v91NFb85a+dH9a1pUNx6Xjggrd8l9pPy4LZ1VYNRXlb+f65+7O/MSIbLir6pA== +jest-circus@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.4.2.tgz#2d00c04baefd0ee2a277014cd494d4b5970663ed" + integrity sha512-wW3ztp6a2P5c1yOc1Cfrt5ozJ7neWmqeXm/4SYiqcSriyisgq63bwFj1NuRdSR5iqS0CMEYwSZd89ZA47W9zUg== dependencies: - "@jest/environment" "^29.4.1" - "@jest/expect" "^29.4.1" - "@jest/test-result" "^29.4.1" - "@jest/types" "^29.4.1" + "@jest/environment" "^29.4.2" + "@jest/expect" "^29.4.2" + "@jest/test-result" "^29.4.2" + "@jest/types" "^29.4.2" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" is-generator-fn "^2.0.0" - jest-each "^29.4.1" - jest-matcher-utils "^29.4.1" - jest-message-util "^29.4.1" - jest-runtime "^29.4.1" - jest-snapshot "^29.4.1" - jest-util "^29.4.1" + jest-each "^29.4.2" + jest-matcher-utils "^29.4.2" + jest-message-util "^29.4.2" + jest-runtime "^29.4.2" + jest-snapshot "^29.4.2" + jest-util "^29.4.2" p-limit "^3.1.0" - pretty-format "^29.4.1" + pretty-format "^29.4.2" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.4.1: - version "29.4.1" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.4.1.tgz#7abef96944f300feb9b76f68b1eb2d68774fe553" - integrity sha512-jz7GDIhtxQ37M+9dlbv5K+/FVcIo1O/b1sX3cJgzlQUf/3VG25nvuWzlDC4F1FLLzUThJeWLu8I7JF9eWpuURQ== +jest-cli@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.4.2.tgz#94a2f913a0a7a49d11bee98ad88bf48baae941f4" + integrity sha512-b+eGUtXq/K2v7SH3QcJvFvaUaCDS1/YAZBYz0m28Q/Ppyr+1qNaHmVYikOrbHVbZqYQs2IeI3p76uy6BWbXq8Q== dependencies: - "@jest/core" "^29.4.1" - "@jest/test-result" "^29.4.1" - "@jest/types" "^29.4.1" + "@jest/core" "^29.4.2" + "@jest/test-result" "^29.4.2" + "@jest/types" "^29.4.2" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.4.1" - jest-util "^29.4.1" - jest-validate "^29.4.1" + jest-config "^29.4.2" + jest-util "^29.4.2" + jest-validate "^29.4.2" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^29.4.1: - version "29.4.1" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.4.1.tgz#e62670c6c980ec21d75941806ec4d0c0c6402728" - integrity sha512-g7p3q4NuXiM4hrS4XFATTkd+2z0Ml2RhFmFPM8c3WyKwVDNszbl4E7cV7WIx1YZeqqCtqbtTtZhGZWJlJqngzg== +jest-config@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.4.2.tgz#15386dd9ed2f7059516915515f786b8836a98f07" + integrity sha512-919CtnXic52YM0zW4C1QxjG6aNueX1kBGthuMtvFtRTAxhKfJmiXC9qwHmi6o2josjbDz8QlWyY55F1SIVmCWA== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.4.1" - "@jest/types" "^29.4.1" - babel-jest "^29.4.1" + "@jest/test-sequencer" "^29.4.2" + "@jest/types" "^29.4.2" + babel-jest "^29.4.2" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^29.4.1" - jest-environment-node "^29.4.1" - jest-get-type "^29.2.0" - jest-regex-util "^29.2.0" - jest-resolve "^29.4.1" - jest-runner "^29.4.1" - jest-util "^29.4.1" - jest-validate "^29.4.1" + jest-circus "^29.4.2" + jest-environment-node "^29.4.2" + jest-get-type "^29.4.2" + jest-regex-util "^29.4.2" + jest-resolve "^29.4.2" + jest-runner "^29.4.2" + jest-util "^29.4.2" + jest-validate "^29.4.2" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^29.4.1" + pretty-format "^29.4.2" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^29.4.1: - version "29.4.1" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.4.1.tgz#9a6dc715037e1fa7a8a44554e7d272088c4029bd" - integrity sha512-uazdl2g331iY56CEyfbNA0Ut7Mn2ulAG5vUaEHXycf1L6IPyuImIxSz4F0VYBKi7LYIuxOwTZzK3wh5jHzASMw== +jest-diff@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.4.2.tgz#b88502d5dc02d97f6512d73c37da8b36f49b4871" + integrity sha512-EK8DSajVtnjx9sa1BkjZq3mqChm2Cd8rIzdXkQMA8e0wuXq53ypz6s5o5V8HRZkoEt2ywJ3eeNWFKWeYr8HK4g== dependencies: chalk "^4.0.0" - diff-sequences "^29.3.1" - jest-get-type "^29.2.0" - pretty-format "^29.4.1" + diff-sequences "^29.4.2" + jest-get-type "^29.4.2" + pretty-format "^29.4.2" -jest-docblock@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.2.0.tgz#307203e20b637d97cee04809efc1d43afc641e82" - integrity sha512-bkxUsxTgWQGbXV5IENmfiIuqZhJcyvF7tU4zJ/7ioTutdz4ToB5Yx6JOFBpgI+TphRY4lhOyCWGNH/QFQh5T6A== +jest-docblock@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.4.2.tgz#c78a95eedf9a24c0a6cc16cf2abdc4b8b0f2531b" + integrity sha512-dV2JdahgClL34Y5vLrAHde3nF3yo2jKRH+GIYJuCpfqwEJZcikzeafVTGAjbOfKPG17ez9iWXwUYp7yefeCRag== dependencies: detect-newline "^3.0.0" -jest-each@^29.4.1: - version "29.4.1" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.4.1.tgz#05ce9979e7486dbd0f5d41895f49ccfdd0afce01" - integrity sha512-QlYFiX3llJMWUV0BtWht/esGEz9w+0i7BHwODKCze7YzZzizgExB9MOfiivF/vVT0GSQ8wXLhvHXh3x2fVD4QQ== +jest-each@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.4.2.tgz#e1347aff1303f4c35470827a62c029d389c5d44a" + integrity sha512-trvKZb0JYiCndc55V1Yh0Luqi7AsAdDWpV+mKT/5vkpnnFQfuQACV72IoRV161aAr6kAVIBpmYzwhBzm34vQkA== dependencies: - "@jest/types" "^29.4.1" + "@jest/types" "^29.4.2" chalk "^4.0.0" - jest-get-type "^29.2.0" - jest-util "^29.4.1" - pretty-format "^29.4.1" - -jest-environment-node@^29.4.1: - version "29.4.1" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.4.1.tgz#22550b7d0f8f0b16228639c9f88ca04bbf3c1974" - integrity sha512-x/H2kdVgxSkxWAIlIh9MfMuBa0hZySmfsC5lCsWmWr6tZySP44ediRKDUiNggX/eHLH7Cd5ZN10Rw+XF5tXsqg== - dependencies: - "@jest/environment" "^29.4.1" - "@jest/fake-timers" "^29.4.1" - "@jest/types" "^29.4.1" + jest-get-type "^29.4.2" + jest-util "^29.4.2" + pretty-format "^29.4.2" + +jest-environment-node@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.4.2.tgz#0eab835b41e25fd0c1a72f62665fc8db08762ad2" + integrity sha512-MLPrqUcOnNBc8zTOfqBbxtoa8/Ee8tZ7UFW7hRDQSUT+NGsvS96wlbHGTf+EFAT9KC3VNb7fWEM6oyvmxtE/9w== + dependencies: + "@jest/environment" "^29.4.2" + "@jest/fake-timers" "^29.4.2" + "@jest/types" "^29.4.2" "@types/node" "*" - jest-mock "^29.4.1" - jest-util "^29.4.1" + jest-mock "^29.4.2" + jest-util "^29.4.2" -jest-get-type@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.2.0.tgz#726646f927ef61d583a3b3adb1ab13f3a5036408" - integrity sha512-uXNJlg8hKFEnDgFsrCjznB+sTxdkuqiCL6zMgA75qEbAJjJYTs9XPrvDctrEig2GDow22T/LvHgO57iJhXB/UA== +jest-get-type@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.4.2.tgz#7cb63f154bca8d8f57364d01614477d466fa43fe" + integrity sha512-vERN30V5i2N6lqlFu4ljdTqQAgrkTFMC9xaIIfOPYBw04pufjXRty5RuXBiB1d72tGbURa/UgoiHB90ruOSivg== -jest-haste-map@^29.4.1: - version "29.4.1" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.4.1.tgz#b0579dc82d94b40ed9041af56ad25c2f80bedaeb" - integrity sha512-imTjcgfVVTvg02khXL11NNLTx9ZaofbAWhilrMg/G8dIkp+HYCswhxf0xxJwBkfhWb3e8dwbjuWburvxmcr58w== +jest-haste-map@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.4.2.tgz#9112df3f5121e643f1b2dcbaa86ab11b0b90b49a" + integrity sha512-WkUgo26LN5UHPknkezrBzr7lUtV1OpGsp+NfXbBwHztsFruS3gz+AMTTBcEklvi8uPzpISzYjdKXYZQJXBnfvw== dependencies: - "@jest/types" "^29.4.1" + "@jest/types" "^29.4.2" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" - jest-regex-util "^29.2.0" - jest-util "^29.4.1" - jest-worker "^29.4.1" + jest-regex-util "^29.4.2" + jest-util "^29.4.2" + jest-worker "^29.4.2" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^29.4.1: - version "29.4.1" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.4.1.tgz#632186c546e084da2b490b7496fee1a1c9929637" - integrity sha512-akpZv7TPyGMnH2RimOCgy+hPmWZf55EyFUvymQ4LMsQP8xSPlZumCPtXGoDhFNhUE2039RApZkTQDKU79p/FiQ== +jest-leak-detector@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.4.2.tgz#8f05c6680e0cb46a1d577c0d3da9793bed3ea97b" + integrity sha512-Wa62HuRJmWXtX9F00nUpWlrbaH5axeYCdyRsOs/+Rb1Vb6+qWTlB5rKwCCRKtorM7owNwKsyJ8NRDUcZ8ghYUA== dependencies: - jest-get-type "^29.2.0" - pretty-format "^29.4.1" + jest-get-type "^29.4.2" + pretty-format "^29.4.2" -jest-matcher-utils@^29.4.1: - version "29.4.1" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.4.1.tgz#73d834e305909c3b43285fbc76f78bf0ad7e1954" - integrity sha512-k5h0u8V4nAEy6lSACepxL/rw78FLDkBnXhZVgFneVpnJONhb2DhZj/Gv4eNe+1XqQ5IhgUcqj745UwH0HJmMnA== +jest-matcher-utils@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.4.2.tgz#08d0bf5abf242e3834bec92c7ef5071732839e85" + integrity sha512-EZaAQy2je6Uqkrm6frnxBIdaWtSYFoR8SVb2sNLAtldswlR/29JAgx+hy67llT3+hXBaLB0zAm5UfeqerioZyg== dependencies: chalk "^4.0.0" - jest-diff "^29.4.1" - jest-get-type "^29.2.0" - pretty-format "^29.4.1" + jest-diff "^29.4.2" + jest-get-type "^29.4.2" + pretty-format "^29.4.2" -jest-message-util@^29.4.1: - version "29.4.1" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.4.1.tgz#522623aa1df9a36ebfdffb06495c7d9d19e8a845" - integrity sha512-H4/I0cXUaLeCw6FM+i4AwCnOwHRgitdaUFOdm49022YD5nfyr8C/DrbXOBEyJaj+w/y0gGJ57klssOaUiLLQGQ== +jest-message-util@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.4.2.tgz#309a2924eae6ca67cf7f25781a2af1902deee717" + integrity sha512-SElcuN4s6PNKpOEtTInjOAA8QvItu0iugkXqhYyguRvQoXapg5gN+9RQxLAkakChZA7Y26j6yUCsFWN+hlKD6g== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.4.1" + "@jest/types" "^29.4.2" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^29.4.1" + pretty-format "^29.4.2" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^29.4.1: - version "29.4.1" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.4.1.tgz#a218a2abf45c99c501d4665207748a6b9e29afbd" - integrity sha512-MwA4hQ7zBOcgVCVnsM8TzaFLVUD/pFWTfbkY953Y81L5ret3GFRZtmPmRFAjKQSdCKoJvvqOu6Bvfpqlwwb0dQ== +jest-mock@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.4.2.tgz#e1054be66fb3e975d26d4528fcde6979e4759de8" + integrity sha512-x1FSd4Gvx2yIahdaIKoBjwji6XpboDunSJ95RpntGrYulI1ByuYQCKN/P7hvk09JB74IonU3IPLdkutEWYt++g== dependencies: - "@jest/types" "^29.4.1" + "@jest/types" "^29.4.2" "@types/node" "*" - jest-util "^29.4.1" + jest-util "^29.4.2" jest-pnp-resolver@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz#930b1546164d4ad5937d5540e711d4d38d4cad2e" integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== -jest-regex-util@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.2.0.tgz#82ef3b587e8c303357728d0322d48bbfd2971f7b" - integrity sha512-6yXn0kg2JXzH30cr2NlThF+70iuO/3irbaB4mh5WyqNIvLLP+B6sFdluO1/1RJmslyh/f9osnefECflHvTbwVA== +jest-regex-util@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.4.2.tgz#19187cca35d301f8126cf7a021dd4dcb7b58a1ca" + integrity sha512-XYZXOqUl1y31H6VLMrrUL1ZhXuiymLKPz0BO1kEeR5xER9Tv86RZrjTm74g5l9bPJQXA/hyLdaVPN/sdqfteig== -jest-resolve-dependencies@^29.4.1: - version "29.4.1" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.4.1.tgz#02420a2e055da105e5fca8218c471d8b9553c904" - integrity sha512-Y3QG3M1ncAMxfjbYgtqNXC5B595zmB6e//p/qpA/58JkQXu/IpLDoLeOa8YoYfsSglBKQQzNUqtfGJJT/qLmJg== +jest-resolve-dependencies@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.4.2.tgz#6359db606f5967b68ca8bbe9dbc07a4306c12bf7" + integrity sha512-6pL4ptFw62rjdrPk7rRpzJYgcRqRZNsZTF1VxVTZMishbO6ObyWvX57yHOaNGgKoADtAHRFYdHQUEvYMJATbDg== dependencies: - jest-regex-util "^29.2.0" - jest-snapshot "^29.4.1" + jest-regex-util "^29.4.2" + jest-snapshot "^29.4.2" -jest-resolve@^29.4.1: - version "29.4.1" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.4.1.tgz#4c6bf71a07b8f0b79c5fdf4f2a2cf47317694c5e" - integrity sha512-j/ZFNV2lm9IJ2wmlq1uYK0Y/1PiyDq9g4HEGsNTNr3viRbJdV+8Lf1SXIiLZXFvyiisu0qUyIXGBnw+OKWkJwQ== +jest-resolve@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.4.2.tgz#8831f449671d08d161fe493003f61dc9b55b808e" + integrity sha512-RtKWW0mbR3I4UdkOrW7552IFGLYQ5AF9YrzD0FnIOkDu0rAMlA5/Y1+r7lhCAP4nXSBTaE7ueeqj6IOwZpgoqw== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^29.4.1" + jest-haste-map "^29.4.2" jest-pnp-resolver "^1.2.2" - jest-util "^29.4.1" - jest-validate "^29.4.1" + jest-util "^29.4.2" + jest-validate "^29.4.2" resolve "^1.20.0" resolve.exports "^2.0.0" slash "^3.0.0" -jest-runner@^29.4.1: - version "29.4.1" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.4.1.tgz#57460d9ebb0eea2e27eeddca1816cf8537469661" - integrity sha512-8d6XXXi7GtHmsHrnaqBKWxjKb166Eyj/ksSaUYdcBK09VbjPwIgWov1VwSmtupCIz8q1Xv4Qkzt/BTo3ZqiCeg== +jest-runner@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.4.2.tgz#2bcecf72303369df4ef1e6e983c22a89870d5125" + integrity sha512-wqwt0drm7JGjwdH+x1XgAl+TFPH7poowMguPQINYxaukCqlczAcNLJiK+OLxUxQAEWMdy+e6nHZlFHO5s7EuRg== dependencies: - "@jest/console" "^29.4.1" - "@jest/environment" "^29.4.1" - "@jest/test-result" "^29.4.1" - "@jest/transform" "^29.4.1" - "@jest/types" "^29.4.1" + "@jest/console" "^29.4.2" + "@jest/environment" "^29.4.2" + "@jest/test-result" "^29.4.2" + "@jest/transform" "^29.4.2" + "@jest/types" "^29.4.2" "@types/node" "*" chalk "^4.0.0" emittery "^0.13.1" graceful-fs "^4.2.9" - jest-docblock "^29.2.0" - jest-environment-node "^29.4.1" - jest-haste-map "^29.4.1" - jest-leak-detector "^29.4.1" - jest-message-util "^29.4.1" - jest-resolve "^29.4.1" - jest-runtime "^29.4.1" - jest-util "^29.4.1" - jest-watcher "^29.4.1" - jest-worker "^29.4.1" + jest-docblock "^29.4.2" + jest-environment-node "^29.4.2" + jest-haste-map "^29.4.2" + jest-leak-detector "^29.4.2" + jest-message-util "^29.4.2" + jest-resolve "^29.4.2" + jest-runtime "^29.4.2" + jest-util "^29.4.2" + jest-watcher "^29.4.2" + jest-worker "^29.4.2" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^29.4.1: - version "29.4.1" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.4.1.tgz#9a50f9c69d3a391690897c01b0bfa8dc5dd45808" - integrity sha512-UXTMU9uKu2GjYwTtoAw5rn4STxWw/nadOfW7v1sx6LaJYa3V/iymdCLQM6xy3+7C6mY8GfX22vKpgxY171UIoA== - dependencies: - "@jest/environment" "^29.4.1" - "@jest/fake-timers" "^29.4.1" - "@jest/globals" "^29.4.1" - "@jest/source-map" "^29.2.0" - "@jest/test-result" "^29.4.1" - "@jest/transform" "^29.4.1" - "@jest/types" "^29.4.1" +jest-runtime@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.4.2.tgz#d86b764c5b95d76cb26ed1f32644e99de5d5c134" + integrity sha512-3fque9vtpLzGuxT9eZqhxi+9EylKK/ESfhClv4P7Y9sqJPs58LjVhTt8jaMp/pRO38agll1CkSu9z9ieTQeRrw== + dependencies: + "@jest/environment" "^29.4.2" + "@jest/fake-timers" "^29.4.2" + "@jest/globals" "^29.4.2" + "@jest/source-map" "^29.4.2" + "@jest/test-result" "^29.4.2" + "@jest/transform" "^29.4.2" + "@jest/types" "^29.4.2" "@types/node" "*" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^29.4.1" - jest-message-util "^29.4.1" - jest-mock "^29.4.1" - jest-regex-util "^29.2.0" - jest-resolve "^29.4.1" - jest-snapshot "^29.4.1" - jest-util "^29.4.1" + jest-haste-map "^29.4.2" + jest-message-util "^29.4.2" + jest-mock "^29.4.2" + jest-regex-util "^29.4.2" + jest-resolve "^29.4.2" + jest-snapshot "^29.4.2" + jest-util "^29.4.2" semver "^7.3.5" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.4.1: - version "29.4.1" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.4.1.tgz#5692210b3690c94f19317913d4082b123bd83dd9" - integrity sha512-l4iV8EjGgQWVz3ee/LR9sULDk2pCkqb71bjvlqn+qp90lFwpnulHj4ZBT8nm1hA1C5wowXLc7MGnw321u0tsYA== +jest-snapshot@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.4.2.tgz#ba1fb9abb279fd2c85109ff1757bc56b503bbb3a" + integrity sha512-PdfubrSNN5KwroyMH158R23tWcAXJyx4pvSvWls1dHoLCaUhGul9rsL3uVjtqzRpkxlkMavQjGuWG1newPgmkw== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" @@ -1885,82 +1885,82 @@ jest-snapshot@^29.4.1: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.4.1" - "@jest/transform" "^29.4.1" - "@jest/types" "^29.4.1" + "@jest/expect-utils" "^29.4.2" + "@jest/transform" "^29.4.2" + "@jest/types" "^29.4.2" "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.4.1" + expect "^29.4.2" graceful-fs "^4.2.9" - jest-diff "^29.4.1" - jest-get-type "^29.2.0" - jest-haste-map "^29.4.1" - jest-matcher-utils "^29.4.1" - jest-message-util "^29.4.1" - jest-util "^29.4.1" + jest-diff "^29.4.2" + jest-get-type "^29.4.2" + jest-haste-map "^29.4.2" + jest-matcher-utils "^29.4.2" + jest-message-util "^29.4.2" + jest-util "^29.4.2" natural-compare "^1.4.0" - pretty-format "^29.4.1" + pretty-format "^29.4.2" semver "^7.3.5" -jest-util@^29.4.1: - version "29.4.1" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.4.1.tgz#2eeed98ff4563b441b5a656ed1a786e3abc3e4c4" - integrity sha512-bQy9FPGxVutgpN4VRc0hk6w7Hx/m6L53QxpDreTZgJd9gfx/AV2MjyPde9tGyZRINAUrSv57p2inGBu2dRLmkQ== +jest-util@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.4.2.tgz#3db8580b295df453a97de4a1b42dd2578dabd2c2" + integrity sha512-wKnm6XpJgzMUSRFB7YF48CuwdzuDIHenVuoIb1PLuJ6F+uErZsuDkU+EiExkChf6473XcawBrSfDSnXl+/YG4g== dependencies: - "@jest/types" "^29.4.1" + "@jest/types" "^29.4.2" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^29.4.1: - version "29.4.1" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.4.1.tgz#0d5174510415083ec329d4f981bf6779211f17e9" - integrity sha512-qNZXcZQdIQx4SfUB/atWnI4/I2HUvhz8ajOSYUu40CSmf9U5emil8EDHgE7M+3j9/pavtk3knlZBDsgFvv/SWw== +jest-validate@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.4.2.tgz#3b3f8c4910ab9a3442d2512e2175df6b3f77b915" + integrity sha512-tto7YKGPJyFbhcKhIDFq8B5od+eVWD/ySZ9Tvcp/NGCvYA4RQbuzhbwYWtIjMT5W5zA2W0eBJwu4HVw34d5G6Q== dependencies: - "@jest/types" "^29.4.1" + "@jest/types" "^29.4.2" camelcase "^6.2.0" chalk "^4.0.0" - jest-get-type "^29.2.0" + jest-get-type "^29.4.2" leven "^3.1.0" - pretty-format "^29.4.1" + pretty-format "^29.4.2" -jest-watcher@^29.4.1: - version "29.4.1" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.4.1.tgz#6e3e2486918bd778849d4d6e67fd77b814f3e6ed" - integrity sha512-vFOzflGFs27nU6h8dpnVRER3O2rFtL+VMEwnG0H3KLHcllLsU8y9DchSh0AL/Rg5nN1/wSiQ+P4ByMGpuybaVw== +jest-watcher@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.4.2.tgz#09c0f4c9a9c7c0807fcefb1445b821c6f7953b7c" + integrity sha512-onddLujSoGiMJt+tKutehIidABa175i/Ays+QvKxCqBwp7fvxP3ZhKsrIdOodt71dKxqk4sc0LN41mWLGIK44w== dependencies: - "@jest/test-result" "^29.4.1" - "@jest/types" "^29.4.1" + "@jest/test-result" "^29.4.2" + "@jest/types" "^29.4.2" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.13.1" - jest-util "^29.4.1" + jest-util "^29.4.2" string-length "^4.0.1" -jest-worker@^29.4.1: - version "29.4.1" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.4.1.tgz#7cb4a99a38975679600305650f86f4807460aab1" - integrity sha512-O9doU/S1EBe+yp/mstQ0VpPwpv0Clgn68TkNwGxL6/usX/KUW9Arnn4ag8C3jc6qHcXznhsT5Na1liYzAsuAbQ== +jest-worker@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.4.2.tgz#d9b2c3bafc69311d84d94e7fb45677fc8976296f" + integrity sha512-VIuZA2hZmFyRbchsUCHEehoSf2HEl0YVF8SDJqtPnKorAaBuh42V8QsLnde0XP5F6TyCynGPEGgBOn3Fc+wZGw== dependencies: "@types/node" "*" - jest-util "^29.4.1" + jest-util "^29.4.2" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^29.4.1: - version "29.4.1" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.4.1.tgz#bb34baca8e05901b49c02c62f1183a6182ea1785" - integrity sha512-cknimw7gAXPDOmj0QqztlxVtBVCw2lYY9CeIE5N6kD+kET1H4H79HSNISJmijb1HF+qk+G+ploJgiDi5k/fRlg== + version "29.4.2" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.4.2.tgz#4c2127d03a71dc187f386156ef155dbf323fb7be" + integrity sha512-+5hLd260vNIHu+7ZgMIooSpKl7Jp5pHKb51e73AJU3owd5dEo/RfVwHbA/na3C/eozrt3hJOLGf96c7EWwIAzg== dependencies: - "@jest/core" "^29.4.1" - "@jest/types" "^29.4.1" + "@jest/core" "^29.4.2" + "@jest/types" "^29.4.2" import-local "^3.0.2" - jest-cli "^29.4.1" + jest-cli "^29.4.2" js-sdsl@^4.1.4: version "4.3.0" @@ -2283,12 +2283,12 @@ prettier@>=3.0.0-alpha.2: resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0-alpha.4.tgz#eee71d6b520b970f44e4045f2dc772bf6f80815f" integrity sha512-+KeqJv4E5kaRsDRgSx9IeVygLKGHRmcoPvRJvPFp3bC1mw8opsva555gGb8TaJzUiHXoLZcus1EX+nlHPda7Pw== -pretty-format@^29.4.1: - version "29.4.1" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.4.1.tgz#0da99b532559097b8254298da7c75a0785b1751c" - integrity sha512-dt/Z761JUVsrIKaY215o1xQJBGlSmTx/h4cSqXqjHLnU1+Kt+mavVE7UgqJJO5ukx5HjSswHfmXz4LjS2oIJfg== +pretty-format@^29.4.2: + version "29.4.2" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.4.2.tgz#64bf5ccc0d718c03027d94ac957bdd32b3fb2401" + integrity sha512-qKlHR8yFVCbcEWba0H0TOC8dnLlO4vPlyEjRPw31FZ2Rupy9nLa8ZLbYny8gWEl8CkEhJqAE6IzdNELTBVcBEg== dependencies: - "@jest/schemas" "^29.4.0" + "@jest/schemas" "^29.4.2" ansi-styles "^5.0.0" react-is "^18.0.0" @@ -2634,10 +2634,10 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== -write-file-atomic@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-5.0.0.tgz#54303f117e109bf3d540261125c8ea5a7320fab0" - integrity sha512-R7NYMnHSlV42K54lwY9lvW6MnSm1HSJqZL3xiSgi9E7//FYaI74r2G0rd+/X6VAMkHEdzxQaU5HUOXWUz5kA/w== +write-file-atomic@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-4.0.2.tgz#a9df01ae5b77858a027fd2e80768ee433555fcfd" + integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg== dependencies: imurmurhash "^0.1.4" signal-exit "^3.0.7" From 77c36f6c2fc5c5435cff2c2338ddfde309160523 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Feb 2023 12:56:48 +0000 Subject: [PATCH 691/785] Bump eslint from 8.33.0 to 8.34.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.33.0 to 8.34.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.33.0...v8.34.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index cb7e01c0..5ba38cf2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1145,9 +1145,9 @@ eslint-visitor-keys@^3.3.0: integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.32.0: - version "8.33.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.33.0.tgz#02f110f32998cb598c6461f24f4d306e41ca33d7" - integrity sha512-WjOpFQgKK8VrCnAtl8We0SUOy/oVZ5NHykyMiagV1M9r8IFpIJX7DduK6n1mpfhlG7T1NLWm2SuD8QB7KFySaA== + version "8.34.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.34.0.tgz#fe0ab0ef478104c1f9ebc5537e303d25a8fb22d6" + integrity sha512-1Z8iFsucw+7kSqXNZVslXS8Ioa4u2KM7GPwuKtkTFAqZ/cHMcEaR+1+Br0wLlot49cNxIiZk5wp8EAbPcYZxTg== dependencies: "@eslint/eslintrc" "^1.4.1" "@humanwhocodes/config-array" "^0.11.8" From 9667377e3d0c32ec619325b75d788f475bdb6203 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Feb 2023 12:56:45 +0000 Subject: [PATCH 692/785] Bump jest from 29.4.2 to 29.4.3 Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.4.2 to 29.4.3. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.4.3/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 707 +++++++++++++++++++++++++++--------------------------- 1 file changed, 353 insertions(+), 354 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5ba38cf2..1280c554 100644 --- a/yarn.lock +++ b/yarn.lock @@ -348,109 +348,109 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^29.4.2": - version "29.4.2" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.4.2.tgz#f78374905c2454764152904a344a2d5226b0ef09" - integrity sha512-0I/rEJwMpV9iwi9cDEnT71a5nNGK9lj8Z4+1pRAU2x/thVXCDnaTGrvxyK+cAqZTFVFCiR+hfVrP4l2m+dCmQg== +"@jest/console@^29.4.3": + version "29.4.3" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.4.3.tgz#1f25a99f7f860e4c46423b5b1038262466fadde1" + integrity sha512-W/o/34+wQuXlgqlPYTansOSiBnuxrTv61dEVkA6HNmpcgHLUjfaUbdqt6oVvOzaawwo9IdW9QOtMgQ1ScSZC4A== dependencies: - "@jest/types" "^29.4.2" + "@jest/types" "^29.4.3" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^29.4.2" - jest-util "^29.4.2" + jest-message-util "^29.4.3" + jest-util "^29.4.3" slash "^3.0.0" -"@jest/core@^29.4.2": - version "29.4.2" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.4.2.tgz#6e999b67bdc2df9d96ba9b142465bda71ee472c2" - integrity sha512-KGuoQah0P3vGNlaS/l9/wQENZGNKGoWb+OPxh3gz+YzG7/XExvYu34MzikRndQCdM2S0tzExN4+FL37i6gZmCQ== +"@jest/core@^29.4.3": + version "29.4.3" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.4.3.tgz#829dd65bffdb490de5b0f69e97de8e3b5eadd94b" + integrity sha512-56QvBq60fS4SPZCuM7T+7scNrkGIe7Mr6PVIXUpu48ouvRaWOFqRPV91eifvFM0ay2HmfswXiGf97NGUN5KofQ== dependencies: - "@jest/console" "^29.4.2" - "@jest/reporters" "^29.4.2" - "@jest/test-result" "^29.4.2" - "@jest/transform" "^29.4.2" - "@jest/types" "^29.4.2" + "@jest/console" "^29.4.3" + "@jest/reporters" "^29.4.3" + "@jest/test-result" "^29.4.3" + "@jest/transform" "^29.4.3" + "@jest/types" "^29.4.3" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" ci-info "^3.2.0" exit "^0.1.2" graceful-fs "^4.2.9" - jest-changed-files "^29.4.2" - jest-config "^29.4.2" - jest-haste-map "^29.4.2" - jest-message-util "^29.4.2" - jest-regex-util "^29.4.2" - jest-resolve "^29.4.2" - jest-resolve-dependencies "^29.4.2" - jest-runner "^29.4.2" - jest-runtime "^29.4.2" - jest-snapshot "^29.4.2" - jest-util "^29.4.2" - jest-validate "^29.4.2" - jest-watcher "^29.4.2" + jest-changed-files "^29.4.3" + jest-config "^29.4.3" + jest-haste-map "^29.4.3" + jest-message-util "^29.4.3" + jest-regex-util "^29.4.3" + jest-resolve "^29.4.3" + jest-resolve-dependencies "^29.4.3" + jest-runner "^29.4.3" + jest-runtime "^29.4.3" + jest-snapshot "^29.4.3" + jest-util "^29.4.3" + jest-validate "^29.4.3" + jest-watcher "^29.4.3" micromatch "^4.0.4" - pretty-format "^29.4.2" + pretty-format "^29.4.3" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.4.2": - version "29.4.2" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.4.2.tgz#ee92c316ee2fbdf0bcd9d2db0ef42d64fea26b56" - integrity sha512-JKs3VUtse0vQfCaFGJRX1bir9yBdtasxziSyu+pIiEllAQOe4oQhdCYIf3+Lx+nGglFktSKToBnRJfD5QKp+NQ== +"@jest/environment@^29.4.3": + version "29.4.3" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.4.3.tgz#9fe2f3169c3b33815dc4bd3960a064a83eba6548" + integrity sha512-dq5S6408IxIa+lr54zeqce+QgI+CJT4nmmA+1yzFgtcsGK8c/EyiUb9XQOgz3BMKrRDfKseeOaxj2eO8LlD3lA== dependencies: - "@jest/fake-timers" "^29.4.2" - "@jest/types" "^29.4.2" + "@jest/fake-timers" "^29.4.3" + "@jest/types" "^29.4.3" "@types/node" "*" - jest-mock "^29.4.2" + jest-mock "^29.4.3" -"@jest/expect-utils@^29.4.2": - version "29.4.2" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.4.2.tgz#cd0065dfdd8e8a182aa350cc121db97b5eed7b3f" - integrity sha512-Dd3ilDJpBnqa0GiPN7QrudVs0cczMMHtehSo2CSTjm3zdHx0RcpmhFNVEltuEFeqfLIyWKFI224FsMSQ/nsJQA== +"@jest/expect-utils@^29.4.3": + version "29.4.3" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.4.3.tgz#95ce4df62952f071bcd618225ac7c47eaa81431e" + integrity sha512-/6JWbkxHOP8EoS8jeeTd9dTfc9Uawi+43oLKHfp6zzux3U2hqOOVnV3ai4RpDYHOccL6g+5nrxpoc8DmJxtXVQ== dependencies: - jest-get-type "^29.4.2" + jest-get-type "^29.4.3" -"@jest/expect@^29.4.2": - version "29.4.2" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.4.2.tgz#2d4a6a41b29380957c5094de19259f87f194578b" - integrity sha512-NUAeZVApzyaeLjfWIV/64zXjA2SS+NuUPHpAlO7IwVMGd5Vf9szTl9KEDlxY3B4liwLO31os88tYNHl6cpjtKQ== +"@jest/expect@^29.4.3": + version "29.4.3" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.4.3.tgz#d31a28492e45a6bcd0f204a81f783fe717045c6e" + integrity sha512-iktRU/YsxEtumI9zsPctYUk7ptpC+AVLLk1Ax3AsA4g1C+8OOnKDkIQBDHtD5hA/+VtgMd5AWI5gNlcAlt2vxQ== dependencies: - expect "^29.4.2" - jest-snapshot "^29.4.2" + expect "^29.4.3" + jest-snapshot "^29.4.3" -"@jest/fake-timers@^29.4.2": - version "29.4.2" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.4.2.tgz#af43ee1a5720b987d0348f80df98f2cb17d45cd0" - integrity sha512-Ny1u0Wg6kCsHFWq7A/rW/tMhIedq2siiyHyLpHCmIhP7WmcAmd2cx95P+0xtTZlj5ZbJxIRQi4OPydZZUoiSQQ== +"@jest/fake-timers@^29.4.3": + version "29.4.3" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.4.3.tgz#31e982638c60fa657d310d4b9d24e023064027b0" + integrity sha512-4Hote2MGcCTWSD2gwl0dwbCpBRHhE6olYEuTj8FMowdg3oQWNKr2YuxenPQYZ7+PfqPY1k98wKDU4Z+Hvd4Tiw== dependencies: - "@jest/types" "^29.4.2" + "@jest/types" "^29.4.3" "@sinonjs/fake-timers" "^10.0.2" "@types/node" "*" - jest-message-util "^29.4.2" - jest-mock "^29.4.2" - jest-util "^29.4.2" + jest-message-util "^29.4.3" + jest-mock "^29.4.3" + jest-util "^29.4.3" -"@jest/globals@^29.4.2": - version "29.4.2" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.4.2.tgz#73f85f5db0e17642258b25fd0b9fc89ddedb50eb" - integrity sha512-zCk70YGPzKnz/I9BNFDPlK+EuJLk21ur/NozVh6JVM86/YYZtZHqxFFQ62O9MWq7uf3vIZnvNA0BzzrtxD9iyg== +"@jest/globals@^29.4.3": + version "29.4.3" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.4.3.tgz#63a2c4200d11bc6d46f12bbe25b07f771fce9279" + integrity sha512-8BQ/5EzfOLG7AaMcDh7yFCbfRLtsc+09E1RQmRBI4D6QQk4m6NSK/MXo+3bJrBN0yU8A2/VIcqhvsOLFmziioA== dependencies: - "@jest/environment" "^29.4.2" - "@jest/expect" "^29.4.2" - "@jest/types" "^29.4.2" - jest-mock "^29.4.2" + "@jest/environment" "^29.4.3" + "@jest/expect" "^29.4.3" + "@jest/types" "^29.4.3" + jest-mock "^29.4.3" -"@jest/reporters@^29.4.2": - version "29.4.2" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.4.2.tgz#6abfa923941daae0acc76a18830ee9e79a22042d" - integrity sha512-10yw6YQe75zCgYcXgEND9kw3UZZH5tJeLzWv4vTk/2mrS1aY50A37F+XT2hPO5OqQFFnUWizXD8k1BMiATNfUw== +"@jest/reporters@^29.4.3": + version "29.4.3" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.4.3.tgz#0a68a0c0f20554760cc2e5443177a0018969e353" + integrity sha512-sr2I7BmOjJhyqj9ANC6CTLsL4emMoka7HkQpcoMRlhCbQJjz2zsRzw0BDPiPyEFDXAbxKgGFYuQZiSJ1Y6YoTg== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.4.2" - "@jest/test-result" "^29.4.2" - "@jest/transform" "^29.4.2" - "@jest/types" "^29.4.2" + "@jest/console" "^29.4.3" + "@jest/test-result" "^29.4.3" + "@jest/transform" "^29.4.3" + "@jest/types" "^29.4.3" "@jridgewell/trace-mapping" "^0.3.15" "@types/node" "*" chalk "^4.0.0" @@ -463,77 +463,77 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^29.4.2" - jest-util "^29.4.2" - jest-worker "^29.4.2" + jest-message-util "^29.4.3" + jest-util "^29.4.3" + jest-worker "^29.4.3" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" v8-to-istanbul "^9.0.1" -"@jest/schemas@^29.4.2": - version "29.4.2" - resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.4.2.tgz#cf7cfe97c5649f518452b176c47ed07486270fc1" - integrity sha512-ZrGzGfh31NtdVH8tn0mgJw4khQuNHiKqdzJAFbCaERbyCP9tHlxWuL/mnMu8P7e/+k4puWjI1NOzi/sFsjce/g== +"@jest/schemas@^29.4.3": + version "29.4.3" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.4.3.tgz#39cf1b8469afc40b6f5a2baaa146e332c4151788" + integrity sha512-VLYKXQmtmuEz6IxJsrZwzG9NvtkQsWNnWMsKxqWNu3+CnfzJQhp0WDDKWLVV9hLKr0l3SLLFRqcYHjhtyuDVxg== dependencies: "@sinclair/typebox" "^0.25.16" -"@jest/source-map@^29.4.2": - version "29.4.2" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.4.2.tgz#f9815d59e25cd3d6828e41489cd239271018d153" - integrity sha512-tIoqV5ZNgYI9XCKXMqbYe5JbumcvyTgNN+V5QW4My033lanijvCD0D4PI9tBw4pRTqWOc00/7X3KVvUh+qnF4Q== +"@jest/source-map@^29.4.3": + version "29.4.3" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.4.3.tgz#ff8d05cbfff875d4a791ab679b4333df47951d20" + integrity sha512-qyt/mb6rLyd9j1jUts4EQncvS6Yy3PM9HghnNv86QBlV+zdL2inCdK1tuVlL+J+lpiw2BI67qXOrX3UurBqQ1w== dependencies: "@jridgewell/trace-mapping" "^0.3.15" callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^29.4.2": - version "29.4.2" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.4.2.tgz#34b0ba069f2e3072261e4884c8fb6bd15ed6fb8d" - integrity sha512-HZsC3shhiHVvMtP+i55MGR5bPcc3obCFbA5bzIOb8pCjwBZf11cZliJncCgaVUbC5yoQNuGqCkC0Q3t6EItxZA== +"@jest/test-result@^29.4.3": + version "29.4.3" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.4.3.tgz#e13d973d16c8c7cc0c597082d5f3b9e7f796ccb8" + integrity sha512-Oi4u9NfBolMq9MASPwuWTlC5WvmNRwI4S8YrQg5R5Gi47DYlBe3sh7ILTqi/LGrK1XUE4XY9KZcQJTH1WJCLLA== dependencies: - "@jest/console" "^29.4.2" - "@jest/types" "^29.4.2" + "@jest/console" "^29.4.3" + "@jest/types" "^29.4.3" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.4.2": - version "29.4.2" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.4.2.tgz#8b48e5bc4af80b42edacaf2a733d4f295edf28fb" - integrity sha512-9Z2cVsD6CcObIVrWigHp2McRJhvCxL27xHtrZFgNC1RwnoSpDx6fZo8QYjJmziFlW9/hr78/3sxF54S8B6v8rg== +"@jest/test-sequencer@^29.4.3": + version "29.4.3" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.4.3.tgz#0862e876a22993385a0f3e7ea1cc126f208a2898" + integrity sha512-yi/t2nES4GB4G0mjLc0RInCq/cNr9dNwJxcGg8sslajua5Kb4kmozAc+qPLzplhBgfw1vLItbjyHzUN92UXicw== dependencies: - "@jest/test-result" "^29.4.2" + "@jest/test-result" "^29.4.3" graceful-fs "^4.2.9" - jest-haste-map "^29.4.2" + jest-haste-map "^29.4.3" slash "^3.0.0" -"@jest/transform@^29.4.2": - version "29.4.2" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.4.2.tgz#b24b72dbab4c8675433a80e222d6a8ef4656fb81" - integrity sha512-kf1v5iTJHn7p9RbOsBuc/lcwyPtJaZJt5885C98omWz79NIeD3PfoiiaPSu7JyCyFzNOIzKhmMhQLUhlTL9BvQ== +"@jest/transform@^29.4.3": + version "29.4.3" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.4.3.tgz#f7d17eac9cb5bb2e1222ea199c7c7e0835e0c037" + integrity sha512-8u0+fBGWolDshsFgPQJESkDa72da/EVwvL+II0trN2DR66wMwiQ9/CihaGfHdlLGFzbBZwMykFtxuwFdZqlKwg== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^29.4.2" + "@jest/types" "^29.4.3" "@jridgewell/trace-mapping" "^0.3.15" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^2.0.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.4.2" - jest-regex-util "^29.4.2" - jest-util "^29.4.2" + jest-haste-map "^29.4.3" + jest-regex-util "^29.4.3" + jest-util "^29.4.3" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" write-file-atomic "^4.0.2" -"@jest/types@^29.4.2": - version "29.4.2" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.4.2.tgz#8f724a414b1246b2bfd56ca5225d9e1f39540d82" - integrity sha512-CKlngyGP0fwlgC1BRUtPZSiWLBhyS9dKwKmyGxk8Z6M82LBEGB2aLQSg+U1MyLsU+M7UjnlLllBM2BLWKVm/Uw== +"@jest/types@^29.4.3": + version "29.4.3" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.4.3.tgz#9069145f4ef09adf10cec1b2901b2d390031431f" + integrity sha512-bPYfw8V65v17m2Od1cv44FH+SiKW7w2Xu7trhcdTLUmSv85rfKsP+qXSjO4KGJr4dtPSzl/gvslZBXctf1qGEA== dependencies: - "@jest/schemas" "^29.4.2" + "@jest/schemas" "^29.4.3" "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" "@types/node" "*" @@ -797,15 +797,15 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.4.2.tgz#b17b9f64be288040877cbe2649f91ac3b63b2ba6" - integrity sha512-vcghSqhtowXPG84posYkkkzcZsdayFkubUgbE3/1tuGbX7AQtwCkkNA/wIbB0BMjuCPoqTkiDyKN7Ty7d3uwNQ== +babel-jest@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.4.3.tgz#478b84d430972b277ad67dd631be94abea676792" + integrity sha512-o45Wyn32svZE+LnMVWv/Z4x0SwtLbh4FyGcYtR20kIWd+rdrDZ9Fzq8Ml3MYLD+mZvEdzCjZsCnYZ2jpJyQ+Nw== dependencies: - "@jest/transform" "^29.4.2" + "@jest/transform" "^29.4.3" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^29.4.2" + babel-preset-jest "^29.4.3" chalk "^4.0.0" graceful-fs "^4.2.9" slash "^3.0.0" @@ -821,10 +821,10 @@ babel-plugin-istanbul@^6.1.1: istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.4.2.tgz#22aa43e255230f02371ffef1cac7eedef58f60bc" - integrity sha512-5HZRCfMeWypFEonRbEkwWXtNS1sQK159LhRVyRuLzyfVBxDy/34Tr/rg4YVi0SScSJ4fqeaR/OIeceJ/LaQ0pQ== +babel-plugin-jest-hoist@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.4.3.tgz#ad1dfb5d31940957e00410ef7d9b2aa94b216101" + integrity sha512-mB6q2q3oahKphy5V7CpnNqZOCkxxZ9aokf1eh82Dy3jQmg4xvM1tGrh5y6BQUJh4a3Pj9+eLfwvAZ7VNKg7H8Q== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -849,12 +849,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.4.2.tgz#f0b20c6a79a9f155515e72a2d4f537fe002a4e38" - integrity sha512-ecWdaLY/8JyfUDr0oELBMpj3R5I1L6ZqG+kRJmwqfHtLWuPrJStR0LUkvUhfykJWTsXXMnohsayN/twltBbDrQ== +babel-preset-jest@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.4.3.tgz#bb926b66ae253b69c6e3ef87511b8bb5c53c5b52" + integrity sha512-gWx6COtSuma6n9bw+8/F+2PCXrIgxV/D1TJFnp6OyBK2cxPWg0K9p/sriNYeifKjpUkMViWQ09DSWtzJQRETsw== dependencies: - babel-plugin-jest-hoist "^29.4.2" + babel-plugin-jest-hoist "^29.4.3" babel-preset-current-node-syntax "^1.0.0" balanced-match@^1.0.0: @@ -1053,10 +1053,10 @@ detect-newline@^3.0.0: resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== -diff-sequences@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.4.2.tgz#711fe6bd8a5869fe2539cee4a5152425ff671fda" - integrity sha512-R6P0Y6PrsH3n4hUXxL3nns0rbRk6Q33js3ygJBeEpbzLzgcNuJ61+u0RXasFpTKISw99TxUzFnumSnRLsjhLaw== +diff-sequences@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.4.3.tgz#9314bc1fabe09267ffeca9cbafc457d8499a13f2" + integrity sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA== doctrine@^3.0.0: version "3.0.0" @@ -1262,16 +1262,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== -expect@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.4.2.tgz#2ae34eb88de797c64a1541ad0f1e2ea8a7a7b492" - integrity sha512-+JHYg9O3hd3RlICG90OPVjRkPBoiUH7PxvDVMnRiaq1g6JUgZStX514erMl0v2Dc5SkfVbm7ztqbd6qHHPn+mQ== +expect@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.4.3.tgz#5e47757316df744fe3b8926c3ae8a3ebdafff7fe" + integrity sha512-uC05+Q7eXECFpgDrHdXA4k2rpMyStAYPItEDLyQDo5Ta7fVkJnNA/4zh/OIVkVVNZ1oOK1PipQoyNjuZ6sz6Dg== dependencies: - "@jest/expect-utils" "^29.4.2" - jest-get-type "^29.4.2" - jest-matcher-utils "^29.4.2" - jest-message-util "^29.4.2" - jest-util "^29.4.2" + "@jest/expect-utils" "^29.4.3" + jest-get-type "^29.4.3" + jest-matcher-utils "^29.4.3" + jest-message-util "^29.4.3" + jest-util "^29.4.3" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1600,284 +1600,283 @@ istanbul-reports@^3.1.3: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.4.2.tgz#bee1fafc8b620d6251423d1978a0080546bc4376" - integrity sha512-Qdd+AXdqD16PQa+VsWJpxR3kN0JyOCX1iugQfx5nUgAsI4gwsKviXkpclxOK9ZnwaY2IQVHz+771eAvqeOlfuw== +jest-changed-files@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.4.3.tgz#7961fe32536b9b6d5c28dfa0abcfab31abcf50a7" + integrity sha512-Vn5cLuWuwmi2GNNbokPOEcvrXGSGrqVnPEZV7rC6P7ck07Dyw9RFnvWglnupSh+hGys0ajGtw/bc2ZgweljQoQ== dependencies: execa "^5.0.0" p-limit "^3.1.0" -jest-circus@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.4.2.tgz#2d00c04baefd0ee2a277014cd494d4b5970663ed" - integrity sha512-wW3ztp6a2P5c1yOc1Cfrt5ozJ7neWmqeXm/4SYiqcSriyisgq63bwFj1NuRdSR5iqS0CMEYwSZd89ZA47W9zUg== +jest-circus@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.4.3.tgz#fff7be1cf5f06224dd36a857d52a9efeb005ba04" + integrity sha512-Vw/bVvcexmdJ7MLmgdT3ZjkJ3LKu8IlpefYokxiqoZy6OCQ2VAm6Vk3t/qHiAGUXbdbJKJWnc8gH3ypTbB/OBw== dependencies: - "@jest/environment" "^29.4.2" - "@jest/expect" "^29.4.2" - "@jest/test-result" "^29.4.2" - "@jest/types" "^29.4.2" + "@jest/environment" "^29.4.3" + "@jest/expect" "^29.4.3" + "@jest/test-result" "^29.4.3" + "@jest/types" "^29.4.3" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" is-generator-fn "^2.0.0" - jest-each "^29.4.2" - jest-matcher-utils "^29.4.2" - jest-message-util "^29.4.2" - jest-runtime "^29.4.2" - jest-snapshot "^29.4.2" - jest-util "^29.4.2" + jest-each "^29.4.3" + jest-matcher-utils "^29.4.3" + jest-message-util "^29.4.3" + jest-runtime "^29.4.3" + jest-snapshot "^29.4.3" + jest-util "^29.4.3" p-limit "^3.1.0" - pretty-format "^29.4.2" + pretty-format "^29.4.3" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.4.2.tgz#94a2f913a0a7a49d11bee98ad88bf48baae941f4" - integrity sha512-b+eGUtXq/K2v7SH3QcJvFvaUaCDS1/YAZBYz0m28Q/Ppyr+1qNaHmVYikOrbHVbZqYQs2IeI3p76uy6BWbXq8Q== +jest-cli@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.4.3.tgz#fe31fdd0c90c765f392b8b7c97e4845071cd2163" + integrity sha512-PiiAPuFNfWWolCE6t3ZrDXQc6OsAuM3/tVW0u27UWc1KE+n/HSn5dSE6B2juqN7WP+PP0jAcnKtGmI4u8GMYCg== dependencies: - "@jest/core" "^29.4.2" - "@jest/test-result" "^29.4.2" - "@jest/types" "^29.4.2" + "@jest/core" "^29.4.3" + "@jest/test-result" "^29.4.3" + "@jest/types" "^29.4.3" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.4.2" - jest-util "^29.4.2" - jest-validate "^29.4.2" + jest-config "^29.4.3" + jest-util "^29.4.3" + jest-validate "^29.4.3" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.4.2.tgz#15386dd9ed2f7059516915515f786b8836a98f07" - integrity sha512-919CtnXic52YM0zW4C1QxjG6aNueX1kBGthuMtvFtRTAxhKfJmiXC9qwHmi6o2josjbDz8QlWyY55F1SIVmCWA== +jest-config@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.4.3.tgz#fca9cdfe6298ae6d04beef1624064d455347c978" + integrity sha512-eCIpqhGnIjdUCXGtLhz4gdDoxKSWXKjzNcc5r+0S1GKOp2fwOipx5mRcwa9GB/ArsxJ1jlj2lmlD9bZAsBxaWQ== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.4.2" - "@jest/types" "^29.4.2" - babel-jest "^29.4.2" + "@jest/test-sequencer" "^29.4.3" + "@jest/types" "^29.4.3" + babel-jest "^29.4.3" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^29.4.2" - jest-environment-node "^29.4.2" - jest-get-type "^29.4.2" - jest-regex-util "^29.4.2" - jest-resolve "^29.4.2" - jest-runner "^29.4.2" - jest-util "^29.4.2" - jest-validate "^29.4.2" + jest-circus "^29.4.3" + jest-environment-node "^29.4.3" + jest-get-type "^29.4.3" + jest-regex-util "^29.4.3" + jest-resolve "^29.4.3" + jest-runner "^29.4.3" + jest-util "^29.4.3" + jest-validate "^29.4.3" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^29.4.2" + pretty-format "^29.4.3" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.4.2.tgz#b88502d5dc02d97f6512d73c37da8b36f49b4871" - integrity sha512-EK8DSajVtnjx9sa1BkjZq3mqChm2Cd8rIzdXkQMA8e0wuXq53ypz6s5o5V8HRZkoEt2ywJ3eeNWFKWeYr8HK4g== +jest-diff@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.4.3.tgz#42f4eb34d0bf8c0fb08b0501069b87e8e84df347" + integrity sha512-YB+ocenx7FZ3T5O9lMVMeLYV4265socJKtkwgk/6YUz/VsEzYDkiMuMhWzZmxm3wDRQvayJu/PjkjjSkjoHsCA== dependencies: chalk "^4.0.0" - diff-sequences "^29.4.2" - jest-get-type "^29.4.2" - pretty-format "^29.4.2" + diff-sequences "^29.4.3" + jest-get-type "^29.4.3" + pretty-format "^29.4.3" -jest-docblock@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.4.2.tgz#c78a95eedf9a24c0a6cc16cf2abdc4b8b0f2531b" - integrity sha512-dV2JdahgClL34Y5vLrAHde3nF3yo2jKRH+GIYJuCpfqwEJZcikzeafVTGAjbOfKPG17ez9iWXwUYp7yefeCRag== +jest-docblock@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.4.3.tgz#90505aa89514a1c7dceeac1123df79e414636ea8" + integrity sha512-fzdTftThczeSD9nZ3fzA/4KkHtnmllawWrXO69vtI+L9WjEIuXWs4AmyME7lN5hU7dB0sHhuPfcKofRsUb/2Fg== dependencies: detect-newline "^3.0.0" -jest-each@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.4.2.tgz#e1347aff1303f4c35470827a62c029d389c5d44a" - integrity sha512-trvKZb0JYiCndc55V1Yh0Luqi7AsAdDWpV+mKT/5vkpnnFQfuQACV72IoRV161aAr6kAVIBpmYzwhBzm34vQkA== +jest-each@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.4.3.tgz#a434c199a2f6151c5e3dc80b2d54586bdaa72819" + integrity sha512-1ElHNAnKcbJb/b+L+7j0/w7bDvljw4gTv1wL9fYOczeJrbTbkMGQ5iQPFJ3eFQH19VPTx1IyfePdqSpePKss7Q== dependencies: - "@jest/types" "^29.4.2" + "@jest/types" "^29.4.3" chalk "^4.0.0" - jest-get-type "^29.4.2" - jest-util "^29.4.2" - pretty-format "^29.4.2" - -jest-environment-node@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.4.2.tgz#0eab835b41e25fd0c1a72f62665fc8db08762ad2" - integrity sha512-MLPrqUcOnNBc8zTOfqBbxtoa8/Ee8tZ7UFW7hRDQSUT+NGsvS96wlbHGTf+EFAT9KC3VNb7fWEM6oyvmxtE/9w== - dependencies: - "@jest/environment" "^29.4.2" - "@jest/fake-timers" "^29.4.2" - "@jest/types" "^29.4.2" + jest-get-type "^29.4.3" + jest-util "^29.4.3" + pretty-format "^29.4.3" + +jest-environment-node@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.4.3.tgz#579c4132af478befc1889ddc43c2413a9cdbe014" + integrity sha512-gAiEnSKF104fsGDXNkwk49jD/0N0Bqu2K9+aMQXA6avzsA9H3Fiv1PW2D+gzbOSR705bWd2wJZRFEFpV0tXISg== + dependencies: + "@jest/environment" "^29.4.3" + "@jest/fake-timers" "^29.4.3" + "@jest/types" "^29.4.3" "@types/node" "*" - jest-mock "^29.4.2" - jest-util "^29.4.2" + jest-mock "^29.4.3" + jest-util "^29.4.3" -jest-get-type@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.4.2.tgz#7cb63f154bca8d8f57364d01614477d466fa43fe" - integrity sha512-vERN30V5i2N6lqlFu4ljdTqQAgrkTFMC9xaIIfOPYBw04pufjXRty5RuXBiB1d72tGbURa/UgoiHB90ruOSivg== +jest-get-type@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.4.3.tgz#1ab7a5207c995161100b5187159ca82dd48b3dd5" + integrity sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg== -jest-haste-map@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.4.2.tgz#9112df3f5121e643f1b2dcbaa86ab11b0b90b49a" - integrity sha512-WkUgo26LN5UHPknkezrBzr7lUtV1OpGsp+NfXbBwHztsFruS3gz+AMTTBcEklvi8uPzpISzYjdKXYZQJXBnfvw== +jest-haste-map@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.4.3.tgz#085a44283269e7ace0645c63a57af0d2af6942e2" + integrity sha512-eZIgAS8tvm5IZMtKlR8Y+feEOMfo2pSQkmNbufdbMzMSn9nitgGxF1waM/+LbryO3OkMcKS98SUb+j/cQxp/vQ== dependencies: - "@jest/types" "^29.4.2" + "@jest/types" "^29.4.3" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" - jest-regex-util "^29.4.2" - jest-util "^29.4.2" - jest-worker "^29.4.2" + jest-regex-util "^29.4.3" + jest-util "^29.4.3" + jest-worker "^29.4.3" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.4.2.tgz#8f05c6680e0cb46a1d577c0d3da9793bed3ea97b" - integrity sha512-Wa62HuRJmWXtX9F00nUpWlrbaH5axeYCdyRsOs/+Rb1Vb6+qWTlB5rKwCCRKtorM7owNwKsyJ8NRDUcZ8ghYUA== +jest-leak-detector@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.4.3.tgz#2b35191d6b35aa0256e63a9b79b0f949249cf23a" + integrity sha512-9yw4VC1v2NspMMeV3daQ1yXPNxMgCzwq9BocCwYrRgXe4uaEJPAN0ZK37nFBhcy3cUwEVstFecFLaTHpF7NiGA== dependencies: - jest-get-type "^29.4.2" - pretty-format "^29.4.2" + jest-get-type "^29.4.3" + pretty-format "^29.4.3" -jest-matcher-utils@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.4.2.tgz#08d0bf5abf242e3834bec92c7ef5071732839e85" - integrity sha512-EZaAQy2je6Uqkrm6frnxBIdaWtSYFoR8SVb2sNLAtldswlR/29JAgx+hy67llT3+hXBaLB0zAm5UfeqerioZyg== +jest-matcher-utils@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.4.3.tgz#ea68ebc0568aebea4c4213b99f169ff786df96a0" + integrity sha512-TTciiXEONycZ03h6R6pYiZlSkvYgT0l8aa49z/DLSGYjex4orMUcafuLXYyyEDWB1RKglq00jzwY00Ei7yFNVg== dependencies: chalk "^4.0.0" - jest-diff "^29.4.2" - jest-get-type "^29.4.2" - pretty-format "^29.4.2" + jest-diff "^29.4.3" + jest-get-type "^29.4.3" + pretty-format "^29.4.3" -jest-message-util@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.4.2.tgz#309a2924eae6ca67cf7f25781a2af1902deee717" - integrity sha512-SElcuN4s6PNKpOEtTInjOAA8QvItu0iugkXqhYyguRvQoXapg5gN+9RQxLAkakChZA7Y26j6yUCsFWN+hlKD6g== +jest-message-util@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.4.3.tgz#65b5280c0fdc9419503b49d4f48d4999d481cb5b" + integrity sha512-1Y8Zd4ZCN7o/QnWdMmT76If8LuDv23Z1DRovBj/vcSFNlGCJGoO8D1nJDw1AdyAGUk0myDLFGN5RbNeJyCRGCw== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.4.2" + "@jest/types" "^29.4.3" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^29.4.2" + pretty-format "^29.4.3" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.4.2.tgz#e1054be66fb3e975d26d4528fcde6979e4759de8" - integrity sha512-x1FSd4Gvx2yIahdaIKoBjwji6XpboDunSJ95RpntGrYulI1ByuYQCKN/P7hvk09JB74IonU3IPLdkutEWYt++g== +jest-mock@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.4.3.tgz#23d84a20a74cdfff0510fdbeefb841ed57b0fe7e" + integrity sha512-LjFgMg+xed9BdkPMyIJh+r3KeHt1klXPJYBULXVVAkbTaaKjPX1o1uVCAZADMEp/kOxGTwy/Ot8XbvgItOrHEg== dependencies: - "@jest/types" "^29.4.2" + "@jest/types" "^29.4.3" "@types/node" "*" - jest-util "^29.4.2" + jest-util "^29.4.3" jest-pnp-resolver@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz#930b1546164d4ad5937d5540e711d4d38d4cad2e" integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== -jest-regex-util@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.4.2.tgz#19187cca35d301f8126cf7a021dd4dcb7b58a1ca" - integrity sha512-XYZXOqUl1y31H6VLMrrUL1ZhXuiymLKPz0BO1kEeR5xER9Tv86RZrjTm74g5l9bPJQXA/hyLdaVPN/sdqfteig== +jest-regex-util@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.4.3.tgz#a42616141e0cae052cfa32c169945d00c0aa0bb8" + integrity sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg== -jest-resolve-dependencies@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.4.2.tgz#6359db606f5967b68ca8bbe9dbc07a4306c12bf7" - integrity sha512-6pL4ptFw62rjdrPk7rRpzJYgcRqRZNsZTF1VxVTZMishbO6ObyWvX57yHOaNGgKoADtAHRFYdHQUEvYMJATbDg== +jest-resolve-dependencies@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.4.3.tgz#9ad7f23839a6d88cef91416bda9393a6e9fd1da5" + integrity sha512-uvKMZAQ3nmXLH7O8WAOhS5l0iWyT3WmnJBdmIHiV5tBbdaDZ1wqtNX04FONGoaFvSOSHBJxnwAVnSn1WHdGVaw== dependencies: - jest-regex-util "^29.4.2" - jest-snapshot "^29.4.2" + jest-regex-util "^29.4.3" + jest-snapshot "^29.4.3" -jest-resolve@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.4.2.tgz#8831f449671d08d161fe493003f61dc9b55b808e" - integrity sha512-RtKWW0mbR3I4UdkOrW7552IFGLYQ5AF9YrzD0FnIOkDu0rAMlA5/Y1+r7lhCAP4nXSBTaE7ueeqj6IOwZpgoqw== +jest-resolve@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.4.3.tgz#3c5b5c984fa8a763edf9b3639700e1c7900538e2" + integrity sha512-GPokE1tzguRyT7dkxBim4wSx6E45S3bOQ7ZdKEG+Qj0Oac9+6AwJPCk0TZh5Vu0xzeX4afpb+eDmgbmZFFwpOw== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^29.4.2" + jest-haste-map "^29.4.3" jest-pnp-resolver "^1.2.2" - jest-util "^29.4.2" - jest-validate "^29.4.2" + jest-util "^29.4.3" + jest-validate "^29.4.3" resolve "^1.20.0" resolve.exports "^2.0.0" slash "^3.0.0" -jest-runner@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.4.2.tgz#2bcecf72303369df4ef1e6e983c22a89870d5125" - integrity sha512-wqwt0drm7JGjwdH+x1XgAl+TFPH7poowMguPQINYxaukCqlczAcNLJiK+OLxUxQAEWMdy+e6nHZlFHO5s7EuRg== +jest-runner@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.4.3.tgz#68dc82c68645eda12bea42b5beece6527d7c1e5e" + integrity sha512-GWPTEiGmtHZv1KKeWlTX9SIFuK19uLXlRQU43ceOQ2hIfA5yPEJC7AMkvFKpdCHx6pNEdOD+2+8zbniEi3v3gA== dependencies: - "@jest/console" "^29.4.2" - "@jest/environment" "^29.4.2" - "@jest/test-result" "^29.4.2" - "@jest/transform" "^29.4.2" - "@jest/types" "^29.4.2" + "@jest/console" "^29.4.3" + "@jest/environment" "^29.4.3" + "@jest/test-result" "^29.4.3" + "@jest/transform" "^29.4.3" + "@jest/types" "^29.4.3" "@types/node" "*" chalk "^4.0.0" emittery "^0.13.1" graceful-fs "^4.2.9" - jest-docblock "^29.4.2" - jest-environment-node "^29.4.2" - jest-haste-map "^29.4.2" - jest-leak-detector "^29.4.2" - jest-message-util "^29.4.2" - jest-resolve "^29.4.2" - jest-runtime "^29.4.2" - jest-util "^29.4.2" - jest-watcher "^29.4.2" - jest-worker "^29.4.2" + jest-docblock "^29.4.3" + jest-environment-node "^29.4.3" + jest-haste-map "^29.4.3" + jest-leak-detector "^29.4.3" + jest-message-util "^29.4.3" + jest-resolve "^29.4.3" + jest-runtime "^29.4.3" + jest-util "^29.4.3" + jest-watcher "^29.4.3" + jest-worker "^29.4.3" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.4.2.tgz#d86b764c5b95d76cb26ed1f32644e99de5d5c134" - integrity sha512-3fque9vtpLzGuxT9eZqhxi+9EylKK/ESfhClv4P7Y9sqJPs58LjVhTt8jaMp/pRO38agll1CkSu9z9ieTQeRrw== - dependencies: - "@jest/environment" "^29.4.2" - "@jest/fake-timers" "^29.4.2" - "@jest/globals" "^29.4.2" - "@jest/source-map" "^29.4.2" - "@jest/test-result" "^29.4.2" - "@jest/transform" "^29.4.2" - "@jest/types" "^29.4.2" +jest-runtime@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.4.3.tgz#f25db9874dcf35a3ab27fdaabca426666cc745bf" + integrity sha512-F5bHvxSH+LvLV24vVB3L8K467dt3y3dio6V3W89dUz9nzvTpqd/HcT9zfYKL2aZPvD63vQFgLvaUX/UpUhrP6Q== + dependencies: + "@jest/environment" "^29.4.3" + "@jest/fake-timers" "^29.4.3" + "@jest/globals" "^29.4.3" + "@jest/source-map" "^29.4.3" + "@jest/test-result" "^29.4.3" + "@jest/transform" "^29.4.3" + "@jest/types" "^29.4.3" "@types/node" "*" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^29.4.2" - jest-message-util "^29.4.2" - jest-mock "^29.4.2" - jest-regex-util "^29.4.2" - jest-resolve "^29.4.2" - jest-snapshot "^29.4.2" - jest-util "^29.4.2" - semver "^7.3.5" + jest-haste-map "^29.4.3" + jest-message-util "^29.4.3" + jest-mock "^29.4.3" + jest-regex-util "^29.4.3" + jest-resolve "^29.4.3" + jest-snapshot "^29.4.3" + jest-util "^29.4.3" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.4.2.tgz#ba1fb9abb279fd2c85109ff1757bc56b503bbb3a" - integrity sha512-PdfubrSNN5KwroyMH158R23tWcAXJyx4pvSvWls1dHoLCaUhGul9rsL3uVjtqzRpkxlkMavQjGuWG1newPgmkw== +jest-snapshot@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.4.3.tgz#183d309371450d9c4a3de7567ed2151eb0e91145" + integrity sha512-NGlsqL0jLPDW91dz304QTM/SNO99lpcSYYAjNiX0Ou+sSGgkanKBcSjCfp/pqmiiO1nQaOyLp6XQddAzRcx3Xw== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" @@ -1885,82 +1884,82 @@ jest-snapshot@^29.4.2: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.4.2" - "@jest/transform" "^29.4.2" - "@jest/types" "^29.4.2" + "@jest/expect-utils" "^29.4.3" + "@jest/transform" "^29.4.3" + "@jest/types" "^29.4.3" "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.4.2" + expect "^29.4.3" graceful-fs "^4.2.9" - jest-diff "^29.4.2" - jest-get-type "^29.4.2" - jest-haste-map "^29.4.2" - jest-matcher-utils "^29.4.2" - jest-message-util "^29.4.2" - jest-util "^29.4.2" + jest-diff "^29.4.3" + jest-get-type "^29.4.3" + jest-haste-map "^29.4.3" + jest-matcher-utils "^29.4.3" + jest-message-util "^29.4.3" + jest-util "^29.4.3" natural-compare "^1.4.0" - pretty-format "^29.4.2" + pretty-format "^29.4.3" semver "^7.3.5" -jest-util@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.4.2.tgz#3db8580b295df453a97de4a1b42dd2578dabd2c2" - integrity sha512-wKnm6XpJgzMUSRFB7YF48CuwdzuDIHenVuoIb1PLuJ6F+uErZsuDkU+EiExkChf6473XcawBrSfDSnXl+/YG4g== +jest-util@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.4.3.tgz#851a148e23fc2b633c55f6dad2e45d7f4579f496" + integrity sha512-ToSGORAz4SSSoqxDSylWX8JzkOQR7zoBtNRsA7e+1WUX5F8jrOwaNpuh1YfJHJKDHXLHmObv5eOjejUd+/Ws+Q== dependencies: - "@jest/types" "^29.4.2" + "@jest/types" "^29.4.3" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.4.2.tgz#3b3f8c4910ab9a3442d2512e2175df6b3f77b915" - integrity sha512-tto7YKGPJyFbhcKhIDFq8B5od+eVWD/ySZ9Tvcp/NGCvYA4RQbuzhbwYWtIjMT5W5zA2W0eBJwu4HVw34d5G6Q== +jest-validate@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.4.3.tgz#a13849dec4f9e95446a7080ad5758f58fa88642f" + integrity sha512-J3u5v7aPQoXPzaar6GndAVhdQcZr/3osWSgTeKg5v574I9ybX/dTyH0AJFb5XgXIB7faVhf+rS7t4p3lL9qFaw== dependencies: - "@jest/types" "^29.4.2" + "@jest/types" "^29.4.3" camelcase "^6.2.0" chalk "^4.0.0" - jest-get-type "^29.4.2" + jest-get-type "^29.4.3" leven "^3.1.0" - pretty-format "^29.4.2" + pretty-format "^29.4.3" -jest-watcher@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.4.2.tgz#09c0f4c9a9c7c0807fcefb1445b821c6f7953b7c" - integrity sha512-onddLujSoGiMJt+tKutehIidABa175i/Ays+QvKxCqBwp7fvxP3ZhKsrIdOodt71dKxqk4sc0LN41mWLGIK44w== +jest-watcher@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.4.3.tgz#e503baa774f0c2f8f3c8db98a22ebf885f19c384" + integrity sha512-zwlXH3DN3iksoIZNk73etl1HzKyi5FuQdYLnkQKm5BW4n8HpoG59xSwpVdFrnh60iRRaRBGw0gcymIxjJENPcA== dependencies: - "@jest/test-result" "^29.4.2" - "@jest/types" "^29.4.2" + "@jest/test-result" "^29.4.3" + "@jest/types" "^29.4.3" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.13.1" - jest-util "^29.4.2" + jest-util "^29.4.3" string-length "^4.0.1" -jest-worker@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.4.2.tgz#d9b2c3bafc69311d84d94e7fb45677fc8976296f" - integrity sha512-VIuZA2hZmFyRbchsUCHEehoSf2HEl0YVF8SDJqtPnKorAaBuh42V8QsLnde0XP5F6TyCynGPEGgBOn3Fc+wZGw== +jest-worker@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.4.3.tgz#9a4023e1ea1d306034237c7133d7da4240e8934e" + integrity sha512-GLHN/GTAAMEy5BFdvpUfzr9Dr80zQqBrh0fz1mtRMe05hqP45+HfQltu7oTBfduD0UeZs09d+maFtFYAXFWvAA== dependencies: "@types/node" "*" - jest-util "^29.4.2" + jest-util "^29.4.3" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^29.4.1: - version "29.4.2" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.4.2.tgz#4c2127d03a71dc187f386156ef155dbf323fb7be" - integrity sha512-+5hLd260vNIHu+7ZgMIooSpKl7Jp5pHKb51e73AJU3owd5dEo/RfVwHbA/na3C/eozrt3hJOLGf96c7EWwIAzg== + version "29.4.3" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.4.3.tgz#1b8be541666c6feb99990fd98adac4737e6e6386" + integrity sha512-XvK65feuEFGZT8OO0fB/QAQS+LGHvQpaadkH5p47/j3Ocqq3xf2pK9R+G0GzgfuhXVxEv76qCOOcMb5efLk6PA== dependencies: - "@jest/core" "^29.4.2" - "@jest/types" "^29.4.2" + "@jest/core" "^29.4.3" + "@jest/types" "^29.4.3" import-local "^3.0.2" - jest-cli "^29.4.2" + jest-cli "^29.4.3" js-sdsl@^4.1.4: version "4.3.0" @@ -2283,12 +2282,12 @@ prettier@>=3.0.0-alpha.2: resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0-alpha.4.tgz#eee71d6b520b970f44e4045f2dc772bf6f80815f" integrity sha512-+KeqJv4E5kaRsDRgSx9IeVygLKGHRmcoPvRJvPFp3bC1mw8opsva555gGb8TaJzUiHXoLZcus1EX+nlHPda7Pw== -pretty-format@^29.4.2: - version "29.4.2" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.4.2.tgz#64bf5ccc0d718c03027d94ac957bdd32b3fb2401" - integrity sha512-qKlHR8yFVCbcEWba0H0TOC8dnLlO4vPlyEjRPw31FZ2Rupy9nLa8ZLbYny8gWEl8CkEhJqAE6IzdNELTBVcBEg== +pretty-format@^29.4.3: + version "29.4.3" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.4.3.tgz#25500ada21a53c9e8423205cf0337056b201244c" + integrity sha512-cvpcHTc42lcsvOOAzd3XuNWTcvk1Jmnzqeu+WsOuiPmxUJTnkbAcFNsRKvEpBEUFVUgy/GTZLulZDcDEi+CIlA== dependencies: - "@jest/schemas" "^29.4.2" + "@jest/schemas" "^29.4.3" ansi-styles "^5.0.0" react-is "^18.0.0" From 00615f56f1a58fa75c1e0fa247e2083a5a829656 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 7 Mar 2023 10:18:19 -0500 Subject: [PATCH 693/785] Bump deps --- package.json | 8 +- yarn.lock | 884 ++++++++++++++++++++++++++------------------------- 2 files changed, 452 insertions(+), 440 deletions(-) diff --git a/package.json b/package.json index 17ac6d29..8da5b9a6 100644 --- a/package.json +++ b/package.json @@ -20,13 +20,13 @@ }, "homepage": "https://github.com/prettier/plugin-ruby#readme", "dependencies": { - "prettier": ">=3.0.0-alpha.2" + "prettier": ">=3.0.0-alpha.6" }, "devDependencies": { - "eslint": "^8.32.0", - "eslint-config-prettier": "^8.0.0", + "eslint": "^8.35.0", + "eslint-config-prettier": "^8.7.0", "husky": "^8.0.1", - "jest": "^29.4.1", + "jest": "^29.5.0", "pretty-quick": "^3.1.2" }, "eslintConfig": { diff --git a/yarn.lock b/yarn.lock index 1280c554..188d364e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,7 +2,7 @@ # yarn lockfile v1 -"@ampproject/remapping@^2.1.0": +"@ampproject/remapping@^2.2.0": version "2.2.0" resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.0.tgz#56c133824780de3174aed5ab6834f3026790154d" integrity sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w== @@ -18,38 +18,39 @@ "@babel/highlight" "^7.18.6" "@babel/compat-data@^7.20.5": - version "7.20.10" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.20.10.tgz#9d92fa81b87542fff50e848ed585b4212c1d34ec" - integrity sha512-sEnuDPpOJR/fcafHMjpcpGN5M2jbUGUHwmuWKM/YdPzeEDJg8bgmbcWQFUfE32MQjti1koACvoPVsDe8Uq+idg== + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.21.0.tgz#c241dc454e5b5917e40d37e525e2f4530c399298" + integrity sha512-gMuZsmsgxk/ENC3O/fRw5QY8A9/uxQbbCEypnLIiYYc/qVJtEV7ouxC3EllIIwNzMqAQee5tanFabWsUOutS7g== "@babel/core@^7.11.6", "@babel/core@^7.12.3": - version "7.20.12" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.20.12.tgz#7930db57443c6714ad216953d1356dac0eb8496d" - integrity sha512-XsMfHovsUYHFMdrIHkZphTN/2Hzzi78R08NuHfDBehym2VsPDL6Zn/JAD/JQdnRvbSsbQc4mVaU1m6JgtTEElg== + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.21.0.tgz#1341aefdcc14ccc7553fcc688dd8986a2daffc13" + integrity sha512-PuxUbxcW6ZYe656yL3EAhpy7qXKq0DmYsrJLpbB8XrsCP9Nm+XCg9XFMb5vIDliPD7+U/+M+QJlH17XOcB7eXA== dependencies: - "@ampproject/remapping" "^2.1.0" + "@ampproject/remapping" "^2.2.0" "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.20.7" + "@babel/generator" "^7.21.0" "@babel/helper-compilation-targets" "^7.20.7" - "@babel/helper-module-transforms" "^7.20.11" - "@babel/helpers" "^7.20.7" - "@babel/parser" "^7.20.7" + "@babel/helper-module-transforms" "^7.21.0" + "@babel/helpers" "^7.21.0" + "@babel/parser" "^7.21.0" "@babel/template" "^7.20.7" - "@babel/traverse" "^7.20.12" - "@babel/types" "^7.20.7" + "@babel/traverse" "^7.21.0" + "@babel/types" "^7.21.0" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.2" semver "^6.3.0" -"@babel/generator@^7.20.7", "@babel/generator@^7.7.2": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.7.tgz#f8ef57c8242665c5929fe2e8d82ba75460187b4a" - integrity sha512-7wqMOJq8doJMZmP4ApXTzLxSr7+oO2jroJURrVEp6XShrQUObV8Tq/D0NCcoYg2uHqUrjzO0zwBjoYzelxK+sw== +"@babel/generator@^7.21.0", "@babel/generator@^7.21.1", "@babel/generator@^7.7.2": + version "7.21.1" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.21.1.tgz#951cc626057bc0af2c35cd23e9c64d384dea83dd" + integrity sha512-1lT45bAYlQhFn/BHivJs43AiW2rg3/UbLyShGfF3C0KmHvO5fSghWd5kBJy30kpRRucGzXStvnnCFniCR2kXAA== dependencies: - "@babel/types" "^7.20.7" + "@babel/types" "^7.21.0" "@jridgewell/gen-mapping" "^0.3.2" + "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" "@babel/helper-compilation-targets@^7.20.7": @@ -68,13 +69,13 @@ resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be" integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg== -"@babel/helper-function-name@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz#941574ed5390682e872e52d3f38ce9d1bef4648c" - integrity sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w== +"@babel/helper-function-name@^7.21.0": + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz#d552829b10ea9f120969304023cd0645fa00b1b4" + integrity sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg== dependencies: - "@babel/template" "^7.18.10" - "@babel/types" "^7.19.0" + "@babel/template" "^7.20.7" + "@babel/types" "^7.21.0" "@babel/helper-hoist-variables@^7.18.6": version "7.18.6" @@ -90,10 +91,10 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-module-transforms@^7.20.11": - version "7.20.11" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.20.11.tgz#df4c7af713c557938c50ea3ad0117a7944b2f1b0" - integrity sha512-uRy78kN4psmji1s2QtbtcCSaj/LILFDp0f/ymhpQH5QY3nljUZCaNWz9X1dEj/8MBdBEFECs7yRhKn8i7NjZgg== +"@babel/helper-module-transforms@^7.21.0": + version "7.21.2" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.21.2.tgz#160caafa4978ac8c00ac66636cb0fa37b024e2d2" + integrity sha512-79yj2AR4U/Oqq/WOV7Lx6hUjau1Zfo4cI+JLAVYeMV5XIlbOhmjEk5ulbTc9fMpmlojzZHkUUxAiK+UKn+hNQQ== dependencies: "@babel/helper-environment-visitor" "^7.18.9" "@babel/helper-module-imports" "^7.18.6" @@ -101,8 +102,8 @@ "@babel/helper-split-export-declaration" "^7.18.6" "@babel/helper-validator-identifier" "^7.19.1" "@babel/template" "^7.20.7" - "@babel/traverse" "^7.20.10" - "@babel/types" "^7.20.7" + "@babel/traverse" "^7.21.2" + "@babel/types" "^7.21.2" "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.8.0": version "7.20.2" @@ -134,18 +135,18 @@ integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== "@babel/helper-validator-option@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz#bf0d2b5a509b1f336099e4ff36e1a63aa5db4db8" - integrity sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw== + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz#8224c7e13ace4bafdc4004da2cf064ef42673180" + integrity sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ== -"@babel/helpers@^7.20.7": - version "7.20.13" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.20.13.tgz#e3cb731fb70dc5337134cadc24cbbad31cc87ad2" - integrity sha512-nzJ0DWCL3gB5RCXbUO3KIMMsBY2Eqbx8mBpKGE/02PgyRQFcPQLbkQ1vyy596mZLaP+dAfD+R4ckASzNVmW3jg== +"@babel/helpers@^7.21.0": + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.21.0.tgz#9dd184fb5599862037917cdc9eecb84577dc4e7e" + integrity sha512-XXve0CBtOW0pd7MRzzmoyuSj0e3SEzj8pgyFxnTT1NJZL38BD1MK7yYrm8yefRPIDvNNe14xR4FdbHwpInD4rA== dependencies: "@babel/template" "^7.20.7" - "@babel/traverse" "^7.20.13" - "@babel/types" "^7.20.7" + "@babel/traverse" "^7.21.0" + "@babel/types" "^7.21.0" "@babel/highlight@^7.18.6": version "7.18.6" @@ -156,10 +157,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.13", "@babel/parser@^7.20.7": - version "7.20.13" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.13.tgz#ddf1eb5a813588d2fb1692b70c6fce75b945c088" - integrity sha512-gFDLKMfpiXCsjt4za2JA9oTMn70CeseCehb11kRZgvd7+F67Hih3OHOK24cRrWECJ/ljfPGac6ygXAs/C8kIvw== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.21.0", "@babel/parser@^7.21.2": + version "7.21.2" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.2.tgz#dacafadfc6d7654c3051a66d6fe55b6cb2f2a0b3" + integrity sha512-URpaIJQwEkEC2T9Kn+Ai6Xe/02iNaVCuT/PtoRz3GPVJVDpPd7mLo+VddTbhCRU9TXqW5mSrQfXZyi8kDKOVpQ== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -259,7 +260,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.19.0" -"@babel/template@^7.18.10", "@babel/template@^7.20.7", "@babel/template@^7.3.3": +"@babel/template@^7.20.7", "@babel/template@^7.3.3": version "7.20.7" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.20.7.tgz#a15090c2839a83b02aa996c0b4994005841fd5a8" integrity sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw== @@ -268,26 +269,26 @@ "@babel/parser" "^7.20.7" "@babel/types" "^7.20.7" -"@babel/traverse@^7.20.10", "@babel/traverse@^7.20.12", "@babel/traverse@^7.20.13", "@babel/traverse@^7.7.2": - version "7.20.13" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.13.tgz#817c1ba13d11accca89478bd5481b2d168d07473" - integrity sha512-kMJXfF0T6DIS9E8cgdLCSAL+cuCK+YEZHWiLK0SXpTo8YRj5lpJu3CDNKiIBCne4m9hhTIqUg6SYTAI39tAiVQ== +"@babel/traverse@^7.21.0", "@babel/traverse@^7.21.2", "@babel/traverse@^7.7.2": + version "7.21.2" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.21.2.tgz#ac7e1f27658750892e815e60ae90f382a46d8e75" + integrity sha512-ts5FFU/dSUPS13tv8XiEObDu9K+iagEKME9kAbaP7r0Y9KtZJZ+NGndDvWoRAYNpeWafbpFeki3q9QoMD6gxyw== dependencies: "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.20.7" + "@babel/generator" "^7.21.1" "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.19.0" + "@babel/helper-function-name" "^7.21.0" "@babel/helper-hoist-variables" "^7.18.6" "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.20.13" - "@babel/types" "^7.20.7" + "@babel/parser" "^7.21.2" + "@babel/types" "^7.21.2" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.18.6", "@babel/types@^7.19.0", "@babel/types@^7.20.2", "@babel/types@^7.20.7", "@babel/types@^7.3.0", "@babel/types@^7.3.3": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.7.tgz#54ec75e252318423fc07fb644dc6a58a64c09b7f" - integrity sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg== +"@babel/types@^7.0.0", "@babel/types@^7.18.6", "@babel/types@^7.20.2", "@babel/types@^7.20.7", "@babel/types@^7.21.0", "@babel/types@^7.21.2", "@babel/types@^7.3.0", "@babel/types@^7.3.3": + version "7.21.2" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.21.2.tgz#92246f6e00f91755893c2876ad653db70c8310d1" + integrity sha512-3wRZSs7jiFaB8AjxiiD+VqN5DTG2iRvJGQ+qYFrs/654lg6kGTQWIOFjlBo5RaXuAZjBmP3+OQH4dmhqiiyYxw== dependencies: "@babel/helper-string-parser" "^7.19.4" "@babel/helper-validator-identifier" "^7.19.1" @@ -298,10 +299,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@eslint/eslintrc@^1.4.1": - version "1.4.1" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.4.1.tgz#af58772019a2d271b7e2d4c23ff4ddcba3ccfb3e" - integrity sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA== +"@eslint/eslintrc@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.0.0.tgz#943309d8697c52fc82c076e90c1c74fbbe69dbff" + integrity sha512-fluIaaV+GyV24CCu/ggiHdV+j4RNh85yQnAYS/G2mZODZgGmmlrgCydjUcV3YvxCm9x8nMAfThsqTni4KiXT4A== dependencies: ajv "^6.12.4" debug "^4.3.2" @@ -313,6 +314,11 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" +"@eslint/js@8.35.0": + version "8.35.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.35.0.tgz#b7569632b0b788a0ca0e438235154e45d42813a7" + integrity sha512-JXdzbRiWclLVoD8sNUjR443VVlYqiYmDVT6rGUEIEHU5YJW0gaVZwV2xgM7D4arkvASqD0IlLUVjHiFuxaftRw== + "@humanwhocodes/config-array@^0.11.8": version "0.11.8" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.8.tgz#03595ac2075a4dc0f191cc2131de14fbd7d410b9" @@ -348,109 +354,109 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^29.4.3": - version "29.4.3" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.4.3.tgz#1f25a99f7f860e4c46423b5b1038262466fadde1" - integrity sha512-W/o/34+wQuXlgqlPYTansOSiBnuxrTv61dEVkA6HNmpcgHLUjfaUbdqt6oVvOzaawwo9IdW9QOtMgQ1ScSZC4A== +"@jest/console@^29.5.0": + version "29.5.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.5.0.tgz#593a6c5c0d3f75689835f1b3b4688c4f8544cb57" + integrity sha512-NEpkObxPwyw/XxZVLPmAGKE89IQRp4puc6IQRPru6JKd1M3fW9v1xM1AnzIJE65hbCkzQAdnL8P47e9hzhiYLQ== dependencies: - "@jest/types" "^29.4.3" + "@jest/types" "^29.5.0" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^29.4.3" - jest-util "^29.4.3" + jest-message-util "^29.5.0" + jest-util "^29.5.0" slash "^3.0.0" -"@jest/core@^29.4.3": - version "29.4.3" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.4.3.tgz#829dd65bffdb490de5b0f69e97de8e3b5eadd94b" - integrity sha512-56QvBq60fS4SPZCuM7T+7scNrkGIe7Mr6PVIXUpu48ouvRaWOFqRPV91eifvFM0ay2HmfswXiGf97NGUN5KofQ== - dependencies: - "@jest/console" "^29.4.3" - "@jest/reporters" "^29.4.3" - "@jest/test-result" "^29.4.3" - "@jest/transform" "^29.4.3" - "@jest/types" "^29.4.3" +"@jest/core@^29.5.0": + version "29.5.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.5.0.tgz#76674b96904484e8214614d17261cc491e5f1f03" + integrity sha512-28UzQc7ulUrOQw1IsN/kv1QES3q2kkbl/wGslyhAclqZ/8cMdB5M68BffkIdSJgKBUt50d3hbwJ92XESlE7LiQ== + dependencies: + "@jest/console" "^29.5.0" + "@jest/reporters" "^29.5.0" + "@jest/test-result" "^29.5.0" + "@jest/transform" "^29.5.0" + "@jest/types" "^29.5.0" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" ci-info "^3.2.0" exit "^0.1.2" graceful-fs "^4.2.9" - jest-changed-files "^29.4.3" - jest-config "^29.4.3" - jest-haste-map "^29.4.3" - jest-message-util "^29.4.3" + jest-changed-files "^29.5.0" + jest-config "^29.5.0" + jest-haste-map "^29.5.0" + jest-message-util "^29.5.0" jest-regex-util "^29.4.3" - jest-resolve "^29.4.3" - jest-resolve-dependencies "^29.4.3" - jest-runner "^29.4.3" - jest-runtime "^29.4.3" - jest-snapshot "^29.4.3" - jest-util "^29.4.3" - jest-validate "^29.4.3" - jest-watcher "^29.4.3" + jest-resolve "^29.5.0" + jest-resolve-dependencies "^29.5.0" + jest-runner "^29.5.0" + jest-runtime "^29.5.0" + jest-snapshot "^29.5.0" + jest-util "^29.5.0" + jest-validate "^29.5.0" + jest-watcher "^29.5.0" micromatch "^4.0.4" - pretty-format "^29.4.3" + pretty-format "^29.5.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.4.3": - version "29.4.3" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.4.3.tgz#9fe2f3169c3b33815dc4bd3960a064a83eba6548" - integrity sha512-dq5S6408IxIa+lr54zeqce+QgI+CJT4nmmA+1yzFgtcsGK8c/EyiUb9XQOgz3BMKrRDfKseeOaxj2eO8LlD3lA== +"@jest/environment@^29.5.0": + version "29.5.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.5.0.tgz#9152d56317c1fdb1af389c46640ba74ef0bb4c65" + integrity sha512-5FXw2+wD29YU1d4I2htpRX7jYnAyTRjP2CsXQdo9SAM8g3ifxWPSV0HnClSn71xwctr0U3oZIIH+dtbfmnbXVQ== dependencies: - "@jest/fake-timers" "^29.4.3" - "@jest/types" "^29.4.3" + "@jest/fake-timers" "^29.5.0" + "@jest/types" "^29.5.0" "@types/node" "*" - jest-mock "^29.4.3" + jest-mock "^29.5.0" -"@jest/expect-utils@^29.4.3": - version "29.4.3" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.4.3.tgz#95ce4df62952f071bcd618225ac7c47eaa81431e" - integrity sha512-/6JWbkxHOP8EoS8jeeTd9dTfc9Uawi+43oLKHfp6zzux3U2hqOOVnV3ai4RpDYHOccL6g+5nrxpoc8DmJxtXVQ== +"@jest/expect-utils@^29.5.0": + version "29.5.0" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.5.0.tgz#f74fad6b6e20f924582dc8ecbf2cb800fe43a036" + integrity sha512-fmKzsidoXQT2KwnrwE0SQq3uj8Z763vzR8LnLBwC2qYWEFpjX8daRsk6rHUM1QvNlEW/UJXNXm59ztmJJWs2Mg== dependencies: jest-get-type "^29.4.3" -"@jest/expect@^29.4.3": - version "29.4.3" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.4.3.tgz#d31a28492e45a6bcd0f204a81f783fe717045c6e" - integrity sha512-iktRU/YsxEtumI9zsPctYUk7ptpC+AVLLk1Ax3AsA4g1C+8OOnKDkIQBDHtD5hA/+VtgMd5AWI5gNlcAlt2vxQ== +"@jest/expect@^29.5.0": + version "29.5.0" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.5.0.tgz#80952f5316b23c483fbca4363ce822af79c38fba" + integrity sha512-PueDR2HGihN3ciUNGr4uelropW7rqUfTiOn+8u0leg/42UhblPxHkfoh0Ruu3I9Y1962P3u2DY4+h7GVTSVU6g== dependencies: - expect "^29.4.3" - jest-snapshot "^29.4.3" + expect "^29.5.0" + jest-snapshot "^29.5.0" -"@jest/fake-timers@^29.4.3": - version "29.4.3" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.4.3.tgz#31e982638c60fa657d310d4b9d24e023064027b0" - integrity sha512-4Hote2MGcCTWSD2gwl0dwbCpBRHhE6olYEuTj8FMowdg3oQWNKr2YuxenPQYZ7+PfqPY1k98wKDU4Z+Hvd4Tiw== +"@jest/fake-timers@^29.5.0": + version "29.5.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.5.0.tgz#d4d09ec3286b3d90c60bdcd66ed28d35f1b4dc2c" + integrity sha512-9ARvuAAQcBwDAqOnglWq2zwNIRUDtk/SCkp/ToGEhFv5r86K21l+VEs0qNTaXtyiY0lEePl3kylijSYJQqdbDg== dependencies: - "@jest/types" "^29.4.3" + "@jest/types" "^29.5.0" "@sinonjs/fake-timers" "^10.0.2" "@types/node" "*" - jest-message-util "^29.4.3" - jest-mock "^29.4.3" - jest-util "^29.4.3" + jest-message-util "^29.5.0" + jest-mock "^29.5.0" + jest-util "^29.5.0" -"@jest/globals@^29.4.3": - version "29.4.3" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.4.3.tgz#63a2c4200d11bc6d46f12bbe25b07f771fce9279" - integrity sha512-8BQ/5EzfOLG7AaMcDh7yFCbfRLtsc+09E1RQmRBI4D6QQk4m6NSK/MXo+3bJrBN0yU8A2/VIcqhvsOLFmziioA== +"@jest/globals@^29.5.0": + version "29.5.0" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.5.0.tgz#6166c0bfc374c58268677539d0c181f9c1833298" + integrity sha512-S02y0qMWGihdzNbUiqSAiKSpSozSuHX5UYc7QbnHP+D9Lyw8DgGGCinrN9uSuHPeKgSSzvPom2q1nAtBvUsvPQ== dependencies: - "@jest/environment" "^29.4.3" - "@jest/expect" "^29.4.3" - "@jest/types" "^29.4.3" - jest-mock "^29.4.3" + "@jest/environment" "^29.5.0" + "@jest/expect" "^29.5.0" + "@jest/types" "^29.5.0" + jest-mock "^29.5.0" -"@jest/reporters@^29.4.3": - version "29.4.3" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.4.3.tgz#0a68a0c0f20554760cc2e5443177a0018969e353" - integrity sha512-sr2I7BmOjJhyqj9ANC6CTLsL4emMoka7HkQpcoMRlhCbQJjz2zsRzw0BDPiPyEFDXAbxKgGFYuQZiSJ1Y6YoTg== +"@jest/reporters@^29.5.0": + version "29.5.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.5.0.tgz#985dfd91290cd78ddae4914ba7921bcbabe8ac9b" + integrity sha512-D05STXqj/M8bP9hQNSICtPqz97u7ffGzZu+9XLucXhkOFBqKcXe04JLZOgIekOxdb73MAoBUFnqvf7MCpKk5OA== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.4.3" - "@jest/test-result" "^29.4.3" - "@jest/transform" "^29.4.3" - "@jest/types" "^29.4.3" + "@jest/console" "^29.5.0" + "@jest/test-result" "^29.5.0" + "@jest/transform" "^29.5.0" + "@jest/types" "^29.5.0" "@jridgewell/trace-mapping" "^0.3.15" "@types/node" "*" chalk "^4.0.0" @@ -463,9 +469,9 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^29.4.3" - jest-util "^29.4.3" - jest-worker "^29.4.3" + jest-message-util "^29.5.0" + jest-util "^29.5.0" + jest-worker "^29.5.0" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" @@ -487,51 +493,51 @@ callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^29.4.3": - version "29.4.3" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.4.3.tgz#e13d973d16c8c7cc0c597082d5f3b9e7f796ccb8" - integrity sha512-Oi4u9NfBolMq9MASPwuWTlC5WvmNRwI4S8YrQg5R5Gi47DYlBe3sh7ILTqi/LGrK1XUE4XY9KZcQJTH1WJCLLA== +"@jest/test-result@^29.5.0": + version "29.5.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.5.0.tgz#7c856a6ca84f45cc36926a4e9c6b57f1973f1408" + integrity sha512-fGl4rfitnbfLsrfx1uUpDEESS7zM8JdgZgOCQuxQvL1Sn/I6ijeAVQWGfXI9zb1i9Mzo495cIpVZhA0yr60PkQ== dependencies: - "@jest/console" "^29.4.3" - "@jest/types" "^29.4.3" + "@jest/console" "^29.5.0" + "@jest/types" "^29.5.0" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.4.3": - version "29.4.3" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.4.3.tgz#0862e876a22993385a0f3e7ea1cc126f208a2898" - integrity sha512-yi/t2nES4GB4G0mjLc0RInCq/cNr9dNwJxcGg8sslajua5Kb4kmozAc+qPLzplhBgfw1vLItbjyHzUN92UXicw== +"@jest/test-sequencer@^29.5.0": + version "29.5.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.5.0.tgz#34d7d82d3081abd523dbddc038a3ddcb9f6d3cc4" + integrity sha512-yPafQEcKjkSfDXyvtgiV4pevSeyuA6MQr6ZIdVkWJly9vkqjnFfcfhRQqpD5whjoU8EORki752xQmjaqoFjzMQ== dependencies: - "@jest/test-result" "^29.4.3" + "@jest/test-result" "^29.5.0" graceful-fs "^4.2.9" - jest-haste-map "^29.4.3" + jest-haste-map "^29.5.0" slash "^3.0.0" -"@jest/transform@^29.4.3": - version "29.4.3" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.4.3.tgz#f7d17eac9cb5bb2e1222ea199c7c7e0835e0c037" - integrity sha512-8u0+fBGWolDshsFgPQJESkDa72da/EVwvL+II0trN2DR66wMwiQ9/CihaGfHdlLGFzbBZwMykFtxuwFdZqlKwg== +"@jest/transform@^29.5.0": + version "29.5.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.5.0.tgz#cf9c872d0965f0cbd32f1458aa44a2b1988b00f9" + integrity sha512-8vbeZWqLJOvHaDfeMuoHITGKSz5qWc9u04lnWrQE3VyuSw604PzQM824ZeX9XSjUCeDiE3GuxZe5UKa8J61NQw== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^29.4.3" + "@jest/types" "^29.5.0" "@jridgewell/trace-mapping" "^0.3.15" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^2.0.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.4.3" + jest-haste-map "^29.5.0" jest-regex-util "^29.4.3" - jest-util "^29.4.3" + jest-util "^29.5.0" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" write-file-atomic "^4.0.2" -"@jest/types@^29.4.3": - version "29.4.3" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.4.3.tgz#9069145f4ef09adf10cec1b2901b2d390031431f" - integrity sha512-bPYfw8V65v17m2Od1cv44FH+SiKW7w2Xu7trhcdTLUmSv85rfKsP+qXSjO4KGJr4dtPSzl/gvslZBXctf1qGEA== +"@jest/types@^29.5.0": + version "29.5.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.5.0.tgz#f59ef9b031ced83047c67032700d8c807d6e1593" + integrity sha512-qbu7kN6czmVRc3xWFQcAN03RAUamgppVUdXrvl1Wr3jlNF93o9mJbGcDWrwGB6ht44u7efB1qCFgVQmca24Uog== dependencies: "@jest/schemas" "^29.4.3" "@types/istanbul-lib-coverage" "^2.0.0" @@ -572,7 +578,7 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== -"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.15", "@jridgewell/trace-mapping@^0.3.9": +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.15", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.9": version "0.3.17" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985" integrity sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g== @@ -602,9 +608,9 @@ fastq "^1.6.0" "@sinclair/typebox@^0.25.16": - version "0.25.21" - resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.25.21.tgz#763b05a4b472c93a8db29b2c3e359d55b29ce272" - integrity sha512-gFukHN4t8K4+wVC+ECqeqwzBDeFeTzBXroBTqE6vcWrQGbEUpHO7LYdG0f4xnvYq4VOEwITSlHlp0JBAIFMS/g== + version "0.25.24" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.25.24.tgz#8c7688559979f7079aacaf31aa881c3aa410b718" + integrity sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ== "@sinonjs/commons@^2.0.0": version "2.0.0" @@ -685,9 +691,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*": - version "18.11.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.18.tgz#8dfb97f0da23c2293e554c5a50d61ef134d7697f" - integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA== + version "18.14.6" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.14.6.tgz#ae1973dd2b1eeb1825695bb11ebfb746d27e3e93" + integrity sha512-93+VvleD3mXwlLI/xASjw0FzKcwzl3OdTCzm1LaRfqgS21gfFtK3zDXM5Op9TeeMsJVOaJ2VRDpT9q4Y3d0AvA== "@types/prettier@^2.1.5": version "2.7.2" @@ -705,9 +711,9 @@ integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== "@types/yargs@^17.0.8": - version "17.0.20" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.20.tgz#107f0fcc13bd4a524e352b41c49fe88aab5c54d5" - integrity sha512-eknWrTHofQuPk2iuqDm1waA7V6xPlbgBoaaXEgYkClhLOnB0TtbW+srJaOToAgawPxPlHQzwypFA2bhZaUGP5A== + version "17.0.22" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.22.tgz#7dd37697691b5f17d020f3c63e7a45971ff71e9a" + integrity sha512-pet5WJ9U8yPVRhkwuEIp5ktAeAqRZOq4UdAyWLWzxbtpyXnzbtLdKiXAjJzi/KLmPGS9wk86lUFWZFN6sISo4g== dependencies: "@types/yargs-parser" "*" @@ -797,15 +803,15 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.4.3.tgz#478b84d430972b277ad67dd631be94abea676792" - integrity sha512-o45Wyn32svZE+LnMVWv/Z4x0SwtLbh4FyGcYtR20kIWd+rdrDZ9Fzq8Ml3MYLD+mZvEdzCjZsCnYZ2jpJyQ+Nw== +babel-jest@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.5.0.tgz#3fe3ddb109198e78b1c88f9ebdecd5e4fc2f50a5" + integrity sha512-mA4eCDh5mSo2EcA9xQjVTpmbbNk32Zb3Q3QFQsNhaK56Q+yoXowzFodLux30HRgyOho5rsQ6B0P9QpMkvvnJ0Q== dependencies: - "@jest/transform" "^29.4.3" + "@jest/transform" "^29.5.0" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^29.4.3" + babel-preset-jest "^29.5.0" chalk "^4.0.0" graceful-fs "^4.2.9" slash "^3.0.0" @@ -821,10 +827,10 @@ babel-plugin-istanbul@^6.1.1: istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.4.3.tgz#ad1dfb5d31940957e00410ef7d9b2aa94b216101" - integrity sha512-mB6q2q3oahKphy5V7CpnNqZOCkxxZ9aokf1eh82Dy3jQmg4xvM1tGrh5y6BQUJh4a3Pj9+eLfwvAZ7VNKg7H8Q== +babel-plugin-jest-hoist@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.5.0.tgz#a97db437936f441ec196990c9738d4b88538618a" + integrity sha512-zSuuuAlTMT4mzLj2nPnUm6fsE6270vdOfnpbJ+RmruU75UhLFvL0N2NgI7xpeS7NaB6hGqmd5pVpGTDYvi4Q3w== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -849,12 +855,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.4.3.tgz#bb926b66ae253b69c6e3ef87511b8bb5c53c5b52" - integrity sha512-gWx6COtSuma6n9bw+8/F+2PCXrIgxV/D1TJFnp6OyBK2cxPWg0K9p/sriNYeifKjpUkMViWQ09DSWtzJQRETsw== +babel-preset-jest@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.5.0.tgz#57bc8cc88097af7ff6a5ab59d1cd29d52a5916e2" + integrity sha512-JOMloxOqdiBSxMAzjRaH023/vvcaSaec49zvg+2LmNsktC7ei39LTJGw02J+9uUtTZUq6xbLyJ4dxe9sSmIuAg== dependencies: - babel-plugin-jest-hoist "^29.4.3" + babel-plugin-jest-hoist "^29.5.0" babel-preset-current-node-syntax "^1.0.0" balanced-match@^1.0.0: @@ -878,14 +884,14 @@ braces@^3.0.2: fill-range "^7.0.1" browserslist@^4.21.3: - version "4.21.4" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.4.tgz#e7496bbc67b9e39dd0f98565feccdcb0d4ff6987" - integrity sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw== + version "4.21.5" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.5.tgz#75c5dae60063ee641f977e00edd3cfb2fb7af6a7" + integrity sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w== dependencies: - caniuse-lite "^1.0.30001400" - electron-to-chromium "^1.4.251" - node-releases "^2.0.6" - update-browserslist-db "^1.0.9" + caniuse-lite "^1.0.30001449" + electron-to-chromium "^1.4.284" + node-releases "^2.0.8" + update-browserslist-db "^1.0.10" bser@2.1.1: version "2.1.1" @@ -914,10 +920,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001400: - version "1.0.30001448" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001448.tgz#ca7550b1587c92a392a2b377cd9c508b3b4395bf" - integrity sha512-tq2YI+MJnooG96XpbTRYkBxLxklZPOdLmNIOdIhvf7SNJan6u5vCKum8iT7ZfCt70m1GPkuC7P3TtX6UuhupuA== +caniuse-lite@^1.0.30001449: + version "1.0.30001462" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001462.tgz#b2e801e37536d453731286857c8520d3dcee15fe" + integrity sha512-PDd20WuOBPiasZ7KbFnmQRyuLE7cFXW2PVd7dmALzbkUXEP46upAuCDm9eY9vho8fgNMGmbAX92QBZHzcnWIqw== chalk@^2.0.0: version "2.4.2" @@ -950,9 +956,9 @@ char-regex@^1.0.2: integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== ci-info@^3.2.0: - version "3.7.1" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.7.1.tgz#708a6cdae38915d597afdf3b145f2f8e1ff55f3f" - integrity sha512-4jYS4MOAaCIStSRwiuxc4B8MYhIe676yO1sYGzARnjXkWpmzZMMYxY6zu8WYWDhSuth5zhrQ1rhNSibyyvv4/w== + version "3.8.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.8.0.tgz#81408265a5380c929f0bc665d62256628ce9ef91" + integrity sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw== cjs-module-lexer@^1.0.0: version "1.2.2" @@ -1044,9 +1050,9 @@ deep-is@^0.1.3: integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== deepmerge@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" - integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== + version "4.3.0" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.0.tgz#65491893ec47756d44719ae520e0e2609233b59b" + integrity sha512-z2wJZXrmeHdvYJp/Ux55wIjqo81G5Bp4c+oELTW+7ar6SogWHajt5a9gO3s3IDaGSAXjDk0vlQKN3rms8ab3og== detect-newline@^3.0.0: version "3.1.0" @@ -1065,10 +1071,10 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -electron-to-chromium@^1.4.251: - version "1.4.284" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz#61046d1e4cab3a25238f6bf7413795270f125592" - integrity sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA== +electron-to-chromium@^1.4.284: + version "1.4.322" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.322.tgz#e0afa1d115b66c1d47869db40d8f2f3729cecc16" + integrity sha512-KovjizNC9XB7dno/2GjxX8VS0SlfPpCjtyoKft+bCO+UfD8bFy16hY4Sh9s0h9BDxbRH2U0zX5VBjpM1LTcNlg== emittery@^0.13.1: version "0.13.1" @@ -1114,10 +1120,10 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -eslint-config-prettier@^8.0.0: - version "8.6.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz#dec1d29ab728f4fa63061774e1672ac4e363d207" - integrity sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA== +eslint-config-prettier@^8.7.0: + version "8.7.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.7.0.tgz#f1cc58a8afebc50980bd53475451df146c13182d" + integrity sha512-HHVXLSlVUhMSmyW4ZzEuvjpwqamgmlfkutD53cYXLikh4pt/modINRcCIApJ84czDxM4GZInwUrromsDdTImTA== eslint-scope@^7.1.1: version "7.1.1" @@ -1144,12 +1150,13 @@ eslint-visitor-keys@^3.3.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== -eslint@^8.32.0: - version "8.34.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.34.0.tgz#fe0ab0ef478104c1f9ebc5537e303d25a8fb22d6" - integrity sha512-1Z8iFsucw+7kSqXNZVslXS8Ioa4u2KM7GPwuKtkTFAqZ/cHMcEaR+1+Br0wLlot49cNxIiZk5wp8EAbPcYZxTg== +eslint@^8.35.0: + version "8.35.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.35.0.tgz#fffad7c7e326bae606f0e8f436a6158566d42323" + integrity sha512-BxAf1fVL7w+JLRQhWl2pzGeSiGqbWumV4WNvc9Rhp6tiCtm4oHnyPBSEtMGZwrQgudFQ+otqzWoPB7x+hxoWsw== dependencies: - "@eslint/eslintrc" "^1.4.1" + "@eslint/eslintrc" "^2.0.0" + "@eslint/js" "8.35.0" "@humanwhocodes/config-array" "^0.11.8" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" @@ -1163,7 +1170,7 @@ eslint@^8.32.0: eslint-utils "^3.0.0" eslint-visitor-keys "^3.3.0" espree "^9.4.0" - esquery "^1.4.0" + esquery "^1.4.2" esutils "^2.0.2" fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" @@ -1203,10 +1210,10 @@ esprima@^4.0.0: resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -esquery@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" - integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== +esquery@^1.4.2: + version "1.5.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b" + integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg== dependencies: estraverse "^5.1.0" @@ -1262,16 +1269,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== -expect@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.4.3.tgz#5e47757316df744fe3b8926c3ae8a3ebdafff7fe" - integrity sha512-uC05+Q7eXECFpgDrHdXA4k2rpMyStAYPItEDLyQDo5Ta7fVkJnNA/4zh/OIVkVVNZ1oOK1PipQoyNjuZ6sz6Dg== +expect@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.5.0.tgz#68c0509156cb2a0adb8865d413b137eeaae682f7" + integrity sha512-yM7xqUrCO2JdpFo4XpM82t+PJBFybdqoQuJLDGeDX2ij8NZzqRHyu3Hp188/JX7SWqud+7t4MUdvcgGBICMHZg== dependencies: - "@jest/expect-utils" "^29.4.3" + "@jest/expect-utils" "^29.5.0" jest-get-type "^29.4.3" - jest-matcher-utils "^29.4.3" - jest-message-util "^29.4.3" - jest-util "^29.4.3" + jest-matcher-utils "^29.5.0" + jest-message-util "^29.5.0" + jest-util "^29.5.0" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1412,9 +1419,9 @@ globals@^11.1.0: integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== globals@^13.19.0: - version "13.19.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.19.0.tgz#7a42de8e6ad4f7242fbcca27ea5b23aca367b5c8" - integrity sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ== + version "13.20.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.20.0.tgz#ea276a1e508ffd4f1612888f9d1bad1e2717bf82" + integrity sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ== dependencies: type-fest "^0.20.2" @@ -1600,94 +1607,95 @@ istanbul-reports@^3.1.3: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.4.3.tgz#7961fe32536b9b6d5c28dfa0abcfab31abcf50a7" - integrity sha512-Vn5cLuWuwmi2GNNbokPOEcvrXGSGrqVnPEZV7rC6P7ck07Dyw9RFnvWglnupSh+hGys0ajGtw/bc2ZgweljQoQ== +jest-changed-files@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.5.0.tgz#e88786dca8bf2aa899ec4af7644e16d9dcf9b23e" + integrity sha512-IFG34IUMUaNBIxjQXF/iu7g6EcdMrGRRxaUSw92I/2g2YC6vCdTltl4nHvt7Ci5nSJwXIkCu8Ka1DKF+X7Z1Ag== dependencies: execa "^5.0.0" p-limit "^3.1.0" -jest-circus@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.4.3.tgz#fff7be1cf5f06224dd36a857d52a9efeb005ba04" - integrity sha512-Vw/bVvcexmdJ7MLmgdT3ZjkJ3LKu8IlpefYokxiqoZy6OCQ2VAm6Vk3t/qHiAGUXbdbJKJWnc8gH3ypTbB/OBw== +jest-circus@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.5.0.tgz#b5926989449e75bff0d59944bae083c9d7fb7317" + integrity sha512-gq/ongqeQKAplVxqJmbeUOJJKkW3dDNPY8PjhJ5G0lBRvu0e3EWGxGy5cI4LAGA7gV2UHCtWBI4EMXK8c9nQKA== dependencies: - "@jest/environment" "^29.4.3" - "@jest/expect" "^29.4.3" - "@jest/test-result" "^29.4.3" - "@jest/types" "^29.4.3" + "@jest/environment" "^29.5.0" + "@jest/expect" "^29.5.0" + "@jest/test-result" "^29.5.0" + "@jest/types" "^29.5.0" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" is-generator-fn "^2.0.0" - jest-each "^29.4.3" - jest-matcher-utils "^29.4.3" - jest-message-util "^29.4.3" - jest-runtime "^29.4.3" - jest-snapshot "^29.4.3" - jest-util "^29.4.3" + jest-each "^29.5.0" + jest-matcher-utils "^29.5.0" + jest-message-util "^29.5.0" + jest-runtime "^29.5.0" + jest-snapshot "^29.5.0" + jest-util "^29.5.0" p-limit "^3.1.0" - pretty-format "^29.4.3" + pretty-format "^29.5.0" + pure-rand "^6.0.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.4.3.tgz#fe31fdd0c90c765f392b8b7c97e4845071cd2163" - integrity sha512-PiiAPuFNfWWolCE6t3ZrDXQc6OsAuM3/tVW0u27UWc1KE+n/HSn5dSE6B2juqN7WP+PP0jAcnKtGmI4u8GMYCg== +jest-cli@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.5.0.tgz#b34c20a6d35968f3ee47a7437ff8e53e086b4a67" + integrity sha512-L1KcP1l4HtfwdxXNFCL5bmUbLQiKrakMUriBEcc1Vfz6gx31ORKdreuWvmQVBit+1ss9NNR3yxjwfwzZNdQXJw== dependencies: - "@jest/core" "^29.4.3" - "@jest/test-result" "^29.4.3" - "@jest/types" "^29.4.3" + "@jest/core" "^29.5.0" + "@jest/test-result" "^29.5.0" + "@jest/types" "^29.5.0" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.4.3" - jest-util "^29.4.3" - jest-validate "^29.4.3" + jest-config "^29.5.0" + jest-util "^29.5.0" + jest-validate "^29.5.0" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.4.3.tgz#fca9cdfe6298ae6d04beef1624064d455347c978" - integrity sha512-eCIpqhGnIjdUCXGtLhz4gdDoxKSWXKjzNcc5r+0S1GKOp2fwOipx5mRcwa9GB/ArsxJ1jlj2lmlD9bZAsBxaWQ== +jest-config@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.5.0.tgz#3cc972faec8c8aaea9ae158c694541b79f3748da" + integrity sha512-kvDUKBnNJPNBmFFOhDbm59iu1Fii1Q6SxyhXfvylq3UTHbg6o7j/g8k2dZyXWLvfdKB1vAPxNZnMgtKJcmu3kA== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.4.3" - "@jest/types" "^29.4.3" - babel-jest "^29.4.3" + "@jest/test-sequencer" "^29.5.0" + "@jest/types" "^29.5.0" + babel-jest "^29.5.0" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^29.4.3" - jest-environment-node "^29.4.3" + jest-circus "^29.5.0" + jest-environment-node "^29.5.0" jest-get-type "^29.4.3" jest-regex-util "^29.4.3" - jest-resolve "^29.4.3" - jest-runner "^29.4.3" - jest-util "^29.4.3" - jest-validate "^29.4.3" + jest-resolve "^29.5.0" + jest-runner "^29.5.0" + jest-util "^29.5.0" + jest-validate "^29.5.0" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^29.4.3" + pretty-format "^29.5.0" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.4.3.tgz#42f4eb34d0bf8c0fb08b0501069b87e8e84df347" - integrity sha512-YB+ocenx7FZ3T5O9lMVMeLYV4265socJKtkwgk/6YUz/VsEzYDkiMuMhWzZmxm3wDRQvayJu/PjkjjSkjoHsCA== +jest-diff@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.5.0.tgz#e0d83a58eb5451dcc1fa61b1c3ee4e8f5a290d63" + integrity sha512-LtxijLLZBduXnHSniy0WMdaHjmQnt3g5sa16W4p0HqukYTTsyTW3GD1q41TyGl5YFXj/5B2U6dlh5FM1LIMgxw== dependencies: chalk "^4.0.0" diff-sequences "^29.4.3" jest-get-type "^29.4.3" - pretty-format "^29.4.3" + pretty-format "^29.5.0" jest-docblock@^29.4.3: version "29.4.3" @@ -1696,94 +1704,94 @@ jest-docblock@^29.4.3: dependencies: detect-newline "^3.0.0" -jest-each@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.4.3.tgz#a434c199a2f6151c5e3dc80b2d54586bdaa72819" - integrity sha512-1ElHNAnKcbJb/b+L+7j0/w7bDvljw4gTv1wL9fYOczeJrbTbkMGQ5iQPFJ3eFQH19VPTx1IyfePdqSpePKss7Q== +jest-each@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.5.0.tgz#fc6e7014f83eac68e22b7195598de8554c2e5c06" + integrity sha512-HM5kIJ1BTnVt+DQZ2ALp3rzXEl+g726csObrW/jpEGl+CDSSQpOJJX2KE/vEg8cxcMXdyEPu6U4QX5eruQv5hA== dependencies: - "@jest/types" "^29.4.3" + "@jest/types" "^29.5.0" chalk "^4.0.0" jest-get-type "^29.4.3" - jest-util "^29.4.3" - pretty-format "^29.4.3" + jest-util "^29.5.0" + pretty-format "^29.5.0" -jest-environment-node@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.4.3.tgz#579c4132af478befc1889ddc43c2413a9cdbe014" - integrity sha512-gAiEnSKF104fsGDXNkwk49jD/0N0Bqu2K9+aMQXA6avzsA9H3Fiv1PW2D+gzbOSR705bWd2wJZRFEFpV0tXISg== +jest-environment-node@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.5.0.tgz#f17219d0f0cc0e68e0727c58b792c040e332c967" + integrity sha512-ExxuIK/+yQ+6PRGaHkKewYtg6hto2uGCgvKdb2nfJfKXgZ17DfXjvbZ+jA1Qt9A8EQSfPnt5FKIfnOO3u1h9qw== dependencies: - "@jest/environment" "^29.4.3" - "@jest/fake-timers" "^29.4.3" - "@jest/types" "^29.4.3" + "@jest/environment" "^29.5.0" + "@jest/fake-timers" "^29.5.0" + "@jest/types" "^29.5.0" "@types/node" "*" - jest-mock "^29.4.3" - jest-util "^29.4.3" + jest-mock "^29.5.0" + jest-util "^29.5.0" jest-get-type@^29.4.3: version "29.4.3" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.4.3.tgz#1ab7a5207c995161100b5187159ca82dd48b3dd5" integrity sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg== -jest-haste-map@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.4.3.tgz#085a44283269e7ace0645c63a57af0d2af6942e2" - integrity sha512-eZIgAS8tvm5IZMtKlR8Y+feEOMfo2pSQkmNbufdbMzMSn9nitgGxF1waM/+LbryO3OkMcKS98SUb+j/cQxp/vQ== +jest-haste-map@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.5.0.tgz#69bd67dc9012d6e2723f20a945099e972b2e94de" + integrity sha512-IspOPnnBro8YfVYSw6yDRKh/TiCdRngjxeacCps1cQ9cgVN6+10JUcuJ1EabrgYLOATsIAigxA0rLR9x/YlrSA== dependencies: - "@jest/types" "^29.4.3" + "@jest/types" "^29.5.0" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" jest-regex-util "^29.4.3" - jest-util "^29.4.3" - jest-worker "^29.4.3" + jest-util "^29.5.0" + jest-worker "^29.5.0" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.4.3.tgz#2b35191d6b35aa0256e63a9b79b0f949249cf23a" - integrity sha512-9yw4VC1v2NspMMeV3daQ1yXPNxMgCzwq9BocCwYrRgXe4uaEJPAN0ZK37nFBhcy3cUwEVstFecFLaTHpF7NiGA== +jest-leak-detector@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.5.0.tgz#cf4bdea9615c72bac4a3a7ba7e7930f9c0610c8c" + integrity sha512-u9YdeeVnghBUtpN5mVxjID7KbkKE1QU4f6uUwuxiY0vYRi9BUCLKlPEZfDGR67ofdFmDz9oPAy2G92Ujrntmow== dependencies: jest-get-type "^29.4.3" - pretty-format "^29.4.3" + pretty-format "^29.5.0" -jest-matcher-utils@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.4.3.tgz#ea68ebc0568aebea4c4213b99f169ff786df96a0" - integrity sha512-TTciiXEONycZ03h6R6pYiZlSkvYgT0l8aa49z/DLSGYjex4orMUcafuLXYyyEDWB1RKglq00jzwY00Ei7yFNVg== +jest-matcher-utils@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.5.0.tgz#d957af7f8c0692c5453666705621ad4abc2c59c5" + integrity sha512-lecRtgm/rjIK0CQ7LPQwzCs2VwW6WAahA55YBuI+xqmhm7LAaxokSB8C97yJeYyT+HvQkH741StzpU41wohhWw== dependencies: chalk "^4.0.0" - jest-diff "^29.4.3" + jest-diff "^29.5.0" jest-get-type "^29.4.3" - pretty-format "^29.4.3" + pretty-format "^29.5.0" -jest-message-util@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.4.3.tgz#65b5280c0fdc9419503b49d4f48d4999d481cb5b" - integrity sha512-1Y8Zd4ZCN7o/QnWdMmT76If8LuDv23Z1DRovBj/vcSFNlGCJGoO8D1nJDw1AdyAGUk0myDLFGN5RbNeJyCRGCw== +jest-message-util@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.5.0.tgz#1f776cac3aca332ab8dd2e3b41625435085c900e" + integrity sha512-Kijeg9Dag6CKtIDA7O21zNTACqD5MD/8HfIV8pdD94vFyFuer52SigdC3IQMhab3vACxXMiFk+yMHNdbqtyTGA== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.4.3" + "@jest/types" "^29.5.0" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^29.4.3" + pretty-format "^29.5.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.4.3.tgz#23d84a20a74cdfff0510fdbeefb841ed57b0fe7e" - integrity sha512-LjFgMg+xed9BdkPMyIJh+r3KeHt1klXPJYBULXVVAkbTaaKjPX1o1uVCAZADMEp/kOxGTwy/Ot8XbvgItOrHEg== +jest-mock@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.5.0.tgz#26e2172bcc71d8b0195081ff1f146ac7e1518aed" + integrity sha512-GqOzvdWDE4fAV2bWQLQCkujxYWL7RxjCnj71b5VhDAGOevB3qj3Ovg26A5NI84ZpODxyzaozXLOh2NCgkbvyaw== dependencies: - "@jest/types" "^29.4.3" + "@jest/types" "^29.5.0" "@types/node" "*" - jest-util "^29.4.3" + jest-util "^29.5.0" jest-pnp-resolver@^1.2.2: version "1.2.3" @@ -1795,88 +1803,88 @@ jest-regex-util@^29.4.3: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.4.3.tgz#a42616141e0cae052cfa32c169945d00c0aa0bb8" integrity sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg== -jest-resolve-dependencies@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.4.3.tgz#9ad7f23839a6d88cef91416bda9393a6e9fd1da5" - integrity sha512-uvKMZAQ3nmXLH7O8WAOhS5l0iWyT3WmnJBdmIHiV5tBbdaDZ1wqtNX04FONGoaFvSOSHBJxnwAVnSn1WHdGVaw== +jest-resolve-dependencies@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.5.0.tgz#f0ea29955996f49788bf70996052aa98e7befee4" + integrity sha512-sjV3GFr0hDJMBpYeUuGduP+YeCRbd7S/ck6IvL3kQ9cpySYKqcqhdLLC2rFwrcL7tz5vYibomBrsFYWkIGGjOg== dependencies: jest-regex-util "^29.4.3" - jest-snapshot "^29.4.3" + jest-snapshot "^29.5.0" -jest-resolve@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.4.3.tgz#3c5b5c984fa8a763edf9b3639700e1c7900538e2" - integrity sha512-GPokE1tzguRyT7dkxBim4wSx6E45S3bOQ7ZdKEG+Qj0Oac9+6AwJPCk0TZh5Vu0xzeX4afpb+eDmgbmZFFwpOw== +jest-resolve@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.5.0.tgz#b053cc95ad1d5f6327f0ac8aae9f98795475ecdc" + integrity sha512-1TzxJ37FQq7J10jPtQjcc+MkCkE3GBpBecsSUWJ0qZNJpmg6m0D9/7II03yJulm3H/fvVjgqLh/k2eYg+ui52w== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^29.4.3" + jest-haste-map "^29.5.0" jest-pnp-resolver "^1.2.2" - jest-util "^29.4.3" - jest-validate "^29.4.3" + jest-util "^29.5.0" + jest-validate "^29.5.0" resolve "^1.20.0" resolve.exports "^2.0.0" slash "^3.0.0" -jest-runner@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.4.3.tgz#68dc82c68645eda12bea42b5beece6527d7c1e5e" - integrity sha512-GWPTEiGmtHZv1KKeWlTX9SIFuK19uLXlRQU43ceOQ2hIfA5yPEJC7AMkvFKpdCHx6pNEdOD+2+8zbniEi3v3gA== - dependencies: - "@jest/console" "^29.4.3" - "@jest/environment" "^29.4.3" - "@jest/test-result" "^29.4.3" - "@jest/transform" "^29.4.3" - "@jest/types" "^29.4.3" +jest-runner@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.5.0.tgz#6a57c282eb0ef749778d444c1d758c6a7693b6f8" + integrity sha512-m7b6ypERhFghJsslMLhydaXBiLf7+jXy8FwGRHO3BGV1mcQpPbwiqiKUR2zU2NJuNeMenJmlFZCsIqzJCTeGLQ== + dependencies: + "@jest/console" "^29.5.0" + "@jest/environment" "^29.5.0" + "@jest/test-result" "^29.5.0" + "@jest/transform" "^29.5.0" + "@jest/types" "^29.5.0" "@types/node" "*" chalk "^4.0.0" emittery "^0.13.1" graceful-fs "^4.2.9" jest-docblock "^29.4.3" - jest-environment-node "^29.4.3" - jest-haste-map "^29.4.3" - jest-leak-detector "^29.4.3" - jest-message-util "^29.4.3" - jest-resolve "^29.4.3" - jest-runtime "^29.4.3" - jest-util "^29.4.3" - jest-watcher "^29.4.3" - jest-worker "^29.4.3" + jest-environment-node "^29.5.0" + jest-haste-map "^29.5.0" + jest-leak-detector "^29.5.0" + jest-message-util "^29.5.0" + jest-resolve "^29.5.0" + jest-runtime "^29.5.0" + jest-util "^29.5.0" + jest-watcher "^29.5.0" + jest-worker "^29.5.0" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.4.3.tgz#f25db9874dcf35a3ab27fdaabca426666cc745bf" - integrity sha512-F5bHvxSH+LvLV24vVB3L8K467dt3y3dio6V3W89dUz9nzvTpqd/HcT9zfYKL2aZPvD63vQFgLvaUX/UpUhrP6Q== +jest-runtime@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.5.0.tgz#c83f943ee0c1da7eb91fa181b0811ebd59b03420" + integrity sha512-1Hr6Hh7bAgXQP+pln3homOiEZtCDZFqwmle7Ew2j8OlbkIu6uE3Y/etJQG8MLQs3Zy90xrp2C0BRrtPHG4zryw== dependencies: - "@jest/environment" "^29.4.3" - "@jest/fake-timers" "^29.4.3" - "@jest/globals" "^29.4.3" + "@jest/environment" "^29.5.0" + "@jest/fake-timers" "^29.5.0" + "@jest/globals" "^29.5.0" "@jest/source-map" "^29.4.3" - "@jest/test-result" "^29.4.3" - "@jest/transform" "^29.4.3" - "@jest/types" "^29.4.3" + "@jest/test-result" "^29.5.0" + "@jest/transform" "^29.5.0" + "@jest/types" "^29.5.0" "@types/node" "*" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^29.4.3" - jest-message-util "^29.4.3" - jest-mock "^29.4.3" + jest-haste-map "^29.5.0" + jest-message-util "^29.5.0" + jest-mock "^29.5.0" jest-regex-util "^29.4.3" - jest-resolve "^29.4.3" - jest-snapshot "^29.4.3" - jest-util "^29.4.3" + jest-resolve "^29.5.0" + jest-snapshot "^29.5.0" + jest-util "^29.5.0" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.4.3.tgz#183d309371450d9c4a3de7567ed2151eb0e91145" - integrity sha512-NGlsqL0jLPDW91dz304QTM/SNO99lpcSYYAjNiX0Ou+sSGgkanKBcSjCfp/pqmiiO1nQaOyLp6XQddAzRcx3Xw== +jest-snapshot@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.5.0.tgz#c9c1ce0331e5b63cd444e2f95a55a73b84b1e8ce" + integrity sha512-x7Wolra5V0tt3wRs3/ts3S6ciSQVypgGQlJpz2rsdQYoUKxMxPNaoHMGJN6qAuPJqS+2iQ1ZUn5kl7HCyls84g== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" @@ -1884,82 +1892,81 @@ jest-snapshot@^29.4.3: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.4.3" - "@jest/transform" "^29.4.3" - "@jest/types" "^29.4.3" + "@jest/expect-utils" "^29.5.0" + "@jest/transform" "^29.5.0" + "@jest/types" "^29.5.0" "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.4.3" + expect "^29.5.0" graceful-fs "^4.2.9" - jest-diff "^29.4.3" + jest-diff "^29.5.0" jest-get-type "^29.4.3" - jest-haste-map "^29.4.3" - jest-matcher-utils "^29.4.3" - jest-message-util "^29.4.3" - jest-util "^29.4.3" + jest-matcher-utils "^29.5.0" + jest-message-util "^29.5.0" + jest-util "^29.5.0" natural-compare "^1.4.0" - pretty-format "^29.4.3" + pretty-format "^29.5.0" semver "^7.3.5" -jest-util@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.4.3.tgz#851a148e23fc2b633c55f6dad2e45d7f4579f496" - integrity sha512-ToSGORAz4SSSoqxDSylWX8JzkOQR7zoBtNRsA7e+1WUX5F8jrOwaNpuh1YfJHJKDHXLHmObv5eOjejUd+/Ws+Q== +jest-util@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.5.0.tgz#24a4d3d92fc39ce90425311b23c27a6e0ef16b8f" + integrity sha512-RYMgG/MTadOr5t8KdhejfvUU82MxsCu5MF6KuDUHl+NuwzUt+Sm6jJWxTJVrDR1j5M/gJVCPKQEpWXY+yIQ6lQ== dependencies: - "@jest/types" "^29.4.3" + "@jest/types" "^29.5.0" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.4.3.tgz#a13849dec4f9e95446a7080ad5758f58fa88642f" - integrity sha512-J3u5v7aPQoXPzaar6GndAVhdQcZr/3osWSgTeKg5v574I9ybX/dTyH0AJFb5XgXIB7faVhf+rS7t4p3lL9qFaw== +jest-validate@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.5.0.tgz#8e5a8f36178d40e47138dc00866a5f3bd9916ffc" + integrity sha512-pC26etNIi+y3HV8A+tUGr/lph9B18GnzSRAkPaaZJIE1eFdiYm6/CewuiJQ8/RlfHd1u/8Ioi8/sJ+CmbA+zAQ== dependencies: - "@jest/types" "^29.4.3" + "@jest/types" "^29.5.0" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^29.4.3" leven "^3.1.0" - pretty-format "^29.4.3" + pretty-format "^29.5.0" -jest-watcher@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.4.3.tgz#e503baa774f0c2f8f3c8db98a22ebf885f19c384" - integrity sha512-zwlXH3DN3iksoIZNk73etl1HzKyi5FuQdYLnkQKm5BW4n8HpoG59xSwpVdFrnh60iRRaRBGw0gcymIxjJENPcA== +jest-watcher@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.5.0.tgz#cf7f0f949828ba65ddbbb45c743a382a4d911363" + integrity sha512-KmTojKcapuqYrKDpRwfqcQ3zjMlwu27SYext9pt4GlF5FUgB+7XE1mcCnSm6a4uUpFyQIkb6ZhzZvHl+jiBCiA== dependencies: - "@jest/test-result" "^29.4.3" - "@jest/types" "^29.4.3" + "@jest/test-result" "^29.5.0" + "@jest/types" "^29.5.0" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.13.1" - jest-util "^29.4.3" + jest-util "^29.5.0" string-length "^4.0.1" -jest-worker@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.4.3.tgz#9a4023e1ea1d306034237c7133d7da4240e8934e" - integrity sha512-GLHN/GTAAMEy5BFdvpUfzr9Dr80zQqBrh0fz1mtRMe05hqP45+HfQltu7oTBfduD0UeZs09d+maFtFYAXFWvAA== +jest-worker@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.5.0.tgz#bdaefb06811bd3384d93f009755014d8acb4615d" + integrity sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA== dependencies: "@types/node" "*" - jest-util "^29.4.3" + jest-util "^29.5.0" merge-stream "^2.0.0" supports-color "^8.0.0" -jest@^29.4.1: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.4.3.tgz#1b8be541666c6feb99990fd98adac4737e6e6386" - integrity sha512-XvK65feuEFGZT8OO0fB/QAQS+LGHvQpaadkH5p47/j3Ocqq3xf2pK9R+G0GzgfuhXVxEv76qCOOcMb5efLk6PA== +jest@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.5.0.tgz#f75157622f5ce7ad53028f2f8888ab53e1f1f24e" + integrity sha512-juMg3he2uru1QoXX078zTa7pO85QyB9xajZc6bU+d9yEGwrKX6+vGmJQ3UdVZsvTEUARIdObzH68QItim6OSSQ== dependencies: - "@jest/core" "^29.4.3" - "@jest/types" "^29.4.3" + "@jest/core" "^29.5.0" + "@jest/types" "^29.5.0" import-local "^3.0.2" - jest-cli "^29.4.3" + jest-cli "^29.5.0" js-sdsl@^4.1.4: version "4.3.0" @@ -2137,10 +2144,10 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== -node-releases@^2.0.6: - version "2.0.8" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.8.tgz#0f349cdc8fcfa39a92ac0be9bc48b7706292b9ae" - integrity sha512-dFSmB8fFHEH/s81Xi+Y/15DQY6VHW81nXRj86EMSL3lmuTmK1e+aT4wrFCkTbm+gSwkw4KpX+rT/pMM2c1mF+A== +node-releases@^2.0.8: + version "2.0.10" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.10.tgz#c311ebae3b6a148c89b1813fd7c4d3c024ef537f" + integrity sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w== normalize-path@^3.0.0: version "3.0.0" @@ -2277,15 +2284,15 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prettier@>=3.0.0-alpha.2: - version "3.0.0-alpha.4" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0-alpha.4.tgz#eee71d6b520b970f44e4045f2dc772bf6f80815f" - integrity sha512-+KeqJv4E5kaRsDRgSx9IeVygLKGHRmcoPvRJvPFp3bC1mw8opsva555gGb8TaJzUiHXoLZcus1EX+nlHPda7Pw== +prettier@>=3.0.0-alpha.6: + version "3.0.0-alpha.6" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0-alpha.6.tgz#c562f9f54966aff792c6920e6a29fbffd1ae07b6" + integrity sha512-AdbQSZ6Oo+iy9Ekzmsgno05P1uX2vqPkjOMJqRfP8hTe+m6iDw4Nt7bPFpWZ/HYCU+3f0P5U0o2ghxQwwkLH7A== -pretty-format@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.4.3.tgz#25500ada21a53c9e8423205cf0337056b201244c" - integrity sha512-cvpcHTc42lcsvOOAzd3XuNWTcvk1Jmnzqeu+WsOuiPmxUJTnkbAcFNsRKvEpBEUFVUgy/GTZLulZDcDEi+CIlA== +pretty-format@^29.5.0: + version "29.5.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.5.0.tgz#283134e74f70e2e3e7229336de0e4fce94ccde5a" + integrity sha512-V2mGkI31qdttvTFX7Mt4efOqHXqJWMu4/r66Xh3Z3BwZaPfPJgp6/gbwoujRpPUtfEF6AUUWx3Jim3GCw5g/Qw== dependencies: "@jest/schemas" "^29.4.3" ansi-styles "^5.0.0" @@ -2324,6 +2331,11 @@ punycode@^2.1.0: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== +pure-rand@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.0.0.tgz#701996ceefa253507923a0e864c17ab421c04a7c" + integrity sha512-rLSBxJjP+4DQOgcJAx6RZHT2he2pkhQdSnofG5VWyVl6GRq/K02ISOuOLcsMOrtKDIJb8JN2zm3FFzWNbezdPw== + queue-microtask@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" @@ -2362,9 +2374,9 @@ resolve-from@^5.0.0: integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== resolve.exports@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.0.tgz#c1a0028c2d166ec2fbf7d0644584927e76e7400e" - integrity sha512-6K/gDlqgQscOlg9fSRpWstA8sYe8rbELsSTNpx+3kTrsVCzvSl0zIvRErM7fdl9ERWDsKnrLnwB+Ne89918XOg== + version "2.0.1" + resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.1.tgz#cee884cd4e3f355660e501fa3276b27d7ffe5a20" + integrity sha512-OEJWVeimw8mgQuj3HfkNl4KqRevH7lzeQNaWRPfx0PPse7Jk6ozcsG4FKVgtzDsC1KUF+YlTHh17NcgHOPykLw== resolve@^1.20.0: version "1.22.1" @@ -2576,7 +2588,7 @@ type-fest@^0.21.3: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== -update-browserslist-db@^1.0.9: +update-browserslist-db@^1.0.10: version "1.0.10" resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz#0f54b876545726f17d00cd9a2561e6dade943ff3" integrity sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ== @@ -2592,9 +2604,9 @@ uri-js@^4.2.2: punycode "^2.1.0" v8-to-istanbul@^9.0.1: - version "9.0.1" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.0.1.tgz#b6f994b0b5d4ef255e17a0d17dc444a9f5132fa4" - integrity sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w== + version "9.1.0" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz#1b83ed4e397f58c85c266a570fc2558b5feb9265" + integrity sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA== dependencies: "@jridgewell/trace-mapping" "^0.3.12" "@types/istanbul-lib-coverage" "^2.0.1" @@ -2662,9 +2674,9 @@ yargs-parser@^21.1.1: integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== yargs@^17.3.1: - version "17.6.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.6.2.tgz#2e23f2944e976339a1ee00f18c77fedee8332541" - integrity sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw== + version "17.7.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.1.tgz#34a77645201d1a8fc5213ace787c220eabbd0967" + integrity sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw== dependencies: cliui "^8.0.1" escalade "^3.1.1" From 7fb4df3d0d3b1e733b56b82ac22f00847389124c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Mar 2023 15:24:33 +0000 Subject: [PATCH 694/785] Bump actions/setup-node from 2 to 3 Bumps [actions/setup-node](https://github.com/actions/setup-node) from 2 to 3. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d3d95106..bfb14f96 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -69,7 +69,7 @@ jobs: # bundler-cache: true # ruby-version: "3.1" # - run: gem install syntax_tree syntax_tree-haml syntax_tree-rbs - # - uses: actions/setup-node@v2 + # - uses: actions/setup-node@v3 # with: # node-version: 18.x # cache: yarn @@ -100,7 +100,7 @@ jobs: with: bundler-cache: true ruby-version: "3.1" - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v3 with: node-version: 16.x cache: yarn From 5e74dd1cc9608d2cf4085428008edac7ab0a2f51 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 12:56:40 +0000 Subject: [PATCH 695/785] Bump eslint from 8.35.0 to 8.36.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.35.0 to 8.36.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.35.0...v8.36.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 73 ++++++++++++++++++++++++++----------------------------- 1 file changed, 34 insertions(+), 39 deletions(-) diff --git a/yarn.lock b/yarn.lock index 188d364e..d4d9bbfc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -299,14 +299,26 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@eslint/eslintrc@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.0.0.tgz#943309d8697c52fc82c076e90c1c74fbbe69dbff" - integrity sha512-fluIaaV+GyV24CCu/ggiHdV+j4RNh85yQnAYS/G2mZODZgGmmlrgCydjUcV3YvxCm9x8nMAfThsqTni4KiXT4A== +"@eslint-community/eslint-utils@^4.2.0": + version "4.2.0" + resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.2.0.tgz#a831e6e468b4b2b5ae42bf658bea015bf10bc518" + integrity sha512-gB8T4H4DEfX2IV9zGDJPOBgP1e/DbfCPDTtEqUMckpvzS1OYtva8JdFYBqMwYk7xAQ429WGF/UPqn8uQ//h2vQ== + dependencies: + eslint-visitor-keys "^3.3.0" + +"@eslint-community/regexpp@^4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.4.0.tgz#3e61c564fcd6b921cb789838631c5ee44df09403" + integrity sha512-A9983Q0LnDGdLPjxyXQ00sbV+K+O+ko2Dr+CZigbHWtX9pNfxlaBkMR8X1CztI73zuEyEBXTVjx7CE+/VSwDiQ== + +"@eslint/eslintrc@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.0.1.tgz#7888fe7ec8f21bc26d646dbd2c11cd776e21192d" + integrity sha512-eFRmABvW2E5Ho6f5fHLqgena46rOj7r7OKHYfLElqcBfGFHHpjBhivyi5+jOEQuSpdc/1phIZJlbC2te+tZNIw== dependencies: ajv "^6.12.4" debug "^4.3.2" - espree "^9.4.0" + espree "^9.5.0" globals "^13.19.0" ignore "^5.2.0" import-fresh "^3.2.1" @@ -314,10 +326,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.35.0": - version "8.35.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.35.0.tgz#b7569632b0b788a0ca0e438235154e45d42813a7" - integrity sha512-JXdzbRiWclLVoD8sNUjR443VVlYqiYmDVT6rGUEIEHU5YJW0gaVZwV2xgM7D4arkvASqD0IlLUVjHiFuxaftRw== +"@eslint/js@8.36.0": + version "8.36.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.36.0.tgz#9837f768c03a1e4a30bd304a64fb8844f0e72efe" + integrity sha512-lxJ9R5ygVm8ZWgYdUweoq5ownDlJ4upvoWmO4eLxBYHdMo+vZ/Rx0EN6MbKWDJOSUGrqJy2Gt+Dyv/VKml0fjg== "@humanwhocodes/config-array@^0.11.8": version "0.11.8" @@ -1133,30 +1145,20 @@ eslint-scope@^7.1.1: esrecurse "^4.3.0" estraverse "^5.2.0" -eslint-utils@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" - integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== - dependencies: - eslint-visitor-keys "^2.0.0" - -eslint-visitor-keys@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" - integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== - eslint-visitor-keys@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.35.0: - version "8.35.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.35.0.tgz#fffad7c7e326bae606f0e8f436a6158566d42323" - integrity sha512-BxAf1fVL7w+JLRQhWl2pzGeSiGqbWumV4WNvc9Rhp6tiCtm4oHnyPBSEtMGZwrQgudFQ+otqzWoPB7x+hxoWsw== - dependencies: - "@eslint/eslintrc" "^2.0.0" - "@eslint/js" "8.35.0" + version "8.36.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.36.0.tgz#1bd72202200a5492f91803b113fb8a83b11285cf" + integrity sha512-Y956lmS7vDqomxlaaQAHVmeb4tNMp2FWIvU/RnU5BD3IKMD/MJPr76xdyr68P8tV1iNMvN2mRK0yy3c+UjL+bw== + dependencies: + "@eslint-community/eslint-utils" "^4.2.0" + "@eslint-community/regexpp" "^4.4.0" + "@eslint/eslintrc" "^2.0.1" + "@eslint/js" "8.36.0" "@humanwhocodes/config-array" "^0.11.8" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" @@ -1167,9 +1169,8 @@ eslint@^8.35.0: doctrine "^3.0.0" escape-string-regexp "^4.0.0" eslint-scope "^7.1.1" - eslint-utils "^3.0.0" eslint-visitor-keys "^3.3.0" - espree "^9.4.0" + espree "^9.5.0" esquery "^1.4.2" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -1191,15 +1192,14 @@ eslint@^8.35.0: minimatch "^3.1.2" natural-compare "^1.4.0" optionator "^0.9.1" - regexpp "^3.2.0" strip-ansi "^6.0.1" strip-json-comments "^3.1.0" text-table "^0.2.0" -espree@^9.4.0: - version "9.4.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.4.1.tgz#51d6092615567a2c2cff7833445e37c28c0065bd" - integrity sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg== +espree@^9.5.0: + version "9.5.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.5.0.tgz#3646d4e3f58907464edba852fa047e6a27bdf113" + integrity sha512-JPbJGhKc47++oo4JkEoTe2wjy4fmMwvFpgJT9cQzmfXKp22Dr6Hf1tdCteLz1h0P3t+mGvWZ+4Uankvh8+c6zw== dependencies: acorn "^8.8.0" acorn-jsx "^5.3.2" @@ -2346,11 +2346,6 @@ react-is@^18.0.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== -regexpp@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" - integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== - require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" From cbab69665b55126901e097a9bd11aeb7fd39fdcd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Mar 2023 13:49:54 +0000 Subject: [PATCH 696/785] Bump eslint-config-prettier from 8.7.0 to 8.8.0 Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.7.0 to 8.8.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.7.0...v8.8.0) --- updated-dependencies: - dependency-name: eslint-config-prettier dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index d4d9bbfc..ac377901 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1133,9 +1133,9 @@ escape-string-regexp@^4.0.0: integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== eslint-config-prettier@^8.7.0: - version "8.7.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.7.0.tgz#f1cc58a8afebc50980bd53475451df146c13182d" - integrity sha512-HHVXLSlVUhMSmyW4ZzEuvjpwqamgmlfkutD53cYXLikh4pt/modINRcCIApJ84czDxM4GZInwUrromsDdTImTA== + version "8.8.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz#bfda738d412adc917fd7b038857110efe98c9348" + integrity sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA== eslint-scope@^7.1.1: version "7.1.1" From 61ef8d9fc63c7d79a8e12522d31d599823981c64 Mon Sep 17 00:00:00 2001 From: David Alejandro <15317732+davidalejandroaguilar@users.noreply.github.com> Date: Fri, 24 Mar 2023 15:29:01 -0700 Subject: [PATCH 697/785] Support passing a custom Ruby executable path via `rubyExecutablePath` option --- README.md | 6 ++++++ src/plugin.js | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c27eeee0..c8615c5e 100644 --- a/README.md +++ b/README.md @@ -160,6 +160,12 @@ For [supported editor integrations](https://github.com/prettier/prettier/blob/ma Refer to [this issue](https://github.com/prettier/plugin-ruby/issues/113#issuecomment-783426539) if you're having difficulties. +Additional options: + +| Options | Default | Description | +| ----------------- | --------------------- | :-----: | +|`rubyExecutablePath`|`"ruby"`|Allows you to configure your Ruby executable path.| + ## Contributing Thanks so much for your interest in contributing! You can contribute in many ways, including: diff --git a/src/plugin.js b/src/plugin.js index 0fbb7dbb..0df039bf 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -84,7 +84,7 @@ export async function spawnServer(opts, killOnExit = true) { const filepath = path.join(tmpdir, `prettier-ruby-parser-${process.pid}.txt`); const server = spawn( - "ruby", + opts.rubyExecutablePath, [serverFilepath, `--plugins=${getPlugins(opts).join(",")}`, filepath], { env: Object.assign({}, process.env, { LANG: getLang() }), @@ -345,7 +345,7 @@ const plugin = { type: "string", category: "Ruby", default: "", - description: "The comma-separated list of plugins to require", + description: "The comma-separated list of plugins to require.", since: "3.1.0" }, rubySingleQuote: { @@ -355,6 +355,13 @@ const plugin = { description: "When double quotes are not necessary for interpolation, prefers the use of single quotes for string literals.", since: "1.0.0" + }, + rubyExecutablePath: { + type: "string", + category: "Ruby", + default: "ruby", + description: "The path to the Ruby executable to use to run the formatter.", + since: "3.3.0" } }, defaultOptions: { From bb99ef3a43d1286bbe8807ef13293e6f6785f425 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Mar 2023 12:56:46 +0000 Subject: [PATCH 698/785] Bump eslint from 8.36.0 to 8.37.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.36.0 to 8.37.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.36.0...v8.37.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/yarn.lock b/yarn.lock index ac377901..5f958ab5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -311,14 +311,14 @@ resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.4.0.tgz#3e61c564fcd6b921cb789838631c5ee44df09403" integrity sha512-A9983Q0LnDGdLPjxyXQ00sbV+K+O+ko2Dr+CZigbHWtX9pNfxlaBkMR8X1CztI73zuEyEBXTVjx7CE+/VSwDiQ== -"@eslint/eslintrc@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.0.1.tgz#7888fe7ec8f21bc26d646dbd2c11cd776e21192d" - integrity sha512-eFRmABvW2E5Ho6f5fHLqgena46rOj7r7OKHYfLElqcBfGFHHpjBhivyi5+jOEQuSpdc/1phIZJlbC2te+tZNIw== +"@eslint/eslintrc@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.0.2.tgz#01575e38707add677cf73ca1589abba8da899a02" + integrity sha512-3W4f5tDUra+pA+FzgugqL2pRimUTDJWKr7BINqOpkZrC0uYI0NIc0/JFgBROCU07HR6GieA5m3/rsPIhDmCXTQ== dependencies: ajv "^6.12.4" debug "^4.3.2" - espree "^9.5.0" + espree "^9.5.1" globals "^13.19.0" ignore "^5.2.0" import-fresh "^3.2.1" @@ -326,10 +326,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.36.0": - version "8.36.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.36.0.tgz#9837f768c03a1e4a30bd304a64fb8844f0e72efe" - integrity sha512-lxJ9R5ygVm8ZWgYdUweoq5ownDlJ4upvoWmO4eLxBYHdMo+vZ/Rx0EN6MbKWDJOSUGrqJy2Gt+Dyv/VKml0fjg== +"@eslint/js@8.37.0": + version "8.37.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.37.0.tgz#cf1b5fa24217fe007f6487a26d765274925efa7d" + integrity sha512-x5vzdtOOGgFVDCUs81QRB2+liax8rFg3+7hqM+QhBG0/G3F1ZsoYl97UrqgHgQ9KKT7G6c4V+aTUCgu/n22v1A== "@humanwhocodes/config-array@^0.11.8": version "0.11.8" @@ -1145,20 +1145,20 @@ eslint-scope@^7.1.1: esrecurse "^4.3.0" estraverse "^5.2.0" -eslint-visitor-keys@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" - integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz#c7f0f956124ce677047ddbc192a68f999454dedc" + integrity sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ== eslint@^8.35.0: - version "8.36.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.36.0.tgz#1bd72202200a5492f91803b113fb8a83b11285cf" - integrity sha512-Y956lmS7vDqomxlaaQAHVmeb4tNMp2FWIvU/RnU5BD3IKMD/MJPr76xdyr68P8tV1iNMvN2mRK0yy3c+UjL+bw== + version "8.37.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.37.0.tgz#1f660ef2ce49a0bfdec0b0d698e0b8b627287412" + integrity sha512-NU3Ps9nI05GUoVMxcZx1J8CNR6xOvUT4jAUMH5+z8lpp3aEdPVCImKw6PWG4PY+Vfkpr+jvMpxs/qoE7wq0sPw== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.4.0" - "@eslint/eslintrc" "^2.0.1" - "@eslint/js" "8.36.0" + "@eslint/eslintrc" "^2.0.2" + "@eslint/js" "8.37.0" "@humanwhocodes/config-array" "^0.11.8" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" @@ -1169,8 +1169,8 @@ eslint@^8.35.0: doctrine "^3.0.0" escape-string-regexp "^4.0.0" eslint-scope "^7.1.1" - eslint-visitor-keys "^3.3.0" - espree "^9.5.0" + eslint-visitor-keys "^3.4.0" + espree "^9.5.1" esquery "^1.4.2" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -1196,14 +1196,14 @@ eslint@^8.35.0: strip-json-comments "^3.1.0" text-table "^0.2.0" -espree@^9.5.0: - version "9.5.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.5.0.tgz#3646d4e3f58907464edba852fa047e6a27bdf113" - integrity sha512-JPbJGhKc47++oo4JkEoTe2wjy4fmMwvFpgJT9cQzmfXKp22Dr6Hf1tdCteLz1h0P3t+mGvWZ+4Uankvh8+c6zw== +espree@^9.5.1: + version "9.5.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.5.1.tgz#4f26a4d5f18905bf4f2e0bd99002aab807e96dd4" + integrity sha512-5yxtHSZXRSW5pvv3hAlXM5+/Oswi1AUFqBmbibKb5s6bp3rGIDkyXU6xCoyuuLhijr4SFwPrXRoZjz0AZDN9tg== dependencies: acorn "^8.8.0" acorn-jsx "^5.3.2" - eslint-visitor-keys "^3.3.0" + eslint-visitor-keys "^3.4.0" esprima@^4.0.0: version "4.0.1" From 7f188d7ae0a00f65847bac9a1f547e527724b8d3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 12:56:44 +0000 Subject: [PATCH 699/785] Bump eslint from 8.37.0 to 8.38.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.37.0 to 8.38.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.37.0...v8.38.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5f958ab5..63827b03 100644 --- a/yarn.lock +++ b/yarn.lock @@ -326,10 +326,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.37.0": - version "8.37.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.37.0.tgz#cf1b5fa24217fe007f6487a26d765274925efa7d" - integrity sha512-x5vzdtOOGgFVDCUs81QRB2+liax8rFg3+7hqM+QhBG0/G3F1ZsoYl97UrqgHgQ9KKT7G6c4V+aTUCgu/n22v1A== +"@eslint/js@8.38.0": + version "8.38.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.38.0.tgz#73a8a0d8aa8a8e6fe270431c5e72ae91b5337892" + integrity sha512-IoD2MfUnOV58ghIHCiil01PcohxjbYR/qCxsoC+xNgUwh1EY8jOOrYmu3d3a71+tJJ23uscEV4X2HJWMsPJu4g== "@humanwhocodes/config-array@^0.11.8": version "0.11.8" @@ -1151,14 +1151,14 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.0: integrity sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ== eslint@^8.35.0: - version "8.37.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.37.0.tgz#1f660ef2ce49a0bfdec0b0d698e0b8b627287412" - integrity sha512-NU3Ps9nI05GUoVMxcZx1J8CNR6xOvUT4jAUMH5+z8lpp3aEdPVCImKw6PWG4PY+Vfkpr+jvMpxs/qoE7wq0sPw== + version "8.38.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.38.0.tgz#a62c6f36e548a5574dd35728ac3c6209bd1e2f1a" + integrity sha512-pIdsD2jwlUGf/U38Jv97t8lq6HpaU/G9NKbYmpWpZGw3LdTNhZLbJePqxOXGB5+JEKfOPU/XLxYxFh03nr1KTg== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.4.0" "@eslint/eslintrc" "^2.0.2" - "@eslint/js" "8.37.0" + "@eslint/js" "8.38.0" "@humanwhocodes/config-array" "^0.11.8" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" From d40d4f3ed683f699d8addd0fe6125ae21de0dd25 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Apr 2023 13:03:24 +0000 Subject: [PATCH 700/785] Bump dependabot/fetch-metadata from 1.3.6 to 1.4.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.3.6 to 1.4.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.3.6...v1.4.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/auto-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index e54c9100..85e9fdb7 100644 --- a/.github/workflows/auto-merge.yml +++ b/.github/workflows/auto-merge.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v1.3.6 + uses: dependabot/fetch-metadata@v1.4.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" - name: Enable auto-merge for Dependabot PRs From cfb433e67899208007f405a834386371c34e0d5a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Apr 2023 12:56:44 +0000 Subject: [PATCH 701/785] Bump eslint from 8.38.0 to 8.39.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.38.0 to 8.39.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.38.0...v8.39.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/yarn.lock b/yarn.lock index 63827b03..681db70b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -326,10 +326,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.38.0": - version "8.38.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.38.0.tgz#73a8a0d8aa8a8e6fe270431c5e72ae91b5337892" - integrity sha512-IoD2MfUnOV58ghIHCiil01PcohxjbYR/qCxsoC+xNgUwh1EY8jOOrYmu3d3a71+tJJ23uscEV4X2HJWMsPJu4g== +"@eslint/js@8.39.0": + version "8.39.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.39.0.tgz#58b536bcc843f4cd1e02a7e6171da5c040f4d44b" + integrity sha512-kf9RB0Fg7NZfap83B3QOqOGg9QmD9yBudqQXzzOtn3i4y7ZUXe5ONeW34Gwi+TxhH4mvj72R1Zc300KUMa9Bng== "@humanwhocodes/config-array@^0.11.8": version "0.11.8" @@ -1137,10 +1137,10 @@ eslint-config-prettier@^8.7.0: resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz#bfda738d412adc917fd7b038857110efe98c9348" integrity sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA== -eslint-scope@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.1.tgz#fff34894c2f65e5226d3041ac480b4513a163642" - integrity sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw== +eslint-scope@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.0.tgz#f21ebdafda02352f103634b96dd47d9f81ca117b" + integrity sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw== dependencies: esrecurse "^4.3.0" estraverse "^5.2.0" @@ -1151,14 +1151,14 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.0: integrity sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ== eslint@^8.35.0: - version "8.38.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.38.0.tgz#a62c6f36e548a5574dd35728ac3c6209bd1e2f1a" - integrity sha512-pIdsD2jwlUGf/U38Jv97t8lq6HpaU/G9NKbYmpWpZGw3LdTNhZLbJePqxOXGB5+JEKfOPU/XLxYxFh03nr1KTg== + version "8.39.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.39.0.tgz#7fd20a295ef92d43809e914b70c39fd5a23cf3f1" + integrity sha512-mwiok6cy7KTW7rBpo05k6+p4YVZByLNjAZ/ACB9DRCu4YDRwjXI01tWHp6KAUWelsBetTxKK/2sHB0vdS8Z2Og== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.4.0" "@eslint/eslintrc" "^2.0.2" - "@eslint/js" "8.38.0" + "@eslint/js" "8.39.0" "@humanwhocodes/config-array" "^0.11.8" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" @@ -1168,7 +1168,7 @@ eslint@^8.35.0: debug "^4.3.2" doctrine "^3.0.0" escape-string-regexp "^4.0.0" - eslint-scope "^7.1.1" + eslint-scope "^7.2.0" eslint-visitor-keys "^3.4.0" espree "^9.5.1" esquery "^1.4.2" From 7e009f0110e5e913e5b16206c72fb305ab2d1896 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Apr 2023 12:56:58 +0000 Subject: [PATCH 702/785] Bump prettier from 3.0.0-alpha.6 to 3.0.0-alpha.10 Bumps [prettier](https://github.com/prettier/prettier) from 3.0.0-alpha.6 to 3.0.0-alpha.10. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/commits) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 63827b03..95e62541 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2285,9 +2285,9 @@ prelude-ls@^1.2.1: integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== prettier@>=3.0.0-alpha.6: - version "3.0.0-alpha.6" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0-alpha.6.tgz#c562f9f54966aff792c6920e6a29fbffd1ae07b6" - integrity sha512-AdbQSZ6Oo+iy9Ekzmsgno05P1uX2vqPkjOMJqRfP8hTe+m6iDw4Nt7bPFpWZ/HYCU+3f0P5U0o2ghxQwwkLH7A== + version "3.0.0-alpha.10" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0-alpha.10.tgz#70f3d4a5cec61c7d7cc3576da020f799d9428b44" + integrity sha512-/mlmcS2qsidHpkGef6WZ+N9AtYmT80+pJHvolUNsydJbJCJNj+aXtSJoK77BZ0aLMpLWxs577EN9o6JXvEMfUA== pretty-format@^29.5.0: version "29.5.0" From fc7127204a734da39168cc7ddb7f6046ec9d0572 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Apr 2023 12:56:42 +0000 Subject: [PATCH 703/785] Bump prettier from 3.0.0-alpha.10 to 3.0.0-alpha.11 Bumps [prettier](https://github.com/prettier/prettier) from 3.0.0-alpha.10 to 3.0.0-alpha.11. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/commits) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 36277de9..8c7968fc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2285,9 +2285,9 @@ prelude-ls@^1.2.1: integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== prettier@>=3.0.0-alpha.6: - version "3.0.0-alpha.10" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0-alpha.10.tgz#70f3d4a5cec61c7d7cc3576da020f799d9428b44" - integrity sha512-/mlmcS2qsidHpkGef6WZ+N9AtYmT80+pJHvolUNsydJbJCJNj+aXtSJoK77BZ0aLMpLWxs577EN9o6JXvEMfUA== + version "3.0.0-alpha.11" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0-alpha.11.tgz#fb6f9c7b4495fcc8c70b6633de885bf38b8585af" + integrity sha512-/x61/kcsjjU8kUEDKnn8PtqRzMXROg68KbUOtRC09oOQ3Vs6Bjwz7tabF98xu/K/RP/jZzWIvxphWr881DaokQ== pretty-format@^29.5.0: version "29.5.0" From 420a827a7f81567b2f913cffef74dd79c188b464 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 May 2023 12:56:43 +0000 Subject: [PATCH 704/785] Bump eslint from 8.39.0 to 8.40.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.39.0 to 8.40.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.39.0...v8.40.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/yarn.lock b/yarn.lock index 8c7968fc..3233d417 100644 --- a/yarn.lock +++ b/yarn.lock @@ -311,14 +311,14 @@ resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.4.0.tgz#3e61c564fcd6b921cb789838631c5ee44df09403" integrity sha512-A9983Q0LnDGdLPjxyXQ00sbV+K+O+ko2Dr+CZigbHWtX9pNfxlaBkMR8X1CztI73zuEyEBXTVjx7CE+/VSwDiQ== -"@eslint/eslintrc@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.0.2.tgz#01575e38707add677cf73ca1589abba8da899a02" - integrity sha512-3W4f5tDUra+pA+FzgugqL2pRimUTDJWKr7BINqOpkZrC0uYI0NIc0/JFgBROCU07HR6GieA5m3/rsPIhDmCXTQ== +"@eslint/eslintrc@^2.0.3": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.0.3.tgz#4910db5505f4d503f27774bf356e3704818a0331" + integrity sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ== dependencies: ajv "^6.12.4" debug "^4.3.2" - espree "^9.5.1" + espree "^9.5.2" globals "^13.19.0" ignore "^5.2.0" import-fresh "^3.2.1" @@ -326,10 +326,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.39.0": - version "8.39.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.39.0.tgz#58b536bcc843f4cd1e02a7e6171da5c040f4d44b" - integrity sha512-kf9RB0Fg7NZfap83B3QOqOGg9QmD9yBudqQXzzOtn3i4y7ZUXe5ONeW34Gwi+TxhH4mvj72R1Zc300KUMa9Bng== +"@eslint/js@8.40.0": + version "8.40.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.40.0.tgz#3ba73359e11f5a7bd3e407f70b3528abfae69cec" + integrity sha512-ElyB54bJIhXQYVKjDSvCkPO1iU1tSAeVQJbllWJq1XQSmmA4dgFk8CbiBGpiOPxleE48vDogxCtmMYku4HSVLA== "@humanwhocodes/config-array@^0.11.8": version "0.11.8" @@ -1145,20 +1145,20 @@ eslint-scope@^7.2.0: esrecurse "^4.3.0" estraverse "^5.2.0" -eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz#c7f0f956124ce677047ddbc192a68f999454dedc" - integrity sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ== +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: + version "3.4.1" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz#c22c48f48942d08ca824cc526211ae400478a994" + integrity sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA== eslint@^8.35.0: - version "8.39.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.39.0.tgz#7fd20a295ef92d43809e914b70c39fd5a23cf3f1" - integrity sha512-mwiok6cy7KTW7rBpo05k6+p4YVZByLNjAZ/ACB9DRCu4YDRwjXI01tWHp6KAUWelsBetTxKK/2sHB0vdS8Z2Og== + version "8.40.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.40.0.tgz#a564cd0099f38542c4e9a2f630fa45bf33bc42a4" + integrity sha512-bvR+TsP9EHL3TqNtj9sCNJVAFK3fBN8Q7g5waghxyRsPLIMwL73XSKnZFK0hk/O2ANC+iAoq6PWMQ+IfBAJIiQ== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.4.0" - "@eslint/eslintrc" "^2.0.2" - "@eslint/js" "8.39.0" + "@eslint/eslintrc" "^2.0.3" + "@eslint/js" "8.40.0" "@humanwhocodes/config-array" "^0.11.8" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" @@ -1169,8 +1169,8 @@ eslint@^8.35.0: doctrine "^3.0.0" escape-string-regexp "^4.0.0" eslint-scope "^7.2.0" - eslint-visitor-keys "^3.4.0" - espree "^9.5.1" + eslint-visitor-keys "^3.4.1" + espree "^9.5.2" esquery "^1.4.2" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -1196,14 +1196,14 @@ eslint@^8.35.0: strip-json-comments "^3.1.0" text-table "^0.2.0" -espree@^9.5.1: - version "9.5.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.5.1.tgz#4f26a4d5f18905bf4f2e0bd99002aab807e96dd4" - integrity sha512-5yxtHSZXRSW5pvv3hAlXM5+/Oswi1AUFqBmbibKb5s6bp3rGIDkyXU6xCoyuuLhijr4SFwPrXRoZjz0AZDN9tg== +espree@^9.5.2: + version "9.5.2" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.5.2.tgz#e994e7dc33a082a7a82dceaf12883a829353215b" + integrity sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw== dependencies: acorn "^8.8.0" acorn-jsx "^5.3.2" - eslint-visitor-keys "^3.4.0" + eslint-visitor-keys "^3.4.1" esprima@^4.0.0: version "4.0.1" From bd8e324e10a458f0213e1b56e147f7186405e7b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 May 2023 12:56:42 +0000 Subject: [PATCH 705/785] Bump eslint from 8.40.0 to 8.41.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.40.0 to 8.41.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.40.0...v8.41.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/yarn.lock b/yarn.lock index 3233d417..56494d89 100644 --- a/yarn.lock +++ b/yarn.lock @@ -326,10 +326,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.40.0": - version "8.40.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.40.0.tgz#3ba73359e11f5a7bd3e407f70b3528abfae69cec" - integrity sha512-ElyB54bJIhXQYVKjDSvCkPO1iU1tSAeVQJbllWJq1XQSmmA4dgFk8CbiBGpiOPxleE48vDogxCtmMYku4HSVLA== +"@eslint/js@8.41.0": + version "8.41.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.41.0.tgz#080321c3b68253522f7646b55b577dd99d2950b3" + integrity sha512-LxcyMGxwmTh2lY9FwHPGWOHmYFCZvbrFCBZL4FzSSsxsRPuhrYUg/49/0KDfW8tnIEaEHtfmn6+NPN+1DqaNmA== "@humanwhocodes/config-array@^0.11.8": version "0.11.8" @@ -1151,14 +1151,14 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: integrity sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA== eslint@^8.35.0: - version "8.40.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.40.0.tgz#a564cd0099f38542c4e9a2f630fa45bf33bc42a4" - integrity sha512-bvR+TsP9EHL3TqNtj9sCNJVAFK3fBN8Q7g5waghxyRsPLIMwL73XSKnZFK0hk/O2ANC+iAoq6PWMQ+IfBAJIiQ== + version "8.41.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.41.0.tgz#3062ca73363b4714b16dbc1e60f035e6134b6f1c" + integrity sha512-WQDQpzGBOP5IrXPo4Hc0814r4/v2rrIsB0rhT7jtunIalgg6gYXWhRMOejVO8yH21T/FGaxjmFjBMNqcIlmH1Q== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.4.0" "@eslint/eslintrc" "^2.0.3" - "@eslint/js" "8.40.0" + "@eslint/js" "8.41.0" "@humanwhocodes/config-array" "^0.11.8" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" @@ -1178,13 +1178,12 @@ eslint@^8.35.0: find-up "^5.0.0" glob-parent "^6.0.2" globals "^13.19.0" - grapheme-splitter "^1.0.4" + graphemer "^1.4.0" ignore "^5.2.0" import-fresh "^3.0.0" imurmurhash "^0.1.4" is-glob "^4.0.0" is-path-inside "^3.0.3" - js-sdsl "^4.1.4" js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" @@ -1430,10 +1429,10 @@ graceful-fs@^4.2.9: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== -grapheme-splitter@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" - integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== +graphemer@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" + integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== has-flag@^3.0.0: version "3.0.0" @@ -1968,11 +1967,6 @@ jest@^29.5.0: import-local "^3.0.2" jest-cli "^29.5.0" -js-sdsl@^4.1.4: - version "4.3.0" - resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.3.0.tgz#aeefe32a451f7af88425b11fdb5f58c90ae1d711" - integrity sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ== - js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" From 4fa5f7dcca674a1559705109fd76feed3dd3771c Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 22 May 2023 17:30:45 -0400 Subject: [PATCH 706/785] Include even more details in changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10ec685b..13a6d763 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,7 +59,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#1198](https://github.com/prettier/plugin-ruby/issues/1198) - pas-f, kddnewton - Fix crashes on JRuby with do blocks. - [#1131](https://github.com/prettier/plugin-ruby/issues/1131) - hyrious, kddnewton - Ensure zombie processes are not left around when the server exits. - [#1206](https://github.com/prettier/plugin-ruby/pull/1206) - kddnewton - Switch back to plain JavaScript for development. -- [#1190](https://github.com/prettier/plugin-ruby/pull/1190) - kddnewton - Switch over to using Syntax Tree for the backend. +- [#1190](https://github.com/prettier/plugin-ruby/pull/1190) - kddnewton - Switch over to using Syntax Tree for the backend. This now requires that users install the necessary gems. ### Removed From a5b406dd5c081edb4069caecd82b9d01ff9f339b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 May 2023 13:02:02 +0000 Subject: [PATCH 707/785] Bump dependabot/fetch-metadata from 1.4.0 to 1.5.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.4.0 to 1.5.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.4.0...v1.5.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/auto-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index 85e9fdb7..d56afdfb 100644 --- a/.github/workflows/auto-merge.yml +++ b/.github/workflows/auto-merge.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v1.4.0 + uses: dependabot/fetch-metadata@v1.5.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" - name: Enable auto-merge for Dependabot PRs From 39a10270e357e54796657a891d07c73439771f7e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 May 2023 13:03:26 +0000 Subject: [PATCH 708/785] Bump dependabot/fetch-metadata from 1.5.0 to 1.5.1 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.5.0 to 1.5.1. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.5.0...v1.5.1) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/auto-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index d56afdfb..57830be5 100644 --- a/.github/workflows/auto-merge.yml +++ b/.github/workflows/auto-merge.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v1.5.0 + uses: dependabot/fetch-metadata@v1.5.1 with: github-token: "${{ secrets.GITHUB_TOKEN }}" - name: Enable auto-merge for Dependabot PRs From 9e29849d65cefc976c3e2b4ab88c16d11869ea1a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 May 2023 12:56:43 +0000 Subject: [PATCH 709/785] Bump prettier from 3.0.0-alpha.11 to 3.0.0-alpha.12 Bumps [prettier](https://github.com/prettier/prettier) from 3.0.0-alpha.11 to 3.0.0-alpha.12. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/commits) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 56494d89..c25e1659 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2279,9 +2279,9 @@ prelude-ls@^1.2.1: integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== prettier@>=3.0.0-alpha.6: - version "3.0.0-alpha.11" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0-alpha.11.tgz#fb6f9c7b4495fcc8c70b6633de885bf38b8585af" - integrity sha512-/x61/kcsjjU8kUEDKnn8PtqRzMXROg68KbUOtRC09oOQ3Vs6Bjwz7tabF98xu/K/RP/jZzWIvxphWr881DaokQ== + version "3.0.0-alpha.12" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0-alpha.12.tgz#c38228f277e870298b6d95e579e54ea500487505" + integrity sha512-QCCLoJ+ttw/DV6zLiHJDZdC7sZ23fk3gCulQmjU6AuA/Uk8o6qbzM4afyEDIM94xhj7MEGDtKYo+ZFpxwjmSEg== pretty-format@^29.5.0: version "29.5.0" From 39995fc7573f062729ac98a258357db48e0923b2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Jun 2023 12:56:35 +0000 Subject: [PATCH 710/785] Bump eslint from 8.41.0 to 8.42.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.41.0 to 8.42.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.41.0...v8.42.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/yarn.lock b/yarn.lock index c25e1659..7eb914fa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -326,15 +326,15 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.41.0": - version "8.41.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.41.0.tgz#080321c3b68253522f7646b55b577dd99d2950b3" - integrity sha512-LxcyMGxwmTh2lY9FwHPGWOHmYFCZvbrFCBZL4FzSSsxsRPuhrYUg/49/0KDfW8tnIEaEHtfmn6+NPN+1DqaNmA== +"@eslint/js@8.42.0": + version "8.42.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.42.0.tgz#484a1d638de2911e6f5a30c12f49c7e4a3270fb6" + integrity sha512-6SWlXpWU5AvId8Ac7zjzmIOqMOba/JWY8XZ4A7q7Gn1Vlfg/SFFIlrtHXt9nPn4op9ZPAkl91Jao+QQv3r/ukw== -"@humanwhocodes/config-array@^0.11.8": - version "0.11.8" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.8.tgz#03595ac2075a4dc0f191cc2131de14fbd7d410b9" - integrity sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g== +"@humanwhocodes/config-array@^0.11.10": + version "0.11.10" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.10.tgz#5a3ffe32cc9306365fb3fd572596cd602d5e12d2" + integrity sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ== dependencies: "@humanwhocodes/object-schema" "^1.2.1" debug "^4.1.1" @@ -1151,15 +1151,15 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: integrity sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA== eslint@^8.35.0: - version "8.41.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.41.0.tgz#3062ca73363b4714b16dbc1e60f035e6134b6f1c" - integrity sha512-WQDQpzGBOP5IrXPo4Hc0814r4/v2rrIsB0rhT7jtunIalgg6gYXWhRMOejVO8yH21T/FGaxjmFjBMNqcIlmH1Q== + version "8.42.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.42.0.tgz#7bebdc3a55f9ed7167251fe7259f75219cade291" + integrity sha512-ulg9Ms6E1WPf67PHaEY4/6E2tEn5/f7FXGzr3t9cBMugOmf1INYvuUwwh1aXQN4MfJ6a5K2iNwP3w4AColvI9A== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.4.0" "@eslint/eslintrc" "^2.0.3" - "@eslint/js" "8.41.0" - "@humanwhocodes/config-array" "^0.11.8" + "@eslint/js" "8.42.0" + "@humanwhocodes/config-array" "^0.11.10" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" ajv "^6.10.0" From c23ca9ba98390009bc50585533d6858d38ea7b6a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Jun 2023 12:56:44 +0000 Subject: [PATCH 711/785] Bump eslint from 8.42.0 to 8.43.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.42.0 to 8.43.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.42.0...v8.43.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7eb914fa..9ec23840 100644 --- a/yarn.lock +++ b/yarn.lock @@ -326,10 +326,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.42.0": - version "8.42.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.42.0.tgz#484a1d638de2911e6f5a30c12f49c7e4a3270fb6" - integrity sha512-6SWlXpWU5AvId8Ac7zjzmIOqMOba/JWY8XZ4A7q7Gn1Vlfg/SFFIlrtHXt9nPn4op9ZPAkl91Jao+QQv3r/ukw== +"@eslint/js@8.43.0": + version "8.43.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.43.0.tgz#559ca3d9ddbd6bf907ad524320a0d14b85586af0" + integrity sha512-s2UHCoiXfxMvmfzqoN+vrQ84ahUSYde9qNO1MdxmoEhyHWsfmwOpFlwYV+ePJEVc7gFnATGUi376WowX1N7tFg== "@humanwhocodes/config-array@^0.11.10": version "0.11.10" @@ -1151,14 +1151,14 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: integrity sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA== eslint@^8.35.0: - version "8.42.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.42.0.tgz#7bebdc3a55f9ed7167251fe7259f75219cade291" - integrity sha512-ulg9Ms6E1WPf67PHaEY4/6E2tEn5/f7FXGzr3t9cBMugOmf1INYvuUwwh1aXQN4MfJ6a5K2iNwP3w4AColvI9A== + version "8.43.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.43.0.tgz#3e8c6066a57097adfd9d390b8fc93075f257a094" + integrity sha512-aaCpf2JqqKesMFGgmRPessmVKjcGXqdlAYLLC3THM8t5nBRZRQ+st5WM/hoJXkdioEXLLbXgclUpM0TXo5HX5Q== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.4.0" "@eslint/eslintrc" "^2.0.3" - "@eslint/js" "8.42.0" + "@eslint/js" "8.43.0" "@humanwhocodes/config-array" "^0.11.10" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" From c683165db68c51f9b514c4418656e9f31609560c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Jun 2023 13:03:14 +0000 Subject: [PATCH 712/785] Bump dependabot/fetch-metadata from 1.5.1 to 1.6.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.5.1 to 1.6.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.5.1...v1.6.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/auto-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index 57830be5..8ca265e0 100644 --- a/.github/workflows/auto-merge.yml +++ b/.github/workflows/auto-merge.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v1.5.1 + uses: dependabot/fetch-metadata@v1.6.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" - name: Enable auto-merge for Dependabot PRs From fb812a3037b3cc431a3199dea32a024c2b246690 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jul 2023 12:01:45 +0000 Subject: [PATCH 713/785] Bump eslint from 8.43.0 to 8.44.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.43.0 to 8.44.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.43.0...v8.44.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 70 +++++++++++++++++++++++++++---------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9ec23840..2fe03826 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,11 @@ # yarn lockfile v1 +"@aashutoshrathi/word-wrap@^1.2.3": + version "1.2.6" + resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" + integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== + "@ampproject/remapping@^2.2.0": version "2.2.0" resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.0.tgz#56c133824780de3174aed5ab6834f3026790154d" @@ -311,14 +316,14 @@ resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.4.0.tgz#3e61c564fcd6b921cb789838631c5ee44df09403" integrity sha512-A9983Q0LnDGdLPjxyXQ00sbV+K+O+ko2Dr+CZigbHWtX9pNfxlaBkMR8X1CztI73zuEyEBXTVjx7CE+/VSwDiQ== -"@eslint/eslintrc@^2.0.3": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.0.3.tgz#4910db5505f4d503f27774bf356e3704818a0331" - integrity sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ== +"@eslint/eslintrc@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.0.tgz#82256f164cc9e0b59669efc19d57f8092706841d" + integrity sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A== dependencies: ajv "^6.12.4" debug "^4.3.2" - espree "^9.5.2" + espree "^9.6.0" globals "^13.19.0" ignore "^5.2.0" import-fresh "^3.2.1" @@ -326,10 +331,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.43.0": - version "8.43.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.43.0.tgz#559ca3d9ddbd6bf907ad524320a0d14b85586af0" - integrity sha512-s2UHCoiXfxMvmfzqoN+vrQ84ahUSYde9qNO1MdxmoEhyHWsfmwOpFlwYV+ePJEVc7gFnATGUi376WowX1N7tFg== +"@eslint/js@8.44.0": + version "8.44.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.44.0.tgz#961a5903c74139390478bdc808bcde3fc45ab7af" + integrity sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw== "@humanwhocodes/config-array@^0.11.10": version "0.11.10" @@ -734,10 +739,10 @@ acorn-jsx@^5.3.2: resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn@^8.8.0: - version "8.8.2" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" - integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== +acorn@^8.9.0: + version "8.9.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.9.0.tgz#78a16e3b2bcc198c10822786fa6679e245db5b59" + integrity sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ== ajv@^6.10.0, ajv@^6.12.4: version "6.12.6" @@ -1151,14 +1156,14 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: integrity sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA== eslint@^8.35.0: - version "8.43.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.43.0.tgz#3e8c6066a57097adfd9d390b8fc93075f257a094" - integrity sha512-aaCpf2JqqKesMFGgmRPessmVKjcGXqdlAYLLC3THM8t5nBRZRQ+st5WM/hoJXkdioEXLLbXgclUpM0TXo5HX5Q== + version "8.44.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.44.0.tgz#51246e3889b259bbcd1d7d736a0c10add4f0e500" + integrity sha512-0wpHoUbDUHgNCyvFB5aXLiQVfK9B0at6gUvzy83k4kAsQ/u769TQDX6iKC+aO4upIHO9WSaA3QoXYQDHbNwf1A== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.4.0" - "@eslint/eslintrc" "^2.0.3" - "@eslint/js" "8.43.0" + "@eslint/eslintrc" "^2.1.0" + "@eslint/js" "8.44.0" "@humanwhocodes/config-array" "^0.11.10" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" @@ -1170,7 +1175,7 @@ eslint@^8.35.0: escape-string-regexp "^4.0.0" eslint-scope "^7.2.0" eslint-visitor-keys "^3.4.1" - espree "^9.5.2" + espree "^9.6.0" esquery "^1.4.2" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -1190,17 +1195,17 @@ eslint@^8.35.0: lodash.merge "^4.6.2" minimatch "^3.1.2" natural-compare "^1.4.0" - optionator "^0.9.1" + optionator "^0.9.3" strip-ansi "^6.0.1" strip-json-comments "^3.1.0" text-table "^0.2.0" -espree@^9.5.2: - version "9.5.2" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.5.2.tgz#e994e7dc33a082a7a82dceaf12883a829353215b" - integrity sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw== +espree@^9.6.0: + version "9.6.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.6.0.tgz#80869754b1c6560f32e3b6929194a3fe07c5b82f" + integrity sha512-1FH/IiruXZ84tpUlm0aCUEwMl2Ho5ilqVh0VvQXw+byAz/4SAciyHLlfmL5WYqsvD38oymdUwBss0LtK8m4s/A== dependencies: - acorn "^8.8.0" + acorn "^8.9.0" acorn-jsx "^5.3.2" eslint-visitor-keys "^3.4.1" @@ -2169,17 +2174,17 @@ onetime@^5.1.0, onetime@^5.1.2: dependencies: mimic-fn "^2.1.0" -optionator@^0.9.1: - version "0.9.1" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" - integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== +optionator@^0.9.3: + version "0.9.3" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64" + integrity sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg== dependencies: + "@aashutoshrathi/word-wrap" "^1.2.3" deep-is "^0.1.3" fast-levenshtein "^2.0.6" levn "^0.4.1" prelude-ls "^1.2.1" type-check "^0.4.0" - word-wrap "^1.2.3" p-limit@^2.2.0: version "2.3.0" @@ -2615,11 +2620,6 @@ which@^2.0.1: dependencies: isexe "^2.0.0" -word-wrap@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" - integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== - wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" From 8d77df50da6432cfb748dbe7078790547c40c8a2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Jul 2023 12:46:07 +0000 Subject: [PATCH 714/785] Bump prettier from 3.0.0-alpha.12 to 3.0.0 Bumps [prettier](https://github.com/prettier/prettier) from 3.0.0-alpha.12 to 3.0.0. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/commits/3.0.0) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2fe03826..c2770d94 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2284,9 +2284,9 @@ prelude-ls@^1.2.1: integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== prettier@>=3.0.0-alpha.6: - version "3.0.0-alpha.12" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0-alpha.12.tgz#c38228f277e870298b6d95e579e54ea500487505" - integrity sha512-QCCLoJ+ttw/DV6zLiHJDZdC7sZ23fk3gCulQmjU6AuA/Uk8o6qbzM4afyEDIM94xhj7MEGDtKYo+ZFpxwjmSEg== + version "3.0.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0.tgz#e7b19f691245a21d618c68bc54dc06122f6105ae" + integrity sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g== pretty-format@^29.5.0: version "29.5.0" From 1bf93eb88205116ecdc5755e5b3ef136d59997be Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Jul 2023 12:46:19 +0000 Subject: [PATCH 715/785] Bump jest from 29.5.0 to 29.6.0 Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.5.0 to 29.6.0. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.6.0/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 649 +++++++++++++++++++++++++++--------------------------- 1 file changed, 328 insertions(+), 321 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2fe03826..1f3febf3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -274,7 +274,7 @@ "@babel/parser" "^7.20.7" "@babel/types" "^7.20.7" -"@babel/traverse@^7.21.0", "@babel/traverse@^7.21.2", "@babel/traverse@^7.7.2": +"@babel/traverse@^7.21.0", "@babel/traverse@^7.21.2": version "7.21.2" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.21.2.tgz#ac7e1f27658750892e815e60ae90f382a46d8e75" integrity sha512-ts5FFU/dSUPS13tv8XiEObDu9K+iagEKME9kAbaP7r0Y9KtZJZ+NGndDvWoRAYNpeWafbpFeki3q9QoMD6gxyw== @@ -371,28 +371,28 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.5.0.tgz#593a6c5c0d3f75689835f1b3b4688c4f8544cb57" - integrity sha512-NEpkObxPwyw/XxZVLPmAGKE89IQRp4puc6IQRPru6JKd1M3fW9v1xM1AnzIJE65hbCkzQAdnL8P47e9hzhiYLQ== +"@jest/console@^29.6.0": + version "29.6.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.6.0.tgz#ad0ae19e56e3ca34f620bab7b3e0bb7e3e655275" + integrity sha512-anb6L1yg7uPQpytNVA5skRaXy3BmrsU8icRhTVNbWdjYWDDfy8M1Kq5HIVRpYoABdbpqsc5Dr+jtu4+qWRQBiQ== dependencies: - "@jest/types" "^29.5.0" + "@jest/types" "^29.6.0" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^29.5.0" - jest-util "^29.5.0" + jest-message-util "^29.6.0" + jest-util "^29.6.0" slash "^3.0.0" -"@jest/core@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.5.0.tgz#76674b96904484e8214614d17261cc491e5f1f03" - integrity sha512-28UzQc7ulUrOQw1IsN/kv1QES3q2kkbl/wGslyhAclqZ/8cMdB5M68BffkIdSJgKBUt50d3hbwJ92XESlE7LiQ== - dependencies: - "@jest/console" "^29.5.0" - "@jest/reporters" "^29.5.0" - "@jest/test-result" "^29.5.0" - "@jest/transform" "^29.5.0" - "@jest/types" "^29.5.0" +"@jest/core@^29.6.0": + version "29.6.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.6.0.tgz#a71da7b99777ff4a3d534bd2529358872909905f" + integrity sha512-5dbMHfY/5R9m8NbgmB3JlxQqooZ/ooPSOiwEQZZ+HODwJTbIu37seVcZNBK29aMdXtjvTRB3f6LCvkKq+r8uQA== + dependencies: + "@jest/console" "^29.6.0" + "@jest/reporters" "^29.6.0" + "@jest/test-result" "^29.6.0" + "@jest/transform" "^29.6.0" + "@jest/types" "^29.6.0" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" @@ -400,81 +400,81 @@ exit "^0.1.2" graceful-fs "^4.2.9" jest-changed-files "^29.5.0" - jest-config "^29.5.0" - jest-haste-map "^29.5.0" - jest-message-util "^29.5.0" + jest-config "^29.6.0" + jest-haste-map "^29.6.0" + jest-message-util "^29.6.0" jest-regex-util "^29.4.3" - jest-resolve "^29.5.0" - jest-resolve-dependencies "^29.5.0" - jest-runner "^29.5.0" - jest-runtime "^29.5.0" - jest-snapshot "^29.5.0" - jest-util "^29.5.0" - jest-validate "^29.5.0" - jest-watcher "^29.5.0" + jest-resolve "^29.6.0" + jest-resolve-dependencies "^29.6.0" + jest-runner "^29.6.0" + jest-runtime "^29.6.0" + jest-snapshot "^29.6.0" + jest-util "^29.6.0" + jest-validate "^29.6.0" + jest-watcher "^29.6.0" micromatch "^4.0.4" - pretty-format "^29.5.0" + pretty-format "^29.6.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.5.0.tgz#9152d56317c1fdb1af389c46640ba74ef0bb4c65" - integrity sha512-5FXw2+wD29YU1d4I2htpRX7jYnAyTRjP2CsXQdo9SAM8g3ifxWPSV0HnClSn71xwctr0U3oZIIH+dtbfmnbXVQ== +"@jest/environment@^29.6.0": + version "29.6.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.6.0.tgz#a873d228159cbba812505f7d13e2d1a2d04a577a" + integrity sha512-bUZLYUxYlUIsslBbxII0fq0kr1+friI3Gty+cRLmocGB1jdcAHs7FS8QdCDqedE8q4DZE1g/AJHH6OJZBLGGsg== dependencies: - "@jest/fake-timers" "^29.5.0" - "@jest/types" "^29.5.0" + "@jest/fake-timers" "^29.6.0" + "@jest/types" "^29.6.0" "@types/node" "*" - jest-mock "^29.5.0" + jest-mock "^29.6.0" -"@jest/expect-utils@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.5.0.tgz#f74fad6b6e20f924582dc8ecbf2cb800fe43a036" - integrity sha512-fmKzsidoXQT2KwnrwE0SQq3uj8Z763vzR8LnLBwC2qYWEFpjX8daRsk6rHUM1QvNlEW/UJXNXm59ztmJJWs2Mg== +"@jest/expect-utils@^29.6.0": + version "29.6.0" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.6.0.tgz#14596ba728d61b0cf70f7d5c8fb88b8a82ea9def" + integrity sha512-LLSQQN7oypMSETKoPWpsWYVKJd9LQWmSDDAc4hUQ4JocVC7LAMy9R3ZMhlnLwbcFvQORZnZR7HM893Px6cJhvA== dependencies: jest-get-type "^29.4.3" -"@jest/expect@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.5.0.tgz#80952f5316b23c483fbca4363ce822af79c38fba" - integrity sha512-PueDR2HGihN3ciUNGr4uelropW7rqUfTiOn+8u0leg/42UhblPxHkfoh0Ruu3I9Y1962P3u2DY4+h7GVTSVU6g== +"@jest/expect@^29.6.0": + version "29.6.0" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.6.0.tgz#2a25759ec696bc03d3e5cfeba5a26732431f844f" + integrity sha512-a7pISPW28Q3c0/pLwz4mQ6tbAI+hc8/0CJp9ix6e9U4dQ6TiHQX82CT5DV5BMWaw8bFH4E6zsfZxXdn6Ka23Bw== dependencies: - expect "^29.5.0" - jest-snapshot "^29.5.0" + expect "^29.6.0" + jest-snapshot "^29.6.0" -"@jest/fake-timers@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.5.0.tgz#d4d09ec3286b3d90c60bdcd66ed28d35f1b4dc2c" - integrity sha512-9ARvuAAQcBwDAqOnglWq2zwNIRUDtk/SCkp/ToGEhFv5r86K21l+VEs0qNTaXtyiY0lEePl3kylijSYJQqdbDg== +"@jest/fake-timers@^29.6.0": + version "29.6.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.6.0.tgz#9751cbabc86a39a1e6827cfcbabeba0207a63c97" + integrity sha512-nuCU46AsZoskthWSDS2Aj6LARgyNcp5Fjx2qxsO/fPl1Wp1CJ+dBDqs0OkEcJK8FBeV/MbjH5efe79M2sHcV+A== dependencies: - "@jest/types" "^29.5.0" + "@jest/types" "^29.6.0" "@sinonjs/fake-timers" "^10.0.2" "@types/node" "*" - jest-message-util "^29.5.0" - jest-mock "^29.5.0" - jest-util "^29.5.0" + jest-message-util "^29.6.0" + jest-mock "^29.6.0" + jest-util "^29.6.0" -"@jest/globals@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.5.0.tgz#6166c0bfc374c58268677539d0c181f9c1833298" - integrity sha512-S02y0qMWGihdzNbUiqSAiKSpSozSuHX5UYc7QbnHP+D9Lyw8DgGGCinrN9uSuHPeKgSSzvPom2q1nAtBvUsvPQ== +"@jest/globals@^29.6.0": + version "29.6.0" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.6.0.tgz#e1603da83f69ed1a75e272d15da34a6a2fca1e24" + integrity sha512-IQQ3hZ2D/hwEwXSMv5GbfhzdH0nTQR3KPYxnuW6gYWbd6+7/zgMz7Okn6EgBbNtJNONq03k5EKA6HqGyzRbpeg== dependencies: - "@jest/environment" "^29.5.0" - "@jest/expect" "^29.5.0" - "@jest/types" "^29.5.0" - jest-mock "^29.5.0" + "@jest/environment" "^29.6.0" + "@jest/expect" "^29.6.0" + "@jest/types" "^29.6.0" + jest-mock "^29.6.0" -"@jest/reporters@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.5.0.tgz#985dfd91290cd78ddae4914ba7921bcbabe8ac9b" - integrity sha512-D05STXqj/M8bP9hQNSICtPqz97u7ffGzZu+9XLucXhkOFBqKcXe04JLZOgIekOxdb73MAoBUFnqvf7MCpKk5OA== +"@jest/reporters@^29.6.0": + version "29.6.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.6.0.tgz#09e6d47b3d9b69172cbc344d4cb8954966a7a466" + integrity sha512-dWEq4HI0VvHcAD6XTtyBKKARLytyyWPIy1SvGOcU91106MfvHPdxZgupFwVHd8TFpZPpA3SebYjtwS5BUS76Rw== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.5.0" - "@jest/test-result" "^29.5.0" - "@jest/transform" "^29.5.0" - "@jest/types" "^29.5.0" - "@jridgewell/trace-mapping" "^0.3.15" + "@jest/console" "^29.6.0" + "@jest/test-result" "^29.6.0" + "@jest/transform" "^29.6.0" + "@jest/types" "^29.6.0" + "@jridgewell/trace-mapping" "^0.3.18" "@types/node" "*" chalk "^4.0.0" collect-v8-coverage "^1.0.0" @@ -486,77 +486,77 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^29.5.0" - jest-util "^29.5.0" - jest-worker "^29.5.0" + jest-message-util "^29.6.0" + jest-util "^29.6.0" + jest-worker "^29.6.0" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" v8-to-istanbul "^9.0.1" -"@jest/schemas@^29.4.3": - version "29.4.3" - resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.4.3.tgz#39cf1b8469afc40b6f5a2baaa146e332c4151788" - integrity sha512-VLYKXQmtmuEz6IxJsrZwzG9NvtkQsWNnWMsKxqWNu3+CnfzJQhp0WDDKWLVV9hLKr0l3SLLFRqcYHjhtyuDVxg== +"@jest/schemas@^29.6.0": + version "29.6.0" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.6.0.tgz#0f4cb2c8e3dca80c135507ba5635a4fd755b0040" + integrity sha512-rxLjXyJBTL4LQeJW3aKo0M/+GkCOXsO+8i9Iu7eDb6KwtP65ayoDsitrdPBtujxQ88k4wI2FNYfa6TOGwSn6cQ== dependencies: - "@sinclair/typebox" "^0.25.16" + "@sinclair/typebox" "^0.27.8" -"@jest/source-map@^29.4.3": - version "29.4.3" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.4.3.tgz#ff8d05cbfff875d4a791ab679b4333df47951d20" - integrity sha512-qyt/mb6rLyd9j1jUts4EQncvS6Yy3PM9HghnNv86QBlV+zdL2inCdK1tuVlL+J+lpiw2BI67qXOrX3UurBqQ1w== +"@jest/source-map@^29.6.0": + version "29.6.0" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.6.0.tgz#bd34a05b5737cb1a99d43e1957020ac8e5b9ddb1" + integrity sha512-oA+I2SHHQGxDCZpbrsCQSoMLb3Bz547JnM+jUr9qEbuw0vQlWZfpPS7CO9J7XiwKicEz9OFn/IYoLkkiUD7bzA== dependencies: - "@jridgewell/trace-mapping" "^0.3.15" + "@jridgewell/trace-mapping" "^0.3.18" callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.5.0.tgz#7c856a6ca84f45cc36926a4e9c6b57f1973f1408" - integrity sha512-fGl4rfitnbfLsrfx1uUpDEESS7zM8JdgZgOCQuxQvL1Sn/I6ijeAVQWGfXI9zb1i9Mzo495cIpVZhA0yr60PkQ== +"@jest/test-result@^29.6.0": + version "29.6.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.6.0.tgz#03bd32d3bb696eff5affecf918468bc633fc32d5" + integrity sha512-9qLb7xITeyWhM4yatn2muqfomuoCTOhv0QV9i7XiIyYi3QLfnvPv5NeJp5u0PZeutAOROMLKakOkmoAisOr3YQ== dependencies: - "@jest/console" "^29.5.0" - "@jest/types" "^29.5.0" + "@jest/console" "^29.6.0" + "@jest/types" "^29.6.0" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.5.0.tgz#34d7d82d3081abd523dbddc038a3ddcb9f6d3cc4" - integrity sha512-yPafQEcKjkSfDXyvtgiV4pevSeyuA6MQr6ZIdVkWJly9vkqjnFfcfhRQqpD5whjoU8EORki752xQmjaqoFjzMQ== +"@jest/test-sequencer@^29.6.0": + version "29.6.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.6.0.tgz#30a70e2dcc7dcf1e0f1170b97384883ce0a7d6e5" + integrity sha512-HYCS3LKRQotKWj2mnA3AN13PPevYZu8MJKm12lzYojpJNnn6kI/3PWmr1At/e3tUu+FHQDiOyaDVuR4EV3ezBw== dependencies: - "@jest/test-result" "^29.5.0" + "@jest/test-result" "^29.6.0" graceful-fs "^4.2.9" - jest-haste-map "^29.5.0" + jest-haste-map "^29.6.0" slash "^3.0.0" -"@jest/transform@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.5.0.tgz#cf9c872d0965f0cbd32f1458aa44a2b1988b00f9" - integrity sha512-8vbeZWqLJOvHaDfeMuoHITGKSz5qWc9u04lnWrQE3VyuSw604PzQM824ZeX9XSjUCeDiE3GuxZe5UKa8J61NQw== +"@jest/transform@^29.6.0": + version "29.6.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.6.0.tgz#dcbb37e35412310073e633816fd7dbc11773596d" + integrity sha512-bhP/KxPo3e322FJ0nKAcb6WVK76ZYyQd1lWygJzoSqP8SYMSLdxHqP4wnPTI4WvbB8PKPDV30y5y7Tya4RHOBA== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^29.5.0" - "@jridgewell/trace-mapping" "^0.3.15" + "@jest/types" "^29.6.0" + "@jridgewell/trace-mapping" "^0.3.18" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^2.0.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.5.0" + jest-haste-map "^29.6.0" jest-regex-util "^29.4.3" - jest-util "^29.5.0" + jest-util "^29.6.0" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" write-file-atomic "^4.0.2" -"@jest/types@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.5.0.tgz#f59ef9b031ced83047c67032700d8c807d6e1593" - integrity sha512-qbu7kN6czmVRc3xWFQcAN03RAUamgppVUdXrvl1Wr3jlNF93o9mJbGcDWrwGB6ht44u7efB1qCFgVQmca24Uog== +"@jest/types@^29.6.0": + version "29.6.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.6.0.tgz#717646103c5715394d78c011a08b3cbb83d738e8" + integrity sha512-8XCgL9JhqbJTFnMRjEAO+TuW251+MoMd5BSzLiE3vvzpQ8RlBxy8NoyNkDhs3K3OL3HeVinlOl9or5p7GTeOLg== dependencies: - "@jest/schemas" "^29.4.3" + "@jest/schemas" "^29.6.0" "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" "@types/node" "*" @@ -595,7 +595,7 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== -"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.15", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.9": +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.9": version "0.3.17" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985" integrity sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g== @@ -603,6 +603,14 @@ "@jridgewell/resolve-uri" "3.1.0" "@jridgewell/sourcemap-codec" "1.4.14" +"@jridgewell/trace-mapping@^0.3.18": + version "0.3.18" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz#25783b2086daf6ff1dcb53c9249ae480e4dd4cd6" + integrity sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA== + dependencies: + "@jridgewell/resolve-uri" "3.1.0" + "@jridgewell/sourcemap-codec" "1.4.14" + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -624,10 +632,10 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@sinclair/typebox@^0.25.16": - version "0.25.24" - resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.25.24.tgz#8c7688559979f7079aacaf31aa881c3aa410b718" - integrity sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ== +"@sinclair/typebox@^0.27.8": + version "0.27.8" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" + integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== "@sinonjs/commons@^2.0.0": version "2.0.0" @@ -820,12 +828,12 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.5.0.tgz#3fe3ddb109198e78b1c88f9ebdecd5e4fc2f50a5" - integrity sha512-mA4eCDh5mSo2EcA9xQjVTpmbbNk32Zb3Q3QFQsNhaK56Q+yoXowzFodLux30HRgyOho5rsQ6B0P9QpMkvvnJ0Q== +babel-jest@^29.6.0: + version "29.6.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.6.0.tgz#f97962732a729ca5cb26f610250c0cb4577bf3f8" + integrity sha512-Jj8Bq2yKsk11XLk06Nm8SdvYkAcecH+GuhxB8DnK5SncjHnJ88TQjSnGgE7jpajpnSvz9DZ6X8hXrDkD/6/TPQ== dependencies: - "@jest/transform" "^29.5.0" + "@jest/transform" "^29.6.0" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" babel-preset-jest "^29.5.0" @@ -1273,16 +1281,17 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== -expect@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.5.0.tgz#68c0509156cb2a0adb8865d413b137eeaae682f7" - integrity sha512-yM7xqUrCO2JdpFo4XpM82t+PJBFybdqoQuJLDGeDX2ij8NZzqRHyu3Hp188/JX7SWqud+7t4MUdvcgGBICMHZg== +expect@^29.6.0: + version "29.6.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.6.0.tgz#a0c114e91d8b6e9fcfb2d830411958699125bd23" + integrity sha512-AV+HaBtnDJ2YEUhPPo25HyUHBLaetM+y/Dq6pEC8VPQyt1dK+k8MfGkMy46djy2bddcqESc1kl4/K1uLWSfk9g== dependencies: - "@jest/expect-utils" "^29.5.0" + "@jest/expect-utils" "^29.6.0" + "@types/node" "*" jest-get-type "^29.4.3" - jest-matcher-utils "^29.5.0" - jest-message-util "^29.5.0" - jest-util "^29.5.0" + jest-matcher-utils "^29.6.0" + jest-message-util "^29.6.0" + jest-util "^29.6.0" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1619,87 +1628,87 @@ jest-changed-files@^29.5.0: execa "^5.0.0" p-limit "^3.1.0" -jest-circus@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.5.0.tgz#b5926989449e75bff0d59944bae083c9d7fb7317" - integrity sha512-gq/ongqeQKAplVxqJmbeUOJJKkW3dDNPY8PjhJ5G0lBRvu0e3EWGxGy5cI4LAGA7gV2UHCtWBI4EMXK8c9nQKA== +jest-circus@^29.6.0: + version "29.6.0" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.6.0.tgz#aa6369bd10aecc8ec68298bd14cf43ac4370958a" + integrity sha512-LtG45qEKhse2Ws5zNR4DnZATReLGQXzBZGZnJ0DU37p6d4wDhu41vvczCQ3Ou+llR6CRYDBshsubV7H4jZvIkw== dependencies: - "@jest/environment" "^29.5.0" - "@jest/expect" "^29.5.0" - "@jest/test-result" "^29.5.0" - "@jest/types" "^29.5.0" + "@jest/environment" "^29.6.0" + "@jest/expect" "^29.6.0" + "@jest/test-result" "^29.6.0" + "@jest/types" "^29.6.0" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" is-generator-fn "^2.0.0" - jest-each "^29.5.0" - jest-matcher-utils "^29.5.0" - jest-message-util "^29.5.0" - jest-runtime "^29.5.0" - jest-snapshot "^29.5.0" - jest-util "^29.5.0" + jest-each "^29.6.0" + jest-matcher-utils "^29.6.0" + jest-message-util "^29.6.0" + jest-runtime "^29.6.0" + jest-snapshot "^29.6.0" + jest-util "^29.6.0" p-limit "^3.1.0" - pretty-format "^29.5.0" + pretty-format "^29.6.0" pure-rand "^6.0.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.5.0.tgz#b34c20a6d35968f3ee47a7437ff8e53e086b4a67" - integrity sha512-L1KcP1l4HtfwdxXNFCL5bmUbLQiKrakMUriBEcc1Vfz6gx31ORKdreuWvmQVBit+1ss9NNR3yxjwfwzZNdQXJw== +jest-cli@^29.6.0: + version "29.6.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.6.0.tgz#a885e3d5a0b12ba520f61f8496bb0c9c2ff97896" + integrity sha512-WvZIaanK/abkw6s01924DQ2QLwM5Q4Y4iPbSDb9Zg6smyXGqqcPQ7ft9X8D7B0jICz312eSzM6UlQNxuZJBrMw== dependencies: - "@jest/core" "^29.5.0" - "@jest/test-result" "^29.5.0" - "@jest/types" "^29.5.0" + "@jest/core" "^29.6.0" + "@jest/test-result" "^29.6.0" + "@jest/types" "^29.6.0" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.5.0" - jest-util "^29.5.0" - jest-validate "^29.5.0" + jest-config "^29.6.0" + jest-util "^29.6.0" + jest-validate "^29.6.0" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.5.0.tgz#3cc972faec8c8aaea9ae158c694541b79f3748da" - integrity sha512-kvDUKBnNJPNBmFFOhDbm59iu1Fii1Q6SxyhXfvylq3UTHbg6o7j/g8k2dZyXWLvfdKB1vAPxNZnMgtKJcmu3kA== +jest-config@^29.6.0: + version "29.6.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.6.0.tgz#0bca14b634919519a298a56c0ed1d200b9f0fa31" + integrity sha512-fKA4jM91PDqWVkMpb1FVKxIuhg3hC6hgaen57cr1rRZkR96dCatvJZsk3ik7/GNu9ERj9wgAspOmyvkFoGsZhA== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.5.0" - "@jest/types" "^29.5.0" - babel-jest "^29.5.0" + "@jest/test-sequencer" "^29.6.0" + "@jest/types" "^29.6.0" + babel-jest "^29.6.0" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^29.5.0" - jest-environment-node "^29.5.0" + jest-circus "^29.6.0" + jest-environment-node "^29.6.0" jest-get-type "^29.4.3" jest-regex-util "^29.4.3" - jest-resolve "^29.5.0" - jest-runner "^29.5.0" - jest-util "^29.5.0" - jest-validate "^29.5.0" + jest-resolve "^29.6.0" + jest-runner "^29.6.0" + jest-util "^29.6.0" + jest-validate "^29.6.0" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^29.5.0" + pretty-format "^29.6.0" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.5.0.tgz#e0d83a58eb5451dcc1fa61b1c3ee4e8f5a290d63" - integrity sha512-LtxijLLZBduXnHSniy0WMdaHjmQnt3g5sa16W4p0HqukYTTsyTW3GD1q41TyGl5YFXj/5B2U6dlh5FM1LIMgxw== +jest-diff@^29.6.0: + version "29.6.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.6.0.tgz#9fe219a2f73a62ed6ac1c1a58e4965dc66836c4b" + integrity sha512-ZRm7cd2m9YyZ0N3iMyuo1iUiprxQ/MFpYWXzEEj7hjzL3WnDffKW8192XBDcrAI8j7hnrM1wed3bL/oEnYF/8w== dependencies: chalk "^4.0.0" diff-sequences "^29.4.3" jest-get-type "^29.4.3" - pretty-format "^29.5.0" + pretty-format "^29.6.0" jest-docblock@^29.4.3: version "29.4.3" @@ -1708,94 +1717,94 @@ jest-docblock@^29.4.3: dependencies: detect-newline "^3.0.0" -jest-each@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.5.0.tgz#fc6e7014f83eac68e22b7195598de8554c2e5c06" - integrity sha512-HM5kIJ1BTnVt+DQZ2ALp3rzXEl+g726csObrW/jpEGl+CDSSQpOJJX2KE/vEg8cxcMXdyEPu6U4QX5eruQv5hA== +jest-each@^29.6.0: + version "29.6.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.6.0.tgz#320637063b518a51e42b38a0186255e6e5978fe7" + integrity sha512-d0Jem4RBAlFUyV6JSXPSHVUpNo5RleSj+iJEy1G3+ZCrzHDjWs/1jUfrbnJKHdJdAx5BCEce/Ju379WqHhQk4w== dependencies: - "@jest/types" "^29.5.0" + "@jest/types" "^29.6.0" chalk "^4.0.0" jest-get-type "^29.4.3" - jest-util "^29.5.0" - pretty-format "^29.5.0" + jest-util "^29.6.0" + pretty-format "^29.6.0" -jest-environment-node@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.5.0.tgz#f17219d0f0cc0e68e0727c58b792c040e332c967" - integrity sha512-ExxuIK/+yQ+6PRGaHkKewYtg6hto2uGCgvKdb2nfJfKXgZ17DfXjvbZ+jA1Qt9A8EQSfPnt5FKIfnOO3u1h9qw== +jest-environment-node@^29.6.0: + version "29.6.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.6.0.tgz#634c3027afaa6f4211516348c59642d74b126a1b" + integrity sha512-BOf5Q2/nFCdBOnyBM5c5/6DbdQYgc+0gyUQ8l8qhUAB8O7pM+4QJXIXJsRZJaxd5SHV6y5VArTVhOfogoqcP8Q== dependencies: - "@jest/environment" "^29.5.0" - "@jest/fake-timers" "^29.5.0" - "@jest/types" "^29.5.0" + "@jest/environment" "^29.6.0" + "@jest/fake-timers" "^29.6.0" + "@jest/types" "^29.6.0" "@types/node" "*" - jest-mock "^29.5.0" - jest-util "^29.5.0" + jest-mock "^29.6.0" + jest-util "^29.6.0" jest-get-type@^29.4.3: version "29.4.3" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.4.3.tgz#1ab7a5207c995161100b5187159ca82dd48b3dd5" integrity sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg== -jest-haste-map@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.5.0.tgz#69bd67dc9012d6e2723f20a945099e972b2e94de" - integrity sha512-IspOPnnBro8YfVYSw6yDRKh/TiCdRngjxeacCps1cQ9cgVN6+10JUcuJ1EabrgYLOATsIAigxA0rLR9x/YlrSA== +jest-haste-map@^29.6.0: + version "29.6.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.6.0.tgz#5f3e6292bc45f596de48835489ddac409748b15a" + integrity sha512-dY1DKufptj7hcJSuhpqlYPGcnN3XjlOy/g0jinpRTMsbb40ivZHiuIPzeminOZkrek8C+oDxC54ILGO3vMLojg== dependencies: - "@jest/types" "^29.5.0" + "@jest/types" "^29.6.0" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" jest-regex-util "^29.4.3" - jest-util "^29.5.0" - jest-worker "^29.5.0" + jest-util "^29.6.0" + jest-worker "^29.6.0" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.5.0.tgz#cf4bdea9615c72bac4a3a7ba7e7930f9c0610c8c" - integrity sha512-u9YdeeVnghBUtpN5mVxjID7KbkKE1QU4f6uUwuxiY0vYRi9BUCLKlPEZfDGR67ofdFmDz9oPAy2G92Ujrntmow== +jest-leak-detector@^29.6.0: + version "29.6.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.6.0.tgz#9b96d275622739b4436ee7e91b3f3d386471105c" + integrity sha512-JdV6EZOPxHR1gd6ccxjNowuROkT2jtGU5G/g58RcJX1xe5mrtLj0g6/ZkyMoXF4cs+tTkHMFX6pcIrB1QPQwCw== dependencies: jest-get-type "^29.4.3" - pretty-format "^29.5.0" + pretty-format "^29.6.0" -jest-matcher-utils@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.5.0.tgz#d957af7f8c0692c5453666705621ad4abc2c59c5" - integrity sha512-lecRtgm/rjIK0CQ7LPQwzCs2VwW6WAahA55YBuI+xqmhm7LAaxokSB8C97yJeYyT+HvQkH741StzpU41wohhWw== +jest-matcher-utils@^29.6.0: + version "29.6.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.6.0.tgz#4465344800591022a5239f529857c053da6a9d5c" + integrity sha512-oSlqfGN+sbkB2Q5um/zL7z80w84FEAcLKzXBZIPyRk2F2Srg1ubhrHVKW68JCvb2+xKzAeGw35b+6gciS24PHw== dependencies: chalk "^4.0.0" - jest-diff "^29.5.0" + jest-diff "^29.6.0" jest-get-type "^29.4.3" - pretty-format "^29.5.0" + pretty-format "^29.6.0" -jest-message-util@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.5.0.tgz#1f776cac3aca332ab8dd2e3b41625435085c900e" - integrity sha512-Kijeg9Dag6CKtIDA7O21zNTACqD5MD/8HfIV8pdD94vFyFuer52SigdC3IQMhab3vACxXMiFk+yMHNdbqtyTGA== +jest-message-util@^29.6.0: + version "29.6.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.6.0.tgz#b23c1f787fcc226c49489fd53018100c2f434fe6" + integrity sha512-mkCp56cETbpoNtsaeWVy6SKzk228mMi9FPHSObaRIhbR2Ujw9PqjW/yqVHD2tN1bHbC8ol6h3UEo7dOPmIYwIA== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.5.0" + "@jest/types" "^29.6.0" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^29.5.0" + pretty-format "^29.6.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.5.0.tgz#26e2172bcc71d8b0195081ff1f146ac7e1518aed" - integrity sha512-GqOzvdWDE4fAV2bWQLQCkujxYWL7RxjCnj71b5VhDAGOevB3qj3Ovg26A5NI84ZpODxyzaozXLOh2NCgkbvyaw== +jest-mock@^29.6.0: + version "29.6.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.6.0.tgz#4643fe35a3f20ef9a71f2a61f037a2ff05702d55" + integrity sha512-2Pb7R2w24Q0aUVn+2/vdRDL6CqGqpheDZy7zrXav8FotOpSGw/4bS2hyVoKHMEx4xzOn6EyCAGwc5czWxXeN7w== dependencies: - "@jest/types" "^29.5.0" + "@jest/types" "^29.6.0" "@types/node" "*" - jest-util "^29.5.0" + jest-util "^29.6.0" jest-pnp-resolver@^1.2.2: version "1.2.3" @@ -1807,170 +1816,168 @@ jest-regex-util@^29.4.3: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.4.3.tgz#a42616141e0cae052cfa32c169945d00c0aa0bb8" integrity sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg== -jest-resolve-dependencies@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.5.0.tgz#f0ea29955996f49788bf70996052aa98e7befee4" - integrity sha512-sjV3GFr0hDJMBpYeUuGduP+YeCRbd7S/ck6IvL3kQ9cpySYKqcqhdLLC2rFwrcL7tz5vYibomBrsFYWkIGGjOg== +jest-resolve-dependencies@^29.6.0: + version "29.6.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.0.tgz#772a315ebf2556c3c0ced98f268d2f931efab8a5" + integrity sha512-eOfPog9K3hJdJk/3i6O6bQhXS+3uXhMDkLJGX+xmMPp7T1d/zdcFofbDnHgNoEkhD/mSimC5IagLEP7lpLLu/A== dependencies: jest-regex-util "^29.4.3" - jest-snapshot "^29.5.0" + jest-snapshot "^29.6.0" -jest-resolve@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.5.0.tgz#b053cc95ad1d5f6327f0ac8aae9f98795475ecdc" - integrity sha512-1TzxJ37FQq7J10jPtQjcc+MkCkE3GBpBecsSUWJ0qZNJpmg6m0D9/7II03yJulm3H/fvVjgqLh/k2eYg+ui52w== +jest-resolve@^29.6.0: + version "29.6.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.6.0.tgz#e7ffd4ebfd03d0ef442eba00611b5a5ea18996b5" + integrity sha512-+hrpY4LzAONoZA/rvB6rnZLkOSA6UgJLpdCWrOZNSgGxWMumzRLu7dLUSCabAHzoHIDQ9qXfr3th1zYNJ0E8sQ== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^29.5.0" + jest-haste-map "^29.6.0" jest-pnp-resolver "^1.2.2" - jest-util "^29.5.0" - jest-validate "^29.5.0" + jest-util "^29.6.0" + jest-validate "^29.6.0" resolve "^1.20.0" resolve.exports "^2.0.0" slash "^3.0.0" -jest-runner@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.5.0.tgz#6a57c282eb0ef749778d444c1d758c6a7693b6f8" - integrity sha512-m7b6ypERhFghJsslMLhydaXBiLf7+jXy8FwGRHO3BGV1mcQpPbwiqiKUR2zU2NJuNeMenJmlFZCsIqzJCTeGLQ== - dependencies: - "@jest/console" "^29.5.0" - "@jest/environment" "^29.5.0" - "@jest/test-result" "^29.5.0" - "@jest/transform" "^29.5.0" - "@jest/types" "^29.5.0" +jest-runner@^29.6.0: + version "29.6.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.6.0.tgz#7d8680b80c92c6fb94b9960714cd7004de7ef948" + integrity sha512-4fZuGV2lOxS2BiqEG9/AI8E6O+jo+QZjMVcgi1x5E6aDql0Gd/EFIbUQ0pSS09y8cya1vJB/qC2xsE468jqtSg== + dependencies: + "@jest/console" "^29.6.0" + "@jest/environment" "^29.6.0" + "@jest/test-result" "^29.6.0" + "@jest/transform" "^29.6.0" + "@jest/types" "^29.6.0" "@types/node" "*" chalk "^4.0.0" emittery "^0.13.1" graceful-fs "^4.2.9" jest-docblock "^29.4.3" - jest-environment-node "^29.5.0" - jest-haste-map "^29.5.0" - jest-leak-detector "^29.5.0" - jest-message-util "^29.5.0" - jest-resolve "^29.5.0" - jest-runtime "^29.5.0" - jest-util "^29.5.0" - jest-watcher "^29.5.0" - jest-worker "^29.5.0" + jest-environment-node "^29.6.0" + jest-haste-map "^29.6.0" + jest-leak-detector "^29.6.0" + jest-message-util "^29.6.0" + jest-resolve "^29.6.0" + jest-runtime "^29.6.0" + jest-util "^29.6.0" + jest-watcher "^29.6.0" + jest-worker "^29.6.0" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.5.0.tgz#c83f943ee0c1da7eb91fa181b0811ebd59b03420" - integrity sha512-1Hr6Hh7bAgXQP+pln3homOiEZtCDZFqwmle7Ew2j8OlbkIu6uE3Y/etJQG8MLQs3Zy90xrp2C0BRrtPHG4zryw== - dependencies: - "@jest/environment" "^29.5.0" - "@jest/fake-timers" "^29.5.0" - "@jest/globals" "^29.5.0" - "@jest/source-map" "^29.4.3" - "@jest/test-result" "^29.5.0" - "@jest/transform" "^29.5.0" - "@jest/types" "^29.5.0" +jest-runtime@^29.6.0: + version "29.6.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.6.0.tgz#0f6d98b40625c620c6fa1f075c3b0ca95daa8f1c" + integrity sha512-5FavYo3EeXLHIvnJf+r7Cj0buePAbe4mzRB9oeVxDS0uVmouSBjWeGgyRjZkw7ArxOoZI8gO6f8SGMJ2HFlwwg== + dependencies: + "@jest/environment" "^29.6.0" + "@jest/fake-timers" "^29.6.0" + "@jest/globals" "^29.6.0" + "@jest/source-map" "^29.6.0" + "@jest/test-result" "^29.6.0" + "@jest/transform" "^29.6.0" + "@jest/types" "^29.6.0" "@types/node" "*" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^29.5.0" - jest-message-util "^29.5.0" - jest-mock "^29.5.0" + jest-haste-map "^29.6.0" + jest-message-util "^29.6.0" + jest-mock "^29.6.0" jest-regex-util "^29.4.3" - jest-resolve "^29.5.0" - jest-snapshot "^29.5.0" - jest-util "^29.5.0" + jest-resolve "^29.6.0" + jest-snapshot "^29.6.0" + jest-util "^29.6.0" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.5.0.tgz#c9c1ce0331e5b63cd444e2f95a55a73b84b1e8ce" - integrity sha512-x7Wolra5V0tt3wRs3/ts3S6ciSQVypgGQlJpz2rsdQYoUKxMxPNaoHMGJN6qAuPJqS+2iQ1ZUn5kl7HCyls84g== +jest-snapshot@^29.6.0: + version "29.6.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.6.0.tgz#a8653fe098f1c39ab37c94f8b1370f606b5618a9" + integrity sha512-H3kUE9NwWDEDoutcOSS921IqdlkdjgnMdj1oMyxAHNflscdLc9dB8OudZHV6kj4OHJxbMxL8CdI5DlwYrs4wQg== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" "@babel/plugin-syntax-jsx" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" - "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.5.0" - "@jest/transform" "^29.5.0" - "@jest/types" "^29.5.0" - "@types/babel__traverse" "^7.0.6" + "@jest/expect-utils" "^29.6.0" + "@jest/transform" "^29.6.0" + "@jest/types" "^29.6.0" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.5.0" + expect "^29.6.0" graceful-fs "^4.2.9" - jest-diff "^29.5.0" + jest-diff "^29.6.0" jest-get-type "^29.4.3" - jest-matcher-utils "^29.5.0" - jest-message-util "^29.5.0" - jest-util "^29.5.0" + jest-matcher-utils "^29.6.0" + jest-message-util "^29.6.0" + jest-util "^29.6.0" natural-compare "^1.4.0" - pretty-format "^29.5.0" - semver "^7.3.5" + pretty-format "^29.6.0" + semver "^7.5.3" -jest-util@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.5.0.tgz#24a4d3d92fc39ce90425311b23c27a6e0ef16b8f" - integrity sha512-RYMgG/MTadOr5t8KdhejfvUU82MxsCu5MF6KuDUHl+NuwzUt+Sm6jJWxTJVrDR1j5M/gJVCPKQEpWXY+yIQ6lQ== +jest-util@^29.6.0: + version "29.6.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.6.0.tgz#4071050c5d70f5d4d48105e8883773f3a6b94f8d" + integrity sha512-S0USx9YwcvEm4pQ5suisVm/RVxBmi0GFR7ocJhIeaCuW5AXnAnffXbaVKvIFodyZNOc9ygzVtTxmBf40HsHXaA== dependencies: - "@jest/types" "^29.5.0" + "@jest/types" "^29.6.0" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.5.0.tgz#8e5a8f36178d40e47138dc00866a5f3bd9916ffc" - integrity sha512-pC26etNIi+y3HV8A+tUGr/lph9B18GnzSRAkPaaZJIE1eFdiYm6/CewuiJQ8/RlfHd1u/8Ioi8/sJ+CmbA+zAQ== +jest-validate@^29.6.0: + version "29.6.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.6.0.tgz#6a7416a1df4fe90896db566b83d6b4c9485c402c" + integrity sha512-MLTrAJsb1+W7svbeZ+A7pAnyXMaQrjvPDKCy7OlfsfB6TMVc69v7WjUWfiR6r3snULFWZASiKgvNVDuATta1dg== dependencies: - "@jest/types" "^29.5.0" + "@jest/types" "^29.6.0" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^29.4.3" leven "^3.1.0" - pretty-format "^29.5.0" + pretty-format "^29.6.0" -jest-watcher@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.5.0.tgz#cf7f0f949828ba65ddbbb45c743a382a4d911363" - integrity sha512-KmTojKcapuqYrKDpRwfqcQ3zjMlwu27SYext9pt4GlF5FUgB+7XE1mcCnSm6a4uUpFyQIkb6ZhzZvHl+jiBCiA== +jest-watcher@^29.6.0: + version "29.6.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.6.0.tgz#77df9ffcdfc70406fdd577020c1e4d62de5a0299" + integrity sha512-LdsQqFNX60mRdRRe+zsELnYRH1yX6KL+ukbh+u6WSQeTheZZe1TlLJNKRQiZ7e0VbvMkywmMWL/KV35noOJCcw== dependencies: - "@jest/test-result" "^29.5.0" - "@jest/types" "^29.5.0" + "@jest/test-result" "^29.6.0" + "@jest/types" "^29.6.0" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.13.1" - jest-util "^29.5.0" + jest-util "^29.6.0" string-length "^4.0.1" -jest-worker@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.5.0.tgz#bdaefb06811bd3384d93f009755014d8acb4615d" - integrity sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA== +jest-worker@^29.6.0: + version "29.6.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.6.0.tgz#e0c40226d073fdb8f0dfe87d7f90f8fd987d8ba3" + integrity sha512-oiQHH1SnKmZIwwPnpOrXTq4kHBk3lKGY/07DpnH0sAu+x7J8rXlbLDROZsU6vy9GwB0hPiZeZpu6YlJ48QoKcA== dependencies: "@types/node" "*" - jest-util "^29.5.0" + jest-util "^29.6.0" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.5.0.tgz#f75157622f5ce7ad53028f2f8888ab53e1f1f24e" - integrity sha512-juMg3he2uru1QoXX078zTa7pO85QyB9xajZc6bU+d9yEGwrKX6+vGmJQ3UdVZsvTEUARIdObzH68QItim6OSSQ== + version "29.6.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.6.0.tgz#dbc8136e6d933177487e2427187e07ebf9db8ce4" + integrity sha512-do1J9gGrQ68E4UfMz/4OM71p9qCqQxu32N/9ZfeYFSSlx0uUOuxeyZxtJZNaUTW12ZA11ERhmBjBhy1Ho96R4g== dependencies: - "@jest/core" "^29.5.0" - "@jest/types" "^29.5.0" + "@jest/core" "^29.6.0" + "@jest/types" "^29.6.0" import-local "^3.0.2" - jest-cli "^29.5.0" + jest-cli "^29.6.0" js-tokens@^4.0.0: version "4.0.0" @@ -2288,12 +2295,12 @@ prettier@>=3.0.0-alpha.6: resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0-alpha.12.tgz#c38228f277e870298b6d95e579e54ea500487505" integrity sha512-QCCLoJ+ttw/DV6zLiHJDZdC7sZ23fk3gCulQmjU6AuA/Uk8o6qbzM4afyEDIM94xhj7MEGDtKYo+ZFpxwjmSEg== -pretty-format@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.5.0.tgz#283134e74f70e2e3e7229336de0e4fce94ccde5a" - integrity sha512-V2mGkI31qdttvTFX7Mt4efOqHXqJWMu4/r66Xh3Z3BwZaPfPJgp6/gbwoujRpPUtfEF6AUUWx3Jim3GCw5g/Qw== +pretty-format@^29.6.0: + version "29.6.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.6.0.tgz#c90c8f145187fe73240662527a513599c16f3b97" + integrity sha512-XH+D4n7Ey0iSR6PdAnBs99cWMZdGsdKrR33iUHQNr79w1szKTCIZDVdXuccAsHVwDBp0XeWPfNEoaxP9EZgRmQ== dependencies: - "@jest/schemas" "^29.4.3" + "@jest/schemas" "^29.6.0" ansi-styles "^5.0.0" react-is "^18.0.0" @@ -2405,10 +2412,10 @@ semver@^6.0.0, semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.3.5: - version "7.3.8" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" - integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== +semver@^7.5.3: + version "7.5.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.3.tgz#161ce8c2c6b4b3bdca6caadc9fa3317a4c4fe88e" + integrity sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ== dependencies: lru-cache "^6.0.0" From 47a68f24437c10ed42bc73931676e02f73143045 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 6 Jul 2023 10:10:04 -0400 Subject: [PATCH 716/785] Bump deps --- package.json | 2 +- yarn.lock | 560 +++++++++++++++++++++++++-------------------------- 2 files changed, 278 insertions(+), 284 deletions(-) diff --git a/package.json b/package.json index 8da5b9a6..095b528b 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ }, "homepage": "https://github.com/prettier/plugin-ruby#readme", "dependencies": { - "prettier": ">=3.0.0-alpha.6" + "prettier": ">=3.0.0" }, "devDependencies": { "eslint": "^8.35.0", diff --git a/yarn.lock b/yarn.lock index 3712c48d..a8312ad8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8,164 +8,164 @@ integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== "@ampproject/remapping@^2.2.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.0.tgz#56c133824780de3174aed5ab6834f3026790154d" - integrity sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w== + version "2.2.1" + resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" + integrity sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg== dependencies: - "@jridgewell/gen-mapping" "^0.1.0" + "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" - integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.5.tgz#234d98e1551960604f1246e6475891a570ad5658" + integrity sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ== dependencies: - "@babel/highlight" "^7.18.6" + "@babel/highlight" "^7.22.5" -"@babel/compat-data@^7.20.5": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.21.0.tgz#c241dc454e5b5917e40d37e525e2f4530c399298" - integrity sha512-gMuZsmsgxk/ENC3O/fRw5QY8A9/uxQbbCEypnLIiYYc/qVJtEV7ouxC3EllIIwNzMqAQee5tanFabWsUOutS7g== +"@babel/compat-data@^7.22.6": + version "7.22.6" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.22.6.tgz#15606a20341de59ba02cd2fcc5086fcbe73bf544" + integrity sha512-29tfsWTq2Ftu7MXmimyC0C5FDZv5DYxOZkh3XD3+QW4V/BYuv/LyEsjj3c0hqedEaDt6DBfDvexMKU8YevdqFg== "@babel/core@^7.11.6", "@babel/core@^7.12.3": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.21.0.tgz#1341aefdcc14ccc7553fcc688dd8986a2daffc13" - integrity sha512-PuxUbxcW6ZYe656yL3EAhpy7qXKq0DmYsrJLpbB8XrsCP9Nm+XCg9XFMb5vIDliPD7+U/+M+QJlH17XOcB7eXA== + version "7.22.8" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.22.8.tgz#386470abe884302db9c82e8e5e87be9e46c86785" + integrity sha512-75+KxFB4CZqYRXjx4NlR4J7yGvKumBuZTmV4NV6v09dVXXkuYVYLT68N6HCzLvfJ+fWCxQsntNzKwwIXL4bHnw== dependencies: "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.21.0" - "@babel/helper-compilation-targets" "^7.20.7" - "@babel/helper-module-transforms" "^7.21.0" - "@babel/helpers" "^7.21.0" - "@babel/parser" "^7.21.0" - "@babel/template" "^7.20.7" - "@babel/traverse" "^7.21.0" - "@babel/types" "^7.21.0" + "@babel/code-frame" "^7.22.5" + "@babel/generator" "^7.22.7" + "@babel/helper-compilation-targets" "^7.22.6" + "@babel/helper-module-transforms" "^7.22.5" + "@babel/helpers" "^7.22.6" + "@babel/parser" "^7.22.7" + "@babel/template" "^7.22.5" + "@babel/traverse" "^7.22.8" + "@babel/types" "^7.22.5" + "@nicolo-ribaudo/semver-v6" "^6.3.3" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.2" - semver "^6.3.0" -"@babel/generator@^7.21.0", "@babel/generator@^7.21.1", "@babel/generator@^7.7.2": - version "7.21.1" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.21.1.tgz#951cc626057bc0af2c35cd23e9c64d384dea83dd" - integrity sha512-1lT45bAYlQhFn/BHivJs43AiW2rg3/UbLyShGfF3C0KmHvO5fSghWd5kBJy30kpRRucGzXStvnnCFniCR2kXAA== +"@babel/generator@^7.22.7", "@babel/generator@^7.7.2": + version "7.22.7" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.22.7.tgz#a6b8152d5a621893f2c9dacf9a4e286d520633d5" + integrity sha512-p+jPjMG+SI8yvIaxGgeW24u7q9+5+TGpZh8/CuB7RhBKd7RCy8FayNEFNNKrNK/eUcY/4ExQqLmyrvBXKsIcwQ== dependencies: - "@babel/types" "^7.21.0" + "@babel/types" "^7.22.5" "@jridgewell/gen-mapping" "^0.3.2" "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" -"@babel/helper-compilation-targets@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz#a6cd33e93629f5eb473b021aac05df62c4cd09bb" - integrity sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ== +"@babel/helper-compilation-targets@^7.22.6": + version "7.22.6" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.6.tgz#e30d61abe9480aa5a83232eb31c111be922d2e52" + integrity sha512-534sYEqWD9VfUm3IPn2SLcH4Q3P86XL+QvqdC7ZsFrzyyPF3T4XGiVghF6PTYNdWg6pXuoqXxNQAhbYeEInTzA== dependencies: - "@babel/compat-data" "^7.20.5" - "@babel/helper-validator-option" "^7.18.6" - browserslist "^4.21.3" + "@babel/compat-data" "^7.22.6" + "@babel/helper-validator-option" "^7.22.5" + "@nicolo-ribaudo/semver-v6" "^6.3.3" + browserslist "^4.21.9" lru-cache "^5.1.1" - semver "^6.3.0" -"@babel/helper-environment-visitor@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be" - integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg== - -"@babel/helper-function-name@^7.21.0": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz#d552829b10ea9f120969304023cd0645fa00b1b4" - integrity sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg== - dependencies: - "@babel/template" "^7.20.7" - "@babel/types" "^7.21.0" - -"@babel/helper-hoist-variables@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678" - integrity sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-module-imports@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz#1e3ebdbbd08aad1437b428c50204db13c5a3ca6e" - integrity sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-module-transforms@^7.21.0": - version "7.21.2" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.21.2.tgz#160caafa4978ac8c00ac66636cb0fa37b024e2d2" - integrity sha512-79yj2AR4U/Oqq/WOV7Lx6hUjau1Zfo4cI+JLAVYeMV5XIlbOhmjEk5ulbTc9fMpmlojzZHkUUxAiK+UKn+hNQQ== - dependencies: - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-module-imports" "^7.18.6" - "@babel/helper-simple-access" "^7.20.2" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/helper-validator-identifier" "^7.19.1" - "@babel/template" "^7.20.7" - "@babel/traverse" "^7.21.2" - "@babel/types" "^7.21.2" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.8.0": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz#d1b9000752b18d0877cff85a5c376ce5c3121629" - integrity sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ== - -"@babel/helper-simple-access@^7.20.2": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz#0ab452687fe0c2cfb1e2b9e0015de07fc2d62dd9" - integrity sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA== - dependencies: - "@babel/types" "^7.20.2" - -"@babel/helper-split-export-declaration@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz#7367949bc75b20c6d5a5d4a97bba2824ae8ef075" - integrity sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-string-parser@^7.19.4": - version "7.19.4" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63" - integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw== - -"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" - integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== - -"@babel/helper-validator-option@^7.18.6": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz#8224c7e13ace4bafdc4004da2cf064ef42673180" - integrity sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ== - -"@babel/helpers@^7.21.0": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.21.0.tgz#9dd184fb5599862037917cdc9eecb84577dc4e7e" - integrity sha512-XXve0CBtOW0pd7MRzzmoyuSj0e3SEzj8pgyFxnTT1NJZL38BD1MK7yYrm8yefRPIDvNNe14xR4FdbHwpInD4rA== - dependencies: - "@babel/template" "^7.20.7" - "@babel/traverse" "^7.21.0" - "@babel/types" "^7.21.0" - -"@babel/highlight@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" - integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== - dependencies: - "@babel/helper-validator-identifier" "^7.18.6" +"@babel/helper-environment-visitor@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz#f06dd41b7c1f44e1f8da6c4055b41ab3a09a7e98" + integrity sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q== + +"@babel/helper-function-name@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz#ede300828905bb15e582c037162f99d5183af1be" + integrity sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ== + dependencies: + "@babel/template" "^7.22.5" + "@babel/types" "^7.22.5" + +"@babel/helper-hoist-variables@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" + integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-module-imports@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz#1a8f4c9f4027d23f520bd76b364d44434a72660c" + integrity sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-module-transforms@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.22.5.tgz#0f65daa0716961b6e96b164034e737f60a80d2ef" + integrity sha512-+hGKDt/Ze8GFExiVHno/2dvG5IdstpzCq0y4Qc9OJ25D4q3pKfiIP/4Vp3/JvhDkLKsDK2api3q3fpIgiIF5bw== + dependencies: + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-module-imports" "^7.22.5" + "@babel/helper-simple-access" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.5" + "@babel/template" "^7.22.5" + "@babel/traverse" "^7.22.5" + "@babel/types" "^7.22.5" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.8.0": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz#dd7ee3735e8a313b9f7b05a773d892e88e6d7295" + integrity sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg== + +"@babel/helper-simple-access@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz#4938357dc7d782b80ed6dbb03a0fba3d22b1d5de" + integrity sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-split-export-declaration@^7.22.5", "@babel/helper-split-export-declaration@^7.22.6": + version "7.22.6" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" + integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-string-parser@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f" + integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== + +"@babel/helper-validator-identifier@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz#9544ef6a33999343c8740fa51350f30eeaaaf193" + integrity sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ== + +"@babel/helper-validator-option@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz#de52000a15a177413c8234fa3a8af4ee8102d0ac" + integrity sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw== + +"@babel/helpers@^7.22.6": + version "7.22.6" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.22.6.tgz#8e61d3395a4f0c5a8060f309fb008200969b5ecd" + integrity sha512-YjDs6y/fVOYFV8hAf1rxd1QvR9wJe1pDBZ2AREKq/SDayfPzgk0PBnVuTCE5X1acEpMMNOVUqoe+OwiZGJ+OaA== + dependencies: + "@babel/template" "^7.22.5" + "@babel/traverse" "^7.22.6" + "@babel/types" "^7.22.5" + +"@babel/highlight@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.5.tgz#aa6c05c5407a67ebce408162b7ede789b4d22031" + integrity sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw== + dependencies: + "@babel/helper-validator-identifier" "^7.22.5" chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.21.0", "@babel/parser@^7.21.2": - version "7.21.2" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.2.tgz#dacafadfc6d7654c3051a66d6fe55b6cb2f2a0b3" - integrity sha512-URpaIJQwEkEC2T9Kn+Ai6Xe/02iNaVCuT/PtoRz3GPVJVDpPd7mLo+VddTbhCRU9TXqW5mSrQfXZyi8kDKOVpQ== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.22.5", "@babel/parser@^7.22.7": + version "7.22.7" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.7.tgz#df8cf085ce92ddbdbf668a7f186ce848c9036cae" + integrity sha512-7NF8pOkHP5o2vpmGgNGcfAeCvOYhGLyA3Z4eBQkT1RJlWu47n63bCs93QfJ2hIAFCil7L5P2IWhs1oToVgrL0Q== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -203,11 +203,11 @@ "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-jsx@^7.7.2": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz#a8feef63b010150abd97f1649ec296e849943ca0" - integrity sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q== + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz#a6b68e84fb76e759fc3b93e901876ffabbe1d918" + integrity sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-logical-assignment-operators@^7.8.3": version "7.10.4" @@ -259,44 +259,44 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-typescript@^7.7.2": - version "7.20.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.20.0.tgz#4e9a0cfc769c85689b77a2e642d24e9f697fc8c7" - integrity sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ== - dependencies: - "@babel/helper-plugin-utils" "^7.19.0" - -"@babel/template@^7.20.7", "@babel/template@^7.3.3": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.20.7.tgz#a15090c2839a83b02aa996c0b4994005841fd5a8" - integrity sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw== - dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/parser" "^7.20.7" - "@babel/types" "^7.20.7" - -"@babel/traverse@^7.21.0", "@babel/traverse@^7.21.2": - version "7.21.2" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.21.2.tgz#ac7e1f27658750892e815e60ae90f382a46d8e75" - integrity sha512-ts5FFU/dSUPS13tv8XiEObDu9K+iagEKME9kAbaP7r0Y9KtZJZ+NGndDvWoRAYNpeWafbpFeki3q9QoMD6gxyw== - dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.21.1" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.21.0" - "@babel/helper-hoist-variables" "^7.18.6" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.21.2" - "@babel/types" "^7.21.2" + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz#aac8d383b062c5072c647a31ef990c1d0af90272" + integrity sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/template@^7.22.5", "@babel/template@^7.3.3": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.5.tgz#0c8c4d944509875849bd0344ff0050756eefc6ec" + integrity sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw== + dependencies: + "@babel/code-frame" "^7.22.5" + "@babel/parser" "^7.22.5" + "@babel/types" "^7.22.5" + +"@babel/traverse@^7.22.5", "@babel/traverse@^7.22.6", "@babel/traverse@^7.22.8": + version "7.22.8" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.8.tgz#4d4451d31bc34efeae01eac222b514a77aa4000e" + integrity sha512-y6LPR+wpM2I3qJrsheCTwhIinzkETbplIgPBbwvqPKc+uljeA5gP+3nP8irdYt1mjQaDnlIcG+dw8OjAco4GXw== + dependencies: + "@babel/code-frame" "^7.22.5" + "@babel/generator" "^7.22.7" + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-function-name" "^7.22.5" + "@babel/helper-hoist-variables" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/parser" "^7.22.7" + "@babel/types" "^7.22.5" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.18.6", "@babel/types@^7.20.2", "@babel/types@^7.20.7", "@babel/types@^7.21.0", "@babel/types@^7.21.2", "@babel/types@^7.3.0", "@babel/types@^7.3.3": - version "7.21.2" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.21.2.tgz#92246f6e00f91755893c2876ad653db70c8310d1" - integrity sha512-3wRZSs7jiFaB8AjxiiD+VqN5DTG2iRvJGQ+qYFrs/654lg6kGTQWIOFjlBo5RaXuAZjBmP3+OQH4dmhqiiyYxw== +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.22.5", "@babel/types@^7.3.3": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.22.5.tgz#cd93eeaab025880a3a47ec881f4b096a5b786fbe" + integrity sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA== dependencies: - "@babel/helper-string-parser" "^7.19.4" - "@babel/helper-validator-identifier" "^7.19.1" + "@babel/helper-string-parser" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.5" to-fast-properties "^2.0.0" "@bcoe/v8-coverage@^0.2.3": @@ -305,16 +305,16 @@ integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== "@eslint-community/eslint-utils@^4.2.0": - version "4.2.0" - resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.2.0.tgz#a831e6e468b4b2b5ae42bf658bea015bf10bc518" - integrity sha512-gB8T4H4DEfX2IV9zGDJPOBgP1e/DbfCPDTtEqUMckpvzS1OYtva8JdFYBqMwYk7xAQ429WGF/UPqn8uQ//h2vQ== + version "4.4.0" + resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" + integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== dependencies: eslint-visitor-keys "^3.3.0" "@eslint-community/regexpp@^4.4.0": - version "4.4.0" - resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.4.0.tgz#3e61c564fcd6b921cb789838631c5ee44df09403" - integrity sha512-A9983Q0LnDGdLPjxyXQ00sbV+K+O+ko2Dr+CZigbHWtX9pNfxlaBkMR8X1CztI73zuEyEBXTVjx7CE+/VSwDiQ== + version "4.5.1" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.5.1.tgz#cdd35dce4fa1a89a4fd42b1599eb35b3af408884" + integrity sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ== "@eslint/eslintrc@^2.1.0": version "2.1.0" @@ -563,18 +563,10 @@ "@types/yargs" "^17.0.8" chalk "^4.0.0" -"@jridgewell/gen-mapping@^0.1.0": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996" - integrity sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w== - dependencies: - "@jridgewell/set-array" "^1.0.0" - "@jridgewell/sourcemap-codec" "^1.4.10" - -"@jridgewell/gen-mapping@^0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" - integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== +"@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz#7e02e6eb5df901aaedb08514203b096614024098" + integrity sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ== dependencies: "@jridgewell/set-array" "^1.0.1" "@jridgewell/sourcemap-codec" "^1.4.10" @@ -585,25 +577,22 @@ resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== -"@jridgewell/set-array@^1.0.0", "@jridgewell/set-array@^1.0.1": +"@jridgewell/set-array@^1.0.1": version "1.1.2" resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== -"@jridgewell/sourcemap-codec@1.4.14", "@jridgewell/sourcemap-codec@^1.4.10": +"@jridgewell/sourcemap-codec@1.4.14": version "1.4.14" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== -"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.9": - version "0.3.17" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985" - integrity sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g== - dependencies: - "@jridgewell/resolve-uri" "3.1.0" - "@jridgewell/sourcemap-codec" "1.4.14" +"@jridgewell/sourcemap-codec@^1.4.10": + version "1.4.15" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" + integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== -"@jridgewell/trace-mapping@^0.3.18": +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.9": version "0.3.18" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz#25783b2086daf6ff1dcb53c9249ae480e4dd4cd6" integrity sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA== @@ -611,6 +600,11 @@ "@jridgewell/resolve-uri" "3.1.0" "@jridgewell/sourcemap-codec" "1.4.14" +"@nicolo-ribaudo/semver-v6@^6.3.3": + version "6.3.3" + resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/semver-v6/-/semver-v6-6.3.3.tgz#ea6d23ade78a325f7a52750aab1526b02b628c29" + integrity sha512-3Yc1fUTs69MG/uZbJlLSI3JISMn2UV2rg+1D/vROUqZyh3l6iYHCs7GMp+M40ZD7yOdDbYjJcU1oTJhrc+dGKg== + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -637,24 +631,24 @@ resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== -"@sinonjs/commons@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-2.0.0.tgz#fd4ca5b063554307e8327b4564bd56d3b73924a3" - integrity sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg== +"@sinonjs/commons@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-3.0.0.tgz#beb434fe875d965265e04722ccfc21df7f755d72" + integrity sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA== dependencies: type-detect "4.0.8" "@sinonjs/fake-timers@^10.0.2": - version "10.0.2" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-10.0.2.tgz#d10549ed1f423d80639c528b6c7f5a1017747d0c" - integrity sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw== + version "10.3.0" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz#55fdff1ecab9f354019129daf4df0dd4d923ea66" + integrity sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA== dependencies: - "@sinonjs/commons" "^2.0.0" + "@sinonjs/commons" "^3.0.0" "@types/babel__core@^7.1.14": - version "7.20.0" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.0.tgz#61bc5a4cae505ce98e1e36c5445e4bee060d8891" - integrity sha512-+n8dL/9GWblDO0iU6eZAwEIJVr5DWigtle+Q6HLOrh/pdbXOhOtqzq8VPPE2zvNJzSKY4vH/z3iT3tn0A3ypiQ== + version "7.20.1" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.1.tgz#916ecea274b0c776fec721e333e55762d3a9614b" + integrity sha512-aACu/U/omhdk15O4Nfb+fHgH/z3QsfQzpnvRZhYhThms83ZnAOZz7zZAWO7mn2yyNQaA4xTO8GLK3uqFU4bYYw== dependencies: "@babel/parser" "^7.20.7" "@babel/types" "^7.20.7" @@ -678,11 +672,11 @@ "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": - version "7.18.3" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.18.3.tgz#dfc508a85781e5698d5b33443416b6268c4b3e8d" - integrity sha512-1kbcJ40lLB7MHsj39U4Sh1uTd2E7rLEa79kmDpI6cy+XiXsteB3POdQomoq4FxszMrO3ZYchkhYJw7A2862b3w== + version "7.20.1" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.20.1.tgz#dd6f1d2411ae677dcb2db008c962598be31d6acf" + integrity sha512-MitHFXnhtgwsGZWtT68URpOvLN4EREih1u3QtQiN4VdAxWKRVvGCSvw/Qth0M0Qq3pJpnGOu5JaM/ydK7OGbqg== dependencies: - "@babel/types" "^7.3.0" + "@babel/types" "^7.20.7" "@types/graceful-fs@^4.1.3": version "4.1.6" @@ -716,14 +710,14 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*": - version "18.14.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.14.6.tgz#ae1973dd2b1eeb1825695bb11ebfb746d27e3e93" - integrity sha512-93+VvleD3mXwlLI/xASjw0FzKcwzl3OdTCzm1LaRfqgS21gfFtK3zDXM5Op9TeeMsJVOaJ2VRDpT9q4Y3d0AvA== + version "20.4.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.4.0.tgz#01d637d1891e419bc85763b46f42809cd2d5addb" + integrity sha512-jfT7iTf/4kOQ9S7CHV9BIyRaQqHu67mOjsIQBC3BKZvzvUB6zLxEwJ6sBE3ozcvP8kF6Uk5PXN0Q+c0dfhGX0g== "@types/prettier@^2.1.5": - version "2.7.2" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.2.tgz#6c2324641cc4ba050a8c710b2b251b377581fbf0" - integrity sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg== + version "2.7.3" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.3.tgz#3e51a17e291d01d17d3fc61422015a933af7a08f" + integrity sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA== "@types/stack-utils@^2.0.0": version "2.0.1" @@ -736,9 +730,9 @@ integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== "@types/yargs@^17.0.8": - version "17.0.22" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.22.tgz#7dd37697691b5f17d020f3c63e7a45971ff71e9a" - integrity sha512-pet5WJ9U8yPVRhkwuEIp5ktAeAqRZOq4UdAyWLWzxbtpyXnzbtLdKiXAjJzi/KLmPGS9wk86lUFWZFN6sISo4g== + version "17.0.24" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.24.tgz#b3ef8d50ad4aa6aecf6ddc97c580a00f5aa11902" + integrity sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw== dependencies: "@types/yargs-parser" "*" @@ -748,9 +742,9 @@ acorn-jsx@^5.3.2: integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== acorn@^8.9.0: - version "8.9.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.9.0.tgz#78a16e3b2bcc198c10822786fa6679e245db5b59" - integrity sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ== + version "8.10.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" + integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== ajv@^6.10.0, ajv@^6.12.4: version "6.12.6" @@ -908,15 +902,15 @@ braces@^3.0.2: dependencies: fill-range "^7.0.1" -browserslist@^4.21.3: - version "4.21.5" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.5.tgz#75c5dae60063ee641f977e00edd3cfb2fb7af6a7" - integrity sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w== +browserslist@^4.21.9: + version "4.21.9" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.9.tgz#e11bdd3c313d7e2a9e87e8b4b0c7872b13897635" + integrity sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg== dependencies: - caniuse-lite "^1.0.30001449" - electron-to-chromium "^1.4.284" - node-releases "^2.0.8" - update-browserslist-db "^1.0.10" + caniuse-lite "^1.0.30001503" + electron-to-chromium "^1.4.431" + node-releases "^2.0.12" + update-browserslist-db "^1.0.11" bser@2.1.1: version "2.1.1" @@ -945,10 +939,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001449: - version "1.0.30001462" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001462.tgz#b2e801e37536d453731286857c8520d3dcee15fe" - integrity sha512-PDd20WuOBPiasZ7KbFnmQRyuLE7cFXW2PVd7dmALzbkUXEP46upAuCDm9eY9vho8fgNMGmbAX92QBZHzcnWIqw== +caniuse-lite@^1.0.30001503: + version "1.0.30001512" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001512.tgz#7450843fb581c39f290305a83523c7a9ef0d4cb4" + integrity sha512-2S9nK0G/mE+jasCUsMPlARhRCts1ebcp2Ji8Y8PWi4NDE1iRdLCnEPHkEfeBrGC45L4isBx5ur3IQ6yTE2mRZw== chalk@^2.0.0: version "2.4.2" @@ -986,9 +980,9 @@ ci-info@^3.2.0: integrity sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw== cjs-module-lexer@^1.0.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40" - integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA== + version "1.2.3" + resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz#6c370ab19f8a3394e318fe682686ec0ac684d107" + integrity sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ== cliui@^8.0.1: version "8.0.1" @@ -1005,9 +999,9 @@ co@^4.6.0: integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== collect-v8-coverage@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59" - integrity sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg== + version "1.0.2" + resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz#c0b29bcd33bcd0779a1344c2136051e6afd3d9e9" + integrity sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q== color-convert@^1.9.0: version "1.9.3" @@ -1075,9 +1069,9 @@ deep-is@^0.1.3: integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== deepmerge@^4.2.2: - version "4.3.0" - resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.0.tgz#65491893ec47756d44719ae520e0e2609233b59b" - integrity sha512-z2wJZXrmeHdvYJp/Ux55wIjqo81G5Bp4c+oELTW+7ar6SogWHajt5a9gO3s3IDaGSAXjDk0vlQKN3rms8ab3og== + version "4.3.1" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" + integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== detect-newline@^3.0.0: version "3.1.0" @@ -1096,10 +1090,10 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -electron-to-chromium@^1.4.284: - version "1.4.322" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.322.tgz#e0afa1d115b66c1d47869db40d8f2f3729cecc16" - integrity sha512-KovjizNC9XB7dno/2GjxX8VS0SlfPpCjtyoKft+bCO+UfD8bFy16hY4Sh9s0h9BDxbRH2U0zX5VBjpM1LTcNlg== +electron-to-chromium@^1.4.431: + version "1.4.451" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.451.tgz#12b63ee5c82cbbc7b4ddd91e90f5a0dfc10de26e" + integrity sha512-YYbXHIBxAHe3KWvGOJOuWa6f3tgow44rBW+QAuwVp2DvGqNZeE//K2MowNdWS7XE8li5cgQDrX1LdBr41LufkA== emittery@^0.13.1: version "0.13.1" @@ -1439,9 +1433,9 @@ globals@^13.19.0: type-fest "^0.20.2" graceful-fs@^4.2.9: - version "4.2.10" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" - integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== + version "4.2.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== graphemer@^1.4.0: version "1.4.0" @@ -1529,10 +1523,10 @@ is-arrayish@^0.2.1: resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== -is-core-module@^2.9.0: - version "2.11.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144" - integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw== +is-core-module@^2.11.0: + version "2.12.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.12.1.tgz#0c0b6885b6f80011c71541ce15c8d66cf5a4f9fd" + integrity sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg== dependencies: has "^1.0.3" @@ -2150,10 +2144,10 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== -node-releases@^2.0.8: - version "2.0.10" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.10.tgz#c311ebae3b6a148c89b1813fd7c4d3c024ef537f" - integrity sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w== +node-releases@^2.0.12: + version "2.0.12" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.12.tgz#35627cc224a23bfb06fb3380f2b3afaaa7eb1039" + integrity sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ== normalize-path@^3.0.0: version "3.0.0" @@ -2274,9 +2268,9 @@ picomatch@^2.0.4, picomatch@^2.2.3, picomatch@^2.3.1: integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== pirates@^4.0.4: - version "4.0.5" - resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b" - integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ== + version "4.0.6" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9" + integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== pkg-dir@^4.2.0: version "4.2.0" @@ -2290,7 +2284,7 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prettier@>=3.0.0-alpha.6: +prettier@>=3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0.tgz#e7b19f691245a21d618c68bc54dc06122f6105ae" integrity sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g== @@ -2338,9 +2332,9 @@ punycode@^2.1.0: integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== pure-rand@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.0.0.tgz#701996ceefa253507923a0e864c17ab421c04a7c" - integrity sha512-rLSBxJjP+4DQOgcJAx6RZHT2he2pkhQdSnofG5VWyVl6GRq/K02ISOuOLcsMOrtKDIJb8JN2zm3FFzWNbezdPw== + version "6.0.2" + resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.0.2.tgz#a9c2ddcae9b68d736a8163036f088a2781c8b306" + integrity sha512-6Yg0ekpKICSjPswYOuC5sku/TSWaRYlA0qsXqJgM/d/4pLPHPuTxK7Nbf7jFKzAeedUhR8C7K9Uv63FBsSo8xQ== queue-microtask@^1.2.2: version "1.2.3" @@ -2375,16 +2369,16 @@ resolve-from@^5.0.0: integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== resolve.exports@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.1.tgz#cee884cd4e3f355660e501fa3276b27d7ffe5a20" - integrity sha512-OEJWVeimw8mgQuj3HfkNl4KqRevH7lzeQNaWRPfx0PPse7Jk6ozcsG4FKVgtzDsC1KUF+YlTHh17NcgHOPykLw== + version "2.0.2" + resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.2.tgz#f8c934b8e6a13f539e38b7098e2e36134f01e800" + integrity sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg== resolve@^1.20.0: - version "1.22.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" - integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== + version "1.22.2" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.2.tgz#0ed0943d4e301867955766c9f3e1ae6d01c6845f" + integrity sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g== dependencies: - is-core-module "^2.9.0" + is-core-module "^2.11.0" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" @@ -2589,10 +2583,10 @@ type-fest@^0.21.3: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== -update-browserslist-db@^1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz#0f54b876545726f17d00cd9a2561e6dade943ff3" - integrity sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ== +update-browserslist-db@^1.0.11: + version "1.0.11" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz#9a2a641ad2907ae7b3616506f4b977851db5b940" + integrity sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA== dependencies: escalade "^3.1.1" picocolors "^1.0.0" @@ -2670,9 +2664,9 @@ yargs-parser@^21.1.1: integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== yargs@^17.3.1: - version "17.7.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.1.tgz#34a77645201d1a8fc5213ace787c220eabbd0967" - integrity sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw== + version "17.7.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" + integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== dependencies: cliui "^8.0.1" escalade "^3.1.1" From c87329b6f04bddb6889d578f429b076aefebfaa3 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 6 Jul 2023 10:13:41 -0400 Subject: [PATCH 717/785] Specify default --- README.md | 23 +++++++++-------------- src/plugin.js | 29 +++++++++-------------------- 2 files changed, 18 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index c8615c5e..44ebaab9 100644 --- a/README.md +++ b/README.md @@ -104,14 +104,15 @@ The `prettier` executable is now installed and ready for use: Below are the options (from [`src/plugin.js`](src/plugin.js)) that `@prettier/plugin-ruby` currently supports: -| API Option | CLI Option | Default | Description | -| ----------------- | --------------------- | :-----: | --------------------------------------------------------------------------------------------------------------------------------------------------- | -| `printWidth` | `--print-width` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)). | -| `requirePragma` | `--require-pragma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#require-pragma)). | -| `rubyPlugins` | `--ruby-plugins` | `""` | The comma-separated list of plugins to require. See [Syntax Tree](https://github.com/ruby-syntax-tree/syntax_tree#plugins). | -| `rubySingleQuote` | `--ruby-single-quote` | `false` | Whether or not to default to single quotes for Ruby code. See [Syntax Tree](https://github.com/ruby-syntax-tree/syntax_tree#plugins). | -| `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). | -| `trailingComma` | `--trailing-comma` | `es5` | Almost same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#trailing-commas)). Will be on for any value except `none`. | +| API Option | CLI Option | Default | Description | +| -------------------- | --------------------- | :------------------------------------------------: | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| `printWidth` | `--print-width` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)). | +| `requirePragma` | `--require-pragma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#require-pragma)). | +| `rubyExecutablePath` | `"ruby"` | Allows you to configure your Ruby executable path. | +| `rubyPlugins` | `--ruby-plugins` | `""` | The comma-separated list of plugins to require. See [Syntax Tree](https://github.com/ruby-syntax-tree/syntax_tree#plugins). | +| `rubySingleQuote` | `--ruby-single-quote` | `false` | Whether or not to default to single quotes for Ruby code. See [Syntax Tree](https://github.com/ruby-syntax-tree/syntax_tree#plugins). | +| `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). | +| `trailingComma` | `--trailing-comma` | `es5` | Almost same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#trailing-commas)). Will be on for any value except `none`. | Any of these can be added to your existing [prettier configuration file](https://prettier.io/docs/en/configuration.html). For example: @@ -160,12 +161,6 @@ For [supported editor integrations](https://github.com/prettier/prettier/blob/ma Refer to [this issue](https://github.com/prettier/plugin-ruby/issues/113#issuecomment-783426539) if you're having difficulties. -Additional options: - -| Options | Default | Description | -| ----------------- | --------------------- | :-----: | -|`rubyExecutablePath`|`"ruby"`|Allows you to configure your Ruby executable path.| - ## Contributing Thanks so much for your interest in contributing! You can contribute in many ways, including: diff --git a/src/plugin.js b/src/plugin.js index 0df039bf..f2b4744e 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -65,27 +65,15 @@ function getPlugins(opts) { // created that will contain the connection information. export async function spawnServer(opts, killOnExit = true) { const tmpdir = os.tmpdir(); - - // First, get a filepath that points to the server script. If we're running - // under normal circumstances, we can just use a path relative to the - // import.meta.url value. - const serverURL = new URL("./server.rb", import.meta.url); - let serverFilepath = url.fileURLToPath(serverURL); - - // If we're in a yarn Plug'n'Play environment, then the relative paths being - // used by the parser server are not going to work with its virtual file - // system. So instead we need to copy the server script to a temporary - // directory. - if (process.versions.pnp) { - if (url.fileURLToPath(new URL(".", import.meta.url)).includes(".zip")) { - // TODO: wait for prettier to get support back for pnp - } - } - const filepath = path.join(tmpdir, `prettier-ruby-parser-${process.pid}.txt`); + const server = spawn( - opts.rubyExecutablePath, - [serverFilepath, `--plugins=${getPlugins(opts).join(",")}`, filepath], + opts.rubyExecutablePath || "ruby", + [ + url.fileURLToPath(new URL("./server.rb", import.meta.url)), + `--plugins=${getPlugins(opts).join(",")}`, + filepath + ], { env: Object.assign({}, process.env, { LANG: getLang() }), stdio: "ignore", @@ -360,7 +348,8 @@ const plugin = { type: "string", category: "Ruby", default: "ruby", - description: "The path to the Ruby executable to use to run the formatter.", + description: + "The path to the Ruby executable to use to run the formatter.", since: "3.3.0" } }, From ea7348778a04c85ee0c7f1bbe3bc50ad5660d3c4 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 6 Jul 2023 10:32:14 -0400 Subject: [PATCH 718/785] Provide better errors on missing gems --- src/plugin.js | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/plugin.js b/src/plugin.js index f2b4744e..5d31a7df 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -76,7 +76,7 @@ export async function spawnServer(opts, killOnExit = true) { ], { env: Object.assign({}, process.env, { LANG: getLang() }), - stdio: "ignore", + stdio: ["ignore", "ignore", "inherit"], detached: true } ); @@ -104,17 +104,6 @@ export async function spawnServer(opts, killOnExit = true) { } return new Promise((resolve, reject) => { - const timeout = setTimeout( - () => { - const message = - "Failed to get connection options from parse server in time. If this happens repeatedly, try increasing the PRETTIER_RUBY_TIMEOUT_MS environment variable beyond 10000."; - - clearInterval(interval); - reject(new Error(message)); - }, - parseInt(process.env.PRETTIER_RUBY_TIMEOUT_MS || "10000", 10) - ); - const interval = setInterval(() => { if (fs.existsSync(filepath)) { const connectionJSON = fs.readFileSync(filepath).toString("utf-8"); @@ -124,10 +113,25 @@ export async function spawnServer(opts, killOnExit = true) { connectionOptions: JSON.parse(connectionJSON) }); + clearTimeout(timeout); + clearInterval(interval); + } else if (server.exitCode) { + reject(new Error("Failed to start parse server.")); clearTimeout(timeout); clearInterval(interval); } }, 100); + + const timeout = setTimeout( + () => { + const message = + "Failed to get connection options from parse server in time. If this happens repeatedly, try increasing the PRETTIER_RUBY_TIMEOUT_MS environment variable beyond 10000."; + + clearInterval(interval); + reject(new Error(message)); + }, + parseInt(process.env.PRETTIER_RUBY_TIMEOUT_MS || "10000", 10) + ); }); } From 605e0194d459a3257c5ff8d209ac4359cb9d42a2 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 6 Jul 2023 10:41:52 -0400 Subject: [PATCH 719/785] Bump to v4.0.0 --- CHANGELOG.md | 15 ++++++++++++++- package.json | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13a6d763..05786ca4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,18 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [4.0.0] - 2023-07-06 + +### Added + +- [#1283](https://github.com/prettier/plugin-ruby/pull/1283) - oriolgual - Use `process.execPath` instead of `"node"`. +- [#1358](https://github.com/prettier/plugin-ruby/pull/1358) - davidalejandroaguilar - Add the `rubyExecutablePath` option. +- [#1359](https://github.com/prettier/plugin-ruby/pull/1359) - kddnewton - Inherit stderr from the parser process in order to provide better error messages when failing to spawn parser server. This will put out missing gem errors, for example. + +### Changed + +- [#1360](https://github.com/prettier/plugin-ruby/pull/1360) - kddnewton - Require prettier v3.0.0+. + ## [3.2.2] - 2022-09-20 ### Changed @@ -1267,7 +1279,8 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v3.2.2...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v4.0.0...HEAD +[4.0.0]: https://github.com/prettier/plugin-ruby/compare/v3.2.2...v4.0.0 [3.2.2]: https://github.com/prettier/plugin-ruby/compare/v3.2.1...v3.2.2 [3.2.1]: https://github.com/prettier/plugin-ruby/compare/v3.2.0...v3.2.1 [3.2.0]: https://github.com/prettier/plugin-ruby/compare/v3.1.2...v3.2.0 diff --git a/package.json b/package.json index 095b528b..d2b550fa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "3.2.2", + "version": "4.0.0", "description": "prettier plugin for the Ruby programming language", "type": "module", "main": "src/plugin.js", From abbc69243c126adcb1262639639ef84a4c453904 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 Jul 2023 12:55:26 +0000 Subject: [PATCH 720/785] Bump jest from 29.6.0 to 29.6.1 Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.6.0 to 29.6.1. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.6.1/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 584 +++++++++++++++++++++++++++--------------------------- 1 file changed, 292 insertions(+), 292 deletions(-) diff --git a/yarn.lock b/yarn.lock index a8312ad8..a1c0fbb1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -371,28 +371,28 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^29.6.0": - version "29.6.0" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.6.0.tgz#ad0ae19e56e3ca34f620bab7b3e0bb7e3e655275" - integrity sha512-anb6L1yg7uPQpytNVA5skRaXy3BmrsU8icRhTVNbWdjYWDDfy8M1Kq5HIVRpYoABdbpqsc5Dr+jtu4+qWRQBiQ== +"@jest/console@^29.6.1": + version "29.6.1" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.6.1.tgz#b48ba7b9c34b51483e6d590f46e5837f1ab5f639" + integrity sha512-Aj772AYgwTSr5w8qnyoJ0eDYvN6bMsH3ORH1ivMotrInHLKdUz6BDlaEXHdM6kODaBIkNIyQGzsMvRdOv7VG7Q== dependencies: - "@jest/types" "^29.6.0" + "@jest/types" "^29.6.1" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^29.6.0" - jest-util "^29.6.0" + jest-message-util "^29.6.1" + jest-util "^29.6.1" slash "^3.0.0" -"@jest/core@^29.6.0": - version "29.6.0" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.6.0.tgz#a71da7b99777ff4a3d534bd2529358872909905f" - integrity sha512-5dbMHfY/5R9m8NbgmB3JlxQqooZ/ooPSOiwEQZZ+HODwJTbIu37seVcZNBK29aMdXtjvTRB3f6LCvkKq+r8uQA== - dependencies: - "@jest/console" "^29.6.0" - "@jest/reporters" "^29.6.0" - "@jest/test-result" "^29.6.0" - "@jest/transform" "^29.6.0" - "@jest/types" "^29.6.0" +"@jest/core@^29.6.1": + version "29.6.1" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.6.1.tgz#fac0d9ddf320490c93356ba201451825231e95f6" + integrity sha512-CcowHypRSm5oYQ1obz1wfvkjZZ2qoQlrKKvlfPwh5jUXVU12TWr2qMeH8chLMuTFzHh5a1g2yaqlqDICbr+ukQ== + dependencies: + "@jest/console" "^29.6.1" + "@jest/reporters" "^29.6.1" + "@jest/test-result" "^29.6.1" + "@jest/transform" "^29.6.1" + "@jest/types" "^29.6.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" @@ -400,80 +400,80 @@ exit "^0.1.2" graceful-fs "^4.2.9" jest-changed-files "^29.5.0" - jest-config "^29.6.0" - jest-haste-map "^29.6.0" - jest-message-util "^29.6.0" + jest-config "^29.6.1" + jest-haste-map "^29.6.1" + jest-message-util "^29.6.1" jest-regex-util "^29.4.3" - jest-resolve "^29.6.0" - jest-resolve-dependencies "^29.6.0" - jest-runner "^29.6.0" - jest-runtime "^29.6.0" - jest-snapshot "^29.6.0" - jest-util "^29.6.0" - jest-validate "^29.6.0" - jest-watcher "^29.6.0" + jest-resolve "^29.6.1" + jest-resolve-dependencies "^29.6.1" + jest-runner "^29.6.1" + jest-runtime "^29.6.1" + jest-snapshot "^29.6.1" + jest-util "^29.6.1" + jest-validate "^29.6.1" + jest-watcher "^29.6.1" micromatch "^4.0.4" - pretty-format "^29.6.0" + pretty-format "^29.6.1" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.6.0": - version "29.6.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.6.0.tgz#a873d228159cbba812505f7d13e2d1a2d04a577a" - integrity sha512-bUZLYUxYlUIsslBbxII0fq0kr1+friI3Gty+cRLmocGB1jdcAHs7FS8QdCDqedE8q4DZE1g/AJHH6OJZBLGGsg== +"@jest/environment@^29.6.1": + version "29.6.1" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.6.1.tgz#ee358fff2f68168394b4a50f18c68278a21fe82f" + integrity sha512-RMMXx4ws+Gbvw3DfLSuo2cfQlK7IwGbpuEWXCqyYDcqYTI+9Ju3a5hDnXaxjNsa6uKh9PQF2v+qg+RLe63tz5A== dependencies: - "@jest/fake-timers" "^29.6.0" - "@jest/types" "^29.6.0" + "@jest/fake-timers" "^29.6.1" + "@jest/types" "^29.6.1" "@types/node" "*" - jest-mock "^29.6.0" + jest-mock "^29.6.1" -"@jest/expect-utils@^29.6.0": - version "29.6.0" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.6.0.tgz#14596ba728d61b0cf70f7d5c8fb88b8a82ea9def" - integrity sha512-LLSQQN7oypMSETKoPWpsWYVKJd9LQWmSDDAc4hUQ4JocVC7LAMy9R3ZMhlnLwbcFvQORZnZR7HM893Px6cJhvA== +"@jest/expect-utils@^29.6.1": + version "29.6.1" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.6.1.tgz#ab83b27a15cdd203fe5f68230ea22767d5c3acc5" + integrity sha512-o319vIf5pEMx0LmzSxxkYYxo4wrRLKHq9dP1yJU7FoPTB0LfAKSz8SWD6D/6U3v/O52t9cF5t+MeJiRsfk7zMw== dependencies: jest-get-type "^29.4.3" -"@jest/expect@^29.6.0": - version "29.6.0" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.6.0.tgz#2a25759ec696bc03d3e5cfeba5a26732431f844f" - integrity sha512-a7pISPW28Q3c0/pLwz4mQ6tbAI+hc8/0CJp9ix6e9U4dQ6TiHQX82CT5DV5BMWaw8bFH4E6zsfZxXdn6Ka23Bw== +"@jest/expect@^29.6.1": + version "29.6.1" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.6.1.tgz#fef18265188f6a97601f1ea0a2912d81a85b4657" + integrity sha512-N5xlPrAYaRNyFgVf2s9Uyyvr795jnB6rObuPx4QFvNJz8aAjpZUDfO4bh5G/xuplMID8PrnuF1+SfSyDxhsgYg== dependencies: - expect "^29.6.0" - jest-snapshot "^29.6.0" + expect "^29.6.1" + jest-snapshot "^29.6.1" -"@jest/fake-timers@^29.6.0": - version "29.6.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.6.0.tgz#9751cbabc86a39a1e6827cfcbabeba0207a63c97" - integrity sha512-nuCU46AsZoskthWSDS2Aj6LARgyNcp5Fjx2qxsO/fPl1Wp1CJ+dBDqs0OkEcJK8FBeV/MbjH5efe79M2sHcV+A== +"@jest/fake-timers@^29.6.1": + version "29.6.1" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.6.1.tgz#c773efddbc61e1d2efcccac008139f621de57c69" + integrity sha512-RdgHgbXyosCDMVYmj7lLpUwXA4c69vcNzhrt69dJJdf8azUrpRh3ckFCaTPNjsEeRi27Cig0oKDGxy5j7hOgHg== dependencies: - "@jest/types" "^29.6.0" + "@jest/types" "^29.6.1" "@sinonjs/fake-timers" "^10.0.2" "@types/node" "*" - jest-message-util "^29.6.0" - jest-mock "^29.6.0" - jest-util "^29.6.0" + jest-message-util "^29.6.1" + jest-mock "^29.6.1" + jest-util "^29.6.1" -"@jest/globals@^29.6.0": - version "29.6.0" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.6.0.tgz#e1603da83f69ed1a75e272d15da34a6a2fca1e24" - integrity sha512-IQQ3hZ2D/hwEwXSMv5GbfhzdH0nTQR3KPYxnuW6gYWbd6+7/zgMz7Okn6EgBbNtJNONq03k5EKA6HqGyzRbpeg== +"@jest/globals@^29.6.1": + version "29.6.1" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.6.1.tgz#c8a8923e05efd757308082cc22893d82b8aa138f" + integrity sha512-2VjpaGy78JY9n9370H8zGRCFbYVWwjY6RdDMhoJHa1sYfwe6XM/azGN0SjY8kk7BOZApIejQ1BFPyH7FPG0w3A== dependencies: - "@jest/environment" "^29.6.0" - "@jest/expect" "^29.6.0" - "@jest/types" "^29.6.0" - jest-mock "^29.6.0" + "@jest/environment" "^29.6.1" + "@jest/expect" "^29.6.1" + "@jest/types" "^29.6.1" + jest-mock "^29.6.1" -"@jest/reporters@^29.6.0": - version "29.6.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.6.0.tgz#09e6d47b3d9b69172cbc344d4cb8954966a7a466" - integrity sha512-dWEq4HI0VvHcAD6XTtyBKKARLytyyWPIy1SvGOcU91106MfvHPdxZgupFwVHd8TFpZPpA3SebYjtwS5BUS76Rw== +"@jest/reporters@^29.6.1": + version "29.6.1" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.6.1.tgz#3325a89c9ead3cf97ad93df3a427549d16179863" + integrity sha512-9zuaI9QKr9JnoZtFQlw4GREQbxgmNYXU6QuWtmuODvk5nvPUeBYapVR/VYMyi2WSx3jXTLJTJji8rN6+Cm4+FA== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.6.0" - "@jest/test-result" "^29.6.0" - "@jest/transform" "^29.6.0" - "@jest/types" "^29.6.0" + "@jest/console" "^29.6.1" + "@jest/test-result" "^29.6.1" + "@jest/transform" "^29.6.1" + "@jest/types" "^29.6.1" "@jridgewell/trace-mapping" "^0.3.18" "@types/node" "*" chalk "^4.0.0" @@ -486,9 +486,9 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^29.6.0" - jest-util "^29.6.0" - jest-worker "^29.6.0" + jest-message-util "^29.6.1" + jest-util "^29.6.1" + jest-worker "^29.6.1" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" @@ -510,51 +510,51 @@ callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^29.6.0": - version "29.6.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.6.0.tgz#03bd32d3bb696eff5affecf918468bc633fc32d5" - integrity sha512-9qLb7xITeyWhM4yatn2muqfomuoCTOhv0QV9i7XiIyYi3QLfnvPv5NeJp5u0PZeutAOROMLKakOkmoAisOr3YQ== +"@jest/test-result@^29.6.1": + version "29.6.1" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.6.1.tgz#850e565a3f58ee8ca6ec424db00cb0f2d83c36ba" + integrity sha512-Ynr13ZRcpX6INak0TPUukU8GWRfm/vAytE3JbJNGAvINySWYdfE7dGZMbk36oVuK4CigpbhMn8eg1dixZ7ZJOw== dependencies: - "@jest/console" "^29.6.0" - "@jest/types" "^29.6.0" + "@jest/console" "^29.6.1" + "@jest/types" "^29.6.1" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.6.0": - version "29.6.0" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.6.0.tgz#30a70e2dcc7dcf1e0f1170b97384883ce0a7d6e5" - integrity sha512-HYCS3LKRQotKWj2mnA3AN13PPevYZu8MJKm12lzYojpJNnn6kI/3PWmr1At/e3tUu+FHQDiOyaDVuR4EV3ezBw== +"@jest/test-sequencer@^29.6.1": + version "29.6.1" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.6.1.tgz#e3e582ee074dd24ea9687d7d1aaf05ee3a9b068e" + integrity sha512-oBkC36PCDf/wb6dWeQIhaviU0l5u6VCsXa119yqdUosYAt7/FbQU2M2UoziO3igj/HBDEgp57ONQ3fm0v9uyyg== dependencies: - "@jest/test-result" "^29.6.0" + "@jest/test-result" "^29.6.1" graceful-fs "^4.2.9" - jest-haste-map "^29.6.0" + jest-haste-map "^29.6.1" slash "^3.0.0" -"@jest/transform@^29.6.0": - version "29.6.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.6.0.tgz#dcbb37e35412310073e633816fd7dbc11773596d" - integrity sha512-bhP/KxPo3e322FJ0nKAcb6WVK76ZYyQd1lWygJzoSqP8SYMSLdxHqP4wnPTI4WvbB8PKPDV30y5y7Tya4RHOBA== +"@jest/transform@^29.6.1": + version "29.6.1" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.6.1.tgz#acb5606019a197cb99beda3c05404b851f441c92" + integrity sha512-URnTneIU3ZjRSaf906cvf6Hpox3hIeJXRnz3VDSw5/X93gR8ycdfSIEy19FlVx8NFmpN7fe3Gb1xF+NjXaQLWg== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^29.6.0" + "@jest/types" "^29.6.1" "@jridgewell/trace-mapping" "^0.3.18" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^2.0.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.6.0" + jest-haste-map "^29.6.1" jest-regex-util "^29.4.3" - jest-util "^29.6.0" + jest-util "^29.6.1" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" write-file-atomic "^4.0.2" -"@jest/types@^29.6.0": - version "29.6.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.6.0.tgz#717646103c5715394d78c011a08b3cbb83d738e8" - integrity sha512-8XCgL9JhqbJTFnMRjEAO+TuW251+MoMd5BSzLiE3vvzpQ8RlBxy8NoyNkDhs3K3OL3HeVinlOl9or5p7GTeOLg== +"@jest/types@^29.6.1": + version "29.6.1" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.6.1.tgz#ae79080278acff0a6af5eb49d063385aaa897bf2" + integrity sha512-tPKQNMPuXgvdOn2/Lg9HNfUvjYVGolt04Hp03f5hAk878uwOLikN+JzeLY0HcVgKgFl9Hs3EIqpu3WX27XNhnw== dependencies: "@jest/schemas" "^29.6.0" "@types/istanbul-lib-coverage" "^2.0.0" @@ -822,12 +822,12 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^29.6.0: - version "29.6.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.6.0.tgz#f97962732a729ca5cb26f610250c0cb4577bf3f8" - integrity sha512-Jj8Bq2yKsk11XLk06Nm8SdvYkAcecH+GuhxB8DnK5SncjHnJ88TQjSnGgE7jpajpnSvz9DZ6X8hXrDkD/6/TPQ== +babel-jest@^29.6.1: + version "29.6.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.6.1.tgz#a7141ad1ed5ec50238f3cd36127636823111233a" + integrity sha512-qu+3bdPEQC6KZSPz+4Fyjbga5OODNcp49j6GKzG1EKbkfyJBxEYGVUmVGpwCSeGouG52R4EgYMLb6p9YeEEQ4A== dependencies: - "@jest/transform" "^29.6.0" + "@jest/transform" "^29.6.1" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" babel-preset-jest "^29.5.0" @@ -1275,17 +1275,17 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== -expect@^29.6.0: - version "29.6.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.6.0.tgz#a0c114e91d8b6e9fcfb2d830411958699125bd23" - integrity sha512-AV+HaBtnDJ2YEUhPPo25HyUHBLaetM+y/Dq6pEC8VPQyt1dK+k8MfGkMy46djy2bddcqESc1kl4/K1uLWSfk9g== +expect@^29.6.1: + version "29.6.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.6.1.tgz#64dd1c8f75e2c0b209418f2b8d36a07921adfdf1" + integrity sha512-XEdDLonERCU1n9uR56/Stx9OqojaLAQtZf9PrCHH9Hl8YXiEIka3H4NXJ3NOIBmQJTg7+j7buh34PMHfJujc8g== dependencies: - "@jest/expect-utils" "^29.6.0" + "@jest/expect-utils" "^29.6.1" "@types/node" "*" jest-get-type "^29.4.3" - jest-matcher-utils "^29.6.0" - jest-message-util "^29.6.0" - jest-util "^29.6.0" + jest-matcher-utils "^29.6.1" + jest-message-util "^29.6.1" + jest-util "^29.6.1" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1622,87 +1622,87 @@ jest-changed-files@^29.5.0: execa "^5.0.0" p-limit "^3.1.0" -jest-circus@^29.6.0: - version "29.6.0" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.6.0.tgz#aa6369bd10aecc8ec68298bd14cf43ac4370958a" - integrity sha512-LtG45qEKhse2Ws5zNR4DnZATReLGQXzBZGZnJ0DU37p6d4wDhu41vvczCQ3Ou+llR6CRYDBshsubV7H4jZvIkw== +jest-circus@^29.6.1: + version "29.6.1" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.6.1.tgz#861dab37e71a89907d1c0fabc54a0019738ed824" + integrity sha512-tPbYLEiBU4MYAL2XoZme/bgfUeotpDBd81lgHLCbDZZFaGmECk0b+/xejPFtmiBP87GgP/y4jplcRpbH+fgCzQ== dependencies: - "@jest/environment" "^29.6.0" - "@jest/expect" "^29.6.0" - "@jest/test-result" "^29.6.0" - "@jest/types" "^29.6.0" + "@jest/environment" "^29.6.1" + "@jest/expect" "^29.6.1" + "@jest/test-result" "^29.6.1" + "@jest/types" "^29.6.1" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" is-generator-fn "^2.0.0" - jest-each "^29.6.0" - jest-matcher-utils "^29.6.0" - jest-message-util "^29.6.0" - jest-runtime "^29.6.0" - jest-snapshot "^29.6.0" - jest-util "^29.6.0" + jest-each "^29.6.1" + jest-matcher-utils "^29.6.1" + jest-message-util "^29.6.1" + jest-runtime "^29.6.1" + jest-snapshot "^29.6.1" + jest-util "^29.6.1" p-limit "^3.1.0" - pretty-format "^29.6.0" + pretty-format "^29.6.1" pure-rand "^6.0.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.6.0: - version "29.6.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.6.0.tgz#a885e3d5a0b12ba520f61f8496bb0c9c2ff97896" - integrity sha512-WvZIaanK/abkw6s01924DQ2QLwM5Q4Y4iPbSDb9Zg6smyXGqqcPQ7ft9X8D7B0jICz312eSzM6UlQNxuZJBrMw== +jest-cli@^29.6.1: + version "29.6.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.6.1.tgz#99d9afa7449538221c71f358f0fdd3e9c6e89f72" + integrity sha512-607dSgTA4ODIN6go9w6xY3EYkyPFGicx51a69H7yfvt7lN53xNswEVLovq+E77VsTRi5fWprLH0yl4DJgE8Ing== dependencies: - "@jest/core" "^29.6.0" - "@jest/test-result" "^29.6.0" - "@jest/types" "^29.6.0" + "@jest/core" "^29.6.1" + "@jest/test-result" "^29.6.1" + "@jest/types" "^29.6.1" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.6.0" - jest-util "^29.6.0" - jest-validate "^29.6.0" + jest-config "^29.6.1" + jest-util "^29.6.1" + jest-validate "^29.6.1" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^29.6.0: - version "29.6.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.6.0.tgz#0bca14b634919519a298a56c0ed1d200b9f0fa31" - integrity sha512-fKA4jM91PDqWVkMpb1FVKxIuhg3hC6hgaen57cr1rRZkR96dCatvJZsk3ik7/GNu9ERj9wgAspOmyvkFoGsZhA== +jest-config@^29.6.1: + version "29.6.1" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.6.1.tgz#d785344509065d53a238224c6cdc0ed8e2f2f0dd" + integrity sha512-XdjYV2fy2xYixUiV2Wc54t3Z4oxYPAELUzWnV6+mcbq0rh742X2p52pii5A3oeRzYjLnQxCsZmp0qpI6klE2cQ== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.6.0" - "@jest/types" "^29.6.0" - babel-jest "^29.6.0" + "@jest/test-sequencer" "^29.6.1" + "@jest/types" "^29.6.1" + babel-jest "^29.6.1" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^29.6.0" - jest-environment-node "^29.6.0" + jest-circus "^29.6.1" + jest-environment-node "^29.6.1" jest-get-type "^29.4.3" jest-regex-util "^29.4.3" - jest-resolve "^29.6.0" - jest-runner "^29.6.0" - jest-util "^29.6.0" - jest-validate "^29.6.0" + jest-resolve "^29.6.1" + jest-runner "^29.6.1" + jest-util "^29.6.1" + jest-validate "^29.6.1" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^29.6.0" + pretty-format "^29.6.1" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^29.6.0: - version "29.6.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.6.0.tgz#9fe219a2f73a62ed6ac1c1a58e4965dc66836c4b" - integrity sha512-ZRm7cd2m9YyZ0N3iMyuo1iUiprxQ/MFpYWXzEEj7hjzL3WnDffKW8192XBDcrAI8j7hnrM1wed3bL/oEnYF/8w== +jest-diff@^29.6.1: + version "29.6.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.6.1.tgz#13df6db0a89ee6ad93c747c75c85c70ba941e545" + integrity sha512-FsNCvinvl8oVxpNLttNQX7FAq7vR+gMDGj90tiP7siWw1UdakWUGqrylpsYrpvj908IYckm5Y0Q7azNAozU1Kg== dependencies: chalk "^4.0.0" diff-sequences "^29.4.3" jest-get-type "^29.4.3" - pretty-format "^29.6.0" + pretty-format "^29.6.1" jest-docblock@^29.4.3: version "29.4.3" @@ -1711,94 +1711,94 @@ jest-docblock@^29.4.3: dependencies: detect-newline "^3.0.0" -jest-each@^29.6.0: - version "29.6.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.6.0.tgz#320637063b518a51e42b38a0186255e6e5978fe7" - integrity sha512-d0Jem4RBAlFUyV6JSXPSHVUpNo5RleSj+iJEy1G3+ZCrzHDjWs/1jUfrbnJKHdJdAx5BCEce/Ju379WqHhQk4w== +jest-each@^29.6.1: + version "29.6.1" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.6.1.tgz#975058e5b8f55c6780beab8b6ab214921815c89c" + integrity sha512-n5eoj5eiTHpKQCAVcNTT7DRqeUmJ01hsAL0Q1SMiBHcBcvTKDELixQOGMCpqhbIuTcfC4kMfSnpmDqRgRJcLNQ== dependencies: - "@jest/types" "^29.6.0" + "@jest/types" "^29.6.1" chalk "^4.0.0" jest-get-type "^29.4.3" - jest-util "^29.6.0" - pretty-format "^29.6.0" + jest-util "^29.6.1" + pretty-format "^29.6.1" -jest-environment-node@^29.6.0: - version "29.6.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.6.0.tgz#634c3027afaa6f4211516348c59642d74b126a1b" - integrity sha512-BOf5Q2/nFCdBOnyBM5c5/6DbdQYgc+0gyUQ8l8qhUAB8O7pM+4QJXIXJsRZJaxd5SHV6y5VArTVhOfogoqcP8Q== +jest-environment-node@^29.6.1: + version "29.6.1" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.6.1.tgz#08a122dece39e58bc388da815a2166c58b4abec6" + integrity sha512-ZNIfAiE+foBog24W+2caIldl4Irh8Lx1PUhg/GZ0odM1d/h2qORAsejiFc7zb+SEmYPn1yDZzEDSU5PmDkmVLQ== dependencies: - "@jest/environment" "^29.6.0" - "@jest/fake-timers" "^29.6.0" - "@jest/types" "^29.6.0" + "@jest/environment" "^29.6.1" + "@jest/fake-timers" "^29.6.1" + "@jest/types" "^29.6.1" "@types/node" "*" - jest-mock "^29.6.0" - jest-util "^29.6.0" + jest-mock "^29.6.1" + jest-util "^29.6.1" jest-get-type@^29.4.3: version "29.4.3" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.4.3.tgz#1ab7a5207c995161100b5187159ca82dd48b3dd5" integrity sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg== -jest-haste-map@^29.6.0: - version "29.6.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.6.0.tgz#5f3e6292bc45f596de48835489ddac409748b15a" - integrity sha512-dY1DKufptj7hcJSuhpqlYPGcnN3XjlOy/g0jinpRTMsbb40ivZHiuIPzeminOZkrek8C+oDxC54ILGO3vMLojg== +jest-haste-map@^29.6.1: + version "29.6.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.6.1.tgz#62655c7a1c1b349a3206441330fb2dbdb4b63803" + integrity sha512-0m7f9PZXxOCk1gRACiVgX85knUKPKLPg4oRCjLoqIm9brTHXaorMA0JpmtmVkQiT8nmXyIVoZd/nnH1cfC33ig== dependencies: - "@jest/types" "^29.6.0" + "@jest/types" "^29.6.1" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" jest-regex-util "^29.4.3" - jest-util "^29.6.0" - jest-worker "^29.6.0" + jest-util "^29.6.1" + jest-worker "^29.6.1" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^29.6.0: - version "29.6.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.6.0.tgz#9b96d275622739b4436ee7e91b3f3d386471105c" - integrity sha512-JdV6EZOPxHR1gd6ccxjNowuROkT2jtGU5G/g58RcJX1xe5mrtLj0g6/ZkyMoXF4cs+tTkHMFX6pcIrB1QPQwCw== +jest-leak-detector@^29.6.1: + version "29.6.1" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.6.1.tgz#66a902c81318e66e694df7d096a95466cb962f8e" + integrity sha512-OrxMNyZirpOEwkF3UHnIkAiZbtkBWiye+hhBweCHkVbCgyEy71Mwbb5zgeTNYWJBi1qgDVfPC1IwO9dVEeTLwQ== dependencies: jest-get-type "^29.4.3" - pretty-format "^29.6.0" + pretty-format "^29.6.1" -jest-matcher-utils@^29.6.0: - version "29.6.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.6.0.tgz#4465344800591022a5239f529857c053da6a9d5c" - integrity sha512-oSlqfGN+sbkB2Q5um/zL7z80w84FEAcLKzXBZIPyRk2F2Srg1ubhrHVKW68JCvb2+xKzAeGw35b+6gciS24PHw== +jest-matcher-utils@^29.6.1: + version "29.6.1" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.6.1.tgz#6c60075d84655d6300c5d5128f46531848160b53" + integrity sha512-SLaztw9d2mfQQKHmJXKM0HCbl2PPVld/t9Xa6P9sgiExijviSp7TnZZpw2Fpt+OI3nwUO/slJbOfzfUMKKC5QA== dependencies: chalk "^4.0.0" - jest-diff "^29.6.0" + jest-diff "^29.6.1" jest-get-type "^29.4.3" - pretty-format "^29.6.0" + pretty-format "^29.6.1" -jest-message-util@^29.6.0: - version "29.6.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.6.0.tgz#b23c1f787fcc226c49489fd53018100c2f434fe6" - integrity sha512-mkCp56cETbpoNtsaeWVy6SKzk228mMi9FPHSObaRIhbR2Ujw9PqjW/yqVHD2tN1bHbC8ol6h3UEo7dOPmIYwIA== +jest-message-util@^29.6.1: + version "29.6.1" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.6.1.tgz#d0b21d87f117e1b9e165e24f245befd2ff34ff8d" + integrity sha512-KoAW2zAmNSd3Gk88uJ56qXUWbFk787QKmjjJVOjtGFmmGSZgDBrlIL4AfQw1xyMYPNVD7dNInfIbur9B2rd/wQ== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.6.0" + "@jest/types" "^29.6.1" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^29.6.0" + pretty-format "^29.6.1" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^29.6.0: - version "29.6.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.6.0.tgz#4643fe35a3f20ef9a71f2a61f037a2ff05702d55" - integrity sha512-2Pb7R2w24Q0aUVn+2/vdRDL6CqGqpheDZy7zrXav8FotOpSGw/4bS2hyVoKHMEx4xzOn6EyCAGwc5czWxXeN7w== +jest-mock@^29.6.1: + version "29.6.1" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.6.1.tgz#049ee26aea8cbf54c764af649070910607316517" + integrity sha512-brovyV9HBkjXAEdRooaTQK42n8usKoSRR3gihzUpYeV/vwqgSoNfrksO7UfSACnPmxasO/8TmHM3w9Hp3G1dgw== dependencies: - "@jest/types" "^29.6.0" + "@jest/types" "^29.6.1" "@types/node" "*" - jest-util "^29.6.0" + jest-util "^29.6.1" jest-pnp-resolver@^1.2.2: version "1.2.3" @@ -1810,168 +1810,168 @@ jest-regex-util@^29.4.3: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.4.3.tgz#a42616141e0cae052cfa32c169945d00c0aa0bb8" integrity sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg== -jest-resolve-dependencies@^29.6.0: - version "29.6.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.0.tgz#772a315ebf2556c3c0ced98f268d2f931efab8a5" - integrity sha512-eOfPog9K3hJdJk/3i6O6bQhXS+3uXhMDkLJGX+xmMPp7T1d/zdcFofbDnHgNoEkhD/mSimC5IagLEP7lpLLu/A== +jest-resolve-dependencies@^29.6.1: + version "29.6.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.1.tgz#b85b06670f987a62515bbf625d54a499e3d708f5" + integrity sha512-BbFvxLXtcldaFOhNMXmHRWx1nXQO5LoXiKSGQcA1LxxirYceZT6ch8KTE1bK3X31TNG/JbkI7OkS/ABexVahiw== dependencies: jest-regex-util "^29.4.3" - jest-snapshot "^29.6.0" + jest-snapshot "^29.6.1" -jest-resolve@^29.6.0: - version "29.6.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.6.0.tgz#e7ffd4ebfd03d0ef442eba00611b5a5ea18996b5" - integrity sha512-+hrpY4LzAONoZA/rvB6rnZLkOSA6UgJLpdCWrOZNSgGxWMumzRLu7dLUSCabAHzoHIDQ9qXfr3th1zYNJ0E8sQ== +jest-resolve@^29.6.1: + version "29.6.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.6.1.tgz#4c3324b993a85e300add2f8609f51b80ddea39ee" + integrity sha512-AeRkyS8g37UyJiP9w3mmI/VXU/q8l/IH52vj/cDAyScDcemRbSBhfX/NMYIGilQgSVwsjxrCHf3XJu4f+lxCMg== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^29.6.0" + jest-haste-map "^29.6.1" jest-pnp-resolver "^1.2.2" - jest-util "^29.6.0" - jest-validate "^29.6.0" + jest-util "^29.6.1" + jest-validate "^29.6.1" resolve "^1.20.0" resolve.exports "^2.0.0" slash "^3.0.0" -jest-runner@^29.6.0: - version "29.6.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.6.0.tgz#7d8680b80c92c6fb94b9960714cd7004de7ef948" - integrity sha512-4fZuGV2lOxS2BiqEG9/AI8E6O+jo+QZjMVcgi1x5E6aDql0Gd/EFIbUQ0pSS09y8cya1vJB/qC2xsE468jqtSg== - dependencies: - "@jest/console" "^29.6.0" - "@jest/environment" "^29.6.0" - "@jest/test-result" "^29.6.0" - "@jest/transform" "^29.6.0" - "@jest/types" "^29.6.0" +jest-runner@^29.6.1: + version "29.6.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.6.1.tgz#54557087e7972d345540d622ab5bfc3d8f34688c" + integrity sha512-tw0wb2Q9yhjAQ2w8rHRDxteryyIck7gIzQE4Reu3JuOBpGp96xWgF0nY8MDdejzrLCZKDcp8JlZrBN/EtkQvPQ== + dependencies: + "@jest/console" "^29.6.1" + "@jest/environment" "^29.6.1" + "@jest/test-result" "^29.6.1" + "@jest/transform" "^29.6.1" + "@jest/types" "^29.6.1" "@types/node" "*" chalk "^4.0.0" emittery "^0.13.1" graceful-fs "^4.2.9" jest-docblock "^29.4.3" - jest-environment-node "^29.6.0" - jest-haste-map "^29.6.0" - jest-leak-detector "^29.6.0" - jest-message-util "^29.6.0" - jest-resolve "^29.6.0" - jest-runtime "^29.6.0" - jest-util "^29.6.0" - jest-watcher "^29.6.0" - jest-worker "^29.6.0" + jest-environment-node "^29.6.1" + jest-haste-map "^29.6.1" + jest-leak-detector "^29.6.1" + jest-message-util "^29.6.1" + jest-resolve "^29.6.1" + jest-runtime "^29.6.1" + jest-util "^29.6.1" + jest-watcher "^29.6.1" + jest-worker "^29.6.1" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^29.6.0: - version "29.6.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.6.0.tgz#0f6d98b40625c620c6fa1f075c3b0ca95daa8f1c" - integrity sha512-5FavYo3EeXLHIvnJf+r7Cj0buePAbe4mzRB9oeVxDS0uVmouSBjWeGgyRjZkw7ArxOoZI8gO6f8SGMJ2HFlwwg== +jest-runtime@^29.6.1: + version "29.6.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.6.1.tgz#8a0fc9274ef277f3d70ba19d238e64334958a0dc" + integrity sha512-D6/AYOA+Lhs5e5il8+5pSLemjtJezUr+8zx+Sn8xlmOux3XOqx4d8l/2udBea8CRPqqrzhsKUsN/gBDE/IcaPQ== dependencies: - "@jest/environment" "^29.6.0" - "@jest/fake-timers" "^29.6.0" - "@jest/globals" "^29.6.0" + "@jest/environment" "^29.6.1" + "@jest/fake-timers" "^29.6.1" + "@jest/globals" "^29.6.1" "@jest/source-map" "^29.6.0" - "@jest/test-result" "^29.6.0" - "@jest/transform" "^29.6.0" - "@jest/types" "^29.6.0" + "@jest/test-result" "^29.6.1" + "@jest/transform" "^29.6.1" + "@jest/types" "^29.6.1" "@types/node" "*" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^29.6.0" - jest-message-util "^29.6.0" - jest-mock "^29.6.0" + jest-haste-map "^29.6.1" + jest-message-util "^29.6.1" + jest-mock "^29.6.1" jest-regex-util "^29.4.3" - jest-resolve "^29.6.0" - jest-snapshot "^29.6.0" - jest-util "^29.6.0" + jest-resolve "^29.6.1" + jest-snapshot "^29.6.1" + jest-util "^29.6.1" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.6.0: - version "29.6.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.6.0.tgz#a8653fe098f1c39ab37c94f8b1370f606b5618a9" - integrity sha512-H3kUE9NwWDEDoutcOSS921IqdlkdjgnMdj1oMyxAHNflscdLc9dB8OudZHV6kj4OHJxbMxL8CdI5DlwYrs4wQg== +jest-snapshot@^29.6.1: + version "29.6.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.6.1.tgz#0d083cb7de716d5d5cdbe80d598ed2fbafac0239" + integrity sha512-G4UQE1QQ6OaCgfY+A0uR1W2AY0tGXUPQpoUClhWHq1Xdnx1H6JOrC2nH5lqnOEqaDgbHFgIwZ7bNq24HpB180A== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" "@babel/plugin-syntax-jsx" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.6.0" - "@jest/transform" "^29.6.0" - "@jest/types" "^29.6.0" + "@jest/expect-utils" "^29.6.1" + "@jest/transform" "^29.6.1" + "@jest/types" "^29.6.1" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.6.0" + expect "^29.6.1" graceful-fs "^4.2.9" - jest-diff "^29.6.0" + jest-diff "^29.6.1" jest-get-type "^29.4.3" - jest-matcher-utils "^29.6.0" - jest-message-util "^29.6.0" - jest-util "^29.6.0" + jest-matcher-utils "^29.6.1" + jest-message-util "^29.6.1" + jest-util "^29.6.1" natural-compare "^1.4.0" - pretty-format "^29.6.0" + pretty-format "^29.6.1" semver "^7.5.3" -jest-util@^29.6.0: - version "29.6.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.6.0.tgz#4071050c5d70f5d4d48105e8883773f3a6b94f8d" - integrity sha512-S0USx9YwcvEm4pQ5suisVm/RVxBmi0GFR7ocJhIeaCuW5AXnAnffXbaVKvIFodyZNOc9ygzVtTxmBf40HsHXaA== +jest-util@^29.6.1: + version "29.6.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.6.1.tgz#c9e29a87a6edbf1e39e6dee2b4689b8a146679cb" + integrity sha512-NRFCcjc+/uO3ijUVyNOQJluf8PtGCe/W6cix36+M3cTFgiYqFOOW5MgN4JOOcvbUhcKTYVd1CvHz/LWi8d16Mg== dependencies: - "@jest/types" "^29.6.0" + "@jest/types" "^29.6.1" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^29.6.0: - version "29.6.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.6.0.tgz#6a7416a1df4fe90896db566b83d6b4c9485c402c" - integrity sha512-MLTrAJsb1+W7svbeZ+A7pAnyXMaQrjvPDKCy7OlfsfB6TMVc69v7WjUWfiR6r3snULFWZASiKgvNVDuATta1dg== +jest-validate@^29.6.1: + version "29.6.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.6.1.tgz#765e684af6e2c86dce950aebefbbcd4546d69f7b" + integrity sha512-r3Ds69/0KCN4vx4sYAbGL1EVpZ7MSS0vLmd3gV78O+NAx3PDQQukRU5hNHPXlyqCgFY8XUk7EuTMLugh0KzahA== dependencies: - "@jest/types" "^29.6.0" + "@jest/types" "^29.6.1" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^29.4.3" leven "^3.1.0" - pretty-format "^29.6.0" + pretty-format "^29.6.1" -jest-watcher@^29.6.0: - version "29.6.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.6.0.tgz#77df9ffcdfc70406fdd577020c1e4d62de5a0299" - integrity sha512-LdsQqFNX60mRdRRe+zsELnYRH1yX6KL+ukbh+u6WSQeTheZZe1TlLJNKRQiZ7e0VbvMkywmMWL/KV35noOJCcw== +jest-watcher@^29.6.1: + version "29.6.1" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.6.1.tgz#7c0c43ddd52418af134c551c92c9ea31e5ec942e" + integrity sha512-d4wpjWTS7HEZPaaj8m36QiaP856JthRZkrgcIY/7ISoUWPIillrXM23WPboZVLbiwZBt4/qn2Jke84Sla6JhFA== dependencies: - "@jest/test-result" "^29.6.0" - "@jest/types" "^29.6.0" + "@jest/test-result" "^29.6.1" + "@jest/types" "^29.6.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.13.1" - jest-util "^29.6.0" + jest-util "^29.6.1" string-length "^4.0.1" -jest-worker@^29.6.0: - version "29.6.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.6.0.tgz#e0c40226d073fdb8f0dfe87d7f90f8fd987d8ba3" - integrity sha512-oiQHH1SnKmZIwwPnpOrXTq4kHBk3lKGY/07DpnH0sAu+x7J8rXlbLDROZsU6vy9GwB0hPiZeZpu6YlJ48QoKcA== +jest-worker@^29.6.1: + version "29.6.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.6.1.tgz#64b015f0e985ef3a8ad049b61fe92b3db74a5319" + integrity sha512-U+Wrbca7S8ZAxAe9L6nb6g8kPdia5hj32Puu5iOqBCMTMWFHXuK6dOV2IFrpedbTV8fjMFLdWNttQTBL6u2MRA== dependencies: "@types/node" "*" - jest-util "^29.6.0" + jest-util "^29.6.1" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^29.5.0: - version "29.6.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.6.0.tgz#dbc8136e6d933177487e2427187e07ebf9db8ce4" - integrity sha512-do1J9gGrQ68E4UfMz/4OM71p9qCqQxu32N/9ZfeYFSSlx0uUOuxeyZxtJZNaUTW12ZA11ERhmBjBhy1Ho96R4g== + version "29.6.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.6.1.tgz#74be1cb719c3abe439f2d94aeb18e6540a5b02ad" + integrity sha512-Nirw5B4nn69rVUZtemCQhwxOBhm0nsp3hmtF4rzCeWD7BkjAXRIji7xWQfnTNbz9g0aVsBX6aZK3n+23LM6uDw== dependencies: - "@jest/core" "^29.6.0" - "@jest/types" "^29.6.0" + "@jest/core" "^29.6.1" + "@jest/types" "^29.6.1" import-local "^3.0.2" - jest-cli "^29.6.0" + jest-cli "^29.6.1" js-tokens@^4.0.0: version "4.0.0" @@ -2289,10 +2289,10 @@ prettier@>=3.0.0: resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0.tgz#e7b19f691245a21d618c68bc54dc06122f6105ae" integrity sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g== -pretty-format@^29.6.0: - version "29.6.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.6.0.tgz#c90c8f145187fe73240662527a513599c16f3b97" - integrity sha512-XH+D4n7Ey0iSR6PdAnBs99cWMZdGsdKrR33iUHQNr79w1szKTCIZDVdXuccAsHVwDBp0XeWPfNEoaxP9EZgRmQ== +pretty-format@^29.6.1: + version "29.6.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.6.1.tgz#ec838c288850b7c4f9090b867c2d4f4edbfb0f3e" + integrity sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog== dependencies: "@jest/schemas" "^29.6.0" ansi-styles "^5.0.0" From bd96fafffc4881340c8bb2b6d219611d5b3f605e Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sat, 8 Jul 2023 12:31:38 -0400 Subject: [PATCH 721/785] Make sure to read all data from response socket --- src/plugin.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/plugin.js b/src/plugin.js index 5d31a7df..22459cad 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -140,10 +140,7 @@ if (process.env.PRETTIER_RUBY_HOST) { connectionOptions = JSON.parse(process.env.PRETTIER_RUBY_HOST); } -// Formats and sends a request to the parser server. We use netcat (or something -// like it) here since Prettier requires the results of `parse` to be -// synchronous and Node.js does not offer a mechanism for synchronous socket -// requests. +// Formats and sends an asynchronous request to the parser server. async function parse(parser, source, opts) { if (!connectionOptions) { const spawnedServer = await spawnServer(opts); @@ -152,10 +149,18 @@ async function parse(parser, source, opts) { return new Promise((resolve, reject) => { const socket = new net.Socket(); + let chunks = ""; + + socket.on("error", (error) => { + reject(error); + }); - socket.on("error", reject); socket.on("data", (data) => { - const response = JSON.parse(data.toString("utf-8")); + chunks += data.toString("utf-8"); + }); + + socket.on("end", () => { + const response = JSON.parse(chunks); if (response.error) { const error = new Error(response.error); From 08d74a2f9c19fe0370dca9465f0aab3c741eb764 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sat, 8 Jul 2023 12:35:58 -0400 Subject: [PATCH 722/785] Bump to version 4.0.1 --- .github/workflows/main.yml | 48 +++----------------------------------- CHANGELOG.md | 9 ++++++- package.json | 2 +- 3 files changed, 12 insertions(+), 47 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bfb14f96..62292d9f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,9 +14,9 @@ jobs: - ubuntu-latest - windows-latest ruby: - - "2.7" - "3.0" - "3.1" + - "3.2" runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@main @@ -49,48 +49,6 @@ jobs: - run: yarn checkFormat - run: yarn lint - # smoketest: - # name: Yarn PnP smoke test - # strategy: - # fail-fast: false - # matrix: - # platform: - # - macos-latest - # - ubuntu-latest - # - windows-latest - # yarn: - # - 2.x - # - 3.x - # runs-on: ${{ matrix.platform }} - # steps: - # - uses: actions/checkout@main - # - uses: ruby/setup-ruby@v1 - # with: - # bundler-cache: true - # ruby-version: "3.1" - # - run: gem install syntax_tree syntax_tree-haml syntax_tree-rbs - # - uses: actions/setup-node@v3 - # with: - # node-version: 18.x - # cache: yarn - # - run: yarn install --frozen-lockfile - # - run: yarn pack - # # Windows runners don't have /tmp, let's make sure it exists - # - run: mkdir -p /tmp - # - run: mv prettier-plugin-ruby-*.tgz /tmp/prettier-plugin-ruby.tgz - # - run: mkdir /tmp/smoketest - # - name: Smoke test - # run: | - # cd /tmp/smoketest - # echo '{ "name": "smoketest", "type": "module", "license": "MIT" }' > package.json - # yarn set version berry # workaround for https://github.com/yarnpkg/berry/issues/3180 - # yarn set version ${{ matrix.yarn }} - # yarn add prettier@next @prettier/plugin-ruby@file:/tmp/prettier-plugin-ruby.tgz - # npx rimraf .yarn/unplugged # Make sure Yarn didn't unplug anything; this will deliberately break if it did - # echo '{ "plugins": ["@prettier/plugin-ruby"] }' > .prettierrc.json - # echo 'def add(a, b) ; a + b ; end' > smoketest.rb - # yarn run prettier -w smoketest.rb && ruby -c smoketest.rb - gem: name: Gem runs-on: ubuntu-latest @@ -99,10 +57,10 @@ jobs: - uses: ruby/setup-ruby@v1 with: bundler-cache: true - ruby-version: "3.1" + ruby-version: "3.2" - uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: 18.x cache: yarn - run: yarn install --frozen-lockfile - run: gem build -o prettier.gem diff --git a/CHANGELOG.md b/CHANGELOG.md index 05786ca4..8b777b0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [4.0.1] - 2023-07-08 + +### Changed + +- [#1363](https://github.com/prettier/plugin-ruby/pull/1363) - mscrivo, kddnewton - Ensure all data is read from socket before attempting to parse to JSON. + ## [4.0.0] - 2023-07-06 ### Added @@ -1279,7 +1285,8 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v4.0.0...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v4.0.1...HEAD +[4.0.1]: https://github.com/prettier/plugin-ruby/compare/v4.0.0...v4.0.1 [4.0.0]: https://github.com/prettier/plugin-ruby/compare/v3.2.2...v4.0.0 [3.2.2]: https://github.com/prettier/plugin-ruby/compare/v3.2.1...v3.2.2 [3.2.1]: https://github.com/prettier/plugin-ruby/compare/v3.2.0...v3.2.1 diff --git a/package.json b/package.json index d2b550fa..2cf48c9d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "4.0.0", + "version": "4.0.1", "description": "prettier plugin for the Ruby programming language", "type": "module", "main": "src/plugin.js", From 3c968a4c3bdc0c5263b93465c2ff05ea21173449 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Jul 2023 00:57:55 +0000 Subject: [PATCH 723/785] Bump semver from 6.3.0 to 6.3.1 Bumps [semver](https://github.com/npm/node-semver) from 6.3.0 to 6.3.1. - [Release notes](https://github.com/npm/node-semver/releases) - [Changelog](https://github.com/npm/node-semver/blob/v6.3.1/CHANGELOG.md) - [Commits](https://github.com/npm/node-semver/compare/v6.3.0...v6.3.1) --- updated-dependencies: - dependency-name: semver dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index a1c0fbb1..19f2949b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2402,14 +2402,14 @@ run-parallel@^1.1.9: queue-microtask "^1.2.2" semver@^6.0.0, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + version "6.3.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== semver@^7.5.3: - version "7.5.3" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.3.tgz#161ce8c2c6b4b3bdca6caadc9fa3317a4c4fe88e" - integrity sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ== + version "7.5.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== dependencies: lru-cache "^6.0.0" From 27de9a88d3990a8084d1947c438ea4b0fc75317d Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 14 Jul 2023 11:34:01 -0400 Subject: [PATCH 724/785] Specify prettier as a peer dependency --- package.json | 5 +-- yarn.lock | 92 ++++++++++++++++++++++++---------------------------- 2 files changed, 45 insertions(+), 52 deletions(-) diff --git a/package.json b/package.json index 2cf48c9d..2cf27772 100644 --- a/package.json +++ b/package.json @@ -19,14 +19,15 @@ "url": "https://github.com/prettier/plugin-ruby/issues" }, "homepage": "https://github.com/prettier/plugin-ruby#readme", - "dependencies": { - "prettier": ">=3.0.0" + "peerDependencies": { + "prettier": "^3.0.0" }, "devDependencies": { "eslint": "^8.35.0", "eslint-config-prettier": "^8.7.0", "husky": "^8.0.1", "jest": "^29.5.0", + "prettier": "^3.0.0", "pretty-quick": "^3.1.2" }, "eslintConfig": { diff --git a/yarn.lock b/yarn.lock index 19f2949b..4d964f9d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -22,52 +22,52 @@ dependencies: "@babel/highlight" "^7.22.5" -"@babel/compat-data@^7.22.6": - version "7.22.6" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.22.6.tgz#15606a20341de59ba02cd2fcc5086fcbe73bf544" - integrity sha512-29tfsWTq2Ftu7MXmimyC0C5FDZv5DYxOZkh3XD3+QW4V/BYuv/LyEsjj3c0hqedEaDt6DBfDvexMKU8YevdqFg== +"@babel/compat-data@^7.22.9": + version "7.22.9" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.22.9.tgz#71cdb00a1ce3a329ce4cbec3a44f9fef35669730" + integrity sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ== "@babel/core@^7.11.6", "@babel/core@^7.12.3": - version "7.22.8" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.22.8.tgz#386470abe884302db9c82e8e5e87be9e46c86785" - integrity sha512-75+KxFB4CZqYRXjx4NlR4J7yGvKumBuZTmV4NV6v09dVXXkuYVYLT68N6HCzLvfJ+fWCxQsntNzKwwIXL4bHnw== + version "7.22.9" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.22.9.tgz#bd96492c68822198f33e8a256061da3cf391f58f" + integrity sha512-G2EgeufBcYw27U4hhoIwFcgc1XU7TlXJ3mv04oOv1WCuo900U/anZSPzEqNjwdjgffkk2Gs0AN0dW1CKVLcG7w== dependencies: "@ampproject/remapping" "^2.2.0" "@babel/code-frame" "^7.22.5" - "@babel/generator" "^7.22.7" - "@babel/helper-compilation-targets" "^7.22.6" - "@babel/helper-module-transforms" "^7.22.5" + "@babel/generator" "^7.22.9" + "@babel/helper-compilation-targets" "^7.22.9" + "@babel/helper-module-transforms" "^7.22.9" "@babel/helpers" "^7.22.6" "@babel/parser" "^7.22.7" "@babel/template" "^7.22.5" "@babel/traverse" "^7.22.8" "@babel/types" "^7.22.5" - "@nicolo-ribaudo/semver-v6" "^6.3.3" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.2" + semver "^6.3.1" -"@babel/generator@^7.22.7", "@babel/generator@^7.7.2": - version "7.22.7" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.22.7.tgz#a6b8152d5a621893f2c9dacf9a4e286d520633d5" - integrity sha512-p+jPjMG+SI8yvIaxGgeW24u7q9+5+TGpZh8/CuB7RhBKd7RCy8FayNEFNNKrNK/eUcY/4ExQqLmyrvBXKsIcwQ== +"@babel/generator@^7.22.7", "@babel/generator@^7.22.9", "@babel/generator@^7.7.2": + version "7.22.9" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.22.9.tgz#572ecfa7a31002fa1de2a9d91621fd895da8493d" + integrity sha512-KtLMbmicyuK2Ak/FTCJVbDnkN1SlT8/kceFTiuDiiRUUSMnHMidxSCdG4ndkTOHHpoomWe/4xkvHkEOncwjYIw== dependencies: "@babel/types" "^7.22.5" "@jridgewell/gen-mapping" "^0.3.2" "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" -"@babel/helper-compilation-targets@^7.22.6": - version "7.22.6" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.6.tgz#e30d61abe9480aa5a83232eb31c111be922d2e52" - integrity sha512-534sYEqWD9VfUm3IPn2SLcH4Q3P86XL+QvqdC7ZsFrzyyPF3T4XGiVghF6PTYNdWg6pXuoqXxNQAhbYeEInTzA== +"@babel/helper-compilation-targets@^7.22.9": + version "7.22.9" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.9.tgz#f9d0a7aaaa7cd32a3f31c9316a69f5a9bcacb892" + integrity sha512-7qYrNM6HjpnPHJbopxmb8hSPoZ0gsX8IvUS32JGVoy+pU9e5N0nLr1VjJoR6kA4d9dmGLxNYOjeB8sUDal2WMw== dependencies: - "@babel/compat-data" "^7.22.6" + "@babel/compat-data" "^7.22.9" "@babel/helper-validator-option" "^7.22.5" - "@nicolo-ribaudo/semver-v6" "^6.3.3" browserslist "^4.21.9" lru-cache "^5.1.1" + semver "^6.3.1" "@babel/helper-environment-visitor@^7.22.5": version "7.22.5" @@ -96,19 +96,16 @@ dependencies: "@babel/types" "^7.22.5" -"@babel/helper-module-transforms@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.22.5.tgz#0f65daa0716961b6e96b164034e737f60a80d2ef" - integrity sha512-+hGKDt/Ze8GFExiVHno/2dvG5IdstpzCq0y4Qc9OJ25D4q3pKfiIP/4Vp3/JvhDkLKsDK2api3q3fpIgiIF5bw== +"@babel/helper-module-transforms@^7.22.9": + version "7.22.9" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.22.9.tgz#92dfcb1fbbb2bc62529024f72d942a8c97142129" + integrity sha512-t+WA2Xn5K+rTeGtC8jCsdAH52bjggG5TKRuRrAGNM/mjIbO4GxvlLMFOEz9wXY5I2XQ60PMFsAG2WIcG82dQMQ== dependencies: "@babel/helper-environment-visitor" "^7.22.5" "@babel/helper-module-imports" "^7.22.5" "@babel/helper-simple-access" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" "@babel/helper-validator-identifier" "^7.22.5" - "@babel/template" "^7.22.5" - "@babel/traverse" "^7.22.5" - "@babel/types" "^7.22.5" "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.8.0": version "7.22.5" @@ -122,7 +119,7 @@ dependencies: "@babel/types" "^7.22.5" -"@babel/helper-split-export-declaration@^7.22.5", "@babel/helper-split-export-declaration@^7.22.6": +"@babel/helper-split-export-declaration@^7.22.6": version "7.22.6" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== @@ -274,7 +271,7 @@ "@babel/parser" "^7.22.5" "@babel/types" "^7.22.5" -"@babel/traverse@^7.22.5", "@babel/traverse@^7.22.6", "@babel/traverse@^7.22.8": +"@babel/traverse@^7.22.6", "@babel/traverse@^7.22.8": version "7.22.8" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.8.tgz#4d4451d31bc34efeae01eac222b514a77aa4000e" integrity sha512-y6LPR+wpM2I3qJrsheCTwhIinzkETbplIgPBbwvqPKc+uljeA5gP+3nP8irdYt1mjQaDnlIcG+dw8OjAco4GXw== @@ -600,11 +597,6 @@ "@jridgewell/resolve-uri" "3.1.0" "@jridgewell/sourcemap-codec" "1.4.14" -"@nicolo-ribaudo/semver-v6@^6.3.3": - version "6.3.3" - resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/semver-v6/-/semver-v6-6.3.3.tgz#ea6d23ade78a325f7a52750aab1526b02b628c29" - integrity sha512-3Yc1fUTs69MG/uZbJlLSI3JISMn2UV2rg+1D/vROUqZyh3l6iYHCs7GMp+M40ZD7yOdDbYjJcU1oTJhrc+dGKg== - "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -710,9 +702,9 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*": - version "20.4.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.4.0.tgz#01d637d1891e419bc85763b46f42809cd2d5addb" - integrity sha512-jfT7iTf/4kOQ9S7CHV9BIyRaQqHu67mOjsIQBC3BKZvzvUB6zLxEwJ6sBE3ozcvP8kF6Uk5PXN0Q+c0dfhGX0g== + version "20.4.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.4.2.tgz#129cc9ae69f93824f92fac653eebfb4812ab4af9" + integrity sha512-Dd0BYtWgnWJKwO1jkmTrzofjK2QXXcai0dmtzvIBhcA+RsG5h8R3xlyta0kGOZRNfL9GuRtb1knmPEhQrePCEw== "@types/prettier@^2.1.5": version "2.7.3" @@ -940,9 +932,9 @@ camelcase@^6.2.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001503: - version "1.0.30001512" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001512.tgz#7450843fb581c39f290305a83523c7a9ef0d4cb4" - integrity sha512-2S9nK0G/mE+jasCUsMPlARhRCts1ebcp2Ji8Y8PWi4NDE1iRdLCnEPHkEfeBrGC45L4isBx5ur3IQ6yTE2mRZw== + version "1.0.30001515" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001515.tgz#418aefeed9d024cd3129bfae0ccc782d4cb8f12b" + integrity sha512-eEFDwUOZbE24sb+Ecsx3+OvNETqjWIdabMy52oOkIgcUtAsQifjUG9q4U9dgTHJM2mfk4uEPxc0+xuFdJ629QA== chalk@^2.0.0: version "2.4.2" @@ -1091,9 +1083,9 @@ doctrine@^3.0.0: esutils "^2.0.2" electron-to-chromium@^1.4.431: - version "1.4.451" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.451.tgz#12b63ee5c82cbbc7b4ddd91e90f5a0dfc10de26e" - integrity sha512-YYbXHIBxAHe3KWvGOJOuWa6f3tgow44rBW+QAuwVp2DvGqNZeE//K2MowNdWS7XE8li5cgQDrX1LdBr41LufkA== + version "1.4.460" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.460.tgz#f360a5059c039c4a5fb4dfa99680ad8129dd9f84" + integrity sha512-kKiHnbrHME7z8E6AYaw0ehyxY5+hdaRmeUbjBO22LZMdqTYCO29EvF0T1cQ3pJ1RN5fyMcHl1Lmcsdt9WWJpJQ== emittery@^0.13.1: version "0.13.1" @@ -2145,9 +2137,9 @@ node-int64@^0.4.0: integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== node-releases@^2.0.12: - version "2.0.12" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.12.tgz#35627cc224a23bfb06fb3380f2b3afaaa7eb1039" - integrity sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ== + version "2.0.13" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.13.tgz#d5ed1627c23e3461e819b02e57b75e4899b1c81d" + integrity sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ== normalize-path@^3.0.0: version "3.0.0" @@ -2284,7 +2276,7 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prettier@>=3.0.0: +prettier@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0.tgz#e7b19f691245a21d618c68bc54dc06122f6105ae" integrity sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g== @@ -2401,7 +2393,7 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -semver@^6.0.0, semver@^6.3.0: +semver@^6.0.0, semver@^6.3.0, semver@^6.3.1: version "6.3.1" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== From e0f322b80cfff1a9ea743b5e814d36549f3bcf02 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 14 Jul 2023 11:38:40 -0400 Subject: [PATCH 725/785] Bump to version 4.0.2 --- CHANGELOG.md | 9 ++++++++- package.json | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b777b0c..86272b3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [4.0.2] - 2023-07-14 + +### Changed + +- [#1367](https://github.com/prettier/plugin-ruby/pull/1367) - kddnewton - Specify `prettier` as a peer dependency and not a runtime dependency. + ## [4.0.1] - 2023-07-08 ### Changed @@ -1285,7 +1291,8 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v4.0.1...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v4.0.2...HEAD +[4.0.2]: https://github.com/prettier/plugin-ruby/compare/v4.0.1...v4.0.2 [4.0.1]: https://github.com/prettier/plugin-ruby/compare/v4.0.0...v4.0.1 [4.0.0]: https://github.com/prettier/plugin-ruby/compare/v3.2.2...v4.0.0 [3.2.2]: https://github.com/prettier/plugin-ruby/compare/v3.2.1...v3.2.2 diff --git a/package.json b/package.json index 2cf27772..a2862f8f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "4.0.1", + "version": "4.0.2", "description": "prettier plugin for the Ruby programming language", "type": "module", "main": "src/plugin.js", From 96745b1eee36cdf58b13868497b8ee16acb00b63 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jul 2023 12:37:22 +0000 Subject: [PATCH 726/785] Bump eslint from 8.44.0 to 8.45.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.44.0 to 8.45.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.44.0...v8.45.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4d964f9d..3ed82be5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1150,9 +1150,9 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: integrity sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA== eslint@^8.35.0: - version "8.44.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.44.0.tgz#51246e3889b259bbcd1d7d736a0c10add4f0e500" - integrity sha512-0wpHoUbDUHgNCyvFB5aXLiQVfK9B0at6gUvzy83k4kAsQ/u769TQDX6iKC+aO4upIHO9WSaA3QoXYQDHbNwf1A== + version "8.45.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.45.0.tgz#bab660f90d18e1364352c0a6b7c6db8edb458b78" + integrity sha512-pd8KSxiQpdYRfYa9Wufvdoct3ZPQQuVuU5O6scNgMuOMYuxvH0IGaYK0wUFjo4UYYQQCUndlXiMbnxopwvvTiw== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.4.0" @@ -1179,7 +1179,6 @@ eslint@^8.35.0: globals "^13.19.0" graphemer "^1.4.0" ignore "^5.2.0" - import-fresh "^3.0.0" imurmurhash "^0.1.4" is-glob "^4.0.0" is-path-inside "^3.0.3" @@ -1191,7 +1190,6 @@ eslint@^8.35.0: natural-compare "^1.4.0" optionator "^0.9.3" strip-ansi "^6.0.1" - strip-json-comments "^3.1.0" text-table "^0.2.0" espree@^9.6.0: @@ -1476,7 +1474,7 @@ ignore@^5.1.4, ignore@^5.2.0: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== -import-fresh@^3.0.0, import-fresh@^3.2.1: +import-fresh@^3.2.1: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== @@ -2491,7 +2489,7 @@ strip-final-newline@^2.0.0: resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== -strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: +strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== From 49a6c4abc6911e79e254d2ff1abf39ac52b80118 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 20 Jul 2023 09:43:15 -0400 Subject: [PATCH 727/785] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 44ebaab9..7349d98f 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ gem install bundler prettier_print syntax_tree syntax_tree-haml syntax_tree-rbs The `prettier` executable is now installed and ready for use: ```bash -./node_modules/.bin/prettier --write '**/*' +./node_modules/.bin/prettier --plugin=@prettier/plugin-ruby --write '**/*' ``` ## Configuration From fac6fc72c10849456c53d40f933aa7c841c65199 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 27 Jul 2023 12:46:13 +0000 Subject: [PATCH 728/785] Bump jest from 29.6.1 to 29.6.2 Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.6.1 to 29.6.2. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.6.2/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 542 +++++++++++++++++++++++++++--------------------------- 1 file changed, 268 insertions(+), 274 deletions(-) diff --git a/yarn.lock b/yarn.lock index 3ed82be5..a12b6d08 100644 --- a/yarn.lock +++ b/yarn.lock @@ -368,27 +368,27 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^29.6.1": - version "29.6.1" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.6.1.tgz#b48ba7b9c34b51483e6d590f46e5837f1ab5f639" - integrity sha512-Aj772AYgwTSr5w8qnyoJ0eDYvN6bMsH3ORH1ivMotrInHLKdUz6BDlaEXHdM6kODaBIkNIyQGzsMvRdOv7VG7Q== +"@jest/console@^29.6.2": + version "29.6.2" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.6.2.tgz#bf1d4101347c23e07c029a1b1ae07d550f5cc541" + integrity sha512-0N0yZof5hi44HAR2pPS+ikJ3nzKNoZdVu8FffRf3wy47I7Dm7etk/3KetMdRUqzVd16V4O2m2ISpNTbnIuqy1w== dependencies: "@jest/types" "^29.6.1" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^29.6.1" - jest-util "^29.6.1" + jest-message-util "^29.6.2" + jest-util "^29.6.2" slash "^3.0.0" -"@jest/core@^29.6.1": - version "29.6.1" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.6.1.tgz#fac0d9ddf320490c93356ba201451825231e95f6" - integrity sha512-CcowHypRSm5oYQ1obz1wfvkjZZ2qoQlrKKvlfPwh5jUXVU12TWr2qMeH8chLMuTFzHh5a1g2yaqlqDICbr+ukQ== +"@jest/core@^29.6.2": + version "29.6.2" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.6.2.tgz#6f2d1dbe8aa0265fcd4fb8082ae1952f148209c8" + integrity sha512-Oj+5B+sDMiMWLhPFF+4/DvHOf+U10rgvCLGPHP8Xlsy/7QxS51aU/eBngudHlJXnaWD5EohAgJ4js+T6pa+zOg== dependencies: - "@jest/console" "^29.6.1" - "@jest/reporters" "^29.6.1" - "@jest/test-result" "^29.6.1" - "@jest/transform" "^29.6.1" + "@jest/console" "^29.6.2" + "@jest/reporters" "^29.6.2" + "@jest/test-result" "^29.6.2" + "@jest/transform" "^29.6.2" "@jest/types" "^29.6.1" "@types/node" "*" ansi-escapes "^4.2.1" @@ -397,79 +397,79 @@ exit "^0.1.2" graceful-fs "^4.2.9" jest-changed-files "^29.5.0" - jest-config "^29.6.1" - jest-haste-map "^29.6.1" - jest-message-util "^29.6.1" + jest-config "^29.6.2" + jest-haste-map "^29.6.2" + jest-message-util "^29.6.2" jest-regex-util "^29.4.3" - jest-resolve "^29.6.1" - jest-resolve-dependencies "^29.6.1" - jest-runner "^29.6.1" - jest-runtime "^29.6.1" - jest-snapshot "^29.6.1" - jest-util "^29.6.1" - jest-validate "^29.6.1" - jest-watcher "^29.6.1" + jest-resolve "^29.6.2" + jest-resolve-dependencies "^29.6.2" + jest-runner "^29.6.2" + jest-runtime "^29.6.2" + jest-snapshot "^29.6.2" + jest-util "^29.6.2" + jest-validate "^29.6.2" + jest-watcher "^29.6.2" micromatch "^4.0.4" - pretty-format "^29.6.1" + pretty-format "^29.6.2" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.6.1": - version "29.6.1" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.6.1.tgz#ee358fff2f68168394b4a50f18c68278a21fe82f" - integrity sha512-RMMXx4ws+Gbvw3DfLSuo2cfQlK7IwGbpuEWXCqyYDcqYTI+9Ju3a5hDnXaxjNsa6uKh9PQF2v+qg+RLe63tz5A== +"@jest/environment@^29.6.2": + version "29.6.2" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.6.2.tgz#794c0f769d85e7553439d107d3f43186dc6874a9" + integrity sha512-AEcW43C7huGd/vogTddNNTDRpO6vQ2zaQNrttvWV18ArBx9Z56h7BIsXkNFJVOO4/kblWEQz30ckw0+L3izc+Q== dependencies: - "@jest/fake-timers" "^29.6.1" + "@jest/fake-timers" "^29.6.2" "@jest/types" "^29.6.1" "@types/node" "*" - jest-mock "^29.6.1" + jest-mock "^29.6.2" -"@jest/expect-utils@^29.6.1": - version "29.6.1" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.6.1.tgz#ab83b27a15cdd203fe5f68230ea22767d5c3acc5" - integrity sha512-o319vIf5pEMx0LmzSxxkYYxo4wrRLKHq9dP1yJU7FoPTB0LfAKSz8SWD6D/6U3v/O52t9cF5t+MeJiRsfk7zMw== +"@jest/expect-utils@^29.6.2": + version "29.6.2" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.6.2.tgz#1b97f290d0185d264dd9fdec7567a14a38a90534" + integrity sha512-6zIhM8go3RV2IG4aIZaZbxwpOzz3ZiM23oxAlkquOIole+G6TrbeXnykxWYlqF7kz2HlBjdKtca20x9atkEQYg== dependencies: jest-get-type "^29.4.3" -"@jest/expect@^29.6.1": - version "29.6.1" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.6.1.tgz#fef18265188f6a97601f1ea0a2912d81a85b4657" - integrity sha512-N5xlPrAYaRNyFgVf2s9Uyyvr795jnB6rObuPx4QFvNJz8aAjpZUDfO4bh5G/xuplMID8PrnuF1+SfSyDxhsgYg== +"@jest/expect@^29.6.2": + version "29.6.2" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.6.2.tgz#5a2ad58bb345165d9ce0a1845bbf873c480a4b28" + integrity sha512-m6DrEJxVKjkELTVAztTLyS/7C92Y2b0VYqmDROYKLLALHn8T/04yPs70NADUYPrV3ruI+H3J0iUIuhkjp7vkfg== dependencies: - expect "^29.6.1" - jest-snapshot "^29.6.1" + expect "^29.6.2" + jest-snapshot "^29.6.2" -"@jest/fake-timers@^29.6.1": - version "29.6.1" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.6.1.tgz#c773efddbc61e1d2efcccac008139f621de57c69" - integrity sha512-RdgHgbXyosCDMVYmj7lLpUwXA4c69vcNzhrt69dJJdf8azUrpRh3ckFCaTPNjsEeRi27Cig0oKDGxy5j7hOgHg== +"@jest/fake-timers@^29.6.2": + version "29.6.2" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.6.2.tgz#fe9d43c5e4b1b901168fe6f46f861b3e652a2df4" + integrity sha512-euZDmIlWjm1Z0lJ1D0f7a0/y5Kh/koLFMUBE5SUYWrmy8oNhJpbTBDAP6CxKnadcMLDoDf4waRYCe35cH6G6PA== dependencies: "@jest/types" "^29.6.1" "@sinonjs/fake-timers" "^10.0.2" "@types/node" "*" - jest-message-util "^29.6.1" - jest-mock "^29.6.1" - jest-util "^29.6.1" + jest-message-util "^29.6.2" + jest-mock "^29.6.2" + jest-util "^29.6.2" -"@jest/globals@^29.6.1": - version "29.6.1" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.6.1.tgz#c8a8923e05efd757308082cc22893d82b8aa138f" - integrity sha512-2VjpaGy78JY9n9370H8zGRCFbYVWwjY6RdDMhoJHa1sYfwe6XM/azGN0SjY8kk7BOZApIejQ1BFPyH7FPG0w3A== +"@jest/globals@^29.6.2": + version "29.6.2" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.6.2.tgz#74af81b9249122cc46f1eb25793617eec69bf21a" + integrity sha512-cjuJmNDjs6aMijCmSa1g2TNG4Lby/AeU7/02VtpW+SLcZXzOLK2GpN2nLqcFjmhy3B3AoPeQVx7BnyOf681bAw== dependencies: - "@jest/environment" "^29.6.1" - "@jest/expect" "^29.6.1" + "@jest/environment" "^29.6.2" + "@jest/expect" "^29.6.2" "@jest/types" "^29.6.1" - jest-mock "^29.6.1" + jest-mock "^29.6.2" -"@jest/reporters@^29.6.1": - version "29.6.1" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.6.1.tgz#3325a89c9ead3cf97ad93df3a427549d16179863" - integrity sha512-9zuaI9QKr9JnoZtFQlw4GREQbxgmNYXU6QuWtmuODvk5nvPUeBYapVR/VYMyi2WSx3jXTLJTJji8rN6+Cm4+FA== +"@jest/reporters@^29.6.2": + version "29.6.2" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.6.2.tgz#524afe1d76da33d31309c2c4a2c8062d0c48780a" + integrity sha512-sWtijrvIav8LgfJZlrGCdN0nP2EWbakglJY49J1Y5QihcQLfy7ovyxxjJBRXMNltgt4uPtEcFmIMbVshEDfFWw== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.6.1" - "@jest/test-result" "^29.6.1" - "@jest/transform" "^29.6.1" + "@jest/console" "^29.6.2" + "@jest/test-result" "^29.6.2" + "@jest/transform" "^29.6.2" "@jest/types" "^29.6.1" "@jridgewell/trace-mapping" "^0.3.18" "@types/node" "*" @@ -483,9 +483,9 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^29.6.1" - jest-util "^29.6.1" - jest-worker "^29.6.1" + jest-message-util "^29.6.2" + jest-util "^29.6.2" + jest-worker "^29.6.2" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" @@ -507,30 +507,30 @@ callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^29.6.1": - version "29.6.1" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.6.1.tgz#850e565a3f58ee8ca6ec424db00cb0f2d83c36ba" - integrity sha512-Ynr13ZRcpX6INak0TPUukU8GWRfm/vAytE3JbJNGAvINySWYdfE7dGZMbk36oVuK4CigpbhMn8eg1dixZ7ZJOw== +"@jest/test-result@^29.6.2": + version "29.6.2" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.6.2.tgz#fdd11583cd1608e4db3114e8f0cce277bf7a32ed" + integrity sha512-3VKFXzcV42EYhMCsJQURptSqnyjqCGbtLuX5Xxb6Pm6gUf1wIRIl+mandIRGJyWKgNKYF9cnstti6Ls5ekduqw== dependencies: - "@jest/console" "^29.6.1" + "@jest/console" "^29.6.2" "@jest/types" "^29.6.1" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.6.1": - version "29.6.1" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.6.1.tgz#e3e582ee074dd24ea9687d7d1aaf05ee3a9b068e" - integrity sha512-oBkC36PCDf/wb6dWeQIhaviU0l5u6VCsXa119yqdUosYAt7/FbQU2M2UoziO3igj/HBDEgp57ONQ3fm0v9uyyg== +"@jest/test-sequencer@^29.6.2": + version "29.6.2" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.6.2.tgz#585eff07a68dd75225a7eacf319780cb9f6b9bf4" + integrity sha512-GVYi6PfPwVejO7slw6IDO0qKVum5jtrJ3KoLGbgBWyr2qr4GaxFV6su+ZAjdTX75Sr1DkMFRk09r2ZVa+wtCGw== dependencies: - "@jest/test-result" "^29.6.1" + "@jest/test-result" "^29.6.2" graceful-fs "^4.2.9" - jest-haste-map "^29.6.1" + jest-haste-map "^29.6.2" slash "^3.0.0" -"@jest/transform@^29.6.1": - version "29.6.1" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.6.1.tgz#acb5606019a197cb99beda3c05404b851f441c92" - integrity sha512-URnTneIU3ZjRSaf906cvf6Hpox3hIeJXRnz3VDSw5/X93gR8ycdfSIEy19FlVx8NFmpN7fe3Gb1xF+NjXaQLWg== +"@jest/transform@^29.6.2": + version "29.6.2" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.6.2.tgz#522901ebbb211af08835bc3bcdf765ab778094e3" + integrity sha512-ZqCqEISr58Ce3U+buNFJYUktLJZOggfyvR+bZMaiV1e8B1SIvJbwZMrYz3gx/KAPn9EXmOmN+uB08yLCjWkQQg== dependencies: "@babel/core" "^7.11.6" "@jest/types" "^29.6.1" @@ -540,9 +540,9 @@ convert-source-map "^2.0.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.6.1" + jest-haste-map "^29.6.2" jest-regex-util "^29.4.3" - jest-util "^29.6.1" + jest-util "^29.6.2" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" @@ -706,11 +706,6 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-20.4.2.tgz#129cc9ae69f93824f92fac653eebfb4812ab4af9" integrity sha512-Dd0BYtWgnWJKwO1jkmTrzofjK2QXXcai0dmtzvIBhcA+RsG5h8R3xlyta0kGOZRNfL9GuRtb1knmPEhQrePCEw== -"@types/prettier@^2.1.5": - version "2.7.3" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.3.tgz#3e51a17e291d01d17d3fc61422015a933af7a08f" - integrity sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA== - "@types/stack-utils@^2.0.0": version "2.0.1" resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" @@ -814,12 +809,12 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.6.1.tgz#a7141ad1ed5ec50238f3cd36127636823111233a" - integrity sha512-qu+3bdPEQC6KZSPz+4Fyjbga5OODNcp49j6GKzG1EKbkfyJBxEYGVUmVGpwCSeGouG52R4EgYMLb6p9YeEEQ4A== +babel-jest@^29.6.2: + version "29.6.2" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.6.2.tgz#cada0a59e07f5acaeb11cbae7e3ba92aec9c1126" + integrity sha512-BYCzImLos6J3BH/+HvUCHG1dTf2MzmAB4jaVxHV+29RZLjR29XuYTmsf2sdDwkrb+FczkGo3kOhE7ga6sI0P4A== dependencies: - "@jest/transform" "^29.6.1" + "@jest/transform" "^29.6.2" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" babel-preset-jest "^29.5.0" @@ -1050,10 +1045,10 @@ debug@^4.1.0, debug@^4.1.1, debug@^4.3.2: dependencies: ms "2.1.2" -dedent@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" - integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA== +dedent@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.2.0.tgz#32039cd75c035f684e01c4a07cb88c0ecbeb57be" + integrity sha512-i4tcg0ClgvMUSxwHpt+NHQ01ZJmAkl6eBvDNrSZG9e+oLRTCSHv0wpr/Bzjpf6CwKeIHGevE1M34Y1Axdms5VQ== deep-is@^0.1.3: version "0.1.4" @@ -1265,17 +1260,17 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== -expect@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.6.1.tgz#64dd1c8f75e2c0b209418f2b8d36a07921adfdf1" - integrity sha512-XEdDLonERCU1n9uR56/Stx9OqojaLAQtZf9PrCHH9Hl8YXiEIka3H4NXJ3NOIBmQJTg7+j7buh34PMHfJujc8g== +expect@^29.6.2: + version "29.6.2" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.6.2.tgz#7b08e83eba18ddc4a2cf62b5f2d1918f5cd84521" + integrity sha512-iAErsLxJ8C+S02QbLAwgSGSezLQK+XXRDt8IuFXFpwCNw2ECmzZSmjKcCaFVp5VRMk+WAvz6h6jokzEzBFZEuA== dependencies: - "@jest/expect-utils" "^29.6.1" + "@jest/expect-utils" "^29.6.2" "@types/node" "*" jest-get-type "^29.4.3" - jest-matcher-utils "^29.6.1" - jest-message-util "^29.6.1" - jest-util "^29.6.1" + jest-matcher-utils "^29.6.2" + jest-message-util "^29.6.2" + jest-util "^29.6.2" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1612,87 +1607,87 @@ jest-changed-files@^29.5.0: execa "^5.0.0" p-limit "^3.1.0" -jest-circus@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.6.1.tgz#861dab37e71a89907d1c0fabc54a0019738ed824" - integrity sha512-tPbYLEiBU4MYAL2XoZme/bgfUeotpDBd81lgHLCbDZZFaGmECk0b+/xejPFtmiBP87GgP/y4jplcRpbH+fgCzQ== +jest-circus@^29.6.2: + version "29.6.2" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.6.2.tgz#1e6ffca60151ac66cad63fce34f443f6b5bb4258" + integrity sha512-G9mN+KOYIUe2sB9kpJkO9Bk18J4dTDArNFPwoZ7WKHKel55eKIS/u2bLthxgojwlf9NLCVQfgzM/WsOVvoC6Fw== dependencies: - "@jest/environment" "^29.6.1" - "@jest/expect" "^29.6.1" - "@jest/test-result" "^29.6.1" + "@jest/environment" "^29.6.2" + "@jest/expect" "^29.6.2" + "@jest/test-result" "^29.6.2" "@jest/types" "^29.6.1" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - dedent "^0.7.0" + dedent "^1.0.0" is-generator-fn "^2.0.0" - jest-each "^29.6.1" - jest-matcher-utils "^29.6.1" - jest-message-util "^29.6.1" - jest-runtime "^29.6.1" - jest-snapshot "^29.6.1" - jest-util "^29.6.1" + jest-each "^29.6.2" + jest-matcher-utils "^29.6.2" + jest-message-util "^29.6.2" + jest-runtime "^29.6.2" + jest-snapshot "^29.6.2" + jest-util "^29.6.2" p-limit "^3.1.0" - pretty-format "^29.6.1" + pretty-format "^29.6.2" pure-rand "^6.0.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.6.1.tgz#99d9afa7449538221c71f358f0fdd3e9c6e89f72" - integrity sha512-607dSgTA4ODIN6go9w6xY3EYkyPFGicx51a69H7yfvt7lN53xNswEVLovq+E77VsTRi5fWprLH0yl4DJgE8Ing== +jest-cli@^29.6.2: + version "29.6.2" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.6.2.tgz#edb381763398d1a292cd1b636a98bfa5644b8fda" + integrity sha512-TT6O247v6dCEX2UGHGyflMpxhnrL0DNqP2fRTKYm3nJJpCTfXX3GCMQPGFjXDoj0i5/Blp3jriKXFgdfmbYB6Q== dependencies: - "@jest/core" "^29.6.1" - "@jest/test-result" "^29.6.1" + "@jest/core" "^29.6.2" + "@jest/test-result" "^29.6.2" "@jest/types" "^29.6.1" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.6.1" - jest-util "^29.6.1" - jest-validate "^29.6.1" + jest-config "^29.6.2" + jest-util "^29.6.2" + jest-validate "^29.6.2" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.6.1.tgz#d785344509065d53a238224c6cdc0ed8e2f2f0dd" - integrity sha512-XdjYV2fy2xYixUiV2Wc54t3Z4oxYPAELUzWnV6+mcbq0rh742X2p52pii5A3oeRzYjLnQxCsZmp0qpI6klE2cQ== +jest-config@^29.6.2: + version "29.6.2" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.6.2.tgz#c68723f06b31ca5e63030686e604727d406cd7c3" + integrity sha512-VxwFOC8gkiJbuodG9CPtMRjBUNZEHxwfQXmIudSTzFWxaci3Qub1ddTRbFNQlD/zUeaifLndh/eDccFX4wCMQw== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.6.1" + "@jest/test-sequencer" "^29.6.2" "@jest/types" "^29.6.1" - babel-jest "^29.6.1" + babel-jest "^29.6.2" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^29.6.1" - jest-environment-node "^29.6.1" + jest-circus "^29.6.2" + jest-environment-node "^29.6.2" jest-get-type "^29.4.3" jest-regex-util "^29.4.3" - jest-resolve "^29.6.1" - jest-runner "^29.6.1" - jest-util "^29.6.1" - jest-validate "^29.6.1" + jest-resolve "^29.6.2" + jest-runner "^29.6.2" + jest-util "^29.6.2" + jest-validate "^29.6.2" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^29.6.1" + pretty-format "^29.6.2" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.6.1.tgz#13df6db0a89ee6ad93c747c75c85c70ba941e545" - integrity sha512-FsNCvinvl8oVxpNLttNQX7FAq7vR+gMDGj90tiP7siWw1UdakWUGqrylpsYrpvj908IYckm5Y0Q7azNAozU1Kg== +jest-diff@^29.6.2: + version "29.6.2" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.6.2.tgz#c36001e5543e82a0805051d3ceac32e6825c1c46" + integrity sha512-t+ST7CB9GX5F2xKwhwCf0TAR17uNDiaPTZnVymP9lw0lssa9vG+AFyDZoeIHStU3WowFFwT+ky+er0WVl2yGhA== dependencies: chalk "^4.0.0" diff-sequences "^29.4.3" jest-get-type "^29.4.3" - pretty-format "^29.6.1" + pretty-format "^29.6.2" jest-docblock@^29.4.3: version "29.4.3" @@ -1701,38 +1696,38 @@ jest-docblock@^29.4.3: dependencies: detect-newline "^3.0.0" -jest-each@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.6.1.tgz#975058e5b8f55c6780beab8b6ab214921815c89c" - integrity sha512-n5eoj5eiTHpKQCAVcNTT7DRqeUmJ01hsAL0Q1SMiBHcBcvTKDELixQOGMCpqhbIuTcfC4kMfSnpmDqRgRJcLNQ== +jest-each@^29.6.2: + version "29.6.2" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.6.2.tgz#c9e4b340bcbe838c73adf46b76817b15712d02ce" + integrity sha512-MsrsqA0Ia99cIpABBc3izS1ZYoYfhIy0NNWqPSE0YXbQjwchyt6B1HD2khzyPe1WiJA7hbxXy77ZoUQxn8UlSw== dependencies: "@jest/types" "^29.6.1" chalk "^4.0.0" jest-get-type "^29.4.3" - jest-util "^29.6.1" - pretty-format "^29.6.1" + jest-util "^29.6.2" + pretty-format "^29.6.2" -jest-environment-node@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.6.1.tgz#08a122dece39e58bc388da815a2166c58b4abec6" - integrity sha512-ZNIfAiE+foBog24W+2caIldl4Irh8Lx1PUhg/GZ0odM1d/h2qORAsejiFc7zb+SEmYPn1yDZzEDSU5PmDkmVLQ== +jest-environment-node@^29.6.2: + version "29.6.2" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.6.2.tgz#a9ea2cabff39b08eca14ccb32c8ceb924c8bb1ad" + integrity sha512-YGdFeZ3T9a+/612c5mTQIllvWkddPbYcN2v95ZH24oWMbGA4GGS2XdIF92QMhUhvrjjuQWYgUGW2zawOyH63MQ== dependencies: - "@jest/environment" "^29.6.1" - "@jest/fake-timers" "^29.6.1" + "@jest/environment" "^29.6.2" + "@jest/fake-timers" "^29.6.2" "@jest/types" "^29.6.1" "@types/node" "*" - jest-mock "^29.6.1" - jest-util "^29.6.1" + jest-mock "^29.6.2" + jest-util "^29.6.2" jest-get-type@^29.4.3: version "29.4.3" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.4.3.tgz#1ab7a5207c995161100b5187159ca82dd48b3dd5" integrity sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg== -jest-haste-map@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.6.1.tgz#62655c7a1c1b349a3206441330fb2dbdb4b63803" - integrity sha512-0m7f9PZXxOCk1gRACiVgX85knUKPKLPg4oRCjLoqIm9brTHXaorMA0JpmtmVkQiT8nmXyIVoZd/nnH1cfC33ig== +jest-haste-map@^29.6.2: + version "29.6.2" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.6.2.tgz#298c25ea5255cfad8b723179d4295cf3a50a70d1" + integrity sha512-+51XleTDAAysvU8rT6AnS1ZJ+WHVNqhj1k6nTvN2PYP+HjU3kqlaKQ1Lnw3NYW3bm2r8vq82X0Z1nDDHZMzHVA== dependencies: "@jest/types" "^29.6.1" "@types/graceful-fs" "^4.1.3" @@ -1741,35 +1736,35 @@ jest-haste-map@^29.6.1: fb-watchman "^2.0.0" graceful-fs "^4.2.9" jest-regex-util "^29.4.3" - jest-util "^29.6.1" - jest-worker "^29.6.1" + jest-util "^29.6.2" + jest-worker "^29.6.2" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.6.1.tgz#66a902c81318e66e694df7d096a95466cb962f8e" - integrity sha512-OrxMNyZirpOEwkF3UHnIkAiZbtkBWiye+hhBweCHkVbCgyEy71Mwbb5zgeTNYWJBi1qgDVfPC1IwO9dVEeTLwQ== +jest-leak-detector@^29.6.2: + version "29.6.2" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.6.2.tgz#e2b307fee78cab091c37858a98c7e1d73cdf5b38" + integrity sha512-aNqYhfp5uYEO3tdWMb2bfWv6f0b4I0LOxVRpnRLAeque2uqOVVMLh6khnTcE2qJ5wAKop0HcreM1btoysD6bPQ== dependencies: jest-get-type "^29.4.3" - pretty-format "^29.6.1" + pretty-format "^29.6.2" -jest-matcher-utils@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.6.1.tgz#6c60075d84655d6300c5d5128f46531848160b53" - integrity sha512-SLaztw9d2mfQQKHmJXKM0HCbl2PPVld/t9Xa6P9sgiExijviSp7TnZZpw2Fpt+OI3nwUO/slJbOfzfUMKKC5QA== +jest-matcher-utils@^29.6.2: + version "29.6.2" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.6.2.tgz#39de0be2baca7a64eacb27291f0bd834fea3a535" + integrity sha512-4LiAk3hSSobtomeIAzFTe+N8kL6z0JtF3n6I4fg29iIW7tt99R7ZcIFW34QkX+DuVrf+CUe6wuVOpm7ZKFJzZQ== dependencies: chalk "^4.0.0" - jest-diff "^29.6.1" + jest-diff "^29.6.2" jest-get-type "^29.4.3" - pretty-format "^29.6.1" + pretty-format "^29.6.2" -jest-message-util@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.6.1.tgz#d0b21d87f117e1b9e165e24f245befd2ff34ff8d" - integrity sha512-KoAW2zAmNSd3Gk88uJ56qXUWbFk787QKmjjJVOjtGFmmGSZgDBrlIL4AfQw1xyMYPNVD7dNInfIbur9B2rd/wQ== +jest-message-util@^29.6.2: + version "29.6.2" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.6.2.tgz#af7adc2209c552f3f5ae31e77cf0a261f23dc2bb" + integrity sha512-vnIGYEjoPSuRqV8W9t+Wow95SDp6KPX2Uf7EoeG9G99J2OVh7OSwpS4B6J0NfpEIpfkBNHlBZpA2rblEuEFhZQ== dependencies: "@babel/code-frame" "^7.12.13" "@jest/types" "^29.6.1" @@ -1777,18 +1772,18 @@ jest-message-util@^29.6.1: chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^29.6.1" + pretty-format "^29.6.2" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.6.1.tgz#049ee26aea8cbf54c764af649070910607316517" - integrity sha512-brovyV9HBkjXAEdRooaTQK42n8usKoSRR3gihzUpYeV/vwqgSoNfrksO7UfSACnPmxasO/8TmHM3w9Hp3G1dgw== +jest-mock@^29.6.2: + version "29.6.2" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.6.2.tgz#ef9c9b4d38c34a2ad61010a021866dad41ce5e00" + integrity sha512-hoSv3lb3byzdKfwqCuT6uTscan471GUECqgNYykg6ob0yiAw3zYc7OrPnI9Qv8Wwoa4lC7AZ9hyS4AiIx5U2zg== dependencies: "@jest/types" "^29.6.1" "@types/node" "*" - jest-util "^29.6.1" + jest-util "^29.6.2" jest-pnp-resolver@^1.2.2: version "1.2.3" @@ -1800,67 +1795,67 @@ jest-regex-util@^29.4.3: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.4.3.tgz#a42616141e0cae052cfa32c169945d00c0aa0bb8" integrity sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg== -jest-resolve-dependencies@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.1.tgz#b85b06670f987a62515bbf625d54a499e3d708f5" - integrity sha512-BbFvxLXtcldaFOhNMXmHRWx1nXQO5LoXiKSGQcA1LxxirYceZT6ch8KTE1bK3X31TNG/JbkI7OkS/ABexVahiw== +jest-resolve-dependencies@^29.6.2: + version "29.6.2" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.2.tgz#36435269b6672c256bcc85fb384872c134cc4cf2" + integrity sha512-LGqjDWxg2fuQQm7ypDxduLu/m4+4Lb4gczc13v51VMZbVP5tSBILqVx8qfWcsdP8f0G7aIqByIALDB0R93yL+w== dependencies: jest-regex-util "^29.4.3" - jest-snapshot "^29.6.1" + jest-snapshot "^29.6.2" -jest-resolve@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.6.1.tgz#4c3324b993a85e300add2f8609f51b80ddea39ee" - integrity sha512-AeRkyS8g37UyJiP9w3mmI/VXU/q8l/IH52vj/cDAyScDcemRbSBhfX/NMYIGilQgSVwsjxrCHf3XJu4f+lxCMg== +jest-resolve@^29.6.2: + version "29.6.2" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.6.2.tgz#f18405fe4b50159b7b6d85e81f6a524d22afb838" + integrity sha512-G/iQUvZWI5e3SMFssc4ug4dH0aZiZpsDq9o1PtXTV1210Ztyb2+w+ZgQkB3iOiC5SmAEzJBOHWz6Hvrd+QnNPw== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^29.6.1" + jest-haste-map "^29.6.2" jest-pnp-resolver "^1.2.2" - jest-util "^29.6.1" - jest-validate "^29.6.1" + jest-util "^29.6.2" + jest-validate "^29.6.2" resolve "^1.20.0" resolve.exports "^2.0.0" slash "^3.0.0" -jest-runner@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.6.1.tgz#54557087e7972d345540d622ab5bfc3d8f34688c" - integrity sha512-tw0wb2Q9yhjAQ2w8rHRDxteryyIck7gIzQE4Reu3JuOBpGp96xWgF0nY8MDdejzrLCZKDcp8JlZrBN/EtkQvPQ== +jest-runner@^29.6.2: + version "29.6.2" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.6.2.tgz#89e8e32a8fef24781a7c4c49cd1cb6358ac7fc01" + integrity sha512-wXOT/a0EspYgfMiYHxwGLPCZfC0c38MivAlb2lMEAlwHINKemrttu1uSbcGbfDV31sFaPWnWJPmb2qXM8pqZ4w== dependencies: - "@jest/console" "^29.6.1" - "@jest/environment" "^29.6.1" - "@jest/test-result" "^29.6.1" - "@jest/transform" "^29.6.1" + "@jest/console" "^29.6.2" + "@jest/environment" "^29.6.2" + "@jest/test-result" "^29.6.2" + "@jest/transform" "^29.6.2" "@jest/types" "^29.6.1" "@types/node" "*" chalk "^4.0.0" emittery "^0.13.1" graceful-fs "^4.2.9" jest-docblock "^29.4.3" - jest-environment-node "^29.6.1" - jest-haste-map "^29.6.1" - jest-leak-detector "^29.6.1" - jest-message-util "^29.6.1" - jest-resolve "^29.6.1" - jest-runtime "^29.6.1" - jest-util "^29.6.1" - jest-watcher "^29.6.1" - jest-worker "^29.6.1" + jest-environment-node "^29.6.2" + jest-haste-map "^29.6.2" + jest-leak-detector "^29.6.2" + jest-message-util "^29.6.2" + jest-resolve "^29.6.2" + jest-runtime "^29.6.2" + jest-util "^29.6.2" + jest-watcher "^29.6.2" + jest-worker "^29.6.2" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.6.1.tgz#8a0fc9274ef277f3d70ba19d238e64334958a0dc" - integrity sha512-D6/AYOA+Lhs5e5il8+5pSLemjtJezUr+8zx+Sn8xlmOux3XOqx4d8l/2udBea8CRPqqrzhsKUsN/gBDE/IcaPQ== +jest-runtime@^29.6.2: + version "29.6.2" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.6.2.tgz#692f25e387f982e89ab83270e684a9786248e545" + integrity sha512-2X9dqK768KufGJyIeLmIzToDmsN0m7Iek8QNxRSI/2+iPFYHF0jTwlO3ftn7gdKd98G/VQw9XJCk77rbTGZnJg== dependencies: - "@jest/environment" "^29.6.1" - "@jest/fake-timers" "^29.6.1" - "@jest/globals" "^29.6.1" + "@jest/environment" "^29.6.2" + "@jest/fake-timers" "^29.6.2" + "@jest/globals" "^29.6.2" "@jest/source-map" "^29.6.0" - "@jest/test-result" "^29.6.1" - "@jest/transform" "^29.6.1" + "@jest/test-result" "^29.6.2" + "@jest/transform" "^29.6.2" "@jest/types" "^29.6.1" "@types/node" "*" chalk "^4.0.0" @@ -1868,47 +1863,46 @@ jest-runtime@^29.6.1: collect-v8-coverage "^1.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^29.6.1" - jest-message-util "^29.6.1" - jest-mock "^29.6.1" + jest-haste-map "^29.6.2" + jest-message-util "^29.6.2" + jest-mock "^29.6.2" jest-regex-util "^29.4.3" - jest-resolve "^29.6.1" - jest-snapshot "^29.6.1" - jest-util "^29.6.1" + jest-resolve "^29.6.2" + jest-snapshot "^29.6.2" + jest-util "^29.6.2" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.6.1.tgz#0d083cb7de716d5d5cdbe80d598ed2fbafac0239" - integrity sha512-G4UQE1QQ6OaCgfY+A0uR1W2AY0tGXUPQpoUClhWHq1Xdnx1H6JOrC2nH5lqnOEqaDgbHFgIwZ7bNq24HpB180A== +jest-snapshot@^29.6.2: + version "29.6.2" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.6.2.tgz#9b431b561a83f2bdfe041e1cab8a6becdb01af9c" + integrity sha512-1OdjqvqmRdGNvWXr/YZHuyhh5DeaLp1p/F8Tht/MrMw4Kr1Uu/j4lRG+iKl1DAqUJDWxtQBMk41Lnf/JETYBRA== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" "@babel/plugin-syntax-jsx" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.6.1" - "@jest/transform" "^29.6.1" + "@jest/expect-utils" "^29.6.2" + "@jest/transform" "^29.6.2" "@jest/types" "^29.6.1" - "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.6.1" + expect "^29.6.2" graceful-fs "^4.2.9" - jest-diff "^29.6.1" + jest-diff "^29.6.2" jest-get-type "^29.4.3" - jest-matcher-utils "^29.6.1" - jest-message-util "^29.6.1" - jest-util "^29.6.1" + jest-matcher-utils "^29.6.2" + jest-message-util "^29.6.2" + jest-util "^29.6.2" natural-compare "^1.4.0" - pretty-format "^29.6.1" + pretty-format "^29.6.2" semver "^7.5.3" -jest-util@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.6.1.tgz#c9e29a87a6edbf1e39e6dee2b4689b8a146679cb" - integrity sha512-NRFCcjc+/uO3ijUVyNOQJluf8PtGCe/W6cix36+M3cTFgiYqFOOW5MgN4JOOcvbUhcKTYVd1CvHz/LWi8d16Mg== +jest-util@^29.6.2: + version "29.6.2" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.6.2.tgz#8a052df8fff2eebe446769fd88814521a517664d" + integrity sha512-3eX1qb6L88lJNCFlEADKOkjpXJQyZRiavX1INZ4tRnrBVr2COd3RgcTLyUiEXMNBlDU/cgYq6taUS0fExrWW4w== dependencies: "@jest/types" "^29.6.1" "@types/node" "*" @@ -1917,51 +1911,51 @@ jest-util@^29.6.1: graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.6.1.tgz#765e684af6e2c86dce950aebefbbcd4546d69f7b" - integrity sha512-r3Ds69/0KCN4vx4sYAbGL1EVpZ7MSS0vLmd3gV78O+NAx3PDQQukRU5hNHPXlyqCgFY8XUk7EuTMLugh0KzahA== +jest-validate@^29.6.2: + version "29.6.2" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.6.2.tgz#25d972af35b2415b83b1373baf1a47bb266c1082" + integrity sha512-vGz0yMN5fUFRRbpJDPwxMpgSXW1LDKROHfBopAvDcmD6s+B/s8WJrwi+4bfH4SdInBA5C3P3BI19dBtKzx1Arg== dependencies: "@jest/types" "^29.6.1" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^29.4.3" leven "^3.1.0" - pretty-format "^29.6.1" + pretty-format "^29.6.2" -jest-watcher@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.6.1.tgz#7c0c43ddd52418af134c551c92c9ea31e5ec942e" - integrity sha512-d4wpjWTS7HEZPaaj8m36QiaP856JthRZkrgcIY/7ISoUWPIillrXM23WPboZVLbiwZBt4/qn2Jke84Sla6JhFA== +jest-watcher@^29.6.2: + version "29.6.2" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.6.2.tgz#77c224674f0620d9f6643c4cfca186d8893ca088" + integrity sha512-GZitlqkMkhkefjfN/p3SJjrDaxPflqxEAv3/ik10OirZqJGYH5rPiIsgVcfof0Tdqg3shQGdEIxDBx+B4tuLzA== dependencies: - "@jest/test-result" "^29.6.1" + "@jest/test-result" "^29.6.2" "@jest/types" "^29.6.1" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.13.1" - jest-util "^29.6.1" + jest-util "^29.6.2" string-length "^4.0.1" -jest-worker@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.6.1.tgz#64b015f0e985ef3a8ad049b61fe92b3db74a5319" - integrity sha512-U+Wrbca7S8ZAxAe9L6nb6g8kPdia5hj32Puu5iOqBCMTMWFHXuK6dOV2IFrpedbTV8fjMFLdWNttQTBL6u2MRA== +jest-worker@^29.6.2: + version "29.6.2" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.6.2.tgz#682fbc4b6856ad0aa122a5403c6d048b83f3fb44" + integrity sha512-l3ccBOabTdkng8I/ORCkADz4eSMKejTYv1vB/Z83UiubqhC1oQ5Li6dWCyqOIvSifGjUBxuvxvlm6KGK2DtuAQ== dependencies: "@types/node" "*" - jest-util "^29.6.1" + jest-util "^29.6.2" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^29.5.0: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.6.1.tgz#74be1cb719c3abe439f2d94aeb18e6540a5b02ad" - integrity sha512-Nirw5B4nn69rVUZtemCQhwxOBhm0nsp3hmtF4rzCeWD7BkjAXRIji7xWQfnTNbz9g0aVsBX6aZK3n+23LM6uDw== + version "29.6.2" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.6.2.tgz#3bd55b9fd46a161b2edbdf5f1d1bd0d1eab76c42" + integrity sha512-8eQg2mqFbaP7CwfsTpCxQ+sHzw1WuNWL5UUvjnWP4hx2riGz9fPSzYOaU5q8/GqWn1TfgZIVTqYJygbGbWAANg== dependencies: - "@jest/core" "^29.6.1" + "@jest/core" "^29.6.2" "@jest/types" "^29.6.1" import-local "^3.0.2" - jest-cli "^29.6.1" + jest-cli "^29.6.2" js-tokens@^4.0.0: version "4.0.0" @@ -2279,10 +2273,10 @@ prettier@^3.0.0: resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0.tgz#e7b19f691245a21d618c68bc54dc06122f6105ae" integrity sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g== -pretty-format@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.6.1.tgz#ec838c288850b7c4f9090b867c2d4f4edbfb0f3e" - integrity sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog== +pretty-format@^29.6.2: + version "29.6.2" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.6.2.tgz#3d5829261a8a4d89d8b9769064b29c50ed486a47" + integrity sha512-1q0oC8eRveTg5nnBEWMXAU2qpv65Gnuf2eCQzSjxpWFkPaPARwqZZDGuNE0zPAZfTCHzIk3A8dIjwlQKKLphyg== dependencies: "@jest/schemas" "^29.6.0" ansi-styles "^5.0.0" From 326589a9f65115f2fd07944972495f09137a13c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 27 Jul 2023 12:46:20 +0000 Subject: [PATCH 729/785] Bump eslint-config-prettier from 8.8.0 to 8.9.0 Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.8.0 to 8.9.0. - [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.8.0...v8.9.0) --- updated-dependencies: - dependency-name: eslint-config-prettier dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 3ed82be5..829cc511 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1132,9 +1132,9 @@ escape-string-regexp@^4.0.0: integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== eslint-config-prettier@^8.7.0: - version "8.8.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz#bfda738d412adc917fd7b038857110efe98c9348" - integrity sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA== + version "8.9.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.9.0.tgz#094b6254b2804b0544f7cee535f802b6d29ee10b" + integrity sha512-+sbni7NfVXnOpnRadUA8S28AUlsZt9GjgFvABIRL9Hkn8KqNzOp+7Lw4QWtrwn20KzU3wqu1QoOj2m+7rKRqkA== eslint-scope@^7.2.0: version "7.2.0" From 1b0e68d3e9a102e82ef4bba2c4d1084c20204025 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Jul 2023 12:11:08 +0000 Subject: [PATCH 730/785] Bump eslint from 8.45.0 to 8.46.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.45.0 to 8.46.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.45.0...v8.46.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 70 +++++++++++++++++++++++++++---------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9ca0dbe0..eda088a8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -308,15 +308,15 @@ dependencies: eslint-visitor-keys "^3.3.0" -"@eslint-community/regexpp@^4.4.0": - version "4.5.1" - resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.5.1.tgz#cdd35dce4fa1a89a4fd42b1599eb35b3af408884" - integrity sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ== +"@eslint-community/regexpp@^4.6.1": + version "4.6.2" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.6.2.tgz#1816b5f6948029c5eaacb0703b850ee0cb37d8f8" + integrity sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw== -"@eslint/eslintrc@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.0.tgz#82256f164cc9e0b59669efc19d57f8092706841d" - integrity sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A== +"@eslint/eslintrc@^2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.1.tgz#18d635e24ad35f7276e8a49d135c7d3ca6a46f93" + integrity sha512-9t7ZA7NGGK8ckelF0PQCfcxIUzs1Md5rrO6U/c+FIQNanea5UZC0wqKXH4vHBccmu4ZJgZ2idtPeW7+Q2npOEA== dependencies: ajv "^6.12.4" debug "^4.3.2" @@ -328,10 +328,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.44.0": - version "8.44.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.44.0.tgz#961a5903c74139390478bdc808bcde3fc45ab7af" - integrity sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw== +"@eslint/js@^8.46.0": + version "8.46.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.46.0.tgz#3f7802972e8b6fe3f88ed1aabc74ec596c456db6" + integrity sha512-a8TLtmPi8xzPkCbp/OGFUo5yhRkHM2Ko9kOWP4znJr0WAhWyThaw3PnwX4vOTWOAMsV2uRt32PPDcEz63esSaA== "@humanwhocodes/config-array@^0.11.10": version "0.11.10" @@ -733,7 +733,7 @@ acorn@^8.9.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== -ajv@^6.10.0, ajv@^6.12.4: +ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -1131,40 +1131,40 @@ eslint-config-prettier@^8.7.0: resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.9.0.tgz#094b6254b2804b0544f7cee535f802b6d29ee10b" integrity sha512-+sbni7NfVXnOpnRadUA8S28AUlsZt9GjgFvABIRL9Hkn8KqNzOp+7Lw4QWtrwn20KzU3wqu1QoOj2m+7rKRqkA== -eslint-scope@^7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.0.tgz#f21ebdafda02352f103634b96dd47d9f81ca117b" - integrity sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw== +eslint-scope@^7.2.2: + version "7.2.2" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f" + integrity sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== dependencies: esrecurse "^4.3.0" estraverse "^5.2.0" -eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: - version "3.4.1" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz#c22c48f48942d08ca824cc526211ae400478a994" - integrity sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA== +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.2: + version "3.4.2" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.2.tgz#8c2095440eca8c933bedcadf16fefa44dbe9ba5f" + integrity sha512-8drBzUEyZ2llkpCA67iYrgEssKDUu68V8ChqqOfFupIaG/LCVPUT+CoGJpT77zJprs4T/W7p07LP7zAIMuweVw== eslint@^8.35.0: - version "8.45.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.45.0.tgz#bab660f90d18e1364352c0a6b7c6db8edb458b78" - integrity sha512-pd8KSxiQpdYRfYa9Wufvdoct3ZPQQuVuU5O6scNgMuOMYuxvH0IGaYK0wUFjo4UYYQQCUndlXiMbnxopwvvTiw== + version "8.46.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.46.0.tgz#a06a0ff6974e53e643acc42d1dcf2e7f797b3552" + integrity sha512-cIO74PvbW0qU8e0mIvk5IV3ToWdCq5FYG6gWPHHkx6gNdjlbAYvtfHmlCMXxjcoVaIdwy/IAt3+mDkZkfvb2Dg== dependencies: "@eslint-community/eslint-utils" "^4.2.0" - "@eslint-community/regexpp" "^4.4.0" - "@eslint/eslintrc" "^2.1.0" - "@eslint/js" "8.44.0" + "@eslint-community/regexpp" "^4.6.1" + "@eslint/eslintrc" "^2.1.1" + "@eslint/js" "^8.46.0" "@humanwhocodes/config-array" "^0.11.10" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" - ajv "^6.10.0" + ajv "^6.12.4" chalk "^4.0.0" cross-spawn "^7.0.2" debug "^4.3.2" doctrine "^3.0.0" escape-string-regexp "^4.0.0" - eslint-scope "^7.2.0" - eslint-visitor-keys "^3.4.1" - espree "^9.6.0" + eslint-scope "^7.2.2" + eslint-visitor-keys "^3.4.2" + espree "^9.6.1" esquery "^1.4.2" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -1187,10 +1187,10 @@ eslint@^8.35.0: strip-ansi "^6.0.1" text-table "^0.2.0" -espree@^9.6.0: - version "9.6.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.6.0.tgz#80869754b1c6560f32e3b6929194a3fe07c5b82f" - integrity sha512-1FH/IiruXZ84tpUlm0aCUEwMl2Ho5ilqVh0VvQXw+byAz/4SAciyHLlfmL5WYqsvD38oymdUwBss0LtK8m4s/A== +espree@^9.6.0, espree@^9.6.1: + version "9.6.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f" + integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== dependencies: acorn "^8.9.0" acorn-jsx "^5.3.2" From 9228ef3fc12207a6f21257313822690c972e42c1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Aug 2023 12:18:22 +0000 Subject: [PATCH 731/785] Bump eslint-config-prettier from 8.9.0 to 8.10.0 Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.9.0 to 8.10.0. - [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.9.0...v8.10.0) --- updated-dependencies: - dependency-name: eslint-config-prettier dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index eda088a8..8a55f935 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1127,9 +1127,9 @@ escape-string-regexp@^4.0.0: integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== eslint-config-prettier@^8.7.0: - version "8.9.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.9.0.tgz#094b6254b2804b0544f7cee535f802b6d29ee10b" - integrity sha512-+sbni7NfVXnOpnRadUA8S28AUlsZt9GjgFvABIRL9Hkn8KqNzOp+7Lw4QWtrwn20KzU3wqu1QoOj2m+7rKRqkA== + version "8.10.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.10.0.tgz#3a06a662130807e2502fc3ff8b4143d8a0658e11" + integrity sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg== eslint-scope@^7.2.2: version "7.2.2" From 60c82c67bd063167454dbc6c7691f9fd921966e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Aug 2023 12:18:36 +0000 Subject: [PATCH 732/785] Bump prettier from 3.0.0 to 3.0.1 Bumps [prettier](https://github.com/prettier/prettier) from 3.0.0 to 3.0.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/3.0.0...3.0.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index eda088a8..f4d0a75c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2269,9 +2269,9 @@ prelude-ls@^1.2.1: integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== prettier@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0.tgz#e7b19f691245a21d618c68bc54dc06122f6105ae" - integrity sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g== + version "3.0.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.1.tgz#65271fc9320ce4913c57747a70ce635b30beaa40" + integrity sha512-fcOWSnnpCrovBsmFZIGIy9UqK2FaI7Hqax+DIO0A9UxeVoY4iweyaFjS5TavZN97Hfehph0nhsZnjlVKzEQSrQ== pretty-format@^29.6.2: version "29.6.2" From 1a550f711d6875de55fa7e16ab2a5016d36306e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Aug 2023 12:53:13 +0000 Subject: [PATCH 733/785] Bump eslint-config-prettier from 8.10.0 to 9.0.0 Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.10.0 to 9.0.0. - [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.10.0...v9.0.0) --- updated-dependencies: - dependency-name: eslint-config-prettier dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index a2862f8f..d09fde8c 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ }, "devDependencies": { "eslint": "^8.35.0", - "eslint-config-prettier": "^8.7.0", + "eslint-config-prettier": "^9.0.0", "husky": "^8.0.1", "jest": "^29.5.0", "prettier": "^3.0.0", diff --git a/yarn.lock b/yarn.lock index 27191e9c..8b384143 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1126,10 +1126,10 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -eslint-config-prettier@^8.7.0: - version "8.10.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.10.0.tgz#3a06a662130807e2502fc3ff8b4143d8a0658e11" - integrity sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg== +eslint-config-prettier@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz#eb25485946dd0c66cd216a46232dc05451518d1f" + integrity sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw== eslint-scope@^7.2.2: version "7.2.2" From bd7dee53f72501851c8b2453c8429389978b79ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Aug 2023 12:54:50 +0000 Subject: [PATCH 734/785] Bump eslint from 8.46.0 to 8.47.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.46.0 to 8.47.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.46.0...v8.47.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/yarn.lock b/yarn.lock index 8b384143..c05f282f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -313,10 +313,10 @@ resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.6.2.tgz#1816b5f6948029c5eaacb0703b850ee0cb37d8f8" integrity sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw== -"@eslint/eslintrc@^2.1.1": - version "2.1.1" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.1.tgz#18d635e24ad35f7276e8a49d135c7d3ca6a46f93" - integrity sha512-9t7ZA7NGGK8ckelF0PQCfcxIUzs1Md5rrO6U/c+FIQNanea5UZC0wqKXH4vHBccmu4ZJgZ2idtPeW7+Q2npOEA== +"@eslint/eslintrc@^2.1.2": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.2.tgz#c6936b4b328c64496692f76944e755738be62396" + integrity sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g== dependencies: ajv "^6.12.4" debug "^4.3.2" @@ -328,10 +328,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@^8.46.0": - version "8.46.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.46.0.tgz#3f7802972e8b6fe3f88ed1aabc74ec596c456db6" - integrity sha512-a8TLtmPi8xzPkCbp/OGFUo5yhRkHM2Ko9kOWP4znJr0WAhWyThaw3PnwX4vOTWOAMsV2uRt32PPDcEz63esSaA== +"@eslint/js@^8.47.0": + version "8.47.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.47.0.tgz#5478fdf443ff8158f9de171c704ae45308696c7d" + integrity sha512-P6omY1zv5MItm93kLM8s2vr1HICJH8v0dvddDhysbIuZ+vcjOHg5Zbkf1mTkcmi2JA9oBG2anOkRnW8WJTS8Og== "@humanwhocodes/config-array@^0.11.10": version "0.11.10" @@ -1139,20 +1139,20 @@ eslint-scope@^7.2.2: esrecurse "^4.3.0" estraverse "^5.2.0" -eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.2: - version "3.4.2" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.2.tgz#8c2095440eca8c933bedcadf16fefa44dbe9ba5f" - integrity sha512-8drBzUEyZ2llkpCA67iYrgEssKDUu68V8ChqqOfFupIaG/LCVPUT+CoGJpT77zJprs4T/W7p07LP7zAIMuweVw== +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: + version "3.4.3" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" + integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== eslint@^8.35.0: - version "8.46.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.46.0.tgz#a06a0ff6974e53e643acc42d1dcf2e7f797b3552" - integrity sha512-cIO74PvbW0qU8e0mIvk5IV3ToWdCq5FYG6gWPHHkx6gNdjlbAYvtfHmlCMXxjcoVaIdwy/IAt3+mDkZkfvb2Dg== + version "8.47.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.47.0.tgz#c95f9b935463fb4fad7005e626c7621052e90806" + integrity sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.6.1" - "@eslint/eslintrc" "^2.1.1" - "@eslint/js" "^8.46.0" + "@eslint/eslintrc" "^2.1.2" + "@eslint/js" "^8.47.0" "@humanwhocodes/config-array" "^0.11.10" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" @@ -1163,7 +1163,7 @@ eslint@^8.35.0: doctrine "^3.0.0" escape-string-regexp "^4.0.0" eslint-scope "^7.2.2" - eslint-visitor-keys "^3.4.2" + eslint-visitor-keys "^3.4.3" espree "^9.6.1" esquery "^1.4.2" esutils "^2.0.2" From 1ce5d6b50d087a75cf074e842677a7f070a67dce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Aug 2023 12:31:15 +0000 Subject: [PATCH 735/785] Bump prettier from 3.0.1 to 3.0.2 Bumps [prettier](https://github.com/prettier/prettier) from 3.0.1 to 3.0.2. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/3.0.1...3.0.2) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index c05f282f..4d161a8d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2269,9 +2269,9 @@ prelude-ls@^1.2.1: integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== prettier@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.1.tgz#65271fc9320ce4913c57747a70ce635b30beaa40" - integrity sha512-fcOWSnnpCrovBsmFZIGIy9UqK2FaI7Hqax+DIO0A9UxeVoY4iweyaFjS5TavZN97Hfehph0nhsZnjlVKzEQSrQ== + version "3.0.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.2.tgz#78fcecd6d870551aa5547437cdae39d4701dca5b" + integrity sha512-o2YR9qtniXvwEZlOKbveKfDQVyqxbEIWn48Z8m3ZJjBjcCmUy3xZGIv+7AkaeuaTr6yPXJjwv07ZWlsWbEy1rQ== pretty-format@^29.6.2: version "29.6.2" From 02e89e1c0b4f7ae9bd3fa8d6d40127cd94f2a381 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Aug 2023 12:01:52 +0000 Subject: [PATCH 736/785] Bump jest from 29.6.2 to 29.6.3 Bumps [jest](https://github.com/jestjs/jest/tree/HEAD/packages/jest) from 29.6.2 to 29.6.3. - [Release notes](https://github.com/jestjs/jest/releases) - [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/jestjs/jest/commits/v29.6.3/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 723 +++++++++++++++++++++++++++--------------------------- 1 file changed, 367 insertions(+), 356 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4d161a8d..750fe14c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -368,109 +368,109 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^29.6.2": - version "29.6.2" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.6.2.tgz#bf1d4101347c23e07c029a1b1ae07d550f5cc541" - integrity sha512-0N0yZof5hi44HAR2pPS+ikJ3nzKNoZdVu8FffRf3wy47I7Dm7etk/3KetMdRUqzVd16V4O2m2ISpNTbnIuqy1w== +"@jest/console@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.6.3.tgz#55ad945087c27e380d6d9fcbb85181ed802543f3" + integrity sha512-ukZbHAdDH4ktZIOKvWs1juAXhiVAdvCyM8zv4S/7Ii3vJSDvMW5k+wOVGMQmHLHUFw3Ko63ZQNy7NI6PSlsD5w== dependencies: - "@jest/types" "^29.6.1" + "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^29.6.2" - jest-util "^29.6.2" + jest-message-util "^29.6.3" + jest-util "^29.6.3" slash "^3.0.0" -"@jest/core@^29.6.2": - version "29.6.2" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.6.2.tgz#6f2d1dbe8aa0265fcd4fb8082ae1952f148209c8" - integrity sha512-Oj+5B+sDMiMWLhPFF+4/DvHOf+U10rgvCLGPHP8Xlsy/7QxS51aU/eBngudHlJXnaWD5EohAgJ4js+T6pa+zOg== +"@jest/core@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.6.3.tgz#bccee53680762e1bdef2a0038f123cc8d7ba4ab8" + integrity sha512-skV1XrfNxfagmjRUrk2FyN5/2YwIzdWVVBa/orUfbLvQUANXxERq2pTvY0I+FinWHjDKB2HRmpveUiph4X0TJw== dependencies: - "@jest/console" "^29.6.2" - "@jest/reporters" "^29.6.2" - "@jest/test-result" "^29.6.2" - "@jest/transform" "^29.6.2" - "@jest/types" "^29.6.1" + "@jest/console" "^29.6.3" + "@jest/reporters" "^29.6.3" + "@jest/test-result" "^29.6.3" + "@jest/transform" "^29.6.3" + "@jest/types" "^29.6.3" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" ci-info "^3.2.0" exit "^0.1.2" graceful-fs "^4.2.9" - jest-changed-files "^29.5.0" - jest-config "^29.6.2" - jest-haste-map "^29.6.2" - jest-message-util "^29.6.2" - jest-regex-util "^29.4.3" - jest-resolve "^29.6.2" - jest-resolve-dependencies "^29.6.2" - jest-runner "^29.6.2" - jest-runtime "^29.6.2" - jest-snapshot "^29.6.2" - jest-util "^29.6.2" - jest-validate "^29.6.2" - jest-watcher "^29.6.2" + jest-changed-files "^29.6.3" + jest-config "^29.6.3" + jest-haste-map "^29.6.3" + jest-message-util "^29.6.3" + jest-regex-util "^29.6.3" + jest-resolve "^29.6.3" + jest-resolve-dependencies "^29.6.3" + jest-runner "^29.6.3" + jest-runtime "^29.6.3" + jest-snapshot "^29.6.3" + jest-util "^29.6.3" + jest-validate "^29.6.3" + jest-watcher "^29.6.3" micromatch "^4.0.4" - pretty-format "^29.6.2" + pretty-format "^29.6.3" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.6.2": - version "29.6.2" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.6.2.tgz#794c0f769d85e7553439d107d3f43186dc6874a9" - integrity sha512-AEcW43C7huGd/vogTddNNTDRpO6vQ2zaQNrttvWV18ArBx9Z56h7BIsXkNFJVOO4/kblWEQz30ckw0+L3izc+Q== +"@jest/environment@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.6.3.tgz#bb02535c729393a0345b8d2c5eef94d34f7b35a3" + integrity sha512-u/u3cCztYCfgBiGHsamqP5x+XvucftOGPbf5RJQxfpeC1y4AL8pCjKvPDA3oCmdhZYPgk5AE0VOD/flweR69WA== dependencies: - "@jest/fake-timers" "^29.6.2" - "@jest/types" "^29.6.1" + "@jest/fake-timers" "^29.6.3" + "@jest/types" "^29.6.3" "@types/node" "*" - jest-mock "^29.6.2" + jest-mock "^29.6.3" -"@jest/expect-utils@^29.6.2": - version "29.6.2" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.6.2.tgz#1b97f290d0185d264dd9fdec7567a14a38a90534" - integrity sha512-6zIhM8go3RV2IG4aIZaZbxwpOzz3ZiM23oxAlkquOIole+G6TrbeXnykxWYlqF7kz2HlBjdKtca20x9atkEQYg== +"@jest/expect-utils@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.6.3.tgz#5ef1a9689fdaa348da837c8be8d1219f56940ea3" + integrity sha512-nvOEW4YoqRKD9HBJ9OJ6przvIvP9qilp5nAn1462P5ZlL/MM9SgPEZFyjTGPfs7QkocdUsJa6KjHhyRn4ueItA== dependencies: - jest-get-type "^29.4.3" + jest-get-type "^29.6.3" -"@jest/expect@^29.6.2": - version "29.6.2" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.6.2.tgz#5a2ad58bb345165d9ce0a1845bbf873c480a4b28" - integrity sha512-m6DrEJxVKjkELTVAztTLyS/7C92Y2b0VYqmDROYKLLALHn8T/04yPs70NADUYPrV3ruI+H3J0iUIuhkjp7vkfg== +"@jest/expect@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.6.3.tgz#d54e1e7134982166f62653add0d4b8262dd72db9" + integrity sha512-Ic08XbI2jlg6rECy+CGwk/8NDa6VE7UmIG6++9OTPAMnQmNGY28hu69Nf629CWv6T7YMODLbONxDFKdmQeI9FA== dependencies: - expect "^29.6.2" - jest-snapshot "^29.6.2" + expect "^29.6.3" + jest-snapshot "^29.6.3" -"@jest/fake-timers@^29.6.2": - version "29.6.2" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.6.2.tgz#fe9d43c5e4b1b901168fe6f46f861b3e652a2df4" - integrity sha512-euZDmIlWjm1Z0lJ1D0f7a0/y5Kh/koLFMUBE5SUYWrmy8oNhJpbTBDAP6CxKnadcMLDoDf4waRYCe35cH6G6PA== +"@jest/fake-timers@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.6.3.tgz#7e780b05b14ad59dca68bdc188f6cf085552a0e8" + integrity sha512-pa1wmqvbj6eX0nMvOM2VDAWvJOI5A/Mk3l8O7n7EsAh71sMZblaKO9iT4GjIj0LwwK3CP/Jp1ypEV0x3m89RvA== dependencies: - "@jest/types" "^29.6.1" + "@jest/types" "^29.6.3" "@sinonjs/fake-timers" "^10.0.2" "@types/node" "*" - jest-message-util "^29.6.2" - jest-mock "^29.6.2" - jest-util "^29.6.2" + jest-message-util "^29.6.3" + jest-mock "^29.6.3" + jest-util "^29.6.3" -"@jest/globals@^29.6.2": - version "29.6.2" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.6.2.tgz#74af81b9249122cc46f1eb25793617eec69bf21a" - integrity sha512-cjuJmNDjs6aMijCmSa1g2TNG4Lby/AeU7/02VtpW+SLcZXzOLK2GpN2nLqcFjmhy3B3AoPeQVx7BnyOf681bAw== +"@jest/globals@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.6.3.tgz#fe9e302bc20683ba8feb683b8804e38a9913b783" + integrity sha512-RB+uI+CZMHntzlnOPlll5x/jgRff3LEPl/td/jzMXiIgR0iIhKq9qm1HLU+EC52NuoVy/1swit/sDGjVn4bc6A== dependencies: - "@jest/environment" "^29.6.2" - "@jest/expect" "^29.6.2" - "@jest/types" "^29.6.1" - jest-mock "^29.6.2" + "@jest/environment" "^29.6.3" + "@jest/expect" "^29.6.3" + "@jest/types" "^29.6.3" + jest-mock "^29.6.3" -"@jest/reporters@^29.6.2": - version "29.6.2" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.6.2.tgz#524afe1d76da33d31309c2c4a2c8062d0c48780a" - integrity sha512-sWtijrvIav8LgfJZlrGCdN0nP2EWbakglJY49J1Y5QihcQLfy7ovyxxjJBRXMNltgt4uPtEcFmIMbVshEDfFWw== +"@jest/reporters@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.6.3.tgz#e5071915d74f43e0f49982fa518ca3283a9f4c5a" + integrity sha512-kGz59zMi0GkVjD2CJeYWG9k6cvj7eBqt9aDAqo2rcCLRTYlvQ62Gu/n+tOmJMBHGjzeijjuCENjzTyYBgrtLUw== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.6.2" - "@jest/test-result" "^29.6.2" - "@jest/transform" "^29.6.2" - "@jest/types" "^29.6.1" + "@jest/console" "^29.6.3" + "@jest/test-result" "^29.6.3" + "@jest/transform" "^29.6.3" + "@jest/types" "^29.6.3" "@jridgewell/trace-mapping" "^0.3.18" "@types/node" "*" chalk "^4.0.0" @@ -479,81 +479,81 @@ glob "^7.1.3" graceful-fs "^4.2.9" istanbul-lib-coverage "^3.0.0" - istanbul-lib-instrument "^5.1.0" + istanbul-lib-instrument "^6.0.0" istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^29.6.2" - jest-util "^29.6.2" - jest-worker "^29.6.2" + jest-message-util "^29.6.3" + jest-util "^29.6.3" + jest-worker "^29.6.3" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" v8-to-istanbul "^9.0.1" -"@jest/schemas@^29.6.0": - version "29.6.0" - resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.6.0.tgz#0f4cb2c8e3dca80c135507ba5635a4fd755b0040" - integrity sha512-rxLjXyJBTL4LQeJW3aKo0M/+GkCOXsO+8i9Iu7eDb6KwtP65ayoDsitrdPBtujxQ88k4wI2FNYfa6TOGwSn6cQ== +"@jest/schemas@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.6.3.tgz#430b5ce8a4e0044a7e3819663305a7b3091c8e03" + integrity sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA== dependencies: "@sinclair/typebox" "^0.27.8" -"@jest/source-map@^29.6.0": - version "29.6.0" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.6.0.tgz#bd34a05b5737cb1a99d43e1957020ac8e5b9ddb1" - integrity sha512-oA+I2SHHQGxDCZpbrsCQSoMLb3Bz547JnM+jUr9qEbuw0vQlWZfpPS7CO9J7XiwKicEz9OFn/IYoLkkiUD7bzA== +"@jest/source-map@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.6.3.tgz#d90ba772095cf37a34a5eb9413f1b562a08554c4" + integrity sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw== dependencies: "@jridgewell/trace-mapping" "^0.3.18" callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^29.6.2": - version "29.6.2" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.6.2.tgz#fdd11583cd1608e4db3114e8f0cce277bf7a32ed" - integrity sha512-3VKFXzcV42EYhMCsJQURptSqnyjqCGbtLuX5Xxb6Pm6gUf1wIRIl+mandIRGJyWKgNKYF9cnstti6Ls5ekduqw== +"@jest/test-result@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.6.3.tgz#1da4c6749c16a71c108644624d9cd0d17206aa2b" + integrity sha512-k7ZZaNvOSMBHPZYiy0kuiaFoyansR5QnTwDux1EjK3kD5iWpRVyJIJ0RAIV39SThafchuW59vra7F8mdy5Hfgw== dependencies: - "@jest/console" "^29.6.2" - "@jest/types" "^29.6.1" + "@jest/console" "^29.6.3" + "@jest/types" "^29.6.3" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.6.2": - version "29.6.2" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.6.2.tgz#585eff07a68dd75225a7eacf319780cb9f6b9bf4" - integrity sha512-GVYi6PfPwVejO7slw6IDO0qKVum5jtrJ3KoLGbgBWyr2qr4GaxFV6su+ZAjdTX75Sr1DkMFRk09r2ZVa+wtCGw== +"@jest/test-sequencer@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.6.3.tgz#e59f422bc3786d79fac504c16979a5f1b999a932" + integrity sha512-/SmijaAU2TY9ComFGIYa6Z+fmKqQMnqs2Nmwb0P/Z/tROdZ7M0iruES1EaaU9PBf8o9uED5xzaJ3YPFEIcDgAg== dependencies: - "@jest/test-result" "^29.6.2" + "@jest/test-result" "^29.6.3" graceful-fs "^4.2.9" - jest-haste-map "^29.6.2" + jest-haste-map "^29.6.3" slash "^3.0.0" -"@jest/transform@^29.6.2": - version "29.6.2" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.6.2.tgz#522901ebbb211af08835bc3bcdf765ab778094e3" - integrity sha512-ZqCqEISr58Ce3U+buNFJYUktLJZOggfyvR+bZMaiV1e8B1SIvJbwZMrYz3gx/KAPn9EXmOmN+uB08yLCjWkQQg== +"@jest/transform@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.6.3.tgz#e8e376f56fffe827b529bf03a9881e58d152c14b" + integrity sha512-dPIc3DsvMZ/S8ut4L2ViCj265mKO0owB0wfzBv2oGzL9pQ+iRvJewHqLBmsGb7XFb5UotWIEtvY5A/lnylaIoQ== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^29.6.1" + "@jest/types" "^29.6.3" "@jridgewell/trace-mapping" "^0.3.18" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^2.0.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.6.2" - jest-regex-util "^29.4.3" - jest-util "^29.6.2" + jest-haste-map "^29.6.3" + jest-regex-util "^29.6.3" + jest-util "^29.6.3" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" write-file-atomic "^4.0.2" -"@jest/types@^29.6.1": - version "29.6.1" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.6.1.tgz#ae79080278acff0a6af5eb49d063385aaa897bf2" - integrity sha512-tPKQNMPuXgvdOn2/Lg9HNfUvjYVGolt04Hp03f5hAk878uwOLikN+JzeLY0HcVgKgFl9Hs3EIqpu3WX27XNhnw== +"@jest/types@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.6.3.tgz#1131f8cf634e7e84c5e77bab12f052af585fba59" + integrity sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw== dependencies: - "@jest/schemas" "^29.6.0" + "@jest/schemas" "^29.6.3" "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" "@types/node" "*" @@ -809,15 +809,15 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.6.2.tgz#cada0a59e07f5acaeb11cbae7e3ba92aec9c1126" - integrity sha512-BYCzImLos6J3BH/+HvUCHG1dTf2MzmAB4jaVxHV+29RZLjR29XuYTmsf2sdDwkrb+FczkGo3kOhE7ga6sI0P4A== +babel-jest@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.6.3.tgz#e62f6c38f3ec8c147244168ee18ef0b919f10348" + integrity sha512-1Ne93zZZEy5XmTa4Q+W5+zxBrDpExX8E3iy+xJJ+24ewlfo/T3qHfQJCzi/MMVFmBQDNxtRR/Gfd2dwb/0yrQw== dependencies: - "@jest/transform" "^29.6.2" + "@jest/transform" "^29.6.3" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^29.5.0" + babel-preset-jest "^29.6.3" chalk "^4.0.0" graceful-fs "^4.2.9" slash "^3.0.0" @@ -833,10 +833,10 @@ babel-plugin-istanbul@^6.1.1: istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.5.0.tgz#a97db437936f441ec196990c9738d4b88538618a" - integrity sha512-zSuuuAlTMT4mzLj2nPnUm6fsE6270vdOfnpbJ+RmruU75UhLFvL0N2NgI7xpeS7NaB6hGqmd5pVpGTDYvi4Q3w== +babel-plugin-jest-hoist@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz#aadbe943464182a8922c3c927c3067ff40d24626" + integrity sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -861,12 +861,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.5.0.tgz#57bc8cc88097af7ff6a5ab59d1cd29d52a5916e2" - integrity sha512-JOMloxOqdiBSxMAzjRaH023/vvcaSaec49zvg+2LmNsktC7ei39LTJGw02J+9uUtTZUq6xbLyJ4dxe9sSmIuAg== +babel-preset-jest@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz#fa05fa510e7d493896d7b0dd2033601c840f171c" + integrity sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA== dependencies: - babel-plugin-jest-hoist "^29.5.0" + babel-plugin-jest-hoist "^29.6.3" babel-preset-current-node-syntax "^1.0.0" balanced-match@^1.0.0: @@ -1065,10 +1065,10 @@ detect-newline@^3.0.0: resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== -diff-sequences@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.4.3.tgz#9314bc1fabe09267ffeca9cbafc457d8499a13f2" - integrity sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA== +diff-sequences@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" + integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== doctrine@^3.0.0: version "3.0.0" @@ -1260,17 +1260,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== -expect@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.6.2.tgz#7b08e83eba18ddc4a2cf62b5f2d1918f5cd84521" - integrity sha512-iAErsLxJ8C+S02QbLAwgSGSezLQK+XXRDt8IuFXFpwCNw2ECmzZSmjKcCaFVp5VRMk+WAvz6h6jokzEzBFZEuA== +expect@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.6.3.tgz#e74b57c35a81fd93ece6b570e371309c53dc4f54" + integrity sha512-x1vY4LlEMWUYVZQrFi4ZANXFwqYbJ/JNQspLVvzhW2BNY28aNcXMQH6imBbt+RBf5sVRTodYHXtSP/TLEU0Dxw== dependencies: - "@jest/expect-utils" "^29.6.2" - "@types/node" "*" - jest-get-type "^29.4.3" - jest-matcher-utils "^29.6.2" - jest-message-util "^29.6.2" - jest-util "^29.6.2" + "@jest/expect-utils" "^29.6.3" + jest-get-type "^29.6.3" + jest-matcher-utils "^29.6.3" + jest-message-util "^29.6.3" + jest-util "^29.6.3" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1562,7 +1561,7 @@ istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== -istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0: +istanbul-lib-instrument@^5.0.4: version "5.2.1" resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz#d10c8885c2125574e1c231cacadf955675e1ce3d" integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg== @@ -1573,6 +1572,17 @@ istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0: istanbul-lib-coverage "^3.2.0" semver "^6.3.0" +istanbul-lib-instrument@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.0.tgz#7a8af094cbfff1d5bb280f62ce043695ae8dd5b8" + integrity sha512-x58orMzEVfzPUKqlbLd1hXCnySCxKdDKa6Rjg97CwuLLRI4g3FHTdnExu1OqffVFay6zeMW+T6/DowFLndWnIw== + dependencies: + "@babel/core" "^7.12.3" + "@babel/parser" "^7.14.7" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-coverage "^3.2.0" + semver "^7.5.4" + istanbul-lib-report@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" @@ -1599,363 +1609,364 @@ istanbul-reports@^3.1.3: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.5.0.tgz#e88786dca8bf2aa899ec4af7644e16d9dcf9b23e" - integrity sha512-IFG34IUMUaNBIxjQXF/iu7g6EcdMrGRRxaUSw92I/2g2YC6vCdTltl4nHvt7Ci5nSJwXIkCu8Ka1DKF+X7Z1Ag== +jest-changed-files@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.6.3.tgz#97cfdc93f74fb8af2a1acb0b78f836f1fb40c449" + integrity sha512-G5wDnElqLa4/c66ma5PG9eRjE342lIbF6SUnTJi26C3J28Fv2TVY2rOyKB9YGbSA5ogwevgmxc4j4aVjrEK6Yg== dependencies: execa "^5.0.0" + jest-util "^29.6.3" p-limit "^3.1.0" -jest-circus@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.6.2.tgz#1e6ffca60151ac66cad63fce34f443f6b5bb4258" - integrity sha512-G9mN+KOYIUe2sB9kpJkO9Bk18J4dTDArNFPwoZ7WKHKel55eKIS/u2bLthxgojwlf9NLCVQfgzM/WsOVvoC6Fw== +jest-circus@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.6.3.tgz#c5ac37758bb9e78fd78ebd655ed1d28b220d6fd3" + integrity sha512-p0R5YqZEMnOpHqHLWRSjm2z/0p6RNsrNE/GRRT3eli8QGOAozj6Ys/3Tv+Ej+IfltJoSPwcQ6/hOCRkNlxLLCw== dependencies: - "@jest/environment" "^29.6.2" - "@jest/expect" "^29.6.2" - "@jest/test-result" "^29.6.2" - "@jest/types" "^29.6.1" + "@jest/environment" "^29.6.3" + "@jest/expect" "^29.6.3" + "@jest/test-result" "^29.6.3" + "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^1.0.0" is-generator-fn "^2.0.0" - jest-each "^29.6.2" - jest-matcher-utils "^29.6.2" - jest-message-util "^29.6.2" - jest-runtime "^29.6.2" - jest-snapshot "^29.6.2" - jest-util "^29.6.2" + jest-each "^29.6.3" + jest-matcher-utils "^29.6.3" + jest-message-util "^29.6.3" + jest-runtime "^29.6.3" + jest-snapshot "^29.6.3" + jest-util "^29.6.3" p-limit "^3.1.0" - pretty-format "^29.6.2" + pretty-format "^29.6.3" pure-rand "^6.0.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.6.2.tgz#edb381763398d1a292cd1b636a98bfa5644b8fda" - integrity sha512-TT6O247v6dCEX2UGHGyflMpxhnrL0DNqP2fRTKYm3nJJpCTfXX3GCMQPGFjXDoj0i5/Blp3jriKXFgdfmbYB6Q== +jest-cli@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.6.3.tgz#1e6520106e9d7443a481ebe07ffed46e1568a51f" + integrity sha512-KuPdXUPXQIf0t6DvmG8MV4QyhcjR1a6ruKl3YL7aGn/AQ8JkROwFkWzEpDIpt11Qy188dHbRm8WjwMsV/4nmnQ== dependencies: - "@jest/core" "^29.6.2" - "@jest/test-result" "^29.6.2" - "@jest/types" "^29.6.1" + "@jest/core" "^29.6.3" + "@jest/test-result" "^29.6.3" + "@jest/types" "^29.6.3" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.6.2" - jest-util "^29.6.2" - jest-validate "^29.6.2" + jest-config "^29.6.3" + jest-util "^29.6.3" + jest-validate "^29.6.3" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.6.2.tgz#c68723f06b31ca5e63030686e604727d406cd7c3" - integrity sha512-VxwFOC8gkiJbuodG9CPtMRjBUNZEHxwfQXmIudSTzFWxaci3Qub1ddTRbFNQlD/zUeaifLndh/eDccFX4wCMQw== +jest-config@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.6.3.tgz#2d1490005a28291806022f7f95ec3debf55eaaf7" + integrity sha512-nb9bOq2aEqogbyL4F9mLkAeQGAgNt7Uz6U59YtQDIxFPiL7Ejgq0YIrp78oyEHD6H4CIV/k7mFrK7eFDzUJ69w== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.6.2" - "@jest/types" "^29.6.1" - babel-jest "^29.6.2" + "@jest/test-sequencer" "^29.6.3" + "@jest/types" "^29.6.3" + babel-jest "^29.6.3" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^29.6.2" - jest-environment-node "^29.6.2" - jest-get-type "^29.4.3" - jest-regex-util "^29.4.3" - jest-resolve "^29.6.2" - jest-runner "^29.6.2" - jest-util "^29.6.2" - jest-validate "^29.6.2" + jest-circus "^29.6.3" + jest-environment-node "^29.6.3" + jest-get-type "^29.6.3" + jest-regex-util "^29.6.3" + jest-resolve "^29.6.3" + jest-runner "^29.6.3" + jest-util "^29.6.3" + jest-validate "^29.6.3" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^29.6.2" + pretty-format "^29.6.3" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.6.2.tgz#c36001e5543e82a0805051d3ceac32e6825c1c46" - integrity sha512-t+ST7CB9GX5F2xKwhwCf0TAR17uNDiaPTZnVymP9lw0lssa9vG+AFyDZoeIHStU3WowFFwT+ky+er0WVl2yGhA== +jest-diff@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.6.3.tgz#365c6b037ea8e67d2f2af68bc018fc18d44311f0" + integrity sha512-3sw+AdWnwH9sSNohMRKA7JiYUJSRr/WS6+sEFfBuhxU5V5GlEVKfvUn8JuMHE0wqKowemR1C2aHy8VtXbaV8dQ== dependencies: chalk "^4.0.0" - diff-sequences "^29.4.3" - jest-get-type "^29.4.3" - pretty-format "^29.6.2" + diff-sequences "^29.6.3" + jest-get-type "^29.6.3" + pretty-format "^29.6.3" -jest-docblock@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.4.3.tgz#90505aa89514a1c7dceeac1123df79e414636ea8" - integrity sha512-fzdTftThczeSD9nZ3fzA/4KkHtnmllawWrXO69vtI+L9WjEIuXWs4AmyME7lN5hU7dB0sHhuPfcKofRsUb/2Fg== +jest-docblock@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.6.3.tgz#293dca5188846c9f7c0c2b1bb33e5b11f21645f2" + integrity sha512-2+H+GOTQBEm2+qFSQ7Ma+BvyV+waiIFxmZF5LdpBsAEjWX8QYjSCa4FrkIYtbfXUJJJnFCYrOtt6TZ+IAiTjBQ== dependencies: detect-newline "^3.0.0" -jest-each@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.6.2.tgz#c9e4b340bcbe838c73adf46b76817b15712d02ce" - integrity sha512-MsrsqA0Ia99cIpABBc3izS1ZYoYfhIy0NNWqPSE0YXbQjwchyt6B1HD2khzyPe1WiJA7hbxXy77ZoUQxn8UlSw== +jest-each@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.6.3.tgz#1956f14f5f0cb8ae0b2e7cabc10bb03ec817c142" + integrity sha512-KoXfJ42k8cqbkfshW7sSHcdfnv5agDdHCPA87ZBdmHP+zJstTJc0ttQaJ/x7zK6noAL76hOuTIJ6ZkQRS5dcyg== dependencies: - "@jest/types" "^29.6.1" + "@jest/types" "^29.6.3" chalk "^4.0.0" - jest-get-type "^29.4.3" - jest-util "^29.6.2" - pretty-format "^29.6.2" - -jest-environment-node@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.6.2.tgz#a9ea2cabff39b08eca14ccb32c8ceb924c8bb1ad" - integrity sha512-YGdFeZ3T9a+/612c5mTQIllvWkddPbYcN2v95ZH24oWMbGA4GGS2XdIF92QMhUhvrjjuQWYgUGW2zawOyH63MQ== - dependencies: - "@jest/environment" "^29.6.2" - "@jest/fake-timers" "^29.6.2" - "@jest/types" "^29.6.1" + jest-get-type "^29.6.3" + jest-util "^29.6.3" + pretty-format "^29.6.3" + +jest-environment-node@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.6.3.tgz#72217a00db2c26755406241c70ad73c334917e28" + integrity sha512-PKl7upfPJXMYbWpD+60o4HP86KvFO2c9dZ+Zr6wUzsG5xcPx/65o3ArNgHW5M0RFvLYdW4/aieR4JSooD0a2ew== + dependencies: + "@jest/environment" "^29.6.3" + "@jest/fake-timers" "^29.6.3" + "@jest/types" "^29.6.3" "@types/node" "*" - jest-mock "^29.6.2" - jest-util "^29.6.2" + jest-mock "^29.6.3" + jest-util "^29.6.3" -jest-get-type@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.4.3.tgz#1ab7a5207c995161100b5187159ca82dd48b3dd5" - integrity sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg== +jest-get-type@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.6.3.tgz#36f499fdcea197c1045a127319c0481723908fd1" + integrity sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw== -jest-haste-map@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.6.2.tgz#298c25ea5255cfad8b723179d4295cf3a50a70d1" - integrity sha512-+51XleTDAAysvU8rT6AnS1ZJ+WHVNqhj1k6nTvN2PYP+HjU3kqlaKQ1Lnw3NYW3bm2r8vq82X0Z1nDDHZMzHVA== +jest-haste-map@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.6.3.tgz#a53ac35a137fd32d932039aab29d02a9dab30689" + integrity sha512-GecR5YavfjkhOytEFHAeI6aWWG3f/cOKNB1YJvj/B76xAmeVjy4zJUYobGF030cRmKaO1FBw3V8CZZ6KVh9ZSw== dependencies: - "@jest/types" "^29.6.1" + "@jest/types" "^29.6.3" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" - jest-regex-util "^29.4.3" - jest-util "^29.6.2" - jest-worker "^29.6.2" + jest-regex-util "^29.6.3" + jest-util "^29.6.3" + jest-worker "^29.6.3" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.6.2.tgz#e2b307fee78cab091c37858a98c7e1d73cdf5b38" - integrity sha512-aNqYhfp5uYEO3tdWMb2bfWv6f0b4I0LOxVRpnRLAeque2uqOVVMLh6khnTcE2qJ5wAKop0HcreM1btoysD6bPQ== +jest-leak-detector@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.6.3.tgz#b9661bc3aec8874e59aff361fa0c6d7cd507ea01" + integrity sha512-0kfbESIHXYdhAdpLsW7xdwmYhLf1BRu4AA118/OxFm0Ho1b2RcTmO4oF6aAMaxpxdxnJ3zve2rgwzNBD4Zbm7Q== dependencies: - jest-get-type "^29.4.3" - pretty-format "^29.6.2" + jest-get-type "^29.6.3" + pretty-format "^29.6.3" -jest-matcher-utils@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.6.2.tgz#39de0be2baca7a64eacb27291f0bd834fea3a535" - integrity sha512-4LiAk3hSSobtomeIAzFTe+N8kL6z0JtF3n6I4fg29iIW7tt99R7ZcIFW34QkX+DuVrf+CUe6wuVOpm7ZKFJzZQ== +jest-matcher-utils@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.6.3.tgz#a7574092b635d96a38fa0a22d015fb596b9c2efc" + integrity sha512-6ZrMYINZdwduSt5Xu18/n49O1IgXdjsfG7NEZaQws9k69eTKWKcVbJBw/MZsjOZe2sSyJFmuzh8042XWwl54Zg== dependencies: chalk "^4.0.0" - jest-diff "^29.6.2" - jest-get-type "^29.4.3" - pretty-format "^29.6.2" + jest-diff "^29.6.3" + jest-get-type "^29.6.3" + pretty-format "^29.6.3" -jest-message-util@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.6.2.tgz#af7adc2209c552f3f5ae31e77cf0a261f23dc2bb" - integrity sha512-vnIGYEjoPSuRqV8W9t+Wow95SDp6KPX2Uf7EoeG9G99J2OVh7OSwpS4B6J0NfpEIpfkBNHlBZpA2rblEuEFhZQ== +jest-message-util@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.6.3.tgz#bce16050d86801b165f20cfde34dc01d3cf85fbf" + integrity sha512-FtzaEEHzjDpQp51HX4UMkPZjy46ati4T5pEMyM6Ik48ztu4T9LQplZ6OsimHx7EuM9dfEh5HJa6D3trEftu3dA== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.6.1" + "@jest/types" "^29.6.3" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^29.6.2" + pretty-format "^29.6.3" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.6.2.tgz#ef9c9b4d38c34a2ad61010a021866dad41ce5e00" - integrity sha512-hoSv3lb3byzdKfwqCuT6uTscan471GUECqgNYykg6ob0yiAw3zYc7OrPnI9Qv8Wwoa4lC7AZ9hyS4AiIx5U2zg== +jest-mock@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.6.3.tgz#433f3fd528c8ec5a76860177484940628bdf5e0a" + integrity sha512-Z7Gs/mOyTSR4yPsaZ72a/MtuK6RnC3JYqWONe48oLaoEcYwEDxqvbXz85G4SJrm2Z5Ar9zp6MiHF4AlFlRM4Pg== dependencies: - "@jest/types" "^29.6.1" + "@jest/types" "^29.6.3" "@types/node" "*" - jest-util "^29.6.2" + jest-util "^29.6.3" jest-pnp-resolver@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz#930b1546164d4ad5937d5540e711d4d38d4cad2e" integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== -jest-regex-util@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.4.3.tgz#a42616141e0cae052cfa32c169945d00c0aa0bb8" - integrity sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg== +jest-regex-util@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.6.3.tgz#4a556d9c776af68e1c5f48194f4d0327d24e8a52" + integrity sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg== -jest-resolve-dependencies@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.2.tgz#36435269b6672c256bcc85fb384872c134cc4cf2" - integrity sha512-LGqjDWxg2fuQQm7ypDxduLu/m4+4Lb4gczc13v51VMZbVP5tSBILqVx8qfWcsdP8f0G7aIqByIALDB0R93yL+w== +jest-resolve-dependencies@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.3.tgz#fc58ac08f9ed992b10d5cfb0bbb1d89b98508ff3" + integrity sha512-iah5nhSPTwtUV7yzpTc9xGg8gP3Ch2VNsuFMsKoCkNCrQSbFtx5KRPemmPJ32AUhTSDqJXB6djPN6zAaUGV53g== dependencies: - jest-regex-util "^29.4.3" - jest-snapshot "^29.6.2" + jest-regex-util "^29.6.3" + jest-snapshot "^29.6.3" -jest-resolve@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.6.2.tgz#f18405fe4b50159b7b6d85e81f6a524d22afb838" - integrity sha512-G/iQUvZWI5e3SMFssc4ug4dH0aZiZpsDq9o1PtXTV1210Ztyb2+w+ZgQkB3iOiC5SmAEzJBOHWz6Hvrd+QnNPw== +jest-resolve@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.6.3.tgz#e3114e1514973c8f1607387c3042f4d2926f2d60" + integrity sha512-WMXwxhvzDeA/J+9jz1i8ZKGmbw/n+s988EiUvRI4egM+eTn31Hb5v10Re3slG3/qxntkBt2/6GkQVDGu6Bwyhw== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^29.6.2" + jest-haste-map "^29.6.3" jest-pnp-resolver "^1.2.2" - jest-util "^29.6.2" - jest-validate "^29.6.2" + jest-util "^29.6.3" + jest-validate "^29.6.3" resolve "^1.20.0" resolve.exports "^2.0.0" slash "^3.0.0" -jest-runner@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.6.2.tgz#89e8e32a8fef24781a7c4c49cd1cb6358ac7fc01" - integrity sha512-wXOT/a0EspYgfMiYHxwGLPCZfC0c38MivAlb2lMEAlwHINKemrttu1uSbcGbfDV31sFaPWnWJPmb2qXM8pqZ4w== +jest-runner@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.6.3.tgz#162b1a549c4728265e716d75533b65b4c77e6b22" + integrity sha512-E4zsMhQnjhirFPhDTJgoLMWUrVCDij/KGzWlbslDHGuO8Hl2pVUfOiygMzVZtZq+BzmlqwEr7LYmW+WFLlmX8w== dependencies: - "@jest/console" "^29.6.2" - "@jest/environment" "^29.6.2" - "@jest/test-result" "^29.6.2" - "@jest/transform" "^29.6.2" - "@jest/types" "^29.6.1" + "@jest/console" "^29.6.3" + "@jest/environment" "^29.6.3" + "@jest/test-result" "^29.6.3" + "@jest/transform" "^29.6.3" + "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" emittery "^0.13.1" graceful-fs "^4.2.9" - jest-docblock "^29.4.3" - jest-environment-node "^29.6.2" - jest-haste-map "^29.6.2" - jest-leak-detector "^29.6.2" - jest-message-util "^29.6.2" - jest-resolve "^29.6.2" - jest-runtime "^29.6.2" - jest-util "^29.6.2" - jest-watcher "^29.6.2" - jest-worker "^29.6.2" + jest-docblock "^29.6.3" + jest-environment-node "^29.6.3" + jest-haste-map "^29.6.3" + jest-leak-detector "^29.6.3" + jest-message-util "^29.6.3" + jest-resolve "^29.6.3" + jest-runtime "^29.6.3" + jest-util "^29.6.3" + jest-watcher "^29.6.3" + jest-worker "^29.6.3" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.6.2.tgz#692f25e387f982e89ab83270e684a9786248e545" - integrity sha512-2X9dqK768KufGJyIeLmIzToDmsN0m7Iek8QNxRSI/2+iPFYHF0jTwlO3ftn7gdKd98G/VQw9XJCk77rbTGZnJg== - dependencies: - "@jest/environment" "^29.6.2" - "@jest/fake-timers" "^29.6.2" - "@jest/globals" "^29.6.2" - "@jest/source-map" "^29.6.0" - "@jest/test-result" "^29.6.2" - "@jest/transform" "^29.6.2" - "@jest/types" "^29.6.1" +jest-runtime@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.6.3.tgz#8bfa29447808419a7b5bed13beb0447a90344c65" + integrity sha512-VM0Z3a9xaqizGpEKwCOIhImkrINYzxgwk8oQAvrmAiXX8LNrJrRjyva30RkuRY0ETAotHLlUcd2moviCA1hgsQ== + dependencies: + "@jest/environment" "^29.6.3" + "@jest/fake-timers" "^29.6.3" + "@jest/globals" "^29.6.3" + "@jest/source-map" "^29.6.3" + "@jest/test-result" "^29.6.3" + "@jest/transform" "^29.6.3" + "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^29.6.2" - jest-message-util "^29.6.2" - jest-mock "^29.6.2" - jest-regex-util "^29.4.3" - jest-resolve "^29.6.2" - jest-snapshot "^29.6.2" - jest-util "^29.6.2" + jest-haste-map "^29.6.3" + jest-message-util "^29.6.3" + jest-mock "^29.6.3" + jest-regex-util "^29.6.3" + jest-resolve "^29.6.3" + jest-snapshot "^29.6.3" + jest-util "^29.6.3" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.6.2.tgz#9b431b561a83f2bdfe041e1cab8a6becdb01af9c" - integrity sha512-1OdjqvqmRdGNvWXr/YZHuyhh5DeaLp1p/F8Tht/MrMw4Kr1Uu/j4lRG+iKl1DAqUJDWxtQBMk41Lnf/JETYBRA== +jest-snapshot@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.6.3.tgz#2435b50881f7bffdc1a66e66c64a2602c8086281" + integrity sha512-66Iu7H1ojiveQMGFnKecHIZPPPBjZwfQEnF6wxqpxGf57sV3YSUtAb5/sTKM5TPa3OndyxZp1wxHFbmgVhc53w== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" "@babel/plugin-syntax-jsx" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.6.2" - "@jest/transform" "^29.6.2" - "@jest/types" "^29.6.1" + "@jest/expect-utils" "^29.6.3" + "@jest/transform" "^29.6.3" + "@jest/types" "^29.6.3" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.6.2" + expect "^29.6.3" graceful-fs "^4.2.9" - jest-diff "^29.6.2" - jest-get-type "^29.4.3" - jest-matcher-utils "^29.6.2" - jest-message-util "^29.6.2" - jest-util "^29.6.2" + jest-diff "^29.6.3" + jest-get-type "^29.6.3" + jest-matcher-utils "^29.6.3" + jest-message-util "^29.6.3" + jest-util "^29.6.3" natural-compare "^1.4.0" - pretty-format "^29.6.2" + pretty-format "^29.6.3" semver "^7.5.3" -jest-util@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.6.2.tgz#8a052df8fff2eebe446769fd88814521a517664d" - integrity sha512-3eX1qb6L88lJNCFlEADKOkjpXJQyZRiavX1INZ4tRnrBVr2COd3RgcTLyUiEXMNBlDU/cgYq6taUS0fExrWW4w== +jest-util@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.6.3.tgz#e15c3eac8716440d1ed076f09bc63ace1aebca63" + integrity sha512-QUjna/xSy4B32fzcKTSz1w7YYzgiHrjjJjevdRf61HYk998R5vVMMNmrHESYZVDS5DSWs+1srPLPKxXPkeSDOA== dependencies: - "@jest/types" "^29.6.1" + "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.6.2.tgz#25d972af35b2415b83b1373baf1a47bb266c1082" - integrity sha512-vGz0yMN5fUFRRbpJDPwxMpgSXW1LDKROHfBopAvDcmD6s+B/s8WJrwi+4bfH4SdInBA5C3P3BI19dBtKzx1Arg== +jest-validate@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.6.3.tgz#a75fca774cfb1c5758c70d035d30a1f9c2784b4d" + integrity sha512-e7KWZcAIX+2W1o3cHfnqpGajdCs1jSM3DkXjGeLSNmCazv1EeI1ggTeK5wdZhF+7N+g44JI2Od3veojoaumlfg== dependencies: - "@jest/types" "^29.6.1" + "@jest/types" "^29.6.3" camelcase "^6.2.0" chalk "^4.0.0" - jest-get-type "^29.4.3" + jest-get-type "^29.6.3" leven "^3.1.0" - pretty-format "^29.6.2" + pretty-format "^29.6.3" -jest-watcher@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.6.2.tgz#77c224674f0620d9f6643c4cfca186d8893ca088" - integrity sha512-GZitlqkMkhkefjfN/p3SJjrDaxPflqxEAv3/ik10OirZqJGYH5rPiIsgVcfof0Tdqg3shQGdEIxDBx+B4tuLzA== +jest-watcher@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.6.3.tgz#f5089852fc5f57ba1d956ec02d80cf2f6f34156d" + integrity sha512-NgpFjZ2U2MKusjidbi4Oiu7tfs+nrgdIxIEVROvH1cFmOei9Uj25lwkMsakqLnH/s0nEcvxO1ck77FiRlcnpZg== dependencies: - "@jest/test-result" "^29.6.2" - "@jest/types" "^29.6.1" + "@jest/test-result" "^29.6.3" + "@jest/types" "^29.6.3" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.13.1" - jest-util "^29.6.2" + jest-util "^29.6.3" string-length "^4.0.1" -jest-worker@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.6.2.tgz#682fbc4b6856ad0aa122a5403c6d048b83f3fb44" - integrity sha512-l3ccBOabTdkng8I/ORCkADz4eSMKejTYv1vB/Z83UiubqhC1oQ5Li6dWCyqOIvSifGjUBxuvxvlm6KGK2DtuAQ== +jest-worker@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.6.3.tgz#7b1a47bbb6559f3c0882d16595938590e63915d5" + integrity sha512-wacANXecZ/GbQakpf2CClrqrlwsYYDSXFd4fIGdL+dXpM2GWoJ+6bhQ7vR3TKi3+gkSfBkjy1/khH/WrYS4Q6g== dependencies: "@types/node" "*" - jest-util "^29.6.2" + jest-util "^29.6.3" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^29.5.0: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.6.2.tgz#3bd55b9fd46a161b2edbdf5f1d1bd0d1eab76c42" - integrity sha512-8eQg2mqFbaP7CwfsTpCxQ+sHzw1WuNWL5UUvjnWP4hx2riGz9fPSzYOaU5q8/GqWn1TfgZIVTqYJygbGbWAANg== + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.6.3.tgz#118cf081d440d31b21989f61bfcd8b7797ca6a01" + integrity sha512-alueLuoPCDNHFcFGmgETR4KpQ+0ff3qVaiJwxQM4B5sC0CvXcgg4PEi7xrDkxuItDmdz/FVc7SSit4KEu8GRvw== dependencies: - "@jest/core" "^29.6.2" - "@jest/types" "^29.6.1" + "@jest/core" "^29.6.3" + "@jest/types" "^29.6.3" import-local "^3.0.2" - jest-cli "^29.6.2" + jest-cli "^29.6.3" js-tokens@^4.0.0: version "4.0.0" @@ -2273,12 +2284,12 @@ prettier@^3.0.0: resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.2.tgz#78fcecd6d870551aa5547437cdae39d4701dca5b" integrity sha512-o2YR9qtniXvwEZlOKbveKfDQVyqxbEIWn48Z8m3ZJjBjcCmUy3xZGIv+7AkaeuaTr6yPXJjwv07ZWlsWbEy1rQ== -pretty-format@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.6.2.tgz#3d5829261a8a4d89d8b9769064b29c50ed486a47" - integrity sha512-1q0oC8eRveTg5nnBEWMXAU2qpv65Gnuf2eCQzSjxpWFkPaPARwqZZDGuNE0zPAZfTCHzIk3A8dIjwlQKKLphyg== +pretty-format@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.6.3.tgz#d432bb4f1ca6f9463410c3fb25a0ba88e594ace7" + integrity sha512-ZsBgjVhFAj5KeK+nHfF1305/By3lechHQSMWCTl8iHSbfOm2TN5nHEtFc/+W7fAyUeCs2n5iow72gld4gW0xDw== dependencies: - "@jest/schemas" "^29.6.0" + "@jest/schemas" "^29.6.3" ansi-styles "^5.0.0" react-is "^18.0.0" @@ -2390,7 +2401,7 @@ semver@^6.0.0, semver@^6.3.0, semver@^6.3.1: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.5.3: +semver@^7.5.3, semver@^7.5.4: version "7.5.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== From 3b77f9815e829926ba777b4b638fd23fdb0c82ed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Aug 2023 12:38:08 +0000 Subject: [PATCH 737/785] Bump jest from 29.6.3 to 29.6.4 Bumps [jest](https://github.com/jestjs/jest/tree/HEAD/packages/jest) from 29.6.3 to 29.6.4. - [Release notes](https://github.com/jestjs/jest/releases) - [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/jestjs/jest/commits/v29.6.4/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 372 +++++++++++++++++++++++++++--------------------------- 1 file changed, 186 insertions(+), 186 deletions(-) diff --git a/yarn.lock b/yarn.lock index 750fe14c..160f83aa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -368,10 +368,10 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^29.6.3": - version "29.6.3" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.6.3.tgz#55ad945087c27e380d6d9fcbb85181ed802543f3" - integrity sha512-ukZbHAdDH4ktZIOKvWs1juAXhiVAdvCyM8zv4S/7Ii3vJSDvMW5k+wOVGMQmHLHUFw3Ko63ZQNy7NI6PSlsD5w== +"@jest/console@^29.6.4": + version "29.6.4" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.6.4.tgz#a7e2d84516301f986bba0dd55af9d5fe37f46527" + integrity sha512-wNK6gC0Ha9QeEPSkeJedQuTQqxZYnDPuDcDhVuVatRvMkL4D0VTvFVZj+Yuh6caG2aOfzkUZ36KtCmLNtR02hw== dependencies: "@jest/types" "^29.6.3" "@types/node" "*" @@ -380,15 +380,15 @@ jest-util "^29.6.3" slash "^3.0.0" -"@jest/core@^29.6.3": - version "29.6.3" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.6.3.tgz#bccee53680762e1bdef2a0038f123cc8d7ba4ab8" - integrity sha512-skV1XrfNxfagmjRUrk2FyN5/2YwIzdWVVBa/orUfbLvQUANXxERq2pTvY0I+FinWHjDKB2HRmpveUiph4X0TJw== +"@jest/core@^29.6.4": + version "29.6.4" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.6.4.tgz#265ebee05ec1ff3567757e7a327155c8d6bdb126" + integrity sha512-U/vq5ccNTSVgYH7mHnodHmCffGWHJnz/E1BEWlLuK5pM4FZmGfBn/nrJGLjUsSmyx3otCeqc1T31F4y08AMDLg== dependencies: - "@jest/console" "^29.6.3" - "@jest/reporters" "^29.6.3" - "@jest/test-result" "^29.6.3" - "@jest/transform" "^29.6.3" + "@jest/console" "^29.6.4" + "@jest/reporters" "^29.6.4" + "@jest/test-result" "^29.6.4" + "@jest/transform" "^29.6.4" "@jest/types" "^29.6.3" "@types/node" "*" ansi-escapes "^4.2.1" @@ -397,52 +397,52 @@ exit "^0.1.2" graceful-fs "^4.2.9" jest-changed-files "^29.6.3" - jest-config "^29.6.3" - jest-haste-map "^29.6.3" + jest-config "^29.6.4" + jest-haste-map "^29.6.4" jest-message-util "^29.6.3" jest-regex-util "^29.6.3" - jest-resolve "^29.6.3" - jest-resolve-dependencies "^29.6.3" - jest-runner "^29.6.3" - jest-runtime "^29.6.3" - jest-snapshot "^29.6.3" + jest-resolve "^29.6.4" + jest-resolve-dependencies "^29.6.4" + jest-runner "^29.6.4" + jest-runtime "^29.6.4" + jest-snapshot "^29.6.4" jest-util "^29.6.3" jest-validate "^29.6.3" - jest-watcher "^29.6.3" + jest-watcher "^29.6.4" micromatch "^4.0.4" pretty-format "^29.6.3" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.6.3": - version "29.6.3" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.6.3.tgz#bb02535c729393a0345b8d2c5eef94d34f7b35a3" - integrity sha512-u/u3cCztYCfgBiGHsamqP5x+XvucftOGPbf5RJQxfpeC1y4AL8pCjKvPDA3oCmdhZYPgk5AE0VOD/flweR69WA== +"@jest/environment@^29.6.4": + version "29.6.4" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.6.4.tgz#78ec2c9f8c8829a37616934ff4fea0c028c79f4f" + integrity sha512-sQ0SULEjA1XUTHmkBRl7A1dyITM9yb1yb3ZNKPX3KlTd6IG7mWUe3e2yfExtC2Zz1Q+mMckOLHmL/qLiuQJrBQ== dependencies: - "@jest/fake-timers" "^29.6.3" + "@jest/fake-timers" "^29.6.4" "@jest/types" "^29.6.3" "@types/node" "*" jest-mock "^29.6.3" -"@jest/expect-utils@^29.6.3": - version "29.6.3" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.6.3.tgz#5ef1a9689fdaa348da837c8be8d1219f56940ea3" - integrity sha512-nvOEW4YoqRKD9HBJ9OJ6przvIvP9qilp5nAn1462P5ZlL/MM9SgPEZFyjTGPfs7QkocdUsJa6KjHhyRn4ueItA== +"@jest/expect-utils@^29.6.4": + version "29.6.4" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.6.4.tgz#17c7dfe6cec106441f218b0aff4b295f98346679" + integrity sha512-FEhkJhqtvBwgSpiTrocquJCdXPsyvNKcl/n7A3u7X4pVoF4bswm11c9d4AV+kfq2Gpv/mM8x7E7DsRvH+djkrg== dependencies: jest-get-type "^29.6.3" -"@jest/expect@^29.6.3": - version "29.6.3" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.6.3.tgz#d54e1e7134982166f62653add0d4b8262dd72db9" - integrity sha512-Ic08XbI2jlg6rECy+CGwk/8NDa6VE7UmIG6++9OTPAMnQmNGY28hu69Nf629CWv6T7YMODLbONxDFKdmQeI9FA== +"@jest/expect@^29.6.4": + version "29.6.4" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.6.4.tgz#1d6ae17dc68d906776198389427ab7ce6179dba6" + integrity sha512-Warhsa7d23+3X5bLbrbYvaehcgX5TLYhI03JKoedTiI8uJU4IhqYBWF7OSSgUyz4IgLpUYPkK0AehA5/fRclAA== dependencies: - expect "^29.6.3" - jest-snapshot "^29.6.3" + expect "^29.6.4" + jest-snapshot "^29.6.4" -"@jest/fake-timers@^29.6.3": - version "29.6.3" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.6.3.tgz#7e780b05b14ad59dca68bdc188f6cf085552a0e8" - integrity sha512-pa1wmqvbj6eX0nMvOM2VDAWvJOI5A/Mk3l8O7n7EsAh71sMZblaKO9iT4GjIj0LwwK3CP/Jp1ypEV0x3m89RvA== +"@jest/fake-timers@^29.6.4": + version "29.6.4" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.6.4.tgz#45a27f093c43d5d989362a3e7a8c70c83188b4f6" + integrity sha512-6UkCwzoBK60edXIIWb0/KWkuj7R7Qq91vVInOe3De6DSpaEiqjKcJw4F7XUet24Wupahj9J6PlR09JqJ5ySDHw== dependencies: "@jest/types" "^29.6.3" "@sinonjs/fake-timers" "^10.0.2" @@ -451,25 +451,25 @@ jest-mock "^29.6.3" jest-util "^29.6.3" -"@jest/globals@^29.6.3": - version "29.6.3" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.6.3.tgz#fe9e302bc20683ba8feb683b8804e38a9913b783" - integrity sha512-RB+uI+CZMHntzlnOPlll5x/jgRff3LEPl/td/jzMXiIgR0iIhKq9qm1HLU+EC52NuoVy/1swit/sDGjVn4bc6A== +"@jest/globals@^29.6.4": + version "29.6.4" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.6.4.tgz#4f04f58731b062b44ef23036b79bdb31f40c7f63" + integrity sha512-wVIn5bdtjlChhXAzVXavcY/3PEjf4VqM174BM3eGL5kMxLiZD5CLnbmkEyA1Dwh9q8XjP6E8RwjBsY/iCWrWsA== dependencies: - "@jest/environment" "^29.6.3" - "@jest/expect" "^29.6.3" + "@jest/environment" "^29.6.4" + "@jest/expect" "^29.6.4" "@jest/types" "^29.6.3" jest-mock "^29.6.3" -"@jest/reporters@^29.6.3": - version "29.6.3" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.6.3.tgz#e5071915d74f43e0f49982fa518ca3283a9f4c5a" - integrity sha512-kGz59zMi0GkVjD2CJeYWG9k6cvj7eBqt9aDAqo2rcCLRTYlvQ62Gu/n+tOmJMBHGjzeijjuCENjzTyYBgrtLUw== +"@jest/reporters@^29.6.4": + version "29.6.4" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.6.4.tgz#9d6350c8a2761ece91f7946e97ab0dabc06deab7" + integrity sha512-sxUjWxm7QdchdrD3NfWKrL8FBsortZeibSJv4XLjESOOjSUOkjQcb0ZHJwfhEGIvBvTluTzfG2yZWZhkrXJu8g== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.6.3" - "@jest/test-result" "^29.6.3" - "@jest/transform" "^29.6.3" + "@jest/console" "^29.6.4" + "@jest/test-result" "^29.6.4" + "@jest/transform" "^29.6.4" "@jest/types" "^29.6.3" "@jridgewell/trace-mapping" "^0.3.18" "@types/node" "*" @@ -485,7 +485,7 @@ istanbul-reports "^3.1.3" jest-message-util "^29.6.3" jest-util "^29.6.3" - jest-worker "^29.6.3" + jest-worker "^29.6.4" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" @@ -507,30 +507,30 @@ callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^29.6.3": - version "29.6.3" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.6.3.tgz#1da4c6749c16a71c108644624d9cd0d17206aa2b" - integrity sha512-k7ZZaNvOSMBHPZYiy0kuiaFoyansR5QnTwDux1EjK3kD5iWpRVyJIJ0RAIV39SThafchuW59vra7F8mdy5Hfgw== +"@jest/test-result@^29.6.4": + version "29.6.4" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.6.4.tgz#adf5c79f6e1fb7405ad13d67d9e2b6ff54b54c6b" + integrity sha512-uQ1C0AUEN90/dsyEirgMLlouROgSY+Wc/JanVVk0OiUKa5UFh7sJpMEM3aoUBAz2BRNvUJ8j3d294WFuRxSyOQ== dependencies: - "@jest/console" "^29.6.3" + "@jest/console" "^29.6.4" "@jest/types" "^29.6.3" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.6.3": - version "29.6.3" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.6.3.tgz#e59f422bc3786d79fac504c16979a5f1b999a932" - integrity sha512-/SmijaAU2TY9ComFGIYa6Z+fmKqQMnqs2Nmwb0P/Z/tROdZ7M0iruES1EaaU9PBf8o9uED5xzaJ3YPFEIcDgAg== +"@jest/test-sequencer@^29.6.4": + version "29.6.4" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.6.4.tgz#86aef66aaa22b181307ed06c26c82802fb836d7b" + integrity sha512-E84M6LbpcRq3fT4ckfKs9ryVanwkaIB0Ws9bw3/yP4seRLg/VaCZ/LgW0MCq5wwk4/iP/qnilD41aj2fsw2RMg== dependencies: - "@jest/test-result" "^29.6.3" + "@jest/test-result" "^29.6.4" graceful-fs "^4.2.9" - jest-haste-map "^29.6.3" + jest-haste-map "^29.6.4" slash "^3.0.0" -"@jest/transform@^29.6.3": - version "29.6.3" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.6.3.tgz#e8e376f56fffe827b529bf03a9881e58d152c14b" - integrity sha512-dPIc3DsvMZ/S8ut4L2ViCj265mKO0owB0wfzBv2oGzL9pQ+iRvJewHqLBmsGb7XFb5UotWIEtvY5A/lnylaIoQ== +"@jest/transform@^29.6.4": + version "29.6.4" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.6.4.tgz#a6bc799ef597c5d85b2e65a11fd96b6b239bab5a" + integrity sha512-8thgRSiXUqtr/pPGY/OsyHuMjGyhVnWrFAwoxmIemlBuiMyU1WFs0tXoNxzcr4A4uErs/ABre76SGmrr5ab/AA== dependencies: "@babel/core" "^7.11.6" "@jest/types" "^29.6.3" @@ -540,7 +540,7 @@ convert-source-map "^2.0.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.6.3" + jest-haste-map "^29.6.4" jest-regex-util "^29.6.3" jest-util "^29.6.3" micromatch "^4.0.4" @@ -809,12 +809,12 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.6.3.tgz#e62f6c38f3ec8c147244168ee18ef0b919f10348" - integrity sha512-1Ne93zZZEy5XmTa4Q+W5+zxBrDpExX8E3iy+xJJ+24ewlfo/T3qHfQJCzi/MMVFmBQDNxtRR/Gfd2dwb/0yrQw== +babel-jest@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.6.4.tgz#98dbc45d1c93319c82a8ab4a478b670655dd2585" + integrity sha512-meLj23UlSLddj6PC+YTOFRgDAtjnZom8w/ACsrx0gtPtv5cJZk0A5Unk5bV4wixD7XaPCN1fQvpww8czkZURmw== dependencies: - "@jest/transform" "^29.6.3" + "@jest/transform" "^29.6.4" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" babel-preset-jest "^29.6.3" @@ -1260,14 +1260,14 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== -expect@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.6.3.tgz#e74b57c35a81fd93ece6b570e371309c53dc4f54" - integrity sha512-x1vY4LlEMWUYVZQrFi4ZANXFwqYbJ/JNQspLVvzhW2BNY28aNcXMQH6imBbt+RBf5sVRTodYHXtSP/TLEU0Dxw== +expect@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.6.4.tgz#a6e6f66d4613717859b2fe3da98a739437b6f4b8" + integrity sha512-F2W2UyQ8XYyftHT57dtfg8Ue3X5qLgm2sSug0ivvLRH/VKNRL/pDxg/TH7zVzbQB0tu80clNFy6LU7OS/VSEKA== dependencies: - "@jest/expect-utils" "^29.6.3" + "@jest/expect-utils" "^29.6.4" jest-get-type "^29.6.3" - jest-matcher-utils "^29.6.3" + jest-matcher-utils "^29.6.4" jest-message-util "^29.6.3" jest-util "^29.6.3" @@ -1618,14 +1618,14 @@ jest-changed-files@^29.6.3: jest-util "^29.6.3" p-limit "^3.1.0" -jest-circus@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.6.3.tgz#c5ac37758bb9e78fd78ebd655ed1d28b220d6fd3" - integrity sha512-p0R5YqZEMnOpHqHLWRSjm2z/0p6RNsrNE/GRRT3eli8QGOAozj6Ys/3Tv+Ej+IfltJoSPwcQ6/hOCRkNlxLLCw== +jest-circus@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.6.4.tgz#f074c8d795e0cc0f2ebf0705086b1be6a9a8722f" + integrity sha512-YXNrRyntVUgDfZbjXWBMPslX1mQ8MrSG0oM/Y06j9EYubODIyHWP8hMUbjbZ19M3M+zamqEur7O80HODwACoJw== dependencies: - "@jest/environment" "^29.6.3" - "@jest/expect" "^29.6.3" - "@jest/test-result" "^29.6.3" + "@jest/environment" "^29.6.4" + "@jest/expect" "^29.6.4" + "@jest/test-result" "^29.6.4" "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" @@ -1633,10 +1633,10 @@ jest-circus@^29.6.3: dedent "^1.0.0" is-generator-fn "^2.0.0" jest-each "^29.6.3" - jest-matcher-utils "^29.6.3" + jest-matcher-utils "^29.6.4" jest-message-util "^29.6.3" - jest-runtime "^29.6.3" - jest-snapshot "^29.6.3" + jest-runtime "^29.6.4" + jest-snapshot "^29.6.4" jest-util "^29.6.3" p-limit "^3.1.0" pretty-format "^29.6.3" @@ -1644,44 +1644,44 @@ jest-circus@^29.6.3: slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.6.3.tgz#1e6520106e9d7443a481ebe07ffed46e1568a51f" - integrity sha512-KuPdXUPXQIf0t6DvmG8MV4QyhcjR1a6ruKl3YL7aGn/AQ8JkROwFkWzEpDIpt11Qy188dHbRm8WjwMsV/4nmnQ== +jest-cli@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.6.4.tgz#ad52f2dfa1b0291de7ec7f8d7c81ac435521ede0" + integrity sha512-+uMCQ7oizMmh8ZwRfZzKIEszFY9ksjjEQnTEMTaL7fYiL3Kw4XhqT9bYh+A4DQKUb67hZn2KbtEnDuHvcgK4pQ== dependencies: - "@jest/core" "^29.6.3" - "@jest/test-result" "^29.6.3" + "@jest/core" "^29.6.4" + "@jest/test-result" "^29.6.4" "@jest/types" "^29.6.3" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.6.3" + jest-config "^29.6.4" jest-util "^29.6.3" jest-validate "^29.6.3" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.6.3.tgz#2d1490005a28291806022f7f95ec3debf55eaaf7" - integrity sha512-nb9bOq2aEqogbyL4F9mLkAeQGAgNt7Uz6U59YtQDIxFPiL7Ejgq0YIrp78oyEHD6H4CIV/k7mFrK7eFDzUJ69w== +jest-config@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.6.4.tgz#eff958ee41d4e1ee7a6106d02b74ad9fc427d79e" + integrity sha512-JWohr3i9m2cVpBumQFv2akMEnFEPVOh+9L2xIBJhJ0zOaci2ZXuKJj0tgMKQCBZAKA09H049IR4HVS/43Qb19A== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.6.3" + "@jest/test-sequencer" "^29.6.4" "@jest/types" "^29.6.3" - babel-jest "^29.6.3" + babel-jest "^29.6.4" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^29.6.3" - jest-environment-node "^29.6.3" + jest-circus "^29.6.4" + jest-environment-node "^29.6.4" jest-get-type "^29.6.3" jest-regex-util "^29.6.3" - jest-resolve "^29.6.3" - jest-runner "^29.6.3" + jest-resolve "^29.6.4" + jest-runner "^29.6.4" jest-util "^29.6.3" jest-validate "^29.6.3" micromatch "^4.0.4" @@ -1690,10 +1690,10 @@ jest-config@^29.6.3: slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.6.3.tgz#365c6b037ea8e67d2f2af68bc018fc18d44311f0" - integrity sha512-3sw+AdWnwH9sSNohMRKA7JiYUJSRr/WS6+sEFfBuhxU5V5GlEVKfvUn8JuMHE0wqKowemR1C2aHy8VtXbaV8dQ== +jest-diff@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.6.4.tgz#85aaa6c92a79ae8cd9a54ebae8d5b6d9a513314a" + integrity sha512-9F48UxR9e4XOEZvoUXEHSWY4qC4zERJaOfrbBg9JpbJOO43R1vN76REt/aMGZoY6GD5g84nnJiBIVlscegefpw== dependencies: chalk "^4.0.0" diff-sequences "^29.6.3" @@ -1718,13 +1718,13 @@ jest-each@^29.6.3: jest-util "^29.6.3" pretty-format "^29.6.3" -jest-environment-node@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.6.3.tgz#72217a00db2c26755406241c70ad73c334917e28" - integrity sha512-PKl7upfPJXMYbWpD+60o4HP86KvFO2c9dZ+Zr6wUzsG5xcPx/65o3ArNgHW5M0RFvLYdW4/aieR4JSooD0a2ew== +jest-environment-node@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.6.4.tgz#4ce311549afd815d3cafb49e60a1e4b25f06d29f" + integrity sha512-i7SbpH2dEIFGNmxGCpSc2w9cA4qVD+wfvg2ZnfQ7XVrKL0NA5uDVBIiGH8SR4F0dKEv/0qI5r+aDomDf04DpEQ== dependencies: - "@jest/environment" "^29.6.3" - "@jest/fake-timers" "^29.6.3" + "@jest/environment" "^29.6.4" + "@jest/fake-timers" "^29.6.4" "@jest/types" "^29.6.3" "@types/node" "*" jest-mock "^29.6.3" @@ -1735,10 +1735,10 @@ jest-get-type@^29.6.3: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.6.3.tgz#36f499fdcea197c1045a127319c0481723908fd1" integrity sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw== -jest-haste-map@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.6.3.tgz#a53ac35a137fd32d932039aab29d02a9dab30689" - integrity sha512-GecR5YavfjkhOytEFHAeI6aWWG3f/cOKNB1YJvj/B76xAmeVjy4zJUYobGF030cRmKaO1FBw3V8CZZ6KVh9ZSw== +jest-haste-map@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.6.4.tgz#97143ce833829157ea7025204b08f9ace609b96a" + integrity sha512-12Ad+VNTDHxKf7k+M65sviyynRoZYuL1/GTuhEVb8RYsNSNln71nANRb/faSyWvx0j+gHcivChXHIoMJrGYjog== dependencies: "@jest/types" "^29.6.3" "@types/graceful-fs" "^4.1.3" @@ -1748,7 +1748,7 @@ jest-haste-map@^29.6.3: graceful-fs "^4.2.9" jest-regex-util "^29.6.3" jest-util "^29.6.3" - jest-worker "^29.6.3" + jest-worker "^29.6.4" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: @@ -1762,13 +1762,13 @@ jest-leak-detector@^29.6.3: jest-get-type "^29.6.3" pretty-format "^29.6.3" -jest-matcher-utils@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.6.3.tgz#a7574092b635d96a38fa0a22d015fb596b9c2efc" - integrity sha512-6ZrMYINZdwduSt5Xu18/n49O1IgXdjsfG7NEZaQws9k69eTKWKcVbJBw/MZsjOZe2sSyJFmuzh8042XWwl54Zg== +jest-matcher-utils@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.6.4.tgz#327db7ababea49455df3b23e5d6109fe0c709d24" + integrity sha512-KSzwyzGvK4HcfnserYqJHYi7sZVqdREJ9DMPAKVbS98JsIAvumihaNUbjrWw0St7p9IY7A9UskCW5MYlGmBQFQ== dependencies: chalk "^4.0.0" - jest-diff "^29.6.3" + jest-diff "^29.6.4" jest-get-type "^29.6.3" pretty-format "^29.6.3" @@ -1806,22 +1806,22 @@ jest-regex-util@^29.6.3: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.6.3.tgz#4a556d9c776af68e1c5f48194f4d0327d24e8a52" integrity sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg== -jest-resolve-dependencies@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.3.tgz#fc58ac08f9ed992b10d5cfb0bbb1d89b98508ff3" - integrity sha512-iah5nhSPTwtUV7yzpTc9xGg8gP3Ch2VNsuFMsKoCkNCrQSbFtx5KRPemmPJ32AUhTSDqJXB6djPN6zAaUGV53g== +jest-resolve-dependencies@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.4.tgz#20156b33c7eacbb6bb77aeba4bed0eab4a3f8734" + integrity sha512-7+6eAmr1ZBF3vOAJVsfLj1QdqeXG+WYhidfLHBRZqGN24MFRIiKG20ItpLw2qRAsW/D2ZUUmCNf6irUr/v6KHA== dependencies: jest-regex-util "^29.6.3" - jest-snapshot "^29.6.3" + jest-snapshot "^29.6.4" -jest-resolve@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.6.3.tgz#e3114e1514973c8f1607387c3042f4d2926f2d60" - integrity sha512-WMXwxhvzDeA/J+9jz1i8ZKGmbw/n+s988EiUvRI4egM+eTn31Hb5v10Re3slG3/qxntkBt2/6GkQVDGu6Bwyhw== +jest-resolve@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.6.4.tgz#e34cb06f2178b429c38455d98d1a07572ac9faa3" + integrity sha512-fPRq+0vcxsuGlG0O3gyoqGTAxasagOxEuyoxHeyxaZbc9QNek0AmJWSkhjlMG+mTsj+8knc/mWb3fXlRNVih7Q== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^29.6.3" + jest-haste-map "^29.6.4" jest-pnp-resolver "^1.2.2" jest-util "^29.6.3" jest-validate "^29.6.3" @@ -1829,44 +1829,44 @@ jest-resolve@^29.6.3: resolve.exports "^2.0.0" slash "^3.0.0" -jest-runner@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.6.3.tgz#162b1a549c4728265e716d75533b65b4c77e6b22" - integrity sha512-E4zsMhQnjhirFPhDTJgoLMWUrVCDij/KGzWlbslDHGuO8Hl2pVUfOiygMzVZtZq+BzmlqwEr7LYmW+WFLlmX8w== +jest-runner@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.6.4.tgz#b3b8ccb85970fde0fae40c73ee11eb75adccfacf" + integrity sha512-SDaLrMmtVlQYDuG0iSPYLycG8P9jLI+fRm8AF/xPKhYDB2g6xDWjXBrR5M8gEWsK6KVFlebpZ4QsrxdyIX1Jaw== dependencies: - "@jest/console" "^29.6.3" - "@jest/environment" "^29.6.3" - "@jest/test-result" "^29.6.3" - "@jest/transform" "^29.6.3" + "@jest/console" "^29.6.4" + "@jest/environment" "^29.6.4" + "@jest/test-result" "^29.6.4" + "@jest/transform" "^29.6.4" "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" emittery "^0.13.1" graceful-fs "^4.2.9" jest-docblock "^29.6.3" - jest-environment-node "^29.6.3" - jest-haste-map "^29.6.3" + jest-environment-node "^29.6.4" + jest-haste-map "^29.6.4" jest-leak-detector "^29.6.3" jest-message-util "^29.6.3" - jest-resolve "^29.6.3" - jest-runtime "^29.6.3" + jest-resolve "^29.6.4" + jest-runtime "^29.6.4" jest-util "^29.6.3" - jest-watcher "^29.6.3" - jest-worker "^29.6.3" + jest-watcher "^29.6.4" + jest-worker "^29.6.4" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.6.3.tgz#8bfa29447808419a7b5bed13beb0447a90344c65" - integrity sha512-VM0Z3a9xaqizGpEKwCOIhImkrINYzxgwk8oQAvrmAiXX8LNrJrRjyva30RkuRY0ETAotHLlUcd2moviCA1hgsQ== +jest-runtime@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.6.4.tgz#b0bc495c9b6b12a0a7042ac34ca9bb85f8cd0ded" + integrity sha512-s/QxMBLvmwLdchKEjcLfwzP7h+jsHvNEtxGP5P+Fl1FMaJX2jMiIqe4rJw4tFprzCwuSvVUo9bn0uj4gNRXsbA== dependencies: - "@jest/environment" "^29.6.3" - "@jest/fake-timers" "^29.6.3" - "@jest/globals" "^29.6.3" + "@jest/environment" "^29.6.4" + "@jest/fake-timers" "^29.6.4" + "@jest/globals" "^29.6.4" "@jest/source-map" "^29.6.3" - "@jest/test-result" "^29.6.3" - "@jest/transform" "^29.6.3" + "@jest/test-result" "^29.6.4" + "@jest/transform" "^29.6.4" "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" @@ -1874,36 +1874,36 @@ jest-runtime@^29.6.3: collect-v8-coverage "^1.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^29.6.3" + jest-haste-map "^29.6.4" jest-message-util "^29.6.3" jest-mock "^29.6.3" jest-regex-util "^29.6.3" - jest-resolve "^29.6.3" - jest-snapshot "^29.6.3" + jest-resolve "^29.6.4" + jest-snapshot "^29.6.4" jest-util "^29.6.3" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.6.3.tgz#2435b50881f7bffdc1a66e66c64a2602c8086281" - integrity sha512-66Iu7H1ojiveQMGFnKecHIZPPPBjZwfQEnF6wxqpxGf57sV3YSUtAb5/sTKM5TPa3OndyxZp1wxHFbmgVhc53w== +jest-snapshot@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.6.4.tgz#9833eb6b66ff1541c7fd8ceaa42d541f407b4876" + integrity sha512-VC1N8ED7+4uboUKGIDsbvNAZb6LakgIPgAF4RSpF13dN6YaMokfRqO+BaqK4zIh6X3JffgwbzuGqDEjHm/MrvA== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" "@babel/plugin-syntax-jsx" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.6.3" - "@jest/transform" "^29.6.3" + "@jest/expect-utils" "^29.6.4" + "@jest/transform" "^29.6.4" "@jest/types" "^29.6.3" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.6.3" + expect "^29.6.4" graceful-fs "^4.2.9" - jest-diff "^29.6.3" + jest-diff "^29.6.4" jest-get-type "^29.6.3" - jest-matcher-utils "^29.6.3" + jest-matcher-utils "^29.6.4" jest-message-util "^29.6.3" jest-util "^29.6.3" natural-compare "^1.4.0" @@ -1934,12 +1934,12 @@ jest-validate@^29.6.3: leven "^3.1.0" pretty-format "^29.6.3" -jest-watcher@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.6.3.tgz#f5089852fc5f57ba1d956ec02d80cf2f6f34156d" - integrity sha512-NgpFjZ2U2MKusjidbi4Oiu7tfs+nrgdIxIEVROvH1cFmOei9Uj25lwkMsakqLnH/s0nEcvxO1ck77FiRlcnpZg== +jest-watcher@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.6.4.tgz#633eb515ae284aa67fd6831f1c9d1b534cf0e0ba" + integrity sha512-oqUWvx6+On04ShsT00Ir9T4/FvBeEh2M9PTubgITPxDa739p4hoQweWPRGyYeaojgT0xTpZKF0Y/rSY1UgMxvQ== dependencies: - "@jest/test-result" "^29.6.3" + "@jest/test-result" "^29.6.4" "@jest/types" "^29.6.3" "@types/node" "*" ansi-escapes "^4.2.1" @@ -1948,10 +1948,10 @@ jest-watcher@^29.6.3: jest-util "^29.6.3" string-length "^4.0.1" -jest-worker@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.6.3.tgz#7b1a47bbb6559f3c0882d16595938590e63915d5" - integrity sha512-wacANXecZ/GbQakpf2CClrqrlwsYYDSXFd4fIGdL+dXpM2GWoJ+6bhQ7vR3TKi3+gkSfBkjy1/khH/WrYS4Q6g== +jest-worker@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.6.4.tgz#f34279f4afc33c872b470d4af21b281ac616abd3" + integrity sha512-6dpvFV4WjcWbDVGgHTWo/aupl8/LbBx2NSKfiwqf79xC/yeJjKHT1+StcKy/2KTmW16hE68ccKVOtXf+WZGz7Q== dependencies: "@types/node" "*" jest-util "^29.6.3" @@ -1959,14 +1959,14 @@ jest-worker@^29.6.3: supports-color "^8.0.0" jest@^29.5.0: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.6.3.tgz#118cf081d440d31b21989f61bfcd8b7797ca6a01" - integrity sha512-alueLuoPCDNHFcFGmgETR4KpQ+0ff3qVaiJwxQM4B5sC0CvXcgg4PEi7xrDkxuItDmdz/FVc7SSit4KEu8GRvw== + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.6.4.tgz#7c48e67a445ba264b778253b5d78d4ebc9d0a622" + integrity sha512-tEFhVQFF/bzoYV1YuGyzLPZ6vlPrdfvDmmAxudA1dLEuiztqg2Rkx20vkKY32xiDROcD2KXlgZ7Cu8RPeEHRKw== dependencies: - "@jest/core" "^29.6.3" + "@jest/core" "^29.6.4" "@jest/types" "^29.6.3" import-local "^3.0.2" - jest-cli "^29.6.3" + jest-cli "^29.6.4" js-tokens@^4.0.0: version "4.0.0" From 0b16f1c1afd72b8c7e9f67ed7a453a4446cce640 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Aug 2023 12:31:08 +0000 Subject: [PATCH 738/785] Bump eslint from 8.47.0 to 8.48.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.47.0 to 8.48.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.47.0...v8.48.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index 160f83aa..862c950e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -328,10 +328,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@^8.47.0": - version "8.47.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.47.0.tgz#5478fdf443ff8158f9de171c704ae45308696c7d" - integrity sha512-P6omY1zv5MItm93kLM8s2vr1HICJH8v0dvddDhysbIuZ+vcjOHg5Zbkf1mTkcmi2JA9oBG2anOkRnW8WJTS8Og== +"@eslint/js@8.48.0": + version "8.48.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.48.0.tgz#642633964e217905436033a2bd08bf322849b7fb" + integrity sha512-ZSjtmelB7IJfWD2Fvb7+Z+ChTIKWq6kjda95fLcQKNS5aheVHn4IkfgRQE3sIIzTcSLwLcLZUD9UBt+V7+h+Pw== "@humanwhocodes/config-array@^0.11.10": version "0.11.10" @@ -1145,14 +1145,14 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4 integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== eslint@^8.35.0: - version "8.47.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.47.0.tgz#c95f9b935463fb4fad7005e626c7621052e90806" - integrity sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q== + version "8.48.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.48.0.tgz#bf9998ba520063907ba7bfe4c480dc8be03c2155" + integrity sha512-sb6DLeIuRXxeM1YljSe1KEx9/YYeZFQWcV8Rq9HfigmdDEugjLEVEa1ozDjL6YDjBpQHPJxJzze+alxi4T3OLg== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.6.1" "@eslint/eslintrc" "^2.1.2" - "@eslint/js" "^8.47.0" + "@eslint/js" "8.48.0" "@humanwhocodes/config-array" "^0.11.10" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" From 8e0ff99a8fa4b25b47b113a6a7bd33b148124524 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Aug 2023 12:38:16 +0000 Subject: [PATCH 739/785] Bump prettier from 3.0.2 to 3.0.3 Bumps [prettier](https://github.com/prettier/prettier) from 3.0.2 to 3.0.3. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/3.0.2...3.0.3) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 862c950e..9db7fd9e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2280,9 +2280,9 @@ prelude-ls@^1.2.1: integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== prettier@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.2.tgz#78fcecd6d870551aa5547437cdae39d4701dca5b" - integrity sha512-o2YR9qtniXvwEZlOKbveKfDQVyqxbEIWn48Z8m3ZJjBjcCmUy3xZGIv+7AkaeuaTr6yPXJjwv07ZWlsWbEy1rQ== + version "3.0.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643" + integrity sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg== pretty-format@^29.6.3: version "29.6.3" From d4e6b447bb48009a609f99730efeca88a31dcb8f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 12:23:25 +0000 Subject: [PATCH 740/785] Bump eslint from 8.48.0 to 8.49.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.48.0 to 8.49.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.48.0...v8.49.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9db7fd9e..1c5503a2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -328,15 +328,15 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.48.0": - version "8.48.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.48.0.tgz#642633964e217905436033a2bd08bf322849b7fb" - integrity sha512-ZSjtmelB7IJfWD2Fvb7+Z+ChTIKWq6kjda95fLcQKNS5aheVHn4IkfgRQE3sIIzTcSLwLcLZUD9UBt+V7+h+Pw== +"@eslint/js@8.49.0": + version "8.49.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.49.0.tgz#86f79756004a97fa4df866835093f1df3d03c333" + integrity sha512-1S8uAY/MTJqVx0SC4epBq+N2yhuwtNwLbJYNZyhL2pO1ZVKn5HFXav5T41Ryzy9K9V7ZId2JB2oy/W4aCd9/2w== -"@humanwhocodes/config-array@^0.11.10": - version "0.11.10" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.10.tgz#5a3ffe32cc9306365fb3fd572596cd602d5e12d2" - integrity sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ== +"@humanwhocodes/config-array@^0.11.11": + version "0.11.11" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.11.tgz#88a04c570dbbc7dd943e4712429c3df09bc32844" + integrity sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA== dependencies: "@humanwhocodes/object-schema" "^1.2.1" debug "^4.1.1" @@ -1145,15 +1145,15 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4 integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== eslint@^8.35.0: - version "8.48.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.48.0.tgz#bf9998ba520063907ba7bfe4c480dc8be03c2155" - integrity sha512-sb6DLeIuRXxeM1YljSe1KEx9/YYeZFQWcV8Rq9HfigmdDEugjLEVEa1ozDjL6YDjBpQHPJxJzze+alxi4T3OLg== + version "8.49.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.49.0.tgz#09d80a89bdb4edee2efcf6964623af1054bf6d42" + integrity sha512-jw03ENfm6VJI0jA9U+8H5zfl5b+FvuU3YYvZRdZHOlU2ggJkxrlkJH4HcDrZpj6YwD8kuYqvQM8LyesoazrSOQ== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.6.1" "@eslint/eslintrc" "^2.1.2" - "@eslint/js" "8.48.0" - "@humanwhocodes/config-array" "^0.11.10" + "@eslint/js" "8.49.0" + "@humanwhocodes/config-array" "^0.11.11" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" ajv "^6.12.4" From df3cc4cdbc8ffc2eb14dc5e1c6fca51856b74a8d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Sep 2023 12:22:03 +0000 Subject: [PATCH 741/785] Bump jest from 29.6.4 to 29.7.0 Bumps [jest](https://github.com/jestjs/jest/tree/HEAD/packages/jest) from 29.6.4 to 29.7.0. - [Release notes](https://github.com/jestjs/jest/releases) - [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/jestjs/jest/commits/v29.7.0/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 564 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 288 insertions(+), 276 deletions(-) diff --git a/yarn.lock b/yarn.lock index 1c5503a2..e2efc5e7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -368,27 +368,27 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^29.6.4": - version "29.6.4" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.6.4.tgz#a7e2d84516301f986bba0dd55af9d5fe37f46527" - integrity sha512-wNK6gC0Ha9QeEPSkeJedQuTQqxZYnDPuDcDhVuVatRvMkL4D0VTvFVZj+Yuh6caG2aOfzkUZ36KtCmLNtR02hw== +"@jest/console@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.7.0.tgz#cd4822dbdb84529265c5a2bdb529a3c9cc950ffc" + integrity sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg== dependencies: "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^29.6.3" - jest-util "^29.6.3" + jest-message-util "^29.7.0" + jest-util "^29.7.0" slash "^3.0.0" -"@jest/core@^29.6.4": - version "29.6.4" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.6.4.tgz#265ebee05ec1ff3567757e7a327155c8d6bdb126" - integrity sha512-U/vq5ccNTSVgYH7mHnodHmCffGWHJnz/E1BEWlLuK5pM4FZmGfBn/nrJGLjUsSmyx3otCeqc1T31F4y08AMDLg== +"@jest/core@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.7.0.tgz#b6cccc239f30ff36609658c5a5e2291757ce448f" + integrity sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg== dependencies: - "@jest/console" "^29.6.4" - "@jest/reporters" "^29.6.4" - "@jest/test-result" "^29.6.4" - "@jest/transform" "^29.6.4" + "@jest/console" "^29.7.0" + "@jest/reporters" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" "@jest/types" "^29.6.3" "@types/node" "*" ansi-escapes "^4.2.1" @@ -396,80 +396,80 @@ ci-info "^3.2.0" exit "^0.1.2" graceful-fs "^4.2.9" - jest-changed-files "^29.6.3" - jest-config "^29.6.4" - jest-haste-map "^29.6.4" - jest-message-util "^29.6.3" + jest-changed-files "^29.7.0" + jest-config "^29.7.0" + jest-haste-map "^29.7.0" + jest-message-util "^29.7.0" jest-regex-util "^29.6.3" - jest-resolve "^29.6.4" - jest-resolve-dependencies "^29.6.4" - jest-runner "^29.6.4" - jest-runtime "^29.6.4" - jest-snapshot "^29.6.4" - jest-util "^29.6.3" - jest-validate "^29.6.3" - jest-watcher "^29.6.4" + jest-resolve "^29.7.0" + jest-resolve-dependencies "^29.7.0" + jest-runner "^29.7.0" + jest-runtime "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" + jest-watcher "^29.7.0" micromatch "^4.0.4" - pretty-format "^29.6.3" + pretty-format "^29.7.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.6.4": - version "29.6.4" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.6.4.tgz#78ec2c9f8c8829a37616934ff4fea0c028c79f4f" - integrity sha512-sQ0SULEjA1XUTHmkBRl7A1dyITM9yb1yb3ZNKPX3KlTd6IG7mWUe3e2yfExtC2Zz1Q+mMckOLHmL/qLiuQJrBQ== +"@jest/environment@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.7.0.tgz#24d61f54ff1f786f3cd4073b4b94416383baf2a7" + integrity sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw== dependencies: - "@jest/fake-timers" "^29.6.4" + "@jest/fake-timers" "^29.7.0" "@jest/types" "^29.6.3" "@types/node" "*" - jest-mock "^29.6.3" + jest-mock "^29.7.0" -"@jest/expect-utils@^29.6.4": - version "29.6.4" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.6.4.tgz#17c7dfe6cec106441f218b0aff4b295f98346679" - integrity sha512-FEhkJhqtvBwgSpiTrocquJCdXPsyvNKcl/n7A3u7X4pVoF4bswm11c9d4AV+kfq2Gpv/mM8x7E7DsRvH+djkrg== +"@jest/expect-utils@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.7.0.tgz#023efe5d26a8a70f21677d0a1afc0f0a44e3a1c6" + integrity sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA== dependencies: jest-get-type "^29.6.3" -"@jest/expect@^29.6.4": - version "29.6.4" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.6.4.tgz#1d6ae17dc68d906776198389427ab7ce6179dba6" - integrity sha512-Warhsa7d23+3X5bLbrbYvaehcgX5TLYhI03JKoedTiI8uJU4IhqYBWF7OSSgUyz4IgLpUYPkK0AehA5/fRclAA== +"@jest/expect@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.7.0.tgz#76a3edb0cb753b70dfbfe23283510d3d45432bf2" + integrity sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ== dependencies: - expect "^29.6.4" - jest-snapshot "^29.6.4" + expect "^29.7.0" + jest-snapshot "^29.7.0" -"@jest/fake-timers@^29.6.4": - version "29.6.4" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.6.4.tgz#45a27f093c43d5d989362a3e7a8c70c83188b4f6" - integrity sha512-6UkCwzoBK60edXIIWb0/KWkuj7R7Qq91vVInOe3De6DSpaEiqjKcJw4F7XUet24Wupahj9J6PlR09JqJ5ySDHw== +"@jest/fake-timers@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.7.0.tgz#fd91bf1fffb16d7d0d24a426ab1a47a49881a565" + integrity sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ== dependencies: "@jest/types" "^29.6.3" "@sinonjs/fake-timers" "^10.0.2" "@types/node" "*" - jest-message-util "^29.6.3" - jest-mock "^29.6.3" - jest-util "^29.6.3" + jest-message-util "^29.7.0" + jest-mock "^29.7.0" + jest-util "^29.7.0" -"@jest/globals@^29.6.4": - version "29.6.4" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.6.4.tgz#4f04f58731b062b44ef23036b79bdb31f40c7f63" - integrity sha512-wVIn5bdtjlChhXAzVXavcY/3PEjf4VqM174BM3eGL5kMxLiZD5CLnbmkEyA1Dwh9q8XjP6E8RwjBsY/iCWrWsA== +"@jest/globals@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.7.0.tgz#8d9290f9ec47ff772607fa864ca1d5a2efae1d4d" + integrity sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ== dependencies: - "@jest/environment" "^29.6.4" - "@jest/expect" "^29.6.4" + "@jest/environment" "^29.7.0" + "@jest/expect" "^29.7.0" "@jest/types" "^29.6.3" - jest-mock "^29.6.3" + jest-mock "^29.7.0" -"@jest/reporters@^29.6.4": - version "29.6.4" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.6.4.tgz#9d6350c8a2761ece91f7946e97ab0dabc06deab7" - integrity sha512-sxUjWxm7QdchdrD3NfWKrL8FBsortZeibSJv4XLjESOOjSUOkjQcb0ZHJwfhEGIvBvTluTzfG2yZWZhkrXJu8g== +"@jest/reporters@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.7.0.tgz#04b262ecb3b8faa83b0b3d321623972393e8f4c7" + integrity sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.6.4" - "@jest/test-result" "^29.6.4" - "@jest/transform" "^29.6.4" + "@jest/console" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" "@jest/types" "^29.6.3" "@jridgewell/trace-mapping" "^0.3.18" "@types/node" "*" @@ -483,9 +483,9 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^29.6.3" - jest-util "^29.6.3" - jest-worker "^29.6.4" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + jest-worker "^29.7.0" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" @@ -507,30 +507,30 @@ callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^29.6.4": - version "29.6.4" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.6.4.tgz#adf5c79f6e1fb7405ad13d67d9e2b6ff54b54c6b" - integrity sha512-uQ1C0AUEN90/dsyEirgMLlouROgSY+Wc/JanVVk0OiUKa5UFh7sJpMEM3aoUBAz2BRNvUJ8j3d294WFuRxSyOQ== +"@jest/test-result@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.7.0.tgz#8db9a80aa1a097bb2262572686734baed9b1657c" + integrity sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA== dependencies: - "@jest/console" "^29.6.4" + "@jest/console" "^29.7.0" "@jest/types" "^29.6.3" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.6.4": - version "29.6.4" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.6.4.tgz#86aef66aaa22b181307ed06c26c82802fb836d7b" - integrity sha512-E84M6LbpcRq3fT4ckfKs9ryVanwkaIB0Ws9bw3/yP4seRLg/VaCZ/LgW0MCq5wwk4/iP/qnilD41aj2fsw2RMg== +"@jest/test-sequencer@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz#6cef977ce1d39834a3aea887a1726628a6f072ce" + integrity sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw== dependencies: - "@jest/test-result" "^29.6.4" + "@jest/test-result" "^29.7.0" graceful-fs "^4.2.9" - jest-haste-map "^29.6.4" + jest-haste-map "^29.7.0" slash "^3.0.0" -"@jest/transform@^29.6.4": - version "29.6.4" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.6.4.tgz#a6bc799ef597c5d85b2e65a11fd96b6b239bab5a" - integrity sha512-8thgRSiXUqtr/pPGY/OsyHuMjGyhVnWrFAwoxmIemlBuiMyU1WFs0tXoNxzcr4A4uErs/ABre76SGmrr5ab/AA== +"@jest/transform@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.7.0.tgz#df2dd9c346c7d7768b8a06639994640c642e284c" + integrity sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw== dependencies: "@babel/core" "^7.11.6" "@jest/types" "^29.6.3" @@ -540,9 +540,9 @@ convert-source-map "^2.0.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.6.4" + jest-haste-map "^29.7.0" jest-regex-util "^29.6.3" - jest-util "^29.6.3" + jest-util "^29.7.0" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" @@ -809,12 +809,12 @@ arrify@^2.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== -babel-jest@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.6.4.tgz#98dbc45d1c93319c82a8ab4a478b670655dd2585" - integrity sha512-meLj23UlSLddj6PC+YTOFRgDAtjnZom8w/ACsrx0gtPtv5cJZk0A5Unk5bV4wixD7XaPCN1fQvpww8czkZURmw== +babel-jest@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.7.0.tgz#f4369919225b684c56085998ac63dbd05be020d5" + integrity sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg== dependencies: - "@jest/transform" "^29.6.4" + "@jest/transform" "^29.7.0" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" babel-preset-jest "^29.6.3" @@ -1029,6 +1029,19 @@ convert-source-map@^2.0.0: resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== +create-jest@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/create-jest/-/create-jest-29.7.0.tgz#a355c5b3cb1e1af02ba177fe7afd7feee49a5320" + integrity sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q== + dependencies: + "@jest/types" "^29.6.3" + chalk "^4.0.0" + exit "^0.1.2" + graceful-fs "^4.2.9" + jest-config "^29.7.0" + jest-util "^29.7.0" + prompts "^2.0.1" + cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -1260,16 +1273,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== -expect@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.6.4.tgz#a6e6f66d4613717859b2fe3da98a739437b6f4b8" - integrity sha512-F2W2UyQ8XYyftHT57dtfg8Ue3X5qLgm2sSug0ivvLRH/VKNRL/pDxg/TH7zVzbQB0tu80clNFy6LU7OS/VSEKA== +expect@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.7.0.tgz#578874590dcb3214514084c08115d8aee61e11bc" + integrity sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw== dependencies: - "@jest/expect-utils" "^29.6.4" + "@jest/expect-utils" "^29.7.0" jest-get-type "^29.6.3" - jest-matcher-utils "^29.6.4" - jest-message-util "^29.6.3" - jest-util "^29.6.3" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -1609,136 +1622,135 @@ istanbul-reports@^3.1.3: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.6.3.tgz#97cfdc93f74fb8af2a1acb0b78f836f1fb40c449" - integrity sha512-G5wDnElqLa4/c66ma5PG9eRjE342lIbF6SUnTJi26C3J28Fv2TVY2rOyKB9YGbSA5ogwevgmxc4j4aVjrEK6Yg== +jest-changed-files@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.7.0.tgz#1c06d07e77c78e1585d020424dedc10d6e17ac3a" + integrity sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w== dependencies: execa "^5.0.0" - jest-util "^29.6.3" + jest-util "^29.7.0" p-limit "^3.1.0" -jest-circus@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.6.4.tgz#f074c8d795e0cc0f2ebf0705086b1be6a9a8722f" - integrity sha512-YXNrRyntVUgDfZbjXWBMPslX1mQ8MrSG0oM/Y06j9EYubODIyHWP8hMUbjbZ19M3M+zamqEur7O80HODwACoJw== +jest-circus@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.7.0.tgz#b6817a45fcc835d8b16d5962d0c026473ee3668a" + integrity sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw== dependencies: - "@jest/environment" "^29.6.4" - "@jest/expect" "^29.6.4" - "@jest/test-result" "^29.6.4" + "@jest/environment" "^29.7.0" + "@jest/expect" "^29.7.0" + "@jest/test-result" "^29.7.0" "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^1.0.0" is-generator-fn "^2.0.0" - jest-each "^29.6.3" - jest-matcher-utils "^29.6.4" - jest-message-util "^29.6.3" - jest-runtime "^29.6.4" - jest-snapshot "^29.6.4" - jest-util "^29.6.3" + jest-each "^29.7.0" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-runtime "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" p-limit "^3.1.0" - pretty-format "^29.6.3" + pretty-format "^29.7.0" pure-rand "^6.0.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.6.4.tgz#ad52f2dfa1b0291de7ec7f8d7c81ac435521ede0" - integrity sha512-+uMCQ7oizMmh8ZwRfZzKIEszFY9ksjjEQnTEMTaL7fYiL3Kw4XhqT9bYh+A4DQKUb67hZn2KbtEnDuHvcgK4pQ== +jest-cli@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.7.0.tgz#5592c940798e0cae677eec169264f2d839a37995" + integrity sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg== dependencies: - "@jest/core" "^29.6.4" - "@jest/test-result" "^29.6.4" + "@jest/core" "^29.7.0" + "@jest/test-result" "^29.7.0" "@jest/types" "^29.6.3" chalk "^4.0.0" + create-jest "^29.7.0" exit "^0.1.2" - graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.6.4" - jest-util "^29.6.3" - jest-validate "^29.6.3" - prompts "^2.0.1" + jest-config "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" yargs "^17.3.1" -jest-config@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.6.4.tgz#eff958ee41d4e1ee7a6106d02b74ad9fc427d79e" - integrity sha512-JWohr3i9m2cVpBumQFv2akMEnFEPVOh+9L2xIBJhJ0zOaci2ZXuKJj0tgMKQCBZAKA09H049IR4HVS/43Qb19A== +jest-config@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.7.0.tgz#bcbda8806dbcc01b1e316a46bb74085a84b0245f" + integrity sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.6.4" + "@jest/test-sequencer" "^29.7.0" "@jest/types" "^29.6.3" - babel-jest "^29.6.4" + babel-jest "^29.7.0" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^29.6.4" - jest-environment-node "^29.6.4" + jest-circus "^29.7.0" + jest-environment-node "^29.7.0" jest-get-type "^29.6.3" jest-regex-util "^29.6.3" - jest-resolve "^29.6.4" - jest-runner "^29.6.4" - jest-util "^29.6.3" - jest-validate "^29.6.3" + jest-resolve "^29.7.0" + jest-runner "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^29.6.3" + pretty-format "^29.7.0" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.6.4.tgz#85aaa6c92a79ae8cd9a54ebae8d5b6d9a513314a" - integrity sha512-9F48UxR9e4XOEZvoUXEHSWY4qC4zERJaOfrbBg9JpbJOO43R1vN76REt/aMGZoY6GD5g84nnJiBIVlscegefpw== +jest-diff@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.7.0.tgz#017934a66ebb7ecf6f205e84699be10afd70458a" + integrity sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw== dependencies: chalk "^4.0.0" diff-sequences "^29.6.3" jest-get-type "^29.6.3" - pretty-format "^29.6.3" + pretty-format "^29.7.0" -jest-docblock@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.6.3.tgz#293dca5188846c9f7c0c2b1bb33e5b11f21645f2" - integrity sha512-2+H+GOTQBEm2+qFSQ7Ma+BvyV+waiIFxmZF5LdpBsAEjWX8QYjSCa4FrkIYtbfXUJJJnFCYrOtt6TZ+IAiTjBQ== +jest-docblock@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.7.0.tgz#8fddb6adc3cdc955c93e2a87f61cfd350d5d119a" + integrity sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g== dependencies: detect-newline "^3.0.0" -jest-each@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.6.3.tgz#1956f14f5f0cb8ae0b2e7cabc10bb03ec817c142" - integrity sha512-KoXfJ42k8cqbkfshW7sSHcdfnv5agDdHCPA87ZBdmHP+zJstTJc0ttQaJ/x7zK6noAL76hOuTIJ6ZkQRS5dcyg== +jest-each@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.7.0.tgz#162a9b3f2328bdd991beaabffbb74745e56577d1" + integrity sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ== dependencies: "@jest/types" "^29.6.3" chalk "^4.0.0" jest-get-type "^29.6.3" - jest-util "^29.6.3" - pretty-format "^29.6.3" + jest-util "^29.7.0" + pretty-format "^29.7.0" -jest-environment-node@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.6.4.tgz#4ce311549afd815d3cafb49e60a1e4b25f06d29f" - integrity sha512-i7SbpH2dEIFGNmxGCpSc2w9cA4qVD+wfvg2ZnfQ7XVrKL0NA5uDVBIiGH8SR4F0dKEv/0qI5r+aDomDf04DpEQ== +jest-environment-node@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.7.0.tgz#0b93e111dda8ec120bc8300e6d1fb9576e164376" + integrity sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw== dependencies: - "@jest/environment" "^29.6.4" - "@jest/fake-timers" "^29.6.4" + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" "@jest/types" "^29.6.3" "@types/node" "*" - jest-mock "^29.6.3" - jest-util "^29.6.3" + jest-mock "^29.7.0" + jest-util "^29.7.0" jest-get-type@^29.6.3: version "29.6.3" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.6.3.tgz#36f499fdcea197c1045a127319c0481723908fd1" integrity sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw== -jest-haste-map@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.6.4.tgz#97143ce833829157ea7025204b08f9ace609b96a" - integrity sha512-12Ad+VNTDHxKf7k+M65sviyynRoZYuL1/GTuhEVb8RYsNSNln71nANRb/faSyWvx0j+gHcivChXHIoMJrGYjog== +jest-haste-map@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.7.0.tgz#3c2396524482f5a0506376e6c858c3bbcc17b104" + integrity sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA== dependencies: "@jest/types" "^29.6.3" "@types/graceful-fs" "^4.1.3" @@ -1747,35 +1759,35 @@ jest-haste-map@^29.6.4: fb-watchman "^2.0.0" graceful-fs "^4.2.9" jest-regex-util "^29.6.3" - jest-util "^29.6.3" - jest-worker "^29.6.4" + jest-util "^29.7.0" + jest-worker "^29.7.0" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.6.3.tgz#b9661bc3aec8874e59aff361fa0c6d7cd507ea01" - integrity sha512-0kfbESIHXYdhAdpLsW7xdwmYhLf1BRu4AA118/OxFm0Ho1b2RcTmO4oF6aAMaxpxdxnJ3zve2rgwzNBD4Zbm7Q== +jest-leak-detector@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz#5b7ec0dadfdfec0ca383dc9aa016d36b5ea4c728" + integrity sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw== dependencies: jest-get-type "^29.6.3" - pretty-format "^29.6.3" + pretty-format "^29.7.0" -jest-matcher-utils@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.6.4.tgz#327db7ababea49455df3b23e5d6109fe0c709d24" - integrity sha512-KSzwyzGvK4HcfnserYqJHYi7sZVqdREJ9DMPAKVbS98JsIAvumihaNUbjrWw0St7p9IY7A9UskCW5MYlGmBQFQ== +jest-matcher-utils@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz#ae8fec79ff249fd592ce80e3ee474e83a6c44f12" + integrity sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g== dependencies: chalk "^4.0.0" - jest-diff "^29.6.4" + jest-diff "^29.7.0" jest-get-type "^29.6.3" - pretty-format "^29.6.3" + pretty-format "^29.7.0" -jest-message-util@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.6.3.tgz#bce16050d86801b165f20cfde34dc01d3cf85fbf" - integrity sha512-FtzaEEHzjDpQp51HX4UMkPZjy46ati4T5pEMyM6Ik48ztu4T9LQplZ6OsimHx7EuM9dfEh5HJa6D3trEftu3dA== +jest-message-util@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.7.0.tgz#8bc392e204e95dfe7564abbe72a404e28e51f7f3" + integrity sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w== dependencies: "@babel/code-frame" "^7.12.13" "@jest/types" "^29.6.3" @@ -1783,18 +1795,18 @@ jest-message-util@^29.6.3: chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^29.6.3" + pretty-format "^29.7.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.6.3.tgz#433f3fd528c8ec5a76860177484940628bdf5e0a" - integrity sha512-Z7Gs/mOyTSR4yPsaZ72a/MtuK6RnC3JYqWONe48oLaoEcYwEDxqvbXz85G4SJrm2Z5Ar9zp6MiHF4AlFlRM4Pg== +jest-mock@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.7.0.tgz#4e836cf60e99c6fcfabe9f99d017f3fdd50a6347" + integrity sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw== dependencies: "@jest/types" "^29.6.3" "@types/node" "*" - jest-util "^29.6.3" + jest-util "^29.7.0" jest-pnp-resolver@^1.2.2: version "1.2.3" @@ -1806,67 +1818,67 @@ jest-regex-util@^29.6.3: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.6.3.tgz#4a556d9c776af68e1c5f48194f4d0327d24e8a52" integrity sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg== -jest-resolve-dependencies@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.4.tgz#20156b33c7eacbb6bb77aeba4bed0eab4a3f8734" - integrity sha512-7+6eAmr1ZBF3vOAJVsfLj1QdqeXG+WYhidfLHBRZqGN24MFRIiKG20ItpLw2qRAsW/D2ZUUmCNf6irUr/v6KHA== +jest-resolve-dependencies@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz#1b04f2c095f37fc776ff40803dc92921b1e88428" + integrity sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA== dependencies: jest-regex-util "^29.6.3" - jest-snapshot "^29.6.4" + jest-snapshot "^29.7.0" -jest-resolve@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.6.4.tgz#e34cb06f2178b429c38455d98d1a07572ac9faa3" - integrity sha512-fPRq+0vcxsuGlG0O3gyoqGTAxasagOxEuyoxHeyxaZbc9QNek0AmJWSkhjlMG+mTsj+8knc/mWb3fXlRNVih7Q== +jest-resolve@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.7.0.tgz#64d6a8992dd26f635ab0c01e5eef4399c6bcbc30" + integrity sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^29.6.4" + jest-haste-map "^29.7.0" jest-pnp-resolver "^1.2.2" - jest-util "^29.6.3" - jest-validate "^29.6.3" + jest-util "^29.7.0" + jest-validate "^29.7.0" resolve "^1.20.0" resolve.exports "^2.0.0" slash "^3.0.0" -jest-runner@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.6.4.tgz#b3b8ccb85970fde0fae40c73ee11eb75adccfacf" - integrity sha512-SDaLrMmtVlQYDuG0iSPYLycG8P9jLI+fRm8AF/xPKhYDB2g6xDWjXBrR5M8gEWsK6KVFlebpZ4QsrxdyIX1Jaw== +jest-runner@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.7.0.tgz#809af072d408a53dcfd2e849a4c976d3132f718e" + integrity sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ== dependencies: - "@jest/console" "^29.6.4" - "@jest/environment" "^29.6.4" - "@jest/test-result" "^29.6.4" - "@jest/transform" "^29.6.4" + "@jest/console" "^29.7.0" + "@jest/environment" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" emittery "^0.13.1" graceful-fs "^4.2.9" - jest-docblock "^29.6.3" - jest-environment-node "^29.6.4" - jest-haste-map "^29.6.4" - jest-leak-detector "^29.6.3" - jest-message-util "^29.6.3" - jest-resolve "^29.6.4" - jest-runtime "^29.6.4" - jest-util "^29.6.3" - jest-watcher "^29.6.4" - jest-worker "^29.6.4" + jest-docblock "^29.7.0" + jest-environment-node "^29.7.0" + jest-haste-map "^29.7.0" + jest-leak-detector "^29.7.0" + jest-message-util "^29.7.0" + jest-resolve "^29.7.0" + jest-runtime "^29.7.0" + jest-util "^29.7.0" + jest-watcher "^29.7.0" + jest-worker "^29.7.0" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.6.4.tgz#b0bc495c9b6b12a0a7042ac34ca9bb85f8cd0ded" - integrity sha512-s/QxMBLvmwLdchKEjcLfwzP7h+jsHvNEtxGP5P+Fl1FMaJX2jMiIqe4rJw4tFprzCwuSvVUo9bn0uj4gNRXsbA== +jest-runtime@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.7.0.tgz#efecb3141cf7d3767a3a0cc8f7c9990587d3d817" + integrity sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ== dependencies: - "@jest/environment" "^29.6.4" - "@jest/fake-timers" "^29.6.4" - "@jest/globals" "^29.6.4" + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" + "@jest/globals" "^29.7.0" "@jest/source-map" "^29.6.3" - "@jest/test-result" "^29.6.4" - "@jest/transform" "^29.6.4" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" @@ -1874,46 +1886,46 @@ jest-runtime@^29.6.4: collect-v8-coverage "^1.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^29.6.4" - jest-message-util "^29.6.3" - jest-mock "^29.6.3" + jest-haste-map "^29.7.0" + jest-message-util "^29.7.0" + jest-mock "^29.7.0" jest-regex-util "^29.6.3" - jest-resolve "^29.6.4" - jest-snapshot "^29.6.4" - jest-util "^29.6.3" + jest-resolve "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.6.4.tgz#9833eb6b66ff1541c7fd8ceaa42d541f407b4876" - integrity sha512-VC1N8ED7+4uboUKGIDsbvNAZb6LakgIPgAF4RSpF13dN6YaMokfRqO+BaqK4zIh6X3JffgwbzuGqDEjHm/MrvA== +jest-snapshot@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.7.0.tgz#c2c574c3f51865da1bb329036778a69bf88a6be5" + integrity sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" "@babel/plugin-syntax-jsx" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.6.4" - "@jest/transform" "^29.6.4" + "@jest/expect-utils" "^29.7.0" + "@jest/transform" "^29.7.0" "@jest/types" "^29.6.3" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.6.4" + expect "^29.7.0" graceful-fs "^4.2.9" - jest-diff "^29.6.4" + jest-diff "^29.7.0" jest-get-type "^29.6.3" - jest-matcher-utils "^29.6.4" - jest-message-util "^29.6.3" - jest-util "^29.6.3" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" natural-compare "^1.4.0" - pretty-format "^29.6.3" + pretty-format "^29.7.0" semver "^7.5.3" -jest-util@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.6.3.tgz#e15c3eac8716440d1ed076f09bc63ace1aebca63" - integrity sha512-QUjna/xSy4B32fzcKTSz1w7YYzgiHrjjJjevdRf61HYk998R5vVMMNmrHESYZVDS5DSWs+1srPLPKxXPkeSDOA== +jest-util@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.7.0.tgz#23c2b62bfb22be82b44de98055802ff3710fc0bc" + integrity sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA== dependencies: "@jest/types" "^29.6.3" "@types/node" "*" @@ -1922,51 +1934,51 @@ jest-util@^29.6.3: graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.6.3.tgz#a75fca774cfb1c5758c70d035d30a1f9c2784b4d" - integrity sha512-e7KWZcAIX+2W1o3cHfnqpGajdCs1jSM3DkXjGeLSNmCazv1EeI1ggTeK5wdZhF+7N+g44JI2Od3veojoaumlfg== +jest-validate@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.7.0.tgz#7bf705511c64da591d46b15fce41400d52147d9c" + integrity sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw== dependencies: "@jest/types" "^29.6.3" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^29.6.3" leven "^3.1.0" - pretty-format "^29.6.3" + pretty-format "^29.7.0" -jest-watcher@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.6.4.tgz#633eb515ae284aa67fd6831f1c9d1b534cf0e0ba" - integrity sha512-oqUWvx6+On04ShsT00Ir9T4/FvBeEh2M9PTubgITPxDa739p4hoQweWPRGyYeaojgT0xTpZKF0Y/rSY1UgMxvQ== +jest-watcher@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.7.0.tgz#7810d30d619c3a62093223ce6bb359ca1b28a2f2" + integrity sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g== dependencies: - "@jest/test-result" "^29.6.4" + "@jest/test-result" "^29.7.0" "@jest/types" "^29.6.3" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.13.1" - jest-util "^29.6.3" + jest-util "^29.7.0" string-length "^4.0.1" -jest-worker@^29.6.4: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.6.4.tgz#f34279f4afc33c872b470d4af21b281ac616abd3" - integrity sha512-6dpvFV4WjcWbDVGgHTWo/aupl8/LbBx2NSKfiwqf79xC/yeJjKHT1+StcKy/2KTmW16hE68ccKVOtXf+WZGz7Q== +jest-worker@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.7.0.tgz#acad073acbbaeb7262bd5389e1bcf43e10058d4a" + integrity sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw== dependencies: "@types/node" "*" - jest-util "^29.6.3" + jest-util "^29.7.0" merge-stream "^2.0.0" supports-color "^8.0.0" jest@^29.5.0: - version "29.6.4" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.6.4.tgz#7c48e67a445ba264b778253b5d78d4ebc9d0a622" - integrity sha512-tEFhVQFF/bzoYV1YuGyzLPZ6vlPrdfvDmmAxudA1dLEuiztqg2Rkx20vkKY32xiDROcD2KXlgZ7Cu8RPeEHRKw== + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.7.0.tgz#994676fc24177f088f1c5e3737f5697204ff2613" + integrity sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw== dependencies: - "@jest/core" "^29.6.4" + "@jest/core" "^29.7.0" "@jest/types" "^29.6.3" import-local "^3.0.2" - jest-cli "^29.6.4" + jest-cli "^29.7.0" js-tokens@^4.0.0: version "4.0.0" @@ -2284,10 +2296,10 @@ prettier@^3.0.0: resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643" integrity sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg== -pretty-format@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.6.3.tgz#d432bb4f1ca6f9463410c3fb25a0ba88e594ace7" - integrity sha512-ZsBgjVhFAj5KeK+nHfF1305/By3lechHQSMWCTl8iHSbfOm2TN5nHEtFc/+W7fAyUeCs2n5iow72gld4gW0xDw== +pretty-format@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812" + integrity sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ== dependencies: "@jest/schemas" "^29.6.3" ansi-styles "^5.0.0" From a7c1089bc1dd18f0d1cdfd242e5022596514b8ff Mon Sep 17 00:00:00 2001 From: Michael Moen Date: Thu, 5 Oct 2023 10:37:49 -0500 Subject: [PATCH 742/785] Update README for Prettier v3 --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 7349d98f..b4512a99 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,17 @@ The `prettier` executable is now installed and ready for use: ./node_modules/.bin/prettier --plugin=@prettier/plugin-ruby --write '**/*' ``` +### Using Prettier >= 3.0 + +You need to tell Prettier to use the plugin, add the following to your existing [prettier configuration +file](https://prettier.io/docs/en/configuration.html). + +```json +{ + "plugins": ["@prettier/plugin-ruby"], +} +``` + ## Configuration Below are the options (from [`src/plugin.js`](src/plugin.js)) that `@prettier/plugin-ruby` currently supports: From 9dd336027440cc955b4a4b02cef2d470b1710da9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Oct 2023 12:17:42 +0000 Subject: [PATCH 743/785] Bump eslint from 8.49.0 to 8.51.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.49.0 to 8.51.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.49.0...v8.51.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index e2efc5e7..63b633fd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -328,10 +328,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.49.0": - version "8.49.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.49.0.tgz#86f79756004a97fa4df866835093f1df3d03c333" - integrity sha512-1S8uAY/MTJqVx0SC4epBq+N2yhuwtNwLbJYNZyhL2pO1ZVKn5HFXav5T41Ryzy9K9V7ZId2JB2oy/W4aCd9/2w== +"@eslint/js@8.51.0": + version "8.51.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.51.0.tgz#6d419c240cfb2b66da37df230f7e7eef801c32fa" + integrity sha512-HxjQ8Qn+4SI3/AFv6sOrDB+g6PpUTDwSJiQqOrnneEk8L71161srI9gjzzZvYVbzHiVg/BvcH95+cK/zfIt4pg== "@humanwhocodes/config-array@^0.11.11": version "0.11.11" @@ -1158,14 +1158,14 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4 integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== eslint@^8.35.0: - version "8.49.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.49.0.tgz#09d80a89bdb4edee2efcf6964623af1054bf6d42" - integrity sha512-jw03ENfm6VJI0jA9U+8H5zfl5b+FvuU3YYvZRdZHOlU2ggJkxrlkJH4HcDrZpj6YwD8kuYqvQM8LyesoazrSOQ== + version "8.51.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.51.0.tgz#4a82dae60d209ac89a5cff1604fea978ba4950f3" + integrity sha512-2WuxRZBrlwnXi+/vFSJyjMqrNjtJqiasMzehF0shoLaW7DzS3/9Yvrmq5JiT66+pNjiX4UBnLDiKHcWAr/OInA== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.6.1" "@eslint/eslintrc" "^2.1.2" - "@eslint/js" "8.49.0" + "@eslint/js" "8.51.0" "@humanwhocodes/config-array" "^0.11.11" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" From f776be9156061b76e70416bb6bb6d5ef79a2ce83 Mon Sep 17 00:00:00 2001 From: Heiko Rabe Date: Sun, 19 Nov 2023 12:28:07 +0100 Subject: [PATCH 744/785] Support shimmed ruby versions --- src/plugin.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugin.js b/src/plugin.js index 22459cad..3ae4de7b 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -75,6 +75,7 @@ export async function spawnServer(opts, killOnExit = true) { filepath ], { + cwd: path.dirname(opts.filepath), env: Object.assign({}, process.env, { LANG: getLang() }), stdio: ["ignore", "ignore", "inherit"], detached: true From b01581ffa5f73ae3de1f59655d27959103d1d973 Mon Sep 17 00:00:00 2001 From: Heiko Rabe Date: Mon, 20 Nov 2023 08:30:58 +0100 Subject: [PATCH 745/785] Prettify README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b4512a99..a0db67ff 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ file](https://prettier.io/docs/en/configuration.html). ```json { - "plugins": ["@prettier/plugin-ruby"], + "plugins": ["@prettier/plugin-ruby"] } ``` From 18c286c734dc465109f2f770d84e8fb54f368af7 Mon Sep 17 00:00:00 2001 From: Heiko Rabe Date: Mon, 20 Nov 2023 08:41:12 +0100 Subject: [PATCH 746/785] Fix file path --- src/plugin.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugin.js b/src/plugin.js index 3ae4de7b..808c1cb6 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -67,6 +67,8 @@ export async function spawnServer(opts, killOnExit = true) { const tmpdir = os.tmpdir(); const filepath = path.join(tmpdir, `prettier-ruby-parser-${process.pid}.txt`); + const currentDir = opts.filepath || process.cwd(); + const server = spawn( opts.rubyExecutablePath || "ruby", [ @@ -75,7 +77,7 @@ export async function spawnServer(opts, killOnExit = true) { filepath ], { - cwd: path.dirname(opts.filepath), + cwd: path.dirname(currentDir), env: Object.assign({}, process.env, { LANG: getLang() }), stdio: ["ignore", "ignore", "inherit"], detached: true From a6025fd08632c55c6a93f24d7a2d9a3a0b32492e Mon Sep 17 00:00:00 2001 From: Heiko Rabe Date: Mon, 20 Nov 2023 08:41:32 +0100 Subject: [PATCH 747/785] Repair tests --- test/js/ruby/nodes/lambda.test.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/js/ruby/nodes/lambda.test.js b/test/js/ruby/nodes/lambda.test.js index c42e34b6..a1f9dc3c 100644 --- a/test/js/ruby/nodes/lambda.test.js +++ b/test/js/ruby/nodes/lambda.test.js @@ -36,9 +36,9 @@ describe("lambda", () => { return expect(`command :foo, -> { ${long} }`).toChangeFormat( ruby(` command :foo, - -> { + -> do ${long} - } + end `) ); }); @@ -51,9 +51,9 @@ describe("lambda", () => { return expect(`command.call :foo, -> { ${long} }`).toChangeFormat( ruby(` command.call :foo, - -> { + -> do ${long} - } + end `) ); }); @@ -62,9 +62,9 @@ describe("lambda", () => { return expect(`command :foo, bar: -> { ${long} }`).toChangeFormat( ruby(` command :foo, - bar: -> { + bar: -> do ${long} - } + end `) ); }); @@ -79,9 +79,9 @@ describe("lambda", () => { ${long}, a${long}, aa${long} - ) { + ) do true - } + end `) ); }); From 5b860436ced483b6139431a689a990042b79f4ca Mon Sep 17 00:00:00 2001 From: Heiko Rabe Date: Mon, 20 Nov 2023 08:46:05 +0100 Subject: [PATCH 748/785] Rename const --- src/plugin.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugin.js b/src/plugin.js index 808c1cb6..d6931207 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -67,7 +67,7 @@ export async function spawnServer(opts, killOnExit = true) { const tmpdir = os.tmpdir(); const filepath = path.join(tmpdir, `prettier-ruby-parser-${process.pid}.txt`); - const currentDir = opts.filepath || process.cwd(); + const currentFile = opts.filepath || process.cwd(); const server = spawn( opts.rubyExecutablePath || "ruby", @@ -77,7 +77,7 @@ export async function spawnServer(opts, killOnExit = true) { filepath ], { - cwd: path.dirname(currentDir), + cwd: path.dirname(currentFile), env: Object.assign({}, process.env, { LANG: getLang() }), stdio: ["ignore", "ignore", "inherit"], detached: true From 4643d2ed11459833e11a61520d91c92ac638b341 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Nov 2023 13:38:25 -0500 Subject: [PATCH 749/785] Bump to latest --- package.json | 4 +- test/js/ruby/nodes/lambda.test.js | 16 ++++---- yarn.lock | 62 +++++++++++++++++-------------- 3 files changed, 44 insertions(+), 38 deletions(-) diff --git a/package.json b/package.json index d09fde8c..538fef64 100644 --- a/package.json +++ b/package.json @@ -23,11 +23,11 @@ "prettier": "^3.0.0" }, "devDependencies": { - "eslint": "^8.35.0", + "eslint": "^8.54.0", "eslint-config-prettier": "^9.0.0", "husky": "^8.0.1", "jest": "^29.5.0", - "prettier": "^3.0.0", + "prettier": "^3.1.0", "pretty-quick": "^3.1.2" }, "eslintConfig": { diff --git a/test/js/ruby/nodes/lambda.test.js b/test/js/ruby/nodes/lambda.test.js index c42e34b6..a1f9dc3c 100644 --- a/test/js/ruby/nodes/lambda.test.js +++ b/test/js/ruby/nodes/lambda.test.js @@ -36,9 +36,9 @@ describe("lambda", () => { return expect(`command :foo, -> { ${long} }`).toChangeFormat( ruby(` command :foo, - -> { + -> do ${long} - } + end `) ); }); @@ -51,9 +51,9 @@ describe("lambda", () => { return expect(`command.call :foo, -> { ${long} }`).toChangeFormat( ruby(` command.call :foo, - -> { + -> do ${long} - } + end `) ); }); @@ -62,9 +62,9 @@ describe("lambda", () => { return expect(`command :foo, bar: -> { ${long} }`).toChangeFormat( ruby(` command :foo, - bar: -> { + bar: -> do ${long} - } + end `) ); }); @@ -79,9 +79,9 @@ describe("lambda", () => { ${long}, a${long}, aa${long} - ) { + ) do true - } + end `) ); }); diff --git a/yarn.lock b/yarn.lock index 63b633fd..ca626fa9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -313,10 +313,10 @@ resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.6.2.tgz#1816b5f6948029c5eaacb0703b850ee0cb37d8f8" integrity sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw== -"@eslint/eslintrc@^2.1.2": - version "2.1.2" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.2.tgz#c6936b4b328c64496692f76944e755738be62396" - integrity sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g== +"@eslint/eslintrc@^2.1.3": + version "2.1.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.3.tgz#797470a75fe0fbd5a53350ee715e85e87baff22d" + integrity sha512-yZzuIG+jnVu6hNSzFEN07e8BxF3uAzYtQb6uDkaYZLo6oYZDCq454c5kB8zxnzfCYyP4MIuyBn10L0DqwujTmA== dependencies: ajv "^6.12.4" debug "^4.3.2" @@ -328,17 +328,17 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.51.0": - version "8.51.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.51.0.tgz#6d419c240cfb2b66da37df230f7e7eef801c32fa" - integrity sha512-HxjQ8Qn+4SI3/AFv6sOrDB+g6PpUTDwSJiQqOrnneEk8L71161srI9gjzzZvYVbzHiVg/BvcH95+cK/zfIt4pg== +"@eslint/js@8.54.0": + version "8.54.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.54.0.tgz#4fab9a2ff7860082c304f750e94acd644cf984cf" + integrity sha512-ut5V+D+fOoWPgGGNj83GGjnntO39xDy6DWxO0wb7Jp3DcMX0TfIqdzHF85VTQkerdyGmuuMD9AKAo5KiNlf/AQ== -"@humanwhocodes/config-array@^0.11.11": - version "0.11.11" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.11.tgz#88a04c570dbbc7dd943e4712429c3df09bc32844" - integrity sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA== +"@humanwhocodes/config-array@^0.11.13": + version "0.11.13" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.13.tgz#075dc9684f40a531d9b26b0822153c1e832ee297" + integrity sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ== dependencies: - "@humanwhocodes/object-schema" "^1.2.1" + "@humanwhocodes/object-schema" "^2.0.1" debug "^4.1.1" minimatch "^3.0.5" @@ -347,10 +347,10 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== -"@humanwhocodes/object-schema@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" - integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== +"@humanwhocodes/object-schema@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz#e5211452df060fa8522b55c7b3c0c4d1981cb044" + integrity sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw== "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" @@ -723,6 +723,11 @@ dependencies: "@types/yargs-parser" "*" +"@ungap/structured-clone@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" + integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== + acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" @@ -1157,18 +1162,19 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4 resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== -eslint@^8.35.0: - version "8.51.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.51.0.tgz#4a82dae60d209ac89a5cff1604fea978ba4950f3" - integrity sha512-2WuxRZBrlwnXi+/vFSJyjMqrNjtJqiasMzehF0shoLaW7DzS3/9Yvrmq5JiT66+pNjiX4UBnLDiKHcWAr/OInA== +eslint@^8.54.0: + version "8.54.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.54.0.tgz#588e0dd4388af91a2e8fa37ea64924074c783537" + integrity sha512-NY0DfAkM8BIZDVl6PgSa1ttZbx3xHgJzSNJKYcQglem6CppHyMhRIQkBVSSMaSRnLhig3jsDbEzOjwCVt4AmmA== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.6.1" - "@eslint/eslintrc" "^2.1.2" - "@eslint/js" "8.51.0" - "@humanwhocodes/config-array" "^0.11.11" + "@eslint/eslintrc" "^2.1.3" + "@eslint/js" "8.54.0" + "@humanwhocodes/config-array" "^0.11.13" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" + "@ungap/structured-clone" "^1.2.0" ajv "^6.12.4" chalk "^4.0.0" cross-spawn "^7.0.2" @@ -2291,10 +2297,10 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prettier@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643" - integrity sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg== +prettier@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.1.0.tgz#c6d16474a5f764ea1a4a373c593b779697744d5e" + integrity sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw== pretty-format@^29.7.0: version "29.7.0" From a31fcbecac8de9bdcee16afcf01aee127e467b67 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Nov 2023 13:40:02 -0500 Subject: [PATCH 750/785] Fix up README.md formatting --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b4512a99..a0db67ff 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ file](https://prettier.io/docs/en/configuration.html). ```json { - "plugins": ["@prettier/plugin-ruby"], + "plugins": ["@prettier/plugin-ruby"] } ``` From a0fd31cfbdb70f41c7fc4e3c4ef60dbd7e0652cc Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Nov 2023 13:40:32 -0500 Subject: [PATCH 751/785] Update node versions in main.yml --- .github/workflows/main.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 62292d9f..7c247608 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,9 +24,9 @@ jobs: with: bundler-cache: true ruby-version: ${{ matrix.ruby }} - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: 20.x cache: yarn - run: yarn install --frozen-lockfile - run: yarn test @@ -41,9 +41,9 @@ jobs: with: bundler-cache: true ruby-version: "3.0" - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: 20.x cache: yarn - run: yarn install --frozen-lockfile - run: yarn checkFormat @@ -58,9 +58,9 @@ jobs: with: bundler-cache: true ruby-version: "3.2" - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: 20.x cache: yarn - run: yarn install --frozen-lockfile - run: gem build -o prettier.gem From cd4a0dc889f7664422b95538330f37dccc0ee001 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Nov 2023 13:41:25 -0500 Subject: [PATCH 752/785] Update to latest yarn.lock --- yarn.lock | 555 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 283 insertions(+), 272 deletions(-) diff --git a/yarn.lock b/yarn.lock index ca626fa9..34ff2bdd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15,72 +15,73 @@ "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.5.tgz#234d98e1551960604f1246e6475891a570ad5658" - integrity sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.22.13", "@babel/code-frame@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.23.4.tgz#03ae5af150be94392cb5c7ccd97db5a19a5da6aa" + integrity sha512-r1IONyb6Ia+jYR2vvIDhdWdlTGhqbBoFqLTQidzZ4kepUFH15ejXvFHxCVbtl7BOXIudsIubf4E81xeA3h3IXA== dependencies: - "@babel/highlight" "^7.22.5" + "@babel/highlight" "^7.23.4" + chalk "^2.4.2" "@babel/compat-data@^7.22.9": - version "7.22.9" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.22.9.tgz#71cdb00a1ce3a329ce4cbec3a44f9fef35669730" - integrity sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ== + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.23.3.tgz#3febd552541e62b5e883a25eb3effd7c7379db11" + integrity sha512-BmR4bWbDIoFJmJ9z2cZ8Gmm2MXgEDgjdWgpKmKWUt54UGFJdlj31ECtbaDvCG/qVdG3AQ1SfpZEs01lUFbzLOQ== "@babel/core@^7.11.6", "@babel/core@^7.12.3": - version "7.22.9" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.22.9.tgz#bd96492c68822198f33e8a256061da3cf391f58f" - integrity sha512-G2EgeufBcYw27U4hhoIwFcgc1XU7TlXJ3mv04oOv1WCuo900U/anZSPzEqNjwdjgffkk2Gs0AN0dW1CKVLcG7w== + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.23.3.tgz#5ec09c8803b91f51cc887dedc2654a35852849c9" + integrity sha512-Jg+msLuNuCJDyBvFv5+OKOUjWMZgd85bKjbICd3zWrKAo+bJ49HJufi7CQE0q0uR8NGyO6xkCACScNqyjHSZew== dependencies: "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.22.5" - "@babel/generator" "^7.22.9" - "@babel/helper-compilation-targets" "^7.22.9" - "@babel/helper-module-transforms" "^7.22.9" - "@babel/helpers" "^7.22.6" - "@babel/parser" "^7.22.7" - "@babel/template" "^7.22.5" - "@babel/traverse" "^7.22.8" - "@babel/types" "^7.22.5" - convert-source-map "^1.7.0" + "@babel/code-frame" "^7.22.13" + "@babel/generator" "^7.23.3" + "@babel/helper-compilation-targets" "^7.22.15" + "@babel/helper-module-transforms" "^7.23.3" + "@babel/helpers" "^7.23.2" + "@babel/parser" "^7.23.3" + "@babel/template" "^7.22.15" + "@babel/traverse" "^7.23.3" + "@babel/types" "^7.23.3" + convert-source-map "^2.0.0" debug "^4.1.0" gensync "^1.0.0-beta.2" - json5 "^2.2.2" + json5 "^2.2.3" semver "^6.3.1" -"@babel/generator@^7.22.7", "@babel/generator@^7.22.9", "@babel/generator@^7.7.2": - version "7.22.9" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.22.9.tgz#572ecfa7a31002fa1de2a9d91621fd895da8493d" - integrity sha512-KtLMbmicyuK2Ak/FTCJVbDnkN1SlT8/kceFTiuDiiRUUSMnHMidxSCdG4ndkTOHHpoomWe/4xkvHkEOncwjYIw== +"@babel/generator@^7.23.3", "@babel/generator@^7.23.4", "@babel/generator@^7.7.2": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.4.tgz#4a41377d8566ec18f807f42962a7f3551de83d1c" + integrity sha512-esuS49Cga3HcThFNebGhlgsrVLkvhqvYDTzgjfFFlHJcIfLe5jFmRRfCQ1KuBfc4Jrtn3ndLgKWAKjBE+IraYQ== dependencies: - "@babel/types" "^7.22.5" + "@babel/types" "^7.23.4" "@jridgewell/gen-mapping" "^0.3.2" "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" -"@babel/helper-compilation-targets@^7.22.9": - version "7.22.9" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.9.tgz#f9d0a7aaaa7cd32a3f31c9316a69f5a9bcacb892" - integrity sha512-7qYrNM6HjpnPHJbopxmb8hSPoZ0gsX8IvUS32JGVoy+pU9e5N0nLr1VjJoR6kA4d9dmGLxNYOjeB8sUDal2WMw== +"@babel/helper-compilation-targets@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz#0698fc44551a26cf29f18d4662d5bf545a6cfc52" + integrity sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw== dependencies: "@babel/compat-data" "^7.22.9" - "@babel/helper-validator-option" "^7.22.5" + "@babel/helper-validator-option" "^7.22.15" browserslist "^4.21.9" lru-cache "^5.1.1" semver "^6.3.1" -"@babel/helper-environment-visitor@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz#f06dd41b7c1f44e1f8da6c4055b41ab3a09a7e98" - integrity sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q== +"@babel/helper-environment-visitor@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" + integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== -"@babel/helper-function-name@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz#ede300828905bb15e582c037162f99d5183af1be" - integrity sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ== +"@babel/helper-function-name@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" + integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== dependencies: - "@babel/template" "^7.22.5" - "@babel/types" "^7.22.5" + "@babel/template" "^7.22.15" + "@babel/types" "^7.23.0" "@babel/helper-hoist-variables@^7.22.5": version "7.22.5" @@ -89,23 +90,23 @@ dependencies: "@babel/types" "^7.22.5" -"@babel/helper-module-imports@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz#1a8f4c9f4027d23f520bd76b364d44434a72660c" - integrity sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg== +"@babel/helper-module-imports@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz#16146307acdc40cc00c3b2c647713076464bdbf0" + integrity sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w== dependencies: - "@babel/types" "^7.22.5" + "@babel/types" "^7.22.15" -"@babel/helper-module-transforms@^7.22.9": - version "7.22.9" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.22.9.tgz#92dfcb1fbbb2bc62529024f72d942a8c97142129" - integrity sha512-t+WA2Xn5K+rTeGtC8jCsdAH52bjggG5TKRuRrAGNM/mjIbO4GxvlLMFOEz9wXY5I2XQ60PMFsAG2WIcG82dQMQ== +"@babel/helper-module-transforms@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz#d7d12c3c5d30af5b3c0fcab2a6d5217773e2d0f1" + integrity sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ== dependencies: - "@babel/helper-environment-visitor" "^7.22.5" - "@babel/helper-module-imports" "^7.22.5" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-module-imports" "^7.22.15" "@babel/helper-simple-access" "^7.22.5" "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/helper-validator-identifier" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.20" "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.8.0": version "7.22.5" @@ -126,43 +127,43 @@ dependencies: "@babel/types" "^7.22.5" -"@babel/helper-string-parser@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f" - integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== - -"@babel/helper-validator-identifier@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz#9544ef6a33999343c8740fa51350f30eeaaaf193" - integrity sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ== - -"@babel/helper-validator-option@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz#de52000a15a177413c8234fa3a8af4ee8102d0ac" - integrity sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw== - -"@babel/helpers@^7.22.6": - version "7.22.6" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.22.6.tgz#8e61d3395a4f0c5a8060f309fb008200969b5ecd" - integrity sha512-YjDs6y/fVOYFV8hAf1rxd1QvR9wJe1pDBZ2AREKq/SDayfPzgk0PBnVuTCE5X1acEpMMNOVUqoe+OwiZGJ+OaA== - dependencies: - "@babel/template" "^7.22.5" - "@babel/traverse" "^7.22.6" - "@babel/types" "^7.22.5" - -"@babel/highlight@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.5.tgz#aa6c05c5407a67ebce408162b7ede789b4d22031" - integrity sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw== - dependencies: - "@babel/helper-validator-identifier" "^7.22.5" - chalk "^2.0.0" +"@babel/helper-string-parser@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" + integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== + +"@babel/helper-validator-identifier@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" + integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== + +"@babel/helper-validator-option@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz#694c30dfa1d09a6534cdfcafbe56789d36aba040" + integrity sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA== + +"@babel/helpers@^7.23.2": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.23.4.tgz#7d2cfb969aa43222032193accd7329851facf3c1" + integrity sha512-HfcMizYz10cr3h29VqyfGL6ZWIjTwWfvYBMsBVGwpcbhNGe3wQ1ZXZRPzZoAHhd9OqHadHqjQ89iVKINXnbzuw== + dependencies: + "@babel/template" "^7.22.15" + "@babel/traverse" "^7.23.4" + "@babel/types" "^7.23.4" + +"@babel/highlight@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.23.4.tgz#edaadf4d8232e1a961432db785091207ead0621b" + integrity sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A== + dependencies: + "@babel/helper-validator-identifier" "^7.22.20" + chalk "^2.4.2" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.22.5", "@babel/parser@^7.22.7": - version "7.22.7" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.7.tgz#df8cf085ce92ddbdbf668a7f186ce848c9036cae" - integrity sha512-7NF8pOkHP5o2vpmGgNGcfAeCvOYhGLyA3Z4eBQkT1RJlWu47n63bCs93QfJ2hIAFCil7L5P2IWhs1oToVgrL0Q== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.22.15", "@babel/parser@^7.23.3", "@babel/parser@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.4.tgz#409fbe690c333bb70187e2de4021e1e47a026661" + integrity sha512-vf3Xna6UEprW+7t6EtOmFpHNAuxw3xqPZghy+brsnusscJRW5BMUzzHZc5ICjULee81WeUV2jjakG09MDglJXQ== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -200,9 +201,9 @@ "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-jsx@^7.7.2": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz#a6b68e84fb76e759fc3b93e901876ffabbe1d918" - integrity sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg== + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz#8f2e4f8a9b5f9aa16067e142c1ac9cd9f810f473" + integrity sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg== dependencies: "@babel/helper-plugin-utils" "^7.22.5" @@ -256,44 +257,44 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-typescript@^7.7.2": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz#aac8d383b062c5072c647a31ef990c1d0af90272" - integrity sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ== + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.23.3.tgz#24f460c85dbbc983cd2b9c4994178bcc01df958f" + integrity sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ== dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/template@^7.22.5", "@babel/template@^7.3.3": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.5.tgz#0c8c4d944509875849bd0344ff0050756eefc6ec" - integrity sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw== +"@babel/template@^7.22.15", "@babel/template@^7.3.3": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" + integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== dependencies: - "@babel/code-frame" "^7.22.5" - "@babel/parser" "^7.22.5" - "@babel/types" "^7.22.5" + "@babel/code-frame" "^7.22.13" + "@babel/parser" "^7.22.15" + "@babel/types" "^7.22.15" -"@babel/traverse@^7.22.6", "@babel/traverse@^7.22.8": - version "7.22.8" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.8.tgz#4d4451d31bc34efeae01eac222b514a77aa4000e" - integrity sha512-y6LPR+wpM2I3qJrsheCTwhIinzkETbplIgPBbwvqPKc+uljeA5gP+3nP8irdYt1mjQaDnlIcG+dw8OjAco4GXw== +"@babel/traverse@^7.23.3", "@babel/traverse@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.4.tgz#c2790f7edf106d059a0098770fe70801417f3f85" + integrity sha512-IYM8wSUwunWTB6tFC2dkKZhxbIjHoWemdK+3f8/wq8aKhbUscxD5MX72ubd90fxvFknaLPeGw5ycU84V1obHJg== dependencies: - "@babel/code-frame" "^7.22.5" - "@babel/generator" "^7.22.7" - "@babel/helper-environment-visitor" "^7.22.5" - "@babel/helper-function-name" "^7.22.5" + "@babel/code-frame" "^7.23.4" + "@babel/generator" "^7.23.4" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-function-name" "^7.23.0" "@babel/helper-hoist-variables" "^7.22.5" "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/parser" "^7.22.7" - "@babel/types" "^7.22.5" + "@babel/parser" "^7.23.4" + "@babel/types" "^7.23.4" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.22.5", "@babel/types@^7.3.3": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.22.5.tgz#cd93eeaab025880a3a47ec881f4b096a5b786fbe" - integrity sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA== +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.22.15", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.3", "@babel/types@^7.23.4", "@babel/types@^7.3.3": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.4.tgz#7206a1810fc512a7f7f7d4dace4cb4c1c9dbfb8e" + integrity sha512-7uIFwVYpoplT5jp/kVv6EF93VaJ8H+Yn5IczYiaAi98ajzjfoZfslet/e0sLh+wVBjb2qqIut1b0S26VSafsSQ== dependencies: - "@babel/helper-string-parser" "^7.22.5" - "@babel/helper-validator-identifier" "^7.22.5" + "@babel/helper-string-parser" "^7.23.4" + "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" "@bcoe/v8-coverage@^0.2.3": @@ -309,9 +310,9 @@ eslint-visitor-keys "^3.3.0" "@eslint-community/regexpp@^4.6.1": - version "4.6.2" - resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.6.2.tgz#1816b5f6948029c5eaacb0703b850ee0cb37d8f8" - integrity sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw== + version "4.10.0" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.0.tgz#548f6de556857c8bb73bbee70c35dc82a2e74d63" + integrity sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA== "@eslint/eslintrc@^2.1.3": version "2.1.3" @@ -569,33 +570,28 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" -"@jridgewell/resolve-uri@3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" - integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== +"@jridgewell/resolve-uri@^3.1.0": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" + integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== "@jridgewell/set-array@^1.0.1": version "1.1.2" resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== -"@jridgewell/sourcemap-codec@1.4.14": - version "1.4.14" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" - integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== - -"@jridgewell/sourcemap-codec@^1.4.10": +"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": version "1.4.15" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== "@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.9": - version "0.3.18" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz#25783b2086daf6ff1dcb53c9249ae480e4dd4cd6" - integrity sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA== + version "0.3.20" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz#72e45707cf240fa6b081d0366f8265b0cd10197f" + integrity sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q== dependencies: - "@jridgewell/resolve-uri" "3.1.0" - "@jridgewell/sourcemap-codec" "1.4.14" + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -638,9 +634,9 @@ "@sinonjs/commons" "^3.0.0" "@types/babel__core@^7.1.14": - version "7.20.1" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.1.tgz#916ecea274b0c776fec721e333e55762d3a9614b" - integrity sha512-aACu/U/omhdk15O4Nfb+fHgH/z3QsfQzpnvRZhYhThms83ZnAOZz7zZAWO7mn2yyNQaA4xTO8GLK3uqFU4bYYw== + version "7.20.4" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.4.tgz#26a87347e6c6f753b3668398e34496d6d9ac6ac0" + integrity sha512-mLnSC22IC4vcWiuObSRjrLd9XcBTGf59vUSoq2jkQDJ/QQ8PMI9rSuzE+aEV8karUMbskw07bKYoUJCKTUaygg== dependencies: "@babel/parser" "^7.20.7" "@babel/types" "^7.20.7" @@ -649,50 +645,50 @@ "@types/babel__traverse" "*" "@types/babel__generator@*": - version "7.6.4" - resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.4.tgz#1f20ce4c5b1990b37900b63f050182d28c2439b7" - integrity sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg== + version "7.6.7" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.7.tgz#a7aebf15c7bc0eb9abd638bdb5c0b8700399c9d0" + integrity sha512-6Sfsq+EaaLrw4RmdFWE9Onp63TOUue71AWb4Gpa6JxzgTYtimbM086WnYTy2U67AofR++QKCo08ZP6pwx8YFHQ== dependencies: "@babel/types" "^7.0.0" "@types/babel__template@*": - version "7.4.1" - resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.1.tgz#3d1a48fd9d6c0edfd56f2ff578daed48f36c8969" - integrity sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g== + version "7.4.4" + resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.4.tgz#5672513701c1b2199bc6dad636a9d7491586766f" + integrity sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": - version "7.20.1" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.20.1.tgz#dd6f1d2411ae677dcb2db008c962598be31d6acf" - integrity sha512-MitHFXnhtgwsGZWtT68URpOvLN4EREih1u3QtQiN4VdAxWKRVvGCSvw/Qth0M0Qq3pJpnGOu5JaM/ydK7OGbqg== + version "7.20.4" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.20.4.tgz#ec2c06fed6549df8bc0eb4615b683749a4a92e1b" + integrity sha512-mSM/iKUk5fDDrEV/e83qY+Cr3I1+Q3qqTuEn++HAWYjEa1+NxZr6CNrcJGf2ZTnq4HoFGC3zaTPZTobCzCFukA== dependencies: "@babel/types" "^7.20.7" "@types/graceful-fs@^4.1.3": - version "4.1.6" - resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.6.tgz#e14b2576a1c25026b7f02ede1de3b84c3a1efeae" - integrity sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw== + version "4.1.9" + resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.9.tgz#2a06bc0f68a20ab37b3e36aa238be6abdf49e8b4" + integrity sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ== dependencies: "@types/node" "*" "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44" - integrity sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g== + version "2.0.6" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz#7739c232a1fee9b4d3ce8985f314c0c6d33549d7" + integrity sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w== "@types/istanbul-lib-report@*": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#c14c24f18ea8190c118ee7562b7ff99a36552686" - integrity sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg== + version "3.0.3" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz#53047614ae72e19fc0401d872de3ae2b4ce350bf" + integrity sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA== dependencies: "@types/istanbul-lib-coverage" "*" "@types/istanbul-reports@^3.0.0": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz#9153fe98bba2bd565a63add9436d6f0d7f8468ff" - integrity sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw== + version "3.0.4" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz#0f03e3d2f670fbdac586e34b433783070cc16f54" + integrity sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ== dependencies: "@types/istanbul-lib-report" "*" @@ -702,24 +698,26 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*": - version "20.4.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.4.2.tgz#129cc9ae69f93824f92fac653eebfb4812ab4af9" - integrity sha512-Dd0BYtWgnWJKwO1jkmTrzofjK2QXXcai0dmtzvIBhcA+RsG5h8R3xlyta0kGOZRNfL9GuRtb1knmPEhQrePCEw== + version "20.9.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.9.2.tgz#002815c8e87fe0c9369121c78b52e800fadc0ac6" + integrity sha512-WHZXKFCEyIUJzAwh3NyyTHYSR35SevJ6mZ1nWwJafKtiQbqRTIKSRcw3Ma3acqgsent3RRDqeVwpHntMk+9irg== + dependencies: + undici-types "~5.26.4" "@types/stack-utils@^2.0.0": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" - integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== + version "2.0.3" + resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8" + integrity sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw== "@types/yargs-parser@*": - version "21.0.0" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b" - integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== + version "21.0.3" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.3.tgz#815e30b786d2e8f0dcd85fd5bcf5e1a04d008f15" + integrity sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ== "@types/yargs@^17.0.8": - version "17.0.24" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.24.tgz#b3ef8d50ad4aa6aecf6ddc97c580a00f5aa11902" - integrity sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw== + version "17.0.31" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.31.tgz#8fd0089803fd55d8a285895a18b88cb71a99683c" + integrity sha512-bocYSx4DI8TmdlvxqGpVNXOgCNR1Jj0gNPhhAY+iz1rgKDAaYrAYdFYnhDV1IFuiuVc9HkOwyDcFxaTElF3/wg== dependencies: "@types/yargs-parser" "*" @@ -734,9 +732,9 @@ acorn-jsx@^5.3.2: integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== acorn@^8.9.0: - version "8.10.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" - integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== + version "8.11.2" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.2.tgz#ca0d78b51895be5390a5903c5b3bdcdaf78ae40b" + integrity sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w== ajv@^6.12.4: version "6.12.6" @@ -895,14 +893,14 @@ braces@^3.0.2: fill-range "^7.0.1" browserslist@^4.21.9: - version "4.21.9" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.9.tgz#e11bdd3c313d7e2a9e87e8b4b0c7872b13897635" - integrity sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg== + version "4.22.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.22.1.tgz#ba91958d1a59b87dab6fed8dfbcb3da5e2e9c619" + integrity sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ== dependencies: - caniuse-lite "^1.0.30001503" - electron-to-chromium "^1.4.431" - node-releases "^2.0.12" - update-browserslist-db "^1.0.11" + caniuse-lite "^1.0.30001541" + electron-to-chromium "^1.4.535" + node-releases "^2.0.13" + update-browserslist-db "^1.0.13" bser@2.1.1: version "2.1.1" @@ -931,12 +929,12 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001503: - version "1.0.30001515" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001515.tgz#418aefeed9d024cd3129bfae0ccc782d4cb8f12b" - integrity sha512-eEFDwUOZbE24sb+Ecsx3+OvNETqjWIdabMy52oOkIgcUtAsQifjUG9q4U9dgTHJM2mfk4uEPxc0+xuFdJ629QA== +caniuse-lite@^1.0.30001541: + version "1.0.30001563" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001563.tgz#aa68a64188903e98f36eb9c56e48fba0c1fe2a32" + integrity sha512-na2WUmOxnwIZtwnFI2CZ/3er0wdNzU7hN+cPYz/z2ajHThnkWjNBOpEPP4n+4r2WPM847JaMotaJE3bnfzjyKw== -chalk@^2.0.0: +chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -967,9 +965,9 @@ char-regex@^1.0.2: integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== ci-info@^3.2.0: - version "3.8.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.8.0.tgz#81408265a5380c929f0bc665d62256628ce9ef91" - integrity sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw== + version "3.9.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" + integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== cjs-module-lexer@^1.0.0: version "1.2.3" @@ -1024,11 +1022,6 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== -convert-source-map@^1.6.0, convert-source-map@^1.7.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" - integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== - convert-source-map@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" @@ -1064,9 +1057,9 @@ debug@^4.1.0, debug@^4.1.1, debug@^4.3.2: ms "2.1.2" dedent@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.2.0.tgz#32039cd75c035f684e01c4a07cb88c0ecbeb57be" - integrity sha512-i4tcg0ClgvMUSxwHpt+NHQ01ZJmAkl6eBvDNrSZG9e+oLRTCSHv0wpr/Bzjpf6CwKeIHGevE1M34Y1Axdms5VQ== + version "1.5.1" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.5.1.tgz#4f3fc94c8b711e9bb2800d185cd6ad20f2a90aff" + integrity sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg== deep-is@^0.1.3: version "0.1.4" @@ -1095,10 +1088,10 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -electron-to-chromium@^1.4.431: - version "1.4.460" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.460.tgz#f360a5059c039c4a5fb4dfa99680ad8129dd9f84" - integrity sha512-kKiHnbrHME7z8E6AYaw0ehyxY5+hdaRmeUbjBO22LZMdqTYCO29EvF0T1cQ3pJ1RN5fyMcHl1Lmcsdt9WWJpJQ== +electron-to-chromium@^1.4.535: + version "1.4.588" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.588.tgz#d553f3c008e73488fb181fdf2601fdb0b1ffbb78" + integrity sha512-soytjxwbgcCu7nh5Pf4S2/4wa6UIu+A3p03U2yVr53qGxi1/VTR3ENI+p50v+UxqqZAfl48j3z55ud7VHIOr9w== emittery@^0.13.1: version "0.13.1" @@ -1350,17 +1343,18 @@ find-up@^5.0.0: path-exists "^4.0.0" flat-cache@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" - integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== + version "3.2.0" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.2.0.tgz#2c0c2d5040c99b1632771a9d105725c0115363ee" + integrity sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw== dependencies: - flatted "^3.1.0" + flatted "^3.2.9" + keyv "^4.5.3" rimraf "^3.0.2" -flatted@^3.1.0: - version "3.2.7" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" - integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== +flatted@^3.2.9: + version "3.2.9" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.9.tgz#7eb4c67ca1ba34232ca9d2d93e9886e611ad7daf" + integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ== fs.realpath@^1.0.0: version "1.0.0" @@ -1368,14 +1362,14 @@ fs.realpath@^1.0.0: integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== fsevents@^2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" - integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== gensync@^1.0.0-beta.2: version "1.0.0-beta.2" @@ -1429,9 +1423,9 @@ globals@^11.1.0: integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== globals@^13.19.0: - version "13.20.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.20.0.tgz#ea276a1e508ffd4f1612888f9d1bad1e2717bf82" - integrity sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ== + version "13.23.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.23.0.tgz#ef31673c926a0976e1f61dab4dca57e0c0a8af02" + integrity sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA== dependencies: type-fest "^0.20.2" @@ -1455,12 +1449,12 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== +hasown@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.0.tgz#f4c513d454a57b7c7e1650778de226b11700546c" + integrity sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA== dependencies: - function-bind "^1.1.1" + function-bind "^1.1.2" html-escaper@^2.0.0: version "2.0.2" @@ -1483,9 +1477,9 @@ husky@^8.0.1: integrity sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg== ignore@^5.1.4, ignore@^5.2.0: - version "5.2.4" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" - integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== + version "5.3.0" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.0.tgz#67418ae40d34d6999c95ff56016759c718c82f78" + integrity sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg== import-fresh@^3.2.1: version "3.3.0" @@ -1526,12 +1520,12 @@ is-arrayish@^0.2.1: resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== -is-core-module@^2.11.0: - version "2.12.1" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.12.1.tgz#0c0b6885b6f80011c71541ce15c8d66cf5a4f9fd" - integrity sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg== +is-core-module@^2.13.0: + version "2.13.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.1.tgz#ad0d7532c6fea9da1ebdc82742d74525c6273384" + integrity sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw== dependencies: - has "^1.0.3" + hasown "^2.0.0" is-extglob@^2.1.1: version "2.1.1" @@ -1576,9 +1570,9 @@ isexe@^2.0.0: integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" - integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== + version "3.2.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz#2d166c4b0644d43a39f04bf6c2edd1e585f31756" + integrity sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg== istanbul-lib-instrument@^5.0.4: version "5.2.1" @@ -1592,9 +1586,9 @@ istanbul-lib-instrument@^5.0.4: semver "^6.3.0" istanbul-lib-instrument@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.0.tgz#7a8af094cbfff1d5bb280f62ce043695ae8dd5b8" - integrity sha512-x58orMzEVfzPUKqlbLd1hXCnySCxKdDKa6Rjg97CwuLLRI4g3FHTdnExu1OqffVFay6zeMW+T6/DowFLndWnIw== + version "6.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.1.tgz#71e87707e8041428732518c6fb5211761753fbdf" + integrity sha512-EAMEJBsYuyyztxMxW3g7ugGPkrZsV57v0Hmv3mm1uQsmB+QnZuepg731CRaIgeUVSdmsTngOkSnauNF8p7FIhA== dependencies: "@babel/core" "^7.12.3" "@babel/parser" "^7.14.7" @@ -1603,12 +1597,12 @@ istanbul-lib-instrument@^6.0.0: semver "^7.5.4" istanbul-lib-report@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" - integrity sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw== + version "3.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz#908305bac9a5bd175ac6a74489eafd0fc2445a7d" + integrity sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw== dependencies: istanbul-lib-coverage "^3.0.0" - make-dir "^3.0.0" + make-dir "^4.0.0" supports-color "^7.1.0" istanbul-lib-source-maps@^4.0.0: @@ -1621,9 +1615,9 @@ istanbul-lib-source-maps@^4.0.0: source-map "^0.6.1" istanbul-reports@^3.1.3: - version "3.1.5" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.5.tgz#cc9a6ab25cb25659810e4785ed9d9fb742578bae" - integrity sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w== + version "3.1.6" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.6.tgz#2544bcab4768154281a2f0870471902704ccaa1a" + integrity sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg== dependencies: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" @@ -2011,6 +2005,11 @@ jsesc@^2.5.1: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== +json-buffer@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" + integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== + json-parse-even-better-errors@^2.3.0: version "2.3.1" resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" @@ -2026,11 +2025,18 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== -json5@^2.2.2: +json5@^2.2.3: version "2.2.3" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== +keyv@^4.5.3: + version "4.5.4" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" + integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== + dependencies: + json-buffer "3.0.1" + kleur@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" @@ -2087,12 +2093,12 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" -make-dir@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" - integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== +make-dir@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-4.0.0.tgz#c3c2307a771277cd9638305f915c29ae741b614e" + integrity sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw== dependencies: - semver "^6.0.0" + semver "^7.5.3" makeerror@1.0.12: version "1.0.12" @@ -2157,7 +2163,7 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== -node-releases@^2.0.12: +node-releases@^2.0.13: version "2.0.13" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.13.tgz#d5ed1627c23e3461e819b02e57b75e4899b1c81d" integrity sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ== @@ -2340,14 +2346,14 @@ pump@^3.0.0: once "^1.3.1" punycode@^2.1.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" - integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== + version "2.3.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" + integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== pure-rand@^6.0.0: - version "6.0.2" - resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.0.2.tgz#a9c2ddcae9b68d736a8163036f088a2781c8b306" - integrity sha512-6Yg0ekpKICSjPswYOuC5sku/TSWaRYlA0qsXqJgM/d/4pLPHPuTxK7Nbf7jFKzAeedUhR8C7K9Uv63FBsSo8xQ== + version "6.0.4" + resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.0.4.tgz#50b737f6a925468679bff00ad20eade53f37d5c7" + integrity sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA== queue-microtask@^1.2.2: version "1.2.3" @@ -2387,11 +2393,11 @@ resolve.exports@^2.0.0: integrity sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg== resolve@^1.20.0: - version "1.22.2" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.2.tgz#0ed0943d4e301867955766c9f3e1ae6d01c6845f" - integrity sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g== + version "1.22.8" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" + integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== dependencies: - is-core-module "^2.11.0" + is-core-module "^2.13.0" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" @@ -2414,7 +2420,7 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -semver@^6.0.0, semver@^6.3.0, semver@^6.3.1: +semver@^6.3.0, semver@^6.3.1: version "6.3.1" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== @@ -2596,10 +2602,15 @@ type-fest@^0.21.3: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== -update-browserslist-db@^1.0.11: - version "1.0.11" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz#9a2a641ad2907ae7b3616506f4b977851db5b940" - integrity sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA== +undici-types@~5.26.4: + version "5.26.5" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" + integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== + +update-browserslist-db@^1.0.13: + version "1.0.13" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz#3c5e4f5c083661bd38ef64b6328c26ed6c8248c4" + integrity sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg== dependencies: escalade "^3.1.1" picocolors "^1.0.0" @@ -2612,13 +2623,13 @@ uri-js@^4.2.2: punycode "^2.1.0" v8-to-istanbul@^9.0.1: - version "9.1.0" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz#1b83ed4e397f58c85c266a570fc2558b5feb9265" - integrity sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA== + version "9.1.3" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.1.3.tgz#ea456604101cd18005ac2cae3cdd1aa058a6306b" + integrity sha512-9lDD+EVI2fjFsMWXc6dy5JJzBsVTcQ2fVkfBvncZ6xJWG9wtBhOldG+mHkSL0+V1K/xgZz0JDO5UT5hFwHUghg== dependencies: "@jridgewell/trace-mapping" "^0.3.12" "@types/istanbul-lib-coverage" "^2.0.1" - convert-source-map "^1.6.0" + convert-source-map "^2.0.0" walker@^1.0.8: version "1.0.8" From 376b9274e77baa17372e7a35811d75299c87c59f Mon Sep 17 00:00:00 2001 From: Mike Chlipala Date: Fri, 17 Nov 2023 09:14:27 -0800 Subject: [PATCH 753/785] Require haml/rbs dependencies on demand --- src/server.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server.rb b/src/server.rb index e0191853..3429a82d 100644 --- a/src/server.rb +++ b/src/server.rb @@ -4,10 +4,7 @@ require "json" require "socket" -require "prettier_print" require "syntax_tree" -require "syntax_tree/haml" -require "syntax_tree/rbs" # First, require all of the plugins that the user specified. ARGV.shift[/^--plugins=(.*)$/, 1] @@ -100,6 +97,7 @@ formatter.flush formatter.output.join when "rbs" + require "syntax_tree/rbs" formatter = SyntaxTree::RBS::Formatter.new( source, @@ -112,6 +110,8 @@ formatter.flush formatter.output.join when "haml" + require "syntax_tree/haml" + require "prettier_print" formatter = if defined?(SyntaxTree::Haml::Format::Formatter) SyntaxTree::Haml::Format::Formatter.new( From ebd90e53be839211125c86461556873bc2d48692 Mon Sep 17 00:00:00 2001 From: Mike Chlipala Date: Mon, 20 Nov 2023 12:22:26 -0800 Subject: [PATCH 754/785] Require optional dependencies once, rescue LoadErrors --- src/server.rb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/server.rb b/src/server.rb index 3429a82d..f091db06 100644 --- a/src/server.rb +++ b/src/server.rb @@ -6,6 +6,18 @@ require "syntax_tree" +# Optional dependencies +%W[ + syntax_tree/rbs + syntax_tree/haml + prettier_print +].each do |dep| + begin + require dep + rescue LoadError + end +end + # First, require all of the plugins that the user specified. ARGV.shift[/^--plugins=(.*)$/, 1] .split(",") @@ -97,7 +109,6 @@ formatter.flush formatter.output.join when "rbs" - require "syntax_tree/rbs" formatter = SyntaxTree::RBS::Formatter.new( source, @@ -110,8 +121,6 @@ formatter.flush formatter.output.join when "haml" - require "syntax_tree/haml" - require "prettier_print" formatter = if defined?(SyntaxTree::Haml::Format::Formatter) SyntaxTree::Haml::Format::Formatter.new( From 34da38e46cc6ea3641395aa5e9299c4b84febe16 Mon Sep 17 00:00:00 2001 From: Mike Chlipala Date: Mon, 20 Nov 2023 17:55:15 -0800 Subject: [PATCH 755/785] Run prettier on src/server.rb --- src/server.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/server.rb b/src/server.rb index f091db06..d5876cf7 100644 --- a/src/server.rb +++ b/src/server.rb @@ -7,11 +7,7 @@ require "syntax_tree" # Optional dependencies -%W[ - syntax_tree/rbs - syntax_tree/haml - prettier_print -].each do |dep| +%W[syntax_tree/rbs syntax_tree/haml prettier_print].each do |dep| begin require dep rescue LoadError From dc6b48dbce394180903f037be188fa7405de869d Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Nov 2023 13:38:25 -0500 Subject: [PATCH 756/785] Bump to latest --- package.json | 4 ++-- yarn.lock | 62 ++++++++++++++++++++++++++++------------------------ 2 files changed, 36 insertions(+), 30 deletions(-) diff --git a/package.json b/package.json index d09fde8c..538fef64 100644 --- a/package.json +++ b/package.json @@ -23,11 +23,11 @@ "prettier": "^3.0.0" }, "devDependencies": { - "eslint": "^8.35.0", + "eslint": "^8.54.0", "eslint-config-prettier": "^9.0.0", "husky": "^8.0.1", "jest": "^29.5.0", - "prettier": "^3.0.0", + "prettier": "^3.1.0", "pretty-quick": "^3.1.2" }, "eslintConfig": { diff --git a/yarn.lock b/yarn.lock index 63b633fd..ca626fa9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -313,10 +313,10 @@ resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.6.2.tgz#1816b5f6948029c5eaacb0703b850ee0cb37d8f8" integrity sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw== -"@eslint/eslintrc@^2.1.2": - version "2.1.2" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.2.tgz#c6936b4b328c64496692f76944e755738be62396" - integrity sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g== +"@eslint/eslintrc@^2.1.3": + version "2.1.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.3.tgz#797470a75fe0fbd5a53350ee715e85e87baff22d" + integrity sha512-yZzuIG+jnVu6hNSzFEN07e8BxF3uAzYtQb6uDkaYZLo6oYZDCq454c5kB8zxnzfCYyP4MIuyBn10L0DqwujTmA== dependencies: ajv "^6.12.4" debug "^4.3.2" @@ -328,17 +328,17 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.51.0": - version "8.51.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.51.0.tgz#6d419c240cfb2b66da37df230f7e7eef801c32fa" - integrity sha512-HxjQ8Qn+4SI3/AFv6sOrDB+g6PpUTDwSJiQqOrnneEk8L71161srI9gjzzZvYVbzHiVg/BvcH95+cK/zfIt4pg== +"@eslint/js@8.54.0": + version "8.54.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.54.0.tgz#4fab9a2ff7860082c304f750e94acd644cf984cf" + integrity sha512-ut5V+D+fOoWPgGGNj83GGjnntO39xDy6DWxO0wb7Jp3DcMX0TfIqdzHF85VTQkerdyGmuuMD9AKAo5KiNlf/AQ== -"@humanwhocodes/config-array@^0.11.11": - version "0.11.11" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.11.tgz#88a04c570dbbc7dd943e4712429c3df09bc32844" - integrity sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA== +"@humanwhocodes/config-array@^0.11.13": + version "0.11.13" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.13.tgz#075dc9684f40a531d9b26b0822153c1e832ee297" + integrity sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ== dependencies: - "@humanwhocodes/object-schema" "^1.2.1" + "@humanwhocodes/object-schema" "^2.0.1" debug "^4.1.1" minimatch "^3.0.5" @@ -347,10 +347,10 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== -"@humanwhocodes/object-schema@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" - integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== +"@humanwhocodes/object-schema@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz#e5211452df060fa8522b55c7b3c0c4d1981cb044" + integrity sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw== "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" @@ -723,6 +723,11 @@ dependencies: "@types/yargs-parser" "*" +"@ungap/structured-clone@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" + integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== + acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" @@ -1157,18 +1162,19 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4 resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== -eslint@^8.35.0: - version "8.51.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.51.0.tgz#4a82dae60d209ac89a5cff1604fea978ba4950f3" - integrity sha512-2WuxRZBrlwnXi+/vFSJyjMqrNjtJqiasMzehF0shoLaW7DzS3/9Yvrmq5JiT66+pNjiX4UBnLDiKHcWAr/OInA== +eslint@^8.54.0: + version "8.54.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.54.0.tgz#588e0dd4388af91a2e8fa37ea64924074c783537" + integrity sha512-NY0DfAkM8BIZDVl6PgSa1ttZbx3xHgJzSNJKYcQglem6CppHyMhRIQkBVSSMaSRnLhig3jsDbEzOjwCVt4AmmA== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.6.1" - "@eslint/eslintrc" "^2.1.2" - "@eslint/js" "8.51.0" - "@humanwhocodes/config-array" "^0.11.11" + "@eslint/eslintrc" "^2.1.3" + "@eslint/js" "8.54.0" + "@humanwhocodes/config-array" "^0.11.13" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" + "@ungap/structured-clone" "^1.2.0" ajv "^6.12.4" chalk "^4.0.0" cross-spawn "^7.0.2" @@ -2291,10 +2297,10 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prettier@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643" - integrity sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg== +prettier@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.1.0.tgz#c6d16474a5f764ea1a4a373c593b779697744d5e" + integrity sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw== pretty-format@^29.7.0: version "29.7.0" From ea96a3f903417793c5f47f460f2f6cf656c230b5 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Nov 2023 13:40:32 -0500 Subject: [PATCH 757/785] Update node versions in main.yml --- .github/workflows/main.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 62292d9f..7c247608 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,9 +24,9 @@ jobs: with: bundler-cache: true ruby-version: ${{ matrix.ruby }} - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: 20.x cache: yarn - run: yarn install --frozen-lockfile - run: yarn test @@ -41,9 +41,9 @@ jobs: with: bundler-cache: true ruby-version: "3.0" - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: 20.x cache: yarn - run: yarn install --frozen-lockfile - run: yarn checkFormat @@ -58,9 +58,9 @@ jobs: with: bundler-cache: true ruby-version: "3.2" - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: 20.x cache: yarn - run: yarn install --frozen-lockfile - run: gem build -o prettier.gem From 79d96d9feafc1f8e186a04260e66bee0df68e4ed Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 20 Nov 2023 13:41:25 -0500 Subject: [PATCH 758/785] Update to latest yarn.lock --- yarn.lock | 555 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 283 insertions(+), 272 deletions(-) diff --git a/yarn.lock b/yarn.lock index ca626fa9..34ff2bdd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15,72 +15,73 @@ "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.5.tgz#234d98e1551960604f1246e6475891a570ad5658" - integrity sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.22.13", "@babel/code-frame@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.23.4.tgz#03ae5af150be94392cb5c7ccd97db5a19a5da6aa" + integrity sha512-r1IONyb6Ia+jYR2vvIDhdWdlTGhqbBoFqLTQidzZ4kepUFH15ejXvFHxCVbtl7BOXIudsIubf4E81xeA3h3IXA== dependencies: - "@babel/highlight" "^7.22.5" + "@babel/highlight" "^7.23.4" + chalk "^2.4.2" "@babel/compat-data@^7.22.9": - version "7.22.9" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.22.9.tgz#71cdb00a1ce3a329ce4cbec3a44f9fef35669730" - integrity sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ== + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.23.3.tgz#3febd552541e62b5e883a25eb3effd7c7379db11" + integrity sha512-BmR4bWbDIoFJmJ9z2cZ8Gmm2MXgEDgjdWgpKmKWUt54UGFJdlj31ECtbaDvCG/qVdG3AQ1SfpZEs01lUFbzLOQ== "@babel/core@^7.11.6", "@babel/core@^7.12.3": - version "7.22.9" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.22.9.tgz#bd96492c68822198f33e8a256061da3cf391f58f" - integrity sha512-G2EgeufBcYw27U4hhoIwFcgc1XU7TlXJ3mv04oOv1WCuo900U/anZSPzEqNjwdjgffkk2Gs0AN0dW1CKVLcG7w== + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.23.3.tgz#5ec09c8803b91f51cc887dedc2654a35852849c9" + integrity sha512-Jg+msLuNuCJDyBvFv5+OKOUjWMZgd85bKjbICd3zWrKAo+bJ49HJufi7CQE0q0uR8NGyO6xkCACScNqyjHSZew== dependencies: "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.22.5" - "@babel/generator" "^7.22.9" - "@babel/helper-compilation-targets" "^7.22.9" - "@babel/helper-module-transforms" "^7.22.9" - "@babel/helpers" "^7.22.6" - "@babel/parser" "^7.22.7" - "@babel/template" "^7.22.5" - "@babel/traverse" "^7.22.8" - "@babel/types" "^7.22.5" - convert-source-map "^1.7.0" + "@babel/code-frame" "^7.22.13" + "@babel/generator" "^7.23.3" + "@babel/helper-compilation-targets" "^7.22.15" + "@babel/helper-module-transforms" "^7.23.3" + "@babel/helpers" "^7.23.2" + "@babel/parser" "^7.23.3" + "@babel/template" "^7.22.15" + "@babel/traverse" "^7.23.3" + "@babel/types" "^7.23.3" + convert-source-map "^2.0.0" debug "^4.1.0" gensync "^1.0.0-beta.2" - json5 "^2.2.2" + json5 "^2.2.3" semver "^6.3.1" -"@babel/generator@^7.22.7", "@babel/generator@^7.22.9", "@babel/generator@^7.7.2": - version "7.22.9" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.22.9.tgz#572ecfa7a31002fa1de2a9d91621fd895da8493d" - integrity sha512-KtLMbmicyuK2Ak/FTCJVbDnkN1SlT8/kceFTiuDiiRUUSMnHMidxSCdG4ndkTOHHpoomWe/4xkvHkEOncwjYIw== +"@babel/generator@^7.23.3", "@babel/generator@^7.23.4", "@babel/generator@^7.7.2": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.4.tgz#4a41377d8566ec18f807f42962a7f3551de83d1c" + integrity sha512-esuS49Cga3HcThFNebGhlgsrVLkvhqvYDTzgjfFFlHJcIfLe5jFmRRfCQ1KuBfc4Jrtn3ndLgKWAKjBE+IraYQ== dependencies: - "@babel/types" "^7.22.5" + "@babel/types" "^7.23.4" "@jridgewell/gen-mapping" "^0.3.2" "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" -"@babel/helper-compilation-targets@^7.22.9": - version "7.22.9" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.9.tgz#f9d0a7aaaa7cd32a3f31c9316a69f5a9bcacb892" - integrity sha512-7qYrNM6HjpnPHJbopxmb8hSPoZ0gsX8IvUS32JGVoy+pU9e5N0nLr1VjJoR6kA4d9dmGLxNYOjeB8sUDal2WMw== +"@babel/helper-compilation-targets@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz#0698fc44551a26cf29f18d4662d5bf545a6cfc52" + integrity sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw== dependencies: "@babel/compat-data" "^7.22.9" - "@babel/helper-validator-option" "^7.22.5" + "@babel/helper-validator-option" "^7.22.15" browserslist "^4.21.9" lru-cache "^5.1.1" semver "^6.3.1" -"@babel/helper-environment-visitor@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz#f06dd41b7c1f44e1f8da6c4055b41ab3a09a7e98" - integrity sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q== +"@babel/helper-environment-visitor@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" + integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== -"@babel/helper-function-name@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz#ede300828905bb15e582c037162f99d5183af1be" - integrity sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ== +"@babel/helper-function-name@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" + integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== dependencies: - "@babel/template" "^7.22.5" - "@babel/types" "^7.22.5" + "@babel/template" "^7.22.15" + "@babel/types" "^7.23.0" "@babel/helper-hoist-variables@^7.22.5": version "7.22.5" @@ -89,23 +90,23 @@ dependencies: "@babel/types" "^7.22.5" -"@babel/helper-module-imports@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz#1a8f4c9f4027d23f520bd76b364d44434a72660c" - integrity sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg== +"@babel/helper-module-imports@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz#16146307acdc40cc00c3b2c647713076464bdbf0" + integrity sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w== dependencies: - "@babel/types" "^7.22.5" + "@babel/types" "^7.22.15" -"@babel/helper-module-transforms@^7.22.9": - version "7.22.9" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.22.9.tgz#92dfcb1fbbb2bc62529024f72d942a8c97142129" - integrity sha512-t+WA2Xn5K+rTeGtC8jCsdAH52bjggG5TKRuRrAGNM/mjIbO4GxvlLMFOEz9wXY5I2XQ60PMFsAG2WIcG82dQMQ== +"@babel/helper-module-transforms@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz#d7d12c3c5d30af5b3c0fcab2a6d5217773e2d0f1" + integrity sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ== dependencies: - "@babel/helper-environment-visitor" "^7.22.5" - "@babel/helper-module-imports" "^7.22.5" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-module-imports" "^7.22.15" "@babel/helper-simple-access" "^7.22.5" "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/helper-validator-identifier" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.20" "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.8.0": version "7.22.5" @@ -126,43 +127,43 @@ dependencies: "@babel/types" "^7.22.5" -"@babel/helper-string-parser@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f" - integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== - -"@babel/helper-validator-identifier@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz#9544ef6a33999343c8740fa51350f30eeaaaf193" - integrity sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ== - -"@babel/helper-validator-option@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz#de52000a15a177413c8234fa3a8af4ee8102d0ac" - integrity sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw== - -"@babel/helpers@^7.22.6": - version "7.22.6" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.22.6.tgz#8e61d3395a4f0c5a8060f309fb008200969b5ecd" - integrity sha512-YjDs6y/fVOYFV8hAf1rxd1QvR9wJe1pDBZ2AREKq/SDayfPzgk0PBnVuTCE5X1acEpMMNOVUqoe+OwiZGJ+OaA== - dependencies: - "@babel/template" "^7.22.5" - "@babel/traverse" "^7.22.6" - "@babel/types" "^7.22.5" - -"@babel/highlight@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.5.tgz#aa6c05c5407a67ebce408162b7ede789b4d22031" - integrity sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw== - dependencies: - "@babel/helper-validator-identifier" "^7.22.5" - chalk "^2.0.0" +"@babel/helper-string-parser@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" + integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== + +"@babel/helper-validator-identifier@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" + integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== + +"@babel/helper-validator-option@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz#694c30dfa1d09a6534cdfcafbe56789d36aba040" + integrity sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA== + +"@babel/helpers@^7.23.2": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.23.4.tgz#7d2cfb969aa43222032193accd7329851facf3c1" + integrity sha512-HfcMizYz10cr3h29VqyfGL6ZWIjTwWfvYBMsBVGwpcbhNGe3wQ1ZXZRPzZoAHhd9OqHadHqjQ89iVKINXnbzuw== + dependencies: + "@babel/template" "^7.22.15" + "@babel/traverse" "^7.23.4" + "@babel/types" "^7.23.4" + +"@babel/highlight@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.23.4.tgz#edaadf4d8232e1a961432db785091207ead0621b" + integrity sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A== + dependencies: + "@babel/helper-validator-identifier" "^7.22.20" + chalk "^2.4.2" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.22.5", "@babel/parser@^7.22.7": - version "7.22.7" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.7.tgz#df8cf085ce92ddbdbf668a7f186ce848c9036cae" - integrity sha512-7NF8pOkHP5o2vpmGgNGcfAeCvOYhGLyA3Z4eBQkT1RJlWu47n63bCs93QfJ2hIAFCil7L5P2IWhs1oToVgrL0Q== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.22.15", "@babel/parser@^7.23.3", "@babel/parser@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.4.tgz#409fbe690c333bb70187e2de4021e1e47a026661" + integrity sha512-vf3Xna6UEprW+7t6EtOmFpHNAuxw3xqPZghy+brsnusscJRW5BMUzzHZc5ICjULee81WeUV2jjakG09MDglJXQ== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -200,9 +201,9 @@ "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-jsx@^7.7.2": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz#a6b68e84fb76e759fc3b93e901876ffabbe1d918" - integrity sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg== + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz#8f2e4f8a9b5f9aa16067e142c1ac9cd9f810f473" + integrity sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg== dependencies: "@babel/helper-plugin-utils" "^7.22.5" @@ -256,44 +257,44 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-typescript@^7.7.2": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz#aac8d383b062c5072c647a31ef990c1d0af90272" - integrity sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ== + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.23.3.tgz#24f460c85dbbc983cd2b9c4994178bcc01df958f" + integrity sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ== dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/template@^7.22.5", "@babel/template@^7.3.3": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.5.tgz#0c8c4d944509875849bd0344ff0050756eefc6ec" - integrity sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw== +"@babel/template@^7.22.15", "@babel/template@^7.3.3": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" + integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== dependencies: - "@babel/code-frame" "^7.22.5" - "@babel/parser" "^7.22.5" - "@babel/types" "^7.22.5" + "@babel/code-frame" "^7.22.13" + "@babel/parser" "^7.22.15" + "@babel/types" "^7.22.15" -"@babel/traverse@^7.22.6", "@babel/traverse@^7.22.8": - version "7.22.8" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.8.tgz#4d4451d31bc34efeae01eac222b514a77aa4000e" - integrity sha512-y6LPR+wpM2I3qJrsheCTwhIinzkETbplIgPBbwvqPKc+uljeA5gP+3nP8irdYt1mjQaDnlIcG+dw8OjAco4GXw== +"@babel/traverse@^7.23.3", "@babel/traverse@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.4.tgz#c2790f7edf106d059a0098770fe70801417f3f85" + integrity sha512-IYM8wSUwunWTB6tFC2dkKZhxbIjHoWemdK+3f8/wq8aKhbUscxD5MX72ubd90fxvFknaLPeGw5ycU84V1obHJg== dependencies: - "@babel/code-frame" "^7.22.5" - "@babel/generator" "^7.22.7" - "@babel/helper-environment-visitor" "^7.22.5" - "@babel/helper-function-name" "^7.22.5" + "@babel/code-frame" "^7.23.4" + "@babel/generator" "^7.23.4" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-function-name" "^7.23.0" "@babel/helper-hoist-variables" "^7.22.5" "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/parser" "^7.22.7" - "@babel/types" "^7.22.5" + "@babel/parser" "^7.23.4" + "@babel/types" "^7.23.4" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.22.5", "@babel/types@^7.3.3": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.22.5.tgz#cd93eeaab025880a3a47ec881f4b096a5b786fbe" - integrity sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA== +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.22.15", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.3", "@babel/types@^7.23.4", "@babel/types@^7.3.3": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.4.tgz#7206a1810fc512a7f7f7d4dace4cb4c1c9dbfb8e" + integrity sha512-7uIFwVYpoplT5jp/kVv6EF93VaJ8H+Yn5IczYiaAi98ajzjfoZfslet/e0sLh+wVBjb2qqIut1b0S26VSafsSQ== dependencies: - "@babel/helper-string-parser" "^7.22.5" - "@babel/helper-validator-identifier" "^7.22.5" + "@babel/helper-string-parser" "^7.23.4" + "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" "@bcoe/v8-coverage@^0.2.3": @@ -309,9 +310,9 @@ eslint-visitor-keys "^3.3.0" "@eslint-community/regexpp@^4.6.1": - version "4.6.2" - resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.6.2.tgz#1816b5f6948029c5eaacb0703b850ee0cb37d8f8" - integrity sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw== + version "4.10.0" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.0.tgz#548f6de556857c8bb73bbee70c35dc82a2e74d63" + integrity sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA== "@eslint/eslintrc@^2.1.3": version "2.1.3" @@ -569,33 +570,28 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" -"@jridgewell/resolve-uri@3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" - integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== +"@jridgewell/resolve-uri@^3.1.0": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" + integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== "@jridgewell/set-array@^1.0.1": version "1.1.2" resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== -"@jridgewell/sourcemap-codec@1.4.14": - version "1.4.14" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" - integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== - -"@jridgewell/sourcemap-codec@^1.4.10": +"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": version "1.4.15" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== "@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.9": - version "0.3.18" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz#25783b2086daf6ff1dcb53c9249ae480e4dd4cd6" - integrity sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA== + version "0.3.20" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz#72e45707cf240fa6b081d0366f8265b0cd10197f" + integrity sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q== dependencies: - "@jridgewell/resolve-uri" "3.1.0" - "@jridgewell/sourcemap-codec" "1.4.14" + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -638,9 +634,9 @@ "@sinonjs/commons" "^3.0.0" "@types/babel__core@^7.1.14": - version "7.20.1" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.1.tgz#916ecea274b0c776fec721e333e55762d3a9614b" - integrity sha512-aACu/U/omhdk15O4Nfb+fHgH/z3QsfQzpnvRZhYhThms83ZnAOZz7zZAWO7mn2yyNQaA4xTO8GLK3uqFU4bYYw== + version "7.20.4" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.4.tgz#26a87347e6c6f753b3668398e34496d6d9ac6ac0" + integrity sha512-mLnSC22IC4vcWiuObSRjrLd9XcBTGf59vUSoq2jkQDJ/QQ8PMI9rSuzE+aEV8karUMbskw07bKYoUJCKTUaygg== dependencies: "@babel/parser" "^7.20.7" "@babel/types" "^7.20.7" @@ -649,50 +645,50 @@ "@types/babel__traverse" "*" "@types/babel__generator@*": - version "7.6.4" - resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.4.tgz#1f20ce4c5b1990b37900b63f050182d28c2439b7" - integrity sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg== + version "7.6.7" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.7.tgz#a7aebf15c7bc0eb9abd638bdb5c0b8700399c9d0" + integrity sha512-6Sfsq+EaaLrw4RmdFWE9Onp63TOUue71AWb4Gpa6JxzgTYtimbM086WnYTy2U67AofR++QKCo08ZP6pwx8YFHQ== dependencies: "@babel/types" "^7.0.0" "@types/babel__template@*": - version "7.4.1" - resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.1.tgz#3d1a48fd9d6c0edfd56f2ff578daed48f36c8969" - integrity sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g== + version "7.4.4" + resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.4.tgz#5672513701c1b2199bc6dad636a9d7491586766f" + integrity sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": - version "7.20.1" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.20.1.tgz#dd6f1d2411ae677dcb2db008c962598be31d6acf" - integrity sha512-MitHFXnhtgwsGZWtT68URpOvLN4EREih1u3QtQiN4VdAxWKRVvGCSvw/Qth0M0Qq3pJpnGOu5JaM/ydK7OGbqg== + version "7.20.4" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.20.4.tgz#ec2c06fed6549df8bc0eb4615b683749a4a92e1b" + integrity sha512-mSM/iKUk5fDDrEV/e83qY+Cr3I1+Q3qqTuEn++HAWYjEa1+NxZr6CNrcJGf2ZTnq4HoFGC3zaTPZTobCzCFukA== dependencies: "@babel/types" "^7.20.7" "@types/graceful-fs@^4.1.3": - version "4.1.6" - resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.6.tgz#e14b2576a1c25026b7f02ede1de3b84c3a1efeae" - integrity sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw== + version "4.1.9" + resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.9.tgz#2a06bc0f68a20ab37b3e36aa238be6abdf49e8b4" + integrity sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ== dependencies: "@types/node" "*" "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44" - integrity sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g== + version "2.0.6" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz#7739c232a1fee9b4d3ce8985f314c0c6d33549d7" + integrity sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w== "@types/istanbul-lib-report@*": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#c14c24f18ea8190c118ee7562b7ff99a36552686" - integrity sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg== + version "3.0.3" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz#53047614ae72e19fc0401d872de3ae2b4ce350bf" + integrity sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA== dependencies: "@types/istanbul-lib-coverage" "*" "@types/istanbul-reports@^3.0.0": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz#9153fe98bba2bd565a63add9436d6f0d7f8468ff" - integrity sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw== + version "3.0.4" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz#0f03e3d2f670fbdac586e34b433783070cc16f54" + integrity sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ== dependencies: "@types/istanbul-lib-report" "*" @@ -702,24 +698,26 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*": - version "20.4.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.4.2.tgz#129cc9ae69f93824f92fac653eebfb4812ab4af9" - integrity sha512-Dd0BYtWgnWJKwO1jkmTrzofjK2QXXcai0dmtzvIBhcA+RsG5h8R3xlyta0kGOZRNfL9GuRtb1knmPEhQrePCEw== + version "20.9.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.9.2.tgz#002815c8e87fe0c9369121c78b52e800fadc0ac6" + integrity sha512-WHZXKFCEyIUJzAwh3NyyTHYSR35SevJ6mZ1nWwJafKtiQbqRTIKSRcw3Ma3acqgsent3RRDqeVwpHntMk+9irg== + dependencies: + undici-types "~5.26.4" "@types/stack-utils@^2.0.0": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" - integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== + version "2.0.3" + resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8" + integrity sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw== "@types/yargs-parser@*": - version "21.0.0" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b" - integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== + version "21.0.3" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.3.tgz#815e30b786d2e8f0dcd85fd5bcf5e1a04d008f15" + integrity sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ== "@types/yargs@^17.0.8": - version "17.0.24" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.24.tgz#b3ef8d50ad4aa6aecf6ddc97c580a00f5aa11902" - integrity sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw== + version "17.0.31" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.31.tgz#8fd0089803fd55d8a285895a18b88cb71a99683c" + integrity sha512-bocYSx4DI8TmdlvxqGpVNXOgCNR1Jj0gNPhhAY+iz1rgKDAaYrAYdFYnhDV1IFuiuVc9HkOwyDcFxaTElF3/wg== dependencies: "@types/yargs-parser" "*" @@ -734,9 +732,9 @@ acorn-jsx@^5.3.2: integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== acorn@^8.9.0: - version "8.10.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" - integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== + version "8.11.2" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.2.tgz#ca0d78b51895be5390a5903c5b3bdcdaf78ae40b" + integrity sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w== ajv@^6.12.4: version "6.12.6" @@ -895,14 +893,14 @@ braces@^3.0.2: fill-range "^7.0.1" browserslist@^4.21.9: - version "4.21.9" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.9.tgz#e11bdd3c313d7e2a9e87e8b4b0c7872b13897635" - integrity sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg== + version "4.22.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.22.1.tgz#ba91958d1a59b87dab6fed8dfbcb3da5e2e9c619" + integrity sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ== dependencies: - caniuse-lite "^1.0.30001503" - electron-to-chromium "^1.4.431" - node-releases "^2.0.12" - update-browserslist-db "^1.0.11" + caniuse-lite "^1.0.30001541" + electron-to-chromium "^1.4.535" + node-releases "^2.0.13" + update-browserslist-db "^1.0.13" bser@2.1.1: version "2.1.1" @@ -931,12 +929,12 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001503: - version "1.0.30001515" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001515.tgz#418aefeed9d024cd3129bfae0ccc782d4cb8f12b" - integrity sha512-eEFDwUOZbE24sb+Ecsx3+OvNETqjWIdabMy52oOkIgcUtAsQifjUG9q4U9dgTHJM2mfk4uEPxc0+xuFdJ629QA== +caniuse-lite@^1.0.30001541: + version "1.0.30001563" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001563.tgz#aa68a64188903e98f36eb9c56e48fba0c1fe2a32" + integrity sha512-na2WUmOxnwIZtwnFI2CZ/3er0wdNzU7hN+cPYz/z2ajHThnkWjNBOpEPP4n+4r2WPM847JaMotaJE3bnfzjyKw== -chalk@^2.0.0: +chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -967,9 +965,9 @@ char-regex@^1.0.2: integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== ci-info@^3.2.0: - version "3.8.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.8.0.tgz#81408265a5380c929f0bc665d62256628ce9ef91" - integrity sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw== + version "3.9.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" + integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== cjs-module-lexer@^1.0.0: version "1.2.3" @@ -1024,11 +1022,6 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== -convert-source-map@^1.6.0, convert-source-map@^1.7.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" - integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== - convert-source-map@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" @@ -1064,9 +1057,9 @@ debug@^4.1.0, debug@^4.1.1, debug@^4.3.2: ms "2.1.2" dedent@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.2.0.tgz#32039cd75c035f684e01c4a07cb88c0ecbeb57be" - integrity sha512-i4tcg0ClgvMUSxwHpt+NHQ01ZJmAkl6eBvDNrSZG9e+oLRTCSHv0wpr/Bzjpf6CwKeIHGevE1M34Y1Axdms5VQ== + version "1.5.1" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.5.1.tgz#4f3fc94c8b711e9bb2800d185cd6ad20f2a90aff" + integrity sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg== deep-is@^0.1.3: version "0.1.4" @@ -1095,10 +1088,10 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -electron-to-chromium@^1.4.431: - version "1.4.460" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.460.tgz#f360a5059c039c4a5fb4dfa99680ad8129dd9f84" - integrity sha512-kKiHnbrHME7z8E6AYaw0ehyxY5+hdaRmeUbjBO22LZMdqTYCO29EvF0T1cQ3pJ1RN5fyMcHl1Lmcsdt9WWJpJQ== +electron-to-chromium@^1.4.535: + version "1.4.588" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.588.tgz#d553f3c008e73488fb181fdf2601fdb0b1ffbb78" + integrity sha512-soytjxwbgcCu7nh5Pf4S2/4wa6UIu+A3p03U2yVr53qGxi1/VTR3ENI+p50v+UxqqZAfl48j3z55ud7VHIOr9w== emittery@^0.13.1: version "0.13.1" @@ -1350,17 +1343,18 @@ find-up@^5.0.0: path-exists "^4.0.0" flat-cache@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" - integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== + version "3.2.0" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.2.0.tgz#2c0c2d5040c99b1632771a9d105725c0115363ee" + integrity sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw== dependencies: - flatted "^3.1.0" + flatted "^3.2.9" + keyv "^4.5.3" rimraf "^3.0.2" -flatted@^3.1.0: - version "3.2.7" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" - integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== +flatted@^3.2.9: + version "3.2.9" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.9.tgz#7eb4c67ca1ba34232ca9d2d93e9886e611ad7daf" + integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ== fs.realpath@^1.0.0: version "1.0.0" @@ -1368,14 +1362,14 @@ fs.realpath@^1.0.0: integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== fsevents@^2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" - integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== gensync@^1.0.0-beta.2: version "1.0.0-beta.2" @@ -1429,9 +1423,9 @@ globals@^11.1.0: integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== globals@^13.19.0: - version "13.20.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.20.0.tgz#ea276a1e508ffd4f1612888f9d1bad1e2717bf82" - integrity sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ== + version "13.23.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.23.0.tgz#ef31673c926a0976e1f61dab4dca57e0c0a8af02" + integrity sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA== dependencies: type-fest "^0.20.2" @@ -1455,12 +1449,12 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== +hasown@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.0.tgz#f4c513d454a57b7c7e1650778de226b11700546c" + integrity sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA== dependencies: - function-bind "^1.1.1" + function-bind "^1.1.2" html-escaper@^2.0.0: version "2.0.2" @@ -1483,9 +1477,9 @@ husky@^8.0.1: integrity sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg== ignore@^5.1.4, ignore@^5.2.0: - version "5.2.4" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" - integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== + version "5.3.0" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.0.tgz#67418ae40d34d6999c95ff56016759c718c82f78" + integrity sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg== import-fresh@^3.2.1: version "3.3.0" @@ -1526,12 +1520,12 @@ is-arrayish@^0.2.1: resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== -is-core-module@^2.11.0: - version "2.12.1" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.12.1.tgz#0c0b6885b6f80011c71541ce15c8d66cf5a4f9fd" - integrity sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg== +is-core-module@^2.13.0: + version "2.13.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.1.tgz#ad0d7532c6fea9da1ebdc82742d74525c6273384" + integrity sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw== dependencies: - has "^1.0.3" + hasown "^2.0.0" is-extglob@^2.1.1: version "2.1.1" @@ -1576,9 +1570,9 @@ isexe@^2.0.0: integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" - integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== + version "3.2.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz#2d166c4b0644d43a39f04bf6c2edd1e585f31756" + integrity sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg== istanbul-lib-instrument@^5.0.4: version "5.2.1" @@ -1592,9 +1586,9 @@ istanbul-lib-instrument@^5.0.4: semver "^6.3.0" istanbul-lib-instrument@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.0.tgz#7a8af094cbfff1d5bb280f62ce043695ae8dd5b8" - integrity sha512-x58orMzEVfzPUKqlbLd1hXCnySCxKdDKa6Rjg97CwuLLRI4g3FHTdnExu1OqffVFay6zeMW+T6/DowFLndWnIw== + version "6.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.1.tgz#71e87707e8041428732518c6fb5211761753fbdf" + integrity sha512-EAMEJBsYuyyztxMxW3g7ugGPkrZsV57v0Hmv3mm1uQsmB+QnZuepg731CRaIgeUVSdmsTngOkSnauNF8p7FIhA== dependencies: "@babel/core" "^7.12.3" "@babel/parser" "^7.14.7" @@ -1603,12 +1597,12 @@ istanbul-lib-instrument@^6.0.0: semver "^7.5.4" istanbul-lib-report@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" - integrity sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw== + version "3.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz#908305bac9a5bd175ac6a74489eafd0fc2445a7d" + integrity sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw== dependencies: istanbul-lib-coverage "^3.0.0" - make-dir "^3.0.0" + make-dir "^4.0.0" supports-color "^7.1.0" istanbul-lib-source-maps@^4.0.0: @@ -1621,9 +1615,9 @@ istanbul-lib-source-maps@^4.0.0: source-map "^0.6.1" istanbul-reports@^3.1.3: - version "3.1.5" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.5.tgz#cc9a6ab25cb25659810e4785ed9d9fb742578bae" - integrity sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w== + version "3.1.6" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.6.tgz#2544bcab4768154281a2f0870471902704ccaa1a" + integrity sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg== dependencies: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" @@ -2011,6 +2005,11 @@ jsesc@^2.5.1: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== +json-buffer@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" + integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== + json-parse-even-better-errors@^2.3.0: version "2.3.1" resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" @@ -2026,11 +2025,18 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== -json5@^2.2.2: +json5@^2.2.3: version "2.2.3" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== +keyv@^4.5.3: + version "4.5.4" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" + integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== + dependencies: + json-buffer "3.0.1" + kleur@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" @@ -2087,12 +2093,12 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" -make-dir@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" - integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== +make-dir@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-4.0.0.tgz#c3c2307a771277cd9638305f915c29ae741b614e" + integrity sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw== dependencies: - semver "^6.0.0" + semver "^7.5.3" makeerror@1.0.12: version "1.0.12" @@ -2157,7 +2163,7 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== -node-releases@^2.0.12: +node-releases@^2.0.13: version "2.0.13" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.13.tgz#d5ed1627c23e3461e819b02e57b75e4899b1c81d" integrity sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ== @@ -2340,14 +2346,14 @@ pump@^3.0.0: once "^1.3.1" punycode@^2.1.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" - integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== + version "2.3.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" + integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== pure-rand@^6.0.0: - version "6.0.2" - resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.0.2.tgz#a9c2ddcae9b68d736a8163036f088a2781c8b306" - integrity sha512-6Yg0ekpKICSjPswYOuC5sku/TSWaRYlA0qsXqJgM/d/4pLPHPuTxK7Nbf7jFKzAeedUhR8C7K9Uv63FBsSo8xQ== + version "6.0.4" + resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.0.4.tgz#50b737f6a925468679bff00ad20eade53f37d5c7" + integrity sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA== queue-microtask@^1.2.2: version "1.2.3" @@ -2387,11 +2393,11 @@ resolve.exports@^2.0.0: integrity sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg== resolve@^1.20.0: - version "1.22.2" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.2.tgz#0ed0943d4e301867955766c9f3e1ae6d01c6845f" - integrity sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g== + version "1.22.8" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" + integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== dependencies: - is-core-module "^2.11.0" + is-core-module "^2.13.0" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" @@ -2414,7 +2420,7 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -semver@^6.0.0, semver@^6.3.0, semver@^6.3.1: +semver@^6.3.0, semver@^6.3.1: version "6.3.1" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== @@ -2596,10 +2602,15 @@ type-fest@^0.21.3: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== -update-browserslist-db@^1.0.11: - version "1.0.11" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz#9a2a641ad2907ae7b3616506f4b977851db5b940" - integrity sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA== +undici-types@~5.26.4: + version "5.26.5" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" + integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== + +update-browserslist-db@^1.0.13: + version "1.0.13" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz#3c5e4f5c083661bd38ef64b6328c26ed6c8248c4" + integrity sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg== dependencies: escalade "^3.1.1" picocolors "^1.0.0" @@ -2612,13 +2623,13 @@ uri-js@^4.2.2: punycode "^2.1.0" v8-to-istanbul@^9.0.1: - version "9.1.0" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz#1b83ed4e397f58c85c266a570fc2558b5feb9265" - integrity sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA== + version "9.1.3" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.1.3.tgz#ea456604101cd18005ac2cae3cdd1aa058a6306b" + integrity sha512-9lDD+EVI2fjFsMWXc6dy5JJzBsVTcQ2fVkfBvncZ6xJWG9wtBhOldG+mHkSL0+V1K/xgZz0JDO5UT5hFwHUghg== dependencies: "@jridgewell/trace-mapping" "^0.3.12" "@types/istanbul-lib-coverage" "^2.0.1" - convert-source-map "^1.6.0" + convert-source-map "^2.0.0" walker@^1.0.8: version "1.0.8" From 7a628f3e1847131a7ebc9d31059b06deb91d5517 Mon Sep 17 00:00:00 2001 From: Mike Chlipala Date: Fri, 17 Nov 2023 09:14:27 -0800 Subject: [PATCH 759/785] Require haml/rbs dependencies on demand --- src/server.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server.rb b/src/server.rb index e0191853..3429a82d 100644 --- a/src/server.rb +++ b/src/server.rb @@ -4,10 +4,7 @@ require "json" require "socket" -require "prettier_print" require "syntax_tree" -require "syntax_tree/haml" -require "syntax_tree/rbs" # First, require all of the plugins that the user specified. ARGV.shift[/^--plugins=(.*)$/, 1] @@ -100,6 +97,7 @@ formatter.flush formatter.output.join when "rbs" + require "syntax_tree/rbs" formatter = SyntaxTree::RBS::Formatter.new( source, @@ -112,6 +110,8 @@ formatter.flush formatter.output.join when "haml" + require "syntax_tree/haml" + require "prettier_print" formatter = if defined?(SyntaxTree::Haml::Format::Formatter) SyntaxTree::Haml::Format::Formatter.new( From c14fdfbc263841a7802ac9453f8df2e24e01631d Mon Sep 17 00:00:00 2001 From: Mike Chlipala Date: Mon, 20 Nov 2023 12:22:26 -0800 Subject: [PATCH 760/785] Require optional dependencies once, rescue LoadErrors --- src/server.rb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/server.rb b/src/server.rb index 3429a82d..f091db06 100644 --- a/src/server.rb +++ b/src/server.rb @@ -6,6 +6,18 @@ require "syntax_tree" +# Optional dependencies +%W[ + syntax_tree/rbs + syntax_tree/haml + prettier_print +].each do |dep| + begin + require dep + rescue LoadError + end +end + # First, require all of the plugins that the user specified. ARGV.shift[/^--plugins=(.*)$/, 1] .split(",") @@ -97,7 +109,6 @@ formatter.flush formatter.output.join when "rbs" - require "syntax_tree/rbs" formatter = SyntaxTree::RBS::Formatter.new( source, @@ -110,8 +121,6 @@ formatter.flush formatter.output.join when "haml" - require "syntax_tree/haml" - require "prettier_print" formatter = if defined?(SyntaxTree::Haml::Format::Formatter) SyntaxTree::Haml::Format::Formatter.new( From eef9ade169fcc155e18be4c524178cbabc853479 Mon Sep 17 00:00:00 2001 From: Mike Chlipala Date: Mon, 20 Nov 2023 17:55:15 -0800 Subject: [PATCH 761/785] Run prettier on src/server.rb --- src/server.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/server.rb b/src/server.rb index f091db06..d5876cf7 100644 --- a/src/server.rb +++ b/src/server.rb @@ -7,11 +7,7 @@ require "syntax_tree" # Optional dependencies -%W[ - syntax_tree/rbs - syntax_tree/haml - prettier_print -].each do |dep| +%W[syntax_tree/rbs syntax_tree/haml prettier_print].each do |dep| begin require dep rescue LoadError From 8e47f17c7f62800393fa006eb0130d5279c4ca76 Mon Sep 17 00:00:00 2001 From: Heiko Rabe Date: Thu, 23 Nov 2023 09:01:38 +0100 Subject: [PATCH 762/785] Use default options if no file given --- src/plugin.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/plugin.js b/src/plugin.js index d6931207..4c993a9b 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -67,7 +67,14 @@ export async function spawnServer(opts, killOnExit = true) { const tmpdir = os.tmpdir(); const filepath = path.join(tmpdir, `prettier-ruby-parser-${process.pid}.txt`); - const currentFile = opts.filepath || process.cwd(); + const default_options = { + env: Object.assign({}, process.env, { LANG: getLang() }), + stdio: ["ignore", "ignore", "inherit"], + detached: true + }; + const options = opts.filepath + ? { cwd: path.dirname(opts.filepath), ...default_options } + : default_options; const server = spawn( opts.rubyExecutablePath || "ruby", @@ -76,12 +83,7 @@ export async function spawnServer(opts, killOnExit = true) { `--plugins=${getPlugins(opts).join(",")}`, filepath ], - { - cwd: path.dirname(currentFile), - env: Object.assign({}, process.env, { LANG: getLang() }), - stdio: ["ignore", "ignore", "inherit"], - detached: true - } + options, ); server.unref(); From 0645077826a6d95f7ef0fa5cdc259f20f728fdfd Mon Sep 17 00:00:00 2001 From: Heiko Rabe Date: Thu, 23 Nov 2023 09:23:59 +0100 Subject: [PATCH 763/785] Prettify code --- src/plugin.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugin.js b/src/plugin.js index 4c993a9b..3309940c 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -74,7 +74,7 @@ export async function spawnServer(opts, killOnExit = true) { }; const options = opts.filepath ? { cwd: path.dirname(opts.filepath), ...default_options } - : default_options; + : default_options; const server = spawn( opts.rubyExecutablePath || "ruby", @@ -83,7 +83,7 @@ export async function spawnServer(opts, killOnExit = true) { `--plugins=${getPlugins(opts).join(",")}`, filepath ], - options, + options ); server.unref(); From b281b238eeaac40d5ac445bb72e0fcbfe18e792f Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 27 Nov 2023 21:58:32 -0500 Subject: [PATCH 764/785] Bump to version 4.0.3 --- CHANGELOG.md | 10 +++++++++- package.json | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86272b3f..c1766346 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [4.0.3] - 2023-11-27 + +### Changed + +- [#1406](https://github.com/prettier/plugin-ruby/pull/1406) - mikesea - Support running without the RBS or Haml plugins loaded. +- [#1407](https://github.com/prettier/plugin-ruby/pull/1407) - hrabe - Support shimmed Ruby versions. + ## [4.0.2] - 2023-07-14 ### Changed @@ -1291,7 +1298,8 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v4.0.2...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v4.0.3...HEAD +[4.0.3]: https://github.com/prettier/plugin-ruby/compare/v4.0.2...v4.0.3 [4.0.2]: https://github.com/prettier/plugin-ruby/compare/v4.0.1...v4.0.2 [4.0.1]: https://github.com/prettier/plugin-ruby/compare/v4.0.0...v4.0.1 [4.0.0]: https://github.com/prettier/plugin-ruby/compare/v3.2.2...v4.0.0 diff --git a/package.json b/package.json index 538fef64..64c169ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "4.0.2", + "version": "4.0.3", "description": "prettier plugin for the Ruby programming language", "type": "module", "main": "src/plugin.js", From e93f618f71228a02ecd7288a7a23f1784c6d59c0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 12:21:47 +0000 Subject: [PATCH 765/785] Bump eslint-config-prettier from 9.0.0 to 9.1.0 Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 9.0.0 to 9.1.0. - [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/eslint-config-prettier/compare/v9.0.0...v9.1.0) --- updated-dependencies: - dependency-name: eslint-config-prettier dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 34ff2bdd..1ebebbb9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1138,9 +1138,9 @@ escape-string-regexp@^4.0.0: integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== eslint-config-prettier@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz#eb25485946dd0c66cd216a46232dc05451518d1f" - integrity sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw== + version "9.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz#31af3d94578645966c082fcb71a5846d3c94867f" + integrity sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw== eslint-scope@^7.2.2: version "7.2.2" From d2e00276575ebae4f97e762ac8f07526197a7116 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 12:22:08 +0000 Subject: [PATCH 766/785] Bump eslint from 8.54.0 to 8.55.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.54.0 to 8.55.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.54.0...v8.55.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/yarn.lock b/yarn.lock index 34ff2bdd..204a5e74 100644 --- a/yarn.lock +++ b/yarn.lock @@ -314,10 +314,10 @@ resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.0.tgz#548f6de556857c8bb73bbee70c35dc82a2e74d63" integrity sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA== -"@eslint/eslintrc@^2.1.3": - version "2.1.3" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.3.tgz#797470a75fe0fbd5a53350ee715e85e87baff22d" - integrity sha512-yZzuIG+jnVu6hNSzFEN07e8BxF3uAzYtQb6uDkaYZLo6oYZDCq454c5kB8zxnzfCYyP4MIuyBn10L0DqwujTmA== +"@eslint/eslintrc@^2.1.4": + version "2.1.4" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.4.tgz#388a269f0f25c1b6adc317b5a2c55714894c70ad" + integrity sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ== dependencies: ajv "^6.12.4" debug "^4.3.2" @@ -329,10 +329,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.54.0": - version "8.54.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.54.0.tgz#4fab9a2ff7860082c304f750e94acd644cf984cf" - integrity sha512-ut5V+D+fOoWPgGGNj83GGjnntO39xDy6DWxO0wb7Jp3DcMX0TfIqdzHF85VTQkerdyGmuuMD9AKAo5KiNlf/AQ== +"@eslint/js@8.55.0": + version "8.55.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.55.0.tgz#b721d52060f369aa259cf97392403cb9ce892ec6" + integrity sha512-qQfo2mxH5yVom1kacMtZZJFVdW+E70mqHMJvVg6WTLo+VBuQJ4TojZlfWBjK0ve5BdEeNAVxOsl/nvNMpJOaJA== "@humanwhocodes/config-array@^0.11.13": version "0.11.13" @@ -1156,14 +1156,14 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4 integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== eslint@^8.54.0: - version "8.54.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.54.0.tgz#588e0dd4388af91a2e8fa37ea64924074c783537" - integrity sha512-NY0DfAkM8BIZDVl6PgSa1ttZbx3xHgJzSNJKYcQglem6CppHyMhRIQkBVSSMaSRnLhig3jsDbEzOjwCVt4AmmA== + version "8.55.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.55.0.tgz#078cb7b847d66f2c254ea1794fa395bf8e7e03f8" + integrity sha512-iyUUAM0PCKj5QpwGfmCAG9XXbZCWsqP/eWAWrG/W0umvjuLRBECwSFdt+rCntju0xEH7teIABPwXpahftIaTdA== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.6.1" - "@eslint/eslintrc" "^2.1.3" - "@eslint/js" "8.54.0" + "@eslint/eslintrc" "^2.1.4" + "@eslint/js" "8.55.0" "@humanwhocodes/config-array" "^0.11.13" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" From 27d8763f0f1376e1ee15add52ef5344e47f7dde0 Mon Sep 17 00:00:00 2001 From: Heiko Rabe Date: Mon, 11 Dec 2023 10:03:00 +0100 Subject: [PATCH 767/785] Change cwd detection for mono-repos --- src/plugin.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/plugin.js b/src/plugin.js index 3309940c..71d2030b 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -5,6 +5,7 @@ import os from "os"; import path from "path"; import process from "process"; import url from "url"; +import { resolveConfigFile } from "prettier"; // In order to properly parse ruby code, we need to tell the ruby process to // parse using UTF-8. Unfortunately, the way that you accomplish this looks @@ -67,14 +68,16 @@ export async function spawnServer(opts, killOnExit = true) { const tmpdir = os.tmpdir(); const filepath = path.join(tmpdir, `prettier-ruby-parser-${process.pid}.txt`); - const default_options = { + const options = { env: Object.assign({}, process.env, { LANG: getLang() }), stdio: ["ignore", "ignore", "inherit"], detached: true }; - const options = opts.filepath - ? { cwd: path.dirname(opts.filepath), ...default_options } - : default_options; + + if (opts.filepath) { + const prettierConfig = await resolveConfigFile(opts.filepath); + options.cwd = path.dirname(prettierConfig); + } const server = spawn( opts.rubyExecutablePath || "ruby", From 4a0ea381153fa67b11d183ce37ae6fbda7a254d2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 12:49:39 +0000 Subject: [PATCH 768/785] Bump prettier from 3.1.0 to 3.1.1 Bumps [prettier](https://github.com/prettier/prettier) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/3.1.0...3.1.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 85f62a9d..08caba3c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2304,9 +2304,9 @@ prelude-ls@^1.2.1: integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== prettier@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.1.0.tgz#c6d16474a5f764ea1a4a373c593b779697744d5e" - integrity sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw== + version "3.1.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.1.1.tgz#6ba9f23165d690b6cbdaa88cb0807278f7019848" + integrity sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw== pretty-format@^29.7.0: version "29.7.0" From cc22600256c87aa507149cdbcfc1bab57314ab10 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 12 Dec 2023 14:16:15 -0500 Subject: [PATCH 769/785] Bump to version 4.0.4 --- CHANGELOG.md | 9 ++++++++- package.json | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1766346..0e310a26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [4.0.4] - 2023-12-12 + +### Changed + +- [#1413](https://github.com/prettier/plugin-ruby/pull/1413) - hrabe - Fix the cwd detection for mono-repos. + ## [4.0.3] - 2023-11-27 ### Changed @@ -1298,7 +1304,8 @@ would previously result in `array[]`, but now prints properly. - Initial release 🎉 -[unreleased]: https://github.com/prettier/plugin-ruby/compare/v4.0.3...HEAD +[unreleased]: https://github.com/prettier/plugin-ruby/compare/v4.0.4...HEAD +[4.0.4]: https://github.com/prettier/plugin-ruby/compare/v4.0.3...v4.0.4 [4.0.3]: https://github.com/prettier/plugin-ruby/compare/v4.0.2...v4.0.3 [4.0.2]: https://github.com/prettier/plugin-ruby/compare/v4.0.1...v4.0.2 [4.0.1]: https://github.com/prettier/plugin-ruby/compare/v4.0.0...v4.0.1 diff --git a/package.json b/package.json index 64c169ce..2365fb63 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prettier/plugin-ruby", - "version": "4.0.3", + "version": "4.0.4", "description": "prettier plugin for the Ruby programming language", "type": "module", "main": "src/plugin.js", From 35d37477150bb2b1dc38ee0b11bae9e8ac2f196d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 12:43:09 +0000 Subject: [PATCH 770/785] Bump eslint from 8.55.0 to 8.56.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.55.0 to 8.56.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.55.0...v8.56.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index 08caba3c..2d9ed742 100644 --- a/yarn.lock +++ b/yarn.lock @@ -329,10 +329,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.55.0": - version "8.55.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.55.0.tgz#b721d52060f369aa259cf97392403cb9ce892ec6" - integrity sha512-qQfo2mxH5yVom1kacMtZZJFVdW+E70mqHMJvVg6WTLo+VBuQJ4TojZlfWBjK0ve5BdEeNAVxOsl/nvNMpJOaJA== +"@eslint/js@8.56.0": + version "8.56.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.56.0.tgz#ef20350fec605a7f7035a01764731b2de0f3782b" + integrity sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A== "@humanwhocodes/config-array@^0.11.13": version "0.11.13" @@ -1156,14 +1156,14 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4 integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== eslint@^8.54.0: - version "8.55.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.55.0.tgz#078cb7b847d66f2c254ea1794fa395bf8e7e03f8" - integrity sha512-iyUUAM0PCKj5QpwGfmCAG9XXbZCWsqP/eWAWrG/W0umvjuLRBECwSFdt+rCntju0xEH7teIABPwXpahftIaTdA== + version "8.56.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.56.0.tgz#4957ce8da409dc0809f99ab07a1b94832ab74b15" + integrity sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.6.1" "@eslint/eslintrc" "^2.1.4" - "@eslint/js" "8.55.0" + "@eslint/js" "8.56.0" "@humanwhocodes/config-array" "^0.11.13" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" From 2f01fa152480f18659eaa5e358dbacdf7d73ae31 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 12:13:55 +0000 Subject: [PATCH 771/785] Bump prettier from 3.1.1 to 3.2.2 Bumps [prettier](https://github.com/prettier/prettier) from 3.1.1 to 3.2.2. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/3.1.1...3.2.2) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2d9ed742..5e54c8ad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2304,9 +2304,9 @@ prelude-ls@^1.2.1: integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== prettier@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.1.1.tgz#6ba9f23165d690b6cbdaa88cb0807278f7019848" - integrity sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw== + version "3.2.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.2.tgz#96e580f7ca9c96090ad054616c0c4597e2844b65" + integrity sha512-HTByuKZzw7utPiDO523Tt2pLtEyK7OibUD9suEJQrPUCYQqrHr74GGX6VidMrovbf/I50mPqr8j/II6oBAuc5A== pretty-format@^29.7.0: version "29.7.0" From e5e0b32a00a0bdcb2d8f18dda0dff0229429f57e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 12:03:14 +0000 Subject: [PATCH 772/785] Bump pretty-quick from 3.1.3 to 4.0.0 Bumps [pretty-quick](https://github.com/prettier/pretty-quick) from 3.1.3 to 4.0.0. - [Release notes](https://github.com/prettier/pretty-quick/releases) - [Changelog](https://github.com/prettier/pretty-quick/blob/master/CHANGELOG.md) - [Commits](https://github.com/prettier/pretty-quick/compare/v3.1.3...v4.0.0) --- updated-dependencies: - dependency-name: pretty-quick dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 128 ++++++++++++--------------------------------------- 2 files changed, 30 insertions(+), 100 deletions(-) diff --git a/package.json b/package.json index 2365fb63..84aad63b 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "husky": "^8.0.1", "jest": "^29.5.0", "prettier": "^3.1.0", - "pretty-quick": "^3.1.2" + "pretty-quick": "^4.0.0" }, "eslintConfig": { "extends": [ diff --git a/yarn.lock b/yarn.lock index 5e54c8ad..792e0033 100644 --- a/yarn.lock +++ b/yarn.lock @@ -692,11 +692,6 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/minimatch@^3.0.3": - version "3.0.5" - resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" - integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== - "@types/node@*": version "20.9.2" resolved "https://registry.yarnpkg.com/@types/node/-/node-20.9.2.tgz#002815c8e87fe0c9369121c78b52e800fadc0ac6" @@ -797,21 +792,6 @@ argparse@^2.0.1: resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== -array-differ@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-3.0.0.tgz#3cbb3d0f316810eafcc47624734237d6aee4ae6b" - integrity sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg== - -array-union@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" - integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== - -arrify@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" - integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== - babel-jest@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.7.0.tgz#f4369919225b684c56085998ac63dbd05be020d5" @@ -943,14 +923,6 @@ chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" - integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - chalk@^4.0.0: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" @@ -1040,7 +1012,7 @@ create-jest@^29.7.0: jest-util "^29.7.0" prompts "^2.0.1" -cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: +cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -1103,13 +1075,6 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -end-of-stream@^1.1.0: - version "1.4.4" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" - integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== - dependencies: - once "^1.4.0" - error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" @@ -1237,22 +1202,7 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== -execa@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-4.1.0.tgz#4e5491ad1572f2f17a77d388c6c857135b22847a" - integrity sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA== - dependencies: - cross-spawn "^7.0.0" - get-stream "^5.0.0" - human-signals "^1.1.1" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.0" - onetime "^5.1.0" - signal-exit "^3.0.2" - strip-final-newline "^2.0.0" - -execa@^5.0.0: +execa@^5.0.0, execa@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== @@ -1386,13 +1336,6 @@ get-package-type@^0.1.0: resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== -get-stream@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" - integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== - dependencies: - pump "^3.0.0" - get-stream@^6.0.0: version "6.0.1" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" @@ -1461,11 +1404,6 @@ html-escaper@^2.0.0: resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== -human-signals@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" - integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== - human-signals@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" @@ -1476,7 +1414,7 @@ husky@^8.0.1: resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.3.tgz#4936d7212e46d1dea28fef29bb3a108872cd9184" integrity sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg== -ignore@^5.1.4, ignore@^5.2.0: +ignore@^5.2.0, ignore@^5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.0.tgz#67418ae40d34d6999c95ff56016759c718c82f78" integrity sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg== @@ -2132,7 +2070,7 @@ minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" -mri@^1.1.5: +mri@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b" integrity sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA== @@ -2142,17 +2080,6 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -multimatch@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-4.0.0.tgz#8c3c0f6e3e8449ada0af3dd29efb491a375191b3" - integrity sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ== - dependencies: - "@types/minimatch" "^3.0.3" - array-differ "^3.0.0" - array-union "^2.1.0" - arrify "^2.0.1" - minimatch "^3.0.4" - natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -2173,21 +2100,21 @@ normalize-path@^3.0.0: resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== -npm-run-path@^4.0.0, npm-run-path@^4.0.1: +npm-run-path@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== dependencies: path-key "^3.0.0" -once@^1.3.0, once@^1.3.1, once@^1.4.0: +once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== dependencies: wrappy "1" -onetime@^5.1.0, onetime@^5.1.2: +onetime@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== @@ -2286,6 +2213,11 @@ picomatch@^2.0.4, picomatch@^2.2.3, picomatch@^2.3.1: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== +picomatch@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-3.0.1.tgz#817033161def55ec9638567a2f3bbc876b3e7516" + integrity sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag== + pirates@^4.0.4: version "4.0.6" resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9" @@ -2317,17 +2249,18 @@ pretty-format@^29.7.0: ansi-styles "^5.0.0" react-is "^18.0.0" -pretty-quick@^3.1.2: - version "3.1.3" - resolved "https://registry.yarnpkg.com/pretty-quick/-/pretty-quick-3.1.3.tgz#15281108c0ddf446675157ca40240099157b638e" - integrity sha512-kOCi2FJabvuh1as9enxYmrnBC6tVMoVOenMaBqRfsvBHB0cbpYHjdQEpSglpASDFEXVwplpcGR4CLEaisYAFcA== +pretty-quick@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/pretty-quick/-/pretty-quick-4.0.0.tgz#ea5cce85a5804bfbec7327b0e064509155d03f39" + integrity sha512-M+2MmeufXb/M7Xw3Afh1gxcYpj+sK0AxEfnfF958ktFeAyi5MsKY5brymVURQLgPLV1QaF5P4pb2oFJ54H3yzQ== dependencies: - chalk "^3.0.0" - execa "^4.0.0" - find-up "^4.1.0" - ignore "^5.1.4" - mri "^1.1.5" - multimatch "^4.0.0" + execa "^5.1.1" + find-up "^5.0.0" + ignore "^5.3.0" + mri "^1.2.0" + picocolors "^1.0.0" + picomatch "^3.0.1" + tslib "^2.6.2" prompts@^2.0.1: version "2.4.2" @@ -2337,14 +2270,6 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" -pump@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - punycode@^2.1.0: version "2.3.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" @@ -2444,7 +2369,7 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== -signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: +signal-exit@^3.0.3, signal-exit@^3.0.7: version "3.0.7" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== @@ -2580,6 +2505,11 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" +tslib@^2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" + integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== + type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" From 051eb729ff7c18be158fe81406e95e59379074fc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 12:03:35 +0000 Subject: [PATCH 773/785] Bump prettier from 3.2.2 to 3.2.4 Bumps [prettier](https://github.com/prettier/prettier) from 3.2.2 to 3.2.4. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/3.2.2...3.2.4) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5e54c8ad..0d7f2617 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2304,9 +2304,9 @@ prelude-ls@^1.2.1: integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== prettier@^3.1.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.2.tgz#96e580f7ca9c96090ad054616c0c4597e2844b65" - integrity sha512-HTByuKZzw7utPiDO523Tt2pLtEyK7OibUD9suEJQrPUCYQqrHr74GGX6VidMrovbf/I50mPqr8j/II6oBAuc5A== + version "3.2.4" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.4.tgz#4723cadeac2ce7c9227de758e5ff9b14e075f283" + integrity sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ== pretty-format@^29.7.0: version "29.7.0" From c0002010a9f29fca80322e46ad577fa1e479a120 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Jan 2024 12:26:09 +0000 Subject: [PATCH 774/785] Bump husky from 8.0.3 to 9.0.2 Bumps [husky](https://github.com/typicode/husky) from 8.0.3 to 9.0.2. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v8.0.3...v9.0.2) --- updated-dependencies: - dependency-name: husky dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 84aad63b..be058865 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "devDependencies": { "eslint": "^8.54.0", "eslint-config-prettier": "^9.0.0", - "husky": "^8.0.1", + "husky": "^9.0.2", "jest": "^29.5.0", "prettier": "^3.1.0", "pretty-quick": "^4.0.0" diff --git a/yarn.lock b/yarn.lock index e6a5329b..ceca9002 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1409,10 +1409,10 @@ human-signals@^2.1.0: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== -husky@^8.0.1: - version "8.0.3" - resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.3.tgz#4936d7212e46d1dea28fef29bb3a108872cd9184" - integrity sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg== +husky@^9.0.2: + version "9.0.2" + resolved "https://registry.yarnpkg.com/husky/-/husky-9.0.2.tgz#7ac26cb63719e91a159991039187b35e7358557e" + integrity sha512-0yR5R3OPjl8bYApi6T4QMOAwhtLhBjdYIVg5S6zSzIO8DIvQMh/b7Q8jW3WLbHLHtzpwiyMLBNB4R0Eb6x5+AA== ignore@^5.2.0, ignore@^5.3.0: version "5.3.0" From 8d729909c8b4b135adc0b0e74a7f85dfcb6c73f7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Jan 2024 12:57:03 +0000 Subject: [PATCH 775/785] Bump husky from 9.0.2 to 9.0.6 Bumps [husky](https://github.com/typicode/husky) from 9.0.2 to 9.0.6. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v9.0.2...v9.0.6) --- updated-dependencies: - dependency-name: husky dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index ceca9002..4029ead0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1410,9 +1410,9 @@ human-signals@^2.1.0: integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== husky@^9.0.2: - version "9.0.2" - resolved "https://registry.yarnpkg.com/husky/-/husky-9.0.2.tgz#7ac26cb63719e91a159991039187b35e7358557e" - integrity sha512-0yR5R3OPjl8bYApi6T4QMOAwhtLhBjdYIVg5S6zSzIO8DIvQMh/b7Q8jW3WLbHLHtzpwiyMLBNB4R0Eb6x5+AA== + version "9.0.6" + resolved "https://registry.yarnpkg.com/husky/-/husky-9.0.6.tgz#cee0245d60480b12279cf492ec6cfc1aeb7fa759" + integrity sha512-EEuw/rfTiMjOfuL7pGO/i9otg1u36TXxqjIA6D9qxVjd/UXoDOsLor/BSFf5hTK50shwzCU3aVVwdXDp/lp7RA== ignore@^5.2.0, ignore@^5.3.0: version "5.3.0" From be21af84263798122e981f46b254f0ffab9a5536 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jan 2024 12:13:18 +0000 Subject: [PATCH 776/785] Bump husky from 9.0.6 to 9.0.7 Bumps [husky](https://github.com/typicode/husky) from 9.0.6 to 9.0.7. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v9.0.6...v9.0.7) --- updated-dependencies: - dependency-name: husky dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4029ead0..63bcc0ca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1410,9 +1410,9 @@ human-signals@^2.1.0: integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== husky@^9.0.2: - version "9.0.6" - resolved "https://registry.yarnpkg.com/husky/-/husky-9.0.6.tgz#cee0245d60480b12279cf492ec6cfc1aeb7fa759" - integrity sha512-EEuw/rfTiMjOfuL7pGO/i9otg1u36TXxqjIA6D9qxVjd/UXoDOsLor/BSFf5hTK50shwzCU3aVVwdXDp/lp7RA== + version "9.0.7" + resolved "https://registry.yarnpkg.com/husky/-/husky-9.0.7.tgz#047f24ec1b6c681206af714b4217c13ee97fff20" + integrity sha512-vWdusw+y12DUEeoZqW1kplOFqk3tedGV8qlga8/SF6a3lOiWLqGZZQvfWvY0fQYdfiRi/u1DFNpudTSV9l1aCg== ignore@^5.2.0, ignore@^5.3.0: version "5.3.0" From 63d3818744cf205fb07c6f30a1030cfaa731ee4d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Feb 2024 12:03:32 +0000 Subject: [PATCH 777/785] Bump husky from 9.0.7 to 9.0.10 Bumps [husky](https://github.com/typicode/husky) from 9.0.7 to 9.0.10. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v9.0.7...v9.0.10) --- updated-dependencies: - dependency-name: husky dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 63bcc0ca..f2f900e7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1410,9 +1410,9 @@ human-signals@^2.1.0: integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== husky@^9.0.2: - version "9.0.7" - resolved "https://registry.yarnpkg.com/husky/-/husky-9.0.7.tgz#047f24ec1b6c681206af714b4217c13ee97fff20" - integrity sha512-vWdusw+y12DUEeoZqW1kplOFqk3tedGV8qlga8/SF6a3lOiWLqGZZQvfWvY0fQYdfiRi/u1DFNpudTSV9l1aCg== + version "9.0.10" + resolved "https://registry.yarnpkg.com/husky/-/husky-9.0.10.tgz#ddca8908deb5f244e9286865ebc80b54387672c2" + integrity sha512-TQGNknoiy6bURzIO77pPRu+XHi6zI7T93rX+QnJsoYFf3xdjKOur+IlfqzJGMHIK/wXrLg+GsvMs8Op7vI2jVA== ignore@^5.2.0, ignore@^5.3.0: version "5.3.0" From 38981a6fe4fac81c96897708e4bbb6f0d3d5d7dc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 12:48:26 +0000 Subject: [PATCH 778/785] Bump prettier from 3.2.4 to 3.2.5 Bumps [prettier](https://github.com/prettier/prettier) from 3.2.4 to 3.2.5. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/3.2.4...3.2.5) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index f2f900e7..301c5acf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2236,9 +2236,9 @@ prelude-ls@^1.2.1: integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== prettier@^3.1.0: - version "3.2.4" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.4.tgz#4723cadeac2ce7c9227de758e5ff9b14e075f283" - integrity sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ== + version "3.2.5" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.5.tgz#e52bc3090586e824964a8813b09aba6233b28368" + integrity sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A== pretty-format@^29.7.0: version "29.7.0" From e93dcad0919511abc88aafbd89c3b9bdfc256374 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Feb 2024 12:37:24 +0000 Subject: [PATCH 779/785] Bump husky from 9.0.10 to 9.0.11 Bumps [husky](https://github.com/typicode/husky) from 9.0.10 to 9.0.11. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v9.0.10...v9.0.11) --- updated-dependencies: - dependency-name: husky dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 301c5acf..f409acec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1410,9 +1410,9 @@ human-signals@^2.1.0: integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== husky@^9.0.2: - version "9.0.10" - resolved "https://registry.yarnpkg.com/husky/-/husky-9.0.10.tgz#ddca8908deb5f244e9286865ebc80b54387672c2" - integrity sha512-TQGNknoiy6bURzIO77pPRu+XHi6zI7T93rX+QnJsoYFf3xdjKOur+IlfqzJGMHIK/wXrLg+GsvMs8Op7vI2jVA== + version "9.0.11" + resolved "https://registry.yarnpkg.com/husky/-/husky-9.0.11.tgz#fc91df4c756050de41b3e478b2158b87c1e79af9" + integrity sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw== ignore@^5.2.0, ignore@^5.3.0: version "5.3.0" From 5bd1d7b5219149b3569c60b9c1ea0508fa3c369b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 12:11:35 +0000 Subject: [PATCH 780/785] Bump eslint from 8.56.0 to 8.57.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.56.0 to 8.57.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.56.0...v8.57.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/yarn.lock b/yarn.lock index f409acec..8570438c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -329,18 +329,18 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.56.0": - version "8.56.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.56.0.tgz#ef20350fec605a7f7035a01764731b2de0f3782b" - integrity sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A== - -"@humanwhocodes/config-array@^0.11.13": - version "0.11.13" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.13.tgz#075dc9684f40a531d9b26b0822153c1e832ee297" - integrity sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ== - dependencies: - "@humanwhocodes/object-schema" "^2.0.1" - debug "^4.1.1" +"@eslint/js@8.57.0": + version "8.57.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.57.0.tgz#a5417ae8427873f1dd08b70b3574b453e67b5f7f" + integrity sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g== + +"@humanwhocodes/config-array@^0.11.14": + version "0.11.14" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.14.tgz#d78e481a039f7566ecc9660b4ea7fe6b1fec442b" + integrity sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg== + dependencies: + "@humanwhocodes/object-schema" "^2.0.2" + debug "^4.3.1" minimatch "^3.0.5" "@humanwhocodes/module-importer@^1.0.1": @@ -348,10 +348,10 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== -"@humanwhocodes/object-schema@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz#e5211452df060fa8522b55c7b3c0c4d1981cb044" - integrity sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw== +"@humanwhocodes/object-schema@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz#d9fae00a2d5cb40f92cfe64b47ad749fbc38f917" + integrity sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw== "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" @@ -1021,7 +1021,7 @@ cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -debug@^4.1.0, debug@^4.1.1, debug@^4.3.2: +debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -1121,15 +1121,15 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4 integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== eslint@^8.54.0: - version "8.56.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.56.0.tgz#4957ce8da409dc0809f99ab07a1b94832ab74b15" - integrity sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ== + version "8.57.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.57.0.tgz#c786a6fd0e0b68941aaf624596fb987089195668" + integrity sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.6.1" "@eslint/eslintrc" "^2.1.4" - "@eslint/js" "8.56.0" - "@humanwhocodes/config-array" "^0.11.13" + "@eslint/js" "8.57.0" + "@humanwhocodes/config-array" "^0.11.14" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" "@ungap/structured-clone" "^1.2.0" From a39e277c300afeaab39ef89238687d9cb32671b6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Mar 2024 12:08:24 +0000 Subject: [PATCH 781/785] Bump dependabot/fetch-metadata from 1.6.0 to 2.0.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.6.0 to 2.0.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.6.0...v2.0.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/auto-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index 8ca265e0..44908aae 100644 --- a/.github/workflows/auto-merge.yml +++ b/.github/workflows/auto-merge.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v1.6.0 + uses: dependabot/fetch-metadata@v2.0.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" - name: Enable auto-merge for Dependabot PRs From 6e472faa795228f0a9821f78739ae2a1a03de0ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 12:30:53 +0000 Subject: [PATCH 782/785] Bump eslint from 8.57.0 to 9.0.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.57.0 to 9.0.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.57.0...v9.0.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 156 +++++++++++++++++++++------------------------------ 2 files changed, 66 insertions(+), 92 deletions(-) diff --git a/package.json b/package.json index be058865..aa7ea32a 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "prettier": "^3.0.0" }, "devDependencies": { - "eslint": "^8.54.0", + "eslint": "^9.0.0", "eslint-config-prettier": "^9.0.0", "husky": "^9.0.2", "jest": "^29.5.0", diff --git a/yarn.lock b/yarn.lock index 8570438c..5099b6c1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -314,32 +314,32 @@ resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.0.tgz#548f6de556857c8bb73bbee70c35dc82a2e74d63" integrity sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA== -"@eslint/eslintrc@^2.1.4": - version "2.1.4" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.4.tgz#388a269f0f25c1b6adc317b5a2c55714894c70ad" - integrity sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ== +"@eslint/eslintrc@^3.0.2": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-3.0.2.tgz#36180f8e85bf34d2fe3ccc2261e8e204a411ab4e" + integrity sha512-wV19ZEGEMAC1eHgrS7UQPqsdEiCIbTKTasEfcXAigzoXICcqZSjBZEHlZwNVvKg6UBCjSlos84XiLqsRJnIcIg== dependencies: ajv "^6.12.4" debug "^4.3.2" - espree "^9.6.0" - globals "^13.19.0" + espree "^10.0.1" + globals "^14.0.0" ignore "^5.2.0" import-fresh "^3.2.1" js-yaml "^4.1.0" minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.57.0": - version "8.57.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.57.0.tgz#a5417ae8427873f1dd08b70b3574b453e67b5f7f" - integrity sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g== +"@eslint/js@9.0.0": + version "9.0.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.0.0.tgz#1a9e4b4c96d8c7886e0110ed310a0135144a1691" + integrity sha512-RThY/MnKrhubF6+s1JflwUjPEsnCEmYCWwqa/aRISKWNXGZ9epUwft4bUMM35SdKF9xvBrLydAM1RDHd1Z//ZQ== -"@humanwhocodes/config-array@^0.11.14": - version "0.11.14" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.14.tgz#d78e481a039f7566ecc9660b4ea7fe6b1fec442b" - integrity sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg== +"@humanwhocodes/config-array@^0.12.3": + version "0.12.3" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.12.3.tgz#a6216d90f81a30bedd1d4b5d799b47241f318072" + integrity sha512-jsNnTBlMWuTpDkeE3on7+dWJi0D6fdDfeANj/w7MpS8ztROCoLvIO2nG0CcFj+E4k8j4QrSTh4Oryi3i2G669g== dependencies: - "@humanwhocodes/object-schema" "^2.0.2" + "@humanwhocodes/object-schema" "^2.0.3" debug "^4.3.1" minimatch "^3.0.5" @@ -348,10 +348,10 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== -"@humanwhocodes/object-schema@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz#d9fae00a2d5cb40f92cfe64b47ad749fbc38f917" - integrity sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw== +"@humanwhocodes/object-schema@^2.0.3": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz#4a2868d75d6d6963e423bcf90b7fd1be343409d3" + integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA== "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" @@ -716,20 +716,15 @@ dependencies: "@types/yargs-parser" "*" -"@ungap/structured-clone@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" - integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== - acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn@^8.9.0: - version "8.11.2" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.2.tgz#ca0d78b51895be5390a5903c5b3bdcdaf78ae40b" - integrity sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w== +acorn@^8.11.3: + version "8.11.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" + integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== ajv@^6.12.4: version "6.12.6" @@ -1053,13 +1048,6 @@ diff-sequences@^29.6.3: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== -doctrine@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" - integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== - dependencies: - esutils "^2.0.2" - electron-to-chromium@^1.4.535: version "1.4.588" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.588.tgz#d553f3c008e73488fb181fdf2601fdb0b1ffbb78" @@ -1107,54 +1095,55 @@ eslint-config-prettier@^9.0.0: resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz#31af3d94578645966c082fcb71a5846d3c94867f" integrity sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw== -eslint-scope@^7.2.2: - version "7.2.2" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f" - integrity sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== +eslint-scope@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.0.1.tgz#a9601e4b81a0b9171657c343fb13111688963cfc" + integrity sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og== dependencies: esrecurse "^4.3.0" estraverse "^5.2.0" -eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: +eslint-visitor-keys@^3.3.0: version "3.4.3" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== -eslint@^8.54.0: - version "8.57.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.57.0.tgz#c786a6fd0e0b68941aaf624596fb987089195668" - integrity sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ== +eslint-visitor-keys@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz#e3adc021aa038a2a8e0b2f8b0ce8f66b9483b1fb" + integrity sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw== + +eslint@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.0.0.tgz#6270548758e390343f78c8afd030566d86927d40" + integrity sha512-IMryZ5SudxzQvuod6rUdIUz29qFItWx281VhtFVc2Psy/ZhlCeD/5DT6lBIJ4H3G+iamGJoTln1v+QSuPw0p7Q== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.6.1" - "@eslint/eslintrc" "^2.1.4" - "@eslint/js" "8.57.0" - "@humanwhocodes/config-array" "^0.11.14" + "@eslint/eslintrc" "^3.0.2" + "@eslint/js" "9.0.0" + "@humanwhocodes/config-array" "^0.12.3" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" - "@ungap/structured-clone" "^1.2.0" ajv "^6.12.4" chalk "^4.0.0" cross-spawn "^7.0.2" debug "^4.3.2" - doctrine "^3.0.0" escape-string-regexp "^4.0.0" - eslint-scope "^7.2.2" - eslint-visitor-keys "^3.4.3" - espree "^9.6.1" + eslint-scope "^8.0.1" + eslint-visitor-keys "^4.0.0" + espree "^10.0.1" esquery "^1.4.2" esutils "^2.0.2" fast-deep-equal "^3.1.3" - file-entry-cache "^6.0.1" + file-entry-cache "^8.0.0" find-up "^5.0.0" glob-parent "^6.0.2" - globals "^13.19.0" graphemer "^1.4.0" ignore "^5.2.0" imurmurhash "^0.1.4" is-glob "^4.0.0" is-path-inside "^3.0.3" - js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" lodash.merge "^4.6.2" @@ -1164,14 +1153,14 @@ eslint@^8.54.0: strip-ansi "^6.0.1" text-table "^0.2.0" -espree@^9.6.0, espree@^9.6.1: - version "9.6.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f" - integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== +espree@^10.0.1: + version "10.0.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-10.0.1.tgz#600e60404157412751ba4a6f3a2ee1a42433139f" + integrity sha512-MWkrWZbJsL2UwnjxTX3gG8FneachS/Mwg7tdGXce011sJd5b0JG54vat5KHnfSBODZ3Wvzd2WnjxyzsRoVv+ww== dependencies: - acorn "^8.9.0" + acorn "^8.11.3" acorn-jsx "^5.3.2" - eslint-visitor-keys "^3.4.1" + eslint-visitor-keys "^4.0.0" esprima@^4.0.0: version "4.0.1" @@ -1262,12 +1251,12 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" -file-entry-cache@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" - integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== +file-entry-cache@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-8.0.0.tgz#7787bddcf1131bffb92636c69457bbc0edd6d81f" + integrity sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ== dependencies: - flat-cache "^3.0.4" + flat-cache "^4.0.0" fill-range@^7.0.1: version "7.0.1" @@ -1292,14 +1281,13 @@ find-up@^5.0.0: locate-path "^6.0.0" path-exists "^4.0.0" -flat-cache@^3.0.4: - version "3.2.0" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.2.0.tgz#2c0c2d5040c99b1632771a9d105725c0115363ee" - integrity sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw== +flat-cache@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-4.0.1.tgz#0ece39fcb14ee012f4b0410bd33dd9c1f011127c" + integrity sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw== dependencies: flatted "^3.2.9" - keyv "^4.5.3" - rimraf "^3.0.2" + keyv "^4.5.4" flatted@^3.2.9: version "3.2.9" @@ -1365,12 +1353,10 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -globals@^13.19.0: - version "13.23.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.23.0.tgz#ef31673c926a0976e1f61dab4dca57e0c0a8af02" - integrity sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA== - dependencies: - type-fest "^0.20.2" +globals@^14.0.0: + version "14.0.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e" + integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ== graceful-fs@^4.2.9: version "4.2.11" @@ -1968,7 +1954,7 @@ json5@^2.2.3: resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== -keyv@^4.5.3: +keyv@^4.5.4: version "4.5.4" resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== @@ -2331,13 +2317,6 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rimraf@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" - run-parallel@^1.1.9: version "1.2.0" resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" @@ -2522,11 +2501,6 @@ type-detect@4.0.8: resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== -type-fest@^0.20.2: - version "0.20.2" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" - integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== - type-fest@^0.21.3: version "0.21.3" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" From 036c37377cdedde3575127caeb00df755db370d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 12:23:45 +0000 Subject: [PATCH 783/785] Bump eslint from 9.0.0 to 9.1.0 Bumps [eslint](https://github.com/eslint/eslint) from 9.0.0 to 9.1.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v9.0.0...v9.1.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5099b6c1..6ca2f41f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -329,15 +329,15 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@9.0.0": - version "9.0.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.0.0.tgz#1a9e4b4c96d8c7886e0110ed310a0135144a1691" - integrity sha512-RThY/MnKrhubF6+s1JflwUjPEsnCEmYCWwqa/aRISKWNXGZ9epUwft4bUMM35SdKF9xvBrLydAM1RDHd1Z//ZQ== +"@eslint/js@9.1.1": + version "9.1.1" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.1.1.tgz#eb0f82461d12779bbafc1b5045cde3143d350a8a" + integrity sha512-5WoDz3Y19Bg2BnErkZTp0en+c/i9PvgFS7MBe1+m60HjFr0hrphlAGp4yzI7pxpt4xShln4ZyYp4neJm8hmOkQ== -"@humanwhocodes/config-array@^0.12.3": - version "0.12.3" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.12.3.tgz#a6216d90f81a30bedd1d4b5d799b47241f318072" - integrity sha512-jsNnTBlMWuTpDkeE3on7+dWJi0D6fdDfeANj/w7MpS8ztROCoLvIO2nG0CcFj+E4k8j4QrSTh4Oryi3i2G669g== +"@humanwhocodes/config-array@^0.13.0": + version "0.13.0" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.13.0.tgz#fb907624df3256d04b9aa2df50d7aa97ec648748" + integrity sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw== dependencies: "@humanwhocodes/object-schema" "^2.0.3" debug "^4.3.1" @@ -353,6 +353,11 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz#4a2868d75d6d6963e423bcf90b7fd1be343409d3" integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA== +"@humanwhocodes/retry@^0.2.3": + version "0.2.3" + resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.2.3.tgz#c9aa036d1afa643f1250e83150f39efb3a15a631" + integrity sha512-X38nUbachlb01YMlvPFojKoiXq+LzZvuSce70KPMPdeM1Rj03k4dR7lDslhbqXn3Ang4EU3+EAmwEAsbrjHW3g== + "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -1114,16 +1119,17 @@ eslint-visitor-keys@^4.0.0: integrity sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw== eslint@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.0.0.tgz#6270548758e390343f78c8afd030566d86927d40" - integrity sha512-IMryZ5SudxzQvuod6rUdIUz29qFItWx281VhtFVc2Psy/ZhlCeD/5DT6lBIJ4H3G+iamGJoTln1v+QSuPw0p7Q== + version "9.1.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.1.0.tgz#262625f6b0921f7550f128a0098d05ecaad989c6" + integrity sha512-1TCBecGFQtItia2o39P7Z4BK1X7ByNPxAiWJvwiyTGcOwYnTiiASgMpNA6a+beu8cFPhEDWvPf6mIlYUJv6sgA== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.6.1" "@eslint/eslintrc" "^3.0.2" - "@eslint/js" "9.0.0" - "@humanwhocodes/config-array" "^0.12.3" + "@eslint/js" "9.1.1" + "@humanwhocodes/config-array" "^0.13.0" "@humanwhocodes/module-importer" "^1.0.1" + "@humanwhocodes/retry" "^0.2.3" "@nodelib/fs.walk" "^1.2.8" ajv "^6.12.4" chalk "^4.0.0" @@ -1139,7 +1145,6 @@ eslint@^9.0.0: file-entry-cache "^8.0.0" find-up "^5.0.0" glob-parent "^6.0.2" - graphemer "^1.4.0" ignore "^5.2.0" imurmurhash "^0.1.4" is-glob "^4.0.0" @@ -1363,11 +1368,6 @@ graceful-fs@^4.2.9: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== -graphemer@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" - integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== - has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" From 36fdf965bd820605b5e6986dcf265764b6858509 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Apr 2024 12:08:24 +0000 Subject: [PATCH 784/785] Bump eslint from 9.1.0 to 9.1.1 Bumps [eslint](https://github.com/eslint/eslint) from 9.1.0 to 9.1.1. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v9.1.0...v9.1.1) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 6ca2f41f..908dd2ce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1119,9 +1119,9 @@ eslint-visitor-keys@^4.0.0: integrity sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw== eslint@^9.0.0: - version "9.1.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.1.0.tgz#262625f6b0921f7550f128a0098d05ecaad989c6" - integrity sha512-1TCBecGFQtItia2o39P7Z4BK1X7ByNPxAiWJvwiyTGcOwYnTiiASgMpNA6a+beu8cFPhEDWvPf6mIlYUJv6sgA== + version "9.1.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.1.1.tgz#39ec657ccd12813cb4a1dab2f9229dcc6e468271" + integrity sha512-b4cRQ0BeZcSEzPpY2PjFY70VbO32K7BStTGtBsnIGdTSEEQzBi8hPBcGQmTG2zUvFr9uLe0TK42bw8YszuHEqg== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.6.1" From 91d6bd92b79fc1cbbb7794f77837254bd8b35a32 Mon Sep 17 00:00:00 2001 From: fisker Date: Fri, 7 Mar 2025 02:00:18 +0800 Subject: [PATCH 785/785] Fix ESLint config --- .eslintignore | 1 - eslint.config.js | 21 ++++ package.json | 33 ++--- yarn.lock | 320 ++++++++++++++++++++++++++--------------------- 4 files changed, 208 insertions(+), 167 deletions(-) delete mode 100644 .eslintignore create mode 100644 eslint.config.js diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 7053dc17..00000000 --- a/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -/coverage/ diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 00000000..5f507d16 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,21 @@ +import eslintJs from "@eslint/js"; +import eslintConfigPrettier from "eslint-config-prettier"; +import globals from "globals"; + +export default [ + eslintJs.configs.recommended, + eslintConfigPrettier, + { + languageOptions: { + globals: { + ...globals.builtin, + ...globals.jest, + ...globals.node + } + }, + rules: { + "no-unused-vars": "off" + } + }, + { ignores: ["coverage"] } +]; diff --git a/package.json b/package.json index aa7ea32a..69dea870 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "type": "module", "main": "src/plugin.js", "scripts": { - "checkFormat": "prettier --check '**/*'", + "checkFormat": "prettier . --check", "lint": "eslint --cache .", "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js" }, @@ -23,29 +23,14 @@ "prettier": "^3.0.0" }, "devDependencies": { - "eslint": "^9.0.0", - "eslint-config-prettier": "^9.0.0", - "husky": "^9.0.2", - "jest": "^29.5.0", - "prettier": "^3.1.0", - "pretty-quick": "^4.0.0" - }, - "eslintConfig": { - "extends": [ - "eslint:recommended", - "prettier" - ], - "env": { - "jest": true, - "node": true - }, - "parserOptions": { - "ecmaVersion": 2020, - "sourceType": "module" - }, - "rules": { - "no-undef": "off" - } + "@eslint/js": "^9.21.0", + "eslint": "^9.21.0", + "eslint-config-prettier": "^10.0.2", + "globals": "^16.0.0", + "husky": "^9.1.7", + "jest": "^29.7.0", + "prettier": "^3.5.3", + "pretty-quick": "^4.1.1" }, "jest": { "globalSetup": "./test/js/globalSetup.js", diff --git a/yarn.lock b/yarn.lock index 908dd2ce..dd883b5b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -309,15 +309,31 @@ dependencies: eslint-visitor-keys "^3.3.0" -"@eslint-community/regexpp@^4.6.1": - version "4.10.0" - resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.0.tgz#548f6de556857c8bb73bbee70c35dc82a2e74d63" - integrity sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA== +"@eslint-community/regexpp@^4.12.1": + version "4.12.1" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.12.1.tgz#cfc6cffe39df390a3841cde2abccf92eaa7ae0e0" + integrity sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ== -"@eslint/eslintrc@^3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-3.0.2.tgz#36180f8e85bf34d2fe3ccc2261e8e204a411ab4e" - integrity sha512-wV19ZEGEMAC1eHgrS7UQPqsdEiCIbTKTasEfcXAigzoXICcqZSjBZEHlZwNVvKg6UBCjSlos84XiLqsRJnIcIg== +"@eslint/config-array@^0.19.2": + version "0.19.2" + resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.19.2.tgz#3060b809e111abfc97adb0bb1172778b90cb46aa" + integrity sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w== + dependencies: + "@eslint/object-schema" "^2.1.6" + debug "^4.3.1" + minimatch "^3.1.2" + +"@eslint/core@^0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@eslint/core/-/core-0.12.0.tgz#5f960c3d57728be9f6c65bd84aa6aa613078798e" + integrity sha512-cmrR6pytBuSMTaBweKoGMwu3EiHiEC+DoyupPmlZ0HxBJBtIxwe+j/E4XPIKNx+Q74c8lXKPwYawBf5glsTkHg== + dependencies: + "@types/json-schema" "^7.0.15" + +"@eslint/eslintrc@^3.3.0": + version "3.3.0" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-3.3.0.tgz#96a558f45842989cca7ea1ecd785ad5491193846" + integrity sha512-yaVPAiNAalnCZedKLdR21GOGILMLKPyqSLWaAjQFvYA2i/ciDi8ArYVr69Anohb6cH2Ukhqti4aFnYyPm8wdwQ== dependencies: ajv "^6.12.4" debug "^4.3.2" @@ -329,34 +345,51 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@9.1.1": - version "9.1.1" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.1.1.tgz#eb0f82461d12779bbafc1b5045cde3143d350a8a" - integrity sha512-5WoDz3Y19Bg2BnErkZTp0en+c/i9PvgFS7MBe1+m60HjFr0hrphlAGp4yzI7pxpt4xShln4ZyYp4neJm8hmOkQ== +"@eslint/js@9.21.0", "@eslint/js@^9.21.0": + version "9.21.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.21.0.tgz#4303ef4e07226d87c395b8fad5278763e9c15c08" + integrity sha512-BqStZ3HX8Yz6LvsF5ByXYrtigrV5AXADWLAGc7PH/1SxOb7/FIYYMszZZWiUou/GB9P2lXWk2SV4d+Z8h0nknw== -"@humanwhocodes/config-array@^0.13.0": - version "0.13.0" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.13.0.tgz#fb907624df3256d04b9aa2df50d7aa97ec648748" - integrity sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw== +"@eslint/object-schema@^2.1.6": + version "2.1.6" + resolved "https://registry.yarnpkg.com/@eslint/object-schema/-/object-schema-2.1.6.tgz#58369ab5b5b3ca117880c0f6c0b0f32f6950f24f" + integrity sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA== + +"@eslint/plugin-kit@^0.2.7": + version "0.2.7" + resolved "https://registry.yarnpkg.com/@eslint/plugin-kit/-/plugin-kit-0.2.7.tgz#9901d52c136fb8f375906a73dcc382646c3b6a27" + integrity sha512-JubJ5B2pJ4k4yGxaNLdbjrnk9d/iDz6/q8wOilpIowd6PJPgaxCuHBnBszq7Ce2TyMrywm5r4PnKm6V3iiZF+g== dependencies: - "@humanwhocodes/object-schema" "^2.0.3" - debug "^4.3.1" - minimatch "^3.0.5" + "@eslint/core" "^0.12.0" + levn "^0.4.1" + +"@humanfs/core@^0.19.1": + version "0.19.1" + resolved "https://registry.yarnpkg.com/@humanfs/core/-/core-0.19.1.tgz#17c55ca7d426733fe3c561906b8173c336b40a77" + integrity sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA== + +"@humanfs/node@^0.16.6": + version "0.16.6" + resolved "https://registry.yarnpkg.com/@humanfs/node/-/node-0.16.6.tgz#ee2a10eaabd1131987bf0488fd9b820174cd765e" + integrity sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw== + dependencies: + "@humanfs/core" "^0.19.1" + "@humanwhocodes/retry" "^0.3.0" "@humanwhocodes/module-importer@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== -"@humanwhocodes/object-schema@^2.0.3": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz#4a2868d75d6d6963e423bcf90b7fd1be343409d3" - integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA== +"@humanwhocodes/retry@^0.3.0": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.3.1.tgz#c72a5c76a9fbaf3488e231b13dc52c0da7bab42a" + integrity sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA== -"@humanwhocodes/retry@^0.2.3": - version "0.2.3" - resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.2.3.tgz#c9aa036d1afa643f1250e83150f39efb3a15a631" - integrity sha512-X38nUbachlb01YMlvPFojKoiXq+LzZvuSce70KPMPdeM1Rj03k4dR7lDslhbqXn3Ang4EU3+EAmwEAsbrjHW3g== +"@humanwhocodes/retry@^0.4.2": + version "0.4.2" + resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.4.2.tgz#1860473de7dfa1546767448f333db80cb0ff2161" + integrity sha512-xeO57FpIu4p1Ri3Jq/EXq4ClRm86dVF2z/+kvFnyqVYRavTZmaFaUBbWCOuuTh0o/g7DSsk6kc2vrS4Vl5oPOQ== "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" @@ -598,27 +631,6 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" -"@nodelib/fs.scandir@2.1.5": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" - integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== - dependencies: - "@nodelib/fs.stat" "2.0.5" - run-parallel "^1.1.9" - -"@nodelib/fs.stat@2.0.5": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" - integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== - -"@nodelib/fs.walk@^1.2.8": - version "1.2.8" - resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" - integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== - dependencies: - "@nodelib/fs.scandir" "2.1.5" - fastq "^1.6.0" - "@sinclair/typebox@^0.27.8": version "0.27.8" resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" @@ -671,6 +683,11 @@ dependencies: "@babel/types" "^7.20.7" +"@types/estree@^1.0.6": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50" + integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw== + "@types/graceful-fs@^4.1.3": version "4.1.9" resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.9.tgz#2a06bc0f68a20ab37b3e36aa238be6abdf49e8b4" @@ -697,6 +714,11 @@ dependencies: "@types/istanbul-lib-report" "*" +"@types/json-schema@^7.0.15": + version "7.0.15" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" + integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== + "@types/node@*": version "20.9.2" resolved "https://registry.yarnpkg.com/@types/node/-/node-20.9.2.tgz#002815c8e87fe0c9369121c78b52e800fadc0ac6" @@ -731,6 +753,11 @@ acorn@^8.11.3: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== +acorn@^8.14.0: + version "8.14.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.1.tgz#721d5dc10f7d5b5609a891773d47731796935dfb" + integrity sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg== + ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" @@ -1012,7 +1039,7 @@ create-jest@^29.7.0: jest-util "^29.7.0" prompts "^2.0.1" -cross-spawn@^7.0.2, cross-spawn@^7.0.3: +cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -1021,6 +1048,15 @@ cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" +cross-spawn@^7.0.6: + version "7.0.6" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" + integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" @@ -1095,15 +1131,15 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -eslint-config-prettier@^9.0.0: - version "9.1.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz#31af3d94578645966c082fcb71a5846d3c94867f" - integrity sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw== +eslint-config-prettier@^10.0.2: + version "10.0.2" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-10.0.2.tgz#47444de8aa104ce82c2f91ad2a5e96b62c01e20d" + integrity sha512-1105/17ZIMjmCOJOPNfVdbXafLCLj3hPmkmB7dLgt7XsQ/zkxSuDerE/xgO3RxoHysR1N1whmquY0lSn2O0VLg== -eslint-scope@^8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.0.1.tgz#a9601e4b81a0b9171657c343fb13111688963cfc" - integrity sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og== +eslint-scope@^8.2.0: + version "8.2.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.2.0.tgz#377aa6f1cb5dc7592cfd0b7f892fd0cf352ce442" + integrity sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A== dependencies: esrecurse "^4.3.0" estraverse "^5.2.0" @@ -1118,28 +1154,37 @@ eslint-visitor-keys@^4.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz#e3adc021aa038a2a8e0b2f8b0ce8f66b9483b1fb" integrity sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw== -eslint@^9.0.0: - version "9.1.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.1.1.tgz#39ec657ccd12813cb4a1dab2f9229dcc6e468271" - integrity sha512-b4cRQ0BeZcSEzPpY2PjFY70VbO32K7BStTGtBsnIGdTSEEQzBi8hPBcGQmTG2zUvFr9uLe0TK42bw8YszuHEqg== +eslint-visitor-keys@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz#687bacb2af884fcdda8a6e7d65c606f46a14cd45" + integrity sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw== + +eslint@^9.21.0: + version "9.21.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.21.0.tgz#b1c9c16f5153ff219791f627b94ab8f11f811591" + integrity sha512-KjeihdFqTPhOMXTt7StsDxriV4n66ueuF/jfPNC3j/lduHwr/ijDwJMsF+wyMJethgiKi5wniIE243vi07d3pg== dependencies: "@eslint-community/eslint-utils" "^4.2.0" - "@eslint-community/regexpp" "^4.6.1" - "@eslint/eslintrc" "^3.0.2" - "@eslint/js" "9.1.1" - "@humanwhocodes/config-array" "^0.13.0" + "@eslint-community/regexpp" "^4.12.1" + "@eslint/config-array" "^0.19.2" + "@eslint/core" "^0.12.0" + "@eslint/eslintrc" "^3.3.0" + "@eslint/js" "9.21.0" + "@eslint/plugin-kit" "^0.2.7" + "@humanfs/node" "^0.16.6" "@humanwhocodes/module-importer" "^1.0.1" - "@humanwhocodes/retry" "^0.2.3" - "@nodelib/fs.walk" "^1.2.8" + "@humanwhocodes/retry" "^0.4.2" + "@types/estree" "^1.0.6" + "@types/json-schema" "^7.0.15" ajv "^6.12.4" chalk "^4.0.0" - cross-spawn "^7.0.2" + cross-spawn "^7.0.6" debug "^4.3.2" escape-string-regexp "^4.0.0" - eslint-scope "^8.0.1" - eslint-visitor-keys "^4.0.0" - espree "^10.0.1" - esquery "^1.4.2" + eslint-scope "^8.2.0" + eslint-visitor-keys "^4.2.0" + espree "^10.3.0" + esquery "^1.5.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" file-entry-cache "^8.0.0" @@ -1148,15 +1193,11 @@ eslint@^9.0.0: ignore "^5.2.0" imurmurhash "^0.1.4" is-glob "^4.0.0" - is-path-inside "^3.0.3" json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.4.1" lodash.merge "^4.6.2" minimatch "^3.1.2" natural-compare "^1.4.0" optionator "^0.9.3" - strip-ansi "^6.0.1" - text-table "^0.2.0" espree@^10.0.1: version "10.0.1" @@ -1167,15 +1208,24 @@ espree@^10.0.1: acorn-jsx "^5.3.2" eslint-visitor-keys "^4.0.0" +espree@^10.3.0: + version "10.3.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-10.3.0.tgz#29267cf5b0cb98735b65e64ba07e0ed49d1eed8a" + integrity sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg== + dependencies: + acorn "^8.14.0" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^4.2.0" + esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -esquery@^1.4.2: - version "1.5.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b" - integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg== +esquery@^1.5.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.6.0.tgz#91419234f804d852a82dceec3e16cdc22cf9dae7" + integrity sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg== dependencies: estraverse "^5.1.0" @@ -1196,7 +1246,7 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== -execa@^5.0.0, execa@^5.1.1: +execa@^5.0.0: version "5.1.1" resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== @@ -1242,13 +1292,6 @@ fast-levenshtein@^2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== -fastq@^1.6.0: - version "1.15.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.15.0.tgz#d04d07c6a2a68fe4599fea8d2e103a937fae6b3a" - integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw== - dependencies: - reusify "^1.0.4" - fb-watchman@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.2.tgz#e9524ee6b5c77e9e5001af0f85f3adbb8623255c" @@ -1363,6 +1406,11 @@ globals@^14.0.0: resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e" integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ== +globals@^16.0.0: + version "16.0.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-16.0.0.tgz#3d7684652c5c4fbd086ec82f9448214da49382d8" + integrity sha512-iInW14XItCXET01CQFqudPOWP2jYMl7T+QRQT+UNcR/iQncN/F0UNpgd76iFkBPgNQb4+X3LV9tLJYzwh+Gl3A== + graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" @@ -1395,16 +1443,21 @@ human-signals@^2.1.0: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== -husky@^9.0.2: - version "9.0.11" - resolved "https://registry.yarnpkg.com/husky/-/husky-9.0.11.tgz#fc91df4c756050de41b3e478b2158b87c1e79af9" - integrity sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw== +husky@^9.1.7: + version "9.1.7" + resolved "https://registry.yarnpkg.com/husky/-/husky-9.1.7.tgz#d46a38035d101b46a70456a850ff4201344c0b2d" + integrity sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA== -ignore@^5.2.0, ignore@^5.3.0: +ignore@^5.2.0: version "5.3.0" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.0.tgz#67418ae40d34d6999c95ff56016759c718c82f78" integrity sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg== +ignore@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-7.0.3.tgz#397ef9315dfe0595671eefe8b633fec6943ab733" + integrity sha512-bAH5jbK/F3T3Jls4I0SO1hmPR0dKU0a7+SY6n1yzRtG54FLO8d6w/nxLFX2Nb7dBu6cCWXPaAME6cYqFUMmuCA== + import-fresh@^3.2.1: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" @@ -1478,11 +1531,6 @@ is-number@^7.0.0: resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== -is-path-inside@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" - integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== - is-stream@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" @@ -1894,7 +1942,7 @@ jest-worker@^29.7.0: merge-stream "^2.0.0" supports-color "^8.0.0" -jest@^29.5.0: +jest@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/jest/-/jest-29.7.0.tgz#994676fc24177f088f1c5e3737f5697204ff2613" integrity sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw== @@ -2049,7 +2097,7 @@ mimic-fn@^2.1.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== -minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: +minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -2194,15 +2242,20 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== +picocolors@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== + picomatch@^2.0.4, picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== -picomatch@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-3.0.1.tgz#817033161def55ec9638567a2f3bbc876b3e7516" - integrity sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag== +picomatch@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.2.tgz#77c742931e8f3b8820946c76cd0c1f13730d1dab" + integrity sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg== pirates@^4.0.4: version "4.0.6" @@ -2221,10 +2274,10 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prettier@^3.1.0: - version "3.2.5" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.5.tgz#e52bc3090586e824964a8813b09aba6233b28368" - integrity sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A== +prettier@^3.5.3: + version "3.5.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.5.3.tgz#4fc2ce0d657e7a02e602549f053b239cb7dfe1b5" + integrity sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw== pretty-format@^29.7.0: version "29.7.0" @@ -2235,18 +2288,18 @@ pretty-format@^29.7.0: ansi-styles "^5.0.0" react-is "^18.0.0" -pretty-quick@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/pretty-quick/-/pretty-quick-4.0.0.tgz#ea5cce85a5804bfbec7327b0e064509155d03f39" - integrity sha512-M+2MmeufXb/M7Xw3Afh1gxcYpj+sK0AxEfnfF958ktFeAyi5MsKY5brymVURQLgPLV1QaF5P4pb2oFJ54H3yzQ== +pretty-quick@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/pretty-quick/-/pretty-quick-4.1.1.tgz#8a0c883e4beeb0eddbe7eda50d7b1251d4f72968" + integrity sha512-9Ud0l/CspNTmyIdYac9X7Inb3o8fuUsw+1zJFvCGn+at0t1UwUcUdo2RSZ41gcmfLv1fxgWQxWEfItR7CBwugg== dependencies: - execa "^5.1.1" find-up "^5.0.0" - ignore "^5.3.0" + ignore "^7.0.3" mri "^1.2.0" - picocolors "^1.0.0" - picomatch "^3.0.1" - tslib "^2.6.2" + picocolors "^1.1.1" + picomatch "^4.0.2" + tinyexec "^0.3.2" + tslib "^2.8.1" prompts@^2.0.1: version "2.4.2" @@ -2266,11 +2319,6 @@ pure-rand@^6.0.0: resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.0.4.tgz#50b737f6a925468679bff00ad20eade53f37d5c7" integrity sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA== -queue-microtask@^1.2.2: - version "1.2.3" - resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" - integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== - react-is@^18.0.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" @@ -2312,18 +2360,6 @@ resolve@^1.20.0: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" -reusify@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" - integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== - -run-parallel@^1.1.9: - version "1.2.0" - resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" - integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== - dependencies: - queue-microtask "^1.2.2" - semver@^6.3.0, semver@^6.3.1: version "6.3.1" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" @@ -2462,10 +2498,10 @@ test-exclude@^6.0.0: glob "^7.1.4" minimatch "^3.0.4" -text-table@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== +tinyexec@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/tinyexec/-/tinyexec-0.3.2.tgz#941794e657a85e496577995c6eef66f53f42b3d2" + integrity sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA== tmpl@1.0.5: version "1.0.5" @@ -2484,10 +2520,10 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -tslib@^2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" - integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== +tslib@^2.8.1: + version "2.8.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" + integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== type-check@^0.4.0, type-check@~0.4.0: version "0.4.0"